update v1.0.5.1
This commit is contained in:
@@ -46,22 +46,22 @@ class Handler extends ExceptionHandler {
|
||||
*/
|
||||
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);
|
||||
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);
|
||||
|
||||
if ($this->isHttpException($e))
|
||||
{
|
||||
|
@@ -148,8 +148,8 @@ class InstallerApiController extends Controller {
|
||||
'password' => Hash::make($password),
|
||||
'active' => 1,
|
||||
'role' => 'admin',
|
||||
'assign_group' => 'group A',
|
||||
'primary_dpt' => 'support',
|
||||
'assign_group' => 1,
|
||||
'primary_dpt' => 1,
|
||||
));
|
||||
|
||||
// Setting database installed status
|
||||
|
@@ -91,8 +91,19 @@ class HelptopicController extends Controller {
|
||||
*/
|
||||
public function store(Help_topic $topic, HelptopicRequest $request) {
|
||||
try {
|
||||
if($request->custom_form){
|
||||
$custom_form = $request->custom_form;
|
||||
} else {
|
||||
$custom_form = null;
|
||||
}
|
||||
if($request->auto_assign){
|
||||
$auto_assign = $request->auto_assign;
|
||||
} else {
|
||||
$auto_assign = null;
|
||||
}
|
||||
/* Check whether function success or not */
|
||||
$topic->fill($request->input())->save();
|
||||
$topic->fill($request->except('custom_form','auto_assign'))->save();
|
||||
// $topics->fill($request->except('custom_form','auto_assign'))->save();
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('helptopic')->with('success', 'Helptopic Created Successfully');
|
||||
} catch (Exception $e) {
|
||||
|
@@ -88,7 +88,7 @@ class LanguageController extends Controller {
|
||||
*/
|
||||
public function getLanguages()
|
||||
{
|
||||
$path = 'code/resources/lang';
|
||||
$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))
|
||||
@@ -150,7 +150,7 @@ class LanguageController extends Controller {
|
||||
|
||||
|
||||
//Checking if package already exists or not in lang folder
|
||||
$path = 'code/resources/lang';
|
||||
$path = '../resources/lang';
|
||||
if (in_array(Input::get('iso-code'), scandir($path))) {
|
||||
|
||||
//sending back with error message
|
||||
@@ -168,10 +168,9 @@ class LanguageController extends Controller {
|
||||
|
||||
// checking file is valid.
|
||||
if (Input::file('File')->isValid()) {
|
||||
|
||||
$name = Input::file('File')->getClientOriginalName(); //uploaded file's original name
|
||||
$destinationPath = 'code/public/uploads/'; // defining uploading path
|
||||
$extractpath = 'code/resources/lang/'.Input::get('iso-code');//defining extracting path
|
||||
$destinationPath = '../public/uploads/'; // defining uploading path
|
||||
$extractpath = '../resources/lang/'.Input::get('iso-code');//defining extracting path
|
||||
mkdir($extractpath); //creating directroy for extracting uploadd file
|
||||
//mkdir($destinationPath);
|
||||
Input::file('File')->move($destinationPath, $name); // uploading file to given path
|
||||
@@ -183,42 +182,32 @@ class LanguageController extends Controller {
|
||||
if(!empty($directories)){ //if extract folder contains subfolder
|
||||
$success = File::deleteDirectory($extractpath); //remove extracted folder and it's subfolder from lang
|
||||
//$success2 = File::delete($destinationPath.'/'.$name);
|
||||
|
||||
if($success){
|
||||
//sending back with error message
|
||||
Session::flash('fails', 'Error in directory structure. Zip file must contain language php files only. Try Again.');
|
||||
return Redirect::back()->withInput();
|
||||
}
|
||||
|
||||
}
|
||||
} else {
|
||||
|
||||
// sending back with success message
|
||||
Session::flash('success', "uploaded successfully.");
|
||||
Session::flash('link',"change-language/".Input::get('iso-code'));
|
||||
return Redirect::route('LanguageController');
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
// sending back with error message.
|
||||
Session::flash('fails', 'uploaded file is not valid');
|
||||
return Redirect::route('form');
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*allow user to download language template file
|
||||
*@return type
|
||||
*/
|
||||
Public function download()
|
||||
{
|
||||
return response()->download('code/public/downloads/en.zip');
|
||||
Public function download() {
|
||||
return response()->download('../public/downloads/en.zip');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -228,9 +217,9 @@ class LanguageController extends Controller {
|
||||
*/
|
||||
public function deleteLanguage($lang){
|
||||
if($lang !== App::getLocale()){
|
||||
$deletePath = 'code/resources/lang/'.$lang; //define file path to delete
|
||||
$deletePath = '../resources/lang/'.$lang; //define file path to delete
|
||||
$success = File::deleteDirectory($deletePath); //remove extracted folder and it's subfolder from lang
|
||||
if($success){
|
||||
if($success) {
|
||||
//sending back with success message
|
||||
Session::flash('success', 'Language package deleted successfully.');
|
||||
return Redirect::back();
|
||||
@@ -245,6 +234,4 @@ class LanguageController extends Controller {
|
||||
return redirect('languages');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@@ -80,21 +80,19 @@ class SettingsController extends Controller {
|
||||
* @param type CompanyRequest $request
|
||||
* @return Response
|
||||
*/
|
||||
public function postcompany($id, Company $company, CompanyRequest $request) {
|
||||
|
||||
public function postcompany($id, Company $company, CompanyRequest $request) {
|
||||
/* fetch the values of company request */
|
||||
$companys = $company->whereId('1')->first();
|
||||
if (Input::file('logo')) {
|
||||
$name = Input::file('logo')->getClientOriginalName();
|
||||
$destinationPath = 'lb-faveo/dist/';
|
||||
$destinationPath = 'lb-faveo/media/company/';
|
||||
$fileName = rand(0000, 9999) . '.' . $name;
|
||||
Input::file('logo')->move($destinationPath, $fileName);
|
||||
$companys->logo = $fileName;
|
||||
}
|
||||
if($request->input('use_logo')==null)
|
||||
{
|
||||
$companys->use_logo = '0';
|
||||
}
|
||||
if($request->input('use_logo')==null) {
|
||||
$companys->use_logo = '0';
|
||||
}
|
||||
/* Check whether function success or not */
|
||||
try {
|
||||
$companys->fill($request->except('logo'))->save();
|
||||
|
@@ -697,27 +697,34 @@ class TicketController extends Controller {
|
||||
* @return type response
|
||||
*/
|
||||
public function post_newticket(CreateTicketRequest $request) {
|
||||
$email = $request->input('email');
|
||||
$fullname = $request->input('fullname');
|
||||
$helptopic = $request->input('helptopic');
|
||||
$sla = $request->input('sla');
|
||||
$duedate = $request->input('duedate');
|
||||
$assignto = $request->input('assignto');
|
||||
|
||||
$subject = $request->input('subject');
|
||||
$body = $request->input('body');
|
||||
$priority = $request->input('priority');
|
||||
$phone = $request->input('phone');
|
||||
$source = Ticket_source::where('name','=','email')->first();
|
||||
$headers = null;
|
||||
$help = Help_topic::where('id','=',$helptopic)->first();
|
||||
$form_data = null;
|
||||
//create user
|
||||
if ($this->create_user($email, $fullname, $subject, $body, $phone, $helptopic, $sla, $priority, $source->id, $headers, $help->department, $assignto, $form_data)) {
|
||||
return Redirect('newticket')->with('success', 'Ticket created successfully!');
|
||||
} else {
|
||||
return Redirect('newticket')->with('fails', 'fails');
|
||||
}
|
||||
try{
|
||||
$email = $request->input('email');
|
||||
$fullname = $request->input('fullname');
|
||||
$helptopic = $request->input('helptopic');
|
||||
$sla = $request->input('sla');
|
||||
$duedate = $request->input('duedate');
|
||||
if($request->input('assignto')){
|
||||
$assignto = $request->input('assignto');
|
||||
} else {
|
||||
$assignto = null;
|
||||
}
|
||||
$subject = $request->input('subject');
|
||||
$body = $request->input('body');
|
||||
$priority = $request->input('priority');
|
||||
$phone = $request->input('phone');
|
||||
$source = Ticket_source::where('name','=','email')->first();
|
||||
$headers = null;
|
||||
$help = Help_topic::where('id','=',$helptopic)->first();
|
||||
$form_data = null;
|
||||
//create user
|
||||
if ($this->create_user($email, $fullname, $subject, $body, $phone, $helptopic, $sla, $priority, $source->id, $headers, $help->department, $assignto, $form_data)) {
|
||||
return Redirect('newticket')->with('success', 'Ticket created successfully!');
|
||||
} else {
|
||||
return Redirect('newticket')->with('fails', 'fails');
|
||||
}
|
||||
} catch(Exception $e){
|
||||
return Redirect()->back()->with('fails', '<li>'.$e->errorInfo[2].'</li>');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1083,24 +1090,38 @@ class TicketController extends Controller {
|
||||
}
|
||||
}
|
||||
|
||||
if(Alert::first()->ticket_status == 1 || Alert::first()->ticket_department_member == 1) {
|
||||
// send email to agents
|
||||
$agents = User::where('role','=','agent')->get();
|
||||
// dd($agents);
|
||||
foreach($agents as $agent)
|
||||
{
|
||||
$department_data = Department::where('id','=',$ticketdata->dept_id)->first();
|
||||
|
||||
if($department_data->name == $agent->primary_dpt)
|
||||
{
|
||||
$agent_email = $agent->email;
|
||||
$agent_user = $agent->first_name;
|
||||
Mail::send('emails.'.$mail, ['agent' => $agent_user ,'content'=>$body , 'ticket_number' => $ticket_number2, 'from'=>$company, 'email' => $emailadd, 'name' => $ticket_creator, 'system' => $system], function ($message) use ($agent_email, $agent_user, $ticket_number2, $updated_subject) {
|
||||
$message->to($agent_email, $agent_user)->subject($updated_subject);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
if($is_reply == 0) {
|
||||
if(Alert::first()->ticket_status == 1 || Alert::first()->ticket_department_member == 1) {
|
||||
// send email to agents
|
||||
$agents = User::where('role','=','agent')->get();
|
||||
// dd($agents);
|
||||
foreach($agents as $agent)
|
||||
{
|
||||
$department_data = Department::where('id','=',$ticketdata->dept_id)->first();
|
||||
|
||||
if($department_data->name == $agent->primary_dpt)
|
||||
{
|
||||
$agent_email = $agent->email;
|
||||
$agent_user = $agent->first_name;
|
||||
Mail::send('emails.'.$mail, ['agent' => $agent_user ,'content'=>$body , 'ticket_number' => $ticket_number2, 'from'=>$company, 'email' => $emailadd, 'name' => $ticket_creator, 'system' => $system], function ($message) use ($agent_email, $agent_user, $ticket_number2, $updated_subject) {
|
||||
$message->to($agent_email, $agent_user)->subject($updated_subject);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if($ticketdata->assigned_to) {
|
||||
$assigned_to = User::where('id','=',$ticketdata->assigned_to)->first();
|
||||
$agent_email = $assigned_to->email;
|
||||
$agent_user = $assigned_to->first_name;
|
||||
Mail::send('emails.'.$mail, ['agent' => $assigned_to->user_name ,'content'=>$body , 'ticket_number' => $ticket_number2, 'from'=>$company, 'email' => $assigned_to->email, 'name' => $ticket_creator, 'system' => $system], function ($message) use ($agent_email, $agent_user, $ticket_number2, $updated_subject) {
|
||||
$message->to($agent_email, $agent_user)->subject($updated_subject);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
return ['0'=>$ticket_number2, '1'=>true];
|
||||
}
|
||||
}
|
||||
|
@@ -253,11 +253,11 @@ class UserController extends Controller {
|
||||
if ($user->profile_pic == 'avatar5.png' || $user->profile_pic == 'avatar2.png') {
|
||||
if ($request->input('gender') == 1) {
|
||||
$name = 'avatar5.png';
|
||||
$destinationPath = 'lb-faveo/profilepic';
|
||||
$destinationPath = 'lb-faveo/media/profilepic';
|
||||
$user->profile_pic = $name;
|
||||
} elseif ($request->input('gender') == 0) {
|
||||
$name = 'avatar2.png';
|
||||
$destinationPath = 'lb-faveo/profilepic';
|
||||
$destinationPath = 'lb-faveo/media/profilepic';
|
||||
$user->profile_pic = $name;
|
||||
}
|
||||
}
|
||||
@@ -266,7 +266,7 @@ class UserController extends Controller {
|
||||
// fetching picture name
|
||||
$name = Input::file('profile_pic')->getClientOriginalName();
|
||||
// fetching upload destination path
|
||||
$destinationPath = 'lb-faveo/profilepic';
|
||||
$destinationPath = 'lb-faveo/media/profilepic';
|
||||
// adding a random value to profile picture filename
|
||||
$fileName = rand(0000, 9999) . '.' . $name;
|
||||
// moving the picture to a destination folder
|
||||
|
@@ -66,18 +66,18 @@ class GuestController extends Controller {
|
||||
if ($user->profile_pic == 'avatar5.png' || $user->profile_pic == 'avatar2.png') {
|
||||
if ($request->input('gender') == 1) {
|
||||
$name = 'avatar5.png';
|
||||
$destinationPath = 'lb-faveo/profilepic';
|
||||
$destinationPath = 'lb-faveo/media/profilepic';
|
||||
$user->profile_pic = $name;
|
||||
} elseif ($request->input('gender') == 0) {
|
||||
$name = 'avatar2.png';
|
||||
$destinationPath = 'lb-faveo/profilepic';
|
||||
$destinationPath = 'lb-faveo/media/profilepic';
|
||||
$user->profile_pic = $name;
|
||||
}
|
||||
}
|
||||
if (Input::file('profile_pic')) {
|
||||
//$extension = Input::file('profile_pic')->getClientOriginalExtension();
|
||||
$name = Input::file('profile_pic')->getClientOriginalName();
|
||||
$destinationPath = 'lb-faveo/profilepic';
|
||||
$destinationPath = 'lb-faveo/media/profilepic';
|
||||
$fileName = rand(0000, 9999) . '.' . $name;
|
||||
//echo $fileName;
|
||||
Input::file('profile_pic')->move($destinationPath, $fileName);
|
||||
|
Reference in New Issue
Block a user