Bug fix and Api updates
This commit is contained in:
10
.env
10
.env
@@ -1,9 +1,9 @@
|
||||
APP_ENV=local
|
||||
APP_DEBUG=true
|
||||
APP_DEBUG=false
|
||||
APP_KEY=SomeRandomString
|
||||
DB_HOST=localhost
|
||||
DB_DATABASE=faveo1.0.6
|
||||
DB_USERNAME=root
|
||||
DB_HOST=
|
||||
DB_DATABASE=
|
||||
DB_USERNAME=
|
||||
DB_PASSWORD=
|
||||
CACHE_DRIVER=file
|
||||
SESSION_DRIVER=file
|
||||
@@ -13,5 +13,5 @@ MAIL_HOST=mailtrap.io
|
||||
MAIL_PORT=2525
|
||||
MAIL_USERNAME=null
|
||||
MAIL_PASSWORD=null
|
||||
DB_TYPE=mysql
|
||||
DB_TYPE=
|
||||
DB_PORT=
|
||||
|
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,3 +1,4 @@
|
||||
/node_modules
|
||||
Homestead.yaml
|
||||
Homestead.json
|
||||
Homestead.json
|
||||
/nbproject/private/
|
@@ -735,15 +735,15 @@ class TicketController extends Controller {
|
||||
$eventuserid = $eventthread->user_id;
|
||||
$emailadd = User::where('id', $eventuserid)->first()->email;
|
||||
$source = $eventthread->source;
|
||||
$form_data = $request->except('ReplyContent', 'ticket_ID', 'attachment');
|
||||
$form_data = $request->except('reply_content', 'ticket_ID', 'attachment');
|
||||
\Event::fire(new \App\Events\ClientTicketFormPost($form_data, $emailadd, $source));
|
||||
// dd($attachments);
|
||||
// }
|
||||
//return $attachments;
|
||||
$reply_content = $request->input('ReplyContent');
|
||||
$reply_content = $request->input('reply_content');
|
||||
$thread->ticket_id = $request->input('ticket_ID');
|
||||
$thread->poster = 'support';
|
||||
$thread->body = $request->input('ReplyContent');
|
||||
$thread->body = $request->input('reply_content');
|
||||
$thread->user_id = Auth::user()->id;
|
||||
$ticket_id = $request->input('ticket_ID');
|
||||
//dd($ticket_id);
|
||||
@@ -828,7 +828,7 @@ class TicketController extends Controller {
|
||||
|
||||
try {
|
||||
$this->PhpMailController->sendmail(
|
||||
$from = $this->PhpMailController->mailfrom('1', '0'), $to = ['name' => $user_name, 'email' => $email, 'cc' => $collaborators], $message = ['subject' => $ticket_subject . '[#' . $ticket_number . ']', 'body' => $request->input('ReplyContent'), 'scenario' => 'ticket-reply-agent', 'attachments' => $attachment_files], $template_variables = ['ticket_number' => $ticket_number, 'user' => $username, 'agent_sign' => $agentsign]
|
||||
$from = $this->PhpMailController->mailfrom('1', '0'), $to = ['name' => $user_name, 'email' => $email, 'cc' => $collaborators], $message = ['subject' => $ticket_subject . '[#' . $ticket_number . ']', 'body' => $request->input('reply_content'), 'scenario' => 'ticket-reply-agent', 'attachments' => $attachment_files], $template_variables = ['ticket_number' => $ticket_number, 'user' => $username, 'agent_sign' => $agentsign]
|
||||
);
|
||||
} catch (\Exception $e) {
|
||||
return 0;
|
||||
@@ -843,7 +843,7 @@ class TicketController extends Controller {
|
||||
* @param type Ticket_Thread $thread
|
||||
* @return type bool
|
||||
*/
|
||||
public function ticket_edit_post($ticket_id, Ticket_Thread $thread, Tickets $ticket) {
|
||||
public function ticketEditPost($ticket_id, Ticket_Thread $thread, Tickets $ticket) {
|
||||
|
||||
if (Input::get('subject') == null) {
|
||||
return 1;
|
||||
@@ -887,7 +887,7 @@ class TicketController extends Controller {
|
||||
* @param type $ticket_number
|
||||
* @return type integer
|
||||
*/
|
||||
public function ticket_number($ticket_number) {
|
||||
public function ticketNumber($ticket_number) {
|
||||
$number = $ticket_number;
|
||||
$number = explode('-', $number);
|
||||
$number1 = $number[0];
|
||||
@@ -917,7 +917,7 @@ class TicketController extends Controller {
|
||||
* @param type $email
|
||||
* @return type bool
|
||||
*/
|
||||
public function check_email($email) {
|
||||
public function checkEmail($email) {
|
||||
$check = User::where('email', '=', $email)->first();
|
||||
if ($check == true) {
|
||||
return $check;
|
||||
@@ -948,7 +948,7 @@ class TicketController extends Controller {
|
||||
|
||||
// check emails
|
||||
$ticket_creator = $username;
|
||||
$checkemail = $this->check_email($emailadd);
|
||||
$checkemail = $this->checkEmail($emailadd);
|
||||
$company = $this->company();
|
||||
if ($checkemail == false) {
|
||||
// Generate password
|
||||
@@ -1173,16 +1173,16 @@ class TicketController extends Controller {
|
||||
$ticket_threads->save();
|
||||
}
|
||||
if (isset($id)) {
|
||||
if ($this->ticket_thread($subject, $body, $id, $user_id)) {
|
||||
if ($this->ticketThread($subject, $body, $id, $user_id)) {
|
||||
return array($ticket_number, 1);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$ticket_number = $this->create_ticket($user_id, $subject, $body, $helptopic, $sla, $priority, $source, $headers, $dept, $assignto, $form_data);
|
||||
$ticket_number = $this->createTicket($user_id, $subject, $body, $helptopic, $sla, $priority, $source, $headers, $dept, $assignto, $form_data);
|
||||
return array($ticket_number, 0);
|
||||
}
|
||||
} else {
|
||||
$ticket_number = $this->create_ticket($user_id, $subject, $body, $helptopic, $sla, $priority, $source, $headers, $dept, $assignto, $form_data);
|
||||
$ticket_number = $this->createTicket($user_id, $subject, $body, $helptopic, $sla, $priority, $source, $headers, $dept, $assignto, $form_data);
|
||||
return array($ticket_number, 0);
|
||||
}
|
||||
}
|
||||
@@ -1197,7 +1197,7 @@ class TicketController extends Controller {
|
||||
* @param type $priority
|
||||
* @return type string
|
||||
*/
|
||||
public function create_ticket($user_id, $subject, $body, $helptopic, $sla, $priority, $source, $headers, $dept, $assignto, $form_data) {
|
||||
public function createTicket($user_id, $subject, $body, $helptopic, $sla, $priority, $source, $headers, $dept, $assignto, $form_data) {
|
||||
$max_number = Tickets::whereRaw('id = (select max(`id`) from tickets)')->first();
|
||||
if ($max_number == null) {
|
||||
$ticket_number = "AAAA-9999-9999999";
|
||||
@@ -1209,7 +1209,7 @@ class TicketController extends Controller {
|
||||
|
||||
|
||||
$ticket = new Tickets;
|
||||
$ticket->ticket_number = $this->ticket_number($ticket_number);
|
||||
$ticket->ticket_number = $this->ticketNumber($ticket_number);
|
||||
$ticket->user_id = $user_id;
|
||||
$ticket->dept_id = $dept;
|
||||
$ticket->help_topic_id = $helptopic;
|
||||
@@ -1251,8 +1251,8 @@ class TicketController extends Controller {
|
||||
}
|
||||
// store collaborators
|
||||
// dd($headers);
|
||||
$this->store_collaborators($headers, $id);
|
||||
if ($this->ticket_thread($subject, $body, $id, $user_id) == true) {
|
||||
$this->storeCollaborators($headers, $id);
|
||||
if ($this->ticketThread($subject, $body, $id, $user_id) == true) {
|
||||
return $ticket_number;
|
||||
}
|
||||
}
|
||||
@@ -1265,7 +1265,7 @@ class TicketController extends Controller {
|
||||
* @param type $user_id
|
||||
* @return type
|
||||
*/
|
||||
public function ticket_thread($subject, $body, $id, $user_id) {
|
||||
public function ticketThread($subject, $body, $id, $user_id) {
|
||||
$thread = new Ticket_Thread;
|
||||
$thread->user_id = $user_id;
|
||||
$thread->ticket_id = $id;
|
||||
@@ -1601,7 +1601,7 @@ class TicketController extends Controller {
|
||||
* @param type $headers
|
||||
* @return type
|
||||
*/
|
||||
public function store_collaborators($headers, $id) {
|
||||
public function storeCollaborators($headers, $id) {
|
||||
$company = $this->company();
|
||||
if (isset($headers)) {
|
||||
foreach ($headers as $email => $name) {
|
||||
@@ -1610,7 +1610,7 @@ class TicketController extends Controller {
|
||||
}
|
||||
$name = $name;
|
||||
$email = $email;
|
||||
if ($this->check_email($email) == false) {
|
||||
if ($this->checkEmail($email) == false) {
|
||||
$create_user = new User;
|
||||
$create_user->user_name = $name;
|
||||
$create_user->email = $email;
|
||||
@@ -1636,7 +1636,7 @@ class TicketController extends Controller {
|
||||
|
||||
}
|
||||
} else {
|
||||
$user = $this->check_email($email);
|
||||
$user = $this->checkEmail($email);
|
||||
$user_id = $user->id;
|
||||
}
|
||||
$collaborator_store = new Ticket_Collaborator;
|
||||
|
@@ -19,6 +19,7 @@ use App\Model\helpdesk\Manage\Sla_plan;
|
||||
use App\Model\helpdesk\Utility\Priority;
|
||||
use App\Model\helpdesk\Agent\Department;
|
||||
use App\Model\helpdesk\Ticket\Ticket_source;
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
* -----------------------------------------------------------------------------
|
||||
@@ -111,7 +112,7 @@ class ApiController extends Controller {
|
||||
* @param user_id,subject,body,helptopic,sla,priority,dept
|
||||
* @return json
|
||||
*/
|
||||
public function CreateTicket() {
|
||||
public function createTicket() {
|
||||
try {
|
||||
$v = \Validator::make($this->request->all(), [
|
||||
'user_id' => 'required|exists:users,id',
|
||||
@@ -145,7 +146,7 @@ class ApiController extends Controller {
|
||||
/**
|
||||
* return s ticket number
|
||||
*/
|
||||
$response = $this->ticket->create_ticket($user_id, $subject, $body, $helptopic, $sla, $priority, $source, $headers, $dept, $assignto, $form_data, $attach);
|
||||
$response = $this->ticket->createTicket($user_id, $subject, $body, $helptopic, $sla, $priority, $source, $headers, $dept, $assignto, $form_data, $attach);
|
||||
|
||||
/**
|
||||
* return ticket details
|
||||
@@ -170,11 +171,11 @@ class ApiController extends Controller {
|
||||
* @param TicketRequest $request
|
||||
* @return json
|
||||
*/
|
||||
public function TicketReply() {
|
||||
public function ticketReply() {
|
||||
try {
|
||||
$v = \Validator::make($this->request->all(), [
|
||||
'ticket_ID' => 'required|exists:tickets,id',
|
||||
'ReplyContent' => 'required',
|
||||
'reply_content' => 'required',
|
||||
]);
|
||||
if ($v->fails()) {
|
||||
$error = $v->errors();
|
||||
@@ -198,7 +199,7 @@ class ApiController extends Controller {
|
||||
* Edit a ticket
|
||||
* @return json
|
||||
*/
|
||||
public function EditTicket() {
|
||||
public function editTicket() {
|
||||
try {
|
||||
$v = \Validator::make($this->request->all(), [
|
||||
'ticket_id' => 'required|exists:tickets,id',
|
||||
@@ -213,7 +214,7 @@ class ApiController extends Controller {
|
||||
return response()->json(compact('error'));
|
||||
}
|
||||
$ticket_id = $this->request->input('ticket_id');
|
||||
$result = $this->ticket->ticket_edit_post($ticket_id, $this->thread, $this->model);
|
||||
$result = $this->ticket->ticketEditPost($ticket_id, $this->thread, $this->model);
|
||||
return response()->json(compact('result'));
|
||||
} catch (\Exception $e) {
|
||||
$error = $e->getMessage();
|
||||
@@ -230,7 +231,7 @@ class ApiController extends Controller {
|
||||
* Delete The Ticket
|
||||
* @return json
|
||||
*/
|
||||
public function DeleteTicket() {
|
||||
public function deleteTicket() {
|
||||
try {
|
||||
$v = \Validator::make($this->request->all(), [
|
||||
'ticket_id' => 'required|exists:tickets,id',
|
||||
@@ -258,10 +259,31 @@ class ApiController extends Controller {
|
||||
* Get all opened tickets
|
||||
* @return json
|
||||
*/
|
||||
public function OpenedTickets() {
|
||||
public function openedTickets() {
|
||||
try {
|
||||
$result = $this->model->where('status', '=', 1)->where('isanswered', '=', 0)->where('assigned_to', '=', null)->orderBy('id', 'DESC')->get();
|
||||
return response()->json(compact('result'));
|
||||
// $result = $this->model->where('status', '=', 1)->where('isanswered', '=', 0)->where('assigned_to', '=', null)->orderBy('id', 'DESC')->get();
|
||||
// return response()->json(compact('result'));
|
||||
|
||||
$result = $this->user->join('tickets', function($join) {
|
||||
$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')
|
||||
->join('help_topic', 'help_topic.id', '=', 'tickets.help_topic_id')
|
||||
->join('ticket_status', 'ticket_status.id', '=', 'tickets.status')
|
||||
->join('ticket_thread', function($join) {
|
||||
$join->on('tickets.id', '=', 'ticket_thread.ticket_id')
|
||||
->whereNotNull('title');
|
||||
})
|
||||
->select('first_name', 'last_name', 'email', 'profile_pic', 'ticket_number', 'tickets.id', 'title', 'tickets.created_at', 'department.name as department_name', 'ticket_priority.priority as priotity_name', 'sla_plan.name as sla_plan_name', 'help_topic.topic as help_topic_name', 'ticket_status.name as ticket_status_name')
|
||||
->groupby('tickets.id')
|
||||
->distinct()
|
||||
->paginate(10)
|
||||
->toJson();
|
||||
return $result;
|
||||
|
||||
} catch (\Exception $e) {
|
||||
$error = $e->getMessage();
|
||||
$line = $e->getLine();
|
||||
@@ -277,10 +299,30 @@ class ApiController extends Controller {
|
||||
* Get Unsigned Tickets
|
||||
* @return json
|
||||
*/
|
||||
public function UnassignedTickets() {
|
||||
public function unassignedTickets() {
|
||||
try {
|
||||
$result = $this->model->where('assigned_to', '=', null)->where('status', '1')->orderBy('id', 'DESC')->get();
|
||||
return response()->json(compact('result'));
|
||||
//dd('sdhjbc');
|
||||
// $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')
|
||||
->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')
|
||||
->join('help_topic', 'help_topic.id', '=', 'tickets.help_topic_id')
|
||||
->join('ticket_status', 'ticket_status.id', '=', 'tickets.status')
|
||||
->join('ticket_thread', function($join) {
|
||||
$join->on('tickets.id', '=', 'ticket_thread.ticket_id')
|
||||
->whereNotNull('title');
|
||||
})
|
||||
->select('first_name', 'last_name', 'email', 'profile_pic', 'ticket_number', 'tickets.id', 'title', 'tickets.created_at', 'department.name as department_name', 'ticket_priority.priority as priotity_name', 'sla_plan.name as sla_plan_name', 'help_topic.topic as help_topic_name', 'ticket_status.name as ticket_status_name')
|
||||
->groupby('tickets.id')
|
||||
->distinct()
|
||||
->paginate(10)
|
||||
->toJson();
|
||||
return $unassigned;
|
||||
} catch (\Exception $e) {
|
||||
$error = $e->getMessage();
|
||||
$line = $e->getLine();
|
||||
@@ -296,10 +338,30 @@ class ApiController extends Controller {
|
||||
* Get closed Tickets
|
||||
* @return json
|
||||
*/
|
||||
public function CloseTickets() {
|
||||
public function closeTickets() {
|
||||
try {
|
||||
$result = $this->model->where('status', '>', 1)->where('status', '<', 4)->orderBy('id', 'DESC')->get();
|
||||
return response()->json(compact('result'));
|
||||
// $result = $this->model->where('status', '>', 1)->where('status', '<', 4)->orderBy('id', 'DESC')->get();
|
||||
// return response()->json(compact('result'));
|
||||
|
||||
$result = $this->user->join('tickets', function($join) {
|
||||
$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')
|
||||
->join('help_topic', 'help_topic.id', '=', 'tickets.help_topic_id')
|
||||
->join('ticket_status', 'ticket_status.id', '=', 'tickets.status')
|
||||
->join('ticket_thread', function($join) {
|
||||
$join->on('tickets.id', '=', 'ticket_thread.ticket_id')
|
||||
->whereNotNull('title');
|
||||
})
|
||||
->select('first_name', 'last_name', 'email', 'profile_pic', 'ticket_number', 'tickets.id', 'title', 'tickets.created_at', 'department.name as department_name', 'ticket_priority.priority as priotity_name', 'sla_plan.name as sla_plan_name', 'help_topic.topic as help_topic_name', 'ticket_status.name as ticket_status_name')
|
||||
->groupby('tickets.id')
|
||||
->distinct()
|
||||
->paginate(10)
|
||||
->toJson();
|
||||
return $result;
|
||||
} catch (\Exception $e) {
|
||||
$error = $e->getMessage();
|
||||
$line = $e->getLine();
|
||||
@@ -315,7 +377,7 @@ class ApiController extends Controller {
|
||||
* Get All agents
|
||||
* @return json
|
||||
*/
|
||||
public function GetAgents() {
|
||||
public function getAgents() {
|
||||
try {
|
||||
$result = $this->faveoUser->where('role', 'agent')->orWhere('role', 'admin')->where('active', 1)->get();
|
||||
return response()->json(compact('result'));
|
||||
@@ -334,7 +396,7 @@ class ApiController extends Controller {
|
||||
* Get All Teams
|
||||
* @return json
|
||||
*/
|
||||
public function GetTeams() {
|
||||
public function getTeams() {
|
||||
try {
|
||||
$result = $this->team->get();
|
||||
return response()->json(compact('result'));
|
||||
@@ -353,7 +415,7 @@ class ApiController extends Controller {
|
||||
* To assign a ticket
|
||||
* @return json
|
||||
*/
|
||||
public function AssignTicket() {
|
||||
public function assignTicket() {
|
||||
try {
|
||||
$v = \Validator::make($this->request->all(), [
|
||||
'ticket_id' => 'required',
|
||||
@@ -386,7 +448,7 @@ class ApiController extends Controller {
|
||||
* Get all customers
|
||||
* @return json
|
||||
*/
|
||||
public function GetCustomers() {
|
||||
public function getCustomers() {
|
||||
try {
|
||||
$v = \Validator::make($this->request->all(), [
|
||||
'search' => 'required',
|
||||
@@ -413,7 +475,7 @@ class ApiController extends Controller {
|
||||
* Get a customer by id
|
||||
* @return json
|
||||
*/
|
||||
public function GetCustomer() {
|
||||
public function getCustomer() {
|
||||
try {
|
||||
$v = \Validator::make($this->request->all(), [
|
||||
'user_id' => 'required',
|
||||
@@ -440,7 +502,7 @@ class ApiController extends Controller {
|
||||
* Search tickets
|
||||
* @return json
|
||||
*/
|
||||
public function SearchTicket() {
|
||||
public function searchTicket() {
|
||||
try {
|
||||
$v = \Validator::make($this->request->all(), [
|
||||
'search' => 'required',
|
||||
@@ -467,7 +529,7 @@ class ApiController extends Controller {
|
||||
* Get threads of a ticket
|
||||
* @return json
|
||||
*/
|
||||
public function TicketThreads() {
|
||||
public function ticketThreads() {
|
||||
try {
|
||||
$v = \Validator::make($this->request->all(), [
|
||||
'id' => 'required',
|
||||
@@ -479,7 +541,7 @@ class ApiController extends Controller {
|
||||
$id = $this->request->input('id');
|
||||
$result = $this->thread->where('ticket_id', $id)->get();
|
||||
return response()->json(compact('result'));
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
$error = $e->getMessage();
|
||||
$line = $e->getLine();
|
||||
$file = $e->getFile();
|
||||
@@ -494,7 +556,7 @@ class ApiController extends Controller {
|
||||
* Check the url is valid or not
|
||||
* @return json
|
||||
*/
|
||||
public function CheckUrl() {
|
||||
public function checkUrl() {
|
||||
//dd($this->request);
|
||||
try {
|
||||
$v = \Validator::make($this->request->all(), [
|
||||
@@ -506,11 +568,11 @@ class ApiController extends Controller {
|
||||
}
|
||||
|
||||
$url = $this->request->input('url');
|
||||
$url = $url . "/api/v1/helpdesk/check-url?api-key=" . $this->request->input('api-key') . "&token=" . \Config::get('app.token');
|
||||
$url = $url . "/api/v1/helpdesk/check-url?api_key=" . $this->request->input('api_key') . "&token=" . \Config::get('app.token');
|
||||
$result = $this->CallGetApi($url);
|
||||
//dd($result);
|
||||
return response()->json(compact('result'));
|
||||
} catch (Exception $ex) {
|
||||
} catch (\Exception $ex) {
|
||||
$error = $e->getMessage();
|
||||
return response()->json(compact('error'));
|
||||
} catch (\TokenExpiredException $e) {
|
||||
@@ -523,7 +585,7 @@ class ApiController extends Controller {
|
||||
* Success for currect url
|
||||
* @return string
|
||||
*/
|
||||
public function UrlResult() {
|
||||
public function urlResult() {
|
||||
return "success";
|
||||
}
|
||||
|
||||
@@ -532,7 +594,7 @@ class ApiController extends Controller {
|
||||
* @param type $url
|
||||
* @return type int|string|json
|
||||
*/
|
||||
public function CallGetApi($url) {
|
||||
public function callGetApi($url) {
|
||||
|
||||
$curl = curl_init($url);
|
||||
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
|
||||
@@ -555,7 +617,7 @@ class ApiController extends Controller {
|
||||
* @param type $data
|
||||
* @return type int|string|json
|
||||
*/
|
||||
public function CallPostApi($url, $data) {
|
||||
public function callPostApi($url, $data) {
|
||||
|
||||
$curl = curl_init($url);
|
||||
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
|
||||
@@ -578,7 +640,7 @@ class ApiController extends Controller {
|
||||
*
|
||||
* @return type | json
|
||||
*/
|
||||
public function GenerateApiKey() {
|
||||
public function generateApiKey() {
|
||||
try {
|
||||
$set = $this->setting->where('id', '1')->first();
|
||||
//dd($set);
|
||||
@@ -592,7 +654,7 @@ class ApiController extends Controller {
|
||||
$result = 'please enable api';
|
||||
return response()->json(compact('result'));
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
$error = $e->getMessage();
|
||||
$line = $e->getLine();
|
||||
$file = $e->getFile();
|
||||
@@ -607,11 +669,11 @@ class ApiController extends Controller {
|
||||
* Get help topics
|
||||
* @return json
|
||||
*/
|
||||
public function GetHelpTopic() {
|
||||
public function getHelpTopic() {
|
||||
try {
|
||||
$result = $this->helptopic->get();
|
||||
return response()->json(compact('result'));
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
$error = $e->getMessage();
|
||||
$line = $e->getLine();
|
||||
$file = $e->getFile();
|
||||
@@ -626,11 +688,11 @@ class ApiController extends Controller {
|
||||
* Get Sla plans
|
||||
* @return json
|
||||
*/
|
||||
public function GetSlaPlan() {
|
||||
public function getSlaPlan() {
|
||||
try {
|
||||
$result = $this->slaPlan->get();
|
||||
return response()->json(compact('result'));
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
$error = $e->getMessage();
|
||||
$line = $e->getLine();
|
||||
$file = $e->getFile();
|
||||
@@ -645,11 +707,11 @@ class ApiController extends Controller {
|
||||
* Get priorities
|
||||
* @return json
|
||||
*/
|
||||
public function GetPriority() {
|
||||
public function getPriority() {
|
||||
try {
|
||||
$result = $this->priority->get();
|
||||
return response()->json(compact('result'));
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
$error = $e->getMessage();
|
||||
$line = $e->getLine();
|
||||
$file = $e->getFile();
|
||||
@@ -664,11 +726,11 @@ class ApiController extends Controller {
|
||||
* Get departments
|
||||
* @return json
|
||||
*/
|
||||
public function GetDepartment() {
|
||||
public function getDepartment() {
|
||||
try {
|
||||
$result = $this->department->get();
|
||||
return response()->json(compact('result'));
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
$error = $e->getMessage();
|
||||
$line = $e->getLine();
|
||||
$file = $e->getFile();
|
||||
@@ -683,12 +745,12 @@ class ApiController extends Controller {
|
||||
* Getting the tickets
|
||||
* @return type json
|
||||
*/
|
||||
public function GetTickets() {
|
||||
public function getTickets() {
|
||||
try {
|
||||
$tickets = $this->model->paginate(10);
|
||||
$tickets->toJson();
|
||||
return $tickets;
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
$error = $e->getMessage();
|
||||
$line = $e->getLine();
|
||||
$file = $e->getFile();
|
||||
@@ -703,11 +765,11 @@ class ApiController extends Controller {
|
||||
* Fetching the Inbox details
|
||||
* @return type json
|
||||
*/
|
||||
public function Inbox() {
|
||||
public function inbox() {
|
||||
try {
|
||||
$result = $this->user->join('tickets', 'users.id', '=', 'tickets.user_id')
|
||||
$inbox = $this->user->join('tickets', 'users.id', '=', 'tickets.user_id')
|
||||
->join('department', 'department.id', '=', 'tickets.dept_id')
|
||||
->join('priority', 'priority.id', '=', 'tickets.priority_id')
|
||||
->join('ticket_priority', 'ticket_priority.priority_id', '=', 'tickets.priority_id')
|
||||
->join('sla_plan', 'sla_plan.id', '=', 'tickets.sla')
|
||||
->join('help_topic', 'help_topic.id', '=', 'tickets.help_topic_id')
|
||||
->join('ticket_status', 'ticket_status.id', '=', 'tickets.status')
|
||||
@@ -715,17 +777,20 @@ class ApiController extends Controller {
|
||||
$join->on('tickets.id', '=', 'ticket_thread.ticket_id')
|
||||
->whereNotNull('title');
|
||||
})
|
||||
->select('first_name', 'last_name', 'email', 'profile_pic', 'ticket_number', 'tickets.id', 'title', 'tickets.created_at', 'department.name as department_name', 'priority.name as priotity_name', 'sla_plan.name as sla_plan_name', 'help_topic.topic as help_topic_name', 'ticket_status.name as ticket_status_name')
|
||||
->select('first_name', 'last_name', 'email', 'profile_pic', 'ticket_number', 'tickets.id', 'title', 'tickets.created_at', 'department.name as department_name', 'ticket_priority.priority as priotity_name', 'sla_plan.name as sla_plan_name', 'help_topic.topic as help_topic_name', 'ticket_status.name as ticket_status_name')
|
||||
->groupby('tickets.id')
|
||||
->distinct()
|
||||
->paginate(10)
|
||||
->toJson();
|
||||
return $result;
|
||||
} catch (Exception $ex) {
|
||||
return $inbox;
|
||||
} catch (\Exception $ex) {
|
||||
$error = $e->getMessage();
|
||||
$line = $e->getLine();
|
||||
$file = $e->getFile();
|
||||
return response()->json(compact('error', 'file', 'line'));
|
||||
}catch (\TokenExpiredException $e) {
|
||||
$error = $e->getMessage();
|
||||
return response()->json(compact('error'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -733,7 +798,7 @@ class ApiController extends Controller {
|
||||
* Create internal note
|
||||
* @return type json
|
||||
*/
|
||||
public function InternalNote() {
|
||||
public function internalNote() {
|
||||
try {
|
||||
$v = \Validator::make($this->request->all(), [
|
||||
'userid' => 'required|exists:users,id',
|
||||
@@ -750,11 +815,94 @@ class ApiController extends Controller {
|
||||
$body = $this->request->input('body');
|
||||
$thread = $this->thread->create(['ticket_id' => $ticketid, 'user_id' => $userid, 'is_internal' => 1, 'body' => $body]);
|
||||
return response()->json(compact('thread'));
|
||||
} catch (Exception $ex) {
|
||||
} catch (\Exception $ex) {
|
||||
$error = $e->getMessage();
|
||||
$line = $e->getLine();
|
||||
$file = $e->getFile();
|
||||
return response()->json(compact('error', 'file', 'line'));
|
||||
}catch (\TokenExpiredException $e) {
|
||||
$error = $e->getMessage();
|
||||
return response()->json(compact('error'));
|
||||
}
|
||||
}
|
||||
|
||||
public function getTrash(){
|
||||
try{
|
||||
$trash = $this->user->join('tickets', function($join) {
|
||||
$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')
|
||||
->join('help_topic', 'help_topic.id', '=', 'tickets.help_topic_id')
|
||||
->join('ticket_status', 'ticket_status.id', '=', 'tickets.status')
|
||||
->join('ticket_thread', function($join) {
|
||||
$join->on('tickets.id', '=', 'ticket_thread.ticket_id')
|
||||
->whereNotNull('title');
|
||||
})
|
||||
->select('first_name', 'last_name', 'email', 'profile_pic', 'ticket_number', 'tickets.id', 'title', 'tickets.created_at', 'department.name as department_name', 'ticket_priority.priority as priotity_name', 'sla_plan.name as sla_plan_name', 'help_topic.topic as help_topic_name', 'ticket_status.name as ticket_status_name')
|
||||
->groupby('tickets.id')
|
||||
->distinct()
|
||||
->paginate(10)
|
||||
->toJson();
|
||||
return $trash;
|
||||
|
||||
|
||||
} catch (\Exception $e) {
|
||||
$error = $e->getMessage();
|
||||
$line = $e->getLine();
|
||||
$file = $e->getFile();
|
||||
return response()->json(compact('error', 'file', 'line'));
|
||||
}catch (\TokenExpiredException $e) {
|
||||
$error = $e->getMessage();
|
||||
return response()->json(compact('error'));
|
||||
}
|
||||
}
|
||||
public function getMyTickets(){
|
||||
|
||||
try{
|
||||
$v = \Validator::make($this->request->all(), [
|
||||
'user_id' => 'required|exists:users,id'
|
||||
]);
|
||||
if ($v->fails()) {
|
||||
$error = $v->errors();
|
||||
return response()->json(compact('error'));
|
||||
}
|
||||
$id = $this->request->input('user_id');
|
||||
if($this->user->where('id',$id)->first()->role=='user'){
|
||||
$error = "This user is not an Aget or Admin";
|
||||
return response()->json(compact('error'));
|
||||
}
|
||||
$result = $this->user->join('tickets', function($join) use($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')
|
||||
->join('help_topic', 'help_topic.id', '=', 'tickets.help_topic_id')
|
||||
->join('ticket_status', 'ticket_status.id', '=', 'tickets.status')
|
||||
->join('ticket_thread', function($join) {
|
||||
$join->on('tickets.id', '=', 'ticket_thread.ticket_id')
|
||||
->whereNotNull('title');
|
||||
})
|
||||
->select('first_name', 'last_name', 'email', 'profile_pic', 'ticket_number', 'tickets.id', 'title', 'tickets.created_at', 'department.name as department_name', 'ticket_priority.priority as priotity_name', 'sla_plan.name as sla_plan_name', 'help_topic.topic as help_topic_name', 'ticket_status.name as ticket_status_name')
|
||||
->groupby('tickets.id')
|
||||
->distinct()
|
||||
->paginate(10)
|
||||
->toJson();
|
||||
return $result;
|
||||
|
||||
|
||||
} catch (\Exception $e) {
|
||||
$error = $e->getMessage();
|
||||
$line = $e->getLine();
|
||||
$file = $e->getFile();
|
||||
return response()->json(compact('error', 'file', 'line'));
|
||||
}catch (\TokenExpiredException $e) {
|
||||
$error = $e->getMessage();
|
||||
return response()->json(compact('error'));
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -5,6 +5,7 @@ namespace App\Http\Controllers\Api\v1;
|
||||
use App\Http\Requests;
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
use Exception;
|
||||
|
||||
class TestController extends Controller {
|
||||
|
||||
@@ -20,7 +21,7 @@ class TestController extends Controller {
|
||||
$this->server = "http://" . $_SERVER['HTTP_HOST'] . $server['path'] . "/";
|
||||
}
|
||||
|
||||
static function CallGetApi($url) {
|
||||
static function callGetApi($url) {
|
||||
//dd($url);
|
||||
$curl = curl_init($url);
|
||||
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
|
||||
@@ -37,7 +38,7 @@ class TestController extends Controller {
|
||||
curl_close($curl);
|
||||
}
|
||||
|
||||
static function CallPostApi($url, $data) {
|
||||
static function callPostApi($url, $data) {
|
||||
//dd($url);
|
||||
$curl = curl_init($url);
|
||||
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
|
||||
@@ -55,15 +56,15 @@ class TestController extends Controller {
|
||||
curl_close($curl);
|
||||
}
|
||||
|
||||
public function TicketReply() {
|
||||
public function ticketReply() {
|
||||
|
||||
//$file = file_get_contents(base_path() . '/../lb-faveo/Img/Ladybird.png');
|
||||
|
||||
$data = [
|
||||
|
||||
'ticket_ID' => '13',
|
||||
'ReplyContent' => 'reply for the ticket id',
|
||||
'api-key' => 'clYbe1g7BYVEJznBdvCEBR0xDCLDqKgg',
|
||||
'ticket_ID' => '1',
|
||||
'reply_content' => 'reply for the ticket id',
|
||||
'api_key' => '9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN',
|
||||
// 'attachments' => [
|
||||
// [
|
||||
// 'name' => 'ladybird',
|
||||
@@ -84,11 +85,11 @@ class TestController extends Controller {
|
||||
$url = $this->server . "helpdesk/reply?token=" . \Config::get('app.token');
|
||||
|
||||
$_this = new self();
|
||||
$respose = $_this->CallPostApi($url, $data);
|
||||
$respose = $_this->callPostApi($url, $data);
|
||||
return $respose;
|
||||
}
|
||||
|
||||
public function CreateTicket() {
|
||||
public function createTicket() {
|
||||
|
||||
//$file = file_get_contents(base_path() . '/../lb-faveo/Img/Ladybird.png');
|
||||
|
||||
@@ -101,7 +102,7 @@ class TestController extends Controller {
|
||||
'priority' => '1',
|
||||
'headers' => [0 => 'vijaycodename47@gmail.com'],
|
||||
'dept' => '1',
|
||||
'api-key' => 'clYbe1g7BYVEJznBdvCEBR0xDCLDqKgg',
|
||||
'api_key' => '9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN',
|
||||
/** if attachment */
|
||||
// 'attachments' => [
|
||||
// [
|
||||
@@ -123,16 +124,16 @@ class TestController extends Controller {
|
||||
$url = $this->server . "helpdesk/create?token=" . \Config::get('app.token');
|
||||
|
||||
$_this = new self();
|
||||
$respose = $_this->CallPostApi($url, $data);
|
||||
$respose = $_this->callPostApi($url, $data);
|
||||
return $respose;
|
||||
}
|
||||
|
||||
public function GenerateToken() {
|
||||
public function generateToken() {
|
||||
$data = [
|
||||
//'email'=>'vijaycodename47@gmail.com',
|
||||
'username' => 'vijay',
|
||||
'password' => 'manjapra',
|
||||
'api-key' => 'clYbe1g7BYVEJznBdvCEBR0xDCLDqKgg'
|
||||
'api_key' => '9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN'
|
||||
];
|
||||
|
||||
$data = http_build_query($data, '', '&');
|
||||
@@ -140,237 +141,260 @@ class TestController extends Controller {
|
||||
$url = $this->server . "authenticate";
|
||||
//dd($url);
|
||||
$_this = new self();
|
||||
$respose = $_this->CallPostApi($url, $data);
|
||||
$respose = $_this->callPostApi($url, $data);
|
||||
return $respose;
|
||||
}
|
||||
|
||||
public function CreateUser() {
|
||||
public function createUser() {
|
||||
$data = [
|
||||
'email' => 'vijaycodename@gmail.com',
|
||||
'password' => 'manjapra',
|
||||
'api-key' => 'clYbe1g7BYVEJznBdvCEBR0xDCLDqKgg'
|
||||
'api_key' => '9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN'
|
||||
];
|
||||
|
||||
$data = http_build_query($data, '', '&');
|
||||
$url = $this->server . "register";
|
||||
$_this = new self();
|
||||
$respose = $_this->CallPostApi($url, $data);
|
||||
$respose = $_this->callPostApi($url, $data);
|
||||
return $respose;
|
||||
}
|
||||
|
||||
public function GetAuthUser() {
|
||||
public function getAuthUser() {
|
||||
|
||||
$url = $this->server . "authenticate/user?api-key=clYbe1g7BYVEJznBdvCEBR0xDCLDqKgg&token=" . \Config::get('app.token');
|
||||
$url = $this->server . "authenticate/user?api_key=9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN&token=" . \Config::get('app.token');
|
||||
$_this = new self();
|
||||
$respose = $_this->CallGetApi($url);
|
||||
$respose = $_this->callGetApi($url);
|
||||
return $respose;
|
||||
}
|
||||
|
||||
public function EditTicket() {
|
||||
public function editTicket() {
|
||||
$data = [
|
||||
'ticket_id' => '13',
|
||||
'subject' => 'Api editing ticket via faveo api',
|
||||
'sla_plan' => '2',
|
||||
'help_topic' => '2',
|
||||
'ticket_source' => '2',
|
||||
'api-key' => '9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN',
|
||||
'api_key' => '9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN',
|
||||
'ticket_priority' => '2',
|
||||
];
|
||||
|
||||
$data = http_build_query($data, '', '&');
|
||||
$url = $this->server . "helpdesk/edit?token=" . \Config::get('app.token');
|
||||
$_this = new self();
|
||||
$respose = $_this->CallPostApi($url, $data);
|
||||
$respose = $_this->callPostApi($url, $data);
|
||||
return $respose;
|
||||
}
|
||||
|
||||
public function DeleteTicket() {
|
||||
public function deleteTicket() {
|
||||
$data = [
|
||||
'ticket_id' => [11],
|
||||
'api-key' => '9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN'
|
||||
'api_key' => '9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN'
|
||||
];
|
||||
|
||||
$data = http_build_query($data, '', '&');
|
||||
$url = $this->server . "helpdesk/delete?token=" . \Config::get('app.token');
|
||||
$_this = new self();
|
||||
$respose = $_this->CallPostApi($url, $data);
|
||||
$respose = $_this->callPostApi($url, $data);
|
||||
return $respose;
|
||||
}
|
||||
|
||||
public function OpenedTickets() {
|
||||
$url = $this->server . "helpdesk/open?api-key=9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN&token=" . \Config::get('app.token');
|
||||
public function openedTickets() {
|
||||
$url = $this->server . "helpdesk/open?api_key=9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN&token=" . \Config::get('app.token');
|
||||
$_this = new self();
|
||||
$respose = $_this->CallGetApi($url);
|
||||
$respose = $_this->callGetApi($url);
|
||||
return $respose;
|
||||
}
|
||||
|
||||
public function UnassignedTickets() {
|
||||
$url = $this->server . "helpdesk/unassigned?api-key=9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN&token=" . \Config::get('app.token');
|
||||
public function unassignedTickets() {
|
||||
//dd('dsdf');
|
||||
$url = $this->server . "helpdesk/unassigned?api_key=9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN&token=" . \Config::get('app.token');
|
||||
$_this = new self();
|
||||
$respose = $_this->CallGetApi($url);
|
||||
$respose = $_this->callGetApi($url);
|
||||
//dd($respose);
|
||||
return $respose;
|
||||
}
|
||||
|
||||
public function CloseTickets() {
|
||||
$url = $this->server . "helpdesk/closed?api-key=9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN&token=" . \Config::get('app.token');
|
||||
public function closeTickets() {
|
||||
$url = $this->server . "helpdesk/closed?api_key=9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN&token=" . \Config::get('app.token');
|
||||
$_this = new self();
|
||||
$respose = $_this->CallGetApi($url);
|
||||
$respose = $_this->callGetApi($url);
|
||||
return $respose;
|
||||
}
|
||||
|
||||
public function GetAgents() {
|
||||
$url = $this->server . "helpdesk/agents?api-key=9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN&token=" . \Config::get('app.token');
|
||||
public function getAgents() {
|
||||
$url = $this->server . "helpdesk/agents?api_key=9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN&token=" . \Config::get('app.token');
|
||||
$_this = new self();
|
||||
$respose = $_this->CallGetApi($url);
|
||||
$respose = $_this->callGetApi($url);
|
||||
return $respose;
|
||||
}
|
||||
|
||||
public function GetTeams() {
|
||||
$url = $this->server . "helpdesk/teams?api-key=9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN&token=" . \Config::get('app.token');
|
||||
public function getTeams() {
|
||||
$url = $this->server . "helpdesk/teams?api_key=9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN&token=" . \Config::get('app.token');
|
||||
$_this = new self();
|
||||
$respose = $_this->CallGetApi($url);
|
||||
$respose = $_this->callGetApi($url);
|
||||
return $respose;
|
||||
}
|
||||
|
||||
public function AssignTicket() {
|
||||
public function assignTicket() {
|
||||
$data = [
|
||||
'ticket_id' => 1,
|
||||
'user' => 'vijay.sebastian@ladybirdweb.com',
|
||||
'api-key' => '9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN'
|
||||
'api_key' => '9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN'
|
||||
];
|
||||
$data = http_build_query($data, '', '&');
|
||||
$url = $this->server . "helpdesk/assign?token=" . \Config::get('app.token');
|
||||
$_this = new self();
|
||||
$respose = $_this->CallPostApi($url, $data);
|
||||
$respose = $_this->callPostApi($url, $data);
|
||||
return $respose;
|
||||
}
|
||||
|
||||
public function GetCustomers() {
|
||||
public function getCustomers() {
|
||||
$search = [
|
||||
'search' => 'vij',
|
||||
'api-key' => '9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN'
|
||||
'api_key' => '9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN'
|
||||
];
|
||||
$data = http_build_query($search, '', '&');
|
||||
$url = $this->server . "helpdesk/customers?token=" . \Config::get('app.token');
|
||||
$url = $url . '&' . $data;
|
||||
$_this = new self();
|
||||
$respose = $_this->CallGetApi($url);
|
||||
$respose = $_this->callGetApi($url);
|
||||
return $respose;
|
||||
}
|
||||
|
||||
public function GetCustomer() {
|
||||
public function getCustomer() {
|
||||
$search = [
|
||||
'user_id' => '1',
|
||||
'api-key' => '9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN'
|
||||
'api_key' => '9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN'
|
||||
];
|
||||
$data = http_build_query($search, '', '&');
|
||||
$url = $this->server . "helpdesk/customer?token=" . \Config::get('app.token');
|
||||
$url = $url . '&' . $data;
|
||||
$_this = new self();
|
||||
$respose = $_this->CallGetApi($url);
|
||||
$respose = $_this->callGetApi($url);
|
||||
return $respose;
|
||||
}
|
||||
|
||||
public function GetSearch() {
|
||||
public function getSearch() {
|
||||
$search = [
|
||||
'search' => 'api',
|
||||
'api-key' => '9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN'
|
||||
'api_key' => '9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN'
|
||||
];
|
||||
$data = http_build_query($search, '', '&');
|
||||
$url = $this->server . "helpdesk/ticket-search?token=" . \Config::get('app.token');
|
||||
$url = $url . '&' . $data;
|
||||
$_this = new self();
|
||||
$respose = $_this->CallGetApi($url);
|
||||
$respose = $_this->callGetApi($url);
|
||||
return $respose;
|
||||
}
|
||||
|
||||
public function TicketThreads() {
|
||||
public function ticketThreads() {
|
||||
$search = [
|
||||
'id' => '1',
|
||||
'api-key' => '9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN'
|
||||
'api_key' => '9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN'
|
||||
];
|
||||
$data = http_build_query($search, '', '&');
|
||||
$url = $this->server . "helpdesk/ticket-thread?token=" . \Config::get('app.token');
|
||||
$url = $url . '&' . $data;
|
||||
$_this = new self();
|
||||
$respose = $_this->CallGetApi($url);
|
||||
$respose = $_this->callGetApi($url);
|
||||
return $respose;
|
||||
}
|
||||
|
||||
public function Url() {
|
||||
public function url() {
|
||||
$search = [
|
||||
'url' => 'http://localhost/Faveo-HelpDesk-My-Branch/public/',
|
||||
'api-key' => '9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN'
|
||||
'url' => 'http://localhost/faveo-helpdesk-github/public/',
|
||||
'api_key' => '9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN'
|
||||
];
|
||||
$data = http_build_query($search, '', '&');
|
||||
$url = $this->server . "helpdesk/url?token=" . \Config::get('app.token');
|
||||
$url = $url . '&' . $data;
|
||||
$_this = new self();
|
||||
$respose = $_this->CallGetApi($url);
|
||||
$respose = $_this->callGetApi($url);
|
||||
return $respose;
|
||||
}
|
||||
|
||||
public function GenerateApiKey() {
|
||||
$url = $this->server . "helpdesk/api-key?api-key=9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN&token=" . \Config::get('app.token');
|
||||
public function generateApiKey() {
|
||||
$url = $this->server . "helpdesk/api_key?api_key=9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN&token=" . \Config::get('app.token');
|
||||
$_this = new self();
|
||||
$respose = $_this->CallGetApi($url);
|
||||
$respose = $_this->callGetApi($url);
|
||||
return $respose;
|
||||
}
|
||||
|
||||
public function GetHelpTopic() {
|
||||
$url = $this->server . "helpdesk/help-topic?api-key=9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN&token=" . \Config::get('app.token');
|
||||
public function getHelpTopic() {
|
||||
$url = $this->server . "helpdesk/help-topic?api_key=9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN&token=" . \Config::get('app.token');
|
||||
$_this = new self();
|
||||
$respose = $_this->CallGetApi($url);
|
||||
$respose = $_this->callGetApi($url);
|
||||
return $respose;
|
||||
}
|
||||
|
||||
public function GetSlaPlan() {
|
||||
$url = $this->server . "helpdesk/sla-plan?api-key=9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN&token=" . \Config::get('app.token');
|
||||
public function getSlaPlan() {
|
||||
$url = $this->server . "helpdesk/sla-plan?api_key=9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN&token=" . \Config::get('app.token');
|
||||
$_this = new self();
|
||||
$respose = $_this->CallGetApi($url);
|
||||
$respose = $_this->callGetApi($url);
|
||||
return $respose;
|
||||
}
|
||||
|
||||
public function GetPriority() {
|
||||
$url = $this->server . "helpdesk/priority?api-key=clYbe1g7BYVEJznBdvCEBR0xDCLDqKgg&token=" . \Config::get('app.token');
|
||||
public function getPriority() {
|
||||
$url = $this->server . "helpdesk/priority?api_key=clYbe1g7BYVEJznBdvCEBR0xDCLDqKgg&token=" . \Config::get('app.token');
|
||||
$_this = new self();
|
||||
$respose = $_this->CallGetApi($url);
|
||||
$respose = $_this->callGetApi($url);
|
||||
return $respose;
|
||||
}
|
||||
|
||||
public function GetDepartment() {
|
||||
$url = $this->server . "helpdesk/department?api-key=9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN&token=" . \Config::get('app.token');
|
||||
public function getDepartment() {
|
||||
$url = $this->server . "helpdesk/department?api_key=9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN&token=" . \Config::get('app.token');
|
||||
$_this = new self();
|
||||
$respose = $_this->CallGetApi($url);
|
||||
$respose = $_this->callGetApi($url);
|
||||
return $respose;
|
||||
}
|
||||
|
||||
public function GetTickets() {
|
||||
$url = $this->server . "helpdesk/tickets?api-key=9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN&token=" . \Config::get('app.token');
|
||||
public function getTickets() {
|
||||
$url = $this->server . "helpdesk/tickets?api_key=9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN&token=" . \Config::get('app.token');
|
||||
$_this = new self();
|
||||
$respose = $_this->CallGetApi($url);
|
||||
$respose = $_this->callGetApi($url);
|
||||
return $respose;
|
||||
}
|
||||
|
||||
public function Inbox() {
|
||||
$url = $this->server . "helpdesk/inbox?api-key=9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN&token=" . \Config::get('app.token');
|
||||
public function inbox() {
|
||||
$url = $this->server . "helpdesk/inbox?api_key=9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN&token=" . \Config::get('app.token');
|
||||
$_this = new self();
|
||||
$respose = $_this->CallGetApi($url);
|
||||
$respose = $_this->callGetApi($url);
|
||||
return $respose;
|
||||
}
|
||||
|
||||
public function InternalNote() {
|
||||
public function internalNote() {
|
||||
$data = [
|
||||
'ticketid' => '23',
|
||||
'ticketid' => '1',
|
||||
'userid' => 1,
|
||||
'body' => 'Testing the api internal note',
|
||||
'api-key' => '9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN'
|
||||
'api_key' => '9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN'
|
||||
];
|
||||
$data = http_build_query($data, '', '&');
|
||||
$url = $this->server . "helpdesk/internal-note?token=" . \Config::get('app.token');
|
||||
$_this = new self();
|
||||
$respose = $_this->CallPostApi($url, $data);
|
||||
$respose = $_this->callPostApi($url, $data);
|
||||
return $respose;
|
||||
}
|
||||
|
||||
public function trash() {
|
||||
$url = $this->server . "helpdesk/trash?api_key=9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN&token=" . \Config::get('app.token');
|
||||
$_this = new self();
|
||||
$respose = $_this->callGetApi($url);
|
||||
return $respose;
|
||||
}
|
||||
|
||||
public function myTickets(){
|
||||
try{
|
||||
$url = $this->server . "helpdesk/my-tickets?user_id=1&api_key=9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN&token=" . \Config::get('app.token');
|
||||
$_this = new self();
|
||||
$respose = $_this->callGetApi($url);
|
||||
return $respose;
|
||||
} catch (\Exception $e) {
|
||||
$error = $e->getMessage();
|
||||
$line = $e->getLine();
|
||||
$file = $e->getFile();
|
||||
return response()->json(compact('error', 'file', 'line'));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -39,7 +39,8 @@ class TicketController extends Controller {
|
||||
* Create a new controller instance.
|
||||
* @return type response
|
||||
*/
|
||||
public function __construct(PhpMailController $PhpMailController) {
|
||||
public function __construct() {
|
||||
$PhpMailController = new PhpMailController();
|
||||
$this->PhpMailController = $PhpMailController;
|
||||
}
|
||||
|
||||
@@ -53,7 +54,7 @@ class TicketController extends Controller {
|
||||
* @param type $priority
|
||||
* @return type string
|
||||
*/
|
||||
public function create_ticket($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 = '') {
|
||||
try {
|
||||
$max_number = Tickets::whereRaw('id = (select max(`id`) from tickets)')->first();
|
||||
//dd($max_number);
|
||||
@@ -65,8 +66,8 @@ class TicketController extends Controller {
|
||||
}
|
||||
}
|
||||
$ticket = new Tickets;
|
||||
$ticket->ticket_number = $this->ticket_number($ticket_number);
|
||||
//dd($this->ticket_number($ticket_number));
|
||||
$ticket->ticket_number = $this->ticketNumber($ticket_number);
|
||||
//dd($this->ticketNumber($ticket_number));
|
||||
$ticket->user_id = $user_id;
|
||||
$ticket->dept_id = $dept;
|
||||
$ticket->help_topic_id = $helptopic;
|
||||
@@ -97,9 +98,9 @@ class TicketController extends Controller {
|
||||
|
||||
|
||||
|
||||
$this->store_collaborators($headers, $id);
|
||||
$this->storeCollaborators($headers, $id);
|
||||
|
||||
$thread = $this->ticket_thread($subject, $body, $id, $user_id);
|
||||
$thread = $this->ticketThread($subject, $body, $id, $user_id);
|
||||
if (!empty($attach)) {
|
||||
$this->attach($thread, $attach);
|
||||
}
|
||||
@@ -115,14 +116,14 @@ class TicketController extends Controller {
|
||||
* @param type $headers
|
||||
* @return type
|
||||
*/
|
||||
public function store_collaborators($headers, $id) {
|
||||
public function storeCollaborators($headers, $id) {
|
||||
try {
|
||||
$company = $this->company();
|
||||
if (isset($headers)) {
|
||||
foreach ($headers as $email => $name) {
|
||||
$name = $name;
|
||||
$email = $email;
|
||||
if ($this->check_email($email) == false) {
|
||||
if ($this->checkEmail($email) == false) {
|
||||
$create_user = new User;
|
||||
$create_user->user_name = $name;
|
||||
$create_user->email = $email;
|
||||
@@ -139,7 +140,7 @@ class TicketController extends Controller {
|
||||
$this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('1', '0'), $to = ['name' => $name, 'email' => $email], $message = ['subject' => 'password', 'scenario' => 'registration-notification'], $template_variables = ['user' => $name, 'email_address' => $email, 'user_password' => $password]);
|
||||
|
||||
} else {
|
||||
$user = $this->check_email($email);
|
||||
$user = $this->checkEmail($email);
|
||||
$user_id = $user->id;
|
||||
}
|
||||
$collaborator_store = new Ticket_Collaborator;
|
||||
@@ -164,7 +165,7 @@ class TicketController extends Controller {
|
||||
* @param type $user_id
|
||||
* @return type
|
||||
*/
|
||||
public function ticket_thread($subject, $body, $id, $user_id) {
|
||||
public function ticketThread($subject, $body, $id, $user_id) {
|
||||
try {
|
||||
$thread = new Ticket_Thread;
|
||||
$thread->user_id = $user_id;
|
||||
@@ -184,7 +185,7 @@ class TicketController extends Controller {
|
||||
* @param type $ticket_number
|
||||
* @return type integer
|
||||
*/
|
||||
public function ticket_number($ticket_number) {
|
||||
public function ticketNumber($ticket_number) {
|
||||
try {
|
||||
//dd($ticket_number);
|
||||
$number = $ticket_number;
|
||||
@@ -248,12 +249,12 @@ class TicketController extends Controller {
|
||||
$eventuserid = $eventthread->user_id;
|
||||
$emailadd = User::where('id', $eventuserid)->first()->email;
|
||||
$source = $eventthread->source;
|
||||
$form_data = $request->except('ReplyContent', 'ticket_ID', 'attachment');
|
||||
$form_data = $request->except('reply_content', 'ticket_ID', 'attachment');
|
||||
\Event::fire(new \App\Events\ClientTicketFormPost($form_data, $emailadd, $source));
|
||||
$reply_content = $request->input('ReplyContent');
|
||||
$reply_content = $request->input('reply_content');
|
||||
$thread->ticket_id = $request->input('ticket_ID');
|
||||
$thread->poster = 'support';
|
||||
$thread->body = $request->input('ReplyContent');
|
||||
$thread->body = $request->input('reply_content');
|
||||
$thread->user_id = Auth::user()->id;
|
||||
$ticket_id = $request->input('ticket_ID');
|
||||
$tickets = Tickets::where('id', '=', $ticket_id)->first();
|
||||
@@ -377,7 +378,7 @@ try {
|
||||
* @param type Ticket_Thread $thread
|
||||
* @return type bool
|
||||
*/
|
||||
public function ticket_edit_post($ticket_id, $thread, $ticket) {
|
||||
public function ticketEditPost($ticket_id, $thread, $ticket) {
|
||||
try {
|
||||
|
||||
$ticket = $ticket->where('id', '=', $ticket_id)->first();
|
||||
@@ -517,7 +518,7 @@ try {
|
||||
* @param type $email
|
||||
* @return type bool
|
||||
*/
|
||||
public function check_email($email) {
|
||||
public function checkEmail($email) {
|
||||
try {
|
||||
$check = User::where('email', '=', $email)->first();
|
||||
if ($check == true) {
|
||||
|
@@ -116,7 +116,7 @@ class TokenAuthController extends Controller {
|
||||
* verify the url is existing or not
|
||||
* @return type json
|
||||
*/
|
||||
public function CheckUrl() {
|
||||
public function checkUrl() {
|
||||
try {
|
||||
$v = \Validator::make($request->all(), [
|
||||
'url' => 'required|url'
|
||||
|
@@ -188,7 +188,7 @@ class GuestController extends Controller {
|
||||
$thread->ticket_id = $request->input('ticket_ID');
|
||||
$thread->title = $request->input('To');
|
||||
$thread->user_id = Auth::user()->id;
|
||||
$thread->body = $request->input('ReplyContent');
|
||||
$thread->body = $request->input('reply_content');
|
||||
$thread->poster = 'user';
|
||||
$thread->save();
|
||||
$ticket_id = $request->input('ticket_ID');
|
||||
|
@@ -25,7 +25,7 @@ class ApiKey {
|
||||
$set = $this->setting->where('id', '1')->first();
|
||||
if ($set->api_enable == 1) {
|
||||
$key = $set->api_key;
|
||||
if ($key == $request->input('api-key')) {
|
||||
if ($key == $request->input('api_key')) {
|
||||
return $next($request);
|
||||
} else {
|
||||
$result = 'wrong api key';
|
||||
|
@@ -30,7 +30,7 @@ class TicketRequest extends Request {
|
||||
return [
|
||||
// 'To' => 'required',
|
||||
'ticket_ID' => 'required',
|
||||
'ReplyContent' => 'required',
|
||||
'reply_content' => 'required',
|
||||
];
|
||||
}
|
||||
|
||||
|
@@ -635,62 +635,66 @@ Route::group(['prefix' => 'api/v1'], function() {
|
||||
*/
|
||||
Route::group(['prefix' => 'helpdesk'], function() {
|
||||
|
||||
Route::post('create', 'Api\v1\ApiController@CreateTicket');
|
||||
Route::post('reply', 'Api\v1\ApiController@TicketReply');
|
||||
Route::post('edit', 'Api\v1\ApiController@EditTicket');
|
||||
Route::post('delete', 'Api\v1\ApiController@DeleteTicket');
|
||||
Route::post('assign', 'Api\v1\ApiController@AssignTicket');
|
||||
Route::post('create', 'Api\v1\ApiController@createTicket');
|
||||
Route::post('reply', 'Api\v1\ApiController@ticketReply');
|
||||
Route::post('edit', 'Api\v1\ApiController@editTicket');
|
||||
Route::post('delete', 'Api\v1\ApiController@deleteTicket');
|
||||
Route::post('assign', 'Api\v1\ApiController@assignTicket');
|
||||
|
||||
Route::get('open', 'Api\v1\ApiController@OpenedTickets');
|
||||
Route::get('unassigned', 'Api\v1\ApiController@OpenedTickets');
|
||||
Route::get('closed', 'Api\v1\ApiController@CloseTickets');
|
||||
Route::get('agents', 'Api\v1\ApiController@GetAgents');
|
||||
Route::get('teams', 'Api\v1\ApiController@GetTeams');
|
||||
Route::get('customers', 'Api\v1\ApiController@GetCustomers');
|
||||
Route::get('customer', 'Api\v1\ApiController@GetCustomer');
|
||||
Route::get('ticket-search', 'Api\v1\ApiController@SearchTicket');
|
||||
Route::get('ticket-thread', 'Api\v1\ApiController@TicketThreads');
|
||||
Route::get('url', 'Api\v1\ApiController@CheckUrl');
|
||||
Route::get('check-url', 'Api\v1\ApiController@UrlResult');
|
||||
Route::get('api-key', 'Api\v1\ApiController@GenerateApiKey');
|
||||
Route::get('help-topic', 'Api\v1\ApiController@GetHelpTopic');
|
||||
Route::get('sla-plan', 'Api\v1\ApiController@GetSlaPlan');
|
||||
Route::get('priority', 'Api\v1\ApiController@GetPriority');
|
||||
Route::get('department', 'Api\v1\ApiController@GetDepartment');
|
||||
Route::get('tickets', 'Api\v1\ApiController@GetTickets');
|
||||
Route::get('inbox', 'Api\v1\ApiController@Inbox');
|
||||
Route::post('internal-note', 'Api\v1\ApiController@InternalNote');
|
||||
Route::get('open', 'Api\v1\ApiController@openedTickets');
|
||||
Route::get('unassigned', 'Api\v1\ApiController@unassignedTickets');
|
||||
Route::get('closed', 'Api\v1\ApiController@closeTickets');
|
||||
Route::get('agents', 'Api\v1\ApiController@getAgents');
|
||||
Route::get('teams', 'Api\v1\ApiController@getTeams');
|
||||
Route::get('customers', 'Api\v1\ApiController@getCustomers');
|
||||
Route::get('customer', 'Api\v1\ApiController@getCustomer');
|
||||
Route::get('ticket-search', 'Api\v1\ApiController@searchTicket');
|
||||
Route::get('ticket-thread', 'Api\v1\ApiController@ticketThreads');
|
||||
Route::get('url', 'Api\v1\ApiController@checkUrl');
|
||||
Route::get('check-url', 'Api\v1\ApiController@urlResult');
|
||||
Route::get('api_key', 'Api\v1\ApiController@generateApiKey');
|
||||
Route::get('help-topic', 'Api\v1\ApiController@getHelpTopic');
|
||||
Route::get('sla-plan', 'Api\v1\ApiController@getSlaPlan');
|
||||
Route::get('priority', 'Api\v1\ApiController@getPriority');
|
||||
Route::get('department', 'Api\v1\ApiController@getDepartment');
|
||||
Route::get('tickets', 'Api\v1\ApiController@getTickets');
|
||||
Route::get('inbox', 'Api\v1\ApiController@inbox');
|
||||
Route::get('trash', 'Api\v1\ApiController@getTrash');
|
||||
Route::get('my-tickets', 'Api\v1\ApiController@getMyTickets');
|
||||
Route::post('internal-note', 'Api\v1\ApiController@internalNote');
|
||||
});
|
||||
|
||||
/**
|
||||
* Testing Url
|
||||
*/
|
||||
Route::get('create/user', 'Api\v1\TestController@CreateUser');
|
||||
Route::get('create/ticket', 'Api\v1\TestController@CreateTicket');
|
||||
Route::get('ticket/reply', 'Api\v1\TestController@TicketReply');
|
||||
Route::get('ticket/edit', 'Api\v1\TestController@EditTicket');
|
||||
Route::get('ticket/delete', 'Api\v1\TestController@DeleteTicket');
|
||||
Route::get('create/user', 'Api\v1\TestController@createUser');
|
||||
Route::get('create/ticket', 'Api\v1\TestController@createTicket');
|
||||
Route::get('ticket/reply', 'Api\v1\TestController@ticketReply');
|
||||
Route::get('ticket/edit', 'Api\v1\TestController@editTicket');
|
||||
Route::get('ticket/delete', 'Api\v1\TestController@deleteTicket');
|
||||
|
||||
Route::get('ticket/open', 'Api\v1\TestController@OpenedTickets');
|
||||
Route::get('ticket/unassigned', 'Api\v1\TestController@UnassignedTickets');
|
||||
Route::get('ticket/closed', 'Api\v1\TestController@CloseTickets');
|
||||
Route::get('ticket/assign', 'Api\v1\TestController@AssignTicket');
|
||||
Route::get('ticket/agents', 'Api\v1\TestController@GetAgents');
|
||||
Route::get('ticket/teams', 'Api\v1\TestController@GetTeams');
|
||||
Route::get('ticket/customers', 'Api\v1\TestController@GetCustomers');
|
||||
Route::get('ticket/customer', 'Api\v1\TestController@GetCustomer');
|
||||
Route::get('ticket/search', 'Api\v1\TestController@GetSearch');
|
||||
Route::get('ticket/thread', 'Api\v1\TestController@TicketThreads');
|
||||
Route::get('ticket/url', 'Api\v1\TestController@Url');
|
||||
Route::get('ticket/api', 'Api\v1\TestController@GenerateApiKey');
|
||||
Route::get('ticket/help-topic', 'Api\v1\TestController@GetHelpTopic');
|
||||
Route::get('ticket/sla-plan', 'Api\v1\TestController@GetSlaPlan');
|
||||
Route::get('ticket/priority', 'Api\v1\TestController@GetPriority');
|
||||
Route::get('ticket/department', 'Api\v1\TestController@GetDepartment');
|
||||
Route::get('ticket/tickets', 'Api\v1\TestController@GetTickets');
|
||||
Route::get('ticket/inbox', 'Api\v1\TestController@Inbox');
|
||||
Route::get('ticket/internal', 'Api\v1\TestController@InternalNote');
|
||||
Route::get('ticket/open', 'Api\v1\TestController@openedTickets');
|
||||
Route::get('ticket/unassigned', 'Api\v1\TestController@unassignedTickets');
|
||||
Route::get('ticket/closed', 'Api\v1\TestController@closeTickets');
|
||||
Route::get('ticket/assign', 'Api\v1\TestController@assignTicket');
|
||||
Route::get('ticket/agents', 'Api\v1\TestController@getAgents');
|
||||
Route::get('ticket/teams', 'Api\v1\TestController@getTeams');
|
||||
Route::get('ticket/customers', 'Api\v1\TestController@getCustomers');
|
||||
Route::get('ticket/customer', 'Api\v1\TestController@getCustomer');
|
||||
Route::get('ticket/search', 'Api\v1\TestController@getSearch');
|
||||
Route::get('ticket/thread', 'Api\v1\TestController@ticketThreads');
|
||||
Route::get('ticket/url', 'Api\v1\TestController@url');
|
||||
Route::get('ticket/api', 'Api\v1\TestController@generateApiKey');
|
||||
Route::get('ticket/help-topic', 'Api\v1\TestController@getHelpTopic');
|
||||
Route::get('ticket/sla-plan', 'Api\v1\TestController@getSlaPlan');
|
||||
Route::get('ticket/priority', 'Api\v1\TestController@getPriority');
|
||||
Route::get('ticket/department', 'Api\v1\TestController@getDepartment');
|
||||
Route::get('ticket/tickets', 'Api\v1\TestController@getTickets');
|
||||
Route::get('ticket/inbox', 'Api\v1\TestController@inbox');
|
||||
Route::get('ticket/internal', 'Api\v1\TestController@internalNote');
|
||||
Route::get('ticket/trash', 'Api\v1\TestController@trash');
|
||||
Route::get('ticket/my', 'Api\v1\TestController@myTickets');
|
||||
|
||||
Route::get('generate/token', 'Api\v1\TestController@GenerateToken');
|
||||
Route::get('get/user', 'Api\v1\TestController@GetAuthUser');
|
||||
Route::get('generate/token', 'Api\v1\TestController@generateToken');
|
||||
Route::get('get/user', 'Api\v1\TestController@getAuthUser');
|
||||
});
|
||||
|
@@ -273,6 +273,6 @@ return [
|
||||
|
||||
],
|
||||
|
||||
'token'=>'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxIiwiaXNzIjoiaHR0cDpcL1wvbG9jYWxob3N0XC9GYXZlby1IZWxwRGVzay1NeS1CcmFuY2hcL3B1YmxpY1wvYXBpXC92MVwvYXV0aGVudGljYXRlIiwiaWF0IjoxNDU0OTM3NTQ1LCJleHAiOjE0NTQ5NDExNDUsIm5iZiI6MTQ1NDkzNzU0NSwianRpIjoiNzE1ZGQ3N2Y2ODI3MmE5OGYxNTE0YjAxMTZmY2JiZDMifQ.25b13Yif5ZUcrqOwzSncCHAdy2TfXtR8RlcWfLvsKtw'
|
||||
|
||||
];
|
||||
'token'=>"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxIiwiaXNzIjoiaHR0cDpcL1wvbG9jYWxob3N0XC9mYXZlby1oZWxwZGVzay1naXRodWJcL3B1YmxpY1wvYXBpXC92MVwvYXV0aGVudGljYXRlIiwiaWF0IjoxNDU1NzAyNDEyLCJleHAiOjE0NTU3MDYwMTIsIm5iZiI6MTQ1NTcwMjQxMiwianRpIjoiOTdlODg1ODNjOWQyNDIzNWQ4MzI3Y2ExNzI1NDY1MDQifQ.37E7H2kRCQuz5oBRkQLKhNNpaNXyk4FiEYS9RQ7HZPY"
|
||||
|
||||
];
|
||||
|
@@ -9,7 +9,7 @@ return [
|
||||
'shared_folder_name' => 'shares',
|
||||
'thumb_folder_name' => 'thumbs',
|
||||
'images_dir' => 'public/photos/',
|
||||
'images_url' => '%url%',
|
||||
'images_url' => '%url%',//url('photos').'/',
|
||||
'files_dir' => 'public/files/',
|
||||
'files_url' => '/files/',
|
||||
'file_type_array' => [
|
||||
|
7
nbproject/project.properties
Normal file
7
nbproject/project.properties
Normal file
@@ -0,0 +1,7 @@
|
||||
include.path=${php.global.include.path}
|
||||
php.version=PHP_56
|
||||
source.encoding=UTF-8
|
||||
src.dir=.
|
||||
tags.asp=false
|
||||
tags.short=false
|
||||
web.root=.
|
9
nbproject/project.xml
Normal file
9
nbproject/project.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://www.netbeans.org/ns/project/1">
|
||||
<type>org.netbeans.modules.php.project</type>
|
||||
<configuration>
|
||||
<data xmlns="http://www.netbeans.org/ns/php-project/1">
|
||||
<name>faveo-github</name>
|
||||
</data>
|
||||
</configuration>
|
||||
</project>
|
@@ -334,9 +334,9 @@ $canneds = App\Model\helpdesk\Agent_panel\Canned::where('user_id','=',Auth::user
|
||||
</div>
|
||||
<div class="col-md-10">
|
||||
<div id="newtextarea">
|
||||
<textarea style="width:98%;height:20%;" name="ReplyContent" class="form-control" id="ReplyContent"></textarea>
|
||||
<textarea style="width:98%;height:20%;" name="reply_content" class="form-control" id="reply_content"></textarea>
|
||||
</div>
|
||||
{!! $errors->first('ReplyContent', '<spam class="help-block text-red">:message</spam>') !!}
|
||||
{!! $errors->first('reply_content', '<spam class="help-block text-red">:message</spam>') !!}
|
||||
<br/>
|
||||
<div type="file" class="btn btn-default btn-file"><i class="fa fa-paperclip"> </i> {!! Lang::get('lang.attachment') !!}<input type="file" name="attachment[]" multiple/></div><br/>
|
||||
{!! Lang::get('lang.max') !!}. 10MB
|
||||
@@ -1090,7 +1090,7 @@ jQuery('.star').attr('disabled', true);
|
||||
|
||||
$(function () {
|
||||
// $('#cand').wysihtml5();
|
||||
var wysihtml5Editor = $('#ReplyContent').wysihtml5().data("wysihtml5").editor;
|
||||
var wysihtml5Editor = $('#reply_content').wysihtml5().data("wysihtml5").editor;
|
||||
|
||||
$('#select').on('change', function (e) {
|
||||
|
||||
@@ -1394,7 +1394,7 @@ $(document).ready(function () {
|
||||
|
||||
$("#newtextarea").empty();
|
||||
var div = document.getElementById('newtextarea');
|
||||
div.innerHTML = div.innerHTML + '<textarea style="width:98%;height:200px;" name="ReplyContent" class="form-control" id="ReplyContent"/></textarea>';
|
||||
div.innerHTML = div.innerHTML + '<textarea style="width:98%;height:200px;" name="reply_content" class="form-control" id="reply_content"/></textarea>';
|
||||
|
||||
$("#newtextarea1").empty();
|
||||
var div1 = document.getElementById('newtextarea1');
|
||||
@@ -1446,7 +1446,7 @@ $(document).ready(function () {
|
||||
// var wysihtml5Editor = $('textarea').wysihtml5().data("wysihtml5").editor;
|
||||
$("#newtextarea").empty();
|
||||
var div = document.getElementById('newtextarea');
|
||||
div.innerHTML = div.innerHTML + '<textarea style="width:98%;height:200px;" name="ReplyContent" class="form-control" id="ReplyContent"/></textarea>';
|
||||
div.innerHTML = div.innerHTML + '<textarea style="width:98%;height:200px;" name="reply_content" class="form-control" id="reply_content"/></textarea>';
|
||||
|
||||
$("#newtextarea1").empty();
|
||||
var div1 = document.getElementById('newtextarea1');
|
||||
|
@@ -169,11 +169,11 @@ class="active"
|
||||
<div class="row">
|
||||
<div class="form-group {{ $errors->has('title') ? 'has-error' : '' }}">
|
||||
<div class="col-md-2">
|
||||
{!! Form::label('Reply Content', 'ReplyContent:') !!}
|
||||
{!! Form::label('Reply Content', 'reply_content:') !!}
|
||||
</div>
|
||||
<div class="col-md-10">
|
||||
<textarea name="ReplyContent"></textarea>
|
||||
{!! $errors->first('ReplyContent', '<spam class="help-block text-red">:message</spam>') !!}
|
||||
<textarea name="reply_content"></textarea>
|
||||
{!! $errors->first('reply_content', '<spam class="help-block text-red">:message</spam>') !!}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -222,8 +222,8 @@ class="active"
|
||||
<label>Message</label>
|
||||
</div>
|
||||
<div class="col-md-10">
|
||||
<textarea name="ReplyContent"></textarea>
|
||||
{!! $errors->first('ReplyContent', '<spam class="help-block text-red">:message</spam>') !!}
|
||||
<textarea name="reply_content"></textarea>
|
||||
{!! $errors->first('reply_content', '<spam class="help-block text-red">:message</spam>') !!}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -261,11 +261,11 @@ echo UTC::usertimezone(date_format($time, 'd/m/Y H:i:s'));
|
||||
<!-- reply content -->
|
||||
<div class="form-group {{ $errors->has('title') ? 'has-error' : '' }}">
|
||||
<div class="col-md-2">
|
||||
{!! Form::label('Reply Content', 'ReplyContent:') !!}
|
||||
{!! Form::label('Reply Content', 'reply_content:') !!}
|
||||
</div>
|
||||
<div class="col-md-10">
|
||||
<textarea style="width:98%;height:200px;" name="ReplyContent" id="ReplyContent"></textarea>
|
||||
{!! $errors->first('ReplyContent', '<spam class="help-block text-red">:message</spam>') !!}
|
||||
<textarea style="width:98%;height:200px;" name="reply_content" id="reply_content"></textarea>
|
||||
{!! $errors->first('reply_content', '<spam class="help-block text-red">:message</spam>') !!}
|
||||
<br/>
|
||||
{{-- <div type="file" class="btn btn-default btn-file"><i class="fa fa-paperclip"> </i> Attachment<input type="file" name="attachment[]" multiple/></div><br/>
|
||||
Max. 10MB --}}
|
||||
|
@@ -220,11 +220,11 @@ echo UTC::usertimezone(date_format($time, 'd/m/Y H:i:s'));
|
||||
<!-- reply content -->
|
||||
<div class="form-group {{ $errors->has('title') ? 'has-error' : '' }}">
|
||||
<div class="col-md-2">
|
||||
{!! Form::label('Reply Content', 'ReplyContent:') !!}
|
||||
{!! Form::label('Reply Content', 'reply_content:') !!}
|
||||
</div>
|
||||
<div class="col-md-10">
|
||||
<textarea style="width:98%;height:200px;" name="ReplyContent" id="ReplyContent"></textarea>
|
||||
{!! $errors->first('ReplyContent', '<spam class="help-block text-red">:message</spam>') !!}
|
||||
<textarea style="width:98%;height:200px;" name="reply_content" id="reply_content"></textarea>
|
||||
{!! $errors->first('reply_content', '<spam class="help-block text-red">:message</spam>') !!}
|
||||
<br/>
|
||||
{{-- <div type="file" class="btn btn-default btn-file"><i class="fa fa-paperclip"> </i> Attachment<input type="file" name="attachment[]" multiple/></div><br/>
|
||||
Max. 10MB --}}
|
||||
|
@@ -22,7 +22,7 @@ class ClientTest extends PHPUnit_Framework_TestCase
|
||||
// Mock the notify function
|
||||
$this->client = $this->getMockBuilder('Bugsnag_Client')
|
||||
->setMethods(array('notify'))
|
||||
->setConstructorArgs(array('example-api-key'))
|
||||
->setConstructorArgs(array('example-api_key'))
|
||||
->getMock();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user