update v 1.0.7.5
This commit is contained in:
@@ -191,6 +191,7 @@ class ApiController extends Controller
|
||||
*/
|
||||
public function ticketReply()
|
||||
{
|
||||
//dd($this->request->all());
|
||||
try {
|
||||
$v = \Validator::make($this->request->all(), [
|
||||
'ticket_ID' => 'required|exists:tickets,id',
|
||||
@@ -302,9 +303,9 @@ class ApiController extends Controller
|
||||
// return response()->json(compact('result'));
|
||||
|
||||
$result = $this->user->join('tickets', function ($join) {
|
||||
$join->on('users.id', '=', 'tickets.user_id')
|
||||
$join->on('users.id', '=', 'tickets.user_id')
|
||||
->where('isanswered', '=', 0)->where('status', '=', 1)->whereNull('assigned_to');
|
||||
})
|
||||
})
|
||||
->join('department', 'department.id', '=', 'tickets.dept_id')
|
||||
->join('ticket_priority', 'ticket_priority.priority_id', '=', 'tickets.priority_id')
|
||||
->join('sla_plan', 'sla_plan.id', '=', 'tickets.sla')
|
||||
@@ -347,9 +348,9 @@ class ApiController extends Controller
|
||||
// $result = $this->model->where('assigned_to', '=', null)->where('status', '1')->orderBy('id', 'DESC')->get();
|
||||
// return response()->json(compact('result'));
|
||||
$unassigned = $this->user->join('tickets', function ($join) {
|
||||
$join->on('users.id', '=', 'tickets.user_id')
|
||||
$join->on('users.id', '=', 'tickets.user_id')
|
||||
->whereNull('assigned_to')->where('status', '=', 1);
|
||||
})
|
||||
})
|
||||
->join('department', 'department.id', '=', 'tickets.dept_id')
|
||||
->join('ticket_priority', 'ticket_priority.priority_id', '=', 'tickets.priority_id')
|
||||
->join('sla_plan', 'sla_plan.id', '=', 'tickets.sla')
|
||||
@@ -392,9 +393,9 @@ class ApiController extends Controller
|
||||
// return response()->json(compact('result'));
|
||||
|
||||
$result = $this->user->join('tickets', function ($join) {
|
||||
$join->on('users.id', '=', 'tickets.user_id')
|
||||
$join->on('users.id', '=', 'tickets.user_id')
|
||||
->where('isanswered', '=', 0)->where('status', '>', 1)->where('status', '<', 4);
|
||||
})
|
||||
})
|
||||
->join('department', 'department.id', '=', 'tickets.dept_id')
|
||||
->join('ticket_priority', 'ticket_priority.priority_id', '=', 'tickets.priority_id')
|
||||
->join('sla_plan', 'sla_plan.id', '=', 'tickets.sla')
|
||||
@@ -1019,9 +1020,9 @@ class ApiController extends Controller
|
||||
{
|
||||
try {
|
||||
$trash = $this->user->join('tickets', function ($join) {
|
||||
$join->on('users.id', '=', 'tickets.user_id')
|
||||
$join->on('users.id', '=', 'tickets.user_id')
|
||||
->where('status', '=', 5);
|
||||
})
|
||||
})
|
||||
->join('department', 'department.id', '=', 'tickets.dept_id')
|
||||
->join('ticket_priority', 'ticket_priority.priority_id', '=', 'tickets.priority_id')
|
||||
->join('sla_plan', 'sla_plan.id', '=', 'tickets.sla')
|
||||
@@ -1070,9 +1071,9 @@ class ApiController extends Controller
|
||||
return response()->json(compact('error'));
|
||||
}
|
||||
$result = $this->user->join('tickets', function ($join) use ($id) {
|
||||
$join->on('users.id', '=', 'tickets.assigned_to')
|
||||
$join->on('users.id', '=', 'tickets.assigned_to')
|
||||
->where('user_id', '=', $id);
|
||||
})
|
||||
})
|
||||
->join('department', 'department.id', '=', 'tickets.dept_id')
|
||||
->join('ticket_priority', 'ticket_priority.priority_id', '=', 'tickets.priority_id')
|
||||
->join('sla_plan', 'sla_plan.id', '=', 'tickets.sla')
|
||||
@@ -1121,9 +1122,9 @@ class ApiController extends Controller
|
||||
return response()->json(compact('error'));
|
||||
}
|
||||
$result = $this->user->join('tickets', function ($join) use ($id) {
|
||||
$join->on('users.id', '=', 'tickets.user_id')
|
||||
$join->on('users.id', '=', 'tickets.user_id')
|
||||
->where('user_id', '=', $id);
|
||||
})
|
||||
})
|
||||
->join('department', 'department.id', '=', 'tickets.dept_id')
|
||||
->join('ticket_priority', 'ticket_priority.priority_id', '=', 'tickets.priority_id')
|
||||
->join('sla_plan', 'sla_plan.id', '=', 'tickets.sla')
|
||||
|
@@ -63,6 +63,17 @@ class InstallerApiController extends Controller
|
||||
|
||||
return ['response' => 'fail', 'reason' => $return_data, 'status' => '0'];
|
||||
}
|
||||
$path1 = base_path().DIRECTORY_SEPARATOR.'.env';
|
||||
$path2 = base_path().DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'database.php';
|
||||
$path3 = base_path().DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'Http'.DIRECTORY_SEPARATOR.'routes.php';
|
||||
$path4 = base_path().DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'lfm.php';
|
||||
$f1 = substr(sprintf('%o', fileperms($path1)), -3);
|
||||
$f2 = substr(sprintf('%o', fileperms($path2)), -3);
|
||||
$f3 = substr(sprintf('%o', fileperms($path3)), -3);
|
||||
$f4 = substr(sprintf('%o', fileperms($path4)), -3);
|
||||
if ($f1 != '777' || $f2 != '777' || $f3 != '777' || $f4 != '777') {
|
||||
return ['response' => 'fail', 'reason' => 'File permission issue.', 'status' => '0'];
|
||||
}
|
||||
// dd($validator->messages());
|
||||
// error_reporting(E_ALL & ~E_NOTICE);
|
||||
// Check for pre install
|
||||
@@ -214,9 +225,16 @@ class InstallerApiController extends Controller
|
||||
$content24 = File::get($path23);
|
||||
$content23 = str_replace('"%smtplink%"', $smtpfilepath, $content23);
|
||||
$content24 = str_replace("'%url%'", $lfmpath, $content24);
|
||||
$link = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
|
||||
$pos = strpos($link, 'api/v1/system-config');
|
||||
$link = substr($link, 0, $pos);
|
||||
$app_url = app_path('../config/app.php');
|
||||
$datacontent2 = File::get($app_url);
|
||||
$datacontent2 = str_replace('http://localhost', $link, $datacontent2);
|
||||
File::put($app_url, $datacontent2);
|
||||
File::put($path22, $content23);
|
||||
File::put($path23, $content24);
|
||||
|
||||
Artisan::call('key:generate');
|
||||
// If user created return success
|
||||
if ($user) {
|
||||
return ['response' => 'success', 'status' => '1'];
|
||||
|
@@ -269,11 +269,16 @@ class TicketController extends Controller
|
||||
try {
|
||||
$check_attachment = null;
|
||||
$eventthread = $thread->where('ticket_id', $request->input('ticket_ID'))->first();
|
||||
//dd($request->input('ticket_ID'));
|
||||
//dd($eventthread);
|
||||
$eventuserid = $eventthread->user_id;
|
||||
$emailadd = User::where('id', $eventuserid)->first()->email;
|
||||
//dd($emailadd);
|
||||
$source = $eventthread->source;
|
||||
|
||||
$form_data = $request->except('reply_content', 'ticket_ID', 'attachment');
|
||||
\Event::fire(new \App\Events\ClientTicketFormPost($form_data, $emailadd, $source));
|
||||
//dd('yes');
|
||||
$reply_content = $request->input('reply_content');
|
||||
$thread->ticket_id = $request->input('ticket_ID');
|
||||
$thread->poster = 'support';
|
||||
@@ -333,10 +338,16 @@ class TicketController extends Controller
|
||||
// // }
|
||||
// // }
|
||||
// }, true);
|
||||
|
||||
//dd('reply');
|
||||
/*
|
||||
* Getting the subject of the thread
|
||||
*/
|
||||
//dd($eventthread);
|
||||
try {
|
||||
$this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('0', $ticketdata->dept_id), $to = ['name' => $username, 'email' => $emailadd], $message = ['subject' => $updated_subject, 'scenario' => 'create-ticket-by-agent', 'body' => $body], $template_variables = ['agent_sign' => Auth::user()->agent_sign, 'ticket_number' => $ticket_number2]);
|
||||
$re = $this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('0', $tickets->dept_id), $to = ['name' => $user_name, 'email' => $email], $message = ['subject' => $eventthread->title, 'scenario' => 'create-ticket-by-agent', 'body' => $thread->body], $template_variables = ['agent_sign' => Auth::user()->agent_sign, 'ticket_number' => $tickets->number]);
|
||||
//dd($re);
|
||||
} catch (\Exception $e) {
|
||||
throw new \Exception($e->getMessage());
|
||||
}
|
||||
|
||||
$collaborators = Ticket_Collaborator::where('ticket_id', '=', $ticket_id)->get();
|
||||
@@ -368,6 +379,7 @@ class TicketController extends Controller
|
||||
|
||||
return $thread;
|
||||
} catch (\Exception $e) {
|
||||
//dd($e);
|
||||
return $e->getMessage();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user