update for version 1.0.1
This commit is contained in:
7
code/app/Commands/Command.php
Normal file
7
code/app/Commands/Command.php
Normal file
@@ -0,0 +1,7 @@
|
||||
<?php namespace App\Commands;
|
||||
|
||||
abstract class Command {
|
||||
|
||||
//
|
||||
|
||||
}
|
||||
32
code/app/Console/Commands/Inspire.php
Normal file
32
code/app/Console/Commands/Inspire.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php namespace App\Console\Commands;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Foundation\Inspiring;
|
||||
|
||||
class Inspire extends Command {
|
||||
|
||||
/**
|
||||
* The console command name.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $name = 'inspire';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Display an inspiring quote';
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$this->comment(PHP_EOL.Inspiring::quote().PHP_EOL);
|
||||
}
|
||||
|
||||
}
|
||||
37
code/app/Console/Kernel.php
Normal file
37
code/app/Console/Kernel.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php namespace App\Console;
|
||||
|
||||
use Illuminate\Console\Scheduling\Schedule;
|
||||
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
|
||||
|
||||
class Kernel extends ConsoleKernel {
|
||||
|
||||
/**
|
||||
* The Artisan commands provided by your application.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $commands = [
|
||||
'App\Console\Commands\Inspire',
|
||||
];
|
||||
|
||||
/**
|
||||
* Define the application's command schedule.
|
||||
*
|
||||
* @param \Illuminate\Console\Scheduling\Schedule $schedule
|
||||
* @return void
|
||||
*/
|
||||
protected function schedule(Schedule $schedule)
|
||||
{
|
||||
$schedule->command('inspire')
|
||||
->hourly();
|
||||
|
||||
$schedule->call(function () {
|
||||
|
||||
$user = new User;
|
||||
$user->save();
|
||||
|
||||
})->everyFiveMinutes();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
7
code/app/Events/Event.php
Normal file
7
code/app/Events/Event.php
Normal file
@@ -0,0 +1,7 @@
|
||||
<?php namespace App\Events;
|
||||
|
||||
abstract class Event {
|
||||
|
||||
//
|
||||
|
||||
}
|
||||
94
code/app/Exceptions/Handler.php
Normal file
94
code/app/Exceptions/Handler.php
Normal file
@@ -0,0 +1,94 @@
|
||||
<?php namespace App\Exceptions;
|
||||
|
||||
use Exception;
|
||||
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
|
||||
// use App\Http\Controllers\Common\SettingsController;
|
||||
//use App\Model\helpdesk\Email\Smtp;
|
||||
|
||||
class Handler extends ExceptionHandler {
|
||||
|
||||
/**
|
||||
* A list of the exception types that should not be reported.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $dontReport = [
|
||||
'Symfony\Component\HttpKernel\Exception\HttpException'
|
||||
];
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
* @return type response
|
||||
*/
|
||||
// public function __construct() {
|
||||
// SettingsController::smtp();
|
||||
// }
|
||||
|
||||
/**
|
||||
* Report or log an exception.
|
||||
*
|
||||
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
|
||||
*
|
||||
* @param \Exception $e
|
||||
* @return void
|
||||
*/
|
||||
public function report(Exception $e)
|
||||
{
|
||||
return parent::report($e);
|
||||
}
|
||||
|
||||
/**
|
||||
* Render an exception into an HTTP response.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Exception $e
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function render($request, Exception $e)
|
||||
{
|
||||
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('');
|
||||
// });
|
||||
// }
|
||||
}
|
||||
return response()->view('errors.500', []);
|
||||
}
|
||||
return parent::render($request, $e);
|
||||
|
||||
// if ($this->isHttpException($e))
|
||||
// {
|
||||
// return $this->renderHttpException($e);
|
||||
// }
|
||||
|
||||
|
||||
// if (config('app.debug'))
|
||||
// {
|
||||
// return $this->renderExceptionWithWhoops($e);
|
||||
// }
|
||||
|
||||
// return parent::render($request, $e);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
// protected function renderExceptionWithWhoops(Exception $e)
|
||||
// {
|
||||
// $whoops = new \Whoops\Run;
|
||||
// $whoops->pushHandler(new \Whoops\Handler\PrettyPageHandler());
|
||||
|
||||
// return new \Illuminate\Http\Response(
|
||||
// $whoops->handleException($e),
|
||||
// $e->getStatusCode(),
|
||||
// $e->getHeaders()
|
||||
// );
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
0
code/app/Handlers/Commands/.gitkeep
Normal file
0
code/app/Handlers/Commands/.gitkeep
Normal file
0
code/app/Handlers/Events/.gitkeep
Normal file
0
code/app/Handlers/Events/.gitkeep
Normal file
244
code/app/Http/Controllers/Admin/helpdesk/AgentController.php
Normal file
244
code/app/Http/Controllers/Admin/helpdesk/AgentController.php
Normal file
@@ -0,0 +1,244 @@
|
||||
<?php namespace App\Http\Controllers\Admin\helpdesk;
|
||||
// controller
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Controllers\Common\SettingsController;
|
||||
// request
|
||||
use App\Http\Requests\helpdesk\AgentRequest;
|
||||
use App\Http\Requests\helpdesk\AgentUpdate;
|
||||
// model
|
||||
use App\User;
|
||||
use App\Model\helpdesk\Agent\Assign_team_agent;
|
||||
use App\Model\helpdesk\Agent\Department;
|
||||
use App\Model\helpdesk\Agent\Groups;
|
||||
use App\Model\helpdesk\Agent\Teams;
|
||||
use App\Model\helpdesk\Utility\Timezones;
|
||||
use App\Model\helpdesk\Settings\Company;
|
||||
// classes
|
||||
use DB;
|
||||
use Mail;
|
||||
use Hash;
|
||||
|
||||
/**
|
||||
* AgentController
|
||||
*
|
||||
* @package Controllers
|
||||
* @subpackage Controller
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class AgentController extends Controller {
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
* @return Response
|
||||
*/
|
||||
public function __construct() {
|
||||
SettingsController::smtp();
|
||||
$this->middleware('auth');
|
||||
$this->middleware('roles');
|
||||
}
|
||||
|
||||
/**
|
||||
* get index page
|
||||
* @param type User $user
|
||||
* @return type Response
|
||||
*/
|
||||
public function index() {
|
||||
try {
|
||||
return view('themes.default1.admin.helpdesk.agent.agents.index');
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
* @param type Assign_team_agent $team_assign_agent
|
||||
* @param type Timezones $timezone
|
||||
* @param type Groups $group
|
||||
* @param type Department $department
|
||||
* @param type Teams $team
|
||||
* @return type Response
|
||||
*/
|
||||
public function create(Assign_team_agent $team_assign_agent, Timezones $timezone, Groups $group, Department $department, Teams $team) {
|
||||
try {
|
||||
$team = $team->get();
|
||||
$timezones = $timezone->get();
|
||||
$groups = $group->get();
|
||||
$departments = $department->get();
|
||||
$teams = $team->lists('id', 'name');
|
||||
return view('themes.default1.admin.helpdesk.agent.agents.create', compact('assign', 'teams', 'agents', 'timezones', 'groups', 'departments', 'team'));
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
* @param type User $user
|
||||
* @param type AgentRequest $request
|
||||
* @param type Assign_team_agent $team_assign_agent
|
||||
* @return type Response
|
||||
*/
|
||||
public function store(User $user, AgentRequest $request, Assign_team_agent $team_assign_agent) {
|
||||
try {
|
||||
/* Insert to user table */
|
||||
$user->role = 'agent';
|
||||
$user->fill($request->input())->save();
|
||||
$password = $this->generateRandomString();
|
||||
$user->password = Hash::make($password);
|
||||
$requests = $request->input('team_id');
|
||||
$id = $user->id;
|
||||
foreach ($requests as $req) {
|
||||
DB::insert('insert into team_assign_agent (team_id, agent_id) values (?,?)', [$req, $id]);
|
||||
}
|
||||
/* Succes And Failure condition */
|
||||
if ($user->save() == true) {
|
||||
$name = $user->user_name;
|
||||
$email = $user->email;
|
||||
$from = $this->company();
|
||||
Mail::send('emails.pass', ['name' => $name, 'password' => $password, 'from' => $from], function ($message) use ($email, $name) {
|
||||
$message->to($email, $name)->subject('[password]');
|
||||
});
|
||||
return redirect('agents')->with('success', 'Agent Created sucessfully');
|
||||
} else {
|
||||
return redirect('agents')->with('fails', 'Agent can not Create');
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
return redirect('agents')->with('fails', 'Agent can not Create');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function show($id) {
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
* @param type int $id
|
||||
* @param type User $user
|
||||
* @param type Assign_team_agent $team_assign_agent
|
||||
* @param type Timezones $timezone
|
||||
* @param type Groups $group
|
||||
* @param type Department $department
|
||||
* @param type Teams $team
|
||||
* @return type Response
|
||||
*/
|
||||
public function edit($id, User $user, Assign_team_agent $team_assign_agent, Timezones $timezone, Groups $group, Department $department, Teams $team) {
|
||||
try {
|
||||
$user = $user->whereId($id)->first();
|
||||
$team = $team->get();
|
||||
$teams1 = $team->lists('name', 'id');
|
||||
$timezones = $timezone->get();
|
||||
$groups = $group->get();
|
||||
$departments = $department->get();
|
||||
$table = $team_assign_agent->where('agent_id', $id)->first();
|
||||
$teams = $team->lists('id', 'name');
|
||||
$assign = $team_assign_agent->where('agent_id', $id)->lists('team_id');
|
||||
return view('themes.default1.admin.helpdesk.agent.agents.edit', compact('teams', 'assign', 'table', 'teams1', 'selectedTeams', 'user', 'timezones', 'groups', 'departments', 'team', 'exp', 'counted'));
|
||||
} catch (Exception $e) {
|
||||
return redirect('agents')->with('fail', 'No such file');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
* @param type int $id
|
||||
* @param type User $user
|
||||
* @param type AgentUpdate $request
|
||||
* @param type Assign_team_agent $team_assign_agent
|
||||
* @return type Response
|
||||
*/
|
||||
public function update($id, User $user, AgentUpdate $request, Assign_team_agent $team_assign_agent) {
|
||||
try {
|
||||
$user = $user->whereId($id)->first();
|
||||
$daylight_save = $request->input('daylight_save');
|
||||
$limit_access = $request->input('limit_access');
|
||||
$directory_listing = $request->input('directory_listing');
|
||||
$vocation_mode = $request->input('vocation_mode');
|
||||
//==============================================
|
||||
$user->daylight_save = $daylight_save;
|
||||
$user->limit_access = $limit_access;
|
||||
$user->directory_listing = $directory_listing;
|
||||
$user->vocation_mode = $vocation_mode;
|
||||
//==============================================
|
||||
$table = $team_assign_agent->where('agent_id', $id);
|
||||
$table->delete();
|
||||
$requests = $request->input('team_id');
|
||||
foreach ($requests as $req) {
|
||||
DB::insert('insert into team_assign_agent (team_id, agent_id) values (?,?)', [$req, $id]);
|
||||
}
|
||||
//Todo For success and failure conditions
|
||||
$user->fill($request->except('daylight_save', 'limit_access', 'directory_listing', 'vocation_mode', 'assign_team'))->save();
|
||||
return redirect('agents')->with('success', 'Agent Updated sucessfully');
|
||||
} catch (Exception $e) {
|
||||
return redirect('agents')->with('fails', 'Agent did not update');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
* @param type int $id
|
||||
* @param type User $user
|
||||
* @param type Assign_team_agent $team_assign_agent
|
||||
* @return type Response
|
||||
*/
|
||||
public function destroy($id, User $user, Assign_team_agent $team_assign_agent) {
|
||||
try {
|
||||
/* Becouse of foreign key we delete team_assign_agent first */
|
||||
$team_assign_agent = $team_assign_agent->where('agent_id', $id);
|
||||
$team_assign_agent->delete();
|
||||
$user = $user->whereId($id)->first();
|
||||
if ($user->delete()) {
|
||||
return redirect('agents')->with('success', 'Agent Deleted sucessfully');
|
||||
} else {
|
||||
return redirect('agents')->with('fails', 'Agent can not Delete ');
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
return redirect('agents')->with('fails', 'Agent can not Delete if the team Excist');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Generate a random string for password
|
||||
* @param type $length
|
||||
* @return type string
|
||||
*/
|
||||
public function generateRandomString($length = 10) {
|
||||
$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
|
||||
$charactersLength = strlen($characters);
|
||||
$randomString = '';
|
||||
for ($i = 0; $i < $length; $i++) {
|
||||
$randomString .= $characters[rand(0, $charactersLength - 1)];
|
||||
}
|
||||
return $randomString;
|
||||
}
|
||||
|
||||
/**
|
||||
* company
|
||||
* @return type
|
||||
*/
|
||||
public function company()
|
||||
{
|
||||
$company = Company::Where('id','=','1')->first();
|
||||
if($company->company_name == null){
|
||||
$company = "Support Center";
|
||||
}else{
|
||||
$company = $company->company_name;
|
||||
}
|
||||
return $company;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function agent_profile($id) {
|
||||
$agent = User::where('id','=',$id)->first();
|
||||
return \View::make('themes.default1.admin.helpdesk.agent.agents.agent-profile',compact('agent'));
|
||||
}
|
||||
|
||||
}
|
||||
152
code/app/Http/Controllers/Admin/helpdesk/BanlistController.php
Normal file
152
code/app/Http/Controllers/Admin/helpdesk/BanlistController.php
Normal file
@@ -0,0 +1,152 @@
|
||||
<?php namespace App\Http\Controllers\Admin\helpdesk;
|
||||
// controller
|
||||
use App\Http\Controllers\Controller;
|
||||
// request
|
||||
use App\Http\Requests\helpdesk\BanlistRequest;
|
||||
use App\Http\Requests\helpdesk\BanRequest;
|
||||
// model
|
||||
use App\User;
|
||||
|
||||
/**
|
||||
* BanlistController
|
||||
*
|
||||
* @package Controllers
|
||||
* @subpackage Controller
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class BanlistController extends Controller {
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
* @return type void
|
||||
*/
|
||||
public function __construct() {
|
||||
$this->middleware('auth');
|
||||
$this->middleware('roles');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
* @param type Banlist $ban
|
||||
* @return type Response
|
||||
*/
|
||||
public function index() {
|
||||
try {
|
||||
$bans = User::where('ban','=',1)->get();
|
||||
return view('themes.default1.admin.helpdesk.emails.banlist.index', compact('bans'));
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
* @return type Response
|
||||
*/
|
||||
public function create() {
|
||||
try {
|
||||
return view('themes.default1.admin.helpdesk.emails.banlist.create');
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
* @param type banlist $ban
|
||||
* @param type BanRequest $request
|
||||
* @param type User $user
|
||||
* @return type Response
|
||||
*/
|
||||
public function store(BanRequest $request, User $user) {
|
||||
// try {
|
||||
//adding field to user whether it is banned or not
|
||||
$adban = $request->input('email');
|
||||
$use = $user->where('email', $adban)->first();
|
||||
if ($use != null) {
|
||||
$use->ban = $request->input('ban_status');
|
||||
$use->internal_note = $request->input('internal_note');
|
||||
$use->save();
|
||||
// $user->create($request->input())->save();
|
||||
return redirect()->back()->with('success', 'Email Banned sucessfully');
|
||||
} else {
|
||||
$user = new User;
|
||||
$user->email = $adban;
|
||||
$user->ban = $request->input('ban_status');
|
||||
$user->internal_note = $request->input('internal_note');
|
||||
$user->save();
|
||||
return redirect()->back()->with('success', 'Email Banned sucessfully');
|
||||
}
|
||||
// } catch (Exception $e) {
|
||||
// return redirect('banlist')->with('fails', 'Email can not Ban');
|
||||
// }
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function show($id) {
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
* @param type int $id
|
||||
* @param type Banlist $ban
|
||||
* @return type Response
|
||||
*/
|
||||
public function edit($id, User $ban) {
|
||||
try {
|
||||
$bans = $ban->whereId($id)->first();
|
||||
return view('themes.default1.admin.helpdesk.emails.banlist.edit', compact('bans'));
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
* @param type int $id
|
||||
* @param type Banlist $ban
|
||||
* @param type BanlistRequest $request
|
||||
* @return type Response
|
||||
*/
|
||||
public function update($id, User $ban, BanlistRequest $request) {
|
||||
try {
|
||||
$bans = $ban->whereId($id)->first();
|
||||
$bans->internal_note = $request->input('internal_note');
|
||||
$bans->ban = $request->input('ban');
|
||||
// dd($request->input('ban'));
|
||||
if ($bans->save()) {
|
||||
return redirect('banlist')->with('success', 'Banned Email Updated sucessfully');
|
||||
} else {
|
||||
return redirect('banlist')->with('fails', 'Banned Email not Updated');
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
return redirect('banlist')->with('fails', 'Banned Email not Updated');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
* @param type int $id
|
||||
* @param type Banlist $ban
|
||||
* @return type Response
|
||||
*/
|
||||
public function destroy($id, Banlist $ban) {
|
||||
try {
|
||||
$bans = $ban->whereId($id)->first();
|
||||
/* Success and Falure condition */
|
||||
if ($bans->delete() == true) {
|
||||
return redirect('banlist')->with('success', 'Banned Email Deleted sucessfully');
|
||||
} else {
|
||||
return redirect('banlist')->with('fails', 'Banned Email can not Delete');
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
return redirect('banlist')->with('fails', 'Banned Email can not Delete');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,191 @@
|
||||
<?php namespace App\Http\Controllers\Admin\helpdesk;
|
||||
// controller
|
||||
use App\Http\Controllers\Controller;
|
||||
// request
|
||||
use App\Http\Requests\helpdesk\DepartmentRequest;
|
||||
use App\Http\Requests\helpdesk\DepartmentUpdate;
|
||||
// model
|
||||
use App\Model\helpdesk\Agent\Department;
|
||||
use App\Model\helpdesk\Agent\Groups;
|
||||
use App\Model\helpdesk\Agent\Group_assign_department;
|
||||
use App\Model\helpdesk\Agent\Teams;
|
||||
use App\Model\helpdesk\Email\Emails;
|
||||
use App\Model\helpdesk\Email\Template;
|
||||
use App\Model\helpdesk\Manage\Sla_plan;
|
||||
use App\User;
|
||||
// classes
|
||||
use DB;
|
||||
|
||||
/**
|
||||
* DepartmentController
|
||||
*
|
||||
* @package Controllers
|
||||
* @subpackage Controller
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class DepartmentController extends Controller {
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
* @return void
|
||||
*/
|
||||
public function __construct() {
|
||||
$this->middleware('auth');
|
||||
$this->middleware('roles');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get index page
|
||||
* @param type Department $department
|
||||
* @return type Response
|
||||
*/
|
||||
public function index(Department $department) {
|
||||
try {
|
||||
$departments = $department->get();
|
||||
return view('themes.default1.admin.helpdesk.agent.departments.index', compact('departments'));
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
* @param type User $user
|
||||
* @param type Group_assign_department $group_assign_department
|
||||
* @param type Department $department
|
||||
* @param type Sla_plan $sla
|
||||
* @param type Template $template
|
||||
* @param type Emails $email
|
||||
* @param type Groups $group
|
||||
* @return type Response
|
||||
*/
|
||||
public function create(User $user, Group_assign_department $group_assign_department, Department $department, Sla_plan $sla, Template $template, Emails $email, Groups $group) {
|
||||
try {
|
||||
$slas = $sla->get();
|
||||
$user = $user->where('role', 'agent')->get();
|
||||
$emails = $email->get();
|
||||
$templates = $template->get();
|
||||
$department = $department->get();
|
||||
$groups = $group->lists('id', 'name');
|
||||
return view('themes.default1.admin.helpdesk.agent.departments.create', compact('department', 'templates', 'slas', 'user', 'emails', 'groups'));
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
* @param type Department $department
|
||||
* @param type DepartmentRequest $request
|
||||
* @return type Response
|
||||
*/
|
||||
public function store(Department $department, DepartmentRequest $request) {
|
||||
try {
|
||||
$department->fill($request->except('group_id'))->save();
|
||||
$requests = $request->input('group_id');
|
||||
$id = $department->id;
|
||||
// foreach ($requests as $req) {
|
||||
// DB::insert('insert into group_assign_department(group_id, department_id) values (?,?)', [$req, $id]);
|
||||
// }
|
||||
/* Succes And Failure condition */
|
||||
/* Check Whether the function Success or Fail */
|
||||
if ($department->save() == true) {
|
||||
return redirect('departments')->with('success', 'Department Created sucessfully');
|
||||
} else {
|
||||
return redirect('departments')->with('fails', 'Department can not Create');
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
return redirect('departments')->with('fails', 'Department can not Create');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function show($id) {
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
* @param type int $id
|
||||
* @param type User $user
|
||||
* @param type Group_assign_department $group_assign_department
|
||||
* @param type Template $template
|
||||
* @param type Teams $team
|
||||
* @param type Department $department
|
||||
* @param type Sla_plan $sla
|
||||
* @param type Emails $email
|
||||
* @param type Groups $group
|
||||
* @return type Response
|
||||
*/
|
||||
public function edit($id, User $user, Group_assign_department $group_assign_department, Template $template, Teams $team, Department $department, Sla_plan $sla, Emails $email, Groups $group) {
|
||||
try {
|
||||
$slas = $sla->get();
|
||||
$user = $user->where('role', 'agent')->get();
|
||||
$emails = $email->get();
|
||||
$templates = $template->get();
|
||||
$departments = $department->whereId($id)->first();
|
||||
$groups = $group->lists('id', 'name');
|
||||
$assign = $group_assign_department->where('department_id', $id)->lists('group_id');
|
||||
return view('themes.default1.admin.helpdesk.agent.departments.edit', compact('assign', 'team', 'templates', 'departments', 'slas', 'user', 'emails', 'groups'));
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
* @param type int $id
|
||||
* @param type Group_assign_department $group_assign_department
|
||||
* @param type Department $department
|
||||
* @param type DepartmentUpdate $request
|
||||
* @return type Response
|
||||
*/
|
||||
public function update($id, Group_assign_department $group_assign_department, Department $department, DepartmentUpdate $request) {
|
||||
try {
|
||||
$table = $group_assign_department->where('department_id', $id);
|
||||
$table->delete();
|
||||
$requests = $request->input('group_id');
|
||||
// foreach ($requests as $req) {
|
||||
// DB::insert('insert into group_assign_department (group_id, department_id) values (?,?)', [$req, $id]);
|
||||
// }
|
||||
$departments = $department->whereId($id)->first();
|
||||
if ($departments->fill($request->except('group_access'))->save()) {
|
||||
return redirect('departments')->with('success', 'Department Updated sucessfully');
|
||||
} else {
|
||||
return redirect('departments')->with('fails', 'Department not Updated');
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
return redirect('departments')->with('fails', 'Department not Updated');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
* @param type int $id
|
||||
* @param type Department $department
|
||||
* @param type Group_assign_department $group_assign_department
|
||||
* @return type Response
|
||||
*/
|
||||
public function destroy($id, Department $department, Group_assign_department $group_assign_department) {
|
||||
try {
|
||||
/* Becouse of foreign key we delete group_assign_department first */
|
||||
$group_assign_department = $group_assign_department->where('department_id', $id);
|
||||
$group_assign_department->delete();
|
||||
$departments = $department->whereId($id)->first();
|
||||
/* Check the function is Success or Fail */
|
||||
if ($departments->delete() == true) {
|
||||
return redirect('departments')->with('success', 'Department Deleted sucessfully');
|
||||
} else {
|
||||
return redirect('departments')->with('fails', 'Department can not Delete');
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
return redirect('departments')->with('fails', 'Department can not Delete');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
164
code/app/Http/Controllers/Admin/helpdesk/EmailsController.php
Normal file
164
code/app/Http/Controllers/Admin/helpdesk/EmailsController.php
Normal file
@@ -0,0 +1,164 @@
|
||||
<?php namespace App\Http\Controllers\Admin\helpdesk;
|
||||
// controllers
|
||||
use App\Http\Controllers\Controller;
|
||||
// request
|
||||
use App\Http\Requests\helpdesk\EmailsEditRequest;
|
||||
use App\Http\Requests\helpdesk\EmailsRequest;
|
||||
// model
|
||||
use App\Model\helpdesk\Agent\Department;
|
||||
use App\Model\helpdesk\Email\Emails;
|
||||
use App\Model\helpdesk\Manage\Help_topic;
|
||||
use App\Model\helpdesk\Utility\MailboxProtocol;
|
||||
use App\Model\helpdesk\Ticket\Ticket_Priority;
|
||||
// classes
|
||||
use Crypt;
|
||||
|
||||
/**
|
||||
* EmailsController
|
||||
*
|
||||
* @package Controllers
|
||||
* @subpackage Controller
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class EmailsController extends Controller {
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
* @return type
|
||||
*/
|
||||
public function __construct() {
|
||||
$this->middleware('auth');
|
||||
$this->middleware('roles');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
* @param type Emails $emails
|
||||
* @return type Response
|
||||
*/
|
||||
public function index(Emails $emails) {
|
||||
try {
|
||||
$emails = $emails->get();
|
||||
return view('themes.default1.admin.helpdesk.emails.emails.index', compact('emails'));
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
* @param type Department $department
|
||||
* @param type Help_topic $help
|
||||
* @param type Priority $priority
|
||||
* @param type MailboxProtocol $mailbox_protocol
|
||||
* @return type Response
|
||||
*/
|
||||
public function create(Department $department, Help_topic $help, Ticket_Priority $priority, MailboxProtocol $mailbox_protocol) {
|
||||
try {
|
||||
$departments = $department->get();
|
||||
$helps = $help->get();
|
||||
$priority = $priority->get();
|
||||
$mailbox_protocols = $mailbox_protocol->get();
|
||||
return view('themes.default1.admin.helpdesk.emails.emails.create', compact('mailbox_protocols', 'priority', 'departments', 'helps'));
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
* @param type Emails $email
|
||||
* @param type EmailsRequest $request
|
||||
* @return type Response
|
||||
*/
|
||||
public function store(Emails $email, EmailsRequest $request) {
|
||||
try {
|
||||
$password = $request->input('password');
|
||||
$encrypted = Crypt::encrypt($password);
|
||||
$email->password = $encrypted;
|
||||
if ($email->fill($request->except('password'))->save() == true) {
|
||||
return redirect('emails')->with('success', 'Email Created sucessfully');
|
||||
} else {
|
||||
return redirect('emails')->with('fails', 'Email can not Create');
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
return redirect('emails')->with('fails', 'Email can not Create');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function show($id) {
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
* @param type int $id
|
||||
* @param type Department $department
|
||||
* @param type Help_topic $help
|
||||
* @param type Emails $email
|
||||
* @param type Priority $priority
|
||||
* @param type MailboxProtocol $mailbox_protocol
|
||||
* @return type Response
|
||||
*/
|
||||
public function edit($id, Department $department, Help_topic $help, Emails $email, Ticket_Priority $priority, MailboxProtocol $mailbox_protocol) {
|
||||
try {
|
||||
$emails = $email->whereId($id)->first();
|
||||
$departments = $department->get();
|
||||
$helps = $help->get();
|
||||
$priority = $priority->get();
|
||||
$mailbox_protocols = $mailbox_protocol->get();
|
||||
return view('themes.default1.admin.helpdesk.emails.emails.edit', compact('mailbox_protocols', 'priority', 'departments', 'helps', 'emails'));
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
* @param type $id
|
||||
* @param type Emails $email
|
||||
* @param type EmailsEditRequest $request
|
||||
* @return type Response
|
||||
*/
|
||||
public function update($id, Emails $email, EmailsEditRequest $request) {
|
||||
$password = $request->input('password');
|
||||
$encrypted = Crypt::encrypt($password);
|
||||
//echo $encrypted;
|
||||
//$value = Crypt::decrypt($encrypted);
|
||||
//echo $value;
|
||||
try {
|
||||
$emails = $email->whereId($id)->first();
|
||||
$emails->password = $encrypted;
|
||||
$emails->fill($request->except('password'))->save();
|
||||
return redirect('emails')->with('success', 'Email Updated sucessfully');
|
||||
} catch (Exception $e) {
|
||||
return redirect('emails')->with('fails', 'Email not updated');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
* @param type int $id
|
||||
* @param type Emails $email
|
||||
* @return type Response
|
||||
*/
|
||||
public function destroy($id, Emails $email) {
|
||||
try {
|
||||
$emails = $email->whereId($id)->first();
|
||||
if ($emails->delete() == true) {
|
||||
return redirect('emails')->with('success', 'Email Deleted sucessfully');
|
||||
} else {
|
||||
return redirect('emails')->with('fails', 'Email can not Delete ');
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
return redirect('emails')->with('fails', 'Email can not Delete ');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
108
code/app/Http/Controllers/Admin/helpdesk/FormController.php
Normal file
108
code/app/Http/Controllers/Admin/helpdesk/FormController.php
Normal file
@@ -0,0 +1,108 @@
|
||||
<?php namespace App\Http\Controllers\Admin\helpdesk;
|
||||
|
||||
use App\Model\helpdesk\Form\Fields;
|
||||
use App\Model\helpdesk\Form\Forms;
|
||||
use Illuminate\Http\Request;
|
||||
use Input;
|
||||
use App\Http\Controllers\Controller;
|
||||
use Redirect;
|
||||
|
||||
class FormController extends Controller {
|
||||
private $fields;
|
||||
private $forms;
|
||||
|
||||
|
||||
public function __construct(Fields $fields,Forms $forms) {
|
||||
$this->fields = $fields;
|
||||
$this->forms = $forms;
|
||||
// $this->middleware('auth');
|
||||
}
|
||||
|
||||
/**
|
||||
* home
|
||||
* @return type
|
||||
*/
|
||||
public function home() {
|
||||
return view('forms.home');
|
||||
}
|
||||
|
||||
/**
|
||||
* list of forms
|
||||
* @param type Forms $forms
|
||||
* @return Response
|
||||
*/
|
||||
public function index(Forms $forms) {
|
||||
return view('themes.default1.admin.helpdesk.manage.form.index',compact('forms'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
* @return Response
|
||||
*/
|
||||
public function create() {
|
||||
return view('themes.default1.admin.helpdesk.manage.form.form');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function show($id) {
|
||||
return view('themes.default1.admin.helpdesk.manage.form.preview',compact('id'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function store(Forms $forms) {
|
||||
if(!Input::get('formname')) {
|
||||
return Redirect::back()->with('fails','Please fill Form name');
|
||||
}
|
||||
$required = Input::get('required');
|
||||
$count = count($required);
|
||||
$require = array();
|
||||
for($i=2;$i<$count+2;$i++) {
|
||||
for($j=0;$j<1;$j++) {
|
||||
array_push($require,$required[$i][$j]);
|
||||
}
|
||||
}
|
||||
$forms->formname = Input::get('formname');
|
||||
$forms->save();
|
||||
$count = count(Input::get('name'));
|
||||
$fields = array();
|
||||
for($i=0; $i<=$count; $i++) {
|
||||
if(!empty(Input::get('name')[$i])) {
|
||||
array_push($fields, array(
|
||||
'forms_id' => $forms->id,
|
||||
'label' => Input::get('label')[$i],
|
||||
'name' => Input::get('name')[$i],
|
||||
'type' => Input::get('type')[$i],
|
||||
'value' => Input::get('value')[$i],
|
||||
'required'=>$require[$i],
|
||||
));
|
||||
}
|
||||
}
|
||||
Fields::insert($fields);
|
||||
return Redirect::back()->with('success','Successfully created Form');
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function delete($id,Forms $forms, Fields $field) {
|
||||
$fields = $field->where('forms_id',$id)->get();
|
||||
foreach($fields as $field) {
|
||||
$field->delete();
|
||||
}
|
||||
$forms = $forms->where('id',$id)->first();
|
||||
$forms->delete();
|
||||
return redirect()->back()->with('success', 'Deleted Successfully');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
198
code/app/Http/Controllers/Admin/helpdesk/GroupController.php
Normal file
198
code/app/Http/Controllers/Admin/helpdesk/GroupController.php
Normal file
@@ -0,0 +1,198 @@
|
||||
<?php namespace App\Http\Controllers\Admin\helpdesk;
|
||||
// controllers
|
||||
use App\Http\Controllers\Controller;
|
||||
// requests
|
||||
use App\Http\Requests\helpdesk\GroupRequest;
|
||||
use Illuminate\Http\Request;
|
||||
// models
|
||||
use App\Model\helpdesk\Agent\Department;
|
||||
use App\Model\helpdesk\Agent\Groups;
|
||||
use App\Model\helpdesk\Agent\Group_assign_department;
|
||||
// classes
|
||||
use Illuminate\Support\Facades\Input;
|
||||
|
||||
/**
|
||||
* GroupController
|
||||
*
|
||||
* @package Controllers
|
||||
* @subpackage Controller
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class GroupController extends Controller {
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
* @return type void
|
||||
*/
|
||||
public function __construct() {
|
||||
$this->middleware('auth');
|
||||
$this->middleware('roles');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
* @param type Groups $group
|
||||
* @param type Department $department
|
||||
* @param type Group_assign_department $group_assign_department
|
||||
* @return type Response
|
||||
*/
|
||||
public function index(Groups $group, Department $department, Group_assign_department $group_assign_department) {
|
||||
try {
|
||||
$groups = $group->get();
|
||||
$departments = $department->lists('id');
|
||||
return view('themes.default1.admin.helpdesk.agent.groups.index', compact('departments', 'group_assign_department', 'groups'));
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
* @return type Response
|
||||
*/
|
||||
public function create() {
|
||||
try {
|
||||
return view('themes.default1.admin.helpdesk.agent.groups.create');
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
* @param type Groups $group
|
||||
* @param type GroupRequest $request
|
||||
* @return type Response
|
||||
*/
|
||||
public function store(Groups $group, GroupRequest $request) {
|
||||
try {
|
||||
/* Check Whether function success or not */
|
||||
if ($group->fill($request->input())->save() == true) {
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('groups')->with('success', 'Groups Created Successfully');
|
||||
} else {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('groups')->with('fails', 'Groups can not Create');
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('groups')->with('fails', 'Groups can not Create');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function show($id, Groups $group, Request $request) {
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
* @param type int $id
|
||||
* @param type Groups $group
|
||||
* @return type Response
|
||||
*/
|
||||
public function edit($id, Groups $group) {
|
||||
try {
|
||||
$groups = $group->whereId($id)->first();
|
||||
return view('themes.default1.admin.helpdesk.agent.groups.edit', compact('groups'));
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
* @param type int $id
|
||||
* @param type Groups $group
|
||||
* @param type Request $request
|
||||
* @return type Response
|
||||
*/
|
||||
public function update($id, Groups $group, Request $request) {
|
||||
try {
|
||||
$var = $group->whereId($id)->first();
|
||||
//Updating Status
|
||||
$status = $request->Input('group_status');
|
||||
$var->group_status = $status;
|
||||
//Updating can_create_ticket field
|
||||
$createTicket = $request->Input('can_create_ticket');
|
||||
$var->can_create_ticket = $createTicket;
|
||||
//Updating can_edit_ticket field
|
||||
$editTicket = $request->Input('can_edit_ticket');
|
||||
$var->can_edit_ticket = $editTicket;
|
||||
//Updating can_post_ticket field
|
||||
$postTicket = $request->Input('can_post_ticket');
|
||||
$var->can_post_ticket = $postTicket;
|
||||
//Updating can_close_ticket field
|
||||
$closeTicket = $request->Input('can_close_ticket');
|
||||
$var->can_close_ticket = $closeTicket;
|
||||
//Updating can_assign_ticket field
|
||||
$assignTicket = $request->Input('can_assign_ticket');
|
||||
$var->can_assign_ticket = $assignTicket;
|
||||
//Updating can_trasfer_ticket field
|
||||
$trasferTicket = $request->Input('can_trasfer_ticket');
|
||||
$var->can_trasfer_ticket = $trasferTicket;
|
||||
//Updating can_delete_ticket field
|
||||
$deleteTicket = $request->Input('can_delete_ticket');
|
||||
$var->can_delete_ticket = $deleteTicket;
|
||||
//Updating can_ban_email field
|
||||
$banEmail = $request->Input('can_ban_email');
|
||||
$var->can_ban_email = $banEmail;
|
||||
//Updating can_manage_canned field
|
||||
$manageCanned = $request->Input('can_manage_canned');
|
||||
$var->can_manage_canned = $manageCanned;
|
||||
//Updating can_manage_faq field
|
||||
$manageFaq = $request->Input('can_manage_faq');
|
||||
$var->can_manage_faq = $manageFaq;
|
||||
//Updating can_view_agent_stats field
|
||||
$viewAgentStats = $request->Input('can_view_agent_stats');
|
||||
$var->can_view_agent_stats = $viewAgentStats;
|
||||
//Updating department_access field
|
||||
$departmentAccess = $request->Input('department_access');
|
||||
$var->department_access = $departmentAccess;
|
||||
//Updating admin_notes field
|
||||
$adminNotes = $request->Input('admin_notes');
|
||||
$var->admin_notes = $adminNotes;
|
||||
/* Check whether function success or not */
|
||||
if ($var->save() == true) {
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('groups')->with('success', 'Group Updated Successfully');
|
||||
} else {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('groups')->with('fails', 'Group can not Update');
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('groups')->with('fails', 'Groups can not Create');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
* @param type int $id
|
||||
* @param type Groups $group
|
||||
* @param type Group_assign_department $group_assign_department
|
||||
* @return type Response
|
||||
*/
|
||||
public function destroy($id, Groups $group, Group_assign_department $group_assign_department) {
|
||||
try {
|
||||
$group_assign_department->where('group_id', $id)->delete();
|
||||
$groups = $group->whereId($id)->first();
|
||||
/* Check whether function success or not */
|
||||
if ($groups->delete() == true) {
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('groups')->with('success', 'Group Deleted Successfully');
|
||||
} else {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('groups')->with('fails', 'Group can not Delete');
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('groups')->with('fails', 'Groups can not Create');
|
||||
}
|
||||
}
|
||||
}
|
||||
185
code/app/Http/Controllers/Admin/helpdesk/HelptopicController.php
Normal file
185
code/app/Http/Controllers/Admin/helpdesk/HelptopicController.php
Normal file
@@ -0,0 +1,185 @@
|
||||
<?php namespace App\Http\Controllers\Admin\helpdesk;
|
||||
// controllers
|
||||
use App\Http\Controllers\Controller;
|
||||
// requests
|
||||
use App\Http\Requests\helpdesk\HelptopicRequest;
|
||||
use App\Http\Requests\helpdesk\HelptopicUpdate;
|
||||
// models
|
||||
use App\Model\helpdesk\Agent\Agents;
|
||||
use App\Model\helpdesk\Agent\Department;
|
||||
use App\Model\helpdesk\Form\Forms;
|
||||
use App\Model\helpdesk\Manage\Help_topic;
|
||||
use App\Model\helpdesk\Manage\Sla_plan;
|
||||
use App\Model\helpdesk\Ticket\Ticket_Priority;
|
||||
use App\User;
|
||||
|
||||
/**
|
||||
* HelptopicController
|
||||
*
|
||||
* @package Controllers
|
||||
* @subpackage Controller
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class HelptopicController extends Controller {
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
* @return type vodi
|
||||
*/
|
||||
public function __construct() {
|
||||
$this->middleware('auth');
|
||||
$this->middleware('roles');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
* @param type Help_topic $topic
|
||||
* @return type Response
|
||||
*/
|
||||
public function index(Help_topic $topic) {
|
||||
try {
|
||||
$topics = $topic->get();
|
||||
return view('themes.default1.admin.helpdesk.manage.helptopic.index', compact('topics'));
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
* @param type Priority $priority
|
||||
* @param type Department $department
|
||||
* @param type Help_topic $topic
|
||||
* @param type Form_name $form
|
||||
* @param type Agents $agent
|
||||
* @param type Sla_plan $sla
|
||||
* @return type Response
|
||||
*/
|
||||
/*
|
||||
================================================
|
||||
| Route to Create view file passing Model Values
|
||||
| 1.Department Model
|
||||
| 2.Help_topic Model
|
||||
| 3.Agents Model
|
||||
| 4.Sla_plan Model
|
||||
| 5.Forms Model
|
||||
================================================
|
||||
*/
|
||||
public function create(Ticket_Priority $priority, Department $department, Help_topic $topic, Forms $form, User $agent, Sla_plan $sla) {
|
||||
try {
|
||||
$departments = $department->get();
|
||||
$topics = $topic->get();
|
||||
$forms = $form->get();
|
||||
$agents = $agent->where('role','=','agent')->get();
|
||||
$slas = $sla->get();
|
||||
$priority = $priority->get();
|
||||
return view('themes.default1.admin.helpdesk.manage.helptopic.create', compact('priority', 'departments', 'topics', 'forms', 'agents', 'slas'));
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
* @param type Help_topic $topic
|
||||
* @param type HelptopicRequest $request
|
||||
* @return type Response
|
||||
*/
|
||||
public function store(Help_topic $topic, HelptopicRequest $request) {
|
||||
try {
|
||||
/* Check whether function success or not */
|
||||
if ($topic->fill($request->input())->save() == true) {
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('helptopic')->with('success', 'Helptopic Created Successfully');
|
||||
} else {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('helptopic')->with('fails', 'Helptopic can not Create');
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('helptopic')->with('fails', 'Helptopic can not Create');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function show($id) {
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
* @param type $id
|
||||
* @param type Priority $priority
|
||||
* @param type Department $department
|
||||
* @param type Help_topic $topic
|
||||
* @param type Form_name $form
|
||||
* @param type Agents $agent
|
||||
* @param type Sla_plan $sla
|
||||
* @return type Response
|
||||
*/
|
||||
public function edit($id, Ticket_Priority $priority, Department $department, Help_topic $topic, Forms $form, Sla_plan $sla) {
|
||||
try {
|
||||
$agents = User::where('role','=','agent')->get();
|
||||
$departments = $department->get();
|
||||
$topics = $topic->whereId($id)->first();
|
||||
$forms = $form->get();
|
||||
$slas = $sla->get();
|
||||
$priority = $priority->get();
|
||||
return view('themes.default1.admin.helpdesk.manage.helptopic.edit', compact('priority', 'departments', 'topics', 'forms', 'agents', 'slas'));
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
* @param type $id
|
||||
* @param type Help_topic $topic
|
||||
* @param type HelptopicUpdate $request
|
||||
* @return type Response
|
||||
*/
|
||||
public function update($id, Help_topic $topic, HelptopicUpdate $request) {
|
||||
try {
|
||||
$topics = $topic->whereId($id)->first();
|
||||
/* Check whether function success or not */
|
||||
if ($topics->fill($request->input())->save() == true) {
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('helptopic')->with('success', 'Helptopic Updated Successfully');
|
||||
} else {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('helptopic')->with('fails', 'Helptopic can not Updated');
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('helptopic')->with('fails', 'Helptopic can not Create');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
* @param type int $id
|
||||
* @param type Help_topic $topic
|
||||
* @return type Response
|
||||
*/
|
||||
public function destroy($id, Help_topic $topic) {
|
||||
try {
|
||||
$topics = $topic->whereId($id)->first();
|
||||
/* Check whether function success or not */
|
||||
if ($topics->delete() == true) {
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('helptopic')->with('success', 'Helptopic Deleted Successfully');
|
||||
} else {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('helptopic')->with('fails', 'Helptopic can not Delete');
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('helptopic')->with('fails', 'Helptopic can not Create');
|
||||
}
|
||||
}
|
||||
}
|
||||
34
code/app/Http/Controllers/Admin/helpdesk/HomeController.php
Normal file
34
code/app/Http/Controllers/Admin/helpdesk/HomeController.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php namespace App\Http\Controllers\Admin\helpdesk;
|
||||
|
||||
/**
|
||||
* -----------------------------------------------
|
||||
* HelptopicController
|
||||
* -----------------------------------------------
|
||||
* This controller renders your application's "dashboard" for users that
|
||||
* are authenticated. Of course, you are free to change or remove the
|
||||
* controller as you wish. It is just here to get your app started!
|
||||
*
|
||||
* @package Controllers
|
||||
* @subpackage Controller
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class HomeController extends Controller {
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
* @return void
|
||||
*/
|
||||
public function __construct() {
|
||||
$this->middleware('auth');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the application dashboard to the user.
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function index() {
|
||||
return view('themes/default1/admin/dashboard');
|
||||
}
|
||||
|
||||
}
|
||||
122
code/app/Http/Controllers/Admin/helpdesk/ProfileController.php
Normal file
122
code/app/Http/Controllers/Admin/helpdesk/ProfileController.php
Normal file
@@ -0,0 +1,122 @@
|
||||
<?php namespace App\Http\Controllers\Admin\helpdesk;
|
||||
// controllers
|
||||
use App\Http\Controllers\Controller;
|
||||
// requests
|
||||
use App\Http\Requests\ProfilePassword;
|
||||
use App\Http\Requests\ProfileRequest;
|
||||
// models
|
||||
use App\User;
|
||||
// classes
|
||||
use Auth;
|
||||
use Hash;
|
||||
use Input;
|
||||
|
||||
/**
|
||||
* ProfileController
|
||||
*
|
||||
* @package Controllers
|
||||
* @subpackage Controller
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class ProfileController extends Controller {
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
* @return type void
|
||||
*/
|
||||
public function __construct() {
|
||||
$this->middleware('auth');
|
||||
$this->middleware('roles');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get profile page
|
||||
* @return type Response
|
||||
*/
|
||||
public function getProfile() {
|
||||
try {
|
||||
$user = Auth::user();
|
||||
if ($user) {
|
||||
return view('themes.default1.agent.helpdesk.user.profile', compact('user'));
|
||||
} else {
|
||||
return redirect('404');
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
return redirect('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get profile Edit page
|
||||
* @return type Response
|
||||
*/
|
||||
public function getProfileedit() {
|
||||
try {
|
||||
$user = Auth::user();
|
||||
if ($user) {
|
||||
return view('themes.default1.agent.helpdesk.user.profile-edit', compact('user'));
|
||||
} else {
|
||||
return redirect('404');
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
return redirect('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Post profile page
|
||||
* @param type int $id
|
||||
* @param type ProfileRequest $request
|
||||
* @return type Response
|
||||
*/
|
||||
public function postProfile($id, ProfileRequest $request) {
|
||||
$user = Auth::user();
|
||||
$user->gender = $request->input('gender');
|
||||
$user->save();
|
||||
if ($user->profile_pic == 'avatar5.png' || $user->profile_pic == 'avatar2.png') {
|
||||
if ($request->input('gender') == 1) {
|
||||
$name = 'avatar5.png';
|
||||
$destinationPath = 'lb-faveo/profilepic';
|
||||
$user->profile_pic = $name;
|
||||
} elseif ($request->input('gender') == 0) {
|
||||
$name = 'avatar2.png';
|
||||
$destinationPath = 'lb-faveo/profilepic';
|
||||
$user->profile_pic = $name;
|
||||
}
|
||||
}
|
||||
if (Input::file('profile_pic')) {
|
||||
//$extension = Input::file('profile_pic')->getClientOriginalExtension();
|
||||
$name = Input::file('profile_pic')->getClientOriginalName();
|
||||
$destinationPath = 'lb-faveo/profilepic';
|
||||
$fileName = rand(0000, 9999) . '.' . $name;
|
||||
//echo $fileName;
|
||||
Input::file('profile_pic')->move($destinationPath, $fileName);
|
||||
$user->profile_pic = $fileName;
|
||||
} else {
|
||||
$user->fill($request->except('profile_pic', 'gender'))->save();
|
||||
return redirect('guest')->with('success', 'Profile Updated sucessfully');
|
||||
}
|
||||
if ($user->fill($request->except('profile_pic'))->save()) {
|
||||
return redirect('guest')->with('success', 'Profile Updated sucessfully');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Post Profile password page
|
||||
* @param type int $id
|
||||
* @param type User $user
|
||||
* @param type ProfilePassword $request
|
||||
* @return type Response
|
||||
*/
|
||||
public function postProfilePassword($id, User $user, ProfilePassword $request) {
|
||||
$user = Auth::user();
|
||||
//echo $user->password;
|
||||
if (Hash::check($request->input('old_password'), $user->getAuthPassword())) {
|
||||
$user->password = Hash::make($request->input('new_password'));
|
||||
$user->save();
|
||||
return redirect('guest')->with('success', 'Password Updated sucessfully');
|
||||
} else {
|
||||
return redirect('guest')->with('fails', 'Password was not Updated');
|
||||
}
|
||||
}
|
||||
}
|
||||
435
code/app/Http/Controllers/Admin/helpdesk/SettingsController.php
Normal file
435
code/app/Http/Controllers/Admin/helpdesk/SettingsController.php
Normal file
@@ -0,0 +1,435 @@
|
||||
<?php namespace App\Http\Controllers\Admin\helpdesk;
|
||||
// controllers
|
||||
use App\Http\Controllers\Controller;
|
||||
// requests
|
||||
use App\Http\Requests\helpdesk\CompanyRequest;
|
||||
use App\Http\Requests\helpdesk\EmailRequest;
|
||||
use App\Http\Requests\helpdesk\SystemRequest;
|
||||
// models
|
||||
use App\Model\helpdesk\Agent\Department;
|
||||
use App\Model\helpdesk\Email\Emails;
|
||||
use App\Model\helpdesk\Email\Template;
|
||||
use App\Model\helpdesk\Manage\Help_topic;
|
||||
use App\Model\helpdesk\Manage\Sla_plan;
|
||||
use App\Model\helpdesk\Settings\Access;
|
||||
use App\Model\helpdesk\Settings\Alert;
|
||||
use App\Model\helpdesk\Settings\Company;
|
||||
use App\Model\helpdesk\Settings\Email;
|
||||
use App\Model\helpdesk\Settings\Responder;
|
||||
use App\Model\helpdesk\Settings\System;
|
||||
use App\Model\helpdesk\Settings\Ticket;
|
||||
use App\Model\helpdesk\Utility\Date_format;
|
||||
use App\Model\helpdesk\Utility\Date_time_format;
|
||||
use App\Model\helpdesk\Utility\Logs;
|
||||
use App\Model\helpdesk\Ticket\Ticket_Priority;
|
||||
use App\Model\helpdesk\Utility\Timezones;
|
||||
use App\Model\helpdesk\Utility\Time_format;
|
||||
// classes
|
||||
use Illuminate\Http\Request;
|
||||
use Input;
|
||||
|
||||
/**
|
||||
* SettingsController
|
||||
*
|
||||
* @package Controllers
|
||||
* @subpackage Controller
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class SettingsController extends Controller {
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
* @return void
|
||||
*/
|
||||
public function __construct() {
|
||||
// $this->smtp();
|
||||
$this->middleware('auth');
|
||||
$this->middleware('roles');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @return Response
|
||||
* @param $compant instance of company table
|
||||
*
|
||||
* get the form for company setting page
|
||||
*/
|
||||
public function getcompany(Company $company) {
|
||||
try {
|
||||
/* fetch the values of company from company table */
|
||||
$companys = $company->whereId('1')->first();
|
||||
/* Direct to Company Settings Page */
|
||||
return view('themes.default1.admin.helpdesk.settings.company', compact('companys'));
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
* @param type int $id
|
||||
* @param type Company $company
|
||||
* @param type CompanyRequest $request
|
||||
* @return Response
|
||||
*/
|
||||
public function postcompany($id, Company $company, CompanyRequest $request) {
|
||||
try {
|
||||
/* fetch the values of company request */
|
||||
$companys = $company->whereId('1')->first();
|
||||
if (Input::file('logo')) {
|
||||
$name = Input::file('logo')->getClientOriginalName();
|
||||
$destinationPath = 'dist';
|
||||
$fileName = rand(0000, 9999) . '.' . $name;
|
||||
Input::file('logo')->move($destinationPath, $fileName);
|
||||
$companys->logo = $fileName;
|
||||
}
|
||||
if($request->input('use_logo')==null)
|
||||
{
|
||||
$companys->use_logo = '0';
|
||||
}
|
||||
/* Check whether function success or not */
|
||||
if ($companys->fill($request->except('logo'))->save() == true) {
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('getcompany')->with('success', 'Company Updated Successfully');
|
||||
} else {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('getcompany')->with('fails', 'Company can not Updated');
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('getcompany')->with('fails', 'Company can not Updated');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* get the form for System setting page
|
||||
* @param type System $system
|
||||
* @param type Department $department
|
||||
* @param type Timezones $timezone
|
||||
* @param type Date_format $date
|
||||
* @param type Date_time_format $date_time
|
||||
* @param type Time_format $time
|
||||
* @param type Logs $log
|
||||
* @return type Response
|
||||
*/
|
||||
public function getsystem(System $system, Department $department, Timezones $timezone, Date_format $date, Date_time_format $date_time, Time_format $time, Logs $log) {
|
||||
try {
|
||||
/* fetch the values of system from system table */
|
||||
$systems = $system->whereId('1')->first();
|
||||
/* Fetch the values from Department table */
|
||||
$departments = $department->get();
|
||||
/* Fetch the values from Timezones table */
|
||||
$timezones = $timezone->get();
|
||||
/* Direct to System Settings Page */
|
||||
return view('themes.default1.admin.helpdesk.settings.system', compact('systems', 'departments', 'timezones', 'time', 'date', 'date_time', 'log'));
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
* @param type int $id
|
||||
* @param type System $system
|
||||
* @param type SystemRequest $request
|
||||
* @return type Response
|
||||
*/
|
||||
public function postsystem($id, System $system, SystemRequest $request) {
|
||||
try {
|
||||
/* fetch the values of system request */
|
||||
$systems = $system->whereId('1')->first();
|
||||
/* fill the values to coompany table */
|
||||
/* Check whether function success or not */
|
||||
if ($systems->fill($request->input())->save() == true) {
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('getsystem')->with('success', 'System Updated Successfully');
|
||||
} else {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('getsystem')->with('fails', 'System can not Updated');
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('getsystem')->with('fails', 'System can not Updated');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* get the form for Ticket setting page
|
||||
* @param type Ticket $ticket
|
||||
* @param type Sla_plan $sla
|
||||
* @param type Help_topic $topic
|
||||
* @param type Priority $priority
|
||||
* @return type Response
|
||||
*/
|
||||
public function getticket(Ticket $ticket, Sla_plan $sla, Help_topic $topic, Ticket_Priority $priority) {
|
||||
try {
|
||||
/* fetch the values of ticket from ticket table */
|
||||
$tickets = $ticket->whereId('1')->first();
|
||||
/* Fetch the values from SLA Plan table */
|
||||
$slas = $sla->get();
|
||||
/* Fetch the values from Help_topic table */
|
||||
$topics = $topic->get();
|
||||
/* Direct to Ticket Settings Page */
|
||||
return view('themes.default1.admin.helpdesk.settings.ticket', compact('tickets', 'slas', 'topics', 'priority'));
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
* @param type int $id
|
||||
* @param type Ticket $ticket
|
||||
* @param type Request $request
|
||||
* @return type Response
|
||||
*/
|
||||
public function postticket($id, Ticket $ticket, Request $request) {
|
||||
try {
|
||||
/* fetch the values of ticket request */
|
||||
$tickets = $ticket->whereId('1')->first();
|
||||
/* fill the values to coompany table */
|
||||
$tickets->fill($request->except('captcha', 'claim_response', 'assigned_ticket', 'answered_ticket', 'agent_mask', 'html', 'client_update'))->save();
|
||||
/* insert checkbox to Database */
|
||||
$tickets->captcha = $request->input('captcha');
|
||||
$tickets->claim_response = $request->input('claim_response');
|
||||
$tickets->assigned_ticket = $request->input('assigned_ticket');
|
||||
$tickets->answered_ticket = $request->input('answered_ticket');
|
||||
$tickets->agent_mask = $request->input('agent_mask');
|
||||
$tickets->html = $request->input('html');
|
||||
$tickets->client_update = $request->input('client_update');
|
||||
/* Check whether function success or not */
|
||||
if ($tickets->save() == true) {
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('getticket')->with('success', 'Ticket Updated Successfully');
|
||||
} else {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('getticket')->with('fails', 'Ticket can not Updated');
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('getticket')->with('fails', 'Ticket can not Updated');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* get the form for Email setting page
|
||||
* @param type Email $email
|
||||
* @param type Template $template
|
||||
* @param type Emails $email1
|
||||
* @return type Response
|
||||
*/
|
||||
public function getemail(Email $email, Template $template, Emails $email1) {
|
||||
try {
|
||||
/* fetch the values of email from Email table */
|
||||
$emails = $email->whereId('1')->first();
|
||||
/* Fetch the values from Template table */
|
||||
$templates = $template->get();
|
||||
/* Fetch the values from Emails table */
|
||||
$emails1 = $email1->get();
|
||||
/* Direct to Email Settings Page */
|
||||
return view('themes.default1.admin.helpdesk.settings.email', compact('emails', 'templates', 'emails1'));
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
* @param type int $id
|
||||
* @param type Email $email
|
||||
* @param type EmailRequest $request
|
||||
* @return type Response
|
||||
*/
|
||||
public function postemail($id, Email $email, EmailRequest $request) {
|
||||
try {
|
||||
/* fetch the values of email request */
|
||||
$emails = $email->whereId('1')->first();
|
||||
/* fill the values to email table */
|
||||
$emails->fill($request->except('email_fetching', 'all_emails', 'email_collaborator', 'strip', 'attachment'))->save();
|
||||
/* insert checkboxes to database */
|
||||
$emails->email_fetching = $request->input('email_fetching');
|
||||
$emails->all_emails = $request->input('all_emails');
|
||||
$emails->email_collaborator = $request->input('email_collaborator');
|
||||
$emails->strip = $request->input('strip');
|
||||
$emails->attachment = $request->input('attachment');
|
||||
/* Check whether function success or not */
|
||||
if ($emails->save() == true) {
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('getemail')->with('success', 'Email Updated Successfully');
|
||||
} else {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('getemail')->with('fails', 'Email can not Updated');
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('getemail')->with('fails', 'Email can not Updated');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* get the form for Access setting page
|
||||
* @param type Access $access
|
||||
* @return type Response
|
||||
*/
|
||||
// public function getaccess(Access $access) {
|
||||
// try {
|
||||
// /* fetch the values of access from access table */
|
||||
// $accesses = $access->whereId('1')->first();
|
||||
// // Direct to Access Settings Page
|
||||
// return view('themes.default1.admin.helpdesk.settings.access', compact('accesses'));
|
||||
// } catch (Exception $e) {
|
||||
// return view('404');
|
||||
// }
|
||||
// }
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
* @param type Access $access
|
||||
* @param type Request $request
|
||||
* @return type Response
|
||||
*/
|
||||
// public function postaccess(Access $access, Request $request) {
|
||||
// try {
|
||||
// /* fetch the values of access request */
|
||||
// $accesses = $access->whereId('1')->first();
|
||||
// /* fill the values to access table */
|
||||
// $accesses->fill($request->except('password_reset', 'bind_agent_ip', 'reg_require', 'quick_access'))->save();
|
||||
// /* insert checkbox value to DB */
|
||||
// $accesses->password_reset = $request->input('password_reset');
|
||||
// $accesses->bind_agent_ip = $request->input('bind_agent_ip');
|
||||
// $accesses->reg_require = $request->input('reg_require');
|
||||
// $accesses->quick_access = $request->input('quick_access');
|
||||
// /* Check whether function success or not */
|
||||
// if ($accesses->save() == true) {
|
||||
// /* redirect to Index page with Success Message */
|
||||
// return redirect('getaccess')->with('success', 'Access Updated Successfully');
|
||||
// } else {
|
||||
// /* redirect to Index page with Fails Message */
|
||||
// return redirect('getaccess')->with('fails', 'Access can not Updated');
|
||||
// }
|
||||
// } catch (Exception $e) {
|
||||
// /* redirect to Index page with Fails Message */
|
||||
// return redirect('getaccess')->with('fails', 'Access can not Updated');
|
||||
// }
|
||||
// }
|
||||
|
||||
/**
|
||||
* get the form for Responder setting page
|
||||
* @param type Responder $responder
|
||||
* @return type Response
|
||||
*/
|
||||
public function getresponder(Responder $responder) {
|
||||
try {
|
||||
/* fetch the values of responder from responder table */
|
||||
$responders = $responder->whereId('1')->first();
|
||||
/* Direct to Responder Settings Page */
|
||||
return view('themes.default1.admin.helpdesk.settings.responder', compact('responders'));
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
* @param type Responder $responder
|
||||
* @param type Request $request
|
||||
* @return type
|
||||
*/
|
||||
public function postresponder(Responder $responder, Request $request) {
|
||||
try {
|
||||
/* fetch the values of responder request */
|
||||
$responders = $responder->whereId('1')->first();
|
||||
/* insert Checkbox value to DB */
|
||||
$responders->new_ticket = $request->input('new_ticket');
|
||||
$responders->agent_new_ticket = $request->input('agent_new_ticket');
|
||||
$responders->submitter = $request->input('submitter');
|
||||
$responders->participants = $request->input('participants');
|
||||
$responders->overlimit = $request->input('overlimit');
|
||||
/* fill the values to coompany table */
|
||||
/* Check whether function success or not */
|
||||
if ($responders->save() == true) {
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('getresponder')->with('success', 'Responder Updated Successfully');
|
||||
} else {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('getresponder')->with('fails', 'Responder can not Updated');
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('getresponder')->with('fails', 'Responder can not Updated');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* get the form for Alert setting page
|
||||
* @param type Alert $alert
|
||||
* @return type Response
|
||||
*/
|
||||
public function getalert(Alert $alert) {
|
||||
try {
|
||||
/* fetch the values of alert from alert table */
|
||||
$alerts = $alert->whereId('1')->first();
|
||||
/* Direct to Alert Settings Page */
|
||||
return view('themes.default1.admin.helpdesk.settings.alert', compact('alerts'));
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
* @param type $id
|
||||
* @param type Alert $alert
|
||||
* @param type Request $request
|
||||
* @return type Response
|
||||
*/
|
||||
public function postalert($id, Alert $alert, Request $request) {
|
||||
try {
|
||||
/* fetch the values of alert request */
|
||||
$alerts = $alert->whereId('1')->first();
|
||||
/* Insert Checkbox to DB */
|
||||
$alerts->assignment_status = $request->input('assignment_status');
|
||||
$alerts->ticket_status = $request->input('ticket_status');
|
||||
$alerts->overdue_department_member = $request->input('overdue_department_member');
|
||||
$alerts->sql_error = $request->input('sql_error');
|
||||
$alerts->excessive_failure = $request->input('excessive_failure');
|
||||
$alerts->overdue_status = $request->input('overdue_status');
|
||||
$alerts->overdue_assigned_agent = $request->input('overdue_assigned_agent');
|
||||
$alerts->overdue_department_manager = $request->input('overdue_department_manager');
|
||||
$alerts->internal_status = $request->input('internal_status');
|
||||
$alerts->internal_last_responder = $request->input('internal_last_responder');
|
||||
$alerts->internal_assigned_agent = $request->input('internal_assigned_agent');
|
||||
$alerts->internal_department_manager = $request->input('internal_department_manager');
|
||||
$alerts->assignment_assigned_agent = $request->input('assignment_assigned_agent');
|
||||
$alerts->assignment_team_leader = $request->input('assignment_team_leader');
|
||||
$alerts->assignment_team_member = $request->input('assignment_team_member');
|
||||
$alerts->system_error = $request->input('system_error');
|
||||
$alerts->transfer_department_member = $request->input('transfer_department_member');
|
||||
$alerts->transfer_department_manager = $request->input('transfer_department_manager');
|
||||
$alerts->transfer_assigned_agent = $request->input('transfer_assigned_agent');
|
||||
$alerts->transfer_status = $request->input('transfer_status');
|
||||
$alerts->message_organization_accmanager = $request->input('message_organization_accmanager');
|
||||
$alerts->message_department_manager = $request->input('message_department_manager');
|
||||
$alerts->message_assigned_agent = $request->input('message_assigned_agent');
|
||||
$alerts->message_last_responder = $request->input('message_last_responder');
|
||||
$alerts->message_status = $request->input('message_status');
|
||||
$alerts->ticket_organization_accmanager = $request->input('ticket_organization_accmanager');
|
||||
$alerts->ticket_department_manager = $request->input('ticket_department_manager');
|
||||
$alerts->ticket_department_member = $request->input('ticket_department_member');
|
||||
$alerts->ticket_admin_email = $request->input('ticket_admin_email');
|
||||
/* fill the values to coompany table */
|
||||
/* Check whether function success or not */
|
||||
if ($alerts->save() == true) {
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('getalert')->with('success', 'Alert Updated Successfully');
|
||||
} else {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('getalert')->with('fails', 'Alert can not Updated');
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('getalert')->with('fails', 'Alert can not Updated');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
161
code/app/Http/Controllers/Admin/helpdesk/SlaController.php
Normal file
161
code/app/Http/Controllers/Admin/helpdesk/SlaController.php
Normal file
@@ -0,0 +1,161 @@
|
||||
<?php namespace App\Http\Controllers\Admin\helpdesk;
|
||||
// controllers
|
||||
use App\Http\Controllers\Controller;
|
||||
// requests
|
||||
use App\Http\Requests\helpdesk\SlaRequest;
|
||||
use App\Http\Requests\helpdesk\SlaUpdate;
|
||||
// models
|
||||
use App\Model\helpdesk\Manage\Sla_plan;
|
||||
|
||||
/**
|
||||
* SlaController
|
||||
*
|
||||
* @package Controllers
|
||||
* @subpackage Controller
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class SlaController extends Controller {
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
* @return type void
|
||||
*/
|
||||
public function __construct() {
|
||||
$this->middleware('auth');
|
||||
$this->middleware('roles');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
* @param type Sla_plan $sla
|
||||
* @return type Response
|
||||
*/
|
||||
public function index(Sla_plan $sla) {
|
||||
try {
|
||||
/* Declare a Variable $slas to store all Values From Sla_plan Table */
|
||||
$slas = $sla->get();
|
||||
/* Listing the values From Sla_plan Table */
|
||||
return view('themes.default1.admin.helpdesk.manage.sla.index', compact('slas'));
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
* @return type Response
|
||||
*/
|
||||
public function create() {
|
||||
try {
|
||||
/* Direct to Create Page */
|
||||
return view('themes.default1.admin.helpdesk.manage.sla.create');
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
* @param type Sla_plan $sla
|
||||
* @param type SlaRequest $request
|
||||
* @return type Response
|
||||
*/
|
||||
public function store(Sla_plan $sla, SlaRequest $request) {
|
||||
try {
|
||||
/* Fill the request values to Sla_plan Table */
|
||||
/* Check whether function success or not */
|
||||
if ($sla->fill($request->input())->save() == true) {
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('sla')->with('success', 'SLA Plan Created Successfully');
|
||||
} else {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('sla')->with('fails', 'SLA Plan can not Create');
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('sla')->with('fails', 'SLA Plan can not Create');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function show($id) {
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
* @param type int $id
|
||||
* @param type Sla_plan $sla
|
||||
* @return type Response
|
||||
*/
|
||||
public function edit($id, Sla_plan $sla) {
|
||||
try {
|
||||
/* Direct to edit page along values of perticular field using Id */
|
||||
$slas = $sla->whereId($id)->first();
|
||||
$slas->get();
|
||||
return view('themes.default1.admin.helpdesk.manage.sla.edit', compact('slas'));
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
* @param type int $id
|
||||
* @param type Sla_plan $sla
|
||||
* @param type SlaUpdate $request
|
||||
* @return type Response
|
||||
*/
|
||||
public function update($id, Sla_plan $sla, SlaUpdate $request) {
|
||||
try {
|
||||
/* Fill values to selected field using Id except Check box */
|
||||
$slas = $sla->whereId($id)->first();
|
||||
$slas->fill($request->except('transient', 'ticket_overdue'))->save();
|
||||
/* Update transient checkox field */
|
||||
$slas->transient = $request->input('transient');
|
||||
/* Update ticket_overdue checkox field */
|
||||
$slas->ticket_overdue = $request->input('ticket_overdue');
|
||||
/* Check whether function success or not */
|
||||
if ($slas->save() == true) {
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('sla')->with('success', 'SLA Plan Updated Successfully');
|
||||
} else {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('sla')->with('fails', 'SLA Plan can not Update');
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('sla')->with('fails', 'SLA Plan can not Update');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
* @param type int $id
|
||||
* @param type Sla_plan $sla
|
||||
* @return type Response
|
||||
*/
|
||||
public function destroy($id, Sla_plan $sla) {
|
||||
try {
|
||||
/* Delete a perticular field from the database by delete() using Id */
|
||||
$slas = $sla->whereId($id)->first();
|
||||
/* Check whether function success or not */
|
||||
if ($slas->delete() == true) {
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('sla')->with('success', 'SLA Plan Deleted Successfully');
|
||||
} else {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('sla')->with('fails', 'SLA Plan can not Delete');
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('sla')->with('fails', 'SLA Plan can not Delete');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
167
code/app/Http/Controllers/Admin/helpdesk/TeamController.php
Normal file
167
code/app/Http/Controllers/Admin/helpdesk/TeamController.php
Normal file
@@ -0,0 +1,167 @@
|
||||
<?php namespace App\Http\Controllers\Admin\helpdesk;
|
||||
// controllers
|
||||
use App\Http\Controllers\Controller;
|
||||
// requests
|
||||
use App\Http\Requests\helpdesk\TeamRequest;
|
||||
use App\Http\Requests\helpdesk\TeamUpdate;
|
||||
// models
|
||||
use App\Model\helpdesk\Agent\Assign_team_agent;
|
||||
use App\Model\helpdesk\Agent\Teams;
|
||||
use App\User;
|
||||
|
||||
/**
|
||||
* TeamController
|
||||
*
|
||||
* @package Controllers
|
||||
* @subpackage Controller
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class TeamController extends Controller {
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
* @return type void
|
||||
*/
|
||||
public function __construct() {
|
||||
$this->middleware('auth');
|
||||
$this->middleware('roles');
|
||||
}
|
||||
|
||||
/**
|
||||
* get Index page
|
||||
* @param type Teams $team
|
||||
* @param type Assign_team_agent $assign_team_agent
|
||||
* @return type Response
|
||||
*/
|
||||
public function index(Teams $team, Assign_team_agent $assign_team_agent) {
|
||||
try {
|
||||
$teams = $team->get();
|
||||
/* find out the Number of Members in the Team */
|
||||
$id = $teams->lists('id');
|
||||
$assign_team_agent = $assign_team_agent->get();
|
||||
return view('themes.default1.admin.helpdesk.agent.teams.index', compact('assign_team_agent', 'teams'));
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
* @param type User $user
|
||||
* @return type Response
|
||||
*/
|
||||
public function create(User $user) {
|
||||
try {
|
||||
$user = $user->get();
|
||||
return view('themes.default1.admin.helpdesk.agent.teams.create', compact('user'));
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
* @param type Teams $team
|
||||
* @param type TeamRequest $request
|
||||
* @return type Response
|
||||
*/
|
||||
public function store(Teams $team, TeamRequest $request) {
|
||||
try {
|
||||
/* Check whether function success or not */
|
||||
if ($team->fill($request->input())->save() == true) {
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('teams')->with('success', 'Teams Created Successfully');
|
||||
} else {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('teams')->with('fails', 'Teams can not Create');
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('teams')->with('fails', 'Teams can not Create');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function show($id) {
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
* @param type $id
|
||||
* @param type User $user
|
||||
* @param type Assign_team_agent $assign_team_agent
|
||||
* @param type Teams $team
|
||||
* @return type Response
|
||||
*/
|
||||
public function edit($id, User $user, Assign_team_agent $assign_team_agent, Teams $team) {
|
||||
try {
|
||||
$user = $user->whereId($id)->first();
|
||||
$teams = $team->whereId($id)->first();
|
||||
$agent_team = $assign_team_agent->where('team_id', $id)->get();
|
||||
$agent_id = $agent_team->lists('agent_id', 'agent_id');
|
||||
return view('themes.default1.admin.helpdesk.agent.teams.edit', compact('agent_id', 'user', 'teams', 'allagents'));
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
* @param type int $id
|
||||
* @param type Teams $team
|
||||
* @param type TeamUpdate $request
|
||||
* @return type Response
|
||||
*/
|
||||
public function update($id, Teams $team, TeamUpdate $request) {
|
||||
try {
|
||||
$teams = $team->whereId($id)->first();
|
||||
//updating check box
|
||||
$alert = $request->input('assign_alert');
|
||||
$teams->assign_alert = $alert;
|
||||
$teams->save(); //saving check box
|
||||
//updating whole field
|
||||
/* Check whether function success or not */
|
||||
if ($teams->fill($request->input())->save() == true) {
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('teams')->with('success', 'Teams Updated Successfully');
|
||||
} else {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('teams')->with('fails', 'Teams can not Update');
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('teams')->with('fails', 'Teams can not Update');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
* @param type int $id
|
||||
* @param type Teams $team
|
||||
* @param type Assign_team_agent $assign_team_agent
|
||||
* @return type Response
|
||||
*/
|
||||
public function destroy($id, Teams $team, Assign_team_agent $assign_team_agent) {
|
||||
try {
|
||||
$assign_team_agent->where('team_id', $id)->delete();
|
||||
$teams = $team->whereId($id)->first();
|
||||
/* Check whether function success or not */
|
||||
if ($teams->delete() == true) {
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('teams')->with('success', 'Teams Deleted Successfully');
|
||||
} else {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('teams')->with('fails', 'Teams can not Delete');
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('teams')->with('fails', 'Teams can not Delete');
|
||||
}
|
||||
}
|
||||
}
|
||||
192
code/app/Http/Controllers/Admin/helpdesk/TemplateController.php
Normal file
192
code/app/Http/Controllers/Admin/helpdesk/TemplateController.php
Normal file
@@ -0,0 +1,192 @@
|
||||
<?php namespace App\Http\Controllers\Admin\helpdesk;
|
||||
// controllers
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Controllers\Common\SettingsController;
|
||||
// requests
|
||||
use App\Http\Requests\helpdesk\TemplateRequest;
|
||||
use App\Http\Requests\helpdesk\TemplateUdate;
|
||||
// models
|
||||
use App\Model\helpdesk\Email\Emails;
|
||||
use App\Model\helpdesk\Email\Template;
|
||||
use App\Model\helpdesk\Utility\Languages;
|
||||
// classes
|
||||
use Illuminate\Http\Request;
|
||||
use Mail;
|
||||
|
||||
/**
|
||||
* TemplateController
|
||||
*
|
||||
* @package Controllers
|
||||
* @subpackage Controller
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class TemplateController extends Controller {
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
* @return type void
|
||||
*/
|
||||
public function __construct() {
|
||||
SettingsController::smtp();
|
||||
$this->middleware('auth');
|
||||
$this->middleware('roles');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
* @param type Template $template
|
||||
* @return type Response
|
||||
*/
|
||||
public function index(Template $template) {
|
||||
try {
|
||||
$templates = $template->get();
|
||||
return view('themes.default1.admin.helpdesk.emails.template.index', compact('templates'));
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
* @param type Languages $language
|
||||
* @param type Template $template
|
||||
* @return type Response
|
||||
*/
|
||||
public function create(Languages $language, Template $template) {
|
||||
try {
|
||||
$templates = $template->get();
|
||||
$languages = $language->get();
|
||||
return view('themes.default1.admin.helpdesk.emails.template.create', compact('languages', 'templates'));
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
* @param type Template $template
|
||||
* @param type TemplateRequest $request
|
||||
* @return type Response
|
||||
*/
|
||||
public function store(Template $template, TemplateRequest $request) {
|
||||
try {
|
||||
/* Check whether function success or not */
|
||||
if ($template->fill($request->input())->save() == true) {
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('template')->with('success', 'Teams Created Successfully');
|
||||
} else {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('template')->with('fails', 'Teams can not Create');
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('template')->with('fails', 'Teams can not Create');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function show($id) {
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
* @param type $id
|
||||
* @param type Template $template
|
||||
* @param type Languages $language
|
||||
* @return type Response
|
||||
*/
|
||||
public function edit($id, Template $template, Languages $language) {
|
||||
try {
|
||||
$templates = $template->whereId($id)->first();
|
||||
$languages = $language->get();
|
||||
return view('themes.default1.admin.helpdesk.emails.template.edit', compact('templates', 'languages'));
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
* @param type int $id
|
||||
* @param type Template $template
|
||||
* @param type TemplateUdate $request
|
||||
* @return type Response
|
||||
*/
|
||||
public function update($id, Template $template, TemplateUdate $request) {
|
||||
try {
|
||||
//TODO validation
|
||||
$templates = $template->whereId($id)->first();
|
||||
/* Check whether function success or not */
|
||||
if ($templates->fill($request->input())->save() == true) {
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('template')->with('success', 'Teams Updated Successfully');
|
||||
} else {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('template')->with('fails', 'Teams can not Update');
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('template')->with('fails', 'Teams can not Update');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
* @param type int $id
|
||||
* @param type Template $template
|
||||
* @return type Response
|
||||
*/
|
||||
public function destroy($id, Template $template) {
|
||||
try {
|
||||
$templates = $template->whereId($id)->first();
|
||||
/* Check whether function success or not */
|
||||
if ($templates->delete() == true) {
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('template')->with('success', 'Teams Deleted Successfully');
|
||||
} else {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('template')->with('fails', 'Teams can not Delete');
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('template')->with('fails', 'Teams can not Delete');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Form for Email connection checking.
|
||||
* @param type Emails $email
|
||||
* @return type Response
|
||||
*/
|
||||
public function formDiagno(Emails $email) {
|
||||
try {
|
||||
$emails = $email->get();
|
||||
return view('themes.default1.admin.helpdesk.emails.template.formDiagno', compact('emails'));
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* function to send emails
|
||||
* @param type Request $request
|
||||
* @return type
|
||||
*/
|
||||
public function postDiagno(Request $request) {
|
||||
$email = $request->input('to');
|
||||
if($email == null)
|
||||
{
|
||||
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) {
|
||||
$message->to($email)->subject('Checking the connection');
|
||||
});
|
||||
return redirect('getdiagno')->with('success', 'Please check your mail. An E-mail has been sent to your E-mail address');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php namespace App\Http\Controllers\Admin\helpdesk;
|
||||
// controllers
|
||||
use App\Http\Controllers\Controller;
|
||||
// models
|
||||
use App\Model\helpdesk\Priority;
|
||||
use App\Model\helpdesk\Ticket_thread;
|
||||
|
||||
/**
|
||||
* ThreadController
|
||||
*
|
||||
* @package Controllers
|
||||
* @subpackage Controller
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class ThreadController extends Controller {
|
||||
|
||||
/**
|
||||
* get the values from ticket_thread Table and direct to view page
|
||||
* @param type Ticket_thread $thread
|
||||
* @param type Priority $priority
|
||||
* @return type Response
|
||||
*/
|
||||
public function getTickets(Ticket_thread $thread, Priority $priority) {
|
||||
try {
|
||||
/* get the values of Ticket_thread from Ticket_thread Table */
|
||||
$threads = $thread->get();
|
||||
/* get the values of priority from Priority Table */
|
||||
$priorities = $priority->get();
|
||||
/* Direct to view page */
|
||||
return view('themes.default1.admin.helpdesk.tickets.ticket', compact('threads', 'priorities'));
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
}
|
||||
131
code/app/Http/Controllers/Agent/helpdesk/CannedController.php
Normal file
131
code/app/Http/Controllers/Agent/helpdesk/CannedController.php
Normal file
@@ -0,0 +1,131 @@
|
||||
<?php namespace App\Http\Controllers\Agent\helpdesk;
|
||||
// controllers
|
||||
use App\Http\Controllers\Controller;
|
||||
// requests
|
||||
use App\Http\Requests\helpdesk\CannedRequest;
|
||||
use App\Http\Requests\helpdesk\CannedUpdateRequest;
|
||||
// model
|
||||
use App\Model\helpdesk\Agent_panel\Canned;
|
||||
use App\User;
|
||||
|
||||
/**
|
||||
* UserController
|
||||
*
|
||||
* @package Controllers
|
||||
* @subpackage Controller
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class CannedController 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');
|
||||
// $this->middleware('roles');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
* @param type User $user
|
||||
* @return type Response
|
||||
*/
|
||||
public function index() {
|
||||
return view('themes.default1.agent.helpdesk.canned.index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
* @return type Response
|
||||
*/
|
||||
public function create() {
|
||||
return view('themes.default1.agent.helpdesk.canned.create');
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
* @param type User $user
|
||||
* @param type Sys_userRequest $request
|
||||
* @return type Response
|
||||
*/
|
||||
public function store(CannedRequest $request, Canned $canned) {
|
||||
$canned->user_id = \Auth::user()->id;
|
||||
$canned->title = $request->input('title');
|
||||
$canned->message = $request->input('message');
|
||||
$canned->save();
|
||||
return redirect()->route('canned.list')->with('success','Added Successfully');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
* @param type int $id
|
||||
* @param type User $user
|
||||
* @return type Response
|
||||
*/
|
||||
public function edit($id, Canned $canned) {
|
||||
$canned = $canned->where('user_id', '=', \Auth::user()->id)->where('id','=',$id)->first();
|
||||
return view('themes.default1.agent.helpdesk.canned.edit',compact('canned'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
* @param type int $id
|
||||
* @param type User $user
|
||||
* @param type Sys_userUpdate $request
|
||||
* @return type Response
|
||||
*/
|
||||
public function update($id, CannedUpdateRequest $request, Canned $canned) {
|
||||
|
||||
$canned = $canned->where('id','=',$id)->where('user_id', '=', \Auth::user()->id)->first();
|
||||
$canned->user_id = \Auth::user()->id;
|
||||
$canned->title = $request->input('title');
|
||||
$canned->message = $request->input('message');
|
||||
$canned->save();
|
||||
|
||||
return redirect()->route('canned.list')->with('success','Updated Successfully');
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
* @param type int $id
|
||||
* @param type User $user
|
||||
* @return type Response
|
||||
*/
|
||||
public function destroy($id, Canned $canned) {
|
||||
/* select the field where id = $id(request Id) */
|
||||
$canned = $canned->whereId($id)->first();
|
||||
/* delete the selected field */
|
||||
/* Check whether function success or not */
|
||||
if ($canned->delete() == true) {
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect()->route('canned.list')->with('success', 'User Deleted Successfully');
|
||||
} else {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect()->route('canned.list')->with('fails', 'User can not Delete');
|
||||
}
|
||||
return view('themes.default1.agent.helpdesk.canned.destroy');
|
||||
}
|
||||
|
||||
/**
|
||||
* get canned
|
||||
* @param type $id
|
||||
* @return type json
|
||||
*/
|
||||
public function get_canned($id) {
|
||||
if($id != "zzz") {
|
||||
$canned = Canned::where('id','=',$id)->where('user_id','=',\Auth::user()->id)->first();
|
||||
$msg = $canned->message;
|
||||
} else {
|
||||
$msg = "";
|
||||
}
|
||||
return \Response::json($msg);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
<?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()
|
||||
{
|
||||
$ticketlist = DB::table('tickets')
|
||||
->select(DB::raw('MONTH(updated_at) as month'),
|
||||
DB::raw('count(*) as tickets'))
|
||||
->groupBy('month')
|
||||
->orderBy('month', 'asc')
|
||||
->get();
|
||||
|
||||
return $ticketlist;
|
||||
}
|
||||
|
||||
}
|
||||
228
code/app/Http/Controllers/Agent/helpdesk/MailController.php
Normal file
228
code/app/Http/Controllers/Agent/helpdesk/MailController.php
Normal file
@@ -0,0 +1,228 @@
|
||||
<?php namespace App\Http\Controllers\Agent\helpdesk;
|
||||
// controllers
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Controllers\Agent\helpdesk\TicketController;
|
||||
// models
|
||||
use App\User;
|
||||
use App\Model\helpdesk\Email\Emails;
|
||||
use App\Model\helpdesk\Settings\Email;
|
||||
use App\Model\helpdesk\Ticket\Ticket_attachments;
|
||||
use App\Model\helpdesk\Ticket\Ticket_Thread;
|
||||
use App\Model\helpdesk\Settings\System;
|
||||
// classes
|
||||
use PhpImap\Mailbox as ImapMailbox;
|
||||
use PhpImap\IncomingMail;
|
||||
use PhpImap\IncomingMailAttachment;
|
||||
use \ForceUTF8\Encoding;
|
||||
use App;
|
||||
use DB;
|
||||
use Crypt;
|
||||
use Schedule;
|
||||
use File;
|
||||
use Artisan;
|
||||
|
||||
/**
|
||||
* MailController
|
||||
*
|
||||
* @package Controllers
|
||||
* @subpackage Controller
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class MailController extends Controller {
|
||||
|
||||
/**
|
||||
* constructor
|
||||
* Create a new controller instance.
|
||||
* @param type TicketController $TicketController
|
||||
*/
|
||||
public function __construct(TicketController $TicketController) {
|
||||
$this->TicketController = $TicketController;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reademails
|
||||
* @return type
|
||||
*/
|
||||
public function readmails(Emails $emails, Email $settings_email, System $system)
|
||||
{
|
||||
$path_url = $system->first()->url;
|
||||
if($settings_email->first()->email_fetching == 1)
|
||||
{
|
||||
if($settings_email->first()->all_emails == 1)
|
||||
{
|
||||
$helptopic = $this->TicketController->default_helptopic();
|
||||
$sla = $this->TicketController->default_sla();
|
||||
$email = $emails->get();
|
||||
foreach($email as $e_mail)
|
||||
{
|
||||
$dept = $e_mail->department;
|
||||
$host = $e_mail->fetching_host;
|
||||
$port = $e_mail->fetching_port;
|
||||
$protocol = $e_mail->mailbox_protocol;
|
||||
$imap_config = '{'.$host.':'.$port.$protocol.'}INBOX';
|
||||
|
||||
$password = Crypt::decrypt($e_mail->password);
|
||||
$mailbox = new ImapMailbox($imap_config, $e_mail->user_name, $password, __DIR__);
|
||||
$mails = array();
|
||||
$mailsIds = $mailbox->searchMailBox('SINCE '. date('d-M-Y', strtotime("-1 day")));
|
||||
if(!$mailsIds) {
|
||||
die('Mailbox is empty');
|
||||
}
|
||||
// dd($mailsIds);
|
||||
foreach($mailsIds as $mailId)
|
||||
{
|
||||
$overview = $mailbox->get_overview($mailId);
|
||||
$var = $overview[0]->seen ? 'read' : 'unread';
|
||||
if ($var == 'unread') {
|
||||
$mail = $mailbox->getMail($mailId);
|
||||
if($settings_email->email_collaborator == 1) {
|
||||
$collaborator = $mail->cc;
|
||||
} else {
|
||||
$collaborator = null;
|
||||
}
|
||||
$body = $mail->textHtml;
|
||||
// dd($mailId);
|
||||
if($body == null)
|
||||
{
|
||||
$body = $mailbox->backup_getmail($mailId);
|
||||
$body = str_replace('\r\n', '<br/>', $body);
|
||||
// var_dump($body);
|
||||
}
|
||||
// dd($body);
|
||||
$date = $mail->date;
|
||||
$datetime = $overview[0]->date;
|
||||
$date_time = explode(" ", $datetime);
|
||||
$date = $date_time[1] . "-" . $date_time[2] . "-" . $date_time[3] . " " . $date_time[4];
|
||||
$date = date('Y-m-d H:i:s', strtotime($date));
|
||||
|
||||
if(isset($mail->subject)){
|
||||
$subject = $mail->subject;
|
||||
} else {
|
||||
$subject = "No Subject";
|
||||
}
|
||||
|
||||
$fromname = $mail->fromName;
|
||||
$fromaddress = $mail->fromAddress;
|
||||
$source = "2";
|
||||
$phone = "";
|
||||
$priority = '1';
|
||||
$assign = "";
|
||||
$form_data = null;
|
||||
if ($this->TicketController->create_user($fromaddress, $fromname, $subject, $body, $phone, $helptopic, $sla, $priority, $source, $collaborator, $dept, $assign, $form_data) == true) {
|
||||
$thread_id = Ticket_Thread::whereRaw('id = (select max(`id`) from ticket_thread)')->first();
|
||||
$thread_id = $thread_id->id;
|
||||
|
||||
foreach($mail->getAttachments() as $attachment)
|
||||
{
|
||||
$support = "support";
|
||||
// echo $_SERVER['DOCUMENT_ROOT'];
|
||||
$dir_img_paths = __DIR__;
|
||||
$dir_img_path = explode('/code', $dir_img_paths);
|
||||
$filepath = explode('../../../../../public/',$attachment->filePath);
|
||||
$path = $dir_img_path[0]."/code/public/".$filepath[1];
|
||||
// dd($path);
|
||||
$filesize = filesize($path);
|
||||
$file_data = file_get_contents($path);
|
||||
$ext = pathinfo($attachment->filePath, PATHINFO_EXTENSION);
|
||||
$imageid = $attachment->id;
|
||||
$string = str_replace('-', '', $attachment->name);
|
||||
$filename = explode('src', $attachment->filePath);
|
||||
$filename = str_replace('\\', '', $filename);
|
||||
$body = str_replace("cid:".$imageid, $filepath[1], $body);
|
||||
$pos = strpos($body, $filepath[1]);
|
||||
|
||||
if($pos == false) {
|
||||
|
||||
if($settings_email->first()->attachment == 1) {
|
||||
$upload = new Ticket_attachments;
|
||||
$upload->file = $file_data;
|
||||
$upload->thread_id = $thread_id;
|
||||
$upload->name = $filepath[1];
|
||||
$upload->type = $ext;
|
||||
$upload->size = $filesize;
|
||||
$upload->poster = "ATTACHMENT";
|
||||
$upload->save();
|
||||
}
|
||||
} else {
|
||||
$upload = new Ticket_attachments;
|
||||
$upload->file = $file_data;
|
||||
$upload->thread_id = $thread_id;
|
||||
$upload->name = $filepath[1];
|
||||
$upload->type = $ext;
|
||||
$upload->size = $filesize;
|
||||
$upload->poster = "INLINE";
|
||||
$upload->save();
|
||||
}
|
||||
unlink($path);
|
||||
}
|
||||
$body = Encoding::fixUTF8($body);
|
||||
$thread = Ticket_Thread::where('id','=',$thread_id)->first();
|
||||
$thread->body = $this->separate_reply($body) ;
|
||||
$thread->save();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* separate reply
|
||||
* @param type $body
|
||||
* @return type string
|
||||
*/
|
||||
public function separate_reply($body) {
|
||||
$body2 = explode('---Reply above this line---', $body);
|
||||
$body3 = $body2[0];
|
||||
return $body3;
|
||||
}
|
||||
|
||||
/**
|
||||
* Decode Imap text
|
||||
* @param type $str
|
||||
* @return type string
|
||||
*/
|
||||
public function decode_imap_text($str) {
|
||||
$result = '';
|
||||
$decode_header = imap_mime_header_decode($str);
|
||||
foreach ($decode_header AS $obj) {
|
||||
$result .= htmlspecialchars(rtrim($obj->text, "\t"));
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* fetch_attachments
|
||||
* @return type
|
||||
*/
|
||||
public function fetch_attachments(){
|
||||
$uploads = Upload::all();
|
||||
foreach($uploads as $attachment) {
|
||||
$image = @imagecreatefromstring($attachment->file);
|
||||
ob_start();
|
||||
imagejpeg($image, null, 80);
|
||||
$data = ob_get_contents();
|
||||
ob_end_clean();
|
||||
$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>';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* function to load data
|
||||
* @param type $id
|
||||
* @return type file
|
||||
*/
|
||||
public function get_data($id){
|
||||
$attachments = App\Model\helpdesk\Ticket\Ticket_attachments::where('id','=',$id)->get();
|
||||
foreach($attachments as $attachment)
|
||||
{
|
||||
header('Content-type: application/'.$attachment->type.'');
|
||||
header('Content-Disposition: inline; filename='.$attachment->name.'');
|
||||
header('Content-Transfer-Encoding: binary');
|
||||
echo $attachment->file;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,185 @@
|
||||
<?php namespace App\Http\Controllers\Agent\helpdesk;
|
||||
// controllers
|
||||
use App\Http\Controllers\Controller;
|
||||
// requests
|
||||
use App\Http\Requests\helpdesk\OrganizationRequest;
|
||||
/* include organization model */
|
||||
use App\Http\Requests\helpdesk\OrganizationUpdate;
|
||||
// models
|
||||
/* Define OrganizationRequest to validate the create form */
|
||||
use App\Model\helpdesk\Agent_panel\Organization;
|
||||
/* Define OrganizationUpdate to validate the create form */
|
||||
use App\Model\helpdesk\Agent_panel\User_org_head;
|
||||
|
||||
/**
|
||||
* OrganizationController
|
||||
*
|
||||
* @package Controllers
|
||||
* @subpackage Controller
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class OrganizationController 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');
|
||||
// $this->middleware('roles');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
* @param type Organization $org
|
||||
* @return type Response
|
||||
*/
|
||||
public function index() {
|
||||
try {
|
||||
/* get all values of table organization */
|
||||
return view('themes.default1.agent.helpdesk.organization.index');
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
* @return type Response
|
||||
*/
|
||||
public function create() {
|
||||
try {
|
||||
return view('themes.default1.agent.helpdesk.organization.create');
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
* @param type Organization $org
|
||||
* @param type OrganizationRequest $request
|
||||
* @return type Response
|
||||
*/
|
||||
public function store(Organization $org, OrganizationRequest $request) {
|
||||
try {
|
||||
/* Insert the all input request to organization table */
|
||||
/* Check whether function success or not */
|
||||
if ($org->fill($request->input())->save() == true) {
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('organizations')->with('success', 'Organization Created Successfully');
|
||||
} else {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('organizations')->with('fails', 'Organization can not Create');
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('organizations')->with('fails', 'Organization can not Create');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param type $id
|
||||
* @param type Organization $org
|
||||
* @return type Response
|
||||
*/
|
||||
public function show($id, Organization $org) {
|
||||
try {
|
||||
/* select the field by id */
|
||||
$orgs = $org->whereId($id)->first();
|
||||
/* To view page */
|
||||
return view('themes.default1.agent.helpdesk.organization.show', compact('orgs'));
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param type $id
|
||||
* @param type Organization $org
|
||||
* @return type Response
|
||||
*/
|
||||
public function edit($id, Organization $org) {
|
||||
try {
|
||||
/* select the field by id */
|
||||
$orgs = $org->whereId($id)->first();
|
||||
/* To view page */
|
||||
return view('themes.default1.agent.helpdesk.organization.edit', compact('orgs'));
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param type $id
|
||||
* @param type Organization $org
|
||||
* @param type OrganizationUpdate $request
|
||||
* @return type Response
|
||||
*/
|
||||
public function update($id, Organization $org, OrganizationUpdate $request) {
|
||||
try {
|
||||
/* select the field by id */
|
||||
$orgs = $org->whereId($id)->first();
|
||||
/* update the organization table */
|
||||
/* Check whether function success or not */
|
||||
if ($orgs->fill($request->input())->save() == true) {
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('organizations')->with('success', 'Organization Updated Successfully');
|
||||
} else {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('organizations')->with('fails', 'Organization can not Update');
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('organizations')->with('fails', 'Organization can not Update');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
* @param type int $id
|
||||
* @return type Response
|
||||
*/
|
||||
public function destroy($id, Organization $org) {
|
||||
try {
|
||||
// User_org
|
||||
/* select the field by id */
|
||||
$orgs = $org->whereId($id)->first();
|
||||
/* Delete the field selected from the table */
|
||||
/* Check whether function success or not */
|
||||
if ($orgs->delete() == true) {
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('organizations')->with('success', 'Organization Deleted Successfully');
|
||||
} else {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('organizations')->with('fails', 'Organization can not Delete');
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('organizations')->with('fails', 'Organization can not Delete');
|
||||
}
|
||||
}
|
||||
|
||||
public function Head_Org($id){
|
||||
|
||||
$head_user = \Input::get('user');
|
||||
|
||||
$org_head = Organization::where('id','=',$id)->first();
|
||||
$org_head->head = $head_user;
|
||||
$org_head->save();
|
||||
return 1;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
<?php namespace App\Http\Controllers\Agent\helpdesk;
|
||||
// controllers
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Controllers\Agent\helpdesk\TicketController;
|
||||
use App\Http\Controllers\Common\SettingsController;
|
||||
// requests
|
||||
use App\Http\Requests\helpdesk\CreateTicketRequest;
|
||||
use App\Http\Requests\helpdesk\TicketRequest;
|
||||
use App\Http\Requests\helpdesk\TicketEditRequest;
|
||||
// models
|
||||
use App\Model\helpdesk\Email\Banlist;
|
||||
use App\Model\helpdesk\Ticket\Tickets;
|
||||
use App\Model\helpdesk\Ticket\Ticket_attachments;
|
||||
use App\Model\helpdesk\Ticket\Ticket_Collaborator;
|
||||
use App\Model\helpdesk\Ticket\Ticket_Thread;
|
||||
use App\Model\helpdesk\Settings\Company;
|
||||
use App\Model\helpdesk\Settings\System;
|
||||
use App\Model\helpdesk\Settings\Alert;
|
||||
use App\Model\helpdesk\Ticket\Ticket_Status;
|
||||
use App\Model\helpdesk\Email\Emails;
|
||||
use App\Model\helpdesk\Agent\Department;
|
||||
use App\User;
|
||||
// classes
|
||||
use Auth;
|
||||
use Hash;
|
||||
use Input;
|
||||
use Mail;
|
||||
use PDF;
|
||||
|
||||
/**
|
||||
* TicketController2
|
||||
*
|
||||
* @package Controllers
|
||||
* @subpackage Controller
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class Ticket2Controller extends Controller {
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
* @return type response
|
||||
*/
|
||||
public function __construct() {
|
||||
SettingsController::smtp();
|
||||
$this->middleware('auth');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the Inbox ticket list page
|
||||
* @return type response
|
||||
*/
|
||||
public function deptopen($id) {
|
||||
$dept = Department::where('name','=',$id)->first();
|
||||
if(Auth::user()->role == 'agent') {
|
||||
if(Auth::user()->dept_id == $dept->id) {
|
||||
return view('themes.default1.agent.helpdesk.dept-ticket.open',compact('id'));
|
||||
} else {
|
||||
return redirect()->back()->with('fails','Unauthorised!');
|
||||
}
|
||||
} else {
|
||||
return view('themes.default1.agent.helpdesk.dept-ticket.open',compact('id'));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the Inbox ticket list page
|
||||
* @return type response
|
||||
*/
|
||||
public function deptclose($id) {
|
||||
$dept = Department::where('name','=',$id)->first();
|
||||
if(Auth::user()->role == 'agent') {
|
||||
if(Auth::user()->dept_id == $dept->id) {
|
||||
return view('themes.default1.agent.helpdesk.dept-ticket.closed',compact('id'));
|
||||
} else {
|
||||
return redirect()->back()->with('fails','Unauthorised!');
|
||||
}
|
||||
} else {
|
||||
return view('themes.default1.agent.helpdesk.dept-ticket.closed',compact('id'));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the Inbox ticket list page
|
||||
* @return type response
|
||||
*/
|
||||
public function deptinprogress($id) {
|
||||
$dept = Department::where('name','=',$id)->first();
|
||||
if(Auth::user()->role == 'agent') {
|
||||
if(Auth::user()->dept_id == $dept->id) {
|
||||
return view('themes.default1.agent.helpdesk.dept-ticket.inprogress',compact('id'));
|
||||
} else {
|
||||
return redirect()->back()->with('fails','Unauthorised!');
|
||||
}
|
||||
} else {
|
||||
return view('themes.default1.agent.helpdesk.dept-ticket.inprogress',compact('id'));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
1312
code/app/Http/Controllers/Agent/helpdesk/TicketController.php
Normal file
1312
code/app/Http/Controllers/Agent/helpdesk/TicketController.php
Normal file
File diff suppressed because it is too large
Load Diff
322
code/app/Http/Controllers/Agent/helpdesk/UserController.php
Normal file
322
code/app/Http/Controllers/Agent/helpdesk/UserController.php
Normal file
@@ -0,0 +1,322 @@
|
||||
<?php namespace App\Http\Controllers\Agent\helpdesk;
|
||||
// controllers
|
||||
use App\Http\Controllers\Controller;
|
||||
// requests
|
||||
/* Include Sys_user Model */
|
||||
use App\Http\Requests\helpdesk\ProfilePassword;
|
||||
/* For validation include Sys_userRequest in create */
|
||||
use App\Http\Requests\helpdesk\ProfileRequest;
|
||||
/* For validation include Sys_userUpdate in update */
|
||||
use App\Http\Requests\helpdesk\Sys_userRequest;
|
||||
/* include guest_note model */
|
||||
use App\Http\Requests\helpdesk\Sys_userUpdate;
|
||||
// models
|
||||
use App\Model\helpdesk\Agent_panel\Organization;
|
||||
use App\Model\helpdesk\Agent_panel\User_org;
|
||||
/* include User Model */
|
||||
/* include Help_topic Model */
|
||||
/* Profile validator */
|
||||
/* Profile Password validator */
|
||||
use App\User;
|
||||
// classes
|
||||
/* include ticket_thred model */
|
||||
use Auth;
|
||||
/* include tickets model */
|
||||
use Hash;
|
||||
/* TicketRequest to validate the ticket response */
|
||||
/* Validate post check ticket */
|
||||
use Input;
|
||||
use Redirect;
|
||||
|
||||
/**
|
||||
* UserController
|
||||
*
|
||||
* @package Controllers
|
||||
* @subpackage Controller
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class UserController 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');
|
||||
// $this->middleware('roles');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
* @param type User $user
|
||||
* @return type Response
|
||||
*/
|
||||
public function index() {
|
||||
try {
|
||||
/* get all values in Sys_user */
|
||||
return view('themes.default1.agent.helpdesk.user.index');
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
* @return type Response
|
||||
*/
|
||||
public function create() {
|
||||
try {
|
||||
return view('themes.default1.agent.helpdesk.user.create');
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
* @param type User $user
|
||||
* @param type Sys_userRequest $request
|
||||
* @return type Response
|
||||
*/
|
||||
public function store(User $user, Sys_userRequest $request) {
|
||||
try {
|
||||
/* insert the input request to sys_user table */
|
||||
/* Check whether function success or not */
|
||||
$user->email = $request->input('email');
|
||||
$user->user_name = $request->input('full_name');
|
||||
$user->mobile = $request->input('mobile');
|
||||
$user->ext = $request->input('ext');
|
||||
$user->phone_number = $request->input('phone_number');
|
||||
$user->active = $request->input('active');
|
||||
$user->internal_note = $request->input('internal_note');
|
||||
$user->role = 'user';
|
||||
if ($user->save() == true) {
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('user')->with('success', 'User Created Successfully');
|
||||
} else {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('user')->with('fails', 'User can not Create');
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('user')->with('fails', 'User can not Create');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
* @param type int $id
|
||||
* @param type User $user
|
||||
* @return type Response
|
||||
*/
|
||||
public function show($id, User $user) {
|
||||
try {
|
||||
/* select the field where id = $id(request Id) */
|
||||
$users = $user->whereId($id)->first();
|
||||
return view('themes.default1.agent.helpdesk.user.show', compact('users'));
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
* @param type int $id
|
||||
* @param type User $user
|
||||
* @return type Response
|
||||
*/
|
||||
public function edit($id, User $user) {
|
||||
try {
|
||||
/* select the field where id = $id(request Id) */
|
||||
$users = $user->whereId($id)->first();
|
||||
return view('themes.default1.agent.helpdesk.user.edit', compact('users'));
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
* @param type int $id
|
||||
* @param type User $user
|
||||
* @param type Sys_userUpdate $request
|
||||
* @return type Response
|
||||
*/
|
||||
public function update($id, User $user, Sys_userUpdate $request) {
|
||||
try {
|
||||
/* select the field where id = $id(request Id) */
|
||||
$users = $user->whereId($id)->first();
|
||||
/* Update the value by selected field */
|
||||
/* Check whether function success or not */
|
||||
if ($users->fill($request->input())->save() == true) {
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('user')->with('success', 'User Updated Successfully');
|
||||
} else {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('user')->with('fails', 'User can not Update');
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('user')->with('fails', 'User can not Update');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
* @param type int $id
|
||||
* @param type User $user
|
||||
* @return type Response
|
||||
*/
|
||||
public function destroy($id, User $user) {
|
||||
try {
|
||||
/* select the field where id = $id(request Id) */
|
||||
$users = $user->whereId($id)->first();
|
||||
/* delete the selected field */
|
||||
/* Check whether function success or not */
|
||||
if ($users->delete() == true) {
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('user')->with('success', 'User Deleted Successfully');
|
||||
} else {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('user')->with('fails', 'User can not Delete');
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('user')->with('fails', 'User can not Delete');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* get profile page
|
||||
* @return type Response
|
||||
*/
|
||||
public function getProfile() {
|
||||
$user = Auth::user();
|
||||
return view('themes.default1.agent.helpdesk.user.profile', compact('user'));
|
||||
}
|
||||
|
||||
/**
|
||||
* get profile edit page
|
||||
* @return type Response
|
||||
*/
|
||||
public function getProfileedit() {
|
||||
$user = Auth::user();
|
||||
return view('themes.default1.agent.helpdesk.user.profile-edit', compact('user'));
|
||||
}
|
||||
|
||||
/**
|
||||
* post profile page
|
||||
* @param type int $id
|
||||
* @param type ProfileRequest $request
|
||||
* @return type Response
|
||||
*/
|
||||
public function postProfileedit(ProfileRequest $request) {
|
||||
$user = Auth::user();
|
||||
$user->gender = $request->input('gender');
|
||||
$user->save();
|
||||
if ($user->profile_pic == 'avatar5.png' || $user->profile_pic == 'avatar2.png') {
|
||||
if ($request->input('gender') == 1) {
|
||||
$name = 'avatar5.png';
|
||||
$destinationPath = 'lb-faveo/profilepic';
|
||||
$user->profile_pic = $name;
|
||||
} elseif ($request->input('gender') == 0) {
|
||||
$name = 'avatar2.png';
|
||||
$destinationPath = 'lb-faveo/profilepic';
|
||||
$user->profile_pic = $name;
|
||||
}
|
||||
}
|
||||
if (Input::file('profile_pic')) {
|
||||
//$extension = Input::file('profile_pic')->getClientOriginalExtension();
|
||||
$name = Input::file('profile_pic')->getClientOriginalName();
|
||||
$destinationPath = 'lb-faveo/profilepic';
|
||||
$fileName = rand(0000, 9999) . '.' . $name;
|
||||
//echo $fileName;
|
||||
Input::file('profile_pic')->move($destinationPath, $fileName);
|
||||
$user->profile_pic = $fileName;
|
||||
} else {
|
||||
$user->fill($request->except('profile_pic', 'gender'))->save();
|
||||
return Redirect::route('profile')->with('success', 'Profile Updated sucessfully');
|
||||
}
|
||||
if ($user->fill($request->except('profile_pic'))->save()) {
|
||||
return Redirect::route('profile')->with('success', 'Profile Updated sucessfully');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Post profile password
|
||||
* @param type int $id
|
||||
* @param type ProfilePassword $request
|
||||
* @return type Response
|
||||
*/
|
||||
public function postProfilePassword($id, ProfilePassword $request) {
|
||||
$user = Auth::user();
|
||||
//echo $user->password;
|
||||
if (Hash::check($request->input('old_password'), $user->getAuthPassword())) {
|
||||
$user->password = Hash::make($request->input('new_password'));
|
||||
$user->save();
|
||||
return redirect('profile-edit')->with('success1', 'Password Updated sucessfully');
|
||||
} else {
|
||||
return redirect('profile-edit')->with('fails1', 'Password was not Updated. Incorrect old password');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* User Assign Org
|
||||
* @param type $id
|
||||
* @return type boolean
|
||||
*/
|
||||
public function UserAssignOrg($id) {
|
||||
$org = Input::get('org');
|
||||
$user_org = new User_org;
|
||||
$user_org->org_id = $org;
|
||||
$user_org->user_id = $id;
|
||||
$user_org->save();
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* user create organisation
|
||||
* @return type value
|
||||
*/
|
||||
public function User_Create_Org($id) {
|
||||
|
||||
if(Input::get('website')!=null) {
|
||||
// checking website
|
||||
$check = Organization::where('website','=',Input::get('website'))->first();
|
||||
} else {
|
||||
$check = null;
|
||||
}
|
||||
|
||||
// checking name
|
||||
$check2 = Organization::where('name','=',Input::get('name'))->first();
|
||||
|
||||
if (\Input::get('name') == null) {
|
||||
return "Name is required";
|
||||
} elseif($check2 != null) {
|
||||
return "Name should be Unique";
|
||||
} elseif($check != null) {
|
||||
return "Website should be Unique";
|
||||
} else {
|
||||
$org = new Organization;
|
||||
$org->name = Input::get('name');
|
||||
$org->phone = Input::get('phone');
|
||||
$org->website = Input::get('website');
|
||||
$org->address = Input::get('address');
|
||||
$org->internal_notes = Input::get('internal');
|
||||
$org->save();
|
||||
|
||||
$user_org = new User_org;
|
||||
$user_org->org_id = $org->id;
|
||||
$user_org->user_id = $id;
|
||||
$user_org->save();
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
168
code/app/Http/Controllers/Auth/AuthController.php
Normal file
168
code/app/Http/Controllers/Auth/AuthController.php
Normal file
@@ -0,0 +1,168 @@
|
||||
<?php namespace App\Http\Controllers\Auth;
|
||||
// controllers
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Controllers\Common\SettingsController;
|
||||
// requests
|
||||
use App\Http\Requests\helpdesk\LoginRequest;
|
||||
use App\Http\Requests\helpdesk\RegisterRequest;
|
||||
use App\User;
|
||||
// classes
|
||||
/* include User Model */
|
||||
use Hash;
|
||||
/* Include RegisterRequest */
|
||||
use Illuminate\Contracts\Auth\Guard;
|
||||
/* Register validation */
|
||||
use Illuminate\Contracts\Auth\Registrar;
|
||||
use Illuminate\Foundation\Auth\AuthenticatesAndRegistersUsers;
|
||||
/* Include login validator */
|
||||
use Mail;
|
||||
use Auth;
|
||||
|
||||
/**
|
||||
* ---------------------------------------------------
|
||||
* AuthController
|
||||
* ---------------------------------------------------
|
||||
* This controller handles the registration of new users, as well as the
|
||||
* authentication of existing users. By default, this controller uses
|
||||
* a simple trait to add these behaviors. Why don't you explore it?
|
||||
*
|
||||
* @package Controllers
|
||||
* @subpackage Controller
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class AuthController extends Controller {
|
||||
|
||||
use AuthenticatesAndRegistersUsers;
|
||||
/* to redirect after login */
|
||||
// if auth is agent
|
||||
protected $redirectTo = '/dashboard';
|
||||
// if auth is user
|
||||
protected $redirectToUser = '/profile';
|
||||
/* Direct After Logout */
|
||||
protected $redirectAfterLogout = '/';
|
||||
protected $loginPath = '/auth/login';
|
||||
|
||||
/**
|
||||
* Create a new authentication controller instance.
|
||||
*
|
||||
* @param \Illuminate\Contracts\Auth\Guard $auth
|
||||
* @param \Illuminate\Contracts\Auth\Registrar $registrar
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Guard $auth, Registrar $registrar) {
|
||||
SettingsController::smtp();
|
||||
$this->auth = $auth;
|
||||
$this->registrar = $registrar;
|
||||
$this->middleware('guest', ['except' => 'getLogout']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the form for registration
|
||||
* @return type Response
|
||||
*/
|
||||
public function getRegister() {
|
||||
if(Auth::user()) {
|
||||
if(Auth::user()->role == "admin" || Auth::user()->role == "agent") {
|
||||
return \Redirect::route('dashboard');
|
||||
} elseif(Auth::user()->role == "user") {
|
||||
// return view('auth.register');
|
||||
}
|
||||
} else {
|
||||
return view('auth.register');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Post registration form
|
||||
* @param type User $user
|
||||
* @param type RegisterRequest $request
|
||||
* @return type Response
|
||||
*/
|
||||
public function postRegister(User $user, RegisterRequest $request) {
|
||||
$password = Hash::make($request->input('password'));
|
||||
$user->password = $password;
|
||||
$name = $request->input('full_name');
|
||||
$user->user_name = $name;
|
||||
$user->email = $request->input('email');
|
||||
// $user->first_name = $request->input('first_name');
|
||||
// $user->last_nmae = $request->input('last_nmae');
|
||||
// $user->phone_number = $request->input('phone_number');
|
||||
// $user->company = $request->input('company');
|
||||
$user->role = 'user';
|
||||
$code = str_random(60);
|
||||
$user->remember_token = $code;
|
||||
$user->save();
|
||||
// send mail for successful registration
|
||||
$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');
|
||||
});
|
||||
return redirect('home')->with('success', 'Activate Your Account ! Click on Link that send to your mail');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get mail function
|
||||
* @param type $token
|
||||
* @param type User $user
|
||||
* @return type Response
|
||||
*/
|
||||
public function getMail($token, User $user) {
|
||||
$user = $user->where('remember_token', $token)->where('active', 0)->first();
|
||||
if ($user) {
|
||||
$user->active = 1;
|
||||
$user->save();
|
||||
return redirect('auth/login');
|
||||
} else {
|
||||
return redirect('auth/login');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get login page
|
||||
* @return type Response
|
||||
*/
|
||||
public function getLogin() {
|
||||
if(Auth::user()) {
|
||||
if(Auth::user()->role == "admin" || Auth::user()->role == "agent"){
|
||||
return \Redirect::route('dashboard');
|
||||
} elseif(Auth::user()->role == "user") {
|
||||
return \Redirect::route('home');
|
||||
}
|
||||
} else {
|
||||
return view('auth.login');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Post of login page
|
||||
* @param type LoginRequest $request
|
||||
* @return type Response
|
||||
*/
|
||||
public function postLogin(LoginRequest $request) {
|
||||
// $email = $request->input('email');
|
||||
// $password = Hash::make($request->input('password'));
|
||||
// $remember = $request->input('remember');
|
||||
// dd([$email,$password,$remember]);
|
||||
$credentials = $request->only('email', 'password');
|
||||
if ($this->auth->attempt($credentials, $request->has('remember'))) {
|
||||
if(Auth::user()->role == 'user') {
|
||||
return \Redirect::route('home');
|
||||
} else {
|
||||
return redirect()->intended($this->redirectPath());
|
||||
}
|
||||
}
|
||||
return redirect($this->loginPath())
|
||||
->withInput($request->only('email', 'remember'))
|
||||
->withErrors([
|
||||
'email' => $this->getFailedLoginMessage(),
|
||||
'password' => $this->getFailedLoginMessage(),
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Failed login message
|
||||
* @return type string
|
||||
*/
|
||||
protected function getFailedLoginMessage() {
|
||||
return 'This Field do not match our records.';
|
||||
}
|
||||
}
|
||||
53
code/app/Http/Controllers/Auth/PasswordController.php
Normal file
53
code/app/Http/Controllers/Auth/PasswordController.php
Normal file
@@ -0,0 +1,53 @@
|
||||
<?php namespace App\Http\Controllers\Auth;
|
||||
// classes
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Contracts\Auth\Guard;
|
||||
use Illuminate\Contracts\Auth\PasswordBroker;
|
||||
use Illuminate\Foundation\Auth\ResetsPasswords;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
|
||||
use App\User;
|
||||
|
||||
use App\Http\Controllers\Common\SettingsController;
|
||||
|
||||
|
||||
/**
|
||||
* PasswordController
|
||||
*
|
||||
* @package Controllers
|
||||
* @subpackage Controller
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class PasswordController extends Controller {
|
||||
|
||||
use ResetsPasswords;
|
||||
|
||||
/**
|
||||
* Create a new password controller instance.
|
||||
*
|
||||
* @param \Illuminate\Contracts\Auth\Guard $auth
|
||||
* @param \Illuminate\Contracts\Auth\PasswordBroker $passwords
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Guard $auth, PasswordBroker $passwords) {
|
||||
$this->auth = $auth;
|
||||
$this->passwords = $passwords;
|
||||
$this->middleware('guest');
|
||||
SettingsController::smtp();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Display the form to request a password reset link.
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function getEmail()
|
||||
{
|
||||
return view('auth.password');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
<?php namespace App\Http\Controllers\Client\helpdesk;
|
||||
// controllers
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Controllers\Agent\helpdesk\TicketController;
|
||||
use App\Http\Controllers\Common\SettingsController;
|
||||
// requests
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Requests\helpdesk\CreateTicketRequest;
|
||||
use App\Http\Requests\helpdesk\TicketRequest;
|
||||
use App\Http\Requests\helpdesk\TicketEditRequest;
|
||||
|
||||
// models
|
||||
use App\Model\helpdesk\Email\Banlist;
|
||||
use App\Model\helpdesk\Ticket\Tickets;
|
||||
use App\Model\helpdesk\Ticket\Ticket_attachments;
|
||||
use App\Model\helpdesk\Ticket\Ticket_Collaborator;
|
||||
use App\Model\helpdesk\Ticket\Ticket_Thread;
|
||||
use App\Model\helpdesk\Settings\Company;
|
||||
use App\Model\helpdesk\Settings\System;
|
||||
use App\Model\helpdesk\Settings\Alert;
|
||||
use App\Model\helpdesk\Ticket\Ticket_Status;
|
||||
use App\Model\helpdesk\Email\Emails;
|
||||
use App\Model\helpdesk\Agent\Department;
|
||||
use App\User;
|
||||
// classes
|
||||
use Auth;
|
||||
use Hash;
|
||||
use Input;
|
||||
use Mail;
|
||||
use PDF;
|
||||
|
||||
/**
|
||||
* TicketController2
|
||||
*
|
||||
* @package Controllers
|
||||
* @subpackage Controller
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class ClientTicketController extends Controller {
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
* @return type response
|
||||
*/
|
||||
public function __construct() {
|
||||
SettingsController::smtp();
|
||||
// $this->middleware('auth');
|
||||
// $this->middleware('role.user');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Checked ticket
|
||||
* @param type Tickets $ticket
|
||||
* @param type User $user
|
||||
* @return type response
|
||||
*/
|
||||
public function getCheckTicket(Tickets $ticket, User $user) {
|
||||
return view('themes.default1.client.helpdesk.guest-user.newticket', compact('ticket'));
|
||||
}
|
||||
|
||||
/**
|
||||
* reply
|
||||
* @param type $value
|
||||
* @return type view
|
||||
*/
|
||||
public function reply($id, Request $request) {
|
||||
$comment = $request->input('comment');
|
||||
if($comment != null) {
|
||||
$tickets = Tickets::where('id','=',$id)->first();
|
||||
$threads = new Ticket_Thread;
|
||||
$threads->user_id = Auth::user()->id;
|
||||
$threads->ticket_id = $tickets->id;
|
||||
$threads->poster = "client";
|
||||
$threads->body = $comment;
|
||||
$threads->save();
|
||||
return \Redirect::back()->with('success1','Successfully replied');
|
||||
} else {
|
||||
return \Redirect::back()->with('fails1','Please fill some data!');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
<?php namespace App\Http\Controllers\Client\helpdesk;
|
||||
// controllers
|
||||
use App\Http\Controllers\Controller;
|
||||
// models
|
||||
use App\Model\helpdesk\Email\Emails;
|
||||
|
||||
|
||||
/**
|
||||
* EmailController
|
||||
*
|
||||
* @package Controllers
|
||||
* @subpackage Controller
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class OuthouseController extends Controller {
|
||||
|
||||
/**
|
||||
* post port
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function port()
|
||||
{
|
||||
$port = Emails::where('id','=','1')->first();
|
||||
$portvalue = $port->option_value;
|
||||
|
||||
return $portvalue;
|
||||
}
|
||||
|
||||
/**
|
||||
* post host
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function host()
|
||||
{
|
||||
$host=Option::where('option_name','=','host')->first();
|
||||
$hostvalue=$host->option_value;
|
||||
|
||||
return $hostvalue;
|
||||
}
|
||||
|
||||
/**
|
||||
* post username
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function username()
|
||||
{
|
||||
$username=Option::where('option_name','=','username')->first();
|
||||
$uservalue=$username->option_value;
|
||||
|
||||
return $uservalue;
|
||||
}
|
||||
|
||||
/**
|
||||
* post passowrd
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function password()
|
||||
{
|
||||
$password=Option::where('option_name','=','password')->first();
|
||||
$passvalue=$password->option_value;
|
||||
|
||||
return $passvalue;
|
||||
}
|
||||
|
||||
/**
|
||||
* post encryption
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function encryption()
|
||||
{
|
||||
$encryption=Option::where('option_name','=','encryption')->first();
|
||||
$encryptvalue=$encryption->option_value;
|
||||
|
||||
return $encryptvalue;
|
||||
}
|
||||
|
||||
}
|
||||
198
code/app/Http/Controllers/Client/helpdesk/FormController.php
Normal file
198
code/app/Http/Controllers/Client/helpdesk/FormController.php
Normal file
@@ -0,0 +1,198 @@
|
||||
<?php namespace App\Http\Controllers\Client\helpdesk;
|
||||
// controllers
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Controllers\Agent\helpdesk\TicketController;
|
||||
use App\Http\Controllers\Common\SettingsController;
|
||||
// requests
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Requests\helpdesk\ClientRequest;
|
||||
// models
|
||||
/* include help topic model */
|
||||
use App\Model\helpdesk\Form\Form_details;
|
||||
/* Include form_name model */
|
||||
use App\Model\helpdesk\Form\Form_name;
|
||||
/* include form_detals model */
|
||||
/* Include form_value model */
|
||||
use App\Model\helpdesk\Manage\Help_topic;
|
||||
use App\Model\helpdesk\Settings\Company;
|
||||
/* Validate form TicketForm using */
|
||||
use App\Model\helpdesk\Ticket\Tickets;
|
||||
use App\Model\helpdesk\Ticket\Ticket_Thread;
|
||||
use App\Model\helpdesk\Settings\System;
|
||||
use App\Model\helpdesk\Settings\Ticket;
|
||||
use App\Model\helpdesk\Agent\Department;
|
||||
use App\Model\helpdesk\Ticket\Ticket_source;
|
||||
use App\User;
|
||||
// classes
|
||||
use Form;
|
||||
use Input;
|
||||
use Mail;
|
||||
use Hash;
|
||||
use Redirect;
|
||||
use Config;
|
||||
|
||||
use DateTime;
|
||||
use DateTimeZone;
|
||||
use App\Model\helpdesk\Form\Fields;
|
||||
use App\Model\helpdesk\Form\Form_value;
|
||||
|
||||
|
||||
/**
|
||||
* FormController
|
||||
*
|
||||
* @package Controllers
|
||||
* @subpackage Controller
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class FormController extends Controller {
|
||||
|
||||
public function __construct(TicketController $TicketController) {
|
||||
SettingsController::smtp();
|
||||
$this->TicketController = $TicketController;
|
||||
}
|
||||
|
||||
// /**
|
||||
// * This Function to get the form for the ticket
|
||||
// * @param type Form_name $name
|
||||
// * @param type Form_details $details
|
||||
// * @param type Help_topic $topics
|
||||
// * @return type Response
|
||||
// */
|
||||
// public function getForm() {
|
||||
// if(Config::get('database.install') == '%0%') {
|
||||
// return Redirect::route('license');
|
||||
// }
|
||||
// if(System::first()->status == 1) {
|
||||
// return view('themes.default1.client.helpdesk.guest-user.form');
|
||||
// } else {
|
||||
// return "hello";
|
||||
// }
|
||||
// }
|
||||
|
||||
/**
|
||||
* getform
|
||||
* @param type Help_topic $topic
|
||||
* @return type
|
||||
*/
|
||||
public function getForm(Help_topic $topic) {
|
||||
if(\Config::get('database.install') == '%0%') {
|
||||
return \Redirect::route('license');
|
||||
}
|
||||
if(System::first()->status == 1) {
|
||||
$topics = $topic->get();
|
||||
return view('themes.default1.client.helpdesk.form', compact('topics'));
|
||||
} else {
|
||||
return \Redirect::route('home');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This Function to post the form for the ticket
|
||||
* @param type Form_name $name
|
||||
* @param type Form_details $details
|
||||
* @return type string
|
||||
*/
|
||||
public function postForm($id,Form_name $name, Form_details $details, Help_topic $topic) {
|
||||
// dd($id);
|
||||
if($id != 0 ){
|
||||
$helptopic = $topic->where('id', '=', $id)->first();
|
||||
$custom_form = $helptopic->custom_form;
|
||||
$values = Fields::where('forms_id', '=', $custom_form)->get();
|
||||
if(!$values) {
|
||||
} if($values) {
|
||||
foreach($values as $value){
|
||||
if($value->type == "select") {
|
||||
$data = $value->value;
|
||||
$value = explode(',', $data);
|
||||
echo '<select class="form-control">';
|
||||
foreach($value as $option){
|
||||
echo '<option>'.$option.'</option>';
|
||||
}
|
||||
echo '</select></br>';
|
||||
} elseif ($value->type == "radio" ) {
|
||||
$type2 = $value->value;
|
||||
$val = explode(',', $type2);
|
||||
echo '<label class="radio-inline">'.$value->label.'</label>   <input type="'.$value->type.'" name="'.$value->name.'"> '.$val[0].'
|
||||
   <input type="'.$value->type.'" name="'.$value->name.'"> '.$val[1].'</br>';
|
||||
} elseif($value->type == "textarea" ) {
|
||||
$type3 = $value->value;
|
||||
$v = explode(',', $type3);
|
||||
//dd($v);
|
||||
if(array_key_exists(1, $v)){
|
||||
echo '<label>'.$value->label.'</label></br><textarea class=form-control rows="'.$v[0].'" cols="'.$v[1].'"></textarea></br>';
|
||||
} else {
|
||||
echo '<label>'.$value->label.'</label></br><textarea class=form-control rows="10" cols="60"></textarea></br>';
|
||||
}
|
||||
} elseif($value->type == "checkbox" ) {
|
||||
$type4 = $value->value;
|
||||
$check = explode(',', $type4);
|
||||
echo '<label class="radio-inline">'.$value->label.'   <input type="'.$value->type.'" name="'.$value->name.'">  '.$check[0].'</label><label class="radio-inline"><input type="'.$value->type.'" name="'.$value->name.'">  '.$check[1].'</label></br>';
|
||||
} else {
|
||||
echo '<label>'.$value->label.'</label><input type="'.$value->type.'" class="form-control" name="'.$value->name.'" /></br>';
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Posted form
|
||||
* @param type Request $request
|
||||
* @param type User $user
|
||||
*/
|
||||
public function postedForm(User $user, ClientRequest $request, Ticket $ticket_settings, Ticket_source $ticket_source) {
|
||||
|
||||
$form_extras = $request->except('Name','Phone','Email','Subject','Details','helptopic','_wysihtml5_mode','_token');
|
||||
|
||||
$name = $request->input('Name');
|
||||
$phone = $request->input('Phone');
|
||||
$email = $request->input('Email');
|
||||
$subject = $request->input('Subject');
|
||||
$details = $request->input('Details');
|
||||
|
||||
$System = System::where('id','=',1)->first();
|
||||
$departments = Department::where('id','=',$System->department)->first();
|
||||
$department = $departments->id;
|
||||
|
||||
$status = $ticket_settings->first()->status;
|
||||
$helptopic = $ticket_settings->first()->help_topic;
|
||||
$sla = $ticket_settings->first()->sla;
|
||||
$priority = $ticket_settings->first()->priority;
|
||||
$source = $ticket_source->where('name','=','web')->first();
|
||||
|
||||
$collaborator = null;
|
||||
|
||||
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');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* reply
|
||||
* @param type $value
|
||||
* @return type view
|
||||
*/
|
||||
public function post_ticket_reply($id, Request $request) {
|
||||
$comment = $request->input('comment');
|
||||
if($comment != null) {
|
||||
$tickets = Tickets::where('id','=',$id)->first();
|
||||
$threads = new Ticket_Thread;
|
||||
$threads->user_id = $tickets->user_id;
|
||||
$threads->ticket_id = $tickets->id;
|
||||
$threads->poster = "client";
|
||||
$threads->body = $comment;
|
||||
$threads->save();
|
||||
return \Redirect::back()->with('success1','Successfully replied');
|
||||
} else {
|
||||
return \Redirect::back()->with('fails1','Please fill some data!');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
278
code/app/Http/Controllers/Client/helpdesk/GuestController.php
Normal file
278
code/app/Http/Controllers/Client/helpdesk/GuestController.php
Normal file
@@ -0,0 +1,278 @@
|
||||
<?php namespace App\Http\Controllers\Client\helpdesk;
|
||||
// controllers
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Controllers\Common\SettingsController;
|
||||
// requests
|
||||
use App\Http\Requests\helpdesk\CheckTicket;
|
||||
use App\Http\Requests\helpdesk\ProfilePassword;
|
||||
use App\Http\Requests\helpdesk\ProfileRequest;
|
||||
use App\Http\Requests\helpdesk\TicketRequest;
|
||||
// models
|
||||
use App\Model\helpdesk\Manage\Help_topic;
|
||||
use App\Model\helpdesk\Ticket\Tickets;
|
||||
use App\Model\helpdesk\Ticket\Ticket_Thread;
|
||||
use App\Model\helpdesk\Settings\Company;
|
||||
use App\Model\helpdesk\Settings\System;
|
||||
use App\User;
|
||||
// classes
|
||||
use Auth;
|
||||
use Hash;
|
||||
use Input;
|
||||
|
||||
/**
|
||||
* GuestController
|
||||
*
|
||||
* @package Controllers
|
||||
* @subpackage Controller
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class GuestController extends Controller {
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
* @return type void
|
||||
*/
|
||||
public function __construct() {
|
||||
SettingsController::smtp();
|
||||
$this->middleware('auth');
|
||||
// $this->middleware('role.user');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get profile
|
||||
* @return type Response
|
||||
*/
|
||||
public function getProfile() {
|
||||
$user = Auth::user();
|
||||
return view('themes.default1.client.helpdesk.profile', compact('user'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Save profile data
|
||||
* @param type $id
|
||||
* @param type ProfileRequest $request
|
||||
* @return type Response
|
||||
*/
|
||||
public function postProfile(ProfileRequest $request) {
|
||||
$user = User::where('id','=',Auth::user()->id)->first();
|
||||
$user->gender = $request->get('gender');
|
||||
$user->save();
|
||||
if ($user->profile_pic == 'avatar5.png' || $user->profile_pic == 'avatar2.png') {
|
||||
if ($request->input('gender') == 1) {
|
||||
$name = 'avatar5.png';
|
||||
$destinationPath = 'lb-faveo/profilepic';
|
||||
$user->profile_pic = $name;
|
||||
} elseif ($request->input('gender') == 0) {
|
||||
$name = 'avatar2.png';
|
||||
$destinationPath = 'lb-faveo/profilepic';
|
||||
$user->profile_pic = $name;
|
||||
}
|
||||
}
|
||||
if (Input::file('profile_pic')) {
|
||||
//$extension = Input::file('profile_pic')->getClientOriginalExtension();
|
||||
$name = Input::file('profile_pic')->getClientOriginalName();
|
||||
$destinationPath = 'lb-faveo/profilepic';
|
||||
$fileName = rand(0000, 9999) . '.' . $name;
|
||||
//echo $fileName;
|
||||
Input::file('profile_pic')->move($destinationPath, $fileName);
|
||||
$user->profile_pic = $fileName;
|
||||
} else {
|
||||
$user->fill($request->except('profile_pic', 'gender'))->save();
|
||||
return redirect()->back()->with('success1', 'Profile Updated sucessfully');
|
||||
}
|
||||
if ($user->fill($request->except('profile_pic'))->save()) {
|
||||
return redirect()->back()->with('success1', 'Profile Updated sucessfully');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Ticket page
|
||||
* @param type Help_topic $topic
|
||||
* @return type Response
|
||||
*/
|
||||
public function getTicket(Help_topic $topic) {
|
||||
$topics = $topic->get();
|
||||
return view('themes.default1.client.helpdesk.tickets.form', compact('topics'));
|
||||
}
|
||||
|
||||
/**
|
||||
* getform
|
||||
* @param type Help_topic $topic
|
||||
* @return type
|
||||
*/
|
||||
public function getForm(Help_topic $topic) {
|
||||
if(\Config::get('database.install') == '%0%') {
|
||||
return \Redirect::route('license');
|
||||
}
|
||||
if(System::first()->status == 1) {
|
||||
$topics = $topic->get();
|
||||
return view('themes.default1.client.helpdesk.form', compact('topics'));
|
||||
} else {
|
||||
return \Redirect::route('home');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get my ticket
|
||||
* @param type Tickets $tickets
|
||||
* @param type Ticket_Thread $thread
|
||||
* @param type User $user
|
||||
* @return type Response
|
||||
*/
|
||||
public function getMyticket() {
|
||||
return view('themes.default1.client.helpdesk.mytickets');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get ticket-thread
|
||||
* @param type Ticket_Thread $thread
|
||||
* @param type Tickets $tickets
|
||||
* @param type User $user
|
||||
* @return type Response
|
||||
*/
|
||||
public function thread(Ticket_Thread $thread, Tickets $tickets, User $user) {
|
||||
$user_id = Auth::user()->id;
|
||||
//dd($user_id);
|
||||
/* get the ticket's id == ticket_id of thread */
|
||||
$tickets = $tickets->where('user_id', '=', $user_id)->first();
|
||||
//dd($ticket);
|
||||
$thread = $thread->where('ticket_id', $tickets->id)->first();
|
||||
//dd($thread);
|
||||
// $tickets = $tickets->whereId($id)->first();
|
||||
return view('themes.default1.client.guest-user.view_ticket', compact('thread', 'tickets'));
|
||||
}
|
||||
|
||||
/**
|
||||
* ticket Edit
|
||||
* @return
|
||||
*/
|
||||
public function ticketEdit() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Post porfile password
|
||||
* @param type $id
|
||||
* @param type ProfilePassword $request
|
||||
* @return type Response
|
||||
*/
|
||||
public function postProfilePassword(ProfilePassword $request) {
|
||||
$user = Auth::user();
|
||||
//echo $user->password;
|
||||
if (Hash::check($request->input('old_password'), $user->getAuthPassword())) {
|
||||
$user->password = Hash::make($request->input('new_password'));
|
||||
$user->save();
|
||||
return redirect()->back()->with('success2', 'Password Updated sucessfully');
|
||||
} else {
|
||||
return redirect()->back()->with('fails2', 'Password was not Updated. Incorrect old password');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Ticekt reply
|
||||
* @param type Ticket_Thread $thread
|
||||
* @param type TicketRequest $request
|
||||
* @return type Response
|
||||
*/
|
||||
public function reply(Ticket_Thread $thread, TicketRequest $request) {
|
||||
$thread->ticket_id = $request->input('ticket_ID');
|
||||
$thread->title = $request->input('To');
|
||||
$thread->user_id = Auth::user()->id;
|
||||
$thread->body = $request->input('ReplyContent');
|
||||
$thread->poster = 'user';
|
||||
$thread->save();
|
||||
$ticket_id = $request->input('ticket_ID');
|
||||
$tickets = Tickets::where('id', '=', $ticket_id)->first();
|
||||
$thread = Ticket_Thread::where('ticket_id', '=', $ticket_id)->first();
|
||||
return Redirect("thread/" . $ticket_id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Checked ticket
|
||||
* @param type Tickets $ticket
|
||||
* @param type User $user
|
||||
* @return type response
|
||||
*/
|
||||
public function getCheckTicket(Tickets $ticket, User $user) {
|
||||
return view('themes.default1.client.helpdesk.guest-user.newticket', compact('ticket'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Post Check ticket
|
||||
* @param type CheckTicket $request
|
||||
* @param type User $user
|
||||
* @param type Tickets $ticket
|
||||
* @param type Ticket_Thread $thread
|
||||
* @return type Response
|
||||
*/
|
||||
public function PostCheckTicket() {
|
||||
|
||||
$Email = \Input::get('email');
|
||||
$Ticket_number = \Input::get('ticket_number');
|
||||
|
||||
$ticket = Tickets::where('ticket_number', '=', $Ticket_number)->first();
|
||||
if($ticket == null) {
|
||||
return \Redirect::route('form')->with('fails', 'There is no such Ticket Number');
|
||||
} else {
|
||||
$userId = $ticket->user_id;
|
||||
$user = User::where('id', '=', $userId)->first();
|
||||
|
||||
if($user->role == 'user') {
|
||||
$username = $user->user_name;
|
||||
} else {
|
||||
$username = $user->first_name." ".$user->last_name;
|
||||
}
|
||||
|
||||
if($user->email != $Email) {
|
||||
return \Redirect::route('form')->with('fails', "Email didn't match with Ticket Number");
|
||||
} else {
|
||||
$code = $ticket->id;
|
||||
$code = \Crypt::encrypt($code);
|
||||
|
||||
$company = $this->company();
|
||||
|
||||
\Mail::send('emails.check_ticket',
|
||||
array('link'=>\URL::route('check_ticket',$code),'user'=>$username, 'from'=>$company),
|
||||
function($message) use($user, $username, $Ticket_number) {
|
||||
$message->to($user->email, $username)->subject('Ticket link Request ['.$Ticket_number.']');
|
||||
}
|
||||
);
|
||||
return \Redirect::back()
|
||||
->with('success','We have sent you a link by Email. Please click on that link to view ticket');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* get ticket email
|
||||
* @param type $id
|
||||
* @return type
|
||||
*/
|
||||
public function get_ticket_email($id) {
|
||||
$id1 = \Crypt::decrypt($id);
|
||||
return view('themes.default1.client.helpdesk.ckeckticket',compact('id'));
|
||||
}
|
||||
|
||||
/**
|
||||
* get ticket status
|
||||
* @param type Tickets $ticket
|
||||
* @return type
|
||||
*/
|
||||
public function getTicketStat(Tickets $ticket) {
|
||||
return view('themes.default1.client.helpdesk.ckeckticket', compact('ticket'));
|
||||
}
|
||||
|
||||
/**
|
||||
* get company
|
||||
* @return type
|
||||
*/
|
||||
public function company() {
|
||||
$company = Company::Where('id','=','1')->first();
|
||||
if($company->company_name == null){
|
||||
$company = "Support Center";
|
||||
}else{
|
||||
$company = $company->company_name;
|
||||
}
|
||||
return $company;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php namespace App\Http\Controllers\Client\helpdesk;
|
||||
// controllers
|
||||
use App\Http\Controllers\Controller;
|
||||
// models
|
||||
use App\Model\helpdesk\Settings\System;
|
||||
// classes
|
||||
use Config;
|
||||
use Redirect;
|
||||
|
||||
/**
|
||||
* OuthouseController
|
||||
*
|
||||
* @package Controllers
|
||||
* @subpackage Controller
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class WelcomepageController extends Controller {
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function get(System $note) {
|
||||
if(Config::get('database.install')=='%0%') {
|
||||
return Redirect::route('licence');
|
||||
}
|
||||
$notes = $note->get();
|
||||
foreach ($notes as $note) {
|
||||
$content = $note->content;
|
||||
}
|
||||
return view('themes.default1.client.guest-user.guest', compact('heading', 'content'));
|
||||
}
|
||||
|
||||
public function index() {
|
||||
if(Config::get('database.install')=='%0%') {
|
||||
return Redirect::route('licence');
|
||||
}
|
||||
return view('themes.default1.client.helpdesk.guest-user.index');
|
||||
}
|
||||
}
|
||||
346
code/app/Http/Controllers/Common/SettingsController.php
Normal file
346
code/app/Http/Controllers/Common/SettingsController.php
Normal file
@@ -0,0 +1,346 @@
|
||||
<?php namespace App\Http\Controllers\Common;
|
||||
// controllers
|
||||
use App\Http\Controllers\Controller;
|
||||
// requests
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Requests\helpdesk\SmtpRequest;
|
||||
use App\Http\Requests;
|
||||
// models
|
||||
use App\Model\helpdesk\Theme\Footer2;
|
||||
use App\Model\helpdesk\Theme\Footer3;
|
||||
use App\Model\helpdesk\Theme\Footer4;
|
||||
use App\Model\helpdesk\Theme\Footer;
|
||||
use App\Model\helpdesk\Email\Smtp;
|
||||
use App\Model\helpdesk\Utility\Version_Check;
|
||||
// classes
|
||||
use Config;
|
||||
use Input;
|
||||
use Crypt;
|
||||
|
||||
/**
|
||||
****************************
|
||||
* Settings Controllers
|
||||
****************************
|
||||
* Controller to keep smtp details and fetch where ever needed
|
||||
* @package default
|
||||
*/
|
||||
class SettingsController extends Controller {
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
* @return type void
|
||||
*/
|
||||
public function __construct() {
|
||||
// $this->smtp();
|
||||
$this->middleware('auth');
|
||||
$this->middleware('roles');
|
||||
SettingsController::driver();
|
||||
SettingsController::host();
|
||||
SettingsController::port();
|
||||
SettingsController::from();
|
||||
SettingsController::encryption();
|
||||
SettingsController::username();
|
||||
SettingsController::password();
|
||||
}
|
||||
|
||||
/**
|
||||
* get the page to create the footer
|
||||
* @return response
|
||||
*/
|
||||
public function CreateFooter(Footer $footer) {
|
||||
$footer = $footer->whereId('1')->first();
|
||||
return view('themes.default1.admin.helpdesk.theme.footer', compact('footer'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Post footer
|
||||
* @param type Footer $footer
|
||||
* @param type Request $request
|
||||
* @return type response
|
||||
*/
|
||||
public function PostFooter(Footer $footer, Request $request) {
|
||||
$footer = $footer->whereId('1')->first();
|
||||
if ($footer->fill($request->input())->save()) {
|
||||
return redirect('create-footer')->with('success', 'Footer Saved Successfully');
|
||||
} else {
|
||||
return redirect('create-footer')->with('fails', 'Footer was not Saved');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* get the page to create the footer
|
||||
* @return response
|
||||
*/
|
||||
public function CreateFooter2(Footer2 $footer2) {
|
||||
$footer2 = $footer2->whereId('1')->first();
|
||||
return view('themes.default1.admin.helpdesk.theme.footer2', compact('footer2'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Post footer 2
|
||||
* @param type Footer $footer
|
||||
* @param type Request $request
|
||||
* @return type response
|
||||
*/
|
||||
public function PostFooter2(Footer2 $footer2, Request $request) {
|
||||
$footer2 = $footer2->whereId('1')->first();
|
||||
if ($footer2->fill($request->input())->save()) {
|
||||
return redirect('create-footer2')->with('success', 'Footer Saved Successfully');
|
||||
} else {
|
||||
return redirect('create-footer2')->with('fails', 'Footer was not Saved');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* get the page to create the footer
|
||||
* @return response
|
||||
*/
|
||||
public function CreateFooter3(Footer3 $footer3) {
|
||||
$footer3 = $footer3->whereId('1')->first();
|
||||
return view('themes.default1.admin.helpdesk.theme.footer3', compact('footer3'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Post footer 3
|
||||
* @param type Footer $footer
|
||||
* @param type Request $request
|
||||
* @return type response
|
||||
*/
|
||||
public function PostFooter3(Footer3 $footer3, Request $request) {
|
||||
$footer3 = $footer3->whereId('1')->first();
|
||||
if ($footer3->fill($request->input())->save()) {
|
||||
return redirect('create-footer3')->with('success', 'Footer Saved Successfully');
|
||||
} else {
|
||||
return redirect('create-footer3')->with('fails', 'Footer was not Saved');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* get the page to create the footer
|
||||
* @return response
|
||||
*/
|
||||
public function CreateFooter4(Footer4 $footer4) {
|
||||
$footer4 = $footer4->whereId('1')->first();
|
||||
return view('themes.default1.admin.helpdesk.theme.footer4', compact('footer4'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Post footer 4
|
||||
* @param type Footer $footer
|
||||
* @param type Request $request
|
||||
* @return type response
|
||||
*/
|
||||
public function PostFooter4(Footer4 $footer4, Request $request) {
|
||||
$footer4 = $footer4->whereId('1')->first();
|
||||
if ($footer4->fill($request->input())->save()) {
|
||||
return redirect('create-footer4')->with('success', 'Footer Saved Successfully');
|
||||
} else {
|
||||
return redirect('create-footer4')->with('fails', 'Footer was not Saved');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Driver
|
||||
* @return type void
|
||||
*/
|
||||
static function driver() {
|
||||
$set = new Smtp;
|
||||
$settings = Smtp::where('id','=','1')->first();
|
||||
Config::set('mail.host', $settings->driver);
|
||||
}
|
||||
|
||||
/**
|
||||
* SMTP host
|
||||
* @return type void
|
||||
*/
|
||||
static function host() {
|
||||
$set = new Smtp;
|
||||
$settings = Smtp::where('id','=','1')->first();
|
||||
Config::set('mail.host', $settings->host);
|
||||
}
|
||||
|
||||
/**
|
||||
* SMTP port
|
||||
* @return type void
|
||||
*/
|
||||
static function port() {
|
||||
$set = new Smtp;
|
||||
$settings = Smtp::where('id','=','1')->first();
|
||||
Config::set('mail.port', intval($settings->port));
|
||||
}
|
||||
|
||||
/**
|
||||
* SMTP from
|
||||
* @return type void
|
||||
*/
|
||||
static function from() {
|
||||
$set = new Smtp;
|
||||
$settings = Smtp::where('id','=','1')->first();
|
||||
Config::set('mail.from', ['address'=>$settings->email,'name'=>$settings->company_name]);
|
||||
}
|
||||
|
||||
/**
|
||||
* SMTP encryption
|
||||
* @return type void
|
||||
*/
|
||||
static function encryption() {
|
||||
$set = new Smtp;
|
||||
$settings = Smtp::where('id','=','1')->first();
|
||||
Config::set('mail.encryption', $settings->encryption);
|
||||
}
|
||||
|
||||
/**
|
||||
* SMTP username
|
||||
* @return type void
|
||||
*/
|
||||
static function username() {
|
||||
$set = new Smtp;
|
||||
$settings = Smtp::where('id','=','1')->first();
|
||||
Config::set('mail.username', $settings->email);
|
||||
}
|
||||
|
||||
/**
|
||||
* SMTP password
|
||||
* @return type void
|
||||
*/
|
||||
static function password() {
|
||||
$settings = Smtp::first();
|
||||
if($settings->password) {
|
||||
$pass = $settings->password;
|
||||
$password = Crypt::decrypt($pass);
|
||||
Config::set('mail.password', $password);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* get SMTP
|
||||
* @return type view
|
||||
*/
|
||||
public function getsmtp(){
|
||||
$settings = Smtp::where('id','=','1')->first();
|
||||
return view('themes.default1.admin.helpdesk.emails.smtp',compact('settings'));
|
||||
}
|
||||
|
||||
/**
|
||||
* POST SMTP
|
||||
* @return type view
|
||||
*/
|
||||
public function postsmtp(SmtpRequest $request){
|
||||
$data = Smtp::where('id','=',1)->first();
|
||||
$data->driver = $request->input('driver');
|
||||
$data->host = $request->input('host');
|
||||
$data->port = $request->input('port');
|
||||
$data->encryption = $request->input('encryption');
|
||||
$data->name = $request->input('name');
|
||||
$data->email = $request->input('email');
|
||||
$data->password = Crypt::encrypt($request->input('password'));
|
||||
if($data->save()) {
|
||||
return \Redirect::route('getsmtp')->with('success','success');
|
||||
} else {
|
||||
return \Redirect::route('getsmtp')->with('fails','fails');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* SMTP
|
||||
* @return type void
|
||||
*/
|
||||
static function smtp() {
|
||||
$settings = Smtp::where('id','=','1')->first();
|
||||
if($settings->password) {
|
||||
$password = Crypt::decrypt($settings->password);
|
||||
Config::set('mail.driver', $settings->driver);
|
||||
Config::set('mail.password', $password);
|
||||
Config::set('mail.username', $settings->email);
|
||||
Config::set('mail.encryption', $settings->encryption);
|
||||
Config::set('mail.from', ['address'=>$settings->email,'name'=>$settings->name]);
|
||||
Config::set('mail.port', intval($settings->port));
|
||||
Config::set('mail.host', $settings->host);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Settings
|
||||
* @param type Smtp $set
|
||||
* @return type view\
|
||||
*/
|
||||
public function settings(Smtp $set) {
|
||||
$settings = $set->where('id','1')->first();
|
||||
return view('themes.default1.admin.settings',compact('settings'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Post settings
|
||||
* @param type Settings $set
|
||||
* @param type Request $request
|
||||
* @return type view
|
||||
*/
|
||||
public function PostSettings(Settings $set, Request $request) {
|
||||
$settings = $set->where('id','1')->first();
|
||||
$pass = $request->input('password');
|
||||
$password = Crypt::encrypt($pass);
|
||||
$settings->password = $password;
|
||||
$settings->save();
|
||||
if (Input::file('logo')) {
|
||||
$name = Input::file('logo')->getClientOriginalName();
|
||||
$destinationPath = 'dist/logo';
|
||||
$fileName = rand(0000, 9999) . '.' . $name;
|
||||
Input::file('logo')->move($destinationPath, $fileName);
|
||||
$settings->logo = $fileName;
|
||||
$settings->save();
|
||||
}
|
||||
$settings->fill($request->except('logo','password'))->save();
|
||||
return redirect()->back()->with('success','Settings updated Successfully');
|
||||
}
|
||||
|
||||
/**
|
||||
* version_check
|
||||
* @return type
|
||||
*/
|
||||
public function version_check() {
|
||||
|
||||
$response_url = \URL::route('post-version-check');
|
||||
|
||||
echo "<form action='http://www.faveohelpdesk.com/bill/version' method='post' name='redirect'>";
|
||||
echo "<input type='hidden' name='_token' value='csrf_token()'/>";
|
||||
echo "<input type='hidden' name='title' value='helpdeskcommunityedition'/>";
|
||||
echo "<input type='hidden' name='id' value='19'/>";
|
||||
echo "<input type='hidden' name='response_url' value='".$response_url."' />";
|
||||
echo "</form>";
|
||||
echo "<script language='javascript'>document.redirect.submit();</script>";
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* post_version_check
|
||||
* @return type
|
||||
*/
|
||||
public function post_version_check(Request $request) {
|
||||
|
||||
$current_version = \Config::get('app.version');
|
||||
|
||||
$new_version = $request->value;
|
||||
|
||||
if($current_version == $new_version) {
|
||||
// echo "No, new Updates";
|
||||
return redirect()->route('checkupdate')->with('info',' No, new Updates');
|
||||
} elseif($current_version < $new_version) {
|
||||
$version = Version_Check::where('id','=','1')->first();
|
||||
$version->current_version = $current_version;
|
||||
$version->new_version = $new_version;
|
||||
$version->save();
|
||||
// echo "Version " . $new_version . " is Available";
|
||||
return redirect()->route('checkupdate')->with('info',' Version '. $new_version . ' is Available');
|
||||
} else {
|
||||
// echo "Error Checking Version";
|
||||
return redirect()->route('checkupdate')->with('info',' Error Checking Version');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function getupdate() {
|
||||
return \View::make('themes.default1.admin.helpdesk.settings.checkupdate');
|
||||
}
|
||||
}
|
||||
11
code/app/Http/Controllers/Controller.php
Normal file
11
code/app/Http/Controllers/Controller.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php namespace App\Http\Controllers;
|
||||
// classes
|
||||
use Illuminate\Foundation\Bus\DispatchesCommands;
|
||||
use Illuminate\Routing\Controller as BaseController;
|
||||
use Illuminate\Foundation\Validation\ValidatesRequests;
|
||||
|
||||
abstract class Controller extends BaseController {
|
||||
|
||||
use DispatchesCommands,
|
||||
ValidatesRequests;
|
||||
}
|
||||
21
code/app/Http/Controllers/Error/ErrorController.php
Normal file
21
code/app/Http/Controllers/Error/ErrorController.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php namespace App\Http\Controllers\Error;
|
||||
// controllers
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
/**
|
||||
* ErrorController
|
||||
*
|
||||
* @package Controllers
|
||||
* @subpackage Controller
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class ErrorController extends Controller {
|
||||
|
||||
/**
|
||||
* Display a Error Page of 404.
|
||||
* @return Response
|
||||
*/
|
||||
public function error404() {
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
40
code/app/Http/Controllers/HomeController.php
Normal file
40
code/app/Http/Controllers/HomeController.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php namespace App\Http\Controllers;
|
||||
|
||||
class HomeController extends Controller {
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Home Controller
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This controller renders your application's "dashboard" for users that
|
||||
| are authenticated. Of course, you are free to change or remove the
|
||||
| controller as you wish. It is just here to get your app started!
|
||||
|
|
||||
*/
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct() {
|
||||
// $this->middleware('auth');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the application dashboard to the user.
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function index() {
|
||||
ksjdckjdsnc
|
||||
return view('themes/default1/admin/dashboard');
|
||||
}
|
||||
|
||||
|
||||
public function getsmtp(){
|
||||
$smtp = \App\Model\helpdesk\Email\Smtp::where('id','=','1')->first();
|
||||
return $smtp->host;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,428 @@
|
||||
<?php namespace App\Http\Controllers\Installer\helpdesk;
|
||||
// controllers
|
||||
use App\Http\Controllers\Controller;
|
||||
// requests
|
||||
use App\Http\Requests\helpdesk\InstallerRequest;
|
||||
// models
|
||||
use App\User;
|
||||
use App\Model\helpdesk\Settings\System;
|
||||
use App\Model\helpdesk\Form\Form_details;
|
||||
// classes
|
||||
use App;
|
||||
use Artisan;
|
||||
use Config;
|
||||
use File;
|
||||
use Hash;
|
||||
use Input;
|
||||
use Redirect;
|
||||
use Session;
|
||||
use View;
|
||||
|
||||
/**
|
||||
* |=======================================================================
|
||||
* |Class: InstallController
|
||||
* |=======================================================================
|
||||
*
|
||||
* Class to perform the first install operation without this the database
|
||||
* settings could not be started
|
||||
*
|
||||
* @package Faveo HELPDESK
|
||||
* @subpackage Controller
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*
|
||||
*/
|
||||
class InstallController extends Controller {
|
||||
|
||||
/**
|
||||
* Get Licence (step 1)
|
||||
* @return type view
|
||||
*/
|
||||
public function licence() {
|
||||
if (Session::get('step5') == 'step5') {
|
||||
return Redirect::route('account');
|
||||
}
|
||||
|
||||
if (Config::get('database.install') == '%0%') {
|
||||
return view('themes/default1/installer/helpdesk/view1');
|
||||
} else {
|
||||
// return 1;
|
||||
return redirect('/auth/login');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Post Licencecheck
|
||||
* @return type view
|
||||
*/
|
||||
public function licencecheck() {
|
||||
$accept = (Input::has('accept1')) ? true : false;
|
||||
if ($accept == 'accept') {
|
||||
Session::put('step1', 'step1');
|
||||
return Redirect::route('prerequisites');
|
||||
} else {
|
||||
return Redirect::route('licence')->with('fails', 'Failed! first accept the licence agreeement');
|
||||
}
|
||||
// return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get prerequisites (step 2)
|
||||
*
|
||||
* Checking the extensions enabled required for installing the faveo
|
||||
* without which the project cannot be executed properly
|
||||
* @return type view
|
||||
*/
|
||||
public function prerequisites() {
|
||||
if (Session::get('step5') == 'step5') {
|
||||
return Redirect::route('account');
|
||||
}
|
||||
if (Config::get('database.install') == '%0%') {
|
||||
if (Session::get('step1') == 'step1') {
|
||||
return View::make('themes/default1/installer/helpdesk/view2');
|
||||
} else {
|
||||
return Redirect::route('licence');
|
||||
}
|
||||
} else {
|
||||
return redirect('/auth/login');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Post Prerequisitescheck
|
||||
* checking prerequisites
|
||||
* @return type view
|
||||
*/
|
||||
public function prerequisitescheck() {
|
||||
Session::put('step2', 'step2');
|
||||
return Redirect::route('localization');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Localization (step 3)
|
||||
* Requesting user recomended settings for installation
|
||||
* @return type view
|
||||
*/
|
||||
public function localization() {
|
||||
if (Session::get('step5') == 'step5') {
|
||||
return Redirect::route('account');
|
||||
}
|
||||
if (Config::get('database.install') == '%0%') {
|
||||
if (Session::get('step2') == 'step2') {
|
||||
return View::make('themes/default1/installer/helpdesk/view3');
|
||||
} else {
|
||||
return Redirect::route('prerequisites');
|
||||
}
|
||||
} else {
|
||||
return redirect('/auth/login');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Post localizationcheck
|
||||
* checking prerequisites
|
||||
* @return type view
|
||||
*/
|
||||
public function localizationcheck() {
|
||||
|
||||
Session::put('step3', 'step3');
|
||||
|
||||
Session::put('language', Input::get('language'));
|
||||
Session::put('timezone', Input::get('timezone'));
|
||||
Session::put('date', Input::get('date'));
|
||||
Session::put('datetime', Input::get('datetime'));
|
||||
|
||||
return Redirect::route('configuration');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Configuration (step 4)
|
||||
* checking prerequisites
|
||||
* @return type view
|
||||
*/
|
||||
public function configuration() {
|
||||
if (Session::get('step5') == 'step5') {
|
||||
return Redirect::route('account');
|
||||
}
|
||||
if (Config::get('database.install') == '%0%') {
|
||||
if (Session::get('step3') == 'step3') {
|
||||
return View::make('themes/default1/installer/helpdesk/view4');
|
||||
} else {
|
||||
return Redirect::route('localization');
|
||||
}
|
||||
} else {
|
||||
return redirect('/auth/login');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Post configurationcheck
|
||||
* checking prerequisites
|
||||
* @return type view
|
||||
*/
|
||||
public function configurationcheck() {
|
||||
|
||||
Session::put('step4', 'step4');
|
||||
|
||||
Session::put('default', Input::get('default'));
|
||||
Session::put('host', Input::get('host'));
|
||||
Session::put('databasename', Input::get('databasename'));
|
||||
Session::put('username', Input::get('username'));
|
||||
Session::put('password', Input::get('password'));
|
||||
|
||||
return Redirect::route('database');
|
||||
}
|
||||
|
||||
/**
|
||||
* postconnection
|
||||
* @return type view
|
||||
*/
|
||||
public function postconnection() {
|
||||
|
||||
$default = Input::get('default');
|
||||
$host = Input::get('host');
|
||||
$database = Input::get('databasename');
|
||||
$dbusername = Input::get('username');
|
||||
$dbpassword = Input::get('password');
|
||||
// set default value
|
||||
$path0 = app_path('../config/database.php');
|
||||
$content0 = File::get($path0);
|
||||
$content0 = str_replace('%default%', $default, $content0);
|
||||
File::put($path0, $content0);
|
||||
// set host,databasename,username,password
|
||||
if ($default == 'mysql') {
|
||||
$path = app_path('../config/database.php');
|
||||
$content = File::get($path);
|
||||
$content = str_replace('%host%', $host, $content);
|
||||
File::put($path, $content);
|
||||
|
||||
$path1 = app_path('../config/database.php');
|
||||
$content1 = File::get($path1);
|
||||
$content1 = str_replace('%database%', $database, $content1);
|
||||
File::put($path1, $content1);
|
||||
|
||||
$path2 = app_path('../config/database.php');
|
||||
$content2 = File::get($path2);
|
||||
$content2 = str_replace('%username%', $dbusername, $content2);
|
||||
File::put($path2, $content2);
|
||||
|
||||
$path3 = app_path('../config/database.php');
|
||||
$content3 = File::get($path3);
|
||||
$content3 = str_replace('%password%', $dbpassword, $content3);
|
||||
File::put($path3, $content3);
|
||||
} elseif ($default == 'pgsql') {
|
||||
$path = app_path('../config/database.php');
|
||||
$content = File::get($path);
|
||||
$content = str_replace('%host1%', $host, $content);
|
||||
File::put($path, $content);
|
||||
|
||||
$path1 = app_path('../config/database.php');
|
||||
$content1 = File::get($path1);
|
||||
$content1 = str_replace('%database1%', $database, $content1);
|
||||
File::put($path1, $content1);
|
||||
|
||||
$path2 = app_path('../config/database.php');
|
||||
$content2 = File::get($path2);
|
||||
$content2 = str_replace('%username1%', $username, $content2);
|
||||
File::put($path2, $content2);
|
||||
|
||||
$path3 = app_path('../config/database.php');
|
||||
$content3 = File::get($path3);
|
||||
$content3 = str_replace('%password1%', $password, $content3);
|
||||
File::put($path3, $content3);
|
||||
} elseif ($default == 'sqlsrv') {
|
||||
$path = app_path('../config/database.php');
|
||||
$content = File::get($path);
|
||||
$content = str_replace('%host2%', $host, $content);
|
||||
File::put($path, $content);
|
||||
|
||||
$path1 = app_path('../config/database.php');
|
||||
$content1 = File::get($path1);
|
||||
$content1 = str_replace('%database2%', $database, $content1);
|
||||
File::put($path1, $content1);
|
||||
|
||||
$path2 = app_path('../config/database.php');
|
||||
$content2 = File::get($path2);
|
||||
$content2 = str_replace('%username2%', $username, $content2);
|
||||
File::put($path2, $content2);
|
||||
|
||||
$path3 = app_path('../config/database.php');
|
||||
$content3 = File::get($path3);
|
||||
$content3 = str_replace('%password2%', $password, $content3);
|
||||
File::put($path3, $content3);
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get database
|
||||
* checking prerequisites
|
||||
* @return type view
|
||||
*/
|
||||
public function database() {
|
||||
if (Config::get('database.install') == '%0%') {
|
||||
if (Session::get('step4') == 'step4') {
|
||||
return View::make('themes/default1/installer/helpdesk/view5');
|
||||
} else {
|
||||
return Redirect::route('configuration');
|
||||
}
|
||||
} else {
|
||||
return redirect('/auth/login');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get account
|
||||
* checking prerequisites
|
||||
* @return type view
|
||||
*/
|
||||
public function account() {
|
||||
if (Config::get('database.install') == '%0%') {
|
||||
if (Session::get('step4') == 'step4') {
|
||||
Session::put('step5', 'step5');
|
||||
Session::forget('step1');
|
||||
Session::forget('step2');
|
||||
Session::forget('step3');
|
||||
return View::make('themes/default1/installer/helpdesk/view6');
|
||||
} else {
|
||||
return Redirect::route('configuration');
|
||||
}
|
||||
} else {
|
||||
return redirect('/auth/login');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Post accountcheck
|
||||
* checking prerequisites
|
||||
* @param type InstallerRequest $request
|
||||
* @return type view
|
||||
*/
|
||||
public function accountcheck(InstallerRequest $request) {
|
||||
// dd($request);
|
||||
// config/database.php management
|
||||
$default = $request->input('default');
|
||||
$host = $request->input('host');
|
||||
$database = $request->input('databasename');
|
||||
$dbusername = $request->input('dbusername');
|
||||
$dbpassword = $request->input('dbpassword');
|
||||
|
||||
// migrate database
|
||||
Artisan::call('migrate', array('--force' => true));
|
||||
Artisan::call('db:seed', array('--force' => true));
|
||||
|
||||
// create user
|
||||
$firstname = $request->input('firstname');
|
||||
$lastname = $request->input('Lastname');
|
||||
$email = $request->input('email');
|
||||
$username = $request->input('username');
|
||||
$password = $request->input('password');
|
||||
|
||||
$language = $request->input('language');
|
||||
$timezone = $request->input('timezone');
|
||||
$date = $request->input('date');
|
||||
$datetime = $request->input('datetime');
|
||||
|
||||
$system = System::where('id','=','1')->first();
|
||||
$system->time_zone = $timezone;
|
||||
$system->date_time_format = $datetime;
|
||||
$system->save();
|
||||
|
||||
|
||||
$form1 = new Form_details;
|
||||
$form1->label = 'Name';
|
||||
$form1->type = 'text';
|
||||
$form1->form_name_id = '1';
|
||||
$form1->save();
|
||||
|
||||
$form2 = new Form_details;
|
||||
$form2->label = 'Phone';
|
||||
$form2->type = 'number';
|
||||
$form2->form_name_id = '1';
|
||||
$form2->save();
|
||||
|
||||
$form3 = new Form_details;
|
||||
$form3->label = 'Email';
|
||||
$form3->type = 'text';
|
||||
$form3->form_name_id = '1';
|
||||
$form3->save();
|
||||
|
||||
$form4 = new Form_details;
|
||||
$form4->label = 'Subject';
|
||||
$form4->type = 'text';
|
||||
$form4->form_name_id = '1';
|
||||
$form4->save();
|
||||
|
||||
$form5 = new Form_details;
|
||||
$form5->label = 'Details';
|
||||
$form5->type = 'textarea';
|
||||
$form5->form_name_id = '1';
|
||||
$form5->save();
|
||||
|
||||
$user = User::create(array(
|
||||
'first_name' => $firstname,
|
||||
'last_name' => $lastname,
|
||||
'email' => $email,
|
||||
'user_name' => $username,
|
||||
'password' => Hash::make($password),
|
||||
'active' => 1,
|
||||
'role' => 'admin',
|
||||
'assign_group' => 'group A',
|
||||
'primary_dpt' => 'support',
|
||||
));
|
||||
|
||||
if ($user) {
|
||||
Session::put('step6', 'step6');
|
||||
return Redirect::route('final');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get finalize
|
||||
* checking prerequisites
|
||||
* @return type view
|
||||
*/
|
||||
public function finalize() {
|
||||
if (Session::get('step6') == 'step6') {
|
||||
// $var = "http://" . $_SERVER['HTTP_HOST'] . "/epeper-pdf";
|
||||
// $siteurl = Option::where('option_name', '=', 'siteurl')->first();
|
||||
// $siteurl->option_value = $var;
|
||||
// $siteurl->save();
|
||||
$value = '1';
|
||||
$install = app_path('../config/database.php');
|
||||
$datacontent = File::get($install);
|
||||
$datacontent = str_replace('%0%', $value, $datacontent);
|
||||
File::put($install, $datacontent);
|
||||
|
||||
$smtpfilepath = "\App\Http\Controllers\Common\SettingsController::smtp()";
|
||||
$path22 = app_path('Http\routes.php');
|
||||
$content23 = File::get($path22);
|
||||
$content23 = str_replace('"%smtplink%"', $smtpfilepath, $content23);
|
||||
File::put($path22, $content23);
|
||||
|
||||
|
||||
try {
|
||||
return View::make('themes/default1/installer/helpdesk/view7');
|
||||
} catch (Exception $e) {
|
||||
return Redirect::route('npl');
|
||||
}
|
||||
} else {
|
||||
return redirect('/auth/login');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Post finalcheck
|
||||
* checking prerequisites
|
||||
* @return type view
|
||||
*/
|
||||
public function finalcheck() {
|
||||
try
|
||||
{
|
||||
return redirect('/auth/login');
|
||||
} catch (Exception $e) {
|
||||
return redirect('/auth/login');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
40
code/app/Http/Kernel.php
Normal file
40
code/app/Http/Kernel.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php namespace App\Http;
|
||||
|
||||
use Illuminate\Foundation\Http\Kernel as HttpKernel;
|
||||
|
||||
/**
|
||||
* Kernel
|
||||
*
|
||||
* @package HttpKernel
|
||||
*/
|
||||
class Kernel extends HttpKernel {
|
||||
|
||||
/**
|
||||
* The application's global HTTP middleware stack.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $middleware = [
|
||||
'Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode',
|
||||
'Illuminate\Cookie\Middleware\EncryptCookies',
|
||||
'Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse',
|
||||
'Illuminate\Session\Middleware\StartSession',
|
||||
'Illuminate\View\Middleware\ShareErrorsFromSession',
|
||||
//'App\Http\Middleware\VerifyCsrfToken',
|
||||
];
|
||||
|
||||
/**
|
||||
* The application's route middleware.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $routeMiddleware = [
|
||||
'auth' => 'App\Http\Middleware\Authenticate',
|
||||
'auth.basic' => 'Illuminate\Auth\Middleware\AuthenticateWithBasicAuth',
|
||||
'guest' => 'App\Http\Middleware\RedirectIfAuthenticated',
|
||||
'roles' => 'App\Http\Middleware\CheckRole',
|
||||
'role.agent' => 'App\Http\Middleware\CheckRoleAgent',
|
||||
'role.user' => 'App\Http\Middleware\CheckRoleUser',
|
||||
];
|
||||
|
||||
}
|
||||
49
code/app/Http/Middleware/Authenticate.php
Normal file
49
code/app/Http/Middleware/Authenticate.php
Normal file
@@ -0,0 +1,49 @@
|
||||
<?php namespace App\Http\Middleware;
|
||||
use Closure;
|
||||
use Illuminate\Contracts\Auth\Guard;
|
||||
|
||||
/**
|
||||
* Authenticate
|
||||
*
|
||||
* @package Middleware
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class Authenticate {
|
||||
|
||||
/**
|
||||
* The Guard implementation.
|
||||
*
|
||||
* @var Guard
|
||||
*/
|
||||
protected $auth;
|
||||
|
||||
/**
|
||||
* Create a new filter instance.
|
||||
*
|
||||
* @param Guard $auth
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Guard $auth) {
|
||||
$this->auth = $auth;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Closure $next
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle($request, Closure $next) {
|
||||
if ($this->auth->guest()) {
|
||||
if ($request->ajax()) {
|
||||
return response('Unauthorized.', 401);
|
||||
} else {
|
||||
return redirect()->guest('auth/login');
|
||||
}
|
||||
}
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
|
||||
}
|
||||
27
code/app/Http/Middleware/CheckRole.php
Normal file
27
code/app/Http/Middleware/CheckRole.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php namespace App\Http\Middleware;
|
||||
use Closure;
|
||||
|
||||
/**
|
||||
* CheckRole
|
||||
*
|
||||
* @package Middleware
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class CheckRole {
|
||||
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Closure $next
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle($request, Closure $next) {
|
||||
|
||||
if ($request->user()->role == 'admin') {
|
||||
return $next($request);
|
||||
}
|
||||
return redirect('guest')->with('fails', 'You are not Autherised');
|
||||
}
|
||||
|
||||
}
|
||||
27
code/app/Http/Middleware/CheckRoleAgent.php
Normal file
27
code/app/Http/Middleware/CheckRoleAgent.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
namespace App\Http\Middleware;
|
||||
use Closure;
|
||||
|
||||
/**
|
||||
* CheckRoleAgent
|
||||
*
|
||||
* @package default
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class CheckRoleAgent {
|
||||
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Closure $next
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle($request, Closure $next) {
|
||||
if ($request->user()->role == 'agent' || $request->user()->role == 'admin') {
|
||||
return $next($request);
|
||||
}
|
||||
return redirect('dashboard')->with('fails', 'You are not Autherised');
|
||||
}
|
||||
|
||||
}
|
||||
26
code/app/Http/Middleware/CheckRoleUser.php
Normal file
26
code/app/Http/Middleware/CheckRoleUser.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php namespace App\Http\Middleware;
|
||||
use Closure;
|
||||
|
||||
/**
|
||||
* CheckRoleUser
|
||||
*
|
||||
* @package Middleware
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class CheckRoleUser {
|
||||
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Closure $next
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle($request, Closure $next) {
|
||||
if ($request->user()->role == 'user') {
|
||||
return $next($request);
|
||||
}
|
||||
return redirect('guest')->with('fails', 'You are not Autherised');
|
||||
}
|
||||
|
||||
}
|
||||
41
code/app/Http/Middleware/RedirectIfAuthenticated.php
Normal file
41
code/app/Http/Middleware/RedirectIfAuthenticated.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php namespace App\Http\Middleware;
|
||||
|
||||
use Closure;
|
||||
use Illuminate\Contracts\Auth\Guard;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
|
||||
class RedirectIfAuthenticated {
|
||||
|
||||
/**
|
||||
* The Guard implementation.
|
||||
*
|
||||
* @var Guard
|
||||
*/
|
||||
protected $auth;
|
||||
|
||||
/**
|
||||
* Create a new filter instance.
|
||||
*
|
||||
* @param Guard $auth
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Guard $auth) {
|
||||
$this->auth = $auth;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Closure $next
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle($request, Closure $next) {
|
||||
if ($this->auth->check()) {
|
||||
return new RedirectResponse(url('dashboard'));
|
||||
}
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
|
||||
}
|
||||
19
code/app/Http/Middleware/VerifyCsrfToken.php
Normal file
19
code/app/Http/Middleware/VerifyCsrfToken.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php namespace App\Http\Middleware;
|
||||
|
||||
use Closure;
|
||||
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as BaseVerifier;
|
||||
|
||||
class VerifyCsrfToken extends BaseVerifier {
|
||||
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Closure $next
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle($request, Closure $next) {
|
||||
return parent::handle($request, $next);
|
||||
}
|
||||
|
||||
}
|
||||
9
code/app/Http/Requests/Request.php
Normal file
9
code/app/Http/Requests/Request.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php namespace App\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
abstract class Request extends FormRequest {
|
||||
|
||||
//
|
||||
|
||||
}
|
||||
43
code/app/Http/Requests/helpdesk/AgentRequest.php
Normal file
43
code/app/Http/Requests/helpdesk/AgentRequest.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
* AgentRequest
|
||||
*
|
||||
* @package Request
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class AgentRequest extends Request {
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules() {
|
||||
return [
|
||||
'user_name' => 'required|unique:users',
|
||||
'first_name' => 'required',
|
||||
'last_name' => 'required',
|
||||
'email' => 'required',
|
||||
'account_type' => 'required',
|
||||
// 'account_status' => 'required',
|
||||
'assign_group' => 'required',
|
||||
'primary_dpt' => 'required',
|
||||
'agent_tzone' => 'required',
|
||||
// 'phone_number' => 'phone:IN',
|
||||
// 'mobile' => 'phone:IN',
|
||||
'team_id' => 'required',
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
42
code/app/Http/Requests/helpdesk/AgentUpdate.php
Normal file
42
code/app/Http/Requests/helpdesk/AgentUpdate.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
* AgentUpdate
|
||||
*
|
||||
* @package Request
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class AgentUpdate extends Request {
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules() {
|
||||
return [
|
||||
'first_name' => 'required',
|
||||
'last_name' => 'required',
|
||||
'email' => 'required|email',
|
||||
'account_type' => 'required',
|
||||
'role' => 'required',
|
||||
'assign_group' => 'required',
|
||||
'primary_dpt' => 'required',
|
||||
'agent_tzone' => 'required',
|
||||
'phone_number' => 'phone:IN',
|
||||
'mobile' => 'phone:IN',
|
||||
'team_id' => 'required',
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
27
code/app/Http/Requests/helpdesk/ArticleRequest.php
Normal file
27
code/app/Http/Requests/helpdesk/ArticleRequest.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
class ArticleRequest extends Request {
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules() {
|
||||
return [
|
||||
'name' => 'required',
|
||||
'description' => 'required',
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
33
code/app/Http/Requests/helpdesk/BanRequest.php
Normal file
33
code/app/Http/Requests/helpdesk/BanRequest.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
* BanRequest
|
||||
*
|
||||
* @package Request
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class BanRequest extends Request {
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules() {
|
||||
return [
|
||||
'email' => 'required|email|unique:users',
|
||||
'ban' => 'required',
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
33
code/app/Http/Requests/helpdesk/BanlistRequest.php
Normal file
33
code/app/Http/Requests/helpdesk/BanlistRequest.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
* BanlistRequest
|
||||
*
|
||||
* @package Request
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class BanlistRequest extends Request {
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules() {
|
||||
return [
|
||||
'email' => 'email',
|
||||
'ban' => 'required',
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
33
code/app/Http/Requests/helpdesk/CannedRequest.php
Normal file
33
code/app/Http/Requests/helpdesk/CannedRequest.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
* AgentRequest
|
||||
*
|
||||
* @package Request
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class CannedRequest extends Request {
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules() {
|
||||
return [
|
||||
'title' => 'required',
|
||||
'message' => 'required',
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
33
code/app/Http/Requests/helpdesk/CannedUpdateRequest.php
Normal file
33
code/app/Http/Requests/helpdesk/CannedUpdateRequest.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
* AgentRequest
|
||||
*
|
||||
* @package Request
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class CannedUpdateRequest extends Request {
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules() {
|
||||
return [
|
||||
'title' => 'required',
|
||||
'message' => 'required',
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
33
code/app/Http/Requests/helpdesk/CheckTicket.php
Normal file
33
code/app/Http/Requests/helpdesk/CheckTicket.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
* CheckTicket
|
||||
*
|
||||
* @package Request
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class CheckTicket extends Request {
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules() {
|
||||
return [
|
||||
'email' => 'required|email',
|
||||
'ticket_number' => 'required',
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
35
code/app/Http/Requests/helpdesk/ClientRequest.php
Normal file
35
code/app/Http/Requests/helpdesk/ClientRequest.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
* CompanyRequest
|
||||
*
|
||||
* @package Request
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class ClientRequest extends Request {
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules() {
|
||||
return [
|
||||
'Name'=>'required',
|
||||
'Email'=>'required',
|
||||
'Subject'=>'required',
|
||||
'Details'=>'required',
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
29
code/app/Http/Requests/helpdesk/CommentRequest.php
Normal file
29
code/app/Http/Requests/helpdesk/CommentRequest.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
class CommentRequest extends Request {
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules() {
|
||||
return [
|
||||
'name' => 'required|max:10',
|
||||
'email' => 'required|email',
|
||||
'website' => 'url',
|
||||
'comment' => 'required|max:60',
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
35
code/app/Http/Requests/helpdesk/CompanyRequest.php
Normal file
35
code/app/Http/Requests/helpdesk/CompanyRequest.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
* CompanyRequest
|
||||
*
|
||||
* @package Request
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class CompanyRequest extends Request {
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules() {
|
||||
return [
|
||||
'company_name' => 'required',
|
||||
'website' => 'url',
|
||||
'phone' => 'numeric',
|
||||
'logo' => 'image',
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
29
code/app/Http/Requests/helpdesk/ContactRequest.php
Normal file
29
code/app/Http/Requests/helpdesk/ContactRequest.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
class ContactRequest extends Request {
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules() {
|
||||
return [
|
||||
'name' => 'required',
|
||||
'email' => 'required|email',
|
||||
'subject' => 'required',
|
||||
'message' => 'required|max:50',
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
40
code/app/Http/Requests/helpdesk/CreateTicketRequest.php
Normal file
40
code/app/Http/Requests/helpdesk/CreateTicketRequest.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
* CreateTicketRequest
|
||||
*
|
||||
* @package Request
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class CreateTicketRequest extends Request {
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules() {
|
||||
return [
|
||||
|
||||
'email' => 'required|email',
|
||||
'fullname' => 'required|min:3',
|
||||
'helptopic' => 'required',
|
||||
// 'dept' => 'required',
|
||||
'sla' => 'required',
|
||||
'subject' => 'required|min:5',
|
||||
'body' => 'required|min:20',
|
||||
'priority' => 'required',
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
35
code/app/Http/Requests/helpdesk/DepartmentRequest.php
Normal file
35
code/app/Http/Requests/helpdesk/DepartmentRequest.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
* DepartmentRequest
|
||||
*
|
||||
* @package Request
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class DepartmentRequest extends Request {
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules() {
|
||||
return [
|
||||
'name' => 'required|unique:department',
|
||||
// 'outgoing_email' => 'required',
|
||||
// 'auto_response_email' => 'required',
|
||||
// 'group_id' => 'required',
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
35
code/app/Http/Requests/helpdesk/DepartmentUpdate.php
Normal file
35
code/app/Http/Requests/helpdesk/DepartmentUpdate.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
* DepartmentUpdate
|
||||
*
|
||||
* @package Request
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class DepartmentUpdate extends Request {
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules() {
|
||||
return [
|
||||
|
||||
// 'outgoing_email' => 'required',
|
||||
// 'auto_response_email' => 'required',
|
||||
// 'group_id' => 'required',
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
35
code/app/Http/Requests/helpdesk/DiagnoRequest.php
Normal file
35
code/app/Http/Requests/helpdesk/DiagnoRequest.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
* DiagnoRequest
|
||||
*
|
||||
* @package Request
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class DiagnoRequest extends Request {
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules() {
|
||||
return [
|
||||
'from' => 'required|email',
|
||||
'to' => 'required|email',
|
||||
'subject' => 'required',
|
||||
'message' => 'required',
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
31
code/app/Http/Requests/helpdesk/EmailRequest.php
Normal file
31
code/app/Http/Requests/helpdesk/EmailRequest.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
* EmailRequest
|
||||
*
|
||||
* @package Request
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class EmailRequest extends Request {
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules() {
|
||||
return [
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
45
code/app/Http/Requests/helpdesk/EmailsEditRequest.php
Normal file
45
code/app/Http/Requests/helpdesk/EmailsEditRequest.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
* EmailsEditRequest
|
||||
*
|
||||
* @package Request
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class EmailsEditRequest extends Request {
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules() {
|
||||
return [
|
||||
'email_address' => 'email',
|
||||
'email_name' => 'required',
|
||||
'department' => 'required',
|
||||
'priority' => 'required',
|
||||
'help_topic' => 'required',
|
||||
// 'imap_config' => 'required',
|
||||
'password' => 'required|min:6',
|
||||
'user_name' => 'required',
|
||||
// 'sending_host' => 'required',
|
||||
// 'sending_port' => 'required',
|
||||
//'mailbox_protocol' => 'required'
|
||||
'fetching_host' => 'required',
|
||||
'fetching_port' => 'required',
|
||||
'mailbox_protocol' => 'required',
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
44
code/app/Http/Requests/helpdesk/EmailsRequest.php
Normal file
44
code/app/Http/Requests/helpdesk/EmailsRequest.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
* EmailsRequest
|
||||
*
|
||||
* @package Request
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class EmailsRequest extends Request {
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules() {
|
||||
return [
|
||||
'email_address' => 'required|email|unique:emails',
|
||||
'email_name' => 'required',
|
||||
'department' => 'required',
|
||||
'priority' => 'required',
|
||||
'help_topic' => 'required',
|
||||
// 'imap_config' => 'required',
|
||||
'password' => 'required|min:6',
|
||||
'user_name' => 'required',
|
||||
// 'sending_host' => 'required',
|
||||
// 'sending_port' => 'required',
|
||||
'fetching_host' => 'required',
|
||||
'fetching_port' => 'required',
|
||||
'mailbox_protocol' => 'required',
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
36
code/app/Http/Requests/helpdesk/FormRequest.php
Normal file
36
code/app/Http/Requests/helpdesk/FormRequest.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
* FormRequest
|
||||
*
|
||||
* @package Request
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class FormRequest extends Request {
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules() {
|
||||
return [
|
||||
|
||||
'title' => 'required',
|
||||
'label' => 'required',
|
||||
'type' => 'required',
|
||||
'visibility' => 'required',
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
32
code/app/Http/Requests/helpdesk/GroupRequest.php
Normal file
32
code/app/Http/Requests/helpdesk/GroupRequest.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
* GroupRequest
|
||||
*
|
||||
* @package Request
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class GroupRequest extends Request {
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules() {
|
||||
return [
|
||||
'name' => 'required|unique:groups',
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
38
code/app/Http/Requests/helpdesk/HelptopicRequest.php
Normal file
38
code/app/Http/Requests/helpdesk/HelptopicRequest.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
* HelptopicRequest
|
||||
*
|
||||
* @package Request
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class HelptopicRequest extends Request {
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules() {
|
||||
return [
|
||||
'topic' => 'required|unique:help_topic',
|
||||
// 'parent_topic' => 'required',
|
||||
// 'custom_form' => 'required',
|
||||
'department' => 'required',
|
||||
'priority' => 'required',
|
||||
'sla_plan' => 'required',
|
||||
// 'auto_assign' => 'required',
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
37
code/app/Http/Requests/helpdesk/HelptopicUpdate.php
Normal file
37
code/app/Http/Requests/helpdesk/HelptopicUpdate.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
* HelptopicUpdate
|
||||
*
|
||||
* @package Request
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class HelptopicUpdate extends Request {
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules() {
|
||||
return [
|
||||
// 'parent_topic' => 'required',
|
||||
// 'custom_form' => 'required',
|
||||
'department' => 'required',
|
||||
'priority' => 'required',
|
||||
'sla_plan' => 'required',
|
||||
// 'auto_assign' => 'required',
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
37
code/app/Http/Requests/helpdesk/InstallerRequest.php
Normal file
37
code/app/Http/Requests/helpdesk/InstallerRequest.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
* InstallerRequest
|
||||
*
|
||||
* @package Request
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class InstallerRequest extends Request {
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules() {
|
||||
return [
|
||||
'firstname' => 'required|max:20',
|
||||
'Lastname' => 'required|max:20',
|
||||
'email' => 'required|max:50|email',
|
||||
'username' => 'required|max:50|min:3',
|
||||
'password' => 'required|min:6',
|
||||
'confirmpassword' => 'required|same:password',
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
33
code/app/Http/Requests/helpdesk/LoginRequest.php
Normal file
33
code/app/Http/Requests/helpdesk/LoginRequest.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
* LoginRequest
|
||||
*
|
||||
* @package Request
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class LoginRequest extends Request {
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules() {
|
||||
return [
|
||||
'email' => 'required|email',
|
||||
'password' => 'required|min:6',
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
33
code/app/Http/Requests/helpdesk/MessageRequest.php
Normal file
33
code/app/Http/Requests/helpdesk/MessageRequest.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
class MessageRequest extends Request {
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
|
||||
|
||||
'message_title' => 'required',
|
||||
'message' => 'required'
|
||||
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
35
code/app/Http/Requests/helpdesk/OrganizationRequest.php
Normal file
35
code/app/Http/Requests/helpdesk/OrganizationRequest.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
* OrganizationRequest
|
||||
*
|
||||
* @package Request
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class OrganizationRequest extends Request {
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules() {
|
||||
return [
|
||||
|
||||
'name' => 'required|unique:organization',
|
||||
'website' => 'url',
|
||||
// 'phone' => 'size:10',
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
34
code/app/Http/Requests/helpdesk/OrganizationUpdate.php
Normal file
34
code/app/Http/Requests/helpdesk/OrganizationUpdate.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
* OrganizationUpdate
|
||||
*
|
||||
* @package Request
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class OrganizationUpdate extends Request {
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules() {
|
||||
return [
|
||||
|
||||
'website' => 'url',
|
||||
// 'phone' => 'size:10',
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
34
code/app/Http/Requests/helpdesk/ProfilePassword.php
Normal file
34
code/app/Http/Requests/helpdesk/ProfilePassword.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
* ProfilePassword
|
||||
*
|
||||
* @package Request
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class ProfilePassword extends Request {
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules() {
|
||||
return [
|
||||
'old_password' => 'required',
|
||||
'new_password' => 'required|min:6',
|
||||
'confirm_password' => 'required|same:new_password',
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
33
code/app/Http/Requests/helpdesk/ProfileRequest.php
Normal file
33
code/app/Http/Requests/helpdesk/ProfileRequest.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
* ProfileRequest
|
||||
*
|
||||
* @package Request
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class ProfileRequest extends Request {
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules() {
|
||||
return [
|
||||
'first_name' => 'required',
|
||||
'profile_pic' => 'mimes:png,jpeg',
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
35
code/app/Http/Requests/helpdesk/RegisterRequest.php
Normal file
35
code/app/Http/Requests/helpdesk/RegisterRequest.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
* RegisterRequest
|
||||
*
|
||||
* @package Request
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class RegisterRequest extends Request {
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules() {
|
||||
return [
|
||||
'email' => 'required|max:50|email|unique:users',
|
||||
'full_name' => 'required',
|
||||
'password' => 'required|min:6',
|
||||
'password_confirmation' => 'required|same:password',
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
33
code/app/Http/Requests/helpdesk/SlaRequest.php
Normal file
33
code/app/Http/Requests/helpdesk/SlaRequest.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
* SlaRequest
|
||||
*
|
||||
* @package Request
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class SlaRequest extends Request {
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules() {
|
||||
return [
|
||||
'name' => 'required|unique:sla_plan',
|
||||
'grace_period' => 'required',
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
32
code/app/Http/Requests/helpdesk/SlaUpdate.php
Normal file
32
code/app/Http/Requests/helpdesk/SlaUpdate.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
* SlaUpdate
|
||||
*
|
||||
* @package Request
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class SlaUpdate extends Request {
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules() {
|
||||
return [
|
||||
'grace_period' => 'required',
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
37
code/app/Http/Requests/helpdesk/SmtpRequest.php
Normal file
37
code/app/Http/Requests/helpdesk/SmtpRequest.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
* TicketForm
|
||||
*
|
||||
* @package Request
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class SmtpRequest extends Request {
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules() {
|
||||
return [
|
||||
'host' => 'required',
|
||||
'port' => 'required',
|
||||
'encryption' => 'required',
|
||||
'name' => 'required',
|
||||
'email' => 'required',
|
||||
'password' => 'required',
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
35
code/app/Http/Requests/helpdesk/Sys_userRequest.php
Normal file
35
code/app/Http/Requests/helpdesk/Sys_userRequest.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
* Sys_userRequest
|
||||
*
|
||||
* @package Request
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class Sys_userRequest extends Request {
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules() {
|
||||
return [
|
||||
|
||||
'email' => 'required|unique:users,email',
|
||||
'full_name' => 'required',
|
||||
// 'phone' => 'size:10',
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
34
code/app/Http/Requests/helpdesk/Sys_userUpdate.php
Normal file
34
code/app/Http/Requests/helpdesk/Sys_userUpdate.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
* Sys_userUpdate
|
||||
*
|
||||
* @package Request
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class Sys_userUpdate extends Request {
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules() {
|
||||
return [
|
||||
'user_name' => 'required',
|
||||
// 'email' => 'required|email',
|
||||
// 'phone' => 'size:10',
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
34
code/app/Http/Requests/helpdesk/SystemRequest.php
Normal file
34
code/app/Http/Requests/helpdesk/SystemRequest.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
* SystemRequest
|
||||
*
|
||||
* @package Request
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class SystemRequest extends Request {
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules() {
|
||||
return [
|
||||
|
||||
'name' => '',
|
||||
'url' => 'url',
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
33
code/app/Http/Requests/helpdesk/TeamRequest.php
Normal file
33
code/app/Http/Requests/helpdesk/TeamRequest.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
* TeamRequest
|
||||
*
|
||||
* @package Request
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class TeamRequest extends Request {
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules() {
|
||||
return [
|
||||
'name' => 'required|unique:teams',
|
||||
'status' => 'required',
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
31
code/app/Http/Requests/helpdesk/TeamUpdate.php
Normal file
31
code/app/Http/Requests/helpdesk/TeamUpdate.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
* TeamUpdate
|
||||
*
|
||||
* @package Request
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class TeamUpdate extends Request {
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules() {
|
||||
return [
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
35
code/app/Http/Requests/helpdesk/TemplateRequest.php
Normal file
35
code/app/Http/Requests/helpdesk/TemplateRequest.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
* TemplateRequest
|
||||
*
|
||||
* @package Request
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class TemplateRequest extends Request {
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules() {
|
||||
return [
|
||||
'name' => 'required|unique:template',
|
||||
'ban_status' => 'required',
|
||||
'template_set_to_clone' => 'required',
|
||||
'language' => 'required',
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
35
code/app/Http/Requests/helpdesk/TemplateUdate.php
Normal file
35
code/app/Http/Requests/helpdesk/TemplateUdate.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
* TemplateUdate
|
||||
*
|
||||
* @package Request
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class TemplateUdate extends Request {
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules() {
|
||||
return [
|
||||
|
||||
'ban_status' => 'required',
|
||||
'template_set_to_clone' => 'required',
|
||||
'language' => 'required',
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
36
code/app/Http/Requests/helpdesk/TicketEditRequest.php
Normal file
36
code/app/Http/Requests/helpdesk/TicketEditRequest.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
* AgentRequest
|
||||
*
|
||||
* @package Request
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class TicketEditRequest extends Request {
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules() {
|
||||
return [
|
||||
// 'subject' => 'required',
|
||||
// 'sla_paln' => 'required',
|
||||
// 'help_topic' => 'required',
|
||||
// 'ticket_source' => 'required',
|
||||
// 'ticket_priority' => 'required',
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
35
code/app/Http/Requests/helpdesk/TicketForm.php
Normal file
35
code/app/Http/Requests/helpdesk/TicketForm.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
* TicketForm
|
||||
*
|
||||
* @package Request
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class TicketForm extends Request {
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules() {
|
||||
return [
|
||||
'help_topic' => 'required',
|
||||
'Email' => 'required',
|
||||
'Subject' => 'required',
|
||||
'Detail' => 'required',
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
34
code/app/Http/Requests/helpdesk/TicketRequest.php
Normal file
34
code/app/Http/Requests/helpdesk/TicketRequest.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
* TicketRequest
|
||||
*
|
||||
* @package Request
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class TicketRequest extends Request {
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules() {
|
||||
return [
|
||||
// 'To' => 'required',
|
||||
'ticket_ID' => 'required',
|
||||
'ReplyContent' => 'required',
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
520
code/app/Http/routes.php
Normal file
520
code/app/Http/routes.php
Normal file
@@ -0,0 +1,520 @@
|
||||
<?php
|
||||
"%smtplink%";
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Application Routes
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here is where you can register all of the routes for an application.
|
||||
| It's a breeze. Simply tell Laravel the URIs it should respond to
|
||||
| and give it the controller to call when that URI is requested.
|
||||
|
|
||||
*/
|
||||
|
||||
//Route::get('/', 'WelcomeController@index');
|
||||
//Route::get('/', 'HomeController@index');
|
||||
|
||||
Route::controllers([
|
||||
'auth' => 'Auth\AuthController',
|
||||
'password' => 'Auth\PasswordController',
|
||||
]);
|
||||
|
||||
// Route::get('login','Auth\AuthController@getLogin');
|
||||
$router->get('getmail/{token}', 'Auth\AuthController@getMail');
|
||||
|
||||
/*
|
||||
|-------------------------------------------------------------------------------
|
||||
|Admin Routes
|
||||
|-------------------------------------------------------------------------------
|
||||
| Here is defining entire routes for the Admin Panel
|
||||
|
|
||||
*/
|
||||
|
||||
// To get the dash board
|
||||
//Route::get('dashboard', 'HomeController@index');
|
||||
|
||||
Route::group(['middleware' => 'roles', 'middleware' => 'auth'], function () {
|
||||
// resource is a function to process create,edit,read and delete
|
||||
Route::resource('groups', 'Admin\helpdesk\GroupController'); // for group module, for CRUD
|
||||
|
||||
Route::resource('departments', 'Admin\helpdesk\DepartmentController'); // for departments module, for CRUD
|
||||
|
||||
Route::resource('teams', 'Admin\helpdesk\TeamController'); // in teams module, for CRUD
|
||||
|
||||
Route::resource('agents', 'Admin\helpdesk\AgentController'); // in agents module, for CRUD
|
||||
|
||||
Route::resource('emails', 'Admin\helpdesk\EmailsController'); // in emails module, for CRUD
|
||||
|
||||
Route::resource('banlist', 'Admin\helpdesk\BanlistController'); // in banlist module, for CRUD
|
||||
|
||||
Route::resource('template', 'Admin\helpdesk\TemplateController'); // in template module, for CRUD
|
||||
|
||||
Route::get('getdiagno', 'Admin\helpdesk\TemplateController@formDiagno'); // for getting form for diagnostic
|
||||
|
||||
Route::post('postdiagno', 'Admin\helpdesk\TemplateController@postDiagno'); // for getting form for diagnostic
|
||||
|
||||
Route::resource('helptopic', 'Admin\helpdesk\HelptopicController'); // in helptopics module, for CRUD
|
||||
|
||||
Route::resource('sla', 'Admin\helpdesk\SlaController'); // in SLA Plan module, for CRUD
|
||||
|
||||
Route::resource('forms','Admin\helpdesk\FormController');
|
||||
|
||||
Route::get('delete-forms/{id}',['as'=>'forms.delete','uses'=>'Admin\helpdesk\FormController@delete']);
|
||||
|
||||
//$router->model('id','getcompany');
|
||||
|
||||
Route::get('agent-profile-page/{id}',['as'=>'agent.profile.page','uses'=>'Admin\helpdesk\AgentController@agent_profile']);
|
||||
|
||||
|
||||
Route::get('getcompany', 'Admin\helpdesk\SettingsController@getcompany'); // direct to company setting page
|
||||
|
||||
Route::patch('postcompany/{id}', 'Admin\helpdesk\SettingsController@postcompany'); // Updating the Company table with requests
|
||||
|
||||
Route::get('getsystem', 'Admin\helpdesk\SettingsController@getsystem'); // direct to system setting page
|
||||
|
||||
Route::patch('postsystem/{id}', 'Admin\helpdesk\SettingsController@postsystem'); // Updating the System table with requests
|
||||
|
||||
Route::get('getticket', 'Admin\helpdesk\SettingsController@getticket'); // direct to ticket setting page
|
||||
|
||||
Route::patch('postticket/{id}', 'Admin\helpdesk\SettingsController@postticket'); // Updating the Ticket table with requests
|
||||
|
||||
Route::get('getemail', 'Admin\helpdesk\SettingsController@getemail'); // direct to email setting page
|
||||
|
||||
Route::patch('postemail/{id}', 'Admin\helpdesk\SettingsController@postemail'); // Updating the Email table with requests
|
||||
|
||||
// Route::get('getaccess', 'Admin\helpdesk\SettingsController@getaccess'); // direct to access setting page
|
||||
|
||||
// Route::patch('postaccess/{id}', 'Admin\helpdesk\SettingsController@postaccess'); // Updating the Access table with requests
|
||||
|
||||
Route::get('getresponder', 'Admin\helpdesk\SettingsController@getresponder'); // direct to responder setting page
|
||||
|
||||
Route::patch('postresponder/{id}', 'Admin\helpdesk\SettingsController@postresponder'); // Updating the Responder table with requests
|
||||
|
||||
Route::get('getalert', 'Admin\helpdesk\SettingsController@getalert'); // direct to alert setting page
|
||||
|
||||
Route::patch('postalert/{id}', 'Admin\helpdesk\SettingsController@postalert'); // Updating the Alert table with requests
|
||||
|
||||
/* User profile edit get */
|
||||
Route::get('admin-profile', 'Admin\helpdesk\ProfileController@getProfile');
|
||||
|
||||
/* Admin profile get */
|
||||
Route::get('admin-profile-edit', 'Admin\helpdesk\ProfileController@getProfileedit');
|
||||
|
||||
/* Admin Profile Post */
|
||||
Route::patch('admin-profile', 'Admin\helpdesk\ProfileController@postProfileedit');
|
||||
|
||||
/* Admin Profile Password Post */
|
||||
Route::patch('admin-profile-password', 'Admin\helpdesk\ProfileController@postProfilePassword');
|
||||
|
||||
/* get the create footer page for admin */
|
||||
Route::get('create-footer', 'Common\SettingsController@CreateFooter');
|
||||
|
||||
/* post footer to insert to database */
|
||||
Route::patch('post-create-footer/{id}', 'Common\SettingsController@PostFooter');
|
||||
|
||||
/* get the create footer page for admin */
|
||||
Route::get('create-footer2', 'Common\SettingsController@CreateFooter2');
|
||||
|
||||
/* post footer to insert to database */
|
||||
Route::patch('post-create-footer2/{id}', 'Common\SettingsController@PostFooter2');
|
||||
|
||||
/* get the create footer page for admin */
|
||||
Route::get('create-footer3', 'Common\SettingsController@CreateFooter3');
|
||||
|
||||
/* post footer to insert to database */
|
||||
Route::patch('post-create-footer3/{id}', 'Common\SettingsController@PostFooter3');
|
||||
|
||||
/* get the create footer page for admin */
|
||||
Route::get('create-footer4', 'Common\SettingsController@CreateFooter4');
|
||||
|
||||
/* post footer to insert to database */
|
||||
Route::patch('post-create-footer4/{id}', 'Common\SettingsController@PostFooter4');
|
||||
|
||||
/* get the create footer page for admin */
|
||||
Route::get('getsmtp',['as'=>'getsmtp','uses'=>'Common\SettingsController@getsmtp']);
|
||||
|
||||
/* post footer to insert to database */
|
||||
Route::patch('post-smtp',['as'=>'post_smtp','uses'=>'Common\SettingsController@postsmtp']);
|
||||
|
||||
/* Check version */
|
||||
Route::get('version-check',['as'=>'version-check','uses'=>'Common\SettingsController@version_check']);
|
||||
|
||||
/* post Check version */
|
||||
Route::post('post-version-check',['as'=>'post-version-check','uses'=>'Common\SettingsController@post_version_check']);
|
||||
|
||||
/* get Check update */
|
||||
Route::get('checkUpdate',['as'=>'checkupdate','uses'=>'Common\SettingsController@getupdate']);
|
||||
});
|
||||
/* calling ticket.blade.php file */
|
||||
|
||||
// $router->get('tickets','Admin\ThreadController@getTickets');
|
||||
|
||||
/* calling timeline.blade.php file */
|
||||
|
||||
Route::get('time', function () {
|
||||
return view('themes.default1.admin.tickets.timeline');
|
||||
});
|
||||
|
||||
/*
|
||||
|------------------------------------------------------------------
|
||||
|Agent Routes
|
||||
|--------------------------------------------------------------------
|
||||
| Here defining entire Agent Panel routers
|
||||
|
|
||||
|
|
||||
*/
|
||||
Route::group(['middleware' => 'role.agent', 'middleware' => 'auth'], function () {
|
||||
/* User router is used to control the CRUD of user */
|
||||
Route::resource('user', 'Agent\helpdesk\UserController');
|
||||
|
||||
/* organization router used to deal CRUD function of organization */
|
||||
Route::resource('organizations', 'Agent\helpdesk\OrganizationController');
|
||||
|
||||
/* User profile get */
|
||||
Route::get('profile',['as'=>'profile' , 'uses'=> 'Agent\helpdesk\UserController@getProfile']);
|
||||
|
||||
/* User profile edit get */
|
||||
Route::get('profile-edit', ['as'=>'agent-profile-edit','uses'=>'Agent\helpdesk\UserController@getProfileedit']);
|
||||
|
||||
/* User Profile Post */
|
||||
Route::patch('agent-profile',['as'=>'agent-profile','uses'=> 'Agent\helpdesk\UserController@postProfileedit']);
|
||||
|
||||
/* Profile Password Post */
|
||||
Route::patch('agent-profile-password/{id}', 'Agent\helpdesk\UserController@postProfilePassword');
|
||||
|
||||
/* Canned list */
|
||||
Route::get('canned/list',['as'=>'canned.list','uses'=>'Agent\helpdesk\CannedController@index']);
|
||||
|
||||
/* Canned create */
|
||||
Route::get('canned/create',['as'=>'canned.create','uses'=>'Agent\helpdesk\CannedController@create']);
|
||||
|
||||
/* Canned store */
|
||||
Route::patch('canned/store',['as'=>'canned.store','uses'=>'Agent\helpdesk\CannedController@store']);
|
||||
|
||||
/* Canned edit */
|
||||
Route::get('canned/edit/{id}',['as'=>'canned.edit','uses'=>'Agent\helpdesk\CannedController@edit']);
|
||||
|
||||
/* Canned update */
|
||||
Route::patch('canned/update/{id}',['as'=>'canned.update','uses'=>'Agent\helpdesk\CannedController@update']);
|
||||
|
||||
/* Canned show */
|
||||
Route::get('canned/show/{id}',['as'=>'canned.show','uses'=>'Agent\helpdesk\CannedController@show']);
|
||||
|
||||
/* Canned delete */
|
||||
Route::delete('canned/destroy/{id}',['as'=>'canned.destroy','uses'=>'Agent\helpdesk\CannedController@destroy']);
|
||||
|
||||
// Route::get('/abcd', 'GuestController@getList');
|
||||
// Route::get('/qwer', ['as' => 'thread', 'uses' => 'GuestController@getThread']);
|
||||
|
||||
/* Fetch Emails */
|
||||
Route::get('/test', ['as' => 'thr', 'uses' => 'Agent\helpdesk\MailController@fetchdata']);
|
||||
|
||||
/* Get Ticket */
|
||||
Route::get('/ticket', ['as' => 'ticket', 'uses' => 'Agent\helpdesk\TicketController@ticket_list']);
|
||||
|
||||
/* Get Inbox Ticket */
|
||||
Route::get('/ticket/inbox', ['as' => 'inbox.ticket', 'uses' => 'Agent\helpdesk\TicketController@inbox_ticket_list']);
|
||||
|
||||
/* Get Open Ticket */
|
||||
Route::get('/ticket/open', ['as' => 'open.ticket', 'uses' => 'Agent\helpdesk\TicketController@open_ticket_list']);
|
||||
|
||||
/* Get Answered Ticket */
|
||||
Route::get('/ticket/answered', ['as' => 'answered.ticket', 'uses' => 'Agent\helpdesk\TicketController@answered_ticket_list']);
|
||||
|
||||
/* Get Tickets Assigned to logged user */
|
||||
Route::get('/ticket/myticket', ['as' => 'myticket.ticket', 'uses' => 'Agent\helpdesk\TicketController@myticket_ticket_list']);
|
||||
|
||||
/* Get Overdue Ticket */
|
||||
Route::get('/ticket/overdue', ['as' => 'overdue.ticket', 'uses' => 'Agent\helpdesk\TicketController@overdue_ticket_list']);
|
||||
|
||||
/* Get Closed Ticket */
|
||||
Route::get('/ticket/closed', ['as' => 'closed.ticket', 'uses' => 'Agent\helpdesk\TicketController@closed_ticket_list']);
|
||||
|
||||
/* Get Assigned Ticket */
|
||||
Route::get('/ticket/assigned', ['as' => 'assigned.ticket', 'uses' => 'Agent\helpdesk\TicketController@assigned_ticket_list']);
|
||||
|
||||
/* Get Create New Ticket */
|
||||
Route::get('/newticket', ['as' => 'newticket', 'uses' => 'Agent\helpdesk\TicketController@newticket']);
|
||||
|
||||
/* Post Create New Ticket */
|
||||
Route::post('/newticket/post', ['as' => 'post.newticket', 'uses' => 'Agent\helpdesk\TicketController@post_newticket']);
|
||||
|
||||
/* Get Thread by ID */
|
||||
Route::get('/thread/{id}', ['as' => 'ticket.thread', 'uses' => 'Agent\helpdesk\TicketController@thread']);
|
||||
|
||||
/* Patch Thread Reply */
|
||||
Route::patch('/thread/reply/{id}', ['as' => 'ticket.reply', 'uses' => 'Agent\helpdesk\TicketController@reply']);
|
||||
|
||||
/* Patch Internal Note */
|
||||
Route::patch('/internal/note/{id}', ['as' => 'Internal.note', 'uses' => 'Agent\helpdesk\TicketController@InternalNote']);
|
||||
|
||||
/* Patch Ticket assigned to whom */
|
||||
Route::patch('/ticket/assign/{id}', ['as' => 'assign.ticket', 'uses' => 'Agent\helpdesk\TicketController@assign']);
|
||||
|
||||
/* Patchi Ticket Edit */
|
||||
Route::patch('/ticket/post/edit/{id}', ['as' => 'ticket.post.edit', 'uses' => 'Agent\helpdesk\TicketController@ticket_edit_post']);
|
||||
|
||||
/* Get Print Ticket */
|
||||
Route::get('/ticket/print/{id}', ['as' => 'ticket.print', 'uses' => 'Agent\helpdesk\TicketController@ticket_print']);
|
||||
|
||||
/* Get Ticket Close */
|
||||
Route::get('/ticket/close/{id}', ['as' => 'ticket.close', 'uses' => 'Agent\helpdesk\TicketController@close']);
|
||||
|
||||
/* Get ticket Resolve */
|
||||
Route::get('/ticket/resolve/{id}', ['as' => 'ticket.resolve', 'uses' => 'Agent\helpdesk\TicketController@resolve']);
|
||||
|
||||
/* Get Ticket Open */
|
||||
Route::get('/ticket/open/{id}', ['as' => 'ticket.open', 'uses' => 'Agent\helpdesk\TicketController@open']);
|
||||
|
||||
/* Get Ticket Delete */
|
||||
Route::get('/ticket/delete/{id}', ['as' => 'ticket.delete', 'uses' => 'Agent\helpdesk\TicketController@delete']);
|
||||
|
||||
/* Get Ban Email */
|
||||
Route::get('/email/ban/{id}', ['as' => 'ban.email', 'uses' => 'Agent\helpdesk\TicketController@ban']);
|
||||
|
||||
/* Get Ticket Surrender */
|
||||
Route::get('/ticket/surrender/{id}', ['as' => 'ticket.surrender', 'uses' => 'Agent\helpdesk\TicketController@surrender']);
|
||||
|
||||
Route::get('/aaaa', 'Client\helpdesk\GuestController@ticket_number');
|
||||
|
||||
/* To show Deleted Tickets */
|
||||
Route::get('trash', 'Agent\helpdesk\TicketController@trash');
|
||||
|
||||
/* To show Unassigned Tickets */
|
||||
Route::get('unassigned', 'Agent\helpdesk\TicketController@unassigned');
|
||||
|
||||
/* To show dashboard pages */
|
||||
Route::get('dashboard', 'Agent\helpdesk\DashboardController@index');
|
||||
|
||||
Route::get('agen', 'Agent\helpdesk\DashboardController@ChartData');
|
||||
|
||||
/* get image */
|
||||
Route::get('image/{id}', ['as'=>'image', 'uses'=>'Agent\helpdesk\MailController@get_data']);
|
||||
|
||||
Route::get('thread/auto/{id}', 'Agent\helpdesk\TicketController@autosearch');
|
||||
|
||||
Route::get('auto', 'Agent\helpdesk\TicketController@autosearch2');
|
||||
|
||||
Route::patch('search-user', 'Agent\helpdesk\TicketController@usersearch');
|
||||
|
||||
Route::patch('add-user', 'Agent\helpdesk\TicketController@useradd');
|
||||
|
||||
Route::post('remove-user', 'Agent\helpdesk\TicketController@userremove');
|
||||
|
||||
Route::post('select_all', ['as'=>'select_all' ,'uses'=>'Agent\helpdesk\TicketController@select_all']);
|
||||
|
||||
Route::post('canned/{id}', 'Agent\helpdesk\CannedController@get_canned');
|
||||
|
||||
// Route::get('message' , 'MessageController@show');
|
||||
|
||||
Route::post('lock',['as'=>'lock' , 'uses'=>'Agent\helpdesk\TicketController@lock']);
|
||||
|
||||
Route::patch('user-org-assign/{id}', ['as'=>'user.assign.org', 'uses'=>'Agent\helpdesk\UserController@UserAssignOrg']);
|
||||
|
||||
Route::patch('/user-org/{id}','Agent\helpdesk\UserController@User_Create_Org');
|
||||
|
||||
Route::patch('/head-org/{id}','Agent\helpdesk\OrganizationController@Head_Org');
|
||||
|
||||
// Department ticket
|
||||
// Open
|
||||
Route::get('/{dept}/open',['as'=>'dept.open.ticket','uses'=>'Agent\helpdesk\TicketController@deptopen']);
|
||||
// Inprogress
|
||||
Route::get('/{dept}/inprogress',['as'=>'dept.inprogress.ticket','uses'=>'Agent\helpdesk\TicketController@deptinprogress']);
|
||||
// Closed
|
||||
Route::get('/{dept}/closed',['as'=>'dept.closed.ticket','uses'=>'Agent\helpdesk\TicketController@deptclose']);
|
||||
|
||||
});
|
||||
// cscdds
|
||||
/*
|
||||
|------------------------------------------------------------------
|
||||
|Guest Routes
|
||||
|--------------------------------------------------------------------
|
||||
| Here defining Guest User's routes
|
||||
|
|
||||
|
|
||||
*/
|
||||
// seasrch
|
||||
Route::POST('tickets/search/', function() {
|
||||
$keyword = Illuminate\Support\Str::lower(Input::get('auto'));
|
||||
$models = App\Model\Ticket\Tickets::where('ticket_number', '=',$keyword)->orderby('ticket_number')->take(10)->skip(0)->get();
|
||||
$count = count($models);
|
||||
return Illuminate\Support\Facades\Redirect::back()->with("contents", $models)->with("counts", $count);
|
||||
|
||||
});
|
||||
Route::any('getdata', function() {
|
||||
|
||||
$term = Illuminate\Support\Str::lower(Input::get('term'));
|
||||
$data = Illuminate\Support\Facades\DB::table("tickets")->distinct()->select('ticket_number')->where('ticket_number','LIKE',$term.'%')->groupBy('ticket_number')->take(10)->get();
|
||||
foreach($data as $v) {
|
||||
return [
|
||||
'value' => $v->ticket_number
|
||||
];
|
||||
}
|
||||
});
|
||||
|
||||
/* get the form for create a ticket by guest user */
|
||||
Route::get('getform', ['as'=>'guest.getform' ,'uses'=> 'Client\helpdesk\FormController@getForm']);
|
||||
/* post the AJAX form for create a ticket by guest user */
|
||||
Route::post('postform/{id}', 'Client\helpdesk\FormController@postForm');
|
||||
/* post the form to store the value */
|
||||
Route::post('postedform', 'Client\helpdesk\FormController@postedForm');
|
||||
//testing checkbox auto-populate
|
||||
Route::get('check', 'CheckController@getcheck');
|
||||
Route::post('postcheck/{id}', 'CheckController@postcheck');
|
||||
//guest layout
|
||||
Route::get('home', ['as'=>'home', 'uses'=>'Client\helpdesk\WelcomepageController@index']);
|
||||
Route::get('/', ['as'=>'/', 'uses'=>'Client\helpdesk\WelcomepageController@index']);
|
||||
|
||||
//getform
|
||||
Route::get('form',['as'=>'form','uses'=>'Client\helpdesk\FormController@getForm']);
|
||||
//detail ticket information
|
||||
Route::get('mytickets/{id}', ['as' => 'ticketinfo', 'uses' => 'Client\helpdesk\GuestController@singleThread']);
|
||||
//ticket ckeck
|
||||
Route::post('checkmyticket', 'Client\helpdesk\GuestController@PostCheckTicket');
|
||||
//detail ticket information
|
||||
Route::get('check_ticket/{id}', ['as' => 'check_ticket', 'uses' => 'Client\helpdesk\GuestController@get_ticket_email']);
|
||||
|
||||
//testing ckeditor
|
||||
//===================================================================================
|
||||
Route::group(['middleware' => 'role.user', 'middleware' => 'auth'], function () {
|
||||
/* User profile get */
|
||||
Route::get('client-profile', ['as'=>'client.profile', 'uses'=>'Client\helpdesk\GuestController@getProfile']);
|
||||
Route::get('mytickets', ['as' => 'ticket2', 'uses' => 'Client\helpdesk\GuestController@getMyticket']);
|
||||
/* Get my tickets */
|
||||
Route::get('myticket/{id}', ['as' => 'ticket', 'uses' => 'Client\helpdesk\GuestController@thread']);
|
||||
/* User Profile Post */
|
||||
Route::patch('client-profile-edit', 'Client\helpdesk\GuestController@postProfile');
|
||||
/* Profile Password Post */
|
||||
Route::patch('client-profile-password', 'Client\helpdesk\GuestController@postProfilePassword');
|
||||
|
||||
Route::post('post/reply/{id}',['as'=>'client.reply','uses'=>'Client\helpdesk\ClientTicketController@reply']);
|
||||
});
|
||||
|
||||
//====================================================================================
|
||||
/* Check your Ticket */
|
||||
Route::get('checkticket', 'Client\helpdesk\ClientTicketController@getCheckTicket');
|
||||
/* Get my tickets */
|
||||
Route::get('myticket', ['as' => 'ticket', 'uses' => 'Client\helpdesk\GuestController@getMyticket']);
|
||||
/* Get my tickets */
|
||||
Route::get('myticket/{id}', ['as' => 'ticket', 'uses' => 'Client\helpdesk\GuestController@thread']);
|
||||
/* post Check Ticket */
|
||||
Route::post('postcheck', 'Client\helpdesk\GuestController@PostCheckTicket');
|
||||
Route::get('postcheck', 'Client\helpdesk\GuestController@PostCheckTicket');
|
||||
|
||||
Route::post('post-ticket-reply/{id}', 'Client\helpdesk\FormController@post_ticket_reply');
|
||||
|
||||
|
||||
/* 404 page */
|
||||
Route::get('404', 'error\ErrorController@error404');
|
||||
|
||||
// installer
|
||||
Route::get('/serial', array(
|
||||
'as' => 'serialkey',
|
||||
'uses' => 'Installer\helpdesk\InstallController@serialkey',
|
||||
));
|
||||
Route::post('/CheckSerial/{id}', array(
|
||||
'as' => 'CheckSerial',
|
||||
'uses' => 'Installer\helpdesk\InstallController@PostSerialKey',
|
||||
));
|
||||
Route::get('/step1', array(
|
||||
'as' => 'licence',
|
||||
'uses' => 'Installer\helpdesk\InstallController@licence',
|
||||
));
|
||||
Route::post('/step1post', array(
|
||||
'as' => 'postlicence',
|
||||
'uses' => 'Installer\helpdesk\InstallController@licencecheck',
|
||||
));
|
||||
Route::get('/step2', array(
|
||||
'as' => 'prerequisites',
|
||||
'uses' => 'Installer\helpdesk\InstallController@prerequisites',
|
||||
));
|
||||
Route::post('/step2post', array(
|
||||
'as' => 'postprerequisites',
|
||||
'uses' => 'Installer\helpdesk\InstallController@prerequisitescheck',
|
||||
));
|
||||
Route::get('/step3', array(
|
||||
'as' => 'localization',
|
||||
'uses' => 'Installer\helpdesk\InstallController@localization',
|
||||
));
|
||||
Route::post('/step3post', array(
|
||||
'as' => 'postlocalization',
|
||||
'uses' => 'Installer\helpdesk\InstallController@localizationcheck',
|
||||
));
|
||||
Route::get('/step4', array(
|
||||
'as' => 'configuration',
|
||||
'uses' => 'Installer\helpdesk\InstallController@configuration',
|
||||
));
|
||||
Route::post('/step4post', array(
|
||||
'as' => 'postconfiguration',
|
||||
'uses' => 'Installer\helpdesk\InstallController@configurationcheck',
|
||||
));
|
||||
Route::get('/step5', array(
|
||||
'as' => 'database',
|
||||
'uses' => 'Installer\helpdesk\InstallController@database',
|
||||
));
|
||||
Route::get('/step6', array(
|
||||
'as' => 'account',
|
||||
'uses' => 'Installer\helpdesk\InstallController@account',
|
||||
));
|
||||
Route::post('/step6post', array(
|
||||
'as' => 'postaccount',
|
||||
'uses' => 'Installer\helpdesk\InstallController@accountcheck',
|
||||
));
|
||||
Route::get('/final', array(
|
||||
'as' => 'final',
|
||||
'uses' => 'Installer\helpdesk\InstallController@finalize',
|
||||
));
|
||||
Route::post('/finalpost', array(
|
||||
'as' => 'postfinal',
|
||||
'uses' => 'Installer\helpdesk\InstallController@finalcheck',
|
||||
));
|
||||
Route::patch('/postconnection', array(
|
||||
'as' => 'postconnection',
|
||||
'uses' => 'Installer\helpdesk\InstallController@postconnection',
|
||||
));
|
||||
|
||||
|
||||
|
||||
// cron job link
|
||||
Route::get('readmails',['as' => 'readmails', 'uses' => 'Agent\helpdesk\MailController@readmails']);
|
||||
|
||||
// to list of routes
|
||||
Route::get('/aaa',function(){
|
||||
$routeCollection = Route::getRoutes();
|
||||
echo "<table style='width:100%'>";
|
||||
echo "<tr>";
|
||||
echo "<td width='10%'><h4>HTTP Method</h4></td>";
|
||||
echo "<td width='10%'><h4>Route</h4></td>";
|
||||
echo "<td width='10%'><h4>Url</h4></td>";
|
||||
echo "<td width='80%'><h4>Corresponding Action</h4></td>";
|
||||
echo "</tr>";
|
||||
foreach ($routeCollection as $value) {
|
||||
echo "<tr>";
|
||||
echo "<td>" . $value->getMethods()[0] . "</td>";
|
||||
echo "<td>" . $value->getName() . "</td>";
|
||||
echo "<td>" . $value->getPath() . "</td>";
|
||||
echo "<td>" . $value->getActionName() . "</td>";
|
||||
echo "</tr>";
|
||||
}
|
||||
echo "</table>";
|
||||
});
|
||||
|
||||
Route::get('503',function(){
|
||||
return view('errors.503');
|
||||
});
|
||||
|
||||
Route::get('404',function(){
|
||||
return view('errors.404');
|
||||
});
|
||||
|
||||
|
||||
Route::get('testmail',function(){
|
||||
$e = "hello";
|
||||
Config::set('mail.host', 'smtp.gmail.com');
|
||||
\Mail::send('errors.report', array('e' => $e), function ($message) {
|
||||
$message->to('sujitprasad4567@gmail.com', 'sujit prasad')->subject('Error');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
// Route::get('smp','HomeController@getsmtp');
|
||||
13
code/app/Model/helpdesk/Agent/Agents.php
Normal file
13
code/app/Model/helpdesk/Agent/Agents.php
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php namespace App\Model\helpdesk\Agent;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Agents extends Model
|
||||
{
|
||||
protected $table = 'agents';
|
||||
protected $fillable = [
|
||||
'user_name','first_name','last_name','email','phone','mobile','agent_sign',
|
||||
'account_type','account_status','assign_group','primary_dpt','agent_tzone',
|
||||
'daylight_save','limit_access','directory_listing','vocation_mode','assign_team'
|
||||
];
|
||||
}
|
||||
11
code/app/Model/helpdesk/Agent/Assign_team_agent.php
Normal file
11
code/app/Model/helpdesk/Agent/Assign_team_agent.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php namespace App\Model\helpdesk\Agent;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Assign_team_agent extends Model {
|
||||
|
||||
protected $table = 'team_assign_agent';
|
||||
|
||||
protected $fillable = ['id','team_id','agent_id'];
|
||||
|
||||
}
|
||||
13
code/app/Model/helpdesk/Agent/Department.php
Normal file
13
code/app/Model/helpdesk/Agent/Department.php
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php namespace App\Model\helpdesk\Agent;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Department extends Model
|
||||
{
|
||||
protected $table = 'department';
|
||||
protected $fillable = [
|
||||
'name', 'type', 'sla', 'manager', 'ticket_assignment', 'outgoing_email',
|
||||
'template_set', 'auto_ticket_response', 'auto_message_response',
|
||||
'auto_response_email', 'recipient', 'group_access', 'department_sign'
|
||||
];
|
||||
}
|
||||
11
code/app/Model/helpdesk/Agent/Group_assign_department.php
Normal file
11
code/app/Model/helpdesk/Agent/Group_assign_department.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php namespace App\Model\helpdesk\Agent;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Group_assign_department extends Model {
|
||||
|
||||
protected $table = 'group_assign_department';
|
||||
|
||||
protected $fillable = ['group_id','id','department_id'];
|
||||
|
||||
}
|
||||
15
code/app/Model/helpdesk/Agent/Groups.php
Normal file
15
code/app/Model/helpdesk/Agent/Groups.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php namespace App\Model\helpdesk\Agent;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Groups extends Model
|
||||
{
|
||||
protected $table = 'groups';
|
||||
protected $fillable = [
|
||||
'name', 'group_status', 'can_create_ticket', 'can_edit_ticket',
|
||||
'can_post_ticket', 'can_close_ticket', 'can_assign_ticket',
|
||||
'can_trasfer_ticket', 'can_delete_ticket', 'can_ban_email',
|
||||
'can_manage_canned', 'can_manage_faq', 'can_view_agent_stats',
|
||||
'department_access', 'admin_notes'
|
||||
];
|
||||
}
|
||||
11
code/app/Model/helpdesk/Agent/Teams.php
Normal file
11
code/app/Model/helpdesk/Agent/Teams.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php namespace App\Model\helpdesk\Agent;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Teams extends Model
|
||||
{
|
||||
protected $table = 'teams';
|
||||
protected $fillable = [
|
||||
'name', 'status', 'team_lead', 'assign_alert', 'admin_notes'
|
||||
];
|
||||
}
|
||||
13
code/app/Model/helpdesk/Agent_panel/Canned.php
Normal file
13
code/app/Model/helpdesk/Agent_panel/Canned.php
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php namespace App\Model\helpdesk\Agent_panel;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Canned extends Model {
|
||||
|
||||
/* define the table name */
|
||||
protected $table = 'canned_response';
|
||||
|
||||
/* Define the fillable fields */
|
||||
protected $fillable = ['user_id','title','message','created_at','updated_at'];
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user