update v1.0.6
This commit is contained in:
2
.env
2
.env
@@ -2,7 +2,7 @@ APP_ENV=local
|
|||||||
APP_DEBUG=true
|
APP_DEBUG=true
|
||||||
APP_KEY=SomeRandomString
|
APP_KEY=SomeRandomString
|
||||||
DB_HOST=localhost
|
DB_HOST=localhost
|
||||||
DB_DATABASE=fav222222
|
DB_DATABASE=faveo1.0.6
|
||||||
DB_USERNAME=root
|
DB_USERNAME=root
|
||||||
DB_PASSWORD=
|
DB_PASSWORD=
|
||||||
CACHE_DRIVER=file
|
CACHE_DRIVER=file
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
<h3>About Faveo</h3>
|
<h3>About Faveo</h3>
|
||||||
<br><img src="https://travis-ci.org/ladybirdweb/faveo-helpdesk.svg?branch=master"> <img src="https://img.shields.io/badge/License-OSL-blue.svg"> <a href="https://gitter.im/ladybirdweb/faveo-helpdesk" target="_blank"><img src="https://badges.gitter.im/ladybirdweb/faveo-helpdesk.svg"></a></br>
|
<br><img src="https://travis-ci.org/ladybirdweb/faveo-helpdesk.svg?branch=master"> <img src="https://img.shields.io/badge/License-OSL-blue.svg"></br>
|
||||||
<p>Headquartered in Bangalore, Faveo HELPDESK provides Businesses with an automated Helpdesk system to manage customer support.
|
<p>Headquartered in Bangalore, Faveo HELPDESK provides Businesses with an automated Helpdesk system to manage customer support.
|
||||||
<br/><br/>
|
<br/><br/>
|
||||||
The word Faveo comes from Latin which means to be favourable. Which truly highlights vision and the scope as well as the functionality of the product that Faveo is. It is specifically designed to cater the needs of startups and SME’s empowering them with state of art, ticket based support system. In today’s competitive startup scenario customer retention is one of the major challenges. Handling client query diligently is all the difference between retaining or losing a long lasting relationship. The company is driven with passion of providing tools for managing consumer queries for strategic insights and helping companies take those decisive decisions.
|
The word Faveo comes from Latin which means to be favourable. Which truly highlights vision and the scope as well as the functionality of the product that Faveo is. It is specifically designed to cater the needs of startups and SME’s empowering them with state of art, ticket based support system. In today’s competitive startup scenario customer retention is one of the major challenges. Handling client query diligently is all the difference between retaining or losing a long lasting relationship. The company is driven with passion of providing tools for managing consumer queries for strategic insights and helping companies take those decisive decisions.
|
||||||
|
@@ -1,7 +1,10 @@
|
|||||||
<?php namespace App\Exceptions;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Exceptions;
|
||||||
|
|
||||||
use Exception;
|
use Exception;
|
||||||
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
|
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
|
||||||
|
|
||||||
// use App\Http\Controllers\Common\SettingsController;
|
// use App\Http\Controllers\Common\SettingsController;
|
||||||
//use App\Model\helpdesk\Email\Smtp;
|
//use App\Model\helpdesk\Email\Smtp;
|
||||||
|
|
||||||
@@ -32,8 +35,7 @@ class Handler extends ExceptionHandler {
|
|||||||
* @param \Exception $e
|
* @param \Exception $e
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function report(Exception $e)
|
public function report(Exception $e) {
|
||||||
{
|
|
||||||
return parent::report($e);
|
return parent::report($e);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -44,52 +46,48 @@ class Handler extends ExceptionHandler {
|
|||||||
* @param \Exception $e
|
* @param \Exception $e
|
||||||
* @return \Illuminate\Http\Response
|
* @return \Illuminate\Http\Response
|
||||||
*/
|
*/
|
||||||
public function render($request, Exception $e)
|
public function render($request, Exception $e) {
|
||||||
{
|
|
||||||
if(config('app.debug') == false) {
|
|
||||||
if ($this->isHttpException($e) && $e->getStatusCode() == 404) {
|
|
||||||
return response()->view('errors.404', []);
|
|
||||||
} else {
|
|
||||||
if(\Config::get('database.install') == 1) {
|
|
||||||
// if(\Config::get('app.ErrorLog') == '%1%') {
|
|
||||||
// \App\Http\Controllers\Common\SettingsController::smtp();
|
|
||||||
// \Mail::send('errors.report', array('e' => $e), function ($message) {
|
|
||||||
// $message->to('', '')->subject('Faveo HELPDESK Pro ERROR');
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
return response()->view('errors.500', []);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return parent::render($request, $e);
|
|
||||||
|
|
||||||
if ($this->isHttpException($e))
|
if ($e instanceof \Tymon\JWTAuth\Exceptions\TokenExpiredException) {
|
||||||
{
|
return response()->json(['message' => $e->getMessage(), 'code' => $e->getStatusCode()]);
|
||||||
|
//dd($e);
|
||||||
|
} else if ($e instanceof \Tymon\JWTAuth\Exceptions\TokenInvalidException) {
|
||||||
|
return response()->json(['message' => $e->getMessage(), 'code' => $e->getStatusCode()]);
|
||||||
|
}
|
||||||
|
|
||||||
|
// if (config('app.debug') == false) {
|
||||||
|
// if ($this->isHttpException($e) && $e->getStatusCode() == 404) {
|
||||||
|
// return response()->view('errors.404', []);
|
||||||
|
// } else {
|
||||||
|
// if (\Config::get('database.install') == 1) {
|
||||||
|
// // if(\Config::get('app.ErrorLog') == '%1%') {
|
||||||
|
// // \App\Http\Controllers\Common\SettingsController::smtp();
|
||||||
|
// // $this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('1', '0'), $to = ['name' => '', 'email' => ''], $message = ['subject' => '', 'scenario'=>'error-report'], $template_variables = ['e' =>$e ]);
|
||||||
|
// // }
|
||||||
|
// }
|
||||||
|
// return response()->view('errors.500', []);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// return parent::render($request, $e);
|
||||||
|
|
||||||
|
if ($this->isHttpException($e)) {
|
||||||
return $this->renderHttpException($e);
|
return $this->renderHttpException($e);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config('app.debug'))
|
if (config('app.debug')) {
|
||||||
{
|
|
||||||
return $this->renderExceptionWithWhoops($e);
|
return $this->renderExceptionWithWhoops($e);
|
||||||
}
|
}
|
||||||
|
|
||||||
return parent::render($request, $e);
|
return parent::render($request, $e);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function renderExceptionWithWhoops(Exception $e) {
|
||||||
|
|
||||||
protected function renderExceptionWithWhoops(Exception $e)
|
|
||||||
{
|
|
||||||
$whoops = new \Whoops\Run;
|
$whoops = new \Whoops\Run;
|
||||||
$whoops->pushHandler(new \Whoops\Handler\PrettyPageHandler());
|
$whoops->pushHandler(new \Whoops\Handler\PrettyPageHandler());
|
||||||
|
|
||||||
return new \Illuminate\Http\Response(
|
return new \Illuminate\Http\Response(
|
||||||
$whoops->handleException($e),
|
$whoops->handleException($e), $e->getStatusCode(), $e->getHeaders()
|
||||||
$e->getStatusCode(),
|
|
||||||
$e->getHeaders()
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -1,13 +1,14 @@
|
|||||||
<?php namespace App\Http\Controllers\Admin\helpdesk;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin\helpdesk;
|
||||||
|
|
||||||
// controller
|
// controller
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
use App\Http\Controllers\Common\SettingsController;
|
use App\Http\Controllers\Common\SettingsController;
|
||||||
|
use App\Http\Controllers\Common\PhpMailController;
|
||||||
// request
|
// request
|
||||||
use App\Http\Requests\helpdesk\AgentRequest;
|
use App\Http\Requests\helpdesk\AgentRequest;
|
||||||
use App\Http\Requests\helpdesk\AgentUpdate;
|
use App\Http\Requests\helpdesk\AgentUpdate;
|
||||||
|
|
||||||
// model
|
// model
|
||||||
use App\User;
|
use App\User;
|
||||||
use App\Model\helpdesk\Agent\Assign_team_agent;
|
use App\Model\helpdesk\Agent\Assign_team_agent;
|
||||||
@@ -16,7 +17,8 @@ use App\Model\helpdesk\Agent\Groups;
|
|||||||
use App\Model\helpdesk\Agent\Teams;
|
use App\Model\helpdesk\Agent\Teams;
|
||||||
use App\Model\helpdesk\Utility\Timezones;
|
use App\Model\helpdesk\Utility\Timezones;
|
||||||
use App\Model\helpdesk\Settings\Company;
|
use App\Model\helpdesk\Settings\Company;
|
||||||
|
use App\Model\helpdesk\Settings\Email;
|
||||||
|
use App\Model\helpdesk\Email\Emails;
|
||||||
// classes
|
// classes
|
||||||
use DB;
|
use DB;
|
||||||
use Mail;
|
use Mail;
|
||||||
@@ -33,7 +35,6 @@ use Exception;
|
|||||||
*/
|
*/
|
||||||
class AgentController extends Controller {
|
class AgentController extends Controller {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new controller instance.
|
* Create a new controller instance.
|
||||||
* constructor to check
|
* constructor to check
|
||||||
@@ -42,7 +43,8 @@ class AgentController extends Controller {
|
|||||||
* 3. roles must be agent
|
* 3. roles must be agent
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function __construct() {
|
public function __construct(PhpMailController $PhpMailController) {
|
||||||
|
$this->PhpMailController = $PhpMailController;
|
||||||
SettingsController::smtp();
|
SettingsController::smtp();
|
||||||
// checking authentication
|
// checking authentication
|
||||||
$this->middleware('auth');
|
$this->middleware('auth');
|
||||||
@@ -81,7 +83,7 @@ class AgentController extends Controller {
|
|||||||
$teams = $team->lists('id', 'name');
|
$teams = $team->lists('id', 'name');
|
||||||
return view('themes.default1.admin.helpdesk.agent.agents.create', compact('assign', 'teams', 'agents', 'timezones', 'groups', 'departments', 'team'));
|
return view('themes.default1.admin.helpdesk.agent.agents.create', compact('assign', 'teams', 'agents', 'timezones', 'groups', 'departments', 'team'));
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
return redirect()->back()->with('fails',$e->errorInfo[2]);
|
return redirect()->back()->with('fails', $e->errorInfo[2]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -94,6 +96,8 @@ class AgentController extends Controller {
|
|||||||
*/
|
*/
|
||||||
public function store(User $user, AgentRequest $request, Assign_team_agent $team_assign_agent) {
|
public function store(User $user, AgentRequest $request, Assign_team_agent $team_assign_agent) {
|
||||||
|
|
||||||
|
// dd($this->system_mail());
|
||||||
|
|
||||||
/* Insert to user table */
|
/* Insert to user table */
|
||||||
$user->role = 'agent';
|
$user->role = 'agent';
|
||||||
$user->fill($request->input())->save();
|
$user->fill($request->input())->save();
|
||||||
@@ -103,20 +107,18 @@ class AgentController extends Controller {
|
|||||||
$id = $user->id;
|
$id = $user->id;
|
||||||
// insert team
|
// insert team
|
||||||
foreach ($requests as $req) {
|
foreach ($requests as $req) {
|
||||||
DB::insert('insert into team_assign_agent (team_id, agent_id) values (?,?)', [$req, $id]);
|
// DB::insert('insert into team_assign_agent (team_id, agent_id) values (?,?)', [$req, $id]);
|
||||||
}
|
}
|
||||||
/* Succes And Failure condition */
|
/* Succes And Failure condition */
|
||||||
if ($user->save() == true) {
|
if ($user->save() == true) {
|
||||||
$name = $user->user_name;
|
$name = $user->user_name;
|
||||||
$email = $user->email;
|
$email = $user->email;
|
||||||
$from = $this->company();
|
$system_from = $this->company();
|
||||||
|
try {
|
||||||
// send mail on registration
|
// send mail on registration
|
||||||
try{
|
$this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('1', '0'), $to = ['name' => $name, 'email' => $email], $message = ['subject' => 'Password', 'scenario' => 'registration-notification'], $template_variables = ['user' => $name, 'email_address' => $email, 'user_password' => $password]);
|
||||||
Mail::send('emails.pass', ['name' => $name, 'password' => $password, 'from' => $from, 'emailadd' => $email], function ($message) use ($email, $name) {
|
|
||||||
$message->to($email, $name)->subject('[password]');
|
|
||||||
});
|
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
return redirect('agents')->with('fails', 'Some error occuren while sending mail to the agent. Please check email settings'.'<li>'.$e->errorInfo[2].'</li>');
|
return redirect('agents')->with('fails', 'Some error occured while sending mail to the agent. Please check email settings and try again');
|
||||||
}
|
}
|
||||||
return redirect('agents')->with('success', 'Agent Created sucessfully');
|
return redirect('agents')->with('success', 'Agent Created sucessfully');
|
||||||
} else {
|
} else {
|
||||||
@@ -181,7 +183,7 @@ class AgentController extends Controller {
|
|||||||
$user->fill($request->except('daylight_save', 'limit_access', 'directory_listing', 'vocation_mode', 'assign_team'))->save();
|
$user->fill($request->except('daylight_save', 'limit_access', 'directory_listing', 'vocation_mode', 'assign_team'))->save();
|
||||||
return redirect('agents')->with('success', 'Agent Updated sucessfully');
|
return redirect('agents')->with('success', 'Agent Updated sucessfully');
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
return redirect('agents')->with('fails', 'Agent did not update'.'<li>'.$e->errorInfo[2].'</li>');
|
return redirect('agents')->with('fails', 'Agent did not update' . '<li>' . $e->errorInfo[2] . '</li>');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -210,7 +212,6 @@ class AgentController extends Controller {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generate a random string for password
|
* Generate a random string for password
|
||||||
* @param type $length
|
* @param type $length
|
||||||
@@ -231,18 +232,25 @@ class AgentController extends Controller {
|
|||||||
* @return type
|
* @return type
|
||||||
*/
|
*/
|
||||||
public function company() {
|
public function company() {
|
||||||
$company = Company::Where('id','=','1')->first();
|
$company = Company::Where('id', '=', '1')->first();
|
||||||
if($company->company_name == null){
|
if ($company->company_name == null) {
|
||||||
$company = "Support Center";
|
$company = "Support Center";
|
||||||
}else{
|
} else {
|
||||||
$company = $company->company_name;
|
$company = $company->company_name;
|
||||||
}
|
}
|
||||||
return $company;
|
return $company;
|
||||||
}
|
}
|
||||||
|
|
||||||
// public function agent_profile($id) {
|
/**
|
||||||
// $agent = User::where('id','=',$id)->first();
|
* System default email
|
||||||
// return \View::make('themes.default1.admin.helpdesk.agent.agents.agent-profile',compact('agent'));
|
*/
|
||||||
|
// public function system_mail() {
|
||||||
|
// $emails = Emails::all();
|
||||||
|
// $count_emails = $emails->count();
|
||||||
|
// if($count_emails > 1) {
|
||||||
|
// dd($emails);
|
||||||
|
// }
|
||||||
|
// $email = Email::where('id', '=', '1')->first();
|
||||||
|
// return $email->sys_email;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -1,15 +1,15 @@
|
|||||||
<?php namespace App\Http\Controllers\Admin\helpdesk;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin\helpdesk;
|
||||||
|
|
||||||
// controller
|
// controller
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
|
|
||||||
// request
|
// request
|
||||||
use App\Http\Requests\helpdesk\BanlistRequest;
|
use App\Http\Requests\helpdesk\BanlistRequest;
|
||||||
use App\Http\Requests\helpdesk\BanRequest;
|
use App\Http\Requests\helpdesk\BanRequest;
|
||||||
|
|
||||||
// model
|
// model
|
||||||
use App\User;
|
use App\User;
|
||||||
use App\Model\helpdesk\Email\Banlist;
|
use App\Model\helpdesk\Email\Banlist;
|
||||||
|
|
||||||
//classes
|
//classes
|
||||||
use Exception;
|
use Exception;
|
||||||
|
|
||||||
@@ -22,7 +22,7 @@ use Exception;
|
|||||||
*/
|
*/
|
||||||
class BanlistController extends Controller {
|
class BanlistController extends Controller {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new controller instance.
|
* Create a new controller instance.
|
||||||
* constructor to check
|
* constructor to check
|
||||||
* 1. authentication
|
* 1. authentication
|
||||||
@@ -44,7 +44,7 @@ class BanlistController extends Controller {
|
|||||||
*/
|
*/
|
||||||
public function index() {
|
public function index() {
|
||||||
try {
|
try {
|
||||||
$bans = User::where('ban','=',1)->get();
|
$bans = User::where('ban', '=', 1)->get();
|
||||||
return view('themes.default1.admin.helpdesk.emails.banlist.index', compact('bans'));
|
return view('themes.default1.admin.helpdesk.emails.banlist.index', compact('bans'));
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
return view('404');
|
return view('404');
|
||||||
|
@@ -1,4 +1,7 @@
|
|||||||
<?php namespace App\Http\Controllers\Admin\helpdesk;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin\helpdesk;
|
||||||
|
|
||||||
// controller
|
// controller
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
// request
|
// request
|
||||||
@@ -85,10 +88,10 @@ class DepartmentController extends Controller {
|
|||||||
*/
|
*/
|
||||||
public function store(Department $department, DepartmentRequest $request) {
|
public function store(Department $department, DepartmentRequest $request) {
|
||||||
try {
|
try {
|
||||||
$department->fill($request->except('group_id','manager'))->save();
|
$department->fill($request->except('group_id', 'manager'))->save();
|
||||||
$requests = $request->input('group_id');
|
$requests = $request->input('group_id');
|
||||||
$id = $department->id;
|
$id = $department->id;
|
||||||
if($request->manager) {
|
if ($request->manager) {
|
||||||
$department->manager = $request->input('manager');
|
$department->manager = $request->input('manager');
|
||||||
} else {
|
} else {
|
||||||
$department->manager = null;
|
$department->manager = null;
|
||||||
@@ -155,14 +158,14 @@ class DepartmentController extends Controller {
|
|||||||
// }
|
// }
|
||||||
$departments = $department->whereId($id)->first();
|
$departments = $department->whereId($id)->first();
|
||||||
|
|
||||||
if($request->manager) {
|
if ($request->manager) {
|
||||||
$departments->manager = $request->input('manager');
|
$departments->manager = $request->input('manager');
|
||||||
} else {
|
} else {
|
||||||
$departments->manager = null;
|
$departments->manager = null;
|
||||||
}
|
}
|
||||||
$departments->save();
|
$departments->save();
|
||||||
|
|
||||||
if ($departments->fill($request->except('group_access','manager'))->save()) {
|
if ($departments->fill($request->except('group_access', 'manager'))->save()) {
|
||||||
return redirect('departments')->with('success', 'Department Updated sucessfully');
|
return redirect('departments')->with('success', 'Department Updated sucessfully');
|
||||||
} else {
|
} else {
|
||||||
return redirect('departments')->with('fails', 'Department not Updated');
|
return redirect('departments')->with('fails', 'Department not Updated');
|
||||||
@@ -181,61 +184,60 @@ class DepartmentController extends Controller {
|
|||||||
*/
|
*/
|
||||||
public function destroy($id, Department $department, Group_assign_department $group_assign_department, System $system, Tickets $tickets) {
|
public function destroy($id, Department $department, Group_assign_department $group_assign_department, System $system, Tickets $tickets) {
|
||||||
// try {
|
// try {
|
||||||
$system = $system->where('id','=','1')->first();
|
$system = $system->where('id', '=', '1')->first();
|
||||||
if($system->department == $id) {
|
if ($system->department == $id) {
|
||||||
return redirect('departments')->with('fails', 'You cannot delete default department');
|
return redirect('departments')->with('fails', 'You cannot delete default department');
|
||||||
} else {
|
} else {
|
||||||
$tickets = DB::table('tickets')->where('dept_id','=',$id)->update(['dept_id' => $system->department]);
|
$tickets = DB::table('tickets')->where('dept_id', '=', $id)->update(['dept_id' => $system->department]);
|
||||||
if($tickets > 0){
|
if ($tickets > 0) {
|
||||||
if($tickets > 1){
|
if ($tickets > 1) {
|
||||||
$text_tickets = "Tickets";
|
$text_tickets = "Tickets";
|
||||||
} else {
|
} else {
|
||||||
$text_tickets = "Ticket";
|
$text_tickets = "Ticket";
|
||||||
}
|
}
|
||||||
$ticket = '<li>'.$tickets.' '.$text_tickets.' have been moved to default department</li>';
|
$ticket = '<li>' . $tickets . ' ' . $text_tickets . ' have been moved to default department</li>';
|
||||||
} else {
|
} else {
|
||||||
$ticket = "";
|
$ticket = "";
|
||||||
}
|
}
|
||||||
$users = DB::table('users')->where('primary_dpt','=',$id)->update(['primary_dpt' => $system->department]);
|
$users = DB::table('users')->where('primary_dpt', '=', $id)->update(['primary_dpt' => $system->department]);
|
||||||
if($users > 0){
|
if ($users > 0) {
|
||||||
if($users > 1){
|
if ($users > 1) {
|
||||||
$text_user = "Users";
|
$text_user = "Users";
|
||||||
} else {
|
} else {
|
||||||
$text_user = "User";
|
$text_user = "User";
|
||||||
}
|
}
|
||||||
$user = '<li>'.$users.' '.$text_user.' have been moved to default department</li>';
|
$user = '<li>' . $users . ' ' . $text_user . ' have been moved to default department</li>';
|
||||||
} else {
|
} else {
|
||||||
$user = "";
|
$user = "";
|
||||||
}
|
}
|
||||||
$emails = DB::table('emails')->where('department','=',$id)->update(['department' => $system->department]);
|
$emails = DB::table('emails')->where('department', '=', $id)->update(['department' => $system->department]);
|
||||||
if($emails > 0){
|
if ($emails > 0) {
|
||||||
if($emails > 1){
|
if ($emails > 1) {
|
||||||
$text_emails = "Emails";
|
$text_emails = "Emails";
|
||||||
} else {
|
} else {
|
||||||
$text_emails = "Email";
|
$text_emails = "Email";
|
||||||
}
|
}
|
||||||
$email = '<li>'.$emails.' System '.$text_emails.' have been moved to default department</li>';
|
$email = '<li>' . $emails . ' System ' . $text_emails . ' have been moved to default department</li>';
|
||||||
} else {
|
} else {
|
||||||
$email = "";
|
$email = "";
|
||||||
}
|
}
|
||||||
$helptopic = DB::table('help_topic')->where('department','=',$id)->update(['department' => null],['status' => '1']);
|
$helptopic = DB::table('help_topic')->where('department', '=', $id)->update(['department' => null], ['status' => '1']);
|
||||||
if($helptopic > 0){
|
if ($helptopic > 0) {
|
||||||
$helptopic = '<li>The associated helptopic has been deactivated</li>';
|
$helptopic = '<li>The associated helptopic has been deactivated</li>';
|
||||||
} else {
|
} else {
|
||||||
$helptopic = "";
|
$helptopic = "";
|
||||||
}
|
}
|
||||||
$message = $ticket.$user.$email.$helptopic;
|
$message = $ticket . $user . $email . $helptopic;
|
||||||
/* Becouse of foreign key we delete group_assign_department first */
|
/* Becouse of foreign key we delete group_assign_department first */
|
||||||
$group_assign_department = $group_assign_department->where('department_id', $id);
|
$group_assign_department = $group_assign_department->where('department_id', $id);
|
||||||
$group_assign_department->delete();
|
$group_assign_department->delete();
|
||||||
$departments = $department->whereId($id)->first();
|
$departments = $department->whereId($id)->first();
|
||||||
/* Check the function is Success or Fail */
|
/* Check the function is Success or Fail */
|
||||||
if ($departments->delete() == true) {
|
if ($departments->delete() == true) {
|
||||||
return redirect('departments')->with('success', 'Department Deleted sucessfully'.$message);
|
return redirect('departments')->with('success', 'Department Deleted sucessfully' . $message);
|
||||||
} else {
|
} else {
|
||||||
return redirect('departments')->with('fails', 'Department can not Delete');
|
return redirect('departments')->with('fails', 'Department can not Delete');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,4 +1,7 @@
|
|||||||
<?php namespace App\Http\Controllers\Admin\helpdesk;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin\helpdesk;
|
||||||
|
|
||||||
// controllers
|
// controllers
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
// request
|
// request
|
||||||
@@ -10,6 +13,7 @@ use App\Model\helpdesk\Email\Emails;
|
|||||||
use App\Model\helpdesk\Manage\Help_topic;
|
use App\Model\helpdesk\Manage\Help_topic;
|
||||||
use App\Model\helpdesk\Utility\MailboxProtocol;
|
use App\Model\helpdesk\Utility\MailboxProtocol;
|
||||||
use App\Model\helpdesk\Ticket\Ticket_Priority;
|
use App\Model\helpdesk\Ticket\Ticket_Priority;
|
||||||
|
use App\Model\helpdesk\Settings\Email;
|
||||||
// classes
|
// classes
|
||||||
use Crypt;
|
use Crypt;
|
||||||
use Exception;
|
use Exception;
|
||||||
@@ -76,8 +80,29 @@ class EmailsController extends Controller {
|
|||||||
try {
|
try {
|
||||||
$password = $request->input('password');
|
$password = $request->input('password');
|
||||||
$encrypted = Crypt::encrypt($password);
|
$encrypted = Crypt::encrypt($password);
|
||||||
|
$department = $request->input('department');
|
||||||
|
$priority = $request->input('priority');
|
||||||
|
$help_topic = $request->input('help_topic');
|
||||||
|
|
||||||
|
if ($email->fill($request->except('password', 'department', 'priority', 'help_topic'))->save() == true) {
|
||||||
|
if ($request->input('department')) {
|
||||||
|
$email->department = $request->input('department');
|
||||||
|
} else {
|
||||||
|
$email->department = null;
|
||||||
|
}
|
||||||
|
if ($request->input('priority')) {
|
||||||
|
$email->priority = $request->input('priority');
|
||||||
|
} else {
|
||||||
|
$email->priority = null;
|
||||||
|
}
|
||||||
|
if ($request->input('help_topic')) {
|
||||||
|
$email->help_topic = $request->input('help_topic');
|
||||||
|
} else {
|
||||||
|
$email->help_topic = null;
|
||||||
|
}
|
||||||
$email->password = $encrypted;
|
$email->password = $encrypted;
|
||||||
if ($email->fill($request->except('password'))->save() == true) {
|
$email->save();
|
||||||
|
|
||||||
return redirect('emails')->with('success', 'Email Created sucessfully');
|
return redirect('emails')->with('success', 'Email Created sucessfully');
|
||||||
} else {
|
} else {
|
||||||
return redirect('emails')->with('fails', 'Email can not Create');
|
return redirect('emails')->with('fails', 'Email can not Create');
|
||||||
@@ -135,8 +160,25 @@ class EmailsController extends Controller {
|
|||||||
//echo $value;
|
//echo $value;
|
||||||
try {
|
try {
|
||||||
$emails = $email->whereId($id)->first();
|
$emails = $email->whereId($id)->first();
|
||||||
|
// $emails->password = $encrypted;
|
||||||
|
$emails->fill($request->except('password', 'department', 'priority', 'help_topic'))->save();
|
||||||
|
if ($request->input('department')) {
|
||||||
|
$emails->department = $request->input('department');
|
||||||
|
} else {
|
||||||
|
$emails->department = null;
|
||||||
|
}
|
||||||
|
if ($request->input('priority')) {
|
||||||
|
$emails->priority = $request->input('priority');
|
||||||
|
} else {
|
||||||
|
$emails->priority = null;
|
||||||
|
}
|
||||||
|
if ($request->input('help_topic')) {
|
||||||
|
$emails->help_topic = $request->input('help_topic');
|
||||||
|
} else {
|
||||||
|
$emails->help_topic = null;
|
||||||
|
}
|
||||||
$emails->password = $encrypted;
|
$emails->password = $encrypted;
|
||||||
$emails->fill($request->except('password'))->save();
|
$emails->save();
|
||||||
return redirect('emails')->with('success', 'Email Updated sucessfully');
|
return redirect('emails')->with('success', 'Email Updated sucessfully');
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
return redirect('emails')->with('fails', 'Email not updated');
|
return redirect('emails')->with('fails', 'Email not updated');
|
||||||
@@ -150,6 +192,12 @@ class EmailsController extends Controller {
|
|||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function destroy($id, Emails $email) {
|
public function destroy($id, Emails $email) {
|
||||||
|
$default_system_email = Email::where('id', '=', '1')->first();
|
||||||
|
if ($default_system_email->id) {
|
||||||
|
if ($id == $default_system_email->id) {
|
||||||
|
return redirect('emails')->with('fails', 'You cannot delete system default Email');
|
||||||
|
}
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
$emails = $email->whereId($id)->first();
|
$emails = $email->whereId($id)->first();
|
||||||
if ($emails->delete() == true) {
|
if ($emails->delete() == true) {
|
||||||
|
@@ -1,16 +1,15 @@
|
|||||||
<?php namespace App\Http\Controllers\Admin\helpdesk;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin\helpdesk;
|
||||||
|
|
||||||
// Controller
|
// Controller
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
|
|
||||||
// Model
|
// Model
|
||||||
use App\Model\helpdesk\Form\Fields;
|
use App\Model\helpdesk\Form\Fields;
|
||||||
use App\Model\helpdesk\Form\Forms;
|
use App\Model\helpdesk\Form\Forms;
|
||||||
use App\Model\helpdesk\Manage\Help_topic;
|
use App\Model\helpdesk\Manage\Help_topic;
|
||||||
|
|
||||||
// Request
|
// Request
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
// Class
|
// Class
|
||||||
use Input;
|
use Input;
|
||||||
use Redirect;
|
use Redirect;
|
||||||
@@ -25,11 +24,11 @@ use Exception;
|
|||||||
* @author Ladybird <info@ladybirdweb.com>
|
* @author Ladybird <info@ladybirdweb.com>
|
||||||
*/
|
*/
|
||||||
class FormController extends Controller {
|
class FormController extends Controller {
|
||||||
|
|
||||||
private $fields;
|
private $fields;
|
||||||
private $forms;
|
private $forms;
|
||||||
|
|
||||||
|
public function __construct(Fields $fields, Forms $forms) {
|
||||||
public function __construct(Fields $fields,Forms $forms) {
|
|
||||||
$this->fields = $fields;
|
$this->fields = $fields;
|
||||||
$this->forms = $forms;
|
$this->forms = $forms;
|
||||||
// $this->middleware('auth');
|
// $this->middleware('auth');
|
||||||
@@ -49,7 +48,7 @@ class FormController extends Controller {
|
|||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function index(Forms $forms) {
|
public function index(Forms $forms) {
|
||||||
return view('themes.default1.admin.helpdesk.manage.form.index',compact('forms'));
|
return view('themes.default1.admin.helpdesk.manage.form.index', compact('forms'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -66,7 +65,7 @@ class FormController extends Controller {
|
|||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function show($id) {
|
public function show($id) {
|
||||||
return view('themes.default1.admin.helpdesk.manage.form.preview',compact('id'));
|
return view('themes.default1.admin.helpdesk.manage.form.preview', compact('id'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -75,56 +74,50 @@ class FormController extends Controller {
|
|||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function store(Forms $forms) {
|
public function store(Forms $forms) {
|
||||||
if(!Input::get('formname')) {
|
if (!Input::get('formname')) {
|
||||||
return Redirect::back()->with('fails','Please fill Form name');
|
return Redirect::back()->with('fails', 'Please fill Form name');
|
||||||
}
|
}
|
||||||
$required = Input::get('required');
|
$required = Input::get('required');
|
||||||
$count = count($required);
|
$count = count($required);
|
||||||
$require = array();
|
$require = array();
|
||||||
for($i=2;$i<$count+2;$i++) {
|
for ($i = 2; $i < $count + 2; $i++) {
|
||||||
for($j=0;$j<1;$j++) {
|
for ($j = 0; $j < 1; $j++) {
|
||||||
array_push($require,$required[$i][$j]);
|
array_push($require, $required[$i][$j]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$forms->formname = Input::get('formname');
|
$forms->formname = Input::get('formname');
|
||||||
$forms->save();
|
$forms->save();
|
||||||
$count = count(Input::get('name'));
|
$count = count(Input::get('name'));
|
||||||
$fields = array();
|
$fields = array();
|
||||||
for($i=0; $i<=$count; $i++) {
|
for ($i = 0; $i <= $count; $i++) {
|
||||||
if(!empty(Input::get('name')[$i])) {
|
if (!empty(Input::get('name')[$i])) {
|
||||||
array_push($fields, array(
|
array_push($fields, array(
|
||||||
'forms_id' => $forms->id,
|
'forms_id' => $forms->id,
|
||||||
'label' => Input::get('label')[$i],
|
'label' => Input::get('label')[$i],
|
||||||
'name' => Input::get('name')[$i],
|
'name' => Input::get('name')[$i],
|
||||||
'type' => Input::get('type')[$i],
|
'type' => Input::get('type')[$i],
|
||||||
'value' => Input::get('value')[$i],
|
'value' => Input::get('value')[$i],
|
||||||
'required'=>$require[$i],
|
'required' => $require[$i],
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Fields::insert($fields);
|
Fields::insert($fields);
|
||||||
return Redirect::back()->with('success','Successfully created Form');
|
return Redirect::back()->with('success', 'Successfully created Form');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function delete($id, Forms $forms, Fields $field, Help_topic $help_topic) {
|
||||||
|
$fields = $field->where('forms_id', $id)->get();
|
||||||
public function delete($id,Forms $forms, Fields $field, Help_topic $help_topic) {
|
$help_topics = $help_topic->where('custom_form', '=', $id)->get();
|
||||||
$fields = $field->where('forms_id',$id)->get();
|
foreach ($help_topics as $help_topic) {
|
||||||
$help_topics = $help_topic->where('custom_form','=',$id)->get();
|
|
||||||
foreach($help_topics as $help_topic) {
|
|
||||||
$help_topic->custom_form = null;
|
$help_topic->custom_form = null;
|
||||||
$help_topic->save();
|
$help_topic->save();
|
||||||
}
|
}
|
||||||
foreach($fields as $field) {
|
foreach ($fields as $field) {
|
||||||
$field->delete();
|
$field->delete();
|
||||||
}
|
}
|
||||||
$forms = $forms->where('id',$id)->first();
|
$forms = $forms->where('id', $id)->first();
|
||||||
$forms->delete();
|
$forms->delete();
|
||||||
return redirect()->back()->with('success', 'Deleted Successfully');
|
return redirect()->back()->with('success', 'Deleted Successfully');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1,4 +1,7 @@
|
|||||||
<?php namespace App\Http\Controllers\Admin\helpdesk;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin\helpdesk;
|
||||||
|
|
||||||
// controllers
|
// controllers
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
// requests
|
// requests
|
||||||
@@ -12,6 +15,7 @@ use App\User;
|
|||||||
// classes
|
// classes
|
||||||
use Illuminate\Support\Facades\Input;
|
use Illuminate\Support\Facades\Input;
|
||||||
use Exception;
|
use Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GroupController
|
* GroupController
|
||||||
*
|
*
|
||||||
@@ -72,7 +76,7 @@ class GroupController extends Controller {
|
|||||||
return redirect('groups')->with('success', 'Group Created Successfully');
|
return redirect('groups')->with('success', 'Group Created Successfully');
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
/* redirect to Index page with Fails Message */
|
/* redirect to Index page with Fails Message */
|
||||||
return redirect('groups')->with('fails', 'Groups can not Create'.'<li>'.$e->errorInfo[2].'</li>');
|
return redirect('groups')->with('fails', 'Groups can not Create' . '<li>' . $e->errorInfo[2] . '</li>');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -87,7 +91,7 @@ class GroupController extends Controller {
|
|||||||
$groups = $group->whereId($id)->first();
|
$groups = $group->whereId($id)->first();
|
||||||
return view('themes.default1.admin.helpdesk.agent.groups.edit', compact('groups'));
|
return view('themes.default1.admin.helpdesk.agent.groups.edit', compact('groups'));
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
return redirect('groups')->with('fails', 'Groups can not Create'.'<li>'.$e->errorInfo[2].'</li>');
|
return redirect('groups')->with('fails', 'Groups can not Create' . '<li>' . $e->errorInfo[2] . '</li>');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -149,7 +153,7 @@ class GroupController extends Controller {
|
|||||||
return redirect('groups')->with('success', 'Group Updated Successfully');
|
return redirect('groups')->with('success', 'Group Updated Successfully');
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
/* redirect to Index page with Fails Message */
|
/* redirect to Index page with Fails Message */
|
||||||
return redirect('groups')->with('fails', 'Groups can not Create'.'<li>'.$e->errorInfo[2].'</li>');
|
return redirect('groups')->with('fails', 'Groups can not Create' . '<li>' . $e->errorInfo[2] . '</li>');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -162,7 +166,7 @@ class GroupController extends Controller {
|
|||||||
*/
|
*/
|
||||||
public function destroy($id, Groups $group, Group_assign_department $group_assign_department) {
|
public function destroy($id, Groups $group, Group_assign_department $group_assign_department) {
|
||||||
$users = User::where('assign_group', '=', $id)->first();
|
$users = User::where('assign_group', '=', $id)->first();
|
||||||
if($users){
|
if ($users) {
|
||||||
$user = '<li>There are agents assigned to this group. Please unassign them from this group to delete</li>';
|
$user = '<li>There are agents assigned to this group. Please unassign them from this group to delete</li>';
|
||||||
return redirect('groups')->with('fails', 'Group cannot Delete ' . $user);
|
return redirect('groups')->with('fails', 'Group cannot Delete ' . $user);
|
||||||
}
|
}
|
||||||
@@ -175,7 +179,8 @@ class GroupController extends Controller {
|
|||||||
return redirect('groups')->with('success', 'Group Deleted Successfully');
|
return redirect('groups')->with('success', 'Group Deleted Successfully');
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
/* redirect to Index page with Fails Message */
|
/* redirect to Index page with Fails Message */
|
||||||
return redirect('groups')->with('fails', 'Groups cannot Create'.'<li>'.$e->errorInfo[2].'</li>');
|
return redirect('groups')->with('fails', 'Groups cannot Create' . '<li>' . $e->errorInfo[2] . '</li>');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -1,4 +1,7 @@
|
|||||||
<?php namespace App\Http\Controllers\Admin\helpdesk;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin\helpdesk;
|
||||||
|
|
||||||
// controllers
|
// controllers
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
// requests
|
// requests
|
||||||
@@ -74,7 +77,7 @@ class HelptopicController extends Controller {
|
|||||||
$departments = $department->get();
|
$departments = $department->get();
|
||||||
$topics = $topic->get();
|
$topics = $topic->get();
|
||||||
$forms = $form->get();
|
$forms = $form->get();
|
||||||
$agents = $agent->where('role','=','agent')->get();
|
$agents = $agent->where('role', '=', 'agent')->get();
|
||||||
$slas = $sla->get();
|
$slas = $sla->get();
|
||||||
$priority = $priority->get();
|
$priority = $priority->get();
|
||||||
return view('themes.default1.admin.helpdesk.manage.helptopic.create', compact('priority', 'departments', 'topics', 'forms', 'agents', 'slas'));
|
return view('themes.default1.admin.helpdesk.manage.helptopic.create', compact('priority', 'departments', 'topics', 'forms', 'agents', 'slas'));
|
||||||
@@ -91,24 +94,24 @@ class HelptopicController extends Controller {
|
|||||||
*/
|
*/
|
||||||
public function store(Help_topic $topic, HelptopicRequest $request) {
|
public function store(Help_topic $topic, HelptopicRequest $request) {
|
||||||
try {
|
try {
|
||||||
if($request->custom_form){
|
if ($request->custom_form) {
|
||||||
$custom_form = $request->custom_form;
|
$custom_form = $request->custom_form;
|
||||||
} else {
|
} else {
|
||||||
$custom_form = null;
|
$custom_form = null;
|
||||||
}
|
}
|
||||||
if($request->auto_assign){
|
if ($request->auto_assign) {
|
||||||
$auto_assign = $request->auto_assign;
|
$auto_assign = $request->auto_assign;
|
||||||
} else {
|
} else {
|
||||||
$auto_assign = null;
|
$auto_assign = null;
|
||||||
}
|
}
|
||||||
/* Check whether function success or not */
|
/* Check whether function success or not */
|
||||||
$topic->fill($request->except('custom_form','auto_assign'))->save();
|
$topic->fill($request->except('custom_form', 'auto_assign'))->save();
|
||||||
// $topics->fill($request->except('custom_form','auto_assign'))->save();
|
// $topics->fill($request->except('custom_form','auto_assign'))->save();
|
||||||
/* redirect to Index page with Success Message */
|
/* redirect to Index page with Success Message */
|
||||||
return redirect('helptopic')->with('success', 'Helptopic Created Successfully');
|
return redirect('helptopic')->with('success', 'Helptopic Created Successfully');
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
/* redirect to Index page with Fails Message */
|
/* redirect to Index page with Fails Message */
|
||||||
return redirect('helptopic')->with('fails', 'Helptopic can not Create'.'<li>'.$e->errorInfo[2].'</li>');
|
return redirect('helptopic')->with('fails', 'Helptopic can not Create' . '<li>' . $e->errorInfo[2] . '</li>');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -125,7 +128,7 @@ class HelptopicController extends Controller {
|
|||||||
*/
|
*/
|
||||||
public function edit($id, Ticket_Priority $priority, Department $department, Help_topic $topic, Forms $form, Sla_plan $sla) {
|
public function edit($id, Ticket_Priority $priority, Department $department, Help_topic $topic, Forms $form, Sla_plan $sla) {
|
||||||
try {
|
try {
|
||||||
$agents = User::where('role','=','agent')->get();
|
$agents = User::where('role', '=', 'agent')->get();
|
||||||
$departments = $department->get();
|
$departments = $department->get();
|
||||||
$topics = $topic->whereId($id)->first();
|
$topics = $topic->whereId($id)->first();
|
||||||
$forms = $form->get();
|
$forms = $form->get();
|
||||||
@@ -133,7 +136,7 @@ class HelptopicController extends Controller {
|
|||||||
$priority = $priority->get();
|
$priority = $priority->get();
|
||||||
return view('themes.default1.admin.helpdesk.manage.helptopic.edit', compact('priority', 'departments', 'topics', 'forms', 'agents', 'slas'));
|
return view('themes.default1.admin.helpdesk.manage.helptopic.edit', compact('priority', 'departments', 'topics', 'forms', 'agents', 'slas'));
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
return redirect('helptopic')->with('fails', '<li>'.$e->errorInfo[2].'</li>');
|
return redirect('helptopic')->with('fails', '<li>' . $e->errorInfo[2] . '</li>');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -148,18 +151,18 @@ class HelptopicController extends Controller {
|
|||||||
// dd($request);
|
// dd($request);
|
||||||
try {
|
try {
|
||||||
$topics = $topic->whereId($id)->first();
|
$topics = $topic->whereId($id)->first();
|
||||||
if($request->custom_form){
|
if ($request->custom_form) {
|
||||||
$custom_form = $request->custom_form;
|
$custom_form = $request->custom_form;
|
||||||
} else {
|
} else {
|
||||||
$custom_form = null;
|
$custom_form = null;
|
||||||
}
|
}
|
||||||
if($request->auto_assign){
|
if ($request->auto_assign) {
|
||||||
$auto_assign = $request->auto_assign;
|
$auto_assign = $request->auto_assign;
|
||||||
} else {
|
} else {
|
||||||
$auto_assign = null;
|
$auto_assign = null;
|
||||||
}
|
}
|
||||||
/* Check whether function success or not */
|
/* Check whether function success or not */
|
||||||
$topics->fill($request->except('custom_form','auto_assign'))->save();
|
$topics->fill($request->except('custom_form', 'auto_assign'))->save();
|
||||||
$topics->custom_form = $custom_form;
|
$topics->custom_form = $custom_form;
|
||||||
$topics->auto_assign = $auto_assign;
|
$topics->auto_assign = $auto_assign;
|
||||||
$topics->save();
|
$topics->save();
|
||||||
@@ -167,7 +170,7 @@ class HelptopicController extends Controller {
|
|||||||
return redirect('helptopic')->with('success', 'Helptopic Updated Successfully');
|
return redirect('helptopic')->with('success', 'Helptopic Updated Successfully');
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
/* redirect to Index page with Fails Message */
|
/* redirect to Index page with Fails Message */
|
||||||
return redirect('helptopic')->with('fails', 'Helptopic can not Update'.'<li>'.$e->errorInfo[2].'</li>');
|
return redirect('helptopic')->with('fails', 'Helptopic can not Update' . '<li>' . $e->errorInfo[2] . '</li>');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -178,49 +181,50 @@ class HelptopicController extends Controller {
|
|||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function destroy($id, Help_topic $topic, Ticket $ticket_setting) {
|
public function destroy($id, Help_topic $topic, Ticket $ticket_setting) {
|
||||||
$ticket_settings = $ticket_setting->where('id','=','1')->first();
|
$ticket_settings = $ticket_setting->where('id', '=', '1')->first();
|
||||||
if($ticket_settings->help_topic == $id) {
|
if ($ticket_settings->help_topic == $id) {
|
||||||
return redirect('departments')->with('fails', 'You cannot delete default department');
|
return redirect('departments')->with('fails', 'You cannot delete default department');
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
$tickets = DB::table('tickets')->where('help_topic_id','=',$id)->update(['help_topic_id' => $ticket_settings->help_topic]);
|
$tickets = DB::table('tickets')->where('help_topic_id', '=', $id)->update(['help_topic_id' => $ticket_settings->help_topic]);
|
||||||
|
|
||||||
if($tickets > 0){
|
if ($tickets > 0) {
|
||||||
if($tickets > 1){
|
if ($tickets > 1) {
|
||||||
$text_tickets = "Tickets";
|
$text_tickets = "Tickets";
|
||||||
} else {
|
} else {
|
||||||
$text_tickets = "Ticket";
|
$text_tickets = "Ticket";
|
||||||
}
|
}
|
||||||
$ticket = '<li>'.$tickets.' '.$text_tickets.' have been moved to default Help Topic</li>';
|
$ticket = '<li>' . $tickets . ' ' . $text_tickets . ' have been moved to default Help Topic</li>';
|
||||||
} else {
|
} else {
|
||||||
$ticket = "";
|
$ticket = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
$emails = DB::table('emails')->where('help_topic','=',$id)->update(['help_topic' => $ticket_settings->help_topic]);
|
$emails = DB::table('emails')->where('help_topic', '=', $id)->update(['help_topic' => $ticket_settings->help_topic]);
|
||||||
|
|
||||||
if($emails > 0){
|
if ($emails > 0) {
|
||||||
if($emails > 1){
|
if ($emails > 1) {
|
||||||
$text_emails = "Emails";
|
$text_emails = "Emails";
|
||||||
} else {
|
} else {
|
||||||
$text_emails = "Email";
|
$text_emails = "Email";
|
||||||
}
|
}
|
||||||
$email = '<li>'.$emails.' System '.$text_emails.' have been moved to default Help Topic</li>';
|
$email = '<li>' . $emails . ' System ' . $text_emails . ' have been moved to default Help Topic</li>';
|
||||||
} else {
|
} else {
|
||||||
$email = "";
|
$email = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
$message = $ticket.$email;
|
$message = $ticket . $email;
|
||||||
|
|
||||||
$topics = $topic->whereId($id)->first();
|
$topics = $topic->whereId($id)->first();
|
||||||
/* Check whether function success or not */
|
/* Check whether function success or not */
|
||||||
try{
|
try {
|
||||||
$topics->delete();
|
$topics->delete();
|
||||||
/* redirect to Index page with Success Message */
|
/* redirect to Index page with Success Message */
|
||||||
return redirect('helptopic')->with('success', 'Helptopic Deleted Successfully'.$message);
|
return redirect('helptopic')->with('success', 'Helptopic Deleted Successfully' . $message);
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
/* redirect to Index page with Fails Message */
|
/* redirect to Index page with Fails Message */
|
||||||
return redirect('helptopic')->with('fails', 'Helptopic can not Delete'.'<li>'.$e->errorInfo[2].'</li>');
|
return redirect('helptopic')->with('fails', 'Helptopic can not Delete' . '<li>' . $e->errorInfo[2] . '</li>');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -1,4 +1,6 @@
|
|||||||
<?php namespace App\Http\Controllers\Admin\helpdesk;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin\helpdesk;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* -----------------------------------------------
|
* -----------------------------------------------
|
||||||
|
@@ -1,4 +1,7 @@
|
|||||||
<?php namespace App\Http\Controllers\Admin\helpdesk;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin\helpdesk;
|
||||||
|
|
||||||
// controllers
|
// controllers
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
// requests
|
// requests
|
||||||
@@ -48,8 +51,8 @@ class LanguageController extends Controller {
|
|||||||
// return Cache::get('language');
|
// return Cache::get('language');
|
||||||
//} else return 'false';
|
//} else return 'false';
|
||||||
// Cache::put('language',$)
|
// Cache::put('language',$)
|
||||||
$path = '../resources/lang';// Path to check available language packages
|
$path = '../resources/lang'; // Path to check available language packages
|
||||||
if(array_key_exists($lang, Config::get('languages')) && in_array($lang, scandir($path))) {
|
if (array_key_exists($lang, Config::get('languages')) && in_array($lang, scandir($path))) {
|
||||||
// dd(array_key_exists($lang, Config::get('languages')));
|
// dd(array_key_exists($lang, Config::get('languages')));
|
||||||
// app()->setLocale($lang);
|
// app()->setLocale($lang);
|
||||||
|
|
||||||
@@ -62,67 +65,59 @@ class LanguageController extends Controller {
|
|||||||
return Redirect::back();
|
return Redirect::back();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*Shows language page
|
* Shows language page
|
||||||
*@return type response
|
* @return type response
|
||||||
*/
|
*/
|
||||||
public function index(){
|
public function index() {
|
||||||
return view('themes.default1.admin.helpdesk.language.index');
|
return view('themes.default1.admin.helpdesk.language.index');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*Shows Language upload form
|
* Shows Language upload form
|
||||||
*@return type response
|
* @return type response
|
||||||
*/
|
*/
|
||||||
public function getForm(){
|
public function getForm() {
|
||||||
return view('themes.default1.admin.helpdesk.language.create');
|
return view('themes.default1.admin.helpdesk.language.create');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*Provide language datatable to language page
|
* Provide language datatable to language page
|
||||||
*@return type
|
* @return type
|
||||||
*/
|
*/
|
||||||
public function getLanguages()
|
public function getLanguages() {
|
||||||
{
|
|
||||||
$path = '../resources/lang';
|
$path = '../resources/lang';
|
||||||
$values = scandir($path); //Extracts names of directories present in lang directory
|
$values = scandir($path); //Extracts names of directories present in lang directory
|
||||||
$values = array_slice($values, 2); // skips array element $value[0] = '.' & $value[1] = '..'
|
$values = array_slice($values, 2); // skips array element $value[0] = '.' & $value[1] = '..'
|
||||||
return \Datatable::collection(new Collection($values))
|
return \Datatable::collection(new Collection($values))
|
||||||
|
->addColumn('language', function($model) {
|
||||||
->addColumn('language', function($model){
|
return Config::get('languages.' . $model);
|
||||||
return Config::get('languages.'.$model);
|
|
||||||
})
|
})
|
||||||
|
->addColumn('id', function($model) {
|
||||||
->addColumn('id', function($model){
|
|
||||||
return $model;
|
return $model;
|
||||||
})
|
})
|
||||||
|
->addColumn('status', function($model) {
|
||||||
->addColumn('status',function($model){
|
if (Lang::getLocale() === $model) {
|
||||||
if(Lang::getLocale()===$model){return "<span style='color:green'>".Lang::trans("lang.active")."</span>"; } else return "<span style='color:red'>".Lang::trans("lang.inactive")."</span>";
|
return "<span style='color:green'>" . Lang::trans("lang.active") . "</span>";
|
||||||
|
} else
|
||||||
|
return "<span style='color:red'>" . Lang::trans("lang.inactive") . "</span>";
|
||||||
})
|
})
|
||||||
|
->addColumn('Action', function($model) {
|
||||||
->addColumn('Action', function($model){
|
if (Lang::getLocale() === $model) {
|
||||||
if(Lang::getLocale()===$model){
|
return "<a href='change-language/" . $model . "'><input type='button' class='btn btn-info btn-xs btn-flat' disabled value='" . Lang::trans("lang.disable") . "'/></a>
|
||||||
return "<a href='change-language/".$model."'><input type='button' class='btn btn-info btn-xs btn-flat' disabled value='". Lang::trans("lang.disable")."'/></a>
|
<a href='change-language/" . $model . "' class='btn btn-danger btn-xs btn-flat' disabled><i class='fa fa-trash' style='color:black;'> </i> " . Lang::trans("lang.delete") . "</a>";
|
||||||
<a href='change-language/".$model."' class='btn btn-danger btn-xs btn-flat' disabled><i class='fa fa-trash' style='color:black;'> </i> ". Lang::trans("lang.delete")."</a>";
|
|
||||||
} else {
|
} else {
|
||||||
return "<a href='change-language/".$model."'><input type='button' class='btn btn-info btn-xs btn-flat' value='". Lang::trans("lang.enable")."'/></a>
|
return "<a href='change-language/" . $model . "'><input type='button' class='btn btn-info btn-xs btn-flat' value='" . Lang::trans("lang.enable") . "'/></a>
|
||||||
<a href='delete-language/".$model."' class='btn btn-danger btn-xs btn-flat'><i class='fa fa-trash' style='color:black;'> </i> ". Lang::trans("lang.delete")."</a>";
|
<a href='delete-language/" . $model . "' class='btn btn-danger btn-xs btn-flat'><i class='fa fa-trash' style='color:black;'> </i> " . Lang::trans("lang.delete") . "</a>";
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
->searchColumns('language','id')
|
->searchColumns('language', 'id')
|
||||||
|
|
||||||
->make();
|
->make();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*handle language file uploading
|
* handle language file uploading
|
||||||
*@return response
|
* @return response
|
||||||
*/
|
*/
|
||||||
public function postForm() {
|
public function postForm() {
|
||||||
// getting all of the post data
|
// getting all of the post data
|
||||||
@@ -138,14 +133,12 @@ class LanguageController extends Controller {
|
|||||||
'language-name' => 'required',
|
'language-name' => 'required',
|
||||||
'iso-code' => 'required|max:2'
|
'iso-code' => 'required|max:2'
|
||||||
); // and for max size
|
); // and for max size
|
||||||
|
|
||||||
// doing the validation, passing post data, rules and the messages
|
// doing the validation, passing post data, rules and the messages
|
||||||
$validator = Validator::make($file, $rules);
|
$validator = Validator::make($file, $rules);
|
||||||
if ($validator->fails()) {
|
if ($validator->fails()) {
|
||||||
|
|
||||||
// send back to the page with the input data and errors
|
// send back to the page with the input data and errors
|
||||||
return Redirect::back()->withInput()->withErrors($validator);
|
return Redirect::back()->withInput()->withErrors($validator);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
|
||||||
@@ -155,43 +148,39 @@ class LanguageController extends Controller {
|
|||||||
|
|
||||||
//sending back with error message
|
//sending back with error message
|
||||||
Session::flash('fails', Lang::get('lang.package_exist'));
|
Session::flash('fails', Lang::get('lang.package_exist'));
|
||||||
Session::flash('link',"change-language/".strtolower(Input::get('iso-code')));
|
Session::flash('link', "change-language/" . strtolower(Input::get('iso-code')));
|
||||||
return Redirect::back()->withInput();
|
return Redirect::back()->withInput();
|
||||||
|
} elseif (!array_key_exists(strtolower(Input::get('iso-code')), Config::get('languages'))) {//Checking Valid ISO code form Languages.php
|
||||||
} elseif (!array_key_exists(strtolower(Input::get('iso-code')), Config::get('languages'))){//Checking Valid ISO code form Languages.php
|
|
||||||
|
|
||||||
//sending back with error message
|
//sending back with error message
|
||||||
Session::flash('fails', Lang::get('lang.iso-code-error'));
|
Session::flash('fails', Lang::get('lang.iso-code-error'));
|
||||||
return Redirect::back()->withInput();
|
return Redirect::back()->withInput();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
// checking file is valid.
|
// checking file is valid.
|
||||||
if (Input::file('File')->isValid()) {
|
if (Input::file('File')->isValid()) {
|
||||||
$name = Input::file('File')->getClientOriginalName(); //uploaded file's original name
|
$name = Input::file('File')->getClientOriginalName(); //uploaded file's original name
|
||||||
$destinationPath = '../public/uploads/'; // defining uploading path
|
$destinationPath = '../public/uploads/'; // defining uploading path
|
||||||
$extractpath = '../resources/lang/'.strtolower(Input::get('iso-code'));//defining extracting path
|
$extractpath = '../resources/lang/' . strtolower(Input::get('iso-code')); //defining extracting path
|
||||||
mkdir($extractpath); //creating directroy for extracting uploadd file
|
mkdir($extractpath); //creating directroy for extracting uploadd file
|
||||||
//mkdir($destinationPath);
|
//mkdir($destinationPath);
|
||||||
Input::file('File')->move($destinationPath, $name); // uploading file to given path
|
Input::file('File')->move($destinationPath, $name); // uploading file to given path
|
||||||
\Zipper::make($destinationPath.'/'.$name)->extractTo($extractpath);//extracting file to give path
|
\Zipper::make($destinationPath . '/' . $name)->extractTo($extractpath); //extracting file to give path
|
||||||
|
|
||||||
//check if Zip extract foldercontains any subfolder
|
//check if Zip extract foldercontains any subfolder
|
||||||
$directories = File::directories($extractpath);
|
$directories = File::directories($extractpath);
|
||||||
//$directories = glob($extractpath. '/*' , GLOB_ONLYDIR);
|
//$directories = glob($extractpath. '/*' , GLOB_ONLYDIR);
|
||||||
if(!empty($directories)){ //if extract folder contains subfolder
|
if (!empty($directories)) { //if extract folder contains subfolder
|
||||||
$success = File::deleteDirectory($extractpath); //remove extracted folder and it's subfolder from lang
|
$success = File::deleteDirectory($extractpath); //remove extracted folder and it's subfolder from lang
|
||||||
//$success2 = File::delete($destinationPath.'/'.$name);
|
//$success2 = File::delete($destinationPath.'/'.$name);
|
||||||
if($success){
|
if ($success) {
|
||||||
//sending back with error message
|
//sending back with error message
|
||||||
Session::flash('fails', Lang::get('lang.zipp-error'));
|
Session::flash('fails', Lang::get('lang.zipp-error'));
|
||||||
Session::flash('link2',"http://www.ladybirdweb.com/support/show/how-to-translate-faveo-into-multiple-languages");
|
Session::flash('link2', "http://www.ladybirdweb.com/support/show/how-to-translate-faveo-into-multiple-languages");
|
||||||
return Redirect::back()->withInput();
|
return Redirect::back()->withInput();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// sending back with success message
|
// sending back with success message
|
||||||
Session::flash('success', Lang::get("lang.upload-success"));
|
Session::flash('success', Lang::get("lang.upload-success"));
|
||||||
Session::flash('link',"change-language/".strtolower(Input::get('iso-code')));
|
Session::flash('link', "change-language/" . strtolower(Input::get('iso-code')));
|
||||||
return Redirect::route('LanguageController');
|
return Redirect::route('LanguageController');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -204,8 +193,8 @@ class LanguageController extends Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*allow user to download language template file
|
* allow user to download language template file
|
||||||
*@return type
|
* @return type
|
||||||
*/
|
*/
|
||||||
Public function download() {
|
Public function download() {
|
||||||
return response()->download('../public/downloads/en.zip');
|
return response()->download('../public/downloads/en.zip');
|
||||||
@@ -216,11 +205,11 @@ class LanguageController extends Controller {
|
|||||||
* @param type $lang
|
* @param type $lang
|
||||||
* @return type response
|
* @return type response
|
||||||
*/
|
*/
|
||||||
public function deleteLanguage($lang){
|
public function deleteLanguage($lang) {
|
||||||
if($lang !== App::getLocale()){
|
if ($lang !== App::getLocale()) {
|
||||||
$deletePath = '../resources/lang/'.$lang; //define file path to delete
|
$deletePath = '../resources/lang/' . $lang; //define file path to delete
|
||||||
$success = File::deleteDirectory($deletePath); //remove extracted folder and it's subfolder from lang
|
$success = File::deleteDirectory($deletePath); //remove extracted folder and it's subfolder from lang
|
||||||
if($success) {
|
if ($success) {
|
||||||
//sending back with success message
|
//sending back with success message
|
||||||
Session::flash('success', Lang::get('lang.delete-success'));
|
Session::flash('success', Lang::get('lang.delete-success'));
|
||||||
return Redirect::back();
|
return Redirect::back();
|
||||||
@@ -235,4 +224,5 @@ class LanguageController extends Controller {
|
|||||||
return redirect('languages');
|
return redirect('languages');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -1,4 +1,7 @@
|
|||||||
<?php namespace App\Http\Controllers\Admin\helpdesk;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin\helpdesk;
|
||||||
|
|
||||||
// controllers
|
// controllers
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
// requests
|
// requests
|
||||||
@@ -120,4 +123,5 @@ class ProfileController extends Controller {
|
|||||||
return redirect('guest')->with('fails', 'Password was not Updated');
|
return redirect('guest')->with('fails', 'Password was not Updated');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -1,4 +1,7 @@
|
|||||||
<?php namespace App\Http\Controllers\Admin\helpdesk;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin\helpdesk;
|
||||||
|
|
||||||
// controllers
|
// controllers
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
// requests
|
// requests
|
||||||
@@ -27,7 +30,6 @@ use App\Model\helpdesk\Utility\Time_format;
|
|||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Input;
|
use Input;
|
||||||
use Exception;
|
use Exception;
|
||||||
use DB;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SettingsController
|
* SettingsController
|
||||||
@@ -55,25 +57,7 @@ class SettingsController extends Controller {
|
|||||||
public function settings() {
|
public function settings() {
|
||||||
return view('themes.default1.admin.helpdesk.setting');
|
return view('themes.default1.admin.helpdesk.setting');
|
||||||
}
|
}
|
||||||
public function RatingSettings() {
|
|
||||||
$ratings = DB::table('settings_ratings')->get();
|
|
||||||
|
|
||||||
return view('themes.default1.admin.helpdesk.settings.ratings',compact('ratings'));
|
|
||||||
}
|
|
||||||
public function PostRatingSettings($slug) {
|
|
||||||
$name = Input::get('rating_name');
|
|
||||||
$publish = Input::get('publish');
|
|
||||||
$modify = Input::get('modify');
|
|
||||||
|
|
||||||
DB::table('settings_ratings')->whereSlug($slug)->update(array('rating_name' => $name,'publish' => $publish, 'modify' => $modify));
|
|
||||||
|
|
||||||
return redirect()->back()->with('success', 'Successfully updated');
|
|
||||||
}
|
|
||||||
public function RatingDelete($slug) {
|
|
||||||
DB::table('settings_ratings')->whereSlug($slug)->delete();
|
|
||||||
|
|
||||||
return redirect()->back()->with('success', 'Successfully Deleted');
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* @param int $id
|
* @param int $id
|
||||||
* @return Response
|
* @return Response
|
||||||
@@ -88,7 +72,7 @@ public function RatingSettings() {
|
|||||||
/* Direct to Company Settings Page */
|
/* Direct to Company Settings Page */
|
||||||
return view('themes.default1.admin.helpdesk.settings.company', compact('companys'));
|
return view('themes.default1.admin.helpdesk.settings.company', compact('companys'));
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
return redirect()->back()->with('fails',$e->errorInfo[2]);
|
return redirect()->back()->with('fails', $e->errorInfo[2]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -109,7 +93,7 @@ public function RatingSettings() {
|
|||||||
Input::file('logo')->move($destinationPath, $fileName);
|
Input::file('logo')->move($destinationPath, $fileName);
|
||||||
$companys->logo = $fileName;
|
$companys->logo = $fileName;
|
||||||
}
|
}
|
||||||
if($request->input('use_logo')==null) {
|
if ($request->input('use_logo') == null) {
|
||||||
$companys->use_logo = '0';
|
$companys->use_logo = '0';
|
||||||
}
|
}
|
||||||
/* Check whether function success or not */
|
/* Check whether function success or not */
|
||||||
@@ -119,7 +103,7 @@ public function RatingSettings() {
|
|||||||
return redirect('getcompany')->with('success', 'Company Updated Successfully');
|
return redirect('getcompany')->with('success', 'Company Updated Successfully');
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
/* redirect to Index page with Fails Message */
|
/* redirect to Index page with Fails Message */
|
||||||
return redirect('getcompany')->with('fails', 'Company can not Updated'.'<li>'.$e->errorInfo[2].'</li>');
|
return redirect('getcompany')->with('fails', 'Company can not Updated' . '<li>' . $e->errorInfo[2] . '</li>');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -144,7 +128,7 @@ public function RatingSettings() {
|
|||||||
/* Direct to System Settings Page */
|
/* Direct to System Settings Page */
|
||||||
return view('themes.default1.admin.helpdesk.settings.system', compact('systems', 'departments', 'timezones', 'time', 'date', 'date_time'));
|
return view('themes.default1.admin.helpdesk.settings.system', compact('systems', 'departments', 'timezones', 'time', 'date', 'date_time'));
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
return redirect()->back()->with('fails',$e->errorInfo[2]);
|
return redirect()->back()->with('fails', $e->errorInfo[2]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -167,7 +151,7 @@ public function RatingSettings() {
|
|||||||
return redirect('getsystem')->with('success', 'System Updated Successfully');
|
return redirect('getsystem')->with('success', 'System Updated Successfully');
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
/* redirect to Index page with Fails Message */
|
/* redirect to Index page with Fails Message */
|
||||||
return redirect('getsystem')->with('fails', 'System can not Updated'.'<li>'.$e->errorInfo[2].'</li>');
|
return redirect('getsystem')->with('fails', 'System can not Updated' . '<li>' . $e->errorInfo[2] . '</li>');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -190,7 +174,7 @@ public function RatingSettings() {
|
|||||||
/* Direct to Ticket Settings Page */
|
/* Direct to Ticket Settings Page */
|
||||||
return view('themes.default1.admin.helpdesk.settings.ticket', compact('tickets', 'slas', 'topics', 'priority'));
|
return view('themes.default1.admin.helpdesk.settings.ticket', compact('tickets', 'slas', 'topics', 'priority'));
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
return redirect()->back()->with('fails',$e->errorInfo[2]);
|
return redirect()->back()->with('fails', $e->errorInfo[2]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -215,13 +199,14 @@ public function RatingSettings() {
|
|||||||
$tickets->agent_mask = $request->input('agent_mask');
|
$tickets->agent_mask = $request->input('agent_mask');
|
||||||
$tickets->html = $request->input('html');
|
$tickets->html = $request->input('html');
|
||||||
$tickets->client_update = $request->input('client_update');
|
$tickets->client_update = $request->input('client_update');
|
||||||
|
$tickets->collision_avoid = $request->input('collision_avoid');
|
||||||
/* Check whether function success or not */
|
/* Check whether function success or not */
|
||||||
$tickets->save();
|
$tickets->save();
|
||||||
/* redirect to Index page with Success Message */
|
/* redirect to Index page with Success Message */
|
||||||
return redirect('getticket')->with('success', 'Ticket Updated Successfully');
|
return redirect('getticket')->with('success', 'Ticket Updated Successfully');
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
/* redirect to Index page with Fails Message */
|
/* redirect to Index page with Fails Message */
|
||||||
return redirect('getticket')->with('fails', 'Ticket can not Updated'.'<li>'.$e->errorInfo[2].'</li>');
|
return redirect('getticket')->with('fails', 'Ticket can not Updated' . '<li>' . $e->errorInfo[2] . '</li>');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -243,7 +228,7 @@ public function RatingSettings() {
|
|||||||
/* Direct to Email Settings Page */
|
/* Direct to Email Settings Page */
|
||||||
return view('themes.default1.admin.helpdesk.settings.email', compact('emails', 'templates', 'emails1'));
|
return view('themes.default1.admin.helpdesk.settings.email', compact('emails', 'templates', 'emails1'));
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
return redirect()->back()->with('fails',$e->errorInfo[2]);
|
return redirect()->back()->with('fails', $e->errorInfo[2]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -273,7 +258,7 @@ public function RatingSettings() {
|
|||||||
return redirect('getemail')->with('success', 'Email Updated Successfully');
|
return redirect('getemail')->with('success', 'Email Updated Successfully');
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
/* redirect to Index page with Fails Message */
|
/* redirect to Index page with Fails Message */
|
||||||
return redirect('getemail')->with('fails', 'Email can not Updated'.'<li>'.$e->errorInfo[2].'</li>');
|
return redirect('getemail')->with('fails', 'Email can not Updated' . '<li>' . $e->errorInfo[2] . '</li>');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -336,7 +321,7 @@ public function RatingSettings() {
|
|||||||
/* Direct to Responder Settings Page */
|
/* Direct to Responder Settings Page */
|
||||||
return view('themes.default1.admin.helpdesk.settings.responder', compact('responders'));
|
return view('themes.default1.admin.helpdesk.settings.responder', compact('responders'));
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
return redirect()->back()->with('fails',$e->errorInfo[2]);
|
return redirect()->back()->with('fails', $e->errorInfo[2]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -363,7 +348,7 @@ public function RatingSettings() {
|
|||||||
return redirect('getresponder')->with('success', 'Responder Updated Successfully');
|
return redirect('getresponder')->with('success', 'Responder Updated Successfully');
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
/* redirect to Index page with Fails Message */
|
/* redirect to Index page with Fails Message */
|
||||||
return redirect('getresponder')->with('fails', 'Responder can not Updated'.'<li>'.$e->errorInfo[2].'</li>');
|
return redirect('getresponder')->with('fails', 'Responder can not Updated' . '<li>' . $e->errorInfo[2] . '</li>');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -379,7 +364,7 @@ public function RatingSettings() {
|
|||||||
/* Direct to Alert Settings Page */
|
/* Direct to Alert Settings Page */
|
||||||
return view('themes.default1.admin.helpdesk.settings.alert', compact('alerts'));
|
return view('themes.default1.admin.helpdesk.settings.alert', compact('alerts'));
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
return redirect()->back()->with('fails',$e->errorInfo[2]);
|
return redirect()->back()->with('fails', $e->errorInfo[2]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -425,7 +410,7 @@ public function RatingSettings() {
|
|||||||
$alerts->ticket_department_member = $request->input('ticket_department_member');
|
$alerts->ticket_department_member = $request->input('ticket_department_member');
|
||||||
$alerts->ticket_admin_email = $request->input('ticket_admin_email');
|
$alerts->ticket_admin_email = $request->input('ticket_admin_email');
|
||||||
|
|
||||||
if($request->input('system_error') == null){
|
if ($request->input('system_error') == null) {
|
||||||
$str = '%0%';
|
$str = '%0%';
|
||||||
$path = app_path('../config/app.php');
|
$path = app_path('../config/app.php');
|
||||||
$content = \File::get($path);
|
$content = \File::get($path);
|
||||||
@@ -445,8 +430,38 @@ public function RatingSettings() {
|
|||||||
return redirect('getalert')->with('success', 'Alert Updated Successfully');
|
return redirect('getalert')->with('success', 'Alert Updated Successfully');
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
/* redirect to Index page with Fails Message */
|
/* redirect to Index page with Fails Message */
|
||||||
return redirect('getalert')->with('fails', 'Alert can not Updated'.'<li>'.$e->errorInfo[2].'</li>');
|
return redirect('getalert')->with('fails', 'Alert can not Updated' . '<li>' . $e->errorInfo[2] . '</li>');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* To display the list of ratings in the system
|
||||||
|
* @return type View
|
||||||
|
*/
|
||||||
|
public function RatingSettings() {
|
||||||
|
$ratings = DB::table('settings_ratings')->get();
|
||||||
|
return view('themes.default1.admin.helpdesk.settings.ratings', compact('ratings'));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* To store rating data
|
||||||
|
* @return type Redirect
|
||||||
|
*/
|
||||||
|
public function PostRatingSettings($slug) {
|
||||||
|
$name = Input::get('rating_name');
|
||||||
|
$publish = Input::get('publish');
|
||||||
|
$modify = Input::get('modify');
|
||||||
|
DB::table('settings_ratings')->whereSlug($slug)->update(array('rating_name' => $name, 'publish' => $publish, 'modify' => $modify));
|
||||||
|
return redirect()->back()->with('success', 'Successfully updated');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* To delete a type of rating
|
||||||
|
* @return type Redirect
|
||||||
|
*/
|
||||||
|
public function RatingDelete($slug) {
|
||||||
|
DB::table('settings_ratings')->whereSlug($slug)->delete();
|
||||||
|
return redirect()->back()->with('success', 'Successfully Deleted');
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -1,16 +1,15 @@
|
|||||||
<?php namespace App\Http\Controllers\Admin\helpdesk;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin\helpdesk;
|
||||||
|
|
||||||
// controllers
|
// controllers
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
|
|
||||||
// requests
|
// requests
|
||||||
use App\Http\Requests\helpdesk\SlaRequest;
|
use App\Http\Requests\helpdesk\SlaRequest;
|
||||||
use App\Http\Requests\helpdesk\SlaUpdate;
|
use App\Http\Requests\helpdesk\SlaUpdate;
|
||||||
|
|
||||||
// models
|
// models
|
||||||
use App\Model\helpdesk\Manage\Sla_plan;
|
use App\Model\helpdesk\Manage\Sla_plan;
|
||||||
use App\Model\helpdesk\Settings\Ticket;
|
use App\Model\helpdesk\Settings\Ticket;
|
||||||
|
|
||||||
//classes
|
//classes
|
||||||
use DB;
|
use DB;
|
||||||
use Exception;
|
use Exception;
|
||||||
@@ -45,7 +44,7 @@ class SlaController extends Controller {
|
|||||||
/* Listing the values From Sla_plan Table */
|
/* Listing the values From Sla_plan Table */
|
||||||
return view('themes.default1.admin.helpdesk.manage.sla.index', compact('slas'));
|
return view('themes.default1.admin.helpdesk.manage.sla.index', compact('slas'));
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
return redirect()->back()->with('fails',$e->errorInfo[2]);
|
return redirect()->back()->with('fails', $e->errorInfo[2]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -58,7 +57,7 @@ class SlaController extends Controller {
|
|||||||
/* Direct to Create Page */
|
/* Direct to Create Page */
|
||||||
return view('themes.default1.admin.helpdesk.manage.sla.create');
|
return view('themes.default1.admin.helpdesk.manage.sla.create');
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
return redirect()->back()->with('fails',$e->errorInfo[2]);
|
return redirect()->back()->with('fails', $e->errorInfo[2]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -77,7 +76,7 @@ class SlaController extends Controller {
|
|||||||
return redirect('sla')->with('success', 'SLA Plan Created Successfully');
|
return redirect('sla')->with('success', 'SLA Plan Created Successfully');
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
/* redirect to Index page with Fails Message */
|
/* redirect to Index page with Fails Message */
|
||||||
return redirect('sla')->with('fails', 'SLA Plan can not Create'.'<li>'.$e->errorInfo[2].'</li>');
|
return redirect('sla')->with('fails', 'SLA Plan can not Create' . '<li>' . $e->errorInfo[2] . '</li>');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -94,7 +93,7 @@ class SlaController extends Controller {
|
|||||||
$slas->get();
|
$slas->get();
|
||||||
return view('themes.default1.admin.helpdesk.manage.sla.edit', compact('slas'));
|
return view('themes.default1.admin.helpdesk.manage.sla.edit', compact('slas'));
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
return redirect()->back()->with('fails',$e->errorInfo[2]);
|
return redirect()->back()->with('fails', $e->errorInfo[2]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -120,7 +119,7 @@ class SlaController extends Controller {
|
|||||||
return redirect('sla')->with('success', 'SLA Plan Updated Successfully');
|
return redirect('sla')->with('success', 'SLA Plan Updated Successfully');
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
/* redirect to Index page with Fails Message */
|
/* redirect to Index page with Fails Message */
|
||||||
return redirect('sla')->with('fails', 'SLA Plan can not Update'.'<li>'.$e->errorInfo[2].'</li>');
|
return redirect('sla')->with('fails', 'SLA Plan can not Update' . '<li>' . $e->errorInfo[2] . '</li>');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -131,24 +130,24 @@ class SlaController extends Controller {
|
|||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function destroy($id, Sla_plan $sla) {
|
public function destroy($id, Sla_plan $sla) {
|
||||||
$default_sla = Ticket::where('id','=','1')->first();
|
$default_sla = Ticket::where('id', '=', '1')->first();
|
||||||
if($default_sla->sla == $id) {
|
if ($default_sla->sla == $id) {
|
||||||
return redirect('departments')->with('fails', 'You cannot delete default department');
|
return redirect('departments')->with('fails', 'You cannot delete default department');
|
||||||
} else {
|
} else {
|
||||||
$tickets = DB::table('tickets')->where('sla','=',$id)->update(['sla' => $default_sla->sla]);
|
$tickets = DB::table('tickets')->where('sla', '=', $id)->update(['sla' => $default_sla->sla]);
|
||||||
if($tickets > 0) {
|
if ($tickets > 0) {
|
||||||
if($tickets > 1) {
|
if ($tickets > 1) {
|
||||||
$text_tickets = "Tickets";
|
$text_tickets = "Tickets";
|
||||||
} else {
|
} else {
|
||||||
$text_tickets = "Ticket";
|
$text_tickets = "Ticket";
|
||||||
}
|
}
|
||||||
$ticket = '<li>'.$tickets.' '.$text_tickets.' have been moved to default SLA</li>';
|
$ticket = '<li>' . $tickets . ' ' . $text_tickets . ' have been moved to default SLA</li>';
|
||||||
} else {
|
} else {
|
||||||
$ticket = "";
|
$ticket = "";
|
||||||
}
|
}
|
||||||
$dept = DB::table('department')->where('sla','=',$id)->update(['sla' => $default_sla->sla]);
|
$dept = DB::table('department')->where('sla', '=', $id)->update(['sla' => $default_sla->sla]);
|
||||||
if($dept > 0){
|
if ($dept > 0) {
|
||||||
if($dept > 1){
|
if ($dept > 1) {
|
||||||
$text_dept = "Emails";
|
$text_dept = "Emails";
|
||||||
} else {
|
} else {
|
||||||
$text_dept = "Email";
|
$text_dept = "Email";
|
||||||
@@ -157,9 +156,9 @@ class SlaController extends Controller {
|
|||||||
} else {
|
} else {
|
||||||
$dept = "";
|
$dept = "";
|
||||||
}
|
}
|
||||||
$topic = DB::table('help_topic')->where('sla_plan','=',$id)->update(['sla_plan' => $default_sla->sla]);
|
$topic = DB::table('help_topic')->where('sla_plan', '=', $id)->update(['sla_plan' => $default_sla->sla]);
|
||||||
if($topic > 0){
|
if ($topic > 0) {
|
||||||
if($topic > 1){
|
if ($topic > 1) {
|
||||||
$text_topic = "Emails";
|
$text_topic = "Emails";
|
||||||
} else {
|
} else {
|
||||||
$text_topic = "Email";
|
$text_topic = "Email";
|
||||||
@@ -168,17 +167,17 @@ class SlaController extends Controller {
|
|||||||
} else {
|
} else {
|
||||||
$topic = "";
|
$topic = "";
|
||||||
}
|
}
|
||||||
$message = $ticket.$dept.$topic;
|
$message = $ticket . $dept . $topic;
|
||||||
/* Delete a perticular field from the database by delete() using Id */
|
/* Delete a perticular field from the database by delete() using Id */
|
||||||
$slas = $sla->whereId($id)->first();
|
$slas = $sla->whereId($id)->first();
|
||||||
/* Check whether function success or not */
|
/* Check whether function success or not */
|
||||||
try{
|
try {
|
||||||
$slas->delete();
|
$slas->delete();
|
||||||
/* redirect to Index page with Success Message */
|
/* redirect to Index page with Success Message */
|
||||||
return redirect('sla')->with('success', 'SLA Plan Deleted Successfully'.$message);
|
return redirect('sla')->with('success', 'SLA Plan Deleted Successfully' . $message);
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
/* redirect to Index page with Fails Message */
|
/* redirect to Index page with Fails Message */
|
||||||
return redirect('sla')->with('fails', 'SLA Plan can not Delete'.'<li>'.$e->errorInfo[2].'</li>');
|
return redirect('sla')->with('fails', 'SLA Plan can not Delete' . '<li>' . $e->errorInfo[2] . '</li>');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,17 +1,16 @@
|
|||||||
<?php namespace App\Http\Controllers\Admin\helpdesk;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin\helpdesk;
|
||||||
|
|
||||||
// controllers
|
// controllers
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
|
|
||||||
// requests
|
// requests
|
||||||
use App\Http\Requests\helpdesk\TeamRequest;
|
use App\Http\Requests\helpdesk\TeamRequest;
|
||||||
use App\Http\Requests\helpdesk\TeamUpdate;
|
use App\Http\Requests\helpdesk\TeamUpdate;
|
||||||
|
|
||||||
// models
|
// models
|
||||||
use App\Model\helpdesk\Agent\Assign_team_agent;
|
use App\Model\helpdesk\Agent\Assign_team_agent;
|
||||||
use App\Model\helpdesk\Agent\Teams;
|
use App\Model\helpdesk\Agent\Teams;
|
||||||
use App\User;
|
use App\User;
|
||||||
|
|
||||||
// classes
|
// classes
|
||||||
use DB;
|
use DB;
|
||||||
use Exception;
|
use Exception;
|
||||||
@@ -48,7 +47,7 @@ class TeamController extends Controller {
|
|||||||
$assign_team_agent = $assign_team_agent->get();
|
$assign_team_agent = $assign_team_agent->get();
|
||||||
return view('themes.default1.admin.helpdesk.agent.teams.index', compact('assign_team_agent', 'teams'));
|
return view('themes.default1.admin.helpdesk.agent.teams.index', compact('assign_team_agent', 'teams'));
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
return redirect()->back()->with('fails',$e->errorInfo[2]);
|
return redirect()->back()->with('fails', $e->errorInfo[2]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -62,7 +61,7 @@ class TeamController extends Controller {
|
|||||||
$user = $user->get();
|
$user = $user->get();
|
||||||
return view('themes.default1.admin.helpdesk.agent.teams.create', compact('user'));
|
return view('themes.default1.admin.helpdesk.agent.teams.create', compact('user'));
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
return redirect()->back()->with('fails',$e->errorInfo[2]);
|
return redirect()->back()->with('fails', $e->errorInfo[2]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -74,7 +73,7 @@ class TeamController extends Controller {
|
|||||||
*/
|
*/
|
||||||
public function store(Teams $team, TeamRequest $request) {
|
public function store(Teams $team, TeamRequest $request) {
|
||||||
|
|
||||||
if($request->team_lead){
|
if ($request->team_lead) {
|
||||||
$team_lead = $request->team_lead;
|
$team_lead = $request->team_lead;
|
||||||
} else {
|
} else {
|
||||||
$team_lead = null;
|
$team_lead = null;
|
||||||
@@ -87,7 +86,7 @@ class TeamController extends Controller {
|
|||||||
return redirect('teams')->with('success', 'Teams Created Successfully');
|
return redirect('teams')->with('success', 'Teams Created Successfully');
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
/* redirect to Index page with Fails Message */
|
/* redirect to Index page with Fails Message */
|
||||||
return redirect('teams')->with('fails', 'Teams can not Create'.'<li>'.$e->errorInfo[2].'</li>');
|
return redirect('teams')->with('fails', 'Teams can not Create' . '<li>' . $e->errorInfo[2] . '</li>');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -107,7 +106,7 @@ class TeamController extends Controller {
|
|||||||
$agent_id = $agent_team->lists('agent_id', 'agent_id');
|
$agent_id = $agent_team->lists('agent_id', 'agent_id');
|
||||||
return view('themes.default1.admin.helpdesk.agent.teams.edit', compact('agent_id', 'user', 'teams', 'allagents'));
|
return view('themes.default1.admin.helpdesk.agent.teams.edit', compact('agent_id', 'user', 'teams', 'allagents'));
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
return redirect()->back()->with('fails',$e->errorInfo[2]);
|
return redirect()->back()->with('fails', $e->errorInfo[2]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -122,7 +121,7 @@ class TeamController extends Controller {
|
|||||||
|
|
||||||
$teams = $team->whereId($id)->first();
|
$teams = $team->whereId($id)->first();
|
||||||
//updating check box
|
//updating check box
|
||||||
if($request->team_lead){
|
if ($request->team_lead) {
|
||||||
$team_lead = $request->team_lead;
|
$team_lead = $request->team_lead;
|
||||||
} else {
|
} else {
|
||||||
$team_lead = null;
|
$team_lead = null;
|
||||||
@@ -141,7 +140,7 @@ class TeamController extends Controller {
|
|||||||
return redirect('teams')->with('success', 'Teams Updated Successfully');
|
return redirect('teams')->with('success', 'Teams Updated Successfully');
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
/* redirect to Index page with Fails Message */
|
/* redirect to Index page with Fails Message */
|
||||||
return redirect('teams')->with('fails', 'Teams can not Update'.'<li>'.$e->errorInfo[2].'</li>');
|
return redirect('teams')->with('fails', 'Teams can not Update' . '<li>' . $e->errorInfo[2] . '</li>');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -156,14 +155,15 @@ class TeamController extends Controller {
|
|||||||
try {
|
try {
|
||||||
$assign_team_agent->where('team_id', $id)->delete();
|
$assign_team_agent->where('team_id', $id)->delete();
|
||||||
$teams = $team->whereId($id)->first();
|
$teams = $team->whereId($id)->first();
|
||||||
$tickets = DB::table('tickets')->where('team_id','=',$id)->update(['team_id' => null]);
|
$tickets = DB::table('tickets')->where('team_id', '=', $id)->update(['team_id' => null]);
|
||||||
/* Check whether function success or not */
|
/* Check whether function success or not */
|
||||||
$teams->delete();
|
$teams->delete();
|
||||||
/* redirect to Index page with Success Message */
|
/* redirect to Index page with Success Message */
|
||||||
return redirect('teams')->with('success', 'Teams Deleted Successfully');
|
return redirect('teams')->with('success', 'Teams Deleted Successfully');
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
/* redirect to Index page with Fails Message */
|
/* redirect to Index page with Fails Message */
|
||||||
return redirect('teams')->with('fails', 'Teams can not Delete'.'<li>'.$e->errorInfo[2].'</li>');
|
return redirect('teams')->with('fails', 'Teams can not Delete' . '<li>' . $e->errorInfo[2] . '</li>');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -1,7 +1,11 @@
|
|||||||
<?php namespace App\Http\Controllers\Admin\helpdesk;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin\helpdesk;
|
||||||
|
|
||||||
// controllers
|
// controllers
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
use App\Http\Controllers\Common\SettingsController;
|
use App\Http\Controllers\Common\SettingsController;
|
||||||
|
use App\Http\Controllers\Common\PhpMailController;
|
||||||
// requests
|
// requests
|
||||||
use App\Http\Requests\helpdesk\TemplateRequest;
|
use App\Http\Requests\helpdesk\TemplateRequest;
|
||||||
use App\Http\Requests\helpdesk\TemplateUdate;
|
use App\Http\Requests\helpdesk\TemplateUdate;
|
||||||
@@ -28,7 +32,8 @@ class TemplateController extends Controller {
|
|||||||
* Create a new controller instance.
|
* Create a new controller instance.
|
||||||
* @return type void
|
* @return type void
|
||||||
*/
|
*/
|
||||||
public function __construct() {
|
public function __construct(PhpMailController $PhpMailController) {
|
||||||
|
$this->PhpMailController = $PhpMailController;
|
||||||
SettingsController::smtp();
|
SettingsController::smtp();
|
||||||
$this->middleware('auth');
|
$this->middleware('auth');
|
||||||
$this->middleware('roles');
|
$this->middleware('roles');
|
||||||
@@ -102,33 +107,35 @@ class TemplateController extends Controller {
|
|||||||
* @param type Languages $language
|
* @param type Languages $language
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function listtemplates() {
|
public function listdirectories() {
|
||||||
$path = '../resources/views/emails/';
|
$path = '../resources/views/emails/';
|
||||||
|
$directories = scandir($path);
|
||||||
$templates = scandir($path);
|
|
||||||
$directory = str_replace('/', '-', $path);
|
$directory = str_replace('/', '-', $path);
|
||||||
return view('themes.default1.admin.helpdesk.emails.template.listtemplates', compact('templates','directory'));
|
return view('themes.default1.admin.helpdesk.emails.template.listdirectories', compact('directories', 'directory'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function readtemplate($template,$path) {
|
public function listtemplates($template, $path) {
|
||||||
$directory = str_replace('-', '/', $path);
|
$paths = str_replace('-', '/', $path);
|
||||||
$directory2 = $directory.$template;
|
$directory2 = $paths . $template;
|
||||||
if (is_dir($directory2)) {
|
|
||||||
$templates = scandir($directory2);
|
$templates = scandir($directory2);
|
||||||
$directory = str_replace('/', '-', $directory2.'/');
|
$directory = str_replace('/', '-', $directory2 . '/');
|
||||||
return view('themes.default1.admin.helpdesk.emails.template.listtemplates', compact('templates','directory'));
|
return view('themes.default1.admin.helpdesk.emails.template.listtemplates', compact('templates', 'directory'));
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
$handle = fopen($directory.$template, "r");
|
public function readtemplate($template, $path) {
|
||||||
$contents = fread($handle, filesize($directory.$template));
|
$directory = str_replace('-', '/', $path);
|
||||||
|
$handle = fopen($directory . $template, "r");
|
||||||
|
$contents = fread($handle, filesize($directory . $template));
|
||||||
fclose($handle);
|
fclose($handle);
|
||||||
|
|
||||||
|
return view('themes.default1.admin.helpdesk.emails.template.readtemplates', compact('contents', 'template', 'path'));
|
||||||
}
|
}
|
||||||
return view('themes.default1.admin.helpdesk.emails.template.readtemplates', compact('contents','template','path'));
|
|
||||||
}
|
|
||||||
public function createtemplate() {
|
public function createtemplate() {
|
||||||
$directory = '../resources/views/emails/';
|
$directory = '../resources/views/emails/';
|
||||||
$fname = Input::get('folder_name');
|
$fname = Input::get('folder_name');
|
||||||
$filename = $directory.$fname;
|
$filename = $directory . $fname;
|
||||||
|
|
||||||
// images folder creation using php
|
// images folder creation using php
|
||||||
// $mydir = dirname( __FILE__ )."/html/images";
|
// $mydir = dirname( __FILE__ )."/html/images";
|
||||||
@@ -137,30 +144,58 @@ class TemplateController extends Controller {
|
|||||||
// }
|
// }
|
||||||
// Move all images files
|
// Move all images files
|
||||||
|
|
||||||
if(!file_exists($filename)) {
|
if (!file_exists($filename)) {
|
||||||
mkdir($filename,0777);
|
mkdir($filename, 0777);
|
||||||
}
|
}
|
||||||
$files = array_filter(scandir($directory.'default'));
|
$files = array_filter(scandir($directory . 'default'));
|
||||||
|
|
||||||
foreach($files as $file){
|
foreach ($files as $file) {
|
||||||
if ($file === '.' or $file === '..') continue;
|
if ($file === '.' or $file === '..')
|
||||||
if(!is_dir($file)) {
|
continue;
|
||||||
|
if (!is_dir($file)) {
|
||||||
// $file_to_go = str_replace("code/resources/views/emails/",'code/resources/views/emails/'.$fname,$file);
|
// $file_to_go = str_replace("code/resources/views/emails/",'code/resources/views/emails/'.$fname,$file);
|
||||||
$destination = $directory.$fname.'/';
|
$destination = $directory . $fname . '/';
|
||||||
|
|
||||||
copy($directory.'default/'.$file, $destination.$file);
|
copy($directory . 'default/' . $file, $destination . $file);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return \Redirect::back()->with('success', 'Successfully copied');
|
return \Redirect::back()->with('success', 'Successfully copied');
|
||||||
}
|
}
|
||||||
public function writetemplate($template,$path) {
|
|
||||||
|
public function writetemplate($template, $path) {
|
||||||
$directory = str_replace('-', '/', $path);
|
$directory = str_replace('-', '/', $path);
|
||||||
$b = Input::get('templatedata');
|
$b = Input::get('templatedata');
|
||||||
|
|
||||||
file_put_contents($directory.$template, print_r($b, true));
|
file_put_contents($directory . $template, print_r($b, true));
|
||||||
return \Redirect::back()->with('success', 'Successfully updated');
|
return \Redirect::back()->with('success', 'Successfully updated');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function deletetemplate($template, $path) {
|
||||||
|
$directory = str_replace('-', '/', $path);
|
||||||
|
$dir = $directory . $template;
|
||||||
|
$status = \DB::table('settings_email')->first();
|
||||||
|
if ($template == 'default' or $template == $status->template) {
|
||||||
|
return \Redirect::back()->with('fails', 'You cannot delete a default or active directory!');
|
||||||
|
}
|
||||||
|
if (is_dir($dir)) {
|
||||||
|
$objects = scandir($dir);
|
||||||
|
foreach ($objects as $object) {
|
||||||
|
if ($object != "." && $object != "..") {
|
||||||
|
unlink($dir . "/" . $object);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
rmdir($dir);
|
||||||
|
} else {
|
||||||
|
rmdir($dir);
|
||||||
|
}
|
||||||
|
return \Redirect::back()->with('success', 'Successfully Deleted');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function activateset($setname) {
|
||||||
|
\DB::table('settings_email')->update(array('template' => $setname));
|
||||||
|
return \Redirect::back()->with('success', 'You have Successfully Activated this Set');
|
||||||
|
}
|
||||||
|
|
||||||
public function edit($id, Template $template, Languages $language) {
|
public function edit($id, Template $template, Languages $language) {
|
||||||
try {
|
try {
|
||||||
$templates = $template->whereId($id)->first();
|
$templates = $template->whereId($id)->first();
|
||||||
@@ -240,13 +275,12 @@ $files = array_filter(scandir($directory.'default'));
|
|||||||
*/
|
*/
|
||||||
public function postDiagno(Request $request) {
|
public function postDiagno(Request $request) {
|
||||||
$email = $request->input('to');
|
$email = $request->input('to');
|
||||||
if($email == null)
|
if ($email == null) {
|
||||||
{
|
|
||||||
return redirect('getdiagno')->with('fails', 'Please provide E-mail address !');
|
return redirect('getdiagno')->with('fails', 'Please provide E-mail address !');
|
||||||
}
|
}
|
||||||
$mail = Mail::send('themes.default1.admin.helpdesk.emails.template.connection', array('link' => url('getmail'), 'username' => $email), function ($message) use ($email) {
|
// sending mail via php mailer
|
||||||
$message->to($email)->subject('Checking the connection');
|
$mail = $this->PhpMailController->sendmail($from = 1, $to = ['email' => $email], $message = ['subject' => 'Checking the connection', 'scenario' => 'error-report', 'content' => 'Email Received Successfully'], $template_variables = ['system_error' => 'hello']);
|
||||||
});
|
|
||||||
return redirect('getdiagno')->with('success', 'Please check your mail. An E-mail has been sent to your E-mail address');
|
return redirect('getdiagno')->with('success', 'Please check your mail. An E-mail has been sent to your E-mail address');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,14 +1,15 @@
|
|||||||
<?php namespace App\Http\Controllers\Admin\helpdesk;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin\helpdesk;
|
||||||
|
|
||||||
// controllers
|
// controllers
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
|
|
||||||
// models
|
// models
|
||||||
use App\Model\helpdesk\Priority;
|
use App\Model\helpdesk\Priority;
|
||||||
use App\Model\helpdesk\Ticket_thread;
|
use App\Model\helpdesk\Ticket_thread;
|
||||||
|
|
||||||
// classes
|
// classes
|
||||||
use Exception;
|
use Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ThreadController
|
* ThreadController
|
||||||
*
|
*
|
||||||
@@ -36,4 +37,5 @@ class ThreadController extends Controller {
|
|||||||
return view('404');
|
return view('404');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -1,92 +0,0 @@
|
|||||||
<?php namespace App\Http\Controllers\Agent\helpdesk;
|
|
||||||
// controllers
|
|
||||||
use App\Http\Controllers\Controller;
|
|
||||||
// models
|
|
||||||
use App\Model\helpdesk\Settings\Company;
|
|
||||||
use App\Model\helpdesk\Ticket\Ticket_Collaborator;
|
|
||||||
use App\Model\helpdesk\Email\Emails;
|
|
||||||
use App\User;
|
|
||||||
// classes
|
|
||||||
use DB;
|
|
||||||
use View;
|
|
||||||
use Auth;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* DashboardController
|
|
||||||
*
|
|
||||||
* @package Controllers
|
|
||||||
* @subpackage Controller
|
|
||||||
* @author Ladybird <info@ladybirdweb.com>
|
|
||||||
*/
|
|
||||||
class DashboardController extends Controller {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create a new controller instance.
|
|
||||||
* constructor to check
|
|
||||||
* 1. authentication
|
|
||||||
* 2. user roles
|
|
||||||
* 3. roles must be agent
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function __construct() {
|
|
||||||
$this->middleware('auth');
|
|
||||||
$this->middleware('role.agent');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Show the form for creating a new resource.
|
|
||||||
* @return type Response
|
|
||||||
*/
|
|
||||||
public function index() {
|
|
||||||
try {
|
|
||||||
if(Auth::user()->role == "user"){
|
|
||||||
return \Redirect::route('home');
|
|
||||||
}
|
|
||||||
return View::make('themes.default1.agent.helpdesk.dashboard.dashboard');
|
|
||||||
} catch (Exception $e) {
|
|
||||||
return view('404');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ChartData
|
|
||||||
* @return type
|
|
||||||
*/
|
|
||||||
public function ChartData()
|
|
||||||
{
|
|
||||||
$date2 = strtotime(Date('Y-m-d'));
|
|
||||||
$date3 = Date('Y-m-d');
|
|
||||||
$format = 'Y-m-d';
|
|
||||||
$date1 = strtotime(Date($format,strtotime('-1 month'. $date3)));
|
|
||||||
|
|
||||||
$return = "";
|
|
||||||
$last = "";
|
|
||||||
for ( $i = $date1; $i <= $date2; $i = $i + 86400 ) {
|
|
||||||
$thisDate = date( 'Y-m-d', $i );
|
|
||||||
|
|
||||||
$created = \DB::table('tickets')->select('created_at')->where('created_at','LIKE','%'.$thisDate.'%')->count();
|
|
||||||
$closed = \DB::table('tickets')->select('closed_at')->where('closed_at','LIKE','%'.$thisDate.'%')->count();
|
|
||||||
$reopened = \DB::table('tickets')->select('reopened_at')->where('reopened_at','LIKE','%'.$thisDate.'%')->count();
|
|
||||||
|
|
||||||
$value = ['date' => $thisDate, 'open' => $created, 'closed' => $closed, 'reopened' => $reopened];
|
|
||||||
$array = array_map('htmlentities',$value);
|
|
||||||
$json = html_entity_decode(json_encode($array));
|
|
||||||
$return .= $json.',';
|
|
||||||
}
|
|
||||||
$last = rtrim($return,',');
|
|
||||||
|
|
||||||
return '['.$last.']';
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// $ticketlist = DB::table('tickets')
|
|
||||||
// ->select(DB::raw('MONTH(updated_at) as month'),DB::raw('SUM(CASE WHEN status = 3 THEN 1 ELSE 0 END) as closed'),DB::raw('SUM(CASE WHEN status = 2 THEN 1 ELSE 0 END) as reopened'),DB::raw('SUM(CASE WHEN status = 1 THEN 1 ELSE 0 END) as open'),
|
|
||||||
// DB::raw('count(*) as totaltickets'))
|
|
||||||
// ->groupBy('month')
|
|
||||||
// ->orderBy('month', 'asc')
|
|
||||||
// ->get();
|
|
||||||
|
|
||||||
// return $ticketlist;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@@ -1,234 +0,0 @@
|
|||||||
@extends('themes.default1.agent.layout.agent')
|
|
||||||
|
|
||||||
@section('Dashboard')
|
|
||||||
class="active"
|
|
||||||
@stop
|
|
||||||
|
|
||||||
@section('dashboard-bar')
|
|
||||||
active
|
|
||||||
@stop
|
|
||||||
|
|
||||||
@section('dashboard')
|
|
||||||
class="active"
|
|
||||||
@stop
|
|
||||||
|
|
||||||
@section('content')
|
|
||||||
|
|
||||||
<div class="box box-info">
|
|
||||||
|
|
||||||
<?php
|
|
||||||
|
|
||||||
// $tickets = App\Model\Ticket\Tickets::where('created_at','>=',date('Y-m-d'))->get();
|
|
||||||
|
|
||||||
// echo count($tickets);
|
|
||||||
|
|
||||||
?>
|
|
||||||
<div class="box-header with-border">
|
|
||||||
<h3 class="box-title">{!! Lang::get('lang.line_chart') !!}</h3>
|
|
||||||
<div class="box-tools pull-right">
|
|
||||||
<button class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
|
|
||||||
<button class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="box-body">
|
|
||||||
<div class="chart" >
|
|
||||||
<div id="legendDiv"></div>
|
|
||||||
<canvas class="chart-data" id="tickets-graph" width="1000" height="400"></canvas>
|
|
||||||
</div>
|
|
||||||
</div><!-- /.box-body -->
|
|
||||||
</div><!-- /.box -->
|
|
||||||
<hr/>
|
|
||||||
<div class="box">
|
|
||||||
<div class="box-header">
|
|
||||||
<h1>{!! Lang::get('lang.statistics') !!}</h1>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<div class="box-body">
|
|
||||||
<table class="table table-hover" style="overflow:hidden;">
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<th>{!! Lang::get('lang.department') !!}</th>
|
|
||||||
<th>{!! Lang::get('lang.opened') !!}</th>
|
|
||||||
<th>{!! Lang::get('lang.resolved') !!}</th>
|
|
||||||
<th>{!! Lang::get('lang.closed') !!}</th>
|
|
||||||
<th>{!! Lang::get('lang.deleted') !!}</th>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<?php $departments = App\Model\helpdesk\Agent\Department::all(); ?>
|
|
||||||
@foreach($departments as $department)
|
|
||||||
<?php
|
|
||||||
$open = App\Model\helpdesk\Ticket\Tickets::where('dept_id','=',$department->id)->where('status','=',1)->count();
|
|
||||||
$resolve = App\Model\helpdesk\Ticket\Tickets::where('dept_id','=',$department->id)->where('status','=',2)->count();
|
|
||||||
$close = App\Model\helpdesk\Ticket\Tickets::where('dept_id','=',$department->id)->where('status','=',3)->count();
|
|
||||||
$delete = App\Model\helpdesk\Ticket\Tickets::where('dept_id','=',$department->id)->where('status','=',5)->count();
|
|
||||||
|
|
||||||
?>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
|
|
||||||
<td>{!! $department->name !!}</td>
|
|
||||||
<td>{!! $open !!}</td>
|
|
||||||
<td>{!! $resolve !!}</td>
|
|
||||||
<td>{!! $close !!}</td>
|
|
||||||
<td>{!! $delete !!}</td>
|
|
||||||
|
|
||||||
</tr>
|
|
||||||
@endforeach
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script src="{{asset("lb-faveo/plugins/chartjs/Chart.min.js")}}" type="text/javascript"></script>
|
|
||||||
<script type="text/javascript">
|
|
||||||
$(function(){
|
|
||||||
$.getJSON("agen", function (result) {
|
|
||||||
|
|
||||||
var labels = [],data=[],data2=[],data3=[],data4=[];
|
|
||||||
for (var i = 0; i < result.length; i++) {
|
|
||||||
|
|
||||||
$var12 = result[i].month;
|
|
||||||
if($var12 == 1){
|
|
||||||
$var13 = "January";
|
|
||||||
}
|
|
||||||
if($var12 == 2){
|
|
||||||
$var13 = "Febuary";
|
|
||||||
}
|
|
||||||
if($var12 == 3){
|
|
||||||
$var13 = "March";
|
|
||||||
}
|
|
||||||
if($var12 == 4){
|
|
||||||
$var13 = "April";
|
|
||||||
}
|
|
||||||
if($var12 == 5){
|
|
||||||
$var13 = "May";
|
|
||||||
}
|
|
||||||
if($var12 == 6){
|
|
||||||
$var13 = "June";
|
|
||||||
}
|
|
||||||
if($var12 == 7){
|
|
||||||
$var13 = "July";
|
|
||||||
}
|
|
||||||
if($var12 == 8){
|
|
||||||
$var13 = "August";
|
|
||||||
}
|
|
||||||
if($var12 == 9){
|
|
||||||
$var13 = "September";
|
|
||||||
}
|
|
||||||
if($var12 == 10){
|
|
||||||
$var13 = "October";
|
|
||||||
}
|
|
||||||
if($var12 == 11){
|
|
||||||
$var13 = "November";
|
|
||||||
}
|
|
||||||
if($var12 == 12){
|
|
||||||
$var13 = "December";
|
|
||||||
}
|
|
||||||
labels.push($var13);
|
|
||||||
data.push(result[i].totaltickets);
|
|
||||||
data2.push(result[i].closed);
|
|
||||||
data3.push(result[i].reopened);
|
|
||||||
data4.push(result[i].open);
|
|
||||||
}
|
|
||||||
|
|
||||||
var buyerData = {
|
|
||||||
labels : labels,
|
|
||||||
datasets : [
|
|
||||||
{
|
|
||||||
label : "Total Tickets" ,
|
|
||||||
fillColor : "rgba(240, 127, 110, 0.3)",
|
|
||||||
strokeColor : "#f56954",
|
|
||||||
pointColor : "#A62121",
|
|
||||||
pointStrokeColor : "#E60073",
|
|
||||||
data : data
|
|
||||||
|
|
||||||
}
|
|
||||||
,
|
|
||||||
{
|
|
||||||
label : "Open Tickets" ,
|
|
||||||
fillColor : "rgba(255, 102, 204, 0.4)",
|
|
||||||
strokeColor : "#f56954",
|
|
||||||
pointColor : "#FF66CC",
|
|
||||||
pointStrokeColor : "#fff",
|
|
||||||
pointHighlightFill : "#FF4DC3",
|
|
||||||
pointHighlightStroke : "rgba(151,187,205,1)",
|
|
||||||
data : data4
|
|
||||||
|
|
||||||
}
|
|
||||||
,
|
|
||||||
{
|
|
||||||
label : "Closed Tickets",
|
|
||||||
fillColor : "rgba(151,187,205,0.2)",
|
|
||||||
strokeColor : "rgba(151,187,205,1)",
|
|
||||||
pointColor : "rgba(151,187,205,1)",
|
|
||||||
pointStrokeColor : "#0000CC",
|
|
||||||
pointHighlightFill : "#0000E6",
|
|
||||||
pointHighlightStroke : "rgba(151,187,205,1)",
|
|
||||||
data : data2
|
|
||||||
}
|
|
||||||
,
|
|
||||||
{
|
|
||||||
label : "Reopened Tickets",
|
|
||||||
fillColor : "rgba(102,255,51,0.2)",
|
|
||||||
strokeColor : "rgba(151,187,205,1)",
|
|
||||||
pointColor : "rgba(46,184,0,1)",
|
|
||||||
pointStrokeColor : "#fff",
|
|
||||||
pointHighlightFill : "#fff",
|
|
||||||
pointHighlightStroke : "rgba(151,187,205,1)",
|
|
||||||
data : data3
|
|
||||||
}
|
|
||||||
]
|
|
||||||
};
|
|
||||||
|
|
||||||
var myLineChart = new Chart(document.getElementById("tickets-graph").getContext("2d")).Line(buyerData, {
|
|
||||||
showScale: true,
|
|
||||||
//Boolean - Whether grid lines are shown across the chart
|
|
||||||
scaleShowGridLines: false,
|
|
||||||
//String - Colour of the grid lines
|
|
||||||
scaleGridLineColor: "rgba(0,0,0,.05)",
|
|
||||||
//Number - Width of the grid lines
|
|
||||||
scaleGridLineWidth: 1,
|
|
||||||
//Boolean - Whether to show horizontal lines (except X axis)
|
|
||||||
scaleShowHorizontalLines: true,
|
|
||||||
//Boolean - Whether to show vertical lines (except Y axis)
|
|
||||||
scaleShowVerticalLines: true,
|
|
||||||
//Boolean - Whether the line is curved between points
|
|
||||||
bezierCurve: false,
|
|
||||||
//Number - Tension of the bezier curve between points
|
|
||||||
bezierCurveTension: 0.3,
|
|
||||||
//Boolean - Whether to show a dot for each point
|
|
||||||
pointDot: true,
|
|
||||||
//Number - Radius of each point dot in pixels
|
|
||||||
pointDotRadius: 4,
|
|
||||||
//Number - Pixel width of point dot stroke
|
|
||||||
pointDotStrokeWidth: 1,
|
|
||||||
//Number - amount extra to add to the radius to cater for hit detection outside the drawn point
|
|
||||||
pointHitDetectionRadius: 20,
|
|
||||||
//Boolean - Whether to show a stroke for datasets
|
|
||||||
datasetStroke: true,
|
|
||||||
//Number - Pixel width of dataset stroke
|
|
||||||
datasetStrokeWidth: 1,
|
|
||||||
//Boolean - Whether to fill the dataset with a color
|
|
||||||
datasetFill: true,
|
|
||||||
//String - A legend template
|
|
||||||
//Boolean - whether to maintain the starting aspect ratio or not when responsive, if set to false, will take up entire container
|
|
||||||
maintainAspectRatio: false,
|
|
||||||
//Boolean - whether to make the chart responsive to window resizing
|
|
||||||
responsive: true,
|
|
||||||
legendTemplate : '<ul style="list-style-type: square;">'
|
|
||||||
+'<% for (var i=0; i<datasets.length; i++) { %>'
|
|
||||||
+'<li style="color: <%=datasets[i].pointColor%>;">'
|
|
||||||
+'<span style=\"background-color:<%=datasets[i].pointColor%>\"></span>'
|
|
||||||
+'<% if (datasets[i].label) { %><%= datasets[i].label %><% } %>'
|
|
||||||
+'</li>'
|
|
||||||
+'<% } %>'
|
|
||||||
+'</ul>'
|
|
||||||
});
|
|
||||||
|
|
||||||
document.getElementById("legendDiv").innerHTML = myLineChart.generateLegend();
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
</script>
|
|
||||||
|
|
||||||
@stop
|
|
@@ -1,16 +1,15 @@
|
|||||||
<?php namespace App\Http\Controllers\Agent\helpdesk;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Agent\helpdesk;
|
||||||
|
|
||||||
// controllers
|
// controllers
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
|
|
||||||
// requests
|
// requests
|
||||||
use App\Http\Requests\helpdesk\CannedRequest;
|
use App\Http\Requests\helpdesk\CannedRequest;
|
||||||
use App\Http\Requests\helpdesk\CannedUpdateRequest;
|
use App\Http\Requests\helpdesk\CannedUpdateRequest;
|
||||||
|
|
||||||
// model
|
// model
|
||||||
use App\Model\helpdesk\Agent_panel\Canned;
|
use App\Model\helpdesk\Agent_panel\Canned;
|
||||||
use App\User;
|
use App\User;
|
||||||
|
|
||||||
// classes
|
// classes
|
||||||
use Exception;
|
use Exception;
|
||||||
|
|
||||||
@@ -70,9 +69,9 @@ class CannedController extends Controller {
|
|||||||
try {
|
try {
|
||||||
// saving inputs
|
// saving inputs
|
||||||
$canned->save();
|
$canned->save();
|
||||||
return redirect()->route('canned.list')->with('success','Added Successfully');
|
return redirect()->route('canned.list')->with('success', 'Added Successfully');
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
return redirect()->route('canned.list')->with('fails',$e->errorInfo[2]);
|
return redirect()->route('canned.list')->with('fails', $e->errorInfo[2]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -84,8 +83,8 @@ class CannedController extends Controller {
|
|||||||
*/
|
*/
|
||||||
public function edit($id, Canned $canned) {
|
public function edit($id, Canned $canned) {
|
||||||
// fetching requested canned response
|
// fetching requested canned response
|
||||||
$canned = $canned->where('user_id', '=', \Auth::user()->id)->where('id','=',$id)->first();
|
$canned = $canned->where('user_id', '=', \Auth::user()->id)->where('id', '=', $id)->first();
|
||||||
return view('themes.default1.agent.helpdesk.canned.edit',compact('canned'));
|
return view('themes.default1.agent.helpdesk.canned.edit', compact('canned'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -97,7 +96,7 @@ class CannedController extends Controller {
|
|||||||
*/
|
*/
|
||||||
public function update($id, CannedUpdateRequest $request, Canned $canned) {
|
public function update($id, CannedUpdateRequest $request, Canned $canned) {
|
||||||
/* select the field where id = $id(request Id) */
|
/* select the field where id = $id(request Id) */
|
||||||
$canned = $canned->where('id','=',$id)->where('user_id', '=', \Auth::user()->id)->first();
|
$canned = $canned->where('id', '=', $id)->where('user_id', '=', \Auth::user()->id)->first();
|
||||||
// fetching all the requested inputs
|
// fetching all the requested inputs
|
||||||
$canned->user_id = \Auth::user()->id;
|
$canned->user_id = \Auth::user()->id;
|
||||||
$canned->title = $request->input('title');
|
$canned->title = $request->input('title');
|
||||||
@@ -105,9 +104,9 @@ class CannedController extends Controller {
|
|||||||
try {
|
try {
|
||||||
// saving inputs
|
// saving inputs
|
||||||
$canned->save();
|
$canned->save();
|
||||||
return redirect()->route('canned.list')->with('success','Updated Successfully');
|
return redirect()->route('canned.list')->with('success', 'Updated Successfully');
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
return redirect()->route('canned.list')->with('fails',$e->errorInfo[2]);
|
return redirect()->route('canned.list')->with('fails', $e->errorInfo[2]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -139,9 +138,9 @@ class CannedController extends Controller {
|
|||||||
*/
|
*/
|
||||||
public function get_canned($id) {
|
public function get_canned($id) {
|
||||||
// checking for the canned response with requested value
|
// checking for the canned response with requested value
|
||||||
if($id != "zzz") {
|
if ($id != "zzz") {
|
||||||
// fetching canned response
|
// fetching canned response
|
||||||
$canned = Canned::where('id','=',$id)->where('user_id','=',\Auth::user()->id)->first();
|
$canned = Canned::where('id', '=', $id)->where('user_id', '=', \Auth::user()->id)->first();
|
||||||
$msg = $canned->message;
|
$msg = $canned->message;
|
||||||
} else {
|
} else {
|
||||||
$msg = "";
|
$msg = "";
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
<?php namespace App\Http\Controllers\Agent\helpdesk;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Agent\helpdesk;
|
||||||
|
|
||||||
// controllers
|
// controllers
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
|
|
||||||
// models
|
// models
|
||||||
use App\Model\helpdesk\Settings\Company;
|
use App\Model\helpdesk\Settings\Company;
|
||||||
use App\Model\helpdesk\Ticket\Ticket_Collaborator;
|
use App\Model\helpdesk\Ticket\Ticket_Collaborator;
|
||||||
use App\Model\helpdesk\Email\Emails;
|
use App\Model\helpdesk\Email\Emails;
|
||||||
use App\User;
|
use App\User;
|
||||||
|
|
||||||
// classes
|
// classes
|
||||||
use DB;
|
use DB;
|
||||||
use View;
|
use View;
|
||||||
@@ -59,12 +59,10 @@ class DashboardController extends Controller {
|
|||||||
* Fetching dashboard graph data to implement graph
|
* Fetching dashboard graph data to implement graph
|
||||||
* @return type Json
|
* @return type Json
|
||||||
*/
|
*/
|
||||||
public function ChartData($date111 = "",$date122 = "")
|
public function ChartData($date111 = "", $date122 = "") {
|
||||||
{
|
|
||||||
|
|
||||||
$date11 = strtotime($date122);
|
$date11 = strtotime($date122);
|
||||||
$date12 = strtotime($date111);
|
$date12 = strtotime($date111);
|
||||||
if($date11 && $date12){
|
if ($date11 && $date12) {
|
||||||
$date2 = $date12;
|
$date2 = $date12;
|
||||||
$date1 = $date11;
|
$date1 = $date11;
|
||||||
} else {
|
} else {
|
||||||
@@ -73,25 +71,25 @@ class DashboardController extends Controller {
|
|||||||
$date3 = Date('Y-m-d');
|
$date3 = Date('Y-m-d');
|
||||||
$format = 'Y-m-d';
|
$format = 'Y-m-d';
|
||||||
// generating a date range of 1 month
|
// generating a date range of 1 month
|
||||||
$date1 = strtotime(Date($format,strtotime('-1 month'. $date3)));
|
$date1 = strtotime(Date($format, strtotime('-1 month' . $date3)));
|
||||||
}
|
}
|
||||||
$return = "";
|
$return = "";
|
||||||
$last = "";
|
$last = "";
|
||||||
for ( $i = $date1; $i <= $date2; $i = $i + 86400 ) {
|
for ($i = $date1; $i <= $date2; $i = $i + 86400) {
|
||||||
$thisDate = date( 'Y-m-d', $i );
|
$thisDate = date('Y-m-d', $i);
|
||||||
|
|
||||||
$created = \DB::table('tickets')->select('created_at')->where('created_at','LIKE','%'.$thisDate.'%')->count();
|
$created = \DB::table('tickets')->select('created_at')->where('created_at', 'LIKE', '%' . $thisDate . '%')->count();
|
||||||
$closed = \DB::table('tickets')->select('closed_at')->where('closed_at','LIKE','%'.$thisDate.'%')->count();
|
$closed = \DB::table('tickets')->select('closed_at')->where('closed_at', 'LIKE', '%' . $thisDate . '%')->count();
|
||||||
$reopened = \DB::table('tickets')->select('reopened_at')->where('reopened_at','LIKE','%'.$thisDate.'%')->count();
|
$reopened = \DB::table('tickets')->select('reopened_at')->where('reopened_at', 'LIKE', '%' . $thisDate . '%')->count();
|
||||||
|
|
||||||
$value = ['date' => $thisDate, 'open' => $created, 'closed' => $closed, 'reopened' => $reopened];
|
$value = ['date' => $thisDate, 'open' => $created, 'closed' => $closed, 'reopened' => $reopened];
|
||||||
$array = array_map('htmlentities',$value);
|
$array = array_map('htmlentities', $value);
|
||||||
$json = html_entity_decode(json_encode($array));
|
$json = html_entity_decode(json_encode($array));
|
||||||
$return .= $json.',';
|
$return .= $json . ',';
|
||||||
}
|
}
|
||||||
$last = rtrim($return,',');
|
$last = rtrim($return, ',');
|
||||||
|
|
||||||
return '['.$last.']';
|
return '[' . $last . ']';
|
||||||
|
|
||||||
// $ticketlist = DB::table('tickets')
|
// $ticketlist = DB::table('tickets')
|
||||||
// ->select(DB::raw('MONTH(updated_at) as month'),DB::raw('SUM(CASE WHEN status = 3 THEN 1 ELSE 0 END) as closed'),DB::raw('SUM(CASE WHEN status = 2 THEN 1 ELSE 0 END) as reopened'),DB::raw('SUM(CASE WHEN status = 1 THEN 1 ELSE 0 END) as open'),DB::raw('SUM(CASE WHEN status = 5 THEN 1 ELSE 0 END) as deleted'),
|
// ->select(DB::raw('MONTH(updated_at) as month'),DB::raw('SUM(CASE WHEN status = 3 THEN 1 ELSE 0 END) as closed'),DB::raw('SUM(CASE WHEN status = 2 THEN 1 ELSE 0 END) as reopened'),DB::raw('SUM(CASE WHEN status = 1 THEN 1 ELSE 0 END) as open'),DB::raw('SUM(CASE WHEN status = 5 THEN 1 ELSE 0 END) as deleted'),
|
||||||
@@ -99,7 +97,6 @@ class DashboardController extends Controller {
|
|||||||
// ->groupBy('month')
|
// ->groupBy('month')
|
||||||
// ->orderBy('month', 'asc')
|
// ->orderBy('month', 'asc')
|
||||||
// ->get();
|
// ->get();
|
||||||
|
|
||||||
// return $ticketlist;
|
// return $ticketlist;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,8 +1,10 @@
|
|||||||
<?php namespace App\Http\Controllers\Agent\helpdesk;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Agent\helpdesk;
|
||||||
|
|
||||||
// controllers
|
// controllers
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
use App\Http\Controllers\Agent\helpdesk\TicketController;
|
use App\Http\Controllers\Agent\helpdesk\TicketController;
|
||||||
|
|
||||||
// models
|
// models
|
||||||
use App\User;
|
use App\User;
|
||||||
use App\Model\helpdesk\Email\Emails;
|
use App\Model\helpdesk\Email\Emails;
|
||||||
@@ -10,17 +12,17 @@ use App\Model\helpdesk\Settings\Email;
|
|||||||
use App\Model\helpdesk\Ticket\Ticket_attachments;
|
use App\Model\helpdesk\Ticket\Ticket_attachments;
|
||||||
use App\Model\helpdesk\Ticket\Ticket_Thread;
|
use App\Model\helpdesk\Ticket\Ticket_Thread;
|
||||||
use App\Model\helpdesk\Settings\System;
|
use App\Model\helpdesk\Settings\System;
|
||||||
|
use App\Model\helpdesk\Settings\Ticket;
|
||||||
use App\Model\helpdesk\Manage\Help_topic;
|
use App\Model\helpdesk\Manage\Help_topic;
|
||||||
use App\Model\helpdesk\Utility\MailboxProtocol;
|
use App\Model\helpdesk\Utility\MailboxProtocol;
|
||||||
use App\Model\helpdesk\Ticket\Ticket_source;
|
use App\Model\helpdesk\Ticket\Ticket_source;
|
||||||
use App\Model\helpdesk\Ticket\Ticket_Priority;
|
use App\Model\helpdesk\Ticket\Ticket_Priority;
|
||||||
use App\Model\helpdesk\Ticket\Tickets;
|
use App\Model\helpdesk\Ticket\Tickets;
|
||||||
|
|
||||||
// classes
|
// classes
|
||||||
use PhpImap\Mailbox as ImapMailbox;
|
use PhpImap\Mailbox as ImapMailbox;
|
||||||
use PhpImap\IncomingMail;
|
use PhpImap\IncomingMail;
|
||||||
use PhpImap\IncomingMailAttachment;
|
use PhpImap\IncomingMailAttachment;
|
||||||
use ForceUTF8\Encoding;
|
use \ForceUTF8\Encoding;
|
||||||
use App;
|
use App;
|
||||||
use DB;
|
use DB;
|
||||||
use Crypt;
|
use Crypt;
|
||||||
@@ -28,9 +30,7 @@ use Schedule;
|
|||||||
use File;
|
use File;
|
||||||
use Artisan;
|
use Artisan;
|
||||||
use Exception;
|
use Exception;
|
||||||
use Phpmailer\PHPMailerautoload;
|
|
||||||
//$root = realpath($_SERVER["DOCUMENT_ROOT"]);
|
|
||||||
//include_once($root.'\vendor\phpmailer\phpmailer\PHPMailerautoload.php');
|
|
||||||
/**
|
/**
|
||||||
* MailController
|
* MailController
|
||||||
*
|
*
|
||||||
@@ -53,49 +53,59 @@ class MailController extends Controller {
|
|||||||
* Reademails
|
* Reademails
|
||||||
* @return type
|
* @return type
|
||||||
*/
|
*/
|
||||||
|
public function readmails(Emails $emails, Email $settings_email, System $system, Ticket $ticket) {
|
||||||
|
|
||||||
public function readmails(Emails $emails, Email $settings_email, System $system)
|
|
||||||
{
|
|
||||||
// $path_url = $system->first()->url;
|
// $path_url = $system->first()->url;
|
||||||
if($settings_email->first()->email_fetching == 1)
|
if ($settings_email->first()->email_fetching == 1) {
|
||||||
{
|
if ($settings_email->first()->all_emails == 1) {
|
||||||
if($settings_email->first()->all_emails == 1)
|
|
||||||
{
|
|
||||||
// $helptopic = $this->TicketController->default_helptopic();
|
// $helptopic = $this->TicketController->default_helptopic();
|
||||||
// $sla = $this->TicketController->default_sla();
|
// $sla = $this->TicketController->default_sla();
|
||||||
$email = $emails->get();
|
$email = $emails->get();
|
||||||
foreach($email as $e_mail)
|
foreach ($email as $e_mail) {
|
||||||
{
|
$priority = $e_mail->priority;
|
||||||
|
$dept = $e_mail->department;
|
||||||
$helptopic = $e_mail->help_topic;
|
$helptopic = $e_mail->help_topic;
|
||||||
|
|
||||||
|
if ($priority == null) {
|
||||||
|
$priority = $ticket->first()->priority;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($dept == null) {
|
||||||
|
$dept = $system->first()->department;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($helptopic == null) {
|
||||||
|
$helptopic = $ticket->first()->help_topic;
|
||||||
|
}
|
||||||
|
// dd($dept);
|
||||||
|
|
||||||
$get_helptopic = Help_topic::where('id', '=', $helptopic)->first();
|
$get_helptopic = Help_topic::where('id', '=', $helptopic)->first();
|
||||||
$sla = $get_helptopic->sla_plan;
|
$sla = $get_helptopic->sla_plan;
|
||||||
$dept = $e_mail->department;
|
// $dept = $e_mail->department;
|
||||||
$host = $e_mail->fetching_host;
|
$host = $e_mail->fetching_host;
|
||||||
$port = $e_mail->fetching_port;
|
$port = $e_mail->fetching_port;
|
||||||
$protocol = $e_mail->mailbox_protocol;
|
$protocol = $e_mail->mailbox_protocol;
|
||||||
$get_mailboxprotocol = MailboxProtocol::where('id','=',$protocol)->first();
|
$get_mailboxprotocol = MailboxProtocol::where('id', '=', $protocol)->first();
|
||||||
$protocol = $get_mailboxprotocol->value;
|
$protocol = $get_mailboxprotocol->value;
|
||||||
$imap_config = '{'.$host.':'.$port.$protocol.'}INBOX';
|
$imap_config = '{' . $host . ':' . $port . $protocol . '}INBOX';
|
||||||
$password = Crypt::decrypt($e_mail->password);
|
$password = Crypt::decrypt($e_mail->password);
|
||||||
$mailbox = new ImapMailbox($imap_config, $e_mail->email_address, $password, __DIR__);
|
$mailbox = new ImapMailbox($imap_config, $e_mail->email_address, $password, __DIR__);
|
||||||
$mails = array();
|
$mails = array();
|
||||||
$mailsIds = $mailbox->searchMailBox('SINCE '. date('d-M-Y', strtotime("-1 day")));
|
$mailsIds = $mailbox->searchMailBox('SINCE ' . date('d-M-Y', strtotime("-1 day")));
|
||||||
if(!$mailsIds) {
|
if (!$mailsIds) {
|
||||||
die('Mailbox is empty');
|
die('Mailbox is empty');
|
||||||
}
|
}
|
||||||
foreach($mailsIds as $mailId) {
|
foreach ($mailsIds as $mailId) {
|
||||||
$overview = $mailbox->get_overview($mailId);
|
$overview = $mailbox->get_overview($mailId);
|
||||||
$var = $overview[0]->seen ? 'read' : 'unread';
|
$var = $overview[0]->seen ? 'read' : 'unread';
|
||||||
if ($var == 'unread') {
|
if ($var == 'unread') {
|
||||||
$mail = $mailbox->getMail($mailId);
|
$mail = $mailbox->getMail($mailId);
|
||||||
if($settings_email->first()->email_collaborator == 1) {
|
if ($settings_email->first()->email_collaborator == 1) {
|
||||||
$collaborator = $mail->cc;
|
$collaborator = $mail->cc;
|
||||||
} else {
|
} else {
|
||||||
$collaborator = null;
|
$collaborator = null;
|
||||||
}
|
}
|
||||||
$body = $mail->textHtml;
|
$body = $mail->textHtml;
|
||||||
if($body == null) {
|
if ($body == null) {
|
||||||
$body = $mailbox->backup_getmail($mailId);
|
$body = $mailbox->backup_getmail($mailId);
|
||||||
$body = str_replace('\r\n', '<br/>', $body);
|
$body = str_replace('\r\n', '<br/>', $body);
|
||||||
// var_dump($body);
|
// var_dump($body);
|
||||||
@@ -107,7 +117,7 @@ class MailController extends Controller {
|
|||||||
$date = date('Y-m-d H:i:s', strtotime($date));
|
$date = date('Y-m-d H:i:s', strtotime($date));
|
||||||
// dd($date);
|
// dd($date);
|
||||||
|
|
||||||
if(isset($mail->subject)){
|
if (isset($mail->subject)) {
|
||||||
$subject = $mail->subject;
|
$subject = $mail->subject;
|
||||||
} else {
|
} else {
|
||||||
$subject = "No Subject";
|
$subject = "No Subject";
|
||||||
@@ -116,33 +126,31 @@ class MailController extends Controller {
|
|||||||
// dd($subject);
|
// dd($subject);
|
||||||
$fromname = $mail->fromName;
|
$fromname = $mail->fromName;
|
||||||
$fromaddress = $mail->fromAddress;
|
$fromaddress = $mail->fromAddress;
|
||||||
$ticket_source = Ticket_source::where('name','=','email')->first();
|
$ticket_source = Ticket_source::where('name', '=', 'email')->first();
|
||||||
$source = $ticket_source->id;
|
$source = $ticket_source->id;
|
||||||
$phone = "";
|
$phone = "";
|
||||||
$priority = $get_helptopic->priority;
|
|
||||||
// Ticket_Priority::where('')
|
|
||||||
|
|
||||||
$assign = $get_helptopic->auto_assign;
|
$assign = $get_helptopic->auto_assign;
|
||||||
$form_data = null;
|
$form_data = null;
|
||||||
$result = $this->TicketController->create_user($fromaddress, $fromname, $subject, $body, $phone, $helptopic, $sla, $priority, $source, $collaborator, $dept, $assign, $form_data);
|
$result = $this->TicketController->create_user($fromaddress, $fromname, $subject, $body, $phone, $helptopic, $sla, $priority, $source, $collaborator, $dept, $assign, $form_data);
|
||||||
// dd($result);
|
// dd($result);
|
||||||
if ($result[1] == true) {
|
if ($result[1] == true) {
|
||||||
$ticket_table = Tickets::where('ticket_number', '=' , $result[0])->first();
|
$ticket_table = Tickets::where('ticket_number', '=', $result[0])->first();
|
||||||
$thread_id = Ticket_Thread::where('ticket_id','=',$ticket_table->id)->max('id');
|
$thread_id = Ticket_Thread::where('ticket_id', '=', $ticket_table->id)->max('id');
|
||||||
// $thread_id = Ticket_Thread::whereRaw('id = (select max(`id`) from ticket_thread)')->first();
|
// $thread_id = Ticket_Thread::whereRaw('id = (select max(`id`) from ticket_thread)')->first();
|
||||||
$thread_id = $thread_id;
|
$thread_id = $thread_id;
|
||||||
|
|
||||||
foreach($mail->getAttachments() as $attachment) {
|
foreach ($mail->getAttachments() as $attachment) {
|
||||||
$support = "support";
|
$support = "support";
|
||||||
// echo $_SERVER['DOCUMENT_ROOT'];
|
// echo $_SERVER['DOCUMENT_ROOT'];
|
||||||
$dir_img_paths = __DIR__;
|
$dir_img_paths = __DIR__;
|
||||||
$dir_img_path = explode('/code', $dir_img_paths);
|
$dir_img_path = explode('/code', $dir_img_paths);
|
||||||
// dd($attachment->filePath);
|
// dd($attachment->filePath);
|
||||||
$filepath = explode('../../../../../public',$attachment->filePath);
|
$filepath = explode('../../../../../public', $attachment->filePath);
|
||||||
// var_dump($attachment->filePath);
|
// var_dump($attachment->filePath);
|
||||||
// dd($filepath);
|
// dd($filepath);
|
||||||
// $path = $dir_img_path[0]."/code/public/".$filepath[1];
|
// $path = $dir_img_path[0]."/code/public/".$filepath[1];
|
||||||
$path = public_path().$filepath[1];
|
$path = public_path() . $filepath[1];
|
||||||
// dd($path);
|
// dd($path);
|
||||||
$filesize = filesize($path);
|
$filesize = filesize($path);
|
||||||
$file_data = file_get_contents($path);
|
$file_data = file_get_contents($path);
|
||||||
@@ -151,11 +159,11 @@ class MailController extends Controller {
|
|||||||
$string = str_replace('-', '', $attachment->name);
|
$string = str_replace('-', '', $attachment->name);
|
||||||
$filename = explode('src', $attachment->filePath);
|
$filename = explode('src', $attachment->filePath);
|
||||||
$filename = str_replace('\\', '', $filename);
|
$filename = str_replace('\\', '', $filename);
|
||||||
$body = str_replace("cid:".$imageid, $filepath[1], $body);
|
$body = str_replace("cid:" . $imageid, $filepath[1], $body);
|
||||||
$pos = strpos($body, $filepath[1]);
|
$pos = strpos($body, $filepath[1]);
|
||||||
|
|
||||||
if($pos == false) {
|
if ($pos == false) {
|
||||||
if($settings_email->first()->attachment == 1) {
|
if ($settings_email->first()->attachment == 1) {
|
||||||
$upload = new Ticket_attachments;
|
$upload = new Ticket_attachments;
|
||||||
$upload->file = $file_data;
|
$upload->file = $file_data;
|
||||||
$upload->thread_id = $thread_id;
|
$upload->thread_id = $thread_id;
|
||||||
@@ -178,8 +186,8 @@ class MailController extends Controller {
|
|||||||
unlink($path);
|
unlink($path);
|
||||||
}
|
}
|
||||||
$body = Encoding::fixUTF8($body);
|
$body = Encoding::fixUTF8($body);
|
||||||
$thread = Ticket_Thread::where('id','=',$thread_id)->first();
|
$thread = Ticket_Thread::where('id', '=', $thread_id)->first();
|
||||||
$thread->body = $this->separate_reply($body) ;
|
$thread->body = $this->separate_reply($body);
|
||||||
$thread->save();
|
$thread->save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -218,16 +226,16 @@ class MailController extends Controller {
|
|||||||
* fetch_attachments
|
* fetch_attachments
|
||||||
* @return type
|
* @return type
|
||||||
*/
|
*/
|
||||||
public function fetch_attachments(){
|
public function fetch_attachments() {
|
||||||
$uploads = Upload::all();
|
$uploads = Upload::all();
|
||||||
foreach($uploads as $attachment) {
|
foreach ($uploads as $attachment) {
|
||||||
$image = @imagecreatefromstring($attachment->file);
|
$image = @imagecreatefromstring($attachment->file);
|
||||||
ob_start();
|
ob_start();
|
||||||
imagejpeg($image, null, 80);
|
imagejpeg($image, null, 80);
|
||||||
$data = ob_get_contents();
|
$data = ob_get_contents();
|
||||||
ob_end_clean();
|
ob_end_clean();
|
||||||
$var = '<a href="" target="_blank"><img src="data:image/jpg;base64,' . base64_encode($data) . '"/></a>';
|
$var = '<a href="" target="_blank"><img src="data:image/jpg;base64,' . base64_encode($data) . '"/></a>';
|
||||||
echo '<br/><span class="mailbox-attachment-icon has-img">'.$var.'</span>';
|
echo '<br/><span class="mailbox-attachment-icon has-img">' . $var . '</span>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -236,12 +244,11 @@ class MailController extends Controller {
|
|||||||
* @param type $id
|
* @param type $id
|
||||||
* @return type file
|
* @return type file
|
||||||
*/
|
*/
|
||||||
public function get_data($id){
|
public function get_data($id) {
|
||||||
$attachments = App\Model\helpdesk\Ticket\Ticket_attachments::where('id','=',$id)->get();
|
$attachments = App\Model\helpdesk\Ticket\Ticket_attachments::where('id', '=', $id)->get();
|
||||||
foreach($attachments as $attachment)
|
foreach ($attachments as $attachment) {
|
||||||
{
|
header('Content-type: application/' . $attachment->type . '');
|
||||||
header('Content-type: application/'.$attachment->type.'');
|
header('Content-Disposition: inline; filename=' . $attachment->name . '');
|
||||||
header('Content-Disposition: inline; filename='.$attachment->name.'');
|
|
||||||
header('Content-Transfer-Encoding: binary');
|
header('Content-Transfer-Encoding: binary');
|
||||||
echo $attachment->file;
|
echo $attachment->file;
|
||||||
}
|
}
|
||||||
|
@@ -1,8 +1,9 @@
|
|||||||
<?php namespace App\Http\Controllers\Agent\helpdesk;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Agent\helpdesk;
|
||||||
|
|
||||||
// controllers
|
// controllers
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
|
|
||||||
// Model
|
// Model
|
||||||
use App\User;
|
use App\User;
|
||||||
use App\Model\helpdesk\Settings\Company;
|
use App\Model\helpdesk\Settings\Company;
|
||||||
@@ -10,7 +11,6 @@ use App\Model\helpdesk\Agent\Teams;
|
|||||||
use App\Model\helpdesk\Agent\Department;
|
use App\Model\helpdesk\Agent\Department;
|
||||||
use App\Model\helpdesk\Utility\Log_notification;
|
use App\Model\helpdesk\Utility\Log_notification;
|
||||||
use App\Model\helpdesk\settings\Email;
|
use App\Model\helpdesk\settings\Email;
|
||||||
|
|
||||||
// classes
|
// classes
|
||||||
use Exception;
|
use Exception;
|
||||||
|
|
||||||
@@ -26,19 +26,20 @@ class NotificationController extends Controller {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* This function is for sending daily report/notification about the system
|
* This function is for sending daily report/notification about the system
|
||||||
**/
|
* */
|
||||||
public function send_notification() {
|
public function send_notification() {
|
||||||
//fetching email settings
|
//fetching email settings
|
||||||
$email = Email::where('id','=','1')->first();
|
$email = Email::where('id', '=', '1')->first();
|
||||||
// checking if the daily notification is enabled or not
|
// checking if the daily notification is enabled or not
|
||||||
if($email->notification_cron == 1){
|
if ($email->notification_cron == 1) {
|
||||||
// checking if current date is equal to the last entered daily notification log
|
// checking if current date is equal to the last entered daily notification log
|
||||||
$notification = Log_notification::where('log','=','NOT-1')->orderBy('id','DESC')->first();
|
$notification = Log_notification::where('log', '=', 'NOT-1')->orderBy('id', 'DESC')->first();
|
||||||
$date = explode(" " , $notification->created_at);
|
$date = explode(" ", $notification->created_at);
|
||||||
if(Date('Y-m-d') == $date[0]){
|
if (Date('Y-m-d') == $date[0]) {
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// creating a daily notification log
|
// creating a daily notification log
|
||||||
Log_notification::create(['log'=>'NOT-1']);
|
Log_notification::create(['log' => 'NOT-1']);
|
||||||
$company = $this->company();
|
$company = $this->company();
|
||||||
// Send notification details to admin
|
// Send notification details to admin
|
||||||
$this->send_notification_to_admin($company);
|
$this->send_notification_to_admin($company);
|
||||||
@@ -56,15 +57,15 @@ class NotificationController extends Controller {
|
|||||||
* Admin Notification/Report
|
* Admin Notification/Report
|
||||||
* @param company
|
* @param company
|
||||||
* @return mail
|
* @return mail
|
||||||
**/
|
* */
|
||||||
public function send_notification_to_admin($company) {
|
public function send_notification_to_admin($company) {
|
||||||
// get all admin users
|
// get all admin users
|
||||||
$users = User::where('role','=','admin')->get();
|
$users = User::where('role', '=', 'admin')->get();
|
||||||
foreach ($users as $user) {
|
foreach ($users as $user) {
|
||||||
// Send notification details to admin
|
// Send notification details to admin
|
||||||
$email = $user->email;
|
$email = $user->email;
|
||||||
$user_name = $user->first_name . " " . $user->last_name;
|
$user_name = $user->first_name . " " . $user->last_name;
|
||||||
\Mail::send('emails.notifications.admin', ['company' => $company, 'name'=>$user_name], function ($message)use ($email, $user_name, $company) {
|
\Mail::send('emails.notifications.admin', ['company' => $company, 'name' => $user_name], function ($message)use ($email, $user_name, $company) {
|
||||||
$message->to($email, $user_name)->subject($company . ' Daily Report ');
|
$message->to($email, $user_name)->subject($company . ' Daily Report ');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -73,20 +74,20 @@ class NotificationController extends Controller {
|
|||||||
/**
|
/**
|
||||||
* Department Manager Notification/Report
|
* Department Manager Notification/Report
|
||||||
* @return mail
|
* @return mail
|
||||||
**/
|
* */
|
||||||
public function send_notification_to_manager($company) {
|
public function send_notification_to_manager($company) {
|
||||||
// get all department managers
|
// get all department managers
|
||||||
$depts = Department::all();
|
$depts = Department::all();
|
||||||
foreach ($depts as $dept) {
|
foreach ($depts as $dept) {
|
||||||
if(isset($dept->manager)) {
|
if (isset($dept->manager)) {
|
||||||
$dept_name = $dept->name;
|
$dept_name = $dept->name;
|
||||||
$users = User::where('id','=',$dept->manager)->get();
|
$users = User::where('id', '=', $dept->manager)->get();
|
||||||
foreach ($users as $user) {
|
foreach ($users as $user) {
|
||||||
// Send notification details to manager of a department
|
// Send notification details to manager of a department
|
||||||
$email = $user->email;
|
$email = $user->email;
|
||||||
$user_name = $user->first_name . " " . $user->last_name;
|
$user_name = $user->first_name . " " . $user->last_name;
|
||||||
\Mail::send('emails.notifications.manager', ['company' => $company, 'name'=>$user_name,'dept_id' => $dept->id, 'dept_name' => $dept->name], function ($message)use ($email, $user_name, $company, $dept_name) {
|
\Mail::send('emails.notifications.manager', ['company' => $company, 'name' => $user_name, 'dept_id' => $dept->id, 'dept_name' => $dept->name], function ($message)use ($email, $user_name, $company, $dept_name) {
|
||||||
$message->to($email, $user_name)->subject($company . ' Daily Report for department manager of '. $dept_name.' department.');
|
$message->to($email, $user_name)->subject($company . ' Daily Report for department manager of ' . $dept_name . ' department.');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -96,20 +97,20 @@ class NotificationController extends Controller {
|
|||||||
/**
|
/**
|
||||||
* Team Lead Notification/Report
|
* Team Lead Notification/Report
|
||||||
* @return mail
|
* @return mail
|
||||||
**/
|
* */
|
||||||
public function send_notification_to_team_lead($company) {
|
public function send_notification_to_team_lead($company) {
|
||||||
// get all Team leads
|
// get all Team leads
|
||||||
$teams = Teams::all();
|
$teams = Teams::all();
|
||||||
foreach ($teams as $team) {
|
foreach ($teams as $team) {
|
||||||
if(isset($team->team_lead)) {
|
if (isset($team->team_lead)) {
|
||||||
$team_name = $team->name;
|
$team_name = $team->name;
|
||||||
$users = User::where('id','=',$team->team_lead)->get();
|
$users = User::where('id', '=', $team->team_lead)->get();
|
||||||
foreach ($users as $user) {
|
foreach ($users as $user) {
|
||||||
// Send notification details to team lead
|
// Send notification details to team lead
|
||||||
$email = $user->email;
|
$email = $user->email;
|
||||||
$user_name = $user->first_name . " " . $user->last_name;
|
$user_name = $user->first_name . " " . $user->last_name;
|
||||||
\Mail::send('emails.notifications.lead', ['company' => $company, 'name'=>$user_name,'team_id' => $team->id], function ($message)use ($email, $user_name, $company, $team_name) {
|
\Mail::send('emails.notifications.lead', ['company' => $company, 'name' => $user_name, 'team_id' => $team->id], function ($message)use ($email, $user_name, $company, $team_name) {
|
||||||
$message->to($email, $user_name)->subject($company . ' Daily Report for Team Lead of team '. $team_name);
|
$message->to($email, $user_name)->subject($company . ' Daily Report for Team Lead of team ' . $team_name);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -119,15 +120,15 @@ class NotificationController extends Controller {
|
|||||||
/**
|
/**
|
||||||
* Agent Notification/Report
|
* Agent Notification/Report
|
||||||
* @return mail
|
* @return mail
|
||||||
**/
|
* */
|
||||||
public function send_notification_to_agent($company) {
|
public function send_notification_to_agent($company) {
|
||||||
// get all agents users
|
// get all agents users
|
||||||
$users = User::where('role','=','agent')->get();
|
$users = User::where('role', '=', 'agent')->get();
|
||||||
foreach ($users as $user) {
|
foreach ($users as $user) {
|
||||||
// Send notification details to all the agents
|
// Send notification details to all the agents
|
||||||
$email = $user->email;
|
$email = $user->email;
|
||||||
$user_name = $user->first_name . " " . $user->last_name;
|
$user_name = $user->first_name . " " . $user->last_name;
|
||||||
\Mail::send('emails.notifications.agent', ['company' => $company, 'name'=>$user_name, 'user_id' => 1], function ($message)use ($email, $user_name, $company) {
|
\Mail::send('emails.notifications.agent', ['company' => $company, 'name' => $user_name, 'user_id' => 1], function ($message)use ($email, $user_name, $company) {
|
||||||
$message->to($email, $user_name)->subject($company . ' Daily Report for Agents');
|
$message->to($email, $user_name)->subject($company . ' Daily Report for Agents');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -139,11 +140,11 @@ class NotificationController extends Controller {
|
|||||||
*/
|
*/
|
||||||
public function company() {
|
public function company() {
|
||||||
// fetching comapny model
|
// fetching comapny model
|
||||||
$company = Company::Where('id','=','1')->first();
|
$company = Company::Where('id', '=', '1')->first();
|
||||||
// fetching company name
|
// fetching company name
|
||||||
if($company->company_name == null){
|
if ($company->company_name == null) {
|
||||||
$company = "Support Center";
|
$company = "Support Center";
|
||||||
}else{
|
} else {
|
||||||
$company = $company->company_name;
|
$company = $company->company_name;
|
||||||
}
|
}
|
||||||
return $company;
|
return $company;
|
||||||
@@ -157,5 +158,4 @@ class NotificationController extends Controller {
|
|||||||
// $message->to($email, $user_name)->subject('testing reporting');
|
// $message->to($email, $user_name)->subject('testing reporting');
|
||||||
// });
|
// });
|
||||||
// }
|
// }
|
||||||
|
|
||||||
}
|
}
|
@@ -1,13 +1,14 @@
|
|||||||
<?php namespace App\Http\Controllers\Agent\helpdesk;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Agent\helpdesk;
|
||||||
|
|
||||||
// controllers
|
// controllers
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
|
|
||||||
// requests
|
// requests
|
||||||
use App\Http\Requests\helpdesk\OrganizationRequest;
|
use App\Http\Requests\helpdesk\OrganizationRequest;
|
||||||
|
|
||||||
/* include organization model */
|
/* include organization model */
|
||||||
use App\Http\Requests\helpdesk\OrganizationUpdate;
|
use App\Http\Requests\helpdesk\OrganizationUpdate;
|
||||||
|
|
||||||
// models
|
// models
|
||||||
/* Define OrganizationRequest to validate the create form */
|
/* Define OrganizationRequest to validate the create form */
|
||||||
use App\Model\helpdesk\Agent_panel\Organization;
|
use App\Model\helpdesk\Agent_panel\Organization;
|
||||||
@@ -70,9 +71,9 @@ class OrganizationController extends Controller {
|
|||||||
/* column name */
|
/* column name */
|
||||||
->addColumn('name', function ($model) {
|
->addColumn('name', function ($model) {
|
||||||
// return $model->name;
|
// return $model->name;
|
||||||
if(strlen($model->name) > 20) {
|
if (strlen($model->name) > 20) {
|
||||||
$orgname = substr($model->name, 0, 25);
|
$orgname = substr($model->name, 0, 25);
|
||||||
$orgname = substr($orgname, 0, strrpos($orgname, ' ')).' ...';
|
$orgname = substr($orgname, 0, strrpos($orgname, ' ')) . ' ...';
|
||||||
} else {
|
} else {
|
||||||
$orgname = $model->name;
|
$orgname = $model->name;
|
||||||
}
|
}
|
||||||
@@ -92,8 +93,8 @@ class OrganizationController extends Controller {
|
|||||||
->addColumn('Actions', function ($model) {
|
->addColumn('Actions', function ($model) {
|
||||||
// displaying action buttons
|
// displaying action buttons
|
||||||
// modal popup to delete data
|
// modal popup to delete data
|
||||||
return '<span data-toggle="modal" data-target="#deletearticle'.$model->id .'"><a href="#" ><button class="btn btn-danger btn-xs"></a> ' . \Lang::get('lang.delete') . ' </button></span> <a href="'.route('organizations.edit', $model->id).'" class="btn btn-warning btn-xs">' . \Lang::get('lang.edit') . '</a> <a href="'.route('organizations.show', $model->id).'" class="btn btn-primary btn-xs">' . \Lang::get('lang.view') . '</a>
|
return '<span data-toggle="modal" data-target="#deletearticle' . $model->id . '"><a href="#" ><button class="btn btn-danger btn-xs"></a> ' . \Lang::get('lang.delete') . ' </button></span> <a href="' . route('organizations.edit', $model->id) . '" class="btn btn-warning btn-xs">' . \Lang::get('lang.edit') . '</a> <a href="' . route('organizations.show', $model->id) . '" class="btn btn-primary btn-xs">' . \Lang::get('lang.view') . '</a>
|
||||||
<div class="modal fade" id="deletearticle'.$model->id .'">
|
<div class="modal fade" id="deletearticle' . $model->id . '">
|
||||||
<div class="modal-dialog">
|
<div class="modal-dialog">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
@@ -101,11 +102,11 @@ class OrganizationController extends Controller {
|
|||||||
<h4 class="modal-title">Are You Sure ?</h4>
|
<h4 class="modal-title">Are You Sure ?</h4>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
'.$model->user_name.'
|
' . $model->user_name . '
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal" id="dismis2">Close</button>
|
<button type="button" class="btn btn-default pull-left" data-dismiss="modal" id="dismis2">Close</button>
|
||||||
<a href="'.route('org.delete',$model->id).'"><button class="btn btn-danger">delete</button></a>
|
<a href="' . route('org.delete', $model->id) . '"><button class="btn btn-danger">delete</button></a>
|
||||||
</div>
|
</div>
|
||||||
</div><!-- /.modal-content -->
|
</div><!-- /.modal-content -->
|
||||||
</div><!-- /.modal-dialog -->
|
</div><!-- /.modal-dialog -->
|
||||||
@@ -219,7 +220,7 @@ class OrganizationController extends Controller {
|
|||||||
|
|
||||||
/* select the field by id */
|
/* select the field by id */
|
||||||
$orgs = $org->whereId($id)->first();
|
$orgs = $org->whereId($id)->first();
|
||||||
$user_orgs = $user_org->where('org_id','=',$id)->get();
|
$user_orgs = $user_org->where('org_id', '=', $id)->get();
|
||||||
foreach ($user_orgs as $user_org) {
|
foreach ($user_orgs as $user_org) {
|
||||||
$user_org->delete();
|
$user_org->delete();
|
||||||
}
|
}
|
||||||
@@ -240,11 +241,11 @@ class OrganizationController extends Controller {
|
|||||||
* @param type $id
|
* @param type $id
|
||||||
* @return type boolean
|
* @return type boolean
|
||||||
*/
|
*/
|
||||||
public function Head_Org($id){
|
public function Head_Org($id) {
|
||||||
// get the user to make organization head
|
// get the user to make organization head
|
||||||
$head_user = \Input::get('user');
|
$head_user = \Input::get('user');
|
||||||
// get an instance of the selected organization
|
// get an instance of the selected organization
|
||||||
$org_head = Organization::where('id','=',$id)->first();
|
$org_head = Organization::where('id', '=', $id)->first();
|
||||||
$org_head->head = $head_user;
|
$org_head->head = $head_user;
|
||||||
// save the user to organization head
|
// save the user to organization head
|
||||||
$org_head->save();
|
$org_head->save();
|
||||||
|
@@ -1,4 +1,7 @@
|
|||||||
<?php namespace App\Http\Controllers\Agent\helpdesk;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Agent\helpdesk;
|
||||||
|
|
||||||
// controllers
|
// controllers
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
use App\Http\Controllers\Agent\helpdesk\TicketController;
|
use App\Http\Controllers\Agent\helpdesk\TicketController;
|
||||||
@@ -50,15 +53,15 @@ class Ticket2Controller extends Controller {
|
|||||||
* @return type response
|
* @return type response
|
||||||
*/
|
*/
|
||||||
public function deptopen($id) {
|
public function deptopen($id) {
|
||||||
$dept = Department::where('name','=',$id)->first();
|
$dept = Department::where('name', '=', $id)->first();
|
||||||
if(Auth::user()->role == 'agent') {
|
if (Auth::user()->role == 'agent') {
|
||||||
if(Auth::user()->dept_id == $dept->id) {
|
if (Auth::user()->dept_id == $dept->id) {
|
||||||
return view('themes.default1.agent.helpdesk.dept-ticket.open',compact('id'));
|
return view('themes.default1.agent.helpdesk.dept-ticket.open', compact('id'));
|
||||||
} else {
|
} else {
|
||||||
return redirect()->back()->with('fails','Unauthorised!');
|
return redirect()->back()->with('fails', 'Unauthorised!');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return view('themes.default1.agent.helpdesk.dept-ticket.open',compact('id'));
|
return view('themes.default1.agent.helpdesk.dept-ticket.open', compact('id'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -67,15 +70,15 @@ class Ticket2Controller extends Controller {
|
|||||||
* @return type response
|
* @return type response
|
||||||
*/
|
*/
|
||||||
public function deptclose($id) {
|
public function deptclose($id) {
|
||||||
$dept = Department::where('name','=',$id)->first();
|
$dept = Department::where('name', '=', $id)->first();
|
||||||
if(Auth::user()->role == 'agent') {
|
if (Auth::user()->role == 'agent') {
|
||||||
if(Auth::user()->dept_id == $dept->id) {
|
if (Auth::user()->dept_id == $dept->id) {
|
||||||
return view('themes.default1.agent.helpdesk.dept-ticket.closed',compact('id'));
|
return view('themes.default1.agent.helpdesk.dept-ticket.closed', compact('id'));
|
||||||
} else {
|
} else {
|
||||||
return redirect()->back()->with('fails','Unauthorised!');
|
return redirect()->back()->with('fails', 'Unauthorised!');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return view('themes.default1.agent.helpdesk.dept-ticket.closed',compact('id'));
|
return view('themes.default1.agent.helpdesk.dept-ticket.closed', compact('id'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -84,15 +87,15 @@ class Ticket2Controller extends Controller {
|
|||||||
* @return type response
|
* @return type response
|
||||||
*/
|
*/
|
||||||
public function deptinprogress($id) {
|
public function deptinprogress($id) {
|
||||||
$dept = Department::where('name','=',$id)->first();
|
$dept = Department::where('name', '=', $id)->first();
|
||||||
if(Auth::user()->role == 'agent') {
|
if (Auth::user()->role == 'agent') {
|
||||||
if(Auth::user()->dept_id == $dept->id) {
|
if (Auth::user()->dept_id == $dept->id) {
|
||||||
return view('themes.default1.agent.helpdesk.dept-ticket.inprogress',compact('id'));
|
return view('themes.default1.agent.helpdesk.dept-ticket.inprogress', compact('id'));
|
||||||
} else {
|
} else {
|
||||||
return redirect()->back()->with('fails','Unauthorised!');
|
return redirect()->back()->with('fails', 'Unauthorised!');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return view('themes.default1.agent.helpdesk.dept-ticket.inprogress',compact('id'));
|
return view('themes.default1.agent.helpdesk.dept-ticket.inprogress', compact('id'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,9 @@
|
|||||||
<?php namespace App\Http\Controllers\Agent\helpdesk;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Agent\helpdesk;
|
||||||
|
|
||||||
// controllers
|
// controllers
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
|
|
||||||
// requests
|
// requests
|
||||||
/* Include Sys_user Model */
|
/* Include Sys_user Model */
|
||||||
use App\Http\Requests\helpdesk\ProfilePassword;
|
use App\Http\Requests\helpdesk\ProfilePassword;
|
||||||
@@ -11,12 +13,10 @@ use App\Http\Requests\helpdesk\ProfileRequest;
|
|||||||
use App\Http\Requests\helpdesk\Sys_userRequest;
|
use App\Http\Requests\helpdesk\Sys_userRequest;
|
||||||
/* include guest_note model */
|
/* include guest_note model */
|
||||||
use App\Http\Requests\helpdesk\Sys_userUpdate;
|
use App\Http\Requests\helpdesk\Sys_userUpdate;
|
||||||
|
|
||||||
// models
|
// models
|
||||||
use App\Model\helpdesk\Agent_panel\Organization;
|
use App\Model\helpdesk\Agent_panel\Organization;
|
||||||
use App\Model\helpdesk\Agent_panel\User_org;
|
use App\Model\helpdesk\Agent_panel\User_org;
|
||||||
use App\User;
|
use App\User;
|
||||||
|
|
||||||
// classes
|
// classes
|
||||||
use Auth;
|
use Auth;
|
||||||
use Hash;
|
use Hash;
|
||||||
@@ -59,7 +59,7 @@ class UserController extends Controller {
|
|||||||
/* get all values in Sys_user */
|
/* get all values in Sys_user */
|
||||||
return view('themes.default1.agent.helpdesk.user.index');
|
return view('themes.default1.agent.helpdesk.user.index');
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
return redirect()->back()->with('fails',$e->errorInfo[2]);
|
return redirect()->back()->with('fails', $e->errorInfo[2]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -69,16 +69,16 @@ class UserController extends Controller {
|
|||||||
*/
|
*/
|
||||||
public function user_list() {
|
public function user_list() {
|
||||||
// displaying list of users with chumper datatables
|
// displaying list of users with chumper datatables
|
||||||
return \Datatable::collection(User::where('role','!=','admin')->where('role','!=','agent')->get())
|
return \Datatable::collection(User::where('role', '!=', 'admin')->where('role', '!=', 'agent')->get())
|
||||||
/* searchable column username */
|
/* searchable column username */
|
||||||
->searchColumns('user_name')
|
->searchColumns('user_name')
|
||||||
/* order column username and email */
|
/* order column username and email */
|
||||||
->orderColumns('user_name', 'email')
|
->orderColumns('user_name', 'email')
|
||||||
/* column username */
|
/* column username */
|
||||||
->addColumn('user_name', function ($model) {
|
->addColumn('user_name', function ($model) {
|
||||||
if(strlen($model->user_name) > 20) {
|
if (strlen($model->user_name) > 20) {
|
||||||
$username = substr($model->user_name, 0, 30);
|
$username = substr($model->user_name, 0, 30);
|
||||||
$username = substr($username, 0, strrpos($username, ' ')).' ...';
|
$username = substr($username, 0, strrpos($username, ' ')) . ' ...';
|
||||||
} else {
|
} else {
|
||||||
$username = $model->user_name;
|
$username = $model->user_name;
|
||||||
}
|
}
|
||||||
@@ -92,20 +92,20 @@ class UserController extends Controller {
|
|||||||
/* column phone */
|
/* column phone */
|
||||||
->addColumn('phone', function ($model) {
|
->addColumn('phone', function ($model) {
|
||||||
$phone = "";
|
$phone = "";
|
||||||
if($model->phone_number) {
|
if ($model->phone_number) {
|
||||||
$phone = $model->ext . ' ' . $model->phone_number;
|
$phone = $model->ext . ' ' . $model->phone_number;
|
||||||
}
|
}
|
||||||
$mobile = "";
|
$mobile = "";
|
||||||
if($model->mobile) {
|
if ($model->mobile) {
|
||||||
$mobile = $model->mobile;
|
$mobile = $model->mobile;
|
||||||
}
|
}
|
||||||
$phone = $phone ." ". $mobile;
|
$phone = $phone . " " . $mobile;
|
||||||
return $phone;
|
return $phone;
|
||||||
})
|
})
|
||||||
/* column account status */
|
/* column account status */
|
||||||
->addColumn('status', function ($model) {
|
->addColumn('status', function ($model) {
|
||||||
$status = $model->active;
|
$status = $model->active;
|
||||||
if($status == 1) {
|
if ($status == 1) {
|
||||||
$stat = '<button class="btn btn-success btn-xs">Active</button>';
|
$stat = '<button class="btn btn-success btn-xs">Active</button>';
|
||||||
} else {
|
} else {
|
||||||
$stat = '<button class="btn btn-danger btn-xs">Inactive</button>';
|
$stat = '<button class="btn btn-danger btn-xs">Inactive</button>';
|
||||||
@@ -115,7 +115,7 @@ class UserController extends Controller {
|
|||||||
/* column ban status */
|
/* column ban status */
|
||||||
->addColumn('ban', function ($model) {
|
->addColumn('ban', function ($model) {
|
||||||
$status = $model->ban;
|
$status = $model->ban;
|
||||||
if($status == 1) {
|
if ($status == 1) {
|
||||||
$stat = '<button class="btn btn-danger btn-xs">Banned</button>';
|
$stat = '<button class="btn btn-danger btn-xs">Banned</button>';
|
||||||
} else {
|
} else {
|
||||||
$stat = '<button class="btn btn-success btn-xs">Active</button>';
|
$stat = '<button class="btn btn-success btn-xs">Active</button>';
|
||||||
@@ -129,7 +129,7 @@ class UserController extends Controller {
|
|||||||
})
|
})
|
||||||
/* column actions */
|
/* column actions */
|
||||||
->addColumn('Actions', function ($model) {
|
->addColumn('Actions', function ($model) {
|
||||||
return '<a href="'.route('user.edit', $model->id).'" class="btn btn-warning btn-xs">' . \Lang::get('lang.edit') . '</a> <a href="'.route('user.show', $model->id).'" class="btn btn-primary btn-xs">' . \Lang::get('lang.view') . '</a>';
|
return '<a href="' . route('user.edit', $model->id) . '" class="btn btn-warning btn-xs">' . \Lang::get('lang.edit') . '</a> <a href="' . route('user.show', $model->id) . '" class="btn btn-primary btn-xs">' . \Lang::get('lang.view') . '</a>';
|
||||||
})
|
})
|
||||||
->make();
|
->make();
|
||||||
}
|
}
|
||||||
@@ -142,7 +142,7 @@ class UserController extends Controller {
|
|||||||
try {
|
try {
|
||||||
return view('themes.default1.agent.helpdesk.user.create');
|
return view('themes.default1.agent.helpdesk.user.create');
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
return redirect()->back()->with('fails',$e->errorInfo[2]);
|
return redirect()->back()->with('fails', $e->errorInfo[2]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -218,7 +218,7 @@ class UserController extends Controller {
|
|||||||
$users = $user->whereId($id)->first();
|
$users = $user->whereId($id)->first();
|
||||||
/* Update the value by selected field */
|
/* Update the value by selected field */
|
||||||
/* Check whether function success or not */
|
/* Check whether function success or not */
|
||||||
try{
|
try {
|
||||||
$users->fill($request->input())->save();
|
$users->fill($request->input())->save();
|
||||||
/* redirect to Index page with Success Message */
|
/* redirect to Index page with Success Message */
|
||||||
return redirect('user')->with('success', 'User Updated Successfully');
|
return redirect('user')->with('success', 'User Updated Successfully');
|
||||||
@@ -236,8 +236,8 @@ class UserController extends Controller {
|
|||||||
$user = Auth::user();
|
$user = Auth::user();
|
||||||
try {
|
try {
|
||||||
return view('themes.default1.agent.helpdesk.user.profile', compact('user'));
|
return view('themes.default1.agent.helpdesk.user.profile', compact('user'));
|
||||||
} catch(Exception $e) {
|
} catch (Exception $e) {
|
||||||
return redirect()->back()->with('fails',$e->errorInfo[2]);
|
return redirect()->back()->with('fails', $e->errorInfo[2]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -250,7 +250,7 @@ class UserController extends Controller {
|
|||||||
try {
|
try {
|
||||||
return view('themes.default1.agent.helpdesk.user.profile-edit', compact('user'));
|
return view('themes.default1.agent.helpdesk.user.profile-edit', compact('user'));
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
return redirect()->back()->with('fails',$e->errorInfo[2]);
|
return redirect()->back()->with('fails', $e->errorInfo[2]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -290,13 +290,12 @@ class UserController extends Controller {
|
|||||||
// saving filename to database
|
// saving filename to database
|
||||||
$user->profile_pic = $fileName;
|
$user->profile_pic = $fileName;
|
||||||
} else {
|
} else {
|
||||||
try{
|
try {
|
||||||
$user->fill($request->except('profile_pic', 'gender'))->save();
|
$user->fill($request->except('profile_pic', 'gender'))->save();
|
||||||
return Redirect::route('profile')->with('success', 'Profile Updated sucessfully');
|
return Redirect::route('profile')->with('success', 'Profile Updated sucessfully');
|
||||||
} catch (Exception $e){
|
} catch (Exception $e) {
|
||||||
return Redirect::route('profile')->with('success', $e->errorInfo[2]);
|
return Redirect::route('profile')->with('success', $e->errorInfo[2]);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
if ($user->fill($request->except('profile_pic'))->save()) {
|
if ($user->fill($request->except('profile_pic'))->save()) {
|
||||||
return Redirect::route('profile')->with('success', 'Profile Updated sucessfully');
|
return Redirect::route('profile')->with('success', 'Profile Updated sucessfully');
|
||||||
@@ -315,7 +314,7 @@ class UserController extends Controller {
|
|||||||
// checking if the old password matches the new password
|
// checking if the old password matches the new password
|
||||||
if (Hash::check($request->input('old_password'), $user->getAuthPassword())) {
|
if (Hash::check($request->input('old_password'), $user->getAuthPassword())) {
|
||||||
$user->password = Hash::make($request->input('new_password'));
|
$user->password = Hash::make($request->input('new_password'));
|
||||||
try{
|
try {
|
||||||
$user->save();
|
$user->save();
|
||||||
return redirect('profile-edit')->with('success1', 'Password Updated sucessfully');
|
return redirect('profile-edit')->with('success1', 'Password Updated sucessfully');
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
@@ -347,20 +346,20 @@ class UserController extends Controller {
|
|||||||
*/
|
*/
|
||||||
public function User_Create_Org($id) {
|
public function User_Create_Org($id) {
|
||||||
// checking if the entered value for website is available in database
|
// checking if the entered value for website is available in database
|
||||||
if(Input::get('website')!=null) {
|
if (Input::get('website') != null) {
|
||||||
// checking website
|
// checking website
|
||||||
$check = Organization::where('website','=',Input::get('website'))->first();
|
$check = Organization::where('website', '=', Input::get('website'))->first();
|
||||||
} else {
|
} else {
|
||||||
$check = null;
|
$check = null;
|
||||||
}
|
}
|
||||||
// checking if the name is unique
|
// checking if the name is unique
|
||||||
$check2 = Organization::where('name','=',Input::get('name'))->first();
|
$check2 = Organization::where('name', '=', Input::get('name'))->first();
|
||||||
// if any of the fields is not available then return false
|
// if any of the fields is not available then return false
|
||||||
if (\Input::get('name') == null) {
|
if (\Input::get('name') == null) {
|
||||||
return "Name is required";
|
return "Name is required";
|
||||||
} elseif($check2 != null) {
|
} elseif ($check2 != null) {
|
||||||
return "Name should be Unique";
|
return "Name should be Unique";
|
||||||
} elseif($check != null) {
|
} elseif ($check != null) {
|
||||||
return "Website should be Unique";
|
return "Website should be Unique";
|
||||||
} else {
|
} else {
|
||||||
// storing organization details and assigning the current user to that organization
|
// storing organization details and assigning the current user to that organization
|
||||||
@@ -380,4 +379,5 @@ class UserController extends Controller {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@@ -1,22 +1,21 @@
|
|||||||
<?php namespace App\Http\Controllers\Agent\kb;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Agent\kb;
|
||||||
|
|
||||||
// Controllers
|
// Controllers
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
use App\Http\Controllers\Agent\kb\SettingsController;
|
use App\Http\Controllers\Agent\kb\SettingsController;
|
||||||
use App\Http\Controllers\Client\kb\UserController;
|
use App\Http\Controllers\Client\kb\UserController;
|
||||||
use App\Http\Controllers\Agent\helpdesk\TicketController;
|
use App\Http\Controllers\Agent\helpdesk\TicketController;
|
||||||
|
|
||||||
// Requests
|
// Requests
|
||||||
use App\Http\Requests\kb\ArticleRequest;
|
use App\Http\Requests\kb\ArticleRequest;
|
||||||
use App\Http\Requests\kb\ArticleUpdate;
|
use App\Http\Requests\kb\ArticleUpdate;
|
||||||
|
|
||||||
// Models
|
// Models
|
||||||
use App\Model\kb\Article;
|
use App\Model\kb\Article;
|
||||||
use App\Model\kb\Category;
|
use App\Model\kb\Category;
|
||||||
use App\Model\kb\Relationship;
|
use App\Model\kb\Relationship;
|
||||||
use App\Model\kb\Settings;
|
use App\Model\kb\Settings;
|
||||||
use App\Model\kb\Comment;
|
use App\Model\kb\Comment;
|
||||||
|
|
||||||
// Classes
|
// Classes
|
||||||
use Auth;
|
use Auth;
|
||||||
use Chumper\Datatable\Table;
|
use Chumper\Datatable\Table;
|
||||||
@@ -80,8 +79,8 @@ class ArticleController extends Controller {
|
|||||||
/* add column action */
|
/* add column action */
|
||||||
->addColumn('Actions', function ($model) {
|
->addColumn('Actions', function ($model) {
|
||||||
/* here are all the action buttons and modal popup to delete articles with confirmations */
|
/* here are all the action buttons and modal popup to delete articles with confirmations */
|
||||||
return '<span data-toggle="modal" data-target="#deletearticle'.$model->id .'"><a href="#" ><button class="btn btn-danger btn-xs"></a> ' . \Lang::get('lang.delete') . ' </button></span> <a href=article/' . $model->id . '/edit class="btn btn-warning btn-xs">' . \Lang::get('lang.edit') . '</a> <a href=show/'.$model->slug .' class="btn btn-primary btn-xs">' . \Lang::get('lang.view') . '</a>
|
return '<span data-toggle="modal" data-target="#deletearticle' . $model->id . '"><a href="#" ><button class="btn btn-danger btn-xs"></a> ' . \Lang::get('lang.delete') . ' </button></span> <a href=article/' . $model->id . '/edit class="btn btn-warning btn-xs">' . \Lang::get('lang.edit') . '</a> <a href=show/' . $model->slug . ' class="btn btn-primary btn-xs">' . \Lang::get('lang.view') . '</a>
|
||||||
<div class="modal fade" id="deletearticle'.$model->id .'">
|
<div class="modal fade" id="deletearticle' . $model->id . '">
|
||||||
<div class="modal-dialog">
|
<div class="modal-dialog">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
@@ -89,11 +88,11 @@ class ArticleController extends Controller {
|
|||||||
<h4 class="modal-title">Are You Sure ?</h4>
|
<h4 class="modal-title">Are You Sure ?</h4>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
'.$model->name.'
|
' . $model->name . '
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal" id="dismis2">Close</button>
|
<button type="button" class="btn btn-default pull-left" data-dismiss="modal" id="dismis2">Close</button>
|
||||||
<a href="article/delete/'.$model->slug.'"><button class="btn btn-danger">delete</button></a>
|
<a href="article/delete/' . $model->slug . '"><button class="btn btn-danger">delete</button></a>
|
||||||
</div>
|
</div>
|
||||||
</div><!-- /.modal-content -->
|
</div><!-- /.modal-content -->
|
||||||
</div><!-- /.modal-dialog -->
|
</div><!-- /.modal-dialog -->
|
||||||
@@ -108,10 +107,10 @@ class ArticleController extends Controller {
|
|||||||
*/
|
*/
|
||||||
public function index() {
|
public function index() {
|
||||||
/* show article list */
|
/* show article list */
|
||||||
try{
|
try {
|
||||||
return view('themes.default1.agent.kb.article.index');
|
return view('themes.default1.agent.kb.article.index');
|
||||||
} catch(Exception $e) {
|
} catch (Exception $e) {
|
||||||
return redirect()->back()->with('fails',$e->errorInfo[2]);
|
return redirect()->back()->with('fails', $e->errorInfo[2]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -124,12 +123,11 @@ class ArticleController extends Controller {
|
|||||||
/* get the attributes of the category */
|
/* get the attributes of the category */
|
||||||
$category = $category->lists('id', 'name');
|
$category = $category->lists('id', 'name');
|
||||||
/* get the create page */
|
/* get the create page */
|
||||||
try{
|
try {
|
||||||
return view('themes.default1.agent.kb.article.create', compact('category'));
|
return view('themes.default1.agent.kb.article.create', compact('category'));
|
||||||
} catch(Exception $e) {
|
} catch (Exception $e) {
|
||||||
return redirect()->back()->with('fails',$e->errorInfo[2]);
|
return redirect()->back()->with('fails', $e->errorInfo[2]);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -140,22 +138,26 @@ class ArticleController extends Controller {
|
|||||||
*/
|
*/
|
||||||
public function store(Article $article, ArticleRequest $request) {
|
public function store(Article $article, ArticleRequest $request) {
|
||||||
// requesting the values to store article data
|
// requesting the values to store article data
|
||||||
|
$publishTime = $request->input('year') . '-' . $request->input('month') . '-' . $request->input('day') . ' ' . $request->input('hour') . ':' . $request->input('minute') . ':00';
|
||||||
|
|
||||||
$sl = $request->input('slug');
|
$sl = $request->input('slug');
|
||||||
$slug = str_slug($sl, "-");
|
$slug = str_slug($sl, "-");
|
||||||
$article->slug = $slug;
|
$article->slug = $slug;
|
||||||
$article->fill($request->except('created_at','slug'))->save();
|
$article->publish_time = $publishTime;
|
||||||
|
$article->fill($request->except('created_at', 'slug'))->save();
|
||||||
// creating article category relationship
|
// creating article category relationship
|
||||||
$requests = $request->input('category_id');
|
$requests = $request->input('category_id');
|
||||||
$id = $article->id;
|
$id = $article->id;
|
||||||
|
|
||||||
foreach ($requests as $req) {
|
foreach ($requests as $req) {
|
||||||
DB::insert('insert into kb_article_relationship (category_id, article_id) values (?,?)', [$req, $id]);
|
DB::insert('insert into kb_article_relationship (category_id, article_id) values (?,?)', [$req, $id]);
|
||||||
}
|
}
|
||||||
/* insert the values to the article table */
|
/* insert the values to the article table */
|
||||||
try{
|
try {
|
||||||
$article->fill($request->except('slug'))->save();
|
$article->fill($request->except('slug'))->save();
|
||||||
return redirect('article')->with('success', 'Article Inserted Successfully');
|
return redirect('article')->with('success', 'Article Inserted Successfully');
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
return redirect('article')->with('fails', 'Article Not Inserted'. '<li>'.$e->errorInfo[2].'</li>');
|
return redirect('article')->with('fails', 'Article Not Inserted' . '<li>' . $e->errorInfo[2] . '</li>');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -168,10 +170,8 @@ class ArticleController extends Controller {
|
|||||||
* @return view
|
* @return view
|
||||||
*/
|
*/
|
||||||
public function edit($slug, Article $article, Relationship $relation, Category $category) {
|
public function edit($slug, Article $article, Relationship $relation, Category $category) {
|
||||||
|
|
||||||
$aid = $article->where('id', $slug)->first();
|
$aid = $article->where('id', $slug)->first();
|
||||||
$id = $aid->id;
|
$id = $aid->id;
|
||||||
|
|
||||||
/* define the selected fields */
|
/* define the selected fields */
|
||||||
$assign = $relation->where('article_id', $id)->lists('category_id');
|
$assign = $relation->where('article_id', $id)->lists('category_id');
|
||||||
/* get the attributes of the category */
|
/* get the attributes of the category */
|
||||||
@@ -182,10 +182,9 @@ class ArticleController extends Controller {
|
|||||||
/* send to the edit page */
|
/* send to the edit page */
|
||||||
try {
|
try {
|
||||||
return view('themes.default1.agent.kb.article.edit', compact('assign', 'article', 'category'));
|
return view('themes.default1.agent.kb.article.edit', compact('assign', 'article', 'category'));
|
||||||
} catch(Exception $e){
|
} catch (Exception $e) {
|
||||||
return redirect()->back()->with('fails',$e->errorInfo[2]);
|
return redirect()->back()->with('fails', $e->errorInfo[2]);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -198,10 +197,13 @@ class ArticleController extends Controller {
|
|||||||
*/
|
*/
|
||||||
public function update($slug, Article $article, Relationship $relation, ArticleUpdate $request) {
|
public function update($slug, Article $article, Relationship $relation, ArticleUpdate $request) {
|
||||||
$aid = $article->where('id', $slug)->first();
|
$aid = $article->where('id', $slug)->first();
|
||||||
|
$publishTime = $request->input('year') . '-' . $request->input('month') . '-' . $request->input('day') . ' ' . $request->input('hour') . ':' . $request->input('minute') . ':00';
|
||||||
|
|
||||||
$id = $aid->id;
|
$id = $aid->id;
|
||||||
$sl = $request->input('slug');
|
$sl = $request->input('slug');
|
||||||
$slug = str_slug($sl, "-");
|
$slug = str_slug($sl, "-");
|
||||||
// dd($slug);
|
// dd($slug);
|
||||||
|
|
||||||
$article->slug = $slug;
|
$article->slug = $slug;
|
||||||
/* get the attribute of relation table where id==$id */
|
/* get the attribute of relation table where id==$id */
|
||||||
$relation = $relation->where('article_id', $id);
|
$relation = $relation->where('article_id', $id);
|
||||||
@@ -211,16 +213,17 @@ class ArticleController extends Controller {
|
|||||||
$requests = $request->input('category_id');
|
$requests = $request->input('category_id');
|
||||||
$id = $article->id;
|
$id = $article->id;
|
||||||
foreach ($requests as $req) {
|
foreach ($requests as $req) {
|
||||||
DB::insert('insert into article_relationship (category_id, article_id) values (?,?)', [$req, $id]);
|
DB::insert('insert into kb_article_relationship (category_id, article_id) values (?,?)', [$req, $id]);
|
||||||
}
|
}
|
||||||
/* update the value to the table */
|
/* update the value to the table */
|
||||||
try{
|
try {
|
||||||
$article->fill($request->all())->save();
|
$article->fill($request->all())->save();
|
||||||
$article->slug = $slug;
|
$article->slug = $slug;
|
||||||
|
$article->publish_time = $publishTime;
|
||||||
$article->save();
|
$article->save();
|
||||||
return redirect('article')->with('success', 'Article Updated Successfully');
|
return redirect('article')->with('success', 'Article Updated Successfully');
|
||||||
} catch(Exception $e){
|
} catch (Exception $e) {
|
||||||
return redirect('article')->with('fails', 'Article Not Updated'.'<li>'.$e->errorInfo[2].'</li>');
|
return redirect('article')->with('fails', 'Article Not Updated' . '<li>' . $e->errorInfo[2] . '</li>');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -232,19 +235,19 @@ class ArticleController extends Controller {
|
|||||||
*/
|
*/
|
||||||
public function destroy($slug, Article $article, Relationship $relation, Comment $comment) {
|
public function destroy($slug, Article $article, Relationship $relation, Comment $comment) {
|
||||||
/* delete the selected article from the table */
|
/* delete the selected article from the table */
|
||||||
$article = $article->where('slug',$slug)->first(); //get the selected article via id
|
$article = $article->where('slug', $slug)->first(); //get the selected article via id
|
||||||
$id = $article->id;
|
$id = $article->id;
|
||||||
$comments = $comment->where('article_id',$id)->get();
|
$comments = $comment->where('article_id', $id)->get();
|
||||||
if($comments) {
|
if ($comments) {
|
||||||
foreach($comments as $comment)
|
foreach ($comments as $comment)
|
||||||
$comment->delete();
|
$comment->delete();
|
||||||
}
|
}
|
||||||
// deleting relationship
|
// deleting relationship
|
||||||
$relation = $relation->where('article_id', $id)->first();
|
$relation = $relation->where('article_id', $id)->first();
|
||||||
if($relation) {
|
if ($relation) {
|
||||||
$relation->delete();
|
$relation->delete();
|
||||||
}
|
}
|
||||||
if($article) {
|
if ($article) {
|
||||||
if ($article->delete()) {//true:redirect to index page with success message
|
if ($article->delete()) {//true:redirect to index page with success message
|
||||||
return Redirect::back()->with('success', 'Article Deleted Successfully');
|
return Redirect::back()->with('success', 'Article Deleted Successfully');
|
||||||
} else { //redirect to index page with fails message
|
} else { //redirect to index page with fails message
|
||||||
|
@@ -1,4 +1,6 @@
|
|||||||
<?php namespace App\Http\Controllers\Agent\kb;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Agent\kb;
|
||||||
|
|
||||||
// Controllers
|
// Controllers
|
||||||
use App\Http\Controllers\client\kb\UserController;
|
use App\Http\Controllers\client\kb\UserController;
|
||||||
@@ -6,15 +8,12 @@ use App\Http\Controllers\admin\kb\ArticleController;
|
|||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
use App\Http\Controllers\Agent\kb\SettingsController;
|
use App\Http\Controllers\Agent\kb\SettingsController;
|
||||||
use App\Http\Controllers\Agent\helpdesk\TicketController;
|
use App\Http\Controllers\Agent\helpdesk\TicketController;
|
||||||
|
|
||||||
// Requests
|
// Requests
|
||||||
use App\Http\Requests\kb\CategoryRequest;
|
use App\Http\Requests\kb\CategoryRequest;
|
||||||
use App\Http\Requests\kb\CategoryUpdate;
|
use App\Http\Requests\kb\CategoryUpdate;
|
||||||
|
|
||||||
// Model
|
// Model
|
||||||
use App\Model\kb\Category;
|
use App\Model\kb\Category;
|
||||||
use App\Model\kb\Relationship;
|
use App\Model\kb\Relationship;
|
||||||
|
|
||||||
// Classes
|
// Classes
|
||||||
use Datatable;
|
use Datatable;
|
||||||
use Redirect;
|
use Redirect;
|
||||||
@@ -54,7 +53,7 @@ class CategoryController extends Controller {
|
|||||||
public function index() {
|
public function index() {
|
||||||
/* get the view of index of the catogorys with all attributes
|
/* get the view of index of the catogorys with all attributes
|
||||||
of category model */
|
of category model */
|
||||||
try{
|
try {
|
||||||
return view('themes.default1.agent.kb.category.index');
|
return view('themes.default1.agent.kb.category.index');
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
return redirect()->back()->with('fails', $e->errorInfo[2]);
|
return redirect()->back()->with('fails', $e->errorInfo[2]);
|
||||||
@@ -84,7 +83,7 @@ class CategoryController extends Controller {
|
|||||||
/* add column Actions */
|
/* add column Actions */
|
||||||
/* there are action buttons and modal popup to delete a data column */
|
/* there are action buttons and modal popup to delete a data column */
|
||||||
->addColumn('Actions', function ($model) {
|
->addColumn('Actions', function ($model) {
|
||||||
return '<span data-toggle="modal" data-target="#deletecategory' . $model->slug . '"><a href="#" ><button class="btn btn-danger btn-xs"></a>'. \Lang::get("lang.delete") .'</button></span> <a href=category/' . $model->id . '/edit class="btn btn-warning btn-xs">'. \Lang::get("lang.edit") .'</a> <a href=article-list class="btn btn-primary btn-xs">'. \Lang::get("lang.view") .'</a>
|
return '<span data-toggle="modal" data-target="#deletecategory' . $model->slug . '"><a href="#" ><button class="btn btn-danger btn-xs"></a>' . \Lang::get("lang.delete") . '</button></span> <a href=category/' . $model->id . '/edit class="btn btn-warning btn-xs">' . \Lang::get("lang.edit") . '</a> <a href=article-list class="btn btn-primary btn-xs">' . \Lang::get("lang.view") . '</a>
|
||||||
<div class="modal fade" id="deletecategory' . $model->slug . '">
|
<div class="modal fade" id="deletecategory' . $model->slug . '">
|
||||||
<div class="modal-dialog">
|
<div class="modal-dialog">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
@@ -93,7 +92,7 @@ class CategoryController extends Controller {
|
|||||||
<h4 class="modal-title">Are You Sure ?</h4>
|
<h4 class="modal-title">Are You Sure ?</h4>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
'.$model->name.'
|
' . $model->name . '
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal" id="dismis2">Close</button>
|
<button type="button" class="btn btn-default pull-left" data-dismiss="modal" id="dismis2">Close</button>
|
||||||
@@ -104,7 +103,6 @@ class CategoryController extends Controller {
|
|||||||
</div>';
|
</div>';
|
||||||
})
|
})
|
||||||
->make();
|
->make();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -116,11 +114,11 @@ class CategoryController extends Controller {
|
|||||||
/* Get the all attributes in the category model */
|
/* Get the all attributes in the category model */
|
||||||
$category = $category->get();
|
$category = $category->get();
|
||||||
/* get the view page to create new category with all attributes
|
/* get the view page to create new category with all attributes
|
||||||
of category model*/
|
of category model */
|
||||||
try {
|
try {
|
||||||
return view('themes.default1.agent.kb.category.create', compact('category'));
|
return view('themes.default1.agent.kb.category.create', compact('category'));
|
||||||
} catch(Exception $e) {
|
} catch (Exception $e) {
|
||||||
return redirect()->back()->with('fails',$e->errorInfo[2]);
|
return redirect()->back()->with('fails', $e->errorInfo[2]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -136,11 +134,11 @@ class CategoryController extends Controller {
|
|||||||
$slug = str_slug($sl, "-");
|
$slug = str_slug($sl, "-");
|
||||||
$category->slug = $slug;
|
$category->slug = $slug;
|
||||||
// send success message to index page
|
// send success message to index page
|
||||||
try{
|
try {
|
||||||
$category->fill($request->except('slug'))->save();
|
$category->fill($request->except('slug'))->save();
|
||||||
return Redirect::back()->with('success', 'Category Inserted Successfully');
|
return Redirect::back()->with('success', 'Category Inserted Successfully');
|
||||||
} catch(Exception $e) {
|
} catch (Exception $e) {
|
||||||
return Redirect::back()->with('fails', 'Category Not Inserted'.'<li>'.$e->errorInfo[2].'</li>');
|
return Redirect::back()->with('fails', 'Category Not Inserted' . '<li>' . $e->errorInfo[2] . '</li>');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -177,14 +175,14 @@ class CategoryController extends Controller {
|
|||||||
$category->slug = $slug;
|
$category->slug = $slug;
|
||||||
/* update the values at the table via model according with the request */
|
/* update the values at the table via model according with the request */
|
||||||
//redirct to index page with success message
|
//redirct to index page with success message
|
||||||
try{
|
try {
|
||||||
$category->fill($request->all())->save();
|
$category->fill($request->all())->save();
|
||||||
$category->slug = $slug;
|
$category->slug = $slug;
|
||||||
$category->save();
|
$category->save();
|
||||||
return redirect('category')->with('success', 'Category Updated Successfully');
|
return redirect('category')->with('success', 'Category Updated Successfully');
|
||||||
} catch(Exception $e) {
|
} catch (Exception $e) {
|
||||||
//redirect to index with fails message
|
//redirect to index with fails message
|
||||||
return redirect('category')->with('fails', 'Category Not Updated'.'<li>'.$e->errorInfo[2].'</li>');
|
return redirect('category')->with('fails', 'Category Not Updated' . '<li>' . $e->errorInfo[2] . '</li>');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -198,18 +196,17 @@ class CategoryController extends Controller {
|
|||||||
public function destroy($id, Category $category, Relationship $relation) {
|
public function destroy($id, Category $category, Relationship $relation) {
|
||||||
|
|
||||||
$relation = $relation->where('category_id', $id)->first();
|
$relation = $relation->where('category_id', $id)->first();
|
||||||
if($relation != null){
|
if ($relation != null) {
|
||||||
return Redirect::back()->with('fails', 'Category Not Deleted');
|
return Redirect::back()->with('fails', 'Category Not Deleted');
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
/* delete the category selected, id == $id */
|
/* delete the category selected, id == $id */
|
||||||
$category = $category->whereId($id)->first();
|
$category = $category->whereId($id)->first();
|
||||||
// redirect to index with success message
|
// redirect to index with success message
|
||||||
try{
|
try {
|
||||||
$category->delete();
|
$category->delete();
|
||||||
return Redirect::back()->with('success', 'Category Deleted Successfully');
|
return Redirect::back()->with('success', 'Category Deleted Successfully');
|
||||||
} catch(Exception $e){
|
} catch (Exception $e) {
|
||||||
return Redirect::back()->with('fails', 'Category Not Deleted'.'<li>'.$e->errorInfo[2].'</li>');
|
return Redirect::back()->with('fails', 'Category Not Deleted' . '<li>' . $e->errorInfo[2] . '</li>');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,4 +1,6 @@
|
|||||||
<?php namespace App\Http\Controllers\Agent\kb;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Agent\kb;
|
||||||
|
|
||||||
// controllers
|
// controllers
|
||||||
use App\Http\Controllers\client\kb\UserController;
|
use App\Http\Controllers\client\kb\UserController;
|
||||||
@@ -6,15 +8,12 @@ use App\Http\Controllers\Agent\kb\ArticleController;
|
|||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
use App\Http\Controllers\Agent\kb\SettingsController;
|
use App\Http\Controllers\Agent\kb\SettingsController;
|
||||||
use App\Http\Controllers\Agent\helpdesk\TicketController;
|
use App\Http\Controllers\Agent\helpdesk\TicketController;
|
||||||
|
|
||||||
// request
|
// request
|
||||||
use App\Http\Requests\kb\PageRequest;
|
use App\Http\Requests\kb\PageRequest;
|
||||||
use App\Http\Requests\kb\PageUpdate;
|
use App\Http\Requests\kb\PageUpdate;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
// Model
|
// Model
|
||||||
use App\Model\kb\Page;
|
use App\Model\kb\Page;
|
||||||
|
|
||||||
// classes
|
// classes
|
||||||
use Datatable;
|
use Datatable;
|
||||||
use Exception;
|
use Exception;
|
||||||
@@ -53,10 +52,10 @@ class PageController extends Controller {
|
|||||||
public function index() {
|
public function index() {
|
||||||
$pages = $this->page->paginate(3);
|
$pages = $this->page->paginate(3);
|
||||||
$pages->setPath('page');
|
$pages->setPath('page');
|
||||||
try{
|
try {
|
||||||
return view('themes.default1.agent.kb.pages.index', compact('pages'));
|
return view('themes.default1.agent.kb.pages.index', compact('pages'));
|
||||||
} catch(Exception $e) {
|
} catch (Exception $e) {
|
||||||
return redirect()->back()->with('fails',$e->errorInfo[2]);
|
return redirect()->back()->with('fails', $e->errorInfo[2]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -83,7 +82,7 @@ class PageController extends Controller {
|
|||||||
/* add column Actions */
|
/* add column Actions */
|
||||||
/* there are action buttons and modal popup to delete a data column */
|
/* there are action buttons and modal popup to delete a data column */
|
||||||
->addColumn('Actions', function ($model) {
|
->addColumn('Actions', function ($model) {
|
||||||
return '<span data-toggle="modal" data-target="#deletepage' . $model->id . '"><a href="#" ><button class="btn btn-danger btn-xs"></a> '. \Lang::get('lang.delete') .'</button></span> <a href=page/' . $model->slug . '/edit class="btn btn-warning btn-xs">'. \Lang::get('lang.edit') .'</a> <a href=pages/' . $model->slug . ' class="btn btn-primary btn-xs">'. \Lang::get('lang.view') .'</a>
|
return '<span data-toggle="modal" data-target="#deletepage' . $model->id . '"><a href="#" ><button class="btn btn-danger btn-xs"></a> ' . \Lang::get('lang.delete') . '</button></span> <a href=page/' . $model->slug . '/edit class="btn btn-warning btn-xs">' . \Lang::get('lang.edit') . '</a> <a href=pages/' . $model->slug . ' class="btn btn-primary btn-xs">' . \Lang::get('lang.view') . '</a>
|
||||||
<div class="modal fade" id="deletepage' . $model->id . '">
|
<div class="modal fade" id="deletepage' . $model->id . '">
|
||||||
<div class="modal-dialog">
|
<div class="modal-dialog">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
@@ -92,7 +91,7 @@ class PageController extends Controller {
|
|||||||
<h4 class="modal-title">Are You Sure ?</h4>
|
<h4 class="modal-title">Are You Sure ?</h4>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
'.$model->name.'
|
' . $model->name . '
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal" id="dismis2">Close</button>
|
<button type="button" class="btn btn-default pull-left" data-dismiss="modal" id="dismis2">Close</button>
|
||||||
@@ -122,11 +121,11 @@ class PageController extends Controller {
|
|||||||
$sl = $request->input('slug');
|
$sl = $request->input('slug');
|
||||||
$slug = str_slug($sl, "-");
|
$slug = str_slug($sl, "-");
|
||||||
$this->page->slug = $slug;
|
$this->page->slug = $slug;
|
||||||
try{
|
try {
|
||||||
$this->page->fill($request->except('slug'))->save();
|
$this->page->fill($request->except('slug'))->save();
|
||||||
return redirect('page')->with('success','Page created successfully');
|
return redirect('page')->with('success', 'Page created successfully');
|
||||||
} catch(Exception $e) {
|
} catch (Exception $e) {
|
||||||
return redirect('page')->with('fails',$e->errorInfo[2]);
|
return redirect('page')->with('fails', $e->errorInfo[2]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -136,11 +135,11 @@ class PageController extends Controller {
|
|||||||
* @return type view
|
* @return type view
|
||||||
*/
|
*/
|
||||||
public function edit($slug) {
|
public function edit($slug) {
|
||||||
try{
|
try {
|
||||||
$page = $this->page->where('slug', $slug)->first();
|
$page = $this->page->where('slug', $slug)->first();
|
||||||
return view('themes.default1.agent.kb.pages.edit', compact('page'));
|
return view('themes.default1.agent.kb.pages.edit', compact('page'));
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
return redirect('page')->with('fails',$e->errorInfo[2]);
|
return redirect('page')->with('fails', $e->errorInfo[2]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -156,12 +155,12 @@ class PageController extends Controller {
|
|||||||
$sl = $request->input('slug');
|
$sl = $request->input('slug');
|
||||||
$slug = str_slug($sl, "-");
|
$slug = str_slug($sl, "-");
|
||||||
$this->page->slug = $slug;
|
$this->page->slug = $slug;
|
||||||
try{
|
try {
|
||||||
$pages->fill($request->all())->save();
|
$pages->fill($request->all())->save();
|
||||||
$pages->slug = $slug;
|
$pages->slug = $slug;
|
||||||
$pages->save();
|
$pages->save();
|
||||||
return redirect('page')->with('success', 'Your Page Updated Successfully');
|
return redirect('page')->with('success', 'Your Page Updated Successfully');
|
||||||
} catch(Exception $e) {
|
} catch (Exception $e) {
|
||||||
return redirect('page')->with('fails', $e->errorInfo[2]);
|
return redirect('page')->with('fails', $e->errorInfo[2]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -172,7 +171,7 @@ class PageController extends Controller {
|
|||||||
* @return type redirect
|
* @return type redirect
|
||||||
*/
|
*/
|
||||||
public function destroy($id) {
|
public function destroy($id) {
|
||||||
try{
|
try {
|
||||||
// get the page to be deleted
|
// get the page to be deleted
|
||||||
$page = $this->page->whereId($id)->first();
|
$page = $this->page->whereId($id)->first();
|
||||||
$page->delete();
|
$page->delete();
|
||||||
|
@@ -1,10 +1,11 @@
|
|||||||
<?php namespace App\Http\Controllers\Agent\kb;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Agent\kb;
|
||||||
|
|
||||||
// Controllers
|
// Controllers
|
||||||
use App\Http\Controllers\Agent\kb\ArticleController;
|
use App\Http\Controllers\Agent\kb\ArticleController;
|
||||||
use App\Http\Controllers\Agent\helpdesk\TicketController;
|
use App\Http\Controllers\Agent\helpdesk\TicketController;
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
|
|
||||||
// Request
|
// Request
|
||||||
use App\Http\Requests\kb\FooterRequest;
|
use App\Http\Requests\kb\FooterRequest;
|
||||||
use App\Http\Requests\kb\ProfilePassword;
|
use App\Http\Requests\kb\ProfilePassword;
|
||||||
@@ -12,7 +13,6 @@ use App\Http\Requests\kb\ProfileRequest;
|
|||||||
use App\Http\Requests\kb\SettingsRequests;
|
use App\Http\Requests\kb\SettingsRequests;
|
||||||
use App\Http\Requests\kb\SocialRequest;
|
use App\Http\Requests\kb\SocialRequest;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
// Model
|
// Model
|
||||||
use App\Model\kb\Comment;
|
use App\Model\kb\Comment;
|
||||||
use App\Model\kb\Faq;
|
use App\Model\kb\Faq;
|
||||||
@@ -22,7 +22,6 @@ use App\Model\kb\Side2;
|
|||||||
use App\Model\kb\Social;
|
use App\Model\kb\Social;
|
||||||
use App\Model\helpdesk\Utility\Timezones;
|
use App\Model\helpdesk\Utility\Timezones;
|
||||||
use App\Model\helpdesk\Utility\Date_format;
|
use App\Model\helpdesk\Utility\Date_format;
|
||||||
|
|
||||||
// Classes
|
// Classes
|
||||||
use Auth;
|
use Auth;
|
||||||
use Config;
|
use Config;
|
||||||
@@ -78,8 +77,7 @@ class SettingsController extends Controller {
|
|||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function postSettings($id, Settings $settings, SettingsRequests $request) {
|
public function postSettings($id, Settings $settings, SettingsRequests $request) {
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
/* fetch the values of company request */
|
/* fetch the values of company request */
|
||||||
$settings = $settings->whereId('1')->first();
|
$settings = $settings->whereId('1')->first();
|
||||||
if (Input::file('logo')) {
|
if (Input::file('logo')) {
|
||||||
@@ -122,7 +120,6 @@ class SettingsController extends Controller {
|
|||||||
/* redirect to Index page with Fails Message */
|
/* redirect to Index page with Fails Message */
|
||||||
return redirect('settings')->with('fails', 'Settings can not Updated');
|
return redirect('settings')->with('fails', 'Settings can not Updated');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -157,16 +154,16 @@ class SettingsController extends Controller {
|
|||||||
->addColumn('status', function ($model) {
|
->addColumn('status', function ($model) {
|
||||||
$status = $model->status;
|
$status = $model->status;
|
||||||
if ($status == 1) {
|
if ($status == 1) {
|
||||||
return '<p style="color:blue"">'.\Lang::get('lang.published');
|
return '<p style="color:blue"">' . \Lang::get('lang.published');
|
||||||
} else {
|
} else {
|
||||||
return '<p style="color:red"">'.\Lang::get('lang.not_published');
|
return '<p style="color:red"">' . \Lang::get('lang.not_published');
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
->addColumn('Created', function ($model) {
|
->addColumn('Created', function ($model) {
|
||||||
return TicketController::usertimezone(date($model->created_at));
|
return TicketController::usertimezone(date($model->created_at));
|
||||||
})
|
})
|
||||||
->addColumn('Actions', function ($model) {
|
->addColumn('Actions', function ($model) {
|
||||||
return '<a href=comment/delete/' . $model->id . ' class="btn btn-danger btn-xs">'.\Lang::get('lang.delete').'</a> <a href=published/' . $model->id . ' class="btn btn-warning btn-xs">'.\Lang::get('lang.publish').'</a>';
|
return '<a href=comment/delete/' . $model->id . ' class="btn btn-danger btn-xs">' . \Lang::get('lang.delete') . '</a> <a href=published/' . $model->id . ' class="btn btn-warning btn-xs">' . \Lang::get('lang.publish') . '</a>';
|
||||||
})
|
})
|
||||||
->make();
|
->make();
|
||||||
}
|
}
|
||||||
@@ -268,7 +265,6 @@ class SettingsController extends Controller {
|
|||||||
} else {
|
} else {
|
||||||
return redirect('profile')->with('fails2', 'Old password Wrong');
|
return redirect('profile')->with('fails2', 'Old password Wrong');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -13,7 +13,7 @@ use App\Model\helpdesk\Ticket\Ticket_attachments;
|
|||||||
use App\Http\Requests\helpdesk\TicketRequest;
|
use App\Http\Requests\helpdesk\TicketRequest;
|
||||||
use App\User;
|
use App\User;
|
||||||
use App\Model\helpdesk\Agent\Teams;
|
use App\Model\helpdesk\Agent\Teams;
|
||||||
use App\Model\kb\Settings;
|
use App\Model\helpdesk\Settings\System;
|
||||||
use App\Model\helpdesk\Manage\Help_topic;
|
use App\Model\helpdesk\Manage\Help_topic;
|
||||||
use App\Model\helpdesk\Manage\Sla_plan;
|
use App\Model\helpdesk\Manage\Sla_plan;
|
||||||
use App\Model\helpdesk\Utility\Priority;
|
use App\Model\helpdesk\Utility\Priority;
|
||||||
@@ -86,7 +86,7 @@ class ApiController extends Controller {
|
|||||||
$team = new Teams();
|
$team = new Teams();
|
||||||
$this->team = $team;
|
$this->team = $team;
|
||||||
|
|
||||||
$setting = new Settings();
|
$setting = new System();
|
||||||
$this->setting = $setting;
|
$this->setting = $setting;
|
||||||
|
|
||||||
$helptopic = new Help_topic();
|
$helptopic = new Help_topic();
|
||||||
@@ -150,6 +150,7 @@ class ApiController extends Controller {
|
|||||||
/**
|
/**
|
||||||
* return ticket details
|
* return ticket details
|
||||||
*/
|
*/
|
||||||
|
//dd($response);
|
||||||
$result = $this->thread->where('id', $response)->first();
|
$result = $this->thread->where('id', $response)->first();
|
||||||
//$result = $this->attach($result->id,$file);
|
//$result = $this->attach($result->id,$file);
|
||||||
return response()->json(compact('result'));
|
return response()->json(compact('result'));
|
||||||
@@ -259,7 +260,7 @@ class ApiController extends Controller {
|
|||||||
*/
|
*/
|
||||||
public function OpenedTickets() {
|
public function OpenedTickets() {
|
||||||
try {
|
try {
|
||||||
$result = $this->model->where('status', '=', 1)->where('isanswered', '=', 0)->where('assigned_to', '=', 0)->orderBy('id', 'DESC')->get();
|
$result = $this->model->where('status', '=', 1)->where('isanswered', '=', 0)->where('assigned_to', '=', null)->orderBy('id', 'DESC')->get();
|
||||||
return response()->json(compact('result'));
|
return response()->json(compact('result'));
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
$error = $e->getMessage();
|
$error = $e->getMessage();
|
||||||
@@ -278,7 +279,7 @@ class ApiController extends Controller {
|
|||||||
*/
|
*/
|
||||||
public function UnassignedTickets() {
|
public function UnassignedTickets() {
|
||||||
try {
|
try {
|
||||||
$result = $this->model->where('assigned_to', '=', 0)->where('status', '1')->orderBy('id', 'DESC')->get();
|
$result = $this->model->where('assigned_to', '=', null)->where('status', '1')->orderBy('id', 'DESC')->get();
|
||||||
return response()->json(compact('result'));
|
return response()->json(compact('result'));
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
$error = $e->getMessage();
|
$error = $e->getMessage();
|
||||||
@@ -316,7 +317,7 @@ class ApiController extends Controller {
|
|||||||
*/
|
*/
|
||||||
public function GetAgents() {
|
public function GetAgents() {
|
||||||
try {
|
try {
|
||||||
$result = $this->faveoUser->where('role', 'agent')->where('active', 1)->get();
|
$result = $this->faveoUser->where('role', 'agent')->orWhere('role', 'admin')->where('active', 1)->get();
|
||||||
return response()->json(compact('result'));
|
return response()->json(compact('result'));
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
$error = $e->getMessage();
|
$error = $e->getMessage();
|
||||||
@@ -505,8 +506,9 @@ class ApiController extends Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$url = $this->request->input('url');
|
$url = $this->request->input('url');
|
||||||
$url = $url . "/api/v1/helpdesk/check-url?token=" . \Config::get('app.token');
|
$url = $url . "/api/v1/helpdesk/check-url?api-key=" . $this->request->input('api-key') . "&token=" . \Config::get('app.token');
|
||||||
$result = $this->CallGetApi($url);
|
$result = $this->CallGetApi($url);
|
||||||
|
//dd($result);
|
||||||
return response()->json(compact('result'));
|
return response()->json(compact('result'));
|
||||||
} catch (Exception $ex) {
|
} catch (Exception $ex) {
|
||||||
$error = $e->getMessage();
|
$error = $e->getMessage();
|
||||||
@@ -579,6 +581,7 @@ class ApiController extends Controller {
|
|||||||
public function GenerateApiKey() {
|
public function GenerateApiKey() {
|
||||||
try {
|
try {
|
||||||
$set = $this->setting->where('id', '1')->first();
|
$set = $this->setting->where('id', '1')->first();
|
||||||
|
//dd($set);
|
||||||
if ($set->api_enable == 1) {
|
if ($set->api_enable == 1) {
|
||||||
$key = str_random(32);
|
$key = str_random(32);
|
||||||
$set->api_key = $key;
|
$set->api_key = $key;
|
||||||
@@ -675,6 +678,7 @@ class ApiController extends Controller {
|
|||||||
return response()->json(compact('error'));
|
return response()->json(compact('error'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Getting the tickets
|
* Getting the tickets
|
||||||
* @return type json
|
* @return type json
|
||||||
@@ -699,7 +703,6 @@ class ApiController extends Controller {
|
|||||||
* Fetching the Inbox details
|
* Fetching the Inbox details
|
||||||
* @return type json
|
* @return type json
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public function Inbox() {
|
public function Inbox() {
|
||||||
try {
|
try {
|
||||||
$result = $this->user->join('tickets', 'users.id', '=', 'tickets.user_id')
|
$result = $this->user->join('tickets', 'users.id', '=', 'tickets.user_id')
|
||||||
@@ -725,6 +728,7 @@ class ApiController extends Controller {
|
|||||||
return response()->json(compact('error', 'file', 'line'));
|
return response()->json(compact('error', 'file', 'line'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create internal note
|
* Create internal note
|
||||||
* @return type json
|
* @return type json
|
||||||
@@ -754,6 +758,4 @@ class ApiController extends Controller {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -1,4 +1,7 @@
|
|||||||
<?php namespace App\Http\Controllers\Api\v1;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Api\v1;
|
||||||
|
|
||||||
// controllers
|
// controllers
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
// requests
|
// requests
|
||||||
@@ -55,7 +58,7 @@ class InstallerApiController extends Controller {
|
|||||||
$dbpassword = $request->dbpassword;
|
$dbpassword = $request->dbpassword;
|
||||||
$port = $request->port;
|
$port = $request->port;
|
||||||
|
|
||||||
if(isset($default) && isset($host) && isset($database) && isset($dbusername)){
|
if (isset($default) && isset($host) && isset($database) && isset($dbusername)) {
|
||||||
|
|
||||||
// Setting environment values
|
// Setting environment values
|
||||||
$_ENV['DB_TYPE'] = $default;
|
$_ENV['DB_TYPE'] = $default;
|
||||||
@@ -71,16 +74,16 @@ class InstallerApiController extends Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Write environment file
|
// Write environment file
|
||||||
$fp = fopen(base_path()."/.env", 'w');
|
$fp = fopen(base_path() . "/.env", 'w');
|
||||||
fwrite($fp, $config);
|
fwrite($fp, $config);
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
|
|
||||||
return ['response'=>'success','status'=>'1'];
|
return ['response' => 'success', 'status' => '1'];
|
||||||
} else {
|
} else {
|
||||||
return ['response'=>'fail','reason'=>'insufficient parameters','status'=>'0'];
|
return ['response' => 'fail', 'reason' => 'insufficient parameters', 'status' => '0'];
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return ['response'=>'fail','reason'=>'this system is already installed','status'=>'0'];
|
return ['response' => 'fail', 'reason' => 'this system is already installed', 'status' => '0'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -105,14 +108,14 @@ class InstallerApiController extends Controller {
|
|||||||
Artisan::call('db:seed', array('--force' => true));
|
Artisan::call('db:seed', array('--force' => true));
|
||||||
|
|
||||||
// checking requested timezone for the admin and system
|
// checking requested timezone for the admin and system
|
||||||
$timezones = Timezones::where('name','=',$timezone)->first();
|
$timezones = Timezones::where('name', '=', $timezone)->first();
|
||||||
if($timezones->id == null){
|
if ($timezones->id == null) {
|
||||||
return ['response'=>'fail','reason'=>'Invalid time-zone','status'=>'0'];
|
return ['response' => 'fail', 'reason' => 'Invalid time-zone', 'status' => '0'];
|
||||||
}
|
}
|
||||||
// checking requested date time format for the admin and system
|
// checking requested date time format for the admin and system
|
||||||
$date_time_format = Date_time_format::where('format','=',$datetime)->first();
|
$date_time_format = Date_time_format::where('format', '=', $datetime)->first();
|
||||||
if($date_time_format->id == null){
|
if ($date_time_format->id == null) {
|
||||||
return ['response'=>'fail','reason'=>'invalid date-time format','status'=>'0'];
|
return ['response' => 'fail', 'reason' => 'invalid date-time format', 'status' => '0'];
|
||||||
}
|
}
|
||||||
// Creating minum settings for system
|
// Creating minum settings for system
|
||||||
$system = new System;
|
$system = new System;
|
||||||
@@ -144,17 +147,23 @@ class InstallerApiController extends Controller {
|
|||||||
|
|
||||||
// Applying email configuration on route
|
// Applying email configuration on route
|
||||||
$smtpfilepath = "\App\Http\Controllers\Common\SettingsController::smtp()";
|
$smtpfilepath = "\App\Http\Controllers\Common\SettingsController::smtp()";
|
||||||
|
$lfmpath = "url('photos').'/'";
|
||||||
$path22 = app_path('Http/routes.php');
|
$path22 = app_path('Http/routes.php');
|
||||||
|
$path23 = app_path('config/lfm.php');
|
||||||
$content23 = File::get($path22);
|
$content23 = File::get($path22);
|
||||||
|
$content24 = File::get($path23);
|
||||||
$content23 = str_replace('"%smtplink%"', $smtpfilepath, $content23);
|
$content23 = str_replace('"%smtplink%"', $smtpfilepath, $content23);
|
||||||
|
$content24 = str_replace("'%url%'", $lfmpath, $content24);
|
||||||
File::put($path22, $content23);
|
File::put($path22, $content23);
|
||||||
|
File::put($path23, $content24);
|
||||||
|
|
||||||
// If user created return success
|
// If user created return success
|
||||||
if($user){
|
if ($user) {
|
||||||
return ['response'=>'success','status'=>'1'];
|
return ['response' => 'success', 'status' => '1'];
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return ['response'=>'fail','reason'=>'this system is already installed','status'=>'0'];
|
return ['response' => 'fail', 'reason' => 'this system is already installed', 'status' => '0'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@@ -57,27 +57,27 @@ class TestController extends Controller {
|
|||||||
|
|
||||||
public function TicketReply() {
|
public function TicketReply() {
|
||||||
|
|
||||||
$file = file_get_contents(base_path() . '/../lb-faveo/Img/Ladybird.png');
|
//$file = file_get_contents(base_path() . '/../lb-faveo/Img/Ladybird.png');
|
||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
|
|
||||||
'ticket_ID' => '81',
|
'ticket_ID' => '13',
|
||||||
'ReplyContent' => 'reply for the ticket id',
|
'ReplyContent' => 'reply for the ticket id',
|
||||||
'api-key' => 'clYbe1g7BYVEJznBdvCEBR0xDCLDqKgg',
|
'api-key' => 'clYbe1g7BYVEJznBdvCEBR0xDCLDqKgg',
|
||||||
'attachments' => [
|
// 'attachments' => [
|
||||||
[
|
// [
|
||||||
'name' => 'ladybird',
|
// 'name' => 'ladybird',
|
||||||
'size' => '26398',
|
// 'size' => '26398',
|
||||||
'type' => 'png',
|
// 'type' => 'png',
|
||||||
'file' => $file,
|
// 'file' => $file,
|
||||||
],
|
// ],
|
||||||
[
|
// [
|
||||||
'name' => 'ladybird',
|
// 'name' => 'ladybird',
|
||||||
'size' => '26398',
|
// 'size' => '26398',
|
||||||
'type' => 'png',
|
// 'type' => 'png',
|
||||||
'file' => $file,
|
// 'file' => $file,
|
||||||
]
|
// ]
|
||||||
],
|
// ],
|
||||||
];
|
];
|
||||||
$data = http_build_query($data, '', '&');
|
$data = http_build_query($data, '', '&');
|
||||||
|
|
||||||
@@ -90,10 +90,10 @@ class TestController extends Controller {
|
|||||||
|
|
||||||
public function CreateTicket() {
|
public function CreateTicket() {
|
||||||
|
|
||||||
$file = file_get_contents(base_path() . '/../lb-faveo/Img/Ladybird.png');
|
//$file = file_get_contents(base_path() . '/../lb-faveo/Img/Ladybird.png');
|
||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
'user_id' => '1',
|
'user_id' => 1,
|
||||||
'subject' => 'Api create via faveo api',
|
'subject' => 'Api create via faveo api',
|
||||||
'body' => 'Test me when call api',
|
'body' => 'Test me when call api',
|
||||||
'helptopic' => '1',
|
'helptopic' => '1',
|
||||||
@@ -101,24 +101,22 @@ class TestController extends Controller {
|
|||||||
'priority' => '1',
|
'priority' => '1',
|
||||||
'headers' => [0 => 'vijaycodename47@gmail.com'],
|
'headers' => [0 => 'vijaycodename47@gmail.com'],
|
||||||
'dept' => '1',
|
'dept' => '1',
|
||||||
'assignto' => '0',
|
|
||||||
'source' => 'api',
|
|
||||||
'api-key' => 'clYbe1g7BYVEJznBdvCEBR0xDCLDqKgg',
|
'api-key' => 'clYbe1g7BYVEJznBdvCEBR0xDCLDqKgg',
|
||||||
/** if attachment */
|
/** if attachment */
|
||||||
'attachments' => [
|
// 'attachments' => [
|
||||||
[
|
// [
|
||||||
'name' => 'ladybird',
|
// 'name' => 'ladybird',
|
||||||
'size' => '26398',
|
// 'size' => '26398',
|
||||||
'type' => 'png',
|
// 'type' => 'png',
|
||||||
'file' => $file,
|
// 'file' => $file,
|
||||||
],
|
// ],
|
||||||
[
|
// [
|
||||||
'name' => 'ladybird',
|
// 'name' => 'ladybird',
|
||||||
'size' => '26398',
|
// 'size' => '26398',
|
||||||
'type' => 'png',
|
// 'type' => 'png',
|
||||||
'file' => $file,
|
// 'file' => $file,
|
||||||
]
|
// ]
|
||||||
],
|
// ],
|
||||||
];
|
];
|
||||||
$data = http_build_query($data, '', '&');
|
$data = http_build_query($data, '', '&');
|
||||||
|
|
||||||
@@ -162,7 +160,7 @@ class TestController extends Controller {
|
|||||||
|
|
||||||
public function GetAuthUser() {
|
public function GetAuthUser() {
|
||||||
|
|
||||||
$url = $this->server . "authenticate/user?token=" . \Config::get('app.token');
|
$url = $this->server . "authenticate/user?api-key=clYbe1g7BYVEJznBdvCEBR0xDCLDqKgg&token=" . \Config::get('app.token');
|
||||||
$_this = new self();
|
$_this = new self();
|
||||||
$respose = $_this->CallGetApi($url);
|
$respose = $_this->CallGetApi($url);
|
||||||
return $respose;
|
return $respose;
|
||||||
@@ -170,12 +168,12 @@ class TestController extends Controller {
|
|||||||
|
|
||||||
public function EditTicket() {
|
public function EditTicket() {
|
||||||
$data = [
|
$data = [
|
||||||
'ticket_id' => '81',
|
'ticket_id' => '13',
|
||||||
'subject' => 'Api editing ticket via faveo api',
|
'subject' => 'Api editing ticket via faveo api',
|
||||||
'sla_plan' => '2',
|
'sla_plan' => '2',
|
||||||
'help_topic' => '2',
|
'help_topic' => '2',
|
||||||
'ticket_source' => '2',
|
'ticket_source' => '2',
|
||||||
'api-key' => 'clYbe1g7BYVEJznBdvCEBR0xDCLDqKgg',
|
'api-key' => '9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN',
|
||||||
'ticket_priority' => '2',
|
'ticket_priority' => '2',
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -188,8 +186,8 @@ class TestController extends Controller {
|
|||||||
|
|
||||||
public function DeleteTicket() {
|
public function DeleteTicket() {
|
||||||
$data = [
|
$data = [
|
||||||
'ticket_id' => [],
|
'ticket_id' => [11],
|
||||||
'api-key' => 'clYbe1g7BYVEJznBdvCEBR0xDCLDqKgg'
|
'api-key' => '9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN'
|
||||||
];
|
];
|
||||||
|
|
||||||
$data = http_build_query($data, '', '&');
|
$data = http_build_query($data, '', '&');
|
||||||
@@ -200,35 +198,35 @@ class TestController extends Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function OpenedTickets() {
|
public function OpenedTickets() {
|
||||||
$url = $this->server . "helpdesk/open?token=" . \Config::get('app.token');
|
$url = $this->server . "helpdesk/open?api-key=9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN&token=" . \Config::get('app.token');
|
||||||
$_this = new self();
|
$_this = new self();
|
||||||
$respose = $_this->CallGetApi($url);
|
$respose = $_this->CallGetApi($url);
|
||||||
return $respose;
|
return $respose;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function UnassignedTickets() {
|
public function UnassignedTickets() {
|
||||||
$url = $this->server . "helpdesk/unassigned?token=" . \Config::get('app.token');
|
$url = $this->server . "helpdesk/unassigned?api-key=9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN&token=" . \Config::get('app.token');
|
||||||
$_this = new self();
|
$_this = new self();
|
||||||
$respose = $_this->CallGetApi($url);
|
$respose = $_this->CallGetApi($url);
|
||||||
return $respose;
|
return $respose;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function CloseTickets() {
|
public function CloseTickets() {
|
||||||
$url = $this->server . "helpdesk/closed?token=" . \Config::get('app.token');
|
$url = $this->server . "helpdesk/closed?api-key=9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN&token=" . \Config::get('app.token');
|
||||||
$_this = new self();
|
$_this = new self();
|
||||||
$respose = $_this->CallGetApi($url);
|
$respose = $_this->CallGetApi($url);
|
||||||
return $respose;
|
return $respose;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function GetAgents() {
|
public function GetAgents() {
|
||||||
$url = $this->server . "helpdesk/agents?token=" . \Config::get('app.token');
|
$url = $this->server . "helpdesk/agents?api-key=9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN&token=" . \Config::get('app.token');
|
||||||
$_this = new self();
|
$_this = new self();
|
||||||
$respose = $_this->CallGetApi($url);
|
$respose = $_this->CallGetApi($url);
|
||||||
return $respose;
|
return $respose;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function GetTeams() {
|
public function GetTeams() {
|
||||||
$url = $this->server . "helpdesk/teams?token=" . \Config::get('app.token');
|
$url = $this->server . "helpdesk/teams?api-key=9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN&token=" . \Config::get('app.token');
|
||||||
$_this = new self();
|
$_this = new self();
|
||||||
$respose = $_this->CallGetApi($url);
|
$respose = $_this->CallGetApi($url);
|
||||||
return $respose;
|
return $respose;
|
||||||
@@ -236,9 +234,9 @@ class TestController extends Controller {
|
|||||||
|
|
||||||
public function AssignTicket() {
|
public function AssignTicket() {
|
||||||
$data = [
|
$data = [
|
||||||
'ticket_id' => '8',
|
'ticket_id' => 1,
|
||||||
'user' => 'vijay.sebastian@ladybird.com',
|
'user' => 'vijay.sebastian@ladybirdweb.com',
|
||||||
'api-key' => 'clYbe1g7BYVEJznBdvCEBR0xDCLDqKgg'
|
'api-key' => '9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN'
|
||||||
];
|
];
|
||||||
$data = http_build_query($data, '', '&');
|
$data = http_build_query($data, '', '&');
|
||||||
$url = $this->server . "helpdesk/assign?token=" . \Config::get('app.token');
|
$url = $this->server . "helpdesk/assign?token=" . \Config::get('app.token');
|
||||||
@@ -250,7 +248,7 @@ class TestController extends Controller {
|
|||||||
public function GetCustomers() {
|
public function GetCustomers() {
|
||||||
$search = [
|
$search = [
|
||||||
'search' => 'vij',
|
'search' => 'vij',
|
||||||
'api-key' => 'clYbe1g7BYVEJznBdvCEBR0xDCLDqKgg'
|
'api-key' => '9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN'
|
||||||
];
|
];
|
||||||
$data = http_build_query($search, '', '&');
|
$data = http_build_query($search, '', '&');
|
||||||
$url = $this->server . "helpdesk/customers?token=" . \Config::get('app.token');
|
$url = $this->server . "helpdesk/customers?token=" . \Config::get('app.token');
|
||||||
@@ -263,7 +261,7 @@ class TestController extends Controller {
|
|||||||
public function GetCustomer() {
|
public function GetCustomer() {
|
||||||
$search = [
|
$search = [
|
||||||
'user_id' => '1',
|
'user_id' => '1',
|
||||||
'api-key' => 'clYbe1g7BYVEJznBdvCEBR0xDCLDqKgg'
|
'api-key' => '9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN'
|
||||||
];
|
];
|
||||||
$data = http_build_query($search, '', '&');
|
$data = http_build_query($search, '', '&');
|
||||||
$url = $this->server . "helpdesk/customer?token=" . \Config::get('app.token');
|
$url = $this->server . "helpdesk/customer?token=" . \Config::get('app.token');
|
||||||
@@ -276,7 +274,7 @@ class TestController extends Controller {
|
|||||||
public function GetSearch() {
|
public function GetSearch() {
|
||||||
$search = [
|
$search = [
|
||||||
'search' => 'api',
|
'search' => 'api',
|
||||||
'api-key' => 'clYbe1g7BYVEJznBdvCEBR0xDCLDqKgg'
|
'api-key' => '9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN'
|
||||||
];
|
];
|
||||||
$data = http_build_query($search, '', '&');
|
$data = http_build_query($search, '', '&');
|
||||||
$url = $this->server . "helpdesk/ticket-search?token=" . \Config::get('app.token');
|
$url = $this->server . "helpdesk/ticket-search?token=" . \Config::get('app.token');
|
||||||
@@ -288,8 +286,8 @@ class TestController extends Controller {
|
|||||||
|
|
||||||
public function TicketThreads() {
|
public function TicketThreads() {
|
||||||
$search = [
|
$search = [
|
||||||
'id' => '8',
|
'id' => '1',
|
||||||
'api-key' => 'clYbe1g7BYVEJznBdvCEBR0xDCLDqKgg'
|
'api-key' => '9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN'
|
||||||
];
|
];
|
||||||
$data = http_build_query($search, '', '&');
|
$data = http_build_query($search, '', '&');
|
||||||
$url = $this->server . "helpdesk/ticket-thread?token=" . \Config::get('app.token');
|
$url = $this->server . "helpdesk/ticket-thread?token=" . \Config::get('app.token');
|
||||||
@@ -301,8 +299,8 @@ class TestController extends Controller {
|
|||||||
|
|
||||||
public function Url() {
|
public function Url() {
|
||||||
$search = [
|
$search = [
|
||||||
'url' => 'http://localhost/FaveoHELPDESK+KBLatests',
|
'url' => 'http://localhost/Faveo-HelpDesk-My-Branch/public/',
|
||||||
'api-key' => 'clYbe1g7BYVEJznBdvCEBR0xDCLDqKgg'
|
'api-key' => '9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN'
|
||||||
];
|
];
|
||||||
$data = http_build_query($search, '', '&');
|
$data = http_build_query($search, '', '&');
|
||||||
$url = $this->server . "helpdesk/url?token=" . \Config::get('app.token');
|
$url = $this->server . "helpdesk/url?token=" . \Config::get('app.token');
|
||||||
@@ -313,21 +311,21 @@ class TestController extends Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function GenerateApiKey() {
|
public function GenerateApiKey() {
|
||||||
$url = $this->server . "helpdesk/api-key?token=" . \Config::get('app.token');
|
$url = $this->server . "helpdesk/api-key?api-key=9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN&token=" . \Config::get('app.token');
|
||||||
$_this = new self();
|
$_this = new self();
|
||||||
$respose = $_this->CallGetApi($url);
|
$respose = $_this->CallGetApi($url);
|
||||||
return $respose;
|
return $respose;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function GetHelpTopic() {
|
public function GetHelpTopic() {
|
||||||
$url = $this->server . "helpdesk/help-topic?api-key=clYbe1g7BYVEJznBdvCEBR0xDCLDqKgg&token=" . \Config::get('app.token');
|
$url = $this->server . "helpdesk/help-topic?api-key=9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN&token=" . \Config::get('app.token');
|
||||||
$_this = new self();
|
$_this = new self();
|
||||||
$respose = $_this->CallGetApi($url);
|
$respose = $_this->CallGetApi($url);
|
||||||
return $respose;
|
return $respose;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function GetSlaPlan() {
|
public function GetSlaPlan() {
|
||||||
$url = $this->server . "helpdesk/sla-plan?api-key=clYbe1g7BYVEJznBdvCEBR0xDCLDqKgg&token=" . \Config::get('app.token');
|
$url = $this->server . "helpdesk/sla-plan?api-key=9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN&token=" . \Config::get('app.token');
|
||||||
$_this = new self();
|
$_this = new self();
|
||||||
$respose = $_this->CallGetApi($url);
|
$respose = $_this->CallGetApi($url);
|
||||||
return $respose;
|
return $respose;
|
||||||
@@ -341,21 +339,21 @@ class TestController extends Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function GetDepartment() {
|
public function GetDepartment() {
|
||||||
$url = $this->server . "helpdesk/department?api-key=clYbe1g7BYVEJznBdvCEBR0xDCLDqKgg&token=" . \Config::get('app.token');
|
$url = $this->server . "helpdesk/department?api-key=9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN&token=" . \Config::get('app.token');
|
||||||
$_this = new self();
|
$_this = new self();
|
||||||
$respose = $_this->CallGetApi($url);
|
$respose = $_this->CallGetApi($url);
|
||||||
return $respose;
|
return $respose;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function GetTickets() {
|
public function GetTickets() {
|
||||||
$url = $this->server . "helpdesk/tickets?api-key=clYbe1g7BYVEJznBdvCEBR0xDCLDqKgg&token=" . \Config::get('app.token');
|
$url = $this->server . "helpdesk/tickets?api-key=9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN&token=" . \Config::get('app.token');
|
||||||
$_this = new self();
|
$_this = new self();
|
||||||
$respose = $_this->CallGetApi($url);
|
$respose = $_this->CallGetApi($url);
|
||||||
return $respose;
|
return $respose;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function Inbox() {
|
public function Inbox() {
|
||||||
$url = $this->server . "helpdesk/inbox?api-key=clYbe1g7BYVEJznBdvCEBR0xDCLDqKgg&token=" . \Config::get('app.token');
|
$url = $this->server . "helpdesk/inbox?api-key=9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN&token=" . \Config::get('app.token');
|
||||||
$_this = new self();
|
$_this = new self();
|
||||||
$respose = $_this->CallGetApi($url);
|
$respose = $_this->CallGetApi($url);
|
||||||
return $respose;
|
return $respose;
|
||||||
@@ -366,7 +364,7 @@ class TestController extends Controller {
|
|||||||
'ticketid' => '23',
|
'ticketid' => '23',
|
||||||
'userid' => 1,
|
'userid' => 1,
|
||||||
'body' => 'Testing the api internal note',
|
'body' => 'Testing the api internal note',
|
||||||
'api-key' => 'clYbe1g7BYVEJznBdvCEBR0xDCLDqKgg'
|
'api-key' => '9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN'
|
||||||
];
|
];
|
||||||
$data = http_build_query($data, '', '&');
|
$data = http_build_query($data, '', '&');
|
||||||
$url = $this->server . "helpdesk/internal-note?token=" . \Config::get('app.token');
|
$url = $this->server . "helpdesk/internal-note?token=" . \Config::get('app.token');
|
||||||
|
@@ -17,6 +17,7 @@ use App\Model\helpdesk\Ticket\Ticket_Status;
|
|||||||
use App\Model\helpdesk\Ticket\Ticket_attachments;
|
use App\Model\helpdesk\Ticket\Ticket_attachments;
|
||||||
use App\Model\helpdesk\Settings\System;
|
use App\Model\helpdesk\Settings\System;
|
||||||
use App\Model\helpdesk\Settings\Alert;
|
use App\Model\helpdesk\Settings\Alert;
|
||||||
|
use Hash;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* -----------------------------------------------------------------------------
|
* -----------------------------------------------------------------------------
|
||||||
@@ -31,7 +32,6 @@ use App\Model\helpdesk\Settings\Alert;
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class TicketController extends Controller {
|
class TicketController extends Controller {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -47,6 +47,7 @@ class TicketController extends Controller {
|
|||||||
public function create_ticket($user_id, $subject, $body, $helptopic, $sla, $priority, $source, $headers, $dept, $assignto, $form_data, $attach = '') {
|
public function create_ticket($user_id, $subject, $body, $helptopic, $sla, $priority, $source, $headers, $dept, $assignto, $form_data, $attach = '') {
|
||||||
try {
|
try {
|
||||||
$max_number = Tickets::whereRaw('id = (select max(`id`) from tickets)')->first();
|
$max_number = Tickets::whereRaw('id = (select max(`id`) from tickets)')->first();
|
||||||
|
//dd($max_number);
|
||||||
if ($max_number == null) {
|
if ($max_number == null) {
|
||||||
$ticket_number = "AAAA-9999-9999999";
|
$ticket_number = "AAAA-9999-9999999";
|
||||||
} else {
|
} else {
|
||||||
@@ -56,6 +57,7 @@ class TicketController extends Controller {
|
|||||||
}
|
}
|
||||||
$ticket = new Tickets;
|
$ticket = new Tickets;
|
||||||
$ticket->ticket_number = $this->ticket_number($ticket_number);
|
$ticket->ticket_number = $this->ticket_number($ticket_number);
|
||||||
|
//dd($this->ticket_number($ticket_number));
|
||||||
$ticket->user_id = $user_id;
|
$ticket->user_id = $user_id;
|
||||||
$ticket->dept_id = $dept;
|
$ticket->dept_id = $dept;
|
||||||
$ticket->help_topic_id = $helptopic;
|
$ticket->help_topic_id = $helptopic;
|
||||||
@@ -65,6 +67,7 @@ class TicketController extends Controller {
|
|||||||
$ticket->priority_id = $priority;
|
$ticket->priority_id = $priority;
|
||||||
$ticket->source = $source;
|
$ticket->source = $source;
|
||||||
$ticket->save();
|
$ticket->save();
|
||||||
|
//dd($ticket);
|
||||||
$ticket_number = $ticket->ticket_number;
|
$ticket_number = $ticket->ticket_number;
|
||||||
$id = $ticket->id;
|
$id = $ticket->id;
|
||||||
if ($form_data != null) {
|
if ($form_data != null) {
|
||||||
@@ -93,6 +96,7 @@ class TicketController extends Controller {
|
|||||||
}
|
}
|
||||||
return $thread;
|
return $thread;
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
|
dd($e);
|
||||||
return $e->getMessage();
|
return $e->getMessage();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -170,6 +174,7 @@ class TicketController extends Controller {
|
|||||||
*/
|
*/
|
||||||
public function ticket_number($ticket_number) {
|
public function ticket_number($ticket_number) {
|
||||||
try {
|
try {
|
||||||
|
//dd($ticket_number);
|
||||||
$number = $ticket_number;
|
$number = $ticket_number;
|
||||||
$number = explode('-', $number);
|
$number = explode('-', $number);
|
||||||
$number1 = $number[0];
|
$number1 = $number[0];
|
||||||
@@ -193,6 +198,7 @@ class TicketController extends Controller {
|
|||||||
$number = implode('-', $array);
|
$number = implode('-', $array);
|
||||||
return $number;
|
return $number;
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
|
dd($e);
|
||||||
return $e->getMessage();
|
return $e->getMessage();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -373,15 +379,24 @@ class TicketController extends Controller {
|
|||||||
public function assign($id) {
|
public function assign($id) {
|
||||||
try {
|
try {
|
||||||
$UserEmail = Input::get('user');
|
$UserEmail = Input::get('user');
|
||||||
//dd($id);
|
//dd($UserEmail);
|
||||||
// $UserEmail = 'sujitprasad12@yahoo.in';
|
// $UserEmail = 'sujitprasad12@yahoo.in';
|
||||||
$user = User::where('email', '=', $UserEmail)->first();
|
$user = User::where('email', '=', $UserEmail)->first();
|
||||||
|
if (!$user) {
|
||||||
|
return ['error' => 'No agent not found'];
|
||||||
|
}
|
||||||
$user_id = $user->id;
|
$user_id = $user->id;
|
||||||
$ticket = Tickets::where('id', '=', $id)->first();
|
$ticket = Tickets::where('id', '=', $id)->first();
|
||||||
|
if (!$ticket) {
|
||||||
|
return ['error' => 'No ticket not found'];
|
||||||
|
}
|
||||||
$ticket_number = $ticket->ticket_number;
|
$ticket_number = $ticket->ticket_number;
|
||||||
$ticket->assigned_to = $user_id;
|
$ticket->assigned_to = $user_id;
|
||||||
$ticket->save();
|
$ticket->save();
|
||||||
$ticket_thread = Ticket_Thread::where('ticket_id', '=', $id)->first();
|
$ticket_thread = Ticket_Thread::where('ticket_id', '=', $id)->first();
|
||||||
|
if (!$ticket_thread) {
|
||||||
|
return ['error' => 'No thread not found'];
|
||||||
|
}
|
||||||
$ticket_subject = $ticket_thread->title;
|
$ticket_subject = $ticket_thread->title;
|
||||||
$thread = New Ticket_Thread;
|
$thread = New Ticket_Thread;
|
||||||
$thread->ticket_id = $ticket->id;
|
$thread->ticket_id = $ticket->id;
|
||||||
@@ -497,6 +512,7 @@ class TicketController extends Controller {
|
|||||||
return $e->getMessage();
|
return $e->getMessage();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create Attachment
|
* Create Attachment
|
||||||
* @param type $thread
|
* @param type $thread
|
||||||
|
@@ -23,18 +23,19 @@ use Illuminate\Support\Facades\Hash;
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class TokenAuthController extends Controller {
|
class TokenAuthController extends Controller {
|
||||||
|
|
||||||
public function __construct() {
|
public function __construct() {
|
||||||
$this->middleware('api');
|
$this->middleware('api');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Authenticating user with username and password and retuen token
|
* Authenticating user with username and password and retuen token
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
* @return type json
|
* @return type json
|
||||||
*/
|
*/
|
||||||
public function authenticate(Request $request) {
|
public function authenticate(Request $request) {
|
||||||
|
|
||||||
$usernameinput = $request->input('username');
|
$usernameinput = $request->input('username');
|
||||||
$password = $request->input('password');
|
$password = $request->input('password');
|
||||||
$field = filter_var($usernameinput, FILTER_VALIDATE_EMAIL) ? 'email' : 'user_name';
|
$field = filter_var($usernameinput, FILTER_VALIDATE_EMAIL) ? 'email' : 'user_name';
|
||||||
@@ -43,11 +44,11 @@ class TokenAuthController extends Controller {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
if (!$token = JWTAuth::attempt([$field => $usernameinput, 'password' => $password])) {
|
if (!$token = JWTAuth::attempt([$field => $usernameinput, 'password' => $password])) {
|
||||||
return response()->json(['error' => 'invalid_credentials', 'status_code'=>401]);
|
return response()->json(['error' => 'invalid_credentials', 'status_code' => 401]);
|
||||||
}
|
}
|
||||||
} catch (JWTException $e) {
|
} catch (JWTException $e) {
|
||||||
return response()->json(['error' => 'could_not_create_token', 500]);
|
return response()->json(['error' => 'could_not_create_token', 500]);
|
||||||
} catch (\Exception $e){
|
} catch (\Exception $e) {
|
||||||
$error = $e->getMessage();
|
$error = $e->getMessage();
|
||||||
return response()->json(compact('error'));
|
return response()->json(compact('error'));
|
||||||
}
|
}
|
||||||
@@ -55,6 +56,7 @@ class TokenAuthController extends Controller {
|
|||||||
// if no errors are encountered we can return a JWT
|
// if no errors are encountered we can return a JWT
|
||||||
return response()->json(compact('token'));
|
return response()->json(compact('token'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the user details from token
|
* Get the user details from token
|
||||||
* @return type json
|
* @return type json
|
||||||
@@ -75,8 +77,7 @@ class TokenAuthController extends Controller {
|
|||||||
} catch (\Tymon\JWTAuth\Exceptions\JWTException $e) {
|
} catch (\Tymon\JWTAuth\Exceptions\JWTException $e) {
|
||||||
|
|
||||||
return response()->json(['token_absent', $e->getStatusCode()]);
|
return response()->json(['token_absent', $e->getStatusCode()]);
|
||||||
}
|
} catch (\Exception $e) {
|
||||||
catch (\Exception $e){
|
|
||||||
$error = $e->getMessage();
|
$error = $e->getMessage();
|
||||||
return response()->json(compact('error'));
|
return response()->json(compact('error'));
|
||||||
}
|
}
|
||||||
@@ -110,6 +111,7 @@ class TokenAuthController extends Controller {
|
|||||||
return response()->json(compact('error'));
|
return response()->json(compact('error'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* verify the url is existing or not
|
* verify the url is existing or not
|
||||||
* @return type json
|
* @return type json
|
||||||
@@ -125,8 +127,7 @@ class TokenAuthController extends Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$url = $this->request->input('url');
|
$url = $this->request->input('url');
|
||||||
$url = $url.'/api/v1/helpdesk/check-url';
|
$url = $url . '/api/v1/helpdesk/check-url';
|
||||||
|
|
||||||
} catch (Exception $ex) {
|
} catch (Exception $ex) {
|
||||||
$error = $e->getMessage();
|
$error = $e->getMessage();
|
||||||
return response()->json(compact('error'));
|
return response()->json(compact('error'));
|
||||||
|
@@ -1,14 +1,15 @@
|
|||||||
<?php namespace App\Http\Controllers\Auth;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Auth;
|
||||||
|
|
||||||
// controllers
|
// controllers
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
use App\Http\Controllers\Common\SettingsController;
|
use App\Http\Controllers\Common\SettingsController;
|
||||||
|
use App\Http\Controllers\Common\PhpMailController;
|
||||||
// requests
|
// requests
|
||||||
use App\Http\Requests\helpdesk\LoginRequest;
|
use App\Http\Requests\helpdesk\LoginRequest;
|
||||||
use App\Http\Requests\helpdesk\RegisterRequest;
|
use App\Http\Requests\helpdesk\RegisterRequest;
|
||||||
use App\User;
|
use App\User;
|
||||||
|
|
||||||
// classes
|
// classes
|
||||||
use Hash;
|
use Hash;
|
||||||
use Illuminate\Contracts\Auth\Guard;
|
use Illuminate\Contracts\Auth\Guard;
|
||||||
@@ -18,7 +19,6 @@ use Mail;
|
|||||||
use Auth;
|
use Auth;
|
||||||
use Exception;
|
use Exception;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ---------------------------------------------------
|
* ---------------------------------------------------
|
||||||
* AuthController
|
* AuthController
|
||||||
@@ -35,6 +35,7 @@ class AuthController extends Controller {
|
|||||||
|
|
||||||
use AuthenticatesAndRegistersUsers;
|
use AuthenticatesAndRegistersUsers;
|
||||||
/* to redirect after login */
|
/* to redirect after login */
|
||||||
|
|
||||||
// if auth is agent
|
// if auth is agent
|
||||||
protected $redirectTo = '/dashboard';
|
protected $redirectTo = '/dashboard';
|
||||||
// if auth is user
|
// if auth is user
|
||||||
@@ -50,7 +51,8 @@ class AuthController extends Controller {
|
|||||||
* @param \Illuminate\Contracts\Auth\Registrar $registrar
|
* @param \Illuminate\Contracts\Auth\Registrar $registrar
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function __construct(Guard $auth, Registrar $registrar) {
|
public function __construct(Guard $auth, Registrar $registrar, PhpMailController $PhpMailController) {
|
||||||
|
$this->PhpMailController = $PhpMailController;
|
||||||
SettingsController::smtp();
|
SettingsController::smtp();
|
||||||
$this->auth = $auth;
|
$this->auth = $auth;
|
||||||
$this->registrar = $registrar;
|
$this->registrar = $registrar;
|
||||||
@@ -64,10 +66,10 @@ class AuthController extends Controller {
|
|||||||
public function getRegister() {
|
public function getRegister() {
|
||||||
// Event for login
|
// Event for login
|
||||||
\Event::fire(new \App\Events\FormRegisterEvent());
|
\Event::fire(new \App\Events\FormRegisterEvent());
|
||||||
if(Auth::user()) {
|
if (Auth::user()) {
|
||||||
if(Auth::user()->role == "admin" || Auth::user()->role == "agent") {
|
if (Auth::user()->role == "admin" || Auth::user()->role == "agent") {
|
||||||
return \Redirect::route('dashboard');
|
return \Redirect::route('dashboard');
|
||||||
} elseif(Auth::user()->role == "user") {
|
} elseif (Auth::user()->role == "user") {
|
||||||
// return view('auth.register');
|
// return view('auth.register');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -99,13 +101,17 @@ class AuthController extends Controller {
|
|||||||
$user->remember_token = $code;
|
$user->remember_token = $code;
|
||||||
$user->save();
|
$user->save();
|
||||||
// send mail for successful registration
|
// send mail for successful registration
|
||||||
$mail = Mail::send('auth.activate', array('link' => url('getmail', $code), 'username' => $name), function ($message) use ($user) {
|
// $mail = Mail::send('auth.activate', array('link' => url('getmail', $code), 'username' => $name), function ($message) use ($user) {
|
||||||
$message->to($user->email, $user->full_name)->subject('active your account');
|
// $message->to($user->email, $user->full_name)->subject('active your account');
|
||||||
});
|
// });
|
||||||
|
|
||||||
|
$this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('1', '0'), $to = ['name' => $name, 'email' => $request->input('email')], $message = ['subject' => 'password', 'scenario' => 'registration-notification'], $template_variables = ['user' => $name, 'email_address' => $request->input('email'), 'password_reset_link' => url('password/reset/' . $code)]);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return redirect('home')->with('success', 'Activate Your Account ! Click on Link that send to your mail');
|
return redirect('home')->with('success', 'Activate Your Account ! Click on Link that send to your mail');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get mail function
|
* Get mail function
|
||||||
* @param type $token
|
* @param type $token
|
||||||
@@ -128,10 +134,10 @@ class AuthController extends Controller {
|
|||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function getLogin() {
|
public function getLogin() {
|
||||||
if(Auth::user()) {
|
if (Auth::user()) {
|
||||||
if(Auth::user()->role == "admin" || Auth::user()->role == "agent"){
|
if (Auth::user()->role == "admin" || Auth::user()->role == "agent") {
|
||||||
return \Redirect::route('dashboard');
|
return \Redirect::route('dashboard');
|
||||||
} elseif(Auth::user()->role == "user") {
|
} elseif (Auth::user()->role == "user") {
|
||||||
return \Redirect::route('home');
|
return \Redirect::route('home');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -174,7 +180,7 @@ class AuthController extends Controller {
|
|||||||
// If auth ok, redirect to restricted area
|
// If auth ok, redirect to restricted area
|
||||||
\Session::put('loginAttempts', $loginAttempts + 1);
|
\Session::put('loginAttempts', $loginAttempts + 1);
|
||||||
if ($this->auth->attempt([$field => $usernameinput, 'password' => $password], $request->has('remember'))) {
|
if ($this->auth->attempt([$field => $usernameinput, 'password' => $password], $request->has('remember'))) {
|
||||||
if(Auth::user()->role == 'user') {
|
if (Auth::user()->role == 'user') {
|
||||||
return \Redirect::route('/');
|
return \Redirect::route('/');
|
||||||
} else {
|
} else {
|
||||||
return redirect()->intended($this->redirectPath());
|
return redirect()->intended($this->redirectPath());
|
||||||
|
@@ -1,14 +1,15 @@
|
|||||||
<?php namespace App\Http\Controllers\Auth;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Auth;
|
||||||
|
|
||||||
// controllers
|
// controllers
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
use App\Http\Controllers\Common\SettingsController;
|
use App\Http\Controllers\Common\SettingsController;
|
||||||
|
use App\Http\Controllers\Common\PhpMailController;
|
||||||
// request
|
// request
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
// model
|
// model
|
||||||
use App\User;
|
use App\User;
|
||||||
|
|
||||||
// classes
|
// classes
|
||||||
use Illuminate\Contracts\Auth\Guard;
|
use Illuminate\Contracts\Auth\Guard;
|
||||||
use Illuminate\Contracts\Auth\PasswordBroker;
|
use Illuminate\Contracts\Auth\PasswordBroker;
|
||||||
@@ -34,14 +35,14 @@ class PasswordController extends Controller {
|
|||||||
* @param \Illuminate\Contracts\Auth\PasswordBroker $passwords
|
* @param \Illuminate\Contracts\Auth\PasswordBroker $passwords
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function __construct(Guard $auth, PasswordBroker $passwords) {
|
public function __construct(Guard $auth, PasswordBroker $passwords, PhpMailController $PhpMailController) {
|
||||||
|
$this->PhpMailController = $PhpMailController;
|
||||||
$this->auth = $auth;
|
$this->auth = $auth;
|
||||||
$this->passwords = $passwords;
|
$this->passwords = $passwords;
|
||||||
$this->middleware('guest');
|
$this->middleware('guest');
|
||||||
SettingsController::smtp();
|
SettingsController::smtp();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Display the form to request a password reset link.
|
* Display the form to request a password reset link.
|
||||||
*
|
*
|
||||||
@@ -51,5 +52,35 @@ class PasswordController extends Controller {
|
|||||||
return view('auth.password');
|
return view('auth.password');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Display the form to request a password reset link.
|
||||||
|
*
|
||||||
|
* @return Response
|
||||||
|
*/
|
||||||
|
public function postEmail(Request $request) {
|
||||||
|
$date = date('Y-m-d H:i:s');
|
||||||
|
$this->validate($request, ['email' => 'required|email']);
|
||||||
|
$user = User::where('email', '=', $request->only('email'))->first();
|
||||||
|
if (isset($user)) {
|
||||||
|
$user1 = $user->email;
|
||||||
|
//gen new code and pass
|
||||||
|
$code = str_random(60);
|
||||||
|
$password_reset_table = \DB::table('password_resets')->where('email', '=', $user->email)->first();
|
||||||
|
if (isset($password_reset_table)) {
|
||||||
|
|
||||||
|
$password_reset_table = \DB::table('password_resets')->where('email', '=', $user->email)->update(['token' => $code, 'created_at' => $date]);
|
||||||
|
// $password_reset_table->token = $code;
|
||||||
|
// $password_reset_table->update(['token' => $code]);
|
||||||
|
} else {
|
||||||
|
$create_password_reset = \DB::table('password_resets')->insert(['email' => $user->email, 'token' => $code, 'created_at' => $date]);
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('1', '0'), $to = ['name' => $user->user_name, 'email' => $user->email], $message = ['subject' => 'Your Password Reset Link', 'scenario' => 'reset-password'], $template_variables = ['user' => $user->user_name, 'email_address' => $user->email, 'password_reset_link' => url('password/reset/' . $code)]);
|
||||||
|
|
||||||
|
return redirect()->back()->with('status', 'We have e-mailed your password reset link!');
|
||||||
|
} else {
|
||||||
|
return redirect()->back()->with('errors', "We can't find a user with that e-mail address.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -1,4 +1,7 @@
|
|||||||
<?php namespace App\Http\Controllers\Agent\helpdesk;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Agent\helpdesk;
|
||||||
|
|
||||||
// controllers
|
// controllers
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
// requests
|
// requests
|
||||||
@@ -72,7 +75,7 @@ class UserController extends Controller {
|
|||||||
*/
|
*/
|
||||||
public function user_list() {
|
public function user_list() {
|
||||||
|
|
||||||
return \Datatable::collection(User::where('role','!=','admin')->where('role','!=','agent')->get())
|
return \Datatable::collection(User::where('role', '!=', 'admin')->where('role', '!=', 'agent')->get())
|
||||||
->searchColumns('user_name')
|
->searchColumns('user_name')
|
||||||
->orderColumns('user_name', 'email')
|
->orderColumns('user_name', 'email')
|
||||||
->addColumn('user_name', function ($model) {
|
->addColumn('user_name', function ($model) {
|
||||||
@@ -84,19 +87,19 @@ class UserController extends Controller {
|
|||||||
})
|
})
|
||||||
->addColumn('phone', function ($model) {
|
->addColumn('phone', function ($model) {
|
||||||
$phone = "";
|
$phone = "";
|
||||||
if($model->phone_number) {
|
if ($model->phone_number) {
|
||||||
$phone = $model->ext . ' ' . $model->phone_number;
|
$phone = $model->ext . ' ' . $model->phone_number;
|
||||||
}
|
}
|
||||||
$mobile = "";
|
$mobile = "";
|
||||||
if($model->mobile) {
|
if ($model->mobile) {
|
||||||
$mobile = $model->mobile;
|
$mobile = $model->mobile;
|
||||||
}
|
}
|
||||||
$phone = $phone ." ". $mobile;
|
$phone = $phone . " " . $mobile;
|
||||||
return $phone;
|
return $phone;
|
||||||
})
|
})
|
||||||
->addColumn('status', function ($model) {
|
->addColumn('status', function ($model) {
|
||||||
$status = $model->active;
|
$status = $model->active;
|
||||||
if($status == 1) {
|
if ($status == 1) {
|
||||||
$stat = '<button class="btn btn-success btn-xs">Active</button>';
|
$stat = '<button class="btn btn-success btn-xs">Active</button>';
|
||||||
} else {
|
} else {
|
||||||
$stat = '<button class="btn btn-danger btn-xs">Inactive</button>';
|
$stat = '<button class="btn btn-danger btn-xs">Inactive</button>';
|
||||||
@@ -110,8 +113,8 @@ class UserController extends Controller {
|
|||||||
->addColumn('Actions', function ($model) {
|
->addColumn('Actions', function ($model) {
|
||||||
//return '<a href=article/delete/ ' . $model->id . ' class="btn btn-danger btn-flat" onclick="myFunction()">Delete</a> <a href=article/' . $model->id . '/edit class="btn btn-warning btn-flat">Edit</a> <a href=show/' . $model->id . ' class="btn btn-warning btn-flat">View</a>';
|
//return '<a href=article/delete/ ' . $model->id . ' class="btn btn-danger btn-flat" onclick="myFunction()">Delete</a> <a href=article/' . $model->id . '/edit class="btn btn-warning btn-flat">Edit</a> <a href=show/' . $model->id . ' class="btn btn-warning btn-flat">View</a>';
|
||||||
//return '<form action="article/delete/ ' . $model->id . '" method="post" onclick="alert()"><button type="sumbit" value="Delete"></button></form><a href=article/' . $model->id . '/edit class="btn btn-warning btn-flat">Edit</a> <a href=show/' . $model->id . ' class="btn btn-warning btn-flat">View</a>';
|
//return '<form action="article/delete/ ' . $model->id . '" method="post" onclick="alert()"><button type="sumbit" value="Delete"></button></form><a href=article/' . $model->id . '/edit class="btn btn-warning btn-flat">Edit</a> <a href=show/' . $model->id . ' class="btn btn-warning btn-flat">View</a>';
|
||||||
return '<span data-toggle="modal" data-target="#deletearticle'.$model->id .'"><a href="#" ><button class="btn btn-danger btn-xs"></a> ' . \Lang::get('lang.delete') . ' </button></span> <a href="'.route('user.edit', $model->id).'" class="btn btn-warning btn-xs">' . \Lang::get('lang.edit') . '</a> <a href="'.route('user.show', $model->id).'" class="btn btn-primary btn-xs">' . \Lang::get('lang.view') . '</a>
|
return '<span data-toggle="modal" data-target="#deletearticle' . $model->id . '"><a href="#" ><button class="btn btn-danger btn-xs"></a> ' . \Lang::get('lang.delete') . ' </button></span> <a href="' . route('user.edit', $model->id) . '" class="btn btn-warning btn-xs">' . \Lang::get('lang.edit') . '</a> <a href="' . route('user.show', $model->id) . '" class="btn btn-primary btn-xs">' . \Lang::get('lang.view') . '</a>
|
||||||
<div class="modal fade" id="deletearticle'.$model->id .'">
|
<div class="modal fade" id="deletearticle' . $model->id . '">
|
||||||
<div class="modal-dialog">
|
<div class="modal-dialog">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
@@ -119,11 +122,11 @@ class UserController extends Controller {
|
|||||||
<h4 class="modal-title">Are You Sure ?</h4>
|
<h4 class="modal-title">Are You Sure ?</h4>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
'.$model->user_name.'
|
' . $model->user_name . '
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal" id="dismis2">Close</button>
|
<button type="button" class="btn btn-default pull-left" data-dismiss="modal" id="dismis2">Close</button>
|
||||||
<a href="'.route('user.delete',$model->id).'"><button class="btn btn-danger">delete</button></a>
|
<a href="' . route('user.delete', $model->id) . '"><button class="btn btn-danger">delete</button></a>
|
||||||
</div>
|
</div>
|
||||||
</div><!-- /.modal-content -->
|
</div><!-- /.modal-content -->
|
||||||
</div><!-- /.modal-dialog -->
|
</div><!-- /.modal-dialog -->
|
||||||
@@ -352,21 +355,21 @@ class UserController extends Controller {
|
|||||||
*/
|
*/
|
||||||
public function User_Create_Org($id) {
|
public function User_Create_Org($id) {
|
||||||
|
|
||||||
if(Input::get('website')!=null) {
|
if (Input::get('website') != null) {
|
||||||
// checking website
|
// checking website
|
||||||
$check = Organization::where('website','=',Input::get('website'))->first();
|
$check = Organization::where('website', '=', Input::get('website'))->first();
|
||||||
} else {
|
} else {
|
||||||
$check = null;
|
$check = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// checking name
|
// checking name
|
||||||
$check2 = Organization::where('name','=',Input::get('name'))->first();
|
$check2 = Organization::where('name', '=', Input::get('name'))->first();
|
||||||
|
|
||||||
if (\Input::get('name') == null) {
|
if (\Input::get('name') == null) {
|
||||||
return "Name is required";
|
return "Name is required";
|
||||||
} elseif($check2 != null) {
|
} elseif ($check2 != null) {
|
||||||
return "Name should be Unique";
|
return "Name should be Unique";
|
||||||
} elseif($check != null) {
|
} elseif ($check != null) {
|
||||||
return "Website should be Unique";
|
return "Website should be Unique";
|
||||||
} else {
|
} else {
|
||||||
$org = new Organization;
|
$org = new Organization;
|
||||||
@@ -385,4 +388,5 @@ class UserController extends Controller {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@@ -1,16 +1,16 @@
|
|||||||
<?php namespace App\Http\Controllers\Client\helpdesk;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Client\helpdesk;
|
||||||
|
|
||||||
// controllers
|
// controllers
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
use App\Http\Controllers\Agent\helpdesk\TicketController;
|
use App\Http\Controllers\Agent\helpdesk\TicketController;
|
||||||
use App\Http\Controllers\Common\SettingsController;
|
use App\Http\Controllers\Common\SettingsController;
|
||||||
|
|
||||||
// requests
|
// requests
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use App\Http\Requests\helpdesk\CreateTicketRequest;
|
use App\Http\Requests\helpdesk\CreateTicketRequest;
|
||||||
use App\Http\Requests\helpdesk\TicketRequest;
|
use App\Http\Requests\helpdesk\TicketRequest;
|
||||||
use App\Http\Requests\helpdesk\TicketEditRequest;
|
use App\Http\Requests\helpdesk\TicketEditRequest;
|
||||||
|
|
||||||
// models
|
// models
|
||||||
use App\Model\helpdesk\Email\Banlist;
|
use App\Model\helpdesk\Email\Banlist;
|
||||||
use App\Model\helpdesk\Ticket\Tickets;
|
use App\Model\helpdesk\Ticket\Tickets;
|
||||||
@@ -24,7 +24,6 @@ use App\Model\helpdesk\Ticket\Ticket_Status;
|
|||||||
use App\Model\helpdesk\Email\Emails;
|
use App\Model\helpdesk\Email\Emails;
|
||||||
use App\Model\helpdesk\Agent\Department;
|
use App\Model\helpdesk\Agent\Department;
|
||||||
use App\User;
|
use App\User;
|
||||||
|
|
||||||
// classes
|
// classes
|
||||||
use Auth;
|
use Auth;
|
||||||
use Hash;
|
use Hash;
|
||||||
@@ -69,8 +68,8 @@ class ClientTicketController extends Controller {
|
|||||||
*/
|
*/
|
||||||
public function reply($id, Request $request) {
|
public function reply($id, Request $request) {
|
||||||
$comment = $request->input('comment');
|
$comment = $request->input('comment');
|
||||||
if($comment != null) {
|
if ($comment != null) {
|
||||||
$tickets = Tickets::where('id','=',$id)->first();
|
$tickets = Tickets::where('id', '=', $id)->first();
|
||||||
$tickets->closed_at = null;
|
$tickets->closed_at = null;
|
||||||
$tickets->closed = 0;
|
$tickets->closed = 0;
|
||||||
$tickets->reopened_at = date('Y-m-d H:i:s');
|
$tickets->reopened_at = date('Y-m-d H:i:s');
|
||||||
@@ -83,14 +82,13 @@ class ClientTicketController extends Controller {
|
|||||||
try {
|
try {
|
||||||
$threads->save();
|
$threads->save();
|
||||||
$tickets->save();
|
$tickets->save();
|
||||||
return \Redirect::back()->with('success1','Successfully replied');
|
return \Redirect::back()->with('success1', 'Successfully replied');
|
||||||
} catch(Exception $e) {
|
} catch (Exception $e) {
|
||||||
return \Redirect::back()->with('fails1',$e->errorInfo[2]);
|
return \Redirect::back()->with('fails1', $e->errorInfo[2]);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return \Redirect::back()->with('fails1','Please fill some data!');
|
return \Redirect::back()->with('fails1', 'Please fill some data!');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,11 +1,11 @@
|
|||||||
<?php namespace App\Http\Controllers\Client\helpdesk;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Client\helpdesk;
|
||||||
|
|
||||||
// controllers
|
// controllers
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
|
|
||||||
// models
|
// models
|
||||||
use App\Model\helpdesk\Email\Emails;
|
use App\Model\helpdesk\Email\Emails;
|
||||||
|
|
||||||
// classes
|
// classes
|
||||||
use Exception;
|
use Exception;
|
||||||
|
|
||||||
@@ -23,9 +23,8 @@ class OuthouseController extends Controller {
|
|||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public static function port()
|
public static function port() {
|
||||||
{
|
$port = Emails::where('id', '=', '1')->first();
|
||||||
$port = Emails::where('id','=','1')->first();
|
|
||||||
$portvalue = $port->option_value;
|
$portvalue = $port->option_value;
|
||||||
return $portvalue;
|
return $portvalue;
|
||||||
}
|
}
|
||||||
@@ -35,10 +34,9 @@ class OuthouseController extends Controller {
|
|||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public static function host()
|
public static function host() {
|
||||||
{
|
$host = Option::where('option_name', '=', 'host')->first();
|
||||||
$host=Option::where('option_name','=','host')->first();
|
$hostvalue = $host->option_value;
|
||||||
$hostvalue=$host->option_value;
|
|
||||||
return $hostvalue;
|
return $hostvalue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -47,10 +45,9 @@ class OuthouseController extends Controller {
|
|||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public static function username()
|
public static function username() {
|
||||||
{
|
$username = Option::where('option_name', '=', 'username')->first();
|
||||||
$username=Option::where('option_name','=','username')->first();
|
$uservalue = $username->option_value;
|
||||||
$uservalue=$username->option_value;
|
|
||||||
|
|
||||||
return $uservalue;
|
return $uservalue;
|
||||||
}
|
}
|
||||||
@@ -60,10 +57,9 @@ class OuthouseController extends Controller {
|
|||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public static function password()
|
public static function password() {
|
||||||
{
|
$password = Option::where('option_name', '=', 'password')->first();
|
||||||
$password=Option::where('option_name','=','password')->first();
|
$passvalue = $password->option_value;
|
||||||
$passvalue=$password->option_value;
|
|
||||||
|
|
||||||
return $passvalue;
|
return $passvalue;
|
||||||
}
|
}
|
||||||
@@ -73,10 +69,9 @@ class OuthouseController extends Controller {
|
|||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public static function encryption()
|
public static function encryption() {
|
||||||
{
|
$encryption = Option::where('option_name', '=', 'encryption')->first();
|
||||||
$encryption=Option::where('option_name','=','encryption')->first();
|
$encryptvalue = $encryption->option_value;
|
||||||
$encryptvalue=$encryption->option_value;
|
|
||||||
|
|
||||||
return $encryptvalue;
|
return $encryptvalue;
|
||||||
}
|
}
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
<?php namespace App\Http\Controllers\Client\helpdesk;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Client\helpdesk;
|
||||||
|
|
||||||
// controllers
|
// controllers
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
use App\Http\Controllers\Agent\helpdesk\TicketController;
|
use App\Http\Controllers\Agent\helpdesk\TicketController;
|
||||||
use App\Http\Controllers\Common\SettingsController;
|
use App\Http\Controllers\Common\SettingsController;
|
||||||
|
|
||||||
// requests
|
// requests
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use App\Http\Requests\helpdesk\ClientRequest;
|
use App\Http\Requests\helpdesk\ClientRequest;
|
||||||
|
|
||||||
// models
|
// models
|
||||||
use App\Model\helpdesk\Form\Forms;
|
use App\Model\helpdesk\Form\Forms;
|
||||||
use App\Model\helpdesk\Manage\Help_topic;
|
use App\Model\helpdesk\Manage\Help_topic;
|
||||||
@@ -22,7 +22,6 @@ use App\Model\helpdesk\Ticket\Ticket_source;
|
|||||||
use App\User;
|
use App\User;
|
||||||
use App\Model\helpdesk\Form\Fields;
|
use App\Model\helpdesk\Form\Fields;
|
||||||
use App\Model\helpdesk\Form\Form_value;
|
use App\Model\helpdesk\Form\Form_value;
|
||||||
|
|
||||||
// classes
|
// classes
|
||||||
use Form;
|
use Form;
|
||||||
use Input;
|
use Input;
|
||||||
@@ -61,10 +60,10 @@ class FormController extends Controller {
|
|||||||
* @return type
|
* @return type
|
||||||
*/
|
*/
|
||||||
public function getForm(Help_topic $topic) {
|
public function getForm(Help_topic $topic) {
|
||||||
if(\Config::get('database.install') == '%0%') {
|
if (\Config::get('database.install') == '%0%') {
|
||||||
return \Redirect::route('license');
|
return \Redirect::route('license');
|
||||||
}
|
}
|
||||||
if(System::first()->status == 1) {
|
if (System::first()->status == 1) {
|
||||||
$topics = $topic->get();
|
$topics = $topic->get();
|
||||||
return view('themes.default1.client.helpdesk.form', compact('topics'));
|
return view('themes.default1.client.helpdesk.form', compact('topics'));
|
||||||
} else {
|
} else {
|
||||||
@@ -80,41 +79,42 @@ class FormController extends Controller {
|
|||||||
*/
|
*/
|
||||||
public function postForm($id, Help_topic $topic) {
|
public function postForm($id, Help_topic $topic) {
|
||||||
// dd($id);
|
// dd($id);
|
||||||
if($id != 0 ){
|
if ($id != 0) {
|
||||||
$helptopic = $topic->where('id', '=', $id)->first();
|
$helptopic = $topic->where('id', '=', $id)->first();
|
||||||
$custom_form = $helptopic->custom_form;
|
$custom_form = $helptopic->custom_form;
|
||||||
$values = Fields::where('forms_id', '=', $custom_form)->get();
|
$values = Fields::where('forms_id', '=', $custom_form)->get();
|
||||||
if(!$values) {
|
if (!$values) {
|
||||||
} if($values) {
|
|
||||||
foreach($values as $value){
|
} if ($values) {
|
||||||
if($value->type == "select") {
|
foreach ($values as $value) {
|
||||||
|
if ($value->type == "select") {
|
||||||
$data = $value->value;
|
$data = $value->value;
|
||||||
$value = explode(',', $data);
|
$value = explode(',', $data);
|
||||||
echo '<select class="form-control">';
|
echo '<select class="form-control">';
|
||||||
foreach($value as $option){
|
foreach ($value as $option) {
|
||||||
echo '<option>'.$option.'</option>';
|
echo '<option>' . $option . '</option>';
|
||||||
}
|
}
|
||||||
echo '</select></br>';
|
echo '</select></br>';
|
||||||
} elseif ($value->type == "radio" ) {
|
} elseif ($value->type == "radio") {
|
||||||
$type2 = $value->value;
|
$type2 = $value->value;
|
||||||
$val = explode(',', $type2);
|
$val = explode(',', $type2);
|
||||||
echo '<label class="radio-inline">'.$value->label.'</label>   <input type="'.$value->type.'" name="'.$value->name.'"> '.$val[0].'
|
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>';
|
   <input type="' . $value->type . '" name="' . $value->name . '"> ' . $val[1] . '</br>';
|
||||||
} elseif($value->type == "textarea" ) {
|
} elseif ($value->type == "textarea") {
|
||||||
$type3 = $value->value;
|
$type3 = $value->value;
|
||||||
$v = explode(',', $type3);
|
$v = explode(',', $type3);
|
||||||
//dd($v);
|
//dd($v);
|
||||||
if(array_key_exists(1, $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 {
|
} 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;
|
$type4 = $value->value;
|
||||||
$check = explode(',', $type4);
|
$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 {
|
} 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>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -130,7 +130,7 @@ class FormController extends Controller {
|
|||||||
*/
|
*/
|
||||||
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');
|
$form_extras = $request->except('Name', 'Phone', 'Email', 'Subject', 'Details', 'helptopic', '_wysihtml5_mode', '_token');
|
||||||
|
|
||||||
$name = $request->input('Name');
|
$name = $request->input('Name');
|
||||||
$phone = $request->input('Phone');
|
$phone = $request->input('Phone');
|
||||||
@@ -138,26 +138,24 @@ class FormController extends Controller {
|
|||||||
$subject = $request->input('Subject');
|
$subject = $request->input('Subject');
|
||||||
$details = $request->input('Details');
|
$details = $request->input('Details');
|
||||||
|
|
||||||
$System = System::where('id','=',1)->first();
|
$System = System::where('id', '=', 1)->first();
|
||||||
$departments = Department::where('id','=',$System->department)->first();
|
$departments = Department::where('id', '=', $System->department)->first();
|
||||||
$department = $departments->id;
|
$department = $departments->id;
|
||||||
|
|
||||||
$status = $ticket_settings->first()->status;
|
$status = $ticket_settings->first()->status;
|
||||||
$helptopic = $ticket_settings->first()->help_topic;
|
$helptopic = $ticket_settings->first()->help_topic;
|
||||||
$sla = $ticket_settings->first()->sla;
|
$sla = $ticket_settings->first()->sla;
|
||||||
$priority = $ticket_settings->first()->priority;
|
$priority = $ticket_settings->first()->priority;
|
||||||
$source = $ticket_source->where('name','=','web')->first();
|
$source = $ticket_source->where('name', '=', 'web')->first();
|
||||||
|
|
||||||
$collaborator = null;
|
$collaborator = null;
|
||||||
$assignto = null;
|
$assignto = null;
|
||||||
|
|
||||||
if($this->TicketController->create_user($email, $name, $subject, $details, $phone, $helptopic, $sla, $priority, $source->id, $collaborator, $department,$assignto, $form_extras)) {
|
if ($this->TicketController->create_user($email, $name, $subject, $details, $phone, $helptopic, $sla, $priority, $source->id, $collaborator, $department, $assignto, $form_extras)) {
|
||||||
return Redirect::route('guest.getform')->with('success','Ticket Created Successfully');
|
return Redirect::route('guest.getform')->with('success', 'Ticket Created Successfully');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* reply
|
* reply
|
||||||
* @param type $value
|
* @param type $value
|
||||||
@@ -165,8 +163,8 @@ class FormController extends Controller {
|
|||||||
*/
|
*/
|
||||||
public function post_ticket_reply($id, Request $request) {
|
public function post_ticket_reply($id, Request $request) {
|
||||||
$comment = $request->input('comment');
|
$comment = $request->input('comment');
|
||||||
if($comment != null) {
|
if ($comment != null) {
|
||||||
$tickets = Tickets::where('id','=',$id)->first();
|
$tickets = Tickets::where('id', '=', $id)->first();
|
||||||
$threads = new Ticket_Thread;
|
$threads = new Ticket_Thread;
|
||||||
$tickets->closed_at = null;
|
$tickets->closed_at = null;
|
||||||
$tickets->closed = 0;
|
$tickets->closed = 0;
|
||||||
@@ -179,16 +177,13 @@ class FormController extends Controller {
|
|||||||
try {
|
try {
|
||||||
$threads->save();
|
$threads->save();
|
||||||
$tickets->save();
|
$tickets->save();
|
||||||
return \Redirect::back()->with('success1','Successfully replied');
|
return \Redirect::back()->with('success1', 'Successfully replied');
|
||||||
} catch(Exception $e) {
|
} catch (Exception $e) {
|
||||||
return \Redirect::back()->with('fails1',$e->errorInfo[2]);
|
return \Redirect::back()->with('fails1', $e->errorInfo[2]);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return \Redirect::back()->with('fails1','Please fill some data!');
|
return \Redirect::back()->with('fails1', 'Please fill some data!');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
@@ -1,15 +1,16 @@
|
|||||||
<?php namespace App\Http\Controllers\Client\helpdesk;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Client\helpdesk;
|
||||||
|
|
||||||
// controllers
|
// controllers
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
use App\Http\Controllers\Common\SettingsController;
|
use App\Http\Controllers\Common\SettingsController;
|
||||||
|
use App\Http\Controllers\Common\PhpMailController;
|
||||||
// requests
|
// requests
|
||||||
use App\Http\Requests\helpdesk\CheckTicket;
|
use App\Http\Requests\helpdesk\CheckTicket;
|
||||||
use App\Http\Requests\helpdesk\ProfilePassword;
|
use App\Http\Requests\helpdesk\ProfilePassword;
|
||||||
use App\Http\Requests\helpdesk\ProfileRequest;
|
use App\Http\Requests\helpdesk\ProfileRequest;
|
||||||
use App\Http\Requests\helpdesk\TicketRequest;
|
use App\Http\Requests\helpdesk\TicketRequest;
|
||||||
|
|
||||||
// models
|
// models
|
||||||
use App\Model\helpdesk\Manage\Help_topic;
|
use App\Model\helpdesk\Manage\Help_topic;
|
||||||
use App\Model\helpdesk\Ticket\Tickets;
|
use App\Model\helpdesk\Ticket\Tickets;
|
||||||
@@ -17,7 +18,6 @@ use App\Model\helpdesk\Ticket\Ticket_Thread;
|
|||||||
use App\Model\helpdesk\Settings\Company;
|
use App\Model\helpdesk\Settings\Company;
|
||||||
use App\Model\helpdesk\Settings\System;
|
use App\Model\helpdesk\Settings\System;
|
||||||
use App\User;
|
use App\User;
|
||||||
|
|
||||||
// classes
|
// classes
|
||||||
use Auth;
|
use Auth;
|
||||||
use Hash;
|
use Hash;
|
||||||
@@ -37,8 +37,8 @@ class GuestController extends Controller {
|
|||||||
* Create a new controller instance.
|
* Create a new controller instance.
|
||||||
* @return type void
|
* @return type void
|
||||||
*/
|
*/
|
||||||
|
public function __construct(PhpMailController $PhpMailController) {
|
||||||
public function __construct() {
|
$this->PhpMailController = $PhpMailController;
|
||||||
SettingsController::smtp();
|
SettingsController::smtp();
|
||||||
// checking authentication
|
// checking authentication
|
||||||
$this->middleware('auth');
|
$this->middleware('auth');
|
||||||
@@ -60,7 +60,7 @@ class GuestController extends Controller {
|
|||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function postProfile(ProfileRequest $request) {
|
public function postProfile(ProfileRequest $request) {
|
||||||
$user = User::where('id','=',Auth::user()->id)->first();
|
$user = User::where('id', '=', Auth::user()->id)->first();
|
||||||
$user->gender = $request->get('gender');
|
$user->gender = $request->get('gender');
|
||||||
$user->save();
|
$user->save();
|
||||||
if ($user->profile_pic == 'avatar5.png' || $user->profile_pic == 'avatar2.png') {
|
if ($user->profile_pic == 'avatar5.png' || $user->profile_pic == 'avatar2.png') {
|
||||||
@@ -107,10 +107,10 @@ class GuestController extends Controller {
|
|||||||
* @return type
|
* @return type
|
||||||
*/
|
*/
|
||||||
public function getForm(Help_topic $topic) {
|
public function getForm(Help_topic $topic) {
|
||||||
if(\Config::get('database.install') == '%0%') {
|
if (\Config::get('database.install') == '%0%') {
|
||||||
return \Redirect::route('license');
|
return \Redirect::route('license');
|
||||||
}
|
}
|
||||||
if(System::first()->status == 1) {
|
if (System::first()->status == 1) {
|
||||||
$topics = $topic->get();
|
$topics = $topic->get();
|
||||||
return view('themes.default1.client.helpdesk.form', compact('topics'));
|
return view('themes.default1.client.helpdesk.form', compact('topics'));
|
||||||
} else {
|
} else {
|
||||||
@@ -153,6 +153,7 @@ class GuestController extends Controller {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public function ticketEdit() {
|
public function ticketEdit() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -166,7 +167,7 @@ class GuestController extends Controller {
|
|||||||
//echo $user->password;
|
//echo $user->password;
|
||||||
if (Hash::check($request->input('old_password'), $user->getAuthPassword())) {
|
if (Hash::check($request->input('old_password'), $user->getAuthPassword())) {
|
||||||
$user->password = Hash::make($request->input('new_password'));
|
$user->password = Hash::make($request->input('new_password'));
|
||||||
try{
|
try {
|
||||||
$user->save();
|
$user->save();
|
||||||
return redirect()->back()->with('success2', 'Password Updated sucessfully');
|
return redirect()->back()->with('success2', 'Password Updated sucessfully');
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
@@ -220,19 +221,19 @@ class GuestController extends Controller {
|
|||||||
$Ticket_number = \Input::get('ticket_number');
|
$Ticket_number = \Input::get('ticket_number');
|
||||||
|
|
||||||
$ticket = Tickets::where('ticket_number', '=', $Ticket_number)->first();
|
$ticket = Tickets::where('ticket_number', '=', $Ticket_number)->first();
|
||||||
if($ticket == null) {
|
if ($ticket == null) {
|
||||||
return \Redirect::route('form')->with('fails', 'There is no such Ticket Number');
|
return \Redirect::route('form')->with('fails', 'There is no such Ticket Number');
|
||||||
} else {
|
} else {
|
||||||
$userId = $ticket->user_id;
|
$userId = $ticket->user_id;
|
||||||
$user = User::where('id', '=', $userId)->first();
|
$user = User::where('id', '=', $userId)->first();
|
||||||
|
|
||||||
if($user->role == 'user') {
|
if ($user->role == 'user') {
|
||||||
$username = $user->user_name;
|
$username = $user->user_name;
|
||||||
} else {
|
} else {
|
||||||
$username = $user->first_name." ".$user->last_name;
|
$username = $user->first_name . " " . $user->last_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($user->email != $Email) {
|
if ($user->email != $Email) {
|
||||||
return \Redirect::route('form')->with('fails', "Email didn't match with Ticket Number");
|
return \Redirect::route('form')->with('fails', "Email didn't match with Ticket Number");
|
||||||
} else {
|
} else {
|
||||||
$code = $ticket->id;
|
$code = $ticket->id;
|
||||||
@@ -240,14 +241,12 @@ class GuestController extends Controller {
|
|||||||
|
|
||||||
$company = $this->company();
|
$company = $this->company();
|
||||||
|
|
||||||
\Mail::send('emails.check_ticket',
|
$this->PhpMailController->sendmail(
|
||||||
array('link'=>\URL::route('check_ticket',$code),'user'=>$username, 'from'=>$company),
|
$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)]
|
||||||
function($message) use($user, $username, $Ticket_number) {
|
|
||||||
$message->to($user->email, $username)->subject('Ticket link Request ['.$Ticket_number.']');
|
|
||||||
}
|
|
||||||
);
|
);
|
||||||
|
|
||||||
return \Redirect::back()
|
return \Redirect::back()
|
||||||
->with('success','We have sent you a link by Email. Please click on that link to view ticket');
|
->with('success', 'We have sent you a link by Email. Please click on that link to view ticket');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -259,7 +258,7 @@ class GuestController extends Controller {
|
|||||||
*/
|
*/
|
||||||
public function get_ticket_email($id) {
|
public function get_ticket_email($id) {
|
||||||
$id1 = \Crypt::decrypt($id);
|
$id1 = \Crypt::decrypt($id);
|
||||||
return view('themes.default1.client.helpdesk.ckeckticket',compact('id'));
|
return view('themes.default1.client.helpdesk.ckeckticket', compact('id'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -276,10 +275,10 @@ class GuestController extends Controller {
|
|||||||
* @return type
|
* @return type
|
||||||
*/
|
*/
|
||||||
public function company() {
|
public function company() {
|
||||||
$company = Company::Where('id','=','1')->first();
|
$company = Company::Where('id', '=', '1')->first();
|
||||||
if($company->company_name == null){
|
if ($company->company_name == null) {
|
||||||
$company = "Support Center";
|
$company = "Support Center";
|
||||||
}else{
|
} else {
|
||||||
$company = $company->company_name;
|
$company = $company->company_name;
|
||||||
}
|
}
|
||||||
return $company;
|
return $company;
|
||||||
|
@@ -1,4 +1,7 @@
|
|||||||
<?php namespace App\Http\Controllers\Client\helpdesk;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Client\helpdesk;
|
||||||
|
|
||||||
// controllers
|
// controllers
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
// models
|
// models
|
||||||
@@ -23,7 +26,7 @@ class WelcomepageController extends Controller {
|
|||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function get(System $note) {
|
public function get(System $note) {
|
||||||
if(Config::get('database.install')=='%0%') {
|
if (Config::get('database.install') == '%0%') {
|
||||||
return Redirect::route('licence');
|
return Redirect::route('licence');
|
||||||
}
|
}
|
||||||
$notes = $note->get();
|
$notes = $note->get();
|
||||||
@@ -34,9 +37,10 @@ class WelcomepageController extends Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function index() {
|
public function index() {
|
||||||
if(Config::get('database.install')=='%0%') {
|
if (Config::get('database.install') == '%0%') {
|
||||||
return Redirect::route('licence');
|
return Redirect::route('licence');
|
||||||
}
|
}
|
||||||
return view('themes.default1.client.helpdesk.guest-user.index');
|
return view('themes.default1.client.helpdesk.guest-user.index');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -1,4 +1,6 @@
|
|||||||
<?php namespace App\Http\Controllers\Client\kb;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Client\kb;
|
||||||
|
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
use App\Http\Requests\kb\CommentRequest;
|
use App\Http\Requests\kb\CommentRequest;
|
||||||
@@ -40,6 +42,7 @@ class UserController extends Controller {
|
|||||||
* @package default
|
* @package default
|
||||||
*/
|
*/
|
||||||
public function getArticle(Article $article, Category $category, Settings $settings) {
|
public function getArticle(Article $article, Category $category, Settings $settings) {
|
||||||
|
|
||||||
$settings = $settings->first();
|
$settings = $settings->first();
|
||||||
$pagination = $settings->pagination;
|
$pagination = $settings->pagination;
|
||||||
// $article = $article->where('status', '1');
|
// $article = $article->where('status', '1');
|
||||||
@@ -90,12 +93,16 @@ class UserController extends Controller {
|
|||||||
*/
|
*/
|
||||||
public function show($slug, Article $article, Category $category) {
|
public function show($slug, Article $article, Category $category) {
|
||||||
//ArticleController::timezone();
|
//ArticleController::timezone();
|
||||||
$arti = $article->where('slug', $slug)->where('status','1')->where('type','1')->first();
|
$tz = \App\Model\helpdesk\Settings\System::where('id', '1')->first()->time_zone;
|
||||||
|
$tz = \App\Model\helpdesk\Utility\Timezones::where('id', $tz)->first()->name;
|
||||||
// dd($arti);
|
date_default_timezone_set($tz);
|
||||||
//$categorys = $category->get();
|
$date = \Carbon\Carbon::now()->toDateTimeString();
|
||||||
//$avatar->get('vijaycodename47@gmail.com');
|
$arti = $article->where('slug', $slug)->where('status', '1')->where('type', '1')->where('publish_time', '<', $date)->first();
|
||||||
|
if ($arti) {
|
||||||
return view('themes.default1.client.kb.article-list.show', compact('arti'));
|
return view('themes.default1.client.kb.article-list.show', compact('arti'));
|
||||||
|
} else {
|
||||||
|
return redirect()->back()->with('fails', 'No records on publish time');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getCategory($slug, Article $article, Category $category, Relationship $relation) {
|
public function getCategory($slug, Article $article, Category $category, Relationship $relation) {
|
||||||
@@ -108,15 +115,13 @@ class UserController extends Controller {
|
|||||||
$article_id = $all->lists('article_id');
|
$article_id = $all->lists('article_id');
|
||||||
$categorys = $category->get();
|
$categorys = $category->get();
|
||||||
/* direct to view with $article_id */
|
/* direct to view with $article_id */
|
||||||
return view('themes.default1.client.kb.article-list.category', compact('all','id', 'categorys', 'article_id'));
|
return view('themes.default1.client.kb.article-list.category', compact('all', 'id', 'categorys', 'article_id'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function home(Article $article, Category $category, Relationship $relation) {
|
public function home(Article $article, Category $category, Relationship $relation) {
|
||||||
if (Config::get('database.install') == '%0%') {
|
if (Config::get('database.install') == '%0%') {
|
||||||
return redirect('step1');
|
return redirect('step1');
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
//$categorys = $category->get();
|
//$categorys = $category->get();
|
||||||
$categorys = $category->get();
|
$categorys = $category->get();
|
||||||
// $categorys->setPath('home');
|
// $categorys->setPath('home');
|
||||||
@@ -185,7 +190,7 @@ class UserController extends Controller {
|
|||||||
* @return type response
|
* @return type response
|
||||||
*/
|
*/
|
||||||
public function postComment($slug, Article $article, CommentRequest $request, Comment $comment) {
|
public function postComment($slug, Article $article, CommentRequest $request, Comment $comment) {
|
||||||
$article = $article->where('slug',$slug)->first();
|
$article = $article->where('slug', $slug)->first();
|
||||||
$id = $article->id;
|
$id = $article->id;
|
||||||
$comment->article_id = $id;
|
$comment->article_id = $id;
|
||||||
if ($comment->fill($request->input())->save()) {
|
if ($comment->fill($request->input())->save()) {
|
||||||
@@ -200,23 +205,28 @@ class UserController extends Controller {
|
|||||||
//$this->timezone($page->created_at);
|
//$this->timezone($page->created_at);
|
||||||
return view('themes.default1.client.kb.article-list.pages', compact('page'));
|
return view('themes.default1.client.kb.article-list.pages', compact('page'));
|
||||||
}
|
}
|
||||||
|
|
||||||
static function port() {
|
static function port() {
|
||||||
$setting = Settings::whereId('1')->first();
|
$setting = Settings::whereId('1')->first();
|
||||||
Config::set('mail.port', $setting->port);
|
Config::set('mail.port', $setting->port);
|
||||||
}
|
}
|
||||||
|
|
||||||
static function host() {
|
static function host() {
|
||||||
$setting = Settings::whereId('1')->first();
|
$setting = Settings::whereId('1')->first();
|
||||||
Config::set('mail.host', $setting->host);
|
Config::set('mail.host', $setting->host);
|
||||||
}
|
}
|
||||||
|
|
||||||
static function encryption() {
|
static function encryption() {
|
||||||
$setting = Settings::whereId('1')->first();
|
$setting = Settings::whereId('1')->first();
|
||||||
Config::set(['mail.encryption' => $setting->encryption, 'mail.username' => $setting->email]);
|
Config::set(['mail.encryption' => $setting->encryption, 'mail.username' => $setting->email]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static function email() {
|
static function email() {
|
||||||
$setting = Settings::whereId('1')->first();
|
$setting = Settings::whereId('1')->first();
|
||||||
Config::set(['mail.from' => ['address' => $setting->email, 'name' => 'asd']]);
|
Config::set(['mail.from' => ['address' => $setting->email, 'name' => 'asd']]);
|
||||||
//dd(Config::get('mail'));
|
//dd(Config::get('mail'));
|
||||||
}
|
}
|
||||||
|
|
||||||
static function password() {
|
static function password() {
|
||||||
$setting = Settings::whereId('1')->first();
|
$setting = Settings::whereId('1')->first();
|
||||||
Config::set(['mail.password' => $setting->password, 'mail.sendmail' => $setting->email]);
|
Config::set(['mail.password' => $setting->password, 'mail.sendmail' => $setting->email]);
|
||||||
@@ -228,7 +238,6 @@ class UserController extends Controller {
|
|||||||
// $categorys->setPath('home');
|
// $categorys->setPath('home');
|
||||||
/* direct to view with $article_id */
|
/* direct to view with $article_id */
|
||||||
return view('themes.default1.client.kb.article-list.categoryList', compact('categorys', 'article_id'));
|
return view('themes.default1.client.kb.article-list.categoryList', compact('categorys', 'article_id'));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// static function timezone($utc) {
|
// static function timezone($utc) {
|
||||||
@@ -238,7 +247,6 @@ class UserController extends Controller {
|
|||||||
// //$utc = date('M d Y h:i:s A');
|
// //$utc = date('M d Y h:i:s A');
|
||||||
// //echo 'UTC : ' . $utc;
|
// //echo 'UTC : ' . $utc;
|
||||||
// date_default_timezone_set($tz);
|
// date_default_timezone_set($tz);
|
||||||
|
|
||||||
// $offset = date('Z', strtotime($utc));
|
// $offset = date('Z', strtotime($utc));
|
||||||
// //print "offset: $offset \n";
|
// //print "offset: $offset \n";
|
||||||
// $date = date($format, strtotime($utc) + $offset);
|
// $date = date($format, strtotime($utc) + $offset);
|
||||||
|
@@ -1,4 +1,7 @@
|
|||||||
<?php namespace App\Http\Controllers\Common;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Common;
|
||||||
|
|
||||||
// controllers
|
// controllers
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
// requests
|
// requests
|
||||||
@@ -43,7 +46,6 @@ class SettingsController extends Controller {
|
|||||||
SettingsController::password();
|
SettingsController::password();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* get the page to create the footer
|
* get the page to create the footer
|
||||||
* @return response
|
* @return response
|
||||||
@@ -57,49 +59,46 @@ class SettingsController extends Controller {
|
|||||||
* @return response
|
* @return response
|
||||||
*/
|
*/
|
||||||
public function list_widget() {
|
public function list_widget() {
|
||||||
return \Datatable::collection(Widgets::where('id','<','7')->get())
|
return \Datatable::collection(Widgets::where('id', '<', '7')->get())
|
||||||
->searchColumns('name')
|
->searchColumns('name')
|
||||||
->orderColumns('name', 'title', 'value')
|
->orderColumns('name', 'title', 'value')
|
||||||
->addColumn('name', function ($model) {
|
->addColumn('name', function ($model) {
|
||||||
return $model->name;
|
return $model->name;
|
||||||
})
|
})
|
||||||
|
|
||||||
->addColumn('title', function ($model) {
|
->addColumn('title', function ($model) {
|
||||||
return $model->title;
|
return $model->title;
|
||||||
})
|
})
|
||||||
|
|
||||||
->addColumn('body', function ($model) {
|
->addColumn('body', function ($model) {
|
||||||
return $model->value;
|
return $model->value;
|
||||||
})
|
})
|
||||||
|
|
||||||
->addColumn('Actions', function ($model) {
|
->addColumn('Actions', function ($model) {
|
||||||
return '<span data-toggle="modal" data-target="#edit_widget'.$model->id .'"><a class="btn btn-warning btn-xs">' . \Lang::get('lang.edit') . '</a></span>
|
return '<span data-toggle="modal" data-target="#edit_widget' . $model->id . '"><a class="btn btn-warning btn-xs">' . \Lang::get('lang.edit') . '</a></span>
|
||||||
<div class="modal fade" id="edit_widget'.$model->id .'">
|
<div class="modal fade" id="edit_widget' . $model->id . '">
|
||||||
<div class="modal-dialog">
|
<div class="modal-dialog">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<form action="'. url('edit-widget/'.$model->id) .'" method="POST">
|
<form action="' . url('edit-widget/' . $model->id) . '" method="POST">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||||
<h4 class="modal-title">'.strtoupper($model->name).' </h4>
|
<h4 class="modal-title">' . strtoupper($model->name) . ' </h4>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<div class="form-group" style="width:100%">
|
<div class="form-group" style="width:100%">
|
||||||
<label>'.\Lang::get("lang.title").'</label><br/>
|
<label>' . \Lang::get("lang.title") . '</label><br/>
|
||||||
<input type="text" name="title" value="'.$model->title.'" class="form-control" style="width:100%">
|
<input type="text" name="title" value="' . $model->title . '" class="form-control" style="width:100%">
|
||||||
</div>
|
</div>
|
||||||
<br/>
|
<br/>
|
||||||
<div class="form-group" style="width:100%">
|
<div class="form-group" style="width:100%">
|
||||||
<label>'.\Lang::get("lang.content").'</label><br/>
|
<label>' . \Lang::get("lang.content") . '</label><br/>
|
||||||
<textarea name="content" class="form-control" style="width:100%" id="Content'.$model->id.'">'.$model->value.'</textarea>
|
<textarea name="content" class="form-control" style="width:100%" id="Content' . $model->id . '">' . $model->value . '</textarea>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal" id="dismis2">'.\Lang::get('lang.close').'</button>
|
<button type="button" class="btn btn-default pull-left" data-dismiss="modal" id="dismis2">' . \Lang::get('lang.close') . '</button>
|
||||||
<input type="submit" class="btn btn-primary" value="'.\Lang::get('lang.update').'">
|
<input type="submit" class="btn btn-primary" value="' . \Lang::get('lang.update') . '">
|
||||||
</div>
|
</div>
|
||||||
<script>
|
<script>
|
||||||
$(function () {
|
$(function () {
|
||||||
$("#Content'. $model->id .'").wysihtml5();
|
$("#Content' . $model->id . '").wysihtml5();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</form>
|
</form>
|
||||||
@@ -107,11 +106,9 @@ class SettingsController extends Controller {
|
|||||||
</div>
|
</div>
|
||||||
</div>';
|
</div>';
|
||||||
})
|
})
|
||||||
|
|
||||||
->make();
|
->make();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Post footer
|
* Post footer
|
||||||
* @param type Footer $footer
|
* @param type Footer $footer
|
||||||
@@ -119,13 +116,13 @@ class SettingsController extends Controller {
|
|||||||
* @return type response
|
* @return type response
|
||||||
*/
|
*/
|
||||||
public function edit_widget($id, Widgets $widgets, Request $request) {
|
public function edit_widget($id, Widgets $widgets, Request $request) {
|
||||||
$widget = $widgets->where('id','=',$id)->first();
|
$widget = $widgets->where('id', '=', $id)->first();
|
||||||
$widget->title = $request->title;
|
$widget->title = $request->title;
|
||||||
$widget->value = $request->content;
|
$widget->value = $request->content;
|
||||||
try{
|
try {
|
||||||
$widget->save();
|
$widget->save();
|
||||||
return redirect()->back()->with('success', $widget->name.' Saved Successfully');
|
return redirect()->back()->with('success', $widget->name . ' Saved Successfully');
|
||||||
} catch(Exception $e) {
|
} catch (Exception $e) {
|
||||||
return redirect()->back()->with('fails', $e->errorInfo[2]);
|
return redirect()->back()->with('fails', $e->errorInfo[2]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -143,37 +140,35 @@ class SettingsController extends Controller {
|
|||||||
* @return response
|
* @return response
|
||||||
*/
|
*/
|
||||||
public function list_social_buttons() {
|
public function list_social_buttons() {
|
||||||
return \Datatable::collection(Widgets::where('id','>','6')->get())
|
return \Datatable::collection(Widgets::where('id', '>', '6')->get())
|
||||||
->searchColumns('name')
|
->searchColumns('name')
|
||||||
->orderColumns('name', 'value')
|
->orderColumns('name', 'value')
|
||||||
->addColumn('name', function ($model) {
|
->addColumn('name', function ($model) {
|
||||||
return $model->name;
|
return $model->name;
|
||||||
})
|
})
|
||||||
|
|
||||||
->addColumn('link', function ($model) {
|
->addColumn('link', function ($model) {
|
||||||
return $model->value;
|
return $model->value;
|
||||||
})
|
})
|
||||||
|
|
||||||
->addColumn('Actions', function ($model) {
|
->addColumn('Actions', function ($model) {
|
||||||
return '<span data-toggle="modal" data-target="#edit_widget'.$model->id .'"><a class="btn btn-warning btn-xs">' . \Lang::get('lang.edit') . '</a></span>
|
return '<span data-toggle="modal" data-target="#edit_widget' . $model->id . '"><a class="btn btn-warning btn-xs">' . \Lang::get('lang.edit') . '</a></span>
|
||||||
<div class="modal fade" id="edit_widget'.$model->id .'">
|
<div class="modal fade" id="edit_widget' . $model->id . '">
|
||||||
<div class="modal-dialog">
|
<div class="modal-dialog">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<form action="'. url('edit-widget/'.$model->id) .'" method="POST">
|
<form action="' . url('edit-widget/' . $model->id) . '" method="POST">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||||
<h4 class="modal-title">'.strtoupper($model->name).' </h4>
|
<h4 class="modal-title">' . strtoupper($model->name) . ' </h4>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<br/>
|
<br/>
|
||||||
<div class="form-group" style="width:100%">
|
<div class="form-group" style="width:100%">
|
||||||
<label>'.\Lang::get("lang.link").'</label><br/>
|
<label>' . \Lang::get("lang.link") . '</label><br/>
|
||||||
<input type="url" name="content" class="form-control" style="width:100%" value="'.$model->value.'">
|
<input type="url" name="content" class="form-control" style="width:100%" value="' . $model->value . '">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal" id="dismis2">'.\Lang::get('lang.close').'</button>
|
<button type="button" class="btn btn-default pull-left" data-dismiss="modal" id="dismis2">' . \Lang::get('lang.close') . '</button>
|
||||||
<input type="submit" class="btn btn-primary" value="'.\Lang::get('lang.update').'">
|
<input type="submit" class="btn btn-primary" value="' . \Lang::get('lang.update') . '">
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
@@ -190,14 +185,14 @@ class SettingsController extends Controller {
|
|||||||
* @return type response
|
* @return type response
|
||||||
*/
|
*/
|
||||||
public function edit_social_buttons($id, Widgets $widgets, Request $request) {
|
public function edit_social_buttons($id, Widgets $widgets, Request $request) {
|
||||||
$widget = $widgets->where('id','=',$id)->first();
|
$widget = $widgets->where('id', '=', $id)->first();
|
||||||
$widget->title = $request->title;
|
$widget->title = $request->title;
|
||||||
$widget->value = $request->content;
|
$widget->value = $request->content;
|
||||||
try{
|
try {
|
||||||
$widget->save();
|
$widget->save();
|
||||||
return redirect()->back()->with('success', $widget->name.' Saved Successfully');
|
return redirect()->back()->with('success', $widget->name . ' Saved Successfully');
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
return redirect()->back()->with('fails',$e->errorInfo[2]);
|
return redirect()->back()->with('fails', $e->errorInfo[2]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -296,7 +291,7 @@ class SettingsController extends Controller {
|
|||||||
$data->name = $request->input('name');
|
$data->name = $request->input('name');
|
||||||
$data->email = $request->input('email');
|
$data->email = $request->input('email');
|
||||||
$data->password = Crypt::encrypt($request->input('password'));
|
$data->password = Crypt::encrypt($request->input('password'));
|
||||||
try{
|
try {
|
||||||
$data->save();
|
$data->save();
|
||||||
return \Redirect::route('getsmtp')->with('success', 'success');
|
return \Redirect::route('getsmtp')->with('success', 'success');
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
@@ -343,9 +338,9 @@ class SettingsController extends Controller {
|
|||||||
$pass = $request->input('password');
|
$pass = $request->input('password');
|
||||||
$password = Crypt::encrypt($pass);
|
$password = Crypt::encrypt($pass);
|
||||||
$settings->password = $password;
|
$settings->password = $password;
|
||||||
try{
|
try {
|
||||||
$settings->save();
|
$settings->save();
|
||||||
} catch(Exception $e) {
|
} catch (Exception $e) {
|
||||||
return redirect()->back()->with('fails', $e->errorInfo[2]);
|
return redirect()->back()->with('fails', $e->errorInfo[2]);
|
||||||
}
|
}
|
||||||
if (Input::file('logo')) {
|
if (Input::file('logo')) {
|
||||||
@@ -425,8 +420,8 @@ class SettingsController extends Controller {
|
|||||||
$activate = "<a href=" . url('plugin/status/' . $model['path']) . ">Deactivate</a>";
|
$activate = "<a href=" . url('plugin/status/' . $model['path']) . ">Deactivate</a>";
|
||||||
}
|
}
|
||||||
|
|
||||||
$delete = "<a href= id=delete".$model['path']." data-toggle=modal data-target=#del".$model['path']."><span style='color:red'>Delete</span></a>"
|
$delete = "<a href= id=delete" . $model['path'] . " data-toggle=modal data-target=#del" . $model['path'] . "><span style='color:red'>Delete</span></a>"
|
||||||
. "<div class='modal fade' id=del".$model['path'].">
|
. "<div class='modal fade' id=del" . $model['path'] . ">
|
||||||
<div class='modal-dialog'>
|
<div class='modal-dialog'>
|
||||||
<div class=modal-content>
|
<div class=modal-content>
|
||||||
<div class=modal-header>
|
<div class=modal-header>
|
||||||
@@ -457,7 +452,7 @@ class SettingsController extends Controller {
|
|||||||
return ucfirst($model['author']);
|
return ucfirst($model['author']);
|
||||||
})
|
})
|
||||||
->addColumn('website', function($model) {
|
->addColumn('website', function($model) {
|
||||||
return "<a href=".$model['website']." target=_blank>".$model['website']."</a>";
|
return "<a href=" . $model['website'] . " target=_blank>" . $model['website'] . "</a>";
|
||||||
})
|
})
|
||||||
->addColumn('version', function($model) {
|
->addColumn('version', function($model) {
|
||||||
return $model['version'];
|
return $model['version'];
|
||||||
@@ -523,7 +518,7 @@ class SettingsController extends Controller {
|
|||||||
$lines = file($app, FILE_IGNORE_NEW_LINES);
|
$lines = file($app, FILE_IGNORE_NEW_LINES);
|
||||||
$lines[$line_i_am_looking_for] = $str;
|
$lines[$line_i_am_looking_for] = $str;
|
||||||
file_put_contents($app, implode("\n", $lines));
|
file_put_contents($app, implode("\n", $lines));
|
||||||
$plug->create(['name' => $filename, 'path' => $filename,'status'=>1]);
|
$plug->create(['name' => $filename, 'path' => $filename, 'status' => 1]);
|
||||||
return redirect()->back()->with('success', 'Installed SuccessFully');
|
return redirect()->back()->with('success', 'Installed SuccessFully');
|
||||||
} else {
|
} else {
|
||||||
/**
|
/**
|
||||||
|
@@ -1,4 +1,7 @@
|
|||||||
<?php namespace App\Http\Controllers;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
// classes
|
// classes
|
||||||
use Illuminate\Foundation\Bus\DispatchesCommands;
|
use Illuminate\Foundation\Bus\DispatchesCommands;
|
||||||
use Illuminate\Routing\Controller as BaseController;
|
use Illuminate\Routing\Controller as BaseController;
|
||||||
|
@@ -1,4 +1,7 @@
|
|||||||
<?php namespace App\Http\Controllers\Error;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Error;
|
||||||
|
|
||||||
// controllers
|
// controllers
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
|
|
||||||
@@ -18,4 +21,5 @@ class ErrorController extends Controller {
|
|||||||
public function error404() {
|
public function error404() {
|
||||||
return view('404');
|
return view('404');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -1,9 +1,10 @@
|
|||||||
<?php namespace App\Http\Controllers;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
use App\Model\helpdesk\Manage\Sla_plan;
|
use App\Model\helpdesk\Manage\Sla_plan;
|
||||||
use App\Model\helpdesk\Ticket\Tickets;
|
use App\Model\helpdesk\Ticket\Tickets;
|
||||||
|
|
||||||
|
|
||||||
class HomeController extends Controller {
|
class HomeController extends Controller {
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
@@ -35,45 +36,43 @@ class HomeController extends Controller {
|
|||||||
return view('themes/default1/admin/dashboard');
|
return view('themes/default1/admin/dashboard');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getsmtp() {
|
||||||
public function getsmtp(){
|
$smtp = \App\Model\helpdesk\Email\Smtp::where('id', '=', '1')->first();
|
||||||
$smtp = \App\Model\helpdesk\Email\Smtp::where('id','=','1')->first();
|
|
||||||
return $smtp->host;
|
return $smtp->host;
|
||||||
}
|
}
|
||||||
|
|
||||||
Public function getdata(){
|
Public function getdata() {
|
||||||
return \View::make('emails/notifications/agent');
|
return \View::make('emails/notifications/agent');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getreport(){
|
public function getreport() {
|
||||||
return \View::make('test');
|
return \View::make('test');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function pushdata(){
|
public function pushdata() {
|
||||||
|
|
||||||
$date2 = strtotime(Date('Y-m-d'));
|
$date2 = strtotime(Date('Y-m-d'));
|
||||||
$date3 = Date('Y-m-d');
|
$date3 = Date('Y-m-d');
|
||||||
$format = 'Y-m-d';
|
$format = 'Y-m-d';
|
||||||
$date1 = strtotime(Date($format,strtotime('-1 month'. $date3)));
|
$date1 = strtotime(Date($format, strtotime('-1 month' . $date3)));
|
||||||
|
|
||||||
$return = "";
|
$return = "";
|
||||||
$last = "";
|
$last = "";
|
||||||
for ( $i = $date1; $i <= $date2; $i = $i + 86400 ) {
|
for ($i = $date1; $i <= $date2; $i = $i + 86400) {
|
||||||
$thisDate = date( 'Y-m-d', $i );
|
$thisDate = date('Y-m-d', $i);
|
||||||
|
|
||||||
$created = \DB::table('tickets')->select('created_at')->where('created_at','LIKE','%'.$thisDate.'%')->count();
|
$created = \DB::table('tickets')->select('created_at')->where('created_at', 'LIKE', '%' . $thisDate . '%')->count();
|
||||||
$closed = \DB::table('tickets')->select('closed_at')->where('closed_at','LIKE','%'.$thisDate.'%')->count();
|
$closed = \DB::table('tickets')->select('closed_at')->where('closed_at', 'LIKE', '%' . $thisDate . '%')->count();
|
||||||
$reopened = \DB::table('tickets')->select('reopened_at')->where('reopened_at','LIKE','%'.$thisDate.'%')->count();
|
$reopened = \DB::table('tickets')->select('reopened_at')->where('reopened_at', 'LIKE', '%' . $thisDate . '%')->count();
|
||||||
|
|
||||||
$value = ['date' => $thisDate, 'open' => $created, 'closed' => $closed, 'reopened' => $reopened];
|
$value = ['date' => $thisDate, 'open' => $created, 'closed' => $closed, 'reopened' => $reopened];
|
||||||
$array = array_map('htmlentities',$value);
|
$array = array_map('htmlentities', $value);
|
||||||
$json = html_entity_decode(json_encode($array));
|
$json = html_entity_decode(json_encode($array));
|
||||||
$return .= $json.',';
|
$return .= $json . ',';
|
||||||
}
|
}
|
||||||
$last = rtrim($return,',');
|
$last = rtrim($return, ',');
|
||||||
|
|
||||||
return '['.$last.']';
|
|
||||||
|
|
||||||
|
return '[' . $last . ']';
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -1,4 +1,7 @@
|
|||||||
<?php namespace App\Http\Controllers\Installer\helpdesk;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Installer\helpdesk;
|
||||||
|
|
||||||
// controllers
|
// controllers
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
// requests
|
// requests
|
||||||
@@ -20,6 +23,7 @@ use Redirect;
|
|||||||
use Session;
|
use Session;
|
||||||
use View;
|
use View;
|
||||||
use Exception;
|
use Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* |=======================================================================
|
* |=======================================================================
|
||||||
* |Class: InstallController
|
* |Class: InstallController
|
||||||
@@ -34,15 +38,16 @@ use Exception;
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
class InstallController extends Controller {
|
class InstallController extends Controller {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get Licence (step 1)
|
* Get Licence (step 1)
|
||||||
* @return type view
|
* @return type view
|
||||||
*/
|
*/
|
||||||
public function licence() {
|
public function licence() {
|
||||||
// checking if the installation is running for the first time or not
|
// checking if the installation is running for the first time or not
|
||||||
if (Session::get('step5') == 'step5') {
|
// if (Session::get('step5') == 'step5') {
|
||||||
return Redirect::route('account');
|
// return Redirect::route('account');
|
||||||
}
|
// }
|
||||||
// checking if the installation is running for the first time or not
|
// checking if the installation is running for the first time or not
|
||||||
if (Config::get('database.install') == '%0%') {
|
if (Config::get('database.install') == '%0%') {
|
||||||
return view('themes/default1/installer/helpdesk/view1');
|
return view('themes/default1/installer/helpdesk/view1');
|
||||||
@@ -51,6 +56,7 @@ class InstallController extends Controller {
|
|||||||
return redirect('/auth/login');
|
return redirect('/auth/login');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Post Licencecheck
|
* Post Licencecheck
|
||||||
* @return type view
|
* @return type view
|
||||||
@@ -66,6 +72,7 @@ class InstallController extends Controller {
|
|||||||
}
|
}
|
||||||
// return 1;
|
// return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get prerequisites (step 2)
|
* Get prerequisites (step 2)
|
||||||
*
|
*
|
||||||
@@ -75,9 +82,9 @@ class InstallController extends Controller {
|
|||||||
*/
|
*/
|
||||||
public function prerequisites() {
|
public function prerequisites() {
|
||||||
// checking if the installation is running for the first time or not
|
// checking if the installation is running for the first time or not
|
||||||
if (Session::get('step5') == 'step5') {
|
// if (Session::get('step5') == 'step5') {
|
||||||
return Redirect::route('account');
|
// return Redirect::route('account');
|
||||||
}
|
// }
|
||||||
// checking if the installation is running for the first time or not
|
// checking if the installation is running for the first time or not
|
||||||
if (Config::get('database.install') == '%0%') {
|
if (Config::get('database.install') == '%0%') {
|
||||||
if (Session::get('step1') == 'step1') {
|
if (Session::get('step1') == 'step1') {
|
||||||
@@ -89,6 +96,7 @@ class InstallController extends Controller {
|
|||||||
return redirect('/auth/login');
|
return redirect('/auth/login');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Post Prerequisitescheck
|
* Post Prerequisitescheck
|
||||||
* checking prerequisites
|
* checking prerequisites
|
||||||
@@ -98,6 +106,7 @@ class InstallController extends Controller {
|
|||||||
Session::put('step2', 'step2');
|
Session::put('step2', 'step2');
|
||||||
return Redirect::route('configuration');
|
return Redirect::route('configuration');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get Localization (step 3)
|
* Get Localization (step 3)
|
||||||
* Requesting user recomended settings for installation
|
* Requesting user recomended settings for installation
|
||||||
@@ -105,9 +114,9 @@ class InstallController extends Controller {
|
|||||||
*/
|
*/
|
||||||
public function localization() {
|
public function localization() {
|
||||||
// checking if the installation is running for the first time or not
|
// checking if the installation is running for the first time or not
|
||||||
if (Session::get('step5') == 'step5') {
|
// if (Session::get('step5') == 'step5') {
|
||||||
return Redirect::route('account');
|
// return Redirect::route('account');
|
||||||
}
|
// }
|
||||||
// checking if the installation is running for the first time or not
|
// checking if the installation is running for the first time or not
|
||||||
if (Config::get('database.install') == '%0%') {
|
if (Config::get('database.install') == '%0%') {
|
||||||
if (Session::get('step2') == 'step2') {
|
if (Session::get('step2') == 'step2') {
|
||||||
@@ -119,19 +128,24 @@ class InstallController extends Controller {
|
|||||||
return redirect('/auth/login');
|
return redirect('/auth/login');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Post localizationcheck
|
* Post localizationcheck
|
||||||
* checking prerequisites
|
* checking prerequisites
|
||||||
* @return type view
|
* @return type view
|
||||||
*/
|
*/
|
||||||
public function localizationcheck() {
|
public function localizationcheck() {
|
||||||
|
|
||||||
Session::put('step3', 'step3');
|
Session::put('step3', 'step3');
|
||||||
|
|
||||||
Session::put('language', Input::get('language'));
|
Session::put('language', Input::get('language'));
|
||||||
Session::put('timezone', Input::get('timezone'));
|
Session::put('timezone', Input::get('timezone'));
|
||||||
Session::put('date', Input::get('date'));
|
Session::put('date', Input::get('date'));
|
||||||
Session::put('datetime', Input::get('datetime'));
|
Session::put('datetime', Input::get('datetime'));
|
||||||
|
|
||||||
return Redirect::route('configuration');
|
return Redirect::route('configuration');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get Configuration (step 4)
|
* Get Configuration (step 4)
|
||||||
* checking prerequisites
|
* checking prerequisites
|
||||||
@@ -139,9 +153,9 @@ class InstallController extends Controller {
|
|||||||
*/
|
*/
|
||||||
public function configuration() {
|
public function configuration() {
|
||||||
// checking if the installation is running for the first time or not
|
// checking if the installation is running for the first time or not
|
||||||
if (Session::get('step5') == 'step5') {
|
// if (Session::get('step5') == 'step5') {
|
||||||
return Redirect::route('account');
|
// return Redirect::route('account');
|
||||||
}
|
// }
|
||||||
// checking if the installation is running for the first time or not
|
// checking if the installation is running for the first time or not
|
||||||
if (Config::get('database.install') == '%0%') {
|
if (Config::get('database.install') == '%0%') {
|
||||||
if (Session::get('step2') == 'step2') {
|
if (Session::get('step2') == 'step2') {
|
||||||
@@ -153,21 +167,26 @@ class InstallController extends Controller {
|
|||||||
return redirect('/auth/login');
|
return redirect('/auth/login');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Post configurationcheck
|
* Post configurationcheck
|
||||||
* checking prerequisites
|
* checking prerequisites
|
||||||
* @return type view
|
* @return type view
|
||||||
*/
|
*/
|
||||||
public function configurationcheck() {
|
public function configurationcheck() {
|
||||||
|
|
||||||
Session::put('step4', 'step4');
|
Session::put('step4', 'step4');
|
||||||
|
|
||||||
Session::put('default', Input::get('default'));
|
Session::put('default', Input::get('default'));
|
||||||
Session::put('host', Input::get('host'));
|
Session::put('host', Input::get('host'));
|
||||||
Session::put('databasename', Input::get('databasename'));
|
Session::put('databasename', Input::get('databasename'));
|
||||||
Session::put('username', Input::get('username'));
|
Session::put('username', Input::get('username'));
|
||||||
Session::put('password', Input::get('password'));
|
Session::put('password', Input::get('password'));
|
||||||
Session::put('port', Input::get('port'));
|
Session::put('port', Input::get('port'));
|
||||||
|
|
||||||
return Redirect::route('database');
|
return Redirect::route('database');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* postconnection
|
* postconnection
|
||||||
* @return type view
|
* @return type view
|
||||||
@@ -180,6 +199,7 @@ class InstallController extends Controller {
|
|||||||
$dbusername = Input::get('username');
|
$dbusername = Input::get('username');
|
||||||
$dbpassword = Input::get('password');
|
$dbpassword = Input::get('password');
|
||||||
$port = Input::get('port');
|
$port = Input::get('port');
|
||||||
|
|
||||||
// Setting environment values
|
// Setting environment values
|
||||||
$_ENV['DB_TYPE'] = $default;
|
$_ENV['DB_TYPE'] = $default;
|
||||||
$_ENV['DB_HOST'] = $host;
|
$_ENV['DB_HOST'] = $host;
|
||||||
@@ -187,16 +207,19 @@ class InstallController extends Controller {
|
|||||||
$_ENV['DB_DATABASE'] = $database;
|
$_ENV['DB_DATABASE'] = $database;
|
||||||
$_ENV['DB_USERNAME'] = $dbusername;
|
$_ENV['DB_USERNAME'] = $dbusername;
|
||||||
$_ENV['DB_PASSWORD'] = $dbpassword;
|
$_ENV['DB_PASSWORD'] = $dbpassword;
|
||||||
|
|
||||||
$config = '';
|
$config = '';
|
||||||
foreach ($_ENV as $key => $val) {
|
foreach ($_ENV as $key => $val) {
|
||||||
$config .= "{$key}={$val}\n";
|
$config .= "{$key}={$val}\n";
|
||||||
}
|
}
|
||||||
// Write environment file
|
// Write environment file
|
||||||
$fp = fopen(base_path()."/.env", 'w');
|
$fp = fopen(base_path() . "/.env", 'w');
|
||||||
fwrite($fp, $config);
|
fwrite($fp, $config);
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get database
|
* Get database
|
||||||
* checking prerequisites
|
* checking prerequisites
|
||||||
@@ -214,6 +237,7 @@ class InstallController extends Controller {
|
|||||||
return redirect('/auth/login');
|
return redirect('/auth/login');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get account
|
* Get account
|
||||||
* checking prerequisites
|
* checking prerequisites
|
||||||
@@ -235,6 +259,7 @@ class InstallController extends Controller {
|
|||||||
return redirect('/auth/login');
|
return redirect('/auth/login');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Post accountcheck
|
* Post accountcheck
|
||||||
* checking prerequisites
|
* checking prerequisites
|
||||||
@@ -242,35 +267,44 @@ class InstallController extends Controller {
|
|||||||
* @return type view
|
* @return type view
|
||||||
*/
|
*/
|
||||||
public function accountcheck(InstallerRequest $request) {
|
public function accountcheck(InstallerRequest $request) {
|
||||||
|
|
||||||
// migrate database
|
// migrate database
|
||||||
Artisan::call('migrate', array('--force' => true));
|
Artisan::call('migrate', array('--force' => true));
|
||||||
Artisan::call('db:seed', array('--force' => true));
|
Artisan::call('db:seed', array('--force' => true));
|
||||||
|
|
||||||
// create user
|
// create user
|
||||||
$firstname = $request->input('firstname');
|
$firstname = $request->input('firstname');
|
||||||
$lastname = $request->input('Lastname');
|
$lastname = $request->input('Lastname');
|
||||||
$email = $request->input('email');
|
$email = $request->input('email');
|
||||||
$username = $request->input('username');
|
$username = $request->input('username');
|
||||||
$password = $request->input('password');
|
$password = $request->input('password');
|
||||||
|
|
||||||
$language = $request->input('language');
|
$language = $request->input('language');
|
||||||
$timezone = $request->input('timezone');
|
$timezone = $request->input('timezone');
|
||||||
$date = $request->input('date');
|
$date = $request->input('date');
|
||||||
$datetime = $request->input('datetime');
|
$datetime = $request->input('datetime');
|
||||||
|
|
||||||
|
|
||||||
|
//\Cache::forever('language', $language);
|
||||||
|
|
||||||
|
//\App::setLocale($language);
|
||||||
// $system = System::where('id','=','1')->first();
|
// $system = System::where('id','=','1')->first();
|
||||||
// $system->time_zone = $timezone;
|
// $system->time_zone = $timezone;
|
||||||
// $system->date_time_format = $datetime;
|
// $system->date_time_format = $datetime;
|
||||||
// $system->save();
|
// $system->save();
|
||||||
// checking requested timezone for the admin and system
|
// checking requested timezone for the admin and system
|
||||||
$timezones = Timezones::where('name','=',$timezone)->first();
|
$timezones = Timezones::where('name', '=', $timezone)->first();
|
||||||
if($timezones->id == null){
|
if ($timezones->id == null) {
|
||||||
return ['response'=>'fail','reason'=>'Invalid time-zone','status'=>'0'];
|
return ['response' => 'fail', 'reason' => 'Invalid time-zone', 'status' => '0'];
|
||||||
}
|
}
|
||||||
// var_dump($datetime);
|
// var_dump($datetime);
|
||||||
// checking requested date time format for the admin and system
|
// checking requested date time format for the admin and system
|
||||||
$date_time_format = Date_time_format::where('format','=',$datetime)->first();
|
$date_time_format = Date_time_format::where('format', '=', $datetime)->first();
|
||||||
// dd($date_time_format);
|
// dd($date_time_format);
|
||||||
if($date_time_format->id == null){
|
if ($date_time_format->id == null) {
|
||||||
return ['response'=>'fail','reason'=>'invalid date-time format','status'=>'0'];
|
return ['response' => 'fail', 'reason' => 'invalid date-time format', 'status' => '0'];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Creating minum settings for system
|
// Creating minum settings for system
|
||||||
$system = new System;
|
$system = new System;
|
||||||
$system->status = 1;
|
$system->status = 1;
|
||||||
@@ -278,6 +312,8 @@ class InstallController extends Controller {
|
|||||||
$system->date_time_format = $date_time_format->id;
|
$system->date_time_format = $date_time_format->id;
|
||||||
$system->time_zone = $timezones->id;
|
$system->time_zone = $timezones->id;
|
||||||
$system->save();
|
$system->save();
|
||||||
|
|
||||||
|
|
||||||
// creating an user
|
// creating an user
|
||||||
$user = User::create(array(
|
$user = User::create(array(
|
||||||
'first_name' => $firstname,
|
'first_name' => $firstname,
|
||||||
@@ -296,6 +332,7 @@ class InstallController extends Controller {
|
|||||||
return Redirect::route('final');
|
return Redirect::route('final');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get finalize
|
* Get finalize
|
||||||
* checking prerequisites
|
* checking prerequisites
|
||||||
@@ -311,11 +348,22 @@ class InstallController extends Controller {
|
|||||||
File::put($install, $datacontent);
|
File::put($install, $datacontent);
|
||||||
// setting email settings in route
|
// setting email settings in route
|
||||||
$smtpfilepath = "\App\Http\Controllers\Common\SettingsController::smtp()";
|
$smtpfilepath = "\App\Http\Controllers\Common\SettingsController::smtp()";
|
||||||
|
$lfmpath = "url('photos').'/'";
|
||||||
$path22 = app_path('Http/routes.php');
|
$path22 = app_path('Http/routes.php');
|
||||||
|
$path23 = base_path('config/lfm.php');
|
||||||
$content23 = File::get($path22);
|
$content23 = File::get($path22);
|
||||||
|
$content24 = File::get($path23);
|
||||||
$content23 = str_replace('"%smtplink%"', $smtpfilepath, $content23);
|
$content23 = str_replace('"%smtplink%"', $smtpfilepath, $content23);
|
||||||
|
$content24 = str_replace("'%url%'", $lfmpath, $content24);
|
||||||
File::put($path22, $content23);
|
File::put($path22, $content23);
|
||||||
|
File::put($path23, $content24);
|
||||||
try {
|
try {
|
||||||
|
Session::forget('step1');
|
||||||
|
Session::forget('step2');
|
||||||
|
Session::forget('step3');
|
||||||
|
Session::forget('step4');
|
||||||
|
Session::forget('step5');
|
||||||
|
Session::forget('step6');
|
||||||
return View::make('themes/default1/installer/helpdesk/view6');
|
return View::make('themes/default1/installer/helpdesk/view6');
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
return Redirect::route('npl');
|
return Redirect::route('npl');
|
||||||
@@ -324,6 +372,7 @@ class InstallController extends Controller {
|
|||||||
return redirect('/auth/login');
|
return redirect('/auth/login');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Post finalcheck
|
* Post finalcheck
|
||||||
* checking prerequisites
|
* checking prerequisites
|
||||||
@@ -336,4 +385,5 @@ class InstallController extends Controller {
|
|||||||
return redirect('/auth/login');
|
return redirect('/auth/login');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -1,119 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Http\Controllers;
|
|
||||||
|
|
||||||
use App\Http\Requests;
|
|
||||||
use App\Http\Controllers\Controller;
|
|
||||||
use Phpmailer\PHPMailerautoload;
|
|
||||||
use Illuminate\Http\Request;
|
|
||||||
|
|
||||||
class PhpMailController extends Controller {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Display a listing of the resource.
|
|
||||||
*
|
|
||||||
* @return Response
|
|
||||||
*/
|
|
||||||
public function index() {
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sending emails from the system.
|
|
||||||
*
|
|
||||||
* @return Mail
|
|
||||||
*/
|
|
||||||
public function sendmail($host = '', $username = '', $password = '', $smtpsecure = '', $port = '', $from = '', $recipants = '', $subject = '', $body = '', $cc = '', $bc = '') {
|
|
||||||
|
|
||||||
$mail = new \PHPMailer;
|
|
||||||
|
|
||||||
//$mail->SMTPDebug = 3; // Enable verbose debug output
|
|
||||||
|
|
||||||
$mail->isSMTP(); // Set mailer to use SMTP
|
|
||||||
$mail->Host = 'smtp.gmail.com'; // Specify main and backup SMTP servers
|
|
||||||
$mail->SMTPAuth = true; // Enable SMTP authentication
|
|
||||||
$mail->Username = 'sujitprasad4567@gmail.com'; // SMTP username
|
|
||||||
$mail->Password = 'pankajprasad22.'; // SMTP password
|
|
||||||
$mail->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted
|
|
||||||
$mail->Port = 587; // TCP port to connect to
|
|
||||||
|
|
||||||
$mail->setFrom('sujitprasad4567@gmail.com', 'Mailer');
|
|
||||||
$mail->addAddress('sada059@gmail.com', 'Joe User'); // Add a recipient
|
|
||||||
// Name is optional
|
|
||||||
$mail->addReplyTo('sada059@gmail.com', 'Information');
|
|
||||||
|
|
||||||
|
|
||||||
// Optional name
|
|
||||||
$mail->isHTML(true); // Set email format to HTML
|
|
||||||
|
|
||||||
$mail->Subject = 'Here is the subject';
|
|
||||||
$mail->Body = 'This is the HTML message body <b>in bold!</b>';
|
|
||||||
$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
|
|
||||||
|
|
||||||
if (!$mail->send()) {
|
|
||||||
echo 'Message could not be sent.';
|
|
||||||
echo 'Mailer Error: ' . $mail->ErrorInfo;
|
|
||||||
} else {
|
|
||||||
echo 'Message has been sent';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Show the form for creating a new resource.
|
|
||||||
*
|
|
||||||
* @return Response
|
|
||||||
*/
|
|
||||||
public function create() {
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Store a newly created resource in storage.
|
|
||||||
*
|
|
||||||
* @return Response
|
|
||||||
*/
|
|
||||||
public function store() {
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Display the specified resource.
|
|
||||||
*
|
|
||||||
* @param int $id
|
|
||||||
* @return Response
|
|
||||||
*/
|
|
||||||
public function show($id) {
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Show the form for editing the specified resource.
|
|
||||||
*
|
|
||||||
* @param int $id
|
|
||||||
* @return Response
|
|
||||||
*/
|
|
||||||
public function edit($id) {
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Update the specified resource in storage.
|
|
||||||
*
|
|
||||||
* @param int $id
|
|
||||||
* @return Response
|
|
||||||
*/
|
|
||||||
public function update($id) {
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Remove the specified resource from storage.
|
|
||||||
*
|
|
||||||
* @param int $id
|
|
||||||
* @return Response
|
|
||||||
*/
|
|
||||||
public function destroy($id) {
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@@ -1,4 +1,6 @@
|
|||||||
<?php namespace App\Http;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http;
|
||||||
|
|
||||||
use Illuminate\Foundation\Http\Kernel as HttpKernel;
|
use Illuminate\Foundation\Http\Kernel as HttpKernel;
|
||||||
|
|
||||||
@@ -36,6 +38,9 @@ class Kernel extends HttpKernel {
|
|||||||
'roles' => 'App\Http\Middleware\CheckRole',
|
'roles' => 'App\Http\Middleware\CheckRole',
|
||||||
'role.agent' => 'App\Http\Middleware\CheckRoleAgent',
|
'role.agent' => 'App\Http\Middleware\CheckRoleAgent',
|
||||||
'role.user' => 'App\Http\Middleware\CheckRoleUser',
|
'role.user' => 'App\Http\Middleware\CheckRoleUser',
|
||||||
|
'api' => 'App\Http\Middleware\ApiKey',
|
||||||
|
'jwt.auth' => \Tymon\JWTAuth\Middleware\GetUserFromToken::class,
|
||||||
|
'jwt.refresh' => \Tymon\JWTAuth\Middleware\RefreshToken::class
|
||||||
];
|
];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -1,4 +1,7 @@
|
|||||||
<?php namespace App\Http\Middleware;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Middleware;
|
||||||
|
|
||||||
use Closure;
|
use Closure;
|
||||||
use Illuminate\Contracts\Auth\Guard;
|
use Illuminate\Contracts\Auth\Guard;
|
||||||
|
|
||||||
|
@@ -1,4 +1,7 @@
|
|||||||
<?php namespace App\Http\Middleware;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Middleware;
|
||||||
|
|
||||||
use Closure;
|
use Closure;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -1,4 +1,7 @@
|
|||||||
<?php namespace App\Http\Middleware;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Middleware;
|
||||||
|
|
||||||
use Closure;
|
use Closure;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -1,4 +1,7 @@
|
|||||||
<?php namespace App\Http\Middleware;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Middleware;
|
||||||
|
|
||||||
use Closure;
|
use Closure;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -1,4 +1,6 @@
|
|||||||
<?php namespace App\Http\Middleware;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Middleware;
|
||||||
|
|
||||||
use Cache;
|
use Cache;
|
||||||
use Closure;
|
use Closure;
|
||||||
@@ -11,14 +13,14 @@ use Illuminate\Support\Facades\Config;
|
|||||||
use Illuminate\Support\Facades\Session;
|
use Illuminate\Support\Facades\Session;
|
||||||
|
|
||||||
class LanguageMiddleware implements Middleware {
|
class LanguageMiddleware implements Middleware {
|
||||||
public function handle($request, Closure $next)
|
|
||||||
{
|
public function handle($request, Closure $next) {
|
||||||
if (Cache::has('language') AND array_key_exists(Cache::get('language'), Config::get('languages'))) {
|
if (Cache::has('language') AND array_key_exists(Cache::get('language'), Config::get('languages'))) {
|
||||||
App::setLocale(Cache::get('language'));
|
App::setLocale(Cache::get('language'));
|
||||||
}
|
} else { // This is optional as Laravel will automatically set the fallback language if there is none specified
|
||||||
else { // This is optional as Laravel will automatically set the fallback language if there is none specified
|
|
||||||
App::setLocale(Config::get('app.fallback_locale'));
|
App::setLocale(Config::get('app.fallback_locale'));
|
||||||
}
|
}
|
||||||
return $next($request);
|
return $next($request);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@@ -1,4 +1,6 @@
|
|||||||
<?php namespace App\Http\Middleware;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Middleware;
|
||||||
|
|
||||||
use Closure;
|
use Closure;
|
||||||
use Illuminate\Contracts\Auth\Guard;
|
use Illuminate\Contracts\Auth\Guard;
|
||||||
|
@@ -1,4 +1,6 @@
|
|||||||
<?php namespace App\Http\Middleware;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Middleware;
|
||||||
|
|
||||||
use Closure;
|
use Closure;
|
||||||
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as BaseVerifier;
|
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as BaseVerifier;
|
||||||
|
@@ -1,9 +1,9 @@
|
|||||||
<?php namespace App\Http\Requests;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Requests;
|
||||||
|
|
||||||
use Illuminate\Foundation\Http\FormRequest;
|
use Illuminate\Foundation\Http\FormRequest;
|
||||||
|
|
||||||
abstract class Request extends FormRequest {
|
abstract class Request extends FormRequest {
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -1,4 +1,7 @@
|
|||||||
<?php namespace App\Http\Requests\helpdesk;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Requests\helpdesk;
|
||||||
|
|
||||||
use App\Http\Requests\Request;
|
use App\Http\Requests\Request;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -1,4 +1,7 @@
|
|||||||
<?php namespace App\Http\Requests\helpdesk;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Requests\helpdesk;
|
||||||
|
|
||||||
use App\Http\Requests\Request;
|
use App\Http\Requests\Request;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -1,4 +1,7 @@
|
|||||||
<?php namespace App\Http\Requests\helpdesk;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Requests\helpdesk;
|
||||||
|
|
||||||
use App\Http\Requests\Request;
|
use App\Http\Requests\Request;
|
||||||
|
|
||||||
class ArticleRequest extends Request {
|
class ArticleRequest extends Request {
|
||||||
|
@@ -1,4 +1,7 @@
|
|||||||
<?php namespace App\Http\Requests\helpdesk;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Requests\helpdesk;
|
||||||
|
|
||||||
use App\Http\Requests\Request;
|
use App\Http\Requests\Request;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -1,4 +1,7 @@
|
|||||||
<?php namespace App\Http\Requests\helpdesk;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Requests\helpdesk;
|
||||||
|
|
||||||
use App\Http\Requests\Request;
|
use App\Http\Requests\Request;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -1,4 +1,7 @@
|
|||||||
<?php namespace App\Http\Requests\helpdesk;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Requests\helpdesk;
|
||||||
|
|
||||||
use App\Http\Requests\Request;
|
use App\Http\Requests\Request;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -1,4 +1,7 @@
|
|||||||
<?php namespace App\Http\Requests\helpdesk;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Requests\helpdesk;
|
||||||
|
|
||||||
use App\Http\Requests\Request;
|
use App\Http\Requests\Request;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -1,4 +1,7 @@
|
|||||||
<?php namespace App\Http\Requests\helpdesk;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Requests\helpdesk;
|
||||||
|
|
||||||
use App\Http\Requests\Request;
|
use App\Http\Requests\Request;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -1,4 +1,7 @@
|
|||||||
<?php namespace App\Http\Requests\helpdesk;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Requests\helpdesk;
|
||||||
|
|
||||||
use App\Http\Requests\Request;
|
use App\Http\Requests\Request;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -25,10 +28,10 @@ class ClientRequest extends Request {
|
|||||||
*/
|
*/
|
||||||
public function rules() {
|
public function rules() {
|
||||||
return [
|
return [
|
||||||
'Name'=>'required',
|
'Name' => 'required',
|
||||||
'Email'=>'required',
|
'Email' => 'required',
|
||||||
'Subject'=>'required',
|
'Subject' => 'required',
|
||||||
'Details'=>'required',
|
'Details' => 'required',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,4 +1,7 @@
|
|||||||
<?php namespace App\Http\Requests\helpdesk;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Requests\helpdesk;
|
||||||
|
|
||||||
use App\Http\Requests\Request;
|
use App\Http\Requests\Request;
|
||||||
|
|
||||||
class CommentRequest extends Request {
|
class CommentRequest extends Request {
|
||||||
|
@@ -1,4 +1,7 @@
|
|||||||
<?php namespace App\Http\Requests\helpdesk;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Requests\helpdesk;
|
||||||
|
|
||||||
use App\Http\Requests\Request;
|
use App\Http\Requests\Request;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -1,4 +1,7 @@
|
|||||||
<?php namespace App\Http\Requests\helpdesk;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Requests\helpdesk;
|
||||||
|
|
||||||
use App\Http\Requests\Request;
|
use App\Http\Requests\Request;
|
||||||
|
|
||||||
class ContactRequest extends Request {
|
class ContactRequest extends Request {
|
||||||
|
@@ -1,4 +1,7 @@
|
|||||||
<?php namespace App\Http\Requests\helpdesk;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Requests\helpdesk;
|
||||||
|
|
||||||
use App\Http\Requests\Request;
|
use App\Http\Requests\Request;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -1,4 +1,7 @@
|
|||||||
<?php namespace App\Http\Requests\helpdesk;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Requests\helpdesk;
|
||||||
|
|
||||||
use App\Http\Requests\Request;
|
use App\Http\Requests\Request;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -1,4 +1,7 @@
|
|||||||
<?php namespace App\Http\Requests\helpdesk;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Requests\helpdesk;
|
||||||
|
|
||||||
use App\Http\Requests\Request;
|
use App\Http\Requests\Request;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -1,4 +1,7 @@
|
|||||||
<?php namespace App\Http\Requests\helpdesk;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Requests\helpdesk;
|
||||||
|
|
||||||
use App\Http\Requests\Request;
|
use App\Http\Requests\Request;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -1,4 +1,7 @@
|
|||||||
<?php namespace App\Http\Requests\helpdesk;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Requests\helpdesk;
|
||||||
|
|
||||||
use App\Http\Requests\Request;
|
use App\Http\Requests\Request;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -1,4 +1,7 @@
|
|||||||
<?php namespace App\Http\Requests\helpdesk;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Requests\helpdesk;
|
||||||
|
|
||||||
use App\Http\Requests\Request;
|
use App\Http\Requests\Request;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -27,9 +30,9 @@ class EmailsEditRequest extends Request {
|
|||||||
return [
|
return [
|
||||||
'email_address' => 'email',
|
'email_address' => 'email',
|
||||||
'email_name' => 'required',
|
'email_name' => 'required',
|
||||||
'department' => 'required',
|
// 'department' => 'required',
|
||||||
'priority' => 'required',
|
// 'priority' => 'required',
|
||||||
'help_topic' => 'required',
|
// 'help_topic' => 'required',
|
||||||
// 'imap_config' => 'required',
|
// 'imap_config' => 'required',
|
||||||
'password' => 'required|min:6',
|
'password' => 'required|min:6',
|
||||||
// 'user_name' => 'required',
|
// 'user_name' => 'required',
|
||||||
|
@@ -1,4 +1,7 @@
|
|||||||
<?php namespace App\Http\Requests\helpdesk;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Requests\helpdesk;
|
||||||
|
|
||||||
use App\Http\Requests\Request;
|
use App\Http\Requests\Request;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -27,9 +30,9 @@ class EmailsRequest extends Request {
|
|||||||
return [
|
return [
|
||||||
'email_address' => 'required|email|unique:emails',
|
'email_address' => 'required|email|unique:emails',
|
||||||
'email_name' => 'required',
|
'email_name' => 'required',
|
||||||
'department' => 'required',
|
// 'department' => 'required',
|
||||||
'priority' => 'required',
|
// 'priority' => 'required',
|
||||||
'help_topic' => 'required',
|
// 'help_topic' => 'required',
|
||||||
// 'imap_config' => 'required',
|
// 'imap_config' => 'required',
|
||||||
'password' => 'required|min:6',
|
'password' => 'required|min:6',
|
||||||
// 'user_name' => 'required',
|
// 'user_name' => 'required',
|
||||||
|
@@ -1,4 +1,7 @@
|
|||||||
<?php namespace App\Http\Requests\helpdesk;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Requests\helpdesk;
|
||||||
|
|
||||||
use App\Http\Requests\Request;
|
use App\Http\Requests\Request;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -1,4 +1,7 @@
|
|||||||
<?php namespace App\Http\Requests\helpdesk;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Requests\helpdesk;
|
||||||
|
|
||||||
use App\Http\Requests\Request;
|
use App\Http\Requests\Request;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -1,4 +1,7 @@
|
|||||||
<?php namespace App\Http\Requests\helpdesk;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Requests\helpdesk;
|
||||||
|
|
||||||
use App\Http\Requests\Request;
|
use App\Http\Requests\Request;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -1,4 +1,7 @@
|
|||||||
<?php namespace App\Http\Requests\helpdesk;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Requests\helpdesk;
|
||||||
|
|
||||||
use App\Http\Requests\Request;
|
use App\Http\Requests\Request;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -1,4 +1,7 @@
|
|||||||
<?php namespace App\Http\Requests\helpdesk;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Requests\helpdesk;
|
||||||
|
|
||||||
use App\Http\Requests\Request;
|
use App\Http\Requests\Request;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -1,4 +1,7 @@
|
|||||||
<?php namespace App\Http\Requests\helpdesk;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Requests\helpdesk;
|
||||||
|
|
||||||
use App\Http\Requests\Request;
|
use App\Http\Requests\Request;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -1,4 +1,6 @@
|
|||||||
<?php namespace App\Http\Requests\helpdesk;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Requests\helpdesk;
|
||||||
|
|
||||||
use App\Http\Requests\Request;
|
use App\Http\Requests\Request;
|
||||||
|
|
||||||
@@ -9,8 +11,7 @@ class MessageRequest extends Request {
|
|||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function authorize()
|
public function authorize() {
|
||||||
{
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -19,14 +20,12 @@ class MessageRequest extends Request {
|
|||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function rules()
|
public function rules() {
|
||||||
{
|
|
||||||
return [
|
return [
|
||||||
|
|
||||||
|
|
||||||
'message_title' => 'required',
|
'message_title' => 'required',
|
||||||
'message' => 'required'
|
'message' => 'required'
|
||||||
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,4 +1,7 @@
|
|||||||
<?php namespace App\Http\Requests\helpdesk;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Requests\helpdesk;
|
||||||
|
|
||||||
use App\Http\Requests\Request;
|
use App\Http\Requests\Request;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -1,4 +1,7 @@
|
|||||||
<?php namespace App\Http\Requests\helpdesk;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Requests\helpdesk;
|
||||||
|
|
||||||
use App\Http\Requests\Request;
|
use App\Http\Requests\Request;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -1,4 +1,7 @@
|
|||||||
<?php namespace App\Http\Requests\helpdesk;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Requests\helpdesk;
|
||||||
|
|
||||||
use App\Http\Requests\Request;
|
use App\Http\Requests\Request;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -1,4 +1,7 @@
|
|||||||
<?php namespace App\Http\Requests\helpdesk;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Requests\helpdesk;
|
||||||
|
|
||||||
use App\Http\Requests\Request;
|
use App\Http\Requests\Request;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -1,4 +1,7 @@
|
|||||||
<?php namespace App\Http\Requests\helpdesk;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Requests\helpdesk;
|
||||||
|
|
||||||
use App\Http\Requests\Request;
|
use App\Http\Requests\Request;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -1,4 +1,7 @@
|
|||||||
<?php namespace App\Http\Requests\helpdesk;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Requests\helpdesk;
|
||||||
|
|
||||||
use App\Http\Requests\Request;
|
use App\Http\Requests\Request;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -1,4 +1,7 @@
|
|||||||
<?php namespace App\Http\Requests\helpdesk;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Requests\helpdesk;
|
||||||
|
|
||||||
use App\Http\Requests\Request;
|
use App\Http\Requests\Request;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -1,4 +1,7 @@
|
|||||||
<?php namespace App\Http\Requests\helpdesk;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Requests\helpdesk;
|
||||||
|
|
||||||
use App\Http\Requests\Request;
|
use App\Http\Requests\Request;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -1,4 +1,7 @@
|
|||||||
<?php namespace App\Http\Requests\helpdesk;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Requests\helpdesk;
|
||||||
|
|
||||||
use App\Http\Requests\Request;
|
use App\Http\Requests\Request;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -1,4 +1,7 @@
|
|||||||
<?php namespace App\Http\Requests\helpdesk;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Requests\helpdesk;
|
||||||
|
|
||||||
use App\Http\Requests\Request;
|
use App\Http\Requests\Request;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -1,4 +1,7 @@
|
|||||||
<?php namespace App\Http\Requests\helpdesk;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Requests\helpdesk;
|
||||||
|
|
||||||
use App\Http\Requests\Request;
|
use App\Http\Requests\Request;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -1,4 +1,7 @@
|
|||||||
<?php namespace App\Http\Requests\helpdesk;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Requests\helpdesk;
|
||||||
|
|
||||||
use App\Http\Requests\Request;
|
use App\Http\Requests\Request;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -1,4 +1,7 @@
|
|||||||
<?php namespace App\Http\Requests\helpdesk;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Requests\helpdesk;
|
||||||
|
|
||||||
use App\Http\Requests\Request;
|
use App\Http\Requests\Request;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user