Applied fixes from StyleCI
This commit is contained in:
@@ -3,20 +3,19 @@
|
||||
namespace App\Exceptions;
|
||||
|
||||
// controller
|
||||
use Exception;
|
||||
use Bugsnag;
|
||||
//use Illuminate\Validation\ValidationException;
|
||||
use Illuminate\Foundation\Validation\ValidationException;
|
||||
use Bugsnag\BugsnagLaravel\BugsnagExceptionHandler as ExceptionHandler;
|
||||
use Exception;
|
||||
use Illuminate\Auth\Access\AuthorizationException;
|
||||
use Illuminate\Database\Eloquent\ModelNotFoundException;
|
||||
// use Symfony\Component\HttpKernel\Exception\HttpException;
|
||||
// use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
|
||||
use Bugsnag\BugsnagLaravel\BugsnagExceptionHandler as ExceptionHandler;
|
||||
use Bugsnag;
|
||||
use Symfony\Component\HttpFoundation\RedirectResponse;
|
||||
use Illuminate\Database\Eloquent\ModelNotFoundException;
|
||||
use Illuminate\Foundation\Validation\ValidationException;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
|
||||
class Handler extends ExceptionHandler {
|
||||
|
||||
class Handler extends ExceptionHandler
|
||||
{
|
||||
/**
|
||||
* A list of the exception types that should not be reported.
|
||||
*
|
||||
@@ -53,7 +52,8 @@ class Handler extends ExceptionHandler {
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function report(Exception $e) {
|
||||
public function report(Exception $e)
|
||||
{
|
||||
$debug = \Config::get('app.bugsnag_reporting');
|
||||
$debug = ($debug) ? 'true' : 'false';
|
||||
if ($debug == 'false') {
|
||||
@@ -61,6 +61,7 @@ class Handler extends ExceptionHandler {
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
return parent::report($e);
|
||||
}
|
||||
|
||||
@@ -128,12 +129,14 @@ class Handler extends ExceptionHandler {
|
||||
|
||||
/**
|
||||
* Render an exception into an HTTP response.
|
||||
*
|
||||
* @param type $request
|
||||
* @param Exception $e
|
||||
*
|
||||
* @return type mixed
|
||||
*/
|
||||
public function render($request, Exception $e) {
|
||||
|
||||
public function render($request, Exception $e)
|
||||
{
|
||||
switch ($e) {
|
||||
case $e instanceof \Illuminate\Http\Exception\HttpResponseException:
|
||||
return parent::render($request, $e);
|
||||
@@ -147,38 +150,49 @@ class Handler extends ExceptionHandler {
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to render 500 error page
|
||||
* Function to render 500 error page.
|
||||
*
|
||||
* @param type $request
|
||||
* @param type $e
|
||||
*
|
||||
* @return type mixed
|
||||
*/
|
||||
public function render500($request, $e) {
|
||||
public function render500($request, $e)
|
||||
{
|
||||
if (config('app.debug') == true) {
|
||||
return parent::render($request, $e);
|
||||
}
|
||||
|
||||
return redirect()->route('error500', []);
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to render 404 error page
|
||||
* Function to render 404 error page.
|
||||
*
|
||||
* @param type $request
|
||||
* @param type $e
|
||||
*
|
||||
* @return type mixed
|
||||
*/
|
||||
public function render404($request, $e) {
|
||||
public function render404($request, $e)
|
||||
{
|
||||
if (config('app.debug') == true) {
|
||||
return parent::render($request, $e);
|
||||
}
|
||||
|
||||
return redirect()->route('error404', []);
|
||||
}
|
||||
|
||||
/**
|
||||
* Common finction to render both types of codes
|
||||
* Common finction to render both types of codes.
|
||||
*
|
||||
* @param type $request
|
||||
* @param type $e
|
||||
*
|
||||
* @return type mixed
|
||||
*/
|
||||
public function common($request, $e) {
|
||||
public function common($request, $e)
|
||||
{
|
||||
switch ($e) {
|
||||
case $e instanceof HttpException:
|
||||
return $this->render404($request, $e);
|
||||
@@ -187,7 +201,7 @@ class Handler extends ExceptionHandler {
|
||||
default:
|
||||
return $this->render500($request, $e);
|
||||
}
|
||||
|
||||
return parent::render($request, $e);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -175,7 +175,6 @@ class DepartmentController extends Controller
|
||||
{
|
||||
// dd($id);
|
||||
try {
|
||||
|
||||
$table = $group_assign_department->where('department_id', $id);
|
||||
$table->delete();
|
||||
$requests = $request->input('group_id');
|
||||
|
@@ -28,14 +28,15 @@ use Lang;
|
||||
*
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class EmailsController extends Controller {
|
||||
|
||||
class EmailsController extends Controller
|
||||
{
|
||||
/**
|
||||
* Defining constructor variables.
|
||||
*
|
||||
* @return type
|
||||
*/
|
||||
public function __construct() {
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('auth');
|
||||
$this->middleware('roles');
|
||||
}
|
||||
@@ -47,7 +48,8 @@ class EmailsController extends Controller {
|
||||
*
|
||||
* @return type view
|
||||
*/
|
||||
public function index(Emails $email) {
|
||||
public function index(Emails $email)
|
||||
{
|
||||
try {
|
||||
// fetch all the emails from emails table
|
||||
$emails = $email->get();
|
||||
@@ -68,7 +70,8 @@ class EmailsController extends Controller {
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function create(Department $department, Help_topic $help, Ticket_Priority $ticket_priority, MailboxProtocol $mailbox_protocol) {
|
||||
public function create(Department $department, Help_topic $help, Ticket_Priority $ticket_priority, MailboxProtocol $mailbox_protocol)
|
||||
{
|
||||
try {
|
||||
// fetch all the departments from the department table
|
||||
$departments = $department->get();
|
||||
@@ -93,7 +96,8 @@ class EmailsController extends Controller {
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function validatingEmailSettings(Request $request) {
|
||||
public function validatingEmailSettings(Request $request)
|
||||
{
|
||||
$validator = \Validator::make(
|
||||
[
|
||||
'email_address' => $request->input('email_address'),
|
||||
@@ -173,7 +177,8 @@ class EmailsController extends Controller {
|
||||
*
|
||||
* @return type Redirect
|
||||
*/
|
||||
public function store($request, $imap_check) {
|
||||
public function store($request, $imap_check)
|
||||
{
|
||||
$email = new Emails();
|
||||
try {
|
||||
// saving all the fields to the database
|
||||
@@ -255,7 +260,8 @@ class EmailsController extends Controller {
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function edit($id, Department $department, Help_topic $help, Emails $email, Ticket_Priority $ticket_priority, MailboxProtocol $mailbox_protocol) {
|
||||
public function edit($id, Department $department, Help_topic $help, Emails $email, Ticket_Priority $ticket_priority, MailboxProtocol $mailbox_protocol)
|
||||
{
|
||||
try {
|
||||
$sys_email = \DB::table('settings_email')->select('sys_email')->where('id', '=', 1)->first();
|
||||
// dd($sys_email);
|
||||
@@ -286,7 +292,8 @@ class EmailsController extends Controller {
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function validatingEmailSettingsUpdate($id, Request $request) {
|
||||
public function validatingEmailSettingsUpdate($id, Request $request)
|
||||
{
|
||||
$validator = \Validator::make(
|
||||
[
|
||||
'email_address' => $request->input('email_address'),
|
||||
@@ -368,7 +375,8 @@ class EmailsController extends Controller {
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function update($id, $request, $imap_check) {
|
||||
public function update($id, $request, $imap_check)
|
||||
{
|
||||
try {
|
||||
// fetch the selected emails
|
||||
$emails = Emails::whereId($id)->first();
|
||||
@@ -445,7 +453,8 @@ class EmailsController extends Controller {
|
||||
*
|
||||
* @return type Redirect
|
||||
*/
|
||||
public function destroy($id, Emails $email) {
|
||||
public function destroy($id, Emails $email)
|
||||
{
|
||||
// fetching the details on the basis of the $id passed to the function
|
||||
$default_system_email = Email::where('id', '=', '1')->first();
|
||||
if ($default_system_email->sys_email) {
|
||||
@@ -476,7 +485,8 @@ class EmailsController extends Controller {
|
||||
*
|
||||
* @return type int
|
||||
*/
|
||||
public function getImapStream($request, $validate) {
|
||||
public function getImapStream($request, $validate)
|
||||
{
|
||||
$fetching_status = $request->input('fetching_status');
|
||||
$username = $request->input('email_address');
|
||||
$password = $request->input('password');
|
||||
@@ -518,7 +528,8 @@ class EmailsController extends Controller {
|
||||
*
|
||||
* @return type int
|
||||
*/
|
||||
public function checkImapStream($imap_stream) {
|
||||
public function checkImapStream($imap_stream)
|
||||
{
|
||||
$check_imap_stream = imap_check($imap_stream);
|
||||
if ($check_imap_stream) {
|
||||
$imap_stream = 1;
|
||||
@@ -536,7 +547,8 @@ class EmailsController extends Controller {
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getSmtp($request) {
|
||||
public function getSmtp($request)
|
||||
{
|
||||
$sending_status = $request->input('sending_status');
|
||||
// cheking for the sending protocol
|
||||
if ($request->input('sending_protocol') == 'smtp') {
|
||||
@@ -585,7 +597,8 @@ class EmailsController extends Controller {
|
||||
*
|
||||
* @return type string or null
|
||||
*/
|
||||
public function departmentValue($dept) {
|
||||
public function departmentValue($dept)
|
||||
{
|
||||
if ($dept) {
|
||||
$email_department = $dept;
|
||||
} else {
|
||||
@@ -602,7 +615,8 @@ class EmailsController extends Controller {
|
||||
*
|
||||
* @return type string or null
|
||||
*/
|
||||
public function priorityValue($priority) {
|
||||
public function priorityValue($priority)
|
||||
{
|
||||
if ($priority) {
|
||||
$email_priority = $priority;
|
||||
} else {
|
||||
@@ -619,7 +633,8 @@ class EmailsController extends Controller {
|
||||
*
|
||||
* @return type string or null
|
||||
*/
|
||||
public function helpTopicValue($help_topic) {
|
||||
public function helpTopicValue($help_topic)
|
||||
{
|
||||
if ($help_topic) {
|
||||
$email_help_topic = $help_topic;
|
||||
} else {
|
||||
@@ -628,5 +643,4 @@ class EmailsController extends Controller {
|
||||
|
||||
return $email_help_topic;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -3,16 +3,15 @@
|
||||
namespace App\Http\Controllers\Admin\helpdesk;
|
||||
|
||||
// controller
|
||||
use App\Http\Controllers\Common\PhpMailController;
|
||||
use App\Http\Controllers\Controller;
|
||||
// request
|
||||
|
||||
use Exception;
|
||||
use Lang;
|
||||
use File;
|
||||
use Lang;
|
||||
|
||||
/**
|
||||
* ErrorAndDebuggingController
|
||||
* ErrorAndDebuggingController.
|
||||
*
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
@@ -31,20 +30,25 @@ class ErrorAndDebuggingController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* function to show error and debugging setting page
|
||||
* function to show error and debugging setting page.
|
||||
*
|
||||
* @param void
|
||||
*
|
||||
* @return response
|
||||
*/
|
||||
public function showSettings()
|
||||
{
|
||||
$debug = \Config::get('app.debug');
|
||||
$bugsnag = \Config::get('app.bugsnag_reporting');
|
||||
|
||||
return view('themes.default1.admin.helpdesk.settings.error-and-logs.error-debug')->with(['debug' => $debug, 'bugsnag' => $bugsnag]);
|
||||
}
|
||||
|
||||
/**
|
||||
* funtion to update error and debugging settings
|
||||
* funtion to update error and debugging settings.
|
||||
*
|
||||
* @param void
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public function postSettings()
|
||||
@@ -78,6 +82,7 @@ class ErrorAndDebuggingController extends Controller
|
||||
"'bugsnag_reporting' => ".\Input::get('bugsnag'),
|
||||
$datacontent2);
|
||||
File::put($bugsnag_debug_new, $datacontent2);
|
||||
|
||||
return redirect()->back()->with('success',
|
||||
Lang::get('lang.error-debug-settings-saved-message'));
|
||||
} else {
|
||||
@@ -91,8 +96,10 @@ class ErrorAndDebuggingController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* function to show error log table page
|
||||
* function to show error log table page.
|
||||
*
|
||||
* @param void
|
||||
*
|
||||
* @return response view
|
||||
*/
|
||||
public function showErrorLogs()
|
||||
|
@@ -104,6 +104,7 @@ class SlaController extends Controller
|
||||
$slas = Sla_plan::whereId($id)->first();
|
||||
$slas->get();
|
||||
$sla = \DB::table('settings_ticket')->select('sla')->where('id', '=', 1)->first();
|
||||
|
||||
return view('themes.default1.admin.helpdesk.manage.sla.edit', compact('slas', 'sla'));
|
||||
} catch (Exception $e) {
|
||||
return redirect()->back()->with('fails', $e->getMessage());
|
||||
@@ -137,6 +138,7 @@ class SlaController extends Controller
|
||||
->where('id', '=', 1)
|
||||
->update(['sla' => $id]);
|
||||
}
|
||||
|
||||
return redirect('sla')->with('success', Lang::get('lang.sla_plan_updated_successfully'));
|
||||
} catch (Exception $e) {
|
||||
/* redirect to Index page with Fails Message */
|
||||
|
@@ -24,14 +24,15 @@ use Lang;
|
||||
*
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class TemplateController extends Controller {
|
||||
|
||||
class TemplateController extends Controller
|
||||
{
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return type void
|
||||
*/
|
||||
public function __construct(PhpMailController $PhpMailController) {
|
||||
public function __construct(PhpMailController $PhpMailController)
|
||||
{
|
||||
$this->PhpMailController = $PhpMailController;
|
||||
$this->middleware('auth');
|
||||
$this->middleware('roles');
|
||||
@@ -44,7 +45,8 @@ class TemplateController extends Controller {
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function index(Template $template) {
|
||||
public function index(Template $template)
|
||||
{
|
||||
try {
|
||||
$templates = $template->get();
|
||||
|
||||
@@ -62,7 +64,8 @@ class TemplateController extends Controller {
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function create(Languages $language, Template $template) {
|
||||
public function create(Languages $language, Template $template)
|
||||
{
|
||||
try {
|
||||
$templates = $template->get();
|
||||
$languages = $language->get();
|
||||
@@ -81,7 +84,8 @@ class TemplateController extends Controller {
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function store(Template $template, TemplateRequest $request) {
|
||||
public function store(Template $template, TemplateRequest $request)
|
||||
{
|
||||
try {
|
||||
/* Check whether function success or not */
|
||||
if ($template->fill($request->input())->save() == true) {
|
||||
@@ -104,7 +108,8 @@ class TemplateController extends Controller {
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function show($id) {
|
||||
public function show($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
@@ -117,7 +122,8 @@ class TemplateController extends Controller {
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function listdirectories() {
|
||||
public function listdirectories()
|
||||
{
|
||||
$path = \Config::get('view.paths')[0].'/emails/';
|
||||
$directories = scandir($path);
|
||||
$directory = str_replace('/', '-', $path);
|
||||
@@ -125,7 +131,8 @@ class TemplateController extends Controller {
|
||||
return view('themes.default1.admin.helpdesk.emails.template.listdirectories', compact('directories', 'directory'));
|
||||
}
|
||||
|
||||
public function listtemplates($template, $path) {
|
||||
public function listtemplates($template, $path)
|
||||
{
|
||||
$paths = str_replace('-', '/', $path);
|
||||
$directory2 = $paths.$template;
|
||||
|
||||
@@ -135,7 +142,8 @@ class TemplateController extends Controller {
|
||||
return view('themes.default1.admin.helpdesk.emails.template.listtemplates', compact('templates', 'directory'));
|
||||
}
|
||||
|
||||
public function readtemplate($template, $path) {
|
||||
public function readtemplate($template, $path)
|
||||
{
|
||||
$directory = str_replace('-', '/', $path);
|
||||
$handle = fopen($directory.$template, 'r');
|
||||
$contents = fread($handle, filesize($directory.$template));
|
||||
@@ -144,7 +152,8 @@ class TemplateController extends Controller {
|
||||
return view('themes.default1.admin.helpdesk.emails.template.readtemplates', compact('contents', 'template', 'path'));
|
||||
}
|
||||
|
||||
public function createtemplate() {
|
||||
public function createtemplate()
|
||||
{
|
||||
$directory = '../resources/views/emails/';
|
||||
$fname = Input::get('folder_name');
|
||||
$filename = $directory.$fname;
|
||||
@@ -176,7 +185,8 @@ class TemplateController extends Controller {
|
||||
return \Redirect::back()->with('success', 'Successfully copied');
|
||||
}
|
||||
|
||||
public function writetemplate($template, $path) {
|
||||
public function writetemplate($template, $path)
|
||||
{
|
||||
$directory = str_replace('-', '/', $path);
|
||||
$b = Input::get('templatedata');
|
||||
|
||||
@@ -185,7 +195,8 @@ class TemplateController extends Controller {
|
||||
return \Redirect::back()->with('success', 'Successfully updated');
|
||||
}
|
||||
|
||||
public function deletetemplate($template, $path) {
|
||||
public function deletetemplate($template, $path)
|
||||
{
|
||||
$directory = str_replace('-', '/', $path);
|
||||
$dir = $directory.$template;
|
||||
$status = \DB::table('settings_email')->first();
|
||||
@@ -207,13 +218,15 @@ class TemplateController extends Controller {
|
||||
return \Redirect::back()->with('success', 'Successfully Deleted');
|
||||
}
|
||||
|
||||
public function activateset($setname) {
|
||||
public function activateset($setname)
|
||||
{
|
||||
\DB::table('settings_email')->update(['template' => $setname]);
|
||||
|
||||
return \Redirect::back()->with('success', 'You have Successfully Activated this Set');
|
||||
}
|
||||
|
||||
public function edit($id, Template $template, Languages $language) {
|
||||
public function edit($id, Template $template, Languages $language)
|
||||
{
|
||||
try {
|
||||
$templates = $template->whereId($id)->first();
|
||||
$languages = $language->get();
|
||||
@@ -233,7 +246,8 @@ class TemplateController extends Controller {
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function update($id, Template $template, TemplateUdate $request) {
|
||||
public function update($id, Template $template, TemplateUdate $request)
|
||||
{
|
||||
try {
|
||||
//TODO validation
|
||||
$templates = $template->whereId($id)->first();
|
||||
@@ -259,7 +273,8 @@ class TemplateController extends Controller {
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function destroy($id, Template $template) {
|
||||
public function destroy($id, Template $template)
|
||||
{
|
||||
try {
|
||||
$templates = $template->whereId($id)->first();
|
||||
/* Check whether function success or not */
|
||||
@@ -283,7 +298,8 @@ class TemplateController extends Controller {
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function formDiagno(Emails $email) {
|
||||
public function formDiagno(Emails $email)
|
||||
{
|
||||
try {
|
||||
$emails = $email->get();
|
||||
|
||||
@@ -300,7 +316,8 @@ class TemplateController extends Controller {
|
||||
*
|
||||
* @return type
|
||||
*/
|
||||
public function postDiagno(DiagnosRequest $request) {
|
||||
public function postDiagno(DiagnosRequest $request)
|
||||
{
|
||||
try {
|
||||
$email_details = Emails::where('id', '=', $request->from)->first();
|
||||
if ($email_details->sending_protocol == 'mail') {
|
||||
@@ -346,10 +363,10 @@ class TemplateController extends Controller {
|
||||
$return = Lang::get('lang.message_has_been_sent');
|
||||
}
|
||||
}
|
||||
|
||||
return redirect()->back()->with('success', $return);
|
||||
} catch (Exception $e) {
|
||||
return redirect()->back()->with('fails', $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -166,7 +166,7 @@ class WorkflowController extends Controller
|
||||
{
|
||||
try {
|
||||
// store a new workflow credentials in to the system
|
||||
$workflow_name = new WorkflowName;
|
||||
$workflow_name = new WorkflowName();
|
||||
$workflow_name->name = $request->name;
|
||||
$workflow_name->status = $request->status;
|
||||
$workflow_name->order = $request->execution_order;
|
||||
|
@@ -27,15 +27,16 @@ use PhpImap\Mailbox as ImapMailbox;
|
||||
*
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class MailController extends Controller {
|
||||
|
||||
class MailController extends Controller
|
||||
{
|
||||
/**
|
||||
* constructor
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @param type TicketController $TicketController
|
||||
*/
|
||||
public function __construct(TicketWorkflowController $TicketWorkflowController) {
|
||||
public function __construct(TicketWorkflowController $TicketWorkflowController)
|
||||
{
|
||||
$this->middleware('board');
|
||||
$this->TicketWorkflowController = $TicketWorkflowController;
|
||||
}
|
||||
@@ -45,7 +46,8 @@ class MailController extends Controller {
|
||||
*
|
||||
* @return type
|
||||
*/
|
||||
public function readmails(Emails $emails, Email $settings_email, System $system, Ticket $ticket) {
|
||||
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) {
|
||||
@@ -224,7 +226,8 @@ class MailController extends Controller {
|
||||
*
|
||||
* @return type string
|
||||
*/
|
||||
public function separate_reply($body) {
|
||||
public function separate_reply($body)
|
||||
{
|
||||
$body2 = explode('---Reply above this line---', $body);
|
||||
$body3 = $body2[0];
|
||||
|
||||
@@ -238,7 +241,8 @@ class MailController extends Controller {
|
||||
*
|
||||
* @return type string
|
||||
*/
|
||||
public function decode_imap_text($str) {
|
||||
public function decode_imap_text($str)
|
||||
{
|
||||
$result = '';
|
||||
$decode_header = imap_mime_header_decode($str);
|
||||
foreach ($decode_header as $obj) {
|
||||
@@ -253,7 +257,8 @@ class MailController extends Controller {
|
||||
*
|
||||
* @return type
|
||||
*/
|
||||
public function fetch_attachments() {
|
||||
public function fetch_attachments()
|
||||
{
|
||||
$uploads = Upload::all();
|
||||
foreach ($uploads as $attachment) {
|
||||
$image = @imagecreatefromstring($attachment->file);
|
||||
@@ -273,7 +278,8 @@ class MailController extends Controller {
|
||||
*
|
||||
* @return type file
|
||||
*/
|
||||
public function get_data($id) {
|
||||
public function get_data($id)
|
||||
{
|
||||
$attachments = App\Model\helpdesk\Ticket\Ticket_attachments::where('id', '=', $id)->get();
|
||||
foreach ($attachments as $attachment) {
|
||||
header('Content-type: application/'.$attachment->type.'');
|
||||
@@ -283,7 +289,8 @@ class MailController extends Controller {
|
||||
}
|
||||
}
|
||||
|
||||
public static function trimTableTag($html) {
|
||||
public static function trimTableTag($html)
|
||||
{
|
||||
if (strpos('<table>', $html) != false) {
|
||||
$first_pos = strpos($html, '<table');
|
||||
$fist_string = substr_replace($html, '', 0, $first_pos);
|
||||
@@ -292,23 +299,28 @@ class MailController extends Controller {
|
||||
$diff = $total - $last_pos;
|
||||
$str = substr_replace($fist_string, '', $last_pos, -1);
|
||||
$final_str = str_finish($str, '</table>');
|
||||
|
||||
return $final_str;
|
||||
}
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
||||
public static function trim3D($html) {
|
||||
public static function trim3D($html)
|
||||
{
|
||||
$body = str_replace('=3D', '', $html);
|
||||
|
||||
return $body;
|
||||
}
|
||||
|
||||
public static function trimInjections($html, $tags = ['<script>', '</script>', '<style>', '</style>', '<?php', '?>']) {
|
||||
public static function trimInjections($html, $tags = ['<script>', '</script>', '<style>', '</style>', '<?php', '?>'])
|
||||
{
|
||||
$replace = [];
|
||||
foreach ($tags as $key => $tag) {
|
||||
$replace[$key] = htmlspecialchars($tag);
|
||||
}
|
||||
$body = str_replace($tags, $replace, $html);
|
||||
|
||||
return $body;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -91,6 +91,7 @@ class UserController extends Controller
|
||||
} else {
|
||||
$stringCut = $model->user_name;
|
||||
}
|
||||
|
||||
return $stringCut;
|
||||
})
|
||||
/* column email */
|
||||
|
@@ -29,8 +29,8 @@ use Redirect;
|
||||
*
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class ArticleController extends Controller {
|
||||
|
||||
class ArticleController extends Controller
|
||||
{
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
* constructor to check
|
||||
@@ -40,7 +40,8 @@ class ArticleController extends Controller {
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct() {
|
||||
public function __construct()
|
||||
{
|
||||
// checking authentication
|
||||
$this->middleware('auth');
|
||||
// checking roles
|
||||
@@ -48,7 +49,8 @@ class ArticleController extends Controller {
|
||||
SettingsController::language();
|
||||
}
|
||||
|
||||
public function test() {
|
||||
public function test()
|
||||
{
|
||||
//$table = $this->setDatatable();
|
||||
return view('themes.default1.agent.kb.article.test');
|
||||
}
|
||||
@@ -58,7 +60,8 @@ class ArticleController extends Controller {
|
||||
*
|
||||
* @return type void
|
||||
*/
|
||||
public function getData() {
|
||||
public function getData()
|
||||
{
|
||||
$article = new Article();
|
||||
// returns chumper datatable
|
||||
return Datatable::query($article)
|
||||
@@ -68,7 +71,6 @@ class ArticleController extends Controller {
|
||||
->orderColumns('name', 'description')
|
||||
/* add column name */
|
||||
->addColumn('name', function ($model) {
|
||||
|
||||
$string = strip_tags($model->name);
|
||||
if (strlen($string) > 40) {
|
||||
// truncate string
|
||||
@@ -76,6 +78,7 @@ class ArticleController extends Controller {
|
||||
} else {
|
||||
$stringCut = $model->name;
|
||||
}
|
||||
|
||||
return $stringCut.'...';
|
||||
})
|
||||
/* add column Created */
|
||||
@@ -114,7 +117,8 @@ class ArticleController extends Controller {
|
||||
*
|
||||
* @return type view
|
||||
*/
|
||||
public function index() {
|
||||
public function index()
|
||||
{
|
||||
/* show article list */
|
||||
try {
|
||||
return view('themes.default1.agent.kb.article.index');
|
||||
@@ -130,7 +134,8 @@ class ArticleController extends Controller {
|
||||
*
|
||||
* @return type view
|
||||
*/
|
||||
public function create(Category $category) {
|
||||
public function create(Category $category)
|
||||
{
|
||||
/* get the attributes of the category */
|
||||
$category = $category->lists('id', 'name');
|
||||
/* get the create page */
|
||||
@@ -149,7 +154,8 @@ class ArticleController extends Controller {
|
||||
*
|
||||
* @return type redirect
|
||||
*/
|
||||
public function store(Article $article, ArticleRequest $request) {
|
||||
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';
|
||||
|
||||
@@ -185,7 +191,8 @@ class ArticleController extends Controller {
|
||||
*
|
||||
* @return view
|
||||
*/
|
||||
public function edit($slug) {
|
||||
public function edit($slug)
|
||||
{
|
||||
$article = new Article();
|
||||
$relation = new Relationship();
|
||||
$category = new Category();
|
||||
@@ -216,7 +223,8 @@ class ArticleController extends Controller {
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function update($slug, ArticleUpdate $request) {
|
||||
public function update($slug, ArticleUpdate $request)
|
||||
{
|
||||
$article = new Article();
|
||||
$relation = new Relationship();
|
||||
$aid = $article->where('id', $slug)->first();
|
||||
@@ -259,7 +267,8 @@ class ArticleController extends Controller {
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function destroy($slug, Article $article, Relationship $relation, Comment $comment) {
|
||||
public function destroy($slug, Article $article, Relationship $relation, Comment $comment)
|
||||
{
|
||||
/* delete the selected article from the table */
|
||||
$article = $article->where('slug', $slug)->first(); //get the selected article via id
|
||||
$id = $article->id;
|
||||
@@ -293,7 +302,8 @@ class ArticleController extends Controller {
|
||||
*
|
||||
* @return type
|
||||
*/
|
||||
public static function usertimezone($utc) {
|
||||
public static function usertimezone($utc)
|
||||
{
|
||||
$user = Auth::user();
|
||||
$tz = $user->timezone;
|
||||
$set = Settings::whereId('1')->first();
|
||||
@@ -304,5 +314,4 @@ class ArticleController extends Controller {
|
||||
$date = date($format, strtotime($utc) + $offset);
|
||||
echo $date;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -23,8 +23,8 @@ use Redirect;
|
||||
*
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class CategoryController extends Controller {
|
||||
|
||||
class CategoryController extends Controller
|
||||
{
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
* constructor to check
|
||||
@@ -34,7 +34,8 @@ class CategoryController extends Controller {
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct() {
|
||||
public function __construct()
|
||||
{
|
||||
// checking authentication
|
||||
$this->middleware('auth');
|
||||
// checking roles
|
||||
@@ -49,7 +50,8 @@ class CategoryController extends Controller {
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function index() {
|
||||
public function index()
|
||||
{
|
||||
/* get the view of index of the catogorys with all attributes
|
||||
of category model */
|
||||
try {
|
||||
@@ -64,7 +66,8 @@ class CategoryController extends Controller {
|
||||
*
|
||||
* @return type chumper datatable
|
||||
*/
|
||||
public function getData() {
|
||||
public function getData()
|
||||
{
|
||||
/* fetching chumper datatables */
|
||||
return Datatable::collection(Category::All())
|
||||
/* search column name */
|
||||
@@ -73,7 +76,6 @@ class CategoryController extends Controller {
|
||||
->orderColumns('name', 'description')
|
||||
/* add column name */
|
||||
->addColumn('name', function ($model) {
|
||||
|
||||
$string = strip_tags($model->name);
|
||||
if (strlen($string) > 40) {
|
||||
// truncate string
|
||||
@@ -81,6 +83,7 @@ class CategoryController extends Controller {
|
||||
} else {
|
||||
$stringCut = $model->name;
|
||||
}
|
||||
|
||||
return $stringCut.'...';
|
||||
})
|
||||
/* add column Created */
|
||||
@@ -121,7 +124,8 @@ class CategoryController extends Controller {
|
||||
*
|
||||
* @return type view
|
||||
*/
|
||||
public function create(Category $category) {
|
||||
public function create(Category $category)
|
||||
{
|
||||
/* Get the all attributes in the category model */
|
||||
$category = $category->get();
|
||||
/* get the view page to create new category with all attributes
|
||||
@@ -141,7 +145,8 @@ class CategoryController extends Controller {
|
||||
*
|
||||
* @return type Redirect
|
||||
*/
|
||||
public function store(Category $category, CategoryRequest $request) {
|
||||
public function store(Category $category, CategoryRequest $request)
|
||||
{
|
||||
/* Get the whole request from the form and insert into table via model */
|
||||
$sl = $request->input('slug');
|
||||
$slug = str_slug($sl, '-');
|
||||
@@ -164,7 +169,8 @@ class CategoryController extends Controller {
|
||||
*
|
||||
* @return type view
|
||||
*/
|
||||
public function edit($slug) {
|
||||
public function edit($slug)
|
||||
{
|
||||
// fetch the category
|
||||
$cid = Category::where('id', $slug)->first();
|
||||
$id = $cid->id;
|
||||
@@ -183,7 +189,8 @@ class CategoryController extends Controller {
|
||||
*
|
||||
* @return type redirect
|
||||
*/
|
||||
public function update($slug, CategoryUpdate $request) {
|
||||
public function update($slug, CategoryUpdate $request)
|
||||
{
|
||||
|
||||
/* Edit the selected category via id */
|
||||
$category = Category::where('id', $slug)->first();
|
||||
@@ -197,6 +204,7 @@ class CategoryController extends Controller {
|
||||
$category->fill($request->all())->save();
|
||||
$category->slug = $slug;
|
||||
$category->save();
|
||||
|
||||
return redirect('category')->with('success', Lang::get('lang.category_updated_successfully'));
|
||||
} catch (Exception $e) {
|
||||
//redirect to index with fails message
|
||||
@@ -213,7 +221,8 @@ class CategoryController extends Controller {
|
||||
*
|
||||
* @return type Redirect
|
||||
*/
|
||||
public function destroy($id, Category $category, Relationship $relation) {
|
||||
public function destroy($id, Category $category, Relationship $relation)
|
||||
{
|
||||
$relation = $relation->where('category_id', $id)->first();
|
||||
if ($relation != null) {
|
||||
return Redirect::back()->with('fails', Lang::get('lang.category_not_deleted'));
|
||||
@@ -230,5 +239,4 @@ class CategoryController extends Controller {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -21,8 +21,8 @@ use Lang;
|
||||
*
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class PageController extends Controller {
|
||||
|
||||
class PageController extends Controller
|
||||
{
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
* constructor to check
|
||||
@@ -32,7 +32,8 @@ class PageController extends Controller {
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Page $page) {
|
||||
public function __construct(Page $page)
|
||||
{
|
||||
// checking authentication
|
||||
$this->middleware('auth');
|
||||
// checking roles
|
||||
@@ -46,7 +47,8 @@ class PageController extends Controller {
|
||||
*
|
||||
* @return type
|
||||
*/
|
||||
public function index() {
|
||||
public function index()
|
||||
{
|
||||
$pages = $this->page->paginate(3);
|
||||
$pages->setPath('page');
|
||||
try {
|
||||
@@ -61,7 +63,8 @@ class PageController extends Controller {
|
||||
*
|
||||
* @return type
|
||||
*/
|
||||
public function getData() {
|
||||
public function getData()
|
||||
{
|
||||
/* fetching chumper datatables */
|
||||
return Datatable::collection(Page::All())
|
||||
/* search column name */
|
||||
@@ -108,7 +111,8 @@ class PageController extends Controller {
|
||||
*
|
||||
* @return type view
|
||||
*/
|
||||
public function create() {
|
||||
public function create()
|
||||
{
|
||||
return view('themes.default1.agent.kb.pages.create');
|
||||
}
|
||||
|
||||
@@ -119,7 +123,8 @@ class PageController extends Controller {
|
||||
*
|
||||
* @return type
|
||||
*/
|
||||
public function store(PageRequest $request) {
|
||||
public function store(PageRequest $request)
|
||||
{
|
||||
$sl = $request->input('slug');
|
||||
$slug = str_slug($sl, '-');
|
||||
$this->page->slug = $slug;
|
||||
@@ -139,7 +144,8 @@ class PageController extends Controller {
|
||||
*
|
||||
* @return type view
|
||||
*/
|
||||
public function edit($slug) {
|
||||
public function edit($slug)
|
||||
{
|
||||
try {
|
||||
$page = $this->page->where('slug', $slug)->first();
|
||||
|
||||
@@ -157,7 +163,8 @@ class PageController extends Controller {
|
||||
*
|
||||
* @return type redirect
|
||||
*/
|
||||
public function update($slug, PageUpdate $request) {
|
||||
public function update($slug, PageUpdate $request)
|
||||
{
|
||||
// get pages with respect to slug
|
||||
$pages = $this->page->where('slug', $slug)->first();
|
||||
$sl = $request->input('slug');
|
||||
@@ -181,7 +188,8 @@ class PageController extends Controller {
|
||||
*
|
||||
* @return type redirect
|
||||
*/
|
||||
public function destroy($id) {
|
||||
public function destroy($id)
|
||||
{
|
||||
try {
|
||||
// get the page to be deleted
|
||||
$page = $this->page->whereId($id)->first();
|
||||
@@ -192,5 +200,4 @@ class PageController extends Controller {
|
||||
return redirect('page')->with('fails', $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -29,8 +29,8 @@ use Mail;
|
||||
*
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class AuthController extends Controller {
|
||||
|
||||
class AuthController extends Controller
|
||||
{
|
||||
use AuthenticatesAndRegistersUsers;
|
||||
/* to redirect after login */
|
||||
|
||||
@@ -50,7 +50,8 @@ class AuthController extends Controller {
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(PhpMailController $PhpMailController) {
|
||||
public function __construct(PhpMailController $PhpMailController)
|
||||
{
|
||||
$this->PhpMailController = $PhpMailController;
|
||||
SettingsController::smtp();
|
||||
$this->middleware('guest', ['except' => 'getLogout']);
|
||||
@@ -61,7 +62,8 @@ class AuthController extends Controller {
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function getRegister() {
|
||||
public function getRegister()
|
||||
{
|
||||
// Event for login
|
||||
\Event::fire(new \App\Events\FormRegisterEvent());
|
||||
if (Auth::user()) {
|
||||
@@ -83,7 +85,8 @@ class AuthController extends Controller {
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function postRegister(User $user, RegisterRequest $request) {
|
||||
public function postRegister(User $user, RegisterRequest $request)
|
||||
{
|
||||
// Event for login
|
||||
\Event::fire(new \App\Events\LoginEvent($request));
|
||||
$password = Hash::make($request->input('password'));
|
||||
@@ -103,16 +106,20 @@ class AuthController extends Controller {
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to activate account
|
||||
* Function to activate account.
|
||||
*
|
||||
* @param type $token
|
||||
*
|
||||
* @return type redirect
|
||||
*/
|
||||
public function accountActivate($token) {
|
||||
public function accountActivate($token)
|
||||
{
|
||||
$user = User::where('remember_token', '=', $token)->first();
|
||||
if ($user) {
|
||||
$user->active = 1;
|
||||
$user->remember_token = NULL;
|
||||
$user->remember_token = null;
|
||||
$user->save();
|
||||
|
||||
return redirect('/auth/login')->with('status', 'Acount activated. Login to start');
|
||||
} else {
|
||||
return redirect('/auth/login')->with('fails', 'Invalid Token');
|
||||
@@ -127,7 +134,8 @@ class AuthController extends Controller {
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function getMail($token, User $user) {
|
||||
public function getMail($token, User $user)
|
||||
{
|
||||
$user = $user->where('remember_token', $token)->where('active', 0)->first();
|
||||
if ($user) {
|
||||
$user->active = 1;
|
||||
@@ -144,7 +152,8 @@ class AuthController extends Controller {
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function getLogin() {
|
||||
public function getLogin()
|
||||
{
|
||||
if (Auth::user()) {
|
||||
if (Auth::user()->role == 'admin' || Auth::user()->role == 'agent') {
|
||||
return \Redirect::route('dashboard');
|
||||
@@ -163,7 +172,8 @@ class AuthController extends Controller {
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function postLogin(LoginRequest $request) {
|
||||
public function postLogin(LoginRequest $request)
|
||||
{
|
||||
// Set login attempts and login time
|
||||
$value = $_SERVER['REMOTE_ADDR'];
|
||||
$usernameinput = $request->input('email');
|
||||
@@ -246,7 +256,8 @@ class AuthController extends Controller {
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function addLoginAttempt($value, $field) {
|
||||
public function addLoginAttempt($value, $field)
|
||||
{
|
||||
$result = DB::table('login_attempts')->where('IP', '=', $value)->first();
|
||||
$data = $result;
|
||||
$security = Security::whereId('1')->first();
|
||||
@@ -271,7 +282,8 @@ class AuthController extends Controller {
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function clearLoginAttempts($value, $field) {
|
||||
public function clearLoginAttempts($value, $field)
|
||||
{
|
||||
$data = DB::table('login_attempts')->where('IP', '=', $value)->orWhere('User', '=', $field)->update(['attempts' => '0']);
|
||||
|
||||
return $data;
|
||||
@@ -284,7 +296,8 @@ class AuthController extends Controller {
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function confirmIPAddress($value, $field) {
|
||||
public function confirmIPAddress($value, $field)
|
||||
{
|
||||
$security = Security::whereId('1')->first();
|
||||
$time = $security->lockout_period;
|
||||
$max_attempts = $security->backlist_threshold;
|
||||
@@ -314,8 +327,8 @@ class AuthController extends Controller {
|
||||
*
|
||||
* @return type string
|
||||
*/
|
||||
protected function getFailedLoginMessage() {
|
||||
protected function getFailedLoginMessage()
|
||||
{
|
||||
return Lang::get('lang.this_field_do_not_match_our_records');
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -33,15 +33,16 @@ use Redirect;
|
||||
*
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class FormController extends Controller {
|
||||
|
||||
class FormController extends Controller
|
||||
{
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
* Constructor to check.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(TicketWorkflowController $TicketWorkflowController) {
|
||||
public function __construct(TicketWorkflowController $TicketWorkflowController)
|
||||
{
|
||||
$this->middleware('board');
|
||||
// creating a TicketController instance
|
||||
$this->TicketWorkflowController = $TicketWorkflowController;
|
||||
@@ -54,7 +55,8 @@ class FormController extends Controller {
|
||||
*
|
||||
* @return type
|
||||
*/
|
||||
public function getForm(Help_topic $topic, CountryCode $code) {
|
||||
public function getForm(Help_topic $topic, CountryCode $code)
|
||||
{
|
||||
if (\Config::get('database.install') == '%0%') {
|
||||
return \Redirect::route('license');
|
||||
}
|
||||
@@ -78,13 +80,13 @@ class FormController extends Controller {
|
||||
*
|
||||
* @return type string
|
||||
*/
|
||||
public function postForm($id, Help_topic $topic) {
|
||||
public function postForm($id, Help_topic $topic)
|
||||
{
|
||||
if ($id != 0) {
|
||||
$helptopic = $topic->where('id', '=', $id)->first();
|
||||
$custom_form = $helptopic->custom_form;
|
||||
$values = Fields::where('forms_id', '=', $custom_form)->get();
|
||||
if (!$values) {
|
||||
|
||||
}
|
||||
if ($values) {
|
||||
foreach ($values as $value) {
|
||||
@@ -130,8 +132,8 @@ class FormController extends Controller {
|
||||
* @param type Request $request
|
||||
* @param type User $user
|
||||
*/
|
||||
public function postedForm(User $user, ClientRequest $request, Ticket $ticket_settings, Ticket_source $ticket_source, Ticket_attachments $ta, CountryCode $code) {
|
||||
|
||||
public function postedForm(User $user, ClientRequest $request, Ticket $ticket_settings, Ticket_source $ticket_source, Ticket_attachments $ta, CountryCode $code)
|
||||
{
|
||||
$form_extras = $request->except('Name', 'Phone', 'Email', 'Subject', 'Details', 'helptopic', '_wysihtml5_mode', '_token');
|
||||
|
||||
$name = $request->input('Name');
|
||||
@@ -207,7 +209,8 @@ class FormController extends Controller {
|
||||
*
|
||||
* @return type view
|
||||
*/
|
||||
public function post_ticket_reply($id, Request $request) {
|
||||
public function post_ticket_reply($id, Request $request)
|
||||
{
|
||||
try {
|
||||
if ($comment != null) {
|
||||
$tickets = Tickets::where('id', '=', $id)->first();
|
||||
@@ -270,5 +273,4 @@ class FormController extends Controller {
|
||||
// return \Redirect::back()->with('fails1', Lang::get('lang.please_fill_some_data'));
|
||||
// }
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -15,9 +15,10 @@ use Redirect;
|
||||
*
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class WelcomepageController extends Controller {
|
||||
|
||||
public function __construct() {
|
||||
class WelcomepageController extends Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
// $this->middleware('board');
|
||||
}
|
||||
|
||||
@@ -26,7 +27,8 @@ class WelcomepageController extends Controller {
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function get(System $note) {
|
||||
public function get(System $note)
|
||||
{
|
||||
if (Config::get('database.install') == '%0%') {
|
||||
return Redirect::route('licence');
|
||||
}
|
||||
@@ -38,12 +40,12 @@ class WelcomepageController extends Controller {
|
||||
return view('themes.default1.client.guest-user.guest', compact('heading', 'content'));
|
||||
}
|
||||
|
||||
public function index() {
|
||||
public function index()
|
||||
{
|
||||
if (Config::get('database.install') == '%0%') {
|
||||
return Redirect::route('licence');
|
||||
}
|
||||
|
||||
return view('themes.default1.client.helpdesk.guest-user.index');
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -11,9 +11,10 @@ use App\Model\helpdesk\Settings\Email;
|
||||
use App\User;
|
||||
use Auth;
|
||||
|
||||
class PhpMailController extends Controller {
|
||||
|
||||
public function fetch_smtp_details($id) {
|
||||
class PhpMailController extends Controller
|
||||
{
|
||||
public function fetch_smtp_details($id)
|
||||
{
|
||||
$emails = Emails::where('id', '=', $id)->first();
|
||||
if ($emails->sending_status == 1) {
|
||||
return $emails;
|
||||
@@ -29,7 +30,8 @@ class PhpMailController extends Controller {
|
||||
*
|
||||
* @return Mail
|
||||
*/
|
||||
public function sendmail($from, $to, $message, $template_variables) {
|
||||
public function sendmail($from, $to, $message, $template_variables)
|
||||
{
|
||||
// dd($from);
|
||||
$from_address = $this->fetch_smtp_details($from);
|
||||
if ($from_address == null) {
|
||||
@@ -221,8 +223,7 @@ class PhpMailController extends Controller {
|
||||
|
||||
// dd($messagebody);
|
||||
//$mail->SMTPDebug = 3; // Enable verbose debug output
|
||||
if ($protocol == "smtp") {
|
||||
|
||||
if ($protocol == 'smtp') {
|
||||
$mail->isSMTP(); // Set mailer to use SMTP
|
||||
$mail->Host = $host; // Specify main and backup SMTP servers
|
||||
$mail->SMTPAuth = true; // Enable SMTP authentication
|
||||
@@ -231,7 +232,7 @@ class PhpMailController extends Controller {
|
||||
$mail->SMTPSecure = $smtpsecure; // Enable TLS encryption, `ssl` also accepted
|
||||
$mail->Port = $port; // TCP port to connect to
|
||||
$mail->setFrom($username, $fromname);
|
||||
} elseif ($protocol == "mail") {
|
||||
} elseif ($protocol == 'mail') {
|
||||
$mail->IsSendmail(); // telling the class to use SendMail transport
|
||||
if ($username == $fromname) {
|
||||
$mail->setFrom($username);
|
||||
@@ -292,7 +293,8 @@ class PhpMailController extends Controller {
|
||||
*
|
||||
* @return MailNotification
|
||||
*/
|
||||
public function sendEmail($from, $to, $message) {
|
||||
public function sendEmail($from, $to, $message)
|
||||
{
|
||||
// dd($from);
|
||||
$from_address = $this->fetch_smtp_details($from);
|
||||
|
||||
@@ -418,7 +420,8 @@ class PhpMailController extends Controller {
|
||||
*
|
||||
* @return type
|
||||
*/
|
||||
public function company() {
|
||||
public function company()
|
||||
{
|
||||
$company = Company::Where('id', '=', '1')->first();
|
||||
if ($company->company_name == null) {
|
||||
$company = 'Support Center';
|
||||
@@ -480,7 +483,8 @@ class PhpMailController extends Controller {
|
||||
*
|
||||
* @return type integer
|
||||
*/
|
||||
public function mailfrom($reg, $dept_id) {
|
||||
public function mailfrom($reg, $dept_id)
|
||||
{
|
||||
$email = Email::where('id', '=', '1')->first();
|
||||
if ($reg == 1) {
|
||||
return $email->sys_email;
|
||||
@@ -493,5 +497,4 @@ class PhpMailController extends Controller {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -7,19 +7,22 @@ use Closure;
|
||||
|
||||
/**
|
||||
* CheckBoard.
|
||||
* Checking if the system board is online or offline
|
||||
* Checking if the system board is online or offline.
|
||||
*
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class CheckBoard {
|
||||
|
||||
class CheckBoard
|
||||
{
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Closure $next
|
||||
*
|
||||
* @return type Mixed
|
||||
*/
|
||||
public function handle($request, Closure $next) {
|
||||
public function handle($request, Closure $next)
|
||||
{
|
||||
if ($this->checkBoard() == '1') {
|
||||
return $next($request);
|
||||
} else {
|
||||
@@ -28,16 +31,18 @@ class CheckBoard {
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to get the system offline details
|
||||
* Function to get the system offline details.
|
||||
*
|
||||
* @return type Mixed
|
||||
*/
|
||||
public function checkBoard() {
|
||||
public function checkBoard()
|
||||
{
|
||||
$res = 0;
|
||||
$system = new System;
|
||||
$system = new System();
|
||||
if ($system->first()) {
|
||||
$res = $system->first()->status;
|
||||
}
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -31,6 +31,7 @@ class CheckUpdate
|
||||
return redirect('file-update');
|
||||
}
|
||||
}
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
|
||||
|
@@ -335,12 +335,12 @@ Route::group(['middleware' => 'roles', 'middleware' => 'auth', 'middleware' => '
|
||||
|
||||
//route for submit error and debugging setting form page
|
||||
Route::post('post-settings', ['as' => 'post.error.debug.settings',
|
||||
'uses' => 'Admin\helpdesk\ErrorAndDebuggingController@postSettings']);
|
||||
'uses' => 'Admin\helpdesk\ErrorAndDebuggingController@postSettings', ]);
|
||||
|
||||
//route to error logs table page
|
||||
Route::get('show-error-logs', [
|
||||
'as' => 'error.logs',
|
||||
'uses' => 'Admin\helpdesk\ErrorAndDebuggingController@showErrorLogs'
|
||||
'uses' => 'Admin\helpdesk\ErrorAndDebuggingController@showErrorLogs',
|
||||
]);
|
||||
});
|
||||
|
||||
|
@@ -26,7 +26,8 @@ class Ticket_Thread extends BaseModel
|
||||
// $this->attributes['title'] = str_replace('"', "'", $value);
|
||||
// }
|
||||
|
||||
public function getTitleAttribute($value) {
|
||||
public function getTitleAttribute($value)
|
||||
{
|
||||
return str_replace('"', "'", $value);
|
||||
}
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
@@ -49,7 +49,7 @@ return array(
|
||||
| contain these strings will be filtered.
|
||||
|
|
||||
*/
|
||||
'filters' => env('BUGSNAG_FILTERS', array('password')),
|
||||
'filters' => env('BUGSNAG_FILTERS', ['password']),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
@@ -72,6 +72,6 @@ return array(
|
||||
| )
|
||||
|
|
||||
*/
|
||||
'proxy' => env('BUGSNAG_PROXY', null)
|
||||
'proxy' => env('BUGSNAG_PROXY', null),
|
||||
|
||||
);
|
||||
];
|
||||
|
@@ -10,7 +10,9 @@ use App\Model\helpdesk\Email\Smtp;
|
||||
use App\Model\helpdesk\Manage\Help_topic;
|
||||
use App\Model\helpdesk\Manage\Sla_plan;
|
||||
use App\Model\helpdesk\Notification\NotificationType;
|
||||
use App\Model\helpdesk\Ratings\Rating;
|
||||
use App\Model\helpdesk\Settings\Alert;
|
||||
use App\Model\helpdesk\Settings\CommonSettings;
|
||||
use App\Model\helpdesk\Settings\Company;
|
||||
use App\Model\helpdesk\Settings\Email;
|
||||
use App\Model\helpdesk\Settings\Responder;
|
||||
@@ -31,8 +33,6 @@ use App\Model\helpdesk\Utility\Time_format;
|
||||
use App\Model\helpdesk\Utility\Timezones;
|
||||
use App\Model\helpdesk\Utility\Version_Check;
|
||||
use App\Model\helpdesk\Workflow\WorkflowClose;
|
||||
use App\Model\helpdesk\Settings\CommonSettings;
|
||||
use App\Model\helpdesk\Ratings\Rating;
|
||||
use App\Model\kb\Settings;
|
||||
// Knowledge base
|
||||
use Illuminate\Database\Seeder;
|
||||
@@ -2009,12 +2009,12 @@ class DatabaseSeeder extends Seeder
|
||||
Template::create(['id' => '12', 'name' => 'registration', 'type' => '12', 'message' => '<span><p>Hello {!!$user!!} , </p><p>This email is confirmation that you are now registered at our helpdesk.</p><p>Registered Email: {!!$email_address!!}</p><p>Please click on the below link to activate your account and Login to the system {!!$password_reset_link!!}</p><p>Thank You.</p><p>Kind Regards,</p><p>{!!$system_from!!} </p></span>', 'set_id' => '1']);
|
||||
|
||||
|
||||
/**
|
||||
/*
|
||||
* All the common settings will be listed here
|
||||
*/
|
||||
CommonSettings::create(['id' => '1', 'option_name' => 'ticket_token_time_duration', 'option_value' => '1']);
|
||||
|
||||
/**
|
||||
/*
|
||||
* Ratings
|
||||
*/
|
||||
Rating::create(['id' => '1', 'name' => 'OverAll Satisfaction', 'display_order' => '1', 'allow_modification' => '1', 'rating_scale' => '5', 'rating_area' => 'Helpdesk Area']);
|
||||
|
@@ -1,4 +1,4 @@
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
@@ -14,7 +14,7 @@ return [
|
||||
*/
|
||||
|
||||
'password' => 'Passwörter müssen mindestens sechs Zeichen lang sein und der Bestätigung entsprechen.',
|
||||
'user' => "Wir können keinen Benutzer mit dieser E-Mail-Adresse finden.",
|
||||
'user' => 'Wir können keinen Benutzer mit dieser E-Mail-Adresse finden.',
|
||||
'token' => 'Dieser Passwort-Reset-Token ist ungültig.',
|
||||
'sent' => 'Wir haben dir einen Passwort-Reset-Link per E-Mail zukommen lassen!',
|
||||
'reset' => 'Dein Passwort wurde zurückgesetzt!',
|
||||
|
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
|
@@ -14,7 +14,7 @@ return [
|
||||
*/
|
||||
|
||||
'password' => 'Le Passwords devono essere almeno di sei caratteri e combaciare.',
|
||||
'user' => "Non esiste un utente con questo indirizzo e-mail.",
|
||||
'user' => 'Non esiste un utente con questo indirizzo e-mail.',
|
||||
'token' => 'Il token per il reset della password non è valido.',
|
||||
'sent' => 'Una email con il link al reset della passowrd ti è stato inviato!',
|
||||
'reset' => 'La tua password è stata resettata!',
|
||||
|
@@ -1,7 +1,7 @@
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
return array(
|
||||
return [
|
||||
/*
|
||||
|----------------------------------------------------------------------------------------
|
||||
| Authentication Pages [English(en)]
|
||||
@@ -312,7 +312,7 @@ return array(
|
||||
'iso-code' => 'ISO-CODE',
|
||||
'download' => 'Downlaod',
|
||||
'upload_file' => 'Загрузить файл',
|
||||
'enter_iso-code' => "Enter ISO-CODE",
|
||||
'enter_iso-code' => 'Enter ISO-CODE',
|
||||
'eg.' => 'Example',
|
||||
'for' => 'for',
|
||||
'english' => 'Английский',
|
||||
@@ -321,15 +321,15 @@ return array(
|
||||
'read-more' => 'Подробнее.',
|
||||
'enable_lang' => 'Enable it.',
|
||||
'add-lang-package' => 'Add new language package',
|
||||
'package_exist' => "Package already exists.",
|
||||
'iso-code-error' => "Error in iso-code. enter correct iso-code.",
|
||||
'package_exist' => 'Package already exists.',
|
||||
'iso-code-error' => 'Error in iso-code. enter correct iso-code.',
|
||||
'zipp-error' => 'Error in zip file. Zip must contian language php files only.',
|
||||
'upload-success' => "Загрузка произошла успешна.",
|
||||
"file-error" => 'Error in file or invalid file.',
|
||||
'upload-success' => 'Загрузка произошла успешна.',
|
||||
'file-error' => 'Error in file or invalid file.',
|
||||
'delete-success' => 'Языковой пакет успешно удален.',
|
||||
'lang-doesnot-exist' => 'Языковой пакет не существует.',
|
||||
'active-lang-error' => 'Языковой пакет не может быть удален, когда он активен.',
|
||||
"language-error" => 'Языковой пакет не найден в указанной дериктории.',
|
||||
'language-error' => 'Языковой пакет не найден в указанной дериктории.',
|
||||
/*
|
||||
|----------------------------------------------------------------------------------------
|
||||
| Manage Pages [English(en)]
|
||||
@@ -405,10 +405,10 @@ return array(
|
||||
'are_you_sure_you_want_to_delete' => 'Вы уверены, что хотите удалить',
|
||||
'close' => 'Закрыть',
|
||||
'instructions' => 'Инструкции',
|
||||
"instructions_on_creating_form" => "Select field type you want to add to the form below and click on 'Type' dropdown. Don't forget to set field options if type is select,checkbox or radio..Separate each option by a coma. After you finish creating the form, you can save the form by clicking Save Form button",
|
||||
'instructions_on_creating_form' => "Select field type you want to add to the form below and click on 'Type' dropdown. Don't forget to set field options if type is select,checkbox or radio..Separate each option by a coma. After you finish creating the form, you can save the form by clicking Save Form button",
|
||||
'form_properties' => 'Свойства Формы',
|
||||
'adding_fields' => 'Добавление полей',
|
||||
"click_add_fields_button_to_add_fields" => "Click <b>'Add Fields'</b> button to add Fields",
|
||||
'click_add_fields_button_to_add_fields' => "Click <b>'Add Fields'</b> button to add Fields",
|
||||
'add_fields' => 'Добавить поле',
|
||||
'save_form' => 'Сохранить Форму',
|
||||
'label' => 'Метки',
|
||||
@@ -634,7 +634,7 @@ return array(
|
||||
'please_select_an_organization' => 'Пожалуйста, выберите организацию',
|
||||
'please_select_an_user' => 'Пожалуйста, выберите пользователя',
|
||||
'organization_profile' => 'Профиль Организации',
|
||||
'organization-s_head' => "Страница руководителя",
|
||||
'organization-s_head' => 'Страница руководителя',
|
||||
'select_department_manager' => 'Выберите Менеджера Отдела',
|
||||
'users_of' => 'Пользователи',
|
||||
/*
|
||||
@@ -824,4 +824,4 @@ return array(
|
||||
'post_comment' => 'Отправить Комментарий',
|
||||
'plugin' => 'Плагин',
|
||||
'end_date' => 'Конец Даты',
|
||||
);
|
||||
];
|
||||
|
@@ -13,10 +13,10 @@ return [
|
||||
|
|
||||
*/
|
||||
|
||||
"password" => "Пароль должен содержать не менее шести символов и соответствовать подтверждения.",
|
||||
"user" => "Мы не можем найти пользователя с данным адресом электронной почты.",
|
||||
"token" => "Этот пароль сбросить маркер недействителен.",
|
||||
"sent" => "Мы по электронной почте Ваш пароль сбросить ссылку!",
|
||||
"reset" => "Ваш пароль был сброшен!",
|
||||
'password' => 'Пароль должен содержать не менее шести символов и соответствовать подтверждения.',
|
||||
'user' => 'Мы не можем найти пользователя с данным адресом электронной почты.',
|
||||
'token' => 'Этот пароль сбросить маркер недействителен.',
|
||||
'sent' => 'Мы по электронной почте Ваш пароль сбросить ссылку!',
|
||||
'reset' => 'Ваш пароль был сброшен!',
|
||||
|
||||
];
|
||||
|
@@ -13,66 +13,66 @@ return [
|
||||
|
|
||||
*/
|
||||
|
||||
"accepted" => "The :attribute must be accepted.",
|
||||
"active_url" => "The :attribute is not a valid URL.",
|
||||
"after" => "The :attribute must be a date after :date.",
|
||||
"alpha" => "The :attribute may only contain letters.",
|
||||
"alpha_dash" => "The :attribute may only contain letters, numbers, and dashes.",
|
||||
"alpha_num" => "The :attribute may only contain letters and numbers.",
|
||||
"array" => "The :attribute must be an array.",
|
||||
"before" => "The :attribute must be a date before :date.",
|
||||
"between" => [
|
||||
"numeric" => "The :attribute must be between :min and :max.",
|
||||
"file" => "The :attribute must be between :min and :max kilobytes.",
|
||||
"string" => "The :attribute must be between :min and :max characters.",
|
||||
"array" => "The :attribute must have between :min and :max items.",
|
||||
'accepted' => 'The :attribute must be accepted.',
|
||||
'active_url' => 'The :attribute is not a valid URL.',
|
||||
'after' => 'The :attribute must be a date after :date.',
|
||||
'alpha' => 'The :attribute may only contain letters.',
|
||||
'alpha_dash' => 'The :attribute may only contain letters, numbers, and dashes.',
|
||||
'alpha_num' => 'The :attribute may only contain letters and numbers.',
|
||||
'array' => 'The :attribute must be an array.',
|
||||
'before' => 'The :attribute must be a date before :date.',
|
||||
'between' => [
|
||||
'numeric' => 'The :attribute must be between :min and :max.',
|
||||
'file' => 'The :attribute must be between :min and :max kilobytes.',
|
||||
'string' => 'The :attribute must be between :min and :max characters.',
|
||||
'array' => 'The :attribute must have between :min and :max items.',
|
||||
],
|
||||
"boolean" => "The :attribute field must be true or false.",
|
||||
"confirmed" => "The :attribute confirmation does not match.",
|
||||
"date" => "The :attribute is not a valid date.",
|
||||
"date_format" => "The :attribute does not match the format :format.",
|
||||
"different" => "The :attribute and :other must be different.",
|
||||
"digits" => "The :attribute must be :digits digits.",
|
||||
"digits_between" => "The :attribute must be between :min and :max digits.",
|
||||
"email" => "The :attribute must be a valid email address.",
|
||||
"filled" => "The :attribute field is required.",
|
||||
"exists" => "The selected :attribute is invalid.",
|
||||
"image" => "The :attribute must be an image.",
|
||||
"in" => "The selected :attribute is invalid.",
|
||||
"integer" => "The :attribute must be an integer.",
|
||||
"ip" => "The :attribute must be a valid IP address.",
|
||||
"max" => [
|
||||
"numeric" => "The :attribute may not be greater than :max.",
|
||||
"file" => "The :attribute may not be greater than :max kilobytes.",
|
||||
"string" => "The :attribute may not be greater than :max characters.",
|
||||
"array" => "The :attribute may not have more than :max items.",
|
||||
'boolean' => 'The :attribute field must be true or false.',
|
||||
'confirmed' => 'The :attribute confirmation does not match.',
|
||||
'date' => 'The :attribute is not a valid date.',
|
||||
'date_format' => 'The :attribute does not match the format :format.',
|
||||
'different' => 'The :attribute and :other must be different.',
|
||||
'digits' => 'The :attribute must be :digits digits.',
|
||||
'digits_between' => 'The :attribute must be between :min and :max digits.',
|
||||
'email' => 'The :attribute must be a valid email address.',
|
||||
'filled' => 'The :attribute field is required.',
|
||||
'exists' => 'The selected :attribute is invalid.',
|
||||
'image' => 'The :attribute must be an image.',
|
||||
'in' => 'The selected :attribute is invalid.',
|
||||
'integer' => 'The :attribute must be an integer.',
|
||||
'ip' => 'The :attribute must be a valid IP address.',
|
||||
'max' => [
|
||||
'numeric' => 'The :attribute may not be greater than :max.',
|
||||
'file' => 'The :attribute may not be greater than :max kilobytes.',
|
||||
'string' => 'The :attribute may not be greater than :max characters.',
|
||||
'array' => 'The :attribute may not have more than :max items.',
|
||||
],
|
||||
"mimes" => "The :attribute must be a file of type: :values.",
|
||||
"min" => [
|
||||
"numeric" => "The :attribute must be at least :min.",
|
||||
"file" => "The :attribute must be at least :min kilobytes.",
|
||||
"string" => "The :attribute must be at least :min characters.",
|
||||
"array" => "The :attribute must have at least :min items.",
|
||||
'mimes' => 'The :attribute must be a file of type: :values.',
|
||||
'min' => [
|
||||
'numeric' => 'The :attribute must be at least :min.',
|
||||
'file' => 'The :attribute must be at least :min kilobytes.',
|
||||
'string' => 'The :attribute must be at least :min characters.',
|
||||
'array' => 'The :attribute must have at least :min items.',
|
||||
],
|
||||
"not_in" => "The selected :attribute is invalid.",
|
||||
"numeric" => "The :attribute must be a number.",
|
||||
"regex" => "The :attribute format is invalid.",
|
||||
"required" => "The :attribute field is required.",
|
||||
"required_if" => "The :attribute field is required when :other is :value.",
|
||||
"required_with" => "The :attribute field is required when :values is present.",
|
||||
"required_with_all" => "The :attribute field is required when :values is present.",
|
||||
"required_without" => "The :attribute field is required when :values is not present.",
|
||||
"required_without_all" => "The :attribute field is required when none of :values are present.",
|
||||
"same" => "The :attribute and :other must match.",
|
||||
"size" => [
|
||||
"numeric" => "The :attribute must be :size.",
|
||||
"file" => "The :attribute must be :size kilobytes.",
|
||||
"string" => "The :attribute must be :size characters.",
|
||||
"array" => "The :attribute must contain :size items.",
|
||||
'not_in' => 'The selected :attribute is invalid.',
|
||||
'numeric' => 'The :attribute must be a number.',
|
||||
'regex' => 'The :attribute format is invalid.',
|
||||
'required' => 'The :attribute field is required.',
|
||||
'required_if' => 'The :attribute field is required when :other is :value.',
|
||||
'required_with' => 'The :attribute field is required when :values is present.',
|
||||
'required_with_all' => 'The :attribute field is required when :values is present.',
|
||||
'required_without' => 'The :attribute field is required when :values is not present.',
|
||||
'required_without_all' => 'The :attribute field is required when none of :values are present.',
|
||||
'same' => 'The :attribute and :other must match.',
|
||||
'size' => [
|
||||
'numeric' => 'The :attribute must be :size.',
|
||||
'file' => 'The :attribute must be :size kilobytes.',
|
||||
'string' => 'The :attribute must be :size characters.',
|
||||
'array' => 'The :attribute must contain :size items.',
|
||||
],
|
||||
"unique" => "The :attribute has already been taken.",
|
||||
"url" => "The :attribute format is invalid.",
|
||||
"timezone" => "The :attribute must be a valid zone.",
|
||||
'unique' => 'The :attribute has already been taken.',
|
||||
'url' => 'The :attribute format is invalid.',
|
||||
'timezone' => 'The :attribute must be a valid zone.',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user