Applied fixes from StyleCI
This commit is contained in:

committed by
StyleCI Bot

parent
be5df5334f
commit
d637c2b23f
@@ -3,70 +3,60 @@
|
||||
namespace App\Http\Controllers\Client\helpdesk;
|
||||
|
||||
// controllers
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Controllers\Agent\helpdesk\TicketController;
|
||||
use App\Http\Controllers\Common\SettingsController;
|
||||
use App\Http\Controllers\Controller;
|
||||
// requests
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Requests\helpdesk\CreateTicketRequest;
|
||||
use App\Http\Requests\helpdesk\TicketRequest;
|
||||
use App\Http\Requests\helpdesk\TicketEditRequest;
|
||||
// models
|
||||
use App\Model\helpdesk\Email\Banlist;
|
||||
use App\Model\helpdesk\Ticket\Tickets;
|
||||
use App\Model\helpdesk\Ticket\Ticket_attachments;
|
||||
use App\Model\helpdesk\Ticket\Ticket_Collaborator;
|
||||
use App\Model\helpdesk\Ticket\Ticket_Thread;
|
||||
use App\Model\helpdesk\Settings\Company;
|
||||
use App\Model\helpdesk\Settings\System;
|
||||
use App\Model\helpdesk\Settings\Alert;
|
||||
use App\Model\helpdesk\Ticket\Ticket_Status;
|
||||
use App\Model\helpdesk\Email\Emails;
|
||||
use App\Model\helpdesk\Agent\Department;
|
||||
// models
|
||||
use App\Model\helpdesk\Ticket\Tickets;
|
||||
use App\User;
|
||||
// classes
|
||||
use Auth;
|
||||
use Hash;
|
||||
use Input;
|
||||
use Mail;
|
||||
use PDF;
|
||||
// classes
|
||||
use Exception;
|
||||
use Illuminate\Http\Request;
|
||||
use Input;
|
||||
|
||||
/**
|
||||
* TicketController2
|
||||
* TicketController2.
|
||||
*
|
||||
* @package Controllers
|
||||
* @subpackage Controller
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class ClientTicketController extends Controller {
|
||||
|
||||
class ClientTicketController extends Controller
|
||||
{
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return type response
|
||||
*/
|
||||
public function __construct() {
|
||||
public function __construct()
|
||||
{
|
||||
SettingsController::smtp();
|
||||
// $this->middleware('auth');
|
||||
// $this->middleware('role.user');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Checked ticket
|
||||
* Get Checked ticket.
|
||||
*
|
||||
* @param type Tickets $ticket
|
||||
* @param type User $user
|
||||
* @param type User $user
|
||||
*
|
||||
* @return type response
|
||||
*/
|
||||
public function getCheckTicket(Tickets $ticket, User $user) {
|
||||
public function getCheckTicket(Tickets $ticket, User $user)
|
||||
{
|
||||
return view('themes.default1.client.helpdesk.guest-user.newticket', compact('ticket'));
|
||||
}
|
||||
|
||||
/**
|
||||
* reply
|
||||
* @param type $value
|
||||
* reply.
|
||||
*
|
||||
* @param type $value
|
||||
*
|
||||
* @return type view
|
||||
*/
|
||||
public function reply($id, Request $request) {
|
||||
public function reply($id, Request $request)
|
||||
{
|
||||
$comment = $request->input('comment');
|
||||
if ($comment != null) {
|
||||
$tickets = Tickets::where('id', '=', $id)->first();
|
||||
@@ -74,14 +64,15 @@ class ClientTicketController extends Controller {
|
||||
$tickets->closed = 0;
|
||||
$tickets->reopened_at = date('Y-m-d H:i:s');
|
||||
$tickets->reopened = 1;
|
||||
$threads = new Ticket_Thread;
|
||||
$threads = new Ticket_Thread();
|
||||
$threads->user_id = Auth::user()->id;
|
||||
$threads->ticket_id = $tickets->id;
|
||||
$threads->poster = "client";
|
||||
$threads->poster = 'client';
|
||||
$threads->body = $comment;
|
||||
try {
|
||||
$threads->save();
|
||||
$tickets->save();
|
||||
|
||||
return \Redirect::back()->with('success1', 'Successfully replied');
|
||||
} catch (Exception $e) {
|
||||
return \Redirect::back()->with('fails1', $e->errorInfo[2]);
|
||||
@@ -90,5 +81,4 @@ class ClientTicketController extends Controller {
|
||||
return \Redirect::back()->with('fails1', 'Please fill some data!');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -7,45 +7,47 @@ use App\Http\Controllers\Controller;
|
||||
// models
|
||||
use App\Model\helpdesk\Email\Emails;
|
||||
// classes
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
* EmailController
|
||||
* EmailController.
|
||||
*
|
||||
* @package Controllers
|
||||
* @subpackage Controller
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class OuthouseController extends Controller {
|
||||
|
||||
class EmailController extends Controller
|
||||
{
|
||||
/**
|
||||
* post port
|
||||
* post port.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function port() {
|
||||
public static function port()
|
||||
{
|
||||
$port = Emails::where('id', '=', '1')->first();
|
||||
$portvalue = $port->option_value;
|
||||
|
||||
return $portvalue;
|
||||
}
|
||||
|
||||
/**
|
||||
* post host
|
||||
* post host.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function host() {
|
||||
public static function host()
|
||||
{
|
||||
$host = Option::where('option_name', '=', 'host')->first();
|
||||
$hostvalue = $host->option_value;
|
||||
|
||||
return $hostvalue;
|
||||
}
|
||||
|
||||
/**
|
||||
* post username
|
||||
* post username.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function username() {
|
||||
public static function username()
|
||||
{
|
||||
$username = Option::where('option_name', '=', 'username')->first();
|
||||
$uservalue = $username->option_value;
|
||||
|
||||
@@ -53,11 +55,12 @@ class OuthouseController extends Controller {
|
||||
}
|
||||
|
||||
/**
|
||||
* post passowrd
|
||||
* post passowrd.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function password() {
|
||||
public static function password()
|
||||
{
|
||||
$password = Option::where('option_name', '=', 'password')->first();
|
||||
$passvalue = $password->option_value;
|
||||
|
||||
@@ -65,15 +68,15 @@ class OuthouseController extends Controller {
|
||||
}
|
||||
|
||||
/**
|
||||
* post encryption
|
||||
* post encryption.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function encryption() {
|
||||
public static function encryption()
|
||||
{
|
||||
$encryption = Option::where('option_name', '=', 'encryption')->first();
|
||||
$encryptvalue = $encryption->option_value;
|
||||
|
||||
return $encryptvalue;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -3,51 +3,44 @@
|
||||
namespace App\Http\Controllers\Client\helpdesk;
|
||||
|
||||
// controllers
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Controllers\Agent\helpdesk\TicketController;
|
||||
use App\Http\Controllers\Common\SettingsController;
|
||||
use App\Http\Controllers\Controller;
|
||||
// requests
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Requests\helpdesk\ClientRequest;
|
||||
use App\Model\helpdesk\Agent\Department;
|
||||
// models
|
||||
use App\Model\helpdesk\Form\Forms;
|
||||
use App\Model\helpdesk\Form\Fields;
|
||||
use App\Model\helpdesk\Manage\Help_topic;
|
||||
use App\Model\helpdesk\Settings\Company;
|
||||
use App\Model\helpdesk\Ticket\Tickets;
|
||||
use App\Model\helpdesk\Ticket\Ticket_Thread;
|
||||
use App\Model\helpdesk\Settings\System;
|
||||
use App\Model\helpdesk\Settings\Ticket;
|
||||
use App\Model\helpdesk\Agent\Department;
|
||||
use App\Model\helpdesk\Ticket\Ticket_source;
|
||||
use App\Model\helpdesk\Ticket\Ticket_Thread;
|
||||
use App\Model\helpdesk\Ticket\Tickets;
|
||||
use App\User;
|
||||
use App\Model\helpdesk\Form\Fields;
|
||||
use App\Model\helpdesk\Form\Form_value;
|
||||
use Exception;
|
||||
// classes
|
||||
use Form;
|
||||
use Illuminate\Http\Request;
|
||||
use Input;
|
||||
use Mail;
|
||||
use Hash;
|
||||
use Redirect;
|
||||
use Config;
|
||||
use DateTime;
|
||||
use DateTimeZone;
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
* FormController
|
||||
* FormController.
|
||||
*
|
||||
* @package Controllers
|
||||
* @subpackage Controller
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class FormController extends Controller {
|
||||
|
||||
class FormController extends Controller
|
||||
{
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
* Constructor to check
|
||||
* Constructor to check.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(TicketController $TicketController) {
|
||||
public function __construct(TicketController $TicketController)
|
||||
{
|
||||
// mail smtp settings
|
||||
SettingsController::smtp();
|
||||
// creating a TicketController instance
|
||||
@@ -55,16 +48,20 @@ class FormController extends Controller {
|
||||
}
|
||||
|
||||
/**
|
||||
* getform
|
||||
* @param type Help_topic $topic
|
||||
* getform.
|
||||
*
|
||||
* @param type Help_topic $topic
|
||||
*
|
||||
* @return type
|
||||
*/
|
||||
public function getForm(Help_topic $topic) {
|
||||
public function getForm(Help_topic $topic)
|
||||
{
|
||||
if (\Config::get('database.install') == '%0%') {
|
||||
return \Redirect::route('license');
|
||||
}
|
||||
if (System::first()->status == 1) {
|
||||
$topics = $topic->get();
|
||||
|
||||
return view('themes.default1.client.helpdesk.form', compact('topics'));
|
||||
} else {
|
||||
return \Redirect::route('home');
|
||||
@@ -72,64 +69,68 @@ class FormController extends Controller {
|
||||
}
|
||||
|
||||
/**
|
||||
* This Function to post the form for the ticket
|
||||
* @param type Form_name $name
|
||||
* This Function to post the form for the ticket.
|
||||
*
|
||||
* @param type Form_name $name
|
||||
* @param type Form_details $details
|
||||
*
|
||||
* @return type string
|
||||
*/
|
||||
public function postForm($id, Help_topic $topic) {
|
||||
public function postForm($id, Help_topic $topic)
|
||||
{
|
||||
// dd($id);
|
||||
if ($id != 0) {
|
||||
$helptopic = $topic->where('id', '=', $id)->first();
|
||||
$custom_form = $helptopic->custom_form;
|
||||
$values = Fields::where('forms_id', '=', $custom_form)->get();
|
||||
if (!$values) {
|
||||
|
||||
} if ($values) {
|
||||
}
|
||||
if ($values) {
|
||||
foreach ($values as $value) {
|
||||
if ($value->type == "select") {
|
||||
if ($value->type == 'select') {
|
||||
$data = $value->value;
|
||||
$value = explode(',', $data);
|
||||
echo '<select class="form-control">';
|
||||
foreach ($value as $option) {
|
||||
echo '<option>' . $option . '</option>';
|
||||
echo '<option>'.$option.'</option>';
|
||||
}
|
||||
echo '</select></br>';
|
||||
} elseif ($value->type == "radio") {
|
||||
} elseif ($value->type == 'radio') {
|
||||
$type2 = $value->value;
|
||||
$val = explode(',', $type2);
|
||||
echo '<label class="radio-inline">' . $value->label . '</label>   <input type="' . $value->type . '" name="' . $value->name . '"> ' . $val[0] . '
|
||||
   <input type="' . $value->type . '" name="' . $value->name . '"> ' . $val[1] . '</br>';
|
||||
} elseif ($value->type == "textarea") {
|
||||
echo '<label class="radio-inline">'.$value->label.'</label>   <input type="'.$value->type.'" name="'.$value->name.'"> '.$val[0].'
|
||||
   <input type="'.$value->type.'" name="'.$value->name.'"> '.$val[1].'</br>';
|
||||
} elseif ($value->type == 'textarea') {
|
||||
$type3 = $value->value;
|
||||
$v = explode(',', $type3);
|
||||
//dd($v);
|
||||
if (array_key_exists(1, $v)) {
|
||||
echo '<label>' . $value->label . '</label></br><textarea class=form-control rows="' . $v[0] . '" cols="' . $v[1] . '"></textarea></br>';
|
||||
echo '<label>'.$value->label.'</label></br><textarea class=form-control rows="'.$v[0].'" cols="'.$v[1].'"></textarea></br>';
|
||||
} else {
|
||||
echo '<label>' . $value->label . '</label></br><textarea class=form-control rows="10" cols="60"></textarea></br>';
|
||||
echo '<label>'.$value->label.'</label></br><textarea class=form-control rows="10" cols="60"></textarea></br>';
|
||||
}
|
||||
} elseif ($value->type == "checkbox") {
|
||||
} elseif ($value->type == 'checkbox') {
|
||||
$type4 = $value->value;
|
||||
$check = explode(',', $type4);
|
||||
echo '<label class="radio-inline">' . $value->label . '   <input type="' . $value->type . '" name="' . $value->name . '">  ' . $check[0] . '</label><label class="radio-inline"><input type="' . $value->type . '" name="' . $value->name . '">  ' . $check[1] . '</label></br>';
|
||||
echo '<label class="radio-inline">'.$value->label.'   <input type="'.$value->type.'" name="'.$value->name.'">  '.$check[0].'</label><label class="radio-inline"><input type="'.$value->type.'" name="'.$value->name.'">  '.$check[1].'</label></br>';
|
||||
} else {
|
||||
echo '<label>' . $value->label . '</label><input type="' . $value->type . '" class="form-control" name="' . $value->name . '" /></br>';
|
||||
echo '<label>'.$value->label.'</label><input type="'.$value->type.'" class="form-control" name="'.$value->name.'" /></br>';
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return null;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Posted form
|
||||
* Posted form.
|
||||
*
|
||||
* @param type Request $request
|
||||
* @param type User $user
|
||||
* @param type User $user
|
||||
*/
|
||||
public function postedForm(User $user, ClientRequest $request, Ticket $ticket_settings, Ticket_source $ticket_source) {
|
||||
|
||||
public function postedForm(User $user, ClientRequest $request, Ticket $ticket_settings, Ticket_source $ticket_source)
|
||||
{
|
||||
$form_extras = $request->except('Name', 'Phone', 'Email', 'Subject', 'Details', 'helptopic', '_wysihtml5_mode', '_token');
|
||||
|
||||
$name = $request->input('Name');
|
||||
@@ -157,26 +158,30 @@ class FormController extends Controller {
|
||||
}
|
||||
|
||||
/**
|
||||
* reply
|
||||
* @param type $value
|
||||
* reply.
|
||||
*
|
||||
* @param type $value
|
||||
*
|
||||
* @return type view
|
||||
*/
|
||||
public function post_ticket_reply($id, Request $request) {
|
||||
public function post_ticket_reply($id, Request $request)
|
||||
{
|
||||
$comment = $request->input('comment');
|
||||
if ($comment != null) {
|
||||
$tickets = Tickets::where('id', '=', $id)->first();
|
||||
$threads = new Ticket_Thread;
|
||||
$threads = new Ticket_Thread();
|
||||
$tickets->closed_at = null;
|
||||
$tickets->closed = 0;
|
||||
$tickets->reopened_at = date('Y-m-d H:i:s');
|
||||
$tickets->reopened = 1;
|
||||
$threads->user_id = $tickets->user_id;
|
||||
$threads->ticket_id = $tickets->id;
|
||||
$threads->poster = "client";
|
||||
$threads->poster = 'client';
|
||||
$threads->body = $comment;
|
||||
try {
|
||||
$threads->save();
|
||||
$tickets->save();
|
||||
|
||||
return \Redirect::back()->with('success1', 'Successfully replied');
|
||||
} catch (Exception $e) {
|
||||
return \Redirect::back()->with('fails1', $e->errorInfo[2]);
|
||||
@@ -185,5 +190,4 @@ class FormController extends Controller {
|
||||
return \Redirect::back()->with('fails1', 'Please fill some data!');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -3,9 +3,9 @@
|
||||
namespace App\Http\Controllers\Client\helpdesk;
|
||||
|
||||
// controllers
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Controllers\Common\SettingsController;
|
||||
use App\Http\Controllers\Common\PhpMailController;
|
||||
use App\Http\Controllers\Common\SettingsController;
|
||||
use App\Http\Controllers\Controller;
|
||||
// requests
|
||||
use App\Http\Requests\helpdesk\CheckTicket;
|
||||
use App\Http\Requests\helpdesk\ProfilePassword;
|
||||
@@ -13,31 +13,31 @@ use App\Http\Requests\helpdesk\ProfileRequest;
|
||||
use App\Http\Requests\helpdesk\TicketRequest;
|
||||
// models
|
||||
use App\Model\helpdesk\Manage\Help_topic;
|
||||
use App\Model\helpdesk\Ticket\Tickets;
|
||||
use App\Model\helpdesk\Ticket\Ticket_Thread;
|
||||
use App\Model\helpdesk\Settings\Company;
|
||||
use App\Model\helpdesk\Settings\System;
|
||||
use App\Model\helpdesk\Ticket\Ticket_Thread;
|
||||
use App\Model\helpdesk\Ticket\Tickets;
|
||||
use App\User;
|
||||
// classes
|
||||
use Auth;
|
||||
use Exception;
|
||||
use Hash;
|
||||
use Input;
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
* GuestController
|
||||
* GuestController.
|
||||
*
|
||||
* @package Controllers
|
||||
* @subpackage Controller
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class GuestController extends Controller {
|
||||
|
||||
class GuestController extends Controller
|
||||
{
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return type void
|
||||
*/
|
||||
public function __construct(PhpMailController $PhpMailController) {
|
||||
public function __construct(PhpMailController $PhpMailController)
|
||||
{
|
||||
$this->PhpMailController = $PhpMailController;
|
||||
SettingsController::smtp();
|
||||
// checking authentication
|
||||
@@ -45,21 +45,27 @@ class GuestController extends Controller {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get profile
|
||||
* Get profile.
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function getProfile() {
|
||||
public function getProfile()
|
||||
{
|
||||
$user = Auth::user();
|
||||
|
||||
return view('themes.default1.client.helpdesk.profile', compact('user'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Save profile data
|
||||
* @param type $id
|
||||
* Save profile data.
|
||||
*
|
||||
* @param type $id
|
||||
* @param type ProfileRequest $request
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function postProfile(ProfileRequest $request) {
|
||||
public function postProfile(ProfileRequest $request)
|
||||
{
|
||||
$user = User::where('id', '=', Auth::user()->id)->first();
|
||||
$user->gender = $request->get('gender');
|
||||
$user->save();
|
||||
@@ -78,12 +84,13 @@ class GuestController extends Controller {
|
||||
//$extension = Input::file('profile_pic')->getClientOriginalExtension();
|
||||
$name = Input::file('profile_pic')->getClientOriginalName();
|
||||
$destinationPath = 'lb-faveo/media/profilepic';
|
||||
$fileName = rand(0000, 9999) . '.' . $name;
|
||||
$fileName = rand(0000, 9999).'.'.$name;
|
||||
//echo $fileName;
|
||||
Input::file('profile_pic')->move($destinationPath, $fileName);
|
||||
$user->profile_pic = $fileName;
|
||||
} else {
|
||||
$user->fill($request->except('profile_pic', 'gender'))->save();
|
||||
|
||||
return redirect()->back()->with('success1', 'Profile Updated sucessfully');
|
||||
}
|
||||
if ($user->fill($request->except('profile_pic'))->save()) {
|
||||
@@ -92,26 +99,34 @@ class GuestController extends Controller {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Ticket page
|
||||
* Get Ticket page.
|
||||
*
|
||||
* @param type Help_topic $topic
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function getTicket(Help_topic $topic) {
|
||||
public function getTicket(Help_topic $topic)
|
||||
{
|
||||
$topics = $topic->get();
|
||||
|
||||
return view('themes.default1.client.helpdesk.tickets.form', compact('topics'));
|
||||
}
|
||||
|
||||
/**
|
||||
* getform
|
||||
* @param type Help_topic $topic
|
||||
* getform.
|
||||
*
|
||||
* @param type Help_topic $topic
|
||||
*
|
||||
* @return type
|
||||
*/
|
||||
public function getForm(Help_topic $topic) {
|
||||
public function getForm(Help_topic $topic)
|
||||
{
|
||||
if (\Config::get('database.install') == '%0%') {
|
||||
return \Redirect::route('license');
|
||||
}
|
||||
if (System::first()->status == 1) {
|
||||
$topics = $topic->get();
|
||||
|
||||
return view('themes.default1.client.helpdesk.form', compact('topics'));
|
||||
} else {
|
||||
return \Redirect::route('home');
|
||||
@@ -119,24 +134,30 @@ class GuestController extends Controller {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get my ticket
|
||||
* @param type Tickets $tickets
|
||||
* Get my ticket.
|
||||
*
|
||||
* @param type Tickets $tickets
|
||||
* @param type Ticket_Thread $thread
|
||||
* @param type User $user
|
||||
* @param type User $user
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function getMyticket() {
|
||||
public function getMyticket()
|
||||
{
|
||||
return view('themes.default1.client.helpdesk.mytickets');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get ticket-thread
|
||||
* Get ticket-thread.
|
||||
*
|
||||
* @param type Ticket_Thread $thread
|
||||
* @param type Tickets $tickets
|
||||
* @param type User $user
|
||||
* @param type Tickets $tickets
|
||||
* @param type User $user
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function thread(Ticket_Thread $thread, Tickets $tickets, User $user) {
|
||||
public function thread(Ticket_Thread $thread, Tickets $tickets, User $user)
|
||||
{
|
||||
$user_id = Auth::user()->id;
|
||||
//dd($user_id);
|
||||
/* get the ticket's id == ticket_id of thread */
|
||||
@@ -149,26 +170,31 @@ class GuestController extends Controller {
|
||||
}
|
||||
|
||||
/**
|
||||
* ticket Edit
|
||||
* ticket Edit.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public function ticketEdit() {
|
||||
|
||||
public function ticketEdit()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Post porfile password
|
||||
* @param type $id
|
||||
* Post porfile password.
|
||||
*
|
||||
* @param type $id
|
||||
* @param type ProfilePassword $request
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function postProfilePassword(ProfilePassword $request) {
|
||||
public function postProfilePassword(ProfilePassword $request)
|
||||
{
|
||||
$user = Auth::user();
|
||||
//echo $user->password;
|
||||
if (Hash::check($request->input('old_password'), $user->getAuthPassword())) {
|
||||
$user->password = Hash::make($request->input('new_password'));
|
||||
try {
|
||||
$user->save();
|
||||
|
||||
return redirect()->back()->with('success2', 'Password Updated sucessfully');
|
||||
} catch (Exception $e) {
|
||||
return redirect()->back()->with('fails2', $e->errorInfo[2]);
|
||||
@@ -179,12 +205,15 @@ class GuestController extends Controller {
|
||||
}
|
||||
|
||||
/**
|
||||
* Ticekt reply
|
||||
* Ticekt reply.
|
||||
*
|
||||
* @param type Ticket_Thread $thread
|
||||
* @param type TicketRequest $request
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function reply(Ticket_Thread $thread, TicketRequest $request) {
|
||||
public function reply(Ticket_Thread $thread, TicketRequest $request)
|
||||
{
|
||||
$thread->ticket_id = $request->input('ticket_ID');
|
||||
$thread->title = $request->input('To');
|
||||
$thread->user_id = Auth::user()->id;
|
||||
@@ -194,29 +223,35 @@ class GuestController extends Controller {
|
||||
$ticket_id = $request->input('ticket_ID');
|
||||
$tickets = Tickets::where('id', '=', $ticket_id)->first();
|
||||
$thread = Ticket_Thread::where('ticket_id', '=', $ticket_id)->first();
|
||||
return Redirect("thread/" . $ticket_id);
|
||||
|
||||
return Redirect('thread/'.$ticket_id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Checked ticket
|
||||
* Get Checked ticket.
|
||||
*
|
||||
* @param type Tickets $ticket
|
||||
* @param type User $user
|
||||
* @param type User $user
|
||||
*
|
||||
* @return type response
|
||||
*/
|
||||
public function getCheckTicket(Tickets $ticket, User $user) {
|
||||
public function getCheckTicket(Tickets $ticket, User $user)
|
||||
{
|
||||
return view('themes.default1.client.helpdesk.guest-user.newticket', compact('ticket'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Post Check ticket
|
||||
* @param type CheckTicket $request
|
||||
* @param type User $user
|
||||
* @param type Tickets $ticket
|
||||
* Post Check ticket.
|
||||
*
|
||||
* @param type CheckTicket $request
|
||||
* @param type User $user
|
||||
* @param type Tickets $ticket
|
||||
* @param type Ticket_Thread $thread
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function PostCheckTicket() {
|
||||
|
||||
public function PostCheckTicket()
|
||||
{
|
||||
$Email = \Input::get('email');
|
||||
$Ticket_number = \Input::get('ticket_number');
|
||||
|
||||
@@ -230,7 +265,7 @@ class GuestController extends Controller {
|
||||
if ($user->role == 'user') {
|
||||
$username = $user->user_name;
|
||||
} else {
|
||||
$username = $user->first_name . " " . $user->last_name;
|
||||
$username = $user->first_name.' '.$user->last_name;
|
||||
}
|
||||
|
||||
if ($user->email != $Email) {
|
||||
@@ -242,7 +277,7 @@ class GuestController extends Controller {
|
||||
$company = $this->company();
|
||||
|
||||
$this->PhpMailController->sendmail(
|
||||
$from = $this->PhpMailController->mailfrom('1', '0'), $to = ['name' => $username, 'email' => $user->email], $message = ['subject' => 'Ticket link Request [' . $Ticket_number . ']', 'scenario' => 'check-ticket'], $template_variables = ['user' => $username, 'ticket_link_with_number' => \URL::route('check_ticket', $code)]
|
||||
$from = $this->PhpMailController->mailfrom('1', '0'), $to = ['name' => $username, 'email' => $user->email], $message = ['subject' => 'Ticket link Request ['.$Ticket_number.']', 'scenario' => 'check-ticket'], $template_variables = ['user' => $username, 'ticket_link_with_number' => \URL::route('check_ticket', $code)]
|
||||
);
|
||||
|
||||
return \Redirect::back()
|
||||
@@ -252,36 +287,45 @@ class GuestController extends Controller {
|
||||
}
|
||||
|
||||
/**
|
||||
* get ticket email
|
||||
* @param type $id
|
||||
* get ticket email.
|
||||
*
|
||||
* @param type $id
|
||||
*
|
||||
* @return type
|
||||
*/
|
||||
public function get_ticket_email($id) {
|
||||
public function get_ticket_email($id)
|
||||
{
|
||||
$id1 = \Crypt::decrypt($id);
|
||||
|
||||
return view('themes.default1.client.helpdesk.ckeckticket', compact('id'));
|
||||
}
|
||||
|
||||
/**
|
||||
* get ticket status
|
||||
* @param type Tickets $ticket
|
||||
* get ticket status.
|
||||
*
|
||||
* @param type Tickets $ticket
|
||||
*
|
||||
* @return type
|
||||
*/
|
||||
public function getTicketStat(Tickets $ticket) {
|
||||
public function getTicketStat(Tickets $ticket)
|
||||
{
|
||||
return view('themes.default1.client.helpdesk.ckeckticket', compact('ticket'));
|
||||
}
|
||||
|
||||
/**
|
||||
* get company
|
||||
* get company.
|
||||
*
|
||||
* @return type
|
||||
*/
|
||||
public function company() {
|
||||
public function company()
|
||||
{
|
||||
$company = Company::Where('id', '=', '1')->first();
|
||||
if ($company->company_name == null) {
|
||||
$company = "Support Center";
|
||||
$company = 'Support Center';
|
||||
} else {
|
||||
$company = $company->company_name;
|
||||
}
|
||||
|
||||
return $company;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -9,23 +9,21 @@ use App\Model\helpdesk\Settings\System;
|
||||
// classes
|
||||
use Config;
|
||||
use Redirect;
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
* OuthouseController
|
||||
* OuthouseController.
|
||||
*
|
||||
* @package Controllers
|
||||
* @subpackage Controller
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class WelcomepageController extends Controller {
|
||||
|
||||
class WelcomepageController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function get(System $note) {
|
||||
public function get(System $note)
|
||||
{
|
||||
if (Config::get('database.install') == '%0%') {
|
||||
return Redirect::route('licence');
|
||||
}
|
||||
@@ -33,14 +31,16 @@ class WelcomepageController extends Controller {
|
||||
foreach ($notes as $note) {
|
||||
$content = $note->content;
|
||||
}
|
||||
|
||||
return view('themes.default1.client.guest-user.guest', compact('heading', 'content'));
|
||||
}
|
||||
|
||||
public function index() {
|
||||
public function index()
|
||||
{
|
||||
if (Config::get('database.install') == '%0%') {
|
||||
return Redirect::route('licence');
|
||||
}
|
||||
|
||||
return view('themes.default1.client.helpdesk.guest-user.index');
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user