Applied fixes from StyleCI
This commit is contained in:

committed by
StyleCI Bot

parent
be5df5334f
commit
d637c2b23f
@@ -3,47 +3,47 @@
|
||||
namespace App\Http\Controllers\Admin\helpdesk;
|
||||
|
||||
// controller
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Controllers\Common\SettingsController;
|
||||
use App\Http\Controllers\Common\PhpMailController;
|
||||
use App\Http\Controllers\Common\SettingsController;
|
||||
use App\Http\Controllers\Controller;
|
||||
// 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\Email\Emails;
|
||||
use App\Model\helpdesk\Settings\Company;
|
||||
use App\Model\helpdesk\Settings\Email;
|
||||
use App\Model\helpdesk\Email\Emails;
|
||||
use App\Model\helpdesk\Utility\Timezones;
|
||||
use App\User;
|
||||
// classes
|
||||
use DB;
|
||||
use Mail;
|
||||
use Hash;
|
||||
use Exception;
|
||||
use Hash;
|
||||
use Mail;
|
||||
|
||||
/**
|
||||
* AgentController
|
||||
* This controller is used to CRUD category
|
||||
* This controller is used to CRUD category.
|
||||
*
|
||||
* @package Controllers
|
||||
* @subpackage Controller
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class AgentController extends Controller {
|
||||
|
||||
class AgentController extends Controller
|
||||
{
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
* constructor to check
|
||||
* 1. authentication
|
||||
* 2. user roles
|
||||
* 3. roles must be agent
|
||||
* 3. roles must be agent.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(PhpMailController $PhpMailController) {
|
||||
public function __construct(PhpMailController $PhpMailController)
|
||||
{
|
||||
$this->PhpMailController = $PhpMailController;
|
||||
SettingsController::smtp();
|
||||
// checking authentication
|
||||
@@ -53,11 +53,14 @@ class AgentController extends Controller {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all agent list page
|
||||
* Get all agent list page.
|
||||
*
|
||||
* @param type User $user
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function index() {
|
||||
public function index()
|
||||
{
|
||||
try {
|
||||
return view('themes.default1.admin.helpdesk.agent.agents.index');
|
||||
} catch (Exception $e) {
|
||||
@@ -66,21 +69,25 @@ class AgentController extends Controller {
|
||||
}
|
||||
|
||||
/**
|
||||
* creating a new agent
|
||||
* creating a new agent.
|
||||
*
|
||||
* @param type Assign_team_agent $team_assign_agent
|
||||
* @param type Timezones $timezone
|
||||
* @param type Groups $group
|
||||
* @param type Department $department
|
||||
* @param type Teams $team
|
||||
* @param type Timezones $timezone
|
||||
* @param type Groups $group
|
||||
* @param type Department $department
|
||||
* @param type Teams $team
|
||||
*
|
||||
* @return type view
|
||||
*/
|
||||
public function create(Assign_team_agent $team_assign_agent, Timezones $timezone, Groups $group, Department $department, Teams $team) {
|
||||
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 redirect()->back()->with('fails', $e->errorInfo[2]);
|
||||
@@ -88,13 +95,16 @@ class AgentController extends Controller {
|
||||
}
|
||||
|
||||
/**
|
||||
* store a new agent
|
||||
* @param type User $user
|
||||
* @param type AgentRequest $request
|
||||
* store a new agent.
|
||||
*
|
||||
* @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) {
|
||||
public function store(User $user, AgentRequest $request, Assign_team_agent $team_assign_agent)
|
||||
{
|
||||
|
||||
// dd($this->system_mail());
|
||||
|
||||
@@ -120,6 +130,7 @@ class AgentController extends Controller {
|
||||
} catch (Exception $e) {
|
||||
return redirect('agents')->with('fails', 'Some error occured while sending mail to the agent. Please check email settings and try again');
|
||||
}
|
||||
|
||||
return redirect('agents')->with('success', 'Agent Created sucessfully');
|
||||
} else {
|
||||
return redirect('agents')->with('fails', 'Agent can not Create');
|
||||
@@ -127,17 +138,20 @@ class AgentController extends Controller {
|
||||
}
|
||||
|
||||
/**
|
||||
* Editing a selected agent
|
||||
* @param type int $id
|
||||
* @param type User $user
|
||||
* Editing a selected agent.
|
||||
*
|
||||
* @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
|
||||
* @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) {
|
||||
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();
|
||||
@@ -148,6 +162,7 @@ class AgentController extends Controller {
|
||||
$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');
|
||||
@@ -156,13 +171,16 @@ class AgentController extends Controller {
|
||||
|
||||
/**
|
||||
* Update the specified agent in storage.
|
||||
* @param type int $id
|
||||
* @param type User $user
|
||||
* @param type AgentUpdate $request
|
||||
*
|
||||
* @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) {
|
||||
public function update($id, User $user, AgentUpdate $request, Assign_team_agent $team_assign_agent)
|
||||
{
|
||||
|
||||
// storing all the details
|
||||
$user = $user->whereId($id)->first();
|
||||
@@ -181,20 +199,24 @@ class AgentController extends Controller {
|
||||
//Todo For success and failure conditions
|
||||
try {
|
||||
$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' . '<li>' . $e->errorInfo[2] . '</li>');
|
||||
return redirect('agents')->with('fails', 'Agent did not update'.'<li>'.$e->errorInfo[2].'</li>');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified agent from storage.
|
||||
* @param type int $id
|
||||
* @param type User $user
|
||||
*
|
||||
* @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) {
|
||||
public function destroy($id, User $user, Assign_team_agent $team_assign_agent)
|
||||
{
|
||||
/* Becouse of foreign key we delete team_assign_agent first */
|
||||
error_reporting(E_ALL & ~E_NOTICE);
|
||||
$team_assign_agent = $team_assign_agent->where('agent_id', $id);
|
||||
@@ -205,43 +227,52 @@ class AgentController extends Controller {
|
||||
$user->id;
|
||||
$user->delete();
|
||||
throw new \Exception($error);
|
||||
|
||||
return redirect('agents')->with('success', 'Agent Deleted sucessfully');
|
||||
} catch (\Exception $e) {
|
||||
dd($e->errorInfo);
|
||||
|
||||
return redirect('agents')->with('fails', $error);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate a random string for password
|
||||
* Generate a random string for password.
|
||||
*
|
||||
* @param type $length
|
||||
*
|
||||
* @return type string
|
||||
*/
|
||||
public function generateRandomString($length = 10) {
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetching comapny name to send mail
|
||||
* Fetching comapny name to send mail.
|
||||
*
|
||||
* @return type
|
||||
*/
|
||||
public function company() {
|
||||
public function company()
|
||||
{
|
||||
$company = Company::Where('id', '=', '1')->first();
|
||||
if ($company->company_name == null) {
|
||||
$company = "Support Center";
|
||||
$company = 'Support Center';
|
||||
} else {
|
||||
$company = $company->company_name;
|
||||
}
|
||||
|
||||
return $company;
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* System default email
|
||||
*/
|
||||
// public function system_mail() {
|
||||
|
@@ -8,29 +8,30 @@ use App\Http\Controllers\Controller;
|
||||
use App\Http\Requests\helpdesk\BanlistRequest;
|
||||
use App\Http\Requests\helpdesk\BanRequest;
|
||||
// model
|
||||
use App\User;
|
||||
use App\Model\helpdesk\Email\Banlist;
|
||||
use App\User;
|
||||
//classes
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
* BanlistController
|
||||
* In this controller in the CRUD function for all the banned emails
|
||||
* @package Controllers
|
||||
* @subpackage Controller
|
||||
* In this controller in the CRUD function for all the banned emails.
|
||||
*
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class BanlistController extends Controller {
|
||||
|
||||
class BanlistController extends Controller
|
||||
{
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
* constructor to check
|
||||
* 1. authentication
|
||||
* 2. user roles
|
||||
* 3. roles must be agent
|
||||
* 3. roles must be agent.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct() {
|
||||
public function __construct()
|
||||
{
|
||||
// checking authentication
|
||||
$this->middleware('auth');
|
||||
// checking admin roles
|
||||
@@ -39,12 +40,16 @@ class BanlistController extends Controller {
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @param type Banlist $ban
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function index() {
|
||||
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');
|
||||
@@ -53,9 +58,11 @@ class BanlistController extends Controller {
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function create() {
|
||||
public function create()
|
||||
{
|
||||
try {
|
||||
return view('themes.default1.admin.helpdesk.emails.banlist.create');
|
||||
} catch (Exception $e) {
|
||||
@@ -65,12 +72,15 @@ class BanlistController extends Controller {
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
* @param type banlist $ban
|
||||
*
|
||||
* @param type banlist $ban
|
||||
* @param type BanRequest $request
|
||||
* @param type User $user
|
||||
* @param type User $user
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function store(BanRequest $request, User $user) {
|
||||
public function store(BanRequest $request, User $user)
|
||||
{
|
||||
// dd($request);
|
||||
try {
|
||||
//adding field to user whether it is banned or not
|
||||
@@ -83,11 +93,12 @@ class BanlistController extends Controller {
|
||||
// $user->create($request->input())->save();
|
||||
return redirect('banlist')->with('success', 'Email Banned sucessfully');
|
||||
} else {
|
||||
$user = new User;
|
||||
$user = new User();
|
||||
$user->email = $adban;
|
||||
$user->ban = $request->input('ban');
|
||||
$user->internal_note = $request->input('internal_note');
|
||||
$user->save();
|
||||
|
||||
return redirect('banlist')->with('success', 'Email Banned sucessfully');
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
@@ -98,22 +109,28 @@ class BanlistController extends Controller {
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @param int $id
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function show($id) {
|
||||
public function show($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
* @param type int $id
|
||||
*
|
||||
* @param type int $id
|
||||
* @param type Banlist $ban
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function edit($id, User $ban) {
|
||||
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');
|
||||
@@ -122,12 +139,15 @@ class BanlistController extends Controller {
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
* @param type int $id
|
||||
* @param type Banlist $ban
|
||||
*
|
||||
* @param type int $id
|
||||
* @param type Banlist $ban
|
||||
* @param type BanlistRequest $request
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function update($id, User $ban, BanlistRequest $request) {
|
||||
public function update($id, User $ban, BanlistRequest $request)
|
||||
{
|
||||
try {
|
||||
$bans = $ban->whereId($id)->first();
|
||||
$bans->internal_note = $request->input('internal_note');
|
||||
@@ -143,7 +163,7 @@ class BanlistController extends Controller {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* Remove the specified resource from storage.
|
||||
* @param type int $id
|
||||
* @param type Banlist $ban
|
||||
|
@@ -9,46 +9,50 @@ 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\Groups;
|
||||
use App\Model\helpdesk\Agent\Teams;
|
||||
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\System;
|
||||
use App\Model\helpdesk\Ticket\Tickets;
|
||||
use App\Model\helpdesk\Manage\Help_topic;
|
||||
use App\User;
|
||||
// classes
|
||||
use DB;
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
* DepartmentController
|
||||
* DepartmentController.
|
||||
*
|
||||
* @package Controllers
|
||||
* @subpackage Controller
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class DepartmentController extends Controller {
|
||||
|
||||
class DepartmentController extends Controller
|
||||
{
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct() {
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('auth');
|
||||
$this->middleware('roles');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get index page
|
||||
* Get index page.
|
||||
*
|
||||
* @param type Department $department
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function index(Department $department) {
|
||||
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');
|
||||
@@ -57,16 +61,19 @@ class DepartmentController extends Controller {
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
* @param type User $user
|
||||
*
|
||||
* @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
|
||||
* @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) {
|
||||
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();
|
||||
@@ -74,6 +81,7 @@ class DepartmentController extends Controller {
|
||||
$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');
|
||||
@@ -82,11 +90,14 @@ class DepartmentController extends Controller {
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
* @param type Department $department
|
||||
*
|
||||
* @param type Department $department
|
||||
* @param type DepartmentRequest $request
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function store(Department $department, DepartmentRequest $request) {
|
||||
public function store(Department $department, DepartmentRequest $request)
|
||||
{
|
||||
try {
|
||||
$department->fill($request->except('group_id', 'manager'))->save();
|
||||
$requests = $request->input('group_id');
|
||||
@@ -113,18 +124,21 @@ class DepartmentController extends Controller {
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
* @param type int $id
|
||||
* @param type User $user
|
||||
*
|
||||
* @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
|
||||
* @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) {
|
||||
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();
|
||||
@@ -133,6 +147,7 @@ class DepartmentController extends Controller {
|
||||
$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');
|
||||
@@ -141,13 +156,16 @@ class DepartmentController extends Controller {
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
* @param type int $id
|
||||
*
|
||||
* @param type int $id
|
||||
* @param type Group_assign_department $group_assign_department
|
||||
* @param type Department $department
|
||||
* @param type DepartmentUpdate $request
|
||||
* @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) {
|
||||
public function update($id, Group_assign_department $group_assign_department, Department $department, DepartmentUpdate $request)
|
||||
{
|
||||
// dd($id);
|
||||
try {
|
||||
$table = $group_assign_department->where('department_id', $id);
|
||||
@@ -177,12 +195,15 @@ class DepartmentController extends Controller {
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
* @param type int $id
|
||||
* @param type Department $department
|
||||
*
|
||||
* @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, System $system, Tickets $tickets) {
|
||||
public function destroy($id, Department $department, Group_assign_department $group_assign_department, System $system, Tickets $tickets)
|
||||
{
|
||||
// try {
|
||||
$system = $system->where('id', '=', '1')->first();
|
||||
if ($system->department == $id) {
|
||||
@@ -191,54 +212,53 @@ class DepartmentController extends Controller {
|
||||
$tickets = DB::table('tickets')->where('dept_id', '=', $id)->update(['dept_id' => $system->department]);
|
||||
if ($tickets > 0) {
|
||||
if ($tickets > 1) {
|
||||
$text_tickets = "Tickets";
|
||||
$text_tickets = 'Tickets';
|
||||
} else {
|
||||
$text_tickets = "Ticket";
|
||||
$text_tickets = 'Ticket';
|
||||
}
|
||||
$ticket = '<li>' . $tickets . ' ' . $text_tickets . ' have been moved to default department</li>';
|
||||
$ticket = '<li>'.$tickets.' '.$text_tickets.' have been moved to default department</li>';
|
||||
} else {
|
||||
$ticket = "";
|
||||
$ticket = '';
|
||||
}
|
||||
$users = DB::table('users')->where('primary_dpt', '=', $id)->update(['primary_dpt' => $system->department]);
|
||||
if ($users > 0) {
|
||||
if ($users > 1) {
|
||||
$text_user = "Users";
|
||||
$text_user = 'Users';
|
||||
} else {
|
||||
$text_user = "User";
|
||||
$text_user = 'User';
|
||||
}
|
||||
$user = '<li>' . $users . ' ' . $text_user . ' have been moved to default department</li>';
|
||||
$user = '<li>'.$users.' '.$text_user.' have been moved to default department</li>';
|
||||
} else {
|
||||
$user = "";
|
||||
$user = '';
|
||||
}
|
||||
$emails = DB::table('emails')->where('department', '=', $id)->update(['department' => $system->department]);
|
||||
if ($emails > 0) {
|
||||
if ($emails > 1) {
|
||||
$text_emails = "Emails";
|
||||
$text_emails = 'Emails';
|
||||
} else {
|
||||
$text_emails = "Email";
|
||||
$text_emails = 'Email';
|
||||
}
|
||||
$email = '<li>' . $emails . ' System ' . $text_emails . ' have been moved to default department</li>';
|
||||
$email = '<li>'.$emails.' System '.$text_emails.' have been moved to default department</li>';
|
||||
} else {
|
||||
$email = "";
|
||||
$email = '';
|
||||
}
|
||||
$helptopic = DB::table('help_topic')->where('department', '=', $id)->update(['department' => null], ['status' => '1']);
|
||||
if ($helptopic > 0) {
|
||||
$helptopic = '<li>The associated helptopic has been deactivated</li>';
|
||||
} else {
|
||||
$helptopic = "";
|
||||
$helptopic = '';
|
||||
}
|
||||
$message = $ticket . $user . $email . $helptopic;
|
||||
$message = $ticket.$user.$email.$helptopic;
|
||||
/* 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' . $message);
|
||||
return redirect('departments')->with('success', 'Department Deleted sucessfully'.$message);
|
||||
} else {
|
||||
return redirect('departments')->with('fails', 'Department can not Delete');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -11,39 +11,43 @@ use App\Http\Requests\helpdesk\EmailsRequest;
|
||||
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;
|
||||
use App\Model\helpdesk\Settings\Email;
|
||||
use App\Model\helpdesk\Ticket\Ticket_Priority;
|
||||
use App\Model\helpdesk\Utility\MailboxProtocol;
|
||||
// classes
|
||||
use Crypt;
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
* EmailsController
|
||||
* EmailsController.
|
||||
*
|
||||
* @package Controllers
|
||||
* @subpackage Controller
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class EmailsController extends Controller {
|
||||
|
||||
class EmailsController extends Controller
|
||||
{
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return type
|
||||
*/
|
||||
public function __construct() {
|
||||
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) {
|
||||
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');
|
||||
@@ -52,18 +56,22 @@ class EmailsController extends Controller {
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
* @param type Department $department
|
||||
* @param type Help_topic $help
|
||||
* @param type Priority $priority
|
||||
*
|
||||
* @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) {
|
||||
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');
|
||||
@@ -72,11 +80,14 @@ class EmailsController extends Controller {
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
* @param type Emails $email
|
||||
*
|
||||
* @param type Emails $email
|
||||
* @param type EmailsRequest $request
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function store(Emails $email, EmailsRequest $request) {
|
||||
public function store(Emails $email, EmailsRequest $request)
|
||||
{
|
||||
try {
|
||||
$password = $request->input('password');
|
||||
$encrypted = Crypt::encrypt($password);
|
||||
@@ -115,30 +126,36 @@ class EmailsController extends Controller {
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @param int $id
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function show($id) {
|
||||
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 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) {
|
||||
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');
|
||||
@@ -147,12 +164,15 @@ class EmailsController extends Controller {
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
* @param type $id
|
||||
* @param type Emails $email
|
||||
*
|
||||
* @param type $id
|
||||
* @param type Emails $email
|
||||
* @param type EmailsEditRequest $request
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function update($id, Emails $email, EmailsEditRequest $request) {
|
||||
public function update($id, Emails $email, EmailsEditRequest $request)
|
||||
{
|
||||
$password = $request->input('password');
|
||||
$encrypted = Crypt::encrypt($password);
|
||||
//echo $encrypted;
|
||||
@@ -179,6 +199,7 @@ class EmailsController extends Controller {
|
||||
}
|
||||
$emails->password = $encrypted;
|
||||
$emails->save();
|
||||
|
||||
return redirect('emails')->with('success', 'Email Updated sucessfully');
|
||||
} catch (Exception $e) {
|
||||
return redirect('emails')->with('fails', 'Email not updated');
|
||||
@@ -187,11 +208,14 @@ class EmailsController extends Controller {
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
* @param type int $id
|
||||
*
|
||||
* @param type int $id
|
||||
* @param type Emails $email
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function destroy($id, Emails $email) {
|
||||
public function destroy($id, Emails $email)
|
||||
{
|
||||
$default_system_email = Email::where('id', '=', '1')->first();
|
||||
if ($default_system_email->id) {
|
||||
if ($id == $default_system_email->id) {
|
||||
@@ -209,5 +233,4 @@ class EmailsController extends Controller {
|
||||
return redirect('emails')->with('fails', 'Email can not Delete ');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -13,58 +13,66 @@ use Illuminate\Http\Request;
|
||||
// Class
|
||||
use Input;
|
||||
use Redirect;
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
* FormController
|
||||
* This controller is used to CRUD Custom Forms
|
||||
* This controller is used to CRUD Custom Forms.
|
||||
*
|
||||
* @package Controllers
|
||||
* @subpackage Controller
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class FormController extends Controller {
|
||||
|
||||
class FormController extends Controller
|
||||
{
|
||||
private $fields;
|
||||
private $forms;
|
||||
|
||||
public function __construct(Fields $fields, Forms $forms) {
|
||||
public function __construct(Fields $fields, Forms $forms)
|
||||
{
|
||||
$this->fields = $fields;
|
||||
$this->forms = $forms;
|
||||
// $this->middleware('auth');
|
||||
}
|
||||
|
||||
/**
|
||||
* home
|
||||
* home.
|
||||
*
|
||||
* @return type
|
||||
*/
|
||||
public function home() {
|
||||
public function home()
|
||||
{
|
||||
return view('forms.home');
|
||||
}
|
||||
|
||||
/**
|
||||
* list of forms
|
||||
* @param type Forms $forms
|
||||
* list of forms.
|
||||
*
|
||||
* @param type Forms $forms
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function index(Forms $forms) {
|
||||
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() {
|
||||
public function create()
|
||||
{
|
||||
return view('themes.default1.admin.helpdesk.manage.form.form');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
* @param int $id
|
||||
*
|
||||
* @param int $id
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function show($id) {
|
||||
public function show($id)
|
||||
{
|
||||
return view('themes.default1.admin.helpdesk.manage.form.preview', compact('id'));
|
||||
}
|
||||
|
||||
@@ -73,13 +81,14 @@ class FormController extends Controller {
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function store(Forms $forms) {
|
||||
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();
|
||||
$require = [];
|
||||
for ($i = 2; $i < $count + 2; $i++) {
|
||||
for ($j = 0; $j < 1; $j++) {
|
||||
array_push($require, $required[$i][$j]);
|
||||
@@ -88,24 +97,26 @@ class FormController extends Controller {
|
||||
$forms->formname = Input::get('formname');
|
||||
$forms->save();
|
||||
$count = count(Input::get('name'));
|
||||
$fields = array();
|
||||
$fields = [];
|
||||
for ($i = 0; $i <= $count; $i++) {
|
||||
if (!empty(Input::get('name')[$i])) {
|
||||
array_push($fields, array(
|
||||
array_push($fields, [
|
||||
'forms_id' => $forms->id,
|
||||
'label' => Input::get('label')[$i],
|
||||
'name' => Input::get('name')[$i],
|
||||
'type' => Input::get('type')[$i],
|
||||
'value' => Input::get('value')[$i],
|
||||
'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, Help_topic $help_topic) {
|
||||
public function delete($id, Forms $forms, Fields $field, Help_topic $help_topic)
|
||||
{
|
||||
$fields = $field->where('forms_id', $id)->get();
|
||||
$help_topics = $help_topic->where('custom_form', '=', $id)->get();
|
||||
foreach ($help_topics as $help_topic) {
|
||||
@@ -117,7 +128,7 @@ class FormController extends Controller {
|
||||
}
|
||||
$forms = $forms->where('id', $id)->first();
|
||||
$forms->delete();
|
||||
|
||||
return redirect()->back()->with('success', 'Deleted Successfully');
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -6,45 +6,49 @@ namespace App\Http\Controllers\Admin\helpdesk;
|
||||
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;
|
||||
// models
|
||||
use App\Model\helpdesk\Agent\Group_assign_department;
|
||||
use App\Model\helpdesk\Agent\Groups;
|
||||
use App\User;
|
||||
// classes
|
||||
use Illuminate\Support\Facades\Input;
|
||||
use Exception;
|
||||
// classes
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Input;
|
||||
|
||||
/**
|
||||
* GroupController
|
||||
* GroupController.
|
||||
*
|
||||
* @package Controllers
|
||||
* @subpackage Controller
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class GroupController extends Controller {
|
||||
|
||||
class GroupController extends Controller
|
||||
{
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return type void
|
||||
*/
|
||||
public function __construct() {
|
||||
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 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) {
|
||||
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');
|
||||
@@ -53,9 +57,11 @@ class GroupController extends Controller {
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function create() {
|
||||
public function create()
|
||||
{
|
||||
try {
|
||||
return view('themes.default1.admin.helpdesk.agent.groups.create');
|
||||
} catch (Exception $e) {
|
||||
@@ -65,44 +71,55 @@ class GroupController extends Controller {
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
* @param type Groups $group
|
||||
*
|
||||
* @param type Groups $group
|
||||
* @param type GroupRequest $request
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function store(Groups $group, GroupRequest $request) {
|
||||
public function store(Groups $group, GroupRequest $request)
|
||||
{
|
||||
try {
|
||||
/* Check Whether function success or not */
|
||||
$group->fill($request->input())->save();
|
||||
|
||||
return redirect('groups')->with('success', 'Group Created Successfully');
|
||||
} catch (Exception $e) {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('groups')->with('fails', 'Groups can not Create' . '<li>' . $e->errorInfo[2] . '</li>');
|
||||
return redirect('groups')->with('fails', 'Groups can not Create'.'<li>'.$e->errorInfo[2].'</li>');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
* @param type int $id
|
||||
*
|
||||
* @param type int $id
|
||||
* @param type Groups $group
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function edit($id, Groups $group) {
|
||||
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 redirect('groups')->with('fails', 'Groups can not Create' . '<li>' . $e->errorInfo[2] . '</li>');
|
||||
return redirect('groups')->with('fails', 'Groups can not Create'.'<li>'.$e->errorInfo[2].'</li>');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
* @param type int $id
|
||||
* @param type Groups $group
|
||||
*
|
||||
* @param type int $id
|
||||
* @param type Groups $group
|
||||
* @param type Request $request
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function update($id, Groups $group, Request $request) {
|
||||
public function update($id, Groups $group, Request $request)
|
||||
{
|
||||
$var = $group->whereId($id)->first();
|
||||
//Updating Status
|
||||
$status = $request->Input('group_status');
|
||||
@@ -153,22 +170,26 @@ class GroupController extends Controller {
|
||||
return redirect('groups')->with('success', 'Group Updated Successfully');
|
||||
} catch (Exception $e) {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('groups')->with('fails', 'Groups can not Create' . '<li>' . $e->errorInfo[2] . '</li>');
|
||||
return redirect('groups')->with('fails', 'Groups can not Create'.'<li>'.$e->errorInfo[2].'</li>');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
* @param type int $id
|
||||
* @param type Groups $group
|
||||
*
|
||||
* @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) {
|
||||
public function destroy($id, Groups $group, Group_assign_department $group_assign_department)
|
||||
{
|
||||
$users = User::where('assign_group', '=', $id)->first();
|
||||
if ($users) {
|
||||
$user = '<li>There are agents assigned to this group. Please unassign them from this group to delete</li>';
|
||||
return redirect('groups')->with('fails', 'Group cannot Delete ' . $user);
|
||||
|
||||
return redirect('groups')->with('fails', 'Group cannot Delete '.$user);
|
||||
}
|
||||
$group_assign_department->where('group_id', $id)->delete();
|
||||
$groups = $group->whereId($id)->first();
|
||||
@@ -179,8 +200,7 @@ class GroupController extends Controller {
|
||||
return redirect('groups')->with('success', 'Group Deleted Successfully');
|
||||
} catch (Exception $e) {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('groups')->with('fails', 'Groups cannot Create' . '<li>' . $e->errorInfo[2] . '</li>');
|
||||
return redirect('groups')->with('fails', 'Groups cannot Create'.'<li>'.$e->errorInfo[2].'</li>');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -13,39 +13,43 @@ 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\Model\helpdesk\Settings\Ticket;
|
||||
use App\Model\helpdesk\Ticket\Ticket_Priority;
|
||||
use App\User;
|
||||
// classes
|
||||
use DB;
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
* HelptopicController
|
||||
* HelptopicController.
|
||||
*
|
||||
* @package Controllers
|
||||
* @subpackage Controller
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class HelptopicController extends Controller {
|
||||
|
||||
class HelptopicController extends Controller
|
||||
{
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return type vodi
|
||||
*/
|
||||
public function __construct() {
|
||||
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) {
|
||||
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');
|
||||
@@ -54,12 +58,14 @@ class HelptopicController extends Controller {
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
* @param type Priority $priority
|
||||
*
|
||||
* @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
|
||||
* @param type Form_name $form
|
||||
* @param type Agents $agent
|
||||
* @param type Sla_plan $sla
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
/*
|
||||
@@ -72,7 +78,8 @@ class HelptopicController extends Controller {
|
||||
| 5.Forms Model
|
||||
================================================
|
||||
*/
|
||||
public function create(Ticket_Priority $priority, Department $department, Help_topic $topic, Forms $form, User $agent, Sla_plan $sla) {
|
||||
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();
|
||||
@@ -80,6 +87,7 @@ class HelptopicController extends Controller {
|
||||
$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');
|
||||
@@ -88,11 +96,14 @@ class HelptopicController extends Controller {
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
* @param type Help_topic $topic
|
||||
*
|
||||
* @param type Help_topic $topic
|
||||
* @param type HelptopicRequest $request
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function store(Help_topic $topic, HelptopicRequest $request) {
|
||||
public function store(Help_topic $topic, HelptopicRequest $request)
|
||||
{
|
||||
try {
|
||||
if ($request->custom_form) {
|
||||
$custom_form = $request->custom_form;
|
||||
@@ -111,22 +122,25 @@ class HelptopicController extends Controller {
|
||||
return redirect('helptopic')->with('success', 'Helptopic Created Successfully');
|
||||
} catch (Exception $e) {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('helptopic')->with('fails', 'Helptopic can not Create' . '<li>' . $e->errorInfo[2] . '</li>');
|
||||
return redirect('helptopic')->with('fails', 'Helptopic can not Create'.'<li>'.$e->errorInfo[2].'</li>');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
* @param type $id
|
||||
* @param type Priority $priority
|
||||
*
|
||||
* @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
|
||||
* @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) {
|
||||
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();
|
||||
@@ -134,20 +148,24 @@ class HelptopicController extends Controller {
|
||||
$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 redirect('helptopic')->with('fails', '<li>' . $e->errorInfo[2] . '</li>');
|
||||
return redirect('helptopic')->with('fails', '<li>'.$e->errorInfo[2].'</li>');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
* @param type $id
|
||||
* @param type Help_topic $topic
|
||||
*
|
||||
* @param type $id
|
||||
* @param type Help_topic $topic
|
||||
* @param type HelptopicUpdate $request
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function update($id, Help_topic $topic, HelptopicUpdate $request) {
|
||||
public function update($id, Help_topic $topic, HelptopicUpdate $request)
|
||||
{
|
||||
// dd($request);
|
||||
try {
|
||||
$topics = $topic->whereId($id)->first();
|
||||
@@ -170,61 +188,62 @@ class HelptopicController extends Controller {
|
||||
return redirect('helptopic')->with('success', 'Helptopic Updated Successfully');
|
||||
} catch (Exception $e) {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('helptopic')->with('fails', 'Helptopic can not Update' . '<li>' . $e->errorInfo[2] . '</li>');
|
||||
return redirect('helptopic')->with('fails', 'Helptopic can not Update'.'<li>'.$e->errorInfo[2].'</li>');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
* @param type int $id
|
||||
*
|
||||
* @param type int $id
|
||||
* @param type Help_topic $topic
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function destroy($id, Help_topic $topic, Ticket $ticket_setting) {
|
||||
public function destroy($id, Help_topic $topic, Ticket $ticket_setting)
|
||||
{
|
||||
$ticket_settings = $ticket_setting->where('id', '=', '1')->first();
|
||||
if ($ticket_settings->help_topic == $id) {
|
||||
return redirect('departments')->with('fails', 'You cannot delete default department');
|
||||
} else {
|
||||
|
||||
$tickets = DB::table('tickets')->where('help_topic_id', '=', $id)->update(['help_topic_id' => $ticket_settings->help_topic]);
|
||||
|
||||
if ($tickets > 0) {
|
||||
if ($tickets > 1) {
|
||||
$text_tickets = "Tickets";
|
||||
$text_tickets = 'Tickets';
|
||||
} else {
|
||||
$text_tickets = "Ticket";
|
||||
$text_tickets = 'Ticket';
|
||||
}
|
||||
$ticket = '<li>' . $tickets . ' ' . $text_tickets . ' have been moved to default Help Topic</li>';
|
||||
$ticket = '<li>'.$tickets.' '.$text_tickets.' have been moved to default Help Topic</li>';
|
||||
} else {
|
||||
$ticket = "";
|
||||
$ticket = '';
|
||||
}
|
||||
|
||||
$emails = DB::table('emails')->where('help_topic', '=', $id)->update(['help_topic' => $ticket_settings->help_topic]);
|
||||
|
||||
if ($emails > 0) {
|
||||
if ($emails > 1) {
|
||||
$text_emails = "Emails";
|
||||
$text_emails = 'Emails';
|
||||
} else {
|
||||
$text_emails = "Email";
|
||||
$text_emails = 'Email';
|
||||
}
|
||||
$email = '<li>' . $emails . ' System ' . $text_emails . ' have been moved to default Help Topic</li>';
|
||||
$email = '<li>'.$emails.' System '.$text_emails.' have been moved to default Help Topic</li>';
|
||||
} else {
|
||||
$email = "";
|
||||
$email = '';
|
||||
}
|
||||
|
||||
$message = $ticket . $email;
|
||||
$message = $ticket.$email;
|
||||
|
||||
$topics = $topic->whereId($id)->first();
|
||||
/* Check whether function success or not */
|
||||
try {
|
||||
$topics->delete();
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('helptopic')->with('success', 'Helptopic Deleted Successfully' . $message);
|
||||
return redirect('helptopic')->with('success', 'Helptopic Deleted Successfully'.$message);
|
||||
} catch (Exception $e) {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('helptopic')->with('fails', 'Helptopic can not Delete' . '<li>' . $e->errorInfo[2] . '</li>');
|
||||
return redirect('helptopic')->with('fails', 'Helptopic can not Delete'.'<li>'.$e->errorInfo[2].'</li>');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -10,17 +10,17 @@ namespace App\Http\Controllers\Admin\helpdesk;
|
||||
* 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 {
|
||||
|
||||
class HomeController extends Controller
|
||||
{
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct() {
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('auth');
|
||||
}
|
||||
|
||||
@@ -29,8 +29,8 @@ class HomeController extends Controller {
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function index() {
|
||||
public function index()
|
||||
{
|
||||
return view('themes/default1/admin/dashboard');
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -3,55 +3,55 @@
|
||||
namespace App\Http\Controllers\Admin\helpdesk;
|
||||
|
||||
// controllers
|
||||
use App\Http\Controllers\Controller;
|
||||
use App;
|
||||
// requests
|
||||
use App\Http\Requests;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
//supports
|
||||
use App\Http\Requests;
|
||||
use Cache;
|
||||
use Config;
|
||||
//classes
|
||||
use File;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\Redirect;
|
||||
use Illuminate\Support\Facades\Session;
|
||||
use Illuminate\Support\Collection;
|
||||
//classes
|
||||
use Input;
|
||||
use Config;
|
||||
use Validator;
|
||||
use Zipper;
|
||||
use App;
|
||||
use Lang;
|
||||
use Cache;
|
||||
use File;
|
||||
use Exception;
|
||||
use Validator;
|
||||
|
||||
/**
|
||||
* SlaController
|
||||
* SlaController.
|
||||
*
|
||||
* @package Controllers
|
||||
* @subpackage Controller
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class LanguageController extends Controller {
|
||||
|
||||
class LanguageController extends Controller
|
||||
{
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return type void
|
||||
*/
|
||||
public function __construct() {
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('auth');
|
||||
$this->middleware('roles');
|
||||
}
|
||||
|
||||
/**
|
||||
* Switch language at runtime
|
||||
* Switch language at runtime.
|
||||
*
|
||||
* @param type "" $lang
|
||||
*
|
||||
* @return type response
|
||||
*/
|
||||
public function switchLanguage($lang) {
|
||||
public function switchLanguage($lang)
|
||||
{
|
||||
//if(Cache::has('language'))
|
||||
//{
|
||||
// return Cache::get('language');
|
||||
//} else return 'false';
|
||||
// Cache::put('language',$)
|
||||
$path = base_path('resources/lang'); // Path to check available language packages
|
||||
$path = base_path('resources/lang'); // Path to check available language packages
|
||||
if (array_key_exists($lang, Config::get('languages')) && in_array($lang, scandir($path))) {
|
||||
// dd(array_key_exists($lang, Config::get('languages')));
|
||||
// app()->setLocale($lang);
|
||||
@@ -60,55 +60,63 @@ class LanguageController extends Controller {
|
||||
// dd(Cache::get('language'));
|
||||
// dd()
|
||||
} else {
|
||||
return Redirect::back()->with('fails', Lang::get("lang.language-error"));
|
||||
return Redirect::back()->with('fails', Lang::get('lang.language-error'));
|
||||
}
|
||||
|
||||
return Redirect::back();
|
||||
}
|
||||
|
||||
/**
|
||||
* Shows language page
|
||||
* Shows language page.
|
||||
*
|
||||
* @return type response
|
||||
*/
|
||||
public function index() {
|
||||
public function index()
|
||||
{
|
||||
return view('themes.default1.admin.helpdesk.language.index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Shows Language upload form
|
||||
* Shows Language upload form.
|
||||
*
|
||||
* @return type response
|
||||
*/
|
||||
public function getForm() {
|
||||
public function getForm()
|
||||
{
|
||||
return view('themes.default1.admin.helpdesk.language.create');
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide language datatable to language page
|
||||
* @return type
|
||||
* Provide language datatable to language page.
|
||||
*
|
||||
* @return type
|
||||
*/
|
||||
public function getLanguages() {
|
||||
$path = base_path('resources/lang');
|
||||
public function getLanguages()
|
||||
{
|
||||
$path = base_path('resources/lang');
|
||||
$values = scandir($path); //Extracts names of directories present in lang directory
|
||||
$values = array_slice($values, 2); // skips array element $value[0] = '.' & $value[1] = '..'
|
||||
$values = array_slice($values, 2); // skips array element $value[0] = '.' & $value[1] = '..'
|
||||
return \Datatable::collection(new Collection($values))
|
||||
->addColumn('language', function($model) {
|
||||
return Config::get('languages.' . $model);
|
||||
->addColumn('language', function ($model) {
|
||||
return Config::get('languages.'.$model);
|
||||
})
|
||||
->addColumn('id', function($model) {
|
||||
->addColumn('id', function ($model) {
|
||||
return $model;
|
||||
})
|
||||
->addColumn('status', function($model) {
|
||||
->addColumn('status', function ($model) {
|
||||
if (Lang::getLocale() === $model) {
|
||||
return "<span style='color:green'>" . Lang::trans("lang.active") . "</span>";
|
||||
} else
|
||||
return "<span style='color:red'>" . Lang::trans("lang.inactive") . "</span>";
|
||||
})
|
||||
->addColumn('Action', function($model) {
|
||||
if (Lang::getLocale() === $model) {
|
||||
return "<a href='change-language/" . $model . "'><input type='button' class='btn btn-info btn-xs btn-flat' disabled value='" . Lang::trans("lang.disable") . "'/></a>
|
||||
<a href='change-language/" . $model . "' class='btn btn-danger btn-xs btn-flat' disabled><i class='fa fa-trash' style='color:black;'> </i> " . Lang::trans("lang.delete") . "</a>";
|
||||
return "<span style='color:green'>".Lang::trans('lang.active').'</span>';
|
||||
} else {
|
||||
return "<a href='change-language/" . $model . "'><input type='button' class='btn btn-info btn-xs btn-flat' value='" . Lang::trans("lang.enable") . "'/></a>
|
||||
<a href='delete-language/" . $model . "' class='btn btn-danger btn-xs btn-flat'><i class='fa fa-trash' style='color:black;'> </i> " . Lang::trans("lang.delete") . "</a>";
|
||||
return "<span style='color:red'>".Lang::trans('lang.inactive').'</span>';
|
||||
}
|
||||
})
|
||||
->addColumn('Action', function ($model) {
|
||||
if (Lang::getLocale() === $model) {
|
||||
return "<a href='change-language/".$model."'><input type='button' class='btn btn-info btn-xs btn-flat' disabled value='".Lang::trans('lang.disable')."'/></a>
|
||||
<a href='change-language/".$model."' class='btn btn-danger btn-xs btn-flat' disabled><i class='fa fa-trash' style='color:black;'> </i> ".Lang::trans('lang.delete').'</a>';
|
||||
} else {
|
||||
return "<a href='change-language/".$model."'><input type='button' class='btn btn-info btn-xs btn-flat' value='".Lang::trans('lang.enable')."'/></a>
|
||||
<a href='delete-language/".$model."' class='btn btn-danger btn-xs btn-flat'><i class='fa fa-trash' style='color:black;'> </i> ".Lang::trans('lang.delete').'</a>';
|
||||
}
|
||||
})
|
||||
->searchColumns('language', 'id')
|
||||
@@ -116,23 +124,25 @@ class LanguageController extends Controller {
|
||||
}
|
||||
|
||||
/**
|
||||
* handle language file uploading
|
||||
* @return response
|
||||
* handle language file uploading.
|
||||
*
|
||||
* @return response
|
||||
*/
|
||||
public function postForm() {
|
||||
public function postForm()
|
||||
{
|
||||
// getting all of the post data
|
||||
$file = array(
|
||||
'File' => Input::file('File'),
|
||||
$file = [
|
||||
'File' => Input::file('File'),
|
||||
'language-name' => Input::input('language-name'),
|
||||
'iso-code' => Input::input('iso-code')
|
||||
);
|
||||
'iso-code' => Input::input('iso-code'),
|
||||
];
|
||||
|
||||
// setting up rules
|
||||
$rules = array(
|
||||
'File' => 'required|mimes:zip|max:30000',
|
||||
$rules = [
|
||||
'File' => 'required|mimes:zip|max:30000',
|
||||
'language-name' => 'required',
|
||||
'iso-code' => 'required|max:2'
|
||||
); // and for max size
|
||||
'iso-code' => 'required|max:2',
|
||||
]; // and for max size
|
||||
// doing the validation, passing post data, rules and the messages
|
||||
$validator = Validator::make($file, $rules);
|
||||
if ($validator->fails()) {
|
||||
@@ -141,18 +151,19 @@ class LanguageController extends Controller {
|
||||
return Redirect::back()->withInput()->withErrors($validator);
|
||||
} else {
|
||||
|
||||
|
||||
//Checking if package already exists or not in lang folder
|
||||
$path = base_path('resources/lang');
|
||||
$path = base_path('resources/lang');
|
||||
if (in_array(strtolower(Input::get('iso-code')), scandir($path))) {
|
||||
|
||||
//sending back with error message
|
||||
Session::flash('fails', Lang::get('lang.package_exist'));
|
||||
Session::flash('link', "change-language/" . strtolower(Input::get('iso-code')));
|
||||
Session::flash('link', 'change-language/'.strtolower(Input::get('iso-code')));
|
||||
|
||||
return Redirect::back()->withInput();
|
||||
} elseif (!array_key_exists(strtolower(Input::get('iso-code')), Config::get('languages'))) {//Checking Valid ISO code form Languages.php
|
||||
} elseif (!array_key_exists(strtolower(Input::get('iso-code')), Config::get('languages'))) {//Checking Valid ISO code form Languages.php
|
||||
//sending back with error message
|
||||
Session::flash('fails', Lang::get('lang.iso-code-error'));
|
||||
|
||||
return Redirect::back()->withInput();
|
||||
} else {
|
||||
|
||||
@@ -160,11 +171,11 @@ class LanguageController extends Controller {
|
||||
if (Input::file('File')->isValid()) {
|
||||
$name = Input::file('File')->getClientOriginalName(); //uploaded file's original name
|
||||
$destinationPath = '../public/uploads/'; // defining uploading path
|
||||
$extractpath = '../resources/lang/' . strtolower(Input::get('iso-code')); //defining extracting path
|
||||
$extractpath = '../resources/lang/'.strtolower(Input::get('iso-code')); //defining extracting path
|
||||
mkdir($extractpath); //creating directroy for extracting uploadd file
|
||||
//mkdir($destinationPath);
|
||||
Input::file('File')->move($destinationPath, $name); // uploading file to given path
|
||||
\Zipper::make($destinationPath . '/' . $name)->extractTo($extractpath); //extracting file to give path
|
||||
\Zipper::make($destinationPath.'/'.$name)->extractTo($extractpath); //extracting file to give path
|
||||
//check if Zip extract foldercontains any subfolder
|
||||
$directories = File::directories($extractpath);
|
||||
//$directories = glob($extractpath. '/*' , GLOB_ONLYDIR);
|
||||
@@ -174,18 +185,21 @@ class LanguageController extends Controller {
|
||||
if ($success) {
|
||||
//sending back with error message
|
||||
Session::flash('fails', Lang::get('lang.zipp-error'));
|
||||
Session::flash('link2', "http://www.ladybirdweb.com/support/show/how-to-translate-faveo-into-multiple-languages");
|
||||
Session::flash('link2', 'http://www.ladybirdweb.com/support/show/how-to-translate-faveo-into-multiple-languages');
|
||||
|
||||
return Redirect::back()->withInput();
|
||||
}
|
||||
} else {
|
||||
// sending back with success message
|
||||
Session::flash('success', Lang::get("lang.upload-success"));
|
||||
Session::flash('link', "change-language/" . strtolower(Input::get('iso-code')));
|
||||
Session::flash('success', Lang::get('lang.upload-success'));
|
||||
Session::flash('link', 'change-language/'.strtolower(Input::get('iso-code')));
|
||||
|
||||
return Redirect::route('LanguageController');
|
||||
}
|
||||
} else {
|
||||
// sending back with error message.
|
||||
Session::flash('fails', Lang::get("lang.file-error"));
|
||||
Session::flash('fails', Lang::get('lang.file-error'));
|
||||
|
||||
return Redirect::route('form');
|
||||
}
|
||||
}
|
||||
@@ -193,36 +207,43 @@ class LanguageController extends Controller {
|
||||
}
|
||||
|
||||
/**
|
||||
* allow user to download language template file
|
||||
* allow user to download language template file.
|
||||
*
|
||||
* @return type
|
||||
*/
|
||||
Public function download() {
|
||||
public function download()
|
||||
{
|
||||
return response()->download('../public/downloads/en.zip');
|
||||
}
|
||||
|
||||
/**
|
||||
* This function is used to delete languages
|
||||
* @param type $lang
|
||||
* This function is used to delete languages.
|
||||
*
|
||||
* @param type $lang
|
||||
*
|
||||
* @return type response
|
||||
*/
|
||||
public function deleteLanguage($lang) {
|
||||
public function deleteLanguage($lang)
|
||||
{
|
||||
if ($lang !== App::getLocale()) {
|
||||
$deletePath = base_path('resources/lang') . $lang; //define file path to delete
|
||||
$deletePath = base_path('resources/lang').$lang; //define file path to delete
|
||||
$success = File::deleteDirectory($deletePath); //remove extracted folder and it's subfolder from lang
|
||||
if ($success) {
|
||||
//sending back with success message
|
||||
Session::flash('success', Lang::get('lang.delete-success'));
|
||||
|
||||
return Redirect::back();
|
||||
} else {
|
||||
//sending back with error message
|
||||
Session::flash('fails', Lang::get('lang.lang-doesnot-exist'));
|
||||
|
||||
return Redirect::back();
|
||||
}
|
||||
} else {
|
||||
//sending back with error message
|
||||
Session::flash('fails', Lang::get('lang.active-lang-error'));
|
||||
|
||||
return redirect('languages');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -11,33 +11,35 @@ use App\Http\Requests\ProfileRequest;
|
||||
use App\User;
|
||||
// classes
|
||||
use Auth;
|
||||
use Exception;
|
||||
use Hash;
|
||||
use Input;
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
* ProfileController
|
||||
* ProfileController.
|
||||
*
|
||||
* @package Controllers
|
||||
* @subpackage Controller
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class ProfileController extends Controller {
|
||||
|
||||
class ProfileController extends Controller
|
||||
{
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return type void
|
||||
*/
|
||||
public function __construct() {
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('auth');
|
||||
$this->middleware('roles');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get profile page
|
||||
* Get profile page.
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function getProfile() {
|
||||
public function getProfile()
|
||||
{
|
||||
try {
|
||||
$user = Auth::user();
|
||||
if ($user) {
|
||||
@@ -51,10 +53,12 @@ class ProfileController extends Controller {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get profile Edit page
|
||||
* Get profile Edit page.
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function getProfileedit() {
|
||||
public function getProfileedit()
|
||||
{
|
||||
try {
|
||||
$user = Auth::user();
|
||||
if ($user) {
|
||||
@@ -68,12 +72,15 @@ class ProfileController extends Controller {
|
||||
}
|
||||
|
||||
/**
|
||||
* Post profile page
|
||||
* @param type int $id
|
||||
* Post profile page.
|
||||
*
|
||||
* @param type int $id
|
||||
* @param type ProfileRequest $request
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function postProfile($id, ProfileRequest $request) {
|
||||
public function postProfile($id, ProfileRequest $request)
|
||||
{
|
||||
$user = Auth::user();
|
||||
$user->gender = $request->input('gender');
|
||||
$user->save();
|
||||
@@ -92,12 +99,13 @@ class ProfileController extends Controller {
|
||||
//$extension = Input::file('profile_pic')->getClientOriginalExtension();
|
||||
$name = Input::file('profile_pic')->getClientOriginalName();
|
||||
$destinationPath = 'lb-faveo/profilepic';
|
||||
$fileName = rand(0000, 9999) . '.' . $name;
|
||||
$fileName = rand(0000, 9999).'.'.$name;
|
||||
//echo $fileName;
|
||||
Input::file('profile_pic')->move($destinationPath, $fileName);
|
||||
$user->profile_pic = $fileName;
|
||||
} else {
|
||||
$user->fill($request->except('profile_pic', 'gender'))->save();
|
||||
|
||||
return redirect('guest')->with('success', 'Profile Updated sucessfully');
|
||||
}
|
||||
if ($user->fill($request->except('profile_pic'))->save()) {
|
||||
@@ -106,22 +114,25 @@ class ProfileController extends Controller {
|
||||
}
|
||||
|
||||
/**
|
||||
* Post Profile password page
|
||||
* @param type int $id
|
||||
* @param type User $user
|
||||
* 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) {
|
||||
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');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -21,51 +21,55 @@ 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\Ticket\Ticket_Priority;
|
||||
use App\Model\helpdesk\Utility\Date_format;
|
||||
use App\Model\helpdesk\Utility\Date_time_format;
|
||||
use App\Model\helpdesk\Ticket\Ticket_Priority;
|
||||
use App\Model\helpdesk\Utility\Timezones;
|
||||
use App\Model\helpdesk\Utility\Time_format;
|
||||
use App\Model\helpdesk\Utility\Timezones;
|
||||
// classes
|
||||
use Exception;
|
||||
use Illuminate\Http\Request;
|
||||
use Input;
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
* SettingsController
|
||||
* SettingsController.
|
||||
*
|
||||
* @package Controllers
|
||||
* @subpackage Controller
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class SettingsController extends Controller {
|
||||
|
||||
class SettingsController extends Controller
|
||||
{
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct() {
|
||||
public function __construct()
|
||||
{
|
||||
// $this->smtp();
|
||||
$this->middleware('auth');
|
||||
$this->middleware('roles');
|
||||
}
|
||||
|
||||
/**
|
||||
* Main Settings Page
|
||||
* Main Settings Page.
|
||||
*
|
||||
* @return type view
|
||||
*/
|
||||
public function settings() {
|
||||
public function settings()
|
||||
{
|
||||
return view('themes.default1.admin.helpdesk.setting');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @return Response
|
||||
* @param $compant instance of company table
|
||||
*
|
||||
* get the form for company setting page
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function getcompany(Company $company) {
|
||||
public function getcompany(Company $company)
|
||||
{
|
||||
try {
|
||||
/* fetch the values of company from company table */
|
||||
$companys = $company->whereId('1')->first();
|
||||
@@ -78,18 +82,21 @@ class SettingsController extends Controller {
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
* @param type int $id
|
||||
* @param type Company $company
|
||||
* @param type CompanyRequest $request
|
||||
*
|
||||
* @param type int $id
|
||||
* @param type Company $company
|
||||
* @param type CompanyRequest $request
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function postcompany($id, Company $company, CompanyRequest $request) {
|
||||
public function postcompany($id, Company $company, CompanyRequest $request)
|
||||
{
|
||||
/* fetch the values of company request */
|
||||
$companys = $company->whereId('1')->first();
|
||||
if (Input::file('logo')) {
|
||||
$name = Input::file('logo')->getClientOriginalName();
|
||||
$destinationPath = 'lb-faveo/media/company/';
|
||||
$fileName = rand(0000, 9999) . '.' . $name;
|
||||
$fileName = rand(0000, 9999).'.'.$name;
|
||||
Input::file('logo')->move($destinationPath, $fileName);
|
||||
$companys->logo = $fileName;
|
||||
}
|
||||
@@ -103,21 +110,24 @@ class SettingsController extends Controller {
|
||||
return redirect('getcompany')->with('success', 'Company Updated Successfully');
|
||||
} catch (Exception $e) {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('getcompany')->with('fails', 'Company can not Updated' . '<li>' . $e->errorInfo[2] . '</li>');
|
||||
return redirect('getcompany')->with('fails', 'Company can not Updated'.'<li>'.$e->errorInfo[2].'</li>');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* get the form for System setting page
|
||||
* @param type System $system
|
||||
* @param type Department $department
|
||||
* @param type Timezones $timezone
|
||||
* @param type Date_format $date
|
||||
* 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 Time_format $time
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function getsystem(System $system, Department $department, Timezones $timezone, Date_format $date, Date_time_format $date_time, Time_format $time) {
|
||||
public function getsystem(System $system, Department $department, Timezones $timezone, Date_format $date, Date_time_format $date_time, Time_format $time)
|
||||
{
|
||||
try {
|
||||
/* fetch the values of system from system table */
|
||||
$systems = $system->whereId('1')->first();
|
||||
@@ -134,12 +144,15 @@ class SettingsController extends Controller {
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
* @param type int $id
|
||||
* @param type System $system
|
||||
*
|
||||
* @param type int $id
|
||||
* @param type System $system
|
||||
* @param type SystemRequest $request
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function postsystem($id, System $system, SystemRequest $request) {
|
||||
public function postsystem($id, System $system, SystemRequest $request)
|
||||
{
|
||||
try {
|
||||
// dd($request);
|
||||
/* fetch the values of system request */
|
||||
@@ -151,19 +164,22 @@ class SettingsController extends Controller {
|
||||
return redirect('getsystem')->with('success', 'System Updated Successfully');
|
||||
} catch (Exception $e) {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('getsystem')->with('fails', 'System can not Updated' . '<li>' . $e->errorInfo[2] . '</li>');
|
||||
return redirect('getsystem')->with('fails', 'System can not Updated'.'<li>'.$e->errorInfo[2].'</li>');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* get the form for Ticket setting page
|
||||
* @param type Ticket $ticket
|
||||
* @param type Sla_plan $sla
|
||||
* 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
|
||||
* @param type Priority $priority
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function getticket(Ticket $ticket, Sla_plan $sla, Help_topic $topic, Ticket_Priority $priority) {
|
||||
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();
|
||||
@@ -180,12 +196,15 @@ class SettingsController extends Controller {
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
* @param type int $id
|
||||
* @param type Ticket $ticket
|
||||
*
|
||||
* @param type int $id
|
||||
* @param type Ticket $ticket
|
||||
* @param type Request $request
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function postticket($id, Ticket $ticket, Request $request) {
|
||||
public function postticket($id, Ticket $ticket, Request $request)
|
||||
{
|
||||
try {
|
||||
/* fetch the values of ticket request */
|
||||
$tickets = $ticket->whereId('1')->first();
|
||||
@@ -206,18 +225,21 @@ class SettingsController extends Controller {
|
||||
return redirect('getticket')->with('success', 'Ticket Updated Successfully');
|
||||
} catch (Exception $e) {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('getticket')->with('fails', 'Ticket can not Updated' . '<li>' . $e->errorInfo[2] . '</li>');
|
||||
return redirect('getticket')->with('fails', 'Ticket can not Updated'.'<li>'.$e->errorInfo[2].'</li>');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* get the form for Email setting page
|
||||
* @param type Email $email
|
||||
* get the form for Email setting page.
|
||||
*
|
||||
* @param type Email $email
|
||||
* @param type Template $template
|
||||
* @param type Emails $email1
|
||||
* @param type Emails $email1
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function getemail(Email $email, Template $template, Emails $email1) {
|
||||
public function getemail(Email $email, Template $template, Emails $email1)
|
||||
{
|
||||
try {
|
||||
/* fetch the values of email from Email table */
|
||||
$emails = $email->whereId('1')->first();
|
||||
@@ -234,12 +256,15 @@ class SettingsController extends Controller {
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
* @param type int $id
|
||||
* @param type Email $email
|
||||
*
|
||||
* @param type int $id
|
||||
* @param type Email $email
|
||||
* @param type EmailRequest $request
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function postemail($id, Email $email, EmailRequest $request) {
|
||||
public function postemail($id, Email $email, EmailRequest $request)
|
||||
{
|
||||
try {
|
||||
/* fetch the values of email request */
|
||||
$emails = $email->whereId('1')->first();
|
||||
@@ -258,20 +283,22 @@ class SettingsController extends Controller {
|
||||
return redirect('getemail')->with('success', 'Email Updated Successfully');
|
||||
} catch (Exception $e) {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('getemail')->with('fails', 'Email can not Updated' . '<li>' . $e->errorInfo[2] . '</li>');
|
||||
return redirect('getemail')->with('fails', 'Email can not Updated'.'<li>'.$e->errorInfo[2].'</li>');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* get the form for Access setting page
|
||||
* 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
|
||||
// // Direct to Access Settings Page
|
||||
// return view('themes.default1.admin.helpdesk.settings.access', compact('accesses'));
|
||||
// } catch (Exception $e) {
|
||||
// return view('404');
|
||||
@@ -280,8 +307,10 @@ class SettingsController extends Controller {
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
* @param type Access $access
|
||||
*
|
||||
* @param type Access $access
|
||||
* @param type Request $request
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
// public function postaccess(Access $access, Request $request) {
|
||||
@@ -310,11 +339,14 @@ class SettingsController extends Controller {
|
||||
// }
|
||||
|
||||
/**
|
||||
* get the form for Responder setting page
|
||||
* get the form for Responder setting page.
|
||||
*
|
||||
* @param type Responder $responder
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function getresponder(Responder $responder) {
|
||||
public function getresponder(Responder $responder)
|
||||
{
|
||||
try {
|
||||
/* fetch the values of responder from responder table */
|
||||
$responders = $responder->whereId('1')->first();
|
||||
@@ -327,11 +359,14 @@ class SettingsController extends Controller {
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param type Responder $responder
|
||||
* @param type Request $request
|
||||
* @param type Request $request
|
||||
*
|
||||
* @return type
|
||||
*/
|
||||
public function postresponder(Responder $responder, Request $request) {
|
||||
public function postresponder(Responder $responder, Request $request)
|
||||
{
|
||||
try {
|
||||
/* fetch the values of responder request */
|
||||
$responders = $responder->whereId('1')->first();
|
||||
@@ -348,16 +383,19 @@ class SettingsController extends Controller {
|
||||
return redirect('getresponder')->with('success', 'Responder Updated Successfully');
|
||||
} catch (Exception $e) {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('getresponder')->with('fails', 'Responder can not Updated' . '<li>' . $e->errorInfo[2] . '</li>');
|
||||
return redirect('getresponder')->with('fails', 'Responder can not Updated'.'<li>'.$e->errorInfo[2].'</li>');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* get the form for Alert setting page
|
||||
* get the form for Alert setting page.
|
||||
*
|
||||
* @param type Alert $alert
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function getalert(Alert $alert) {
|
||||
public function getalert(Alert $alert)
|
||||
{
|
||||
try {
|
||||
/* fetch the values of alert from alert table */
|
||||
$alerts = $alert->whereId('1')->first();
|
||||
@@ -370,12 +408,15 @@ class SettingsController extends Controller {
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
* @param type $id
|
||||
* @param type Alert $alert
|
||||
*
|
||||
* @param type $id
|
||||
* @param type Alert $alert
|
||||
* @param type Request $request
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function postalert($id, Alert $alert, Request $request) {
|
||||
public function postalert($id, Alert $alert, Request $request)
|
||||
{
|
||||
try {
|
||||
/* fetch the values of alert request */
|
||||
$alerts = $alert->whereId('1')->first();
|
||||
@@ -430,38 +471,46 @@ class SettingsController extends Controller {
|
||||
return redirect('getalert')->with('success', 'Alert Updated Successfully');
|
||||
} catch (Exception $e) {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('getalert')->with('fails', 'Alert can not Updated' . '<li>' . $e->errorInfo[2] . '</li>');
|
||||
return redirect('getalert')->with('fails', 'Alert can not Updated'.'<li>'.$e->errorInfo[2].'</li>');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* To display the list of ratings in the system
|
||||
* To display the list of ratings in the system.
|
||||
*
|
||||
* @return type View
|
||||
*/
|
||||
public function RatingSettings() {
|
||||
public function RatingSettings()
|
||||
{
|
||||
$ratings = DB::table('settings_ratings')->get();
|
||||
|
||||
return view('themes.default1.admin.helpdesk.settings.ratings', compact('ratings'));
|
||||
}
|
||||
|
||||
/**
|
||||
* To store rating data
|
||||
* To store rating data.
|
||||
*
|
||||
* @return type Redirect
|
||||
*/
|
||||
public function PostRatingSettings($slug) {
|
||||
public function PostRatingSettings($slug)
|
||||
{
|
||||
$name = Input::get('rating_name');
|
||||
$publish = Input::get('publish');
|
||||
$modify = Input::get('modify');
|
||||
DB::table('settings_ratings')->whereSlug($slug)->update(array('rating_name' => $name, 'publish' => $publish, 'modify' => $modify));
|
||||
DB::table('settings_ratings')->whereSlug($slug)->update(['rating_name' => $name, 'publish' => $publish, 'modify' => $modify]);
|
||||
|
||||
return redirect()->back()->with('success', 'Successfully updated');
|
||||
}
|
||||
|
||||
/**
|
||||
* To delete a type of rating
|
||||
* To delete a type of rating.
|
||||
*
|
||||
* @return type Redirect
|
||||
*/
|
||||
public function RatingDelete($slug) {
|
||||
public function RatingDelete($slug)
|
||||
{
|
||||
DB::table('settings_ratings')->whereSlug($slug)->delete();
|
||||
|
||||
return redirect()->back()->with('success', 'Successfully Deleted');
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -15,29 +15,32 @@ use DB;
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
* SlaController
|
||||
* SlaController.
|
||||
*
|
||||
* @package Controllers
|
||||
* @subpackage Controller
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class SlaController extends Controller {
|
||||
|
||||
class SlaController extends Controller
|
||||
{
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return type void
|
||||
*/
|
||||
public function __construct() {
|
||||
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) {
|
||||
public function index(Sla_plan $sla)
|
||||
{
|
||||
try {
|
||||
/* Declare a Variable $slas to store all Values From Sla_plan Table */
|
||||
$slas = $sla->get();
|
||||
@@ -50,9 +53,11 @@ class SlaController extends Controller {
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function create() {
|
||||
public function create()
|
||||
{
|
||||
try {
|
||||
/* Direct to Create Page */
|
||||
return view('themes.default1.admin.helpdesk.manage.sla.create');
|
||||
@@ -63,11 +68,14 @@ class SlaController extends Controller {
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
* @param type Sla_plan $sla
|
||||
*
|
||||
* @param type Sla_plan $sla
|
||||
* @param type SlaRequest $request
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function store(Sla_plan $sla, SlaRequest $request) {
|
||||
public function store(Sla_plan $sla, SlaRequest $request)
|
||||
{
|
||||
try {
|
||||
/* Fill the request values to Sla_plan Table */
|
||||
/* Check whether function success or not */
|
||||
@@ -76,21 +84,25 @@ class SlaController extends Controller {
|
||||
return redirect('sla')->with('success', 'SLA Plan Created Successfully');
|
||||
} catch (Exception $e) {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('sla')->with('fails', 'SLA Plan can not Create' . '<li>' . $e->errorInfo[2] . '</li>');
|
||||
return redirect('sla')->with('fails', 'SLA Plan can not Create'.'<li>'.$e->errorInfo[2].'</li>');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
* @param type int $id
|
||||
*
|
||||
* @param type int $id
|
||||
* @param type Sla_plan $sla
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function edit($id, Sla_plan $sla) {
|
||||
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 redirect()->back()->with('fails', $e->errorInfo[2]);
|
||||
@@ -99,12 +111,15 @@ class SlaController extends Controller {
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
* @param type int $id
|
||||
* @param type Sla_plan $sla
|
||||
*
|
||||
* @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) {
|
||||
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();
|
||||
@@ -119,17 +134,20 @@ class SlaController extends Controller {
|
||||
return redirect('sla')->with('success', 'SLA Plan Updated Successfully');
|
||||
} catch (Exception $e) {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('sla')->with('fails', 'SLA Plan can not Update' . '<li>' . $e->errorInfo[2] . '</li>');
|
||||
return redirect('sla')->with('fails', 'SLA Plan can not Update'.'<li>'.$e->errorInfo[2].'</li>');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
* @param type int $id
|
||||
*
|
||||
* @param type int $id
|
||||
* @param type Sla_plan $sla
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function destroy($id, Sla_plan $sla) {
|
||||
public function destroy($id, Sla_plan $sla)
|
||||
{
|
||||
$default_sla = Ticket::where('id', '=', '1')->first();
|
||||
if ($default_sla->sla == $id) {
|
||||
return redirect('departments')->with('fails', 'You cannot delete default department');
|
||||
@@ -137,49 +155,48 @@ class SlaController extends Controller {
|
||||
$tickets = DB::table('tickets')->where('sla', '=', $id)->update(['sla' => $default_sla->sla]);
|
||||
if ($tickets > 0) {
|
||||
if ($tickets > 1) {
|
||||
$text_tickets = "Tickets";
|
||||
$text_tickets = 'Tickets';
|
||||
} else {
|
||||
$text_tickets = "Ticket";
|
||||
$text_tickets = 'Ticket';
|
||||
}
|
||||
$ticket = '<li>' . $tickets . ' ' . $text_tickets . ' have been moved to default SLA</li>';
|
||||
$ticket = '<li>'.$tickets.' '.$text_tickets.' have been moved to default SLA</li>';
|
||||
} else {
|
||||
$ticket = "";
|
||||
$ticket = '';
|
||||
}
|
||||
$dept = DB::table('department')->where('sla', '=', $id)->update(['sla' => $default_sla->sla]);
|
||||
if ($dept > 0) {
|
||||
if ($dept > 1) {
|
||||
$text_dept = "Emails";
|
||||
$text_dept = 'Emails';
|
||||
} else {
|
||||
$text_dept = "Email";
|
||||
$text_dept = 'Email';
|
||||
}
|
||||
$dept = '<li>Associated department have been moved to default SLA</li>';
|
||||
} else {
|
||||
$dept = "";
|
||||
$dept = '';
|
||||
}
|
||||
$topic = DB::table('help_topic')->where('sla_plan', '=', $id)->update(['sla_plan' => $default_sla->sla]);
|
||||
if ($topic > 0) {
|
||||
if ($topic > 1) {
|
||||
$text_topic = "Emails";
|
||||
$text_topic = 'Emails';
|
||||
} else {
|
||||
$text_topic = "Email";
|
||||
$text_topic = 'Email';
|
||||
}
|
||||
$topic = '<li>Associated Help Topic have been moved to default SLA</li>';
|
||||
} else {
|
||||
$topic = "";
|
||||
$topic = '';
|
||||
}
|
||||
$message = $ticket . $dept . $topic;
|
||||
$message = $ticket.$dept.$topic;
|
||||
/* Delete a perticular field from the database by delete() using Id */
|
||||
$slas = $sla->whereId($id)->first();
|
||||
/* Check whether function success or not */
|
||||
try {
|
||||
$slas->delete();
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('sla')->with('success', 'SLA Plan Deleted Successfully' . $message);
|
||||
return redirect('sla')->with('success', 'SLA Plan Deleted Successfully'.$message);
|
||||
} catch (Exception $e) {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('sla')->with('fails', 'SLA Plan can not Delete' . '<li>' . $e->errorInfo[2] . '</li>');
|
||||
return redirect('sla')->with('fails', 'SLA Plan can not Delete'.'<li>'.$e->errorInfo[2].'</li>');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -16,35 +16,39 @@ use DB;
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
* TeamController
|
||||
* TeamController.
|
||||
*
|
||||
* @package Controllers
|
||||
* @subpackage Controller
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class TeamController extends Controller {
|
||||
|
||||
class TeamController extends Controller
|
||||
{
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return type void
|
||||
*/
|
||||
public function __construct() {
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('auth');
|
||||
$this->middleware('roles');
|
||||
}
|
||||
|
||||
/**
|
||||
* get Index page
|
||||
* @param type Teams $team
|
||||
* 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) {
|
||||
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 redirect()->back()->with('fails', $e->errorInfo[2]);
|
||||
@@ -53,12 +57,16 @@ class TeamController extends Controller {
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @param type User $user
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function create(User $user) {
|
||||
public function create(User $user)
|
||||
{
|
||||
try {
|
||||
$user = $user->get();
|
||||
|
||||
return view('themes.default1.admin.helpdesk.agent.teams.create', compact('user'));
|
||||
} catch (Exception $e) {
|
||||
return redirect()->back()->with('fails', $e->errorInfo[2]);
|
||||
@@ -67,12 +75,14 @@ class TeamController extends Controller {
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
* @param type Teams $team
|
||||
*
|
||||
* @param type Teams $team
|
||||
* @param type TeamRequest $request
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function store(Teams $team, TeamRequest $request) {
|
||||
|
||||
public function store(Teams $team, TeamRequest $request)
|
||||
{
|
||||
if ($request->team_lead) {
|
||||
$team_lead = $request->team_lead;
|
||||
} else {
|
||||
@@ -86,24 +96,28 @@ class TeamController extends Controller {
|
||||
return redirect('teams')->with('success', 'Teams Created Successfully');
|
||||
} catch (Exception $e) {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('teams')->with('fails', 'Teams can not Create' . '<li>' . $e->errorInfo[2] . '</li>');
|
||||
return redirect('teams')->with('fails', 'Teams can not Create'.'<li>'.$e->errorInfo[2].'</li>');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
* @param type $id
|
||||
* @param type User $user
|
||||
*
|
||||
* @param type $id
|
||||
* @param type User $user
|
||||
* @param type Assign_team_agent $assign_team_agent
|
||||
* @param type Teams $team
|
||||
* @param type Teams $team
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function edit($id, User $user, Assign_team_agent $assign_team_agent, Teams $team) {
|
||||
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 redirect()->back()->with('fails', $e->errorInfo[2]);
|
||||
@@ -112,13 +126,15 @@ class TeamController extends Controller {
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
* @param type int $id
|
||||
* @param type Teams $team
|
||||
*
|
||||
* @param type int $id
|
||||
* @param type Teams $team
|
||||
* @param type TeamUpdate $request
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function update($id, Teams $team, TeamUpdate $request) {
|
||||
|
||||
public function update($id, Teams $team, TeamUpdate $request)
|
||||
{
|
||||
$teams = $team->whereId($id)->first();
|
||||
//updating check box
|
||||
if ($request->team_lead) {
|
||||
@@ -140,18 +156,21 @@ class TeamController extends Controller {
|
||||
return redirect('teams')->with('success', 'Teams Updated Successfully');
|
||||
} catch (Exception $e) {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('teams')->with('fails', 'Teams can not Update' . '<li>' . $e->errorInfo[2] . '</li>');
|
||||
return redirect('teams')->with('fails', 'Teams can not Update'.'<li>'.$e->errorInfo[2].'</li>');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
* @param type int $id
|
||||
* @param type Teams $team
|
||||
*
|
||||
* @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) {
|
||||
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();
|
||||
@@ -162,8 +181,7 @@ class TeamController extends Controller {
|
||||
return redirect('teams')->with('success', 'Teams Deleted Successfully');
|
||||
} catch (Exception $e) {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('teams')->with('fails', 'Teams can not Delete' . '<li>' . $e->errorInfo[2] . '</li>');
|
||||
return redirect('teams')->with('fails', 'Teams can not Delete'.'<li>'.$e->errorInfo[2].'</li>');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -3,9 +3,9 @@
|
||||
namespace App\Http\Controllers\Admin\helpdesk;
|
||||
|
||||
// controllers
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Controllers\Common\SettingsController;
|
||||
use App\Http\Controllers\Common\PhpMailController;
|
||||
use App\Http\Controllers\Common\SettingsController;
|
||||
use App\Http\Controllers\Controller;
|
||||
// requests
|
||||
use App\Http\Requests\helpdesk\TemplateRequest;
|
||||
use App\Http\Requests\helpdesk\TemplateUdate;
|
||||
@@ -14,25 +14,25 @@ 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;
|
||||
use Exception;
|
||||
use Illuminate\Http\Request;
|
||||
use Input;
|
||||
use Mail;
|
||||
|
||||
/**
|
||||
* TemplateController
|
||||
* TemplateController.
|
||||
*
|
||||
* @package Controllers
|
||||
* @subpackage Controller
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class TemplateController extends Controller {
|
||||
|
||||
class TemplateController extends Controller
|
||||
{
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return type void
|
||||
*/
|
||||
public function __construct(PhpMailController $PhpMailController) {
|
||||
public function __construct(PhpMailController $PhpMailController)
|
||||
{
|
||||
$this->PhpMailController = $PhpMailController;
|
||||
SettingsController::smtp();
|
||||
$this->middleware('auth');
|
||||
@@ -41,12 +41,16 @@ class TemplateController extends Controller {
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @param type Template $template
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function index(Template $template) {
|
||||
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');
|
||||
@@ -55,14 +59,18 @@ class TemplateController extends Controller {
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @param type Languages $language
|
||||
* @param type Template $template
|
||||
* @param type Template $template
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function create(Languages $language, Template $template) {
|
||||
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');
|
||||
@@ -71,11 +79,14 @@ class TemplateController extends Controller {
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
* @param type Template $template
|
||||
*
|
||||
* @param type Template $template
|
||||
* @param type TemplateRequest $request
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function store(Template $template, TemplateRequest $request) {
|
||||
public function store(Template $template, TemplateRequest $request)
|
||||
{
|
||||
try {
|
||||
/* Check whether function success or not */
|
||||
if ($template->fill($request->input())->save() == true) {
|
||||
@@ -93,49 +104,60 @@ class TemplateController extends Controller {
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
* @param int $id
|
||||
*
|
||||
* @param int $id
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function show($id) {
|
||||
public function show($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
* @param type $id
|
||||
* @param type Template $template
|
||||
*
|
||||
* @param type $id
|
||||
* @param type Template $template
|
||||
* @param type Languages $language
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function listdirectories() {
|
||||
public function listdirectories()
|
||||
{
|
||||
$path = '../resources/views/emails/';
|
||||
$directories = scandir($path);
|
||||
$directory = str_replace('/', '-', $path);
|
||||
|
||||
return view('themes.default1.admin.helpdesk.emails.template.listdirectories', compact('directories', 'directory'));
|
||||
}
|
||||
|
||||
public function listtemplates($template, $path) {
|
||||
public function listtemplates($template, $path)
|
||||
{
|
||||
$paths = str_replace('-', '/', $path);
|
||||
$directory2 = $paths . $template;
|
||||
$directory2 = $paths.$template;
|
||||
|
||||
$templates = scandir($directory2);
|
||||
$directory = str_replace('/', '-', $directory2 . '/');
|
||||
$directory = str_replace('/', '-', $directory2.'/');
|
||||
|
||||
return view('themes.default1.admin.helpdesk.emails.template.listtemplates', compact('templates', 'directory'));
|
||||
}
|
||||
|
||||
public function readtemplate($template, $path) {
|
||||
public function readtemplate($template, $path)
|
||||
{
|
||||
$directory = str_replace('-', '/', $path);
|
||||
$handle = fopen($directory . $template, "r");
|
||||
$contents = fread($handle, filesize($directory . $template));
|
||||
$handle = fopen($directory.$template, 'r');
|
||||
$contents = fread($handle, filesize($directory.$template));
|
||||
fclose($handle);
|
||||
|
||||
return view('themes.default1.admin.helpdesk.emails.template.readtemplates', compact('contents', 'template', 'path'));
|
||||
}
|
||||
|
||||
public function createtemplate() {
|
||||
public function createtemplate()
|
||||
{
|
||||
$directory = '../resources/views/emails/';
|
||||
$fname = Input::get('folder_name');
|
||||
$filename = $directory . $fname;
|
||||
$filename = $directory.$fname;
|
||||
|
||||
// images folder creation using php
|
||||
// $mydir = dirname( __FILE__ )."/html/images";
|
||||
@@ -147,32 +169,37 @@ class TemplateController extends Controller {
|
||||
if (!file_exists($filename)) {
|
||||
mkdir($filename, 0777);
|
||||
}
|
||||
$files = array_filter(scandir($directory . 'default'));
|
||||
$files = array_filter(scandir($directory.'default'));
|
||||
|
||||
foreach ($files as $file) {
|
||||
if ($file === '.' or $file === '..')
|
||||
if ($file === '.' or $file === '..') {
|
||||
continue;
|
||||
}
|
||||
if (!is_dir($file)) {
|
||||
// $file_to_go = str_replace("code/resources/views/emails/",'code/resources/views/emails/'.$fname,$file);
|
||||
$destination = $directory . $fname . '/';
|
||||
$destination = $directory.$fname.'/';
|
||||
|
||||
copy($directory . 'default/' . $file, $destination . $file);
|
||||
copy($directory.'default/'.$file, $destination.$file);
|
||||
}
|
||||
}
|
||||
|
||||
return \Redirect::back()->with('success', 'Successfully copied');
|
||||
}
|
||||
|
||||
public function writetemplate($template, $path) {
|
||||
public function writetemplate($template, $path)
|
||||
{
|
||||
$directory = str_replace('-', '/', $path);
|
||||
$b = Input::get('templatedata');
|
||||
|
||||
file_put_contents($directory . $template, print_r($b, true));
|
||||
file_put_contents($directory.$template, print_r($b, true));
|
||||
|
||||
return \Redirect::back()->with('success', 'Successfully updated');
|
||||
}
|
||||
|
||||
public function deletetemplate($template, $path) {
|
||||
public function deletetemplate($template, $path)
|
||||
{
|
||||
$directory = str_replace('-', '/', $path);
|
||||
$dir = $directory . $template;
|
||||
$dir = $directory.$template;
|
||||
$status = \DB::table('settings_email')->first();
|
||||
if ($template == 'default' or $template == $status->template) {
|
||||
return \Redirect::back()->with('fails', 'You cannot delete a default or active directory!');
|
||||
@@ -180,26 +207,31 @@ class TemplateController extends Controller {
|
||||
if (is_dir($dir)) {
|
||||
$objects = scandir($dir);
|
||||
foreach ($objects as $object) {
|
||||
if ($object != "." && $object != "..") {
|
||||
unlink($dir . "/" . $object);
|
||||
if ($object != '.' && $object != '..') {
|
||||
unlink($dir.'/'.$object);
|
||||
}
|
||||
}
|
||||
rmdir($dir);
|
||||
} else {
|
||||
rmdir($dir);
|
||||
}
|
||||
|
||||
return \Redirect::back()->with('success', 'Successfully Deleted');
|
||||
}
|
||||
|
||||
public function activateset($setname) {
|
||||
\DB::table('settings_email')->update(array('template' => $setname));
|
||||
public function activateset($setname)
|
||||
{
|
||||
\DB::table('settings_email')->update(['template' => $setname]);
|
||||
|
||||
return \Redirect::back()->with('success', 'You have Successfully Activated this Set');
|
||||
}
|
||||
|
||||
public function edit($id, Template $template, Languages $language) {
|
||||
public function edit($id, Template $template, Languages $language)
|
||||
{
|
||||
try {
|
||||
$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');
|
||||
@@ -208,12 +240,15 @@ class TemplateController extends Controller {
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
* @param type int $id
|
||||
* @param type Template $template
|
||||
*
|
||||
* @param type int $id
|
||||
* @param type Template $template
|
||||
* @param type TemplateUdate $request
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function update($id, Template $template, TemplateUdate $request) {
|
||||
public function update($id, Template $template, TemplateUdate $request)
|
||||
{
|
||||
try {
|
||||
//TODO validation
|
||||
$templates = $template->whereId($id)->first();
|
||||
@@ -233,11 +268,14 @@ class TemplateController extends Controller {
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
* @param type int $id
|
||||
*
|
||||
* @param type int $id
|
||||
* @param type Template $template
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function destroy($id, Template $template) {
|
||||
public function destroy($id, Template $template)
|
||||
{
|
||||
try {
|
||||
$templates = $template->whereId($id)->first();
|
||||
/* Check whether function success or not */
|
||||
@@ -256,12 +294,16 @@ class TemplateController extends Controller {
|
||||
|
||||
/**
|
||||
* Form for Email connection checking.
|
||||
*
|
||||
* @param type Emails $email
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function formDiagno(Emails $email) {
|
||||
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');
|
||||
@@ -269,11 +311,14 @@ class TemplateController extends Controller {
|
||||
}
|
||||
|
||||
/**
|
||||
* function to send emails
|
||||
* function to send emails.
|
||||
*
|
||||
* @param type Request $request
|
||||
*
|
||||
* @return type
|
||||
*/
|
||||
public function postDiagno(Request $request) {
|
||||
public function postDiagno(Request $request)
|
||||
{
|
||||
$email = $request->input('to');
|
||||
if ($email == null) {
|
||||
return redirect('getdiagno')->with('fails', 'Please provide E-mail address !');
|
||||
@@ -283,5 +328,4 @@ class TemplateController extends Controller {
|
||||
|
||||
return redirect('getdiagno')->with('success', 'Please check your mail. An E-mail has been sent to your E-mail address');
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -11,21 +11,22 @@ use App\Model\helpdesk\Ticket_thread;
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
* ThreadController
|
||||
* ThreadController.
|
||||
*
|
||||
* @package Controllers
|
||||
* @subpackage Controller
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class ThreadController extends Controller {
|
||||
|
||||
class ThreadController extends Controller
|
||||
{
|
||||
/**
|
||||
* get the values from ticket_thread Table and direct to view page
|
||||
* get the values from ticket_thread Table and direct to view page.
|
||||
*
|
||||
* @param type Ticket_thread $thread
|
||||
* @param type Priority $priority
|
||||
* @return type Response
|
||||
* @param type Priority $priority
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function getTickets(Ticket_thread $thread, Priority $priority) {
|
||||
public function getTickets(Ticket_thread $thread, Priority $priority)
|
||||
{
|
||||
try {
|
||||
/* get the values of Ticket_thread from Ticket_thread Table */
|
||||
$threads = $thread->get();
|
||||
@@ -37,5 +38,4 @@ class ThreadController extends Controller {
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user