updated commit
This commit is contained in:
@@ -1,129 +1,104 @@
|
||||
<?php namespace App\Http\Controllers\Admin;
|
||||
|
||||
//use App\Http\Requests\AgentRequest;
|
||||
<?php
|
||||
namespace App\Http\Controllers\Admin;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Requests\AgentRequest;
|
||||
|
||||
/* include update request for update validation */
|
||||
use App\Http\Requests\AgentUpdate;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Model\Agent\Agents;
|
||||
use App\Model\Utility\Timezones;
|
||||
use App\Model\Agent\Groups;
|
||||
use App\Model\Agent\Department;
|
||||
use App\Model\Agent\Teams;
|
||||
|
||||
use App\Model\Agent\Assign_team_agent;
|
||||
|
||||
use App\Model\Agent\Department;
|
||||
use App\Model\Agent\Groups;
|
||||
use App\Model\Agent\Teams;
|
||||
use App\Model\Utility\Timezones;
|
||||
use App\User;
|
||||
use DB;
|
||||
|
||||
use App\User;
|
||||
|
||||
use Auth;
|
||||
|
||||
/**
|
||||
* AgentController
|
||||
*
|
||||
* @package Controllers
|
||||
* @subpackage Controller
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class AgentController extends Controller {
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
public function __construct() {
|
||||
$this->middleware('auth');
|
||||
$this->middleware('roles');
|
||||
}
|
||||
|
||||
public function index(User $user)
|
||||
{
|
||||
try
|
||||
{
|
||||
$user = $user->where('role','agent')->get();
|
||||
|
||||
/**
|
||||
* get index page
|
||||
* @param type User $user
|
||||
* @return type Response
|
||||
*/
|
||||
public function index(User $user) {
|
||||
try {
|
||||
$user = $user->where('role', 'agent')->get();
|
||||
return view('themes.default1.admin.agent.agents.index', compact('user'));
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return Response
|
||||
* @param type Assign_team_agent $team_assign_agent
|
||||
* @param type Timezones $timezone
|
||||
* @param type Groups $group
|
||||
* @param type Department $department
|
||||
* @param type Teams $team
|
||||
* @return type Response
|
||||
*/
|
||||
public function create(Assign_team_agent $team_assign_agent, Timezones $timezone, Groups $group, Department $department, Teams $team)
|
||||
{
|
||||
try
|
||||
{
|
||||
$team= $team->get();
|
||||
public function create(Assign_team_agent $team_assign_agent, Timezones $timezone, Groups $group, Department $department, Teams $team) {
|
||||
try {
|
||||
$team = $team->get();
|
||||
//$agents = $agent->get();
|
||||
$timezones = $timezone->get();
|
||||
$groups = $group->get();
|
||||
$departments = $department->get();
|
||||
|
||||
$teams = $team->lists('id','name');
|
||||
|
||||
//$assign = $team_assign_agent->where('agent_id',$id)->lists('team_id');
|
||||
|
||||
//$assign = $team_assign_agent->where('agent_id',1)->lists('team_id');
|
||||
|
||||
return view('themes.default1.admin.agent.agents.create', compact('assign','teams','agents','timezones','groups','departments','team'));
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
$teams = $team->lists('id', 'name');
|
||||
//$assign = $team_assign_agent->where('agent_id',$id)->lists('team_id');
|
||||
//$assign = $team_assign_agent->where('agent_id',1)->lists('team_id');
|
||||
return view('themes.default1.admin.agent.agents.create', compact('assign', 'teams', 'agents', 'timezones', 'groups', 'departments', 'team'));
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @return Response
|
||||
* @param type User $user
|
||||
* @param type AgentRequest $request
|
||||
* @param type Assign_team_agent $team_assign_agent
|
||||
* @return type Response
|
||||
*/
|
||||
public function store(User $user, AgentRequest $request, Assign_team_agent $team_assign_agent)
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
public function store(User $user, AgentRequest $request, Assign_team_agent $team_assign_agent) {
|
||||
try {
|
||||
//$agent -> fill($request->except('team_id'))->save();
|
||||
|
||||
/* Insert to user table */
|
||||
$user->role = 'agent';
|
||||
$user->fill($request->input())->save();
|
||||
|
||||
|
||||
// $teams = $request->input('assign_team');
|
||||
// $imp =implode(',', $teams);
|
||||
// $agent->assign_team = $imp;
|
||||
|
||||
$requests = $request->input('team_id');
|
||||
|
||||
$id = $user->id;
|
||||
|
||||
foreach($requests as $req)
|
||||
{
|
||||
DB::insert('insert into team_assign_agent (team_id, agent_id) values (?,?)', [$req, $id]);
|
||||
|
||||
}
|
||||
|
||||
$requests = $request->input('team_id');
|
||||
$id = $user->id;
|
||||
foreach ($requests as $req) {
|
||||
DB::insert('insert into team_assign_agent (team_id, agent_id) values (?,?)', [$req, $id]);
|
||||
}
|
||||
/* Succes And Failure condition */
|
||||
|
||||
if($user->save()==true)
|
||||
{
|
||||
return redirect('agents')->with('success','Agent Created sucessfully');
|
||||
}
|
||||
else
|
||||
{
|
||||
return redirect('agents')->with('fails','Agent can not Create');
|
||||
if ($user->save() == true) {
|
||||
return redirect('agents')->with('success', 'Agent Created sucessfully');
|
||||
} else {
|
||||
return redirect('agents')->with('fails', 'Agent can not Create');
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
return redirect('agents')->with('fails', 'Agent can not Create');
|
||||
}
|
||||
catch( Exception $e)
|
||||
{
|
||||
return redirect('agents')->with('fails','Agent can not Create');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -132,139 +107,104 @@ class AgentController extends Controller {
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
public function show($id) {
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
* @param type int $id
|
||||
* @param type User $user
|
||||
* @param type Assign_team_agent $team_assign_agent
|
||||
* @param type Timezones $timezone
|
||||
* @param type Groups $group
|
||||
* @param type Department $department
|
||||
* @param type Teams $team
|
||||
* @return type Response
|
||||
*/
|
||||
public function edit($id,User $user, Assign_team_agent $team_assign_agent, Timezones $timezone, Groups $group, Department $department, Teams $team)
|
||||
{
|
||||
try
|
||||
{
|
||||
public function edit($id, User $user, Assign_team_agent $team_assign_agent, Timezones $timezone, Groups $group, Department $department, Teams $team) {
|
||||
try {
|
||||
$user = $user->whereId($id)->first();
|
||||
$team= $team->get();
|
||||
$teams1 = $team->lists('name','id');
|
||||
$team = $team->get();
|
||||
$teams1 = $team->lists('name', 'id');
|
||||
$timezones = $timezone->get();
|
||||
$groups = $group->get();
|
||||
$departments = $department->get();
|
||||
|
||||
// $selectedTeam= $user->assign_team;
|
||||
// $selectedTeams = explode(',',$selectedTeam);
|
||||
|
||||
$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.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');
|
||||
// $selectedTeam= $user->assign_team;
|
||||
// $selectedTeams = explode(',',$selectedTeam);
|
||||
$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.agent.agents.edit', compact('teams', 'assign', 'table', 'teams1', 'selectedTeams', 'user', 'timezones', 'groups', 'departments', 'team', 'exp', 'counted'));
|
||||
} catch (Exception $e) {
|
||||
return redirect('agents')->with('fail', 'No such file');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
* @param type int $id
|
||||
* @param type User $user
|
||||
* @param type AgentUpdate $request
|
||||
* @param type Assign_team_agent $team_assign_agent
|
||||
* @return type Response
|
||||
*/
|
||||
public function update($id, User $user, AgentUpdate $request, Assign_team_agent $team_assign_agent)
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
public function update($id, User $user, AgentUpdate $request, Assign_team_agent $team_assign_agent) {
|
||||
try {
|
||||
//$agents = $agent -> whereId($id) -> first();
|
||||
|
||||
$user = $user->whereId($id)->first();
|
||||
|
||||
$daylight_save=$request->input('daylight_save');
|
||||
$limit_access=$request->input('limit_access');
|
||||
$directory_listing=$request->input('directory_listing');
|
||||
$vocation_mode=$request->input('vocation_mode');
|
||||
$daylight_save = $request->input('daylight_save');
|
||||
$limit_access = $request->input('limit_access');
|
||||
$directory_listing = $request->input('directory_listing');
|
||||
$vocation_mode = $request->input('vocation_mode');
|
||||
//$role=$request->input('role');
|
||||
|
||||
//dd($account_status);
|
||||
|
||||
// $agents->daylight_save=$daylight_save;
|
||||
// $agents->limit_access=$limit_access;
|
||||
// $agents->directory_listing=$directory_listing;
|
||||
// $agents->vocation_mode=$vocation_mode;
|
||||
|
||||
//==============================================
|
||||
|
||||
$user->daylight_save=$daylight_save;
|
||||
$user->limit_access=$limit_access;
|
||||
$user->directory_listing=$directory_listing;
|
||||
$user->vocation_mode=$vocation_mode;
|
||||
$user->daylight_save = $daylight_save;
|
||||
$user->limit_access = $limit_access;
|
||||
$user->directory_listing = $directory_listing;
|
||||
$user->vocation_mode = $vocation_mode;
|
||||
//$user->role=$role;
|
||||
|
||||
//==============================================
|
||||
|
||||
|
||||
$table = $team_assign_agent->where('agent_id',$id);
|
||||
$table = $team_assign_agent->where('agent_id', $id);
|
||||
$table->delete();
|
||||
|
||||
$requests = $request->input('team_id');
|
||||
|
||||
foreach($requests as $req)
|
||||
{
|
||||
DB::insert('insert into team_assign_agent (team_id, agent_id) values (?,?)', [$req, $id]);
|
||||
|
||||
}
|
||||
|
||||
foreach ($requests as $req) {
|
||||
DB::insert('insert into team_assign_agent (team_id, agent_id) values (?,?)', [$req, $id]);
|
||||
}
|
||||
//Todo For success and failure conditions
|
||||
|
||||
//$agents->fill($request->except('daylight_save','limit_access','directory_listing','vocation_mode','assign_team'))->save();
|
||||
$user->fill($request->except('daylight_save','limit_access','directory_listing','vocation_mode','assign_team'))->save();
|
||||
return redirect('agents')->with('success','Agent Updated sucessfully');
|
||||
}
|
||||
catch (Exception $e)
|
||||
{
|
||||
return redirect('agents')->with('fails','Agent did not update');
|
||||
$user->fill($request->except('daylight_save', 'limit_access', 'directory_listing', 'vocation_mode', 'assign_team'))->save();
|
||||
return redirect('agents')->with('success', 'Agent Updated sucessfully');
|
||||
} catch (Exception $e) {
|
||||
return redirect('agents')->with('fails', 'Agent did not update');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
* @param type int $id
|
||||
* @param type User $user
|
||||
* @param type Assign_team_agent $team_assign_agent
|
||||
* @return type Response
|
||||
*/
|
||||
public function destroy($id, User $user, Assign_team_agent $team_assign_agent)
|
||||
{
|
||||
try
|
||||
{
|
||||
public function destroy($id, User $user, Assign_team_agent $team_assign_agent) {
|
||||
try {
|
||||
/* Becouse of foreign key we delete team_assign_agent first */
|
||||
$team_assign_agent = $team_assign_agent->where('agent_id',$id);
|
||||
$team_assign_agent = $team_assign_agent->where('agent_id', $id);
|
||||
$team_assign_agent->delete();
|
||||
|
||||
$user = $user->whereId($id)->first();
|
||||
|
||||
|
||||
if($user->delete())
|
||||
{
|
||||
return redirect('agents')->with('success','Agent Deleted sucessfully');
|
||||
if ($user->delete()) {
|
||||
return redirect('agents')->with('success', 'Agent Deleted sucessfully');
|
||||
} else {
|
||||
return redirect('agents')->with('fails', 'Agent can not Delete ');
|
||||
}
|
||||
else
|
||||
{
|
||||
return redirect('agents')->with('fails','Agent can not Delete ');
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
return redirect('agents')->with('fails','Agent can not Delete if the team Excist');
|
||||
} catch (Exception $e) {
|
||||
return redirect('agents')->with('fails', 'Agent can not Delete if the team Excist');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,92 +1,80 @@
|
||||
<?php namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Http\Requests\BanRequest;
|
||||
<?php
|
||||
namespace App\Http\Controllers\Admin;
|
||||
use App\Http\Controllers\Controller;
|
||||
/* include banlist Request for update function validation */
|
||||
use App\Http\Requests\BanlistRequest;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
use App\Http\Requests\BanRequest;
|
||||
use App\Model\Email\Banlist;
|
||||
|
||||
use App\User;
|
||||
|
||||
/**
|
||||
* BanlistController
|
||||
*
|
||||
* @package Controllers
|
||||
* @subpackage Controller
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class BanlistController extends Controller {
|
||||
|
||||
/* constructor for authentication */
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
* @return type void
|
||||
*/
|
||||
public function __construct() {
|
||||
$this->middleware('auth');
|
||||
$this->middleware('roles');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return Response
|
||||
* @param type Banlist $ban
|
||||
* @return type Response
|
||||
*/
|
||||
public function index(Banlist $ban)
|
||||
{
|
||||
try
|
||||
{
|
||||
public function index(Banlist $ban) {
|
||||
try {
|
||||
$bans = $ban->get();
|
||||
return view('themes.default1.admin.emails.banlist.index',compact('bans'));
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
return view('themes.default1.admin.emails.banlist.index', compact('bans'));
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return Response
|
||||
* @return type Response
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
try
|
||||
{
|
||||
public function create() {
|
||||
try {
|
||||
return view('themes.default1.admin.emails.banlist.create');
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @return Response
|
||||
* @param type banlist $ban
|
||||
* @param type BanRequest $request
|
||||
* @param type User $user
|
||||
* @return type Response
|
||||
*/
|
||||
public function store(banlist $ban, BanRequest $request, User $user)
|
||||
{
|
||||
try
|
||||
{
|
||||
public function store(banlist $ban, BanRequest $request, User $user) {
|
||||
try {
|
||||
//adding field to user whether it is banned or not
|
||||
$adban = $request->input('email_address');
|
||||
$use = $user->where('email',$adban)->first();
|
||||
// dd($use);
|
||||
if($use!==null)
|
||||
{
|
||||
$use = $user->where('email', $adban)->first();
|
||||
// dd($use);
|
||||
if ($use !== null) {
|
||||
$use->ban = 1;
|
||||
$use->save();
|
||||
$ban->create($request->input())->save();
|
||||
return redirect('banlist')->with('success','Email Banned sucessfully');
|
||||
}
|
||||
else
|
||||
{
|
||||
return redirect('banlist')->with('success', 'Email Banned sucessfully');
|
||||
} else {
|
||||
$ban->create($request->input())->save();
|
||||
return redirect('banlist')->with('success','Email Banned sucessfully');
|
||||
return redirect('banlist')->with('success', 'Email Banned sucessfully');
|
||||
}
|
||||
// $use = $user->where('email',$adban)->first();
|
||||
// $use->ban = 1;
|
||||
// $use->save();
|
||||
|
||||
|
||||
|
||||
// if($ban->create($request->input())->save()==true)
|
||||
// {
|
||||
// return redirect('banlist')->with('success','Email Banned sucessfully');
|
||||
@@ -95,12 +83,9 @@ class BanlistController extends Controller {
|
||||
// {
|
||||
// return redirect('banlist')->with('fails','Email can not Ban');
|
||||
// }
|
||||
} catch (Exception $e) {
|
||||
return redirect('banlist')->with('fails', 'Email can not Ban');
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
return redirect('banlist')->with('fails','Email can not Ban');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -109,83 +94,62 @@ class BanlistController extends Controller {
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
public function show($id) {
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
* @param type int $id
|
||||
* @param type Banlist $ban
|
||||
* @return type Response
|
||||
*/
|
||||
public function edit($id, Banlist $ban)
|
||||
{
|
||||
try
|
||||
{
|
||||
public function edit($id, Banlist $ban) {
|
||||
try {
|
||||
$bans = $ban->whereId($id)->first();
|
||||
return view('themes.default1.admin.emails.banlist.edit',compact('bans'));
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
return view('themes.default1.admin.emails.banlist.edit', compact('bans'));
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
* @param type int $id
|
||||
* @param type Banlist $ban
|
||||
* @param type BanlistRequest $request
|
||||
* @return type Response
|
||||
*/
|
||||
public function update($id, Banlist $ban, BanlistRequest $request)
|
||||
{
|
||||
try
|
||||
{
|
||||
public function update($id, Banlist $ban, BanlistRequest $request) {
|
||||
try {
|
||||
$bans = $ban->whereId($id)->first();
|
||||
if($bans->fill($request->input())->save())
|
||||
{
|
||||
return redirect('banlist')->with('success','Banned Email Updated sucessfully');
|
||||
if ($bans->fill($request->input())->save()) {
|
||||
return redirect('banlist')->with('success', 'Banned Email Updated sucessfully');
|
||||
} else {
|
||||
return redirect('banlist')->with('fails', 'Banned Email not Updated');
|
||||
}
|
||||
else
|
||||
{
|
||||
return redirect('banlist')->with('fails','Banned Email not Updated');
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
return redirect('banlist')->with('fails','Banned Email not Updated');
|
||||
} catch (Exception $e) {
|
||||
return redirect('banlist')->with('fails', 'Banned Email not Updated');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
* @param type int $id
|
||||
* @param type Banlist $ban
|
||||
* @return type Response
|
||||
*/
|
||||
public function destroy($id, Banlist $ban)
|
||||
{
|
||||
try
|
||||
{
|
||||
public function destroy($id, Banlist $ban) {
|
||||
try {
|
||||
$bans = $ban->whereId($id)->first();
|
||||
|
||||
/* Success and Falure condition */
|
||||
|
||||
if($bans->delete()==true)
|
||||
{
|
||||
return redirect('banlist')->with('success','Banned Email Deleted sucessfully');
|
||||
if ($bans->delete() == true) {
|
||||
return redirect('banlist')->with('success', 'Banned Email Deleted sucessfully');
|
||||
} else {
|
||||
return redirect('banlist')->with('fails', 'Banned Email can not Delete');
|
||||
}
|
||||
else
|
||||
{
|
||||
return redirect('banlist')->with('fails','Banned Email can not Delete');
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
return redirect('banlist')->with('fails','Banned Email can not Delete');
|
||||
} catch (Exception $e) {
|
||||
return redirect('banlist')->with('fails', 'Banned Email can not Delete');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,11 +1,17 @@
|
||||
<?php namespace App\Http\Controllers\Admin;
|
||||
|
||||
<?php
|
||||
namespace App\Http\Controllers\Admin;
|
||||
use Illuminate\Foundation\Bus\DispatchesCommands;
|
||||
use Illuminate\Routing\Controller as BaseController;
|
||||
use Illuminate\Foundation\Validation\ValidatesRequests;
|
||||
use Illuminate\Routing\Controller as BaseController;
|
||||
|
||||
/**
|
||||
* Controller
|
||||
*
|
||||
* @package Controllers
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
abstract class Controller extends BaseController {
|
||||
|
||||
use DispatchesCommands, ValidatesRequests;
|
||||
|
||||
use DispatchesCommands,
|
||||
ValidatesRequests;
|
||||
}
|
||||
|
@@ -1,117 +1,99 @@
|
||||
<?php namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Http\Requests\DepartmentRequest;
|
||||
<?php
|
||||
namespace App\Http\Controllers\Admin;
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
/* include DepartmentUpdate Request for validation */
|
||||
use App\Http\Requests\DepartmentRequest;
|
||||
use App\Http\Requests\DepartmentUpdate;
|
||||
|
||||
use App\Model\Manage\Sla_plan;
|
||||
use App\Model\Agent\Agents;
|
||||
use App\Model\Email\Emails;
|
||||
use App\Model\Agent\Groups;
|
||||
use App\Model\Agent\Department;
|
||||
use App\Model\Email\Template;
|
||||
|
||||
/* Include Teams model */
|
||||
use App\Model\Agent\Teams;
|
||||
|
||||
/* Use Group_assign_department */
|
||||
use App\Model\Agent\Groups;
|
||||
use App\Model\Agent\Group_assign_department;
|
||||
|
||||
use App\Model\Agent\Teams;
|
||||
use App\Model\Email\Emails;
|
||||
use App\Model\Email\Template;
|
||||
use App\Model\Manage\Sla_plan;
|
||||
use App\User;
|
||||
use DB;
|
||||
|
||||
use App\User;
|
||||
|
||||
|
||||
/**
|
||||
* DepartmentController
|
||||
*
|
||||
* @package Controllers
|
||||
* @subpackage Controller
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class DepartmentController extends Controller {
|
||||
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return Response
|
||||
* Create a new controller instance.
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
public function __construct() {
|
||||
$this->middleware('auth');
|
||||
$this->middleware('roles');
|
||||
}
|
||||
public function index(Department $department)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
/**
|
||||
* Get index page
|
||||
* @param type Department $department
|
||||
* @return type Response
|
||||
*/
|
||||
public function index(Department $department) {
|
||||
try {
|
||||
$departments = $department->get();
|
||||
return view('themes.default1.admin.agent.departments.index',compact('departments'));
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
return view('themes.default1.admin.agent.departments.index', compact('departments'));
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return Response
|
||||
* @param type User $user
|
||||
* @param type Group_assign_department $group_assign_department
|
||||
* @param type Department $department
|
||||
* @param type Sla_plan $sla
|
||||
* @param type Template $template
|
||||
* @param type Emails $email
|
||||
* @param type Groups $group
|
||||
* @return type Response
|
||||
*/
|
||||
public function create(User $user,Group_assign_department $group_assign_department, Department $department, Sla_plan $sla,Template $template,Emails $email,Groups $group)
|
||||
{
|
||||
try
|
||||
{
|
||||
$slas=$sla->get();
|
||||
$user=$user->where('role','agent')->get();
|
||||
$emails=$email->get();
|
||||
public function create(User $user, Group_assign_department $group_assign_department, Department $department, Sla_plan $sla, Template $template, Emails $email, Groups $group) {
|
||||
try {
|
||||
$slas = $sla->get();
|
||||
$user = $user->where('role', 'agent')->get();
|
||||
$emails = $email->get();
|
||||
//$groups=$group->get();
|
||||
$templates = $template->get();
|
||||
$department = $department->get();
|
||||
|
||||
$groups = $group->lists('id','name');
|
||||
return view('themes.default1.admin.agent.departments.create',compact('department','templates','slas','user','emails','groups'));
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
$groups = $group->lists('id', 'name');
|
||||
return view('themes.default1.admin.agent.departments.create', compact('department', 'templates', 'slas', 'user', 'emails', 'groups'));
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @return Response
|
||||
* @param type Department $department
|
||||
* @param type DepartmentRequest $request
|
||||
* @return type Response
|
||||
*/
|
||||
public function store(Department $department,DepartmentRequest $request)
|
||||
{
|
||||
try
|
||||
{
|
||||
$department -> fill($request->except('group_id'))->save();
|
||||
|
||||
$requests = $request->input('group_id');
|
||||
|
||||
$id = $department->id;
|
||||
|
||||
foreach($requests as $req)
|
||||
{
|
||||
DB::insert('insert into group_assign_department(group_id, department_id) values (?,?)', [$req, $id]);
|
||||
|
||||
}
|
||||
|
||||
public function store(Department $department, DepartmentRequest $request) {
|
||||
try {
|
||||
$department->fill($request->except('group_id'))->save();
|
||||
$requests = $request->input('group_id');
|
||||
$id = $department->id;
|
||||
foreach ($requests as $req) {
|
||||
DB::insert('insert into group_assign_department(group_id, department_id) values (?,?)', [$req, $id]);
|
||||
}
|
||||
/* Succes And Failure condition */
|
||||
/* Check Whether the function Success or Fail */
|
||||
|
||||
if($department->save()==true)
|
||||
{
|
||||
return redirect('departments')->with('success','Department Created sucessfully');
|
||||
if ($department->save() == true) {
|
||||
return redirect('departments')->with('success', 'Department Created sucessfully');
|
||||
} else {
|
||||
return redirect('departments')->with('fails', 'Department can not Create');
|
||||
}
|
||||
else
|
||||
{
|
||||
return redirect('departments')->with('fails','Department can not Create');
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
return redirect('departments')->with('fails','Department can not Create');
|
||||
} catch (Exception $e) {
|
||||
return redirect('departments')->with('fails', 'Department can not Create');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,109 +103,87 @@ class DepartmentController extends Controller {
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
public function show($id) {
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
* @param type int $id
|
||||
* @param type User $user
|
||||
* @param type Group_assign_department $group_assign_department
|
||||
* @param type Template $template
|
||||
* @param type Teams $team
|
||||
* @param type Department $department
|
||||
* @param type Sla_plan $sla
|
||||
* @param type Emails $email
|
||||
* @param type Groups $group
|
||||
* @return type Response
|
||||
*/
|
||||
public function edit($id,User $user, Group_assign_department $group_assign_department, Template $template, Teams $team, Department $department,Sla_plan $sla,Emails $email,Groups $group)
|
||||
{
|
||||
try
|
||||
{
|
||||
$slas=$sla->get();
|
||||
$user=$user->where('role','agent')->get();
|
||||
$emails=$email->get();
|
||||
public function edit($id, User $user, Group_assign_department $group_assign_department, Template $template, Teams $team, Department $department, Sla_plan $sla, Emails $email, Groups $group) {
|
||||
try {
|
||||
$slas = $sla->get();
|
||||
$user = $user->where('role', 'agent')->get();
|
||||
$emails = $email->get();
|
||||
//$groups=$group->get();
|
||||
$templates = $template->get();
|
||||
$departments = $department->whereId($id)->first();
|
||||
|
||||
$groups = $group->lists('id','name');
|
||||
|
||||
$assign = $group_assign_department->where('department_id',$id)->lists('group_id');
|
||||
|
||||
return view('themes.default1.admin.agent.departments.edit',compact('assign','team','templates','departments','slas','user','emails','groups'));
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
$groups = $group->lists('id', 'name');
|
||||
$assign = $group_assign_department->where('department_id', $id)->lists('group_id');
|
||||
return view('themes.default1.admin.agent.departments.edit', compact('assign', 'team', 'templates', 'departments', 'slas', 'user', 'emails', 'groups'));
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
* @param type int $id
|
||||
* @param type Group_assign_department $group_assign_department
|
||||
* @param type Department $department
|
||||
* @param type DepartmentUpdate $request
|
||||
* @return type Response
|
||||
*/
|
||||
public function update($id,Group_assign_department $group_assign_department, Department $department, DepartmentUpdate $request)
|
||||
{
|
||||
try
|
||||
{
|
||||
$table = $group_assign_department->where('department_id',$id);
|
||||
public function update($id, Group_assign_department $group_assign_department, Department $department, DepartmentUpdate $request) {
|
||||
try {
|
||||
$table = $group_assign_department->where('department_id', $id);
|
||||
$table->delete();
|
||||
|
||||
$requests = $request->input('group_id');
|
||||
|
||||
foreach($requests as $req)
|
||||
{
|
||||
DB::insert('insert into group_assign_department (group_id, department_id) values (?,?)', [$req, $id]);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
foreach ($requests as $req) {
|
||||
DB::insert('insert into group_assign_department (group_id, department_id) values (?,?)', [$req, $id]);
|
||||
}
|
||||
$departments = $department->whereId($id)->first();
|
||||
if($departments->fill($request->except('group_access'))->save())
|
||||
{
|
||||
return redirect('departments')->with('success','Department Updated sucessfully');
|
||||
if ($departments->fill($request->except('group_access'))->save()) {
|
||||
return redirect('departments')->with('success', 'Department Updated sucessfully');
|
||||
} else {
|
||||
return redirect('departments')->with('fails', 'Department not Updated');
|
||||
}
|
||||
else
|
||||
{
|
||||
return redirect('departments')->with('fails','Department not Updated');
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
return redirect('departments')->with('fails','Department not Updated');
|
||||
} catch (Exception $e) {
|
||||
return redirect('departments')->with('fails', 'Department not Updated');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
* @param type int $id
|
||||
* @param type Department $department
|
||||
* @param type Group_assign_department $group_assign_department
|
||||
* @return type Response
|
||||
*/
|
||||
public function destroy($id, Department $department, Group_assign_department $group_assign_department)
|
||||
{
|
||||
try
|
||||
{
|
||||
public function destroy($id, Department $department, Group_assign_department $group_assign_department) {
|
||||
try {
|
||||
/* Becouse of foreign key we delete group_assign_department first */
|
||||
$group_assign_department = $group_assign_department->where('department_id',$id);
|
||||
$group_assign_department = $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');
|
||||
if ($departments->delete() == true) {
|
||||
return redirect('departments')->with('success', 'Department Deleted sucessfully');
|
||||
} else {
|
||||
return redirect('departments')->with('fails', 'Department can not Delete');
|
||||
}
|
||||
else
|
||||
{
|
||||
return redirect('departments')->with('fails','Department can not Delete');
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
return redirect('departments')->with('fails','Department can not Delete');
|
||||
} catch (Exception $e) {
|
||||
return redirect('departments')->with('fails', 'Department can not Delete');
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -1,92 +1,85 @@
|
||||
<?php namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Http\Requests\EmailsRequest;
|
||||
use App\Http\Requests\EmailsEditRequest;
|
||||
<?php
|
||||
namespace App\Http\Controllers\Admin;
|
||||
use App\Http\Controllers\Controller;
|
||||
/* Include Priority Model */
|
||||
use App\Model\Utility\Priority;
|
||||
/* Include Mailbox Protocol */
|
||||
use App\Model\Utility\MailboxProtocol;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Requests\EmailsEditRequest;
|
||||
use App\Http\Requests\EmailsRequest;
|
||||
use App\Model\Agent\Department;
|
||||
use App\Model\Email\Emails;
|
||||
use App\Model\Manage\Help_topic;
|
||||
use App\Model\Agent\Department;
|
||||
|
||||
use App\Model\Utility\MailboxProtocol;
|
||||
use App\Model\Utility\Priority;
|
||||
use Crypt;
|
||||
|
||||
/**
|
||||
* EmailsController
|
||||
*
|
||||
* @package Controllers
|
||||
* @subpackage Controller
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class EmailsController extends Controller {
|
||||
|
||||
/* constructor for authentication */
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
* @return type
|
||||
*/
|
||||
public function __construct() {
|
||||
$this->middleware('auth');
|
||||
$this->middleware('roles');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return Response
|
||||
* @param type Emails $emails
|
||||
* @return type Response
|
||||
*/
|
||||
public function index(Emails $emails)
|
||||
{
|
||||
try
|
||||
{
|
||||
public function index(Emails $emails) {
|
||||
try {
|
||||
$emails = $emails->get();
|
||||
return view('themes.default1.admin.emails.emails.index', compact('emails'));
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return Response
|
||||
* @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, Priority $priority, MailboxProtocol $mailbox_protocol)
|
||||
{
|
||||
try
|
||||
{
|
||||
public function create(Department $department, Help_topic $help, 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.emails.emails.create',compact('mailbox_protocols','priority','departments','helps'));
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
return view('themes.default1.admin.emails.emails.create', compact('mailbox_protocols', 'priority', 'departments', 'helps'));
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @return Response
|
||||
* @param type Emails $email
|
||||
* @param type EmailsRequest $request
|
||||
* @return type Response
|
||||
*/
|
||||
public function store(Emails $email, EmailsRequest $request)
|
||||
{
|
||||
try
|
||||
{
|
||||
public function store(Emails $email, EmailsRequest $request) {
|
||||
try {
|
||||
$password = $request->input('password');
|
||||
$encrypted = Crypt::encrypt($password);
|
||||
$email->password = $encrypted;
|
||||
if($email->fill($request->except('password'))->save()==true)
|
||||
{
|
||||
return redirect('emails')->with('success','Email Created sucessfully');
|
||||
if ($email->fill($request->except('password'))->save() == true) {
|
||||
return redirect('emails')->with('success', 'Email Created sucessfully');
|
||||
} else {
|
||||
return redirect('emails')->with('fails', 'Email can not Create');
|
||||
}
|
||||
else
|
||||
{
|
||||
return redirect('emails')->with('fails','Email can not Create');
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
return redirect('emails')->with('fails','Email can not Create');
|
||||
} catch (Exception $e) {
|
||||
return redirect('emails')->with('fails', 'Email can not Create');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,86 +89,73 @@ class EmailsController extends Controller {
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
public function show($id) {
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
* @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, Priority $priority, MailboxProtocol $mailbox_protocol)
|
||||
{
|
||||
try
|
||||
{
|
||||
public function edit($id, Department $department, Help_topic $help, Emails $email, 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.emails.emails.edit',compact('mailbox_protocols','priority','departments','helps','emails'));
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
return view('themes.default1.admin.emails.emails.edit', compact('mailbox_protocols', 'priority', 'departments', 'helps', 'emails'));
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
* @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;
|
||||
//$value = Crypt::decrypt($encrypted);
|
||||
//echo $value;
|
||||
|
||||
try
|
||||
{
|
||||
//echo $encrypted;
|
||||
//$value = Crypt::decrypt($encrypted);
|
||||
//echo $value;
|
||||
try {
|
||||
$emails = $email->whereId($id)->first();
|
||||
$emails->password = $encrypted;
|
||||
$emails->fill($request->except('password'))->save();
|
||||
return redirect('emails')->with('success','Email Updated sucessfully');
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
return redirect('emails')->with('fails','Email not updated');
|
||||
return redirect('emails')->with('success', 'Email Updated sucessfully');
|
||||
} catch (Exception $e) {
|
||||
return redirect('emails')->with('fails', 'Email not updated');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
* @param type int $id
|
||||
* @param type Emails $email
|
||||
* @return type Response
|
||||
*/
|
||||
public function destroy($id, Emails $email)
|
||||
{
|
||||
try
|
||||
{
|
||||
public function destroy($id, Emails $email) {
|
||||
try {
|
||||
$emails = $email->whereId($id)->first();
|
||||
if($emails->delete()==true)
|
||||
{
|
||||
return redirect('emails')->with('success','Email Deleted sucessfully');
|
||||
}
|
||||
else
|
||||
{
|
||||
return redirect('emails')->with('fails','Email can not Delete ');
|
||||
if ($emails->delete() == true) {
|
||||
return redirect('emails')->with('success', 'Email Deleted sucessfully');
|
||||
} else {
|
||||
return redirect('emails')->with('fails', 'Email can not Delete ');
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
return redirect('emails')->with('fails', 'Email can not Delete ');
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
return redirect('emails')->with('fails','Email can not Delete ');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,98 +1,80 @@
|
||||
<?php namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Http\Requests;
|
||||
<?php
|
||||
namespace App\Http\Controllers\Admin;
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
/* Include Forms Model */
|
||||
use App\Http\Requests\FormRequest;
|
||||
use App\Model\Manage\Forms;
|
||||
|
||||
/* Include Form_visibility model */
|
||||
use App\Model\Utility\Form_type;
|
||||
use App\Model\Utility\Form_visibility;
|
||||
|
||||
/* Include Form_type model */
|
||||
use App\Model\Utility\Form_type;
|
||||
|
||||
/* Include FormRequest for validation */
|
||||
use App\Http\Requests\FormRequest;
|
||||
|
||||
/**
|
||||
* FormController
|
||||
*
|
||||
* @package Controllers
|
||||
* @subpackage Controller
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class FormController extends Controller {
|
||||
|
||||
/* constructor for authentication */
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
* @return type void
|
||||
*/
|
||||
public function __construct() {
|
||||
$this->middleware('auth');
|
||||
$this->middleware('roles');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return Response
|
||||
* @param type Forms $form
|
||||
* @return type Response
|
||||
*/
|
||||
public function index(Forms $form)
|
||||
{
|
||||
try
|
||||
{
|
||||
public function index(Forms $form) {
|
||||
try {
|
||||
/* declare variable $forms to hold the values of table form */
|
||||
$forms = $form->get();
|
||||
|
||||
/* Direct to index page with Form table values */
|
||||
return view('themes.default1.admin.manage.form.index',compact('forms'));
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
return view('themes.default1.admin.manage.form.index', compact('forms'));
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return Response
|
||||
* @param type Form_visibility $visibility
|
||||
* @param type Form_type $type
|
||||
* @return type Response
|
||||
*/
|
||||
public function create(Form_visibility $visibility, Form_type $type)
|
||||
{
|
||||
try
|
||||
{
|
||||
public function create(Form_visibility $visibility, Form_type $type) {
|
||||
try {
|
||||
/* Direct to Create page */
|
||||
return view('themes.default1.admin.manage.form.create',compact('visibility','type'));
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
return view('themes.default1.admin.manage.form.create', compact('visibility', 'type'));
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @return Response
|
||||
* @param type Forms $form
|
||||
* @param type FormRequest $request
|
||||
* @return type Response
|
||||
*/
|
||||
public function store(Forms $form, FormRequest $request)
|
||||
{
|
||||
try
|
||||
{
|
||||
public function store(Forms $form, FormRequest $request) {
|
||||
try {
|
||||
/* Fill the all request to the Table */
|
||||
/* Checking Whether function Success or not */
|
||||
|
||||
if($form->fill($request->input())->save()==true)
|
||||
{
|
||||
if ($form->fill($request->input())->save() == true) {
|
||||
/* Redirect to Index page with Success Message */
|
||||
return redirect('form')->with('success','Form Created Successfully');
|
||||
}
|
||||
else
|
||||
{
|
||||
return redirect('form')->with('success', 'Form Created Successfully');
|
||||
} else {
|
||||
/* Redirect to Index page with Fail Message */
|
||||
return redirect('form')->with('fails','Form can not Create');
|
||||
return redirect('form')->with('fails', 'Form can not Create');
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
} catch (Exception $e) {
|
||||
/* Redirect to Index page with Fail Message */
|
||||
return redirect('form')->with('fails','Form can not Create');
|
||||
return redirect('form')->with('fails', 'Form can not Create');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -102,97 +84,78 @@ class FormController extends Controller {
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
public function show($id) {
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
* @param type int $id
|
||||
* @param type Forms $form
|
||||
* @param type Form_visibility $visibility
|
||||
* @param type Form_type $type
|
||||
* @return type Response
|
||||
*/
|
||||
public function edit($id, Forms $form, Form_visibility $visibility, Form_type $type)
|
||||
{
|
||||
try
|
||||
{
|
||||
public function edit($id, Forms $form, Form_visibility $visibility, Form_type $type) {
|
||||
try {
|
||||
/* declare variable $forms to hold the values of a row by Id */
|
||||
$forms = $form->whereId($id)->first();
|
||||
|
||||
/* Direct to Edit page with Form table's perticular row using Id */
|
||||
return view('themes.default1.admin.manage.form.edit',compact('forms','visibility','type'));
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
return view('themes.default1.admin.manage.form.edit', compact('forms', 'visibility', 'type'));
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
* @param type int $id
|
||||
* @param type Forms $form
|
||||
* @param type FormRequest $request
|
||||
* @return type Response
|
||||
*/
|
||||
public function update($id, Forms $form, FormRequest $request)
|
||||
{
|
||||
try
|
||||
{
|
||||
public function update($id, Forms $form, FormRequest $request) {
|
||||
try {
|
||||
/* declare variable $forms to hold the values of a row by Id */
|
||||
$forms = $form->whereId($id)->first();
|
||||
|
||||
/* Fill the values to the row of a selected, by Id */
|
||||
/* Check Whether function is Success or not */
|
||||
if($forms->fill($request->input())->save()==true)
|
||||
{
|
||||
if ($forms->fill($request->input())->save() == true) {
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('form')->with('success','Form Updated Successfully');
|
||||
}
|
||||
else
|
||||
{
|
||||
return redirect('form')->with('success', 'Form Updated Successfully');
|
||||
} else {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('form')->with('fails','Form can not Update');
|
||||
return redirect('form')->with('fails', 'Form can not Update');
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
} catch (Exception $e) {
|
||||
/* Redirect to Index page with Fail Message */
|
||||
return redirect('form')->with('fails','Form can not Create');
|
||||
return redirect('form')->with('fails', 'Form can not Create');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
* @param type int $id
|
||||
* @param type Forms $form
|
||||
* @return type Response
|
||||
*/
|
||||
public function destroy($id, Forms $form)
|
||||
{
|
||||
try
|
||||
{
|
||||
public function destroy($id, Forms $form) {
|
||||
try {
|
||||
/* declare variable $forms to hold the values of a row by Id */
|
||||
$forms = $form->whereId($id)->first();
|
||||
|
||||
/* Delete the values to the row of a selected, by Id */
|
||||
/* Check whether the fuction success or not */
|
||||
if($forms->delete()==true)
|
||||
{
|
||||
if ($forms->delete() == true) {
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('form')->with('success','Form Deleted Successfully');
|
||||
}
|
||||
else
|
||||
{
|
||||
return redirect('form')->with('success', 'Form Deleted Successfully');
|
||||
} else {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('form')->with('fails','Form can not Deleted');
|
||||
return redirect('form')->with('fails', 'Form can not Deleted');
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
} catch (Exception $e) {
|
||||
/* Redirect to Index page with Fail Message */
|
||||
return redirect('form')->with('fails','Form can not Create');
|
||||
return redirect('form')->with('fails', 'Form can not Create');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,96 +1,80 @@
|
||||
<?php namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Http\Requests;
|
||||
<?php
|
||||
namespace App\Http\Controllers\Admin;
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use App\Http\Requests\GroupRequest;
|
||||
use App\Model\Agent\Department;
|
||||
use App\Model\Agent\Groups;
|
||||
use App\Model\Agent\Group_assign_department;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Input;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use App\Http\Requests\GroupRequest;
|
||||
use App\Model\Agent\Groups;
|
||||
|
||||
use App\Model\Agent\Group_assign_department;
|
||||
|
||||
use App\Model\Agent\Department;
|
||||
|
||||
/**
|
||||
* GroupController
|
||||
*
|
||||
* @package Controllers
|
||||
* @subpackage Controller
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class GroupController extends Controller {
|
||||
|
||||
|
||||
/* constructor for authentication */
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
* @return type void
|
||||
*/
|
||||
public function __construct() {
|
||||
$this->middleware('auth');
|
||||
$this->middleware('roles');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return Response
|
||||
* @param type Groups $group
|
||||
* @param type Department $department
|
||||
* @param type Group_assign_department $group_assign_department
|
||||
* @return type Response
|
||||
*/
|
||||
|
||||
|
||||
public function index(Groups $group, Department $department,Group_assign_department $group_assign_department)
|
||||
{
|
||||
try
|
||||
{
|
||||
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.agent.groups.index',compact('departments','group_assign_department','groups'));
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
return view('themes.default1.admin.agent.groups.index', compact('departments', 'group_assign_department', 'groups'));
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return Response
|
||||
* @return type Response
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
try
|
||||
{
|
||||
public function create() {
|
||||
try {
|
||||
return view('themes.default1.admin.agent.groups.create');
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @return Response
|
||||
* @param type Groups $group
|
||||
* @param type GroupRequest $request
|
||||
* @return type Response
|
||||
*/
|
||||
public function store(Groups $group,GroupRequest $request)
|
||||
{
|
||||
try
|
||||
{
|
||||
public function store(Groups $group, GroupRequest $request) {
|
||||
try {
|
||||
/* Check Whether function success or not */
|
||||
|
||||
if($group->fill($request->input())->save()==true)
|
||||
{
|
||||
if ($group->fill($request->input())->save() == true) {
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('groups')->with('success','Groups Created Successfully');
|
||||
}
|
||||
else
|
||||
{
|
||||
return redirect('groups')->with('success', 'Groups Created Successfully');
|
||||
} else {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('groups')->with('fails','Groups can not Create');
|
||||
return redirect('groups')->with('fails', 'Groups can not Create');
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
} catch (Exception $e) {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('groups')->with('fails','Groups can not Create');
|
||||
return redirect('groups')->with('fails', 'Groups can not Create');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -99,45 +83,39 @@ class GroupController extends Controller {
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function show($id, Groups $group, Request $request)
|
||||
{
|
||||
|
||||
public function show($id, Groups $group, Request $request) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
* @param type int $id
|
||||
* @param type Groups $group
|
||||
* @return type Response
|
||||
*/
|
||||
public function edit($id, Groups $group)
|
||||
{
|
||||
try
|
||||
{
|
||||
public function edit($id, Groups $group) {
|
||||
try {
|
||||
$groups = $group->whereId($id)->first();
|
||||
return view('themes.default1.admin.agent.groups.edit',compact('groups'));
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
return view('themes.default1.admin.agent.groups.edit', compact('groups'));
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
* @param type int $id
|
||||
* @param type Groups $group
|
||||
* @param type Request $request
|
||||
* @return type Response
|
||||
*/
|
||||
public function update($id, Groups $group, Request $request )
|
||||
{
|
||||
try
|
||||
{
|
||||
$var = $group->whereId($id)->first() ;
|
||||
public function update($id, Groups $group, Request $request) {
|
||||
try {
|
||||
$var = $group->whereId($id)->first();
|
||||
//Updating Name
|
||||
// $name = $request->Input('name');
|
||||
// $var->name = $name;
|
||||
//Updating Status
|
||||
//Updating Status
|
||||
$status = $request->Input('group_status');
|
||||
$var->group_status = $status;
|
||||
//Updating can_create_ticket field
|
||||
@@ -179,28 +157,20 @@ class GroupController extends Controller {
|
||||
//Updating admin_notes field
|
||||
$adminNotes = $request->Input('admin_notes');
|
||||
$var->admin_notes = $adminNotes;
|
||||
|
||||
/* Check whether function success or not */
|
||||
|
||||
if($var->save()==true)
|
||||
{
|
||||
if ($var->save() == true) {
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('groups')->with('success','Group Updated Successfully');
|
||||
}
|
||||
else
|
||||
{
|
||||
return redirect('groups')->with('success', 'Group Updated Successfully');
|
||||
} else {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('groups')->with('fails','Group can not Update');
|
||||
return redirect('groups')->with('fails', 'Group can not Update');
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
} catch (Exception $e) {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('groups')->with('fails','Groups can not Create');
|
||||
return redirect('groups')->with('fails', 'Groups can not Create');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// public function delete($id, Groups $group)
|
||||
// {
|
||||
// return view('')
|
||||
@@ -208,38 +178,26 @@ class GroupController extends Controller {
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
* @param type int $id
|
||||
* @param type Groups $group
|
||||
* @param type Group_assign_department $group_assign_department
|
||||
* @return type Response
|
||||
*/
|
||||
public function destroy($id, Groups $group, Group_assign_department $group_assign_department)
|
||||
{
|
||||
try
|
||||
{
|
||||
$group_assign_department->where('group_id',$id)->delete();
|
||||
|
||||
public function destroy($id, Groups $group, Group_assign_department $group_assign_department) {
|
||||
try {
|
||||
$group_assign_department->where('group_id', $id)->delete();
|
||||
$groups = $group->whereId($id)->first();
|
||||
|
||||
/* Check whether function success or not */
|
||||
|
||||
if($groups->delete()==true)
|
||||
{
|
||||
if ($groups->delete() == true) {
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('groups')->with('success','Group Deleted Successfully');
|
||||
}
|
||||
else
|
||||
{
|
||||
return redirect('groups')->with('success', 'Group Deleted Successfully');
|
||||
} else {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('groups')->with('fails','Group can not Delete');
|
||||
return redirect('groups')->with('fails', 'Group can not Delete');
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
} catch (Exception $e) {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('groups')->with('fails','Groups can not Create');
|
||||
return redirect('groups')->with('fails', 'Groups can not Create');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@@ -1,126 +1,100 @@
|
||||
<?php namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Http\Requests;
|
||||
|
||||
/* my own Request to Validate The create form */
|
||||
use App\Http\Requests\HelptopicRequest;
|
||||
|
||||
/* Include HelptopicUpdate for update validation*/
|
||||
use App\Http\Requests\HelptopicUpdate;
|
||||
|
||||
<?php
|
||||
namespace App\Http\Controllers\Admin;
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
/*Using Department Model*/
|
||||
use App\Model\Agent\Department;
|
||||
|
||||
/*Using Help_topic Model*/
|
||||
use App\Model\Manage\Help_topic;
|
||||
|
||||
/*Using Agents Model*/
|
||||
use App\Http\Requests\HelptopicRequest;
|
||||
use App\Http\Requests\HelptopicUpdate;
|
||||
use App\Model\Agent\Agents;
|
||||
|
||||
/*Using Sla_plan Model*/
|
||||
use App\Model\Manage\Sla_plan;
|
||||
|
||||
/*Using Forms Model*/
|
||||
use App\Model\Agent\Department;
|
||||
use App\Model\Form\Form_name;
|
||||
|
||||
/* Include Priority Model */
|
||||
use App\Model\Manage\Help_topic;
|
||||
use App\Model\Manage\Sla_plan;
|
||||
use App\Model\Utility\Priority;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* HelptopicController
|
||||
*
|
||||
* @package Controllers
|
||||
* @subpackage Controller
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class HelptopicController extends Controller {
|
||||
|
||||
/* constructor for authentication */
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
* @return type vodi
|
||||
*/
|
||||
public function __construct() {
|
||||
$this->middleware('auth');
|
||||
$this->middleware('roles');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return Response
|
||||
* @param type Help_topic $topic
|
||||
* @return type Response
|
||||
*/
|
||||
public function index(Help_topic $topic)
|
||||
{
|
||||
try
|
||||
{
|
||||
public function index(Help_topic $topic) {
|
||||
try {
|
||||
$topics = $topic->get();
|
||||
return view('themes.default1.admin.manage.helptopic.index',compact('topics'));
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
return view('themes.default1.admin.manage.helptopic.index', compact('topics'));
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return Response
|
||||
* @param type Priority $priority
|
||||
* @param type Department $department
|
||||
* @param type Help_topic $topic
|
||||
* @param type Form_name $form
|
||||
* @param type Agents $agent
|
||||
* @param type Sla_plan $sla
|
||||
* @return type Response
|
||||
*/
|
||||
/*
|
||||
================================================
|
||||
| Route to Create view file passing Model Values
|
||||
| 1.Department Model
|
||||
| 2.Help_topic Model
|
||||
| 3.Agents Model
|
||||
| 4.Sla_plan Model
|
||||
| 5.Forms Model
|
||||
================================================
|
||||
*/
|
||||
public function create(Priority $priority,Department $department, Help_topic $topic, Form_name $form, Agents $agent, Sla_plan $sla)
|
||||
{
|
||||
try
|
||||
{
|
||||
================================================
|
||||
| Route to Create view file passing Model Values
|
||||
| 1.Department Model
|
||||
| 2.Help_topic Model
|
||||
| 3.Agents Model
|
||||
| 4.Sla_plan Model
|
||||
| 5.Forms Model
|
||||
================================================
|
||||
*/
|
||||
public function create(Priority $priority, Department $department, Help_topic $topic, Form_name $form, Agents $agent, Sla_plan $sla) {
|
||||
try {
|
||||
$departments = $department->get();
|
||||
$topics = $topic->get();
|
||||
$forms = $form->get();
|
||||
$agents = $agent->get();
|
||||
$slas = $sla->get();
|
||||
$priority = $priority->get();
|
||||
|
||||
return view('themes.default1.admin.manage.helptopic.create',compact('priority','departments','topics','forms','agents','slas'));
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
return view('themes.default1.admin.manage.helptopic.create', compact('priority', 'departments', 'topics', 'forms', 'agents', 'slas'));
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @return Response
|
||||
* @param type Help_topic $topic
|
||||
* @param type HelptopicRequest $request
|
||||
* @return type Response
|
||||
*/
|
||||
public function store(Help_topic $topic, HelptopicRequest $request)
|
||||
{
|
||||
try
|
||||
{
|
||||
public function store(Help_topic $topic, HelptopicRequest $request) {
|
||||
try {
|
||||
/* Check whether function success or not */
|
||||
|
||||
if($topic->fill($request->input())->save()==true)
|
||||
{
|
||||
if ($topic->fill($request->input())->save() == true) {
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('helptopic')->with('success','Helptopic Created Successfully');
|
||||
}
|
||||
else
|
||||
{
|
||||
return redirect('helptopic')->with('success', 'Helptopic Created Successfully');
|
||||
} else {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('helptopic')->with('fails','Helptopic can not Create');
|
||||
return redirect('helptopic')->with('fails', 'Helptopic can not Create');
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
} catch (Exception $e) {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('helptopic')->with('fails','Helptopic can not Create');
|
||||
return redirect('helptopic')->with('fails', 'Helptopic can not Create');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -130,98 +104,79 @@ class HelptopicController extends Controller {
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
public function show($id) {
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
* @param type $id
|
||||
* @param type Priority $priority
|
||||
* @param type Department $department
|
||||
* @param type Help_topic $topic
|
||||
* @param type Form_name $form
|
||||
* @param type Agents $agent
|
||||
* @param type Sla_plan $sla
|
||||
* @return type Response
|
||||
*/
|
||||
public function edit($id,Priority $priority,Department $department, Help_topic $topic, Form_name $form, Agents $agent, Sla_plan $sla)
|
||||
{
|
||||
try
|
||||
{
|
||||
public function edit($id, Priority $priority, Department $department, Help_topic $topic, Form_name $form, Agents $agent, Sla_plan $sla) {
|
||||
try {
|
||||
$departments = $department->get();
|
||||
$topics = $topic->whereId($id)->first();
|
||||
$forms = $form->get();
|
||||
$agents = $agent->get();
|
||||
$slas = $sla->get();
|
||||
$priority = $priority->get();
|
||||
|
||||
return view('themes.default1.admin.manage.helptopic.edit',compact('priority','departments','topics','forms','agents','slas'));
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
return view('themes.default1.admin.manage.helptopic.edit', compact('priority', 'departments', 'topics', 'forms', 'agents', 'slas'));
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
* @param type $id
|
||||
* @param type Help_topic $topic
|
||||
* @param type HelptopicUpdate $request
|
||||
* @return type Response
|
||||
*/
|
||||
public function update($id, Help_topic $topic, HelptopicUpdate $request)
|
||||
{
|
||||
try
|
||||
{
|
||||
public function update($id, Help_topic $topic, HelptopicUpdate $request) {
|
||||
try {
|
||||
$topics = $topic->whereId($id)->first();
|
||||
|
||||
/* Check whether function success or not */
|
||||
|
||||
if($topics->fill($request->input())->save()==true)
|
||||
{
|
||||
if ($topics->fill($request->input())->save() == true) {
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('helptopic')->with('success','Helptopic Updated Successfully');
|
||||
}
|
||||
else
|
||||
{
|
||||
return redirect('helptopic')->with('success', 'Helptopic Updated Successfully');
|
||||
} else {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('helptopic')->with('fails','Helptopic can not Updated');
|
||||
return redirect('helptopic')->with('fails', 'Helptopic can not Updated');
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
} catch (Exception $e) {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('helptopic')->with('fails','Helptopic can not Create');
|
||||
return redirect('helptopic')->with('fails', 'Helptopic can not Create');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
* @param type int $id
|
||||
* @param type Help_topic $topic
|
||||
* @return type Response
|
||||
*/
|
||||
public function destroy($id, Help_topic $topic)
|
||||
{
|
||||
try
|
||||
{
|
||||
public function destroy($id, Help_topic $topic) {
|
||||
try {
|
||||
$topics = $topic->whereId($id)->first();
|
||||
|
||||
/* Check whether function success or not */
|
||||
|
||||
if($topics->delete()==true)
|
||||
{
|
||||
if ($topics->delete() == true) {
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('helptopic')->with('success','Helptopic Deleted Successfully');
|
||||
}
|
||||
else
|
||||
{
|
||||
return redirect('helptopic')->with('success', 'Helptopic Deleted Successfully');
|
||||
} else {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('helptopic')->with('fails','Helptopic can not Delete');
|
||||
return redirect('helptopic')->with('fails', 'Helptopic can not Delete');
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
} catch (Exception $e) {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('helptopic')->with('fails','Helptopic can not Create');
|
||||
return redirect('helptopic')->with('fails', 'Helptopic can not Create');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,25 +1,26 @@
|
||||
<?php namespace App\Http\Controllers\Admin;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin;
|
||||
|
||||
/**
|
||||
* -----------------------------------------------
|
||||
* HelptopicController
|
||||
* -----------------------------------------------
|
||||
* This controller renders your application's "dashboard" for users that
|
||||
* are authenticated. Of course, you are free to change or remove the
|
||||
* controller as you wish. It is just here to get your app started!
|
||||
*
|
||||
* @package Controllers
|
||||
* @subpackage Controller
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class HomeController extends Controller {
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Home Controller
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This controller renders your application's "dashboard" for users that
|
||||
| are authenticated. Of course, you are free to change or remove the
|
||||
| controller as you wish. It is just here to get your app started!
|
||||
|
|
||||
*/
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
public function __construct() {
|
||||
$this->middleware('auth');
|
||||
}
|
||||
|
||||
@@ -28,8 +29,7 @@ class HomeController extends Controller {
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
public function index() {
|
||||
return view('themes/default1/admin/dashboard');
|
||||
}
|
||||
|
||||
|
@@ -1,43 +1,37 @@
|
||||
<?php namespace App\Http\Controllers\Admin;
|
||||
|
||||
<?php
|
||||
namespace App\Http\Controllers\Admin;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Requests\ProfilePassword;
|
||||
|
||||
/* include guest_note model */
|
||||
use App\Http\Requests\ProfileRequest;
|
||||
|
||||
/* include User Model */
|
||||
/* include Help_topic Model */
|
||||
|
||||
/* Profile validator */
|
||||
use App\User;
|
||||
|
||||
/* Profile Password validator */
|
||||
|
||||
/* include ticket_thred model */
|
||||
use Auth;
|
||||
|
||||
/* include tickets model */
|
||||
|
||||
/* TicketRequest to validate the ticket response */
|
||||
use Hash;
|
||||
|
||||
/* Validate post check ticket */
|
||||
|
||||
use Input;
|
||||
|
||||
/**
|
||||
* ProfileController
|
||||
*
|
||||
* @package Controllers
|
||||
* @subpackage Controller
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class ProfileController extends Controller {
|
||||
|
||||
/* Define constructor for Authentication Checking */
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
* @return type void
|
||||
*/
|
||||
public function __construct() {
|
||||
$this->middleware('auth');
|
||||
$this->middleware('roles');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get profile page
|
||||
* @return type Response
|
||||
*/
|
||||
public function getProfile() {
|
||||
try
|
||||
{
|
||||
try {
|
||||
$user = Auth::user();
|
||||
if ($user) {
|
||||
return view('themes.default1.admin.profile', compact('user'));
|
||||
@@ -49,52 +43,54 @@ class ProfileController extends Controller {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Post profile page
|
||||
* @param type int $id
|
||||
* @param type ProfileRequest $request
|
||||
* @return type Response
|
||||
*/
|
||||
public function postProfile($id, ProfileRequest $request) {
|
||||
$user = Auth::user();
|
||||
$user->gender = $request->input('gender');
|
||||
$user->save();
|
||||
|
||||
if ($user->profile_pic == 'avatar5.png' || $user->profile_pic == 'avatar2.png') {
|
||||
if ($request->input('gender') == 1) {
|
||||
|
||||
$name = 'avatar5.png';
|
||||
$destinationPath = 'dist/img';
|
||||
$user->profile_pic = $name;
|
||||
} elseif ($request->input('gender') == 0) {
|
||||
|
||||
$name = 'avatar2.png';
|
||||
$destinationPath = 'dist/img';
|
||||
$user->profile_pic = $name;
|
||||
}
|
||||
}
|
||||
|
||||
if (Input::file('profile_pic')) {
|
||||
//$extension = Input::file('profile_pic')->getClientOriginalExtension();
|
||||
$name = Input::file('profile_pic')->getClientOriginalName();
|
||||
|
||||
$destinationPath = 'dist/img';
|
||||
$fileName = rand(0000, 9999) . '.' . $name;
|
||||
//echo $fileName;
|
||||
|
||||
Input::file('profile_pic')->move($destinationPath, $fileName);
|
||||
|
||||
$user->profile_pic = $fileName;
|
||||
|
||||
} else {
|
||||
$user->fill($request->except('profile_pic', 'gender'))->save();
|
||||
return redirect('guest')->with('success', 'Profile Updated sucessfully');
|
||||
|
||||
}
|
||||
|
||||
if ($user->fill($request->except('profile_pic'))->save()) {
|
||||
return redirect('guest')->with('success', 'Profile Updated sucessfully');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Post Profile password page
|
||||
* @param type int $id
|
||||
* @param type User $user
|
||||
* @param type ProfilePassword $request
|
||||
* @return type Response
|
||||
*/
|
||||
public function postProfilePassword($id, User $user, ProfilePassword $request) {
|
||||
$user = Auth::user();
|
||||
//echo $user->password;
|
||||
|
||||
if (Hash::check($request->input('old_password'), $user->getAuthPassword())) {
|
||||
$user->password = Hash::make($request->input('new_password'));
|
||||
$user->save();
|
||||
@@ -102,7 +98,5 @@ class ProfileController extends Controller {
|
||||
} else {
|
||||
return redirect('guest')->with('fails', 'Password was not Updated');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,72 +1,37 @@
|
||||
<?php namespace App\Http\Controllers\Admin;
|
||||
|
||||
<?php
|
||||
namespace App\Http\Controllers\Admin;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Requests\CompanyRequest;
|
||||
|
||||
/* include CompanyRequest for company validation */
|
||||
use App\Http\Requests\EmailRequest;
|
||||
|
||||
/* include Company Model */
|
||||
use App\Http\Requests\SystemRequest;
|
||||
|
||||
/* include System Model */
|
||||
use App\Model\Agent\Department;
|
||||
|
||||
/* Include SystemRequest for system validation */
|
||||
use App\Model\Email\Emails;
|
||||
|
||||
/* include Ticket Model */
|
||||
use App\Model\Email\Template;
|
||||
|
||||
/* include Email Model */
|
||||
use App\Model\Manage\Help_topic;
|
||||
|
||||
/* Include EmailRequest for email settings validation */
|
||||
use App\Model\Manage\Sla_plan;
|
||||
|
||||
/* include Access Model */
|
||||
use App\Model\Settings\Access;
|
||||
|
||||
/* include Responder Model */
|
||||
use App\Model\Settings\Alert;
|
||||
|
||||
/* include Alert Model */
|
||||
use App\Model\Settings\Company;
|
||||
|
||||
/* include Department Model */
|
||||
use App\Model\Settings\Email;
|
||||
|
||||
/* include Timezones Model */
|
||||
use App\Model\Settings\Responder;
|
||||
|
||||
/* include Sla_plan Model */
|
||||
use App\Model\Settings\System;
|
||||
|
||||
/* include Help_topic Model */
|
||||
use App\Model\Settings\Ticket;
|
||||
|
||||
/* include Template Model */
|
||||
use App\Model\Utility\Date_format;
|
||||
|
||||
/* include Emails Model */
|
||||
use App\Model\Utility\Date_time_format;
|
||||
|
||||
/* Include date_format model*/
|
||||
use App\Model\Utility\Logs;
|
||||
|
||||
/* Include Date_time_format model*/
|
||||
use App\Model\Utility\Priority;
|
||||
|
||||
/* Include Time_format model*/
|
||||
use App\Model\Utility\Timezones;
|
||||
|
||||
/* Include Logs Model */
|
||||
use App\Model\Utility\Time_format;
|
||||
|
||||
/* Include Priority Model */
|
||||
use Illuminate\Http\Request;
|
||||
use Input;
|
||||
|
||||
/**
|
||||
* SettingsController
|
||||
*
|
||||
* @package Controllers
|
||||
* @subpackage Controller
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class SettingsController extends Controller {
|
||||
|
||||
/**
|
||||
@@ -88,11 +53,9 @@ class SettingsController extends Controller {
|
||||
*
|
||||
*/
|
||||
public function getcompany(Company $company) {
|
||||
try
|
||||
{
|
||||
try {
|
||||
/* fetch the values of company from company table */
|
||||
$companys = $company->whereId('1')->first();
|
||||
|
||||
/* Direct to Company Settings Page */
|
||||
return view('themes.default1.admin.settings.company', compact('companys'));
|
||||
} catch (Exception $e) {
|
||||
@@ -103,29 +66,23 @@ class SettingsController extends Controller {
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @param type int $id
|
||||
* @param type Company $company
|
||||
* @param type CompanyRequest $request *
|
||||
* @return Response
|
||||
*/
|
||||
public function postcompany($id, Company $company, CompanyRequest $request) {
|
||||
try
|
||||
{
|
||||
try {
|
||||
/* fetch the values of company request */
|
||||
$companys = $company->whereId('1')->first();
|
||||
|
||||
if (Input::file('logo')) {
|
||||
$name = Input::file('logo')->getClientOriginalName();
|
||||
|
||||
$destinationPath = 'dist';
|
||||
$fileName = rand(0000, 9999) . '.' . $name;
|
||||
//echo $fileName;
|
||||
|
||||
Input::file('logo')->move($destinationPath, $fileName);
|
||||
|
||||
$companys->logo = $fileName;
|
||||
}
|
||||
|
||||
/* Check whether function success or not */
|
||||
|
||||
if ($companys->fill($request->except('logo'))->save() == true) {
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('getcompany')->with('success', 'Company Updated Successfully');
|
||||
@@ -137,29 +94,27 @@ class SettingsController extends Controller {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('getcompany')->with('fails', 'Company can not Updated');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @return Response
|
||||
* @param $system instance of System table
|
||||
*
|
||||
* get the form for System setting page
|
||||
*
|
||||
* @param type System $system
|
||||
* @param type Department $department
|
||||
* @param type Timezones $timezone
|
||||
* @param type Date_format $date
|
||||
* @param type Date_time_format $date_time
|
||||
* @param type Time_format $time
|
||||
* @param type Logs $log
|
||||
* @return type Response
|
||||
*/
|
||||
public function getsystem(System $system, Department $department, Timezones $timezone, Date_format $date, Date_time_format $date_time, Time_format $time, Logs $log) {
|
||||
try
|
||||
{
|
||||
try {
|
||||
/* fetch the values of system from system table */
|
||||
$systems = $system->whereId('1')->first();
|
||||
|
||||
/* Fetch the values from Department table */
|
||||
$departments = $department->get();
|
||||
|
||||
/* Fetch the values from Timezones table */
|
||||
$timezones = $timezone->get();
|
||||
|
||||
/* Direct to System Settings Page */
|
||||
return view('themes.default1.admin.settings.system', compact('systems', 'departments', 'timezones', 'time', 'date', 'date_time', 'log'));
|
||||
} catch (Exception $e) {
|
||||
@@ -169,21 +124,18 @@ class SettingsController extends Controller {
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
* @param type int $id
|
||||
* @param type System $system
|
||||
* @param type SystemRequest $request
|
||||
* @return type Response
|
||||
*/
|
||||
public function postsystem($id, System $system, SystemRequest $request) {
|
||||
try
|
||||
{
|
||||
try {
|
||||
/* fetch the values of system request */
|
||||
$systems = $system->whereId('1')->first();
|
||||
|
||||
/* fill the values to coompany table */
|
||||
/* Check whether function success or not */
|
||||
|
||||
//dd($request);
|
||||
|
||||
if ($systems->fill($request->input())->save() == true) {
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('getsystem')->with('success', 'System Updated Successfully');
|
||||
@@ -195,29 +147,24 @@ class SettingsController extends Controller {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('getsystem')->with('fails', 'System can not Updated');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @return Response
|
||||
* @param $ticket instance of Ticket table
|
||||
*
|
||||
* get the form for Ticket setting page
|
||||
*
|
||||
* @param type Ticket $ticket
|
||||
* @param type Sla_plan $sla
|
||||
* @param type Help_topic $topic
|
||||
* @param type Priority $priority
|
||||
* @return type Response
|
||||
*/
|
||||
public function getticket(Ticket $ticket, Sla_plan $sla, Help_topic $topic, Priority $priority) {
|
||||
try
|
||||
{
|
||||
try {
|
||||
/* fetch the values of ticket from ticket table */
|
||||
$tickets = $ticket->whereId('1')->first();
|
||||
|
||||
/* Fetch the values from SLA Plan table */
|
||||
$slas = $sla->get();
|
||||
|
||||
/* Fetch the values from Help_topic table */
|
||||
$topics = $topic->get();
|
||||
|
||||
/* Direct to Ticket Settings Page */
|
||||
return view('themes.default1.admin.settings.ticket', compact('tickets', 'slas', 'topics', 'priority'));
|
||||
} catch (Exception $e) {
|
||||
@@ -227,36 +174,26 @@ class SettingsController extends Controller {
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
* @param type int $id
|
||||
* @param type Ticket $ticket
|
||||
* @param type Request $request
|
||||
* @return type Response
|
||||
*/
|
||||
public function postticket($id, Ticket $ticket, Request $request) {
|
||||
try
|
||||
{
|
||||
try {
|
||||
/* fetch the values of ticket request */
|
||||
$tickets = $ticket->whereId('1')->first();
|
||||
|
||||
/* fill the values to coompany table */
|
||||
$tickets->fill($request->except('captcha', 'claim_response', 'assigned_ticket', 'answered_ticket', 'agent_mask', 'html', 'client_update'))->save();
|
||||
|
||||
/* insert checkbox to Database */
|
||||
$tickets->captcha = $request->input('captcha');
|
||||
|
||||
$tickets->claim_response = $request->input('claim_response');
|
||||
|
||||
$tickets->assigned_ticket = $request->input('assigned_ticket');
|
||||
|
||||
$tickets->answered_ticket = $request->input('answered_ticket');
|
||||
|
||||
$tickets->agent_mask = $request->input('agent_mask');
|
||||
|
||||
$tickets->html = $request->input('html');
|
||||
|
||||
$tickets->client_update = $request->input('client_update');
|
||||
|
||||
/* Check whether function success or not */
|
||||
|
||||
if ($tickets->save() == true) {
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('getticket')->with('success', 'Ticket Updated Successfully');
|
||||
@@ -268,30 +205,23 @@ class SettingsController extends Controller {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('getticket')->with('fails', 'Ticket can not Updated');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @return Response
|
||||
* @param $email instance of Email table
|
||||
*
|
||||
* get the form for Email setting page
|
||||
*
|
||||
* @param type Email $email
|
||||
* @param type Template $template
|
||||
* @param type Emails $email1
|
||||
* @return type Response
|
||||
*/
|
||||
|
||||
public function getemail(Email $email, Template $template, Emails $email1) {
|
||||
try
|
||||
{
|
||||
try {
|
||||
/* fetch the values of email from Email table */
|
||||
$emails = $email->whereId('1')->first();
|
||||
|
||||
/* Fetch the values from Template table */
|
||||
$templates = $template->get();
|
||||
|
||||
/* Fetch the values from Emails table */
|
||||
$emails1 = $email1->get();
|
||||
|
||||
/* Direct to Email Settings Page */
|
||||
return view('themes.default1.admin.settings.email', compact('emails', 'templates', 'emails1'));
|
||||
} catch (Exception $e) {
|
||||
@@ -301,32 +231,24 @@ class SettingsController extends Controller {
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
* @param type int $id
|
||||
* @param type Email $email
|
||||
* @param type EmailRequest $request
|
||||
* @return type Response
|
||||
*/
|
||||
public function postemail($id, Email $email, EmailRequest $request) {
|
||||
try
|
||||
{
|
||||
try {
|
||||
/* fetch the values of email request */
|
||||
$emails = $email->whereId('1')->first();
|
||||
|
||||
/* fill the values to email table */
|
||||
$emails->fill($request->except('email_fetching', 'all_emails', 'email_collaborator', 'strip', 'attachment'))->save();
|
||||
|
||||
/* insert checkboxes to database */
|
||||
$emails->email_fetching = $request->input('email_fetching');
|
||||
|
||||
$emails->all_emails = $request->input('all_emails');
|
||||
|
||||
$emails->email_collaborator = $request->input('email_collaborator');
|
||||
|
||||
$emails->strip = $request->input('strip');
|
||||
|
||||
$emails->attachment = $request->input('attachment');
|
||||
|
||||
/* Check whether function success or not */
|
||||
|
||||
if ($emails->save() == true) {
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('getemail')->with('success', 'Email Updated Successfully');
|
||||
@@ -338,24 +260,17 @@ class SettingsController extends Controller {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('getemail')->with('fails', 'Email can not Updated');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @return Response
|
||||
* @param $access instance of Access table
|
||||
*
|
||||
* get the form for Access setting page
|
||||
*
|
||||
* @param type Access $access
|
||||
* @return type Response
|
||||
*/
|
||||
|
||||
public function getaccess(Access $access) {
|
||||
try
|
||||
{
|
||||
try {
|
||||
/* fetch the values of access from access table */
|
||||
$accesses = $access->whereId('1')->first();
|
||||
|
||||
/* Direct to Access Settings Page */
|
||||
return view('themes.default1.admin.settings.access', compact('accesses'));
|
||||
} catch (Exception $e) {
|
||||
@@ -365,30 +280,22 @@ class SettingsController extends Controller {
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
* @param type Access $access
|
||||
* @param type Request $request
|
||||
* @return type Response
|
||||
*/
|
||||
public function postaccess(Access $access, Request $request) {
|
||||
try
|
||||
{
|
||||
try {
|
||||
/* fetch the values of access request */
|
||||
$accesses = $access->whereId('1')->first();
|
||||
|
||||
/* fill the values to access table */
|
||||
$accesses->fill($request->except('password_reset', 'bind_agent_ip', 'reg_require', 'quick_access'))->save();
|
||||
|
||||
/* insert checkbox value to DB */
|
||||
$accesses->password_reset = $request->input('password_reset');
|
||||
|
||||
$accesses->bind_agent_ip = $request->input('bind_agent_ip');
|
||||
|
||||
$accesses->reg_require = $request->input('reg_require');
|
||||
|
||||
$accesses->quick_access = $request->input('quick_access');
|
||||
|
||||
/* Check whether function success or not */
|
||||
|
||||
if ($accesses->save() == true) {
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('getaccess')->with('success', 'Access Updated Successfully');
|
||||
@@ -400,24 +307,17 @@ class SettingsController extends Controller {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('getaccess')->with('fails', 'Access can not Updated');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @return Response
|
||||
* @param $responder instance of Responder table
|
||||
*
|
||||
* get the form for Responder setting page
|
||||
*
|
||||
* @param type Responder $responder
|
||||
* @return type Response
|
||||
*/
|
||||
|
||||
public function getresponder(Responder $responder) {
|
||||
try
|
||||
{
|
||||
try {
|
||||
/* fetch the values of responder from responder table */
|
||||
$responders = $responder->whereId('1')->first();
|
||||
|
||||
/* Direct to Responder Settings Page */
|
||||
return view('themes.default1.admin.settings.responder', compact('responders'));
|
||||
} catch (Exception $e) {
|
||||
@@ -427,30 +327,22 @@ class SettingsController extends Controller {
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
* @param type Responder $responder
|
||||
* @param type Request $request
|
||||
* @return type
|
||||
*/
|
||||
public function postresponder(Responder $responder, Request $request) {
|
||||
try
|
||||
{
|
||||
try {
|
||||
/* fetch the values of responder request */
|
||||
$responders = $responder->whereId('1')->first();
|
||||
|
||||
/* insert Checkbox value to DB */
|
||||
$responders->new_ticket = $request->input('new_ticket');
|
||||
|
||||
$responders->agent_new_ticket = $request->input('agent_new_ticket');
|
||||
|
||||
$responders->submitter = $request->input('submitter');
|
||||
|
||||
$responders->partcipants = $request->input('partcipants');
|
||||
|
||||
$responders->overlimit = $request->input('overlimit');
|
||||
|
||||
/* fill the values to coompany table */
|
||||
/* Check whether function success or not */
|
||||
|
||||
if ($responders->save() == true) {
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('getresponder')->with('success', 'Responder Updated Successfully');
|
||||
@@ -462,24 +354,17 @@ class SettingsController extends Controller {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('getresponder')->with('fails', 'Responder can not Updated');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @return Response
|
||||
* @param $alert instance of Alert table
|
||||
*
|
||||
* get the form for Alert setting page
|
||||
*
|
||||
* @param type Alert $alert
|
||||
* @return type Response
|
||||
*/
|
||||
|
||||
public function getalert(Alert $alert) {
|
||||
try
|
||||
{
|
||||
try {
|
||||
/* fetch the values of alert from alert table */
|
||||
$alerts = $alert->whereId('1')->first();
|
||||
|
||||
/* Direct to Alert Settings Page */
|
||||
return view('themes.default1.admin.settings.alert', compact('alerts'));
|
||||
} catch (Exception $e) {
|
||||
@@ -489,78 +374,47 @@ class SettingsController extends Controller {
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
* @param type $id
|
||||
* @param type Alert $alert
|
||||
* @param type Request $request
|
||||
* @return type Response
|
||||
*/
|
||||
public function postalert($id, Alert $alert, Request $request) {
|
||||
try
|
||||
{
|
||||
try {
|
||||
/* fetch the values of alert request */
|
||||
$alerts = $alert->whereId('1')->first();
|
||||
|
||||
/* Insert Checkbox to DB */
|
||||
$alerts->assignment_status = $request->input('assignment_status');
|
||||
|
||||
$alerts->ticket_status = $request->input('ticket_status');
|
||||
|
||||
$alerts->overdue_department_member = $request->input('overdue_department_member');
|
||||
|
||||
$alerts->sql_error = $request->input('sql_error');
|
||||
|
||||
$alerts->excessive_failure = $request->input('excessive_failure');
|
||||
|
||||
$alerts->overdue_status = $request->input('overdue_status');
|
||||
|
||||
$alerts->overdue_assigned_agent = $request->input('overdue_assigned_agent');
|
||||
|
||||
$alerts->overdue_department_manager = $request->input('overdue_department_manager');
|
||||
|
||||
$alerts->internal_status = $request->input('internal_status');
|
||||
|
||||
$alerts->internal_last_responder = $request->input('internal_last_responder');
|
||||
|
||||
$alerts->internal_assigned_agent = $request->input('internal_assigned_agent');
|
||||
|
||||
$alerts->internal_department_manager = $request->input('internal_department_manager');
|
||||
|
||||
$alerts->assignment_assigned_agent = $request->input('assignment_assigned_agent');
|
||||
|
||||
$alerts->assignment_team_leader = $request->input('assignment_team_leader');
|
||||
|
||||
$alerts->assignment_team_member = $request->input('assignment_team_member');
|
||||
|
||||
$alerts->system_error = $request->input('system_error');
|
||||
|
||||
$alerts->transfer_department_member = $request->input('transfer_department_member');
|
||||
|
||||
$alerts->transfer_department_manager = $request->input('transfer_department_manager');
|
||||
|
||||
$alerts->transfer_assigned_agent = $request->input('transfer_assigned_agent');
|
||||
|
||||
$alerts->transfer_status = $request->input('transfer_status');
|
||||
|
||||
$alerts->message_organization_accmanager = $request->input('message_organization_accmanager');
|
||||
|
||||
$alerts->message_department_manager = $request->input('message_department_manager');
|
||||
|
||||
$alerts->message_assigned_agent = $request->input('message_assigned_agent');
|
||||
|
||||
$alerts->message_last_responder = $request->input('message_last_responder');
|
||||
|
||||
$alerts->message_status = $request->input('message_status');
|
||||
|
||||
$alerts->ticket_organization_accmanager = $request->input('ticket_organization_accmanager');
|
||||
|
||||
$alerts->ticket_department_manager = $request->input('ticket_department_manager');
|
||||
|
||||
$alerts->ticket_department_member = $request->input('ticket_department_member');
|
||||
|
||||
$alerts->ticket_admin_email = $request->input('ticket_admin_email');
|
||||
|
||||
/* fill the values to coompany table */
|
||||
/* Check whether function success or not */
|
||||
|
||||
if ($alerts->save() == true) {
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('getalert')->with('success', 'Alert Updated Successfully');
|
||||
@@ -572,11 +426,9 @@ class SettingsController extends Controller {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('getalert')->with('fails', 'Alert can not Updated');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function getck() {
|
||||
return view('themes.default1.ckeditor');
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,97 +1,77 @@
|
||||
<?php namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Http\Requests;
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
/* include Sla_plan Model */
|
||||
use App\Http\Requests\SlaRequest;
|
||||
use App\Http\Requests\SlaUpdate;
|
||||
use App\Model\Manage\Sla_plan;
|
||||
|
||||
/* Include SlaRequest */
|
||||
use App\Http\Requests\SlaRequest;
|
||||
|
||||
/* Include SlaUpdate */
|
||||
use App\Http\Requests\SlaUpdate;
|
||||
|
||||
/**
|
||||
* SlaController
|
||||
*
|
||||
* @package Controllers
|
||||
* @subpackage Controller
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class SlaController extends Controller {
|
||||
|
||||
/* constructor for authentication */
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
* @return type void
|
||||
*/
|
||||
public function __construct() {
|
||||
$this->middleware('auth');
|
||||
$this->middleware('roles');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return Response
|
||||
* @param type Sla_plan $sla
|
||||
* @return type Response
|
||||
*/
|
||||
public function index(Sla_plan $sla)
|
||||
{
|
||||
try
|
||||
{
|
||||
public function index(Sla_plan $sla) {
|
||||
try {
|
||||
/* Declare a Variable $slas to store all Values From Sla_plan Table */
|
||||
$slas = $sla->get();
|
||||
|
||||
/* Listing the values From Sla_plan Table */
|
||||
return view('themes.default1.admin.manage.sla.index',compact('slas'));
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
return view('themes.default1.admin.manage.sla.index', compact('slas'));
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return Response
|
||||
* @return type Response
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
try
|
||||
{
|
||||
public function create() {
|
||||
try {
|
||||
/* Direct to Create Page */
|
||||
return view('themes.default1.admin.manage.sla.create');
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @return Response
|
||||
* @param type Sla_plan $sla
|
||||
* @param type SlaRequest $request
|
||||
* @return type Response
|
||||
*/
|
||||
public function store(Sla_plan $sla, SlaRequest $request)
|
||||
{
|
||||
try
|
||||
{
|
||||
public function store(Sla_plan $sla, SlaRequest $request) {
|
||||
try {
|
||||
/* Fill the request values to Sla_plan Table */
|
||||
/* Check whether function success or not */
|
||||
|
||||
if($sla->fill($request->input())->save()==true)
|
||||
|
||||
{
|
||||
if ($sla->fill($request->input())->save() == true) {
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('sla')->with('success','SLA Plan Created Successfully');
|
||||
}
|
||||
else
|
||||
{
|
||||
return redirect('sla')->with('success', 'SLA Plan Created Successfully');
|
||||
} else {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('sla')->with('fails','SLA Plan can not Create');
|
||||
return redirect('sla')->with('fails', 'SLA Plan can not Create');
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
} catch (Exception $e) {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('sla')->with('fails','SLA Plan can not Create');
|
||||
return redirect('sla')->with('fails', 'SLA Plan can not Create');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -100,104 +80,79 @@ class SlaController extends Controller {
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
public function show($id) {
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
* @param type int $id
|
||||
* @param type Sla_plan $sla
|
||||
* @return type Response
|
||||
*/
|
||||
public function edit($id, Sla_plan $sla)
|
||||
{
|
||||
try
|
||||
{
|
||||
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.manage.sla.edit',compact('slas'));
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
return view('themes.default1.admin.manage.sla.edit', compact('slas'));
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
* @param type int $id
|
||||
* @param type Sla_plan $sla
|
||||
* @param type SlaUpdate $request
|
||||
* @return type Response
|
||||
*/
|
||||
public function update($id, Sla_plan $sla, SlaUpdate $request)
|
||||
{
|
||||
try
|
||||
{
|
||||
public function update($id, Sla_plan $sla, SlaUpdate $request) {
|
||||
try {
|
||||
/* Fill values to selected field using Id except Check box */
|
||||
$slas = $sla->whereId($id)->first();
|
||||
$slas->fill($request->except('transient','ticket_overdue'))->save();
|
||||
|
||||
$slas->fill($request->except('transient', 'ticket_overdue'))->save();
|
||||
/* Update transient checkox field */
|
||||
$slas->transient=$request->input('transient');
|
||||
|
||||
$slas->transient = $request->input('transient');
|
||||
/* Update ticket_overdue checkox field */
|
||||
$slas->ticket_overdue=$request->input('ticket_overdue');
|
||||
|
||||
$slas->ticket_overdue = $request->input('ticket_overdue');
|
||||
/* Check whether function success or not */
|
||||
|
||||
if($slas->save()==true)
|
||||
{
|
||||
if ($slas->save() == true) {
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('sla')->with('success','SLA Plan Updated Successfully');
|
||||
}
|
||||
else
|
||||
{
|
||||
return redirect('sla')->with('success', 'SLA Plan Updated Successfully');
|
||||
} else {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('sla')->with('fails','SLA Plan can not Update');
|
||||
return redirect('sla')->with('fails', 'SLA Plan can not Update');
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
} catch (Exception $e) {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('sla')->with('fails','SLA Plan can not Update');
|
||||
return redirect('sla')->with('fails', 'SLA Plan can not Update');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
* @param type int $id
|
||||
* @param type Sla_plan $sla
|
||||
* @return type Response
|
||||
*/
|
||||
public function destroy($id, Sla_plan $sla)
|
||||
{
|
||||
try
|
||||
{
|
||||
public function destroy($id, Sla_plan $sla) {
|
||||
try {
|
||||
/* Delete a perticular field from the database by delete() using Id */
|
||||
$slas = $sla->whereId($id)->first();
|
||||
/* Check whether function success or not */
|
||||
|
||||
if($slas->delete()==true)
|
||||
{
|
||||
if ($slas->delete() == true) {
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('sla')->with('success','SLA Plan Deleted Successfully');
|
||||
}
|
||||
else
|
||||
{
|
||||
return redirect('sla')->with('success', 'SLA Plan Deleted Successfully');
|
||||
} else {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('sla')->with('fails','SLA Plan can not Delete');
|
||||
return redirect('sla')->with('fails', 'SLA Plan can not Delete');
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
} catch (Exception $e) {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('sla')->with('fails','SLA Plan can not Delete');
|
||||
return redirect('sla')->with('fails', 'SLA Plan can not Delete');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,42 +1,40 @@
|
||||
<?php namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Http\Requests\TeamRequest;
|
||||
|
||||
/* include TeamUpdate request for update validation */
|
||||
use App\Http\Requests\TeamUpdate;
|
||||
|
||||
<?php
|
||||
namespace App\Http\Controllers\Admin;
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Model\Agent\Teams;
|
||||
use App\Model\Agent\Agents;
|
||||
|
||||
use App\Http\Requests\TeamRequest;
|
||||
use App\Http\Requests\TeamUpdate;
|
||||
use App\Model\Agent\Assign_team_agent;
|
||||
|
||||
use App\Model\Agent\Teams;
|
||||
use App\User;
|
||||
|
||||
/**
|
||||
* TeamController
|
||||
*
|
||||
* @package Controllers
|
||||
* @subpackage Controller
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class TeamController extends Controller {
|
||||
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return Response
|
||||
* Create a new controller instance.
|
||||
* @return type void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
public function __construct() {
|
||||
$this->middleware('auth');
|
||||
$this->middleware('roles');
|
||||
}
|
||||
public function index(Teams $team, Assign_team_agent $assign_team_agent)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
/**
|
||||
* get Index page
|
||||
* @param type Teams $team
|
||||
* @param type Assign_team_agent $assign_team_agent
|
||||
* @return type Response
|
||||
*/
|
||||
public function index(Teams $team, Assign_team_agent $assign_team_agent) {
|
||||
try {
|
||||
$teams = $team->get();
|
||||
|
||||
/* find out the Number of Members in the Team */
|
||||
|
||||
$id = $teams->lists('id');
|
||||
$assign_team_agent = $assign_team_agent->get();
|
||||
//dd($id);
|
||||
@@ -45,62 +43,46 @@ class TeamController extends Controller {
|
||||
// $assign_team_agent = $assign_team_agent->where('team_id',$i);
|
||||
// dd($assign_team_agent);
|
||||
// }
|
||||
|
||||
return view('themes.default1.admin.agent.teams.index', compact('assign_team_agent','teams'));
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
return view('themes.default1.admin.agent.teams.index', compact('assign_team_agent', 'teams'));
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return Response
|
||||
* @param type User $user
|
||||
* @return type Response
|
||||
*/
|
||||
public function create(User $user)
|
||||
{
|
||||
try
|
||||
{
|
||||
public function create(User $user) {
|
||||
try {
|
||||
$user = $user->get();
|
||||
return view('themes.default1.admin.agent.teams.create',compact('user'));
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
return view('themes.default1.admin.agent.teams.create', compact('user'));
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @return Response
|
||||
* @param type Teams $team
|
||||
* @param type TeamRequest $request
|
||||
* @return type Response
|
||||
*/
|
||||
public function store(Teams $team,TeamRequest $request)
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
public function store(Teams $team, TeamRequest $request) {
|
||||
try {
|
||||
/* Check whether function success or not */
|
||||
|
||||
if($team -> fill($request->input())->save()==true)
|
||||
{
|
||||
if ($team->fill($request->input())->save() == true) {
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('teams')->with('success','Teams Created Successfully');
|
||||
}
|
||||
else
|
||||
{
|
||||
return redirect('teams')->with('success', 'Teams Created Successfully');
|
||||
} else {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('teams')->with('fails','Teams can not Create');
|
||||
return redirect('teams')->with('fails', 'Teams can not Create');
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
} catch (Exception $e) {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('teams')->with('fails','Teams can not Create');
|
||||
return redirect('teams')->with('fails', 'Teams can not Create');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -109,30 +91,27 @@ class TeamController extends Controller {
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
public function show($id) {
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
* @param type $id
|
||||
* @param type User $user
|
||||
* @param type Assign_team_agent $assign_team_agent
|
||||
* @param type Teams $team
|
||||
* @return type Response
|
||||
*/
|
||||
public function edit($id,User $user,Assign_team_agent $assign_team_agent,Teams $team)
|
||||
{
|
||||
try
|
||||
{
|
||||
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();
|
||||
//$allagents = $agent->get();
|
||||
|
||||
|
||||
/* Gettting member of the team */
|
||||
$agent_team = $assign_team_agent->where('team_id',$id)->get();
|
||||
$agent_team = $assign_team_agent->where('team_id', $id)->get();
|
||||
//dd($agent_team);
|
||||
$agent_id = $agent_team->lists('agent_id','agent_id');
|
||||
$agent_id = $agent_team->lists('agent_id', 'agent_id');
|
||||
// dd($agent_id);
|
||||
//$id = $agent->lists('id');
|
||||
//dd($id);
|
||||
@@ -142,88 +121,63 @@ class TeamController extends Controller {
|
||||
// echo $agent;
|
||||
// //
|
||||
// }
|
||||
|
||||
|
||||
|
||||
return view('themes.default1.admin.agent.teams.edit', compact('agent_id','user','teams','allagents'));
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
return view('themes.default1.admin.agent.teams.edit', compact('agent_id', 'user', 'teams', 'allagents'));
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
* @param type int $id
|
||||
* @param type Teams $team
|
||||
* @param type TeamUpdate $request
|
||||
* @return type Response
|
||||
*/
|
||||
public function update($id,Teams $team, TeamUpdate $request)
|
||||
{
|
||||
try
|
||||
{
|
||||
public function update($id, Teams $team, TeamUpdate $request) {
|
||||
try {
|
||||
$teams = $team->whereId($id)->first();
|
||||
//updating check box
|
||||
$alert = $request->input('assign_alert');
|
||||
$teams->assign_alert=$alert;
|
||||
$teams->save();//saving check box
|
||||
$teams->assign_alert = $alert;
|
||||
$teams->save(); //saving check box
|
||||
//updating whole field
|
||||
|
||||
/* Check whether function success or not */
|
||||
|
||||
if($teams->fill($request->input())->save()==true)
|
||||
{
|
||||
if ($teams->fill($request->input())->save() == true) {
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('teams')->with('success','Teams Updated Successfully');
|
||||
}
|
||||
else
|
||||
{
|
||||
return redirect('teams')->with('success', 'Teams Updated Successfully');
|
||||
} else {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('teams')->with('fails','Teams can not Update');
|
||||
return redirect('teams')->with('fails', 'Teams can not Update');
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
} catch (Exception $e) {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('teams')->with('fails','Teams can not Update');
|
||||
return redirect('teams')->with('fails', 'Teams can not Update');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
* @param type int $id
|
||||
* @param type Teams $team
|
||||
* @param type Assign_team_agent $assign_team_agent
|
||||
* @return type Response
|
||||
*/
|
||||
public function destroy($id, Teams $team, Assign_team_agent $assign_team_agent)
|
||||
{
|
||||
try
|
||||
{
|
||||
$assign_team_agent->where('team_id',$id)->delete();
|
||||
|
||||
public function destroy($id, Teams $team, Assign_team_agent $assign_team_agent) {
|
||||
try {
|
||||
$assign_team_agent->where('team_id', $id)->delete();
|
||||
$teams = $team->whereId($id)->first();
|
||||
|
||||
/* Check whether function success or not */
|
||||
|
||||
if($teams->delete()==true)
|
||||
{
|
||||
if ($teams->delete() == true) {
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('teams')->with('success','Teams Deleted Successfully');
|
||||
}
|
||||
else
|
||||
{
|
||||
return redirect('teams')->with('success', 'Teams Deleted Successfully');
|
||||
} else {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('teams')->with('fails','Teams can not Delete');
|
||||
return redirect('teams')->with('fails', 'Teams can not Delete');
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
} catch (Exception $e) {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('teams')->with('fails','Teams can not Delete');
|
||||
return redirect('teams')->with('fails', 'Teams can not Delete');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,91 +1,82 @@
|
||||
<?php namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Http\Requests\TemplateRequest;
|
||||
use App\Http\Requests\DiagnoRequest;
|
||||
<?php
|
||||
namespace App\Http\Controllers\Admin;
|
||||
use App\Http\Controllers\Controller;
|
||||
/* include TemplateUpdate request for update validation */
|
||||
use App\Http\Requests\TemplateRequest;
|
||||
use App\Http\Requests\TemplateUdate;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Model\Email\Emails;
|
||||
use App\Model\Email\Template;
|
||||
use App\Model\Utility\Languages;
|
||||
use App\Model\Email\Emails;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Mail;
|
||||
|
||||
/**
|
||||
* TemplateController
|
||||
*
|
||||
* @package Controllers
|
||||
* @subpackage Controller
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class TemplateController extends Controller {
|
||||
|
||||
/* constructor for authentication */
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
* @return type void
|
||||
*/
|
||||
public function __construct() {
|
||||
$this->middleware('auth');
|
||||
$this->middleware('roles');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return Response
|
||||
* @param type Template $template
|
||||
* @return type Response
|
||||
*/
|
||||
public function index(Template $template)
|
||||
{
|
||||
try
|
||||
{
|
||||
public function index(Template $template) {
|
||||
try {
|
||||
$templates = $template->get();
|
||||
return view('themes.default1.admin.emails.template.index',compact('templates'));
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
return view('themes.default1.admin.emails.template.index', compact('templates'));
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return Response
|
||||
* @param type Languages $language
|
||||
* @param type Template $template
|
||||
* @return type Response
|
||||
*/
|
||||
public function create(Languages $language, Template $template )
|
||||
{
|
||||
try
|
||||
{
|
||||
public function create(Languages $language, Template $template) {
|
||||
try {
|
||||
$templates = $template->get();
|
||||
$languages = $language->get();
|
||||
return view('themes.default1.admin.emails.template.create',compact('languages','templates'));
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
return view('themes.default1.admin.emails.template.create', compact('languages', 'templates'));
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @return Response
|
||||
* @param type Template $template
|
||||
* @param type TemplateRequest $request
|
||||
* @return type Response
|
||||
*/
|
||||
public function store(Template $template, TemplateRequest $request)
|
||||
{
|
||||
try
|
||||
{
|
||||
public function store(Template $template, TemplateRequest $request) {
|
||||
try {
|
||||
/* Check whether function success or not */
|
||||
|
||||
if($template->fill($request->input())->save()==true)
|
||||
{
|
||||
if ($template->fill($request->input())->save() == true) {
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('template')->with('success','Teams Created Successfully');
|
||||
}
|
||||
else
|
||||
{
|
||||
return redirect('template')->with('success', 'Teams Created Successfully');
|
||||
} else {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('template')->with('fails','Teams can not Create');
|
||||
return redirect('template')->with('fails', 'Teams can not Create');
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
} catch (Exception $e) {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('template')->with('fails','Teams can not Create');
|
||||
return redirect('template')->with('fails', 'Teams can not Create');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -94,132 +85,100 @@ class TemplateController extends Controller {
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
public function show($id) {
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
* @param type $id
|
||||
* @param type Template $template
|
||||
* @param type Languages $language
|
||||
* @return type Response
|
||||
*/
|
||||
public function edit($id, Template $template, Languages $language)
|
||||
{
|
||||
try
|
||||
{
|
||||
public function edit($id, Template $template, Languages $language) {
|
||||
try {
|
||||
$templates = $template->whereId($id)->first();
|
||||
$languages = $language->get();
|
||||
return view('themes.default1.admin.emails.template.edit',compact('templates','languages'));
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
return view('themes.default1.admin.emails.template.edit', compact('templates', 'languages'));
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
* @param type int $id
|
||||
* @param type Template $template
|
||||
* @param type TemplateUdate $request
|
||||
* @return type Response
|
||||
*/
|
||||
public function update($id, Template $template, TemplateUdate $request)
|
||||
{
|
||||
try
|
||||
{
|
||||
public function update($id, Template $template, TemplateUdate $request) {
|
||||
try {
|
||||
//TODO validation
|
||||
$templates = $template->whereId($id)->first();
|
||||
|
||||
/* Check whether function success or not */
|
||||
|
||||
if($templates->fill($request->input())->save()==true)
|
||||
{
|
||||
if ($templates->fill($request->input())->save() == true) {
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('template')->with('success','Teams Updated Successfully');
|
||||
}
|
||||
else
|
||||
{
|
||||
return redirect('template')->with('success', 'Teams Updated Successfully');
|
||||
} else {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('template')->with('fails','Teams can not Update');
|
||||
return redirect('template')->with('fails', 'Teams can not Update');
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
} catch (Exception $e) {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('template')->with('fails','Teams can not Update');
|
||||
return redirect('template')->with('fails', 'Teams can not Update');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
* @param type int $id
|
||||
* @param type Template $template
|
||||
* @return type Response
|
||||
*/
|
||||
public function destroy($id, Template $template)
|
||||
{
|
||||
try
|
||||
{
|
||||
public function destroy($id, Template $template) {
|
||||
try {
|
||||
$templates = $template->whereId($id)->first();
|
||||
|
||||
/* Check whether function success or not */
|
||||
|
||||
if($templates->delete()==true)
|
||||
{
|
||||
if ($templates->delete() == true) {
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('template')->with('success','Teams Deleted Successfully');
|
||||
}
|
||||
else
|
||||
{
|
||||
return redirect('template')->with('success', 'Teams Deleted Successfully');
|
||||
} else {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('template')->with('fails','Teams can not Delete');
|
||||
return redirect('template')->with('fails', 'Teams can not Delete');
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
} catch (Exception $e) {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('template')->with('fails','Teams can not Delete');
|
||||
return redirect('template')->with('fails', 'Teams can not Delete');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Form for Email connection checking.
|
||||
*
|
||||
* @param
|
||||
* @return Response
|
||||
* @param type Emails $email
|
||||
* @return type Response
|
||||
*/
|
||||
public function formDiagno(Emails $email)
|
||||
{
|
||||
try
|
||||
{
|
||||
public function formDiagno(Emails $email) {
|
||||
try {
|
||||
$emails = $email->get();
|
||||
return view('themes.default1.admin.emails.template.formDiagno', compact('emails'));
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
To Do function for Sending an Email
|
||||
*/
|
||||
|
||||
public function postDiagno(Request $request)
|
||||
{
|
||||
|
||||
/**
|
||||
* function to send emails
|
||||
* @param type Request $request
|
||||
* @return type
|
||||
*/
|
||||
public function postDiagno(Request $request) {
|
||||
$email = $request->input('to');
|
||||
$subject = $request->input('subject');
|
||||
|
||||
$mail = Mail::send('themes.default1.admin.emails.template.connection',array('link' => url('getmail'), 'username' => $email), function($message) use($email) {
|
||||
$message->to($email)->subject('Checking the connection');
|
||||
});
|
||||
|
||||
return redirect('getdiagno')->with('success','Activate Your Account ! Click on Link that send to your mail');
|
||||
|
||||
|
||||
$mail = Mail::send('themes.default1.admin.emails.template.connection', array('link' => url('getmail'), 'username' => $email), function ($message) use ($email) {
|
||||
$message->to($email)->subject('Checking the connection');
|
||||
});
|
||||
return redirect('getdiagno')->with('success', 'Activate Your Account ! Click on Link that send to your mail');
|
||||
}
|
||||
}
|
||||
|
@@ -1,36 +1,33 @@
|
||||
<?php namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Http\Requests;
|
||||
<?php
|
||||
namespace App\Http\Controllers\Admin;
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
/* include Priority Model */
|
||||
use App\Model\Priority;
|
||||
|
||||
/* include Ticket_thread Model */
|
||||
use App\Model\Ticket_thread;
|
||||
|
||||
/**
|
||||
* ThreadController
|
||||
*
|
||||
* @package Controllers
|
||||
* @subpackage Controller
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class ThreadController extends Controller {
|
||||
|
||||
/* get the values from ticket_thread Table and direct to view page */
|
||||
|
||||
public function getTickets(Ticket_thread $thread, Priority $priority)
|
||||
|
||||
{
|
||||
try
|
||||
{
|
||||
/**
|
||||
* get the values from ticket_thread Table and direct to view page
|
||||
* @param type Ticket_thread $thread
|
||||
* @param type Priority $priority
|
||||
* @return type Response
|
||||
*/
|
||||
public function getTickets(Ticket_thread $thread, Priority $priority) {
|
||||
try {
|
||||
/* get the values of Ticket_thread from Ticket_thread Table */
|
||||
$threads = $thread->get();
|
||||
|
||||
/* get the values of priority from Priority Table */
|
||||
$priorities = $priority->get();
|
||||
|
||||
/* Direct to view page */
|
||||
return view('themes.default1.admin.tickets.ticket', compact('threads','priorities'));
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
return view('themes.default1.admin.tickets.ticket', compact('threads', 'priorities'));
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
@@ -1,25 +1,26 @@
|
||||
<?php namespace App\Http\Controllers\Admin;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin;
|
||||
|
||||
/**
|
||||
* --------------------------------------------
|
||||
* WelcomeController
|
||||
* --------------------------------------------
|
||||
* This controller renders the "marketing page" for the application and
|
||||
* is configured to only allow guests. Like most of the other sample
|
||||
* controllers, you are free to modify or remove it as you desire.
|
||||
*
|
||||
* @package Controllers
|
||||
* @subpackage Controller
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class WelcomeController extends Controller {
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Welcome Controller
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This controller renders the "marketing page" for the application and
|
||||
| is configured to only allow guests. Like most of the other sample
|
||||
| controllers, you are free to modify or remove it as you desire.
|
||||
|
|
||||
*/
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
public function __construct() {
|
||||
$this->middleware('guest');
|
||||
}
|
||||
|
||||
@@ -28,8 +29,7 @@ class WelcomeController extends Controller {
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
public function index() {
|
||||
return view('welcome');
|
||||
}
|
||||
|
||||
|
@@ -1,25 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Agent;
|
||||
|
||||
<?php namespace App\Http\Controllers\Agent;
|
||||
use App;
|
||||
use App\Http\Controllers\Agent\TicketController;
|
||||
use App\Http\Controllers\Controller;
|
||||
// use App\Model\Ticket\Ticket;
|
||||
use App\Model\Email\Emails;
|
||||
use App\Model\Ticket\Ticket_attachments;
|
||||
use App\Model\Ticket\Ticket_Thread;
|
||||
|
||||
/**
|
||||
* MailController
|
||||
*
|
||||
* @package Controllers
|
||||
* @subpackage Controller
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class MailController extends Controller {
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $email = "";
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $stream = "";
|
||||
|
||||
// public function fetchEmails(Emails $email)
|
||||
// {
|
||||
// $emails = $email->get();
|
||||
// $mailboxes = $emails;
|
||||
// return $mailboxes;
|
||||
// }
|
||||
/**
|
||||
* constructor
|
||||
* Create a new controller instance.
|
||||
* @param type TicketController $TicketController
|
||||
*/
|
||||
public function __construct(TicketController $TicketController) {
|
||||
$this->TicketController = $TicketController;
|
||||
}
|
||||
|
||||
/**
|
||||
* Decode Imap text
|
||||
* @param type $str
|
||||
* @return type string
|
||||
*/
|
||||
function decode_imap_text($str) {
|
||||
$result = '';
|
||||
$decode_header = imap_mime_header_decode($str);
|
||||
@@ -29,29 +48,75 @@ class MailController extends Controller {
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* get Imap data
|
||||
*/
|
||||
function getdata() {
|
||||
/**
|
||||
* fetching all the emails allowed to
|
||||
* check for mails to read tickets
|
||||
*/
|
||||
$email = new Emails;
|
||||
$mailboxes = $email->get();
|
||||
|
||||
//check for any value in $mailbox
|
||||
if (count($mailboxes) >= 0) {
|
||||
foreach ($mailboxes as $current_mailbox) {
|
||||
//checking for fetching status of the emails
|
||||
if ($current_mailbox['fetching_status']) {
|
||||
/**
|
||||
*@imap_open requres three arguments for
|
||||
* reading mails in each emails
|
||||
*
|
||||
* 1. Host
|
||||
* 2. email address
|
||||
* 3. password
|
||||
*/
|
||||
$stream = @imap_open($current_mailbox['fetching_host'], $current_mailbox['email_address'], $current_mailbox['password']);
|
||||
/**
|
||||
* @var $testvar type string
|
||||
*/
|
||||
$testvar = "";
|
||||
// checking for any result in imap_open with value
|
||||
if ($stream >= 0) {
|
||||
$emails = imap_search($stream, 'SINCE ' . date('d-M-Y', strtotime("-10 day")));
|
||||
/**
|
||||
* @imap_search requires two arguments to check
|
||||
* from when to check for mails
|
||||
*
|
||||
* 1. result of @imap_open $stream
|
||||
* 2. date in negative
|
||||
*/
|
||||
$emails = imap_search($stream, 'SINCE ' . date('d-M-Y', strtotime("-1 day")));
|
||||
// checking if $emails has received any value
|
||||
if ($emails != false) {
|
||||
// count for mails
|
||||
if (count($emails) >= 0) {
|
||||
rsort($emails);
|
||||
foreach ($emails as $email_id) {
|
||||
/**
|
||||
* @imap_fetch_overview requires three arguments to check
|
||||
* the overview of each mails
|
||||
*
|
||||
* 1. result of @imap_open $stream
|
||||
* 2. emails numbers $emails_id
|
||||
* 3. and a 0 value
|
||||
*/
|
||||
$overview = imap_fetch_overview($stream, $email_id, 0);
|
||||
$var = $overview[0]->seen ? 'read' : 'unread';
|
||||
if ($var == 'unread') {
|
||||
// check for unread messages
|
||||
if ($var == 'read') {
|
||||
$testvar = 'set';
|
||||
|
||||
/**
|
||||
* fetching overview details fo each mails
|
||||
*
|
||||
* 1. from address
|
||||
* 2. subject
|
||||
* 3. date and time
|
||||
*/
|
||||
$from = $this->decode_imap_text($overview[0]->from);
|
||||
$subject = $this->decode_imap_text($overview[0]->subject);
|
||||
$datetime = $overview[0]->date;
|
||||
// separate date and time
|
||||
$date_time = explode(" ", $datetime);
|
||||
$date = $date_time[1] . "-" . $date_time[2] . "-" . $date_time[3] . " " . $date_time[4];
|
||||
|
||||
@@ -68,26 +133,31 @@ class MailController extends Controller {
|
||||
// {
|
||||
// echo "fail";
|
||||
// }
|
||||
|
||||
$emailadd = explode('&', $from);
|
||||
$username = $emailadd[0];
|
||||
$emailadd = substr($emailadd[1], 3);
|
||||
$date = date('Y-m-d H:i:s', strtotime($date));
|
||||
|
||||
$system = "Email";
|
||||
$phone = "";
|
||||
$helptopic = $this->default_helptopic();
|
||||
$sla = $this->default_sla();
|
||||
|
||||
$helptopic = $this->TicketController->default_helptopic();
|
||||
$sla = $this->TicketController->default_sla();
|
||||
$structure = imap_fetchstructure($stream, $email_id);
|
||||
// $image1 = $structure->parts[0]->parts[1]->parameters[0]->value;
|
||||
// $image = $structure->parts[1]->parameters[0]->value;
|
||||
// echo '<img src="'.$image1.'">';
|
||||
// echo '<img src="'.$image.'">';
|
||||
// dd($structure);
|
||||
//=================================================
|
||||
// HTML
|
||||
//=================================================
|
||||
|
||||
/**
|
||||
* There are 5 types of mail readable formats
|
||||
*
|
||||
* 1. Html
|
||||
* 2. Alternative
|
||||
* 3. Related
|
||||
* 4. Mixed
|
||||
*/
|
||||
|
||||
// checking if the format is Html
|
||||
if ($structure->subtype == 'HTML') {
|
||||
$body2 = imap_fetchbody($stream, $email_id, 1);
|
||||
if ($body2 == null) {
|
||||
@@ -98,10 +168,7 @@ class MailController extends Controller {
|
||||
// echo $body;
|
||||
// echo "0";
|
||||
}
|
||||
|
||||
//=================================================
|
||||
// ALTERNATIVE
|
||||
//=================================================
|
||||
// checking if the format is Alternative
|
||||
if ($structure->subtype == 'ALTERNATIVE') {
|
||||
if (isset($structure->parts)) {
|
||||
$body2 = imap_fetchbody($stream, $email_id, 1.2);
|
||||
@@ -113,10 +180,7 @@ class MailController extends Controller {
|
||||
// echo $body[0];
|
||||
}
|
||||
}
|
||||
|
||||
//=================================================
|
||||
// RELATED
|
||||
//=================================================
|
||||
// checking if the format is related
|
||||
if ($structure->subtype == 'RELATED') {
|
||||
if (isset($structure->parts)) {
|
||||
$parts = $structure->parts;
|
||||
@@ -126,10 +190,8 @@ class MailController extends Controller {
|
||||
$body2 = imap_fetchbody($stream, $email_id, 1);
|
||||
}
|
||||
$body = quoted_printable_decode($body2);
|
||||
|
||||
foreach ($parts as $part) {
|
||||
if ($parts[$i]) {
|
||||
|
||||
}
|
||||
$i++;
|
||||
if (isset($parts[$i])) {
|
||||
@@ -142,7 +204,6 @@ class MailController extends Controller {
|
||||
if (strtolower($object->attribute) == 'filename') {
|
||||
$filename = $object->value;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
if ($parts[$i]->ifparameters == 1) {
|
||||
@@ -150,7 +211,6 @@ class MailController extends Controller {
|
||||
if (strtolower($object->attribute) == 'name') {
|
||||
$name = $object->value;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
$body = str_replace($imageid, $filename, $body);
|
||||
@@ -170,10 +230,7 @@ class MailController extends Controller {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//=================================================
|
||||
// MIXED
|
||||
//=================================================
|
||||
//checking if the format is mixed
|
||||
elseif ($structure->subtype == 'MIXED') {
|
||||
if (isset($structure->parts)) {
|
||||
$parts = $structure->parts;
|
||||
@@ -188,7 +245,6 @@ class MailController extends Controller {
|
||||
$body = quoted_printable_decode($body2);
|
||||
}
|
||||
}
|
||||
|
||||
// subtype = RELATED
|
||||
if ($parts[0]->subtype == 'RELATED') {
|
||||
if (isset($parts[0]->parts)) {
|
||||
@@ -203,7 +259,6 @@ class MailController extends Controller {
|
||||
$name = "";
|
||||
foreach ($parts as $part) {
|
||||
if ($parts[0]) {
|
||||
|
||||
}
|
||||
$i++;
|
||||
if (isset($parts[$i])) {
|
||||
@@ -249,8 +304,8 @@ class MailController extends Controller {
|
||||
// $ticket->body = $body2;
|
||||
// $ticket->date = $datetime;
|
||||
// $ticket->save();
|
||||
|
||||
if ($this->create_user($emailadd, $username, $subject, $body, $phone, $helptopic, $sla, $system) == true) {
|
||||
$priority = '1';
|
||||
if ($this->TicketController->create_user($emailadd, $username, $subject, $body, $phone, $helptopic, $sla, $priority, $system) == true) {
|
||||
$thread_id = Ticket_Thread::whereRaw('id = (select max(`id`) from ticket_thread)')->first();
|
||||
$thread_id = $thread_id->id;
|
||||
if ($this->get_attachment($structure, $stream, $email_id, $thread_id) == true) {
|
||||
@@ -270,10 +325,16 @@ class MailController extends Controller {
|
||||
}
|
||||
}
|
||||
|
||||
//======================================
|
||||
// ATTACHMENT |Incomplete
|
||||
//======================================
|
||||
/**
|
||||
* Get attachments data from mail
|
||||
* @param type $structure
|
||||
* @param type $stream
|
||||
* @param type $email_id
|
||||
* @param type $thread_id
|
||||
* @return type bool
|
||||
*/
|
||||
public function get_attachment($structure, $stream, $email_id, $thread_id) {
|
||||
// checking if the mails has attachments
|
||||
if (isset($structure->parts) && count($structure->parts)) {
|
||||
for ($i = 0; $i < count($structure->parts); $i++) {
|
||||
$attachments[$i] = array(
|
||||
@@ -281,7 +342,7 @@ class MailController extends Controller {
|
||||
'filename' => '',
|
||||
'name' => '',
|
||||
'attachment' => '');
|
||||
|
||||
// checking for files
|
||||
if ($structure->parts[$i]->ifdparameters) {
|
||||
foreach ($structure->parts[$i]->dparameters as $object) {
|
||||
if (strtolower($object->attribute) == 'filename') {
|
||||
@@ -290,6 +351,7 @@ class MailController extends Controller {
|
||||
}
|
||||
}
|
||||
}
|
||||
// checking for files
|
||||
if ($structure->parts[$i]->ifparameters) {
|
||||
foreach ($structure->parts[$i]->parameters as $object) {
|
||||
if (strtolower($object->attribute) == 'name') {
|
||||
@@ -298,8 +360,12 @@ class MailController extends Controller {
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* All over again checking for the availability of attachment
|
||||
*/
|
||||
if ($attachments[$i]['is_attachment']) {
|
||||
$attachments[$i]['attachment'] = imap_fetchbody($stream, $email_id, $i + 1);
|
||||
// decoding if encoded in base64_encode format else quoted_printable_encode
|
||||
if ($structure->parts[$i]->encoding == 3) {
|
||||
$attachments[$i]['attachment'] = base64_decode($attachments[$i]['attachment']);
|
||||
} elseif ($structure->parts[$i]->encoding == 4) {
|
||||
@@ -307,15 +373,19 @@ class MailController extends Controller {
|
||||
}
|
||||
}
|
||||
}
|
||||
// calling the save method to save each attachments
|
||||
if ($this->save_attcahments($attachments, $thread_id) == true) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//=====================================
|
||||
// SAVE ATTACHMENT | Incomplete
|
||||
//=====================================
|
||||
/**
|
||||
* Function to save attachments
|
||||
* @param type $attachments
|
||||
* @param type $thread_id
|
||||
* @return type bool
|
||||
*/
|
||||
public function save_attcahments($attachments, $thread_id) {
|
||||
if (count($attachments) != 0) {
|
||||
foreach ($attachments as $at) {
|
||||
@@ -324,7 +394,6 @@ class MailController extends Controller {
|
||||
$filename = $at['filename'];
|
||||
$ext = pathinfo($filename, PATHINFO_EXTENSION);
|
||||
$tmpName = $at['filename'];
|
||||
// echo '<img src="'.$tmpName.'">';
|
||||
$fp = fopen($tmpName, 'r');
|
||||
$content = fread($fp, filesize($tmpName));
|
||||
$content2 = file_put_contents($at['filename'], $at['attachment']);
|
||||
@@ -334,300 +403,11 @@ class MailController extends Controller {
|
||||
$ticket_Thread->name = $filename;
|
||||
$ticket_Thread->size = $filesize;
|
||||
$ticket_Thread->type = $ext;
|
||||
$ticket_Thread->content = $fp; //$content;
|
||||
$ticket_Thread->content = $fp;
|
||||
$ticket_Thread->save();
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// // public function part($part)
|
||||
// // {
|
||||
// // $structure = $part->parts;
|
||||
// // return $structure;
|
||||
// // }
|
||||
// // public function fetchdata()
|
||||
// // {
|
||||
// // $tickets = Tickets::all();
|
||||
// // foreach ($tickets as $ticket)
|
||||
// // {
|
||||
// // echo $ticket->body.'<hr/>';
|
||||
// // }
|
||||
// // }
|
||||
// public function ticket_list()
|
||||
// {
|
||||
// $tickets = Tickets::all();
|
||||
// $threads = Ticket_Thread::all();
|
||||
// return view('themes.default1.agent.ticket.ticket',compact('tickets'),compact('threads'));
|
||||
// }
|
||||
// public function thread($id)
|
||||
// {
|
||||
// $tickets = Tickets::where('id','=',$id)->first();
|
||||
// $thread = Ticket_Thread::where('ticket_id','=',$id)->first();
|
||||
// return view('themes.default1.agent.ticket.timeline',compact('tickets'),compact('thread'));
|
||||
// }
|
||||
// //============================================
|
||||
// // Create Ticket | Incomplete
|
||||
// //============================================
|
||||
// public function reply(Ticket_Thread $thread, TicketRequest $request)
|
||||
// {
|
||||
// $thread->ticket_id = $request->input('ticket_ID');
|
||||
// $thread->title = $request->input('To');
|
||||
// $thread->body = $request->input('ReplyContent');
|
||||
// $thread->save();
|
||||
// $ticket_id = $request->input('ticket_ID');
|
||||
// $tickets = Tickets::where('id','=',$ticket_id)->first();
|
||||
// $thread = Ticket_Thread::where('ticket_id','=',$ticket_id)->first();
|
||||
// // return 'success';
|
||||
// return Redirect("thread/".$ticket_id);
|
||||
// }
|
||||
// //============================================
|
||||
// // Ticket Edit get | Incomplete
|
||||
// //============================================
|
||||
// public function ticket_edit_get($id, Tickets $ticket , Ticket_Thread $thread)
|
||||
// {
|
||||
// $ticket_id = $ticket->where('id' , '=' , $id)->first();
|
||||
// $thread_id = $thread->where('ticket_id' , '=' , $id)->first();
|
||||
// $user = User::where('id' , '=' , $ticket_id->user_id)->first();
|
||||
// return view("themes.default1.agent.ticket.edit",compact('ticket_id','thread_id','user'));
|
||||
// }
|
||||
// //============================================
|
||||
// // Ticket Edit post | Incomplete
|
||||
// //============================================
|
||||
// public function ticket_edit_post($ticket_id,Ticket_Thread $thread)
|
||||
// {
|
||||
// dd($ticket_id);
|
||||
// // return Redirect("");
|
||||
// }
|
||||
// //============================================
|
||||
// // Ticket print | Incomplete
|
||||
// //============================================
|
||||
// public function ticket_print($id)
|
||||
// {
|
||||
// return pdf();
|
||||
// // return Redirect("");
|
||||
// }
|
||||
// //============================================
|
||||
// // Generate Ticket Number | Incomplete
|
||||
// //============================================
|
||||
// public function ticket_number($ticket_number)
|
||||
// {
|
||||
// $number = $ticket_number;
|
||||
// $number = explode('-',$number);
|
||||
// $number1 = $number[0];
|
||||
// if($number1 == 'ZZZZ'){
|
||||
// $number1 = 'AAAA';
|
||||
// }
|
||||
// $number2 = $number[1];
|
||||
// if($number2 == '9999'){
|
||||
// $number2 = '0000';
|
||||
// }
|
||||
// $number3 = $number[2];
|
||||
// if($number3 == '9999999'){
|
||||
// $number3 = '0000000';
|
||||
// }
|
||||
// $number1++;
|
||||
// $number2++;
|
||||
// $number3++;
|
||||
// $number2 = sprintf('%04s', $number2);
|
||||
// $number3 = sprintf('%07s', $number3);
|
||||
// $array = array($number1,$number2,$number3);
|
||||
// $number = implode('-', $array);
|
||||
// return $number;
|
||||
// }
|
||||
// //=============================================
|
||||
// // Checking email availability | Complete
|
||||
// //=============================================
|
||||
// public function check_email($email)
|
||||
// {
|
||||
// $check = User::where('email','=',$email)->first();
|
||||
// if($check == true)
|
||||
// {
|
||||
// return $check;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
// //===============================================
|
||||
// // Create User | InComplete
|
||||
// //===============================================
|
||||
// public function create_user($emailadd, $username, $subject, $body, $phone, $helptopic, $sla, $system)
|
||||
// {
|
||||
// $email;
|
||||
// $username;
|
||||
// $checkemail = $this->check_email($emailadd);
|
||||
// if($checkemail == false )
|
||||
// {
|
||||
// $password = $this->generateRandomString();
|
||||
// $user = new User;
|
||||
// $user->user_name = $username;
|
||||
// $user->email = $emailadd;
|
||||
// $user->password = Hash::make($password);
|
||||
// if($user->save())
|
||||
// {
|
||||
// $user_id = $user->id;
|
||||
// if(Mail::send('emails.pass', ['password' => $password, 'name' => $username],
|
||||
// function($message)use($emailadd, $username)
|
||||
// {
|
||||
// $message->to($emailadd, $username)->subject('password');
|
||||
// }))
|
||||
// {
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// $username = $checkemail->username;
|
||||
// $user_id = $checkemail->id;
|
||||
// }
|
||||
// $ticket_number = $this->check_ticket($user_id, $subject, $body, $helptopic, $sla);
|
||||
// if(Mail::send('emails.Ticket_Create', ['name' => $username, 'ticket_number' => $ticket_number],
|
||||
// function($message)use($emailadd, $username, $ticket_number)
|
||||
// {
|
||||
// $message->to($emailadd, $username)->subject('[~'.$ticket_number.']');
|
||||
// }))
|
||||
// {
|
||||
// return true;
|
||||
// }
|
||||
// }
|
||||
// //============================================
|
||||
// // Select Default help_topic | Incomplete
|
||||
// //============================================
|
||||
// public function default_helptopic()
|
||||
// {
|
||||
// $helptopic = "Support";
|
||||
// return $helptopic;
|
||||
// }
|
||||
// //============================================
|
||||
// // Select Default sla | Incomplete
|
||||
// //============================================
|
||||
// public function default_sla()
|
||||
// {
|
||||
// $sla = "12hours";
|
||||
// return $sla;
|
||||
// }
|
||||
// //============================================
|
||||
// // Select Default priority | Incomplete
|
||||
// //============================================
|
||||
// public function default_priority()
|
||||
// {
|
||||
// $priority = "important";
|
||||
// return $helptopic;
|
||||
// }
|
||||
// //============================================
|
||||
// // check ticket | Incomplete
|
||||
// //============================================
|
||||
// public function check_ticket($user_id, $subject, $body, $helptopic, $sla)
|
||||
// {
|
||||
// $read_ticket_number = substr($subject, 0, 6);
|
||||
// if($read_ticket_number == 'Re: [~')
|
||||
// {
|
||||
// $separate = explode("]", $subject);
|
||||
// $new_subject = substr($separate[0] , 6 , 20);
|
||||
// $find_number = Tickets::where('ticket_number', '=', $new_subject)->first();
|
||||
// $thread_body = explode("---Reply above this line---", $body);
|
||||
// $body = $thread_body[0];
|
||||
// if(count($find_number) > 0)
|
||||
// {
|
||||
// $id = $find_number->id;
|
||||
// $ticket_number = $find_number->ticket_number;
|
||||
// if(isset($id))
|
||||
// {
|
||||
// if($this->ticket_thread($subject, $body, $id, $user_id))
|
||||
// {
|
||||
// return $ticket_number;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// $ticket_number = $this->create_ticket($user_id, $subject, $body, $helptopic, $sla);
|
||||
// return $ticket_number;
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// $ticket_number = $this->create_ticket($user_id, $subject, $body, $helptopic, $sla);
|
||||
// return $ticket_number;
|
||||
// }
|
||||
// }
|
||||
// //============================================
|
||||
// // Create Ticket | Incomplete
|
||||
// //============================================
|
||||
// public function create_ticket($user_id, $subject, $body, $helptopic, $sla)
|
||||
// {
|
||||
// $max_number = Tickets::whereRaw('id = (select max(`id`) from tickets)')->get();
|
||||
// foreach($max_number as $number)
|
||||
// {
|
||||
// $ticket_number = $number->ticket_number;
|
||||
// }
|
||||
// $ticket = new Tickets;
|
||||
// $ticket->ticket_number = $this->ticket_number($ticket_number);
|
||||
// $ticket->user_id = $user_id;
|
||||
// $ticket->save();
|
||||
// $ticket_number = $ticket->ticket_number;
|
||||
// $id = $ticket->id;
|
||||
// if($this->ticket_thread($subject, $body, $id, $user_id)==true)
|
||||
// {
|
||||
// return $ticket_number;
|
||||
// }
|
||||
// }
|
||||
// //============================================
|
||||
// // Create Ticket | Incomplete
|
||||
// //============================================
|
||||
// public function ticket_thread($subject, $body, $id, $user_id)
|
||||
// {
|
||||
// $thread = new Ticket_Thread;
|
||||
// $thread->user_id = $user_id;
|
||||
// $thread->ticket_id = $id;
|
||||
// $thread->poster = 'client';
|
||||
// $thread->title = $subject;
|
||||
// $thread->body = $body;
|
||||
// if($thread->save())
|
||||
// {
|
||||
// return true;
|
||||
// }
|
||||
// }
|
||||
// //============================================
|
||||
// // Generate Random password | Incomplete
|
||||
// //============================================
|
||||
// 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;
|
||||
// }
|
||||
// public function close($id, Tickets $ticket)
|
||||
// {
|
||||
// $ticket_status = $ticket->where('id','=',$id)->first();
|
||||
// $ticket_status->status = 3;
|
||||
// $ticket_status->save();
|
||||
// return "your ticket".$ticket_status->ticket_number." has been closed";
|
||||
// }
|
||||
// public function resolve($id, Tickets $ticket)
|
||||
// {
|
||||
// $ticket_status = $ticket->where('id','=',$id)->first();
|
||||
// $ticket_status->status = 2;
|
||||
// $ticket_status->save();
|
||||
// return "your ticket".$ticket_status->ticket_number." has been resolved";
|
||||
// }
|
||||
// public function open($id, Tickets $ticket)
|
||||
// {
|
||||
// $ticket_status = $ticket->where('id','=',$id)->first();
|
||||
// $ticket_status->status = 1;
|
||||
// $ticket_status->save();
|
||||
// return "your ticket".$ticket_status->ticket_number." has been opened";
|
||||
// }
|
||||
// public function assign($id)
|
||||
// {
|
||||
// return $id;
|
||||
// }
|
||||
}
|
||||
|
@@ -1,4 +1,6 @@
|
||||
<?php namespace App\Http\Controllers\Agent;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Agent;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Requests\OrganizationRequest;
|
||||
@@ -11,10 +13,24 @@ use App\Model\Agent_panel\Organization;
|
||||
|
||||
/* Define OrganizationUpdate to validate the create form */
|
||||
|
||||
/**
|
||||
* OrganizationController
|
||||
*
|
||||
* @package Controllers
|
||||
* @subpackage Controller
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class OrganizationController extends Controller {
|
||||
|
||||
/* Define constructor for authentication checking */
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
* constructor to check
|
||||
* 1. authentication
|
||||
* 2. user roles
|
||||
* 3. roles must be agent
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct() {
|
||||
$this->middleware('auth');
|
||||
$this->middleware('role.agent');
|
||||
@@ -24,14 +40,13 @@ class OrganizationController extends Controller {
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return Response
|
||||
* @param type Organization $org
|
||||
* @return type Response
|
||||
*/
|
||||
public function index(Organization $org) {
|
||||
try
|
||||
{
|
||||
try {
|
||||
/* get all values of table organization */
|
||||
$orgs = $org->get();
|
||||
|
||||
return view('themes.default1.agent.organization.index', compact('orgs'));
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
@@ -41,11 +56,10 @@ class OrganizationController extends Controller {
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return Response
|
||||
* @return type Response
|
||||
*/
|
||||
public function create() {
|
||||
try
|
||||
{
|
||||
try {
|
||||
return view('themes.default1.agent.organization.create');
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
@@ -54,12 +68,12 @@ class OrganizationController extends Controller {
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @return Response
|
||||
* @param type Organization $org
|
||||
* @param type OrganizationRequest $request
|
||||
* @return type Response
|
||||
*/
|
||||
public function store(Organization $org, OrganizationRequest $request) {
|
||||
try
|
||||
{
|
||||
try {
|
||||
/* Insert the all input request to organization table */
|
||||
/* Check whether function success or not */
|
||||
|
||||
@@ -79,15 +93,14 @@ class OrganizationController extends Controller {
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
* @param type $id
|
||||
* @param type Organization $org
|
||||
* @return type Response
|
||||
*/
|
||||
public function show($id, Organization $org) {
|
||||
try
|
||||
{
|
||||
try {
|
||||
/* select the field by id */
|
||||
$orgs = $org->whereId($id)->first();
|
||||
|
||||
/* To view page */
|
||||
return view('themes.default1.agent.organization.show', compact('orgs'));
|
||||
} catch (Exception $e) {
|
||||
@@ -98,12 +111,12 @@ class OrganizationController extends Controller {
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
* @param type $id
|
||||
* @param type Organization $org
|
||||
* @return type Response
|
||||
*/
|
||||
public function edit($id, Organization $org) {
|
||||
try
|
||||
{
|
||||
try {
|
||||
/* select the field by id */
|
||||
$orgs = $org->whereId($id)->first();
|
||||
|
||||
@@ -117,18 +130,17 @@ class OrganizationController extends Controller {
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
* @param type $id
|
||||
* @param type Organization $org
|
||||
* @param type OrganizationUpdate $request
|
||||
* @return type Response
|
||||
*/
|
||||
public function update($id, Organization $org, OrganizationUpdate $request) {
|
||||
try
|
||||
{
|
||||
try {
|
||||
/* select the field by id */
|
||||
$orgs = $org->whereId($id)->first();
|
||||
|
||||
/* update the organization table */
|
||||
/* Check whether function success or not */
|
||||
|
||||
if ($orgs->fill($request->input())->save() == true) {
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('organizations')->with('success', 'Organization Updated Successfully');
|
||||
@@ -140,24 +152,20 @@ class OrganizationController extends Controller {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('organizations')->with('fails', 'Organization can not Update');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
* @param type int $id
|
||||
* @return type Response
|
||||
*/
|
||||
public function destroy($id) {
|
||||
try
|
||||
{
|
||||
try {
|
||||
/* select the field by id */
|
||||
$orgs = $org->whereId($id)->first();
|
||||
|
||||
/* Delete the field selected from the table */
|
||||
/* Check whether function success or not */
|
||||
|
||||
if ($orgs->delete() == true) {
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('organizations')->with('success', 'Organization Deleted Successfully');
|
||||
|
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Agent;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
@@ -6,89 +7,92 @@ use App\Http\Requests\CreateTicketRequest;
|
||||
use App\Http\Requests\TicketRequest;
|
||||
use App\Model\Email\Banlist;
|
||||
use App\Model\Ticket\Tickets;
|
||||
// use App\Http\Requests\Ticket_EditRequest;
|
||||
use App\Model\Ticket\Ticket_Thread;
|
||||
use App\User;
|
||||
use Auth;
|
||||
use DB;
|
||||
use Hash;
|
||||
use Input;
|
||||
use Mail;
|
||||
use PDF;
|
||||
|
||||
/**
|
||||
* TicketController
|
||||
*
|
||||
* @package Controllers
|
||||
* @subpackage Controller
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class TicketController extends Controller {
|
||||
/* Define constructor for Authentication Checking */
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
* @return type response
|
||||
*/
|
||||
public function __construct() {
|
||||
$this->middleware('auth');
|
||||
}
|
||||
|
||||
//============================================
|
||||
// Ticket List | Incomplete
|
||||
//============================================
|
||||
/**
|
||||
* Show the ticket list page
|
||||
* @return type response
|
||||
*/
|
||||
public function ticket_list() {
|
||||
// $tickets = Tickets::all();
|
||||
// $threads = Ticket_Thread::all();
|
||||
return view('themes.default1.agent.ticket.ticket');
|
||||
}
|
||||
|
||||
//============================================
|
||||
// Open Ticket List | Incomplete
|
||||
//============================================
|
||||
/**
|
||||
* Show the Open ticket list page
|
||||
* @return type response
|
||||
*/
|
||||
public function open_ticket_list() {
|
||||
// $tickets = Tickets::all();
|
||||
// $threads = Ticket_Thread::all();
|
||||
return view('themes.default1.agent.ticket.open');
|
||||
}
|
||||
|
||||
//============================================
|
||||
// Open Ticket List | Incomplete
|
||||
//============================================
|
||||
/**
|
||||
* Show the answered ticket list page
|
||||
* @return type response
|
||||
*/
|
||||
public function answered_ticket_list() {
|
||||
// $tickets = Tickets::all();
|
||||
// $threads = Ticket_Thread::all();
|
||||
return view('themes.default1.agent.ticket.answered');
|
||||
}
|
||||
|
||||
//============================================
|
||||
// Open Ticket List | Incomplete
|
||||
//============================================
|
||||
/**
|
||||
* Show the Myticket list page
|
||||
* @return type response
|
||||
*/
|
||||
public function myticket_ticket_list() {
|
||||
// $tickets = Tickets::all();
|
||||
// $threads = Ticket_Thread::all();
|
||||
return view('themes.default1.agent.ticket.myticket');
|
||||
}
|
||||
|
||||
//============================================
|
||||
// Open Ticket List | Incomplete
|
||||
//============================================
|
||||
/**
|
||||
* Show the Overdue ticket list page
|
||||
* @return type response
|
||||
*/
|
||||
public function overdue_ticket_list() {
|
||||
// $tickets = Tickets::all();
|
||||
// $threads = Ticket_Thread::all();
|
||||
return view('themes.default1.agent.ticket.overdue');
|
||||
}
|
||||
|
||||
//============================================
|
||||
// Open Ticket List | Incomplete
|
||||
//============================================
|
||||
/**
|
||||
* Show the Closed ticket list page
|
||||
* @return type response
|
||||
*/
|
||||
public function closed_ticket_list() {
|
||||
// $tickets = Tickets::all();
|
||||
// $threads = Ticket_Thread::all();
|
||||
return view('themes.default1.agent.ticket.closed');
|
||||
}
|
||||
|
||||
//============================================
|
||||
// create Ticket | Incomplete
|
||||
//============================================
|
||||
/**
|
||||
* Show the New ticket page
|
||||
* @return type response
|
||||
*/
|
||||
public function newticket() {
|
||||
// $tickets = Tickets::all();
|
||||
// $threads = Ticket_Thread::all();
|
||||
return view('themes.default1.agent.ticket.new');
|
||||
}
|
||||
|
||||
//============================================
|
||||
// post create ticket | Incomplete
|
||||
//============================================
|
||||
/**
|
||||
* Save the data of new ticket and show the New ticket page with result
|
||||
* @param type CreateTicketRequest $request
|
||||
* @return type response
|
||||
*/
|
||||
public function post_newticket(CreateTicketRequest $request) {
|
||||
$email = $request->input('email');
|
||||
$fullname = $request->input('fullname');
|
||||
@@ -103,26 +107,31 @@ class TicketController extends Controller {
|
||||
$priority = $request->input('priority');
|
||||
$phone = "";
|
||||
$system = "";
|
||||
//create user
|
||||
if ($this->create_user($email, $fullname, $subject, $body, $phone, $helptopic, $sla, $priority, $system)) {
|
||||
return Redirect('newticket')->with('success', 'success');
|
||||
} else {
|
||||
return Redirect('newticket')->with('success', 'success');
|
||||
return Redirect('newticket')->with('fails', 'fails');
|
||||
}
|
||||
// echo $priority;
|
||||
}
|
||||
|
||||
//============================================
|
||||
// Thread | Incomplete
|
||||
//============================================
|
||||
/**
|
||||
* Shows the ticket thread details
|
||||
* @param type $id
|
||||
* @return type response
|
||||
*/
|
||||
public function thread($id) {
|
||||
$tickets = Tickets::where('id', '=', $id)->first();
|
||||
$thread = Ticket_Thread::where('ticket_id', '=', $id)->first();
|
||||
return view('themes.default1.agent.ticket.timeline', compact('tickets'), compact('thread'));
|
||||
}
|
||||
|
||||
//============================================
|
||||
// Ticket reply | Incomplete
|
||||
//============================================
|
||||
/**
|
||||
* Replying a ticket
|
||||
* @param type Ticket_Thread $thread
|
||||
* @param type TicketRequest $request
|
||||
* @return type bool
|
||||
*/
|
||||
public function reply(Ticket_Thread $thread, TicketRequest $request) {
|
||||
$thread->ticket_id = $request->input('ticket_ID');
|
||||
$thread->poster = 'support';
|
||||
@@ -131,27 +140,17 @@ class TicketController extends Controller {
|
||||
$ticket_id = $request->input('ticket_ID');
|
||||
$tickets = Tickets::where('id', '=', $ticket_id)->first();
|
||||
$thread = Ticket_Thread::where('ticket_id', '=', $ticket_id)->first();
|
||||
// return 'success';
|
||||
return 1;
|
||||
}
|
||||
|
||||
// //============================================
|
||||
// // Ticket Edit get | Incomplete
|
||||
// //============================================
|
||||
// public function ticket_edit_get($id, Tickets $ticket , Ticket_Thread $thread)
|
||||
// {
|
||||
// $ticket_id = $ticket->where('id' , '=' , $id)->first();
|
||||
// $thread_id = $thread->where('ticket_id' , '=' , $id)->first();
|
||||
// $user = User::where('id' , '=' , $ticket_id->user_id)->first();
|
||||
// return view("themes.default1.agent.ticket.edit",compact('ticket_id','thread_id','user'));
|
||||
// }
|
||||
//============================================
|
||||
// Ticket Edit post | Incomplete
|
||||
//============================================
|
||||
/**
|
||||
* Ticket edit and save ticket data
|
||||
* @param type $ticket_id
|
||||
* @param type Ticket_Thread $thread
|
||||
* @return type bool
|
||||
*/
|
||||
public function ticket_edit_post($ticket_id, Ticket_Thread $thread) {
|
||||
// echo $ticket_id;
|
||||
$threads = $thread->where('ticket_id', '=', $ticket_id)->first();
|
||||
// // echo $threads->title;
|
||||
if (Input::get('subject') != null && Input::get('body') != null) {
|
||||
$threads->title = Input::get('subject');
|
||||
$threads->body = Input::get('body');
|
||||
@@ -164,9 +163,11 @@ class TicketController extends Controller {
|
||||
return 0;
|
||||
}
|
||||
|
||||
//============================================
|
||||
// Ticket print | Incomplete
|
||||
//============================================
|
||||
/**
|
||||
* Print Ticket Details
|
||||
* @param type $id
|
||||
* @return type respponse
|
||||
*/
|
||||
public function ticket_print($id) {
|
||||
$tickets = Tickets::where('id', '=', $id)->first();
|
||||
$thread = Ticket_Thread::where('ticket_id', '=', $id)->first();
|
||||
@@ -174,9 +175,11 @@ class TicketController extends Controller {
|
||||
return PDF::load($html)->show();
|
||||
}
|
||||
|
||||
//============================================
|
||||
// Generate Ticket Number | Incomplete
|
||||
//============================================
|
||||
/**
|
||||
* Generates Ticket Number
|
||||
* @param type $ticket_number
|
||||
* @return type integer
|
||||
*/
|
||||
public function ticket_number($ticket_number) {
|
||||
$number = $ticket_number;
|
||||
$number = explode('-', $number);
|
||||
@@ -202,9 +205,11 @@ class TicketController extends Controller {
|
||||
return $number;
|
||||
}
|
||||
|
||||
//=============================================
|
||||
// Checking email availability | Complete
|
||||
//=============================================
|
||||
/**
|
||||
* check email for dublicate entry
|
||||
* @param type $email
|
||||
* @return type bool
|
||||
*/
|
||||
public function check_email($email) {
|
||||
$check = User::where('email', '=', $email)->first();
|
||||
if ($check == true) {
|
||||
@@ -214,37 +219,49 @@ class TicketController extends Controller {
|
||||
}
|
||||
}
|
||||
|
||||
//===============================================
|
||||
// Create User | InComplete
|
||||
//===============================================
|
||||
/**
|
||||
* Create User while creating ticket
|
||||
* @param type $emailadd
|
||||
* @param type $username
|
||||
* @param type $subject
|
||||
* @param type $body
|
||||
* @param type $phone
|
||||
* @param type $helptopic
|
||||
* @param type $sla
|
||||
* @param type $priority
|
||||
* @param type $system
|
||||
* @return type bool
|
||||
*/
|
||||
public function create_user($emailadd, $username, $subject, $body, $phone, $helptopic, $sla, $priority, $system) {
|
||||
// define global variables
|
||||
$email;
|
||||
$username;
|
||||
// check emails
|
||||
$checkemail = $this->check_email($emailadd);
|
||||
|
||||
if ($checkemail == false) {
|
||||
// Generate password
|
||||
$password = $this->generateRandomString();
|
||||
|
||||
// create user
|
||||
$user = new User;
|
||||
$user->user_name = $username;
|
||||
$user->email = $emailadd;
|
||||
$user->password = Hash::make($password);
|
||||
|
||||
// mail user his/her password
|
||||
if ($user->save()) {
|
||||
$user_id = $user->id;
|
||||
if (Mail::send('emails.pass', ['password' => $password, 'name' => $username], function ($message) use ($emailadd, $username) {
|
||||
$message->to($emailadd, $username)->subject('password');
|
||||
})) {
|
||||
|
||||
// need to do something here....
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$username = $checkemail->username;
|
||||
$user_id = $checkemail->id;
|
||||
}
|
||||
|
||||
$ticket_number = $this->check_ticket($user_id, $subject, $body, $helptopic, $sla, $priority);
|
||||
|
||||
// send ticket create details to user
|
||||
if (Mail::send('emails.Ticket_Create', ['name' => $username, 'ticket_number' => $ticket_number], function ($message) use ($emailadd, $username, $ticket_number) {
|
||||
$message->to($emailadd, $username)->subject('[~' . $ticket_number . ']');
|
||||
})) {
|
||||
@@ -252,33 +269,43 @@ class TicketController extends Controller {
|
||||
}
|
||||
}
|
||||
|
||||
//============================================
|
||||
// Select Default help_topic | Incomplete
|
||||
//============================================
|
||||
/**
|
||||
* Default helptopic
|
||||
* @return type string
|
||||
*/
|
||||
public function default_helptopic() {
|
||||
$helptopic = "Support";
|
||||
$helptopic = "1";
|
||||
return $helptopic;
|
||||
}
|
||||
|
||||
//============================================
|
||||
// Select Default sla | Incomplete
|
||||
//============================================
|
||||
/**
|
||||
* Default SLA plan
|
||||
* @return type string
|
||||
*/
|
||||
public function default_sla() {
|
||||
$sla = "12hours";
|
||||
$sla = "1";
|
||||
return $sla;
|
||||
}
|
||||
|
||||
//============================================
|
||||
// Select Default priority | Incomplete
|
||||
//============================================
|
||||
/**
|
||||
* Default Priority
|
||||
* @return type string
|
||||
*/
|
||||
public function default_priority() {
|
||||
$priority = "important";
|
||||
return $helptopic;
|
||||
$priority = "1";
|
||||
return $prioirty;
|
||||
}
|
||||
|
||||
//============================================
|
||||
// check ticket | Incomplete
|
||||
//============================================
|
||||
/**
|
||||
* Check the response of the ticket
|
||||
* @param type $user_id
|
||||
* @param type $subject
|
||||
* @param type $body
|
||||
* @param type $helptopic
|
||||
* @param type $sla
|
||||
* @param type $priority
|
||||
* @return type string
|
||||
*/
|
||||
public function check_ticket($user_id, $subject, $body, $helptopic, $sla, $priority) {
|
||||
$read_ticket_number = substr($subject, 0, 6);
|
||||
if ($read_ticket_number == 'Re: [~') {
|
||||
@@ -305,9 +332,16 @@ class TicketController extends Controller {
|
||||
}
|
||||
}
|
||||
|
||||
//============================================
|
||||
// Create Ticket | Incomplete
|
||||
//============================================
|
||||
/**
|
||||
* Create Ticket
|
||||
* @param type $user_id
|
||||
* @param type $subject
|
||||
* @param type $body
|
||||
* @param type $helptopic
|
||||
* @param type $sla
|
||||
* @param type $priority
|
||||
* @return type string
|
||||
*/
|
||||
public function create_ticket($user_id, $subject, $body, $helptopic, $sla, $priority) {
|
||||
$max_number = Tickets::whereRaw('id = (select max(`id`) from tickets)')->get();
|
||||
foreach ($max_number as $number) {
|
||||
@@ -328,9 +362,14 @@ class TicketController extends Controller {
|
||||
}
|
||||
}
|
||||
|
||||
//============================================
|
||||
// Create Ticket | Incomplete
|
||||
//============================================
|
||||
/**
|
||||
* Generate Ticket Thread
|
||||
* @param type $subject
|
||||
* @param type $body
|
||||
* @param type $id
|
||||
* @param type $user_id
|
||||
* @return type
|
||||
*/
|
||||
public function ticket_thread($subject, $body, $id, $user_id) {
|
||||
$thread = new Ticket_Thread;
|
||||
$thread->user_id = $user_id;
|
||||
@@ -343,9 +382,11 @@ class TicketController extends Controller {
|
||||
}
|
||||
}
|
||||
|
||||
//============================================
|
||||
// Generate Random password | Incomplete
|
||||
//============================================
|
||||
/**
|
||||
* Generate a random string for password
|
||||
* @param type $length
|
||||
* @return type string
|
||||
*/
|
||||
public function generateRandomString($length = 10) {
|
||||
$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
|
||||
$charactersLength = strlen($characters);
|
||||
@@ -356,9 +397,12 @@ class TicketController extends Controller {
|
||||
return $randomString;
|
||||
}
|
||||
|
||||
//============================================
|
||||
// Ticket Close | Incomplete
|
||||
//============================================
|
||||
/**
|
||||
* function to Ticket Close
|
||||
* @param type $id
|
||||
* @param type Tickets $ticket
|
||||
* @return type string
|
||||
*/
|
||||
public function close($id, Tickets $ticket) {
|
||||
$ticket_status = $ticket->where('id', '=', $id)->first();
|
||||
$ticket_status->status = 3;
|
||||
@@ -366,9 +410,12 @@ class TicketController extends Controller {
|
||||
return "your ticket" . $ticket_status->ticket_number . " has been closed";
|
||||
}
|
||||
|
||||
//============================================
|
||||
// Ticket resolve | Incomplete
|
||||
//============================================
|
||||
/**
|
||||
* function to Ticket resolved
|
||||
* @param type $id
|
||||
* @param type Tickets $ticket
|
||||
* @return type string
|
||||
*/
|
||||
public function resolve($id, Tickets $ticket) {
|
||||
$ticket_status = $ticket->where('id', '=', $id)->first();
|
||||
$ticket_status->status = 2;
|
||||
@@ -376,9 +423,12 @@ class TicketController extends Controller {
|
||||
return "your ticket" . $ticket_status->ticket_number . " has been resolved";
|
||||
}
|
||||
|
||||
//============================================
|
||||
// Ticket open | Incomplete
|
||||
//============================================
|
||||
/**
|
||||
* function to Open Ticket
|
||||
* @param type $id
|
||||
* @param type Tickets $ticket
|
||||
* @return type
|
||||
*/
|
||||
public function open($id, Tickets $ticket) {
|
||||
$ticket_status = $ticket->where('id', '=', $id)->first();
|
||||
$ticket_status->status = 1;
|
||||
@@ -386,9 +436,12 @@ class TicketController extends Controller {
|
||||
return "your ticket" . $ticket_status->ticket_number . " has been opened";
|
||||
}
|
||||
|
||||
//============================================
|
||||
// Ticket open | Incomplete
|
||||
//============================================
|
||||
/**
|
||||
* Function to delete ticket
|
||||
* @param type $id
|
||||
* @param type Tickets $ticket
|
||||
* @return type string
|
||||
*/
|
||||
public function delete($id, Tickets $ticket) {
|
||||
$ticket_delete = $ticket->where('id', '=', $id)->first();
|
||||
$ticket_delete->is_deleted = 0;
|
||||
@@ -397,9 +450,12 @@ class TicketController extends Controller {
|
||||
return "your ticket" . $ticket_delete->ticket_number . " has been delete";
|
||||
}
|
||||
|
||||
//============================================
|
||||
// ban email | Incomplete
|
||||
//============================================
|
||||
/**
|
||||
* Function to ban an email
|
||||
* @param type $id
|
||||
* @param type Tickets $ticket
|
||||
* @return type string
|
||||
*/
|
||||
public function ban($id, Tickets $ticket) {
|
||||
$ticket_ban = $ticket->where('id', '=', $id)->first();
|
||||
$ban_email = $ticket_ban->user_id;
|
||||
@@ -417,9 +473,11 @@ class TicketController extends Controller {
|
||||
return "the user has been banned";
|
||||
}
|
||||
|
||||
//============================================
|
||||
// Ticket Assign | Incomplete
|
||||
//============================================
|
||||
/**
|
||||
* function to assign ticket
|
||||
* @param type $id
|
||||
* @return type bool
|
||||
*/
|
||||
public function assign($id) {
|
||||
$UserEmail = Input::get('user');
|
||||
// $UserEmail = 'sujitprasad12@yahoo.in';
|
||||
@@ -431,12 +489,13 @@ class TicketController extends Controller {
|
||||
return 1;
|
||||
}
|
||||
|
||||
//============================================
|
||||
// Internal Note | Incomplete
|
||||
//============================================
|
||||
/**
|
||||
* Function to post internal note
|
||||
* @param type $id
|
||||
* @return type bool
|
||||
*/
|
||||
public function InternalNote($id) {
|
||||
$InternalContent = Input::get('InternalContent');
|
||||
// $InternalContent = 'hello';
|
||||
$thread = Ticket_Thread::where('ticket_id', '=', $id)->first();
|
||||
$NewThread = new Ticket_Thread;
|
||||
$NewThread->ticket_id = $thread->ticket_id;
|
||||
@@ -449,9 +508,11 @@ class TicketController extends Controller {
|
||||
return 1;
|
||||
}
|
||||
|
||||
//============================================
|
||||
// Surrender ticket | Incomplete
|
||||
//============================================
|
||||
/**
|
||||
* Function to surrender a ticket
|
||||
* @param type $id
|
||||
* @return type bool
|
||||
*/
|
||||
public function surrender($id) {
|
||||
$ticket = Tickets::where('id', '=', $id)->first();
|
||||
$ticket->assigned_to = 0;
|
||||
@@ -459,41 +520,57 @@ class TicketController extends Controller {
|
||||
return 1;
|
||||
}
|
||||
|
||||
public function search() {
|
||||
$product = Input::get('type');
|
||||
$word = Input::get('name_startsWith');
|
||||
/**
|
||||
* function to search
|
||||
* @return type
|
||||
*/
|
||||
// public function search() {
|
||||
// $product = Input::get('type');
|
||||
// $word = Input::get('name_startsWith');
|
||||
|
||||
if ($product == 'product') {
|
||||
$starts_with = strtoupper($word);
|
||||
$rows = DB::table('users')->select('user_name')->where('name', 'LIKE', $starts_with . '%')->get();
|
||||
$data = array();
|
||||
foreach ($rows as $row) {
|
||||
array_push($data, $row->name);
|
||||
}
|
||||
print_r(json_encode($data));
|
||||
}
|
||||
// if ($product == 'product') {
|
||||
// $starts_with = strtoupper($word);
|
||||
// $rows = DB::table('users')->select('user_name')->where('name', 'LIKE', $starts_with . '%')->get();
|
||||
// $data = array();
|
||||
// foreach ($rows as $row) {
|
||||
// array_push($data, $row->name);
|
||||
// }
|
||||
// print_r(json_encode($data));
|
||||
// }
|
||||
|
||||
if ($product == 'product_table') {
|
||||
$row_num = Input::get('row_num');
|
||||
$starts_with = strtoupper($word);
|
||||
$rows = DB::table('product')->select('name', 'description', 'cost_price')->where('name', 'LIKE', $starts_with . '%')->get();
|
||||
$data = array();
|
||||
foreach ($rows as $row) {
|
||||
$name = $row->name . '|' . $row->description . '|' . $row->cost_price . '|' . $row_num;
|
||||
array_push($data, $name);
|
||||
}
|
||||
print_r(json_encode($data));
|
||||
}
|
||||
}
|
||||
// if ($product == 'product_table') {
|
||||
// $row_num = Input::get('row_num');
|
||||
// $starts_with = strtoupper($word);
|
||||
// $rows = DB::table('product')->select('name', 'description', 'cost_price')->where('name', 'LIKE', $starts_with . '%')->get();
|
||||
// $data = array();
|
||||
// foreach ($rows as $row) {
|
||||
// $name = $row->name . '|' . $row->description . '|' . $row->cost_price . '|' . $row_num;
|
||||
// array_push($data, $name);
|
||||
// }
|
||||
// print_r(json_encode($data));
|
||||
// }
|
||||
// }
|
||||
|
||||
/**
|
||||
* shows trashed tickets
|
||||
* @return type response
|
||||
*/
|
||||
public function trash() {
|
||||
return view('themes.default1.agent.ticket.trash');
|
||||
}
|
||||
|
||||
/**
|
||||
* shows unassigned tickets
|
||||
* @return type
|
||||
*/
|
||||
public function unassigned() {
|
||||
return view('themes.default1.agent.ticket.unassigned');
|
||||
}
|
||||
|
||||
/**
|
||||
* shows tickets assigned to Auth::user()
|
||||
* @return type
|
||||
*/
|
||||
public function myticket() {
|
||||
return view('themes.default1.agent.ticket.myticket');
|
||||
}
|
||||
|
@@ -1,4 +1,6 @@
|
||||
<?php namespace App\Http\Controllers\Agent;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Agent;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
@@ -15,7 +17,6 @@ use App\Http\Requests\Sys_userRequest;
|
||||
use App\Http\Requests\Sys_userUpdate;
|
||||
|
||||
/* include User Model */
|
||||
use App\Model\Agent_panel\Sys_user;
|
||||
/* include Help_topic Model */
|
||||
|
||||
/* Profile validator */
|
||||
@@ -34,10 +35,24 @@ use Hash;
|
||||
/* Validate post check ticket */
|
||||
use Input;
|
||||
|
||||
/**
|
||||
* UserController
|
||||
*
|
||||
* @package Controllers
|
||||
* @subpackage Controller
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class UserController extends Controller {
|
||||
|
||||
/* Define constructor for Authentication Checking */
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
* constructor to check
|
||||
* 1. authentication
|
||||
* 2. user roles
|
||||
* 3. roles must be agent
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct() {
|
||||
$this->middleware('auth');
|
||||
$this->middleware('role.agent');
|
||||
@@ -46,15 +61,13 @@ class UserController extends Controller {
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return Response
|
||||
* @param type User $user
|
||||
* @return type Response
|
||||
*/
|
||||
public function index(Sys_user $user) {
|
||||
try
|
||||
{
|
||||
public function index(User $user) {
|
||||
try {
|
||||
/* get all values in Sys_user */
|
||||
$users = $user->get();
|
||||
|
||||
$users = $user->where('role', '=', 'user')->get();
|
||||
return view('themes.default1.agent.user.index', compact('users'));
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
@@ -63,12 +76,10 @@ class UserController extends Controller {
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return Response
|
||||
* @return type Response
|
||||
*/
|
||||
public function create() {
|
||||
try
|
||||
{
|
||||
try {
|
||||
return view('themes.default1.agent.user.create');
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
@@ -77,17 +88,19 @@ class UserController extends Controller {
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @return Response
|
||||
* @param type User $user
|
||||
* @param type Sys_userRequest $request
|
||||
* @return type Response
|
||||
*/
|
||||
public function store(Sys_user $user, Sys_userRequest $request) {
|
||||
try
|
||||
{
|
||||
public function store(User $user, Sys_userRequest $request) {
|
||||
try {
|
||||
/* insert the input request to sys_user table */
|
||||
|
||||
/* Check whether function success or not */
|
||||
|
||||
if ($user->fill($request->input())->save() == true) {
|
||||
$user->email = $request->input('email');
|
||||
$user->user_name = $request->input('full_name');
|
||||
$user->phone_number = $request->input('phone');
|
||||
$user->role = 'user';
|
||||
if ($user->save() == true) {
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('user')->with('success', 'User Created Successfully');
|
||||
} else {
|
||||
@@ -98,21 +111,18 @@ class UserController extends Controller {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('user')->with('fails', 'User can not Create');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
* @param type int $id
|
||||
* @param type User $user
|
||||
* @return type Response
|
||||
*/
|
||||
public function show($id, Sys_user $user) {
|
||||
try
|
||||
{
|
||||
public function show($id, User $user) {
|
||||
try {
|
||||
/* select the field where id = $id(request Id) */
|
||||
$users = $user->whereId($id)->first();
|
||||
|
||||
return view('themes.default1.agent.user.show', compact('users'));
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
@@ -121,38 +131,33 @@ class UserController extends Controller {
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
* @param type int $id
|
||||
* @param type User $user
|
||||
* @return type Response
|
||||
*/
|
||||
public function edit($id, Sys_user $user) {
|
||||
try
|
||||
{
|
||||
public function edit($id, User $user) {
|
||||
try {
|
||||
/* select the field where id = $id(request Id) */
|
||||
$users = $user->whereId($id)->first();
|
||||
|
||||
return view('themes.default1.agent.user.edit', compact('users'));
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
* @param type int $id
|
||||
* @param type User $user
|
||||
* @param type Sys_userUpdate $request
|
||||
* @return type Response
|
||||
*/
|
||||
public function update($id, Sys_user $user, Sys_userUpdate $request) {
|
||||
try
|
||||
{
|
||||
public function update($id, User $user, Sys_userUpdate $request) {
|
||||
try {
|
||||
/* select the field where id = $id(request Id) */
|
||||
$users = $user->whereId($id)->first();
|
||||
|
||||
/* Update the value by selected field */
|
||||
/* Check whether function success or not */
|
||||
|
||||
if ($users->fill($request->input())->save() == true) {
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('user')->with('success', 'User Updated Successfully');
|
||||
@@ -164,24 +169,20 @@ class UserController extends Controller {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('user')->with('fails', 'User can not Update');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
* @param type int $id
|
||||
* @param type User $user
|
||||
* @return type Response
|
||||
*/
|
||||
public function destroy($id, Sys_user $user) {
|
||||
try
|
||||
{
|
||||
public function destroy($id, User $user) {
|
||||
try {
|
||||
/* select the field where id = $id(request Id) */
|
||||
$users = $user->whereId($id)->first();
|
||||
|
||||
/* delete the selected field */
|
||||
/* Check whether function success or not */
|
||||
|
||||
if ($users->delete() == true) {
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('user')->with('success', 'User Deleted Successfully');
|
||||
@@ -194,57 +195,63 @@ class UserController extends Controller {
|
||||
return redirect('user')->with('fails', 'User can not Delete');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* get profile page
|
||||
* @return type Response
|
||||
*/
|
||||
public function getProfile() {
|
||||
$user = Auth::user();
|
||||
return view('themes.default1.agent.user.profile', compact('user'));
|
||||
}
|
||||
|
||||
/**
|
||||
* post profile page
|
||||
* @param type int $id
|
||||
* @param type ProfileRequest $request
|
||||
* @return type Response
|
||||
*/
|
||||
public function postProfile($id, ProfileRequest $request) {
|
||||
$user = Auth::user();
|
||||
$user->gender = $request->input('gender');
|
||||
$user->save();
|
||||
|
||||
if ($user->profile_pic == 'avatar5.png' || $user->profile_pic == 'avatar2.png') {
|
||||
if ($request->input('gender') == 1) {
|
||||
|
||||
$name = 'avatar5.png';
|
||||
$destinationPath = 'dist/img';
|
||||
$user->profile_pic = $name;
|
||||
} elseif ($request->input('gender') == 0) {
|
||||
|
||||
$name = 'avatar2.png';
|
||||
$destinationPath = 'dist/img';
|
||||
$user->profile_pic = $name;
|
||||
}
|
||||
}
|
||||
|
||||
if (Input::file('profile_pic')) {
|
||||
//$extension = Input::file('profile_pic')->getClientOriginalExtension();
|
||||
$name = Input::file('profile_pic')->getClientOriginalName();
|
||||
|
||||
$destinationPath = 'dist/img';
|
||||
$fileName = rand(0000, 9999) . '.' . $name;
|
||||
//echo $fileName;
|
||||
|
||||
Input::file('profile_pic')->move($destinationPath, $fileName);
|
||||
|
||||
$user->profile_pic = $fileName;
|
||||
|
||||
} else {
|
||||
$user->fill($request->except('profile_pic', 'gender'))->save();
|
||||
return redirect('guest')->with('success', 'Profile Updated sucessfully');
|
||||
|
||||
}
|
||||
|
||||
if ($user->fill($request->except('profile_pic'))->save()) {
|
||||
return redirect('guest')->with('success', 'Profile Updated sucessfully');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Post profile password
|
||||
* @param type int $id
|
||||
* @param type ProfilePassword $request
|
||||
* @return type Response
|
||||
*/
|
||||
public function postProfilePassword($id, ProfilePassword $request) {
|
||||
$user = Auth::user();
|
||||
//echo $user->password;
|
||||
|
||||
if (Hash::check($request->input('old_password'), $user->getAuthPassword())) {
|
||||
$user->password = Hash::make($request->input('new_password'));
|
||||
$user->save();
|
||||
@@ -253,5 +260,4 @@ class UserController extends Controller {
|
||||
return redirect('guest')->with('fails', 'Password was not Updated');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,48 +1,38 @@
|
||||
<?php namespace App\Http\Controllers\Auth;
|
||||
|
||||
<?php
|
||||
namespace App\Http\Controllers\Auth;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Requests\LoginRequest;
|
||||
use App\Http\Requests\RegisterRequest;
|
||||
use App\User;
|
||||
/* include User Model */
|
||||
use Hash;
|
||||
/* Include RegisterRequest */
|
||||
use Illuminate\Contracts\Auth\Guard;
|
||||
/* Register validation */
|
||||
use Illuminate\Contracts\Auth\Registrar;
|
||||
use Illuminate\Foundation\Auth\AuthenticatesAndRegistersUsers;
|
||||
|
||||
/* include User Model */
|
||||
use App\User;
|
||||
|
||||
/* Include RegisterRequest */
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
/* Register validation */
|
||||
use App\Http\Requests\RegisterRequest;
|
||||
|
||||
use Hash;
|
||||
|
||||
/* Include login validator */
|
||||
use Mail;
|
||||
|
||||
/* Include login validator */
|
||||
use App\Http\Requests\LoginRequest;
|
||||
|
||||
|
||||
/**
|
||||
* ---------------------------------------------------
|
||||
* AuthController
|
||||
* ---------------------------------------------------
|
||||
* This controller handles the registration of new users, as well as the
|
||||
* authentication of existing users. By default, this controller uses
|
||||
* a simple trait to add these behaviors. Why don't you explore it?
|
||||
*
|
||||
* @package Controllers
|
||||
* @subpackage Controller
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class AuthController extends Controller {
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Registration & Login Controller
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This controller handles the registration of new users, as well as the
|
||||
| authentication of existing users. By default, this controller uses
|
||||
| a simple trait to add these behaviors. Why don't you explore it?
|
||||
|
|
||||
*/
|
||||
|
||||
use AuthenticatesAndRegistersUsers;
|
||||
|
||||
/* to redirect after login */
|
||||
protected $redirectTo = '/';
|
||||
|
||||
/* Direct After Logout */
|
||||
protected $redirectAfterLogout = '/';
|
||||
|
||||
protected $loginPath = '/auth/login';
|
||||
|
||||
/**
|
||||
@@ -52,126 +42,99 @@ class AuthController extends Controller {
|
||||
* @param \Illuminate\Contracts\Auth\Registrar $registrar
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Guard $auth, Registrar $registrar)
|
||||
{
|
||||
public function __construct(Guard $auth, Registrar $registrar) {
|
||||
$this->auth = $auth;
|
||||
$this->registrar = $registrar;
|
||||
|
||||
$this->middleware('guest', ['except' => 'getLogout']);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* Get the form for registration */
|
||||
/**
|
||||
* Get the form for registration
|
||||
* @return type Response
|
||||
*/
|
||||
public function getRegister() {
|
||||
return view('auth.register');
|
||||
}
|
||||
|
||||
public function getRegister()
|
||||
|
||||
{
|
||||
|
||||
return view('auth.register');
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function postRegister(User $user, RegisterRequest $request)
|
||||
|
||||
{
|
||||
|
||||
|
||||
|
||||
$password = Hash::make($request->input('password'));
|
||||
$user->password = $password;
|
||||
|
||||
$name = $request->input('full_name');
|
||||
$user->name = $name;
|
||||
|
||||
$user->email = $request->input('email');
|
||||
|
||||
// $user->first_name = $request->input('first_name');
|
||||
|
||||
// $user->last_nmae = $request->input('last_nmae');
|
||||
|
||||
// $user->phone_number = $request->input('phone_number');
|
||||
|
||||
// $user->company = $request->input('company');
|
||||
|
||||
$user->role = 'user';
|
||||
|
||||
$code = str_random(60);
|
||||
/**
|
||||
* Post registration form
|
||||
* @param type User $user
|
||||
* @param type RegisterRequest $request
|
||||
* @return type Response
|
||||
*/
|
||||
public function postRegister(User $user, RegisterRequest $request) {
|
||||
$password = Hash::make($request->input('password'));
|
||||
$user->password = $password;
|
||||
$name = $request->input('full_name');
|
||||
$user->name = $name;
|
||||
$user->email = $request->input('email');
|
||||
// $user->first_name = $request->input('first_name');
|
||||
// $user->last_nmae = $request->input('last_nmae');
|
||||
// $user->phone_number = $request->input('phone_number');
|
||||
// $user->company = $request->input('company');
|
||||
$user->role = 'user';
|
||||
$code = str_random(60);
|
||||
$user->remember_token = $code;
|
||||
|
||||
$user->save();
|
||||
// send mail for successful registration
|
||||
$mail = Mail::send('auth.activate', array('link' => url('getmail', $code), 'username' => $name), function ($message) use ($user) {
|
||||
$message->to($user->email, $user->full_name)->subject('active your account');
|
||||
});
|
||||
return redirect('guest')->with('success', 'Activate Your Account ! Click on Link that send to your mail');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get mail function
|
||||
* @param type $token
|
||||
* @param type User $user
|
||||
* @return type Response
|
||||
*/
|
||||
public function getMail($token, User $user) {
|
||||
$user = $user->where('remember_token', $token)->where('active', 0)->first();
|
||||
if ($user) {
|
||||
$user->active = 1;
|
||||
$user->save();
|
||||
return redirect('auth/login');
|
||||
} else {
|
||||
return redirect('auth/login');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
$mail = Mail::send('auth.activate', array('link' => url('getmail', $code), 'username' => $name), function($message) use($user) {
|
||||
$message->to($user->email, $user->full_name)->subject('active your account');
|
||||
});
|
||||
|
||||
return redirect('guest')->with('success','Activate Your Account ! Click on Link that send to your mail');
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function getMail($token, User $user)
|
||||
{
|
||||
$user = $user->where('remember_token',$token)->where('active',0)->first();
|
||||
//dd($user);
|
||||
if($user)
|
||||
{
|
||||
$user->active = 1;
|
||||
|
||||
$user->save();
|
||||
|
||||
return redirect('auth/login');
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
return redirect('auth/login');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function getLogin()
|
||||
{
|
||||
/**
|
||||
* Get login page
|
||||
* @return type Response
|
||||
*/
|
||||
public function getLogin() {
|
||||
return view('auth.login');
|
||||
}
|
||||
|
||||
/* Post of login page */
|
||||
public function postLogin(LoginRequest $request )
|
||||
{
|
||||
/**
|
||||
* Post of login page
|
||||
* @param type LoginRequest $request
|
||||
* @return type Response
|
||||
*/
|
||||
public function postLogin(LoginRequest $request) {
|
||||
// $email = $request->input('email');
|
||||
|
||||
// $password = Hash::make($request->input('password'));
|
||||
|
||||
// $remember = $request->input('remember');
|
||||
|
||||
// dd([$email,$password,$remember]);
|
||||
|
||||
$credentials = $request->only('email', 'password');
|
||||
|
||||
if ($this->auth->attempt($credentials, $request->has('remember')))
|
||||
{
|
||||
if ($this->auth->attempt($credentials, $request->has('remember'))) {
|
||||
return redirect()->intended($this->redirectPath());
|
||||
}
|
||||
return redirect($this->loginPath())
|
||||
->withInput($request->only('email', 'remember'))
|
||||
->withErrors([
|
||||
'email' => $this->getFailedLoginMessage(),
|
||||
'password'=>$this->getFailedLoginMessage()
|
||||
]);
|
||||
|
||||
|
||||
->withInput($request->only('email', 'remember'))
|
||||
->withErrors([
|
||||
'email' => $this->getFailedLoginMessage(),
|
||||
'password' => $this->getFailedLoginMessage(),
|
||||
]);
|
||||
}
|
||||
|
||||
protected function getFailedLoginMessage()
|
||||
{
|
||||
/**
|
||||
* Get Failed login message
|
||||
* @return type string
|
||||
*/
|
||||
protected function getFailedLoginMessage() {
|
||||
return 'This Field do not match our records.';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}\
|
||||
|
@@ -1,23 +1,21 @@
|
||||
<?php namespace App\Http\Controllers\Auth;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Contracts\Auth\Guard;
|
||||
use Illuminate\Contracts\Auth\PasswordBroker;
|
||||
use Illuminate\Foundation\Auth\ResetsPasswords;
|
||||
|
||||
/**
|
||||
* PasswordController
|
||||
*
|
||||
* @package Controllers
|
||||
* @subpackage Controller
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class PasswordController extends Controller {
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Password Reset Controller
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This controller is responsible for handling password reset requests
|
||||
| and uses a simple trait to include this behavior. You're free to
|
||||
| explore this trait and override any methods you wish to tweak.
|
||||
|
|
||||
*/
|
||||
|
||||
use ResetsPasswords;
|
||||
|
||||
/**
|
||||
@@ -27,12 +25,9 @@ class PasswordController extends Controller {
|
||||
* @param \Illuminate\Contracts\Auth\PasswordBroker $passwords
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Guard $auth, PasswordBroker $passwords)
|
||||
{
|
||||
public function __construct(Guard $auth, PasswordBroker $passwords) {
|
||||
$this->auth = $auth;
|
||||
$this->passwords = $passwords;
|
||||
|
||||
$this->middleware('guest');
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,40 +1,35 @@
|
||||
<?php namespace App\Http\Controllers;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Http\Requests;
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
use App\Model\Agent\Teams;
|
||||
|
||||
use App\Model\Agent\Assign_team_agent;
|
||||
|
||||
use DB;
|
||||
|
||||
class CheckController extends Controller {
|
||||
|
||||
public function getcheck(Teams $team, Assign_team_agent $team_assign_agent)
|
||||
{
|
||||
$table = $team_assign_agent->where('agent_id',1)->first();
|
||||
$teams = $team->lists('id','name');
|
||||
|
||||
$assign = $team_assign_agent->where('agent_id',1)->lists('team_id');
|
||||
|
||||
public function getcheck(Teams $team, Assign_team_agent $team_assign_agent) {
|
||||
$table = $team_assign_agent->where('agent_id', 1)->first();
|
||||
$teams = $team->lists('id', 'name');
|
||||
|
||||
return view('themes.check',compact('teams','assign','table'));
|
||||
}
|
||||
$assign = $team_assign_agent->where('agent_id', 1)->lists('team_id');
|
||||
|
||||
public function postcheck($id, Assign_team_agent $team_assign_agent, Request $request)
|
||||
{
|
||||
$table = $team_assign_agent->where('agent_id',1);
|
||||
$table->delete();
|
||||
|
||||
$requests = $request->input('team_id');
|
||||
|
||||
foreach($requests as $req)
|
||||
{
|
||||
DB::insert('insert into team_assign_agent (team_id, agent_id) values (?,?)', [$req, $id]);
|
||||
|
||||
}
|
||||
}
|
||||
return view('themes.check', compact('teams', 'assign', 'table'));
|
||||
}
|
||||
|
||||
public function postcheck($id, Assign_team_agent $team_assign_agent, Request $request) {
|
||||
$table = $team_assign_agent->where('agent_id', 1);
|
||||
$table->delete();
|
||||
|
||||
$requests = $request->input('team_id');
|
||||
|
||||
foreach ($requests as $req) {
|
||||
DB::insert('insert into team_assign_agent (team_id, agent_id) values (?,?)', [$req, $id]);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,4 +1,6 @@
|
||||
<?php namespace App\Http\Controllers;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Foundation\Bus\DispatchesCommands;
|
||||
use Illuminate\Routing\Controller as BaseController;
|
||||
@@ -6,6 +8,6 @@ use Illuminate\Foundation\Validation\ValidatesRequests;
|
||||
|
||||
abstract class Controller extends BaseController {
|
||||
|
||||
use DispatchesCommands, ValidatesRequests;
|
||||
|
||||
use DispatchesCommands,
|
||||
ValidatesRequests;
|
||||
}
|
||||
|
@@ -1,7 +1,14 @@
|
||||
<?php namespace App\Http\Controllers\Error;
|
||||
|
||||
<?php
|
||||
namespace App\Http\Controllers\Error;
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
/**
|
||||
* ErrorController
|
||||
*
|
||||
* @package Controllers
|
||||
* @subpackage Controller
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class ErrorController extends Controller {
|
||||
|
||||
/**
|
||||
@@ -12,5 +19,4 @@ class ErrorController extends Controller {
|
||||
public function error404() {
|
||||
return view('404');
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,121 +1,102 @@
|
||||
<?php namespace App\Http\Controllers\Guest;
|
||||
|
||||
use App\Http\Requests;
|
||||
<?php
|
||||
namespace App\Http\Controllers\Guest;
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
/* include help topic model */
|
||||
use App\Model\Manage\Help_topic;
|
||||
|
||||
use App\Model\Form\Form_details;
|
||||
/* Include form_name model */
|
||||
use App\Model\Form\Form_name;
|
||||
|
||||
/*include form_detals model*/
|
||||
use App\Model\Form\Form_details;
|
||||
|
||||
/* include form_detals model */
|
||||
/* Include form_value model */
|
||||
use App\Model\Form\Form_value;
|
||||
|
||||
use App\Model\Manage\Help_topic;
|
||||
use App\User;
|
||||
|
||||
use Form;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
/* Validate form TicketForm using */
|
||||
use Input;
|
||||
|
||||
use DB;
|
||||
|
||||
/* Validate form TicketForm using */
|
||||
use App\Http\Requests\TicketForm;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* FormController
|
||||
*
|
||||
* @package Controllers
|
||||
* @subpackage Controller
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class FormController extends Controller {
|
||||
|
||||
/* constructor for authentication */
|
||||
|
||||
|
||||
|
||||
/* function for crate form */
|
||||
|
||||
|
||||
/* This Function to get the form for the ticket */
|
||||
|
||||
public function getForm(Form_name $name, Form_details $details, Help_topic $topics)
|
||||
{
|
||||
/**
|
||||
* This Function to get the form for the ticket
|
||||
* @param type Form_name $name
|
||||
* @param type Form_details $details
|
||||
* @param type Help_topic $topics
|
||||
* @return type Response
|
||||
*/
|
||||
public function getForm(Form_name $name, Form_details $details, Help_topic $topics) {
|
||||
// name of the form where status==1
|
||||
$name = $name->where('status',1)->get();
|
||||
|
||||
$name = $name->where('status', 1)->get();
|
||||
//get label and the type from form_detail table where form_name_id of form_detail
|
||||
// equal to form_name table's id
|
||||
$ids = $name->where('id',2);
|
||||
foreach($ids as $i)
|
||||
{
|
||||
$ids = $name->where('id', 2);
|
||||
foreach ($ids as $i) {
|
||||
$id = $i->id;
|
||||
}
|
||||
|
||||
|
||||
//get form_name_id from form_detail and save to detail_form_name_id
|
||||
$detail_form_name_id = $details->where('form_name_id',$id)->get();
|
||||
$detail_form_name_id = $details->where('form_name_id', $id)->get();
|
||||
$count = count($detail_form_name_id);
|
||||
// foreach($detail_form_name_id as $details)
|
||||
// {
|
||||
// echo $details->label;
|
||||
// }
|
||||
return view('themes.default1.client.guest-user.form',compact('name','detail_form_name_id','topics'));
|
||||
// echo $details->label;
|
||||
// }
|
||||
return view('themes.default1.client.guest-user.form', compact('name', 'detail_form_name_id', 'topics'));
|
||||
}
|
||||
|
||||
/* This Function to post the form for the ticket */
|
||||
|
||||
public function postForm(Form_name $name, Form_details $details)
|
||||
{
|
||||
|
||||
$name = $name->where('status',1)->get();
|
||||
$ids = $name->where('id',2);
|
||||
foreach($ids as $i)
|
||||
{
|
||||
/**
|
||||
* This Function to post the form for the ticket
|
||||
* @param type Form_name $name
|
||||
* @param type Form_details $details
|
||||
* @return type string
|
||||
*/
|
||||
public function postForm(Form_name $name, Form_details $details) {
|
||||
$name = $name->where('status', 1)->get();
|
||||
$ids = $name->where('id', 2);
|
||||
foreach ($ids as $i) {
|
||||
$id = $i->id;
|
||||
//echo $id;
|
||||
}
|
||||
|
||||
$field=$details->where('form_name_id',$id)->get();
|
||||
|
||||
$var=" ";
|
||||
|
||||
foreach ($field as $key) {
|
||||
$type=$key->type;
|
||||
$label=$key->label;
|
||||
$var.=",".$type."-".$label;
|
||||
}
|
||||
return $var;
|
||||
|
||||
|
||||
// foreach($outs as $out)
|
||||
// {
|
||||
// return $out;
|
||||
// }
|
||||
|
||||
// $var=" ";
|
||||
|
||||
// foreach ($field as $key) {
|
||||
// $field=$key->field_name;
|
||||
// $id=$key->form_id;
|
||||
// $var.=",".$field;
|
||||
// }
|
||||
// return $var;
|
||||
// // $var=$field.$id;
|
||||
// // return
|
||||
// // return Response::json(array(
|
||||
// // 'field' => $field,
|
||||
// // 'id' => $id
|
||||
// // ));
|
||||
|
||||
$field = $details->where('form_name_id', $id)->get();
|
||||
$var = " ";
|
||||
foreach ($field as $key) {
|
||||
$type = $key->type;
|
||||
$label = $key->label;
|
||||
$var .= "," . $type . "-" . $label;
|
||||
}
|
||||
return $var;
|
||||
// foreach($outs as $out)
|
||||
// {
|
||||
// return $out;
|
||||
// }
|
||||
// $var=" ";
|
||||
// foreach ($field as $key) {
|
||||
// $field=$key->field_name;
|
||||
// $id=$key->form_id;
|
||||
// $var.=",".$field;
|
||||
// }
|
||||
// return $var;
|
||||
// // $var=$field.$id;
|
||||
// // return
|
||||
// // return Response::json(array(
|
||||
// // 'field' => $field,
|
||||
// // 'id' => $id
|
||||
// // ));
|
||||
}
|
||||
public function postedForm(Request $request, User $user)
|
||||
{
|
||||
|
||||
/**
|
||||
* Posted form
|
||||
* @param type Request $request
|
||||
* @param type User $user
|
||||
*/
|
||||
public function postedForm(Request $request, User $user) {
|
||||
$user->name = $request->input('Name');
|
||||
$user->email = $request->input('Email');
|
||||
$user->save();
|
||||
$user->save();
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,140 +1,149 @@
|
||||
<?php namespace App\Http\Controllers\Guest;
|
||||
<?php
|
||||
namespace App\Http\Controllers\Guest;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Requests\CheckTicket;
|
||||
use App\Http\Requests\ProfilePassword;
|
||||
|
||||
/* include guest_note model */
|
||||
use App\Http\Requests\ProfileRequest;
|
||||
|
||||
/* include User Model */
|
||||
use App\Http\Requests\TicketRequest;
|
||||
use App\Model\Manage\Help_topic;
|
||||
use App\Model\Ticket\Tickets;
|
||||
/* include Help_topic Model */
|
||||
use App\Model\Ticket\Ticket_Thread;
|
||||
|
||||
/* Profile validator */
|
||||
use App\User;
|
||||
|
||||
/* Profile Password validator */
|
||||
use Auth;
|
||||
|
||||
/* include ticket_thred model */
|
||||
use Hash;
|
||||
|
||||
/* include tickets model */
|
||||
|
||||
/* TicketRequest to validate the ticket response */
|
||||
use Input;
|
||||
|
||||
/* Validate post check ticket */
|
||||
|
||||
/**
|
||||
* GuestController
|
||||
*
|
||||
* @package Controllers
|
||||
* @subpackage Controller
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class GuestController extends Controller {
|
||||
|
||||
/* Define constructor for Authentication Checking */
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
* @return type void
|
||||
*/
|
||||
public function __construct() {
|
||||
$this->middleware('auth');
|
||||
$this->middleware('role.user');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get profile
|
||||
* @return type Response
|
||||
*/
|
||||
public function getProfile() {
|
||||
$user = Auth::user();
|
||||
return view('themes.default1.client.guest-user.profile', compact('user'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Save profile data
|
||||
* @param type $id
|
||||
* @param type ProfileRequest $request
|
||||
* @return type Response
|
||||
*/
|
||||
public function postProfile($id, ProfileRequest $request) {
|
||||
$user = Auth::user();
|
||||
$user->gender = $request->input('gender');
|
||||
$user->save();
|
||||
|
||||
if ($user->profile_pic == 'avatar5.png' || $user->profile_pic == 'avatar2.png') {
|
||||
if ($request->input('gender') == 1) {
|
||||
|
||||
$name = 'avatar5.png';
|
||||
$destinationPath = 'dist/img';
|
||||
$user->profile_pic = $name;
|
||||
} elseif ($request->input('gender') == 0) {
|
||||
|
||||
$name = 'avatar2.png';
|
||||
$destinationPath = 'dist/img';
|
||||
$user->profile_pic = $name;
|
||||
}
|
||||
}
|
||||
|
||||
if (Input::file('profile_pic')) {
|
||||
//$extension = Input::file('profile_pic')->getClientOriginalExtension();
|
||||
$name = Input::file('profile_pic')->getClientOriginalName();
|
||||
|
||||
$destinationPath = 'dist/img';
|
||||
$fileName = rand(0000, 9999) . '.' . $name;
|
||||
//echo $fileName;
|
||||
|
||||
Input::file('profile_pic')->move($destinationPath, $fileName);
|
||||
|
||||
$user->profile_pic = $fileName;
|
||||
|
||||
} else {
|
||||
$user->fill($request->except('profile_pic', 'gender'))->save();
|
||||
return redirect('guest')->with('success', 'Profile Updated sucessfully');
|
||||
|
||||
}
|
||||
|
||||
if ($user->fill($request->except('profile_pic'))->save()) {
|
||||
return redirect('guest')->with('success', 'Profile Updated sucessfully');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Ticket page
|
||||
* @param type Help_topic $topic
|
||||
* @return type Response
|
||||
*/
|
||||
public function getTicket(Help_topic $topic) {
|
||||
$topics = $topic->get();
|
||||
return view('themes.default1.client.guest-user.form', compact('topics'));
|
||||
}
|
||||
|
||||
/*Get my ticket*/
|
||||
/**
|
||||
* Get my ticket
|
||||
* @param type Tickets $tickets
|
||||
* @param type Ticket_Thread $thread
|
||||
* @param type User $user
|
||||
* @return type Response
|
||||
*/
|
||||
public function getMyticket(Tickets $tickets, Ticket_Thread $thread, User $user) {
|
||||
$id = Auth::user()->id;
|
||||
/* Get the user where id == $id */
|
||||
$user = $user->whereId($id)->first();
|
||||
|
||||
/* Get the all tickets which belongs to the current user */
|
||||
$tickets = $tickets->where('user_id', $user->id)->get();
|
||||
//dd($tickets);
|
||||
|
||||
/* get the ticket's id == ticket_id of thread */
|
||||
$ticket = $tickets->where('user_id', $user->id)->first();
|
||||
|
||||
/* get the thread of the selected ticket */
|
||||
$thread = $thread->where('ticket_id', $ticket->id)->first();
|
||||
|
||||
return view('themes.default1.agent.ticket.ticket', compact('thread', 'tickets'));
|
||||
}
|
||||
|
||||
/*Get ticket-thread*/
|
||||
/**
|
||||
* Get ticket-thread
|
||||
* @param type Ticket_Thread $thread
|
||||
* @param type Tickets $tickets
|
||||
* @param type User $user
|
||||
* @return type Response
|
||||
*/
|
||||
public function thread(Ticket_Thread $thread, Tickets $tickets, User $user) {
|
||||
|
||||
$user_id = Auth::user()->id;
|
||||
//dd($user_id);
|
||||
|
||||
/* get the ticket's id == ticket_id of thread */
|
||||
$tickets = $tickets->where('user_id', '=', $user_id)->first();
|
||||
//dd($ticket);
|
||||
|
||||
$thread = $thread->where('ticket_id', $tickets->id)->first();
|
||||
//dd($thread);
|
||||
// $tickets = $tickets->whereId($id)->first();
|
||||
|
||||
return view('themes.default1.agent.ticket.timeline', compact('thread', 'tickets'));
|
||||
}
|
||||
|
||||
/* ticket Edit */
|
||||
/**
|
||||
* ticket Edit
|
||||
* @return
|
||||
*/
|
||||
public function ticketEdit() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Post porfile password
|
||||
* @param type $id
|
||||
* @param type ProfilePassword $request
|
||||
* @return type Response
|
||||
*/
|
||||
public function postProfilePassword($id, ProfilePassword $request) {
|
||||
$user = Auth::user();
|
||||
//echo $user->password;
|
||||
|
||||
if (Hash::check($request->input('old_password'), $user->getAuthPassword())) {
|
||||
$user->password = Hash::make($request->input('new_password'));
|
||||
$user->save();
|
||||
@@ -144,11 +153,13 @@ class GuestController extends Controller {
|
||||
}
|
||||
}
|
||||
|
||||
//============================================
|
||||
// Ticket reply | Incomplete
|
||||
//============================================
|
||||
/**
|
||||
* Ticekt reply
|
||||
* @param type Ticket_Thread $thread
|
||||
* @param type TicketRequest $request
|
||||
* @return type Response
|
||||
*/
|
||||
public function reply(Ticket_Thread $thread, TicketRequest $request) {
|
||||
|
||||
$thread->ticket_id = $request->input('ticket_ID');
|
||||
$thread->title = $request->input('To');
|
||||
$thread->user_id = Auth::user()->id;
|
||||
@@ -161,31 +172,39 @@ class GuestController extends Controller {
|
||||
// return 'success';
|
||||
return Redirect("thread/" . $ticket_id);
|
||||
}
|
||||
public function getCheckTicket(Tickets $ticket, User $user) {
|
||||
|
||||
/**
|
||||
* Get Checked ticket
|
||||
* @param type Tickets $ticket
|
||||
* @param type User $user
|
||||
* @return type response
|
||||
*/
|
||||
public function getCheckTicket(Tickets $ticket, User $user) {
|
||||
return view('themes.default1.client.guest-user.newticket', compact('ticket'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Post Check ticket
|
||||
* @param type CheckTicket $request
|
||||
* @param type User $user
|
||||
* @param type Tickets $ticket
|
||||
* @param type Ticket_Thread $thread
|
||||
* @return type Response
|
||||
*/
|
||||
public function PostCheckTicket(CheckTicket $request, User $user, Tickets $ticket, Ticket_Thread $thread) {
|
||||
try
|
||||
{
|
||||
try {
|
||||
$user = $user->where('email', $request->input('email'))->first();
|
||||
$tickets = $ticket->where('ticket_number', $request->input('ticket_number'))->first();
|
||||
|
||||
if ($user && $tickets) {
|
||||
//$user = $user->where('email',$request->input('email'))->first();
|
||||
$user_id = $user->id;
|
||||
|
||||
//$ticket = $ticket->where('user_id',$user_id)->first();
|
||||
//$ticket_number = $ticket->ticket_number;
|
||||
|
||||
$thread = $thread->where('user_id', $user_id)->first();
|
||||
return view('themes.default1.client.guest-user.checkticket', compact('user', 'tickets', 'thread'));
|
||||
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
return redirect('checkticket')->with('fails', 'Enter valid Inputs');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,8 +1,15 @@
|
||||
<?php namespace App\Http\Controllers\Guest;
|
||||
|
||||
<?php
|
||||
namespace App\Http\Controllers\Guest;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Model\Settings\System;
|
||||
|
||||
/**
|
||||
* OuthouseController
|
||||
*
|
||||
* @package Controllers
|
||||
* @subpackage Controller
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class OuthouseController extends Controller {
|
||||
|
||||
/**
|
||||
|
@@ -1,36 +1,35 @@
|
||||
<?php namespace App\Http\Controllers;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
class HomeController extends Controller {
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Home Controller
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This controller renders your application's "dashboard" for users that
|
||||
| are authenticated. Of course, you are free to change or remove the
|
||||
| controller as you wish. It is just here to get your app started!
|
||||
|
|
||||
*/
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Home Controller
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This controller renders your application's "dashboard" for users that
|
||||
| are authenticated. Of course, you are free to change or remove the
|
||||
| controller as you wish. It is just here to get your app started!
|
||||
|
|
||||
*/
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct() {
|
||||
$this->middleware('auth');
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('auth');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the application dashboard to the user.
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
return view('themes/default1/admin/dashboard');
|
||||
}
|
||||
/**
|
||||
* Show the application dashboard to the user.
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function index() {
|
||||
return view('themes/default1/admin/dashboard');
|
||||
}
|
||||
|
||||
}
|
||||
|
392
code/app/Http/Controllers/Installer/InstallController.php
Normal file
392
code/app/Http/Controllers/Installer/InstallController.php
Normal file
@@ -0,0 +1,392 @@
|
||||
<?php
|
||||
namespace App\Http\Controllers\Installer;
|
||||
|
||||
// /**
|
||||
// * |=======================================================================
|
||||
// * |Class: InstallController
|
||||
// * |=======================================================================
|
||||
// *
|
||||
// * Class to perform the first install operation without this the database
|
||||
// * settings could not be started
|
||||
// *
|
||||
// * @package epaper-pdf
|
||||
// * @subpackage Controller
|
||||
// * @author Ladybird <info@ladybirdweb.com>
|
||||
// *
|
||||
// */
|
||||
class InstallController extends Controller {
|
||||
|
||||
// /**
|
||||
// * Get Licence (step 1)
|
||||
// *
|
||||
// * validating licence agreement
|
||||
// */
|
||||
// public function licence(){
|
||||
// if(Config::get('database.install')=='%0%')
|
||||
// {
|
||||
// return View::make('themes/ep-install/default1/display/view1');
|
||||
// }
|
||||
// else{
|
||||
// return Redirect::route('account-sign-In');
|
||||
// }
|
||||
// }
|
||||
|
||||
// /**
|
||||
// * Post Licencecheck
|
||||
// *
|
||||
// * Validating licence agreement
|
||||
// */
|
||||
// public function licencecheck() {
|
||||
// $accept = (Input::has('accept1')) ? true : false;
|
||||
// if ($accept == 'accept') {
|
||||
// Session::put('step1','step1');
|
||||
// return Redirect::route('prerequisites');
|
||||
// } else {
|
||||
// return Redirect::route('licence')->with('fails', 'Failed! first accept the licence agreeement');
|
||||
// }
|
||||
// }
|
||||
|
||||
// /**
|
||||
// * Get prerequisites (step 2)
|
||||
// *
|
||||
// * Checking the extensions enabled required for installing the e-paper pdf
|
||||
// * without which the project cannot be executed properly
|
||||
// *
|
||||
// */
|
||||
// public function prerequisites() {
|
||||
// if(Config::get('database.install')=='%0%')
|
||||
// {
|
||||
// if(Session::get('step1')=='step1'){
|
||||
// return View::make('themes/ep-install/default1/display/view2');
|
||||
// } else {
|
||||
// return Redirect::route('licence');
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// return Redirect::route('account-sign-In');
|
||||
// }
|
||||
// }
|
||||
|
||||
// /**
|
||||
// * Post Prerequisitescheck
|
||||
// *
|
||||
// * checking prerequisites
|
||||
// */
|
||||
// public function prerequisitescheck() {
|
||||
// Session::put('step2','step2');
|
||||
// return Redirect::route('localization');
|
||||
// }
|
||||
|
||||
// /**
|
||||
// * Get Localization (step 3)
|
||||
// *
|
||||
// * Requesting user recomended settings for installation
|
||||
// */
|
||||
// public function localization() {
|
||||
// if(Config::get('database.install')=='%0%')
|
||||
// {
|
||||
// if(Session::get('step2')=='step2'){
|
||||
// return View::make('themes/ep-install/default1/display/view3');
|
||||
// } else {
|
||||
// return Redirect::route('prerequisites');
|
||||
// }
|
||||
// }
|
||||
// else{
|
||||
// return Redirect::route('account-sign-In');
|
||||
// }
|
||||
// }
|
||||
|
||||
// /**
|
||||
// * Post localizationcheck
|
||||
// *
|
||||
// * checking prerequisites
|
||||
// */
|
||||
// public function localizationcheck() {
|
||||
|
||||
// Session::put('step3','step3');
|
||||
|
||||
// Session::put('language', Input::get('language'));
|
||||
// Session::put('timezone', Input::get('timezone'));
|
||||
// Session::put('date', Input::get('date'));
|
||||
// Session::put('datetime', Input::get('datetime'));
|
||||
|
||||
// return Redirect::route('configuration');
|
||||
// }
|
||||
|
||||
// /**
|
||||
// * Get Configuration (step 4)
|
||||
// *
|
||||
// * checking prerequisites
|
||||
// */
|
||||
// public function configuration() {
|
||||
// if(Config::get('database.install')=='%0%')
|
||||
// {
|
||||
// if(Session::get('step3')=='step3'){
|
||||
// return View::make('themes/ep-install/default1/display/view4');
|
||||
// } else {
|
||||
// return Redirect::route('localization');
|
||||
// }
|
||||
// }
|
||||
// else{
|
||||
// return Redirect::route('account-sign-In');
|
||||
// }
|
||||
|
||||
// }
|
||||
|
||||
// /**
|
||||
// * Post configurationcheck
|
||||
// *
|
||||
// * checking prerequisites
|
||||
// */
|
||||
// public function configurationcheck() {
|
||||
|
||||
// Session::put('step4','step4');
|
||||
|
||||
// Session::put('default', Input::get('default'));
|
||||
// Session::put('host', Input::get('host'));
|
||||
// Session::put('databasename', Input::get('databasename'));
|
||||
// Session::put('username', Input::get('username'));
|
||||
// Session::put('password', Input::get('password'));
|
||||
|
||||
// return Redirect::route('database');
|
||||
// }
|
||||
|
||||
// /**
|
||||
// * Get database
|
||||
// *
|
||||
// * checking prerequisites
|
||||
// */
|
||||
// public function database() {
|
||||
// if(Config::get('database.install')=='%0%')
|
||||
// {
|
||||
// if(Session::get('step4')=='step4'){
|
||||
// return View::make('themes/ep-install/default1/display/view5');
|
||||
// } else {
|
||||
// return Redirect::route('configuration');
|
||||
// }
|
||||
// }
|
||||
// else{
|
||||
// return Redirect::route('account-sign-In');
|
||||
// }
|
||||
|
||||
// }
|
||||
|
||||
// /**
|
||||
// * Get account
|
||||
// *
|
||||
// * checking prerequisites
|
||||
// */
|
||||
// public function account() {
|
||||
// if(Config::get('database.install')=='%0%')
|
||||
// {
|
||||
// if(Session::get('step4')=='step4'){
|
||||
// return View::make('themes/ep-install/default1/display/view6');
|
||||
// } else {
|
||||
// return Redirect::route('configuration');
|
||||
// }
|
||||
// }
|
||||
// else{
|
||||
// return Redirect::route('account-sign-In');
|
||||
// }
|
||||
|
||||
// }
|
||||
|
||||
// /**
|
||||
// * Post accountcheck
|
||||
// *
|
||||
// * checking prerequisites
|
||||
// */
|
||||
// public function accountcheck() {
|
||||
// // validation check
|
||||
// $validator = Validator::make(Input::all(), array(
|
||||
// 'firstname' => 'required|max:20',
|
||||
// 'Lastname' => 'required|max:20',
|
||||
// 'email' => 'required|max:50|email',
|
||||
// 'username' => 'required|max:50|min:3',
|
||||
// 'password' => 'required|min:6',
|
||||
// 'confirmpassword' => 'required|same:password'
|
||||
// ));
|
||||
// if ($validator->fails()) {
|
||||
// return Redirect::route('account')
|
||||
// ->withErrors($validator);
|
||||
// } else {
|
||||
|
||||
// // config/database.php management
|
||||
// $default = Input::get('default');
|
||||
// $host = Input::get('host');
|
||||
// $database = Input::get('databasename');
|
||||
// $dbusername = Input::get('dbusername');
|
||||
// $dbpassword = Input::get('dbpassword');
|
||||
|
||||
// // set default value
|
||||
// $path0 = app_path('config/database.php');
|
||||
// $content0 = File::get($path0);
|
||||
// $content0 = str_replace('%default%', $default, $content0);
|
||||
// File::put($path0, $content0);
|
||||
|
||||
// // set host,databasename,username,password
|
||||
// if($default=='mysql')
|
||||
// {
|
||||
// $path = app_path('config/database.php');
|
||||
// $content = File::get($path);
|
||||
// $content = str_replace('%host%', $host, $content);
|
||||
// File::put($path, $content);
|
||||
|
||||
// $path1 = app_path('config/database.php');
|
||||
// $content1 = File::get($path1);
|
||||
// $content1 = str_replace('%database%', $database, $content1);
|
||||
// File::put($path1, $content1);
|
||||
|
||||
// $path2 = app_path('config/database.php');
|
||||
// $content2 = File::get($path2);
|
||||
// $content2 = str_replace('%username%', $dbusername, $content2);
|
||||
// File::put($path2, $content2);
|
||||
|
||||
// $path3 = app_path('config/database.php');
|
||||
// $content3 = File::get($path3);
|
||||
// $content3 = str_replace('%password%', $dbpassword, $content3);
|
||||
// File::put($path3, $content3);
|
||||
// }
|
||||
// elseif($default=='pgsql')
|
||||
// {
|
||||
// $path = app_path('config/database.php');
|
||||
// $content = File::get($path);
|
||||
// $content = str_replace('%host1%', $host, $content);
|
||||
// File::put($path, $content);
|
||||
|
||||
// $path1 = app_path('config/database.php');
|
||||
// $content1 = File::get($path1);
|
||||
// $content1 = str_replace('%database1%', $database, $content1);
|
||||
// File::put($path1, $content1);
|
||||
|
||||
// $path2 = app_path('config/database.php');
|
||||
// $content2 = File::get($path2);
|
||||
// $content2 = str_replace('%username1%', $username, $content2);
|
||||
// File::put($path2, $content2);
|
||||
|
||||
// $path3 = app_path('config/database.php');
|
||||
// $content3 = File::get($path3);
|
||||
// $content3 = str_replace('%password1%', $password, $content3);
|
||||
// File::put($path3, $content3);
|
||||
// }
|
||||
// elseif($default=='sqlsrv')
|
||||
// {
|
||||
// $path = app_path('config/database.php');
|
||||
// $content = File::get($path);
|
||||
// $content = str_replace('%host2%', $host, $content);
|
||||
// File::put($path, $content);
|
||||
|
||||
// $path1 = app_path('config/database.php');
|
||||
// $content1 = File::get($path1);
|
||||
// $content1 = str_replace('%database2%', $database, $content1);
|
||||
// File::put($path1, $content1);
|
||||
|
||||
// $path2 = app_path('config/database.php');
|
||||
// $content2 = File::get($path2);
|
||||
// $content2 = str_replace('%username2%', $username, $content2);
|
||||
// File::put($path2, $content2);
|
||||
|
||||
// $path3 = app_path('config/database.php');
|
||||
// $content3 = File::get($path3);
|
||||
// $content3 = str_replace('%password2%', $password, $content3);
|
||||
// File::put($path3, $content3);
|
||||
// }
|
||||
|
||||
// // migrate database
|
||||
// Artisan::call('migrate', array('--force' => true));
|
||||
// Artisan::call('db:seed', array('--force' => true));
|
||||
|
||||
// // create user
|
||||
// $firstname = Input::get('firstname');
|
||||
// $lastname = Input::get('lastname');
|
||||
// $email = Input::get('email');
|
||||
// $username = Input::get('username');
|
||||
// $password = Input::get('password');
|
||||
|
||||
// $language = Input::get('language');
|
||||
// $timezone = Input::get('timezone');
|
||||
// $date = Input::get('date');
|
||||
// $datetime = Input::get('datetime');
|
||||
|
||||
// $user = User::create(array(
|
||||
// 'firstname' => $firstname,
|
||||
// 'lastname' => $lastname,
|
||||
// 'email' => $email,
|
||||
// 'username' => $username,
|
||||
// 'password' => Hash::make($password),
|
||||
// 'authority' => 'admin',
|
||||
// 'active' => 1
|
||||
// ));
|
||||
|
||||
// // set option values
|
||||
// $dateformat = Option::where('option_name','=','date_format')->first();
|
||||
// $dateformat->option_value = $date;
|
||||
// $dateformat->save();
|
||||
|
||||
// $datetimeformat = Option::where('option_name','=','date_time_format')->first();
|
||||
// $datetimeformat->option_value = $datetime;
|
||||
// $datetimeformat->save();
|
||||
|
||||
// $timezonestring = Option::where('option_name','=','timezone_string')->first();
|
||||
// $timezonestring->option_value = $timezone;
|
||||
// $timezonestring->save();
|
||||
|
||||
// $language1 = Option::where('option_name','=','language')->first();
|
||||
// $language1->option_value = $language;
|
||||
// $language1->save();
|
||||
|
||||
// if ($user) {
|
||||
|
||||
// Session::put('step6','step6');
|
||||
|
||||
// return Redirect::route('final');
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// /**
|
||||
// * Get finalize
|
||||
// *
|
||||
// * checking prerequisites
|
||||
// */
|
||||
// public function finalize() {
|
||||
// if(Session::get('step6')=='step6'){
|
||||
|
||||
// $var = "http://".$_SERVER['HTTP_HOST']."/epeper-pdf";
|
||||
|
||||
// $siteurl = Option::where('option_name','=','siteurl')->first();
|
||||
// $siteurl->option_value = $var ;
|
||||
// $siteurl->save();
|
||||
|
||||
// $value='1';
|
||||
// $install = app_path('config/database.php');
|
||||
// $datacontent = File::get($install);
|
||||
// $datacontent = str_replace('%0%', $value, $datacontent);
|
||||
// File::put($install, $datacontent);
|
||||
// try {
|
||||
// return View::make('themes/ep-install/default1/display/view7');
|
||||
// } catch (Exception $e) {
|
||||
// return Redirect::route('npl');
|
||||
// }
|
||||
// } else {
|
||||
// return Redirect::route('account');
|
||||
// }
|
||||
// }
|
||||
|
||||
// /**
|
||||
// * Post finalcheck
|
||||
// *
|
||||
// * checking prerequisites
|
||||
// */
|
||||
// public function finalcheck() {
|
||||
// try
|
||||
// {
|
||||
// return Redirect::route('account-sign-In');
|
||||
// }
|
||||
// catch (Exception $e) {
|
||||
// return Redirect::Route('account-sign-out');
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
@@ -1,7 +1,14 @@
|
||||
<?php namespace App\Http;
|
||||
<?php
|
||||
|
||||
namespace App\Http;
|
||||
|
||||
use Illuminate\Foundation\Http\Kernel as HttpKernel;
|
||||
|
||||
/**
|
||||
* Kernel
|
||||
*
|
||||
* @package HttpKernel
|
||||
*/
|
||||
class Kernel extends HttpKernel {
|
||||
|
||||
/**
|
||||
@@ -24,12 +31,12 @@ class Kernel extends HttpKernel {
|
||||
* @var array
|
||||
*/
|
||||
protected $routeMiddleware = [
|
||||
'auth' => 'App\Http\Middleware\Authenticate',
|
||||
'auth.basic' => 'Illuminate\Auth\Middleware\AuthenticateWithBasicAuth',
|
||||
'guest' => 'App\Http\Middleware\RedirectIfAuthenticated',
|
||||
'roles' => 'App\Http\Middleware\CheckRole',
|
||||
'role.agent' => 'App\Http\Middleware\CheckRoleAgent',
|
||||
'role.user' => 'App\Http\Middleware\CheckRoleUser',
|
||||
'auth' => 'App\Http\Middleware\Authenticate',
|
||||
'auth.basic' => 'Illuminate\Auth\Middleware\AuthenticateWithBasicAuth',
|
||||
'guest' => 'App\Http\Middleware\RedirectIfAuthenticated',
|
||||
'roles' => 'App\Http\Middleware\CheckRole',
|
||||
'role.agent' => 'App\Http\Middleware\CheckRoleAgent',
|
||||
'role.user' => 'App\Http\Middleware\CheckRoleUser',
|
||||
];
|
||||
|
||||
}
|
||||
|
@@ -1,8 +1,14 @@
|
||||
<?php namespace App\Http\Middleware;
|
||||
|
||||
<?php
|
||||
namespace App\Http\Middleware;
|
||||
use Closure;
|
||||
use Illuminate\Contracts\Auth\Guard;
|
||||
|
||||
/**
|
||||
* Authenticate
|
||||
*
|
||||
* @package Middleware
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class Authenticate {
|
||||
|
||||
/**
|
||||
@@ -18,8 +24,7 @@ class Authenticate {
|
||||
* @param Guard $auth
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Guard $auth)
|
||||
{
|
||||
public function __construct(Guard $auth) {
|
||||
$this->auth = $auth;
|
||||
}
|
||||
|
||||
@@ -30,16 +35,11 @@ class Authenticate {
|
||||
* @param \Closure $next
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle($request, Closure $next)
|
||||
{
|
||||
if ($this->auth->guest())
|
||||
{
|
||||
if ($request->ajax())
|
||||
{
|
||||
public function handle($request, Closure $next) {
|
||||
if ($this->auth->guest()) {
|
||||
if ($request->ajax()) {
|
||||
return response('Unauthorized.', 401);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
return redirect()->guest('auth/login');
|
||||
}
|
||||
}
|
||||
|
@@ -1,7 +1,13 @@
|
||||
<?php namespace App\Http\Middleware;
|
||||
|
||||
<?php
|
||||
namespace App\Http\Middleware;
|
||||
use Closure;
|
||||
|
||||
/**
|
||||
* CheckRole
|
||||
*
|
||||
* @package Middleware
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class CheckRole {
|
||||
|
||||
/**
|
||||
@@ -17,7 +23,6 @@ class CheckRole {
|
||||
return $next($request);
|
||||
}
|
||||
return redirect('guest')->with('fails', 'You are not Autherised');
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,7 +1,13 @@
|
||||
<?php namespace App\Http\Middleware;
|
||||
|
||||
<?php
|
||||
namespace App\Http\Middleware;
|
||||
use Closure;
|
||||
|
||||
/**
|
||||
* CheckRoleAgent
|
||||
*
|
||||
* @package default
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class CheckRoleAgent {
|
||||
|
||||
/**
|
||||
|
@@ -1,7 +1,13 @@
|
||||
<?php namespace App\Http\Middleware;
|
||||
|
||||
<?php
|
||||
namespace App\Http\Middleware;
|
||||
use Closure;
|
||||
|
||||
/**
|
||||
* CheckRoleUser
|
||||
*
|
||||
* @package Middleware
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class CheckRoleUser {
|
||||
|
||||
/**
|
||||
@@ -16,7 +22,6 @@ class CheckRoleUser {
|
||||
return $next($request);
|
||||
}
|
||||
return redirect('guest')->with('fails', 'You are not Autherised');
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,4 +1,6 @@
|
||||
<?php namespace App\Http\Middleware;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Closure;
|
||||
use Illuminate\Contracts\Auth\Guard;
|
||||
@@ -19,8 +21,7 @@ class RedirectIfAuthenticated {
|
||||
* @param Guard $auth
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Guard $auth)
|
||||
{
|
||||
public function __construct(Guard $auth) {
|
||||
$this->auth = $auth;
|
||||
}
|
||||
|
||||
@@ -31,10 +32,8 @@ class RedirectIfAuthenticated {
|
||||
* @param \Closure $next
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle($request, Closure $next)
|
||||
{
|
||||
if ($this->auth->check())
|
||||
{
|
||||
public function handle($request, Closure $next) {
|
||||
if ($this->auth->check()) {
|
||||
return new RedirectResponse(url('dashboard'));
|
||||
}
|
||||
|
||||
|
@@ -1,19 +1,21 @@
|
||||
<?php namespace App\Http\Middleware;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Closure;
|
||||
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as BaseVerifier;
|
||||
|
||||
class VerifyCsrfToken extends BaseVerifier {
|
||||
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Closure $next
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle($request, Closure $next) {
|
||||
return parent::handle($request, $next);
|
||||
}
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Closure $next
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle($request, Closure $next) {
|
||||
return parent::handle($request, $next);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,7 +1,13 @@
|
||||
<?php namespace App\Http\Requests;
|
||||
|
||||
<?php
|
||||
namespace App\Http\Requests;
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
* AgentRequest
|
||||
*
|
||||
* @package Request
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class AgentRequest extends Request {
|
||||
|
||||
/**
|
||||
@@ -9,8 +15,7 @@ class AgentRequest extends Request {
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -19,21 +24,20 @@ class AgentRequest extends Request {
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
public function rules() {
|
||||
return [
|
||||
'user_name' => 'required|unique:agents',
|
||||
'first_name' => 'required',
|
||||
'last_name' => 'required',
|
||||
'email' => 'required',
|
||||
'account_type' => 'required',
|
||||
'account_status' => 'required',
|
||||
'assign_group' => 'required',
|
||||
'primary_dpt' => 'required',
|
||||
'agent_tzone' => 'required',
|
||||
'phone_number' => 'phone:IN',
|
||||
'mobile' => 'phone:IN',
|
||||
'team_id' => 'required'
|
||||
'user_name' => 'required|unique:agents',
|
||||
'first_name' => 'required',
|
||||
'last_name' => 'required',
|
||||
'email' => 'required',
|
||||
'account_type' => 'required',
|
||||
// 'account_status' => 'required',
|
||||
'assign_group' => 'required',
|
||||
'primary_dpt' => 'required',
|
||||
'agent_tzone' => 'required',
|
||||
'phone_number' => 'phone:IN',
|
||||
'mobile' => 'phone:IN',
|
||||
'team_id' => 'required',
|
||||
];
|
||||
}
|
||||
|
||||
|
@@ -1,7 +1,13 @@
|
||||
<?php namespace App\Http\Requests;
|
||||
|
||||
<?php
|
||||
namespace App\Http\Requests;
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
* AgentUpdate
|
||||
*
|
||||
* @package Request
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class AgentUpdate extends Request {
|
||||
|
||||
/**
|
||||
@@ -9,8 +15,7 @@ class AgentUpdate extends Request {
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -19,20 +24,19 @@ class AgentUpdate extends Request {
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'first_name' => 'required',
|
||||
'last_name' => 'required',
|
||||
'email' => 'required|email',
|
||||
'account_type' => 'required',
|
||||
'role' => 'required',
|
||||
'assign_group' => 'required',
|
||||
'primary_dpt' => 'required',
|
||||
'agent_tzone' => 'required',
|
||||
'phone_number' => 'phone:IN',
|
||||
'mobile' => 'phone:IN',
|
||||
'team_id' => 'required'
|
||||
public function rules() {
|
||||
return [
|
||||
'first_name' => 'required',
|
||||
'last_name' => 'required',
|
||||
'email' => 'required|email',
|
||||
'account_type' => 'required',
|
||||
'role' => 'required',
|
||||
'assign_group' => 'required',
|
||||
'primary_dpt' => 'required',
|
||||
'agent_tzone' => 'required',
|
||||
'phone_number' => 'phone:IN',
|
||||
'mobile' => 'phone:IN',
|
||||
'team_id' => 'required',
|
||||
];
|
||||
}
|
||||
|
||||
|
@@ -1,7 +1,13 @@
|
||||
<?php namespace App\Http\Requests;
|
||||
|
||||
<?php
|
||||
namespace App\Http\Requests;
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
* BanRequest
|
||||
*
|
||||
* @package Request
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class BanRequest extends Request {
|
||||
|
||||
/**
|
||||
|
@@ -1,7 +1,13 @@
|
||||
<?php namespace App\Http\Requests;
|
||||
|
||||
<?php
|
||||
namespace App\Http\Requests;
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
* BanlistRequest
|
||||
*
|
||||
* @package Request
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class BanlistRequest extends Request {
|
||||
|
||||
/**
|
||||
@@ -9,8 +15,7 @@ class BanlistRequest extends Request {
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -19,11 +24,10 @@ class BanlistRequest extends Request {
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
public function rules() {
|
||||
return [
|
||||
'email_address' => 'email',
|
||||
'ban_status' => 'required'
|
||||
'email_address' => 'email',
|
||||
'ban_status' => 'required',
|
||||
];
|
||||
}
|
||||
|
||||
|
@@ -1,7 +1,13 @@
|
||||
<?php namespace App\Http\Requests;
|
||||
|
||||
<?php
|
||||
namespace App\Http\Requests;
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
* CheckTicket
|
||||
*
|
||||
* @package Request
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class CheckTicket extends Request {
|
||||
|
||||
/**
|
||||
@@ -9,8 +15,7 @@ class CheckTicket extends Request {
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -19,11 +24,10 @@ class CheckTicket extends Request {
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
public function rules() {
|
||||
return [
|
||||
'email' => 'required|email',
|
||||
'ticket_number'=>'required'
|
||||
'email' => 'required|email',
|
||||
'ticket_number' => 'required',
|
||||
];
|
||||
}
|
||||
|
||||
|
@@ -1,7 +1,13 @@
|
||||
<?php namespace App\Http\Requests;
|
||||
|
||||
<?php
|
||||
namespace App\Http\Requests;
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
* CompanyRequest
|
||||
*
|
||||
* @package Request
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class CompanyRequest extends Request {
|
||||
|
||||
/**
|
||||
@@ -9,8 +15,7 @@ class CompanyRequest extends Request {
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -19,13 +24,12 @@ class CompanyRequest extends Request {
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
public function rules() {
|
||||
return [
|
||||
'company_name' => 'required',
|
||||
'website' => 'url',
|
||||
'phone' => 'numeric',
|
||||
'logo' => 'image'
|
||||
'company_name' => 'required',
|
||||
'website' => 'url',
|
||||
'phone' => 'numeric',
|
||||
'logo' => 'image',
|
||||
];
|
||||
}
|
||||
|
||||
|
@@ -1,7 +1,13 @@
|
||||
<?php namespace App\Http\Requests;
|
||||
|
||||
<?php
|
||||
namespace App\Http\Requests;
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
* CreateTicketRequest
|
||||
*
|
||||
* @package Request
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class CreateTicketRequest extends Request {
|
||||
|
||||
/**
|
||||
@@ -9,8 +15,7 @@ class CreateTicketRequest extends Request {
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -19,18 +24,17 @@ class CreateTicketRequest extends Request {
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
public function rules() {
|
||||
return [
|
||||
|
||||
'email' => 'required|email',
|
||||
'fullname' => 'required|min:3',
|
||||
'helptopic' => 'required',
|
||||
'dept' => 'required',
|
||||
'sla' => 'required',
|
||||
'subject' => 'required|min:5',
|
||||
'body' => 'required|min:20',
|
||||
'priority' => 'required'
|
||||
'email' => 'required|email',
|
||||
'fullname' => 'required|min:3',
|
||||
'helptopic' => 'required',
|
||||
'dept' => 'required',
|
||||
'sla' => 'required',
|
||||
'subject' => 'required|min:5',
|
||||
'body' => 'required|min:20',
|
||||
'priority' => 'required',
|
||||
];
|
||||
}
|
||||
|
||||
|
@@ -1,7 +1,13 @@
|
||||
<?php namespace App\Http\Requests;
|
||||
|
||||
<?php
|
||||
namespace App\Http\Requests;
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
* DepartmentRequest
|
||||
*
|
||||
* @package Request
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class DepartmentRequest extends Request {
|
||||
|
||||
/**
|
||||
@@ -9,8 +15,7 @@ class DepartmentRequest extends Request {
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -19,13 +24,12 @@ class DepartmentRequest extends Request {
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
public function rules() {
|
||||
return [
|
||||
'name' => 'required|unique:department',
|
||||
'outgoing_email' => 'required',
|
||||
'auto_response_email' => 'required',
|
||||
'group_id' => 'required'
|
||||
'name' => 'required|unique:department',
|
||||
'outgoing_email' => 'required',
|
||||
'auto_response_email' => 'required',
|
||||
'group_id' => 'required',
|
||||
];
|
||||
}
|
||||
|
||||
|
@@ -1,7 +1,13 @@
|
||||
<?php namespace App\Http\Requests;
|
||||
|
||||
<?php
|
||||
namespace App\Http\Requests;
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
* DepartmentUpdate
|
||||
*
|
||||
* @package Request
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class DepartmentUpdate extends Request {
|
||||
|
||||
/**
|
||||
@@ -9,8 +15,7 @@ class DepartmentUpdate extends Request {
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -19,13 +24,12 @@ class DepartmentUpdate extends Request {
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
public function rules() {
|
||||
return [
|
||||
|
||||
'outgoing_email' => 'required',
|
||||
'auto_response_email' => 'required',
|
||||
'group_id' => 'required'
|
||||
|
||||
'outgoing_email' => 'required',
|
||||
'auto_response_email' => 'required',
|
||||
'group_id' => 'required',
|
||||
];
|
||||
}
|
||||
|
||||
|
@@ -1,7 +1,13 @@
|
||||
<?php namespace App\Http\Requests;
|
||||
|
||||
<?php
|
||||
namespace App\Http\Requests;
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
* DiagnoRequest
|
||||
*
|
||||
* @package Request
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class DiagnoRequest extends Request {
|
||||
|
||||
/**
|
||||
@@ -9,8 +15,7 @@ class DiagnoRequest extends Request {
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -19,13 +24,12 @@ class DiagnoRequest extends Request {
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
public function rules() {
|
||||
return [
|
||||
'from' => 'required|email',
|
||||
'to' => 'required|email',
|
||||
'subject' => 'required',
|
||||
'message' => 'required'
|
||||
'from' => 'required|email',
|
||||
'to' => 'required|email',
|
||||
'subject' => 'required',
|
||||
'message' => 'required',
|
||||
];
|
||||
}
|
||||
|
||||
|
@@ -1,7 +1,13 @@
|
||||
<?php namespace App\Http\Requests;
|
||||
|
||||
<?php
|
||||
namespace App\Http\Requests;
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
* EmailRequest
|
||||
*
|
||||
* @package Request
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class EmailRequest extends Request {
|
||||
|
||||
/**
|
||||
@@ -9,8 +15,7 @@ class EmailRequest extends Request {
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -19,17 +24,9 @@ class EmailRequest extends Request {
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
|
||||
public function rules()
|
||||
{
|
||||
public function rules() {
|
||||
return [
|
||||
|
||||
|
||||
|
||||
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@@ -1,7 +1,13 @@
|
||||
<?php namespace App\Http\Requests;
|
||||
|
||||
<?php
|
||||
namespace App\Http\Requests;
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
* EmailsEditRequest
|
||||
*
|
||||
* @package Request
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class EmailsEditRequest extends Request {
|
||||
|
||||
/**
|
||||
@@ -9,8 +15,7 @@ class EmailsEditRequest extends Request {
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -19,19 +24,18 @@ class EmailsEditRequest extends Request {
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
public function rules() {
|
||||
return [
|
||||
'email_address' => 'email',
|
||||
'email_name' => 'required',
|
||||
'department' => 'required',
|
||||
'priority' => 'required',
|
||||
'help_topic' => 'required',
|
||||
'imap_config' => 'required',
|
||||
'password' => 'required|min:6',
|
||||
'user_name' => 'required',
|
||||
'sending_host' => 'required',
|
||||
'sending_port' => 'required'
|
||||
'email_address' => 'email',
|
||||
'email_name' => 'required',
|
||||
'department' => 'required',
|
||||
'priority' => 'required',
|
||||
'help_topic' => 'required',
|
||||
'imap_config' => 'required',
|
||||
'password' => 'required|min:6',
|
||||
'user_name' => 'required',
|
||||
'sending_host' => 'required',
|
||||
'sending_port' => 'required',
|
||||
//'mailbox_protocol' => 'required'
|
||||
];
|
||||
}
|
||||
|
@@ -1,7 +1,13 @@
|
||||
<?php namespace App\Http\Requests;
|
||||
|
||||
<?php
|
||||
namespace App\Http\Requests;
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
* EmailsRequest
|
||||
*
|
||||
* @package Request
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class EmailsRequest extends Request {
|
||||
|
||||
/**
|
||||
@@ -9,8 +15,7 @@ class EmailsRequest extends Request {
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -19,19 +24,18 @@ class EmailsRequest extends Request {
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
public function rules() {
|
||||
return [
|
||||
'email_address' => 'required|email|unique:emails',
|
||||
'email_name' => 'required',
|
||||
'department' => 'required',
|
||||
'priority' => 'required',
|
||||
'help_topic' => 'required',
|
||||
'imap_config' => 'required',
|
||||
'password' => 'required|min:6',
|
||||
'user_name' => 'required',
|
||||
'sending_host' => 'required',
|
||||
'sending_port' => 'required'
|
||||
'email_address' => 'required|email|unique:emails',
|
||||
'email_name' => 'required',
|
||||
'department' => 'required',
|
||||
'priority' => 'required',
|
||||
'help_topic' => 'required',
|
||||
'imap_config' => 'required',
|
||||
'password' => 'required|min:6',
|
||||
'user_name' => 'required',
|
||||
'sending_host' => 'required',
|
||||
'sending_port' => 'required',
|
||||
//'mailbox_protocol' => 'required'
|
||||
];
|
||||
}
|
||||
|
@@ -1,7 +1,13 @@
|
||||
<?php namespace App\Http\Requests;
|
||||
|
||||
<?php
|
||||
namespace App\Http\Requests;
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
* FormRequest
|
||||
*
|
||||
* @package Request
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class FormRequest extends Request {
|
||||
|
||||
/**
|
||||
@@ -9,8 +15,7 @@ class FormRequest extends Request {
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -19,15 +24,13 @@ class FormRequest extends Request {
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
public function rules() {
|
||||
return [
|
||||
|
||||
'title' => 'required',
|
||||
'label' => 'required',
|
||||
'type' => 'required',
|
||||
'visibility' => 'required'
|
||||
|
||||
'title' => 'required',
|
||||
'label' => 'required',
|
||||
'type' => 'required',
|
||||
'visibility' => 'required',
|
||||
];
|
||||
}
|
||||
|
||||
|
@@ -1,8 +1,13 @@
|
||||
<?php namespace App\Http\Requests;
|
||||
|
||||
<?php
|
||||
namespace App\Http\Requests;
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
|
||||
/**
|
||||
* GroupRequest
|
||||
*
|
||||
* @package Request
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class GroupRequest extends Request {
|
||||
|
||||
/**
|
||||
@@ -10,8 +15,7 @@ class GroupRequest extends Request {
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -20,10 +24,9 @@ class GroupRequest extends Request {
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
public function rules() {
|
||||
return [
|
||||
'name' => 'required|unique:groups'
|
||||
'name' => 'required|unique:groups',
|
||||
];
|
||||
}
|
||||
|
||||
|
@@ -1,7 +1,13 @@
|
||||
<?php namespace App\Http\Requests;
|
||||
|
||||
<?php
|
||||
namespace App\Http\Requests;
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
* HelptopicRequest
|
||||
*
|
||||
* @package Request
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class HelptopicRequest extends Request {
|
||||
|
||||
/**
|
||||
@@ -9,8 +15,7 @@ class HelptopicRequest extends Request {
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -19,17 +24,15 @@ class HelptopicRequest extends Request {
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
public function rules() {
|
||||
return [
|
||||
'topic' => 'required|unique:help_topic',
|
||||
|
||||
'parent_topic' => 'required',
|
||||
'custom_form' => 'required',
|
||||
'department' => 'required',
|
||||
'priority' => 'required',
|
||||
'sla_plan' => 'required',
|
||||
'auto_assign' => 'required'
|
||||
'topic' => 'required|unique:help_topic',
|
||||
'parent_topic' => 'required',
|
||||
'custom_form' => 'required',
|
||||
'department' => 'required',
|
||||
'priority' => 'required',
|
||||
'sla_plan' => 'required',
|
||||
'auto_assign' => 'required',
|
||||
];
|
||||
}
|
||||
|
||||
|
@@ -1,7 +1,13 @@
|
||||
<?php namespace App\Http\Requests;
|
||||
|
||||
<?php
|
||||
namespace App\Http\Requests;
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
* HelptopicUpdate
|
||||
*
|
||||
* @package Request
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class HelptopicUpdate extends Request {
|
||||
|
||||
/**
|
||||
@@ -9,8 +15,7 @@ class HelptopicUpdate extends Request {
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -19,15 +24,14 @@ class HelptopicUpdate extends Request {
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
public function rules() {
|
||||
return [
|
||||
'parent_topic' => 'required',
|
||||
'custom_form' => 'required',
|
||||
'department' => 'required',
|
||||
'priority' => 'required',
|
||||
'sla_plan' => 'required',
|
||||
'auto_assign' => 'required'
|
||||
'parent_topic' => 'required',
|
||||
'custom_form' => 'required',
|
||||
'department' => 'required',
|
||||
'priority' => 'required',
|
||||
'sla_plan' => 'required',
|
||||
'auto_assign' => 'required',
|
||||
];
|
||||
}
|
||||
|
||||
|
@@ -1,7 +1,13 @@
|
||||
<?php namespace App\Http\Requests;
|
||||
|
||||
<?php
|
||||
namespace App\Http\Requests;
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
* LoginRequest
|
||||
*
|
||||
* @package Request
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class LoginRequest extends Request {
|
||||
|
||||
/**
|
||||
@@ -9,8 +15,7 @@ class LoginRequest extends Request {
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -19,11 +24,10 @@ class LoginRequest extends Request {
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
public function rules() {
|
||||
return [
|
||||
'email' => 'required|email',
|
||||
'password' => 'required|min:6'
|
||||
'email' => 'required|email',
|
||||
'password' => 'required|min:6',
|
||||
];
|
||||
}
|
||||
|
||||
|
@@ -1,7 +1,13 @@
|
||||
<?php namespace App\Http\Requests;
|
||||
|
||||
<?php
|
||||
namespace App\Http\Requests;
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
* OrganizationRequest
|
||||
*
|
||||
* @package Request
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class OrganizationRequest extends Request {
|
||||
|
||||
/**
|
||||
@@ -9,8 +15,7 @@ class OrganizationRequest extends Request {
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -19,13 +24,12 @@ class OrganizationRequest extends Request {
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
public function rules() {
|
||||
return [
|
||||
|
||||
'name' => 'required|unique:organization',
|
||||
'website' => 'url',
|
||||
'phone' => 'size:10'
|
||||
|
||||
'name' => 'required|unique:organization',
|
||||
'website' => 'url',
|
||||
'phone' => 'size:10',
|
||||
];
|
||||
}
|
||||
|
||||
|
@@ -1,7 +1,13 @@
|
||||
<?php namespace App\Http\Requests;
|
||||
|
||||
<?php
|
||||
namespace App\Http\Requests;
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
* OrganizationUpdate
|
||||
*
|
||||
* @package Request
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class OrganizationUpdate extends Request {
|
||||
|
||||
/**
|
||||
@@ -9,8 +15,7 @@ class OrganizationUpdate extends Request {
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -19,12 +24,11 @@ class OrganizationUpdate extends Request {
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
public function rules() {
|
||||
return [
|
||||
|
||||
'website' => 'url',
|
||||
'phone' => 'size:10'
|
||||
|
||||
'website' => 'url',
|
||||
'phone' => 'size:10',
|
||||
];
|
||||
}
|
||||
|
||||
|
@@ -1,7 +1,13 @@
|
||||
<?php namespace App\Http\Requests;
|
||||
|
||||
<?php
|
||||
namespace App\Http\Requests;
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
* ProfilePassword
|
||||
*
|
||||
* @package Request
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class ProfilePassword extends Request {
|
||||
|
||||
/**
|
||||
@@ -9,8 +15,7 @@ class ProfilePassword extends Request {
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -19,12 +24,11 @@ class ProfilePassword extends Request {
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
public function rules() {
|
||||
return [
|
||||
'old_password' => 'required',
|
||||
'new_password' => 'required|min:6',
|
||||
'confirm_password' => 'required|same:new_password'
|
||||
'old_password' => 'required',
|
||||
'new_password' => 'required|min:6',
|
||||
'confirm_password' => 'required|same:new_password',
|
||||
];
|
||||
}
|
||||
|
||||
|
@@ -1,7 +1,13 @@
|
||||
<?php namespace App\Http\Requests;
|
||||
|
||||
<?php
|
||||
namespace App\Http\Requests;
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
* ProfileRequest
|
||||
*
|
||||
* @package Request
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class ProfileRequest extends Request {
|
||||
|
||||
/**
|
||||
@@ -9,8 +15,7 @@ class ProfileRequest extends Request {
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -19,11 +24,10 @@ class ProfileRequest extends Request {
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
public function rules() {
|
||||
return [
|
||||
'first_name' => 'required',
|
||||
'profile_pic' => 'mimes:png,jpeg',
|
||||
'first_name' => 'required',
|
||||
'profile_pic' => 'mimes:png,jpeg',
|
||||
];
|
||||
}
|
||||
|
||||
|
@@ -1,7 +1,13 @@
|
||||
<?php namespace App\Http\Requests;
|
||||
|
||||
<?php
|
||||
namespace App\Http\Requests;
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
* RegisterRequest
|
||||
*
|
||||
* @package Request
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class RegisterRequest extends Request {
|
||||
|
||||
/**
|
||||
@@ -9,8 +15,7 @@ class RegisterRequest extends Request {
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -19,13 +24,12 @@ class RegisterRequest extends Request {
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
public function rules() {
|
||||
return [
|
||||
'email' => 'required|max:50|email|unique:users',
|
||||
'full_name' => 'required',
|
||||
'password' => 'required|min:6',
|
||||
'password_confirmation' => 'required|same:password'
|
||||
'email' => 'required|max:50|email|unique:users',
|
||||
'full_name' => 'required',
|
||||
'password' => 'required|min:6',
|
||||
'password_confirmation' => 'required|same:password',
|
||||
];
|
||||
}
|
||||
|
||||
|
@@ -1,9 +1,9 @@
|
||||
<?php namespace App\Http\Requests;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
abstract class Request extends FormRequest {
|
||||
|
||||
//
|
||||
|
||||
//
|
||||
}
|
||||
|
@@ -1,7 +1,13 @@
|
||||
<?php namespace App\Http\Requests;
|
||||
|
||||
<?php
|
||||
namespace App\Http\Requests;
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
* SlaRequest
|
||||
*
|
||||
* @package Request
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class SlaRequest extends Request {
|
||||
|
||||
/**
|
||||
@@ -9,8 +15,7 @@ class SlaRequest extends Request {
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -19,11 +24,10 @@ class SlaRequest extends Request {
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
public function rules() {
|
||||
return [
|
||||
'name' => 'required|unique:sla_plan',
|
||||
'grace_period'=> 'required'
|
||||
'name' => 'required|unique:sla_plan',
|
||||
'grace_period' => 'required',
|
||||
];
|
||||
}
|
||||
|
||||
|
@@ -1,7 +1,13 @@
|
||||
<?php namespace App\Http\Requests;
|
||||
|
||||
<?php
|
||||
namespace App\Http\Requests;
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
* SlaUpdate
|
||||
*
|
||||
* @package Request
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class SlaUpdate extends Request {
|
||||
|
||||
/**
|
||||
@@ -9,8 +15,7 @@ class SlaUpdate extends Request {
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -19,10 +24,9 @@ class SlaUpdate extends Request {
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
public function rules() {
|
||||
return [
|
||||
'grace_period'=> 'required'
|
||||
'grace_period' => 'required',
|
||||
];
|
||||
}
|
||||
|
||||
|
@@ -1,7 +1,13 @@
|
||||
<?php namespace App\Http\Requests;
|
||||
|
||||
<?php
|
||||
namespace App\Http\Requests;
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
* Sys_userRequest
|
||||
*
|
||||
* @package Request
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class Sys_userRequest extends Request {
|
||||
|
||||
/**
|
||||
@@ -9,8 +15,7 @@ class Sys_userRequest extends Request {
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -19,13 +24,12 @@ class Sys_userRequest extends Request {
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
public function rules() {
|
||||
return [
|
||||
|
||||
'email' => 'required|email',
|
||||
'full_name' => 'required|unique:sys_user',
|
||||
'phone' => 'size:10'
|
||||
|
||||
'email' => 'required|email',
|
||||
'full_name' => 'required|unique:sys_user',
|
||||
'phone' => 'size:10',
|
||||
];
|
||||
}
|
||||
|
||||
|
@@ -1,7 +1,13 @@
|
||||
<?php namespace App\Http\Requests;
|
||||
|
||||
<?php
|
||||
namespace App\Http\Requests;
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
* Sys_userUpdate
|
||||
*
|
||||
* @package Request
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class Sys_userUpdate extends Request {
|
||||
|
||||
/**
|
||||
@@ -9,8 +15,7 @@ class Sys_userUpdate extends Request {
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -19,11 +24,10 @@ class Sys_userUpdate extends Request {
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
public function rules() {
|
||||
return [
|
||||
'email' => 'required|email',
|
||||
'phone' => 'size:10'
|
||||
'email' => 'required|email',
|
||||
'phone' => 'size:10',
|
||||
];
|
||||
}
|
||||
|
||||
|
@@ -1,7 +1,13 @@
|
||||
<?php namespace App\Http\Requests;
|
||||
|
||||
<?php
|
||||
namespace App\Http\Requests;
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
* SystemRequest
|
||||
*
|
||||
* @package Request
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class SystemRequest extends Request {
|
||||
|
||||
/**
|
||||
@@ -9,8 +15,7 @@ class SystemRequest extends Request {
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -19,13 +24,11 @@ class SystemRequest extends Request {
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
public function rules() {
|
||||
return [
|
||||
|
||||
'name' => 'required',
|
||||
'url' => 'url'
|
||||
|
||||
'name' => 'required',
|
||||
'url' => 'url',
|
||||
];
|
||||
}
|
||||
|
||||
|
@@ -1,7 +1,13 @@
|
||||
<?php namespace App\Http\Requests;
|
||||
|
||||
<?php
|
||||
namespace App\Http\Requests;
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
* TeamRequest
|
||||
*
|
||||
* @package Request
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class TeamRequest extends Request {
|
||||
|
||||
/**
|
||||
@@ -9,8 +15,7 @@ class TeamRequest extends Request {
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -19,11 +24,10 @@ class TeamRequest extends Request {
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
public function rules() {
|
||||
return [
|
||||
'name' => 'required|unique:teams',
|
||||
'status' => 'required'
|
||||
'status' => 'required',
|
||||
];
|
||||
}
|
||||
|
||||
|
@@ -1,7 +1,13 @@
|
||||
<?php namespace App\Http\Requests;
|
||||
|
||||
<?php
|
||||
namespace App\Http\Requests;
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
* TeamUpdate
|
||||
*
|
||||
* @package Request
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class TeamUpdate extends Request {
|
||||
|
||||
/**
|
||||
@@ -9,8 +15,7 @@ class TeamUpdate extends Request {
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -19,11 +24,8 @@ class TeamUpdate extends Request {
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
public function rules() {
|
||||
return [
|
||||
|
||||
|
||||
];
|
||||
}
|
||||
|
||||
|
@@ -1,7 +1,13 @@
|
||||
<?php namespace App\Http\Requests;
|
||||
|
||||
<?php
|
||||
namespace App\Http\Requests;
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
* TemplateRequest
|
||||
*
|
||||
* @package Request
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class TemplateRequest extends Request {
|
||||
|
||||
/**
|
||||
|
@@ -1,7 +1,12 @@
|
||||
<?php namespace App\Http\Requests;
|
||||
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
* TemplateUdate
|
||||
*
|
||||
* @package Request
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class TemplateUdate extends Request {
|
||||
|
||||
/**
|
||||
|
@@ -1,7 +1,13 @@
|
||||
<?php namespace App\Http\Requests;
|
||||
|
||||
<?php
|
||||
namespace App\Http\Requests;
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
* TicketForm
|
||||
*
|
||||
* @package Request
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class TicketForm extends Request {
|
||||
|
||||
/**
|
||||
@@ -9,8 +15,7 @@ class TicketForm extends Request {
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -19,13 +24,12 @@ class TicketForm extends Request {
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
public function rules() {
|
||||
return [
|
||||
'help_topic' => 'required',
|
||||
'Email' => 'required',
|
||||
'Subject' => 'required',
|
||||
'Detail' => 'required'
|
||||
'help_topic' => 'required',
|
||||
'Email' => 'required',
|
||||
'Subject' => 'required',
|
||||
'Detail' => 'required',
|
||||
];
|
||||
}
|
||||
|
||||
|
@@ -1,7 +1,13 @@
|
||||
<?php namespace App\Http\Requests;
|
||||
|
||||
<?php
|
||||
namespace App\Http\Requests;
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
* TicketRequest
|
||||
*
|
||||
* @package Request
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class TicketRequest extends Request {
|
||||
|
||||
/**
|
||||
@@ -9,8 +15,7 @@ class TicketRequest extends Request {
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -19,12 +24,11 @@ class TicketRequest extends Request {
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
public function rules() {
|
||||
return [
|
||||
'To' => 'required',
|
||||
'ticket_ID' => 'required',
|
||||
'ReplyContent' => 'required'
|
||||
'To' => 'required',
|
||||
'ticket_ID' => 'required',
|
||||
'ReplyContent' => 'required',
|
||||
];
|
||||
}
|
||||
|
||||
|
@@ -12,7 +12,6 @@
|
||||
*/
|
||||
|
||||
//Route::get('/', 'WelcomeController@index');
|
||||
|
||||
//Route::get('/', 'HomeController@index');
|
||||
|
||||
Route::controllers([
|
||||
@@ -59,8 +58,7 @@ Route::group(['middleware' => 'roles', 'middleware' => 'auth'], function () {
|
||||
Route::resource('sla', 'Admin\SlaController'); // in SLA Plan module, for CRUD
|
||||
|
||||
Route::resource('form', 'Admin\FormController'); // in Form module, for CRUD
|
||||
|
||||
//$router->model('id','getcompany');
|
||||
//$router->model('id','getcompany');
|
||||
|
||||
Route::get('getcompany', 'Admin\SettingsController@getcompany'); // direct to company setting page
|
||||
|
||||
@@ -98,7 +96,6 @@ Route::group(['middleware' => 'roles', 'middleware' => 'auth'], function () {
|
||||
|
||||
/* Admin Profile Password Post */
|
||||
Route::patch('admin-profile-password', 'Admin\ProfileController@postProfilePassword');
|
||||
|
||||
});
|
||||
/* calling ticket.blade.php file */
|
||||
|
||||
@@ -108,7 +105,6 @@ Route::group(['middleware' => 'roles', 'middleware' => 'auth'], function () {
|
||||
|
||||
Route::get('time', function () {
|
||||
return view('themes.default1.admin.tickets.timeline');
|
||||
|
||||
});
|
||||
|
||||
/*
|
||||
@@ -135,9 +131,8 @@ Route::group(['middleware' => 'role.agent', 'middleware' => 'auth'], function ()
|
||||
/* Profile Password Post */
|
||||
Route::patch('agent-profile-password', 'Agent\UserController@postProfilePassword');
|
||||
|
||||
// Route::get('/abcd', 'GuestController@getList');
|
||||
|
||||
// Route::get('/qwer', ['as' => 'thread', 'uses' => 'GuestController@getThread']);
|
||||
// Route::get('/abcd', 'GuestController@getList');
|
||||
// Route::get('/qwer', ['as' => 'thread', 'uses' => 'GuestController@getThread']);
|
||||
|
||||
/* Fetch Emails */
|
||||
Route::get('/test', ['as' => 'thr', 'uses' => 'Agent\MailController@fetchdata']);
|
||||
@@ -209,7 +204,6 @@ Route::group(['middleware' => 'role.agent', 'middleware' => 'auth'], function ()
|
||||
|
||||
/* To show Unassigned Tickets */
|
||||
Route::get('unassigned', 'Agent\TicketController@unassigned');
|
||||
|
||||
});
|
||||
|
||||
/*
|
||||
@@ -240,7 +234,6 @@ $router->get('/', 'Guest\OuthouseController@get');
|
||||
|
||||
//testing ckeditor
|
||||
//$router->get('ck','Admin\SettingsController@getck');
|
||||
|
||||
//===================================================================================
|
||||
|
||||
Route::group(['middleware' => 'role.user', 'middleware' => 'auth'], function () {
|
||||
@@ -252,7 +245,6 @@ Route::group(['middleware' => 'role.user', 'middleware' => 'auth'], function ()
|
||||
|
||||
/* Profile Password Post */
|
||||
Route::patch('profile-password', 'Guest\GuestController@postProfilePassword');
|
||||
|
||||
});
|
||||
//====================================================================================
|
||||
/* Get my tickets */
|
||||
@@ -260,9 +252,8 @@ $router->get('myticket', ['as' => 'ticket', 'uses' => 'Guest\GuestController@get
|
||||
|
||||
/* Get my ticket thread */
|
||||
//$router->get('thread/{id}',['as'=>'ticket.thread','uses'=>'Guest\GuestController@getthread']);
|
||||
|
||||
// testing
|
||||
// Route::get('testing','Agent\MailController@getdata');
|
||||
Route::get('testing', 'Agent\MailController@getdata');
|
||||
|
||||
/* Check your Ticket */
|
||||
$router->get('checkticket', 'Guest\GuestController@getCheckTicket');
|
||||
|
Reference in New Issue
Block a user