more features
This commit is contained in:
@@ -15,6 +15,7 @@ class HelpDeskController extends Controller
|
||||
* Display form to submit a new ticket
|
||||
*/
|
||||
public function displayNewTicket() {
|
||||
//Return the view form to create a new ticket
|
||||
return view('helpdesk.newticket');
|
||||
}
|
||||
|
||||
@@ -26,7 +27,7 @@ class HelpDeskController extends Controller
|
||||
$ticket->subject = $request->subject;
|
||||
$ticket->body = $request->body;
|
||||
$ticket->save();
|
||||
|
||||
//Return the message the ticket has been submitted, and the main dashboard
|
||||
return redirect('/dashboard')->with('success', 'Ticket submitted.');
|
||||
}
|
||||
|
||||
@@ -34,13 +35,25 @@ class HelpDeskController extends Controller
|
||||
* Display current open tickets for the user
|
||||
*/
|
||||
public function displayMyTickets() {
|
||||
//Get the active tickets from the database
|
||||
$tickets = HelpDeskTicket::where(['user_id' => auth()->user()->character_id, 'active' => 1])->get();
|
||||
|
||||
//Return the view with the tickets variable
|
||||
return view('helpdesk.mytickets')->with('tickets', $tickets);
|
||||
}
|
||||
|
||||
/**
|
||||
* Modify currently open ticket for the user
|
||||
*/
|
||||
public function editTicket(Request $request) {
|
||||
//Update the ticket
|
||||
HelpDeskTicket::where(['user_id' => auth()->user()->character_id, 'active' => 1])
|
||||
->update([
|
||||
'department' => $request->department,
|
||||
'subject' => $request->subject,
|
||||
'body' => $request->body,
|
||||
]);
|
||||
|
||||
return redirect('/dashboard')->with('success', 'Ticket modified.');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,6 +70,7 @@ class StructureController extends Controller
|
||||
|
||||
//Declare the structure tax helper class
|
||||
$sHelper = new StructureTaxHelper();
|
||||
|
||||
//Get the dates we are working with
|
||||
$dates = $sHelper->GetTimeFrame();
|
||||
|
||||
|
||||
@@ -27,5 +27,10 @@ class HelpDeskTicket extends Model
|
||||
'department',
|
||||
'subject',
|
||||
'body',
|
||||
'active',
|
||||
];
|
||||
|
||||
public function response() {
|
||||
return $this->hasMany('App\Models\HelpDesk\HelpDeskTicketResponse', 'ticket_id');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,10 +17,11 @@ class CreateHelpDeskTicketsTable extends Migration
|
||||
Schema::create('help_desk_tickets', function(Blueprint $table) {
|
||||
$table->increments('ticket_id');
|
||||
$table->string('user_id');
|
||||
$table->string('assigned_id');
|
||||
$table->string('assigned_id')->default(0);
|
||||
$table->string('department');
|
||||
$table->string('subject');
|
||||
$table->text('body');
|
||||
$table->boolean('active');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user