Resend Ticket Email

- Added routes
 - Changed Attendees.blade to add a button group instead of just the
message button. Added message button to button group
This commit is contained in:
brettninja 2016-03-10 23:25:15 -05:00
parent db91c48e7f
commit 461c6132b2
7 changed files with 126 additions and 41 deletions

View File

@ -526,4 +526,45 @@ class EventAttendeesController extends MyBaseController
'redirectUrl' => '', 'redirectUrl' => '',
]); ]);
} }
/**
* Show the 'Message Attendee' modal
*
* @param Request $request
* @param $attendee_id
* @return View
*/
public function showResendTicketToAttendee(Request $request, $attendee_id)
{
$attendee = Attendee::scope()->findOrFail($attendee_id);
$data = [
'attendee' => $attendee,
'event' => $attendee->event,
'modal_id' => $request->get('modal_id'),
];
return view('ManageEvent.Modals.ResendTicketToAttendee', $data);
}
/**
* Send a message to an attendee
*
* @param Request $request
* @param $attendee_id
* @return mixed
*/
public function postResendTicketToAttendee(Request $request, $attendee_id)
{
$attendee = Attendee::scope()->findOrFail($attendee_id);
$order = $attendee->order;
$this->dispatch(new OrderTicketsCommand($order, false));
return response()->json([
'status' => 'success',
'message' => 'Ticket Successfully Resent',
]);
}
} }

View File

@ -422,6 +422,16 @@ Route::group(['middleware' => ['auth', 'first.run']], function () {
'uses' => 'EventAttendeesController@postMessageAttendee', 'uses' => 'EventAttendeesController@postMessageAttendee',
]); ]);
Route::get('{event_id}/attendees/resend_ticket', [
'as' => 'showResendTicketToAttendee',
'uses' => 'EventAttendeesController@showResendTicketToAttendee',
]);
Route::post('{event_id}/attendees/resend_ticket', [
'as' => 'postResendTicketToAttendee',
'uses' => 'EventAttendeesController@postResendTicketToAttendee',
]);
Route::get('{event_id}/attendees/create', [ Route::get('{event_id}/attendees/create', [
'as' => 'showCreateAttendee', 'as' => 'showCreateAttendee',
'uses' => 'EventAttendeesController@showCreateAttendee', 'uses' => 'EventAttendeesController@showCreateAttendee',

View File

@ -43,7 +43,7 @@ class Attendee extends MyBaseModel
public function order() public function order()
{ {
return$this->belongsTo('\App\Models\Order'); return $this->belongsTo('\App\Models\Order');
} }
public function ticket() public function ticket()

2
public/user_content/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*
!.gitignore

View File

@ -68,12 +68,10 @@ Attendees
<div class="col-md-12"> <div class="col-md-12">
@if($attendees->count()) @if($attendees->count())
<div class="panel"> <div class="panel">
<div class="table-responsive"> <div class="table-responsive">
<table class="table " > <table class="table " >
<thead> <thead>
<tr> <tr>
<!-- <th width="5%"></th>-->
<th> <th>
{!!Html::sortable_link('Name', $sort_by, 'first_name', $sort_order, ['q' => $q , 'page' => $attendees->currentPage()])!!} {!!Html::sortable_link('Name', $sort_by, 'first_name', $sort_order, ['q' => $q , 'page' => $attendees->currentPage()])!!}
</th> </th>
@ -94,43 +92,51 @@ Attendees
<tr class="attendee_{{$attendee->id}} {{$attendee->is_cancelled ? 'danger' : ''}}"> <tr class="attendee_{{$attendee->id}} {{$attendee->is_cancelled ? 'danger' : ''}}">
<td>{{{$attendee->full_name}}}</td> <td>{{{$attendee->full_name}}}</td>
<td> <td>
<a <a data-modal-id="MessageAttendee" href="javascript:void(0);" class="loadModal"
data-modal-id='MessageAttendee'
href='javascript:void(0);'
data-href="{{route('showMessageAttendee', ['attendee_id'=>$attendee->id])}}" data-href="{{route('showMessageAttendee', ['attendee_id'=>$attendee->id])}}"
class='loadModal '
> {{$attendee->email}}</a> > {{$attendee->email}}</a>
</td> </td>
<td> <td>
{{{$attendee->ticket->title}}} {{{$attendee->ticket->title}}}
</td> </td>
<td> <td>
<a href='javascript:void(0);' data-modal-id='view-order-{{ $attendee->order->id }}' data-href="{{route('showManageOrder', ['order_id'=>$attendee->order->id])}}" title="View Order #{{$attendee->order->order_reference}}" class="loadModal"> <a href="javascript:void(0);" data-modal-id="view-order-{{ $attendee->order->id }}" data-href="{{route('showManageOrder', ['order_id'=>$attendee->order->id])}}" title="View Order #{{$attendee->order->order_reference}}" class="loadModal">
#{{$attendee->order->order_reference}} #{{$attendee->order->order_reference}}
</a> </a>
</td> </td>
<td class="text-center"> <td class="text-center">
<div class="btn-group">
<button type="button" class="btn btn-xs btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Action <span class="caret"></span></button>
<ul class="dropdown-menu">
@if($attendee->email) @if($attendee->email)
<a <li><a
data-modal-id='MessageAttendee' data-modal-id="MessageAttendee"
href='javascript:void(0);' href="javascript:void(0);"
data-href="{{route('showMessageAttendee', ['attendee_id'=>$attendee->id])}}" data-href="{{route('showMessageAttendee', ['attendee_id'=>$attendee->id])}}"
class='loadModal btn btn-xs btn-primary' class="loadModal"
> Message</a> > Message</a></li>
@endif @endif
<li><a
data-modal-id="ResendTicketToAttendee"
href="javascript:void(0);"
data-href="{{route('showResendTicketToAttendee', ['attendee_id'=>$attendee->id])}}"
class="loadModal"
> Resend Ticket</a></li>
</ul>
</div>
<a <a
data-modal-id='EditAttendee' data-modal-id="EditAttendee"
href='javascript:void(0);' href="javascript:void(0);"
data-href="{{route('showEditAttendee', ['event_id'=>$event->id, 'attendee_id'=>$attendee->id])}}" data-href="{{route('showEditAttendee', ['event_id'=>$event->id, 'attendee_id'=>$attendee->id])}}"
class='loadModal btn btn-xs btn-primary' class="loadModal btn btn-xs btn-primary"
> Edit</a> > Edit</a>
<a <a
data-modal-id='CancelAttendee' data-modal-id="CancelAttendee"
href='javascript:void(0);' href="javascript:void(0);"
data-href="{{route('showCancelAttendee', ['event_id'=>$event->id, 'attendee_id'=>$attendee->id])}}" data-href="{{route('showCancelAttendee', ['event_id'=>$event->id, 'attendee_id'=>$attendee->id])}}"
class='loadModal btn btn-xs btn-danger' class="loadModal btn btn-xs btn-danger"
> Cancel</a> > Cancel</a>
</td> </td>
</tr> </tr>

View File

@ -0,0 +1,24 @@
<div role="dialog" id="{{$modal_id}}" class="modal fade" style="display: none;">
{!! Form::open(array('url' => route('postResendTicketToAttendee', array('attendee_id' => $attendee->id)), 'class' => 'ajax reset closeModalAfter')) !!}
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header text-center">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h3 class="modal-title">
<i class="ico-envelope"></i>
Resend Ticket to {{{$attendee->full_name}}}
</h3>
</div>
<div class="modal-body">
<div class="help-block">
The attendee will be sent another copy of their ticket to <b>{{$attendee->event->organiser->email}}</b>
</div>
</div> <!-- /end modal body-->
<div class="modal-footer">
{!! Form::button('Cancel', ['class'=>"btn modal-close btn-danger",'data-dismiss'=>'modal']) !!}
{!! Form::submit('Send Ticket', ['class'=>"btn btn-success"]) !!}
</div>
</div><!-- /end modal content-->
{!! Form::close() !!}
</div>
</div>

2
storage/cache/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*
!.gitignore