update v1.0.6
This commit is contained in:
2
.env
2
.env
@@ -2,7 +2,7 @@ APP_ENV=local
|
||||
APP_DEBUG=true
|
||||
APP_KEY=SomeRandomString
|
||||
DB_HOST=localhost
|
||||
DB_DATABASE=fav222222
|
||||
DB_DATABASE=faveo1.0.6
|
||||
DB_USERNAME=root
|
||||
DB_PASSWORD=
|
||||
CACHE_DRIVER=file
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<h3>About Faveo</h3>
|
||||
<br><img src="https://travis-ci.org/ladybirdweb/faveo-helpdesk.svg?branch=master"> <img src="https://img.shields.io/badge/License-OSL-blue.svg"> <a href="https://gitter.im/ladybirdweb/faveo-helpdesk" target="_blank"><img src="https://badges.gitter.im/ladybirdweb/faveo-helpdesk.svg"></a></br>
|
||||
<br><img src="https://travis-ci.org/ladybirdweb/faveo-helpdesk.svg?branch=master"> <img src="https://img.shields.io/badge/License-OSL-blue.svg"></br>
|
||||
<p>Headquartered in Bangalore, Faveo HELPDESK provides Businesses with an automated Helpdesk system to manage customer support.
|
||||
<br/><br/>
|
||||
The word Faveo comes from Latin which means to be favourable. Which truly highlights vision and the scope as well as the functionality of the product that Faveo is. It is specifically designed to cater the needs of startups and SME’s empowering them with state of art, ticket based support system. In today’s competitive startup scenario customer retention is one of the major challenges. Handling client query diligently is all the difference between retaining or losing a long lasting relationship. The company is driven with passion of providing tools for managing consumer queries for strategic insights and helping companies take those decisive decisions.
|
||||
|
@@ -1,7 +1,10 @@
|
||||
<?php namespace App\Exceptions;
|
||||
<?php
|
||||
|
||||
namespace App\Exceptions;
|
||||
|
||||
use Exception;
|
||||
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
|
||||
|
||||
// use App\Http\Controllers\Common\SettingsController;
|
||||
//use App\Model\helpdesk\Email\Smtp;
|
||||
|
||||
@@ -32,8 +35,7 @@ class Handler extends ExceptionHandler {
|
||||
* @param \Exception $e
|
||||
* @return void
|
||||
*/
|
||||
public function report(Exception $e)
|
||||
{
|
||||
public function report(Exception $e) {
|
||||
return parent::report($e);
|
||||
}
|
||||
|
||||
@@ -44,52 +46,48 @@ class Handler extends ExceptionHandler {
|
||||
* @param \Exception $e
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function render($request, Exception $e)
|
||||
{
|
||||
if(config('app.debug') == false) {
|
||||
if ($this->isHttpException($e) && $e->getStatusCode() == 404) {
|
||||
return response()->view('errors.404', []);
|
||||
} else {
|
||||
if(\Config::get('database.install') == 1) {
|
||||
// if(\Config::get('app.ErrorLog') == '%1%') {
|
||||
// \App\Http\Controllers\Common\SettingsController::smtp();
|
||||
// \Mail::send('errors.report', array('e' => $e), function ($message) {
|
||||
// $message->to('', '')->subject('Faveo HELPDESK Pro ERROR');
|
||||
// });
|
||||
// }
|
||||
}
|
||||
return response()->view('errors.500', []);
|
||||
}
|
||||
}
|
||||
return parent::render($request, $e);
|
||||
public function render($request, Exception $e) {
|
||||
|
||||
if ($this->isHttpException($e))
|
||||
{
|
||||
if ($e instanceof \Tymon\JWTAuth\Exceptions\TokenExpiredException) {
|
||||
return response()->json(['message' => $e->getMessage(), 'code' => $e->getStatusCode()]);
|
||||
//dd($e);
|
||||
} else if ($e instanceof \Tymon\JWTAuth\Exceptions\TokenInvalidException) {
|
||||
return response()->json(['message' => $e->getMessage(), 'code' => $e->getStatusCode()]);
|
||||
}
|
||||
|
||||
// if (config('app.debug') == false) {
|
||||
// if ($this->isHttpException($e) && $e->getStatusCode() == 404) {
|
||||
// return response()->view('errors.404', []);
|
||||
// } else {
|
||||
// if (\Config::get('database.install') == 1) {
|
||||
// // if(\Config::get('app.ErrorLog') == '%1%') {
|
||||
// // \App\Http\Controllers\Common\SettingsController::smtp();
|
||||
// // $this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('1', '0'), $to = ['name' => '', 'email' => ''], $message = ['subject' => '', 'scenario'=>'error-report'], $template_variables = ['e' =>$e ]);
|
||||
// // }
|
||||
// }
|
||||
// return response()->view('errors.500', []);
|
||||
// }
|
||||
// }
|
||||
// return parent::render($request, $e);
|
||||
|
||||
if ($this->isHttpException($e)) {
|
||||
return $this->renderHttpException($e);
|
||||
}
|
||||
|
||||
if (config('app.debug'))
|
||||
{
|
||||
if (config('app.debug')) {
|
||||
return $this->renderExceptionWithWhoops($e);
|
||||
}
|
||||
|
||||
return parent::render($request, $e);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
protected function renderExceptionWithWhoops(Exception $e)
|
||||
{
|
||||
protected function renderExceptionWithWhoops(Exception $e) {
|
||||
$whoops = new \Whoops\Run;
|
||||
$whoops->pushHandler(new \Whoops\Handler\PrettyPageHandler());
|
||||
|
||||
return new \Illuminate\Http\Response(
|
||||
$whoops->handleException($e),
|
||||
$e->getStatusCode(),
|
||||
$e->getHeaders()
|
||||
$whoops->handleException($e), $e->getStatusCode(), $e->getHeaders()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@@ -1,13 +1,14 @@
|
||||
<?php namespace App\Http\Controllers\Admin\helpdesk;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin\helpdesk;
|
||||
|
||||
// controller
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Controllers\Common\SettingsController;
|
||||
|
||||
use App\Http\Controllers\Common\PhpMailController;
|
||||
// request
|
||||
use App\Http\Requests\helpdesk\AgentRequest;
|
||||
use App\Http\Requests\helpdesk\AgentUpdate;
|
||||
|
||||
// model
|
||||
use App\User;
|
||||
use App\Model\helpdesk\Agent\Assign_team_agent;
|
||||
@@ -16,7 +17,8 @@ use App\Model\helpdesk\Agent\Groups;
|
||||
use App\Model\helpdesk\Agent\Teams;
|
||||
use App\Model\helpdesk\Utility\Timezones;
|
||||
use App\Model\helpdesk\Settings\Company;
|
||||
|
||||
use App\Model\helpdesk\Settings\Email;
|
||||
use App\Model\helpdesk\Email\Emails;
|
||||
// classes
|
||||
use DB;
|
||||
use Mail;
|
||||
@@ -33,7 +35,6 @@ use Exception;
|
||||
*/
|
||||
class AgentController extends Controller {
|
||||
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
* constructor to check
|
||||
@@ -42,7 +43,8 @@ class AgentController extends Controller {
|
||||
* 3. roles must be agent
|
||||
* @return void
|
||||
*/
|
||||
public function __construct() {
|
||||
public function __construct(PhpMailController $PhpMailController) {
|
||||
$this->PhpMailController = $PhpMailController;
|
||||
SettingsController::smtp();
|
||||
// checking authentication
|
||||
$this->middleware('auth');
|
||||
@@ -94,6 +96,8 @@ class AgentController extends Controller {
|
||||
*/
|
||||
public function store(User $user, AgentRequest $request, Assign_team_agent $team_assign_agent) {
|
||||
|
||||
// dd($this->system_mail());
|
||||
|
||||
/* Insert to user table */
|
||||
$user->role = 'agent';
|
||||
$user->fill($request->input())->save();
|
||||
@@ -103,20 +107,18 @@ class AgentController extends Controller {
|
||||
$id = $user->id;
|
||||
// insert team
|
||||
foreach ($requests as $req) {
|
||||
DB::insert('insert into team_assign_agent (team_id, agent_id) values (?,?)', [$req, $id]);
|
||||
// DB::insert('insert into team_assign_agent (team_id, agent_id) values (?,?)', [$req, $id]);
|
||||
}
|
||||
/* Succes And Failure condition */
|
||||
if ($user->save() == true) {
|
||||
$name = $user->user_name;
|
||||
$email = $user->email;
|
||||
$from = $this->company();
|
||||
// send mail on registration
|
||||
$system_from = $this->company();
|
||||
try {
|
||||
Mail::send('emails.pass', ['name' => $name, 'password' => $password, 'from' => $from, 'emailadd' => $email], function ($message) use ($email, $name) {
|
||||
$message->to($email, $name)->subject('[password]');
|
||||
});
|
||||
// send mail on registration
|
||||
$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]);
|
||||
} catch (Exception $e) {
|
||||
return redirect('agents')->with('fails', 'Some error occuren while sending mail to the agent. Please check email settings'.'<li>'.$e->errorInfo[2].'</li>');
|
||||
return redirect('agents')->with('fails', 'Some error occured while sending mail to the agent. Please check email settings and try again');
|
||||
}
|
||||
return redirect('agents')->with('success', 'Agent Created sucessfully');
|
||||
} else {
|
||||
@@ -210,7 +212,6 @@ class AgentController extends Controller {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Generate a random string for password
|
||||
* @param type $length
|
||||
@@ -240,9 +241,16 @@ class AgentController extends Controller {
|
||||
return $company;
|
||||
}
|
||||
|
||||
// public function agent_profile($id) {
|
||||
// $agent = User::where('id','=',$id)->first();
|
||||
// return \View::make('themes.default1.admin.helpdesk.agent.agents.agent-profile',compact('agent'));
|
||||
/**
|
||||
* System default email
|
||||
*/
|
||||
// public function system_mail() {
|
||||
// $emails = Emails::all();
|
||||
// $count_emails = $emails->count();
|
||||
// if($count_emails > 1) {
|
||||
// dd($emails);
|
||||
// }
|
||||
// $email = Email::where('id', '=', '1')->first();
|
||||
// return $email->sys_email;
|
||||
// }
|
||||
|
||||
}
|
||||
|
@@ -1,15 +1,15 @@
|
||||
<?php namespace App\Http\Controllers\Admin\helpdesk;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin\helpdesk;
|
||||
|
||||
// controller
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
// request
|
||||
use App\Http\Requests\helpdesk\BanlistRequest;
|
||||
use App\Http\Requests\helpdesk\BanRequest;
|
||||
|
||||
// model
|
||||
use App\User;
|
||||
use App\Model\helpdesk\Email\Banlist;
|
||||
|
||||
//classes
|
||||
use Exception;
|
||||
|
||||
|
@@ -1,4 +1,7 @@
|
||||
<?php namespace App\Http\Controllers\Admin\helpdesk;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin\helpdesk;
|
||||
|
||||
// controller
|
||||
use App\Http\Controllers\Controller;
|
||||
// request
|
||||
@@ -235,7 +238,6 @@ class DepartmentController extends Controller {
|
||||
} else {
|
||||
return redirect('departments')->with('fails', 'Department can not Delete');
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -1,4 +1,7 @@
|
||||
<?php namespace App\Http\Controllers\Admin\helpdesk;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin\helpdesk;
|
||||
|
||||
// controllers
|
||||
use App\Http\Controllers\Controller;
|
||||
// request
|
||||
@@ -10,6 +13,7 @@ use App\Model\helpdesk\Email\Emails;
|
||||
use App\Model\helpdesk\Manage\Help_topic;
|
||||
use App\Model\helpdesk\Utility\MailboxProtocol;
|
||||
use App\Model\helpdesk\Ticket\Ticket_Priority;
|
||||
use App\Model\helpdesk\Settings\Email;
|
||||
// classes
|
||||
use Crypt;
|
||||
use Exception;
|
||||
@@ -76,8 +80,29 @@ class EmailsController extends Controller {
|
||||
try {
|
||||
$password = $request->input('password');
|
||||
$encrypted = Crypt::encrypt($password);
|
||||
$department = $request->input('department');
|
||||
$priority = $request->input('priority');
|
||||
$help_topic = $request->input('help_topic');
|
||||
|
||||
if ($email->fill($request->except('password', 'department', 'priority', 'help_topic'))->save() == true) {
|
||||
if ($request->input('department')) {
|
||||
$email->department = $request->input('department');
|
||||
} else {
|
||||
$email->department = null;
|
||||
}
|
||||
if ($request->input('priority')) {
|
||||
$email->priority = $request->input('priority');
|
||||
} else {
|
||||
$email->priority = null;
|
||||
}
|
||||
if ($request->input('help_topic')) {
|
||||
$email->help_topic = $request->input('help_topic');
|
||||
} else {
|
||||
$email->help_topic = null;
|
||||
}
|
||||
$email->password = $encrypted;
|
||||
if ($email->fill($request->except('password'))->save() == true) {
|
||||
$email->save();
|
||||
|
||||
return redirect('emails')->with('success', 'Email Created sucessfully');
|
||||
} else {
|
||||
return redirect('emails')->with('fails', 'Email can not Create');
|
||||
@@ -135,8 +160,25 @@ class EmailsController extends Controller {
|
||||
//echo $value;
|
||||
try {
|
||||
$emails = $email->whereId($id)->first();
|
||||
// $emails->password = $encrypted;
|
||||
$emails->fill($request->except('password', 'department', 'priority', 'help_topic'))->save();
|
||||
if ($request->input('department')) {
|
||||
$emails->department = $request->input('department');
|
||||
} else {
|
||||
$emails->department = null;
|
||||
}
|
||||
if ($request->input('priority')) {
|
||||
$emails->priority = $request->input('priority');
|
||||
} else {
|
||||
$emails->priority = null;
|
||||
}
|
||||
if ($request->input('help_topic')) {
|
||||
$emails->help_topic = $request->input('help_topic');
|
||||
} else {
|
||||
$emails->help_topic = null;
|
||||
}
|
||||
$emails->password = $encrypted;
|
||||
$emails->fill($request->except('password'))->save();
|
||||
$emails->save();
|
||||
return redirect('emails')->with('success', 'Email Updated sucessfully');
|
||||
} catch (Exception $e) {
|
||||
return redirect('emails')->with('fails', 'Email not updated');
|
||||
@@ -150,6 +192,12 @@ class EmailsController extends Controller {
|
||||
* @return type Response
|
||||
*/
|
||||
public function destroy($id, Emails $email) {
|
||||
$default_system_email = Email::where('id', '=', '1')->first();
|
||||
if ($default_system_email->id) {
|
||||
if ($id == $default_system_email->id) {
|
||||
return redirect('emails')->with('fails', 'You cannot delete system default Email');
|
||||
}
|
||||
}
|
||||
try {
|
||||
$emails = $email->whereId($id)->first();
|
||||
if ($emails->delete() == true) {
|
||||
|
@@ -1,16 +1,15 @@
|
||||
<?php namespace App\Http\Controllers\Admin\helpdesk;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin\helpdesk;
|
||||
|
||||
// Controller
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
// Model
|
||||
use App\Model\helpdesk\Form\Fields;
|
||||
use App\Model\helpdesk\Form\Forms;
|
||||
use App\Model\helpdesk\Manage\Help_topic;
|
||||
|
||||
// Request
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
// Class
|
||||
use Input;
|
||||
use Redirect;
|
||||
@@ -25,10 +24,10 @@ use Exception;
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class FormController extends Controller {
|
||||
|
||||
private $fields;
|
||||
private $forms;
|
||||
|
||||
|
||||
public function __construct(Fields $fields, Forms $forms) {
|
||||
$this->fields = $fields;
|
||||
$this->forms = $forms;
|
||||
@@ -106,8 +105,6 @@ class FormController extends Controller {
|
||||
return Redirect::back()->with('success', 'Successfully created Form');
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function delete($id, Forms $forms, Fields $field, Help_topic $help_topic) {
|
||||
$fields = $field->where('forms_id', $id)->get();
|
||||
$help_topics = $help_topic->where('custom_form', '=', $id)->get();
|
||||
@@ -123,8 +120,4 @@ class FormController extends Controller {
|
||||
return redirect()->back()->with('success', 'Deleted Successfully');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@@ -1,4 +1,7 @@
|
||||
<?php namespace App\Http\Controllers\Admin\helpdesk;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin\helpdesk;
|
||||
|
||||
// controllers
|
||||
use App\Http\Controllers\Controller;
|
||||
// requests
|
||||
@@ -12,6 +15,7 @@ use App\User;
|
||||
// classes
|
||||
use Illuminate\Support\Facades\Input;
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
* GroupController
|
||||
*
|
||||
@@ -178,4 +182,5 @@ class GroupController extends Controller {
|
||||
return redirect('groups')->with('fails', 'Groups cannot Create' . '<li>' . $e->errorInfo[2] . '</li>');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,4 +1,7 @@
|
||||
<?php namespace App\Http\Controllers\Admin\helpdesk;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin\helpdesk;
|
||||
|
||||
// controllers
|
||||
use App\Http\Controllers\Controller;
|
||||
// requests
|
||||
@@ -223,4 +226,5 @@ class HelptopicController extends Controller {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,4 +1,6 @@
|
||||
<?php namespace App\Http\Controllers\Admin\helpdesk;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin\helpdesk;
|
||||
|
||||
/**
|
||||
* -----------------------------------------------
|
||||
|
@@ -1,4 +1,7 @@
|
||||
<?php namespace App\Http\Controllers\Admin\helpdesk;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin\helpdesk;
|
||||
|
||||
// controllers
|
||||
use App\Http\Controllers\Controller;
|
||||
// requests
|
||||
@@ -62,8 +65,6 @@ class LanguageController extends Controller {
|
||||
return Redirect::back();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Shows language page
|
||||
* @return type response
|
||||
@@ -72,7 +73,6 @@ class LanguageController extends Controller {
|
||||
return view('themes.default1.admin.helpdesk.language.index');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Shows Language upload form
|
||||
* @return type response
|
||||
@@ -81,30 +81,27 @@ class LanguageController extends Controller {
|
||||
return view('themes.default1.admin.helpdesk.language.create');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Provide language datatable to language page
|
||||
* @return type
|
||||
*/
|
||||
public function getLanguages()
|
||||
{
|
||||
public function getLanguages() {
|
||||
$path = '../resources/lang';
|
||||
$values = scandir($path); //Extracts names of directories present in lang directory
|
||||
$values = array_slice($values, 2); // skips array element $value[0] = '.' & $value[1] = '..'
|
||||
return \Datatable::collection(new Collection($values))
|
||||
|
||||
->addColumn('language', function($model) {
|
||||
return Config::get('languages.' . $model);
|
||||
})
|
||||
|
||||
->addColumn('id', function($model) {
|
||||
return $model;
|
||||
})
|
||||
|
||||
->addColumn('status', function($model) {
|
||||
if(Lang::getLocale()===$model){return "<span style='color:green'>".Lang::trans("lang.active")."</span>"; } else return "<span style='color:red'>".Lang::trans("lang.inactive")."</span>";
|
||||
if (Lang::getLocale() === $model) {
|
||||
return "<span style='color:green'>" . Lang::trans("lang.active") . "</span>";
|
||||
} else
|
||||
return "<span style='color:red'>" . Lang::trans("lang.inactive") . "</span>";
|
||||
})
|
||||
|
||||
->addColumn('Action', function($model) {
|
||||
if (Lang::getLocale() === $model) {
|
||||
return "<a href='change-language/" . $model . "'><input type='button' class='btn btn-info btn-xs btn-flat' disabled value='" . Lang::trans("lang.disable") . "'/></a>
|
||||
@@ -115,11 +112,9 @@ class LanguageController extends Controller {
|
||||
}
|
||||
})
|
||||
->searchColumns('language', 'id')
|
||||
|
||||
->make();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* handle language file uploading
|
||||
* @return response
|
||||
@@ -138,14 +133,12 @@ class LanguageController extends Controller {
|
||||
'language-name' => 'required',
|
||||
'iso-code' => 'required|max:2'
|
||||
); // and for max size
|
||||
|
||||
// doing the validation, passing post data, rules and the messages
|
||||
$validator = Validator::make($file, $rules);
|
||||
if ($validator->fails()) {
|
||||
|
||||
// send back to the page with the input data and errors
|
||||
return Redirect::back()->withInput()->withErrors($validator);
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
@@ -157,13 +150,10 @@ class LanguageController extends Controller {
|
||||
Session::flash('fails', Lang::get('lang.package_exist'));
|
||||
Session::flash('link', "change-language/" . strtolower(Input::get('iso-code')));
|
||||
return Redirect::back()->withInput();
|
||||
|
||||
} elseif (!array_key_exists(strtolower(Input::get('iso-code')), Config::get('languages'))) {//Checking Valid ISO code form Languages.php
|
||||
|
||||
//sending back with error message
|
||||
Session::flash('fails', Lang::get('lang.iso-code-error'));
|
||||
return Redirect::back()->withInput();
|
||||
|
||||
} else {
|
||||
|
||||
// checking file is valid.
|
||||
@@ -175,7 +165,6 @@ class LanguageController extends Controller {
|
||||
//mkdir($destinationPath);
|
||||
Input::file('File')->move($destinationPath, $name); // uploading file to given path
|
||||
\Zipper::make($destinationPath . '/' . $name)->extractTo($extractpath); //extracting file to give path
|
||||
|
||||
//check if Zip extract foldercontains any subfolder
|
||||
$directories = File::directories($extractpath);
|
||||
//$directories = glob($extractpath. '/*' , GLOB_ONLYDIR);
|
||||
@@ -235,4 +224,5 @@ class LanguageController extends Controller {
|
||||
return redirect('languages');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,4 +1,7 @@
|
||||
<?php namespace App\Http\Controllers\Admin\helpdesk;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin\helpdesk;
|
||||
|
||||
// controllers
|
||||
use App\Http\Controllers\Controller;
|
||||
// requests
|
||||
@@ -120,4 +123,5 @@ class ProfileController extends Controller {
|
||||
return redirect('guest')->with('fails', 'Password was not Updated');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,4 +1,7 @@
|
||||
<?php namespace App\Http\Controllers\Admin\helpdesk;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin\helpdesk;
|
||||
|
||||
// controllers
|
||||
use App\Http\Controllers\Controller;
|
||||
// requests
|
||||
@@ -27,7 +30,6 @@ use App\Model\helpdesk\Utility\Time_format;
|
||||
use Illuminate\Http\Request;
|
||||
use Input;
|
||||
use Exception;
|
||||
use DB;
|
||||
|
||||
/**
|
||||
* SettingsController
|
||||
@@ -55,25 +57,7 @@ class SettingsController extends Controller {
|
||||
public function settings() {
|
||||
return view('themes.default1.admin.helpdesk.setting');
|
||||
}
|
||||
public function RatingSettings() {
|
||||
$ratings = DB::table('settings_ratings')->get();
|
||||
|
||||
return view('themes.default1.admin.helpdesk.settings.ratings',compact('ratings'));
|
||||
}
|
||||
public function PostRatingSettings($slug) {
|
||||
$name = Input::get('rating_name');
|
||||
$publish = Input::get('publish');
|
||||
$modify = Input::get('modify');
|
||||
|
||||
DB::table('settings_ratings')->whereSlug($slug)->update(array('rating_name' => $name,'publish' => $publish, 'modify' => $modify));
|
||||
|
||||
return redirect()->back()->with('success', 'Successfully updated');
|
||||
}
|
||||
public function RatingDelete($slug) {
|
||||
DB::table('settings_ratings')->whereSlug($slug)->delete();
|
||||
|
||||
return redirect()->back()->with('success', 'Successfully Deleted');
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @return Response
|
||||
@@ -215,6 +199,7 @@ public function RatingSettings() {
|
||||
$tickets->agent_mask = $request->input('agent_mask');
|
||||
$tickets->html = $request->input('html');
|
||||
$tickets->client_update = $request->input('client_update');
|
||||
$tickets->collision_avoid = $request->input('collision_avoid');
|
||||
/* Check whether function success or not */
|
||||
$tickets->save();
|
||||
/* redirect to Index page with Success Message */
|
||||
@@ -449,4 +434,34 @@ public function RatingSettings() {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* To display the list of ratings in the system
|
||||
* @return type View
|
||||
*/
|
||||
public function RatingSettings() {
|
||||
$ratings = DB::table('settings_ratings')->get();
|
||||
return view('themes.default1.admin.helpdesk.settings.ratings', compact('ratings'));
|
||||
}
|
||||
|
||||
/**
|
||||
* To store rating data
|
||||
* @return type Redirect
|
||||
*/
|
||||
public function PostRatingSettings($slug) {
|
||||
$name = Input::get('rating_name');
|
||||
$publish = Input::get('publish');
|
||||
$modify = Input::get('modify');
|
||||
DB::table('settings_ratings')->whereSlug($slug)->update(array('rating_name' => $name, 'publish' => $publish, 'modify' => $modify));
|
||||
return redirect()->back()->with('success', 'Successfully updated');
|
||||
}
|
||||
|
||||
/**
|
||||
* To delete a type of rating
|
||||
* @return type Redirect
|
||||
*/
|
||||
public function RatingDelete($slug) {
|
||||
DB::table('settings_ratings')->whereSlug($slug)->delete();
|
||||
return redirect()->back()->with('success', 'Successfully Deleted');
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,16 +1,15 @@
|
||||
<?php namespace App\Http\Controllers\Admin\helpdesk;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin\helpdesk;
|
||||
|
||||
// controllers
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
// requests
|
||||
use App\Http\Requests\helpdesk\SlaRequest;
|
||||
use App\Http\Requests\helpdesk\SlaUpdate;
|
||||
|
||||
// models
|
||||
use App\Model\helpdesk\Manage\Sla_plan;
|
||||
use App\Model\helpdesk\Settings\Ticket;
|
||||
|
||||
//classes
|
||||
use DB;
|
||||
use Exception;
|
||||
|
@@ -1,17 +1,16 @@
|
||||
<?php namespace App\Http\Controllers\Admin\helpdesk;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin\helpdesk;
|
||||
|
||||
// controllers
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
// requests
|
||||
use App\Http\Requests\helpdesk\TeamRequest;
|
||||
use App\Http\Requests\helpdesk\TeamUpdate;
|
||||
|
||||
// models
|
||||
use App\Model\helpdesk\Agent\Assign_team_agent;
|
||||
use App\Model\helpdesk\Agent\Teams;
|
||||
use App\User;
|
||||
|
||||
// classes
|
||||
use DB;
|
||||
use Exception;
|
||||
@@ -166,4 +165,5 @@ class TeamController extends Controller {
|
||||
return redirect('teams')->with('fails', 'Teams can not Delete' . '<li>' . $e->errorInfo[2] . '</li>');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,7 +1,11 @@
|
||||
<?php namespace App\Http\Controllers\Admin\helpdesk;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin\helpdesk;
|
||||
|
||||
// controllers
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Controllers\Common\SettingsController;
|
||||
use App\Http\Controllers\Common\PhpMailController;
|
||||
// requests
|
||||
use App\Http\Requests\helpdesk\TemplateRequest;
|
||||
use App\Http\Requests\helpdesk\TemplateUdate;
|
||||
@@ -28,7 +32,8 @@ class TemplateController extends Controller {
|
||||
* Create a new controller instance.
|
||||
* @return type void
|
||||
*/
|
||||
public function __construct() {
|
||||
public function __construct(PhpMailController $PhpMailController) {
|
||||
$this->PhpMailController = $PhpMailController;
|
||||
SettingsController::smtp();
|
||||
$this->middleware('auth');
|
||||
$this->middleware('roles');
|
||||
@@ -102,29 +107,31 @@ class TemplateController extends Controller {
|
||||
* @param type Languages $language
|
||||
* @return type Response
|
||||
*/
|
||||
public function listtemplates() {
|
||||
public function listdirectories() {
|
||||
$path = '../resources/views/emails/';
|
||||
|
||||
$templates = scandir($path);
|
||||
$directories = scandir($path);
|
||||
$directory = str_replace('/', '-', $path);
|
||||
return view('themes.default1.admin.helpdesk.emails.template.listdirectories', compact('directories', 'directory'));
|
||||
}
|
||||
|
||||
public function listtemplates($template, $path) {
|
||||
$paths = str_replace('-', '/', $path);
|
||||
$directory2 = $paths . $template;
|
||||
|
||||
$templates = scandir($directory2);
|
||||
$directory = str_replace('/', '-', $directory2 . '/');
|
||||
return view('themes.default1.admin.helpdesk.emails.template.listtemplates', compact('templates', 'directory'));
|
||||
}
|
||||
|
||||
public function readtemplate($template, $path) {
|
||||
$directory = str_replace('-', '/', $path);
|
||||
$directory2 = $directory.$template;
|
||||
if (is_dir($directory2)) {
|
||||
$templates = scandir($directory2);
|
||||
$directory = str_replace('/', '-', $directory2.'/');
|
||||
return view('themes.default1.admin.helpdesk.emails.template.listtemplates', compact('templates','directory'));
|
||||
}
|
||||
else {
|
||||
$handle = fopen($directory . $template, "r");
|
||||
$contents = fread($handle, filesize($directory . $template));
|
||||
fclose($handle);
|
||||
}
|
||||
|
||||
return view('themes.default1.admin.helpdesk.emails.template.readtemplates', compact('contents', 'template', 'path'));
|
||||
}
|
||||
|
||||
public function createtemplate() {
|
||||
$directory = '../resources/views/emails/';
|
||||
$fname = Input::get('folder_name');
|
||||
@@ -143,7 +150,8 @@ mkdir($filename,0777);
|
||||
$files = array_filter(scandir($directory . 'default'));
|
||||
|
||||
foreach ($files as $file) {
|
||||
if ($file === '.' or $file === '..') continue;
|
||||
if ($file === '.' or $file === '..')
|
||||
continue;
|
||||
if (!is_dir($file)) {
|
||||
// $file_to_go = str_replace("code/resources/views/emails/",'code/resources/views/emails/'.$fname,$file);
|
||||
$destination = $directory . $fname . '/';
|
||||
@@ -153,6 +161,7 @@ $files = array_filter(scandir($directory.'default'));
|
||||
}
|
||||
return \Redirect::back()->with('success', 'Successfully copied');
|
||||
}
|
||||
|
||||
public function writetemplate($template, $path) {
|
||||
$directory = str_replace('-', '/', $path);
|
||||
$b = Input::get('templatedata');
|
||||
@@ -161,6 +170,32 @@ $files = array_filter(scandir($directory.'default'));
|
||||
return \Redirect::back()->with('success', 'Successfully updated');
|
||||
}
|
||||
|
||||
public function deletetemplate($template, $path) {
|
||||
$directory = str_replace('-', '/', $path);
|
||||
$dir = $directory . $template;
|
||||
$status = \DB::table('settings_email')->first();
|
||||
if ($template == 'default' or $template == $status->template) {
|
||||
return \Redirect::back()->with('fails', 'You cannot delete a default or active directory!');
|
||||
}
|
||||
if (is_dir($dir)) {
|
||||
$objects = scandir($dir);
|
||||
foreach ($objects as $object) {
|
||||
if ($object != "." && $object != "..") {
|
||||
unlink($dir . "/" . $object);
|
||||
}
|
||||
}
|
||||
rmdir($dir);
|
||||
} else {
|
||||
rmdir($dir);
|
||||
}
|
||||
return \Redirect::back()->with('success', 'Successfully Deleted');
|
||||
}
|
||||
|
||||
public function activateset($setname) {
|
||||
\DB::table('settings_email')->update(array('template' => $setname));
|
||||
return \Redirect::back()->with('success', 'You have Successfully Activated this Set');
|
||||
}
|
||||
|
||||
public function edit($id, Template $template, Languages $language) {
|
||||
try {
|
||||
$templates = $template->whereId($id)->first();
|
||||
@@ -240,13 +275,12 @@ $files = array_filter(scandir($directory.'default'));
|
||||
*/
|
||||
public function postDiagno(Request $request) {
|
||||
$email = $request->input('to');
|
||||
if($email == null)
|
||||
{
|
||||
if ($email == null) {
|
||||
return redirect('getdiagno')->with('fails', 'Please provide E-mail address !');
|
||||
}
|
||||
$mail = Mail::send('themes.default1.admin.helpdesk.emails.template.connection', array('link' => url('getmail'), 'username' => $email), function ($message) use ($email) {
|
||||
$message->to($email)->subject('Checking the connection');
|
||||
});
|
||||
// sending mail via php mailer
|
||||
$mail = $this->PhpMailController->sendmail($from = 1, $to = ['email' => $email], $message = ['subject' => 'Checking the connection', 'scenario' => 'error-report', 'content' => 'Email Received Successfully'], $template_variables = ['system_error' => 'hello']);
|
||||
|
||||
return redirect('getdiagno')->with('success', 'Please check your mail. An E-mail has been sent to your E-mail address');
|
||||
}
|
||||
|
||||
|
@@ -1,14 +1,15 @@
|
||||
<?php namespace App\Http\Controllers\Admin\helpdesk;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin\helpdesk;
|
||||
|
||||
// controllers
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
// models
|
||||
use App\Model\helpdesk\Priority;
|
||||
use App\Model\helpdesk\Ticket_thread;
|
||||
|
||||
// classes
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
* ThreadController
|
||||
*
|
||||
@@ -36,4 +37,5 @@ class ThreadController extends Controller {
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,92 +0,0 @@
|
||||
<?php namespace App\Http\Controllers\Agent\helpdesk;
|
||||
// controllers
|
||||
use App\Http\Controllers\Controller;
|
||||
// models
|
||||
use App\Model\helpdesk\Settings\Company;
|
||||
use App\Model\helpdesk\Ticket\Ticket_Collaborator;
|
||||
use App\Model\helpdesk\Email\Emails;
|
||||
use App\User;
|
||||
// classes
|
||||
use DB;
|
||||
use View;
|
||||
use Auth;
|
||||
|
||||
/**
|
||||
* DashboardController
|
||||
*
|
||||
* @package Controllers
|
||||
* @subpackage Controller
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class DashboardController extends Controller {
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
* constructor to check
|
||||
* 1. authentication
|
||||
* 2. user roles
|
||||
* 3. roles must be agent
|
||||
* @return void
|
||||
*/
|
||||
public function __construct() {
|
||||
$this->middleware('auth');
|
||||
$this->middleware('role.agent');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
* @return type Response
|
||||
*/
|
||||
public function index() {
|
||||
try {
|
||||
if(Auth::user()->role == "user"){
|
||||
return \Redirect::route('home');
|
||||
}
|
||||
return View::make('themes.default1.agent.helpdesk.dashboard.dashboard');
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* ChartData
|
||||
* @return type
|
||||
*/
|
||||
public function ChartData()
|
||||
{
|
||||
$date2 = strtotime(Date('Y-m-d'));
|
||||
$date3 = Date('Y-m-d');
|
||||
$format = 'Y-m-d';
|
||||
$date1 = strtotime(Date($format,strtotime('-1 month'. $date3)));
|
||||
|
||||
$return = "";
|
||||
$last = "";
|
||||
for ( $i = $date1; $i <= $date2; $i = $i + 86400 ) {
|
||||
$thisDate = date( 'Y-m-d', $i );
|
||||
|
||||
$created = \DB::table('tickets')->select('created_at')->where('created_at','LIKE','%'.$thisDate.'%')->count();
|
||||
$closed = \DB::table('tickets')->select('closed_at')->where('closed_at','LIKE','%'.$thisDate.'%')->count();
|
||||
$reopened = \DB::table('tickets')->select('reopened_at')->where('reopened_at','LIKE','%'.$thisDate.'%')->count();
|
||||
|
||||
$value = ['date' => $thisDate, 'open' => $created, 'closed' => $closed, 'reopened' => $reopened];
|
||||
$array = array_map('htmlentities',$value);
|
||||
$json = html_entity_decode(json_encode($array));
|
||||
$return .= $json.',';
|
||||
}
|
||||
$last = rtrim($return,',');
|
||||
|
||||
return '['.$last.']';
|
||||
|
||||
|
||||
|
||||
// $ticketlist = DB::table('tickets')
|
||||
// ->select(DB::raw('MONTH(updated_at) as month'),DB::raw('SUM(CASE WHEN status = 3 THEN 1 ELSE 0 END) as closed'),DB::raw('SUM(CASE WHEN status = 2 THEN 1 ELSE 0 END) as reopened'),DB::raw('SUM(CASE WHEN status = 1 THEN 1 ELSE 0 END) as open'),
|
||||
// DB::raw('count(*) as totaltickets'))
|
||||
// ->groupBy('month')
|
||||
// ->orderBy('month', 'asc')
|
||||
// ->get();
|
||||
|
||||
// return $ticketlist;
|
||||
}
|
||||
|
||||
}
|
@@ -1,234 +0,0 @@
|
||||
@extends('themes.default1.agent.layout.agent')
|
||||
|
||||
@section('Dashboard')
|
||||
class="active"
|
||||
@stop
|
||||
|
||||
@section('dashboard-bar')
|
||||
active
|
||||
@stop
|
||||
|
||||
@section('dashboard')
|
||||
class="active"
|
||||
@stop
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="box box-info">
|
||||
|
||||
<?php
|
||||
|
||||
// $tickets = App\Model\Ticket\Tickets::where('created_at','>=',date('Y-m-d'))->get();
|
||||
|
||||
// echo count($tickets);
|
||||
|
||||
?>
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">{!! Lang::get('lang.line_chart') !!}</h3>
|
||||
<div class="box-tools pull-right">
|
||||
<button class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
|
||||
<button class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<div class="chart" >
|
||||
<div id="legendDiv"></div>
|
||||
<canvas class="chart-data" id="tickets-graph" width="1000" height="400"></canvas>
|
||||
</div>
|
||||
</div><!-- /.box-body -->
|
||||
</div><!-- /.box -->
|
||||
<hr/>
|
||||
<div class="box">
|
||||
<div class="box-header">
|
||||
<h1>{!! Lang::get('lang.statistics') !!}</h1>
|
||||
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<table class="table table-hover" style="overflow:hidden;">
|
||||
|
||||
<tr>
|
||||
<th>{!! Lang::get('lang.department') !!}</th>
|
||||
<th>{!! Lang::get('lang.opened') !!}</th>
|
||||
<th>{!! Lang::get('lang.resolved') !!}</th>
|
||||
<th>{!! Lang::get('lang.closed') !!}</th>
|
||||
<th>{!! Lang::get('lang.deleted') !!}</th>
|
||||
</tr>
|
||||
|
||||
<?php $departments = App\Model\helpdesk\Agent\Department::all(); ?>
|
||||
@foreach($departments as $department)
|
||||
<?php
|
||||
$open = App\Model\helpdesk\Ticket\Tickets::where('dept_id','=',$department->id)->where('status','=',1)->count();
|
||||
$resolve = App\Model\helpdesk\Ticket\Tickets::where('dept_id','=',$department->id)->where('status','=',2)->count();
|
||||
$close = App\Model\helpdesk\Ticket\Tickets::where('dept_id','=',$department->id)->where('status','=',3)->count();
|
||||
$delete = App\Model\helpdesk\Ticket\Tickets::where('dept_id','=',$department->id)->where('status','=',5)->count();
|
||||
|
||||
?>
|
||||
|
||||
<tr>
|
||||
|
||||
<td>{!! $department->name !!}</td>
|
||||
<td>{!! $open !!}</td>
|
||||
<td>{!! $resolve !!}</td>
|
||||
<td>{!! $close !!}</td>
|
||||
<td>{!! $delete !!}</td>
|
||||
|
||||
</tr>
|
||||
@endforeach
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="{{asset("lb-faveo/plugins/chartjs/Chart.min.js")}}" type="text/javascript"></script>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
$.getJSON("agen", function (result) {
|
||||
|
||||
var labels = [],data=[],data2=[],data3=[],data4=[];
|
||||
for (var i = 0; i < result.length; i++) {
|
||||
|
||||
$var12 = result[i].month;
|
||||
if($var12 == 1){
|
||||
$var13 = "January";
|
||||
}
|
||||
if($var12 == 2){
|
||||
$var13 = "Febuary";
|
||||
}
|
||||
if($var12 == 3){
|
||||
$var13 = "March";
|
||||
}
|
||||
if($var12 == 4){
|
||||
$var13 = "April";
|
||||
}
|
||||
if($var12 == 5){
|
||||
$var13 = "May";
|
||||
}
|
||||
if($var12 == 6){
|
||||
$var13 = "June";
|
||||
}
|
||||
if($var12 == 7){
|
||||
$var13 = "July";
|
||||
}
|
||||
if($var12 == 8){
|
||||
$var13 = "August";
|
||||
}
|
||||
if($var12 == 9){
|
||||
$var13 = "September";
|
||||
}
|
||||
if($var12 == 10){
|
||||
$var13 = "October";
|
||||
}
|
||||
if($var12 == 11){
|
||||
$var13 = "November";
|
||||
}
|
||||
if($var12 == 12){
|
||||
$var13 = "December";
|
||||
}
|
||||
labels.push($var13);
|
||||
data.push(result[i].totaltickets);
|
||||
data2.push(result[i].closed);
|
||||
data3.push(result[i].reopened);
|
||||
data4.push(result[i].open);
|
||||
}
|
||||
|
||||
var buyerData = {
|
||||
labels : labels,
|
||||
datasets : [
|
||||
{
|
||||
label : "Total Tickets" ,
|
||||
fillColor : "rgba(240, 127, 110, 0.3)",
|
||||
strokeColor : "#f56954",
|
||||
pointColor : "#A62121",
|
||||
pointStrokeColor : "#E60073",
|
||||
data : data
|
||||
|
||||
}
|
||||
,
|
||||
{
|
||||
label : "Open Tickets" ,
|
||||
fillColor : "rgba(255, 102, 204, 0.4)",
|
||||
strokeColor : "#f56954",
|
||||
pointColor : "#FF66CC",
|
||||
pointStrokeColor : "#fff",
|
||||
pointHighlightFill : "#FF4DC3",
|
||||
pointHighlightStroke : "rgba(151,187,205,1)",
|
||||
data : data4
|
||||
|
||||
}
|
||||
,
|
||||
{
|
||||
label : "Closed Tickets",
|
||||
fillColor : "rgba(151,187,205,0.2)",
|
||||
strokeColor : "rgba(151,187,205,1)",
|
||||
pointColor : "rgba(151,187,205,1)",
|
||||
pointStrokeColor : "#0000CC",
|
||||
pointHighlightFill : "#0000E6",
|
||||
pointHighlightStroke : "rgba(151,187,205,1)",
|
||||
data : data2
|
||||
}
|
||||
,
|
||||
{
|
||||
label : "Reopened Tickets",
|
||||
fillColor : "rgba(102,255,51,0.2)",
|
||||
strokeColor : "rgba(151,187,205,1)",
|
||||
pointColor : "rgba(46,184,0,1)",
|
||||
pointStrokeColor : "#fff",
|
||||
pointHighlightFill : "#fff",
|
||||
pointHighlightStroke : "rgba(151,187,205,1)",
|
||||
data : data3
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
var myLineChart = new Chart(document.getElementById("tickets-graph").getContext("2d")).Line(buyerData, {
|
||||
showScale: true,
|
||||
//Boolean - Whether grid lines are shown across the chart
|
||||
scaleShowGridLines: false,
|
||||
//String - Colour of the grid lines
|
||||
scaleGridLineColor: "rgba(0,0,0,.05)",
|
||||
//Number - Width of the grid lines
|
||||
scaleGridLineWidth: 1,
|
||||
//Boolean - Whether to show horizontal lines (except X axis)
|
||||
scaleShowHorizontalLines: true,
|
||||
//Boolean - Whether to show vertical lines (except Y axis)
|
||||
scaleShowVerticalLines: true,
|
||||
//Boolean - Whether the line is curved between points
|
||||
bezierCurve: false,
|
||||
//Number - Tension of the bezier curve between points
|
||||
bezierCurveTension: 0.3,
|
||||
//Boolean - Whether to show a dot for each point
|
||||
pointDot: true,
|
||||
//Number - Radius of each point dot in pixels
|
||||
pointDotRadius: 4,
|
||||
//Number - Pixel width of point dot stroke
|
||||
pointDotStrokeWidth: 1,
|
||||
//Number - amount extra to add to the radius to cater for hit detection outside the drawn point
|
||||
pointHitDetectionRadius: 20,
|
||||
//Boolean - Whether to show a stroke for datasets
|
||||
datasetStroke: true,
|
||||
//Number - Pixel width of dataset stroke
|
||||
datasetStrokeWidth: 1,
|
||||
//Boolean - Whether to fill the dataset with a color
|
||||
datasetFill: true,
|
||||
//String - A legend template
|
||||
//Boolean - whether to maintain the starting aspect ratio or not when responsive, if set to false, will take up entire container
|
||||
maintainAspectRatio: false,
|
||||
//Boolean - whether to make the chart responsive to window resizing
|
||||
responsive: true,
|
||||
legendTemplate : '<ul style="list-style-type: square;">'
|
||||
+'<% for (var i=0; i<datasets.length; i++) { %>'
|
||||
+'<li style="color: <%=datasets[i].pointColor%>;">'
|
||||
+'<span style=\"background-color:<%=datasets[i].pointColor%>\"></span>'
|
||||
+'<% if (datasets[i].label) { %><%= datasets[i].label %><% } %>'
|
||||
+'</li>'
|
||||
+'<% } %>'
|
||||
+'</ul>'
|
||||
});
|
||||
|
||||
document.getElementById("legendDiv").innerHTML = myLineChart.generateLegend();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
@stop
|
@@ -1,16 +1,15 @@
|
||||
<?php namespace App\Http\Controllers\Agent\helpdesk;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Agent\helpdesk;
|
||||
|
||||
// controllers
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
// requests
|
||||
use App\Http\Requests\helpdesk\CannedRequest;
|
||||
use App\Http\Requests\helpdesk\CannedUpdateRequest;
|
||||
|
||||
// model
|
||||
use App\Model\helpdesk\Agent_panel\Canned;
|
||||
use App\User;
|
||||
|
||||
// classes
|
||||
use Exception;
|
||||
|
||||
|
@@ -1,14 +1,14 @@
|
||||
<?php namespace App\Http\Controllers\Agent\helpdesk;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Agent\helpdesk;
|
||||
|
||||
// controllers
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
// models
|
||||
use App\Model\helpdesk\Settings\Company;
|
||||
use App\Model\helpdesk\Ticket\Ticket_Collaborator;
|
||||
use App\Model\helpdesk\Email\Emails;
|
||||
use App\User;
|
||||
|
||||
// classes
|
||||
use DB;
|
||||
use View;
|
||||
@@ -59,9 +59,7 @@ class DashboardController extends Controller {
|
||||
* Fetching dashboard graph data to implement graph
|
||||
* @return type Json
|
||||
*/
|
||||
public function ChartData($date111 = "",$date122 = "")
|
||||
{
|
||||
|
||||
public function ChartData($date111 = "", $date122 = "") {
|
||||
$date11 = strtotime($date122);
|
||||
$date12 = strtotime($date111);
|
||||
if ($date11 && $date12) {
|
||||
@@ -99,7 +97,6 @@ class DashboardController extends Controller {
|
||||
// ->groupBy('month')
|
||||
// ->orderBy('month', 'asc')
|
||||
// ->get();
|
||||
|
||||
// return $ticketlist;
|
||||
}
|
||||
|
||||
|
@@ -1,8 +1,10 @@
|
||||
<?php namespace App\Http\Controllers\Agent\helpdesk;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Agent\helpdesk;
|
||||
|
||||
// controllers
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Controllers\Agent\helpdesk\TicketController;
|
||||
|
||||
// models
|
||||
use App\User;
|
||||
use App\Model\helpdesk\Email\Emails;
|
||||
@@ -10,17 +12,17 @@ use App\Model\helpdesk\Settings\Email;
|
||||
use App\Model\helpdesk\Ticket\Ticket_attachments;
|
||||
use App\Model\helpdesk\Ticket\Ticket_Thread;
|
||||
use App\Model\helpdesk\Settings\System;
|
||||
use App\Model\helpdesk\Settings\Ticket;
|
||||
use App\Model\helpdesk\Manage\Help_topic;
|
||||
use App\Model\helpdesk\Utility\MailboxProtocol;
|
||||
use App\Model\helpdesk\Ticket\Ticket_source;
|
||||
use App\Model\helpdesk\Ticket\Ticket_Priority;
|
||||
use App\Model\helpdesk\Ticket\Tickets;
|
||||
|
||||
// classes
|
||||
use PhpImap\Mailbox as ImapMailbox;
|
||||
use PhpImap\IncomingMail;
|
||||
use PhpImap\IncomingMailAttachment;
|
||||
use ForceUTF8\Encoding;
|
||||
use \ForceUTF8\Encoding;
|
||||
use App;
|
||||
use DB;
|
||||
use Crypt;
|
||||
@@ -28,9 +30,7 @@ use Schedule;
|
||||
use File;
|
||||
use Artisan;
|
||||
use Exception;
|
||||
use Phpmailer\PHPMailerautoload;
|
||||
//$root = realpath($_SERVER["DOCUMENT_ROOT"]);
|
||||
//include_once($root.'\vendor\phpmailer\phpmailer\PHPMailerautoload.php');
|
||||
|
||||
/**
|
||||
* MailController
|
||||
*
|
||||
@@ -53,24 +53,34 @@ class MailController extends Controller {
|
||||
* Reademails
|
||||
* @return type
|
||||
*/
|
||||
|
||||
|
||||
public function readmails(Emails $emails, Email $settings_email, System $system)
|
||||
{
|
||||
public function readmails(Emails $emails, Email $settings_email, System $system, Ticket $ticket) {
|
||||
// $path_url = $system->first()->url;
|
||||
if($settings_email->first()->email_fetching == 1)
|
||||
{
|
||||
if($settings_email->first()->all_emails == 1)
|
||||
{
|
||||
if ($settings_email->first()->email_fetching == 1) {
|
||||
if ($settings_email->first()->all_emails == 1) {
|
||||
// $helptopic = $this->TicketController->default_helptopic();
|
||||
// $sla = $this->TicketController->default_sla();
|
||||
$email = $emails->get();
|
||||
foreach($email as $e_mail)
|
||||
{
|
||||
foreach ($email as $e_mail) {
|
||||
$priority = $e_mail->priority;
|
||||
$dept = $e_mail->department;
|
||||
$helptopic = $e_mail->help_topic;
|
||||
|
||||
if ($priority == null) {
|
||||
$priority = $ticket->first()->priority;
|
||||
}
|
||||
|
||||
if ($dept == null) {
|
||||
$dept = $system->first()->department;
|
||||
}
|
||||
|
||||
if ($helptopic == null) {
|
||||
$helptopic = $ticket->first()->help_topic;
|
||||
}
|
||||
// dd($dept);
|
||||
|
||||
$get_helptopic = Help_topic::where('id', '=', $helptopic)->first();
|
||||
$sla = $get_helptopic->sla_plan;
|
||||
$dept = $e_mail->department;
|
||||
// $dept = $e_mail->department;
|
||||
$host = $e_mail->fetching_host;
|
||||
$port = $e_mail->fetching_port;
|
||||
$protocol = $e_mail->mailbox_protocol;
|
||||
@@ -119,8 +129,6 @@ class MailController extends Controller {
|
||||
$ticket_source = Ticket_source::where('name', '=', 'email')->first();
|
||||
$source = $ticket_source->id;
|
||||
$phone = "";
|
||||
$priority = $get_helptopic->priority;
|
||||
// Ticket_Priority::where('')
|
||||
|
||||
$assign = $get_helptopic->auto_assign;
|
||||
$form_data = null;
|
||||
@@ -238,8 +246,7 @@ class MailController extends Controller {
|
||||
*/
|
||||
public function get_data($id) {
|
||||
$attachments = App\Model\helpdesk\Ticket\Ticket_attachments::where('id', '=', $id)->get();
|
||||
foreach($attachments as $attachment)
|
||||
{
|
||||
foreach ($attachments as $attachment) {
|
||||
header('Content-type: application/' . $attachment->type . '');
|
||||
header('Content-Disposition: inline; filename=' . $attachment->name . '');
|
||||
header('Content-Transfer-Encoding: binary');
|
||||
|
@@ -1,8 +1,9 @@
|
||||
<?php namespace App\Http\Controllers\Agent\helpdesk;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Agent\helpdesk;
|
||||
|
||||
// controllers
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
// Model
|
||||
use App\User;
|
||||
use App\Model\helpdesk\Settings\Company;
|
||||
@@ -10,7 +11,6 @@ use App\Model\helpdesk\Agent\Teams;
|
||||
use App\Model\helpdesk\Agent\Department;
|
||||
use App\Model\helpdesk\Utility\Log_notification;
|
||||
use App\Model\helpdesk\settings\Email;
|
||||
|
||||
// classes
|
||||
use Exception;
|
||||
|
||||
@@ -36,6 +36,7 @@ class NotificationController extends Controller {
|
||||
$notification = Log_notification::where('log', '=', 'NOT-1')->orderBy('id', 'DESC')->first();
|
||||
$date = explode(" ", $notification->created_at);
|
||||
if (Date('Y-m-d') == $date[0]) {
|
||||
|
||||
} else {
|
||||
// creating a daily notification log
|
||||
Log_notification::create(['log' => 'NOT-1']);
|
||||
@@ -157,5 +158,4 @@ class NotificationController extends Controller {
|
||||
// $message->to($email, $user_name)->subject('testing reporting');
|
||||
// });
|
||||
// }
|
||||
|
||||
}
|
@@ -1,13 +1,14 @@
|
||||
<?php namespace App\Http\Controllers\Agent\helpdesk;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Agent\helpdesk;
|
||||
|
||||
// controllers
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
// requests
|
||||
use App\Http\Requests\helpdesk\OrganizationRequest;
|
||||
|
||||
/* include organization model */
|
||||
use App\Http\Requests\helpdesk\OrganizationUpdate;
|
||||
|
||||
// models
|
||||
/* Define OrganizationRequest to validate the create form */
|
||||
use App\Model\helpdesk\Agent_panel\Organization;
|
||||
|
@@ -1,4 +1,7 @@
|
||||
<?php namespace App\Http\Controllers\Agent\helpdesk;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Agent\helpdesk;
|
||||
|
||||
// controllers
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Controllers\Agent\helpdesk\TicketController;
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,9 @@
|
||||
<?php namespace App\Http\Controllers\Agent\helpdesk;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Agent\helpdesk;
|
||||
|
||||
// controllers
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
// requests
|
||||
/* Include Sys_user Model */
|
||||
use App\Http\Requests\helpdesk\ProfilePassword;
|
||||
@@ -11,12 +13,10 @@ use App\Http\Requests\helpdesk\ProfileRequest;
|
||||
use App\Http\Requests\helpdesk\Sys_userRequest;
|
||||
/* include guest_note model */
|
||||
use App\Http\Requests\helpdesk\Sys_userUpdate;
|
||||
|
||||
// models
|
||||
use App\Model\helpdesk\Agent_panel\Organization;
|
||||
use App\Model\helpdesk\Agent_panel\User_org;
|
||||
use App\User;
|
||||
|
||||
// classes
|
||||
use Auth;
|
||||
use Hash;
|
||||
@@ -296,7 +296,6 @@ class UserController extends Controller {
|
||||
} catch (Exception $e) {
|
||||
return Redirect::route('profile')->with('success', $e->errorInfo[2]);
|
||||
}
|
||||
|
||||
}
|
||||
if ($user->fill($request->except('profile_pic'))->save()) {
|
||||
return Redirect::route('profile')->with('success', 'Profile Updated sucessfully');
|
||||
@@ -380,4 +379,5 @@ class UserController extends Controller {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@@ -1,22 +1,21 @@
|
||||
<?php namespace App\Http\Controllers\Agent\kb;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Agent\kb;
|
||||
|
||||
// Controllers
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Controllers\Agent\kb\SettingsController;
|
||||
use App\Http\Controllers\Client\kb\UserController;
|
||||
use App\Http\Controllers\Agent\helpdesk\TicketController;
|
||||
|
||||
// Requests
|
||||
use App\Http\Requests\kb\ArticleRequest;
|
||||
use App\Http\Requests\kb\ArticleUpdate;
|
||||
|
||||
// Models
|
||||
use App\Model\kb\Article;
|
||||
use App\Model\kb\Category;
|
||||
use App\Model\kb\Relationship;
|
||||
use App\Model\kb\Settings;
|
||||
use App\Model\kb\Comment;
|
||||
|
||||
// Classes
|
||||
use Auth;
|
||||
use Chumper\Datatable\Table;
|
||||
@@ -129,7 +128,6 @@ class ArticleController extends Controller {
|
||||
} catch (Exception $e) {
|
||||
return redirect()->back()->with('fails', $e->errorInfo[2]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -140,13 +138,17 @@ class ArticleController extends Controller {
|
||||
*/
|
||||
public function store(Article $article, ArticleRequest $request) {
|
||||
// requesting the values to store article data
|
||||
$publishTime = $request->input('year') . '-' . $request->input('month') . '-' . $request->input('day') . ' ' . $request->input('hour') . ':' . $request->input('minute') . ':00';
|
||||
|
||||
$sl = $request->input('slug');
|
||||
$slug = str_slug($sl, "-");
|
||||
$article->slug = $slug;
|
||||
$article->publish_time = $publishTime;
|
||||
$article->fill($request->except('created_at', 'slug'))->save();
|
||||
// creating article category relationship
|
||||
$requests = $request->input('category_id');
|
||||
$id = $article->id;
|
||||
|
||||
foreach ($requests as $req) {
|
||||
DB::insert('insert into kb_article_relationship (category_id, article_id) values (?,?)', [$req, $id]);
|
||||
}
|
||||
@@ -168,10 +170,8 @@ class ArticleController extends Controller {
|
||||
* @return view
|
||||
*/
|
||||
public function edit($slug, Article $article, Relationship $relation, Category $category) {
|
||||
|
||||
$aid = $article->where('id', $slug)->first();
|
||||
$id = $aid->id;
|
||||
|
||||
/* define the selected fields */
|
||||
$assign = $relation->where('article_id', $id)->lists('category_id');
|
||||
/* get the attributes of the category */
|
||||
@@ -185,7 +185,6 @@ class ArticleController extends Controller {
|
||||
} catch (Exception $e) {
|
||||
return redirect()->back()->with('fails', $e->errorInfo[2]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -198,10 +197,13 @@ class ArticleController extends Controller {
|
||||
*/
|
||||
public function update($slug, Article $article, Relationship $relation, ArticleUpdate $request) {
|
||||
$aid = $article->where('id', $slug)->first();
|
||||
$publishTime = $request->input('year') . '-' . $request->input('month') . '-' . $request->input('day') . ' ' . $request->input('hour') . ':' . $request->input('minute') . ':00';
|
||||
|
||||
$id = $aid->id;
|
||||
$sl = $request->input('slug');
|
||||
$slug = str_slug($sl, "-");
|
||||
// dd($slug);
|
||||
|
||||
$article->slug = $slug;
|
||||
/* get the attribute of relation table where id==$id */
|
||||
$relation = $relation->where('article_id', $id);
|
||||
@@ -211,12 +213,13 @@ class ArticleController extends Controller {
|
||||
$requests = $request->input('category_id');
|
||||
$id = $article->id;
|
||||
foreach ($requests as $req) {
|
||||
DB::insert('insert into article_relationship (category_id, article_id) values (?,?)', [$req, $id]);
|
||||
DB::insert('insert into kb_article_relationship (category_id, article_id) values (?,?)', [$req, $id]);
|
||||
}
|
||||
/* update the value to the table */
|
||||
try {
|
||||
$article->fill($request->all())->save();
|
||||
$article->slug = $slug;
|
||||
$article->publish_time = $publishTime;
|
||||
$article->save();
|
||||
return redirect('article')->with('success', 'Article Updated Successfully');
|
||||
} catch (Exception $e) {
|
||||
|
@@ -1,4 +1,6 @@
|
||||
<?php namespace App\Http\Controllers\Agent\kb;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Agent\kb;
|
||||
|
||||
// Controllers
|
||||
use App\Http\Controllers\client\kb\UserController;
|
||||
@@ -6,15 +8,12 @@ use App\Http\Controllers\admin\kb\ArticleController;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Controllers\Agent\kb\SettingsController;
|
||||
use App\Http\Controllers\Agent\helpdesk\TicketController;
|
||||
|
||||
// Requests
|
||||
use App\Http\Requests\kb\CategoryRequest;
|
||||
use App\Http\Requests\kb\CategoryUpdate;
|
||||
|
||||
// Model
|
||||
use App\Model\kb\Category;
|
||||
use App\Model\kb\Relationship;
|
||||
|
||||
// Classes
|
||||
use Datatable;
|
||||
use Redirect;
|
||||
@@ -104,7 +103,6 @@ class CategoryController extends Controller {
|
||||
</div>';
|
||||
})
|
||||
->make();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -200,8 +198,7 @@ class CategoryController extends Controller {
|
||||
$relation = $relation->where('category_id', $id)->first();
|
||||
if ($relation != null) {
|
||||
return Redirect::back()->with('fails', 'Category Not Deleted');
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
/* delete the category selected, id == $id */
|
||||
$category = $category->whereId($id)->first();
|
||||
// redirect to index with success message
|
||||
|
@@ -1,4 +1,6 @@
|
||||
<?php namespace App\Http\Controllers\Agent\kb;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Agent\kb;
|
||||
|
||||
// controllers
|
||||
use App\Http\Controllers\client\kb\UserController;
|
||||
@@ -6,15 +8,12 @@ use App\Http\Controllers\Agent\kb\ArticleController;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Controllers\Agent\kb\SettingsController;
|
||||
use App\Http\Controllers\Agent\helpdesk\TicketController;
|
||||
|
||||
// request
|
||||
use App\Http\Requests\kb\PageRequest;
|
||||
use App\Http\Requests\kb\PageUpdate;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
// Model
|
||||
use App\Model\kb\Page;
|
||||
|
||||
// classes
|
||||
use Datatable;
|
||||
use Exception;
|
||||
|
@@ -1,10 +1,11 @@
|
||||
<?php namespace App\Http\Controllers\Agent\kb;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Agent\kb;
|
||||
|
||||
// Controllers
|
||||
use App\Http\Controllers\Agent\kb\ArticleController;
|
||||
use App\Http\Controllers\Agent\helpdesk\TicketController;
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
// Request
|
||||
use App\Http\Requests\kb\FooterRequest;
|
||||
use App\Http\Requests\kb\ProfilePassword;
|
||||
@@ -12,7 +13,6 @@ use App\Http\Requests\kb\ProfileRequest;
|
||||
use App\Http\Requests\kb\SettingsRequests;
|
||||
use App\Http\Requests\kb\SocialRequest;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
// Model
|
||||
use App\Model\kb\Comment;
|
||||
use App\Model\kb\Faq;
|
||||
@@ -22,7 +22,6 @@ use App\Model\kb\Side2;
|
||||
use App\Model\kb\Social;
|
||||
use App\Model\helpdesk\Utility\Timezones;
|
||||
use App\Model\helpdesk\Utility\Date_format;
|
||||
|
||||
// Classes
|
||||
use Auth;
|
||||
use Config;
|
||||
@@ -78,8 +77,7 @@ class SettingsController extends Controller {
|
||||
* @return Response
|
||||
*/
|
||||
public function postSettings($id, Settings $settings, SettingsRequests $request) {
|
||||
try
|
||||
{
|
||||
try {
|
||||
/* fetch the values of company request */
|
||||
$settings = $settings->whereId('1')->first();
|
||||
if (Input::file('logo')) {
|
||||
@@ -122,7 +120,6 @@ class SettingsController extends Controller {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('settings')->with('fails', 'Settings can not Updated');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -268,7 +265,6 @@ class SettingsController extends Controller {
|
||||
} else {
|
||||
return redirect('profile')->with('fails2', 'Old password Wrong');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -13,7 +13,7 @@ use App\Model\helpdesk\Ticket\Ticket_attachments;
|
||||
use App\Http\Requests\helpdesk\TicketRequest;
|
||||
use App\User;
|
||||
use App\Model\helpdesk\Agent\Teams;
|
||||
use App\Model\kb\Settings;
|
||||
use App\Model\helpdesk\Settings\System;
|
||||
use App\Model\helpdesk\Manage\Help_topic;
|
||||
use App\Model\helpdesk\Manage\Sla_plan;
|
||||
use App\Model\helpdesk\Utility\Priority;
|
||||
@@ -86,7 +86,7 @@ class ApiController extends Controller {
|
||||
$team = new Teams();
|
||||
$this->team = $team;
|
||||
|
||||
$setting = new Settings();
|
||||
$setting = new System();
|
||||
$this->setting = $setting;
|
||||
|
||||
$helptopic = new Help_topic();
|
||||
@@ -150,6 +150,7 @@ class ApiController extends Controller {
|
||||
/**
|
||||
* return ticket details
|
||||
*/
|
||||
//dd($response);
|
||||
$result = $this->thread->where('id', $response)->first();
|
||||
//$result = $this->attach($result->id,$file);
|
||||
return response()->json(compact('result'));
|
||||
@@ -259,7 +260,7 @@ class ApiController extends Controller {
|
||||
*/
|
||||
public function OpenedTickets() {
|
||||
try {
|
||||
$result = $this->model->where('status', '=', 1)->where('isanswered', '=', 0)->where('assigned_to', '=', 0)->orderBy('id', 'DESC')->get();
|
||||
$result = $this->model->where('status', '=', 1)->where('isanswered', '=', 0)->where('assigned_to', '=', null)->orderBy('id', 'DESC')->get();
|
||||
return response()->json(compact('result'));
|
||||
} catch (\Exception $e) {
|
||||
$error = $e->getMessage();
|
||||
@@ -278,7 +279,7 @@ class ApiController extends Controller {
|
||||
*/
|
||||
public function UnassignedTickets() {
|
||||
try {
|
||||
$result = $this->model->where('assigned_to', '=', 0)->where('status', '1')->orderBy('id', 'DESC')->get();
|
||||
$result = $this->model->where('assigned_to', '=', null)->where('status', '1')->orderBy('id', 'DESC')->get();
|
||||
return response()->json(compact('result'));
|
||||
} catch (\Exception $e) {
|
||||
$error = $e->getMessage();
|
||||
@@ -316,7 +317,7 @@ class ApiController extends Controller {
|
||||
*/
|
||||
public function GetAgents() {
|
||||
try {
|
||||
$result = $this->faveoUser->where('role', 'agent')->where('active', 1)->get();
|
||||
$result = $this->faveoUser->where('role', 'agent')->orWhere('role', 'admin')->where('active', 1)->get();
|
||||
return response()->json(compact('result'));
|
||||
} catch (Exception $e) {
|
||||
$error = $e->getMessage();
|
||||
@@ -505,8 +506,9 @@ class ApiController extends Controller {
|
||||
}
|
||||
|
||||
$url = $this->request->input('url');
|
||||
$url = $url . "/api/v1/helpdesk/check-url?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) {
|
||||
$error = $e->getMessage();
|
||||
@@ -579,6 +581,7 @@ class ApiController extends Controller {
|
||||
public function GenerateApiKey() {
|
||||
try {
|
||||
$set = $this->setting->where('id', '1')->first();
|
||||
//dd($set);
|
||||
if ($set->api_enable == 1) {
|
||||
$key = str_random(32);
|
||||
$set->api_key = $key;
|
||||
@@ -675,6 +678,7 @@ class ApiController extends Controller {
|
||||
return response()->json(compact('error'));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Getting the tickets
|
||||
* @return type json
|
||||
@@ -699,7 +703,6 @@ class ApiController extends Controller {
|
||||
* Fetching the Inbox details
|
||||
* @return type json
|
||||
*/
|
||||
|
||||
public function Inbox() {
|
||||
try {
|
||||
$result = $this->user->join('tickets', 'users.id', '=', 'tickets.user_id')
|
||||
@@ -725,6 +728,7 @@ class ApiController extends Controller {
|
||||
return response()->json(compact('error', 'file', 'line'));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create internal note
|
||||
* @return type json
|
||||
@@ -754,6 +758,4 @@ class ApiController extends Controller {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@@ -1,4 +1,7 @@
|
||||
<?php namespace App\Http\Controllers\Api\v1;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Api\v1;
|
||||
|
||||
// controllers
|
||||
use App\Http\Controllers\Controller;
|
||||
// requests
|
||||
@@ -144,10 +147,15 @@ class InstallerApiController extends Controller {
|
||||
|
||||
// Applying email configuration on route
|
||||
$smtpfilepath = "\App\Http\Controllers\Common\SettingsController::smtp()";
|
||||
$lfmpath = "url('photos').'/'";
|
||||
$path22 = app_path('Http/routes.php');
|
||||
$path23 = app_path('config/lfm.php');
|
||||
$content23 = File::get($path22);
|
||||
$content24 = File::get($path23);
|
||||
$content23 = str_replace('"%smtplink%"', $smtpfilepath, $content23);
|
||||
$content24 = str_replace("'%url%'", $lfmpath, $content24);
|
||||
File::put($path22, $content23);
|
||||
File::put($path23, $content24);
|
||||
|
||||
// If user created return success
|
||||
if ($user) {
|
||||
@@ -157,4 +165,5 @@ class InstallerApiController extends Controller {
|
||||
return ['response' => 'fail', 'reason' => 'this system is already installed', 'status' => '0'];
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@@ -57,27 +57,27 @@ class TestController extends Controller {
|
||||
|
||||
public function TicketReply() {
|
||||
|
||||
$file = file_get_contents(base_path() . '/../lb-faveo/Img/Ladybird.png');
|
||||
//$file = file_get_contents(base_path() . '/../lb-faveo/Img/Ladybird.png');
|
||||
|
||||
$data = [
|
||||
|
||||
'ticket_ID' => '81',
|
||||
'ticket_ID' => '13',
|
||||
'ReplyContent' => 'reply for the ticket id',
|
||||
'api-key' => 'clYbe1g7BYVEJznBdvCEBR0xDCLDqKgg',
|
||||
'attachments' => [
|
||||
[
|
||||
'name' => 'ladybird',
|
||||
'size' => '26398',
|
||||
'type' => 'png',
|
||||
'file' => $file,
|
||||
],
|
||||
[
|
||||
'name' => 'ladybird',
|
||||
'size' => '26398',
|
||||
'type' => 'png',
|
||||
'file' => $file,
|
||||
]
|
||||
],
|
||||
// 'attachments' => [
|
||||
// [
|
||||
// 'name' => 'ladybird',
|
||||
// 'size' => '26398',
|
||||
// 'type' => 'png',
|
||||
// 'file' => $file,
|
||||
// ],
|
||||
// [
|
||||
// 'name' => 'ladybird',
|
||||
// 'size' => '26398',
|
||||
// 'type' => 'png',
|
||||
// 'file' => $file,
|
||||
// ]
|
||||
// ],
|
||||
];
|
||||
$data = http_build_query($data, '', '&');
|
||||
|
||||
@@ -90,10 +90,10 @@ class TestController extends Controller {
|
||||
|
||||
public function CreateTicket() {
|
||||
|
||||
$file = file_get_contents(base_path() . '/../lb-faveo/Img/Ladybird.png');
|
||||
//$file = file_get_contents(base_path() . '/../lb-faveo/Img/Ladybird.png');
|
||||
|
||||
$data = [
|
||||
'user_id' => '1',
|
||||
'user_id' => 1,
|
||||
'subject' => 'Api create via faveo api',
|
||||
'body' => 'Test me when call api',
|
||||
'helptopic' => '1',
|
||||
@@ -101,24 +101,22 @@ class TestController extends Controller {
|
||||
'priority' => '1',
|
||||
'headers' => [0 => 'vijaycodename47@gmail.com'],
|
||||
'dept' => '1',
|
||||
'assignto' => '0',
|
||||
'source' => 'api',
|
||||
'api-key' => 'clYbe1g7BYVEJznBdvCEBR0xDCLDqKgg',
|
||||
/** if attachment */
|
||||
'attachments' => [
|
||||
[
|
||||
'name' => 'ladybird',
|
||||
'size' => '26398',
|
||||
'type' => 'png',
|
||||
'file' => $file,
|
||||
],
|
||||
[
|
||||
'name' => 'ladybird',
|
||||
'size' => '26398',
|
||||
'type' => 'png',
|
||||
'file' => $file,
|
||||
]
|
||||
],
|
||||
// 'attachments' => [
|
||||
// [
|
||||
// 'name' => 'ladybird',
|
||||
// 'size' => '26398',
|
||||
// 'type' => 'png',
|
||||
// 'file' => $file,
|
||||
// ],
|
||||
// [
|
||||
// 'name' => 'ladybird',
|
||||
// 'size' => '26398',
|
||||
// 'type' => 'png',
|
||||
// 'file' => $file,
|
||||
// ]
|
||||
// ],
|
||||
];
|
||||
$data = http_build_query($data, '', '&');
|
||||
|
||||
@@ -162,7 +160,7 @@ class TestController extends Controller {
|
||||
|
||||
public function GetAuthUser() {
|
||||
|
||||
$url = $this->server . "authenticate/user?token=" . \Config::get('app.token');
|
||||
$url = $this->server . "authenticate/user?api-key=clYbe1g7BYVEJznBdvCEBR0xDCLDqKgg&token=" . \Config::get('app.token');
|
||||
$_this = new self();
|
||||
$respose = $_this->CallGetApi($url);
|
||||
return $respose;
|
||||
@@ -170,12 +168,12 @@ class TestController extends Controller {
|
||||
|
||||
public function EditTicket() {
|
||||
$data = [
|
||||
'ticket_id' => '81',
|
||||
'ticket_id' => '13',
|
||||
'subject' => 'Api editing ticket via faveo api',
|
||||
'sla_plan' => '2',
|
||||
'help_topic' => '2',
|
||||
'ticket_source' => '2',
|
||||
'api-key' => 'clYbe1g7BYVEJznBdvCEBR0xDCLDqKgg',
|
||||
'api-key' => '9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN',
|
||||
'ticket_priority' => '2',
|
||||
];
|
||||
|
||||
@@ -188,8 +186,8 @@ class TestController extends Controller {
|
||||
|
||||
public function DeleteTicket() {
|
||||
$data = [
|
||||
'ticket_id' => [],
|
||||
'api-key' => 'clYbe1g7BYVEJznBdvCEBR0xDCLDqKgg'
|
||||
'ticket_id' => [11],
|
||||
'api-key' => '9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN'
|
||||
];
|
||||
|
||||
$data = http_build_query($data, '', '&');
|
||||
@@ -200,35 +198,35 @@ class TestController extends Controller {
|
||||
}
|
||||
|
||||
public function OpenedTickets() {
|
||||
$url = $this->server . "helpdesk/open?token=" . \Config::get('app.token');
|
||||
$url = $this->server . "helpdesk/open?api-key=9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN&token=" . \Config::get('app.token');
|
||||
$_this = new self();
|
||||
$respose = $_this->CallGetApi($url);
|
||||
return $respose;
|
||||
}
|
||||
|
||||
public function UnassignedTickets() {
|
||||
$url = $this->server . "helpdesk/unassigned?token=" . \Config::get('app.token');
|
||||
$url = $this->server . "helpdesk/unassigned?api-key=9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN&token=" . \Config::get('app.token');
|
||||
$_this = new self();
|
||||
$respose = $_this->CallGetApi($url);
|
||||
return $respose;
|
||||
}
|
||||
|
||||
public function CloseTickets() {
|
||||
$url = $this->server . "helpdesk/closed?token=" . \Config::get('app.token');
|
||||
$url = $this->server . "helpdesk/closed?api-key=9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN&token=" . \Config::get('app.token');
|
||||
$_this = new self();
|
||||
$respose = $_this->CallGetApi($url);
|
||||
return $respose;
|
||||
}
|
||||
|
||||
public function GetAgents() {
|
||||
$url = $this->server . "helpdesk/agents?token=" . \Config::get('app.token');
|
||||
$url = $this->server . "helpdesk/agents?api-key=9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN&token=" . \Config::get('app.token');
|
||||
$_this = new self();
|
||||
$respose = $_this->CallGetApi($url);
|
||||
return $respose;
|
||||
}
|
||||
|
||||
public function GetTeams() {
|
||||
$url = $this->server . "helpdesk/teams?token=" . \Config::get('app.token');
|
||||
$url = $this->server . "helpdesk/teams?api-key=9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN&token=" . \Config::get('app.token');
|
||||
$_this = new self();
|
||||
$respose = $_this->CallGetApi($url);
|
||||
return $respose;
|
||||
@@ -236,9 +234,9 @@ class TestController extends Controller {
|
||||
|
||||
public function AssignTicket() {
|
||||
$data = [
|
||||
'ticket_id' => '8',
|
||||
'user' => 'vijay.sebastian@ladybird.com',
|
||||
'api-key' => 'clYbe1g7BYVEJznBdvCEBR0xDCLDqKgg'
|
||||
'ticket_id' => 1,
|
||||
'user' => 'vijay.sebastian@ladybirdweb.com',
|
||||
'api-key' => '9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN'
|
||||
];
|
||||
$data = http_build_query($data, '', '&');
|
||||
$url = $this->server . "helpdesk/assign?token=" . \Config::get('app.token');
|
||||
@@ -250,7 +248,7 @@ class TestController extends Controller {
|
||||
public function GetCustomers() {
|
||||
$search = [
|
||||
'search' => 'vij',
|
||||
'api-key' => 'clYbe1g7BYVEJznBdvCEBR0xDCLDqKgg'
|
||||
'api-key' => '9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN'
|
||||
];
|
||||
$data = http_build_query($search, '', '&');
|
||||
$url = $this->server . "helpdesk/customers?token=" . \Config::get('app.token');
|
||||
@@ -263,7 +261,7 @@ class TestController extends Controller {
|
||||
public function GetCustomer() {
|
||||
$search = [
|
||||
'user_id' => '1',
|
||||
'api-key' => 'clYbe1g7BYVEJznBdvCEBR0xDCLDqKgg'
|
||||
'api-key' => '9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN'
|
||||
];
|
||||
$data = http_build_query($search, '', '&');
|
||||
$url = $this->server . "helpdesk/customer?token=" . \Config::get('app.token');
|
||||
@@ -276,7 +274,7 @@ class TestController extends Controller {
|
||||
public function GetSearch() {
|
||||
$search = [
|
||||
'search' => 'api',
|
||||
'api-key' => 'clYbe1g7BYVEJznBdvCEBR0xDCLDqKgg'
|
||||
'api-key' => '9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN'
|
||||
];
|
||||
$data = http_build_query($search, '', '&');
|
||||
$url = $this->server . "helpdesk/ticket-search?token=" . \Config::get('app.token');
|
||||
@@ -288,8 +286,8 @@ class TestController extends Controller {
|
||||
|
||||
public function TicketThreads() {
|
||||
$search = [
|
||||
'id' => '8',
|
||||
'api-key' => 'clYbe1g7BYVEJznBdvCEBR0xDCLDqKgg'
|
||||
'id' => '1',
|
||||
'api-key' => '9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN'
|
||||
];
|
||||
$data = http_build_query($search, '', '&');
|
||||
$url = $this->server . "helpdesk/ticket-thread?token=" . \Config::get('app.token');
|
||||
@@ -301,8 +299,8 @@ class TestController extends Controller {
|
||||
|
||||
public function Url() {
|
||||
$search = [
|
||||
'url' => 'http://localhost/FaveoHELPDESK+KBLatests',
|
||||
'api-key' => 'clYbe1g7BYVEJznBdvCEBR0xDCLDqKgg'
|
||||
'url' => 'http://localhost/Faveo-HelpDesk-My-Branch/public/',
|
||||
'api-key' => '9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN'
|
||||
];
|
||||
$data = http_build_query($search, '', '&');
|
||||
$url = $this->server . "helpdesk/url?token=" . \Config::get('app.token');
|
||||
@@ -313,21 +311,21 @@ class TestController extends Controller {
|
||||
}
|
||||
|
||||
public function GenerateApiKey() {
|
||||
$url = $this->server . "helpdesk/api-key?token=" . \Config::get('app.token');
|
||||
$url = $this->server . "helpdesk/api-key?api-key=9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN&token=" . \Config::get('app.token');
|
||||
$_this = new self();
|
||||
$respose = $_this->CallGetApi($url);
|
||||
return $respose;
|
||||
}
|
||||
|
||||
public function GetHelpTopic() {
|
||||
$url = $this->server . "helpdesk/help-topic?api-key=clYbe1g7BYVEJznBdvCEBR0xDCLDqKgg&token=" . \Config::get('app.token');
|
||||
$url = $this->server . "helpdesk/help-topic?api-key=9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN&token=" . \Config::get('app.token');
|
||||
$_this = new self();
|
||||
$respose = $_this->CallGetApi($url);
|
||||
return $respose;
|
||||
}
|
||||
|
||||
public function GetSlaPlan() {
|
||||
$url = $this->server . "helpdesk/sla-plan?api-key=clYbe1g7BYVEJznBdvCEBR0xDCLDqKgg&token=" . \Config::get('app.token');
|
||||
$url = $this->server . "helpdesk/sla-plan?api-key=9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN&token=" . \Config::get('app.token');
|
||||
$_this = new self();
|
||||
$respose = $_this->CallGetApi($url);
|
||||
return $respose;
|
||||
@@ -341,21 +339,21 @@ class TestController extends Controller {
|
||||
}
|
||||
|
||||
public function GetDepartment() {
|
||||
$url = $this->server . "helpdesk/department?api-key=clYbe1g7BYVEJznBdvCEBR0xDCLDqKgg&token=" . \Config::get('app.token');
|
||||
$url = $this->server . "helpdesk/department?api-key=9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN&token=" . \Config::get('app.token');
|
||||
$_this = new self();
|
||||
$respose = $_this->CallGetApi($url);
|
||||
return $respose;
|
||||
}
|
||||
|
||||
public function GetTickets() {
|
||||
$url = $this->server . "helpdesk/tickets?api-key=clYbe1g7BYVEJznBdvCEBR0xDCLDqKgg&token=" . \Config::get('app.token');
|
||||
$url = $this->server . "helpdesk/tickets?api-key=9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN&token=" . \Config::get('app.token');
|
||||
$_this = new self();
|
||||
$respose = $_this->CallGetApi($url);
|
||||
return $respose;
|
||||
}
|
||||
|
||||
public function Inbox() {
|
||||
$url = $this->server . "helpdesk/inbox?api-key=clYbe1g7BYVEJznBdvCEBR0xDCLDqKgg&token=" . \Config::get('app.token');
|
||||
$url = $this->server . "helpdesk/inbox?api-key=9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN&token=" . \Config::get('app.token');
|
||||
$_this = new self();
|
||||
$respose = $_this->CallGetApi($url);
|
||||
return $respose;
|
||||
@@ -366,7 +364,7 @@ class TestController extends Controller {
|
||||
'ticketid' => '23',
|
||||
'userid' => 1,
|
||||
'body' => 'Testing the api internal note',
|
||||
'api-key' => 'clYbe1g7BYVEJznBdvCEBR0xDCLDqKgg'
|
||||
'api-key' => '9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN'
|
||||
];
|
||||
$data = http_build_query($data, '', '&');
|
||||
$url = $this->server . "helpdesk/internal-note?token=" . \Config::get('app.token');
|
||||
|
@@ -17,6 +17,7 @@ use App\Model\helpdesk\Ticket\Ticket_Status;
|
||||
use App\Model\helpdesk\Ticket\Ticket_attachments;
|
||||
use App\Model\helpdesk\Settings\System;
|
||||
use App\Model\helpdesk\Settings\Alert;
|
||||
use Hash;
|
||||
|
||||
/**
|
||||
* -----------------------------------------------------------------------------
|
||||
@@ -31,7 +32,6 @@ use App\Model\helpdesk\Settings\Alert;
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
class TicketController extends Controller {
|
||||
|
||||
/**
|
||||
@@ -47,6 +47,7 @@ class TicketController extends Controller {
|
||||
public function create_ticket($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);
|
||||
if ($max_number == null) {
|
||||
$ticket_number = "AAAA-9999-9999999";
|
||||
} else {
|
||||
@@ -56,6 +57,7 @@ class TicketController extends Controller {
|
||||
}
|
||||
$ticket = new Tickets;
|
||||
$ticket->ticket_number = $this->ticket_number($ticket_number);
|
||||
//dd($this->ticket_number($ticket_number));
|
||||
$ticket->user_id = $user_id;
|
||||
$ticket->dept_id = $dept;
|
||||
$ticket->help_topic_id = $helptopic;
|
||||
@@ -65,6 +67,7 @@ class TicketController extends Controller {
|
||||
$ticket->priority_id = $priority;
|
||||
$ticket->source = $source;
|
||||
$ticket->save();
|
||||
//dd($ticket);
|
||||
$ticket_number = $ticket->ticket_number;
|
||||
$id = $ticket->id;
|
||||
if ($form_data != null) {
|
||||
@@ -93,6 +96,7 @@ class TicketController extends Controller {
|
||||
}
|
||||
return $thread;
|
||||
} catch (\Exception $e) {
|
||||
dd($e);
|
||||
return $e->getMessage();
|
||||
}
|
||||
}
|
||||
@@ -170,6 +174,7 @@ class TicketController extends Controller {
|
||||
*/
|
||||
public function ticket_number($ticket_number) {
|
||||
try {
|
||||
//dd($ticket_number);
|
||||
$number = $ticket_number;
|
||||
$number = explode('-', $number);
|
||||
$number1 = $number[0];
|
||||
@@ -193,6 +198,7 @@ class TicketController extends Controller {
|
||||
$number = implode('-', $array);
|
||||
return $number;
|
||||
} catch (\Exception $e) {
|
||||
dd($e);
|
||||
return $e->getMessage();
|
||||
}
|
||||
}
|
||||
@@ -373,15 +379,24 @@ class TicketController extends Controller {
|
||||
public function assign($id) {
|
||||
try {
|
||||
$UserEmail = Input::get('user');
|
||||
//dd($id);
|
||||
//dd($UserEmail);
|
||||
// $UserEmail = 'sujitprasad12@yahoo.in';
|
||||
$user = User::where('email', '=', $UserEmail)->first();
|
||||
if (!$user) {
|
||||
return ['error' => 'No agent not found'];
|
||||
}
|
||||
$user_id = $user->id;
|
||||
$ticket = Tickets::where('id', '=', $id)->first();
|
||||
if (!$ticket) {
|
||||
return ['error' => 'No ticket not found'];
|
||||
}
|
||||
$ticket_number = $ticket->ticket_number;
|
||||
$ticket->assigned_to = $user_id;
|
||||
$ticket->save();
|
||||
$ticket_thread = Ticket_Thread::where('ticket_id', '=', $id)->first();
|
||||
if (!$ticket_thread) {
|
||||
return ['error' => 'No thread not found'];
|
||||
}
|
||||
$ticket_subject = $ticket_thread->title;
|
||||
$thread = New Ticket_Thread;
|
||||
$thread->ticket_id = $ticket->id;
|
||||
@@ -497,6 +512,7 @@ class TicketController extends Controller {
|
||||
return $e->getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create Attachment
|
||||
* @param type $thread
|
||||
|
@@ -23,18 +23,19 @@ use Illuminate\Support\Facades\Hash;
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
class TokenAuthController extends Controller {
|
||||
|
||||
public function __construct() {
|
||||
$this->middleware('api');
|
||||
}
|
||||
|
||||
/**
|
||||
* Authenticating user with username and password and retuen token
|
||||
* @param Request $request
|
||||
* @return type json
|
||||
*/
|
||||
public function authenticate(Request $request) {
|
||||
|
||||
$usernameinput = $request->input('username');
|
||||
$password = $request->input('password');
|
||||
$field = filter_var($usernameinput, FILTER_VALIDATE_EMAIL) ? 'email' : 'user_name';
|
||||
@@ -55,6 +56,7 @@ class TokenAuthController extends Controller {
|
||||
// if no errors are encountered we can return a JWT
|
||||
return response()->json(compact('token'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the user details from token
|
||||
* @return type json
|
||||
@@ -75,8 +77,7 @@ class TokenAuthController extends Controller {
|
||||
} catch (\Tymon\JWTAuth\Exceptions\JWTException $e) {
|
||||
|
||||
return response()->json(['token_absent', $e->getStatusCode()]);
|
||||
}
|
||||
catch (\Exception $e){
|
||||
} catch (\Exception $e) {
|
||||
$error = $e->getMessage();
|
||||
return response()->json(compact('error'));
|
||||
}
|
||||
@@ -110,6 +111,7 @@ class TokenAuthController extends Controller {
|
||||
return response()->json(compact('error'));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* verify the url is existing or not
|
||||
* @return type json
|
||||
@@ -126,7 +128,6 @@ class TokenAuthController extends Controller {
|
||||
|
||||
$url = $this->request->input('url');
|
||||
$url = $url . '/api/v1/helpdesk/check-url';
|
||||
|
||||
} catch (Exception $ex) {
|
||||
$error = $e->getMessage();
|
||||
return response()->json(compact('error'));
|
||||
|
@@ -1,14 +1,15 @@
|
||||
<?php namespace App\Http\Controllers\Auth;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
// controllers
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Controllers\Common\SettingsController;
|
||||
|
||||
use App\Http\Controllers\Common\PhpMailController;
|
||||
// requests
|
||||
use App\Http\Requests\helpdesk\LoginRequest;
|
||||
use App\Http\Requests\helpdesk\RegisterRequest;
|
||||
use App\User;
|
||||
|
||||
// classes
|
||||
use Hash;
|
||||
use Illuminate\Contracts\Auth\Guard;
|
||||
@@ -18,7 +19,6 @@ use Mail;
|
||||
use Auth;
|
||||
use Exception;
|
||||
|
||||
|
||||
/**
|
||||
* ---------------------------------------------------
|
||||
* AuthController
|
||||
@@ -35,6 +35,7 @@ class AuthController extends Controller {
|
||||
|
||||
use AuthenticatesAndRegistersUsers;
|
||||
/* to redirect after login */
|
||||
|
||||
// if auth is agent
|
||||
protected $redirectTo = '/dashboard';
|
||||
// if auth is user
|
||||
@@ -50,7 +51,8 @@ class AuthController extends Controller {
|
||||
* @param \Illuminate\Contracts\Auth\Registrar $registrar
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Guard $auth, Registrar $registrar) {
|
||||
public function __construct(Guard $auth, Registrar $registrar, PhpMailController $PhpMailController) {
|
||||
$this->PhpMailController = $PhpMailController;
|
||||
SettingsController::smtp();
|
||||
$this->auth = $auth;
|
||||
$this->registrar = $registrar;
|
||||
@@ -99,13 +101,17 @@ class AuthController extends Controller {
|
||||
$user->remember_token = $code;
|
||||
$user->save();
|
||||
// send mail for successful registration
|
||||
$mail = Mail::send('auth.activate', array('link' => url('getmail', $code), 'username' => $name), function ($message) use ($user) {
|
||||
$message->to($user->email, $user->full_name)->subject('active your account');
|
||||
});
|
||||
// $mail = Mail::send('auth.activate', array('link' => url('getmail', $code), 'username' => $name), function ($message) use ($user) {
|
||||
// $message->to($user->email, $user->full_name)->subject('active your account');
|
||||
// });
|
||||
|
||||
$this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('1', '0'), $to = ['name' => $name, 'email' => $request->input('email')], $message = ['subject' => 'password', 'scenario' => 'registration-notification'], $template_variables = ['user' => $name, 'email_address' => $request->input('email'), 'password_reset_link' => url('password/reset/' . $code)]);
|
||||
|
||||
|
||||
|
||||
return redirect('home')->with('success', 'Activate Your Account ! Click on Link that send to your mail');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get mail function
|
||||
* @param type $token
|
||||
|
@@ -1,14 +1,15 @@
|
||||
<?php namespace App\Http\Controllers\Auth;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
// controllers
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Controllers\Common\SettingsController;
|
||||
|
||||
use App\Http\Controllers\Common\PhpMailController;
|
||||
// request
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
// model
|
||||
use App\User;
|
||||
|
||||
// classes
|
||||
use Illuminate\Contracts\Auth\Guard;
|
||||
use Illuminate\Contracts\Auth\PasswordBroker;
|
||||
@@ -34,14 +35,14 @@ class PasswordController extends Controller {
|
||||
* @param \Illuminate\Contracts\Auth\PasswordBroker $passwords
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Guard $auth, PasswordBroker $passwords) {
|
||||
public function __construct(Guard $auth, PasswordBroker $passwords, PhpMailController $PhpMailController) {
|
||||
$this->PhpMailController = $PhpMailController;
|
||||
$this->auth = $auth;
|
||||
$this->passwords = $passwords;
|
||||
$this->middleware('guest');
|
||||
SettingsController::smtp();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Display the form to request a password reset link.
|
||||
*
|
||||
@@ -51,5 +52,35 @@ class PasswordController extends Controller {
|
||||
return view('auth.password');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the form to request a password reset link.
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function postEmail(Request $request) {
|
||||
$date = date('Y-m-d H:i:s');
|
||||
$this->validate($request, ['email' => 'required|email']);
|
||||
$user = User::where('email', '=', $request->only('email'))->first();
|
||||
if (isset($user)) {
|
||||
$user1 = $user->email;
|
||||
//gen new code and pass
|
||||
$code = str_random(60);
|
||||
$password_reset_table = \DB::table('password_resets')->where('email', '=', $user->email)->first();
|
||||
if (isset($password_reset_table)) {
|
||||
|
||||
$password_reset_table = \DB::table('password_resets')->where('email', '=', $user->email)->update(['token' => $code, 'created_at' => $date]);
|
||||
// $password_reset_table->token = $code;
|
||||
// $password_reset_table->update(['token' => $code]);
|
||||
} else {
|
||||
$create_password_reset = \DB::table('password_resets')->insert(['email' => $user->email, 'token' => $code, 'created_at' => $date]);
|
||||
}
|
||||
|
||||
$this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('1', '0'), $to = ['name' => $user->user_name, 'email' => $user->email], $message = ['subject' => 'Your Password Reset Link', 'scenario' => 'reset-password'], $template_variables = ['user' => $user->user_name, 'email_address' => $user->email, 'password_reset_link' => url('password/reset/' . $code)]);
|
||||
|
||||
return redirect()->back()->with('status', 'We have e-mailed your password reset link!');
|
||||
} else {
|
||||
return redirect()->back()->with('errors', "We can't find a user with that e-mail address.");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,4 +1,7 @@
|
||||
<?php namespace App\Http\Controllers\Agent\helpdesk;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Agent\helpdesk;
|
||||
|
||||
// controllers
|
||||
use App\Http\Controllers\Controller;
|
||||
// requests
|
||||
@@ -385,4 +388,5 @@ class UserController extends Controller {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@@ -1,16 +1,16 @@
|
||||
<?php namespace App\Http\Controllers\Client\helpdesk;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Client\helpdesk;
|
||||
|
||||
// controllers
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Controllers\Agent\helpdesk\TicketController;
|
||||
use App\Http\Controllers\Common\SettingsController;
|
||||
|
||||
// requests
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Requests\helpdesk\CreateTicketRequest;
|
||||
use App\Http\Requests\helpdesk\TicketRequest;
|
||||
use App\Http\Requests\helpdesk\TicketEditRequest;
|
||||
|
||||
// models
|
||||
use App\Model\helpdesk\Email\Banlist;
|
||||
use App\Model\helpdesk\Ticket\Tickets;
|
||||
@@ -24,7 +24,6 @@ use App\Model\helpdesk\Ticket\Ticket_Status;
|
||||
use App\Model\helpdesk\Email\Emails;
|
||||
use App\Model\helpdesk\Agent\Department;
|
||||
use App\User;
|
||||
|
||||
// classes
|
||||
use Auth;
|
||||
use Hash;
|
||||
@@ -93,4 +92,3 @@ class ClientTicketController extends Controller {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@@ -1,11 +1,11 @@
|
||||
<?php namespace App\Http\Controllers\Client\helpdesk;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Client\helpdesk;
|
||||
|
||||
// controllers
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
// models
|
||||
use App\Model\helpdesk\Email\Emails;
|
||||
|
||||
// classes
|
||||
use Exception;
|
||||
|
||||
@@ -23,8 +23,7 @@ class OuthouseController extends Controller {
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function port()
|
||||
{
|
||||
public static function port() {
|
||||
$port = Emails::where('id', '=', '1')->first();
|
||||
$portvalue = $port->option_value;
|
||||
return $portvalue;
|
||||
@@ -35,8 +34,7 @@ class OuthouseController extends Controller {
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function host()
|
||||
{
|
||||
public static function host() {
|
||||
$host = Option::where('option_name', '=', 'host')->first();
|
||||
$hostvalue = $host->option_value;
|
||||
return $hostvalue;
|
||||
@@ -47,8 +45,7 @@ class OuthouseController extends Controller {
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function username()
|
||||
{
|
||||
public static function username() {
|
||||
$username = Option::where('option_name', '=', 'username')->first();
|
||||
$uservalue = $username->option_value;
|
||||
|
||||
@@ -60,8 +57,7 @@ class OuthouseController extends Controller {
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function password()
|
||||
{
|
||||
public static function password() {
|
||||
$password = Option::where('option_name', '=', 'password')->first();
|
||||
$passvalue = $password->option_value;
|
||||
|
||||
@@ -73,8 +69,7 @@ class OuthouseController extends Controller {
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function encryption()
|
||||
{
|
||||
public static function encryption() {
|
||||
$encryption = Option::where('option_name', '=', 'encryption')->first();
|
||||
$encryptvalue = $encryption->option_value;
|
||||
|
||||
|
@@ -1,14 +1,14 @@
|
||||
<?php namespace App\Http\Controllers\Client\helpdesk;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Client\helpdesk;
|
||||
|
||||
// controllers
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Controllers\Agent\helpdesk\TicketController;
|
||||
use App\Http\Controllers\Common\SettingsController;
|
||||
|
||||
// requests
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Requests\helpdesk\ClientRequest;
|
||||
|
||||
// models
|
||||
use App\Model\helpdesk\Form\Forms;
|
||||
use App\Model\helpdesk\Manage\Help_topic;
|
||||
@@ -22,7 +22,6 @@ use App\Model\helpdesk\Ticket\Ticket_source;
|
||||
use App\User;
|
||||
use App\Model\helpdesk\Form\Fields;
|
||||
use App\Model\helpdesk\Form\Form_value;
|
||||
|
||||
// classes
|
||||
use Form;
|
||||
use Input;
|
||||
@@ -85,6 +84,7 @@ class FormController extends Controller {
|
||||
$custom_form = $helptopic->custom_form;
|
||||
$values = Fields::where('forms_id', '=', $custom_form)->get();
|
||||
if (!$values) {
|
||||
|
||||
} if ($values) {
|
||||
foreach ($values as $value) {
|
||||
if ($value->type == "select") {
|
||||
@@ -156,8 +156,6 @@ class FormController extends Controller {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* reply
|
||||
* @param type $value
|
||||
@@ -186,9 +184,6 @@ class FormController extends Controller {
|
||||
} else {
|
||||
return \Redirect::back()->with('fails1', 'Please fill some data!');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
@@ -1,15 +1,16 @@
|
||||
<?php namespace App\Http\Controllers\Client\helpdesk;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Client\helpdesk;
|
||||
|
||||
// controllers
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Controllers\Common\SettingsController;
|
||||
|
||||
use App\Http\Controllers\Common\PhpMailController;
|
||||
// requests
|
||||
use App\Http\Requests\helpdesk\CheckTicket;
|
||||
use App\Http\Requests\helpdesk\ProfilePassword;
|
||||
use App\Http\Requests\helpdesk\ProfileRequest;
|
||||
use App\Http\Requests\helpdesk\TicketRequest;
|
||||
|
||||
// models
|
||||
use App\Model\helpdesk\Manage\Help_topic;
|
||||
use App\Model\helpdesk\Ticket\Tickets;
|
||||
@@ -17,7 +18,6 @@ use App\Model\helpdesk\Ticket\Ticket_Thread;
|
||||
use App\Model\helpdesk\Settings\Company;
|
||||
use App\Model\helpdesk\Settings\System;
|
||||
use App\User;
|
||||
|
||||
// classes
|
||||
use Auth;
|
||||
use Hash;
|
||||
@@ -37,8 +37,8 @@ class GuestController extends Controller {
|
||||
* Create a new controller instance.
|
||||
* @return type void
|
||||
*/
|
||||
|
||||
public function __construct() {
|
||||
public function __construct(PhpMailController $PhpMailController) {
|
||||
$this->PhpMailController = $PhpMailController;
|
||||
SettingsController::smtp();
|
||||
// checking authentication
|
||||
$this->middleware('auth');
|
||||
@@ -153,6 +153,7 @@ class GuestController extends Controller {
|
||||
* @return
|
||||
*/
|
||||
public function ticketEdit() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -240,12 +241,10 @@ class GuestController extends Controller {
|
||||
|
||||
$company = $this->company();
|
||||
|
||||
\Mail::send('emails.check_ticket',
|
||||
array('link'=>\URL::route('check_ticket',$code),'user'=>$username, 'from'=>$company),
|
||||
function($message) use($user, $username, $Ticket_number) {
|
||||
$message->to($user->email, $username)->subject('Ticket link Request ['.$Ticket_number.']');
|
||||
}
|
||||
$this->PhpMailController->sendmail(
|
||||
$from = $this->PhpMailController->mailfrom('1', '0'), $to = ['name' => $username, 'email' => $user->email], $message = ['subject' => 'Ticket link Request [' . $Ticket_number . ']', 'scenario' => 'check-ticket'], $template_variables = ['user' => $username, 'ticket_link_with_number' => \URL::route('check_ticket', $code)]
|
||||
);
|
||||
|
||||
return \Redirect::back()
|
||||
->with('success', 'We have sent you a link by Email. Please click on that link to view ticket');
|
||||
}
|
||||
|
@@ -1,4 +1,7 @@
|
||||
<?php namespace App\Http\Controllers\Client\helpdesk;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Client\helpdesk;
|
||||
|
||||
// controllers
|
||||
use App\Http\Controllers\Controller;
|
||||
// models
|
||||
@@ -39,4 +42,5 @@ class WelcomepageController extends Controller {
|
||||
}
|
||||
return view('themes.default1.client.helpdesk.guest-user.index');
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,4 +1,6 @@
|
||||
<?php namespace App\Http\Controllers\Client\kb;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Client\kb;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Requests\kb\CommentRequest;
|
||||
@@ -40,6 +42,7 @@ class UserController extends Controller {
|
||||
* @package default
|
||||
*/
|
||||
public function getArticle(Article $article, Category $category, Settings $settings) {
|
||||
|
||||
$settings = $settings->first();
|
||||
$pagination = $settings->pagination;
|
||||
// $article = $article->where('status', '1');
|
||||
@@ -90,12 +93,16 @@ class UserController extends Controller {
|
||||
*/
|
||||
public function show($slug, Article $article, Category $category) {
|
||||
//ArticleController::timezone();
|
||||
$arti = $article->where('slug', $slug)->where('status','1')->where('type','1')->first();
|
||||
|
||||
// dd($arti);
|
||||
//$categorys = $category->get();
|
||||
//$avatar->get('vijaycodename47@gmail.com');
|
||||
$tz = \App\Model\helpdesk\Settings\System::where('id', '1')->first()->time_zone;
|
||||
$tz = \App\Model\helpdesk\Utility\Timezones::where('id', $tz)->first()->name;
|
||||
date_default_timezone_set($tz);
|
||||
$date = \Carbon\Carbon::now()->toDateTimeString();
|
||||
$arti = $article->where('slug', $slug)->where('status', '1')->where('type', '1')->where('publish_time', '<', $date)->first();
|
||||
if ($arti) {
|
||||
return view('themes.default1.client.kb.article-list.show', compact('arti'));
|
||||
} else {
|
||||
return redirect()->back()->with('fails', 'No records on publish time');
|
||||
}
|
||||
}
|
||||
|
||||
public function getCategory($slug, Article $article, Category $category, Relationship $relation) {
|
||||
@@ -114,9 +121,7 @@ class UserController extends Controller {
|
||||
public function home(Article $article, Category $category, Relationship $relation) {
|
||||
if (Config::get('database.install') == '%0%') {
|
||||
return redirect('step1');
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
//$categorys = $category->get();
|
||||
$categorys = $category->get();
|
||||
// $categorys->setPath('home');
|
||||
@@ -200,23 +205,28 @@ class UserController extends Controller {
|
||||
//$this->timezone($page->created_at);
|
||||
return view('themes.default1.client.kb.article-list.pages', compact('page'));
|
||||
}
|
||||
|
||||
static function port() {
|
||||
$setting = Settings::whereId('1')->first();
|
||||
Config::set('mail.port', $setting->port);
|
||||
}
|
||||
|
||||
static function host() {
|
||||
$setting = Settings::whereId('1')->first();
|
||||
Config::set('mail.host', $setting->host);
|
||||
}
|
||||
|
||||
static function encryption() {
|
||||
$setting = Settings::whereId('1')->first();
|
||||
Config::set(['mail.encryption' => $setting->encryption, 'mail.username' => $setting->email]);
|
||||
}
|
||||
|
||||
static function email() {
|
||||
$setting = Settings::whereId('1')->first();
|
||||
Config::set(['mail.from' => ['address' => $setting->email, 'name' => 'asd']]);
|
||||
//dd(Config::get('mail'));
|
||||
}
|
||||
|
||||
static function password() {
|
||||
$setting = Settings::whereId('1')->first();
|
||||
Config::set(['mail.password' => $setting->password, 'mail.sendmail' => $setting->email]);
|
||||
@@ -228,7 +238,6 @@ class UserController extends Controller {
|
||||
// $categorys->setPath('home');
|
||||
/* direct to view with $article_id */
|
||||
return view('themes.default1.client.kb.article-list.categoryList', compact('categorys', 'article_id'));
|
||||
|
||||
}
|
||||
|
||||
// static function timezone($utc) {
|
||||
@@ -238,7 +247,6 @@ class UserController extends Controller {
|
||||
// //$utc = date('M d Y h:i:s A');
|
||||
// //echo 'UTC : ' . $utc;
|
||||
// date_default_timezone_set($tz);
|
||||
|
||||
// $offset = date('Z', strtotime($utc));
|
||||
// //print "offset: $offset \n";
|
||||
// $date = date($format, strtotime($utc) + $offset);
|
||||
|
@@ -1,4 +1,7 @@
|
||||
<?php namespace App\Http\Controllers\Common;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Common;
|
||||
|
||||
// controllers
|
||||
use App\Http\Controllers\Controller;
|
||||
// requests
|
||||
@@ -43,7 +46,6 @@ class SettingsController extends Controller {
|
||||
SettingsController::password();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* get the page to create the footer
|
||||
* @return response
|
||||
@@ -63,15 +65,12 @@ class SettingsController extends Controller {
|
||||
->addColumn('name', function ($model) {
|
||||
return $model->name;
|
||||
})
|
||||
|
||||
->addColumn('title', function ($model) {
|
||||
return $model->title;
|
||||
})
|
||||
|
||||
->addColumn('body', function ($model) {
|
||||
return $model->value;
|
||||
})
|
||||
|
||||
->addColumn('Actions', function ($model) {
|
||||
return '<span data-toggle="modal" data-target="#edit_widget' . $model->id . '"><a class="btn btn-warning btn-xs">' . \Lang::get('lang.edit') . '</a></span>
|
||||
<div class="modal fade" id="edit_widget' . $model->id . '">
|
||||
@@ -107,11 +106,9 @@ class SettingsController extends Controller {
|
||||
</div>
|
||||
</div>';
|
||||
})
|
||||
|
||||
->make();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Post footer
|
||||
* @param type Footer $footer
|
||||
@@ -149,11 +146,9 @@ class SettingsController extends Controller {
|
||||
->addColumn('name', function ($model) {
|
||||
return $model->name;
|
||||
})
|
||||
|
||||
->addColumn('link', function ($model) {
|
||||
return $model->value;
|
||||
})
|
||||
|
||||
->addColumn('Actions', function ($model) {
|
||||
return '<span data-toggle="modal" data-target="#edit_widget' . $model->id . '"><a class="btn btn-warning btn-xs">' . \Lang::get('lang.edit') . '</a></span>
|
||||
<div class="modal fade" id="edit_widget' . $model->id . '">
|
||||
|
@@ -1,4 +1,7 @@
|
||||
<?php namespace App\Http\Controllers;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
// classes
|
||||
use Illuminate\Foundation\Bus\DispatchesCommands;
|
||||
use Illuminate\Routing\Controller as BaseController;
|
||||
|
@@ -1,4 +1,7 @@
|
||||
<?php namespace App\Http\Controllers\Error;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Error;
|
||||
|
||||
// controllers
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
@@ -18,4 +21,5 @@ class ErrorController extends Controller {
|
||||
public function error404() {
|
||||
return view('404');
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,9 +1,10 @@
|
||||
<?php namespace App\Http\Controllers;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Model\helpdesk\Manage\Sla_plan;
|
||||
use App\Model\helpdesk\Ticket\Tickets;
|
||||
|
||||
|
||||
class HomeController extends Controller {
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
@@ -35,7 +36,6 @@ class HomeController extends Controller {
|
||||
return view('themes/default1/admin/dashboard');
|
||||
}
|
||||
|
||||
|
||||
public function getsmtp() {
|
||||
$smtp = \App\Model\helpdesk\Email\Smtp::where('id', '=', '1')->first();
|
||||
return $smtp->host;
|
||||
@@ -73,7 +73,6 @@ class HomeController extends Controller {
|
||||
$last = rtrim($return, ',');
|
||||
|
||||
return '[' . $last . ']';
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,4 +1,7 @@
|
||||
<?php namespace App\Http\Controllers\Installer\helpdesk;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Installer\helpdesk;
|
||||
|
||||
// controllers
|
||||
use App\Http\Controllers\Controller;
|
||||
// requests
|
||||
@@ -20,6 +23,7 @@ use Redirect;
|
||||
use Session;
|
||||
use View;
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
* |=======================================================================
|
||||
* |Class: InstallController
|
||||
@@ -34,15 +38,16 @@ use Exception;
|
||||
*
|
||||
*/
|
||||
class InstallController extends Controller {
|
||||
|
||||
/**
|
||||
* Get Licence (step 1)
|
||||
* @return type view
|
||||
*/
|
||||
public function licence() {
|
||||
// checking if the installation is running for the first time or not
|
||||
if (Session::get('step5') == 'step5') {
|
||||
return Redirect::route('account');
|
||||
}
|
||||
// if (Session::get('step5') == 'step5') {
|
||||
// return Redirect::route('account');
|
||||
// }
|
||||
// checking if the installation is running for the first time or not
|
||||
if (Config::get('database.install') == '%0%') {
|
||||
return view('themes/default1/installer/helpdesk/view1');
|
||||
@@ -51,6 +56,7 @@ class InstallController extends Controller {
|
||||
return redirect('/auth/login');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Post Licencecheck
|
||||
* @return type view
|
||||
@@ -66,6 +72,7 @@ class InstallController extends Controller {
|
||||
}
|
||||
// return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get prerequisites (step 2)
|
||||
*
|
||||
@@ -75,9 +82,9 @@ class InstallController extends Controller {
|
||||
*/
|
||||
public function prerequisites() {
|
||||
// checking if the installation is running for the first time or not
|
||||
if (Session::get('step5') == 'step5') {
|
||||
return Redirect::route('account');
|
||||
}
|
||||
// if (Session::get('step5') == 'step5') {
|
||||
// return Redirect::route('account');
|
||||
// }
|
||||
// checking if the installation is running for the first time or not
|
||||
if (Config::get('database.install') == '%0%') {
|
||||
if (Session::get('step1') == 'step1') {
|
||||
@@ -89,6 +96,7 @@ class InstallController extends Controller {
|
||||
return redirect('/auth/login');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Post Prerequisitescheck
|
||||
* checking prerequisites
|
||||
@@ -98,6 +106,7 @@ class InstallController extends Controller {
|
||||
Session::put('step2', 'step2');
|
||||
return Redirect::route('configuration');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Localization (step 3)
|
||||
* Requesting user recomended settings for installation
|
||||
@@ -105,9 +114,9 @@ class InstallController extends Controller {
|
||||
*/
|
||||
public function localization() {
|
||||
// checking if the installation is running for the first time or not
|
||||
if (Session::get('step5') == 'step5') {
|
||||
return Redirect::route('account');
|
||||
}
|
||||
// if (Session::get('step5') == 'step5') {
|
||||
// return Redirect::route('account');
|
||||
// }
|
||||
// checking if the installation is running for the first time or not
|
||||
if (Config::get('database.install') == '%0%') {
|
||||
if (Session::get('step2') == 'step2') {
|
||||
@@ -119,19 +128,24 @@ class InstallController extends Controller {
|
||||
return redirect('/auth/login');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Post localizationcheck
|
||||
* checking prerequisites
|
||||
* @return type view
|
||||
*/
|
||||
public function localizationcheck() {
|
||||
|
||||
Session::put('step3', 'step3');
|
||||
|
||||
Session::put('language', Input::get('language'));
|
||||
Session::put('timezone', Input::get('timezone'));
|
||||
Session::put('date', Input::get('date'));
|
||||
Session::put('datetime', Input::get('datetime'));
|
||||
|
||||
return Redirect::route('configuration');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Configuration (step 4)
|
||||
* checking prerequisites
|
||||
@@ -139,9 +153,9 @@ class InstallController extends Controller {
|
||||
*/
|
||||
public function configuration() {
|
||||
// checking if the installation is running for the first time or not
|
||||
if (Session::get('step5') == 'step5') {
|
||||
return Redirect::route('account');
|
||||
}
|
||||
// if (Session::get('step5') == 'step5') {
|
||||
// return Redirect::route('account');
|
||||
// }
|
||||
// checking if the installation is running for the first time or not
|
||||
if (Config::get('database.install') == '%0%') {
|
||||
if (Session::get('step2') == 'step2') {
|
||||
@@ -153,21 +167,26 @@ class InstallController extends Controller {
|
||||
return redirect('/auth/login');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Post configurationcheck
|
||||
* checking prerequisites
|
||||
* @return type view
|
||||
*/
|
||||
public function configurationcheck() {
|
||||
|
||||
Session::put('step4', 'step4');
|
||||
|
||||
Session::put('default', Input::get('default'));
|
||||
Session::put('host', Input::get('host'));
|
||||
Session::put('databasename', Input::get('databasename'));
|
||||
Session::put('username', Input::get('username'));
|
||||
Session::put('password', Input::get('password'));
|
||||
Session::put('port', Input::get('port'));
|
||||
|
||||
return Redirect::route('database');
|
||||
}
|
||||
|
||||
/**
|
||||
* postconnection
|
||||
* @return type view
|
||||
@@ -180,6 +199,7 @@ class InstallController extends Controller {
|
||||
$dbusername = Input::get('username');
|
||||
$dbpassword = Input::get('password');
|
||||
$port = Input::get('port');
|
||||
|
||||
// Setting environment values
|
||||
$_ENV['DB_TYPE'] = $default;
|
||||
$_ENV['DB_HOST'] = $host;
|
||||
@@ -187,6 +207,7 @@ class InstallController extends Controller {
|
||||
$_ENV['DB_DATABASE'] = $database;
|
||||
$_ENV['DB_USERNAME'] = $dbusername;
|
||||
$_ENV['DB_PASSWORD'] = $dbpassword;
|
||||
|
||||
$config = '';
|
||||
foreach ($_ENV as $key => $val) {
|
||||
$config .= "{$key}={$val}\n";
|
||||
@@ -195,8 +216,10 @@ class InstallController extends Controller {
|
||||
$fp = fopen(base_path() . "/.env", 'w');
|
||||
fwrite($fp, $config);
|
||||
fclose($fp);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get database
|
||||
* checking prerequisites
|
||||
@@ -214,6 +237,7 @@ class InstallController extends Controller {
|
||||
return redirect('/auth/login');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get account
|
||||
* checking prerequisites
|
||||
@@ -235,6 +259,7 @@ class InstallController extends Controller {
|
||||
return redirect('/auth/login');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Post accountcheck
|
||||
* checking prerequisites
|
||||
@@ -242,19 +267,27 @@ class InstallController extends Controller {
|
||||
* @return type view
|
||||
*/
|
||||
public function accountcheck(InstallerRequest $request) {
|
||||
|
||||
// migrate database
|
||||
Artisan::call('migrate', array('--force' => true));
|
||||
Artisan::call('db:seed', array('--force' => true));
|
||||
|
||||
// create user
|
||||
$firstname = $request->input('firstname');
|
||||
$lastname = $request->input('Lastname');
|
||||
$email = $request->input('email');
|
||||
$username = $request->input('username');
|
||||
$password = $request->input('password');
|
||||
|
||||
$language = $request->input('language');
|
||||
$timezone = $request->input('timezone');
|
||||
$date = $request->input('date');
|
||||
$datetime = $request->input('datetime');
|
||||
|
||||
|
||||
//\Cache::forever('language', $language);
|
||||
|
||||
//\App::setLocale($language);
|
||||
// $system = System::where('id','=','1')->first();
|
||||
// $system->time_zone = $timezone;
|
||||
// $system->date_time_format = $datetime;
|
||||
@@ -271,6 +304,7 @@ class InstallController extends Controller {
|
||||
if ($date_time_format->id == null) {
|
||||
return ['response' => 'fail', 'reason' => 'invalid date-time format', 'status' => '0'];
|
||||
}
|
||||
|
||||
// Creating minum settings for system
|
||||
$system = new System;
|
||||
$system->status = 1;
|
||||
@@ -278,6 +312,8 @@ class InstallController extends Controller {
|
||||
$system->date_time_format = $date_time_format->id;
|
||||
$system->time_zone = $timezones->id;
|
||||
$system->save();
|
||||
|
||||
|
||||
// creating an user
|
||||
$user = User::create(array(
|
||||
'first_name' => $firstname,
|
||||
@@ -296,6 +332,7 @@ class InstallController extends Controller {
|
||||
return Redirect::route('final');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get finalize
|
||||
* checking prerequisites
|
||||
@@ -311,11 +348,22 @@ class InstallController extends Controller {
|
||||
File::put($install, $datacontent);
|
||||
// setting email settings in route
|
||||
$smtpfilepath = "\App\Http\Controllers\Common\SettingsController::smtp()";
|
||||
$lfmpath = "url('photos').'/'";
|
||||
$path22 = app_path('Http/routes.php');
|
||||
$path23 = base_path('config/lfm.php');
|
||||
$content23 = File::get($path22);
|
||||
$content24 = File::get($path23);
|
||||
$content23 = str_replace('"%smtplink%"', $smtpfilepath, $content23);
|
||||
$content24 = str_replace("'%url%'", $lfmpath, $content24);
|
||||
File::put($path22, $content23);
|
||||
File::put($path23, $content24);
|
||||
try {
|
||||
Session::forget('step1');
|
||||
Session::forget('step2');
|
||||
Session::forget('step3');
|
||||
Session::forget('step4');
|
||||
Session::forget('step5');
|
||||
Session::forget('step6');
|
||||
return View::make('themes/default1/installer/helpdesk/view6');
|
||||
} catch (Exception $e) {
|
||||
return Redirect::route('npl');
|
||||
@@ -324,6 +372,7 @@ class InstallController extends Controller {
|
||||
return redirect('/auth/login');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Post finalcheck
|
||||
* checking prerequisites
|
||||
@@ -336,4 +385,5 @@ class InstallController extends Controller {
|
||||
return redirect('/auth/login');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,119 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Http\Requests;
|
||||
use App\Http\Controllers\Controller;
|
||||
use Phpmailer\PHPMailerautoload;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class PhpMailController extends Controller {
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function index() {
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Sending emails from the system.
|
||||
*
|
||||
* @return Mail
|
||||
*/
|
||||
public function sendmail($host = '', $username = '', $password = '', $smtpsecure = '', $port = '', $from = '', $recipants = '', $subject = '', $body = '', $cc = '', $bc = '') {
|
||||
|
||||
$mail = new \PHPMailer;
|
||||
|
||||
//$mail->SMTPDebug = 3; // Enable verbose debug output
|
||||
|
||||
$mail->isSMTP(); // Set mailer to use SMTP
|
||||
$mail->Host = 'smtp.gmail.com'; // Specify main and backup SMTP servers
|
||||
$mail->SMTPAuth = true; // Enable SMTP authentication
|
||||
$mail->Username = 'sujitprasad4567@gmail.com'; // SMTP username
|
||||
$mail->Password = 'pankajprasad22.'; // SMTP password
|
||||
$mail->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted
|
||||
$mail->Port = 587; // TCP port to connect to
|
||||
|
||||
$mail->setFrom('sujitprasad4567@gmail.com', 'Mailer');
|
||||
$mail->addAddress('sada059@gmail.com', 'Joe User'); // Add a recipient
|
||||
// Name is optional
|
||||
$mail->addReplyTo('sada059@gmail.com', 'Information');
|
||||
|
||||
|
||||
// Optional name
|
||||
$mail->isHTML(true); // Set email format to HTML
|
||||
|
||||
$mail->Subject = 'Here is the subject';
|
||||
$mail->Body = 'This is the HTML message body <b>in bold!</b>';
|
||||
$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
|
||||
|
||||
if (!$mail->send()) {
|
||||
echo 'Message could not be sent.';
|
||||
echo 'Mailer Error: ' . $mail->ErrorInfo;
|
||||
} else {
|
||||
echo 'Message has been sent';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function create() {
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function store() {
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function show($id) {
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function edit($id) {
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function update($id) {
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function destroy($id) {
|
||||
//
|
||||
}
|
||||
|
||||
}
|
@@ -1,4 +1,6 @@
|
||||
<?php namespace App\Http;
|
||||
<?php
|
||||
|
||||
namespace App\Http;
|
||||
|
||||
use Illuminate\Foundation\Http\Kernel as HttpKernel;
|
||||
|
||||
@@ -36,6 +38,9 @@ class Kernel extends HttpKernel {
|
||||
'roles' => 'App\Http\Middleware\CheckRole',
|
||||
'role.agent' => 'App\Http\Middleware\CheckRoleAgent',
|
||||
'role.user' => 'App\Http\Middleware\CheckRoleUser',
|
||||
'api' => 'App\Http\Middleware\ApiKey',
|
||||
'jwt.auth' => \Tymon\JWTAuth\Middleware\GetUserFromToken::class,
|
||||
'jwt.refresh' => \Tymon\JWTAuth\Middleware\RefreshToken::class
|
||||
];
|
||||
|
||||
}
|
||||
|
@@ -1,4 +1,7 @@
|
||||
<?php namespace App\Http\Middleware;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Closure;
|
||||
use Illuminate\Contracts\Auth\Guard;
|
||||
|
||||
|
@@ -1,4 +1,7 @@
|
||||
<?php namespace App\Http\Middleware;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Closure;
|
||||
|
||||
/**
|
||||
|
@@ -1,4 +1,7 @@
|
||||
<?php namespace App\Http\Middleware;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Closure;
|
||||
|
||||
/**
|
||||
|
@@ -1,4 +1,7 @@
|
||||
<?php namespace App\Http\Middleware;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Closure;
|
||||
|
||||
/**
|
||||
|
@@ -1,4 +1,6 @@
|
||||
<?php namespace App\Http\Middleware;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Cache;
|
||||
use Closure;
|
||||
@@ -11,14 +13,14 @@ use Illuminate\Support\Facades\Config;
|
||||
use Illuminate\Support\Facades\Session;
|
||||
|
||||
class LanguageMiddleware implements Middleware {
|
||||
public function handle($request, Closure $next)
|
||||
{
|
||||
|
||||
public function handle($request, Closure $next) {
|
||||
if (Cache::has('language') AND array_key_exists(Cache::get('language'), Config::get('languages'))) {
|
||||
App::setLocale(Cache::get('language'));
|
||||
}
|
||||
else { // This is optional as Laravel will automatically set the fallback language if there is none specified
|
||||
} else { // This is optional as Laravel will automatically set the fallback language if there is none specified
|
||||
App::setLocale(Config::get('app.fallback_locale'));
|
||||
}
|
||||
return $next($request);
|
||||
}
|
||||
|
||||
}
|
@@ -1,4 +1,6 @@
|
||||
<?php namespace App\Http\Middleware;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Closure;
|
||||
use Illuminate\Contracts\Auth\Guard;
|
||||
|
@@ -1,4 +1,6 @@
|
||||
<?php namespace App\Http\Middleware;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Closure;
|
||||
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as BaseVerifier;
|
||||
|
@@ -1,9 +1,9 @@
|
||||
<?php namespace App\Http\Requests;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
abstract class Request extends FormRequest {
|
||||
|
||||
//
|
||||
|
||||
}
|
||||
|
@@ -1,4 +1,7 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\helpdesk;
|
||||
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
|
@@ -1,4 +1,7 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\helpdesk;
|
||||
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
|
@@ -1,4 +1,7 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\helpdesk;
|
||||
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
class ArticleRequest extends Request {
|
||||
|
@@ -1,4 +1,7 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\helpdesk;
|
||||
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
|
@@ -1,4 +1,7 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\helpdesk;
|
||||
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
|
@@ -1,4 +1,7 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\helpdesk;
|
||||
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
|
@@ -1,4 +1,7 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\helpdesk;
|
||||
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
|
@@ -1,4 +1,7 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\helpdesk;
|
||||
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
|
@@ -1,4 +1,7 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\helpdesk;
|
||||
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
|
@@ -1,4 +1,7 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\helpdesk;
|
||||
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
class CommentRequest extends Request {
|
||||
|
@@ -1,4 +1,7 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\helpdesk;
|
||||
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
|
@@ -1,4 +1,7 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\helpdesk;
|
||||
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
class ContactRequest extends Request {
|
||||
|
@@ -1,4 +1,7 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\helpdesk;
|
||||
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
|
@@ -1,4 +1,7 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\helpdesk;
|
||||
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
|
@@ -1,4 +1,7 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\helpdesk;
|
||||
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
|
@@ -1,4 +1,7 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\helpdesk;
|
||||
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
|
@@ -1,4 +1,7 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\helpdesk;
|
||||
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
|
@@ -1,4 +1,7 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\helpdesk;
|
||||
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
@@ -27,9 +30,9 @@ class EmailsEditRequest extends Request {
|
||||
return [
|
||||
'email_address' => 'email',
|
||||
'email_name' => 'required',
|
||||
'department' => 'required',
|
||||
'priority' => 'required',
|
||||
'help_topic' => 'required',
|
||||
// 'department' => 'required',
|
||||
// 'priority' => 'required',
|
||||
// 'help_topic' => 'required',
|
||||
// 'imap_config' => 'required',
|
||||
'password' => 'required|min:6',
|
||||
// 'user_name' => 'required',
|
||||
|
@@ -1,4 +1,7 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\helpdesk;
|
||||
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
@@ -27,9 +30,9 @@ class EmailsRequest extends Request {
|
||||
return [
|
||||
'email_address' => 'required|email|unique:emails',
|
||||
'email_name' => 'required',
|
||||
'department' => 'required',
|
||||
'priority' => 'required',
|
||||
'help_topic' => 'required',
|
||||
// 'department' => 'required',
|
||||
// 'priority' => 'required',
|
||||
// 'help_topic' => 'required',
|
||||
// 'imap_config' => 'required',
|
||||
'password' => 'required|min:6',
|
||||
// 'user_name' => 'required',
|
||||
|
@@ -1,4 +1,7 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\helpdesk;
|
||||
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
|
@@ -1,4 +1,7 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\helpdesk;
|
||||
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
|
@@ -1,4 +1,7 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\helpdesk;
|
||||
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
|
@@ -1,4 +1,7 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\helpdesk;
|
||||
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
|
@@ -1,4 +1,7 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\helpdesk;
|
||||
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
|
@@ -1,4 +1,7 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\helpdesk;
|
||||
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
|
@@ -1,4 +1,6 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\helpdesk;
|
||||
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
@@ -9,8 +11,7 @@ class MessageRequest extends Request {
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -19,14 +20,12 @@ class MessageRequest extends Request {
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
public function rules() {
|
||||
return [
|
||||
|
||||
|
||||
'message_title' => 'required',
|
||||
'message' => 'required'
|
||||
|
||||
];
|
||||
}
|
||||
|
||||
|
@@ -1,4 +1,7 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\helpdesk;
|
||||
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
|
@@ -1,4 +1,7 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\helpdesk;
|
||||
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
|
@@ -1,4 +1,7 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\helpdesk;
|
||||
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
|
@@ -1,4 +1,7 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\helpdesk;
|
||||
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
|
@@ -1,4 +1,7 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\helpdesk;
|
||||
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
|
@@ -1,4 +1,7 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\helpdesk;
|
||||
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
|
@@ -1,4 +1,7 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\helpdesk;
|
||||
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
|
@@ -1,4 +1,7 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\helpdesk;
|
||||
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
|
@@ -1,4 +1,7 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\helpdesk;
|
||||
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
|
@@ -1,4 +1,7 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\helpdesk;
|
||||
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
|
@@ -1,4 +1,7 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\helpdesk;
|
||||
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
|
@@ -1,4 +1,7 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\helpdesk;
|
||||
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
|
@@ -1,4 +1,7 @@
|
||||
<?php namespace App\Http\Requests\helpdesk;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\helpdesk;
|
||||
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user