Apply fixes from StyleCI
This commit is contained in:
@@ -69,7 +69,7 @@ class ApiController extends Controller
|
|||||||
public $source;
|
public $source;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
*/
|
*/
|
||||||
public function __construct(Request $request)
|
public function __construct(Request $request)
|
||||||
{
|
{
|
||||||
@@ -134,6 +134,7 @@ class ApiController extends Controller
|
|||||||
* @method POST
|
* @method POST
|
||||||
*
|
*
|
||||||
* @param user_id,subject,body,helptopic,sla,priority,dept
|
* @param user_id,subject,body,helptopic,sla,priority,dept
|
||||||
|
*
|
||||||
* @return json
|
* @return json
|
||||||
*/
|
*/
|
||||||
public function createTicket(\App\Http\Requests\helpdesk\CreateTicketRequest $request, \App\Model\helpdesk\Utility\CountryCode $code)
|
public function createTicket(\App\Http\Requests\helpdesk\CreateTicketRequest $request, \App\Model\helpdesk\Utility\CountryCode $code)
|
||||||
@@ -193,7 +194,8 @@ class ApiController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Reply for the ticket.
|
* Reply for the ticket.
|
||||||
*
|
*
|
||||||
* @param TicketRequest $request
|
* @param TicketRequest $request
|
||||||
|
*
|
||||||
* @return json
|
* @return json
|
||||||
*/
|
*/
|
||||||
public function ticketReply()
|
public function ticketReply()
|
||||||
@@ -201,7 +203,7 @@ class ApiController extends Controller
|
|||||||
//dd($this->request->all());
|
//dd($this->request->all());
|
||||||
try {
|
try {
|
||||||
$v = \Validator::make($this->request->all(), [
|
$v = \Validator::make($this->request->all(), [
|
||||||
'ticket_id' => 'required|exists:tickets,id',
|
'ticket_id' => 'required|exists:tickets,id',
|
||||||
'reply_content' => 'required',
|
'reply_content' => 'required',
|
||||||
]);
|
]);
|
||||||
if ($v->fails()) {
|
if ($v->fails()) {
|
||||||
@@ -239,11 +241,11 @@ class ApiController extends Controller
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$v = \Validator::make($this->request->all(), [
|
$v = \Validator::make($this->request->all(), [
|
||||||
'ticket_id' => 'required|exists:tickets,id',
|
'ticket_id' => 'required|exists:tickets,id',
|
||||||
'subject' => 'required',
|
'subject' => 'required',
|
||||||
'sla_plan' => 'required|exists:sla_plan,id',
|
'sla_plan' => 'required|exists:sla_plan,id',
|
||||||
'help_topic' => 'required|exists:help_topic,id',
|
'help_topic' => 'required|exists:help_topic,id',
|
||||||
'ticket_source' => 'required|exists:ticket_source,id',
|
'ticket_source' => 'required|exists:ticket_source,id',
|
||||||
'ticket_priority' => 'required|exists:ticket_priority,priority_id',
|
'ticket_priority' => 'required|exists:ticket_priority,priority_id',
|
||||||
]);
|
]);
|
||||||
if ($v->fails()) {
|
if ($v->fails()) {
|
||||||
@@ -511,7 +513,7 @@ class ApiController extends Controller
|
|||||||
try {
|
try {
|
||||||
$v = \Validator::make($this->request->all(), [
|
$v = \Validator::make($this->request->all(), [
|
||||||
'ticket_id' => 'required',
|
'ticket_id' => 'required',
|
||||||
'user' => 'required',
|
'user' => 'required',
|
||||||
]);
|
]);
|
||||||
if ($v->fails()) {
|
if ($v->fails()) {
|
||||||
$error = $v->errors();
|
$error = $v->errors();
|
||||||
@@ -731,7 +733,7 @@ class ApiController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
$url = $this->request->input('url');
|
$url = $this->request->input('url');
|
||||||
if (! Str::is('*/', $url)) {
|
if (!Str::is('*/', $url)) {
|
||||||
$url = Str::finish($url, '/');
|
$url = Str::finish($url, '/');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -763,7 +765,8 @@ class ApiController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Call curl function for Get Method.
|
* Call curl function for Get Method.
|
||||||
*
|
*
|
||||||
* @param type $url
|
* @param type $url
|
||||||
|
*
|
||||||
* @return type int|string|json
|
* @return type int|string|json
|
||||||
*/
|
*/
|
||||||
public function callGetApi($url)
|
public function callGetApi($url)
|
||||||
@@ -786,8 +789,9 @@ class ApiController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Call curl function for POST Method.
|
* Call curl function for POST Method.
|
||||||
*
|
*
|
||||||
* @param type $url
|
* @param type $url
|
||||||
* @param type $data
|
* @param type $data
|
||||||
|
*
|
||||||
* @return type int|string|json
|
* @return type int|string|json
|
||||||
*/
|
*/
|
||||||
public function callPostApi($url, $data)
|
public function callPostApi($url, $data)
|
||||||
@@ -1025,9 +1029,9 @@ class ApiController extends Controller
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$v = \Validator::make($this->request->all(), [
|
$v = \Validator::make($this->request->all(), [
|
||||||
'user_id' => 'required|exists:users,id',
|
'user_id' => 'required|exists:users,id',
|
||||||
'ticket_id' => 'required|exists:tickets,id',
|
'ticket_id' => 'required|exists:tickets,id',
|
||||||
'body' => 'required',
|
'body' => 'required',
|
||||||
]);
|
]);
|
||||||
if ($v->fails()) {
|
if ($v->fails()) {
|
||||||
$error = $v->errors();
|
$error = $v->errors();
|
||||||
@@ -1256,7 +1260,7 @@ class ApiController extends Controller
|
|||||||
return response()->json(compact('error'));
|
return response()->json(compact('error'));
|
||||||
}
|
}
|
||||||
$id = $this->request->input('ticket_id');
|
$id = $this->request->input('ticket_id');
|
||||||
if (! $this->model->where('id', $id)->first()) {
|
if (!$this->model->where('id', $id)->first()) {
|
||||||
$error = 'There is no Ticket as ticket id: '.$id;
|
$error = 'There is no Ticket as ticket id: '.$id;
|
||||||
|
|
||||||
return response()->json(compact('error'));
|
return response()->json(compact('error'));
|
||||||
@@ -1315,7 +1319,7 @@ class ApiController extends Controller
|
|||||||
$result['duedate'] = date_add($result2->created_at, date_interval_create_from_date_string($result2->grace_period))->format('Y:m:d H:i:s');
|
$result['duedate'] = date_add($result2->created_at, date_interval_create_from_date_string($result2->grace_period))->format('Y:m:d H:i:s');
|
||||||
$result['title'] = utfEncoding(Ticket_Thread::where('ticket_id', $id)->orderBy('id')->first()->title);
|
$result['title'] = utfEncoding(Ticket_Thread::where('ticket_id', $id)->orderBy('id')->first()->title);
|
||||||
$assigned = Tickets::where('id', $id)->select('assigned_to', 'team_id')->first()->toArray();
|
$assigned = Tickets::where('id', $id)->select('assigned_to', 'team_id')->first()->toArray();
|
||||||
if (! empty($assigned)) {
|
if (!empty($assigned)) {
|
||||||
if ($assigned['assigned_to'] != null) {
|
if ($assigned['assigned_to'] != null) {
|
||||||
$result['assignee'] = User::where('id', $assigned['assigned_to'])->first()->name();
|
$result['assignee'] = User::where('id', $assigned['assigned_to'])->first()->name();
|
||||||
} elseif ($assigned['team_id'] != null) {
|
} elseif ($assigned['team_id'] != null) {
|
||||||
@@ -1421,7 +1425,7 @@ class ApiController extends Controller
|
|||||||
$v = \Validator::make(
|
$v = \Validator::make(
|
||||||
Input::all(),
|
Input::all(),
|
||||||
[
|
[
|
||||||
'email' => 'required|email|unique:users',
|
'email' => 'required|email|unique:users',
|
||||||
'ticket_id' => 'required',
|
'ticket_id' => 'required',
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
@@ -1487,7 +1491,7 @@ class ApiController extends Controller
|
|||||||
Input::all(),
|
Input::all(),
|
||||||
[
|
[
|
||||||
'ticketid' => 'required',
|
'ticketid' => 'required',
|
||||||
'email' => 'required',
|
'email' => 'required',
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
if ($v->fails()) {
|
if ($v->fails()) {
|
||||||
@@ -1557,10 +1561,10 @@ class ApiController extends Controller
|
|||||||
$depend = collect([['name' => 'unassigned', 'count' => $unassigned], ['name' => 'mytickets', 'count' => $mytickets]]);
|
$depend = collect([['name' => 'unassigned', 'count' => $unassigned], ['name' => 'mytickets', 'count' => $mytickets]]);
|
||||||
$collection = $statuses->merge($depend);
|
$collection = $statuses->merge($depend);
|
||||||
$result = ['departments' => $department, 'sla' => $sla, 'staffs' => $staff, 'teams' => $team,
|
$result = ['departments' => $department, 'sla' => $sla, 'staffs' => $staff, 'teams' => $team,
|
||||||
'priorities' => $priority, 'helptopics' => $helptopic,
|
'priorities' => $priority, 'helptopics' => $helptopic,
|
||||||
'status' => $status,
|
'status' => $status,
|
||||||
'sources' => $source,
|
'sources' => $source,
|
||||||
'tickets_count' => $collection, ];
|
'tickets_count' => $collection, ];
|
||||||
|
|
||||||
return response()->json(compact('result'));
|
return response()->json(compact('result'));
|
||||||
// $result = ['departments' => $department, 'sla' => $sla, 'staffs' => $staff, 'teams' => $team,
|
// $result = ['departments' => $department, 'sla' => $sla, 'staffs' => $staff, 'teams' => $team,
|
||||||
@@ -1584,10 +1588,10 @@ class ApiController extends Controller
|
|||||||
if ($ticket->dept_id && $ticket->help_topic_id) {
|
if ($ticket->dept_id && $ticket->help_topic_id) {
|
||||||
return $this->getSystem($check, $query);
|
return $this->getSystem($check, $query);
|
||||||
}
|
}
|
||||||
if (! $ticket->dept_id && $ticket->help_topic_id) {
|
if (!$ticket->dept_id && $ticket->help_topic_id) {
|
||||||
return $query->select('tickets.help_topic_id');
|
return $query->select('tickets.help_topic_id');
|
||||||
}
|
}
|
||||||
if ($ticket->dept_id && ! $ticket->help_topic_id) {
|
if ($ticket->dept_id && !$ticket->help_topic_id) {
|
||||||
return $query->select('tickets.dept_id');
|
return $query->select('tickets.dept_id');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1610,14 +1614,15 @@ class ApiController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Register a user with username and password.
|
* Register a user with username and password.
|
||||||
*
|
*
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
|
*
|
||||||
* @return type json
|
* @return type json
|
||||||
*/
|
*/
|
||||||
public function register(Request $request)
|
public function register(Request $request)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$v = \Validator::make($request->all(), [
|
$v = \Validator::make($request->all(), [
|
||||||
'email' => 'required|email|unique:users',
|
'email' => 'required|email|unique:users',
|
||||||
'password' => 'required|min:6',
|
'password' => 'required|min:6',
|
||||||
]);
|
]);
|
||||||
if ($v->fails()) {
|
if ($v->fails()) {
|
||||||
@@ -1654,7 +1659,7 @@ class ApiController extends Controller
|
|||||||
$v = \Validator::make(
|
$v = \Validator::make(
|
||||||
$this->request->all(),
|
$this->request->all(),
|
||||||
[
|
[
|
||||||
'username' => 'required|unique:users,user_name',
|
'username' => 'required|unique:users,user_name',
|
||||||
'first_name' => 'required',
|
'first_name' => 'required',
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
@@ -35,7 +35,7 @@ class ApiExceptAuthController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
$url = $this->request->input('url');
|
$url = $this->request->input('url');
|
||||||
if (! Str::is('*/', $url)) {
|
if (!Str::is('*/', $url)) {
|
||||||
$url = Str::finish($url, '/');
|
$url = Str::finish($url, '/');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -72,7 +72,8 @@ class ApiExceptAuthController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Call curl function for Get Method.
|
* Call curl function for Get Method.
|
||||||
*
|
*
|
||||||
* @param type $url
|
* @param type $url
|
||||||
|
*
|
||||||
* @return type int|string|json
|
* @return type int|string|json
|
||||||
*/
|
*/
|
||||||
public function callGetApi($url)
|
public function callGetApi($url)
|
||||||
@@ -95,8 +96,9 @@ class ApiExceptAuthController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Call curl function for POST Method.
|
* Call curl function for POST Method.
|
||||||
*
|
*
|
||||||
* @param type $url
|
* @param type $url
|
||||||
* @param type $data
|
* @param type $data
|
||||||
|
*
|
||||||
* @return type int|string|json
|
* @return type int|string|json
|
||||||
*/
|
*/
|
||||||
public function callPostApi($url, $data)
|
public function callPostApi($url, $data)
|
||||||
|
@@ -37,21 +37,21 @@ class InstallerApiController extends Controller
|
|||||||
public function config_database(Request $request)
|
public function config_database(Request $request)
|
||||||
{
|
{
|
||||||
$rules = [
|
$rules = [
|
||||||
'database' => 'required|min:1',
|
'database' => 'required|min:1',
|
||||||
'host' => 'required',
|
'host' => 'required',
|
||||||
'databasename' => 'required|min:1',
|
'databasename' => 'required|min:1',
|
||||||
'dbusername' => 'required|min:1',
|
'dbusername' => 'required|min:1',
|
||||||
];
|
];
|
||||||
if ($request->port) {
|
if ($request->port) {
|
||||||
$rules['port'] = 'integer|min:0';
|
$rules['port'] = 'integer|min:0';
|
||||||
}
|
}
|
||||||
$validator = \Validator::make(
|
$validator = \Validator::make(
|
||||||
[
|
[
|
||||||
'database' => $request->database,
|
'database' => $request->database,
|
||||||
'host' => $request->host,
|
'host' => $request->host,
|
||||||
'databasename' => $request->databasename,
|
'databasename' => $request->databasename,
|
||||||
'dbusername' => $request->dbusername,
|
'dbusername' => $request->dbusername,
|
||||||
'port' => $request->port,
|
'port' => $request->port,
|
||||||
],
|
],
|
||||||
$rules
|
$rules
|
||||||
);
|
);
|
||||||
@@ -132,21 +132,21 @@ class InstallerApiController extends Controller
|
|||||||
$validator = \Validator::make(
|
$validator = \Validator::make(
|
||||||
[
|
[
|
||||||
'firstname' => $request->firstname,
|
'firstname' => $request->firstname,
|
||||||
'lastname' => $request->lastname,
|
'lastname' => $request->lastname,
|
||||||
'email' => $request->email,
|
'email' => $request->email,
|
||||||
'username' => $request->username,
|
'username' => $request->username,
|
||||||
'password' => $request->password,
|
'password' => $request->password,
|
||||||
'timezone' => $request->timezone,
|
'timezone' => $request->timezone,
|
||||||
'datetime' => $request->datetime,
|
'datetime' => $request->datetime,
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'firstname' => 'required|alpha|min:1',
|
'firstname' => 'required|alpha|min:1',
|
||||||
'lastname' => 'required|alpha|min:1',
|
'lastname' => 'required|alpha|min:1',
|
||||||
'email' => 'required|email|min:1',
|
'email' => 'required|email|min:1',
|
||||||
'username' => 'required|min:4',
|
'username' => 'required|min:4',
|
||||||
'password' => 'required|min:6',
|
'password' => 'required|min:6',
|
||||||
'timezone' => 'required|min:1',
|
'timezone' => 'required|min:1',
|
||||||
'datetime' => 'required|min:1',
|
'datetime' => 'required|min:1',
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
if ($validator->fails()) {
|
if ($validator->fails()) {
|
||||||
@@ -202,15 +202,15 @@ class InstallerApiController extends Controller
|
|||||||
|
|
||||||
// Creating user
|
// Creating user
|
||||||
$user = User::create([
|
$user = User::create([
|
||||||
'first_name' => $firstname,
|
'first_name' => $firstname,
|
||||||
'last_name' => $lastname,
|
'last_name' => $lastname,
|
||||||
'email' => $email,
|
'email' => $email,
|
||||||
'user_name' => $username,
|
'user_name' => $username,
|
||||||
'password' => Hash::make($password),
|
'password' => Hash::make($password),
|
||||||
'active' => 1,
|
'active' => 1,
|
||||||
'role' => 'admin',
|
'role' => 'admin',
|
||||||
'assign_group' => 1,
|
'assign_group' => 1,
|
||||||
'primary_dpt' => 1,
|
'primary_dpt' => 1,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// Setting database installed status
|
// Setting database installed status
|
||||||
|
@@ -46,12 +46,13 @@ class TicketController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Create Ticket.
|
* Create Ticket.
|
||||||
*
|
*
|
||||||
* @param type $user_id
|
* @param type $user_id
|
||||||
* @param type $subject
|
* @param type $subject
|
||||||
* @param type $body
|
* @param type $body
|
||||||
* @param type $helptopic
|
* @param type $helptopic
|
||||||
* @param type $sla
|
* @param type $sla
|
||||||
* @param type $priority
|
* @param type $priority
|
||||||
|
*
|
||||||
* @return type string
|
* @return type string
|
||||||
*/
|
*/
|
||||||
public function createTicket($user_id, $subject, $body, $helptopic, $sla, $priority, $source, $headers, $dept, $assignto, $form_data, $attach = '')
|
public function createTicket($user_id, $subject, $body, $helptopic, $sla, $priority, $source, $headers, $dept, $assignto, $form_data, $attach = '')
|
||||||
@@ -101,7 +102,7 @@ class TicketController extends Controller
|
|||||||
$this->storeCollaborators($headers, $id);
|
$this->storeCollaborators($headers, $id);
|
||||||
|
|
||||||
$thread = $this->ticketThread($subject, $body, $id, $user_id);
|
$thread = $this->ticketThread($subject, $body, $id, $user_id);
|
||||||
if (! empty($attach)) {
|
if (!empty($attach)) {
|
||||||
$this->attach($thread, $attach);
|
$this->attach($thread, $attach);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -114,7 +115,8 @@ class TicketController extends Controller
|
|||||||
/**
|
/**
|
||||||
* store_collaborators.
|
* store_collaborators.
|
||||||
*
|
*
|
||||||
* @param type $headers
|
* @param type $headers
|
||||||
|
*
|
||||||
* @return type
|
* @return type
|
||||||
*/
|
*/
|
||||||
public function storeCollaborators($headers, $id)
|
public function storeCollaborators($headers, $id)
|
||||||
@@ -164,10 +166,11 @@ class TicketController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Generate Ticket Thread.
|
* Generate Ticket Thread.
|
||||||
*
|
*
|
||||||
* @param type $subject
|
* @param type $subject
|
||||||
* @param type $body
|
* @param type $body
|
||||||
* @param type $id
|
* @param type $id
|
||||||
* @param type $user_id
|
* @param type $user_id
|
||||||
|
*
|
||||||
* @return type
|
* @return type
|
||||||
*/
|
*/
|
||||||
public function ticketThread($subject, $body, $id, $user_id)
|
public function ticketThread($subject, $body, $id, $user_id)
|
||||||
@@ -190,7 +193,8 @@ class TicketController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Generates Ticket Number.
|
* Generates Ticket Number.
|
||||||
*
|
*
|
||||||
* @param type $ticket_number
|
* @param type $ticket_number
|
||||||
|
*
|
||||||
* @return type integer
|
* @return type integer
|
||||||
*/
|
*/
|
||||||
public function ticketNumber($ticket_number)
|
public function ticketNumber($ticket_number)
|
||||||
@@ -230,7 +234,8 @@ class TicketController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Generate a random string for password.
|
* Generate a random string for password.
|
||||||
*
|
*
|
||||||
* @param type $length
|
* @param type $length
|
||||||
|
*
|
||||||
* @return type string
|
* @return type string
|
||||||
*/
|
*/
|
||||||
public function generateRandomString($length = 10)
|
public function generateRandomString($length = 10)
|
||||||
@@ -254,6 +259,7 @@ class TicketController extends Controller
|
|||||||
*
|
*
|
||||||
* @param type Ticket_Thread $thread
|
* @param type Ticket_Thread $thread
|
||||||
* @param type TicketRequest $request
|
* @param type TicketRequest $request
|
||||||
|
*
|
||||||
* @return type bool
|
* @return type bool
|
||||||
*/
|
*/
|
||||||
public function reply($thread, $request, $ta, $attach = '')
|
public function reply($thread, $request, $ta, $attach = '')
|
||||||
@@ -299,7 +305,7 @@ class TicketController extends Controller
|
|||||||
}
|
}
|
||||||
$thread->save();
|
$thread->save();
|
||||||
|
|
||||||
if (! empty($attach)) {
|
if (!empty($attach)) {
|
||||||
$check_attachment = $this->attach($thread->id, $attach);
|
$check_attachment = $this->attach($thread->id, $attach);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -312,7 +318,7 @@ class TicketController extends Controller
|
|||||||
$ticket_number = $tickets->ticket_number;
|
$ticket_number = $tickets->ticket_number;
|
||||||
$company = $this->company();
|
$company = $this->company();
|
||||||
$username = $ticket_user->user_name;
|
$username = $ticket_user->user_name;
|
||||||
if (! empty(Auth::user()->agent_sign)) {
|
if (!empty(Auth::user()->agent_sign)) {
|
||||||
$agentsign = Auth::user()->agent_sign;
|
$agentsign = Auth::user()->agent_sign;
|
||||||
} else {
|
} else {
|
||||||
$agentsign = null;
|
$agentsign = null;
|
||||||
@@ -398,8 +404,9 @@ class TicketController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Ticket edit and save ticket data.
|
* Ticket edit and save ticket data.
|
||||||
*
|
*
|
||||||
* @param type $ticket_id
|
* @param type $ticket_id
|
||||||
* @param type Ticket_Thread $thread
|
* @param type Ticket_Thread $thread
|
||||||
|
*
|
||||||
* @return type bool
|
* @return type bool
|
||||||
*/
|
*/
|
||||||
public function ticketEditPost($ticket_id, $thread, $ticket)
|
public function ticketEditPost($ticket_id, $thread, $ticket)
|
||||||
@@ -430,7 +437,8 @@ class TicketController extends Controller
|
|||||||
/**
|
/**
|
||||||
* function to assign ticket.
|
* function to assign ticket.
|
||||||
*
|
*
|
||||||
* @param type $id
|
* @param type $id
|
||||||
|
*
|
||||||
* @return type bool
|
* @return type bool
|
||||||
*/
|
*/
|
||||||
public function assign($id)
|
public function assign($id)
|
||||||
@@ -440,19 +448,19 @@ class TicketController extends Controller
|
|||||||
//dd($UserEmail);
|
//dd($UserEmail);
|
||||||
// $UserEmail = 'sujitprasad12@yahoo.in';
|
// $UserEmail = 'sujitprasad12@yahoo.in';
|
||||||
$user = User::where('email', '=', $UserEmail)->first();
|
$user = User::where('email', '=', $UserEmail)->first();
|
||||||
if (! $user) {
|
if (!$user) {
|
||||||
return ['error' => 'No agent not found'];
|
return ['error' => 'No agent not found'];
|
||||||
}
|
}
|
||||||
$user_id = $user->id;
|
$user_id = $user->id;
|
||||||
$ticket = Tickets::where('id', '=', $id)->first();
|
$ticket = Tickets::where('id', '=', $id)->first();
|
||||||
if (! $ticket) {
|
if (!$ticket) {
|
||||||
return ['error' => 'No ticket not found'];
|
return ['error' => 'No ticket not found'];
|
||||||
}
|
}
|
||||||
$ticket_number = $ticket->ticket_number;
|
$ticket_number = $ticket->ticket_number;
|
||||||
$ticket->assigned_to = $user_id;
|
$ticket->assigned_to = $user_id;
|
||||||
$ticket->save();
|
$ticket->save();
|
||||||
$ticket_thread = Ticket_Thread::where('ticket_id', '=', $id)->first();
|
$ticket_thread = Ticket_Thread::where('ticket_id', '=', $id)->first();
|
||||||
if (! $ticket_thread) {
|
if (!$ticket_thread) {
|
||||||
return ['error' => 'No thread not found'];
|
return ['error' => 'No thread not found'];
|
||||||
}
|
}
|
||||||
$ticket_subject = $ticket_thread->title;
|
$ticket_subject = $ticket_thread->title;
|
||||||
@@ -492,8 +500,9 @@ class TicketController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Function to delete ticket.
|
* Function to delete ticket.
|
||||||
*
|
*
|
||||||
* @param type $id
|
* @param type $id
|
||||||
* @param type Tickets $ticket
|
* @param type Tickets $ticket
|
||||||
|
*
|
||||||
* @return type string
|
* @return type string
|
||||||
*/
|
*/
|
||||||
public function delete($ids, $ticket)
|
public function delete($ids, $ticket)
|
||||||
@@ -546,7 +555,8 @@ class TicketController extends Controller
|
|||||||
/**
|
/**
|
||||||
* check email for dublicate entry.
|
* check email for dublicate entry.
|
||||||
*
|
*
|
||||||
* @param type $email
|
* @param type $email
|
||||||
|
*
|
||||||
* @return type bool
|
* @return type bool
|
||||||
*/
|
*/
|
||||||
public function checkEmail($email)
|
public function checkEmail($email)
|
||||||
@@ -587,8 +597,9 @@ class TicketController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Create Attachment.
|
* Create Attachment.
|
||||||
*
|
*
|
||||||
* @param type $thread
|
* @param type $thread
|
||||||
* @param type $attach
|
* @param type $attach
|
||||||
|
*
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
public function attach($thread, $attach)
|
public function attach($thread, $attach)
|
||||||
@@ -623,6 +634,7 @@ class TicketController extends Controller
|
|||||||
* useradd.
|
* useradd.
|
||||||
*
|
*
|
||||||
* @param type Image $image
|
* @param type Image $image
|
||||||
|
*
|
||||||
* @return type json
|
* @return type json
|
||||||
*/
|
*/
|
||||||
public function useradd()
|
public function useradd()
|
||||||
|
@@ -38,7 +38,8 @@ class TokenAuthController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Authenticating user with username and password and retuen token.
|
* Authenticating user with username and password and retuen token.
|
||||||
*
|
*
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
|
*
|
||||||
* @return type json
|
* @return type json
|
||||||
*/
|
*/
|
||||||
public function authenticate(Request $request)
|
public function authenticate(Request $request)
|
||||||
@@ -50,7 +51,7 @@ class TokenAuthController extends Controller
|
|||||||
//$credentials = $request->only('email', 'password');
|
//$credentials = $request->only('email', 'password');
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (! $token = JWTAuth::attempt([$field => $usernameinput, 'password' => $password, 'active' => 1])) {
|
if (!$token = JWTAuth::attempt([$field => $usernameinput, 'password' => $password, 'active' => 1])) {
|
||||||
return response()->json(['error' => 'invalid_credentials', 'status_code' => 401]);
|
return response()->json(['error' => 'invalid_credentials', 'status_code' => 401]);
|
||||||
}
|
}
|
||||||
} catch (JWTException $e) {
|
} catch (JWTException $e) {
|
||||||
@@ -75,7 +76,7 @@ class TokenAuthController extends Controller
|
|||||||
{
|
{
|
||||||
//dd(JWTAuth::parseToken()->authenticate());
|
//dd(JWTAuth::parseToken()->authenticate());
|
||||||
try {
|
try {
|
||||||
if (! $user = JWTAuth::parseToken()->authenticate()) {
|
if (!$user = JWTAuth::parseToken()->authenticate()) {
|
||||||
return response()->json(['user_not_found', 404]);
|
return response()->json(['user_not_found', 404]);
|
||||||
}
|
}
|
||||||
} catch (Tymon\JWTAuth\Exceptions\TokenExpiredException $e) {
|
} catch (Tymon\JWTAuth\Exceptions\TokenExpiredException $e) {
|
||||||
@@ -96,7 +97,8 @@ class TokenAuthController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Register a user with username and password.
|
* Register a user with username and password.
|
||||||
*
|
*
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
|
*
|
||||||
* @return type json
|
* @return type json
|
||||||
*/
|
*/
|
||||||
// public function register(Request $request)
|
// public function register(Request $request)
|
||||||
|
@@ -86,7 +86,7 @@ class Install extends Command
|
|||||||
$result = [];
|
$result = [];
|
||||||
foreach ($extensions as $key => $extension) {
|
foreach ($extensions as $key => $extension) {
|
||||||
$result[$key]['extension'] = $extension;
|
$result[$key]['extension'] = $extension;
|
||||||
if (! extension_loaded($extension)) {
|
if (!extension_loaded($extension)) {
|
||||||
$result[$key]['status'] = "Not Loading, Please open '".php_ini_loaded_file()."' and add 'extension = ".$extension;
|
$result[$key]['status'] = "Not Loading, Please open '".php_ini_loaded_file()."' and add 'extension = ".$extension;
|
||||||
} else {
|
} else {
|
||||||
$result[$key]['status'] = 'Loading';
|
$result[$key]['status'] = 'Loading';
|
||||||
|
@@ -46,12 +46,12 @@ class InstallDB extends Command
|
|||||||
try {
|
try {
|
||||||
if ($this->confirm('Do you want to migrate tables now?')) {
|
if ($this->confirm('Do you want to migrate tables now?')) {
|
||||||
$env = base_path().DIRECTORY_SEPARATOR.'.env';
|
$env = base_path().DIRECTORY_SEPARATOR.'.env';
|
||||||
if (! is_file($env)) {
|
if (!is_file($env)) {
|
||||||
throw new \Exception("Please run 'php artisan install:faveo'");
|
throw new \Exception("Please run 'php artisan install:faveo'");
|
||||||
}
|
}
|
||||||
$dummy_confirm = $this->confirm('Would you like to install dummy data in database to test before going live?');
|
$dummy_confirm = $this->confirm('Would you like to install dummy data in database to test before going live?');
|
||||||
$this->call('key:generate', ['--force' => true]);
|
$this->call('key:generate', ['--force' => true]);
|
||||||
if (! $dummy_confirm) {
|
if (!$dummy_confirm) {
|
||||||
$this->call('install:migrate');
|
$this->call('install:migrate');
|
||||||
$this->call('install:seed');
|
$this->call('install:seed');
|
||||||
} else {
|
} else {
|
||||||
@@ -62,8 +62,8 @@ class InstallDB extends Command
|
|||||||
$data = [
|
$data = [
|
||||||
[
|
[
|
||||||
'user_name' => 'demo_admin',
|
'user_name' => 'demo_admin',
|
||||||
'email' => '',
|
'email' => '',
|
||||||
'password' => 'demopass',
|
'password' => 'demopass',
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
$this->table($headers, $data);
|
$this->table($headers, $data);
|
||||||
|
@@ -54,10 +54,10 @@ class SecureFaveoAPPKey extends Command
|
|||||||
{
|
{
|
||||||
$username = $this->ask('Enter admin account username');
|
$username = $this->ask('Enter admin account username');
|
||||||
$password = $this->secret('Enter admin account password');
|
$password = $this->secret('Enter admin account password');
|
||||||
if (! $username || ! $password) {
|
if (!$username || !$password) {
|
||||||
throw new Exception('Username and password are required.', 1);
|
throw new Exception('Username and password are required.', 1);
|
||||||
}
|
}
|
||||||
if (! Hash::check($password, User::where('user_name', $username)->value('password'))) {
|
if (!Hash::check($password, User::where('user_name', $username)->value('password'))) {
|
||||||
throw new Exception('We do not recognize you, make sure the username or password you provided are correct.', 1);
|
throw new Exception('We do not recognize you, make sure the username or password you provided are correct.', 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -85,14 +85,15 @@ class SecureFaveoAPPKey extends Command
|
|||||||
* This method also updates the LDAP passwords after new key generation
|
* This method also updates the LDAP passwords after new key generation
|
||||||
* so that the LDAP plugin does not stop working after update
|
* so that the LDAP plugin does not stop working after update
|
||||||
*
|
*
|
||||||
* @param string $file
|
* @param string $file
|
||||||
* @param string $datacontent
|
* @param string $datacontent
|
||||||
|
*
|
||||||
* @return voif
|
* @return voif
|
||||||
*/
|
*/
|
||||||
private function updateAppKey(string $file, string $datacontent): void
|
private function updateAppKey(string $file, string $datacontent): void
|
||||||
{
|
{
|
||||||
$this->fetchAndStoreEmailPassword();
|
$this->fetchAndStoreEmailPassword();
|
||||||
if (! $this->doesEnvVaribaleExists($datacontent, 'APP_KEY')) {
|
if (!$this->doesEnvVaribaleExists($datacontent, 'APP_KEY')) {
|
||||||
$datacontent = $datacontent."\r\nAPP_KEY=base64:h3KjrHeVxyE+j6c8whTAs2YI+7goylGZ/e2vElgXT6I=";
|
$datacontent = $datacontent."\r\nAPP_KEY=base64:h3KjrHeVxyE+j6c8whTAs2YI+7goylGZ/e2vElgXT6I=";
|
||||||
File::put($file, $datacontent);
|
File::put($file, $datacontent);
|
||||||
}
|
}
|
||||||
@@ -111,13 +112,14 @@ class SecureFaveoAPPKey extends Command
|
|||||||
/**
|
/**
|
||||||
* Function checks if given $key exist in $envContent string.
|
* Function checks if given $key exist in $envContent string.
|
||||||
*
|
*
|
||||||
* @param string $envContent
|
* @param string $envContent
|
||||||
* @param string $key
|
* @param string $key
|
||||||
|
*
|
||||||
* @return bool true if given key exist otherwise false
|
* @return bool true if given key exist otherwise false
|
||||||
*/
|
*/
|
||||||
private function doesEnvVaribaleExists(string $envContent, string $key): bool
|
private function doesEnvVaribaleExists(string $envContent, string $key): bool
|
||||||
{
|
{
|
||||||
return ! (strpos($envContent, $key) === false);
|
return !(strpos($envContent, $key) === false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -147,10 +149,11 @@ class SecureFaveoAPPKey extends Command
|
|||||||
/**
|
/**
|
||||||
* Extract the encryption key from the given configuration.
|
* Extract the encryption key from the given configuration.
|
||||||
*
|
*
|
||||||
* @param array $config
|
* @param array $config
|
||||||
* @return string
|
|
||||||
*
|
*
|
||||||
* @throws \RuntimeException
|
* @throws \RuntimeException
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
*/
|
*/
|
||||||
private function key()
|
private function key()
|
||||||
{
|
{
|
||||||
|
@@ -73,8 +73,9 @@ class SetupTestEnv extends Command
|
|||||||
/**
|
/**
|
||||||
* Sets up DB config for testing.
|
* Sets up DB config for testing.
|
||||||
*
|
*
|
||||||
* @param string $dbUsername mysql username
|
* @param string $dbUsername mysql username
|
||||||
* @param string $dbPassword mysql password
|
* @param string $dbPassword mysql password
|
||||||
|
*
|
||||||
* @return null
|
* @return null
|
||||||
*/
|
*/
|
||||||
private function setupConfig($dbUsername, $dbPassword)
|
private function setupConfig($dbUsername, $dbPassword)
|
||||||
@@ -164,8 +165,9 @@ class SetupTestEnv extends Command
|
|||||||
/**
|
/**
|
||||||
* Creates an env file if not exists already.
|
* Creates an env file if not exists already.
|
||||||
*
|
*
|
||||||
* @param string $dbUsername
|
* @param string $dbUsername
|
||||||
* @param string $dbPassword
|
* @param string $dbPassword
|
||||||
|
*
|
||||||
* @return null
|
* @return null
|
||||||
*/
|
*/
|
||||||
private function createEnv(string $dbUsername, string $dbPassword)
|
private function createEnv(string $dbUsername, string $dbPassword)
|
||||||
|
@@ -29,7 +29,8 @@ class Kernel extends ConsoleKernel
|
|||||||
/**
|
/**
|
||||||
* Define the application's command schedule.
|
* Define the application's command schedule.
|
||||||
*
|
*
|
||||||
* @param \Illuminate\Console\Scheduling\Schedule $schedule
|
* @param \Illuminate\Console\Scheduling\Schedule $schedule
|
||||||
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
protected function schedule(Schedule $schedule)
|
protected function schedule(Schedule $schedule)
|
||||||
|
@@ -18,31 +18,31 @@ class LaravelLogViewer
|
|||||||
private static $file;
|
private static $file;
|
||||||
|
|
||||||
private static $levels_classes = [
|
private static $levels_classes = [
|
||||||
'debug' => 'info',
|
'debug' => 'info',
|
||||||
'info' => 'info',
|
'info' => 'info',
|
||||||
'notice' => 'info',
|
'notice' => 'info',
|
||||||
'warning' => 'warning',
|
'warning' => 'warning',
|
||||||
'error' => 'danger',
|
'error' => 'danger',
|
||||||
'critical' => 'danger',
|
'critical' => 'danger',
|
||||||
'alert' => 'danger',
|
'alert' => 'danger',
|
||||||
'emergency' => 'danger',
|
'emergency' => 'danger',
|
||||||
];
|
];
|
||||||
|
|
||||||
private static $levels_imgs = [
|
private static $levels_imgs = [
|
||||||
'debug' => 'info',
|
'debug' => 'info',
|
||||||
'info' => 'info',
|
'info' => 'info',
|
||||||
'notice' => 'info',
|
'notice' => 'info',
|
||||||
'warning' => 'warning',
|
'warning' => 'warning',
|
||||||
'error' => 'warning',
|
'error' => 'warning',
|
||||||
'critical' => 'warning',
|
'critical' => 'warning',
|
||||||
'alert' => 'warning',
|
'alert' => 'warning',
|
||||||
'emergency' => 'warning',
|
'emergency' => 'warning',
|
||||||
];
|
];
|
||||||
|
|
||||||
const MAX_FILE_SIZE = 52428800; // Why? Uh... Sorry
|
const MAX_FILE_SIZE = 52428800; // Why? Uh... Sorry
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $file
|
* @param string $file
|
||||||
*/
|
*/
|
||||||
public static function setFile($file)
|
public static function setFile($file)
|
||||||
{
|
{
|
||||||
@@ -90,9 +90,9 @@ class LaravelLogViewer
|
|||||||
|
|
||||||
$pattern = '/\[\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\].*/';
|
$pattern = '/\[\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\].*/';
|
||||||
|
|
||||||
if (! self::$file) {
|
if (!self::$file) {
|
||||||
$log_file = self::getFiles();
|
$log_file = self::getFiles();
|
||||||
if (! count($log_file)) {
|
if (!count($log_file)) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
self::$file = $log_file[0];
|
self::$file = $log_file[0];
|
||||||
@@ -106,7 +106,7 @@ class LaravelLogViewer
|
|||||||
|
|
||||||
preg_match_all($pattern, $file, $headings);
|
preg_match_all($pattern, $file, $headings);
|
||||||
|
|
||||||
if (! is_array($headings)) {
|
if (!is_array($headings)) {
|
||||||
return $log;
|
return $log;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -122,7 +122,7 @@ class LaravelLogViewer
|
|||||||
if (strpos(strtolower($h[$i]), '.'.$level_value)) {
|
if (strpos(strtolower($h[$i]), '.'.$level_value)) {
|
||||||
preg_match('/^\[(\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2})\].*?(\w+)\.'.$level_key.': (.*?)( in .*?:[0-9]+)?$/', $h[$i], $current);
|
preg_match('/^\[(\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2})\].*?(\w+)\.'.$level_key.': (.*?)( in .*?:[0-9]+)?$/', $h[$i], $current);
|
||||||
|
|
||||||
if (! isset($current[3])) {
|
if (!isset($current[3])) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -142,14 +142,14 @@ class LaravelLogViewer
|
|||||||
}
|
}
|
||||||
//dd($current);
|
//dd($current);
|
||||||
$log[] = [
|
$log[] = [
|
||||||
'context' => $context,
|
'context' => $context,
|
||||||
'level' => $level_value,
|
'level' => $level_value,
|
||||||
'level_class' => self::$levels_classes[$level_value],
|
'level_class' => self::$levels_classes[$level_value],
|
||||||
'level_img' => self::$levels_imgs[$level_value],
|
'level_img' => self::$levels_imgs[$level_value],
|
||||||
'date' => self::date($current[1]),
|
'date' => self::date($current[1]),
|
||||||
'text' => $message,
|
'text' => $message,
|
||||||
'in_file' => isset($current[4]) ? $current[4] : null,
|
'in_file' => isset($current[4]) ? $current[4] : null,
|
||||||
'stack' => preg_replace("/^\n*/", '', $log_data[$i]),
|
'stack' => preg_replace("/^\n*/", '', $log_data[$i]),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -160,7 +160,8 @@ class LaravelLogViewer
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param bool $basename
|
* @param bool $basename
|
||||||
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public static function getFiles($basename = false)
|
public static function getFiles($basename = false)
|
||||||
|
@@ -30,8 +30,8 @@ class LogViewerController extends Controller
|
|||||||
$logs = LaravelLogViewer::all();
|
$logs = LaravelLogViewer::all();
|
||||||
|
|
||||||
return View::make('log::log', [
|
return View::make('log::log', [
|
||||||
'logs' => $logs,
|
'logs' => $logs,
|
||||||
'files' => LaravelLogViewer::getFiles(true),
|
'files' => LaravelLogViewer::getFiles(true),
|
||||||
'current_file' => LaravelLogViewer::getFileName(),
|
'current_file' => LaravelLogViewer::getFileName(),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
@@ -88,9 +88,9 @@ class SettingsController extends Controller
|
|||||||
public function save($key, $value)
|
public function save($key, $value)
|
||||||
{
|
{
|
||||||
CommonSettings::create([
|
CommonSettings::create([
|
||||||
'option_name' => 'storage',
|
'option_name' => 'storage',
|
||||||
'optional_field' => $key,
|
'optional_field' => $key,
|
||||||
'option_value' => $value,
|
'option_value' => $value,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -124,10 +124,10 @@ class SettingsController extends Controller
|
|||||||
|
|
||||||
public function activate()
|
public function activate()
|
||||||
{
|
{
|
||||||
if (! \Schema::hasColumn('ticket_attachment', 'driver')) {
|
if (!\Schema::hasColumn('ticket_attachment', 'driver')) {
|
||||||
$path = 'app'.DIRECTORY_SEPARATOR.'FaveoStorage'.DIRECTORY_SEPARATOR.'database'.DIRECTORY_SEPARATOR.'migrations';
|
$path = 'app'.DIRECTORY_SEPARATOR.'FaveoStorage'.DIRECTORY_SEPARATOR.'database'.DIRECTORY_SEPARATOR.'migrations';
|
||||||
Artisan::call('migrate', [
|
Artisan::call('migrate', [
|
||||||
'--path' => $path,
|
'--path' => $path,
|
||||||
'--force' => true,
|
'--force' => true,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
@@ -160,8 +160,8 @@ class StorageController extends Controller
|
|||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'default' => $this->default,
|
'default' => $this->default,
|
||||||
'cloud' => 's3',
|
'cloud' => 's3',
|
||||||
'disks' => $this->disks(),
|
'disks' => $this->disks(),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -170,23 +170,23 @@ class StorageController extends Controller
|
|||||||
return [
|
return [
|
||||||
'local' => [
|
'local' => [
|
||||||
'driver' => 'local',
|
'driver' => 'local',
|
||||||
'root' => $this->root.'/attachments',
|
'root' => $this->root.'/attachments',
|
||||||
],
|
],
|
||||||
's3' => [
|
's3' => [
|
||||||
'driver' => 's3',
|
'driver' => 's3',
|
||||||
'key' => $this->s3_key,
|
'key' => $this->s3_key,
|
||||||
'secret' => $this->s3_secret,
|
'secret' => $this->s3_secret,
|
||||||
'region' => $this->s3_region,
|
'region' => $this->s3_region,
|
||||||
'bucket' => $this->s3_bucket,
|
'bucket' => $this->s3_bucket,
|
||||||
],
|
],
|
||||||
'rackspace' => [
|
'rackspace' => [
|
||||||
'driver' => 'rackspace',
|
'driver' => 'rackspace',
|
||||||
'username' => $this->rackspace_username,
|
'username' => $this->rackspace_username,
|
||||||
'key' => $this->rackspace_key,
|
'key' => $this->rackspace_key,
|
||||||
'container' => $this->rackspace_container,
|
'container' => $this->rackspace_container,
|
||||||
'endpoint' => $this->rackspace_endpoint,
|
'endpoint' => $this->rackspace_endpoint,
|
||||||
'region' => $this->rackspace_region,
|
'region' => $this->rackspace_region,
|
||||||
'url_type' => $this->rackspace_url_type,
|
'url_type' => $this->rackspace_url_type,
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
@@ -1,16 +1,16 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'settings' => 'Settings',
|
'settings' => 'Settings',
|
||||||
'storage' => 'Storage',
|
'storage' => 'Storage',
|
||||||
'default' => 'Default',
|
'default' => 'Default',
|
||||||
'root' => 'Root',
|
'root' => 'Root',
|
||||||
'region' => 'Region',
|
'region' => 'Region',
|
||||||
'key' => 'Key',
|
'key' => 'Key',
|
||||||
'secret' => 'Secret',
|
'secret' => 'Secret',
|
||||||
'bucket' => 'Bucket',
|
'bucket' => 'Bucket',
|
||||||
'username' => 'Username',
|
'username' => 'Username',
|
||||||
'container' => 'Container',
|
'container' => 'Container',
|
||||||
'endpoint' => 'End Point',
|
'endpoint' => 'End Point',
|
||||||
'url_type' => 'Url Type',
|
'url_type' => 'Url Type',
|
||||||
];
|
];
|
||||||
|
@@ -24,6 +24,7 @@ class Finder
|
|||||||
*
|
*
|
||||||
* @param $id type int
|
* @param $id type int
|
||||||
* @param $custom type array/null
|
* @param $custom type array/null
|
||||||
|
*
|
||||||
* @return type string
|
* @return type string
|
||||||
*/
|
*/
|
||||||
public static function department($id, $custom = null)
|
public static function department($id, $custom = null)
|
||||||
@@ -43,6 +44,7 @@ class Finder
|
|||||||
*
|
*
|
||||||
* @param $id type int
|
* @param $id type int
|
||||||
* @param $custom type array/null
|
* @param $custom type array/null
|
||||||
|
*
|
||||||
* @return type string
|
* @return type string
|
||||||
*/
|
*/
|
||||||
public static function group($id, $custom = null)
|
public static function group($id, $custom = null)
|
||||||
@@ -62,6 +64,7 @@ class Finder
|
|||||||
*
|
*
|
||||||
* @param $id type int
|
* @param $id type int
|
||||||
* @param $custom type array/null
|
* @param $custom type array/null
|
||||||
|
*
|
||||||
* @return type string
|
* @return type string
|
||||||
*/
|
*/
|
||||||
public static function statusType($id, $custom = null)
|
public static function statusType($id, $custom = null)
|
||||||
@@ -81,6 +84,7 @@ class Finder
|
|||||||
*
|
*
|
||||||
* @param $id type int
|
* @param $id type int
|
||||||
* @param $custom type array/null
|
* @param $custom type array/null
|
||||||
|
*
|
||||||
* @return type string
|
* @return type string
|
||||||
*/
|
*/
|
||||||
public static function status($id, $custom = null)
|
public static function status($id, $custom = null)
|
||||||
@@ -106,6 +110,7 @@ class Finder
|
|||||||
* If the value is 1+2+4 = 7 the response is client, agent, admin.
|
* If the value is 1+2+4 = 7 the response is client, agent, admin.
|
||||||
*
|
*
|
||||||
* @param $id type int
|
* @param $id type int
|
||||||
|
*
|
||||||
* @return type string
|
* @return type string
|
||||||
*/
|
*/
|
||||||
public static function rolesGroup($id)
|
public static function rolesGroup($id)
|
||||||
@@ -136,7 +141,8 @@ class Finder
|
|||||||
* ANY TYPE STATUS
|
* ANY TYPE STATUS
|
||||||
* This function is used to return the set of status which are of any type passed in the param.
|
* This function is used to return the set of status which are of any type passed in the param.
|
||||||
*
|
*
|
||||||
* @param type $id
|
* @param type $id
|
||||||
|
*
|
||||||
* @return type array
|
* @return type array
|
||||||
*/
|
*/
|
||||||
public static function anyTypeStatus($id)
|
public static function anyTypeStatus($id)
|
||||||
|
@@ -67,11 +67,12 @@ class AgentController extends Controller
|
|||||||
/**
|
/**
|
||||||
* creating a new agent.
|
* creating a new agent.
|
||||||
*
|
*
|
||||||
* @param Assign_team_agent $team_assign_agent
|
* @param Assign_team_agent $team_assign_agent
|
||||||
* @param Timezones $timezone
|
* @param Timezones $timezone
|
||||||
* @param Groups $group
|
* @param Groups $group
|
||||||
* @param Department $department
|
* @param Department $department
|
||||||
* @param Teams $team_all
|
* @param Teams $team_all
|
||||||
|
*
|
||||||
* @return type view
|
* @return type view
|
||||||
*/
|
*/
|
||||||
public function create(Timezones $timezone, Groups $group, Department $department, Teams $team_all, CountryCode $code)
|
public function create(Timezones $timezone, Groups $group, Department $department, Teams $team_all, CountryCode $code)
|
||||||
@@ -102,9 +103,10 @@ class AgentController extends Controller
|
|||||||
/**
|
/**
|
||||||
* store a new agent.
|
* store a new agent.
|
||||||
*
|
*
|
||||||
* @param User $user
|
* @param User $user
|
||||||
* @param AgentRequest $request
|
* @param AgentRequest $request
|
||||||
* @param Assign_team_agent $team_assign_agent
|
* @param Assign_team_agent $team_assign_agent
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function store(User $user, AgentRequest $request)
|
public function store(User $user, AgentRequest $request)
|
||||||
@@ -113,7 +115,7 @@ class AgentController extends Controller
|
|||||||
return redirect()->back()->with(['fails2' => Lang::get('lang.country-code-required-error'), 'country_code' => 1])->withInput();
|
return redirect()->back()->with(['fails2' => Lang::get('lang.country-code-required-error'), 'country_code' => 1])->withInput();
|
||||||
} else {
|
} else {
|
||||||
$code = CountryCode::select('phonecode')->where('phonecode', '=', $request->get('country_code'))->get();
|
$code = CountryCode::select('phonecode')->where('phonecode', '=', $request->get('country_code'))->get();
|
||||||
if (! count($code)) {
|
if (!count($code)) {
|
||||||
return redirect()->back()->with(['fails2' => Lang::get('lang.incorrect-country-code-error'), 'country_code' => 1])->withInput();
|
return redirect()->back()->with(['fails2' => Lang::get('lang.incorrect-country-code-error'), 'country_code' => 1])->withInput();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -175,6 +177,7 @@ class AgentController extends Controller
|
|||||||
* @param type Groups $group
|
* @param type Groups $group
|
||||||
* @param type Department $department
|
* @param type Department $department
|
||||||
* @param type Teams $team
|
* @param type Teams $team
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function edit($id, User $user, Assign_team_agent $team_assign_agent, Timezones $timezone, Groups $group, Department $department, Teams $team, CountryCode $code)
|
public function edit($id, User $user, Assign_team_agent $team_assign_agent, Timezones $timezone, Groups $group, Department $department, Teams $team, CountryCode $code)
|
||||||
@@ -205,6 +208,7 @@ class AgentController extends Controller
|
|||||||
* @param type User $user
|
* @param type User $user
|
||||||
* @param type AgentUpdate $request
|
* @param type AgentUpdate $request
|
||||||
* @param type Assign_team_agent $team_assign_agent
|
* @param type Assign_team_agent $team_assign_agent
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function update($id, User $user, AgentUpdate $request, Assign_team_agent $team_assign_agent)
|
public function update($id, User $user, AgentUpdate $request, Assign_team_agent $team_assign_agent)
|
||||||
@@ -213,7 +217,7 @@ class AgentController extends Controller
|
|||||||
return redirect()->back()->with(['fails2' => Lang::get('lang.country-code-required-error'), 'country_code' => 1])->withInput();
|
return redirect()->back()->with(['fails2' => Lang::get('lang.country-code-required-error'), 'country_code' => 1])->withInput();
|
||||||
} else {
|
} else {
|
||||||
$code = CountryCode::select('phonecode')->where('phonecode', '=', $request->get('country_code'))->get();
|
$code = CountryCode::select('phonecode')->where('phonecode', '=', $request->get('country_code'))->get();
|
||||||
if (! count($code)) {
|
if (!count($code)) {
|
||||||
return redirect()->back()->with(['fails2' => Lang::get('lang.incorrect-country-code-error'), 'country_code' => 1])->withInput();
|
return redirect()->back()->with(['fails2' => Lang::get('lang.incorrect-country-code-error'), 'country_code' => 1])->withInput();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -252,12 +256,13 @@ class AgentController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Remove the specified agent from storage.
|
* Remove the specified agent from storage.
|
||||||
*
|
*
|
||||||
* @param type $id
|
* @param type $id
|
||||||
* @param User $user
|
* @param User $user
|
||||||
* @param Assign_team_agent $team_assign_agent
|
* @param Assign_team_agent $team_assign_agent
|
||||||
* @return type Response
|
|
||||||
*
|
*
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
|
*
|
||||||
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function destroy($id, User $user, Assign_team_agent $team_assign_agent)
|
public function destroy($id, User $user, Assign_team_agent $team_assign_agent)
|
||||||
{
|
{
|
||||||
@@ -283,7 +288,8 @@ class AgentController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Generate a random string for password.
|
* Generate a random string for password.
|
||||||
*
|
*
|
||||||
* @param type $length
|
* @param type $length
|
||||||
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function generateRandomString($length = 10)
|
public function generateRandomString($length = 10)
|
||||||
|
@@ -71,8 +71,9 @@ class BanlistController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Store a new banned user credentials.
|
* Store a new banned user credentials.
|
||||||
*
|
*
|
||||||
* @param BanRequest $request
|
* @param BanRequest $request
|
||||||
* @param User $user
|
* @param User $user
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function store(BanRequest $request, User $user)
|
public function store(BanRequest $request, User $user)
|
||||||
@@ -105,8 +106,9 @@ class BanlistController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Editing the details of the banned users.
|
* Editing the details of the banned users.
|
||||||
*
|
*
|
||||||
* @param type $id
|
* @param type $id
|
||||||
* @param User $ban
|
* @param User $ban
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function edit($id, User $ban)
|
public function edit($id, User $ban)
|
||||||
@@ -123,9 +125,10 @@ class BanlistController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Update the banned users.
|
* Update the banned users.
|
||||||
*
|
*
|
||||||
* @param type $id
|
* @param type $id
|
||||||
* @param User $ban
|
* @param User $ban
|
||||||
* @param BanlistRequest $request
|
* @param BanlistRequest $request
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function update($id, User $ban, BanlistRequest $request)
|
public function update($id, User $ban, BanlistRequest $request)
|
||||||
@@ -147,8 +150,9 @@ class BanlistController extends Controller
|
|||||||
/**
|
/**
|
||||||
* delete the banned users.
|
* delete the banned users.
|
||||||
*
|
*
|
||||||
* @param type $id
|
* @param type $id
|
||||||
* @param \App\User $ban
|
* @param \App\User $ban
|
||||||
|
*
|
||||||
* @return type view
|
* @return type view
|
||||||
*/
|
*/
|
||||||
public function delete($id, User $ban)
|
public function delete($id, User $ban)
|
||||||
|
@@ -25,7 +25,8 @@ class CloseWrokflowController extends Controller
|
|||||||
/**
|
/**
|
||||||
* get the workflow settings page.
|
* get the workflow settings page.
|
||||||
*
|
*
|
||||||
* @param \App\Model\helpdesk\Workflow\WorkflowClose $securitys
|
* @param \App\Model\helpdesk\Workflow\WorkflowClose $securitys
|
||||||
|
*
|
||||||
* @return type view
|
* @return type view
|
||||||
*/
|
*/
|
||||||
public function index(WorkflowClose $securitys)
|
public function index(WorkflowClose $securitys)
|
||||||
@@ -42,8 +43,9 @@ class CloseWrokflowController extends Controller
|
|||||||
/**
|
/**
|
||||||
* updating the workflow settings for closing ticket.
|
* updating the workflow settings for closing ticket.
|
||||||
*
|
*
|
||||||
* @param type $id
|
* @param type $id
|
||||||
* @param \App\Http\Requests\helpdesk\WorkflowCloseRequest $request
|
* @param \App\Http\Requests\helpdesk\WorkflowCloseRequest $request
|
||||||
|
*
|
||||||
* @return type redirect
|
* @return type redirect
|
||||||
*/
|
*/
|
||||||
public function update($id, WorkflowCloseRequest $request)
|
public function update($id, WorkflowCloseRequest $request)
|
||||||
|
@@ -45,6 +45,7 @@ class DepartmentController extends Controller
|
|||||||
* Get index page.
|
* Get index page.
|
||||||
*
|
*
|
||||||
* @param type Department $department
|
* @param type Department $department
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function index(Department $department)
|
public function index(Department $department)
|
||||||
@@ -68,6 +69,7 @@ class DepartmentController extends Controller
|
|||||||
* @param type Template $template
|
* @param type Template $template
|
||||||
* @param type Emails $email
|
* @param type Emails $email
|
||||||
* @param type Groups $group
|
* @param type Groups $group
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function create(User $user, Group_assign_department $group_assign_department, Department $department, Sla_plan $sla, Template $template, Emails $email, Groups $group)
|
public function create(User $user, Group_assign_department $group_assign_department, Department $department, Sla_plan $sla, Template $template, Emails $email, Groups $group)
|
||||||
@@ -94,6 +96,7 @@ class DepartmentController extends Controller
|
|||||||
*
|
*
|
||||||
* @param type Department $department
|
* @param type Department $department
|
||||||
* @param type DepartmentRequest $request
|
* @param type DepartmentRequest $request
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function store(Department $department, DepartmentRequest $request)
|
public function store(Department $department, DepartmentRequest $request)
|
||||||
@@ -142,6 +145,7 @@ class DepartmentController extends Controller
|
|||||||
* @param type Sla_plan $sla
|
* @param type Sla_plan $sla
|
||||||
* @param type Emails $email
|
* @param type Emails $email
|
||||||
* @param type Groups $group
|
* @param type Groups $group
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function edit($id, User $user, Group_assign_department $group_assign_department, Template $template, Teams $team, Department $department, Sla_plan $sla, Emails $email, Groups $group)
|
public function edit($id, User $user, Group_assign_department $group_assign_department, Template $template, Teams $team, Department $department, Sla_plan $sla, Emails $email, Groups $group)
|
||||||
@@ -175,6 +179,7 @@ class DepartmentController extends Controller
|
|||||||
* @param type Group_assign_department $group_assign_department
|
* @param type Group_assign_department $group_assign_department
|
||||||
* @param type Department $department
|
* @param type Department $department
|
||||||
* @param type DepartmentUpdate $request
|
* @param type DepartmentUpdate $request
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function update($id, Group_assign_department $group_assign_department, Department $department, DepartmentUpdate $request)
|
public function update($id, Group_assign_department $group_assign_department, Department $department, DepartmentUpdate $request)
|
||||||
@@ -223,6 +228,7 @@ class DepartmentController extends Controller
|
|||||||
* @param type int $id
|
* @param type int $id
|
||||||
* @param type Department $department
|
* @param type Department $department
|
||||||
* @param type Group_assign_department $group_assign_department
|
* @param type Group_assign_department $group_assign_department
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function destroy($id, Department $department, Group_assign_department $group_assign_department, System $system, Tickets $tickets)
|
public function destroy($id, Department $department, Group_assign_department $group_assign_department, System $system, Tickets $tickets)
|
||||||
|
@@ -44,6 +44,7 @@ class EmailsController extends Controller
|
|||||||
* Display a listing of the Emails.
|
* Display a listing of the Emails.
|
||||||
*
|
*
|
||||||
* @param type Emails $emails
|
* @param type Emails $emails
|
||||||
|
*
|
||||||
* @return type view
|
* @return type view
|
||||||
*/
|
*/
|
||||||
public function index(Emails $email)
|
public function index(Emails $email)
|
||||||
@@ -65,6 +66,7 @@ class EmailsController extends Controller
|
|||||||
* @param type Help_topic $help
|
* @param type Help_topic $help
|
||||||
* @param type Priority $priority
|
* @param type Priority $priority
|
||||||
* @param type MailboxProtocol $mailbox_protocol
|
* @param type MailboxProtocol $mailbox_protocol
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function create(Department $department, Help_topic $help, Ticket_Priority $ticket_priority, MailboxProtocol $mailbox_protocol)
|
public function create(Department $department, Help_topic $help, Ticket_Priority $ticket_priority, MailboxProtocol $mailbox_protocol)
|
||||||
@@ -93,7 +95,8 @@ class EmailsController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Check for email input validation.
|
* Check for email input validation.
|
||||||
*
|
*
|
||||||
* @param EmailsRequest $request
|
* @param EmailsRequest $request
|
||||||
|
*
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
public function validatingEmailSettings(MailRequest $request, $id = '')
|
public function validatingEmailSettings(MailRequest $request, $id = '')
|
||||||
@@ -158,6 +161,7 @@ class EmailsController extends Controller
|
|||||||
*
|
*
|
||||||
* @param type Emails $email
|
* @param type Emails $email
|
||||||
* @param type EmailsRequest $request
|
* @param type EmailsRequest $request
|
||||||
|
*
|
||||||
* @return type Redirect
|
* @return type Redirect
|
||||||
*/
|
*/
|
||||||
public function store($request, $service_request = [], $id = '')
|
public function store($request, $service_request = [], $id = '')
|
||||||
@@ -202,7 +206,7 @@ class EmailsController extends Controller
|
|||||||
$email->auto_response = 0;
|
$email->auto_response = 0;
|
||||||
}
|
}
|
||||||
$email->fetching_encryption = $request->input('fetching_encryption');
|
$email->fetching_encryption = $request->input('fetching_encryption');
|
||||||
if (! $request->input('imap_validate')) {
|
if (!$request->input('imap_validate')) {
|
||||||
$email->mailbox_protocol = 'novalidate-cert';
|
$email->mailbox_protocol = 'novalidate-cert';
|
||||||
}
|
}
|
||||||
$email->department = $this->departmentValue($request->input('department'));
|
$email->department = $this->departmentValue($request->input('department'));
|
||||||
@@ -285,13 +289,13 @@ class EmailsController extends Controller
|
|||||||
public function setMailConfig($driver, $address, $name, $username, $password, $enc, $host, $port)
|
public function setMailConfig($driver, $address, $name, $username, $password, $enc, $host, $port)
|
||||||
{
|
{
|
||||||
$configs = [
|
$configs = [
|
||||||
'username' => $username,
|
'username' => $username,
|
||||||
'from' => ['address' => $address, 'name' => $name],
|
'from' => ['address' => $address, 'name' => $name],
|
||||||
'password' => $password,
|
'password' => $password,
|
||||||
'encryption' => $enc,
|
'encryption' => $enc,
|
||||||
'host' => $host,
|
'host' => $host,
|
||||||
'port' => $port,
|
'port' => $port,
|
||||||
'driver' => $driver,
|
'driver' => $driver,
|
||||||
];
|
];
|
||||||
foreach ($configs as $key => $config) {
|
foreach ($configs as $key => $config) {
|
||||||
if (is_array($config)) {
|
if (is_array($config)) {
|
||||||
@@ -325,6 +329,7 @@ class EmailsController extends Controller
|
|||||||
* @param type Emails $email
|
* @param type Emails $email
|
||||||
* @param type Priority $priority
|
* @param type Priority $priority
|
||||||
* @param type MailboxProtocol $mailbox_protocol
|
* @param type MailboxProtocol $mailbox_protocol
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function edit($id, Department $department, Help_topic $help, Emails $email, Ticket_Priority $ticket_priority, MailboxProtocol $mailbox_protocol)
|
public function edit($id, Department $department, Help_topic $help, Emails $email, Ticket_Priority $ticket_priority, MailboxProtocol $mailbox_protocol)
|
||||||
@@ -359,7 +364,8 @@ class EmailsController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Check for email input validation.
|
* Check for email input validation.
|
||||||
*
|
*
|
||||||
* @param EmailsRequest $request
|
* @param EmailsRequest $request
|
||||||
|
*
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
public function validatingEmailSettingsUpdate($id, MailRequest $request)
|
public function validatingEmailSettingsUpdate($id, MailRequest $request)
|
||||||
@@ -381,9 +387,10 @@ class EmailsController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Update the specified resource in storage.
|
* Update the specified resource in storage.
|
||||||
*
|
*
|
||||||
* @param type $id
|
* @param type $id
|
||||||
* @param type Emails $email
|
* @param type Emails $email
|
||||||
* @param type EmailsEditRequest $request
|
* @param type EmailsEditRequest $request
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function update($id, $request)
|
public function update($id, $request)
|
||||||
@@ -411,6 +418,7 @@ class EmailsController extends Controller
|
|||||||
*
|
*
|
||||||
* @param type int $id
|
* @param type int $id
|
||||||
* @param type Emails $email
|
* @param type Emails $email
|
||||||
|
*
|
||||||
* @return type Redirect
|
* @return type Redirect
|
||||||
*/
|
*/
|
||||||
public function destroy($id, Emails $email)
|
public function destroy($id, Emails $email)
|
||||||
@@ -440,7 +448,8 @@ class EmailsController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Create imap connection.
|
* Create imap connection.
|
||||||
*
|
*
|
||||||
* @param type $request
|
* @param type $request
|
||||||
|
*
|
||||||
* @return type int
|
* @return type int
|
||||||
*/
|
*/
|
||||||
public function getImapStream($request)
|
public function getImapStream($request)
|
||||||
@@ -460,7 +469,7 @@ class EmailsController extends Controller
|
|||||||
if ($encryption != '') {
|
if ($encryption != '') {
|
||||||
$server->setFlag($encryption);
|
$server->setFlag($encryption);
|
||||||
}
|
}
|
||||||
if (! $validate) {
|
if (!$validate) {
|
||||||
$server->setFlag('novalidate-cert');
|
$server->setFlag('novalidate-cert');
|
||||||
} else {
|
} else {
|
||||||
$server->setFlag('validate-cert');
|
$server->setFlag('validate-cert');
|
||||||
@@ -475,7 +484,8 @@ class EmailsController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Check connection.
|
* Check connection.
|
||||||
*
|
*
|
||||||
* @param type $imap_stream
|
* @param type $imap_stream
|
||||||
|
*
|
||||||
* @return type int
|
* @return type int
|
||||||
*/
|
*/
|
||||||
public function checkImapStream($imap_stream)
|
public function checkImapStream($imap_stream)
|
||||||
@@ -493,7 +503,8 @@ class EmailsController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Get smtp connection.
|
* Get smtp connection.
|
||||||
*
|
*
|
||||||
* @param type $request
|
* @param type $request
|
||||||
|
*
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
public function getSmtp($request)
|
public function getSmtp($request)
|
||||||
@@ -509,12 +520,12 @@ class EmailsController extends Controller
|
|||||||
$mail->Password = $request->input('password'); // SMTP password
|
$mail->Password = $request->input('password'); // SMTP password
|
||||||
$mail->SMTPSecure = $request->input('sending_encryption'); // Enable TLS encryption, `ssl` also accepted
|
$mail->SMTPSecure = $request->input('sending_encryption'); // Enable TLS encryption, `ssl` also accepted
|
||||||
$mail->Port = $request->input('sending_port'); // TCP port to connect to
|
$mail->Port = $request->input('sending_port'); // TCP port to connect to
|
||||||
if (! $request->input('smtp_validate')) {
|
if (!$request->input('smtp_validate')) {
|
||||||
$mail->SMTPAuth = true; // Enable SMTP authentication
|
$mail->SMTPAuth = true; // Enable SMTP authentication
|
||||||
$mail->SMTPOptions = [
|
$mail->SMTPOptions = [
|
||||||
'ssl' => [
|
'ssl' => [
|
||||||
'verify_peer' => false,
|
'verify_peer' => false,
|
||||||
'verify_peer_name' => false,
|
'verify_peer_name' => false,
|
||||||
'allow_self_signed' => true,
|
'allow_self_signed' => true,
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
@@ -542,7 +553,8 @@ class EmailsController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Checking if department value is null.
|
* Checking if department value is null.
|
||||||
*
|
*
|
||||||
* @param type $dept
|
* @param type $dept
|
||||||
|
*
|
||||||
* @return type string or null
|
* @return type string or null
|
||||||
*/
|
*/
|
||||||
public function departmentValue($dept)
|
public function departmentValue($dept)
|
||||||
@@ -559,7 +571,8 @@ class EmailsController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Checking if priority value is null.
|
* Checking if priority value is null.
|
||||||
*
|
*
|
||||||
* @param type $priority
|
* @param type $priority
|
||||||
|
*
|
||||||
* @return type string or null
|
* @return type string or null
|
||||||
*/
|
*/
|
||||||
public function priorityValue($priority)
|
public function priorityValue($priority)
|
||||||
@@ -576,7 +589,8 @@ class EmailsController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Checking if helptopic value is null.
|
* Checking if helptopic value is null.
|
||||||
*
|
*
|
||||||
* @param type $help_topic
|
* @param type $help_topic
|
||||||
|
*
|
||||||
* @return type string or null
|
* @return type string or null
|
||||||
*/
|
*/
|
||||||
public function helpTopicValue($help_topic)
|
public function helpTopicValue($help_topic)
|
||||||
@@ -622,9 +636,9 @@ class EmailsController extends Controller
|
|||||||
}
|
}
|
||||||
foreach ($request as $key => $value) {
|
foreach ($request as $key => $value) {
|
||||||
$mail_service->create([
|
$mail_service->create([
|
||||||
'drive' => $driver,
|
'drive' => $driver,
|
||||||
'key' => $key,
|
'key' => $key,
|
||||||
'value' => $value,
|
'value' => $value,
|
||||||
'email_id' => $emailid,
|
'email_id' => $emailid,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
@@ -34,6 +34,7 @@ class ErrorAndDebuggingController extends Controller
|
|||||||
* function to show error and debugging setting page.
|
* function to show error and debugging setting page.
|
||||||
*
|
*
|
||||||
* @param void
|
* @param void
|
||||||
|
*
|
||||||
* @return response
|
* @return response
|
||||||
*/
|
*/
|
||||||
public function showSettings()
|
public function showSettings()
|
||||||
@@ -48,6 +49,7 @@ class ErrorAndDebuggingController extends Controller
|
|||||||
* funtion to update error and debugging settings.
|
* funtion to update error and debugging settings.
|
||||||
*
|
*
|
||||||
* @param void
|
* @param void
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public function postSettings()
|
public function postSettings()
|
||||||
@@ -98,6 +100,7 @@ class ErrorAndDebuggingController extends Controller
|
|||||||
* function to show error log table page.
|
* function to show error log table page.
|
||||||
*
|
*
|
||||||
* @param void
|
* @param void
|
||||||
|
*
|
||||||
* @return response view
|
* @return response view
|
||||||
*/
|
*/
|
||||||
public function showErrorLogs()
|
public function showErrorLogs()
|
||||||
|
@@ -64,6 +64,7 @@ class FormController extends Controller
|
|||||||
* list of forms.
|
* list of forms.
|
||||||
*
|
*
|
||||||
* @param type Forms $forms
|
* @param type Forms $forms
|
||||||
|
*
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function index(Forms $forms)
|
public function index(Forms $forms)
|
||||||
@@ -92,7 +93,8 @@ class FormController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Show a new form.
|
* Show a new form.
|
||||||
*
|
*
|
||||||
* @param int $id
|
* @param int $id
|
||||||
|
*
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function show($id)
|
public function show($id)
|
||||||
@@ -122,9 +124,9 @@ class FormController extends Controller
|
|||||||
{
|
{
|
||||||
$this->validate($request, [
|
$this->validate($request, [
|
||||||
'formname' => 'required|unique:custom_forms,formname',
|
'formname' => 'required|unique:custom_forms,formname',
|
||||||
'label.*' => 'required',
|
'label.*' => 'required',
|
||||||
'name.*' => 'required',
|
'name.*' => 'required',
|
||||||
'type.*' => 'required',
|
'type.*' => 'required',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -136,13 +138,13 @@ class FormController extends Controller
|
|||||||
$count = count(Input::get('name'));
|
$count = count(Input::get('name'));
|
||||||
$fields = [];
|
$fields = [];
|
||||||
for ($i = 0; $i <= $count; $i++) {
|
for ($i = 0; $i <= $count; $i++) {
|
||||||
if (! empty(Input::get('name')[$i])) {
|
if (!empty(Input::get('name')[$i])) {
|
||||||
$name = Str::slug(Input::get('name')[$i], '_');
|
$name = Str::slug(Input::get('name')[$i], '_');
|
||||||
$field = Fields::create([
|
$field = Fields::create([
|
||||||
'forms_id' => $forms->id,
|
'forms_id' => $forms->id,
|
||||||
'label' => Input::get('label')[$i],
|
'label' => Input::get('label')[$i],
|
||||||
'name' => $name,
|
'name' => $name,
|
||||||
'type' => Input::get('type')[$i],
|
'type' => Input::get('type')[$i],
|
||||||
'required' => $require[$i],
|
'required' => $require[$i],
|
||||||
]);
|
]);
|
||||||
$field_id = $field->id;
|
$field_id = $field->id;
|
||||||
@@ -161,10 +163,11 @@ class FormController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Delete Form.
|
* Delete Form.
|
||||||
*
|
*
|
||||||
* @param type $id
|
* @param type $id
|
||||||
* @param \App\Model\helpdesk\Form\Forms $forms
|
* @param \App\Model\helpdesk\Form\Forms $forms
|
||||||
* @param type $field
|
* @param type $field
|
||||||
* @param type $help_topic
|
* @param type $help_topic
|
||||||
|
*
|
||||||
* @return type redirect
|
* @return type redirect
|
||||||
*/
|
*/
|
||||||
public function delete($id, Forms $forms, Fields $field, Help_topic $help_topic)
|
public function delete($id, Forms $forms, Fields $field, Help_topic $help_topic)
|
||||||
@@ -226,18 +229,18 @@ class FormController extends Controller
|
|||||||
{
|
{
|
||||||
$this->validate($request, [
|
$this->validate($request, [
|
||||||
'formname' => 'required|unique:custom_forms,formname,'.$id,
|
'formname' => 'required|unique:custom_forms,formname,'.$id,
|
||||||
'label.*' => 'required',
|
'label.*' => 'required',
|
||||||
'name.*' => 'required',
|
'name.*' => 'required',
|
||||||
'type.*' => 'required',
|
'type.*' => 'required',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (! $request->input('formname')) {
|
if (!$request->input('formname')) {
|
||||||
throw new Exception(Lang::get('lang.please_fill_form_name'));
|
throw new Exception(Lang::get('lang.please_fill_form_name'));
|
||||||
}
|
}
|
||||||
$form = new Forms();
|
$form = new Forms();
|
||||||
$forms = $form->find($id);
|
$forms = $form->find($id);
|
||||||
if (! $forms) {
|
if (!$forms) {
|
||||||
throw new Exception('Sorry we can not find your request');
|
throw new Exception('Sorry we can not find your request');
|
||||||
}
|
}
|
||||||
$forms->formname = Input::get('formname');
|
$forms->formname = Input::get('formname');
|
||||||
@@ -255,9 +258,9 @@ class FormController extends Controller
|
|||||||
$name = Str::slug(Input::get('name')[$i], '_');
|
$name = Str::slug(Input::get('name')[$i], '_');
|
||||||
$field = $field->create([
|
$field = $field->create([
|
||||||
'forms_id' => $forms->id,
|
'forms_id' => $forms->id,
|
||||||
'label' => Input::get('label')[$i],
|
'label' => Input::get('label')[$i],
|
||||||
'name' => $name,
|
'name' => $name,
|
||||||
'type' => Input::get('type')[$i],
|
'type' => Input::get('type')[$i],
|
||||||
'required' => Input::get('required')[$i],
|
'required' => Input::get('required')[$i],
|
||||||
]);
|
]);
|
||||||
$field_id = $field->id;
|
$field_id = $field->id;
|
||||||
@@ -382,9 +385,9 @@ class FormController extends Controller
|
|||||||
if (count($values_array) > 0) {
|
if (count($values_array) > 0) {
|
||||||
foreach ($values_array as $value) {
|
foreach ($values_array as $value) {
|
||||||
$field_values->create([
|
$field_values->create([
|
||||||
'field_id' => $fieldid,
|
'field_id' => $fieldid,
|
||||||
'child_id' => $childid,
|
'child_id' => $childid,
|
||||||
'field_key' => $key,
|
'field_key' => $key,
|
||||||
'field_value' => Str::slug($value, '_'),
|
'field_value' => Str::slug($value, '_'),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
@@ -41,6 +41,7 @@ class GroupController extends Controller
|
|||||||
* @param type Groups $group
|
* @param type Groups $group
|
||||||
* @param type Department $department
|
* @param type Department $department
|
||||||
* @param type Group_assign_department $group_assign_department
|
* @param type Group_assign_department $group_assign_department
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function index(Groups $group, Department $department, Group_assign_department $group_assign_department)
|
public function index(Groups $group, Department $department, Group_assign_department $group_assign_department)
|
||||||
@@ -74,6 +75,7 @@ class GroupController extends Controller
|
|||||||
*
|
*
|
||||||
* @param type Groups $group
|
* @param type Groups $group
|
||||||
* @param type GroupRequest $request
|
* @param type GroupRequest $request
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function store(Groups $group, GroupRequest $request)
|
public function store(Groups $group, GroupRequest $request)
|
||||||
@@ -94,6 +96,7 @@ class GroupController extends Controller
|
|||||||
*
|
*
|
||||||
* @param type int $id
|
* @param type int $id
|
||||||
* @param type Groups $group
|
* @param type Groups $group
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function edit($id, Groups $group)
|
public function edit($id, Groups $group)
|
||||||
@@ -113,6 +116,7 @@ class GroupController extends Controller
|
|||||||
* @param type int $id
|
* @param type int $id
|
||||||
* @param type Groups $group
|
* @param type Groups $group
|
||||||
* @param type Request $request
|
* @param type Request $request
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function update($id, Groups $group, GroupUpdateRequest $request)
|
public function update($id, Groups $group, GroupUpdateRequest $request)
|
||||||
@@ -181,6 +185,7 @@ class GroupController extends Controller
|
|||||||
* @param type int $id
|
* @param type int $id
|
||||||
* @param type Groups $group
|
* @param type Groups $group
|
||||||
* @param type Group_assign_department $group_assign_department
|
* @param type Group_assign_department $group_assign_department
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function destroy($id, Groups $group, Group_assign_department $group_assign_department)
|
public function destroy($id, Groups $group, Group_assign_department $group_assign_department)
|
||||||
|
@@ -43,6 +43,7 @@ class HelptopicController extends Controller
|
|||||||
* Display a listing of the helptopic.
|
* Display a listing of the helptopic.
|
||||||
*
|
*
|
||||||
* @param type Help_topic $topic
|
* @param type Help_topic $topic
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function index(Help_topic $topic)
|
public function index(Help_topic $topic)
|
||||||
@@ -65,6 +66,7 @@ class HelptopicController extends Controller
|
|||||||
* @param type Form_name $form
|
* @param type Form_name $form
|
||||||
* @param type Agents $agent
|
* @param type Agents $agent
|
||||||
* @param type Sla_plan $sla
|
* @param type Sla_plan $sla
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
@@ -98,6 +100,7 @@ class HelptopicController extends Controller
|
|||||||
*
|
*
|
||||||
* @param type Help_topic $topic
|
* @param type Help_topic $topic
|
||||||
* @param type HelptopicRequest $request
|
* @param type HelptopicRequest $request
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function store(Help_topic $topic, HelptopicRequest $request)
|
public function store(Help_topic $topic, HelptopicRequest $request)
|
||||||
@@ -127,13 +130,14 @@ class HelptopicController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Show the form for editing the specified helptopic.
|
* Show the form for editing the specified helptopic.
|
||||||
*
|
*
|
||||||
* @param type $id
|
* @param type $id
|
||||||
* @param type Priority $priority
|
* @param type Priority $priority
|
||||||
* @param type Department $department
|
* @param type Department $department
|
||||||
* @param type Help_topic $topic
|
* @param type Help_topic $topic
|
||||||
* @param type Form_name $form
|
* @param type Form_name $form
|
||||||
* @param type Agents $agent
|
* @param type Agents $agent
|
||||||
* @param type Sla_plan $sla
|
* @param type Sla_plan $sla
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function edit($id, Ticket_Priority $priority, Department $department, Help_topic $topic, Forms $form, Sla_plan $sla)
|
public function edit($id, Ticket_Priority $priority, Department $department, Help_topic $topic, Forms $form, Sla_plan $sla)
|
||||||
@@ -158,9 +162,10 @@ class HelptopicController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Update the specified helptopic in storage.
|
* Update the specified helptopic in storage.
|
||||||
*
|
*
|
||||||
* @param type $id
|
* @param type $id
|
||||||
* @param type Help_topic $topic
|
* @param type Help_topic $topic
|
||||||
* @param type HelptopicUpdate $request
|
* @param type HelptopicUpdate $request
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function update($id, Help_topic $topic, HelptopicUpdate $request)
|
public function update($id, Help_topic $topic, HelptopicUpdate $request)
|
||||||
@@ -200,6 +205,7 @@ class HelptopicController extends Controller
|
|||||||
*
|
*
|
||||||
* @param type int $id
|
* @param type int $id
|
||||||
* @param type Help_topic $topic
|
* @param type Help_topic $topic
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function destroy($id, Help_topic $topic, Ticket $ticket_setting)
|
public function destroy($id, Help_topic $topic, Ticket $ticket_setting)
|
||||||
|
@@ -41,12 +41,13 @@ class LanguageController extends Controller
|
|||||||
* Switch language at runtime.
|
* Switch language at runtime.
|
||||||
*
|
*
|
||||||
* @param type "" $lang
|
* @param type "" $lang
|
||||||
|
*
|
||||||
* @return type response
|
* @return type response
|
||||||
*/
|
*/
|
||||||
public function switchLanguage($lang)
|
public function switchLanguage($lang)
|
||||||
{
|
{
|
||||||
$changed = UnAuth::changeLanguage($lang);
|
$changed = UnAuth::changeLanguage($lang);
|
||||||
if (! $changed) {
|
if (!$changed) {
|
||||||
return \Redirect::back()->with('fails', Lang::get('lang.language-error'));
|
return \Redirect::back()->with('fails', Lang::get('lang.language-error'));
|
||||||
} else {
|
} else {
|
||||||
return \Redirect::back();
|
return \Redirect::back();
|
||||||
@@ -134,16 +135,16 @@ class LanguageController extends Controller
|
|||||||
try {
|
try {
|
||||||
// getting all of the post data
|
// getting all of the post data
|
||||||
$file = [
|
$file = [
|
||||||
'File' => Request::file('File'),
|
'File' => Request::file('File'),
|
||||||
'language-name' => Request::input('language-name'),
|
'language-name' => Request::input('language-name'),
|
||||||
'iso-code' => Request::input('iso-code'),
|
'iso-code' => Request::input('iso-code'),
|
||||||
];
|
];
|
||||||
|
|
||||||
// setting up rules
|
// setting up rules
|
||||||
$rules = [
|
$rules = [
|
||||||
'File' => 'required|mimes:zip|max:30000',
|
'File' => 'required|mimes:zip|max:30000',
|
||||||
'language-name' => 'required',
|
'language-name' => 'required',
|
||||||
'iso-code' => 'required|max:2',
|
'iso-code' => 'required|max:2',
|
||||||
]; // and for max size
|
]; // and for max size
|
||||||
// doing the validation, passing post data, rules and the messages
|
// doing the validation, passing post data, rules and the messages
|
||||||
$validator = Validator::make($file, $rules);
|
$validator = Validator::make($file, $rules);
|
||||||
@@ -162,7 +163,7 @@ class LanguageController extends Controller
|
|||||||
Session::flash('link', 'change-language/'.strtolower(Request::get('iso-code')));
|
Session::flash('link', 'change-language/'.strtolower(Request::get('iso-code')));
|
||||||
|
|
||||||
return Redirect::back()->withInput();
|
return Redirect::back()->withInput();
|
||||||
} elseif (! array_key_exists(strtolower(Request::get('iso-code')), Config::get('languages'))) {//Checking Valid ISO code form Languages.php
|
} elseif (!array_key_exists(strtolower(Request::get('iso-code')), Config::get('languages'))) {//Checking Valid ISO code form Languages.php
|
||||||
//sending back with error message
|
//sending back with error message
|
||||||
Session::flash('fails', Lang::get('lang.iso-code-error'));
|
Session::flash('fails', Lang::get('lang.iso-code-error'));
|
||||||
|
|
||||||
@@ -181,7 +182,7 @@ class LanguageController extends Controller
|
|||||||
//check if Zip extract foldercontains any subfolder
|
//check if Zip extract foldercontains any subfolder
|
||||||
$directories = File::directories($extractpath);
|
$directories = File::directories($extractpath);
|
||||||
//$directories = glob($extractpath. '/*' , GLOB_ONLYDIR);
|
//$directories = glob($extractpath. '/*' , GLOB_ONLYDIR);
|
||||||
if (! empty($directories)) { //if extract folder contains subfolder
|
if (!empty($directories)) { //if extract folder contains subfolder
|
||||||
$success = File::deleteDirectory($extractpath); //remove extracted folder and it's subfolder from lang
|
$success = File::deleteDirectory($extractpath); //remove extracted folder and it's subfolder from lang
|
||||||
//$success2 = File::delete($destinationPath.'/'.$name);
|
//$success2 = File::delete($destinationPath.'/'.$name);
|
||||||
if ($success) {
|
if ($success) {
|
||||||
@@ -228,7 +229,8 @@ class LanguageController extends Controller
|
|||||||
/**
|
/**
|
||||||
* This function is used to delete languages.
|
* This function is used to delete languages.
|
||||||
*
|
*
|
||||||
* @param type $lang
|
* @param type $lang
|
||||||
|
*
|
||||||
* @return type response
|
* @return type response
|
||||||
*/
|
*/
|
||||||
public function deleteLanguage($lang)
|
public function deleteLanguage($lang)
|
||||||
|
@@ -126,7 +126,8 @@ class PriorityController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param type $priority_id
|
* @param type $priority_id
|
||||||
|
*
|
||||||
* @return type
|
* @return type
|
||||||
*/
|
*/
|
||||||
public function priorityEdit($priority_id)
|
public function priorityEdit($priority_id)
|
||||||
@@ -137,7 +138,8 @@ class PriorityController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param PriorityRequest $request
|
* @param PriorityRequest $request
|
||||||
|
*
|
||||||
* @return type
|
* @return type
|
||||||
*/
|
*/
|
||||||
public function priorityEdit1(PriorityRequest $request)
|
public function priorityEdit1(PriorityRequest $request)
|
||||||
@@ -161,7 +163,8 @@ class PriorityController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param type $priority_id
|
* @param type $priority_id
|
||||||
|
*
|
||||||
* @return type
|
* @return type
|
||||||
*/
|
*/
|
||||||
public function destroy($priority_id)
|
public function destroy($priority_id)
|
||||||
|
@@ -76,6 +76,7 @@ class ProfileController extends Controller
|
|||||||
*
|
*
|
||||||
* @param type int $id
|
* @param type int $id
|
||||||
* @param type ProfileRequest $request
|
* @param type ProfileRequest $request
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function postProfile($id, ProfileRequest $request)
|
public function postProfile($id, ProfileRequest $request)
|
||||||
@@ -118,6 +119,7 @@ class ProfileController extends Controller
|
|||||||
* @param type int $id
|
* @param type int $id
|
||||||
* @param type User $user
|
* @param type User $user
|
||||||
* @param type ProfilePassword $request
|
* @param type ProfilePassword $request
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function postProfilePassword($id, User $user, ProfilePassword $request)
|
public function postProfilePassword($id, User $user, ProfilePassword $request)
|
||||||
|
@@ -32,6 +32,7 @@ class SecurityController extends Controller
|
|||||||
* list of securitys.
|
* list of securitys.
|
||||||
*
|
*
|
||||||
* @param type Security $securitys
|
* @param type Security $securitys
|
||||||
|
*
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function index(Security $securitys)
|
public function index(Security $securitys)
|
||||||
@@ -58,7 +59,8 @@ class SecurityController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Show security.
|
* Show security.
|
||||||
*
|
*
|
||||||
* @param int $id
|
* @param int $id
|
||||||
|
*
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
// public function show($id)
|
// public function show($id)
|
||||||
@@ -92,10 +94,11 @@ class SecurityController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Delete security details.
|
* Delete security details.
|
||||||
*
|
*
|
||||||
* @param type $id
|
* @param type $id
|
||||||
* @param \App\Model\helpdesk\Settings\Security $securitys
|
* @param \App\Model\helpdesk\Settings\Security $securitys
|
||||||
* @param type $field
|
* @param type $field
|
||||||
* @param \App\Http\Controllers\Admin\helpdesk\Help_topic $help_topic
|
* @param \App\Http\Controllers\Admin\helpdesk\Help_topic $help_topic
|
||||||
|
*
|
||||||
* @return type redirect
|
* @return type redirect
|
||||||
*/
|
*/
|
||||||
public function delete($id, Security $securitys, Fields $field, Help_topic $help_topic)
|
public function delete($id, Security $securitys, Fields $field, Help_topic $help_topic)
|
||||||
|
@@ -62,10 +62,11 @@ class SettingsController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param int $id
|
* @param int $id
|
||||||
* @param $compant instance of company table
|
* @param $compant instance of company table
|
||||||
*
|
*
|
||||||
* get the form for company setting page
|
* get the form for company setting page
|
||||||
|
*
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function getcompany(Company $company)
|
public function getcompany(Company $company)
|
||||||
@@ -86,6 +87,7 @@ class SettingsController extends Controller
|
|||||||
* @param type int $id
|
* @param type int $id
|
||||||
* @param type Company $company
|
* @param type Company $company
|
||||||
* @param type CompanyRequest $request
|
* @param type CompanyRequest $request
|
||||||
|
*
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function postcompany($id, Company $company, CompanyRequest $request)
|
public function postcompany($id, Company $company, CompanyRequest $request)
|
||||||
@@ -121,7 +123,7 @@ class SettingsController extends Controller
|
|||||||
public function deleteLogo()
|
public function deleteLogo()
|
||||||
{
|
{
|
||||||
$path = $_GET['data1']; //get file path of logo image
|
$path = $_GET['data1']; //get file path of logo image
|
||||||
if (! unlink($path)) {
|
if (!unlink($path)) {
|
||||||
return 'false';
|
return 'false';
|
||||||
} else {
|
} else {
|
||||||
$companys = Company::where('id', '=', 1)->first();
|
$companys = Company::where('id', '=', 1)->first();
|
||||||
@@ -143,6 +145,7 @@ class SettingsController extends Controller
|
|||||||
* @param type Date_format $date
|
* @param type Date_format $date
|
||||||
* @param type Date_time_format $date_time
|
* @param type Date_time_format $date_time
|
||||||
* @param type Time_format $time
|
* @param type Time_format $time
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function getsystem(System $system, Department $department, Timezones $timezone, Date_format $date, Date_time_format $date_time, Time_format $time, CommonSettings $common_settings)
|
public function getsystem(System $system, Department $department, Timezones $timezone, Date_format $date, Date_time_format $date_time, Time_format $time, CommonSettings $common_settings)
|
||||||
@@ -177,6 +180,7 @@ class SettingsController extends Controller
|
|||||||
* @param type int $id
|
* @param type int $id
|
||||||
* @param type System $system
|
* @param type System $system
|
||||||
* @param type SystemRequest $request
|
* @param type SystemRequest $request
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function postsystem($id, System $system, SystemRequest $request)
|
public function postsystem($id, System $system, SystemRequest $request)
|
||||||
@@ -226,6 +230,7 @@ class SettingsController extends Controller
|
|||||||
* @param type Sla_plan $sla
|
* @param type Sla_plan $sla
|
||||||
* @param type Help_topic $topic
|
* @param type Help_topic $topic
|
||||||
* @param type Priority $priority
|
* @param type Priority $priority
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function getticket(Ticket $ticket, Sla_plan $sla, Help_topic $topic, Ticket_Priority $priority)
|
public function getticket(Ticket $ticket, Sla_plan $sla, Help_topic $topic, Ticket_Priority $priority)
|
||||||
@@ -250,6 +255,7 @@ class SettingsController extends Controller
|
|||||||
* @param type int $id
|
* @param type int $id
|
||||||
* @param type Ticket $ticket
|
* @param type Ticket $ticket
|
||||||
* @param type Request $request
|
* @param type Request $request
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function postticket($id, Ticket $ticket, Request $request)
|
public function postticket($id, Ticket $ticket, Request $request)
|
||||||
@@ -284,6 +290,7 @@ class SettingsController extends Controller
|
|||||||
* @param type Email $email
|
* @param type Email $email
|
||||||
* @param type Template $template
|
* @param type Template $template
|
||||||
* @param type Emails $email1
|
* @param type Emails $email1
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function getemail(Email $email, Template $template, Emails $email1)
|
public function getemail(Email $email, Template $template, Emails $email1)
|
||||||
@@ -308,6 +315,7 @@ class SettingsController extends Controller
|
|||||||
* @param type int $id
|
* @param type int $id
|
||||||
* @param type Email $email
|
* @param type Email $email
|
||||||
* @param type EmailRequest $request
|
* @param type EmailRequest $request
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function postemail($id, Email $email, EmailRequest $request)
|
public function postemail($id, Email $email, EmailRequest $request)
|
||||||
@@ -340,6 +348,7 @@ class SettingsController extends Controller
|
|||||||
* @param type Email $email
|
* @param type Email $email
|
||||||
* @param type Template $template
|
* @param type Template $template
|
||||||
* @param type Emails $email1
|
* @param type Emails $email1
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function getSchedular(Email $email, Template $template, Emails $email1, WorkflowClose $workflow)
|
public function getSchedular(Email $email, Template $template, Emails $email1, WorkflowClose $workflow)
|
||||||
@@ -360,29 +369,29 @@ class SettingsController extends Controller
|
|||||||
$condition = new \App\Model\MailJob\Condition();
|
$condition = new \App\Model\MailJob\Condition();
|
||||||
$job = $condition->checkActiveJob();
|
$job = $condition->checkActiveJob();
|
||||||
$commands = [
|
$commands = [
|
||||||
'' => 'Select',
|
'' => 'Select',
|
||||||
'everyMinute' => 'Every Minute',
|
'everyMinute' => 'Every Minute',
|
||||||
'everyFiveMinutes' => 'Every Five Minute',
|
'everyFiveMinutes' => 'Every Five Minute',
|
||||||
'everyTenMinutes' => 'Every Ten Minute',
|
'everyTenMinutes' => 'Every Ten Minute',
|
||||||
'everyThirtyMinutes' => 'Every Thirty Minute',
|
'everyThirtyMinutes' => 'Every Thirty Minute',
|
||||||
'hourly' => 'Every Hour',
|
'hourly' => 'Every Hour',
|
||||||
'daily' => 'Every Day',
|
'daily' => 'Every Day',
|
||||||
'dailyAt' => 'Daily at',
|
'dailyAt' => 'Daily at',
|
||||||
'weekly' => 'Every Week',
|
'weekly' => 'Every Week',
|
||||||
'monthly' => 'Monthly',
|
'monthly' => 'Monthly',
|
||||||
'yearly' => 'Yearly',
|
'yearly' => 'Yearly',
|
||||||
];
|
];
|
||||||
$followupcommands = [
|
$followupcommands = [
|
||||||
'' => 'Select',
|
'' => 'Select',
|
||||||
'everyMinute' => 'Every Minute',
|
'everyMinute' => 'Every Minute',
|
||||||
'everyFiveMinutes' => 'Every Five Minute',
|
'everyFiveMinutes' => 'Every Five Minute',
|
||||||
'everyTenMinutes' => 'Every Ten Minute',
|
'everyTenMinutes' => 'Every Ten Minute',
|
||||||
'everyThirtyMinutes' => 'Every Thirty Minute',
|
'everyThirtyMinutes' => 'Every Thirty Minute',
|
||||||
'hourly' => 'Every Hour',
|
'hourly' => 'Every Hour',
|
||||||
'daily' => 'Every Day',
|
'daily' => 'Every Day',
|
||||||
'weekly' => 'Every Week',
|
'weekly' => 'Every Week',
|
||||||
'monthly' => 'Monthly',
|
'monthly' => 'Monthly',
|
||||||
'yearly' => 'Yearly',
|
'yearly' => 'Yearly',
|
||||||
];
|
];
|
||||||
if (ini_get('register_argc_argv') == '') {
|
if (ini_get('register_argc_argv') == '') {
|
||||||
//$warn = "Please make 'register_argc_argv' flag as on. Or you can set all your job url in cron";
|
//$warn = "Please make 'register_argc_argv' flag as on. Or you can set all your job url in cron";
|
||||||
@@ -398,6 +407,7 @@ class SettingsController extends Controller
|
|||||||
*
|
*
|
||||||
* @param type Email $email
|
* @param type Email $email
|
||||||
* @param type EmailRequest $request
|
* @param type EmailRequest $request
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function postSchedular(Email $email, Template $template, Emails $email1, TaskRequest $request, WorkflowClose $workflow)
|
public function postSchedular(Email $email, Template $template, Emails $email1, TaskRequest $request, WorkflowClose $workflow)
|
||||||
@@ -437,6 +447,7 @@ class SettingsController extends Controller
|
|||||||
* get the form for Responder setting page.
|
* get the form for Responder setting page.
|
||||||
*
|
*
|
||||||
* @param type Responder $responder
|
* @param type Responder $responder
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function getresponder(Responder $responder)
|
public function getresponder(Responder $responder)
|
||||||
@@ -456,6 +467,7 @@ class SettingsController extends Controller
|
|||||||
*
|
*
|
||||||
* @param type Responder $responder
|
* @param type Responder $responder
|
||||||
* @param type Request $request
|
* @param type Request $request
|
||||||
|
*
|
||||||
* @return type
|
* @return type
|
||||||
*/
|
*/
|
||||||
public function postresponder(Responder $responder, Request $request)
|
public function postresponder(Responder $responder, Request $request)
|
||||||
@@ -484,6 +496,7 @@ class SettingsController extends Controller
|
|||||||
* get the form for Alert setting page.
|
* get the form for Alert setting page.
|
||||||
*
|
*
|
||||||
* @param type Alert $alert
|
* @param type Alert $alert
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function getalert(Alert $alert)
|
public function getalert(Alert $alert)
|
||||||
@@ -501,9 +514,10 @@ class SettingsController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Update the specified alert in storage.
|
* Update the specified alert in storage.
|
||||||
*
|
*
|
||||||
* @param type $id
|
* @param type $id
|
||||||
* @param type Alert $alert
|
* @param type Alert $alert
|
||||||
* @param type Request $request
|
* @param type Request $request
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function postalert($id, Alert $alert, Request $request)
|
public function postalert($id, Alert $alert, Request $request)
|
||||||
@@ -589,10 +603,11 @@ class SettingsController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param int $id
|
* @param int $id
|
||||||
* @param $compant instance of company table
|
* @param $compant instance of company table
|
||||||
*
|
*
|
||||||
* get the form for company setting page
|
* get the form for company setting page
|
||||||
|
*
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function getStatuses()
|
public function getStatuses()
|
||||||
@@ -608,10 +623,11 @@ class SettingsController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param int $id
|
* @param int $id
|
||||||
* @param $compant instance of company table
|
* @param $compant instance of company table
|
||||||
*
|
*
|
||||||
* get the form for company setting page
|
* get the form for company setting page
|
||||||
|
*
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function getEditStatuses($id)
|
public function getEditStatuses($id)
|
||||||
@@ -627,10 +643,11 @@ class SettingsController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param int $id
|
* @param int $id
|
||||||
* @param $compant instance of company table
|
* @param $compant instance of company table
|
||||||
*
|
*
|
||||||
* get the form for company setting page
|
* get the form for company setting page
|
||||||
|
*
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function editStatuses($id, StatusRequest $request)
|
public function editStatuses($id, StatusRequest $request)
|
||||||
@@ -660,8 +677,9 @@ class SettingsController extends Controller
|
|||||||
/**
|
/**
|
||||||
* create a status.
|
* create a status.
|
||||||
*
|
*
|
||||||
* @param \App\Model\helpdesk\Ticket\Ticket_Status $statuss
|
* @param \App\Model\helpdesk\Ticket\Ticket_Status $statuss
|
||||||
* @param \App\Http\Requests\helpdesk\StatusRequest $request
|
* @param \App\Http\Requests\helpdesk\StatusRequest $request
|
||||||
|
*
|
||||||
* @return type redirect
|
* @return type redirect
|
||||||
*/
|
*/
|
||||||
public function createStatuses(\App\Model\helpdesk\Ticket\Ticket_Status $statuss, StatusRequest $request)
|
public function createStatuses(\App\Model\helpdesk\Ticket\Ticket_Status $statuss, StatusRequest $request)
|
||||||
@@ -690,7 +708,8 @@ class SettingsController extends Controller
|
|||||||
/**
|
/**
|
||||||
* delete a status.
|
* delete a status.
|
||||||
*
|
*
|
||||||
* @param type $id
|
* @param type $id
|
||||||
|
*
|
||||||
* @return type redirect
|
* @return type redirect
|
||||||
*/
|
*/
|
||||||
public function deleteStatuses($id)
|
public function deleteStatuses($id)
|
||||||
@@ -777,7 +796,8 @@ class SettingsController extends Controller
|
|||||||
/**
|
/**
|
||||||
* edit a rating.
|
* edit a rating.
|
||||||
*
|
*
|
||||||
* @param type $id
|
* @param type $id
|
||||||
|
*
|
||||||
* @return type view
|
* @return type view
|
||||||
*/
|
*/
|
||||||
public function editRatingSettings($id)
|
public function editRatingSettings($id)
|
||||||
@@ -831,9 +851,10 @@ class SettingsController extends Controller
|
|||||||
/**
|
/**
|
||||||
* store a rating value.
|
* store a rating value.
|
||||||
*
|
*
|
||||||
* @param \App\Model\helpdesk\Ratings\Rating $rating
|
* @param \App\Model\helpdesk\Ratings\Rating $rating
|
||||||
* @param \App\Model\helpdesk\Ratings\RatingRef $ratingrefs
|
* @param \App\Model\helpdesk\Ratings\RatingRef $ratingrefs
|
||||||
* @param \App\Http\Requests\helpdesk\RatingRequest $request
|
* @param \App\Http\Requests\helpdesk\RatingRequest $request
|
||||||
|
*
|
||||||
* @return type redirect
|
* @return type redirect
|
||||||
*/
|
*/
|
||||||
public function storeRating(Rating $rating, \App\Model\helpdesk\Ratings\RatingRef $ratingrefs, \App\Http\Requests\helpdesk\RatingRequest $request)
|
public function storeRating(Rating $rating, \App\Model\helpdesk\Ratings\RatingRef $ratingrefs, \App\Http\Requests\helpdesk\RatingRequest $request)
|
||||||
@@ -902,7 +923,7 @@ class SettingsController extends Controller
|
|||||||
if (count($array) > 0) {
|
if (count($array) > 0) {
|
||||||
foreach ($array as $key => $save) {
|
foreach ($array as $key => $save) {
|
||||||
$command->create([
|
$command->create([
|
||||||
'job' => $key,
|
'job' => $key,
|
||||||
'value' => $save,
|
'value' => $save,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
@@ -913,7 +934,7 @@ class SettingsController extends Controller
|
|||||||
{
|
{
|
||||||
$this->validate($request, [
|
$this->validate($request, [
|
||||||
'format' => ['required', 'regex:/^(?=.*[$|-|#]).+$/'],
|
'format' => ['required', 'regex:/^(?=.*[$|-|#]).+$/'],
|
||||||
'type' => 'required',
|
'type' => 'required',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$format = $request->input('format');
|
$format = $request->input('format');
|
||||||
@@ -1034,6 +1055,7 @@ class SettingsController extends Controller
|
|||||||
* @category function to return clean data view
|
* @category function to return clean data view
|
||||||
*
|
*
|
||||||
* @param null
|
* @param null
|
||||||
|
*
|
||||||
* @return respone/view
|
* @return respone/view
|
||||||
*/
|
*/
|
||||||
public function getCleanUpView()
|
public function getCleanUpView()
|
||||||
@@ -1052,6 +1074,7 @@ class SettingsController extends Controller
|
|||||||
* @category function to handle clean dummy data ajax request
|
* @category function to handle clean dummy data ajax request
|
||||||
*
|
*
|
||||||
* @param null
|
* @param null
|
||||||
|
*
|
||||||
* @return json
|
* @return json
|
||||||
*/
|
*/
|
||||||
public function postCleanDummyData(Request $request)
|
public function postCleanDummyData(Request $request)
|
||||||
@@ -1069,6 +1092,7 @@ class SettingsController extends Controller
|
|||||||
* @category function to clean dummy database and reseed tables with default options
|
* @category function to clean dummy database and reseed tables with default options
|
||||||
*
|
*
|
||||||
* @param null
|
* @param null
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
* Very dangerous function should be call by admin only
|
* Very dangerous function should be call by admin only
|
||||||
*/
|
*/
|
||||||
@@ -1105,16 +1129,16 @@ class SettingsController extends Controller
|
|||||||
DB::commit();
|
DB::commit();
|
||||||
\Artisan::call('db:seed', ['--force' => true]);
|
\Artisan::call('db:seed', ['--force' => true]);
|
||||||
$user2 = \App\User::updateOrCreate(['id' => 1], [
|
$user2 = \App\User::updateOrCreate(['id' => 1], [
|
||||||
'first_name' => $user->first_name,
|
'first_name' => $user->first_name,
|
||||||
'last_name' => $user->last_name,
|
'last_name' => $user->last_name,
|
||||||
'email' => $user->email,
|
'email' => $user->email,
|
||||||
'user_name' => $user->user_name,
|
'user_name' => $user->user_name,
|
||||||
'password' => $user->password,
|
'password' => $user->password,
|
||||||
'assign_group' => 1,
|
'assign_group' => 1,
|
||||||
'primary_dpt' => 1,
|
'primary_dpt' => 1,
|
||||||
'active' => 1,
|
'active' => 1,
|
||||||
'agent_tzone' => $user->agent_tzone,
|
'agent_tzone' => $user->agent_tzone,
|
||||||
'role' => 'admin',
|
'role' => 'admin',
|
||||||
]);
|
]);
|
||||||
$system2 = System::find(1);
|
$system2 = System::find(1);
|
||||||
$system2->time_zone = $system->time_zone;
|
$system2->time_zone = $system->time_zone;
|
||||||
|
@@ -97,10 +97,11 @@ class SettingsController2 extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param int $id
|
* @param int $id
|
||||||
* @param $compant instance of company table
|
* @param $compant instance of company table
|
||||||
*
|
*
|
||||||
* get the form for company setting page
|
* get the form for company setting page
|
||||||
|
*
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function getStatuses()
|
public function getStatuses()
|
||||||
@@ -116,10 +117,11 @@ class SettingsController2 extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param int $id
|
* @param int $id
|
||||||
* @param $compant instance of company table
|
* @param $compant instance of company table
|
||||||
*
|
*
|
||||||
* get the form for company setting page
|
* get the form for company setting page
|
||||||
|
*
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function editStatuses($id)
|
public function editStatuses($id)
|
||||||
@@ -186,10 +188,11 @@ class SettingsController2 extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param int $id
|
* @param int $id
|
||||||
* @param $compant instance of company table
|
* @param $compant instance of company table
|
||||||
*
|
*
|
||||||
* get the form for company setting page
|
* get the form for company setting page
|
||||||
|
*
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function getcompany(Company $company)
|
public function getcompany(Company $company)
|
||||||
@@ -210,6 +213,7 @@ class SettingsController2 extends Controller
|
|||||||
* @param type int $id
|
* @param type int $id
|
||||||
* @param type Company $company
|
* @param type Company $company
|
||||||
* @param type CompanyRequest $request
|
* @param type CompanyRequest $request
|
||||||
|
*
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function postcompany($id, Company $company, CompanyRequest $request)
|
public function postcompany($id, Company $company, CompanyRequest $request)
|
||||||
@@ -245,7 +249,7 @@ class SettingsController2 extends Controller
|
|||||||
public function deleteLogo()
|
public function deleteLogo()
|
||||||
{
|
{
|
||||||
$path = $_GET['data1']; //get file path of logo image
|
$path = $_GET['data1']; //get file path of logo image
|
||||||
if (! unlink($path)) {
|
if (!unlink($path)) {
|
||||||
return 'false';
|
return 'false';
|
||||||
} else {
|
} else {
|
||||||
$companys = Company::where('id', '=', 1)->first();
|
$companys = Company::where('id', '=', 1)->first();
|
||||||
@@ -267,6 +271,7 @@ class SettingsController2 extends Controller
|
|||||||
* @param type Date_format $date
|
* @param type Date_format $date
|
||||||
* @param type Date_time_format $date_time
|
* @param type Date_time_format $date_time
|
||||||
* @param type Time_format $time
|
* @param type Time_format $time
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function getsystem(System $system, Department $department, Timezones $timezone, Date_format $date, Date_time_format $date_time, Time_format $time)
|
public function getsystem(System $system, Department $department, Timezones $timezone, Date_format $date, Date_time_format $date_time, Time_format $time)
|
||||||
@@ -291,6 +296,7 @@ class SettingsController2 extends Controller
|
|||||||
* @param type int $id
|
* @param type int $id
|
||||||
* @param type System $system
|
* @param type System $system
|
||||||
* @param type SystemRequest $request
|
* @param type SystemRequest $request
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function postsystem($id, System $system, SystemRequest $request)
|
public function postsystem($id, System $system, SystemRequest $request)
|
||||||
@@ -317,6 +323,7 @@ class SettingsController2 extends Controller
|
|||||||
* @param type Sla_plan $sla
|
* @param type Sla_plan $sla
|
||||||
* @param type Help_topic $topic
|
* @param type Help_topic $topic
|
||||||
* @param type Priority $priority
|
* @param type Priority $priority
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function getticket(Ticket $ticket, Sla_plan $sla, Help_topic $topic, Ticket_Priority $priority)
|
public function getticket(Ticket $ticket, Sla_plan $sla, Help_topic $topic, Ticket_Priority $priority)
|
||||||
@@ -341,6 +348,7 @@ class SettingsController2 extends Controller
|
|||||||
* @param type int $id
|
* @param type int $id
|
||||||
* @param type Ticket $ticket
|
* @param type Ticket $ticket
|
||||||
* @param type Request $request
|
* @param type Request $request
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function postticket($id, Ticket $ticket, Request $request)
|
public function postticket($id, Ticket $ticket, Request $request)
|
||||||
@@ -375,6 +383,7 @@ class SettingsController2 extends Controller
|
|||||||
* @param type Email $email
|
* @param type Email $email
|
||||||
* @param type Template $template
|
* @param type Template $template
|
||||||
* @param type Emails $email1
|
* @param type Emails $email1
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function getemail(Email $email, Template $template, Emails $email1)
|
public function getemail(Email $email, Template $template, Emails $email1)
|
||||||
@@ -399,6 +408,7 @@ class SettingsController2 extends Controller
|
|||||||
* @param type int $id
|
* @param type int $id
|
||||||
* @param type Email $email
|
* @param type Email $email
|
||||||
* @param type EmailRequest $request
|
* @param type EmailRequest $request
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function postemail($id, Email $email, EmailRequest $request)
|
public function postemail($id, Email $email, EmailRequest $request)
|
||||||
@@ -431,6 +441,7 @@ class SettingsController2 extends Controller
|
|||||||
* @param type Email $email
|
* @param type Email $email
|
||||||
* @param type Template $template
|
* @param type Template $template
|
||||||
* @param type Emails $email1
|
* @param type Emails $email1
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function getSchedular(Email $email, Template $template, Emails $email1)
|
public function getSchedular(Email $email, Template $template, Emails $email1)
|
||||||
@@ -454,6 +465,7 @@ class SettingsController2 extends Controller
|
|||||||
*
|
*
|
||||||
* @param type Email $email
|
* @param type Email $email
|
||||||
* @param type EmailRequest $request
|
* @param type EmailRequest $request
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function postSchedular(Email $email, Template $template, Emails $email1, Request $request)
|
public function postSchedular(Email $email, Template $template, Emails $email1, Request $request)
|
||||||
@@ -485,6 +497,7 @@ class SettingsController2 extends Controller
|
|||||||
* get the form for Access setting page.
|
* get the form for Access setting page.
|
||||||
*
|
*
|
||||||
* @param type Access $access
|
* @param type Access $access
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
// public function getaccess(Access $access) {
|
// public function getaccess(Access $access) {
|
||||||
@@ -503,6 +516,7 @@ class SettingsController2 extends Controller
|
|||||||
*
|
*
|
||||||
* @param type Access $access
|
* @param type Access $access
|
||||||
* @param type Request $request
|
* @param type Request $request
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
// public function postaccess(Access $access, Request $request) {
|
// public function postaccess(Access $access, Request $request) {
|
||||||
@@ -534,6 +548,7 @@ class SettingsController2 extends Controller
|
|||||||
* get the form for Responder setting page.
|
* get the form for Responder setting page.
|
||||||
*
|
*
|
||||||
* @param type Responder $responder
|
* @param type Responder $responder
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function getresponder(Responder $responder)
|
public function getresponder(Responder $responder)
|
||||||
@@ -553,6 +568,7 @@ class SettingsController2 extends Controller
|
|||||||
*
|
*
|
||||||
* @param type Responder $responder
|
* @param type Responder $responder
|
||||||
* @param type Request $request
|
* @param type Request $request
|
||||||
|
*
|
||||||
* @return type
|
* @return type
|
||||||
*/
|
*/
|
||||||
public function postresponder(Responder $responder, Request $request)
|
public function postresponder(Responder $responder, Request $request)
|
||||||
@@ -581,6 +597,7 @@ class SettingsController2 extends Controller
|
|||||||
* get the form for Alert setting page.
|
* get the form for Alert setting page.
|
||||||
*
|
*
|
||||||
* @param type Alert $alert
|
* @param type Alert $alert
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function getalert(Alert $alert)
|
public function getalert(Alert $alert)
|
||||||
@@ -598,9 +615,10 @@ class SettingsController2 extends Controller
|
|||||||
/**
|
/**
|
||||||
* Update the specified resource in storage.
|
* Update the specified resource in storage.
|
||||||
*
|
*
|
||||||
* @param type $id
|
* @param type $id
|
||||||
* @param type Alert $alert
|
* @param type Alert $alert
|
||||||
* @param type Request $request
|
* @param type Request $request
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function postalert($id, Alert $alert, Request $request)
|
public function postalert($id, Alert $alert, Request $request)
|
||||||
|
@@ -37,6 +37,7 @@ class SlaController extends Controller
|
|||||||
* Display a listing of the resource.
|
* Display a listing of the resource.
|
||||||
*
|
*
|
||||||
* @param type Sla_plan $sla
|
* @param type Sla_plan $sla
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function index(Sla_plan $sla)
|
public function index(Sla_plan $sla)
|
||||||
@@ -71,6 +72,7 @@ class SlaController extends Controller
|
|||||||
*
|
*
|
||||||
* @param type Sla_plan $sla
|
* @param type Sla_plan $sla
|
||||||
* @param type SlaRequest $request
|
* @param type SlaRequest $request
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function store(Sla_plan $sla, SlaRequest $request)
|
public function store(Sla_plan $sla, SlaRequest $request)
|
||||||
@@ -92,6 +94,7 @@ class SlaController extends Controller
|
|||||||
*
|
*
|
||||||
* @param type int $id
|
* @param type int $id
|
||||||
* @param type Sla_plan $sla
|
* @param type Sla_plan $sla
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function edit($id)
|
public function edit($id)
|
||||||
@@ -114,6 +117,7 @@ class SlaController extends Controller
|
|||||||
* @param type int $id
|
* @param type int $id
|
||||||
* @param type Sla_plan $sla
|
* @param type Sla_plan $sla
|
||||||
* @param type SlaUpdate $request
|
* @param type SlaUpdate $request
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function update($id, SlaUpdate $request)
|
public function update($id, SlaUpdate $request)
|
||||||
@@ -147,6 +151,7 @@ class SlaController extends Controller
|
|||||||
*
|
*
|
||||||
* @param type int $id
|
* @param type int $id
|
||||||
* @param type Sla_plan $sla
|
* @param type Sla_plan $sla
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function destroy($id)
|
public function destroy($id)
|
||||||
|
@@ -28,9 +28,9 @@ class SocialMediaController extends Controller
|
|||||||
public function postSettings($provider, Request $request)
|
public function postSettings($provider, Request $request)
|
||||||
{
|
{
|
||||||
$this->validate($request, [
|
$this->validate($request, [
|
||||||
'client_id' => 'required',
|
'client_id' => 'required',
|
||||||
'client_secret' => 'required',
|
'client_secret' => 'required',
|
||||||
'redirect' => 'required|url',
|
'redirect' => 'required|url',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -65,8 +65,8 @@ class SocialMediaController extends Controller
|
|||||||
foreach ($requests as $key => $value) {
|
foreach ($requests as $key => $value) {
|
||||||
$social->create([
|
$social->create([
|
||||||
'provider' => $provider,
|
'provider' => $provider,
|
||||||
'key' => $key,
|
'key' => $key,
|
||||||
'value' => $value,
|
'value' => $value,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -41,6 +41,7 @@ class TeamController extends Controller
|
|||||||
*
|
*
|
||||||
* @param type Teams $team
|
* @param type Teams $team
|
||||||
* @param type Assign_team_agent $assign_team_agent
|
* @param type Assign_team_agent $assign_team_agent
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function index(Teams $team, Assign_team_agent $assign_team_agent)
|
public function index(Teams $team, Assign_team_agent $assign_team_agent)
|
||||||
@@ -61,6 +62,7 @@ class TeamController extends Controller
|
|||||||
* Show the form for creating a new resource.
|
* Show the form for creating a new resource.
|
||||||
*
|
*
|
||||||
* @param type User $user
|
* @param type User $user
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function create(User $user)
|
public function create(User $user)
|
||||||
@@ -79,6 +81,7 @@ class TeamController extends Controller
|
|||||||
*
|
*
|
||||||
* @param type Teams $team
|
* @param type Teams $team
|
||||||
* @param type TeamRequest $request
|
* @param type TeamRequest $request
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function store(Teams $team, TeamRequest $request)
|
public function store(Teams $team, TeamRequest $request)
|
||||||
@@ -93,7 +96,7 @@ class TeamController extends Controller
|
|||||||
'team_lead' => $team_lead,
|
'team_lead' => $team_lead,
|
||||||
]);
|
]);
|
||||||
Assign_team_agent::create([
|
Assign_team_agent::create([
|
||||||
'team_id' => $team_update->id,
|
'team_id' => $team_update->id,
|
||||||
'agent_id' => $team_lead,
|
'agent_id' => $team_lead,
|
||||||
]);
|
]);
|
||||||
} else {
|
} else {
|
||||||
@@ -111,10 +114,11 @@ class TeamController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Show the form for editing the specified resource.
|
* Show the form for editing the specified resource.
|
||||||
*
|
*
|
||||||
* @param type $id
|
* @param type $id
|
||||||
* @param type User $user
|
* @param type User $user
|
||||||
* @param type Assign_team_agent $assign_team_agent
|
* @param type Assign_team_agent $assign_team_agent
|
||||||
* @param type Teams $team
|
* @param type Teams $team
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function show($id, User $user, Assign_team_agent $assign_team_agent, Teams $team)
|
public function show($id, User $user, Assign_team_agent $assign_team_agent, Teams $team)
|
||||||
@@ -196,10 +200,11 @@ class TeamController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Show the form for editing the specified resource.
|
* Show the form for editing the specified resource.
|
||||||
*
|
*
|
||||||
* @param type $id
|
* @param type $id
|
||||||
* @param type User $user
|
* @param type User $user
|
||||||
* @param type Assign_team_agent $assign_team_agent
|
* @param type Assign_team_agent $assign_team_agent
|
||||||
* @param type Teams $team
|
* @param type Teams $team
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function edit($id, User $user, Assign_team_agent $assign_team_agent, Teams $team)
|
public function edit($id, User $user, Assign_team_agent $assign_team_agent, Teams $team)
|
||||||
@@ -227,6 +232,7 @@ class TeamController extends Controller
|
|||||||
* @param type int $id
|
* @param type int $id
|
||||||
* @param type Teams $team
|
* @param type Teams $team
|
||||||
* @param type TeamUpdate $request
|
* @param type TeamUpdate $request
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function update($id, Teams $team, TeamUpdate $request)
|
public function update($id, Teams $team, TeamUpdate $request)
|
||||||
@@ -262,6 +268,7 @@ class TeamController extends Controller
|
|||||||
* @param type int $id
|
* @param type int $id
|
||||||
* @param type Teams $team
|
* @param type Teams $team
|
||||||
* @param type Assign_team_agent $assign_team_agent
|
* @param type Assign_team_agent $assign_team_agent
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function destroy($id, Teams $team, Assign_team_agent $assign_team_agent)
|
public function destroy($id, Teams $team, Assign_team_agent $assign_team_agent)
|
||||||
|
@@ -41,6 +41,7 @@ class TemplateController extends Controller
|
|||||||
* Display a listing of the resource.
|
* Display a listing of the resource.
|
||||||
*
|
*
|
||||||
* @param type Template $template
|
* @param type Template $template
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function index(Template $template)
|
public function index(Template $template)
|
||||||
@@ -59,6 +60,7 @@ class TemplateController extends Controller
|
|||||||
*
|
*
|
||||||
* @param type Languages $language
|
* @param type Languages $language
|
||||||
* @param type Template $template
|
* @param type Template $template
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function create(Languages $language, Template $template)
|
public function create(Languages $language, Template $template)
|
||||||
@@ -78,6 +80,7 @@ class TemplateController extends Controller
|
|||||||
*
|
*
|
||||||
* @param type Template $template
|
* @param type Template $template
|
||||||
* @param type TemplateRequest $request
|
* @param type TemplateRequest $request
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function store(Template $template, TemplateRequest $request)
|
public function store(Template $template, TemplateRequest $request)
|
||||||
@@ -100,7 +103,8 @@ class TemplateController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Display the specified resource.
|
* Display the specified resource.
|
||||||
*
|
*
|
||||||
* @param int $id
|
* @param int $id
|
||||||
|
*
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function show($id)
|
public function show($id)
|
||||||
@@ -111,9 +115,10 @@ class TemplateController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Show the form for editing the specified resource.
|
* Show the form for editing the specified resource.
|
||||||
*
|
*
|
||||||
* @param type $id
|
* @param type $id
|
||||||
* @param type Template $template
|
* @param type Template $template
|
||||||
* @param type Languages $language
|
* @param type Languages $language
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function listdirectories()
|
public function listdirectories()
|
||||||
@@ -159,7 +164,7 @@ class TemplateController extends Controller
|
|||||||
// }
|
// }
|
||||||
// Move all images files
|
// Move all images files
|
||||||
|
|
||||||
if (! file_exists($filename)) {
|
if (!file_exists($filename)) {
|
||||||
mkdir($filename, 0777);
|
mkdir($filename, 0777);
|
||||||
}
|
}
|
||||||
$files = array_filter(scandir($directory.'default'));
|
$files = array_filter(scandir($directory.'default'));
|
||||||
@@ -168,7 +173,7 @@ class TemplateController extends Controller
|
|||||||
if ($file === '.' or $file === '..') {
|
if ($file === '.' or $file === '..') {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (! is_dir($file)) {
|
if (!is_dir($file)) {
|
||||||
// $file_to_go = str_replace("code/resources/views/emails/",'code/resources/views/emails/'.$fname,$file);
|
// $file_to_go = str_replace("code/resources/views/emails/",'code/resources/views/emails/'.$fname,$file);
|
||||||
$destination = $directory.$fname.'/';
|
$destination = $directory.$fname.'/';
|
||||||
|
|
||||||
@@ -237,6 +242,7 @@ class TemplateController extends Controller
|
|||||||
* @param type int $id
|
* @param type int $id
|
||||||
* @param type Template $template
|
* @param type Template $template
|
||||||
* @param type TemplateUdate $request
|
* @param type TemplateUdate $request
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function update($id, Template $template, TemplateUdate $request)
|
public function update($id, Template $template, TemplateUdate $request)
|
||||||
@@ -263,6 +269,7 @@ class TemplateController extends Controller
|
|||||||
*
|
*
|
||||||
* @param type int $id
|
* @param type int $id
|
||||||
* @param type Template $template
|
* @param type Template $template
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function destroy($id, Template $template)
|
public function destroy($id, Template $template)
|
||||||
@@ -287,6 +294,7 @@ class TemplateController extends Controller
|
|||||||
* Form for Email connection checking.
|
* Form for Email connection checking.
|
||||||
*
|
*
|
||||||
* @param type Emails $email
|
* @param type Emails $email
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function formDiagno(Emails $email)
|
public function formDiagno(Emails $email)
|
||||||
@@ -304,6 +312,7 @@ class TemplateController extends Controller
|
|||||||
* function to send emails.
|
* function to send emails.
|
||||||
*
|
*
|
||||||
* @param type Request $request
|
* @param type Request $request
|
||||||
|
*
|
||||||
* @return type
|
* @return type
|
||||||
*/
|
*/
|
||||||
public function postDiagno(DiagnosRequest $request)
|
public function postDiagno(DiagnosRequest $request)
|
||||||
@@ -314,18 +323,18 @@ class TemplateController extends Controller
|
|||||||
$msg = $request->input('message');
|
$msg = $request->input('message');
|
||||||
$from = $request->input('from');
|
$from = $request->input('from');
|
||||||
$from_address = Emails::where('id', '=', $from)->first();
|
$from_address = Emails::where('id', '=', $from)->first();
|
||||||
if (! $from_address) {
|
if (!$from_address) {
|
||||||
throw new Exception('Sorry! We can not find your request');
|
throw new Exception('Sorry! We can not find your request');
|
||||||
}
|
}
|
||||||
$to_address = [
|
$to_address = [
|
||||||
|
|
||||||
'name' => '',
|
'name' => '',
|
||||||
'email' => $to,
|
'email' => $to,
|
||||||
];
|
];
|
||||||
$message = [
|
$message = [
|
||||||
'subject' => $subject,
|
'subject' => $subject,
|
||||||
'scenario' => null,
|
'scenario' => null,
|
||||||
'body' => $msg,
|
'body' => $msg,
|
||||||
];
|
];
|
||||||
|
|
||||||
$this->PhpMailController->sendmail($from, $to_address, $message, [], []);
|
$this->PhpMailController->sendmail($from, $to_address, $message, [], []);
|
||||||
|
@@ -22,6 +22,7 @@ class ThreadController extends Controller
|
|||||||
*
|
*
|
||||||
* @param type Ticket_thread $thread
|
* @param type Ticket_thread $thread
|
||||||
* @param type Priority $priority
|
* @param type Priority $priority
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function getTickets(Ticket_Thread $thread, Priority $priority)
|
public function getTickets(Ticket_Thread $thread, Priority $priority)
|
||||||
|
@@ -101,7 +101,7 @@ RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]\n";
|
|||||||
{
|
{
|
||||||
//dd(public_path('.htaccess'),base_path('.htaccess'));
|
//dd(public_path('.htaccess'),base_path('.htaccess'));
|
||||||
$file = public_path('.htaccess');
|
$file = public_path('.htaccess');
|
||||||
if (! \File::exists($file)) {
|
if (!\File::exists($file)) {
|
||||||
$file = base_path('/../.htaccess');
|
$file = base_path('/../.htaccess');
|
||||||
}
|
}
|
||||||
$this->deleteCustom();
|
$this->deleteCustom();
|
||||||
@@ -113,7 +113,7 @@ RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]\n";
|
|||||||
public function deleteCustom()
|
public function deleteCustom()
|
||||||
{
|
{
|
||||||
$file = public_path('.htaccess');
|
$file = public_path('.htaccess');
|
||||||
if (! \File::exists($file)) {
|
if (!\File::exists($file)) {
|
||||||
$file = base_path('/../.htaccess');
|
$file = base_path('/../.htaccess');
|
||||||
}
|
}
|
||||||
$content = file_get_contents($file);
|
$content = file_get_contents($file);
|
||||||
|
@@ -160,7 +160,8 @@ class WorkflowController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Store a new workflow in to the system.
|
* Store a new workflow in to the system.
|
||||||
*
|
*
|
||||||
* @param \App\Http\Requests\helpdesk\WorkflowCreateRequest $request
|
* @param \App\Http\Requests\helpdesk\WorkflowCreateRequest $request
|
||||||
|
*
|
||||||
* @return type view
|
* @return type view
|
||||||
*/
|
*/
|
||||||
public function store(WorkflowCreateRequest $request)
|
public function store(WorkflowCreateRequest $request)
|
||||||
@@ -204,8 +205,9 @@ class WorkflowController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Editing the details of the banned users.
|
* Editing the details of the banned users.
|
||||||
*
|
*
|
||||||
* @param type $id
|
* @param type $id
|
||||||
* @param User $ban
|
* @param User $ban
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function edit($id, WorkflowName $work_flow_name, Emails $emails, WorkflowRules $workflow_rule, WorkflowAction $workflow_action)
|
public function edit($id, WorkflowName $work_flow_name, Emails $emails, WorkflowRules $workflow_rule, WorkflowAction $workflow_action)
|
||||||
@@ -225,8 +227,9 @@ class WorkflowController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Update ticket workflow.
|
* Update ticket workflow.
|
||||||
*
|
*
|
||||||
* @param type $id
|
* @param type $id
|
||||||
* @param \App\Http\Requests\helpdesk\WorkflowUpdateRequest $request
|
* @param \App\Http\Requests\helpdesk\WorkflowUpdateRequest $request
|
||||||
|
*
|
||||||
* @return type view
|
* @return type view
|
||||||
*/
|
*/
|
||||||
public function update($id, WorkflowUpdateRequest $request)
|
public function update($id, WorkflowUpdateRequest $request)
|
||||||
@@ -273,7 +276,7 @@ class WorkflowController extends Controller
|
|||||||
/**
|
/**
|
||||||
* function to delete workflow.
|
* function to delete workflow.
|
||||||
*
|
*
|
||||||
* @param type $id
|
* @param type $id
|
||||||
*/
|
*/
|
||||||
public function destroy($id)
|
public function destroy($id)
|
||||||
{
|
{
|
||||||
@@ -292,8 +295,9 @@ class WorkflowController extends Controller
|
|||||||
/**
|
/**
|
||||||
* function to select action.
|
* function to select action.
|
||||||
*
|
*
|
||||||
* @param type $id
|
* @param type $id
|
||||||
* @param \Illuminate\Http\Request $request
|
* @param \Illuminate\Http\Request $request
|
||||||
|
*
|
||||||
* @return type void
|
* @return type void
|
||||||
*/
|
*/
|
||||||
public function selectAction($id, Request $request)
|
public function selectAction($id, Request $request)
|
||||||
|
@@ -73,6 +73,7 @@ class CannedController extends Controller
|
|||||||
*
|
*
|
||||||
* @param type CannedRequest $request
|
* @param type CannedRequest $request
|
||||||
* @param type Canned $canned
|
* @param type Canned $canned
|
||||||
|
*
|
||||||
* @return type Redirect
|
* @return type Redirect
|
||||||
*/
|
*/
|
||||||
public function store(CannedRequest $request, Canned $canned)
|
public function store(CannedRequest $request, Canned $canned)
|
||||||
@@ -94,8 +95,9 @@ class CannedController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Show the form for editing the Canned Response.
|
* Show the form for editing the Canned Response.
|
||||||
*
|
*
|
||||||
* @param type $id
|
* @param type $id
|
||||||
* @param type Canned $canned
|
* @param type Canned $canned
|
||||||
|
*
|
||||||
* @return type View
|
* @return type View
|
||||||
*/
|
*/
|
||||||
public function edit($id, Canned $canned)
|
public function edit($id, Canned $canned)
|
||||||
@@ -113,9 +115,10 @@ class CannedController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Update the Canned Response in database.
|
* Update the Canned Response in database.
|
||||||
*
|
*
|
||||||
* @param type $id
|
* @param type $id
|
||||||
* @param type CannedUpdateRequest $request
|
* @param type CannedUpdateRequest $request
|
||||||
* @param type Canned $canned
|
* @param type Canned $canned
|
||||||
|
*
|
||||||
* @return type Redirect
|
* @return type Redirect
|
||||||
*/
|
*/
|
||||||
public function update($id, CannedUpdateRequest $request, Canned $canned)
|
public function update($id, CannedUpdateRequest $request, Canned $canned)
|
||||||
@@ -139,8 +142,9 @@ class CannedController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Delete the Canned Response from storage.
|
* Delete the Canned Response from storage.
|
||||||
*
|
*
|
||||||
* @param type $id
|
* @param type $id
|
||||||
* @param type Canned $canned
|
* @param type Canned $canned
|
||||||
|
*
|
||||||
* @return type Redirect
|
* @return type Redirect
|
||||||
*/
|
*/
|
||||||
public function destroy($id, Canned $canned)
|
public function destroy($id, Canned $canned)
|
||||||
@@ -162,7 +166,8 @@ class CannedController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Fetch Canned Response in the ticket detail page.
|
* Fetch Canned Response in the ticket detail page.
|
||||||
*
|
*
|
||||||
* @param type $id
|
* @param type $id
|
||||||
|
*
|
||||||
* @return type json
|
* @return type json
|
||||||
*/
|
*/
|
||||||
public function get_canned($id)
|
public function get_canned($id)
|
||||||
|
@@ -39,6 +39,7 @@ class FilterController extends Controller
|
|||||||
* @category constructor function
|
* @category constructor function
|
||||||
*
|
*
|
||||||
* @param Array/Object $request
|
* @param Array/Object $request
|
||||||
|
*
|
||||||
* @return null
|
* @return null
|
||||||
*/
|
*/
|
||||||
public function __construct(Request $req)
|
public function __construct(Request $req)
|
||||||
@@ -52,6 +53,7 @@ class FilterController extends Controller
|
|||||||
* @category function to handle ticket table/filteration request and build tables
|
* @category function to handle ticket table/filteration request and build tables
|
||||||
*
|
*
|
||||||
* @param Array/Object $request
|
* @param Array/Object $request
|
||||||
|
*
|
||||||
* @return json response //build by getTable() function in TicketController
|
* @return json response //build by getTable() function in TicketController
|
||||||
*/
|
*/
|
||||||
public function getFilter(Request $request)
|
public function getFilter(Request $request)
|
||||||
@@ -140,7 +142,8 @@ class FilterController extends Controller
|
|||||||
/**
|
/**
|
||||||
* @category function to check of all the parameters passed to the URL are correct or not
|
* @category function to check of all the parameters passed to the URL are correct or not
|
||||||
*
|
*
|
||||||
* @param array $inputs
|
* @param array $inputs
|
||||||
|
*
|
||||||
* @return bool true/false
|
* @return bool true/false
|
||||||
*/
|
*/
|
||||||
public function checkRequestIsCorrect($table, $inputs)
|
public function checkRequestIsCorrect($table, $inputs)
|
||||||
@@ -171,7 +174,7 @@ class FilterController extends Controller
|
|||||||
}
|
}
|
||||||
ksort($inputs);
|
ksort($inputs);
|
||||||
foreach ($inputs as $key => $input) {
|
foreach ($inputs as $key => $input) {
|
||||||
if (! in_array($key, $available_options)) {
|
if (!in_array($key, $available_options)) {
|
||||||
// dd('here '.$key);
|
// dd('here '.$key);
|
||||||
$table = $table->where('tickets.id', '=', null);
|
$table = $table->where('tickets.id', '=', null);
|
||||||
} else {
|
} else {
|
||||||
@@ -185,7 +188,8 @@ class FilterController extends Controller
|
|||||||
/**
|
/**
|
||||||
* @category function to filter tickets based on user input requests
|
* @category function to filter tickets based on user input requests
|
||||||
*
|
*
|
||||||
* @param string $input, $value, $table
|
* @param string $input, $value, $table
|
||||||
|
*
|
||||||
* @return builder $table
|
* @return builder $table
|
||||||
*/
|
*/
|
||||||
public function filterByInputs($input, $value, $table, $is_mytickets)
|
public function filterByInputs($input, $value, $table, $is_mytickets)
|
||||||
@@ -354,7 +358,8 @@ class FilterController extends Controller
|
|||||||
/**
|
/**
|
||||||
* @category function to filter the tickets based on show value in the request
|
* @category function to filter the tickets based on show value in the request
|
||||||
*
|
*
|
||||||
* @param array $value(), builder object $table
|
* @param array $value(), builder object $table
|
||||||
|
*
|
||||||
* @return builder object $table
|
* @return builder object $table
|
||||||
*/
|
*/
|
||||||
public function showPage($value, $table)
|
public function showPage($value, $table)
|
||||||
@@ -431,7 +436,7 @@ class FilterController extends Controller
|
|||||||
/**
|
/**
|
||||||
* @category function to filter tickets builder based on agent/admin departments
|
* @category function to filter tickets builder based on agent/admin departments
|
||||||
*
|
*
|
||||||
* @param array $value //requested department, $table
|
* @param array $value //requested department, $table
|
||||||
*
|
*
|
||||||
* @var array
|
* @var array
|
||||||
*
|
*
|
||||||
@@ -461,7 +466,7 @@ class FilterController extends Controller
|
|||||||
/**
|
/**
|
||||||
* @category function to return department ids and access right of departments for agents
|
* @category function to return department ids and access right of departments for agents
|
||||||
*
|
*
|
||||||
* @param array $departments
|
* @param array $departments
|
||||||
*
|
*
|
||||||
* @var array
|
* @var array
|
||||||
*
|
*
|
||||||
@@ -485,7 +490,7 @@ class FilterController extends Controller
|
|||||||
/**
|
/**
|
||||||
* @category function to filter and return ticket query builder based on priority
|
* @category function to filter and return ticket query builder based on priority
|
||||||
*
|
*
|
||||||
* @param array $priority, builder $table
|
* @param array $priority, builder $table
|
||||||
*
|
*
|
||||||
* @var array
|
* @var array
|
||||||
*
|
*
|
||||||
@@ -578,7 +583,7 @@ class FilterController extends Controller
|
|||||||
/**
|
/**
|
||||||
* @category function to filter table for various date option like created, last modified, duo date and overdue
|
* @category function to filter table for various date option like created, last modified, duo date and overdue
|
||||||
*
|
*
|
||||||
* @param string $type (to check type of filter to apply on date), string $value for filters, builder $table
|
* @param string $type (to check type of filter to apply on date), string $value for filters, builder $table
|
||||||
*
|
*
|
||||||
* @var array [start and end dates]
|
* @var array [start and end dates]
|
||||||
*
|
*
|
||||||
@@ -620,7 +625,7 @@ class FilterController extends Controller
|
|||||||
/**
|
/**
|
||||||
* @category function to get start and end date to apply date filter
|
* @category function to get start and end date to apply date filter
|
||||||
*
|
*
|
||||||
* @param string $value
|
* @param string $value
|
||||||
*
|
*
|
||||||
* @var date string, date string
|
* @var date string, date string
|
||||||
*
|
*
|
||||||
@@ -867,7 +872,7 @@ class FilterController extends Controller
|
|||||||
* @category function to apply date filters in table builder after
|
* @category function to apply date filters in table builder after
|
||||||
* getting start and end date based on the type of date filter
|
* getting start and end date based on the type of date filter
|
||||||
*
|
*
|
||||||
* @param array $dates, builder $table, $column (type of filter based on which column is being chosen), $value
|
* @param array $dates, builder $table, $column (type of filter based on which column is being chosen), $value
|
||||||
*
|
*
|
||||||
* @var string (name of column), array
|
* @var string (name of column), array
|
||||||
*
|
*
|
||||||
@@ -901,7 +906,7 @@ class FilterController extends Controller
|
|||||||
/**
|
/**
|
||||||
* @category function to filter ticket by source of creation
|
* @category function to filter ticket by source of creation
|
||||||
*
|
*
|
||||||
* @param array $name of source, builder $table
|
* @param array $name of source, builder $table
|
||||||
*
|
*
|
||||||
* @var array
|
* @var array
|
||||||
*
|
*
|
||||||
@@ -922,7 +927,8 @@ class FilterController extends Controller
|
|||||||
*
|
*
|
||||||
* @category function to get array of status to filter tickets
|
* @category function to get array of status to filter tickets
|
||||||
*
|
*
|
||||||
* @param string $status
|
* @param string $status
|
||||||
|
*
|
||||||
* @return array $status_array
|
* @return array $status_array
|
||||||
*/
|
*/
|
||||||
// public function getStatusArray($status)
|
// public function getStatusArray($status)
|
||||||
@@ -968,6 +974,7 @@ class FilterController extends Controller
|
|||||||
* @category function to filter table builder based on requested status
|
* @category function to filter table builder based on requested status
|
||||||
*
|
*
|
||||||
* @param string array $status_array, builder $table
|
* @param string array $status_array, builder $table
|
||||||
|
*
|
||||||
* @return builder $table
|
* @return builder $table
|
||||||
*/
|
*/
|
||||||
public function filterByStatus($status_array, $table)
|
public function filterByStatus($status_array, $table)
|
||||||
@@ -983,7 +990,8 @@ class FilterController extends Controller
|
|||||||
/**
|
/**
|
||||||
* @category function to format and return user tickets
|
* @category function to format and return user tickets
|
||||||
*
|
*
|
||||||
* @param string $segment
|
* @param string $segment
|
||||||
|
*
|
||||||
* @return builder
|
* @return builder
|
||||||
*/
|
*/
|
||||||
public function formatUserTickets($segment)
|
public function formatUserTickets($segment)
|
||||||
@@ -1029,6 +1037,7 @@ class FilterController extends Controller
|
|||||||
* @category function to filter results on basis of last replier
|
* @category function to filter results on basis of last replier
|
||||||
*
|
*
|
||||||
* @param string array $value, builder $ticket
|
* @param string array $value, builder $ticket
|
||||||
|
*
|
||||||
* @return builder
|
* @return builder
|
||||||
*/
|
*/
|
||||||
public function filterByLastResponder($value, $tickets)
|
public function filterByLastResponder($value, $tickets)
|
||||||
@@ -1066,7 +1075,8 @@ class FilterController extends Controller
|
|||||||
/**
|
/**
|
||||||
* @category function to apply help topic filter
|
* @category function to apply help topic filter
|
||||||
*
|
*
|
||||||
* @param array $value, object $table
|
* @param array $value, object $table
|
||||||
|
*
|
||||||
* @return builder
|
* @return builder
|
||||||
*/
|
*/
|
||||||
public function filterByHelpTopic($value, $table)
|
public function filterByHelpTopic($value, $table)
|
||||||
@@ -1080,8 +1090,9 @@ class FilterController extends Controller
|
|||||||
* @category function to return builder for show filter after checking if input
|
* @category function to return builder for show filter after checking if input
|
||||||
* request has status or not
|
* request has status or not
|
||||||
*
|
*
|
||||||
* @param bool $has_status(if request has status filter values or not),
|
* @param bool $has_status(if request has status filter values or not),
|
||||||
* Object $table, string $status(basic pupose if status)
|
* Object $table, string $status(basic pupose if status)
|
||||||
|
*
|
||||||
* @return object $table;
|
* @return object $table;
|
||||||
*/
|
*/
|
||||||
public function returnShowPageWithStatus($has_status, $table, $status)
|
public function returnShowPageWithStatus($has_status, $table, $status)
|
||||||
|
@@ -316,6 +316,7 @@ class FilterControllerOld extends Controller
|
|||||||
*@category function to format and return user tickets
|
*@category function to format and return user tickets
|
||||||
*
|
*
|
||||||
*@param string $segment
|
*@param string $segment
|
||||||
|
*
|
||||||
*@return builder
|
*@return builder
|
||||||
*/
|
*/
|
||||||
public function formatUserTickets($segment)
|
public function formatUserTickets($segment)
|
||||||
|
@@ -17,7 +17,8 @@ class ImapMail extends Mailbox
|
|||||||
* This function uses imap_search() to perform a search on the mailbox currently opened in the given IMAP stream.
|
* This function uses imap_search() to perform a search on the mailbox currently opened in the given IMAP stream.
|
||||||
* For example, to match all unanswered mails sent by Mom, you'd use: "UNANSWERED FROM mom".
|
* For example, to match all unanswered mails sent by Mom, you'd use: "UNANSWERED FROM mom".
|
||||||
*
|
*
|
||||||
* @param string $criteria See http://php.net/imap_search for a complete list of available criteria
|
* @param string $criteria See http://php.net/imap_search for a complete list of available criteria
|
||||||
|
*
|
||||||
* @return array mailsIds (or empty array)
|
* @return array mailsIds (or empty array)
|
||||||
*/
|
*/
|
||||||
public function searchMailbox($criteria = 'ALL')
|
public function searchMailbox($criteria = 'ALL')
|
||||||
|
@@ -59,7 +59,8 @@ class MailController extends Controller
|
|||||||
/**
|
/**
|
||||||
* separate reply.
|
* separate reply.
|
||||||
*
|
*
|
||||||
* @param type $body
|
* @param type $body
|
||||||
|
*
|
||||||
* @return type string
|
* @return type string
|
||||||
*/
|
*/
|
||||||
public function separate_reply($body)
|
public function separate_reply($body)
|
||||||
@@ -71,13 +72,14 @@ class MailController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param object $email
|
* @param object $email
|
||||||
|
*
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
public function priority($email)
|
public function priority($email)
|
||||||
{
|
{
|
||||||
$priority = $email->priority;
|
$priority = $email->priority;
|
||||||
if (! $priority) {
|
if (!$priority) {
|
||||||
$priority = $this->ticketController()->getSystemDefaultPriority();
|
$priority = $this->ticketController()->getSystemDefaultPriority();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -87,13 +89,14 @@ class MailController extends Controller
|
|||||||
/**
|
/**
|
||||||
* get department.
|
* get department.
|
||||||
*
|
*
|
||||||
* @param object $email
|
* @param object $email
|
||||||
|
*
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
public function department($email)
|
public function department($email)
|
||||||
{
|
{
|
||||||
$department = $email->department;
|
$department = $email->department;
|
||||||
if (! $department) {
|
if (!$department) {
|
||||||
$department = $this->ticketController()->getSystemDefaultDepartment();
|
$department = $this->ticketController()->getSystemDefaultDepartment();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -103,14 +106,15 @@ class MailController extends Controller
|
|||||||
/**
|
/**
|
||||||
* get help topic.
|
* get help topic.
|
||||||
*
|
*
|
||||||
* @param object $email
|
* @param object $email
|
||||||
|
*
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
public function helptopic($email)
|
public function helptopic($email)
|
||||||
{
|
{
|
||||||
//dd($email);
|
//dd($email);
|
||||||
$helptopic = $email->help_topic;
|
$helptopic = $email->help_topic;
|
||||||
if (! $helptopic) {
|
if (!$helptopic) {
|
||||||
$helptopic = $this->ticketController()->getSystemDefaultHelpTopic();
|
$helptopic = $this->ticketController()->getSystemDefaultHelpTopic();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -120,7 +124,8 @@ class MailController extends Controller
|
|||||||
/**
|
/**
|
||||||
* get sla.
|
* get sla.
|
||||||
*
|
*
|
||||||
* @param object $email
|
* @param object $email
|
||||||
|
*
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
public function sla($email)
|
public function sla($email)
|
||||||
@@ -130,7 +135,7 @@ class MailController extends Controller
|
|||||||
if ($help) {
|
if ($help) {
|
||||||
$sla = $help->sla_plan;
|
$sla = $help->sla_plan;
|
||||||
}
|
}
|
||||||
if (! $sla) {
|
if (!$sla) {
|
||||||
$sla = $this->ticketController()->getSystemDefaultSla();
|
$sla = $this->ticketController()->getSystemDefaultSla();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -186,17 +191,17 @@ class MailController extends Controller
|
|||||||
public function getMessageContent($message, $email)
|
public function getMessageContent($message, $email)
|
||||||
{
|
{
|
||||||
$body = $message->getMessageBody(true);
|
$body = $message->getMessageBody(true);
|
||||||
if (! $body) {
|
if (!$body) {
|
||||||
$body = $message->getMessageBody();
|
$body = $message->getMessageBody();
|
||||||
}
|
}
|
||||||
$body = $this->separateReply($body);
|
$body = $this->separateReply($body);
|
||||||
$subject = $message->getSubject();
|
$subject = $message->getSubject();
|
||||||
$address = $message->getAddresses('reply-to');
|
$address = $message->getAddresses('reply-to');
|
||||||
if (! $address) {
|
if (!$address) {
|
||||||
$address = $message->getAddresses('from');
|
$address = $message->getAddresses('from');
|
||||||
}
|
}
|
||||||
$collaborators = $this->collaburators($message, $email);
|
$collaborators = $this->collaburators($message, $email);
|
||||||
$attachments = (! $message->getAttachments()) ? [] : $message->getAttachments();
|
$attachments = (!$message->getAttachments()) ? [] : $message->getAttachments();
|
||||||
//dd(['body' => $body, 'subject' => $subject, 'address' => $address, 'cc' => $collaborator, 'attachments' => $attachments]);
|
//dd(['body' => $body, 'subject' => $subject, 'address' => $address, 'cc' => $collaborator, 'attachments' => $attachments]);
|
||||||
$this->workflow($address, $subject, $body, $collaborators, $attachments, $email);
|
$this->workflow($address, $subject, $body, $collaborators, $attachments, $email);
|
||||||
}
|
}
|
||||||
@@ -342,7 +347,8 @@ class MailController extends Controller
|
|||||||
/**
|
/**
|
||||||
* function to load data.
|
* function to load data.
|
||||||
*
|
*
|
||||||
* @param type $id
|
* @param type $id
|
||||||
|
*
|
||||||
* @return type file
|
* @return type file
|
||||||
*/
|
*/
|
||||||
public function get_data($id)
|
public function get_data($id)
|
||||||
@@ -366,7 +372,8 @@ class MailController extends Controller
|
|||||||
/**
|
/**
|
||||||
* separate reply.
|
* separate reply.
|
||||||
*
|
*
|
||||||
* @param type $body
|
* @param type $body
|
||||||
|
*
|
||||||
* @return type string
|
* @return type string
|
||||||
*/
|
*/
|
||||||
public function separateReply($body)
|
public function separateReply($body)
|
||||||
|
@@ -71,6 +71,7 @@ class NotificationController extends Controller
|
|||||||
* Admin Notification/Report.
|
* Admin Notification/Report.
|
||||||
*
|
*
|
||||||
* @param company
|
* @param company
|
||||||
|
*
|
||||||
* @return mail
|
* @return mail
|
||||||
* */
|
* */
|
||||||
public function send_notification_to_admin($company)
|
public function send_notification_to_admin($company)
|
||||||
@@ -85,13 +86,13 @@ class NotificationController extends Controller
|
|||||||
$contents = $view->render();
|
$contents = $view->render();
|
||||||
$from = $this->PhpMailController->mailfrom('1', '0');
|
$from = $this->PhpMailController->mailfrom('1', '0');
|
||||||
$to = [
|
$to = [
|
||||||
'name' => $user_name,
|
'name' => $user_name,
|
||||||
'email' => $email,
|
'email' => $email,
|
||||||
];
|
];
|
||||||
$message = [
|
$message = [
|
||||||
'subject' => 'Daily Report',
|
'subject' => 'Daily Report',
|
||||||
'scenario' => null,
|
'scenario' => null,
|
||||||
'body' => $contents,
|
'body' => $contents,
|
||||||
];
|
];
|
||||||
|
|
||||||
return $this->PhpMailController->sendEmail($from, $to, $message);
|
return $this->PhpMailController->sendEmail($from, $to, $message);
|
||||||
@@ -119,13 +120,13 @@ class NotificationController extends Controller
|
|||||||
$contents = $view->render();
|
$contents = $view->render();
|
||||||
$from = $this->PhpMailController->mailfrom('1', '0');
|
$from = $this->PhpMailController->mailfrom('1', '0');
|
||||||
$to = [
|
$to = [
|
||||||
'name' => $user_name,
|
'name' => $user_name,
|
||||||
'email' => $email,
|
'email' => $email,
|
||||||
];
|
];
|
||||||
$message = [
|
$message = [
|
||||||
'subject' => 'Daily Report',
|
'subject' => 'Daily Report',
|
||||||
'scenario' => null,
|
'scenario' => null,
|
||||||
'body' => $contents,
|
'body' => $contents,
|
||||||
];
|
];
|
||||||
|
|
||||||
return $this->PhpMailController->sendEmail($from, $to, $message);
|
return $this->PhpMailController->sendEmail($from, $to, $message);
|
||||||
@@ -155,13 +156,13 @@ class NotificationController extends Controller
|
|||||||
$contents = $view->render();
|
$contents = $view->render();
|
||||||
$from = $this->PhpMailController->mailfrom('1', '0');
|
$from = $this->PhpMailController->mailfrom('1', '0');
|
||||||
$to = [
|
$to = [
|
||||||
'name' => $user_name,
|
'name' => $user_name,
|
||||||
'email' => $email,
|
'email' => $email,
|
||||||
];
|
];
|
||||||
$message = [
|
$message = [
|
||||||
'subject' => 'Daily Report',
|
'subject' => 'Daily Report',
|
||||||
'scenario' => null,
|
'scenario' => null,
|
||||||
'body' => $contents,
|
'body' => $contents,
|
||||||
];
|
];
|
||||||
|
|
||||||
return $this->PhpMailController->sendEmail($from, $to, $message);
|
return $this->PhpMailController->sendEmail($from, $to, $message);
|
||||||
@@ -187,13 +188,13 @@ class NotificationController extends Controller
|
|||||||
$contents = $view->render();
|
$contents = $view->render();
|
||||||
$from = $this->PhpMailController->mailfrom('1', '0');
|
$from = $this->PhpMailController->mailfrom('1', '0');
|
||||||
$to = [
|
$to = [
|
||||||
'name' => $user_name,
|
'name' => $user_name,
|
||||||
'email' => $email,
|
'email' => $email,
|
||||||
];
|
];
|
||||||
$message = [
|
$message = [
|
||||||
'subject' => 'Daily Report',
|
'subject' => 'Daily Report',
|
||||||
'scenario' => null,
|
'scenario' => null,
|
||||||
'body' => $contents,
|
'body' => $contents,
|
||||||
];
|
];
|
||||||
|
|
||||||
return $this->PhpMailController->sendEmail($from, $to, $message);
|
return $this->PhpMailController->sendEmail($from, $to, $message);
|
||||||
|
@@ -49,6 +49,7 @@ class OrganizationController extends Controller
|
|||||||
* Display a listing of the resource.
|
* Display a listing of the resource.
|
||||||
*
|
*
|
||||||
* @param type Organization $org
|
* @param type Organization $org
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function index()
|
public function index()
|
||||||
@@ -143,6 +144,7 @@ class OrganizationController extends Controller
|
|||||||
*
|
*
|
||||||
* @param type Organization $org
|
* @param type Organization $org
|
||||||
* @param type OrganizationRequest $request
|
* @param type OrganizationRequest $request
|
||||||
|
*
|
||||||
* @return type Redirect
|
* @return type Redirect
|
||||||
*/
|
*/
|
||||||
public function store(Organization $org, OrganizationRequest $request)
|
public function store(Organization $org, OrganizationRequest $request)
|
||||||
@@ -166,8 +168,9 @@ class OrganizationController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Display the specified organization.
|
* Display the specified organization.
|
||||||
*
|
*
|
||||||
* @param type $id
|
* @param type $id
|
||||||
* @param type Organization $org
|
* @param type Organization $org
|
||||||
|
*
|
||||||
* @return type view
|
* @return type view
|
||||||
*/
|
*/
|
||||||
public function show($id, Organization $org)
|
public function show($id, Organization $org)
|
||||||
@@ -185,8 +188,9 @@ class OrganizationController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Show the form for editing the specified organization.
|
* Show the form for editing the specified organization.
|
||||||
*
|
*
|
||||||
* @param type $id
|
* @param type $id
|
||||||
* @param type Organization $org
|
* @param type Organization $org
|
||||||
|
*
|
||||||
* @return type view
|
* @return type view
|
||||||
*/
|
*/
|
||||||
public function edit($id, Organization $org)
|
public function edit($id, Organization $org)
|
||||||
@@ -204,9 +208,10 @@ class OrganizationController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Update the specified organization in storage.
|
* Update the specified organization in storage.
|
||||||
*
|
*
|
||||||
* @param type $id
|
* @param type $id
|
||||||
* @param type Organization $org
|
* @param type Organization $org
|
||||||
* @param type OrganizationUpdate $request
|
* @param type OrganizationUpdate $request
|
||||||
|
*
|
||||||
* @return type Redirect
|
* @return type Redirect
|
||||||
*/
|
*/
|
||||||
public function update($id, Organization $org, OrganizationUpdate $request)
|
public function update($id, Organization $org, OrganizationUpdate $request)
|
||||||
@@ -234,6 +239,7 @@ class OrganizationController extends Controller
|
|||||||
* Delete a specified organization from storage.
|
* Delete a specified organization from storage.
|
||||||
*
|
*
|
||||||
* @param type int $id
|
* @param type int $id
|
||||||
|
*
|
||||||
* @return type Redirect
|
* @return type Redirect
|
||||||
*/
|
*/
|
||||||
public function destroy($id, Organization $org, User_org $user_org)
|
public function destroy($id, Organization $org, User_org $user_org)
|
||||||
@@ -259,7 +265,8 @@ class OrganizationController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Soring an organization head.
|
* Soring an organization head.
|
||||||
*
|
*
|
||||||
* @param type $id
|
* @param type $id
|
||||||
|
*
|
||||||
* @return type boolean
|
* @return type boolean
|
||||||
*/
|
*/
|
||||||
public function Head_Org($id)
|
public function Head_Org($id)
|
||||||
@@ -278,9 +285,10 @@ class OrganizationController extends Controller
|
|||||||
/**
|
/**
|
||||||
* get the report of organizations.
|
* get the report of organizations.
|
||||||
*
|
*
|
||||||
* @param type $id
|
* @param type $id
|
||||||
* @param type $date111
|
* @param type $date111
|
||||||
* @param type $date122
|
* @param type $date122
|
||||||
|
*
|
||||||
* @return type array
|
* @return type array
|
||||||
*/
|
*/
|
||||||
public function orgChartData($id, $date111 = '', $date122 = '')
|
public function orgChartData($id, $date111 = '', $date122 = '')
|
||||||
|
@@ -53,9 +53,9 @@ class ReportController extends Controller
|
|||||||
/**
|
/**
|
||||||
* function to get help_topic graph.
|
* function to get help_topic graph.
|
||||||
*
|
*
|
||||||
* @param type $date111
|
* @param type $date111
|
||||||
* @param type $date122
|
* @param type $date122
|
||||||
* @param type $helptopic
|
* @param type $helptopic
|
||||||
*/
|
*/
|
||||||
public function chartdataHelptopic(Request $request, $date111 = '', $date122 = '', $helptopic = '')
|
public function chartdataHelptopic(Request $request, $date111 = '', $date122 = '', $helptopic = '')
|
||||||
{
|
{
|
||||||
|
@@ -93,6 +93,7 @@ class TicketController extends Controller
|
|||||||
* Save the data of new ticket and show the New ticket page with result.
|
* Save the data of new ticket and show the New ticket page with result.
|
||||||
*
|
*
|
||||||
* @param type CreateTicketRequest $request
|
* @param type CreateTicketRequest $request
|
||||||
|
*
|
||||||
* @return type response
|
* @return type response
|
||||||
*/
|
*/
|
||||||
public function post_newticket(CreateTicketRequest $request, CountryCode $code, $api = false)
|
public function post_newticket(CreateTicketRequest $request, CountryCode $code, $api = false)
|
||||||
@@ -133,8 +134,8 @@ class TicketController extends Controller
|
|||||||
$geoipcode = $code->where('iso', '=', $location->iso_code)->first();
|
$geoipcode = $code->where('iso', '=', $location->iso_code)->first();
|
||||||
if ($phonecode == null) {
|
if ($phonecode == null) {
|
||||||
$data = [
|
$data = [
|
||||||
'fails' => Lang::get('lang.country-code-required-error'),
|
'fails' => Lang::get('lang.country-code-required-error'),
|
||||||
'phonecode' => $geoipcode->phonecode,
|
'phonecode' => $geoipcode->phonecode,
|
||||||
'country_code_error' => 1,
|
'country_code_error' => 1,
|
||||||
];
|
];
|
||||||
if ($api != false) {
|
if ($api != false) {
|
||||||
@@ -144,10 +145,10 @@ class TicketController extends Controller
|
|||||||
return Redirect()->back()->with($data)->withInput($request->except('password'));
|
return Redirect()->back()->with($data)->withInput($request->except('password'));
|
||||||
} else {
|
} else {
|
||||||
$code = CountryCode::select('phonecode')->where('phonecode', '=', $phonecode)->get();
|
$code = CountryCode::select('phonecode')->where('phonecode', '=', $phonecode)->get();
|
||||||
if (! count($code)) {
|
if (!count($code)) {
|
||||||
$data = [
|
$data = [
|
||||||
'fails' => Lang::get('lang.incorrect-country-code-error'),
|
'fails' => Lang::get('lang.incorrect-country-code-error'),
|
||||||
'phonecode' => $geoipcode->phonecode,
|
'phonecode' => $geoipcode->phonecode,
|
||||||
'country_code_error' => 1,
|
'country_code_error' => 1,
|
||||||
];
|
];
|
||||||
if ($api != false) {
|
if ($api != false) {
|
||||||
@@ -196,7 +197,8 @@ class TicketController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Shows the ticket thread details.
|
* Shows the ticket thread details.
|
||||||
*
|
*
|
||||||
* @param type $id
|
* @param type $id
|
||||||
|
*
|
||||||
* @return type response
|
* @return type response
|
||||||
*/
|
*/
|
||||||
public function thread($id)
|
public function thread($id)
|
||||||
@@ -241,7 +243,7 @@ class TicketController extends Controller
|
|||||||
{
|
{
|
||||||
$size = 0;
|
$size = 0;
|
||||||
$files = Input::file('attachment');
|
$files = Input::file('attachment');
|
||||||
if (! $files) {
|
if (!$files) {
|
||||||
return $size;
|
return $size;
|
||||||
}
|
}
|
||||||
if (count($files) > 0) {
|
if (count($files) > 0) {
|
||||||
@@ -271,6 +273,7 @@ class TicketController extends Controller
|
|||||||
*
|
*
|
||||||
* @param type Ticket_Thread $thread
|
* @param type Ticket_Thread $thread
|
||||||
* @param type TicketRequest $request
|
* @param type TicketRequest $request
|
||||||
|
*
|
||||||
* @return type bool
|
* @return type bool
|
||||||
*/
|
*/
|
||||||
public function reply(Ticket_Thread $thread, Request $request, Ticket_attachments $ta, $mail = true, $system_reply = true, $user_id = '')
|
public function reply(Ticket_Thread $thread, Request $request, Ticket_attachments $ta, $mail = true, $system_reply = true, $user_id = '')
|
||||||
@@ -374,7 +377,7 @@ class TicketController extends Controller
|
|||||||
$ticket_number = $tickets->ticket_number;
|
$ticket_number = $tickets->ticket_number;
|
||||||
$company = $this->company();
|
$company = $this->company();
|
||||||
$username = $ticket_user->first_name;
|
$username = $ticket_user->first_name;
|
||||||
if (! empty(Auth::user()->agent_sign)) {
|
if (!empty(Auth::user()->agent_sign)) {
|
||||||
$agentsign = Auth::user()->agent_sign;
|
$agentsign = Auth::user()->agent_sign;
|
||||||
} else {
|
} else {
|
||||||
$agentsign = null;
|
$agentsign = null;
|
||||||
@@ -389,10 +392,10 @@ class TicketController extends Controller
|
|||||||
}
|
}
|
||||||
$data = [
|
$data = [
|
||||||
'ticket_id' => $request->input('ticket_ID'),
|
'ticket_id' => $request->input('ticket_ID'),
|
||||||
'u_id' => $u_id,
|
'u_id' => $u_id,
|
||||||
'body' => $request->input('reply_content'),
|
'body' => $request->input('reply_content'),
|
||||||
];
|
];
|
||||||
if (! $request->has('do-not-send')) {
|
if (!$request->has('do-not-send')) {
|
||||||
event('Reply-Ticket', [$data]);
|
event('Reply-Ticket', [$data]);
|
||||||
}
|
}
|
||||||
// sending attachments via php mail function
|
// sending attachments via php mail function
|
||||||
@@ -401,7 +404,7 @@ class TicketController extends Controller
|
|||||||
$line = '---Reply above this line---<br><br>';
|
$line = '---Reply above this line---<br><br>';
|
||||||
$collaborators = Ticket_Collaborator::where('ticket_id', '=', $ticket_id)->get();
|
$collaborators = Ticket_Collaborator::where('ticket_id', '=', $ticket_id)->get();
|
||||||
$emails = Emails::where('department', '=', $tickets->dept_id)->first();
|
$emails = Emails::where('department', '=', $tickets->dept_id)->first();
|
||||||
if (! $email) {
|
if (!$email) {
|
||||||
$mail = false;
|
$mail = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -413,16 +416,16 @@ class TicketController extends Controller
|
|||||||
$from = $this->PhpMailController->mailfrom('0', $tickets->dept_id),
|
$from = $this->PhpMailController->mailfrom('0', $tickets->dept_id),
|
||||||
$to = ['name' => $user_name, 'email' => $email, 'cc' => $collaborators],
|
$to = ['name' => $user_name, 'email' => $email, 'cc' => $collaborators],
|
||||||
$message = [
|
$message = [
|
||||||
'subject' => $ticket_subject.'[#'.$ticket_number.']',
|
'subject' => $ticket_subject.'[#'.$ticket_number.']',
|
||||||
'body' => $line.$request->input('reply_content'),
|
'body' => $line.$request->input('reply_content'),
|
||||||
'scenario' => 'ticket-reply',
|
'scenario' => 'ticket-reply',
|
||||||
'attachments' => $attachment_files,
|
'attachments' => $attachment_files,
|
||||||
],
|
],
|
||||||
$template_variables = [
|
$template_variables = [
|
||||||
'ticket_number' => $ticket_number,
|
'ticket_number' => $ticket_number,
|
||||||
'user' => $username,
|
'user' => $username,
|
||||||
'agent_sign' => $agentsign,
|
'agent_sign' => $agentsign,
|
||||||
'system_link' => $link,
|
'system_link' => $link,
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -439,8 +442,9 @@ class TicketController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Ticket edit and save ticket data.
|
* Ticket edit and save ticket data.
|
||||||
*
|
*
|
||||||
* @param type $ticket_id
|
* @param type $ticket_id
|
||||||
* @param type Ticket_Thread $thread
|
* @param type Ticket_Thread $thread
|
||||||
|
*
|
||||||
* @return type bool
|
* @return type bool
|
||||||
*/
|
*/
|
||||||
public function ticketEditPost($ticket_id, Ticket_Thread $thread, Tickets $ticket)
|
public function ticketEditPost($ticket_id, Ticket_Thread $thread, Tickets $ticket)
|
||||||
@@ -476,7 +480,8 @@ class TicketController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Print Ticket Details.
|
* Print Ticket Details.
|
||||||
*
|
*
|
||||||
* @param type $id
|
* @param type $id
|
||||||
|
*
|
||||||
* @return type respponse
|
* @return type respponse
|
||||||
*/
|
*/
|
||||||
public function ticket_print($id)
|
public function ticket_print($id)
|
||||||
@@ -505,7 +510,8 @@ class TicketController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Generates Ticket Number.
|
* Generates Ticket Number.
|
||||||
*
|
*
|
||||||
* @param type $ticket_number
|
* @param type $ticket_number
|
||||||
|
*
|
||||||
* @return type integer
|
* @return type integer
|
||||||
*/
|
*/
|
||||||
public function ticketNumberold($ticket_number)
|
public function ticketNumberold($ticket_number)
|
||||||
@@ -577,7 +583,8 @@ class TicketController extends Controller
|
|||||||
/**
|
/**
|
||||||
* check email for dublicate entry.
|
* check email for dublicate entry.
|
||||||
*
|
*
|
||||||
* @param type $email
|
* @param type $email
|
||||||
|
*
|
||||||
* @return type bool
|
* @return type bool
|
||||||
*/
|
*/
|
||||||
public function checkEmail($email)
|
public function checkEmail($email)
|
||||||
@@ -593,7 +600,8 @@ class TicketController extends Controller
|
|||||||
/**
|
/**
|
||||||
* @category fucntion to check if mobile number is unqique or not
|
* @category fucntion to check if mobile number is unqique or not
|
||||||
*
|
*
|
||||||
* @param string $mobile
|
* @param string $mobile
|
||||||
|
*
|
||||||
* @return bool true(if mobile exists in users table)/false (if mobile does not exist in user table)
|
* @return bool true(if mobile exists in users table)/false (if mobile does not exist in user table)
|
||||||
*/
|
*/
|
||||||
public function checkMobile($mobile)
|
public function checkMobile($mobile)
|
||||||
@@ -609,14 +617,15 @@ class TicketController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Create User while creating ticket.
|
* Create User while creating ticket.
|
||||||
*
|
*
|
||||||
* @param type $emailadd
|
* @param type $emailadd
|
||||||
* @param type $username
|
* @param type $username
|
||||||
* @param type $subject
|
* @param type $subject
|
||||||
* @param type $phone
|
* @param type $phone
|
||||||
* @param type $helptopic
|
* @param type $helptopic
|
||||||
* @param type $sla
|
* @param type $sla
|
||||||
* @param type $priority
|
* @param type $priority
|
||||||
* @param type $system
|
* @param type $system
|
||||||
|
*
|
||||||
* @return type bool
|
* @return type bool
|
||||||
*/
|
*/
|
||||||
public function create_user($emailadd, $username, $subject, $body, $phone, $phonecode, $mobile_number, $helptopic, $sla, $priority, $source, $headers, $dept, $assignto, $from_data, $auto_response, $status)
|
public function create_user($emailadd, $username, $subject, $body, $phone, $phonecode, $mobile_number, $helptopic, $sla, $priority, $source, $headers, $dept, $assignto, $from_data, $auto_response, $status)
|
||||||
@@ -624,7 +633,7 @@ class TicketController extends Controller
|
|||||||
// define global variables
|
// define global variables
|
||||||
|
|
||||||
$unique = $emailadd;
|
$unique = $emailadd;
|
||||||
if (! $emailadd) {
|
if (!$emailadd) {
|
||||||
$unique = $mobile_number;
|
$unique = $mobile_number;
|
||||||
}
|
}
|
||||||
// check emails
|
// check emails
|
||||||
@@ -676,11 +685,11 @@ class TicketController extends Controller
|
|||||||
if ($user_status == 0 || ($email_mandatory->status == 0 || $email_mandatory->status == '0')) {
|
if ($user_status == 0 || ($email_mandatory->status == 0 || $email_mandatory->status == '0')) {
|
||||||
$value = [
|
$value = [
|
||||||
'full_name' => $username,
|
'full_name' => $username,
|
||||||
'email' => $emailadd,
|
'email' => $emailadd,
|
||||||
'code' => $phonecode,
|
'code' => $phonecode,
|
||||||
'mobile' => $mobile_number,
|
'mobile' => $mobile_number,
|
||||||
'user_name' => $unique,
|
'user_name' => $unique,
|
||||||
'password' => $password,
|
'password' => $password,
|
||||||
];
|
];
|
||||||
event(new \App\Events\LoginEvent($value));
|
event(new \App\Events\LoginEvent($value));
|
||||||
}
|
}
|
||||||
@@ -733,9 +742,9 @@ class TicketController extends Controller
|
|||||||
$to = ['name' => $username, 'email' => $emailadd],
|
$to = ['name' => $username, 'email' => $emailadd],
|
||||||
$message = ['subject' => $updated_subject, 'scenario' => 'create-ticket-by-agent', 'body' => $body],
|
$message = ['subject' => $updated_subject, 'scenario' => 'create-ticket-by-agent', 'body' => $body],
|
||||||
$template_variables = [
|
$template_variables = [
|
||||||
'agent_sign' => Auth::user()->agent_sign,
|
'agent_sign' => Auth::user()->agent_sign,
|
||||||
'ticket_number' => $ticket_number2,
|
'ticket_number' => $ticket_number2,
|
||||||
'system_link' => $link,
|
'system_link' => $link,
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -752,9 +761,9 @@ class TicketController extends Controller
|
|||||||
$to = ['name' => $username, 'email' => $emailadd],
|
$to = ['name' => $username, 'email' => $emailadd],
|
||||||
$message = ['subject' => $updated_subject, 'scenario' => 'create-ticket'],
|
$message = ['subject' => $updated_subject, 'scenario' => 'create-ticket'],
|
||||||
$template_variables = ['user' => $username,
|
$template_variables = ['user' => $username,
|
||||||
'ticket_number' => $ticket_number2,
|
'ticket_number' => $ticket_number2,
|
||||||
'department_sign' => '',
|
'department_sign' => '',
|
||||||
'system_link' => $link,
|
'system_link' => $link,
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -815,32 +824,32 @@ class TicketController extends Controller
|
|||||||
$this->PhpMailController->sendmail(
|
$this->PhpMailController->sendmail(
|
||||||
$from = $this->PhpMailController->mailfrom('0', $ticketdata->dept_id),
|
$from = $this->PhpMailController->mailfrom('0', $ticketdata->dept_id),
|
||||||
$to = [
|
$to = [
|
||||||
'user' => $email_data['to_user'],
|
'user' => $email_data['to_user'],
|
||||||
'email' => $email_data['to_email'],
|
'email' => $email_data['to_email'],
|
||||||
],
|
],
|
||||||
$message = [
|
$message = [
|
||||||
'subject' => $updated_subject,
|
'subject' => $updated_subject,
|
||||||
'body' => $body, 'scenario' => $mail,
|
'body' => $body, 'scenario' => $mail,
|
||||||
],
|
],
|
||||||
$template_variables = [
|
$template_variables = [
|
||||||
'ticket_agent_name' => $email_data['to_user_name'],
|
'ticket_agent_name' => $email_data['to_user_name'],
|
||||||
'ticket_client_name' => $username,
|
'ticket_client_name' => $username,
|
||||||
'ticket_client_email' => $emailadd,
|
'ticket_client_email' => $emailadd,
|
||||||
'user' => $email_data['to_user_name'],
|
'user' => $email_data['to_user_name'],
|
||||||
'ticket_number' => $ticket_number2,
|
'ticket_number' => $ticket_number2,
|
||||||
'email_address' => $emailadd,
|
'email_address' => $emailadd,
|
||||||
'name' => $ticket_creator, ]
|
'name' => $ticket_creator, ]
|
||||||
);
|
);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$data = [
|
$data = [
|
||||||
'ticket_number' => $ticket_number2,
|
'ticket_number' => $ticket_number2,
|
||||||
'user_id' => $user_id,
|
'user_id' => $user_id,
|
||||||
'subject' => $subject,
|
'subject' => $subject,
|
||||||
'body' => $body,
|
'body' => $body,
|
||||||
'status' => $status,
|
'status' => $status,
|
||||||
'Priority' => $priority,
|
'Priority' => $priority,
|
||||||
];
|
];
|
||||||
event('Create-Ticket', [$data]);
|
event('Create-Ticket', [$data]);
|
||||||
$data = [
|
$data = [
|
||||||
@@ -892,12 +901,13 @@ class TicketController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Check the response of the ticket.
|
* Check the response of the ticket.
|
||||||
*
|
*
|
||||||
* @param type $user_id
|
* @param type $user_id
|
||||||
* @param type $subject
|
* @param type $subject
|
||||||
* @param type $body
|
* @param type $body
|
||||||
* @param type $helptopic
|
* @param type $helptopic
|
||||||
* @param type $sla
|
* @param type $sla
|
||||||
* @param type $priority
|
* @param type $priority
|
||||||
|
*
|
||||||
* @return type string
|
* @return type string
|
||||||
*/
|
*/
|
||||||
public function check_ticket($user_id, $subject, $body, $helptopic, $sla, $priority, $source, $headers, $dept, $assignto, $form_data, $status)
|
public function check_ticket($user_id, $subject, $body, $helptopic, $sla, $priority, $source, $headers, $dept, $assignto, $form_data, $status)
|
||||||
@@ -939,10 +949,10 @@ class TicketController extends Controller
|
|||||||
// event fire for internal notes
|
// event fire for internal notes
|
||||||
//event to change status
|
//event to change status
|
||||||
$data = [
|
$data = [
|
||||||
'id' => $ticket_number,
|
'id' => $ticket_number,
|
||||||
'status' => 'Open',
|
'status' => 'Open',
|
||||||
'first_name' => $username,
|
'first_name' => $username,
|
||||||
'last_name' => '',
|
'last_name' => '',
|
||||||
];
|
];
|
||||||
event('change-status', [$data]);
|
event('change-status', [$data]);
|
||||||
}
|
}
|
||||||
@@ -967,12 +977,13 @@ class TicketController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Create Ticket.
|
* Create Ticket.
|
||||||
*
|
*
|
||||||
* @param type $user_id
|
* @param type $user_id
|
||||||
* @param type $subject
|
* @param type $subject
|
||||||
* @param type $body
|
* @param type $body
|
||||||
* @param type $helptopic
|
* @param type $helptopic
|
||||||
* @param type $sla
|
* @param type $sla
|
||||||
* @param type $priority
|
* @param type $priority
|
||||||
|
*
|
||||||
* @return type string
|
* @return type string
|
||||||
*/
|
*/
|
||||||
public function createTicket($user_id, $subject, $body, $helptopic, $sla, $priority, $source, $headers, $dept, $assignto, $form_data, $status)
|
public function createTicket($user_id, $subject, $body, $helptopic, $sla, $priority, $source, $headers, $dept, $assignto, $form_data, $status)
|
||||||
@@ -1042,7 +1053,7 @@ class TicketController extends Controller
|
|||||||
$form_name = $form->formname;
|
$form_name = $form->formname;
|
||||||
}
|
}
|
||||||
foreach ($form_data as $key => $form_details) {
|
foreach ($form_data as $key => $form_details) {
|
||||||
if (! is_array($form_details)) {
|
if (!is_array($form_details)) {
|
||||||
$form_value = new Ticket_Form_Data();
|
$form_value = new Ticket_Form_Data();
|
||||||
$form_value->ticket_id = $id;
|
$form_value->ticket_id = $id;
|
||||||
$form_value->title = $key;
|
$form_value->title = $key;
|
||||||
@@ -1063,10 +1074,11 @@ class TicketController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Generate Ticket Thread.
|
* Generate Ticket Thread.
|
||||||
*
|
*
|
||||||
* @param type $subject
|
* @param type $subject
|
||||||
* @param type $body
|
* @param type $body
|
||||||
* @param type $id
|
* @param type $id
|
||||||
* @param type $user_id
|
* @param type $user_id
|
||||||
|
*
|
||||||
* @return type
|
* @return type
|
||||||
*/
|
*/
|
||||||
public function ticketThread($subject, $body, $id, $user_id)
|
public function ticketThread($subject, $body, $id, $user_id)
|
||||||
@@ -1087,7 +1099,8 @@ class TicketController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Generate a random string for password.
|
* Generate a random string for password.
|
||||||
*
|
*
|
||||||
* @param type $length
|
* @param type $length
|
||||||
|
*
|
||||||
* @return type string
|
* @return type string
|
||||||
*/
|
*/
|
||||||
public function generateRandomString($length = 10)
|
public function generateRandomString($length = 10)
|
||||||
@@ -1105,8 +1118,9 @@ class TicketController extends Controller
|
|||||||
/**
|
/**
|
||||||
* function to Ticket Close.
|
* function to Ticket Close.
|
||||||
*
|
*
|
||||||
* @param type $id
|
* @param type $id
|
||||||
* @param type Tickets $ticket
|
* @param type Tickets $ticket
|
||||||
|
*
|
||||||
* @return type string
|
* @return type string
|
||||||
*/
|
*/
|
||||||
public function close($id, Tickets $ticket)
|
public function close($id, Tickets $ticket)
|
||||||
@@ -1155,10 +1169,10 @@ class TicketController extends Controller
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
$data = [
|
$data = [
|
||||||
'id' => $ticket_status->ticket_number,
|
'id' => $ticket_status->ticket_number,
|
||||||
'status' => 'Closed',
|
'status' => 'Closed',
|
||||||
'first_name' => Auth::user()->first_name,
|
'first_name' => Auth::user()->first_name,
|
||||||
'last_name' => Auth::user()->last_name,
|
'last_name' => Auth::user()->last_name,
|
||||||
];
|
];
|
||||||
event('change-status', [$data]);
|
event('change-status', [$data]);
|
||||||
|
|
||||||
@@ -1168,8 +1182,9 @@ class TicketController extends Controller
|
|||||||
/**
|
/**
|
||||||
* function to Ticket resolved.
|
* function to Ticket resolved.
|
||||||
*
|
*
|
||||||
* @param type $id
|
* @param type $id
|
||||||
* @param type Tickets $ticket
|
* @param type Tickets $ticket
|
||||||
|
*
|
||||||
* @return type string
|
* @return type string
|
||||||
*/
|
*/
|
||||||
public function resolve($id, Tickets $ticket)
|
public function resolve($id, Tickets $ticket)
|
||||||
@@ -1200,10 +1215,10 @@ class TicketController extends Controller
|
|||||||
}
|
}
|
||||||
$thread->save();
|
$thread->save();
|
||||||
$data = [
|
$data = [
|
||||||
'id' => $ticket_status->ticket_number,
|
'id' => $ticket_status->ticket_number,
|
||||||
'status' => 'Resolved',
|
'status' => 'Resolved',
|
||||||
'first_name' => Auth::user()->first_name,
|
'first_name' => Auth::user()->first_name,
|
||||||
'last_name' => Auth::user()->last_name,
|
'last_name' => Auth::user()->last_name,
|
||||||
];
|
];
|
||||||
event('change-status', [$data]);
|
event('change-status', [$data]);
|
||||||
|
|
||||||
@@ -1213,8 +1228,9 @@ class TicketController extends Controller
|
|||||||
/**
|
/**
|
||||||
* function to Open Ticket.
|
* function to Open Ticket.
|
||||||
*
|
*
|
||||||
* @param type $id
|
* @param type $id
|
||||||
* @param type Tickets $ticket
|
* @param type Tickets $ticket
|
||||||
|
*
|
||||||
* @return type
|
* @return type
|
||||||
*/
|
*/
|
||||||
public function open($id, Tickets $ticket)
|
public function open($id, Tickets $ticket)
|
||||||
@@ -1239,10 +1255,10 @@ class TicketController extends Controller
|
|||||||
$thread->body = $ticket_status_message->message.' '.Auth::user()->first_name.' '.Auth::user()->last_name;
|
$thread->body = $ticket_status_message->message.' '.Auth::user()->first_name.' '.Auth::user()->last_name;
|
||||||
$thread->save();
|
$thread->save();
|
||||||
$data = [
|
$data = [
|
||||||
'id' => $ticket_status->ticket_number,
|
'id' => $ticket_status->ticket_number,
|
||||||
'status' => 'Open',
|
'status' => 'Open',
|
||||||
'first_name' => Auth::user()->first_name,
|
'first_name' => Auth::user()->first_name,
|
||||||
'last_name' => Auth::user()->last_name,
|
'last_name' => Auth::user()->last_name,
|
||||||
];
|
];
|
||||||
event('change-status', [$data]);
|
event('change-status', [$data]);
|
||||||
|
|
||||||
@@ -1252,8 +1268,9 @@ class TicketController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Function to delete ticket.
|
* Function to delete ticket.
|
||||||
*
|
*
|
||||||
* @param type $id
|
* @param type $id
|
||||||
* @param type Tickets $ticket
|
* @param type Tickets $ticket
|
||||||
|
*
|
||||||
* @return type string
|
* @return type string
|
||||||
*/
|
*/
|
||||||
public function delete($id, Tickets $ticket)
|
public function delete($id, Tickets $ticket)
|
||||||
@@ -1270,10 +1287,10 @@ class TicketController extends Controller
|
|||||||
$ticket_attachment->delete();
|
$ticket_attachment->delete();
|
||||||
}
|
}
|
||||||
$data = [
|
$data = [
|
||||||
'id' => $ticket_delete->ticket_number,
|
'id' => $ticket_delete->ticket_number,
|
||||||
'status' => 'Deleted',
|
'status' => 'Deleted',
|
||||||
'first_name' => Auth::user()->first_name,
|
'first_name' => Auth::user()->first_name,
|
||||||
'last_name' => Auth::user()->last_name,
|
'last_name' => Auth::user()->last_name,
|
||||||
];
|
];
|
||||||
event('change-status', [$data]);
|
event('change-status', [$data]);
|
||||||
|
|
||||||
@@ -1290,10 +1307,10 @@ class TicketController extends Controller
|
|||||||
$thread->body = $ticket_status_message->message.' '.Auth::user()->first_name.' '.Auth::user()->last_name;
|
$thread->body = $ticket_status_message->message.' '.Auth::user()->first_name.' '.Auth::user()->last_name;
|
||||||
$thread->save();
|
$thread->save();
|
||||||
$data = [
|
$data = [
|
||||||
'id' => $ticket_delete->ticket_number,
|
'id' => $ticket_delete->ticket_number,
|
||||||
'status' => 'Deleted',
|
'status' => 'Deleted',
|
||||||
'first_name' => Auth::user()->first_name,
|
'first_name' => Auth::user()->first_name,
|
||||||
'last_name' => Auth::user()->last_name,
|
'last_name' => Auth::user()->last_name,
|
||||||
];
|
];
|
||||||
event('change-status', [$data]);
|
event('change-status', [$data]);
|
||||||
|
|
||||||
@@ -1304,8 +1321,9 @@ class TicketController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Function to ban an email.
|
* Function to ban an email.
|
||||||
*
|
*
|
||||||
* @param type $id
|
* @param type $id
|
||||||
* @param type Tickets $ticket
|
* @param type Tickets $ticket
|
||||||
|
*
|
||||||
* @return type string
|
* @return type string
|
||||||
*/
|
*/
|
||||||
public function ban($id, Tickets $ticket)
|
public function ban($id, Tickets $ticket)
|
||||||
@@ -1323,7 +1341,8 @@ class TicketController extends Controller
|
|||||||
/**
|
/**
|
||||||
* function to assign ticket.
|
* function to assign ticket.
|
||||||
*
|
*
|
||||||
* @param type $id
|
* @param type $id
|
||||||
|
*
|
||||||
* @return type bool
|
* @return type bool
|
||||||
*/
|
*/
|
||||||
public function assign($id)
|
public function assign($id)
|
||||||
@@ -1395,7 +1414,8 @@ class TicketController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Function to post internal note.
|
* Function to post internal note.
|
||||||
*
|
*
|
||||||
* @param type $id
|
* @param type $id
|
||||||
|
*
|
||||||
* @return type bool
|
* @return type bool
|
||||||
*/
|
*/
|
||||||
public function InternalNote($id)
|
public function InternalNote($id)
|
||||||
@@ -1412,8 +1432,8 @@ class TicketController extends Controller
|
|||||||
$NewThread->save();
|
$NewThread->save();
|
||||||
$data = [
|
$data = [
|
||||||
'ticket_id' => $id,
|
'ticket_id' => $id,
|
||||||
'u_id' => Auth::user()->first_name.' '.Auth::user()->last_name,
|
'u_id' => Auth::user()->first_name.' '.Auth::user()->last_name,
|
||||||
'body' => $InternalContent,
|
'body' => $InternalContent,
|
||||||
];
|
];
|
||||||
event('Reply-Ticket', [$data]);
|
event('Reply-Ticket', [$data]);
|
||||||
|
|
||||||
@@ -1423,7 +1443,8 @@ class TicketController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Function to surrender a ticket.
|
* Function to surrender a ticket.
|
||||||
*
|
*
|
||||||
* @param type $id
|
* @param type $id
|
||||||
|
*
|
||||||
* @return type bool
|
* @return type bool
|
||||||
*/
|
*/
|
||||||
public function surrender($id)
|
public function surrender($id)
|
||||||
@@ -1449,7 +1470,8 @@ class TicketController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Search.
|
* Search.
|
||||||
*
|
*
|
||||||
* @param type $keyword
|
* @param type $keyword
|
||||||
|
*
|
||||||
* @return type array
|
* @return type array
|
||||||
*/
|
*/
|
||||||
public function search($keyword)
|
public function search($keyword)
|
||||||
@@ -1466,7 +1488,8 @@ class TicketController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Search.
|
* Search.
|
||||||
*
|
*
|
||||||
* @param type $keyword
|
* @param type $keyword
|
||||||
|
*
|
||||||
* @return type array
|
* @return type array
|
||||||
*/
|
*/
|
||||||
public function stores($ticket_number)
|
public function stores($ticket_number)
|
||||||
@@ -1485,7 +1508,8 @@ class TicketController extends Controller
|
|||||||
/**
|
/**
|
||||||
* store_collaborators.
|
* store_collaborators.
|
||||||
*
|
*
|
||||||
* @param type $headers
|
* @param type $headers
|
||||||
|
*
|
||||||
* @return type
|
* @return type
|
||||||
*/
|
*/
|
||||||
public function storeCollaborators($headers, $id)
|
public function storeCollaborators($headers, $id)
|
||||||
@@ -1567,7 +1591,8 @@ class TicketController extends Controller
|
|||||||
/**
|
/**
|
||||||
* cleanMe.
|
* cleanMe.
|
||||||
*
|
*
|
||||||
* @param type $input
|
* @param type $input
|
||||||
|
*
|
||||||
* @return type
|
* @return type
|
||||||
*/
|
*/
|
||||||
public function cleanMe($input)
|
public function cleanMe($input)
|
||||||
@@ -1584,6 +1609,7 @@ class TicketController extends Controller
|
|||||||
* autosearch.
|
* autosearch.
|
||||||
*
|
*
|
||||||
* @param type Image $image
|
* @param type Image $image
|
||||||
|
*
|
||||||
* @return type json
|
* @return type json
|
||||||
*/
|
*/
|
||||||
public function autosearch($id)
|
public function autosearch($id)
|
||||||
@@ -1597,6 +1623,7 @@ class TicketController extends Controller
|
|||||||
* autosearch2.
|
* autosearch2.
|
||||||
*
|
*
|
||||||
* @param type Image $image
|
* @param type Image $image
|
||||||
|
*
|
||||||
* @return type json
|
* @return type json
|
||||||
*/
|
*/
|
||||||
public function autosearch2(User $user)
|
public function autosearch2(User $user)
|
||||||
@@ -1609,6 +1636,7 @@ class TicketController extends Controller
|
|||||||
* autosearch.
|
* autosearch.
|
||||||
*
|
*
|
||||||
* @param type Image $image
|
* @param type Image $image
|
||||||
|
*
|
||||||
* @return type json
|
* @return type json
|
||||||
*/
|
*/
|
||||||
public function usersearch()
|
public function usersearch()
|
||||||
@@ -1625,7 +1653,7 @@ class TicketController extends Controller
|
|||||||
.'</div>';
|
.'</div>';
|
||||||
}
|
}
|
||||||
$ticket_collaborator = Ticket_Collaborator::where('ticket_id', '=', $ticket_id)->where('user_id', '=', $data->id)->first();
|
$ticket_collaborator = Ticket_Collaborator::where('ticket_id', '=', $ticket_id)->where('user_id', '=', $data->id)->first();
|
||||||
if (! isset($ticket_collaborator)) {
|
if (!isset($ticket_collaborator)) {
|
||||||
$ticket_collaborator = new Ticket_Collaborator();
|
$ticket_collaborator = new Ticket_Collaborator();
|
||||||
$ticket_collaborator->isactive = 1;
|
$ticket_collaborator->isactive = 1;
|
||||||
$ticket_collaborator->ticket_id = $ticket_id;
|
$ticket_collaborator->ticket_id = $ticket_id;
|
||||||
@@ -1643,6 +1671,7 @@ class TicketController extends Controller
|
|||||||
* useradd.
|
* useradd.
|
||||||
*
|
*
|
||||||
* @param type Image $image
|
* @param type Image $image
|
||||||
|
*
|
||||||
* @return type json
|
* @return type json
|
||||||
*/
|
*/
|
||||||
public function useradd()
|
public function useradd()
|
||||||
@@ -1778,7 +1807,8 @@ class TicketController extends Controller
|
|||||||
/**
|
/**
|
||||||
* user time zone.
|
* user time zone.
|
||||||
*
|
*
|
||||||
* @param type $utc
|
* @param type $utc
|
||||||
|
*
|
||||||
* @return type date
|
* @return type date
|
||||||
*/
|
*/
|
||||||
public static function usertimezone($utc)
|
public static function usertimezone($utc)
|
||||||
@@ -1826,7 +1856,8 @@ class TicketController extends Controller
|
|||||||
/**
|
/**
|
||||||
* lock.
|
* lock.
|
||||||
*
|
*
|
||||||
* @param type $id
|
* @param type $id
|
||||||
|
*
|
||||||
* @return type null
|
* @return type null
|
||||||
*/
|
*/
|
||||||
public function lock($id)
|
public function lock($id)
|
||||||
@@ -1968,7 +1999,8 @@ class TicketController extends Controller
|
|||||||
* checkLock($id)
|
* checkLock($id)
|
||||||
* function to check and lock ticket.
|
* function to check and lock ticket.
|
||||||
*
|
*
|
||||||
* @param int $id
|
* @param int $id
|
||||||
|
*
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
public function checkLock($id)
|
public function checkLock($id)
|
||||||
@@ -2019,7 +2051,8 @@ class TicketController extends Controller
|
|||||||
/**
|
/**
|
||||||
* function to Change owner.
|
* function to Change owner.
|
||||||
*
|
*
|
||||||
* @param type $id
|
* @param type $id
|
||||||
|
*
|
||||||
* @return type bool
|
* @return type bool
|
||||||
*/
|
*/
|
||||||
public function changeOwner($id)
|
public function changeOwner($id)
|
||||||
@@ -2084,6 +2117,7 @@ class TicketController extends Controller
|
|||||||
* useradd.
|
* useradd.
|
||||||
*
|
*
|
||||||
* @param type Image $image
|
* @param type Image $image
|
||||||
|
*
|
||||||
* @return type json
|
* @return type json
|
||||||
*/
|
*/
|
||||||
public function changeOwnerAdd($email, $name, $ticket_id)
|
public function changeOwnerAdd($email, $name, $ticket_id)
|
||||||
@@ -2092,9 +2126,9 @@ class TicketController extends Controller
|
|||||||
$email = $email;
|
$email = $email;
|
||||||
$ticket_id = $ticket_id;
|
$ticket_id = $ticket_id;
|
||||||
$validator = \Validator::make(
|
$validator = \Validator::make(
|
||||||
['email' => $email,
|
['email' => $email,
|
||||||
'name' => $name, ],
|
'name' => $name, ],
|
||||||
['email' => 'required|email',
|
['email' => 'required|email',
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
$user = User::where('email', '=', $email)->first();
|
$user = User::where('email', '=', $email)->first();
|
||||||
@@ -2216,12 +2250,12 @@ class TicketController extends Controller
|
|||||||
->update(['status' => 3]);
|
->update(['status' => 3]);
|
||||||
//event has $p_id and $value
|
//event has $p_id and $value
|
||||||
event('ticket.merge', [['parent' => $p_id, 'child' => $value]]);
|
event('ticket.merge', [['parent' => $p_id, 'child' => $value]]);
|
||||||
if (! empty(Input::get('reason'))) {
|
if (!empty(Input::get('reason'))) {
|
||||||
$reason = Input::get('reason');
|
$reason = Input::get('reason');
|
||||||
} else {
|
} else {
|
||||||
$reason = Lang::get('lang.no-reason');
|
$reason = Lang::get('lang.no-reason');
|
||||||
}
|
}
|
||||||
if (! empty(Input::get('title'))) {
|
if (!empty(Input::get('title'))) {
|
||||||
Ticket_Thread::where('ticket_id', '=', $p_id)->first()
|
Ticket_Thread::where('ticket_id', '=', $p_id)->first()
|
||||||
->update(['title' => Input::get('title')]);
|
->update(['title' => Input::get('title')]);
|
||||||
}
|
}
|
||||||
@@ -2271,6 +2305,7 @@ class TicketController extends Controller
|
|||||||
*@category function to call and show ticket details in tool tip via ajax
|
*@category function to call and show ticket details in tool tip via ajax
|
||||||
*
|
*
|
||||||
*@param null
|
*@param null
|
||||||
|
*
|
||||||
*@return string //script to load tooltip data
|
*@return string //script to load tooltip data
|
||||||
*/
|
*/
|
||||||
public static function tooltip($ticketid)
|
public static function tooltip($ticketid)
|
||||||
@@ -2358,6 +2393,7 @@ class TicketController extends Controller
|
|||||||
* @category function to chech if user verifcaition required for creating tickets or not
|
* @category function to chech if user verifcaition required for creating tickets or not
|
||||||
*
|
*
|
||||||
* @param null
|
* @param null
|
||||||
|
*
|
||||||
* @return int 0/1
|
* @return int 0/1
|
||||||
*/
|
*/
|
||||||
public function checkUserVerificationStatus()
|
public function checkUserVerificationStatus()
|
||||||
@@ -2391,7 +2427,7 @@ class TicketController extends Controller
|
|||||||
->where('ticket_thread.id', $threadid)
|
->where('ticket_thread.id', $threadid)
|
||||||
->first();
|
->first();
|
||||||
//dd($thread);
|
//dd($thread);
|
||||||
if (! $thread) {
|
if (!$thread) {
|
||||||
throw new Exception('Sorry we can not find your request');
|
throw new Exception('Sorry we can not find your request');
|
||||||
}
|
}
|
||||||
$company = \App\Model\helpdesk\Settings\Company::where('id', '=', '1')->first();
|
$company = \App\Model\helpdesk\Settings\Company::where('id', '=', '1')->first();
|
||||||
@@ -2613,6 +2649,7 @@ class TicketController extends Controller
|
|||||||
*@category function to send notification of ticket merging to the owners
|
*@category function to send notification of ticket merging to the owners
|
||||||
*
|
*
|
||||||
*@param srting array $t_id, $p_id
|
*@param srting array $t_id, $p_id
|
||||||
|
*
|
||||||
*@return null
|
*@return null
|
||||||
*/
|
*/
|
||||||
public function sendMergeNotification($p_id, $t_id)
|
public function sendMergeNotification($p_id, $t_id)
|
||||||
@@ -2673,7 +2710,8 @@ class TicketController extends Controller
|
|||||||
/**
|
/**
|
||||||
* chumper's function to return data to chumper datatable.
|
* chumper's function to return data to chumper datatable.
|
||||||
*
|
*
|
||||||
* @param array-object $tickets
|
* @param array-object $tickets
|
||||||
|
*
|
||||||
* @return array-object
|
* @return array-object
|
||||||
*/
|
*/
|
||||||
public static function genreateTableJson($tickets)
|
public static function genreateTableJson($tickets)
|
||||||
|
@@ -180,9 +180,10 @@ class TicketWorkflowController extends Controller
|
|||||||
/**
|
/**
|
||||||
* function to check the rules applied to the ticket workflow.
|
* function to check the rules applied to the ticket workflow.
|
||||||
*
|
*
|
||||||
* @param type $to_check
|
* @param type $to_check
|
||||||
* @param type $condition
|
* @param type $condition
|
||||||
* @param type $statement
|
* @param type $statement
|
||||||
|
*
|
||||||
* @return type boolean
|
* @return type boolean
|
||||||
*/
|
*/
|
||||||
public function checkRuleCondition($to_check, $condition, $statement)
|
public function checkRuleCondition($to_check, $condition, $statement)
|
||||||
@@ -211,8 +212,9 @@ class TicketWorkflowController extends Controller
|
|||||||
/**
|
/**
|
||||||
* function to check if the equal functions are applied.
|
* function to check if the equal functions are applied.
|
||||||
*
|
*
|
||||||
* @param type $statement
|
* @param type $statement
|
||||||
* @param type $to_check
|
* @param type $to_check
|
||||||
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function checkEqual($statement, $to_check)
|
public function checkEqual($statement, $to_check)
|
||||||
@@ -227,8 +229,9 @@ class TicketWorkflowController extends Controller
|
|||||||
/**
|
/**
|
||||||
* function to check if the not-equal functions are applied.
|
* function to check if the not-equal functions are applied.
|
||||||
*
|
*
|
||||||
* @param type $statement
|
* @param type $statement
|
||||||
* @param type $to_check
|
* @param type $to_check
|
||||||
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function checkNotEqual($statement, $to_check)
|
public function checkNotEqual($statement, $to_check)
|
||||||
@@ -243,8 +246,9 @@ class TicketWorkflowController extends Controller
|
|||||||
/**
|
/**
|
||||||
* function to check if the contains functions are applied.
|
* function to check if the contains functions are applied.
|
||||||
*
|
*
|
||||||
* @param type $statement
|
* @param type $statement
|
||||||
* @param type $to_check
|
* @param type $to_check
|
||||||
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function checkContains($statement, $to_check)
|
public function checkContains($statement, $to_check)
|
||||||
@@ -259,8 +263,9 @@ class TicketWorkflowController extends Controller
|
|||||||
/**
|
/**
|
||||||
* function to check if the do not contain functions are applied.
|
* function to check if the do not contain functions are applied.
|
||||||
*
|
*
|
||||||
* @param type $statement
|
* @param type $statement
|
||||||
* @param type $to_check
|
* @param type $to_check
|
||||||
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function checkDoNotContain($statement, $to_check)
|
public function checkDoNotContain($statement, $to_check)
|
||||||
@@ -275,8 +280,9 @@ class TicketWorkflowController extends Controller
|
|||||||
/**
|
/**
|
||||||
* function to check if the start functions are applied.
|
* function to check if the start functions are applied.
|
||||||
*
|
*
|
||||||
* @param type $statement
|
* @param type $statement
|
||||||
* @param type $to_check
|
* @param type $to_check
|
||||||
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function checkStarts($statement, $to_check)
|
public function checkStarts($statement, $to_check)
|
||||||
@@ -291,8 +297,9 @@ class TicketWorkflowController extends Controller
|
|||||||
/**
|
/**
|
||||||
* function to check if the ends functions are applied.
|
* function to check if the ends functions are applied.
|
||||||
*
|
*
|
||||||
* @param type $statement
|
* @param type $statement
|
||||||
* @param type $to_check
|
* @param type $to_check
|
||||||
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function checkEnds($statement, $to_check)
|
public function checkEnds($statement, $to_check)
|
||||||
@@ -318,8 +325,9 @@ class TicketWorkflowController extends Controller
|
|||||||
/**
|
/**
|
||||||
* function to apply the action to a ticket.
|
* function to apply the action to a ticket.
|
||||||
*
|
*
|
||||||
* @param type $workflow_id
|
* @param type $workflow_id
|
||||||
* @param type $ticket_settings_details
|
* @param type $ticket_settings_details
|
||||||
|
*
|
||||||
* @return type array
|
* @return type array
|
||||||
*/
|
*/
|
||||||
public function applyActionCondition($workflow_id, $ticket_settings_details)
|
public function applyActionCondition($workflow_id, $ticket_settings_details)
|
||||||
@@ -351,7 +359,8 @@ class TicketWorkflowController extends Controller
|
|||||||
/**
|
/**
|
||||||
* function to reject ticket.
|
* function to reject ticket.
|
||||||
*
|
*
|
||||||
* @param array $ticket_settings_details
|
* @param array $ticket_settings_details
|
||||||
|
*
|
||||||
* @return type array
|
* @return type array
|
||||||
*/
|
*/
|
||||||
public function rejectTicket($ticket_settings_details)
|
public function rejectTicket($ticket_settings_details)
|
||||||
@@ -364,8 +373,9 @@ class TicketWorkflowController extends Controller
|
|||||||
/**
|
/**
|
||||||
* function to change the department of a ticket.
|
* function to change the department of a ticket.
|
||||||
*
|
*
|
||||||
* @param type $workflow_action
|
* @param type $workflow_action
|
||||||
* @param type $ticket_settings_details
|
* @param type $ticket_settings_details
|
||||||
|
*
|
||||||
* @return type array
|
* @return type array
|
||||||
*/
|
*/
|
||||||
public function changeDepartment($workflow_action, $ticket_settings_details)
|
public function changeDepartment($workflow_action, $ticket_settings_details)
|
||||||
@@ -383,8 +393,9 @@ class TicketWorkflowController extends Controller
|
|||||||
/**
|
/**
|
||||||
* function to change the priority of a ticket.
|
* function to change the priority of a ticket.
|
||||||
*
|
*
|
||||||
* @param type $workflow_action
|
* @param type $workflow_action
|
||||||
* @param type $ticket_settings_details
|
* @param type $ticket_settings_details
|
||||||
|
*
|
||||||
* @return type array
|
* @return type array
|
||||||
*/
|
*/
|
||||||
public function changePriority($workflow_action, $ticket_settings_details)
|
public function changePriority($workflow_action, $ticket_settings_details)
|
||||||
@@ -402,8 +413,9 @@ class TicketWorkflowController extends Controller
|
|||||||
/**
|
/**
|
||||||
* function to change the SLA of a ticket.
|
* function to change the SLA of a ticket.
|
||||||
*
|
*
|
||||||
* @param type $workflow_action
|
* @param type $workflow_action
|
||||||
* @param type $ticket_settings_details
|
* @param type $ticket_settings_details
|
||||||
|
*
|
||||||
* @return type array
|
* @return type array
|
||||||
*/
|
*/
|
||||||
public function changeSla($workflow_action, $ticket_settings_details)
|
public function changeSla($workflow_action, $ticket_settings_details)
|
||||||
@@ -421,8 +433,9 @@ class TicketWorkflowController extends Controller
|
|||||||
/**
|
/**
|
||||||
* function to assign tean to a ticket.
|
* function to assign tean to a ticket.
|
||||||
*
|
*
|
||||||
* @param type $workflow_action
|
* @param type $workflow_action
|
||||||
* @param type $ticket_settings_details
|
* @param type $ticket_settings_details
|
||||||
|
*
|
||||||
* @return type array
|
* @return type array
|
||||||
*/
|
*/
|
||||||
public function changeTeam($workflow_action, $ticket_settings_details)
|
public function changeTeam($workflow_action, $ticket_settings_details)
|
||||||
@@ -440,8 +453,9 @@ class TicketWorkflowController extends Controller
|
|||||||
/**
|
/**
|
||||||
* function to assing a ticket to an agent.
|
* function to assing a ticket to an agent.
|
||||||
*
|
*
|
||||||
* @param type $workflow_action
|
* @param type $workflow_action
|
||||||
* @param type $ticket_settings_details
|
* @param type $ticket_settings_details
|
||||||
|
*
|
||||||
* @return type array
|
* @return type array
|
||||||
*/
|
*/
|
||||||
public function changeAgent($workflow_action, $ticket_settings_details)
|
public function changeAgent($workflow_action, $ticket_settings_details)
|
||||||
@@ -459,8 +473,9 @@ class TicketWorkflowController extends Controller
|
|||||||
/**
|
/**
|
||||||
* function to change the helptopic of a ticket.
|
* function to change the helptopic of a ticket.
|
||||||
*
|
*
|
||||||
* @param type $workflow_action
|
* @param type $workflow_action
|
||||||
* @param type $ticket_settings_details
|
* @param type $ticket_settings_details
|
||||||
|
*
|
||||||
* @return type array
|
* @return type array
|
||||||
*/
|
*/
|
||||||
public function changeHelptopic($workflow_action, $ticket_settings_details)
|
public function changeHelptopic($workflow_action, $ticket_settings_details)
|
||||||
@@ -478,8 +493,9 @@ class TicketWorkflowController extends Controller
|
|||||||
/**
|
/**
|
||||||
* function to change the status of a ticket.
|
* function to change the status of a ticket.
|
||||||
*
|
*
|
||||||
* @param type $workflow_action
|
* @param type $workflow_action
|
||||||
* @param type $ticket_settings_details
|
* @param type $ticket_settings_details
|
||||||
|
*
|
||||||
* @return type array
|
* @return type array
|
||||||
*/
|
*/
|
||||||
public function changeStatus($workflow_action, $ticket_settings_details)
|
public function changeStatus($workflow_action, $ticket_settings_details)
|
||||||
|
@@ -73,6 +73,7 @@ class UserController extends Controller
|
|||||||
* Display all list of the users.
|
* Display all list of the users.
|
||||||
*
|
*
|
||||||
* @param type User $user
|
* @param type User $user
|
||||||
|
*
|
||||||
* @return type view
|
* @return type view
|
||||||
*/
|
*/
|
||||||
public function index()
|
public function index()
|
||||||
@@ -271,6 +272,7 @@ class UserController extends Controller
|
|||||||
*
|
*
|
||||||
* @param type User $user
|
* @param type User $user
|
||||||
* @param type Sys_userRequest $request
|
* @param type Sys_userRequest $request
|
||||||
|
*
|
||||||
* @return type redirect
|
* @return type redirect
|
||||||
*/
|
*/
|
||||||
public function store(User $user, Sys_userRequest $request)
|
public function store(User $user, Sys_userRequest $request)
|
||||||
@@ -304,7 +306,7 @@ class UserController extends Controller
|
|||||||
return redirect()->back()->with(['fails' => Lang::get('lang.country-code-required-error'), 'country_code_error' => 1])->withInput();
|
return redirect()->back()->with(['fails' => Lang::get('lang.country-code-required-error'), 'country_code_error' => 1])->withInput();
|
||||||
} else {
|
} else {
|
||||||
$code = CountryCode::select('phonecode')->where('phonecode', '=', $request->get('country_code'))->get();
|
$code = CountryCode::select('phonecode')->where('phonecode', '=', $request->get('country_code'))->get();
|
||||||
if (! count($code)) {
|
if (!count($code)) {
|
||||||
return redirect()->back()->with(['fails' => Lang::get('lang.incorrect-country-code-error'), 'country_code_error' => 1])->withInput();
|
return redirect()->back()->with(['fails' => Lang::get('lang.incorrect-country-code-error'), 'country_code_error' => 1])->withInput();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -349,6 +351,7 @@ class UserController extends Controller
|
|||||||
*
|
*
|
||||||
* @param type int $id
|
* @param type int $id
|
||||||
* @param type User $user
|
* @param type User $user
|
||||||
|
*
|
||||||
* @return type view
|
* @return type view
|
||||||
*/
|
*/
|
||||||
public function randomPassword()
|
public function randomPassword()
|
||||||
@@ -374,6 +377,7 @@ class UserController extends Controller
|
|||||||
*
|
*
|
||||||
* @param type int $id
|
* @param type int $id
|
||||||
* @param type User $user
|
* @param type User $user
|
||||||
|
*
|
||||||
* @return type view
|
* @return type view
|
||||||
*/
|
*/
|
||||||
public function randomPostPassword($id, ChangepasswordRequest $request)
|
public function randomPostPassword($id, ChangepasswordRequest $request)
|
||||||
@@ -397,8 +401,9 @@ class UserController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param type $id
|
* @param type $id
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
|
*
|
||||||
* @return type
|
* @return type
|
||||||
*/
|
*/
|
||||||
public function changeRoleAdmin($id, Request $request)
|
public function changeRoleAdmin($id, Request $request)
|
||||||
@@ -418,8 +423,9 @@ class UserController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param type $id
|
* @param type $id
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
|
*
|
||||||
* @return type
|
* @return type
|
||||||
*/
|
*/
|
||||||
public function changeRoleAgent($id, Request $request)
|
public function changeRoleAgent($id, Request $request)
|
||||||
@@ -439,7 +445,8 @@ class UserController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param type $id
|
* @param type $id
|
||||||
|
*
|
||||||
* @return type
|
* @return type
|
||||||
*/
|
*/
|
||||||
public function changeRoleUser($id)
|
public function changeRoleUser($id)
|
||||||
@@ -465,7 +472,8 @@ class UserController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param type $id
|
* @param type $id
|
||||||
|
*
|
||||||
* @return type
|
* @return type
|
||||||
*/
|
*/
|
||||||
public function deleteAgent($id)
|
public function deleteAgent($id)
|
||||||
@@ -601,6 +609,7 @@ class UserController extends Controller
|
|||||||
*
|
*
|
||||||
* @param type int $id
|
* @param type int $id
|
||||||
* @param type User $user
|
* @param type User $user
|
||||||
|
*
|
||||||
* @return type view
|
* @return type view
|
||||||
*/
|
*/
|
||||||
public function show($id)
|
public function show($id)
|
||||||
@@ -624,6 +633,7 @@ class UserController extends Controller
|
|||||||
*
|
*
|
||||||
* @param type int $id
|
* @param type int $id
|
||||||
* @param type User $user
|
* @param type User $user
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function edit($id, CountryCode $code)
|
public function edit($id, CountryCode $code)
|
||||||
@@ -658,6 +668,7 @@ class UserController extends Controller
|
|||||||
* @param type int $id
|
* @param type int $id
|
||||||
* @param type User $user
|
* @param type User $user
|
||||||
* @param type Sys_userUpdate $request
|
* @param type Sys_userUpdate $request
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function update($id, Sys_userUpdate $request)
|
public function update($id, Sys_userUpdate $request)
|
||||||
@@ -672,7 +683,7 @@ class UserController extends Controller
|
|||||||
return redirect()->back()->with(['fails' => Lang::get('lang.country-code-required-error'), 'country_code_error' => 1])->withInput();
|
return redirect()->back()->with(['fails' => Lang::get('lang.country-code-required-error'), 'country_code_error' => 1])->withInput();
|
||||||
} else {
|
} else {
|
||||||
$code = CountryCode::select('phonecode')->where('phonecode', '=', $request->get('country_code'))->get();
|
$code = CountryCode::select('phonecode')->where('phonecode', '=', $request->get('country_code'))->get();
|
||||||
if (! count($code)) {
|
if (!count($code)) {
|
||||||
return redirect()->back()->with(['fails' => Lang::get('lang.incorrect-country-code-error'), 'country_code_error' => 1])->withInput();
|
return redirect()->back()->with(['fails' => Lang::get('lang.incorrect-country-code-error'), 'country_code_error' => 1])->withInput();
|
||||||
} else {
|
} else {
|
||||||
$users->country_code = $request->country_code;
|
$users->country_code = $request->country_code;
|
||||||
@@ -726,7 +737,7 @@ class UserController extends Controller
|
|||||||
try {
|
try {
|
||||||
return view('themes.default1.agent.helpdesk.user.profile-edit', compact('user'))
|
return view('themes.default1.agent.helpdesk.user.profile-edit', compact('user'))
|
||||||
->with(['phonecode' => $phonecode->phonecode,
|
->with(['phonecode' => $phonecode->phonecode,
|
||||||
'verify' => $status, ]);
|
'verify' => $status, ]);
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
return redirect()->back()->with('fails', $e->getMessage());
|
return redirect()->back()->with('fails', $e->getMessage());
|
||||||
}
|
}
|
||||||
@@ -737,6 +748,7 @@ class UserController extends Controller
|
|||||||
*
|
*
|
||||||
* @param type int $id
|
* @param type int $id
|
||||||
* @param type ProfileRequest $request
|
* @param type ProfileRequest $request
|
||||||
|
*
|
||||||
* @return type Redirect
|
* @return type Redirect
|
||||||
*/
|
*/
|
||||||
public function postProfileedit(ProfileRequest $request)
|
public function postProfileedit(ProfileRequest $request)
|
||||||
@@ -748,7 +760,7 @@ class UserController extends Controller
|
|||||||
return redirect()->back()->with(['fails' => Lang::get('lang.country-code-required-error'), 'country_code_error' => 1])->withInput();
|
return redirect()->back()->with(['fails' => Lang::get('lang.country-code-required-error'), 'country_code_error' => 1])->withInput();
|
||||||
} else {
|
} else {
|
||||||
$code = CountryCode::select('phonecode')->where('phonecode', '=', $request->get('country_code'))->get();
|
$code = CountryCode::select('phonecode')->where('phonecode', '=', $request->get('country_code'))->get();
|
||||||
if (! count($code)) {
|
if (!count($code)) {
|
||||||
return redirect()->back()->with(['fails' => Lang::get('lang.incorrect-country-code-error'), 'country_code_error' => 1])->withInput();
|
return redirect()->back()->with(['fails' => Lang::get('lang.incorrect-country-code-error'), 'country_code_error' => 1])->withInput();
|
||||||
}
|
}
|
||||||
$user->country_code = $request->country_code;
|
$user->country_code = $request->country_code;
|
||||||
@@ -790,6 +802,7 @@ class UserController extends Controller
|
|||||||
*
|
*
|
||||||
* @param type int $id
|
* @param type int $id
|
||||||
* @param type ProfilePassword $request
|
* @param type ProfilePassword $request
|
||||||
|
*
|
||||||
* @return type Redirect
|
* @return type Redirect
|
||||||
*/
|
*/
|
||||||
public function postProfilePassword($id, ProfilePassword $request)
|
public function postProfilePassword($id, ProfilePassword $request)
|
||||||
@@ -815,7 +828,8 @@ class UserController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Assigning an user to an organization.
|
* Assigning an user to an organization.
|
||||||
*
|
*
|
||||||
* @param type $id
|
* @param type $id
|
||||||
|
*
|
||||||
* @return type boolean
|
* @return type boolean
|
||||||
*/
|
*/
|
||||||
public function UserAssignOrg($id)
|
public function UserAssignOrg($id)
|
||||||
@@ -882,7 +896,8 @@ class UserController extends Controller
|
|||||||
/**
|
/**
|
||||||
* creating an organization in user profile page via modal popup.
|
* creating an organization in user profile page via modal popup.
|
||||||
*
|
*
|
||||||
* @param type $id
|
* @param type $id
|
||||||
|
*
|
||||||
* @return type
|
* @return type
|
||||||
*/
|
*/
|
||||||
public function User_Create_Org($id)
|
public function User_Create_Org($id)
|
||||||
@@ -925,7 +940,8 @@ class UserController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Generate a random string for password.
|
* Generate a random string for password.
|
||||||
*
|
*
|
||||||
* @param type $length
|
* @param type $length
|
||||||
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function generateRandomString($length = 10)
|
public function generateRandomString($length = 10)
|
||||||
@@ -953,7 +969,7 @@ class UserController extends Controller
|
|||||||
}
|
}
|
||||||
$org_relations->create([
|
$org_relations->create([
|
||||||
'user_id' => $userid,
|
'user_id' => $userid,
|
||||||
'org_id' => $orgid,
|
'org_id' => $orgid,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1029,7 +1045,7 @@ class UserController extends Controller
|
|||||||
->first();
|
->first();
|
||||||
if ($otp != null) {
|
if ($otp != null) {
|
||||||
$otp_length = strlen(Input::get('otp'));
|
$otp_length = strlen(Input::get('otp'));
|
||||||
if (($otp_length == 6 && ! preg_match('/[a-z]/i', Input::get('otp')))) {
|
if (($otp_length == 6 && !preg_match('/[a-z]/i', Input::get('otp')))) {
|
||||||
$otp2 = Hash::make(Input::get('otp'));
|
$otp2 = Hash::make(Input::get('otp'));
|
||||||
$date1 = date_format($otp->updated_at, 'Y-m-d h:i:sa');
|
$date1 = date_format($otp->updated_at, 'Y-m-d h:i:sa');
|
||||||
$date2 = date('Y-m-d h:i:sa');
|
$date2 = date('Y-m-d h:i:sa');
|
||||||
|
@@ -129,6 +129,7 @@ class ArticleController extends Controller
|
|||||||
* Creating a Article.
|
* Creating a Article.
|
||||||
*
|
*
|
||||||
* @param type Category $category
|
* @param type Category $category
|
||||||
|
*
|
||||||
* @return type view
|
* @return type view
|
||||||
*/
|
*/
|
||||||
public function create(Category $category)
|
public function create(Category $category)
|
||||||
@@ -148,6 +149,7 @@ class ArticleController extends Controller
|
|||||||
*
|
*
|
||||||
* @param type Article $article
|
* @param type Article $article
|
||||||
* @param type ArticleRequest $request
|
* @param type ArticleRequest $request
|
||||||
|
*
|
||||||
* @return type redirect
|
* @return type redirect
|
||||||
*/
|
*/
|
||||||
public function store(Article $article, ArticleRequest $request)
|
public function store(Article $article, ArticleRequest $request)
|
||||||
@@ -184,6 +186,7 @@ class ArticleController extends Controller
|
|||||||
* @param type Article $article
|
* @param type Article $article
|
||||||
* @param type Relationship $relation
|
* @param type Relationship $relation
|
||||||
* @param type Category $category
|
* @param type Category $category
|
||||||
|
*
|
||||||
* @return view
|
* @return view
|
||||||
*/
|
*/
|
||||||
public function edit($slug)
|
public function edit($slug)
|
||||||
@@ -215,6 +218,7 @@ class ArticleController extends Controller
|
|||||||
* @param type Article $article
|
* @param type Article $article
|
||||||
* @param type Relationship $relation
|
* @param type Relationship $relation
|
||||||
* @param type ArticleRequest $request
|
* @param type ArticleRequest $request
|
||||||
|
*
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function update($slug, ArticleUpdate $request)
|
public function update($slug, ArticleUpdate $request)
|
||||||
@@ -256,8 +260,9 @@ class ArticleController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Delete an Agent by id.
|
* Delete an Agent by id.
|
||||||
*
|
*
|
||||||
* @param type $id
|
* @param type $id
|
||||||
* @param type Article $article
|
* @param type Article $article
|
||||||
|
*
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function destroy($slug, Article $article, Relationship $relation, Comment $comment)
|
public function destroy($slug, Article $article, Relationship $relation, Comment $comment)
|
||||||
@@ -291,7 +296,8 @@ class ArticleController extends Controller
|
|||||||
* user time zone
|
* user time zone
|
||||||
* fetching timezone.
|
* fetching timezone.
|
||||||
*
|
*
|
||||||
* @param type $utc
|
* @param type $utc
|
||||||
|
*
|
||||||
* @return type
|
* @return type
|
||||||
*/
|
*/
|
||||||
public static function usertimezone($utc)
|
public static function usertimezone($utc)
|
||||||
|
@@ -48,6 +48,7 @@ class CategoryController extends Controller
|
|||||||
* Indexing all Category.
|
* Indexing all Category.
|
||||||
*
|
*
|
||||||
* @param type Category $category
|
* @param type Category $category
|
||||||
|
*
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function index()
|
public function index()
|
||||||
@@ -115,6 +116,7 @@ class CategoryController extends Controller
|
|||||||
* Create a Category.
|
* Create a Category.
|
||||||
*
|
*
|
||||||
* @param type Category $category
|
* @param type Category $category
|
||||||
|
*
|
||||||
* @return type view
|
* @return type view
|
||||||
*/
|
*/
|
||||||
public function create(Category $category)
|
public function create(Category $category)
|
||||||
@@ -135,6 +137,7 @@ class CategoryController extends Controller
|
|||||||
*
|
*
|
||||||
* @param type Category $category
|
* @param type Category $category
|
||||||
* @param type CategoryRequest $request
|
* @param type CategoryRequest $request
|
||||||
|
*
|
||||||
* @return type Redirect
|
* @return type Redirect
|
||||||
*/
|
*/
|
||||||
public function store(Category $category, CategoryRequest $request)
|
public function store(Category $category, CategoryRequest $request)
|
||||||
@@ -156,8 +159,9 @@ class CategoryController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Show the form for editing the specified category.
|
* Show the form for editing the specified category.
|
||||||
*
|
*
|
||||||
* @param type $slug
|
* @param type $slug
|
||||||
* @param type Category $category
|
* @param type Category $category
|
||||||
|
*
|
||||||
* @return type view
|
* @return type view
|
||||||
*/
|
*/
|
||||||
public function edit($id)
|
public function edit($id)
|
||||||
@@ -172,9 +176,10 @@ class CategoryController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Update the specified Category in storage.
|
* Update the specified Category in storage.
|
||||||
*
|
*
|
||||||
* @param type $slug
|
* @param type $slug
|
||||||
* @param type Category $category
|
* @param type Category $category
|
||||||
* @param type CategoryUpdate $request
|
* @param type CategoryUpdate $request
|
||||||
|
*
|
||||||
* @return type redirect
|
* @return type redirect
|
||||||
*/
|
*/
|
||||||
public function update($id, CategoryRequest $request)
|
public function update($id, CategoryRequest $request)
|
||||||
@@ -200,9 +205,10 @@ class CategoryController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Remove the specified category from storage.
|
* Remove the specified category from storage.
|
||||||
*
|
*
|
||||||
* @param type $id
|
* @param type $id
|
||||||
* @param type Category $category
|
* @param type Category $category
|
||||||
* @param type Relationship $relation
|
* @param type Relationship $relation
|
||||||
|
*
|
||||||
* @return type Redirect
|
* @return type Redirect
|
||||||
*/
|
*/
|
||||||
public function destroy($id, Category $category, Relationship $relation)
|
public function destroy($id, Category $category, Relationship $relation)
|
||||||
|
@@ -122,6 +122,7 @@ class PageController extends Controller
|
|||||||
* To insert a value to the table Page.
|
* To insert a value to the table Page.
|
||||||
*
|
*
|
||||||
* @param type Request $request
|
* @param type Request $request
|
||||||
|
*
|
||||||
* @return type
|
* @return type
|
||||||
*/
|
*/
|
||||||
public function store(PageRequest $request)
|
public function store(PageRequest $request)
|
||||||
@@ -142,7 +143,8 @@ class PageController extends Controller
|
|||||||
/**
|
/**
|
||||||
* To edit a page.
|
* To edit a page.
|
||||||
*
|
*
|
||||||
* @param type $slug
|
* @param type $slug
|
||||||
|
*
|
||||||
* @return type view
|
* @return type view
|
||||||
*/
|
*/
|
||||||
public function edit($slug)
|
public function edit($slug)
|
||||||
@@ -159,8 +161,9 @@ class PageController extends Controller
|
|||||||
/**
|
/**
|
||||||
* To update a page.
|
* To update a page.
|
||||||
*
|
*
|
||||||
* @param type $slug
|
* @param type $slug
|
||||||
* @param type PageUpdate $request
|
* @param type PageUpdate $request
|
||||||
|
*
|
||||||
* @return type redirect
|
* @return type redirect
|
||||||
*/
|
*/
|
||||||
public function update($slug, PageRequest $request)
|
public function update($slug, PageRequest $request)
|
||||||
@@ -184,7 +187,8 @@ class PageController extends Controller
|
|||||||
/**
|
/**
|
||||||
* To Delete a Page.
|
* To Delete a Page.
|
||||||
*
|
*
|
||||||
* @param type $id
|
* @param type $id
|
||||||
|
*
|
||||||
* @return type redirect
|
* @return type redirect
|
||||||
*/
|
*/
|
||||||
public function destroy($id)
|
public function destroy($id)
|
||||||
|
@@ -63,7 +63,8 @@ class SettingsController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Update the specified resource in storage.
|
* Update the specified resource in storage.
|
||||||
*
|
*
|
||||||
* @param int $id
|
* @param int $id
|
||||||
|
*
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function postSettings($id, Settings $settings, SettingsRequests $request)
|
public function postSettings($id, Settings $settings, SettingsRequests $request)
|
||||||
@@ -80,8 +81,8 @@ class SettingsController extends Controller
|
|||||||
$settings->logo = $fileName;
|
$settings->logo = $fileName;
|
||||||
//$thDestinationPath = 'dist/th';
|
//$thDestinationPath = 'dist/th';
|
||||||
Image::make($destinationPath.'/'.$fileName, [
|
Image::make($destinationPath.'/'.$fileName, [
|
||||||
'width' => 300,
|
'width' => 300,
|
||||||
'height' => 300,
|
'height' => 300,
|
||||||
'grayscale' => false,
|
'grayscale' => false,
|
||||||
])->save('lb-faveo/dist/image/'.$fileName);
|
])->save('lb-faveo/dist/image/'.$fileName);
|
||||||
}
|
}
|
||||||
@@ -94,8 +95,8 @@ class SettingsController extends Controller
|
|||||||
$settings->background = $fileName;
|
$settings->background = $fileName;
|
||||||
//$thDestinationPath = 'dist/th';
|
//$thDestinationPath = 'dist/th';
|
||||||
Image::make($destinationPath.'/'.$fileName, [
|
Image::make($destinationPath.'/'.$fileName, [
|
||||||
'width' => 300,
|
'width' => 300,
|
||||||
'height' => 300,
|
'height' => 300,
|
||||||
'grayscale' => false,
|
'grayscale' => false,
|
||||||
])->save('lb-faveo/dist/image/'.$fileName);
|
])->save('lb-faveo/dist/image/'.$fileName);
|
||||||
}
|
}
|
||||||
@@ -117,6 +118,7 @@ class SettingsController extends Controller
|
|||||||
* To Moderate the commenting.
|
* To Moderate the commenting.
|
||||||
*
|
*
|
||||||
* @param type Comment $comment
|
* @param type Comment $comment
|
||||||
|
*
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function comment(Comment $comment)
|
public function comment(Comment $comment)
|
||||||
@@ -165,8 +167,9 @@ class SettingsController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Admin can publish the comment.
|
* Admin can publish the comment.
|
||||||
*
|
*
|
||||||
* @param type $id
|
* @param type $id
|
||||||
* @param type Comment $comment
|
* @param type Comment $comment
|
||||||
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function publish($id, Comment $comment)
|
public function publish($id, Comment $comment)
|
||||||
@@ -183,8 +186,9 @@ class SettingsController extends Controller
|
|||||||
/**
|
/**
|
||||||
* delete the comment.
|
* delete the comment.
|
||||||
*
|
*
|
||||||
* @param type $id
|
* @param type $id
|
||||||
* @param type Comment $comment
|
* @param type Comment $comment
|
||||||
|
*
|
||||||
* @return type
|
* @return type
|
||||||
*/
|
*/
|
||||||
public function delete($id, Comment $comment)
|
public function delete($id, Comment $comment)
|
||||||
|
@@ -57,8 +57,9 @@ class AuthController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Create a new authentication controller instance.
|
* Create a new authentication controller instance.
|
||||||
*
|
*
|
||||||
* @param \Illuminate\Contracts\Auth\Guard $auth
|
* @param \Illuminate\Contracts\Auth\Guard $auth
|
||||||
* @param \Illuminate\Contracts\Auth\Registrar $registrar
|
* @param \Illuminate\Contracts\Auth\Registrar $registrar
|
||||||
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function __construct()
|
public function __construct()
|
||||||
@@ -94,21 +95,21 @@ class AuthController extends Controller
|
|||||||
if ($user->nickname) {
|
if ($user->nickname) {
|
||||||
$username = $user->nickname;
|
$username = $user->nickname;
|
||||||
}
|
}
|
||||||
if (! $first_name) {
|
if (!$first_name) {
|
||||||
$first_name = $username;
|
$first_name = $username;
|
||||||
}
|
}
|
||||||
$data = [
|
$data = [
|
||||||
'first_name' => $first_name,
|
'first_name' => $first_name,
|
||||||
'email' => $user->getEmail(),
|
'email' => $user->getEmail(),
|
||||||
'user_name' => $username,
|
'user_name' => $username,
|
||||||
'role' => 'user',
|
'role' => 'user',
|
||||||
'active' => 1,
|
'active' => 1,
|
||||||
];
|
];
|
||||||
$user = User::where('email', $data['email'])->first();
|
$user = User::where('email', $data['email'])->first();
|
||||||
if (! $user) {
|
if (!$user) {
|
||||||
$user = User::where('user_name', $data['user_name'])->first();
|
$user = User::where('user_name', $data['user_name'])->first();
|
||||||
}
|
}
|
||||||
if (! $user) {
|
if (!$user) {
|
||||||
$user = User::firstOrCreate($data);
|
$user = User::firstOrCreate($data);
|
||||||
}
|
}
|
||||||
Auth::login($user);
|
Auth::login($user);
|
||||||
@@ -148,6 +149,7 @@ class AuthController extends Controller
|
|||||||
*
|
*
|
||||||
* @param type User $user
|
* @param type User $user
|
||||||
* @param type RegisterRequest $request
|
* @param type RegisterRequest $request
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function postRegister(User $user, RegisterRequest $request, $api = false)
|
public function postRegister(User $user, RegisterRequest $request, $api = false)
|
||||||
@@ -164,12 +166,12 @@ class AuthController extends Controller
|
|||||||
} else {
|
} else {
|
||||||
$user->email = $request->input('email');
|
$user->email = $request->input('email');
|
||||||
}
|
}
|
||||||
if (! checkArray('mobile', $request_array)) {
|
if (!checkArray('mobile', $request_array)) {
|
||||||
$user->mobile = null;
|
$user->mobile = null;
|
||||||
} else {
|
} else {
|
||||||
$user->mobile = $request->input('mobile');
|
$user->mobile = $request->input('mobile');
|
||||||
}
|
}
|
||||||
if (! checkArray('code', $request_array)) {
|
if (!checkArray('code', $request_array)) {
|
||||||
$user->country_code = 0;
|
$user->country_code = 0;
|
||||||
} else {
|
} else {
|
||||||
$user->country_code = $request->input('code');
|
$user->country_code = $request->input('code');
|
||||||
@@ -225,7 +227,8 @@ class AuthController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Function to activate account.
|
* Function to activate account.
|
||||||
*
|
*
|
||||||
* @param type $token
|
* @param type $token
|
||||||
|
*
|
||||||
* @return type redirect
|
* @return type redirect
|
||||||
*/
|
*/
|
||||||
public function accountActivate($token)
|
public function accountActivate($token)
|
||||||
@@ -246,8 +249,9 @@ class AuthController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Get mail function.
|
* Get mail function.
|
||||||
*
|
*
|
||||||
* @param type $token
|
* @param type $token
|
||||||
* @param type User $user
|
* @param type User $user
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function getMail($token, User $user)
|
public function getMail($token, User $user)
|
||||||
@@ -290,6 +294,7 @@ class AuthController extends Controller
|
|||||||
* Post of login page.
|
* Post of login page.
|
||||||
*
|
*
|
||||||
* @param type LoginRequest $request
|
* @param type LoginRequest $request
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function postLogin(LoginRequest $request)
|
public function postLogin(LoginRequest $request)
|
||||||
@@ -316,15 +321,15 @@ class AuthController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
$check_active = User::where('email', '=', $request->input('email'))->orwhere('user_name', '=', $request->input('email'))->first();
|
$check_active = User::where('email', '=', $request->input('email'))->orwhere('user_name', '=', $request->input('email'))->first();
|
||||||
if (! $check_active) { //check if user exists or not
|
if (!$check_active) { //check if user exists or not
|
||||||
//if user deos not exist then return back with error that user is not registered
|
//if user deos not exist then return back with error that user is not registered
|
||||||
return redirect()->back()
|
return redirect()->back()
|
||||||
->withInput($request->only('email', 'remember'))
|
->withInput($request->only('email', 'remember'))
|
||||||
->withErrors([
|
->withErrors([
|
||||||
'email' => $this->getFailedLoginMessage(),
|
'email' => $this->getFailedLoginMessage(),
|
||||||
'password' => $this->getFailedLoginMessage(),
|
'password' => $this->getFailedLoginMessage(),
|
||||||
])->with(['error' => Lang::get('lang.not-registered'),
|
])->with(['error' => Lang::get('lang.not-registered'),
|
||||||
'referer' => $referer, ]);
|
'referer' => $referer, ]);
|
||||||
}
|
}
|
||||||
|
|
||||||
//if user exists
|
//if user exists
|
||||||
@@ -337,17 +342,17 @@ class AuthController extends Controller
|
|||||||
// plugin is installed
|
// plugin is installed
|
||||||
if ($sms->status == 1 || $sms->status === '1') { //check plugin is active or not
|
if ($sms->status == 1 || $sms->status === '1') { //check plugin is active or not
|
||||||
// plugin is active
|
// plugin is active
|
||||||
if (! $check_active->active) { //check account is active or not
|
if (!$check_active->active) { //check account is active or not
|
||||||
// account is not active show verify otp window
|
// account is not active show verify otp window
|
||||||
if ($check_active->mobile) { //check user has mobile or not
|
if ($check_active->mobile) { //check user has mobile or not
|
||||||
// user has mobile number return verify OTP screen
|
// user has mobile number return verify OTP screen
|
||||||
return \Redirect::route('otp-verification')
|
return \Redirect::route('otp-verification')
|
||||||
->withInput($request->input())
|
->withInput($request->input())
|
||||||
->with(['values' => $request->input(),
|
->with(['values' => $request->input(),
|
||||||
'referer' => $referer,
|
'referer' => $referer,
|
||||||
'name' => $check_active->first_name,
|
'name' => $check_active->first_name,
|
||||||
'number' => $check_active->mobile,
|
'number' => $check_active->mobile,
|
||||||
'code' => $check_active->country_code, ]);
|
'code' => $check_active->country_code, ]);
|
||||||
} else {
|
} else {
|
||||||
goto a; //attenmpt login (be careful while using goto statements)
|
goto a; //attenmpt login (be careful while using goto statements)
|
||||||
}
|
}
|
||||||
@@ -362,15 +367,15 @@ class AuthController extends Controller
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// setting is disabled
|
// setting is disabled
|
||||||
a: if (! $check_active->active) { //check account is active or not
|
a: if (!$check_active->active) { //check account is active or not
|
||||||
// if accoutn is not active return back with error message that account is inactive
|
// if accoutn is not active return back with error message that account is inactive
|
||||||
return redirect()->back()
|
return redirect()->back()
|
||||||
->withInput($request->only('email', 'remember'))
|
->withInput($request->only('email', 'remember'))
|
||||||
->withErrors([
|
->withErrors([
|
||||||
'email' => $this->getFailedLoginMessage(),
|
'email' => $this->getFailedLoginMessage(),
|
||||||
'password' => $this->getFailedLoginMessage(),
|
'password' => $this->getFailedLoginMessage(),
|
||||||
])->with(['error' => Lang::get('lang.this_account_is_currently_inactive'),
|
])->with(['error' => Lang::get('lang.this_account_is_currently_inactive'),
|
||||||
'referer' => $referer, ]);
|
'referer' => $referer, ]);
|
||||||
} else {
|
} else {
|
||||||
// try login
|
// try login
|
||||||
$loginAttempts = 1;
|
$loginAttempts = 1;
|
||||||
@@ -416,10 +421,10 @@ class AuthController extends Controller
|
|||||||
return redirect()->back()
|
return redirect()->back()
|
||||||
->withInput($request->only('email', 'remember'))
|
->withInput($request->only('email', 'remember'))
|
||||||
->withErrors([
|
->withErrors([
|
||||||
'email' => $this->getFailedLoginMessage(),
|
'email' => $this->getFailedLoginMessage(),
|
||||||
'password' => $this->getFailedLoginMessage(),
|
'password' => $this->getFailedLoginMessage(),
|
||||||
])->with(['error' => Lang::get('lang.invalid'),
|
])->with(['error' => Lang::get('lang.invalid'),
|
||||||
'referer' => $referer, ]);
|
'referer' => $referer, ]);
|
||||||
// Increment login attempts
|
// Increment login attempts
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
return redirect()->back()->with('fails', $e->getMessage());
|
return redirect()->back()->with('fails', $e->getMessage());
|
||||||
@@ -430,6 +435,7 @@ class AuthController extends Controller
|
|||||||
* Add login attempt.
|
* Add login attempt.
|
||||||
*
|
*
|
||||||
* @param type IPaddress $value
|
* @param type IPaddress $value
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function addLoginAttempt($value, $field)
|
public function addLoginAttempt($value, $field)
|
||||||
@@ -457,6 +463,7 @@ class AuthController extends Controller
|
|||||||
* Clear login attempt.
|
* Clear login attempt.
|
||||||
*
|
*
|
||||||
* @param type IPaddress $value
|
* @param type IPaddress $value
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function clearLoginAttempts($value, $field)
|
public function clearLoginAttempts($value, $field)
|
||||||
@@ -470,6 +477,7 @@ class AuthController extends Controller
|
|||||||
* Confiem IP.
|
* Confiem IP.
|
||||||
*
|
*
|
||||||
* @param type IPaddress $value
|
* @param type IPaddress $value
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function confirmIPAddress($value, $field)
|
public function confirmIPAddress($value, $field)
|
||||||
@@ -482,7 +490,7 @@ class AuthController extends Controller
|
|||||||
' FROM '.$table." WHERE IP = '$value' OR User = '$field'");
|
' FROM '.$table." WHERE IP = '$value' OR User = '$field'");
|
||||||
$data = $result;
|
$data = $result;
|
||||||
//Verify that at least one login attempt is in database
|
//Verify that at least one login attempt is in database
|
||||||
if (! $data) {
|
if (!$data) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if ($data[0]->Attempts >= $max_attempts) {
|
if ($data[0]->Attempts >= $max_attempts) {
|
||||||
@@ -512,6 +520,7 @@ class AuthController extends Controller
|
|||||||
* @category function to show verify OTP page
|
* @category function to show verify OTP page
|
||||||
*
|
*
|
||||||
* @param null
|
* @param null
|
||||||
|
*
|
||||||
* @return response|view
|
* @return response|view
|
||||||
*/
|
*/
|
||||||
public function getVerifyOTP()
|
public function getVerifyOTP()
|
||||||
@@ -527,6 +536,7 @@ class AuthController extends Controller
|
|||||||
* @category function to verify OTP
|
* @category function to verify OTP
|
||||||
*
|
*
|
||||||
* @param $request
|
* @param $request
|
||||||
|
*
|
||||||
* @return int|string
|
* @return int|string
|
||||||
*/
|
*/
|
||||||
public function verifyOTP(LoginRequest $request)
|
public function verifyOTP(LoginRequest $request)
|
||||||
@@ -534,13 +544,13 @@ class AuthController extends Controller
|
|||||||
$user = User::select('id', 'mobile', 'user_name')->where('email', '=', $request->input('email'))
|
$user = User::select('id', 'mobile', 'user_name')->where('email', '=', $request->input('email'))
|
||||||
->orWhere('user_name', '=', $request->input('email'))->first();
|
->orWhere('user_name', '=', $request->input('email'))->first();
|
||||||
$otp_length = strlen($request->input('otp'));
|
$otp_length = strlen($request->input('otp'));
|
||||||
if (! \Schema::hasTable('user_verification')) {
|
if (!\Schema::hasTable('user_verification')) {
|
||||||
$message = Lang::get('lang.opt-can-not-be-verified');
|
$message = Lang::get('lang.opt-can-not-be-verified');
|
||||||
} else {
|
} else {
|
||||||
$otp = Otp::select('otp', 'updated_at')->where('user_id', '=', $user->id)
|
$otp = Otp::select('otp', 'updated_at')->where('user_id', '=', $user->id)
|
||||||
->first();
|
->first();
|
||||||
if ($otp != null) {
|
if ($otp != null) {
|
||||||
if (($otp_length == 6 && ! preg_match('/[a-z]/i', $request->input('otp')))) {
|
if (($otp_length == 6 && !preg_match('/[a-z]/i', $request->input('otp')))) {
|
||||||
$otp2 = Hash::make($request->input('otp'));
|
$otp2 = Hash::make($request->input('otp'));
|
||||||
$date1 = date_format($otp->updated_at, 'Y-m-d h:i:sa');
|
$date1 = date_format($otp->updated_at, 'Y-m-d h:i:sa');
|
||||||
$date2 = date('Y-m-d h:i:sa');
|
$date2 = date('Y-m-d h:i:sa');
|
||||||
@@ -573,14 +583,14 @@ class AuthController extends Controller
|
|||||||
return \Redirect::route('otp-verification')
|
return \Redirect::route('otp-verification')
|
||||||
->withInput($request->input())
|
->withInput($request->input())
|
||||||
->with(['values' => $request->input(),
|
->with(['values' => $request->input(),
|
||||||
'number' => $user->mobile,
|
'number' => $user->mobile,
|
||||||
'name' => $user->user_name,
|
'name' => $user->user_name,
|
||||||
'fails' => $message, ]);
|
'fails' => $message, ]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function resendOTP(OtpVerifyRequest $request)
|
public function resendOTP(OtpVerifyRequest $request)
|
||||||
{
|
{
|
||||||
if (! \Schema::hasTable('user_verification') || ! \Schema::hasTable('sms')) {
|
if (!\Schema::hasTable('user_verification') || !\Schema::hasTable('sms')) {
|
||||||
$message = Lang::get('lang.opt-can-not-be-verified');
|
$message = Lang::get('lang.opt-can-not-be-verified');
|
||||||
|
|
||||||
return $message;
|
return $message;
|
||||||
@@ -601,7 +611,8 @@ class AuthController extends Controller
|
|||||||
/**
|
/**
|
||||||
* @category function to change ticket status when user verifies his account
|
* @category function to change ticket status when user verifies his account
|
||||||
*
|
*
|
||||||
* @param int $id => user_id
|
* @param int $id => user_id
|
||||||
|
*
|
||||||
* @return null
|
* @return null
|
||||||
*
|
*
|
||||||
* @author manish.verma@ladybirdweb.com
|
* @author manish.verma@ladybirdweb.com
|
||||||
|
@@ -40,7 +40,8 @@ class ForgotPasswordController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Send a reset link to the given user.
|
* Send a reset link to the given user.
|
||||||
*
|
*
|
||||||
* @param \Illuminate\Http\Request $request
|
* @param \Illuminate\Http\Request $request
|
||||||
|
*
|
||||||
* @return \Illuminate\Http\RedirectResponse
|
* @return \Illuminate\Http\RedirectResponse
|
||||||
*/
|
*/
|
||||||
public function sendResetLinkEmail(Request $request)
|
public function sendResetLinkEmail(Request $request)
|
||||||
@@ -70,10 +71,10 @@ class ForgotPasswordController extends Controller
|
|||||||
$name = $user->user_name;
|
$name = $user->user_name;
|
||||||
}
|
}
|
||||||
$value = [
|
$value = [
|
||||||
'url' => url('password/reset/'.$code),
|
'url' => url('password/reset/'.$code),
|
||||||
'name' => $name,
|
'name' => $name,
|
||||||
'mobile' => $user->mobile,
|
'mobile' => $user->mobile,
|
||||||
'code' => $user->country_code, ];
|
'code' => $user->country_code, ];
|
||||||
event('reset.password2', [$value]);
|
event('reset.password2', [$value]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -76,10 +76,10 @@ class PasswordController extends Controller
|
|||||||
$name = $user->user_name;
|
$name = $user->user_name;
|
||||||
}
|
}
|
||||||
$value = [
|
$value = [
|
||||||
'url' => url('password/reset/'.$code),
|
'url' => url('password/reset/'.$code),
|
||||||
'name' => $name,
|
'name' => $name,
|
||||||
'mobile' => $user->mobile,
|
'mobile' => $user->mobile,
|
||||||
'code' => $user->country_code, ];
|
'code' => $user->country_code, ];
|
||||||
event('reset.password2', [$value]);
|
event('reset.password2', [$value]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -95,7 +95,8 @@ class PasswordController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Reset the given user's password.
|
* Reset the given user's password.
|
||||||
*
|
*
|
||||||
* @param \Illuminate\Http\Request $request
|
* @param \Illuminate\Http\Request $request
|
||||||
|
*
|
||||||
* @return \Illuminate\Http\Response
|
* @return \Illuminate\Http\Response
|
||||||
*/
|
*/
|
||||||
public function reset(Request $request)
|
public function reset(Request $request)
|
||||||
|
@@ -44,14 +44,15 @@ class RegisterController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Get a validator for an incoming registration request.
|
* Get a validator for an incoming registration request.
|
||||||
*
|
*
|
||||||
* @param array $data
|
* @param array $data
|
||||||
|
*
|
||||||
* @return \Illuminate\Contracts\Validation\Validator
|
* @return \Illuminate\Contracts\Validation\Validator
|
||||||
*/
|
*/
|
||||||
protected function validator(array $data)
|
protected function validator(array $data)
|
||||||
{
|
{
|
||||||
return Validator::make($data, [
|
return Validator::make($data, [
|
||||||
'name' => ['required', 'string', 'max:255'],
|
'name' => ['required', 'string', 'max:255'],
|
||||||
'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
|
'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
|
||||||
'password' => ['required', 'string', 'min:8', 'confirmed'],
|
'password' => ['required', 'string', 'min:8', 'confirmed'],
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
@@ -59,14 +60,15 @@ class RegisterController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Create a new user instance after a valid registration.
|
* Create a new user instance after a valid registration.
|
||||||
*
|
*
|
||||||
* @param array $data
|
* @param array $data
|
||||||
|
*
|
||||||
* @return \App\User
|
* @return \App\User
|
||||||
*/
|
*/
|
||||||
protected function create(array $data)
|
protected function create(array $data)
|
||||||
{
|
{
|
||||||
return User::create([
|
return User::create([
|
||||||
'name' => $data['name'],
|
'name' => $data['name'],
|
||||||
'email' => $data['email'],
|
'email' => $data['email'],
|
||||||
'password' => Hash::make($data['password']),
|
'password' => Hash::make($data['password']),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
@@ -54,6 +54,7 @@ class UserController extends Controller
|
|||||||
* Display a listing of the resource.
|
* Display a listing of the resource.
|
||||||
*
|
*
|
||||||
* @param type User $user
|
* @param type User $user
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function index()
|
public function index()
|
||||||
@@ -156,6 +157,7 @@ class UserController extends Controller
|
|||||||
*
|
*
|
||||||
* @param type User $user
|
* @param type User $user
|
||||||
* @param type Sys_userRequest $request
|
* @param type Sys_userRequest $request
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function store(User $user, Sys_userRequest $request)
|
public function store(User $user, Sys_userRequest $request)
|
||||||
@@ -189,6 +191,7 @@ class UserController extends Controller
|
|||||||
*
|
*
|
||||||
* @param type int $id
|
* @param type int $id
|
||||||
* @param type User $user
|
* @param type User $user
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function show($id, User $user)
|
public function show($id, User $user)
|
||||||
@@ -208,6 +211,7 @@ class UserController extends Controller
|
|||||||
*
|
*
|
||||||
* @param type int $id
|
* @param type int $id
|
||||||
* @param type User $user
|
* @param type User $user
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function edit($id, User $user)
|
public function edit($id, User $user)
|
||||||
@@ -228,6 +232,7 @@ class UserController extends Controller
|
|||||||
* @param type int $id
|
* @param type int $id
|
||||||
* @param type User $user
|
* @param type User $user
|
||||||
* @param type Sys_userUpdate $request
|
* @param type Sys_userUpdate $request
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function update($id, User $user, Sys_userUpdate $request)
|
public function update($id, User $user, Sys_userUpdate $request)
|
||||||
@@ -255,6 +260,7 @@ class UserController extends Controller
|
|||||||
*
|
*
|
||||||
* @param type int $id
|
* @param type int $id
|
||||||
* @param type User $user
|
* @param type User $user
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function destroy($id, User $user)
|
public function destroy($id, User $user)
|
||||||
@@ -280,7 +286,8 @@ class UserController extends Controller
|
|||||||
/**
|
/**
|
||||||
* User Assign Org.
|
* User Assign Org.
|
||||||
*
|
*
|
||||||
* @param type $id
|
* @param type $id
|
||||||
|
*
|
||||||
* @return type boolean
|
* @return type boolean
|
||||||
*/
|
*/
|
||||||
public function UserAssignOrg($id)
|
public function UserAssignOrg($id)
|
||||||
|
@@ -40,6 +40,7 @@ class ClientTicketController extends Controller
|
|||||||
*
|
*
|
||||||
* @param type Tickets $ticket
|
* @param type Tickets $ticket
|
||||||
* @param type User $user
|
* @param type User $user
|
||||||
|
*
|
||||||
* @return type response
|
* @return type response
|
||||||
*/
|
*/
|
||||||
public function getCheckTicket(Tickets $ticket, User $user)
|
public function getCheckTicket(Tickets $ticket, User $user)
|
||||||
@@ -50,7 +51,8 @@ class ClientTicketController extends Controller
|
|||||||
/**
|
/**
|
||||||
* reply.
|
* reply.
|
||||||
*
|
*
|
||||||
* @param type $value
|
* @param type $value
|
||||||
|
*
|
||||||
* @return type view
|
* @return type view
|
||||||
*/
|
*/
|
||||||
public function reply($id, Request $request)
|
public function reply($id, Request $request)
|
||||||
|
@@ -59,6 +59,7 @@ class FormController extends Controller
|
|||||||
* getform.
|
* getform.
|
||||||
*
|
*
|
||||||
* @param type Help_topic $topic
|
* @param type Help_topic $topic
|
||||||
|
*
|
||||||
* @return type
|
* @return type
|
||||||
*/
|
*/
|
||||||
public function getForm(Help_topic $topic, CountryCode $code)
|
public function getForm(Help_topic $topic, CountryCode $code)
|
||||||
@@ -68,7 +69,7 @@ class FormController extends Controller
|
|||||||
}
|
}
|
||||||
$settings = CommonSettings::select('status')->where('option_name', '=', 'send_otp')->first();
|
$settings = CommonSettings::select('status')->where('option_name', '=', 'send_otp')->first();
|
||||||
$email_mandatory = CommonSettings::select('status')->where('option_name', '=', 'email_mandatory')->first();
|
$email_mandatory = CommonSettings::select('status')->where('option_name', '=', 'email_mandatory')->first();
|
||||||
if (! \Auth::check() && ($settings->status == 1 || $settings->status == '1')) {
|
if (!\Auth::check() && ($settings->status == 1 || $settings->status == '1')) {
|
||||||
return redirect('auth/login')->with(['login_require' => 'Please login to your account for submitting a ticket', 'referer' => 'form']);
|
return redirect('auth/login')->with(['login_require' => 'Please login to your account for submitting a ticket', 'referer' => 'form']);
|
||||||
}
|
}
|
||||||
$location = GeoIP::getLocation();
|
$location = GeoIP::getLocation();
|
||||||
@@ -95,6 +96,7 @@ class FormController extends Controller
|
|||||||
*
|
*
|
||||||
* @param type Form_name $name
|
* @param type Form_name $name
|
||||||
* @param type Form_details $details
|
* @param type Form_details $details
|
||||||
|
*
|
||||||
* @return type string
|
* @return type string
|
||||||
*/
|
*/
|
||||||
public function postForm($id, Help_topic $topic)
|
public function postForm($id, Help_topic $topic)
|
||||||
@@ -103,7 +105,7 @@ class FormController extends Controller
|
|||||||
$helptopic = $topic->where('id', '=', $id)->first();
|
$helptopic = $topic->where('id', '=', $id)->first();
|
||||||
$custom_form = $helptopic->custom_form;
|
$custom_form = $helptopic->custom_form;
|
||||||
$values = Fields::where('forms_id', '=', $custom_form)->get();
|
$values = Fields::where('forms_id', '=', $custom_form)->get();
|
||||||
if (! $values) {
|
if (!$values) {
|
||||||
}
|
}
|
||||||
if ($values) {
|
if ($values) {
|
||||||
foreach ($values as $form_data) {
|
foreach ($values as $form_data) {
|
||||||
@@ -186,7 +188,7 @@ class FormController extends Controller
|
|||||||
// $priority = $ticket_settings->first()->priority;
|
// $priority = $ticket_settings->first()->priority;
|
||||||
$default_priority = Ticket_Priority::where('is_default', '=', 1)->first();
|
$default_priority = Ticket_Priority::where('is_default', '=', 1)->first();
|
||||||
$user_priority = CommonSettings::where('option_name', '=', 'user_priority')->first();
|
$user_priority = CommonSettings::where('option_name', '=', 'user_priority')->first();
|
||||||
if (! ($request->input('priority'))) {
|
if (!($request->input('priority'))) {
|
||||||
$priority = $default_priority->priority_id;
|
$priority = $default_priority->priority_id;
|
||||||
if ($helpTopicObj->exists() && ($helpTopicObj->value('status') == 1)) {
|
if ($helpTopicObj->exists() && ($helpTopicObj->value('status') == 1)) {
|
||||||
$priority = $helpTopicObj->value('priority');
|
$priority = $helpTopicObj->value('priority');
|
||||||
@@ -208,18 +210,18 @@ class FormController extends Controller
|
|||||||
$geoipcode = $code->where('iso', '=', $location->iso_code)->first();
|
$geoipcode = $code->where('iso', '=', $location->iso_code)->first();
|
||||||
if ($phonecode == null) {
|
if ($phonecode == null) {
|
||||||
$data = [
|
$data = [
|
||||||
'fails' => Lang::get('lang.country-code-required-error'),
|
'fails' => Lang::get('lang.country-code-required-error'),
|
||||||
'phonecode' => $geoipcode->phonecode,
|
'phonecode' => $geoipcode->phonecode,
|
||||||
'country_code_error' => 1,
|
'country_code_error' => 1,
|
||||||
];
|
];
|
||||||
|
|
||||||
return Redirect::back()->with($data)->withInput($request->except('password'));
|
return Redirect::back()->with($data)->withInput($request->except('password'));
|
||||||
} else {
|
} else {
|
||||||
$code = CountryCode::select('phonecode')->where('phonecode', '=', $phonecode)->get();
|
$code = CountryCode::select('phonecode')->where('phonecode', '=', $phonecode)->get();
|
||||||
if (! count($code)) {
|
if (!count($code)) {
|
||||||
$data = [
|
$data = [
|
||||||
'fails' => Lang::get('lang.incorrect-country-code-error'),
|
'fails' => Lang::get('lang.incorrect-country-code-error'),
|
||||||
'phonecode' => $geoipcode->phonecode,
|
'phonecode' => $geoipcode->phonecode,
|
||||||
'country_code_error' => 1,
|
'country_code_error' => 1,
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -261,14 +263,15 @@ class FormController extends Controller
|
|||||||
/**
|
/**
|
||||||
* reply.
|
* reply.
|
||||||
*
|
*
|
||||||
* @param type $value
|
* @param type $value
|
||||||
|
*
|
||||||
* @return type view
|
* @return type view
|
||||||
*/
|
*/
|
||||||
public function post_ticket_reply($id, Request $request)
|
public function post_ticket_reply($id, Request $request)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$comment = $request->input('comment');
|
$comment = $request->input('comment');
|
||||||
if (! empty($comment)) {
|
if (!empty($comment)) {
|
||||||
$tickets = Tickets::where('id', '=', $id)->first();
|
$tickets = Tickets::where('id', '=', $id)->first();
|
||||||
$thread = Ticket_Thread::where('ticket_id', '=', $tickets->id)->first();
|
$thread = Ticket_Thread::where('ticket_id', '=', $tickets->id)->first();
|
||||||
|
|
||||||
@@ -312,7 +315,7 @@ class FormController extends Controller
|
|||||||
$helptopic_id = $request->input('helptopic');
|
$helptopic_id = $request->input('helptopic');
|
||||||
$helptopics = new Help_topic();
|
$helptopics = new Help_topic();
|
||||||
$helptopic = $helptopics->find($helptopic_id);
|
$helptopic = $helptopics->find($helptopic_id);
|
||||||
if (! $helptopic) {
|
if (!$helptopic) {
|
||||||
throw new Exception('We can not find your request');
|
throw new Exception('We can not find your request');
|
||||||
}
|
}
|
||||||
$custom_form = $helptopic->custom_form;
|
$custom_form = $helptopic->custom_form;
|
||||||
|
@@ -67,14 +67,15 @@ class GuestController extends Controller
|
|||||||
|
|
||||||
return view('themes.default1.client.helpdesk.profile', compact('user'))
|
return view('themes.default1.client.helpdesk.profile', compact('user'))
|
||||||
->with(['phonecode' => $phonecode->phonecode,
|
->with(['phonecode' => $phonecode->phonecode,
|
||||||
'verify' => $status, ]);
|
'verify' => $status, ]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Save profile data.
|
* Save profile data.
|
||||||
*
|
*
|
||||||
* @param type $id
|
* @param type $id
|
||||||
* @param type ProfileRequest $request
|
* @param type ProfileRequest $request
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function postProfile(ProfileRequest $request)
|
public function postProfile(ProfileRequest $request)
|
||||||
@@ -86,7 +87,7 @@ class GuestController extends Controller
|
|||||||
return redirect()->back()->with(['fails' => Lang::get('lang.country-code-required-error'), 'country_code_error' => 1])->withInput();
|
return redirect()->back()->with(['fails' => Lang::get('lang.country-code-required-error'), 'country_code_error' => 1])->withInput();
|
||||||
} else {
|
} else {
|
||||||
$code = CountryCode::select('phonecode')->where('phonecode', '=', $request->get('country_code'))->get();
|
$code = CountryCode::select('phonecode')->where('phonecode', '=', $request->get('country_code'))->get();
|
||||||
if (! count($code)) {
|
if (!count($code)) {
|
||||||
return redirect()->back()->with(['fails' => Lang::get('lang.incorrect-country-code-error'), 'country_code_error' => 1])->withInput();
|
return redirect()->back()->with(['fails' => Lang::get('lang.incorrect-country-code-error'), 'country_code_error' => 1])->withInput();
|
||||||
}
|
}
|
||||||
$user->country_code = $request->country_code;
|
$user->country_code = $request->country_code;
|
||||||
@@ -125,6 +126,7 @@ class GuestController extends Controller
|
|||||||
*@category fucntion to check if mobile number is unqique or not
|
*@category fucntion to check if mobile number is unqique or not
|
||||||
*
|
*
|
||||||
*@param string $mobile
|
*@param string $mobile
|
||||||
|
*
|
||||||
*@return bool true(if mobile exists in users table)/false (if mobile does not exist in user table)
|
*@return bool true(if mobile exists in users table)/false (if mobile does not exist in user table)
|
||||||
*/
|
*/
|
||||||
public function checkMobile($mobile)
|
public function checkMobile($mobile)
|
||||||
@@ -145,6 +147,7 @@ class GuestController extends Controller
|
|||||||
* Get Ticket page.
|
* Get Ticket page.
|
||||||
*
|
*
|
||||||
* @param type Help_topic $topic
|
* @param type Help_topic $topic
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function getTicket(Help_topic $topic)
|
public function getTicket(Help_topic $topic)
|
||||||
@@ -158,6 +161,7 @@ class GuestController extends Controller
|
|||||||
* getform.
|
* getform.
|
||||||
*
|
*
|
||||||
* @param type Help_topic $topic
|
* @param type Help_topic $topic
|
||||||
|
*
|
||||||
* @return type
|
* @return type
|
||||||
*/
|
*/
|
||||||
public function getForm(Help_topic $topic)
|
public function getForm(Help_topic $topic)
|
||||||
@@ -180,6 +184,7 @@ class GuestController extends Controller
|
|||||||
* @param type Tickets $tickets
|
* @param type Tickets $tickets
|
||||||
* @param type Ticket_Thread $thread
|
* @param type Ticket_Thread $thread
|
||||||
* @param type User $user
|
* @param type User $user
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function getMyticket()
|
public function getMyticket()
|
||||||
@@ -193,6 +198,7 @@ class GuestController extends Controller
|
|||||||
* @param type Ticket_Thread $thread
|
* @param type Ticket_Thread $thread
|
||||||
* @param type Tickets $tickets
|
* @param type Tickets $tickets
|
||||||
* @param type User $user
|
* @param type User $user
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function thread(Ticket_Thread $thread, Tickets $tickets, User $user)
|
public function thread(Ticket_Thread $thread, Tickets $tickets, User $user)
|
||||||
@@ -220,8 +226,9 @@ class GuestController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Post porfile password.
|
* Post porfile password.
|
||||||
*
|
*
|
||||||
* @param type $id
|
* @param type $id
|
||||||
* @param type ProfilePassword $request
|
* @param type ProfilePassword $request
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function postProfilePassword(ProfilePassword $request)
|
public function postProfilePassword(ProfilePassword $request)
|
||||||
@@ -248,6 +255,7 @@ class GuestController extends Controller
|
|||||||
*
|
*
|
||||||
* @param type Ticket_Thread $thread
|
* @param type Ticket_Thread $thread
|
||||||
* @param type TicketRequest $request
|
* @param type TicketRequest $request
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function reply(Ticket_Thread $thread, TicketRequest $request)
|
public function reply(Ticket_Thread $thread, TicketRequest $request)
|
||||||
@@ -270,6 +278,7 @@ class GuestController extends Controller
|
|||||||
*
|
*
|
||||||
* @param type Tickets $ticket
|
* @param type Tickets $ticket
|
||||||
* @param type User $user
|
* @param type User $user
|
||||||
|
*
|
||||||
* @return type response
|
* @return type response
|
||||||
*/
|
*/
|
||||||
public function getCheckTicket(Tickets $ticket, User $user)
|
public function getCheckTicket(Tickets $ticket, User $user)
|
||||||
@@ -284,12 +293,13 @@ class GuestController extends Controller
|
|||||||
* @param type User $user
|
* @param type User $user
|
||||||
* @param type Tickets $ticket
|
* @param type Tickets $ticket
|
||||||
* @param type Ticket_Thread $thread
|
* @param type Ticket_Thread $thread
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function PostCheckTicket(Request $request)
|
public function PostCheckTicket(Request $request)
|
||||||
{
|
{
|
||||||
$validator = \Validator::make($request->all(), [
|
$validator = \Validator::make($request->all(), [
|
||||||
'email' => 'required|email',
|
'email' => 'required|email',
|
||||||
'ticket_number' => 'required',
|
'ticket_number' => 'required',
|
||||||
]);
|
]);
|
||||||
if ($validator->fails()) {
|
if ($validator->fails()) {
|
||||||
@@ -335,7 +345,8 @@ class GuestController extends Controller
|
|||||||
/**
|
/**
|
||||||
* get ticket email.
|
* get ticket email.
|
||||||
*
|
*
|
||||||
* @param type $id
|
* @param type $id
|
||||||
|
*
|
||||||
* @return type
|
* @return type
|
||||||
*/
|
*/
|
||||||
public function get_ticket_email($id, CommonSettings $common_settings)
|
public function get_ticket_email($id, CommonSettings $common_settings)
|
||||||
@@ -351,6 +362,7 @@ class GuestController extends Controller
|
|||||||
* get ticket status.
|
* get ticket status.
|
||||||
*
|
*
|
||||||
* @param type Tickets $ticket
|
* @param type Tickets $ticket
|
||||||
|
*
|
||||||
* @return type
|
* @return type
|
||||||
*/
|
*/
|
||||||
public function getTicketStat(Tickets $ticket)
|
public function getTicketStat(Tickets $ticket)
|
||||||
@@ -397,7 +409,7 @@ class GuestController extends Controller
|
|||||||
->first();
|
->first();
|
||||||
if ($otp != null) {
|
if ($otp != null) {
|
||||||
$otp_length = strlen(Input::get('otp'));
|
$otp_length = strlen(Input::get('otp'));
|
||||||
if (($otp_length == 6 && ! preg_match('/[a-z]/i', Input::get('otp')))) {
|
if (($otp_length == 6 && !preg_match('/[a-z]/i', Input::get('otp')))) {
|
||||||
$otp2 = Hash::make(Input::get('otp'));
|
$otp2 = Hash::make(Input::get('otp'));
|
||||||
$date1 = date_format($otp->updated_at, 'Y-m-d h:i:sa');
|
$date1 = date_format($otp->updated_at, 'Y-m-d h:i:sa');
|
||||||
$date2 = date('Y-m-d h:i:sa');
|
$date2 = date('Y-m-d h:i:sa');
|
||||||
@@ -525,10 +537,10 @@ class GuestController extends Controller
|
|||||||
if (count($user) > 0) {
|
if (count($user) > 0) {
|
||||||
foreach ($user as $key => $value) {
|
foreach ($user as $key => $value) {
|
||||||
$info->create([
|
$info->create([
|
||||||
'owner' => $id,
|
'owner' => $id,
|
||||||
'service' => $provider,
|
'service' => $provider,
|
||||||
'key' => $key,
|
'key' => $key,
|
||||||
'value' => $value,
|
'value' => $value,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -537,7 +549,7 @@ class GuestController extends Controller
|
|||||||
public function changeEmail($email)
|
public function changeEmail($email)
|
||||||
{
|
{
|
||||||
$user = \Auth::user();
|
$user = \Auth::user();
|
||||||
if ($user && $email && ! $user->email) {
|
if ($user && $email && !$user->email) {
|
||||||
$user->email = $email;
|
$user->email = $email;
|
||||||
$user->save();
|
$user->save();
|
||||||
}
|
}
|
||||||
|
@@ -46,6 +46,7 @@ class UnAuthController extends Controller
|
|||||||
* @param type User $user
|
* @param type User $user
|
||||||
* @param type Tickets $ticket
|
* @param type Tickets $ticket
|
||||||
* @param type Ticket_Thread $thread
|
* @param type Ticket_Thread $thread
|
||||||
|
*
|
||||||
* @return type Response
|
* @return type Response
|
||||||
*/
|
*/
|
||||||
public function PostCheckTicket(Request $request)
|
public function PostCheckTicket(Request $request)
|
||||||
@@ -118,7 +119,8 @@ class UnAuthController extends Controller
|
|||||||
/**
|
/**
|
||||||
* generate random string token for ticket.
|
* generate random string token for ticket.
|
||||||
*
|
*
|
||||||
* @param type $length
|
* @param type $length
|
||||||
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function generate_random_ticket_token($length = 10)
|
public function generate_random_ticket_token($length = 10)
|
||||||
@@ -136,8 +138,9 @@ class UnAuthController extends Controller
|
|||||||
/**
|
/**
|
||||||
* function to check the ticket without loggin In.
|
* function to check the ticket without loggin In.
|
||||||
*
|
*
|
||||||
* @param type $ticket_id
|
* @param type $ticket_id
|
||||||
* @param type $token
|
* @param type $token
|
||||||
|
*
|
||||||
* @return type view
|
* @return type view
|
||||||
*/
|
*/
|
||||||
public function showTicketCode($ticket_id, $token)
|
public function showTicketCode($ticket_id, $token)
|
||||||
@@ -234,8 +237,9 @@ class UnAuthController extends Controller
|
|||||||
/**
|
/**
|
||||||
* function to change the status of the ticket.
|
* function to change the status of the ticket.
|
||||||
*
|
*
|
||||||
* @param type $status
|
* @param type $status
|
||||||
* @param type $id
|
* @param type $id
|
||||||
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function changeStatus($status, $id)
|
public function changeStatus($status, $id)
|
||||||
@@ -323,6 +327,7 @@ class UnAuthController extends Controller
|
|||||||
*@category function to change system's language
|
*@category function to change system's language
|
||||||
*
|
*
|
||||||
*@param string $lang //desired language's iso code
|
*@param string $lang //desired language's iso code
|
||||||
|
*
|
||||||
*@return response
|
*@return response
|
||||||
*/
|
*/
|
||||||
public static function changeLanguage($lang)
|
public static function changeLanguage($lang)
|
||||||
@@ -418,7 +423,7 @@ class UnAuthController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Function to chnage user language preference.
|
* Function to chnage user language preference.
|
||||||
*
|
*
|
||||||
* @param string $lang //desired language's iso code
|
* @param string $lang //desired language's iso code
|
||||||
*
|
*
|
||||||
* @category function to change system's language
|
* @category function to change system's language
|
||||||
*
|
*
|
||||||
|
@@ -31,13 +31,14 @@ class UserController extends Controller
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param
|
* @param
|
||||||
|
*
|
||||||
* @return response
|
* @return response
|
||||||
*/
|
*/
|
||||||
public function getArticle(Article $article, Category $category, Settings $settings)
|
public function getArticle(Article $article, Category $category, Settings $settings)
|
||||||
{
|
{
|
||||||
$setting = $settings->first();
|
$setting = $settings->first();
|
||||||
$pagination = $setting->pagination;
|
$pagination = $setting->pagination;
|
||||||
if (! Auth::check() || \Auth::user()->role == 'user') {
|
if (!Auth::check() || \Auth::user()->role == 'user') {
|
||||||
$article = $article->where('status', '1');
|
$article = $article->where('status', '1');
|
||||||
}
|
}
|
||||||
$article = $article->where('type', '1');
|
$article = $article->where('type', '1');
|
||||||
@@ -53,9 +54,10 @@ class UserController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Get excerpt from string.
|
* Get excerpt from string.
|
||||||
*
|
*
|
||||||
* @param string $str String to get an excerpt from
|
* @param string $str String to get an excerpt from
|
||||||
* @param int $startPos Position int string to start excerpt from
|
* @param int $startPos Position int string to start excerpt from
|
||||||
* @param int $maxLength Maximum length the excerpt may be
|
* @param int $maxLength Maximum length the excerpt may be
|
||||||
|
*
|
||||||
* @return string excerpt
|
* @return string excerpt
|
||||||
*/
|
*/
|
||||||
public static function getExcerpt($str, $startPos = 0, $maxLength = 50)
|
public static function getExcerpt($str, $startPos = 0, $maxLength = 50)
|
||||||
@@ -75,10 +77,11 @@ class UserController extends Controller
|
|||||||
/**
|
/**
|
||||||
* function to search an article.
|
* function to search an article.
|
||||||
*
|
*
|
||||||
* @param \App\Http\Requests\kb\SearchRequest $request
|
* @param \App\Http\Requests\kb\SearchRequest $request
|
||||||
* @param \App\Model\kb\Category $category
|
* @param \App\Model\kb\Category $category
|
||||||
* @param \App\Model\kb\Article $article
|
* @param \App\Model\kb\Article $article
|
||||||
* @param \App\Model\kb\Settings $settings
|
* @param \App\Model\kb\Settings $settings
|
||||||
|
*
|
||||||
* @return type view
|
* @return type view
|
||||||
*/
|
*/
|
||||||
public function search(SearchRequest $request, Category $category, Article $article, Settings $settings)
|
public function search(SearchRequest $request, Category $category, Article $article, Settings $settings)
|
||||||
@@ -110,7 +113,7 @@ class UserController extends Controller
|
|||||||
$date = \Carbon\Carbon::now()->toDateTimeString();
|
$date = \Carbon\Carbon::now()->toDateTimeString();
|
||||||
$arti = $article->where('slug', $slug);
|
$arti = $article->where('slug', $slug);
|
||||||
|
|
||||||
if (! Auth::check() || \Auth::user()->role == 'user') {
|
if (!Auth::check() || \Auth::user()->role == 'user') {
|
||||||
$arti = $arti->where('status', '1');
|
$arti = $arti->where('status', '1');
|
||||||
$arti = $arti->where('publish_time', '<', $date);
|
$arti = $arti->where('publish_time', '<', $date);
|
||||||
}
|
}
|
||||||
@@ -130,7 +133,7 @@ class UserController extends Controller
|
|||||||
{
|
{
|
||||||
/* get the article_id where category_id == current category */
|
/* get the article_id where category_id == current category */
|
||||||
$catid = $category->where('slug', $slug)->first();
|
$catid = $category->where('slug', $slug)->first();
|
||||||
if (! $catid) {
|
if (!$catid) {
|
||||||
return redirect()->back()->with('fails', Lang::get('lang.we_are_sorry_but_the_page_you_are_looking_for_can_not_be_found'));
|
return redirect()->back()->with('fails', Lang::get('lang.we_are_sorry_but_the_page_you_are_looking_for_can_not_be_found'));
|
||||||
}
|
}
|
||||||
$id = $catid->id;
|
$id = $catid->id;
|
||||||
@@ -222,12 +225,13 @@ class UserController extends Controller
|
|||||||
* @param type Request $request
|
* @param type Request $request
|
||||||
* @param type Comment $comment
|
* @param type Comment $comment
|
||||||
* @param type Id $id
|
* @param type Id $id
|
||||||
|
*
|
||||||
* @return type response
|
* @return type response
|
||||||
*/
|
*/
|
||||||
public function postComment($slug, Article $article, CommentRequest $request, Comment $comment)
|
public function postComment($slug, Article $article, CommentRequest $request, Comment $comment)
|
||||||
{
|
{
|
||||||
$article = $article->where('slug', $slug)->first();
|
$article = $article->where('slug', $slug)->first();
|
||||||
if (! $article) {
|
if (!$article) {
|
||||||
return Redirect::back()->with('fails', Lang::get('lang.sorry_not_processed'));
|
return Redirect::back()->with('fails', Lang::get('lang.sorry_not_processed'));
|
||||||
}
|
}
|
||||||
$id = $article->id;
|
$id = $article->id;
|
||||||
|
@@ -56,9 +56,9 @@ class ApiSettings extends Controller
|
|||||||
// dd($request->input());
|
// dd($request->input());
|
||||||
DB::table('settings_system')
|
DB::table('settings_system')
|
||||||
->where('id', 1)
|
->where('id', 1)
|
||||||
->update(['api_enable' => Input::get('api_enable'),
|
->update(['api_enable' => Input::get('api_enable'),
|
||||||
'api_key_mandatory' => Input::get('api_key_mandatory'),
|
'api_key_mandatory' => Input::get('api_key_mandatory'),
|
||||||
'api_key' => Input::get('api_key'), ]);
|
'api_key' => Input::get('api_key'), ]);
|
||||||
$settings = $this->api;
|
$settings = $this->api;
|
||||||
if ($settings->get()->count() > 0) {
|
if ($settings->get()->count() > 0) {
|
||||||
foreach ($settings->get() as $set) {
|
foreach ($settings->get() as $set) {
|
||||||
|
@@ -9,7 +9,7 @@ class CommonMailer
|
|||||||
public function setSmtpDriver($config)
|
public function setSmtpDriver($config)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
if (! $config) {
|
if (!$config) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$https = [];
|
$https = [];
|
||||||
@@ -34,7 +34,7 @@ class CommonMailer
|
|||||||
|
|
||||||
public function setMailGunDriver($config)
|
public function setMailGunDriver($config)
|
||||||
{
|
{
|
||||||
if (! $config) {
|
if (!$config) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -41,10 +41,10 @@ class NotificationController extends Controller
|
|||||||
/**
|
/**
|
||||||
* This function is used to create in app notifications.
|
* This function is used to create in app notifications.
|
||||||
*
|
*
|
||||||
* @param type $model_id
|
* @param type $model_id
|
||||||
* @param type $userid_created
|
* @param type $userid_created
|
||||||
* @param type $type_id
|
* @param type $type_id
|
||||||
* @param type $forwhome
|
* @param type $forwhome
|
||||||
*/
|
*/
|
||||||
public function create($model_id, $userid_created, $type_id, $forwhome = [])
|
public function create($model_id, $userid_created, $type_id, $forwhome = [])
|
||||||
{
|
{
|
||||||
@@ -70,7 +70,8 @@ class NotificationController extends Controller
|
|||||||
/**
|
/**
|
||||||
* This function is to mark all ticket to read status.
|
* This function is to mark all ticket to read status.
|
||||||
*
|
*
|
||||||
* @param type $id
|
* @param type $id
|
||||||
|
*
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
public function markAllRead($id)
|
public function markAllRead($id)
|
||||||
@@ -87,7 +88,8 @@ class NotificationController extends Controller
|
|||||||
/**
|
/**
|
||||||
* This function to mark read.
|
* This function to mark read.
|
||||||
*
|
*
|
||||||
* @param type $id
|
* @param type $id
|
||||||
|
*
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
public function markRead($id)
|
public function markRead($id)
|
||||||
@@ -116,7 +118,8 @@ class NotificationController extends Controller
|
|||||||
/**
|
/**
|
||||||
* function to delete notifications.
|
* function to delete notifications.
|
||||||
*
|
*
|
||||||
* @param type $id
|
* @param type $id
|
||||||
|
*
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
public function delete($id)
|
public function delete($id)
|
||||||
|
@@ -57,6 +57,7 @@ class PhpMailController extends Controller
|
|||||||
*
|
*
|
||||||
* @param type Reg $reg
|
* @param type Reg $reg
|
||||||
* @param type Department $dept_id
|
* @param type Department $dept_id
|
||||||
|
*
|
||||||
* @return type integer
|
* @return type integer
|
||||||
*/
|
*/
|
||||||
public function mailfrom($reg, $dept_id)
|
public function mailfrom($reg, $dept_id)
|
||||||
@@ -182,12 +183,12 @@ class PhpMailController extends Controller
|
|||||||
switch ($mail->sending_protocol) {
|
switch ($mail->sending_protocol) {
|
||||||
case 'smtp':
|
case 'smtp':
|
||||||
$config = ['host' => $mail->sending_host,
|
$config = ['host' => $mail->sending_host,
|
||||||
'port' => $mail->sending_port,
|
'port' => $mail->sending_port,
|
||||||
'security' => $mail->sending_encryption,
|
'security' => $mail->sending_encryption,
|
||||||
'username' => $mail->email_address,
|
'username' => $mail->email_address,
|
||||||
'password' => $mail->password,
|
'password' => $mail->password,
|
||||||
];
|
];
|
||||||
if (! $this->commonMailer->setSmtpDriver($config)) {
|
if (!$this->commonMailer->setSmtpDriver($config)) {
|
||||||
\Log::info('Invaid configuration :- '.$config);
|
\Log::info('Invaid configuration :- '.$config);
|
||||||
|
|
||||||
return 'invalid mail configuration';
|
return 'invalid mail configuration';
|
||||||
@@ -195,8 +196,8 @@ class PhpMailController extends Controller
|
|||||||
break;
|
break;
|
||||||
case 'send_mail':
|
case 'send_mail':
|
||||||
$config = [
|
$config = [
|
||||||
'host' => \Config::get('mail.host'),
|
'host' => \Config::get('mail.host'),
|
||||||
'port' => \Config::get('mail.port'),
|
'port' => \Config::get('mail.port'),
|
||||||
'security' => \Config::get('mail.encryption'),
|
'security' => \Config::get('mail.encryption'),
|
||||||
'username' => \Config::get('mail.username'),
|
'username' => \Config::get('mail.username'),
|
||||||
'password' => \Config::get('mail.password'),
|
'password' => \Config::get('mail.password'),
|
||||||
@@ -278,8 +279,8 @@ class PhpMailController extends Controller
|
|||||||
$short = 'database';
|
$short = 'database';
|
||||||
$field = [
|
$field = [
|
||||||
'driver' => 'database',
|
'driver' => 'database',
|
||||||
'table' => 'jobs',
|
'table' => 'jobs',
|
||||||
'queue' => 'default',
|
'queue' => 'default',
|
||||||
'expire' => 60,
|
'expire' => 60,
|
||||||
];
|
];
|
||||||
$queue = new \App\Model\MailJob\QueueService();
|
$queue = new \App\Model\MailJob\QueueService();
|
||||||
|
@@ -124,6 +124,7 @@ class SettingsController extends Controller
|
|||||||
*
|
*
|
||||||
* @param type Footer $footer
|
* @param type Footer $footer
|
||||||
* @param type Request $request
|
* @param type Request $request
|
||||||
|
*
|
||||||
* @return type response
|
* @return type response
|
||||||
*/
|
*/
|
||||||
public function edit_widget($id, Widgets $widgets, Request $request)
|
public function edit_widget($id, Widgets $widgets, Request $request)
|
||||||
@@ -201,6 +202,7 @@ class SettingsController extends Controller
|
|||||||
*
|
*
|
||||||
* @param type Footer $footer
|
* @param type Footer $footer
|
||||||
* @param type Request $request
|
* @param type Request $request
|
||||||
|
*
|
||||||
* @return type response
|
* @return type response
|
||||||
*/
|
*/
|
||||||
public function edit_social_buttons($id, Widgets $widgets, Request $request)
|
public function edit_social_buttons($id, Widgets $widgets, Request $request)
|
||||||
@@ -260,6 +262,7 @@ class SettingsController extends Controller
|
|||||||
*
|
*
|
||||||
* @param type Settings $set
|
* @param type Settings $set
|
||||||
* @param type Request $request
|
* @param type Request $request
|
||||||
|
*
|
||||||
* @return type view
|
* @return type view
|
||||||
*/
|
*/
|
||||||
public function PostSettings(Settings $set, Request $request)
|
public function PostSettings(Settings $set, Request $request)
|
||||||
@@ -370,7 +373,8 @@ class SettingsController extends Controller
|
|||||||
/**
|
/**
|
||||||
* After plugin post.
|
* After plugin post.
|
||||||
*
|
*
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
|
*
|
||||||
* @return type
|
* @return type
|
||||||
*/
|
*/
|
||||||
public function PostPlugins(Request $request)
|
public function PostPlugins(Request $request)
|
||||||
@@ -378,7 +382,7 @@ class SettingsController extends Controller
|
|||||||
$this->validate($request, ['plugin' => 'required|mimes:application/zip,zip,Zip']);
|
$this->validate($request, ['plugin' => 'required|mimes:application/zip,zip,Zip']);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (! extension_loaded('zip')) {
|
if (!extension_loaded('zip')) {
|
||||||
throw new Exception('Please enable zip extension in your php');
|
throw new Exception('Please enable zip extension in your php');
|
||||||
}
|
}
|
||||||
$plug = new Plugin();
|
$plug = new Plugin();
|
||||||
@@ -448,15 +452,16 @@ class SettingsController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Delete the directory.
|
* Delete the directory.
|
||||||
*
|
*
|
||||||
* @param type $dir
|
* @param type $dir
|
||||||
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function deleteDirectory($dir)
|
public function deleteDirectory($dir)
|
||||||
{
|
{
|
||||||
if (! file_exists($dir)) {
|
if (!file_exists($dir)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (! is_dir($dir)) {
|
if (!is_dir($dir)) {
|
||||||
return unlink($dir);
|
return unlink($dir);
|
||||||
}
|
}
|
||||||
foreach (scandir($dir) as $item) {
|
foreach (scandir($dir) as $item) {
|
||||||
@@ -464,7 +469,7 @@ class SettingsController extends Controller
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
chmod($dir.DIRECTORY_SEPARATOR.$item, 0777);
|
chmod($dir.DIRECTORY_SEPARATOR.$item, 0777);
|
||||||
if (! $this->deleteDirectory($dir.DIRECTORY_SEPARATOR.$item)) {
|
if (!$this->deleteDirectory($dir.DIRECTORY_SEPARATOR.$item)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -577,7 +582,7 @@ class SettingsController extends Controller
|
|||||||
{
|
{
|
||||||
$plugs = new Plugin();
|
$plugs = new Plugin();
|
||||||
$plug = $plugs->where('name', $slug)->first();
|
$plug = $plugs->where('name', $slug)->first();
|
||||||
if (! $plug) {
|
if (!$plug) {
|
||||||
$plugs->create(['name' => $slug, 'path' => $slug, 'status' => 1]);
|
$plugs->create(['name' => $slug, 'path' => $slug, 'status' => 1]);
|
||||||
|
|
||||||
return redirect()->back()->with('success', 'Status has changed');
|
return redirect()->back()->with('success', 'Status has changed');
|
||||||
|
@@ -52,7 +52,8 @@ class TemplateController extends Controller
|
|||||||
* Show template
|
* Show template
|
||||||
* This template to show a particular template.
|
* This template to show a particular template.
|
||||||
*
|
*
|
||||||
* @param type $id
|
* @param type $id
|
||||||
|
*
|
||||||
* @return type view
|
* @return type view
|
||||||
*/
|
*/
|
||||||
public function showTemplate($id)
|
public function showTemplate($id)
|
||||||
@@ -69,7 +70,8 @@ class TemplateController extends Controller
|
|||||||
/**
|
/**
|
||||||
* This function is used to display chumper datatables of the template list.
|
* This function is used to display chumper datatables of the template list.
|
||||||
*
|
*
|
||||||
* @param \Illuminate\Http\Request $request
|
* @param \Illuminate\Http\Request $request
|
||||||
|
*
|
||||||
* @return type datatable
|
* @return type datatable
|
||||||
*/
|
*/
|
||||||
public function GetTemplates(Request $request)
|
public function GetTemplates(Request $request)
|
||||||
@@ -107,7 +109,8 @@ class TemplateController extends Controller
|
|||||||
/**
|
/**
|
||||||
* To store a set of templates.
|
* To store a set of templates.
|
||||||
*
|
*
|
||||||
* @param \App\Http\Requests\helpdesk\TemplateRequest $request
|
* @param \App\Http\Requests\helpdesk\TemplateRequest $request
|
||||||
|
*
|
||||||
* @return type redirect
|
* @return type redirect
|
||||||
*/
|
*/
|
||||||
public function store(TemplateRequest $request)
|
public function store(TemplateRequest $request)
|
||||||
@@ -124,7 +127,8 @@ class TemplateController extends Controller
|
|||||||
/**
|
/**
|
||||||
* function to get the edit page of template.
|
* function to get the edit page of template.
|
||||||
*
|
*
|
||||||
* @param type $id
|
* @param type $id
|
||||||
|
*
|
||||||
* @return type
|
* @return type
|
||||||
*/
|
*/
|
||||||
public function edit($id)
|
public function edit($id)
|
||||||
@@ -143,8 +147,9 @@ class TemplateController extends Controller
|
|||||||
/**
|
/**
|
||||||
* function to update a template.
|
* function to update a template.
|
||||||
*
|
*
|
||||||
* @param type $id
|
* @param type $id
|
||||||
* @param \App\Http\Requests\helpdesk\TemplateUdate $request
|
* @param \App\Http\Requests\helpdesk\TemplateUdate $request
|
||||||
|
*
|
||||||
* @return type
|
* @return type
|
||||||
*/
|
*/
|
||||||
public function update($id, TemplateUdate $request)
|
public function update($id, TemplateUdate $request)
|
||||||
@@ -163,14 +168,15 @@ class TemplateController extends Controller
|
|||||||
/**
|
/**
|
||||||
* function to delete a template.
|
* function to delete a template.
|
||||||
*
|
*
|
||||||
* @param int $id
|
* @param int $id
|
||||||
|
*
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function destroy(Request $request)
|
public function destroy(Request $request)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$ids = $request->input('select');
|
$ids = $request->input('select');
|
||||||
if (! empty($ids)) {
|
if (!empty($ids)) {
|
||||||
foreach ($ids as $id) {
|
foreach ($ids as $id) {
|
||||||
$template = $this->template->where('id', $id)->first();
|
$template = $this->template->where('id', $id)->first();
|
||||||
if ($template) {
|
if ($template) {
|
||||||
@@ -211,7 +217,8 @@ class TemplateController extends Controller
|
|||||||
/**
|
/**
|
||||||
* function to show the templates.
|
* function to show the templates.
|
||||||
*
|
*
|
||||||
* @param type $id
|
* @param type $id
|
||||||
|
*
|
||||||
* @return type Mixed
|
* @return type Mixed
|
||||||
*/
|
*/
|
||||||
public function show($id)
|
public function show($id)
|
||||||
|
@@ -51,7 +51,8 @@ class TemplateSetController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Store a newly created resource in storage.
|
* Store a newly created resource in storage.
|
||||||
*
|
*
|
||||||
* @param \Illuminate\Http\Request $request
|
* @param \Illuminate\Http\Request $request
|
||||||
|
*
|
||||||
* @return \Illuminate\Http\Response
|
* @return \Illuminate\Http\Response
|
||||||
*/
|
*/
|
||||||
public function store(TemplateSet $sets, TemplateSetRequest $request)
|
public function store(TemplateSet $sets, TemplateSetRequest $request)
|
||||||
@@ -73,7 +74,8 @@ class TemplateSetController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Display the specified resource.
|
* Display the specified resource.
|
||||||
*
|
*
|
||||||
* @param int $id
|
* @param int $id
|
||||||
|
*
|
||||||
* @return \Illuminate\Http\Response
|
* @return \Illuminate\Http\Response
|
||||||
*/
|
*/
|
||||||
public function activateSet($id)
|
public function activateSet($id)
|
||||||
@@ -95,7 +97,8 @@ class TemplateSetController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Show the form for editing the specified resource.
|
* Show the form for editing the specified resource.
|
||||||
*
|
*
|
||||||
* @param int $id
|
* @param int $id
|
||||||
|
*
|
||||||
* @return \Illuminate\Http\Response
|
* @return \Illuminate\Http\Response
|
||||||
*/
|
*/
|
||||||
public function show($id)
|
public function show($id)
|
||||||
@@ -110,8 +113,9 @@ class TemplateSetController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Update the specified resource in storage.
|
* Update the specified resource in storage.
|
||||||
*
|
*
|
||||||
* @param \Illuminate\Http\Request $request
|
* @param \Illuminate\Http\Request $request
|
||||||
* @param int $id
|
* @param int $id
|
||||||
|
*
|
||||||
* @return \Illuminate\Http\Response
|
* @return \Illuminate\Http\Response
|
||||||
*/
|
*/
|
||||||
public function update(Request $request, $id)
|
public function update(Request $request, $id)
|
||||||
@@ -122,7 +126,8 @@ class TemplateSetController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Remove the specified resource from storage.
|
* Remove the specified resource from storage.
|
||||||
*
|
*
|
||||||
* @param int $id
|
* @param int $id
|
||||||
|
*
|
||||||
* @return \Illuminate\Http\Response
|
* @return \Illuminate\Http\Response
|
||||||
*/
|
*/
|
||||||
public function destroy($id)
|
public function destroy($id)
|
||||||
|
@@ -218,16 +218,17 @@ class InstallController extends Controller
|
|||||||
* checking prerequisites.
|
* checking prerequisites.
|
||||||
*
|
*
|
||||||
* @param type InstallerRequest $request
|
* @param type InstallerRequest $request
|
||||||
|
*
|
||||||
* @return type view
|
* @return type view
|
||||||
*/
|
*/
|
||||||
public function accountcheck(Request $request)
|
public function accountcheck(Request $request)
|
||||||
{
|
{
|
||||||
$validator = \Validator::make($request->all(), [
|
$validator = \Validator::make($request->all(), [
|
||||||
'firstname' => 'required|max:20',
|
'firstname' => 'required|max:20',
|
||||||
'Lastname' => 'required|max:20',
|
'Lastname' => 'required|max:20',
|
||||||
'email' => 'required|max:50|email',
|
'email' => 'required|max:50|email',
|
||||||
'username' => 'required|max:50|min:3',
|
'username' => 'required|max:50|min:3',
|
||||||
'password' => 'required|min:6',
|
'password' => 'required|min:6',
|
||||||
'confirmpassword' => 'required|same:password',
|
'confirmpassword' => 'required|same:password',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
@@ -266,7 +267,7 @@ class InstallController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
$changed = UnAuth::changeLanguage($language);
|
$changed = UnAuth::changeLanguage($language);
|
||||||
if (! $changed) {
|
if (!$changed) {
|
||||||
return \Redirect::back()->with('fails', 'Invalid language');
|
return \Redirect::back()->with('fails', 'Invalid language');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -285,14 +286,14 @@ class InstallController extends Controller
|
|||||||
// creating an user
|
// creating an user
|
||||||
$user = User::updateOrCreate(['id' => 1], [
|
$user = User::updateOrCreate(['id' => 1], [
|
||||||
'first_name' => $firstname,
|
'first_name' => $firstname,
|
||||||
'last_name' => $lastname,
|
'last_name' => $lastname,
|
||||||
'email' => $email,
|
'email' => $email,
|
||||||
'user_name' => $username,
|
'user_name' => $username,
|
||||||
'password' => Hash::make($password),
|
'password' => Hash::make($password),
|
||||||
//'assign_group' => 1,
|
//'assign_group' => 1,
|
||||||
'primary_dpt' => 1,
|
'primary_dpt' => 1,
|
||||||
'active' => 1,
|
'active' => 1,
|
||||||
'role' => 'admin',
|
'role' => 'admin',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// checking if the user have been created
|
// checking if the user have been created
|
||||||
@@ -454,7 +455,7 @@ class InstallController extends Controller
|
|||||||
if (is_file(base_path().DIRECTORY_SEPARATOR.'.env')) {
|
if (is_file(base_path().DIRECTORY_SEPARATOR.'.env')) {
|
||||||
unlink(base_path().DIRECTORY_SEPARATOR.'.env');
|
unlink(base_path().DIRECTORY_SEPARATOR.'.env');
|
||||||
}
|
}
|
||||||
if (! is_file(base_path().DIRECTORY_SEPARATOR.'example.env')) {
|
if (!is_file(base_path().DIRECTORY_SEPARATOR.'example.env')) {
|
||||||
fopen(base_path().DIRECTORY_SEPARATOR.'example.env', 'w');
|
fopen(base_path().DIRECTORY_SEPARATOR.'example.env', 'w');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -493,7 +494,7 @@ class InstallController extends Controller
|
|||||||
try {
|
try {
|
||||||
$tableNames = \Schema::getConnection()->getDoctrineSchemaManager()->listTableNames();
|
$tableNames = \Schema::getConnection()->getDoctrineSchemaManager()->listTableNames();
|
||||||
if (count($tableNames) === 0) {
|
if (count($tableNames) === 0) {
|
||||||
if (! Cache::get('dummy_data_installation')) {
|
if (!Cache::get('dummy_data_installation')) {
|
||||||
Artisan::call('migrate', ['--force' => true]);
|
Artisan::call('migrate', ['--force' => true]);
|
||||||
$db_install_method = 'migrate';
|
$db_install_method = 'migrate';
|
||||||
} else {
|
} else {
|
||||||
|
@@ -34,7 +34,7 @@ class QueueController extends Controller
|
|||||||
try {
|
try {
|
||||||
$queues = new QueueService();
|
$queues = new QueueService();
|
||||||
$queue = $queues->find($id);
|
$queue = $queues->find($id);
|
||||||
if (! $queue) {
|
if (!$queue) {
|
||||||
throw new Exception('Sorry we can not find your request');
|
throw new Exception('Sorry we can not find your request');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -50,7 +50,7 @@ class QueueController extends Controller
|
|||||||
$values = $request->except('_token');
|
$values = $request->except('_token');
|
||||||
$queues = new QueueService();
|
$queues = new QueueService();
|
||||||
$queue = $queues->find($id);
|
$queue = $queues->find($id);
|
||||||
if (! $queue) {
|
if (!$queue) {
|
||||||
throw new Exception('Sorry we can not find your request');
|
throw new Exception('Sorry we can not find your request');
|
||||||
}
|
}
|
||||||
$setting = new FaveoQueue();
|
$setting = new FaveoQueue();
|
||||||
@@ -64,8 +64,8 @@ class QueueController extends Controller
|
|||||||
foreach ($values as $key => $value) {
|
foreach ($values as $key => $value) {
|
||||||
$setting->create([
|
$setting->create([
|
||||||
'service_id' => $id,
|
'service_id' => $id,
|
||||||
'key' => $key,
|
'key' => $key,
|
||||||
'value' => $value,
|
'value' => $value,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -82,7 +82,7 @@ class QueueController extends Controller
|
|||||||
$queues = new QueueService();
|
$queues = new QueueService();
|
||||||
$queue = $queues->find($id);
|
$queue = $queues->find($id);
|
||||||
$active_queue = $queues->where('status', 1)->first();
|
$active_queue = $queues->where('status', 1)->first();
|
||||||
if (! $queue) {
|
if (!$queue) {
|
||||||
throw new Exception('Sorry we can not find your request');
|
throw new Exception('Sorry we can not find your request');
|
||||||
}
|
}
|
||||||
if ($queue->isActivate() == false && $id != 1 && $id != 2) {
|
if ($queue->isActivate() == false && $id != 1 && $id != 2) {
|
||||||
|
@@ -31,12 +31,12 @@ class UpgradeController extends Controller
|
|||||||
$order_number = '44596328';
|
$order_number = '44596328';
|
||||||
$url = env('APP_URL');
|
$url = env('APP_URL');
|
||||||
$data = [
|
$data = [
|
||||||
'serial_key' => $serial_key,
|
'serial_key' => $serial_key,
|
||||||
'order_number' => $order_number,
|
'order_number' => $order_number,
|
||||||
'name' => $name,
|
'name' => $name,
|
||||||
'version' => Utility::getFileVersion(),
|
'version' => Utility::getFileVersion(),
|
||||||
'request_type' => 'check_update',
|
'request_type' => 'check_update',
|
||||||
'url' => $url,
|
'url' => $url,
|
||||||
];
|
];
|
||||||
$data = Utility::encryptByFaveoPublicKey(json_encode($data));
|
$data = Utility::encryptByFaveoPublicKey(json_encode($data));
|
||||||
//dd($data);
|
//dd($data);
|
||||||
@@ -91,12 +91,12 @@ class UpgradeController extends Controller
|
|||||||
);
|
);
|
||||||
|
|
||||||
$newUpdate = file_get_contents($download_url, false, $context);
|
$newUpdate = file_get_contents($download_url, false, $context);
|
||||||
if (! is_dir("$this->dir/UPDATES/")) {
|
if (!is_dir("$this->dir/UPDATES/")) {
|
||||||
\File::makeDirectory($this->dir.'/UPDATES/', 0777);
|
\File::makeDirectory($this->dir.'/UPDATES/', 0777);
|
||||||
}
|
}
|
||||||
|
|
||||||
$dlHandler = fopen($this->dir.'/UPDATES/'.'/faveo-helpdesk-master.zip', 'w');
|
$dlHandler = fopen($this->dir.'/UPDATES/'.'/faveo-helpdesk-master.zip', 'w');
|
||||||
if (! fwrite($dlHandler, $newUpdate)) {
|
if (!fwrite($dlHandler, $newUpdate)) {
|
||||||
echo '<p>Could not save new update. Operation aborted.</p>';
|
echo '<p>Could not save new update. Operation aborted.</p>';
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
@@ -115,7 +115,7 @@ class UpgradeController extends Controller
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (! extension_loaded('zip')) {
|
if (!extension_loaded('zip')) {
|
||||||
echo '<ul class=list-unstyled>';
|
echo '<ul class=list-unstyled>';
|
||||||
echo "<li style='color:red;'>Sorry we can not process your request because you don't have ZIP extension contact your system admin</li>";
|
echo "<li style='color:red;'>Sorry we can not process your request because you don't have ZIP extension contact your system admin</li>";
|
||||||
echo '</ul>';
|
echo '</ul>';
|
||||||
@@ -139,14 +139,14 @@ class UpgradeController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Make the directory if we need to...
|
//Make the directory if we need to...
|
||||||
if (! is_dir($update.'/'.$thisFileDir.'/')) {
|
if (!is_dir($update.'/'.$thisFileDir.'/')) {
|
||||||
\File::makeDirectory($update.'/'.$thisFileDir, 0775, true, true);
|
\File::makeDirectory($update.'/'.$thisFileDir, 0775, true, true);
|
||||||
// mkdir($update.'/'. $thisFileDir, 0775);
|
// mkdir($update.'/'. $thisFileDir, 0775);
|
||||||
echo '<li style="color:white;">Created Directory '.$thisFileDir.'</li>';
|
echo '<li style="color:white;">Created Directory '.$thisFileDir.'</li>';
|
||||||
}
|
}
|
||||||
|
|
||||||
//Overwrite the file
|
//Overwrite the file
|
||||||
if (! is_dir($update.'/'.$thisFileName)) {
|
if (!is_dir($update.'/'.$thisFileName)) {
|
||||||
echo '<li style="color:white;">'.$thisFileName.'...........';
|
echo '<li style="color:white;">'.$thisFileName.'...........';
|
||||||
$contents = zip_entry_read($aF, zip_entry_filesize($aF));
|
$contents = zip_entry_read($aF, zip_entry_filesize($aF));
|
||||||
$contents = str_replace("\r\n", "\n", $contents);
|
$contents = str_replace("\r\n", "\n", $contents);
|
||||||
@@ -283,7 +283,7 @@ class UpgradeController extends Controller
|
|||||||
if ($latest_version > $current_version) {
|
if ($latest_version > $current_version) {
|
||||||
echo '<p>New Update Found: v'.$latest_version.'</p>';
|
echo '<p>New Update Found: v'.$latest_version.'</p>';
|
||||||
$found = true;
|
$found = true;
|
||||||
if (! is_file("$this->dir/UPDATES/faveo-helpdesk-master.zip")) {
|
if (!is_file("$this->dir/UPDATES/faveo-helpdesk-master.zip")) {
|
||||||
if ($request->get('dodownload') == true) {
|
if ($request->get('dodownload') == true) {
|
||||||
$download_url = $this->downloadLatestCode();
|
$download_url = $this->downloadLatestCode();
|
||||||
if ($download_url != null) {
|
if ($download_url != null) {
|
||||||
@@ -325,7 +325,7 @@ class UpgradeController extends Controller
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$curl = Utility::_isCurl();
|
$curl = Utility::_isCurl();
|
||||||
if (! $curl) {
|
if (!$curl) {
|
||||||
throw new Exception('Please enable your curl function to check latest update');
|
throw new Exception('Please enable your curl function to check latest update');
|
||||||
}
|
}
|
||||||
$ch = curl_init();
|
$ch = curl_init();
|
||||||
@@ -347,7 +347,7 @@ class UpgradeController extends Controller
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$curl = Utility::_isCurl();
|
$curl = Utility::_isCurl();
|
||||||
if (! $curl) {
|
if (!$curl) {
|
||||||
throw new Exception('Please enable your curl function to check latest update');
|
throw new Exception('Please enable your curl function to check latest update');
|
||||||
}
|
}
|
||||||
$ch = curl_init();
|
$ch = curl_init();
|
||||||
@@ -371,7 +371,7 @@ class UpgradeController extends Controller
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$curl = Utility::_isCurl();
|
$curl = Utility::_isCurl();
|
||||||
if (! $curl) {
|
if (!$curl) {
|
||||||
throw new Exception('Please enable your curl function to check latest update');
|
throw new Exception('Please enable your curl function to check latest update');
|
||||||
}
|
}
|
||||||
$ch = curl_init();
|
$ch = curl_init();
|
||||||
|
@@ -48,25 +48,25 @@ class Kernel extends HttpKernel
|
|||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
protected $routeMiddleware = [
|
protected $routeMiddleware = [
|
||||||
'auth' => \App\Http\Middleware\Authenticate::class,
|
'auth' => \App\Http\Middleware\Authenticate::class,
|
||||||
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
|
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
|
||||||
'can' => \Illuminate\Auth\Middleware\Authorize::class,
|
'can' => \Illuminate\Auth\Middleware\Authorize::class,
|
||||||
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
|
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
|
||||||
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
|
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
|
||||||
'roles' => \App\Http\Middleware\CheckRole::class,
|
'roles' => \App\Http\Middleware\CheckRole::class,
|
||||||
'role.agent' => \App\Http\Middleware\CheckRoleAgent::class,
|
'role.agent' => \App\Http\Middleware\CheckRoleAgent::class,
|
||||||
'role.user' => \App\Http\Middleware\CheckRoleUser::class,
|
'role.user' => \App\Http\Middleware\CheckRoleUser::class,
|
||||||
'api' => \App\Http\Middleware\ApiKey::class,
|
'api' => \App\Http\Middleware\ApiKey::class,
|
||||||
'jwt.authOveride' => \App\Http\Middleware\JwtAuthenticate::class,
|
'jwt.authOveride' => \App\Http\Middleware\JwtAuthenticate::class,
|
||||||
'update' => \App\Http\Middleware\CheckUpdate::class,
|
'update' => \App\Http\Middleware\CheckUpdate::class,
|
||||||
'board' => \App\Http\Middleware\CheckBoard::class,
|
'board' => \App\Http\Middleware\CheckBoard::class,
|
||||||
'install' => \App\Http\Middleware\Install::class,
|
'install' => \App\Http\Middleware\Install::class,
|
||||||
'redirect' => \App\Http\Middleware\Redirect::class,
|
'redirect' => \App\Http\Middleware\Redirect::class,
|
||||||
'installer' => \App\Http\Middleware\IsInstalled::class,
|
'installer' => \App\Http\Middleware\IsInstalled::class,
|
||||||
'force.option' => \App\Http\Middleware\TicketViewURL::class,
|
'force.option' => \App\Http\Middleware\TicketViewURL::class,
|
||||||
'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
|
'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
|
||||||
'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class,
|
'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class,
|
||||||
'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
|
'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
|
||||||
'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,
|
'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
@@ -18,8 +18,9 @@ class ApiKey
|
|||||||
/**
|
/**
|
||||||
* Handle an incoming request.
|
* Handle an incoming request.
|
||||||
*
|
*
|
||||||
* @param \Illuminate\Http\Request $request
|
* @param \Illuminate\Http\Request $request
|
||||||
* @param \Closure $next
|
* @param \Closure $next
|
||||||
|
*
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public function handle($request, Closure $next)
|
public function handle($request, Closure $next)
|
||||||
|
@@ -22,7 +22,8 @@ class Authenticate
|
|||||||
/**
|
/**
|
||||||
* Create a new filter instance.
|
* Create a new filter instance.
|
||||||
*
|
*
|
||||||
* @param Guard $auth
|
* @param Guard $auth
|
||||||
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function __construct(Guard $auth)
|
public function __construct(Guard $auth)
|
||||||
@@ -33,8 +34,9 @@ class Authenticate
|
|||||||
/**
|
/**
|
||||||
* Handle an incoming request.
|
* Handle an incoming request.
|
||||||
*
|
*
|
||||||
* @param \Illuminate\Http\Request $request
|
* @param \Illuminate\Http\Request $request
|
||||||
* @param \Closure $next
|
* @param \Closure $next
|
||||||
|
*
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public function handle($request, Closure $next)
|
public function handle($request, Closure $next)
|
||||||
|
@@ -16,8 +16,9 @@ class CheckBoard
|
|||||||
/**
|
/**
|
||||||
* Handle an incoming request.
|
* Handle an incoming request.
|
||||||
*
|
*
|
||||||
* @param \Illuminate\Http\Request $request
|
* @param \Illuminate\Http\Request $request
|
||||||
* @param \Closure $next
|
* @param \Closure $next
|
||||||
|
*
|
||||||
* @return type Mixed
|
* @return type Mixed
|
||||||
*/
|
*/
|
||||||
public function handle($request, Closure $next)
|
public function handle($request, Closure $next)
|
||||||
|
@@ -14,8 +14,9 @@ class CheckRole
|
|||||||
/**
|
/**
|
||||||
* Handle an incoming request.
|
* Handle an incoming request.
|
||||||
*
|
*
|
||||||
* @param \Illuminate\Http\Request $request
|
* @param \Illuminate\Http\Request $request
|
||||||
* @param \Closure $next
|
* @param \Closure $next
|
||||||
|
*
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public function handle($request, Closure $next)
|
public function handle($request, Closure $next)
|
||||||
|
@@ -14,8 +14,9 @@ class CheckRoleAgent
|
|||||||
/**
|
/**
|
||||||
* Handle an incoming request.
|
* Handle an incoming request.
|
||||||
*
|
*
|
||||||
* @param \Illuminate\Http\Request $request
|
* @param \Illuminate\Http\Request $request
|
||||||
* @param \Closure $next
|
* @param \Closure $next
|
||||||
|
*
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public function handle($request, Closure $next)
|
public function handle($request, Closure $next)
|
||||||
|
@@ -14,8 +14,9 @@ class CheckRoleUser
|
|||||||
/**
|
/**
|
||||||
* Handle an incoming request.
|
* Handle an incoming request.
|
||||||
*
|
*
|
||||||
* @param \Illuminate\Http\Request $request
|
* @param \Illuminate\Http\Request $request
|
||||||
* @param \Closure $next
|
* @param \Closure $next
|
||||||
|
*
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public function handle($request, Closure $next)
|
public function handle($request, Closure $next)
|
||||||
|
@@ -12,8 +12,9 @@ class CheckUpdate
|
|||||||
/**
|
/**
|
||||||
* Handle an incoming request.
|
* Handle an incoming request.
|
||||||
*
|
*
|
||||||
* @param \Illuminate\Http\Request $request
|
* @param \Illuminate\Http\Request $request
|
||||||
* @param \Closure $next
|
* @param \Closure $next
|
||||||
|
*
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public function handle($request, Closure $next)
|
public function handle($request, Closure $next)
|
||||||
@@ -46,7 +47,7 @@ class CheckUpdate
|
|||||||
public function checkNewUpdate()
|
public function checkNewUpdate()
|
||||||
{
|
{
|
||||||
$notify = new BarNotification();
|
$notify = new BarNotification();
|
||||||
if (! \Schema::hasTable('bar_notifications')) {
|
if (!\Schema::hasTable('bar_notifications')) {
|
||||||
$url = url('database-upgrade');
|
$url = url('database-upgrade');
|
||||||
//$string = "Your Database is outdated please upgrade <a href=$url>Now !</a>";
|
//$string = "Your Database is outdated please upgrade <a href=$url>Now !</a>";
|
||||||
echo view('themes.default1.update.database', compact('url'));
|
echo view('themes.default1.update.database', compact('url'));
|
||||||
@@ -64,7 +65,7 @@ class CheckUpdate
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (count($notifications) > 0) {
|
if (count($notifications) > 0) {
|
||||||
if (! array_key_exists('new-version', $notifications)) {
|
if (!array_key_exists('new-version', $notifications)) {
|
||||||
$check_version = $this->checkNewVersion();
|
$check_version = $this->checkNewVersion();
|
||||||
if ($check_version == true) {
|
if ($check_version == true) {
|
||||||
$notify->create(['key' => 'new-version', 'value' => 'new version found please click <a href='.url('file-update').'><b>here to download</b></a>']);
|
$notify->create(['key' => 'new-version', 'value' => 'new version found please click <a href='.url('file-update').'><b>here to download</b></a>']);
|
||||||
|
@@ -9,8 +9,9 @@ class Install
|
|||||||
/**
|
/**
|
||||||
* Handle an incoming request.
|
* Handle an incoming request.
|
||||||
*
|
*
|
||||||
* @param \Illuminate\Http\Request $request
|
* @param \Illuminate\Http\Request $request
|
||||||
* @param \Closure $next
|
* @param \Closure $next
|
||||||
|
*
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public function handle($request, Closure $next)
|
public function handle($request, Closure $next)
|
||||||
|
@@ -9,13 +9,14 @@ class IsInstalled
|
|||||||
/**
|
/**
|
||||||
* Handle an incoming request.
|
* Handle an incoming request.
|
||||||
*
|
*
|
||||||
* @param \Illuminate\Http\Request $request
|
* @param \Illuminate\Http\Request $request
|
||||||
* @param \Closure $next
|
* @param \Closure $next
|
||||||
|
*
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public function handle($request, Closure $next)
|
public function handle($request, Closure $next)
|
||||||
{
|
{
|
||||||
if (! isInstall()) {
|
if (!isInstall()) {
|
||||||
return $next($request);
|
return $next($request);
|
||||||
} else {
|
} else {
|
||||||
if ($request->isJson()) {
|
if ($request->isJson()) {
|
||||||
|
@@ -26,11 +26,12 @@ class JwtAuthenticate extends BaseMiddleware
|
|||||||
/**
|
/**
|
||||||
* Handle an incoming request.
|
* Handle an incoming request.
|
||||||
*
|
*
|
||||||
* @param \Illuminate\Http\Request $request
|
* @param \Illuminate\Http\Request $request
|
||||||
* @param \Closure $next
|
* @param \Closure $next
|
||||||
* @return mixed
|
|
||||||
*
|
*
|
||||||
* @throws \Symfony\Component\HttpKernel\Exception\UnauthorizedHttpException
|
* @throws \Symfony\Component\HttpKernel\Exception\UnauthorizedHttpException
|
||||||
|
*
|
||||||
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public function handle($request, Closure $next)
|
public function handle($request, Closure $next)
|
||||||
{
|
{
|
||||||
|
@@ -9,8 +9,9 @@ class Redirect
|
|||||||
/**
|
/**
|
||||||
* Handle an incoming request.
|
* Handle an incoming request.
|
||||||
*
|
*
|
||||||
* @param \Illuminate\Http\Request $request
|
* @param \Illuminate\Http\Request $request
|
||||||
* @param \Closure $next
|
* @param \Closure $next
|
||||||
|
*
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public function handle($request, Closure $next)
|
public function handle($request, Closure $next)
|
||||||
|
@@ -11,9 +11,10 @@ class RedirectIfAuthenticated
|
|||||||
/**
|
/**
|
||||||
* Handle an incoming request.
|
* Handle an incoming request.
|
||||||
*
|
*
|
||||||
* @param \Illuminate\Http\Request $request
|
* @param \Illuminate\Http\Request $request
|
||||||
* @param \Closure(\Illuminate\Http\Request): (\Illuminate\Http\Response|\Illuminate\Http\RedirectResponse) $next
|
* @param \Closure(\Illuminate\Http\Request): (\Illuminate\Http\Response|\Illuminate\Http\RedirectResponse) $next
|
||||||
* @param string|null ...$guards
|
* @param string|null ...$guards
|
||||||
|
*
|
||||||
* @return \Illuminate\Http\Response|\Illuminate\Http\RedirectResponse
|
* @return \Illuminate\Http\Response|\Illuminate\Http\RedirectResponse
|
||||||
*/
|
*/
|
||||||
public function handle(Request $request, Closure $next, ...$guards)
|
public function handle(Request $request, Closure $next, ...$guards)
|
||||||
|
@@ -12,8 +12,9 @@ class TicketViewURL
|
|||||||
/**
|
/**
|
||||||
* Handle an incoming request.
|
* Handle an incoming request.
|
||||||
*
|
*
|
||||||
* @param \Illuminate\Http\Request $request
|
* @param \Illuminate\Http\Request $request
|
||||||
* @param \Closure $next
|
* @param \Closure $next
|
||||||
|
*
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public function handle($request, Closure $next)
|
public function handle($request, Closure $next)
|
||||||
@@ -27,11 +28,11 @@ class TicketViewURL
|
|||||||
if (count(Request::all()) == 0) {
|
if (count(Request::all()) == 0) {
|
||||||
return \Redirect::to('tickets?show%5B%5D=inbox&departments%5B%5D=All');
|
return \Redirect::to('tickets?show%5B%5D=inbox&departments%5B%5D=All');
|
||||||
} else {
|
} else {
|
||||||
if (! array_key_exists('show', Request::all()) && ! array_key_exists('departments', Request::all())) {
|
if (!array_key_exists('show', Request::all()) && !array_key_exists('departments', Request::all())) {
|
||||||
return \Redirect::to($request_str.'&show%5B%5D=inbox&departments%5B%5D=All');
|
return \Redirect::to($request_str.'&show%5B%5D=inbox&departments%5B%5D=All');
|
||||||
} elseif (! array_key_exists('show', Request::all()) && array_key_exists('departments', Request::all())) {
|
} elseif (!array_key_exists('show', Request::all()) && array_key_exists('departments', Request::all())) {
|
||||||
return \Redirect::to($request_str.'&show%5B%5D=inbox');
|
return \Redirect::to($request_str.'&show%5B%5D=inbox');
|
||||||
} elseif (array_key_exists('show', Request::all()) && ! array_key_exists('departments', Request::all())) {
|
} elseif (array_key_exists('show', Request::all()) && !array_key_exists('departments', Request::all())) {
|
||||||
return \Redirect::to($request_str.'&departments%5B%5D=All');
|
return \Redirect::to($request_str.'&departments%5B%5D=All');
|
||||||
} else {
|
} else {
|
||||||
// do nothing
|
// do nothing
|
||||||
|
@@ -23,8 +23,9 @@ class VerifyCsrfToken extends BaseVerifier
|
|||||||
/**
|
/**
|
||||||
* Handle an incoming request.
|
* Handle an incoming request.
|
||||||
*
|
*
|
||||||
* @param \Illuminate\Http\Request $request
|
* @param \Illuminate\Http\Request $request
|
||||||
* @param \Closure $next
|
* @param \Closure $next
|
||||||
|
*
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public function handle($request, Closure $next)
|
public function handle($request, Closure $next)
|
||||||
|
@@ -35,18 +35,18 @@ class AgentRequest extends Request
|
|||||||
}
|
}
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'user_name' => 'required|unique:users|max:30',
|
'user_name' => 'required|unique:users|max:30',
|
||||||
'first_name' => 'required|max:30',
|
'first_name' => 'required|max:30',
|
||||||
// 'last_name' => 'required|max:30',
|
// 'last_name' => 'required|max:30',
|
||||||
'email' => 'required|unique:users',
|
'email' => 'required|unique:users',
|
||||||
'active' => 'required',
|
'active' => 'required',
|
||||||
// 'account_status' => 'required',
|
// 'account_status' => 'required',
|
||||||
'group' => 'required',
|
'group' => 'required',
|
||||||
'primary_department' => 'required',
|
'primary_department' => 'required',
|
||||||
'agent_time_zone' => 'required',
|
'agent_time_zone' => 'required',
|
||||||
// 'phone_number' => 'phone:IN',
|
// 'phone_number' => 'phone:IN',
|
||||||
'mobile' => 'unique:users',
|
'mobile' => 'unique:users',
|
||||||
'team' => 'required',
|
'team' => 'required',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -64,19 +64,19 @@ class AgentRequest extends Request
|
|||||||
$settings = $settings->select('status')->where('option_name', '=', 'send_otp')->first();
|
$settings = $settings->select('status')->where('option_name', '=', 'send_otp')->first();
|
||||||
if ($settings->status == '1' || $settings->status == 1) {
|
if ($settings->status == '1' || $settings->status == 1) {
|
||||||
return [
|
return [
|
||||||
'user_name' => 'required|unique:users|max:30',
|
'user_name' => 'required|unique:users|max:30',
|
||||||
'first_name' => 'required|max:30',
|
'first_name' => 'required|max:30',
|
||||||
// 'last_name' => 'required|max:30',
|
// 'last_name' => 'required|max:30',
|
||||||
'email' => 'required|unique:users',
|
'email' => 'required|unique:users',
|
||||||
'active' => 'required',
|
'active' => 'required',
|
||||||
// 'account_status' => 'required',
|
// 'account_status' => 'required',
|
||||||
'group' => 'required',
|
'group' => 'required',
|
||||||
'primary_department' => 'required',
|
'primary_department' => 'required',
|
||||||
'agent_time_zone' => 'required',
|
'agent_time_zone' => 'required',
|
||||||
// 'phone_number' => 'phone:IN',
|
// 'phone_number' => 'phone:IN',
|
||||||
// 'mobile' => 'phone:IN',
|
// 'mobile' => 'phone:IN',
|
||||||
'team' => 'required',
|
'team' => 'required',
|
||||||
'mobile' => 'required|unique:users',
|
'mobile' => 'required|unique:users',
|
||||||
'country_code' => 'required',
|
'country_code' => 'required',
|
||||||
];
|
];
|
||||||
} else {
|
} else {
|
||||||
|
@@ -29,17 +29,17 @@ class AgentUpdate extends Request
|
|||||||
public function rules()
|
public function rules()
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'user_name' => 'required|max:30|min:3|unique:users,user_name,'.$this->segment(2),
|
'user_name' => 'required|max:30|min:3|unique:users,user_name,'.$this->segment(2),
|
||||||
'first_name' => 'required|max:30',
|
'first_name' => 'required|max:30',
|
||||||
// 'last_name' => 'required|max:30',
|
// 'last_name' => 'required|max:30',
|
||||||
'email' => 'required|email|unique:users,email,'.$this->segment(2),
|
'email' => 'required|email|unique:users,email,'.$this->segment(2),
|
||||||
'active' => 'required',
|
'active' => 'required',
|
||||||
'role' => 'required',
|
'role' => 'required',
|
||||||
'group' => 'required',
|
'group' => 'required',
|
||||||
'primary_department' => 'required',
|
'primary_department' => 'required',
|
||||||
'agent_time_zone' => 'required',
|
'agent_time_zone' => 'required',
|
||||||
'team' => 'required',
|
'team' => 'required',
|
||||||
'mobile' => 'unique:users,mobile,'.$this->segment(2),
|
'mobile' => 'unique:users,mobile,'.$this->segment(2),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -24,7 +24,7 @@ class ArticleRequest extends Request
|
|||||||
public function rules()
|
public function rules()
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'name' => 'required',
|
'name' => 'required',
|
||||||
'description' => 'required',
|
'description' => 'required',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
@@ -30,7 +30,7 @@ class BanRequest extends Request
|
|||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'email' => 'required|email',
|
'email' => 'required|email',
|
||||||
'ban' => 'required',
|
'ban' => 'required',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -30,7 +30,7 @@ class BanlistRequest extends Request
|
|||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'email' => 'email',
|
'email' => 'email',
|
||||||
'ban' => 'required',
|
'ban' => 'required',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -29,7 +29,7 @@ class CannedRequest extends Request
|
|||||||
public function rules()
|
public function rules()
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'title' => 'required|min:2|max:50',
|
'title' => 'required|min:2|max:50',
|
||||||
'message' => 'required',
|
'message' => 'required',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
@@ -29,7 +29,7 @@ class CannedUpdateRequest extends Request
|
|||||||
public function rules()
|
public function rules()
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'title' => 'required|min:2|max:50',
|
'title' => 'required|min:2|max:50',
|
||||||
'message' => 'required',
|
'message' => 'required',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
@@ -29,7 +29,7 @@ class CheckTicket extends Request
|
|||||||
public function rules()
|
public function rules()
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'email' => 'required|email',
|
'email' => 'required|email',
|
||||||
'ticket_number' => 'required',
|
'ticket_number' => 'required',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
@@ -38,12 +38,12 @@ class ClientRequest extends Request
|
|||||||
return $rules;
|
return $rules;
|
||||||
}
|
}
|
||||||
$current_rule = [
|
$current_rule = [
|
||||||
'Name' => 'required',
|
'Name' => 'required',
|
||||||
'Email' => 'required|email',
|
'Email' => 'required|email',
|
||||||
'Subject' => 'required',
|
'Subject' => 'required',
|
||||||
'Details' => 'required',
|
'Details' => 'required',
|
||||||
'mobile' => 'numeric',
|
'mobile' => 'numeric',
|
||||||
'Phone' => 'numeric',
|
'Phone' => 'numeric',
|
||||||
];
|
];
|
||||||
$custom_rule = $this->getCustomRule();
|
$custom_rule = $this->getCustomRule();
|
||||||
$rules = array_merge($current_rule, $custom_rule);
|
$rules = array_merge($current_rule, $custom_rule);
|
||||||
@@ -130,14 +130,14 @@ class ClientRequest extends Request
|
|||||||
$settings = $settings->select('status')->where('option_name', '=', 'send_otp')->first();
|
$settings = $settings->select('status')->where('option_name', '=', 'send_otp')->first();
|
||||||
$email_mandatory = $settings->select('status')->where('option_name', '=', 'email_mandatory')->first();
|
$email_mandatory = $settings->select('status')->where('option_name', '=', 'email_mandatory')->first();
|
||||||
if (($email_mandatory->status == 0 || $email_mandatory->status == '0')) {
|
if (($email_mandatory->status == 0 || $email_mandatory->status == '0')) {
|
||||||
if (! \Auth::check()) {
|
if (!\Auth::check()) {
|
||||||
return [
|
return [
|
||||||
'Name' => 'required',
|
'Name' => 'required',
|
||||||
'Email' => 'email',
|
'Email' => 'email',
|
||||||
'Subject' => 'required',
|
'Subject' => 'required',
|
||||||
'Details' => 'required',
|
'Details' => 'required',
|
||||||
'mobile' => 'required|numeric',
|
'mobile' => 'required|numeric',
|
||||||
'Phone' => 'numeric',
|
'Phone' => 'numeric',
|
||||||
];
|
];
|
||||||
} else {
|
} else {
|
||||||
return [
|
return [
|
||||||
|
@@ -24,8 +24,8 @@ class CommentRequest extends Request
|
|||||||
public function rules()
|
public function rules()
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'name' => 'required|max:10',
|
'name' => 'required|max:10',
|
||||||
'email' => 'required|email',
|
'email' => 'required|email',
|
||||||
'website' => 'url',
|
'website' => 'url',
|
||||||
'comment' => 'required|max:60',
|
'comment' => 'required|max:60',
|
||||||
];
|
];
|
||||||
|
@@ -30,9 +30,9 @@ class CompanyRequest extends Request
|
|||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'company_name' => 'required|max:50',
|
'company_name' => 'required|max:50',
|
||||||
'website' => 'url',
|
'website' => 'url',
|
||||||
'phone' => 'numeric',
|
'phone' => 'numeric',
|
||||||
'logo' => 'image',
|
'logo' => 'image',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -24,8 +24,8 @@ class ContactRequest extends Request
|
|||||||
public function rules()
|
public function rules()
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'name' => 'required',
|
'name' => 'required',
|
||||||
'email' => 'required|email',
|
'email' => 'required|email',
|
||||||
'subject' => 'required',
|
'subject' => 'required',
|
||||||
'message' => 'required|max:50',
|
'message' => 'required|max:50',
|
||||||
];
|
];
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user