update v1.0.7.9 R.C.

This is a Release Candidate. We are still testing.
This commit is contained in:
Sujit Prasad
2016-08-03 20:04:36 +05:30
parent 8b6b924d09
commit ffa56a43cb
3830 changed files with 181529 additions and 495353 deletions

View File

@@ -3,8 +3,8 @@
namespace App\Http\Controllers\Admin\helpdesk;
// controller
use App\Http\Controllers\Common\PhpMailController;
use App\Http\Controllers\Controller;
use App\Http\Controllers\Common\PhpMailController;
// request
use App\Http\Requests\helpdesk\AgentRequest;
use App\Http\Requests\helpdesk\AgentUpdate;
@@ -139,12 +139,14 @@ class AgentController extends Controller
// fetch user credentails to send mail
$name = $user->user_name;
$email = $user->email;
try {
// send mail on registration
$this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('1', '0'), $to = ['name' => $name, 'email' => $email], $message = ['subject' => null, 'scenario' => 'registration-notification'], $template_variables = ['user' => $name, 'email_address' => $email, 'user_password' => $password]);
} catch (Exception $e) {
// returns if try fails
return redirect('agents')->with('warning', Lang::get('lang.agent_send_mail_error_on_agent_creation'));
if($request->input('send_email')) {
try {
// send mail on registration
$this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('1', '0'), $to = ['name' => $name, 'email' => $email], $message = ['subject' => null, 'scenario' => 'registration-notification'], $template_variables = ['user' => $name, 'email_address' => $email, 'user_password' => $password]);
} catch (Exception $e) {
// returns if try fails
return redirect('agents')->with('warning', Lang::get('lang.agent_send_mail_error_on_agent_creation'));
}
}
// returns for the success case
return redirect('agents')->with('success', Lang::get('lang.agent_creation_success'));

View File

@@ -54,7 +54,7 @@ class CloseWrokflowController extends Controller
$security = new WorkflowClose();
$securitys = $security->whereId($id)->first();
$securitys->days = $request->input('days');
// $securitys->condition = $request->input('condition');
// $securitys->condition = $request->input('condition');
$securitys->send_email = $request->input('send_email');
$securitys->status = $request->input('status');
$securitys->save();

View File

@@ -29,15 +29,14 @@ use Lang;
*
* @author Ladybird <info@ladybirdweb.com>
*/
class DepartmentController extends Controller
{
class DepartmentController extends Controller {
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
public function __construct() {
$this->middleware('auth');
$this->middleware('roles');
}
@@ -49,11 +48,9 @@ class DepartmentController extends Controller
*
* @return type Response
*/
public function index(Department $department)
{
public function index(Department $department) {
try {
$departments = $department->get();
return view('themes.default1.admin.helpdesk.agent.departments.index', compact('departments'));
} catch (Exception $e) {
return view('404');
@@ -73,8 +70,7 @@ class DepartmentController extends Controller
*
* @return type Response
*/
public function create(User $user, Group_assign_department $group_assign_department, Department $department, Sla_plan $sla, Template $template, Emails $email, Groups $group)
{
public function create(User $user, Group_assign_department $group_assign_department, Department $department, Sla_plan $sla, Template $template, Emails $email, Groups $group) {
try {
$slas = $sla->get();
$user = $user->where('role', 'agent2')->get();
@@ -97,8 +93,7 @@ class DepartmentController extends Controller
*
* @return type Response
*/
public function store(Department $department, DepartmentRequest $request)
{
public function store(Department $department, DepartmentRequest $request) {
try {
$department->fill($request->except('group_id', 'manager', 'sla'))->save();
if ($request->sla) {
@@ -116,6 +111,11 @@ class DepartmentController extends Controller
/* Succes And Failure condition */
/* Check Whether the function Success or Fail */
if ($department->save() == true) {
if ($request->input('sys_department') == 'on') {
DB::table('settings_system')
->where('id', 1)
->update(['department' => $department->id]);
}
return redirect('departments')->with('success', Lang::get('lang.department_created_sucessfully'));
} else {
return redirect('departments')->with('fails', Lang::get('lang.failed_to_create_department'));
@@ -140,13 +140,12 @@ class DepartmentController extends Controller
*
* @return type Response
*/
public function edit($id, User $user, Group_assign_department $group_assign_department, Template $template, Teams $team, Department $department, Sla_plan $sla, Emails $email, Groups $group)
{
public function edit($id, User $user, Group_assign_department $group_assign_department, Template $template, Teams $team, Department $department, Sla_plan $sla, Emails $email, Groups $group) {
try {
$sys_department = \DB::table('settings_system')
->select('department')
->where('id', '=', 1)
->first();
->select('department')
->where('id', '=', 1)
->first();
$slas = $sla->get();
$user = $user->where('primary_dpt', $id)->get();
$emails = $email->get();
@@ -171,8 +170,7 @@ class DepartmentController extends Controller
*
* @return type Response
*/
public function update($id, Group_assign_department $group_assign_department, Department $department, DepartmentUpdate $request)
{
public function update($id, Group_assign_department $group_assign_department, Department $department, DepartmentUpdate $request) {
// dd($id);
try {
$table = $group_assign_department->where('department_id', $id);
@@ -198,8 +196,8 @@ class DepartmentController extends Controller
}
if ($request->input('sys_department') == 'on') {
DB::table('settings_system')
->where('id', 1)
->update(['department' => $id]);
->where('id', 1)
->update(['department' => $id]);
}
if ($departments->fill($request->except('group_access', 'manager', 'sla'))->save()) {
return redirect('departments')->with('success', Lang::get('lang.department_updated_sucessfully'));
@@ -220,9 +218,9 @@ class DepartmentController extends Controller
*
* @return type Response
*/
public function destroy($id, Department $department, Group_assign_department $group_assign_department, System $system, Tickets $tickets)
{
public function destroy($id, Department $department, Group_assign_department $group_assign_department, System $system, Tickets $tickets) {
// try {
$system = $system->where('id', '=', '1')->first();
if ($system->department == $id) {
return redirect('departments')->with('fails', Lang::get('lang.you_cannot_delete_default_department'));
@@ -234,7 +232,7 @@ class DepartmentController extends Controller
} else {
$text_tickets = 'Ticket';
}
$ticket = '<li>'.$tickets.' '.$text_tickets.Lang::get('lang.have_been_moved_to_default_department').'</li>';
$ticket = '<li>' . $tickets . ' ' . $text_tickets . Lang::get('lang.have_been_moved_to_default_department') . '</li>';
} else {
$ticket = '';
}
@@ -245,7 +243,7 @@ class DepartmentController extends Controller
} else {
$text_user = 'User';
}
$user = '<li>'.$users.' '.$text_user.Lang::get('lang.have_been_moved_to_default_department').'</li>';
$user = '<li>' . $users . ' ' . $text_user . Lang::get('lang.have_been_moved_to_default_department') . '</li>';
} else {
$user = '';
}
@@ -256,27 +254,28 @@ class DepartmentController extends Controller
} else {
$text_emails = 'Email';
}
$email = '<li>'.$emails.' System '.$text_emails.Lang::get('lang.have_been_moved_to_default_department').' </li>';
$email = '<li>' . $emails . ' System ' . $text_emails . Lang::get('lang.have_been_moved_to_default_department') . ' </li>';
} else {
$email = '';
}
$helptopic = DB::table('help_topic')->where('department', '=', $id)->update(['department' => null], ['status' => '1']);
if ($helptopic > 0) {
$helptopic = '<li>'.Lang::get('lang.the_associated_helptopic_has_been_deactivated').'</li>';
$helptopic = '<li>' . Lang::get('lang.the_associated_helptopic_has_been_deactivated') . '</li>';
} else {
$helptopic = '';
}
$message = $ticket.$user.$email.$helptopic;
$message = $ticket . $user . $email . $helptopic;
/* Becouse of foreign key we delete group_assign_department first */
$group_assign_department = $group_assign_department->where('department_id', $id);
$group_assign_department->delete();
$departments = $department->whereId($id)->first();
/* Check the function is Success or Fail */
if ($departments->delete() == true) {
return redirect('departments')->with('success', Lang::get('lang.department_deleted_sucessfully').$message);
return redirect('departments')->with('success', Lang::get('lang.department_deleted_sucessfully') . $message);
} else {
return redirect('departments')->with('fails', Lang::get('lang.department_can_not_delete'));
}
}
}
}

View File

@@ -498,7 +498,7 @@ class EmailsController extends Controller
$mailbox_protocol = $fetching_encryption2;
$host = $request->input('fetching_host');
$port = $request->input('fetching_port');
$mailbox = '{'.$host.':'.$port.$mailbox_protocol.'}INBOX';
$mailbox = '{'.$host.':'.$port.$fetching_protocol.$mailbox_protocol.'}INBOX';
} else {
$mailbox_protocol = $fetching_protocol.$fetching_encryption;
$host = $request->input('fetching_host');

View File

@@ -1,7 +1,5 @@
<?php
namespace App\Http\Controllers\Admin\helpdesk;
// Controller
use App\Http\Controllers\Controller;
// Model
@@ -14,7 +12,6 @@ use Illuminate\Http\Request;
use Input;
use Lang;
use Redirect;
/**
* FormController
* This controller is used to CRUD Custom Forms.
@@ -25,14 +22,12 @@ class FormController extends Controller
{
private $fields;
private $forms;
public function __construct(Fields $fields, Forms $forms)
{
$this->fields = $fields;
$this->forms = $forms;
$this->middleware('auth');
}
/**
* home.
*
@@ -42,7 +37,6 @@ class FormController extends Controller
{
return view('forms.home');
}
/**
* list of forms.
*
@@ -58,7 +52,6 @@ class FormController extends Controller
return redirect()->back()->with('fails', $e->getMessage());
}
}
/**
* create a new form.
*
@@ -72,7 +65,6 @@ class FormController extends Controller
return redirect()->back()->with('fails', $e->getMessage());
}
}
/**
* Show a new form.
*
@@ -88,7 +80,6 @@ class FormController extends Controller
return redirect()->back()->with('fails', $e->getMessage());
}
}
/**
* Store a new form.
*
@@ -124,10 +115,8 @@ class FormController extends Controller
}
}
Fields::insert($fields);
return Redirect::back()->with('success', Lang::get('lang.successfully_created_form'));
}
/**
* Delete Form.
*
@@ -151,7 +140,6 @@ class FormController extends Controller
}
$forms = $forms->where('id', $id)->first();
$forms->delete();
return redirect()->back()->with('success', Lang::get('lang.form_deleted_successfully'));
}
}
}

View File

@@ -40,7 +40,7 @@ class HelptopicController extends Controller
}
/**
* Display a listing of the resource.
* Display a listing of the helptopic.
*
* @param type Help_topic $topic
*
@@ -58,7 +58,7 @@ class HelptopicController extends Controller
}
/**
* Show the form for creating a new resource.
* Show the form for creating a new helptopic.
*
* @param type Priority $priority
* @param type Department $department
@@ -96,7 +96,7 @@ class HelptopicController extends Controller
}
/**
* Store a newly created resource in storage.
* Store a newly created helptpoic in storage.
*
* @param type Help_topic $topic
* @param type HelptopicRequest $request
@@ -128,7 +128,7 @@ class HelptopicController extends Controller
}
/**
* Show the form for editing the specified resource.
* Show the form for editing the specified helptopic.
*
* @param type $id
* @param type Priority $priority
@@ -160,7 +160,7 @@ class HelptopicController extends Controller
}
/**
* Update the specified resource in storage.
* Update the specified helptopic in storage.
*
* @param type $id
* @param type Help_topic $topic
@@ -201,7 +201,7 @@ class HelptopicController extends Controller
}
/**
* Remove the specified resource from storage.
* Remove the specified helptopic from storage.
*
* @param type int $id
* @param type Help_topic $topic

View File

@@ -98,7 +98,12 @@ class LanguageController extends Controller
$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);
if ($model == Config::get('app.fallback_locale')) {
return Config::get('languages.'.$model).' ('.Lang::get('lang.default').')';
} else {
return Config::get('languages.'.$model);
}
})
->addColumn('id', function ($model) {
return $model;
@@ -228,24 +233,29 @@ class LanguageController extends Controller
public function deleteLanguage($lang)
{
if ($lang !== App::getLocale()) {
$deletePath = base_path('resources/lang').'/'.$lang; //define file path to delete
$success = File::deleteDirectory($deletePath); //remove extracted folder and it's subfolder from lang
if ($success) {
//sending back with success message
Session::flash('success', Lang::get('lang.delete-success'));
return Redirect::back();
if ($lang !== Config::get('app.fallback_locale')) {
$deletePath = base_path('resources/lang').'/'.$lang; //define file path to delete
$success = File::deleteDirectory($deletePath); //remove extracted folder and it's subfolder from lang
if ($success) {
//sending back with success message
Session::flash('success', Lang::get('lang.delete-success'));
return Redirect::back();
} else {
//sending back with error message
Session::flash('fails', Lang::get('lang.lang-doesnot-exist'));
return Redirect::back();
}
} else {
//sending back with error message
Session::flash('fails', Lang::get('lang.lang-doesnot-exist'));
return Redirect::back();
Session::flash('fails', Lang::get('lang.lang-fallback-lang'));
return redirect('languages');
}
} else {
//sending back with error message
Session::flash('fails', Lang::get('lang.active-lang-error'));
return redirect('languages');
}
}
}

View File

@@ -64,10 +64,10 @@ class SecurityController extends Controller
*
* @return Response
*/
public function show($id)
{
return view('themes.default1.admin.helpdesk.setting.security.preview', compact('id'));
}
// public function show($id)
// {
// return view('themes.default1.admin.helpdesk.setting.security.preview', compact('id'));
// }
/**
* Update security details.

View File

@@ -30,6 +30,7 @@ use App\Model\helpdesk\Utility\Date_time_format;
use App\Model\helpdesk\Utility\Time_format;
use App\Model\helpdesk\Utility\Timezones;
use App\Model\helpdesk\Workflow\WorkflowClose;
use App\Model\helpdesk\Settings\CommonSettings;
use DateTime;
// classes
use DB;
@@ -93,7 +94,7 @@ class SettingsController extends Controller
$companys = $company->whereId('1')->first();
if (Input::file('logo')) {
$name = Input::file('logo')->getClientOriginalName();
$destinationPath = 'lb-faveo/media/company/';
$destinationPath = 'uploads/company/';
$fileName = rand(0000, 9999).'.'.$name;
Input::file('logo')->move($destinationPath, $fileName);
$companys->logo = $fileName;
@@ -145,7 +146,7 @@ class SettingsController extends Controller
*
* @return type Response
*/
public function getsystem(System $system, Department $department, Timezones $timezone, Date_format $date, Date_time_format $date_time, Time_format $time)
public function getsystem(System $system, Department $department, Timezones $timezone, Date_format $date, Date_time_format $date_time, Time_format $time, CommonSettings $common_settings)
{
try {
/* fetch the values of system from system table */
@@ -154,11 +155,11 @@ class SettingsController extends Controller
$departments = $department->get();
/* Fetch the values from Timezones table */
$timezones = $timezone->get();
//$debug = \Config::get('app.debug');
//dd($value);
/* Fetch status value of common settings */
$common_setting = $common_settings->select('status')->where('option_name', '=', 'user_set_ticket_status')->first();
// /dd($common_setting);
/* Direct to System Settings Page */
return view('themes.default1.admin.helpdesk.settings.system', compact('systems', 'departments', 'timezones', 'time', 'date', 'date_time'));
return view('themes.default1.admin.helpdesk.settings.system', compact('systems', 'departments', 'timezones', 'time', 'date', 'date_time', 'common_setting'));
} catch (Exception $e) {
return redirect()->back()->with('fails', $e->getMessage());
}
@@ -176,16 +177,26 @@ class SettingsController extends Controller
public function postsystem($id, System $system, SystemRequest $request)
{
try {
// dd($request);
//dd($request->user_set_ticket_status);
/* fetch the values of system request */
$systems = $system->whereId('1')->first();
/* fill the values to coompany table */
/* Check whether function success or not */
$systems->fill($request->input())->save();
/* redirect to Index page with Success Message */
$rtl = CommonSettings::where('option_name', '=', 'enable_rtl')->first();
if($request->enable_rtl != null) {
$rtl->option_value = 1;
} else {
$rtl->option_value = 0;
}
$rtl->save();
// dd($datacontent);
//\Config::set('app.debug', $request->input('debug'));
$usts = CommonSettings::where('option_name', '=', 'user_set_ticket_status')->first();
if ($usts->status != $request->user_set_ticket_status){
$usts->status = $request->user_set_ticket_status;
$usts->save();
}
/* redirect to Index page with Success Message */
return redirect('getsystem')->with('success', Lang::get('lang.system_updated_successfully'));
} catch (Exception $e) {
/* redirect to Index page with Fails Message */
@@ -220,7 +231,7 @@ class SettingsController extends Controller
}
/**
* Update the specified resource in storage.
* Update the specified Ticket in storage.
*
* @param type int $id
* @param type Ticket $ticket
@@ -280,7 +291,7 @@ class SettingsController extends Controller
}
/**
* Update the specified resource in storage.
* Update the specified email setting in storage.
*
* @param type int $id
* @param type Email $email
@@ -339,7 +350,7 @@ class SettingsController extends Controller
}
/**
* Update the specified resource in storage for cron job.
* Update the specified schedular in storage for cron job.
*
* @param type Email $email
* @param type EmailRequest $request
@@ -399,7 +410,7 @@ class SettingsController extends Controller
}
/**
* Update the specified resource in storage.
* Update the specified autoresponse in storage.
*
* @param type Responder $responder
* @param type Request $request
@@ -448,7 +459,7 @@ class SettingsController extends Controller
}
/**
* Update the specified resource in storage.
* Update the specified alert in storage.
*
* @param type $id
* @param type Alert $alert

View File

@@ -221,7 +221,7 @@ class SettingsController2 extends Controller
$companys = $company->whereId('1')->first();
if (Input::file('logo')) {
$name = Input::file('logo')->getClientOriginalName();
$destinationPath = 'lb-faveo/media/company/';
$destinationPath = 'uploads/company/';
$fileName = rand(0000, 9999).'.'.$name;
Input::file('logo')->move($destinationPath, $fileName);
$companys->logo = $fileName;

View File

@@ -13,6 +13,7 @@ use App\Http\Requests\helpdesk\TemplateUdate;
use App\Model\helpdesk\Email\Emails;
use App\Model\helpdesk\Email\Template;
use App\Model\helpdesk\Utility\Languages;
use App\Model\helpdesk\Settings\CommonSettings;
// classes
use Exception;
use Illuminate\Http\Request;
@@ -326,9 +327,17 @@ class TemplateController extends Controller
$mail->SetFrom($email_details->email_address, $email_details->email_name); // sender details
$address = $request->to; // receiver email
$mail->AddAddress($address);
$mail->Subject = utf8_decode($request->subject); // subject of the email
$body = utf8_decode($request->message); // body of the email
$mail->MsgHTML($body);
$mail->Subject = $request->subject; // subject of the email
$body = $request->message; // body of the email
$mail->CharSet = "utf8";
// $mail->MsgHTML($body);
// $body = $request->message;
$rtl = CommonSettings::where('option_name', '=', 'enable_rtl')->first();
if($rtl->option_value == 1) {
$mail->ContentType = 'text/html';
$body = '<html dir="rtl" xml:lang="ar" lang="ar"><head></head><body dir="rtl">' . $body . '</body></html>';
} else {
}
if (!$mail->Send()) {
$return = Lang::get('lang.mailer_error').': '.$mail->ErrorInfo;
} else {
@@ -355,15 +364,22 @@ class TemplateController extends Controller
$mail->setFrom($email_details->email_address, $email_details->email_name);
$mail->addAddress($request->to, ''); // Add a recipient
$mail->isHTML(true); // Set email format to HTML
$mail->Subject = utf8_decode($request->subject);
$mail->Body = utf8_decode($request->message);
$mail->CharSet = "utf8";
$mail->Subject = $request->subject;
$body = $request->message;
$rtl = CommonSettings::where('option_name', '=', 'enable_rtl')->first();
if($rtl->option_value == 1) {
$mail->ContentType = 'text/html';
$body = '<html dir="rtl" xml:lang="ar" lang="ar"><head></head><body dir="rtl">' . $body . '</body></html>';
} else {
}
$mail->Body = $body;
if (!$mail->send()) {
$return = Lang::get('lang.mailer_error').': '.$mail->ErrorInfo;
} else {
$return = Lang::get('lang.message_has_been_sent');
}
}
return redirect()->back()->with('success', $return);
} catch (Exception $e) {
return redirect()->back()->with('fails', $e->getMessage());

View File

@@ -6,7 +6,7 @@ namespace App\Http\Controllers\Admin\helpdesk;
use App\Http\Controllers\Controller;
// models
use App\Model\helpdesk\Priority;
use App\Model\helpdesk\Ticket_thread;
use App\Model\helpdesk\Ticket_Thread;
// classes
use Exception;
@@ -25,7 +25,7 @@ class ThreadController extends Controller
*
* @return type Response
*/
public function getTickets(Ticket_thread $thread, Priority $priority)
public function getTickets(Ticket_Thread $thread, Priority $priority)
{
try {
/* get the values of Ticket_thread from Ticket_thread Table */

View File

@@ -132,7 +132,7 @@ class WorkflowController extends Controller
->addColumn('Actions', function ($model) {
$confirmation = 'Are you sure?';
return "<a class='btn btn-info btn-xs btn-flat' href='".route('workflow.edit', $model->id)."'><i class='fa fa-edit text-black'></i> Edit</a> <a class='btn btn-danger btn-xs btn-flat' href='".route('workflow.delete', $model->id)."'><i class='fa fa-trash text-black'></i> Delete</a>";
return "<a class='btn btn-info btn-xs btn-flat' href='".route('workflow.edit', $model->id)."'><i class='fa fa-edit text-black'></i> Edit</a> <a class='btn btn-danger btn-xs btn-flat' href='".route('workflow.delete', $model->id)."' onclick='return confirm_delete()'><i class='fa fa-trash text-black'></i> Delete</a> ";
})
->make();
}