Merge pull request #160 from ladybirdweb/analysis-qg06JE

Applied fixes from StyleCI
This commit is contained in:
Sujit Prasad
2016-08-05 18:54:32 +05:30
committed by GitHub
53 changed files with 1397 additions and 1105 deletions

View File

@@ -2,13 +2,13 @@
namespace App\Console\Commands; namespace App\Console\Commands;
use Illuminate\Console\Command;
use App\Http\Controllers\Agent\helpdesk\NotificationController; use App\Http\Controllers\Agent\helpdesk\NotificationController;
use App\Http\Controllers\Common\PhpMailController; use App\Http\Controllers\Common\PhpMailController;
use Exception; use Exception;
use Illuminate\Console\Command;
class SendReport extends Command { class SendReport extends Command
{
/** /**
* The name and signature of the console command. * The name and signature of the console command.
* *
@@ -30,7 +30,8 @@ class SendReport extends Command {
* *
* @return void * @return void
*/ */
public function __construct() { public function __construct()
{
$mail = new PhpMailController(); $mail = new PhpMailController();
$report = new NotificationController($mail); $report = new NotificationController($mail);
$this->report = $report; $this->report = $report;
@@ -42,15 +43,15 @@ class SendReport extends Command {
* *
* @return mixed * @return mixed
*/ */
public function handle() { public function handle()
{
try { try {
$this->report->send_notification(); $this->report->send_notification();
\Log::info("Report has send"); \Log::info('Report has send');
$this->info("Report has send"); $this->info('Report has send');
} catch (Exception $ex) { } catch (Exception $ex) {
dd($ex); dd($ex);
$this->error($ex->getMessage()); $this->error($ex->getMessage());
} }
} }
} }

View File

@@ -1,5 +1,7 @@
<?php <?php
namespace App\Exceptions; namespace App\Exceptions;
// controller // controller
use Bugsnag; use Bugsnag;
//use Illuminate\Validation\ValidationException; //use Illuminate\Validation\ValidationException;
@@ -11,6 +13,7 @@ use Illuminate\Auth\Access\AuthorizationException;
use Illuminate\Database\Eloquent\ModelNotFoundException; use Illuminate\Database\Eloquent\ModelNotFoundException;
use Illuminate\Foundation\Validation\ValidationException; use Illuminate\Foundation\Validation\ValidationException;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
class Handler extends ExceptionHandler class Handler extends ExceptionHandler
{ {
/** /**
@@ -27,6 +30,7 @@ class Handler extends ExceptionHandler
ModelNotFoundException::class, ModelNotFoundException::class,
\Symfony\Component\HttpKernel\Exception\HttpException::class, \Symfony\Component\HttpKernel\Exception\HttpException::class,
]; ];
/** /**
* Report or log an exception. * Report or log an exception.
* *
@@ -48,8 +52,10 @@ class Handler extends ExceptionHandler
$version = \Config::get('app.version'); $version = \Config::get('app.version');
Bugsnag::setAppVersion($version); Bugsnag::setAppVersion($version);
} }
return parent::report($e); return parent::report($e);
} }
/** /**
* Render an exception into an HTTP response. * Render an exception into an HTTP response.
* *
@@ -71,6 +77,7 @@ class Handler extends ExceptionHandler
return $this->common($request, $e); return $this->common($request, $e);
} }
} }
/** /**
* Function to render 500 error page. * Function to render 500 error page.
* *
@@ -84,9 +91,11 @@ class Handler extends ExceptionHandler
if (config('app.debug') == true) { if (config('app.debug') == true) {
return parent::render($request, $e); return parent::render($request, $e);
} }
return response()->view('errors.500'); return response()->view('errors.500');
//return redirect()->route('error500', []); //return redirect()->route('error500', []);
} }
/** /**
* Function to render 404 error page. * Function to render 404 error page.
* *
@@ -97,7 +106,6 @@ class Handler extends ExceptionHandler
*/ */
public function render404($request, $e) public function render404($request, $e)
{ {
$seg = $request->segments(); $seg = $request->segments();
if (in_array('api', $seg)) { if (in_array('api', $seg)) {
return response()->json(['status' => '404']); return response()->json(['status' => '404']);
@@ -106,12 +114,15 @@ class Handler extends ExceptionHandler
if ($e->getStatusCode() == '404') { if ($e->getStatusCode() == '404') {
return redirect()->route('error404', []); return redirect()->route('error404', []);
} }
return parent::render($request, $e); return parent::render($request, $e);
} }
return redirect()->route('error404', []); return redirect()->route('error404', []);
} }
/** /**
* Function to render database connection failed * Function to render database connection failed.
* *
* @param type $request * @param type $request
* @param type $e * @param type $e
@@ -127,8 +138,10 @@ class Handler extends ExceptionHandler
if (config('app.debug') == true) { if (config('app.debug') == true) {
return parent::render($request, $e); return parent::render($request, $e);
} }
return redirect()->route('error404', []); return redirect()->route('error404', []);
} }
/** /**
* Common finction to render both types of codes. * Common finction to render both types of codes.
* *
@@ -159,6 +172,7 @@ class Handler extends ExceptionHandler
default: default:
return $this->render500($request, $e); return $this->render500($request, $e);
} }
return parent::render($request, $e); return parent::render($request, $e);
} }
} }

View File

@@ -3,8 +3,8 @@
namespace App\Http\Controllers\Admin\helpdesk; namespace App\Http\Controllers\Admin\helpdesk;
// controller // controller
use App\Http\Controllers\Controller;
use App\Http\Controllers\Common\PhpMailController; use App\Http\Controllers\Common\PhpMailController;
use App\Http\Controllers\Controller;
// request // request
use App\Http\Requests\helpdesk\AgentRequest; use App\Http\Requests\helpdesk\AgentRequest;
use App\Http\Requests\helpdesk\AgentUpdate; use App\Http\Requests\helpdesk\AgentUpdate;

View File

@@ -29,14 +29,15 @@ use Lang;
* *
* @author Ladybird <info@ladybirdweb.com> * @author Ladybird <info@ladybirdweb.com>
*/ */
class DepartmentController extends Controller { class DepartmentController extends Controller
{
/** /**
* Create a new controller instance. * Create a new controller instance.
* *
* @return void * @return void
*/ */
public function __construct() { public function __construct()
{
$this->middleware('auth'); $this->middleware('auth');
$this->middleware('roles'); $this->middleware('roles');
} }
@@ -48,9 +49,11 @@ class DepartmentController extends Controller {
* *
* @return type Response * @return type Response
*/ */
public function index(Department $department) { public function index(Department $department)
{
try { try {
$departments = $department->get(); $departments = $department->get();
return view('themes.default1.admin.helpdesk.agent.departments.index', compact('departments')); return view('themes.default1.admin.helpdesk.agent.departments.index', compact('departments'));
} catch (Exception $e) { } catch (Exception $e) {
return view('404'); return view('404');
@@ -70,7 +73,8 @@ class DepartmentController extends Controller {
* *
* @return type Response * @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 { try {
$slas = $sla->get(); $slas = $sla->get();
$user = $user->where('role', 'agent2')->get(); $user = $user->where('role', 'agent2')->get();
@@ -93,7 +97,8 @@ class DepartmentController extends Controller {
* *
* @return type Response * @return type Response
*/ */
public function store(Department $department, DepartmentRequest $request) { public function store(Department $department, DepartmentRequest $request)
{
try { try {
$department->fill($request->except('group_id', 'manager', 'sla'))->save(); $department->fill($request->except('group_id', 'manager', 'sla'))->save();
if ($request->sla) { if ($request->sla) {
@@ -116,6 +121,7 @@ class DepartmentController extends Controller {
->where('id', 1) ->where('id', 1)
->update(['department' => $department->id]); ->update(['department' => $department->id]);
} }
return redirect('departments')->with('success', Lang::get('lang.department_created_sucessfully')); return redirect('departments')->with('success', Lang::get('lang.department_created_sucessfully'));
} else { } else {
return redirect('departments')->with('fails', Lang::get('lang.failed_to_create_department')); return redirect('departments')->with('fails', Lang::get('lang.failed_to_create_department'));
@@ -140,7 +146,8 @@ class DepartmentController extends Controller {
* *
* @return type Response * @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 { try {
$sys_department = \DB::table('settings_system') $sys_department = \DB::table('settings_system')
->select('department') ->select('department')
@@ -170,7 +177,8 @@ class DepartmentController extends Controller {
* *
* @return type Response * @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); // dd($id);
try { try {
$table = $group_assign_department->where('department_id', $id); $table = $group_assign_department->where('department_id', $id);
@@ -218,7 +226,8 @@ class DepartmentController extends Controller {
* *
* @return type Response * @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 { // try {
$system = $system->where('id', '=', '1')->first(); $system = $system->where('id', '=', '1')->first();
@@ -277,5 +286,4 @@ class DepartmentController extends Controller {
} }
} }
} }
} }

View File

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

View File

@@ -103,7 +103,6 @@ class LanguageController extends Controller
} else { } else {
return Config::get('languages.'.$model); return Config::get('languages.'.$model);
} }
}) })
->addColumn('id', function ($model) { ->addColumn('id', function ($model) {
return $model; return $model;
@@ -249,6 +248,7 @@ class LanguageController extends Controller
} }
} else { } else {
Session::flash('fails', Lang::get('lang.lang-fallback-lang')); Session::flash('fails', Lang::get('lang.lang-fallback-lang'));
return redirect('languages'); return redirect('languages');
} }
} else { } else {
@@ -257,5 +257,4 @@ class LanguageController extends Controller
return redirect('languages'); return redirect('languages');
} }
} }
} }

View File

@@ -19,6 +19,7 @@ use App\Model\helpdesk\Manage\Sla_plan;
use App\Model\helpdesk\Notification\UserNotification; use App\Model\helpdesk\Notification\UserNotification;
use App\Model\helpdesk\Ratings\Rating; use App\Model\helpdesk\Ratings\Rating;
use App\Model\helpdesk\Settings\Alert; use App\Model\helpdesk\Settings\Alert;
use App\Model\helpdesk\Settings\CommonSettings;
use App\Model\helpdesk\Settings\Company; use App\Model\helpdesk\Settings\Company;
use App\Model\helpdesk\Settings\Email; use App\Model\helpdesk\Settings\Email;
use App\Model\helpdesk\Settings\Responder; use App\Model\helpdesk\Settings\Responder;
@@ -30,7 +31,6 @@ use App\Model\helpdesk\Utility\Date_time_format;
use App\Model\helpdesk\Utility\Time_format; use App\Model\helpdesk\Utility\Time_format;
use App\Model\helpdesk\Utility\Timezones; use App\Model\helpdesk\Utility\Timezones;
use App\Model\helpdesk\Workflow\WorkflowClose; use App\Model\helpdesk\Workflow\WorkflowClose;
use App\Model\helpdesk\Settings\CommonSettings;
use DateTime; use DateTime;
// classes // classes
use DB; use DB;

View File

@@ -12,8 +12,8 @@ use App\Http\Requests\helpdesk\TemplateUdate;
// models // models
use App\Model\helpdesk\Email\Emails; use App\Model\helpdesk\Email\Emails;
use App\Model\helpdesk\Email\Template; use App\Model\helpdesk\Email\Template;
use App\Model\helpdesk\Utility\Languages;
use App\Model\helpdesk\Settings\CommonSettings; use App\Model\helpdesk\Settings\CommonSettings;
use App\Model\helpdesk\Utility\Languages;
// classes // classes
use Exception; use Exception;
use Illuminate\Http\Request; use Illuminate\Http\Request;
@@ -329,7 +329,7 @@ class TemplateController extends Controller
$mail->AddAddress($address); $mail->AddAddress($address);
$mail->Subject = $request->subject; // subject of the email $mail->Subject = $request->subject; // subject of the email
$body = $request->message; // body of the email $body = $request->message; // body of the email
$mail->CharSet = "utf8"; $mail->CharSet = 'utf8';
// $mail->MsgHTML($body); // $mail->MsgHTML($body);
// $body = $request->message; // $body = $request->message;
$rtl = CommonSettings::where('option_name', '=', 'enable_rtl')->first(); $rtl = CommonSettings::where('option_name', '=', 'enable_rtl')->first();
@@ -364,7 +364,7 @@ class TemplateController extends Controller
$mail->setFrom($email_details->email_address, $email_details->email_name); $mail->setFrom($email_details->email_address, $email_details->email_name);
$mail->addAddress($request->to, ''); // Add a recipient $mail->addAddress($request->to, ''); // Add a recipient
$mail->isHTML(true); // Set email format to HTML $mail->isHTML(true); // Set email format to HTML
$mail->CharSet = "utf8"; $mail->CharSet = 'utf8';
$mail->Subject = $request->subject; $mail->Subject = $request->subject;
$body = $request->message; $body = $request->message;
$rtl = CommonSettings::where('option_name', '=', 'enable_rtl')->first(); $rtl = CommonSettings::where('option_name', '=', 'enable_rtl')->first();
@@ -380,6 +380,7 @@ class TemplateController extends Controller
$return = Lang::get('lang.message_has_been_sent'); $return = Lang::get('lang.message_has_been_sent');
} }
} }
return redirect()->back()->with('success', $return); return redirect()->back()->with('success', $return);
} catch (Exception $e) { } catch (Exception $e) {
return redirect()->back()->with('fails', $e->getMessage()); return redirect()->back()->with('fails', $e->getMessage());

View File

@@ -27,15 +27,16 @@ use PhpImap\Mailbox as ImapMailbox;
* *
* @author Ladybird <info@ladybirdweb.com> * @author Ladybird <info@ladybirdweb.com>
*/ */
class MailController extends Controller { class MailController extends Controller
{
/** /**
* constructor * constructor
* Create a new controller instance. * Create a new controller instance.
* *
* @param type TicketController $TicketController * @param type TicketController $TicketController
*/ */
public function __construct(TicketWorkflowController $TicketWorkflowController) { public function __construct(TicketWorkflowController $TicketWorkflowController)
{
$this->middleware('board'); $this->middleware('board');
$this->TicketWorkflowController = $TicketWorkflowController; $this->TicketWorkflowController = $TicketWorkflowController;
} }
@@ -45,7 +46,8 @@ class MailController extends Controller {
* *
* @return type * @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; // $path_url = $system->first()->url;
if ($settings_email->first()->email_fetching == 1) { if ($settings_email->first()->email_fetching == 1) {
if ($settings_email->first()->all_emails == 1) { if ($settings_email->first()->all_emails == 1) {
@@ -96,13 +98,13 @@ class MailController extends Controller {
try { try {
$mailbox = new ImapMailbox($imap_config, $e_mail->email_address, $password, __DIR__); $mailbox = new ImapMailbox($imap_config, $e_mail->email_address, $password, __DIR__);
} catch (\PhpImap\Exception $e) { } catch (\PhpImap\Exception $e) {
echo "Connection error"; echo 'Connection error';
} }
$mails = []; $mails = [];
try { try {
$mailsIds = $mailbox->searchMailBox('SINCE '.date('d-M-Y', strtotime('-1 day'))); $mailsIds = $mailbox->searchMailBox('SINCE '.date('d-M-Y', strtotime('-1 day')));
} catch (\PhpImap\Exception $e) { } catch (\PhpImap\Exception $e) {
echo "Connection error"; echo 'Connection error';
} }
if (!$mailsIds) { if (!$mailsIds) {
die('Mailbox is empty'); die('Mailbox is empty');
@@ -119,7 +121,7 @@ class MailController extends Controller {
try { try {
$mail = $mailbox->getMail($mailId); $mail = $mailbox->getMail($mailId);
} catch (\PhpImap\Exception $e) { } catch (\PhpImap\Exception $e) {
echo "Connection error"; echo 'Connection error';
} }
if ($settings_email->first()->email_collaborator == 1) { if ($settings_email->first()->email_collaborator == 1) {
$collaborator = $mail->cc; $collaborator = $mail->cc;
@@ -137,11 +139,11 @@ class MailController extends Controller {
if ($body == null) { if ($body == null) {
$attach = $mail->getAttachments(); $attach = $mail->getAttachments();
if (is_array($attach)) { if (is_array($attach)) {
if (key_exists('html-body', $attach)) { if (array_key_exists('html-body', $attach)) {
$path = $attach['html-body']->filePath; $path = $attach['html-body']->filePath;
} }
if ($path == null) { if ($path == null) {
if (key_exists('text-body', $attach)) { if (array_key_exists('text-body', $attach)) {
$path = $attach['text-body']->filePath; $path = $attach['text-body']->filePath;
} }
} }
@@ -151,7 +153,7 @@ class MailController extends Controller {
if ($body) { if ($body) {
$body = self::trimTableTag($body); $body = self::trimTableTag($body);
} else { } else {
$body = ""; $body = '';
} }
} }
} }
@@ -251,7 +253,8 @@ class MailController extends Controller {
* *
* @return type string * @return type string
*/ */
public function separate_reply($body) { public function separate_reply($body)
{
$body2 = explode('---Reply above this line---', $body); $body2 = explode('---Reply above this line---', $body);
$body3 = $body2[0]; $body3 = $body2[0];
@@ -265,7 +268,8 @@ class MailController extends Controller {
* *
* @return type string * @return type string
*/ */
public function decode_imap_text($str) { public function decode_imap_text($str)
{
$result = ''; $result = '';
$decode_header = imap_mime_header_decode($str); $decode_header = imap_mime_header_decode($str);
foreach ($decode_header as $obj) { foreach ($decode_header as $obj) {
@@ -280,7 +284,8 @@ class MailController extends Controller {
* *
* @return type * @return type
*/ */
public function fetch_attachments() { public function fetch_attachments()
{
$uploads = Upload::all(); $uploads = Upload::all();
foreach ($uploads as $attachment) { foreach ($uploads as $attachment) {
$image = @imagecreatefromstring($attachment->file); $image = @imagecreatefromstring($attachment->file);
@@ -300,7 +305,8 @@ class MailController extends Controller {
* *
* @return type file * @return type file
*/ */
public function get_data($id) { public function get_data($id)
{
$attachments = App\Model\helpdesk\Ticket\Ticket_attachments::where('id', '=', $id)->get(); $attachments = App\Model\helpdesk\Ticket\Ticket_attachments::where('id', '=', $id)->get();
foreach ($attachments as $attachment) { foreach ($attachments as $attachment) {
header('Content-type: application/'.$attachment->type.''); header('Content-type: application/'.$attachment->type.'');
@@ -310,7 +316,8 @@ class MailController extends Controller {
} }
} }
public static function trimTableTag($html) { public static function trimTableTag($html)
{
if (strpos('<table>', $html) != false) { if (strpos('<table>', $html) != false) {
$first_pos = strpos($html, '<table'); $first_pos = strpos($html, '<table');
$fist_string = substr_replace($html, '', 0, $first_pos); $fist_string = substr_replace($html, '', 0, $first_pos);
@@ -326,13 +333,15 @@ class MailController extends Controller {
return $html; return $html;
} }
public static function trim3D($html) { public static function trim3D($html)
{
$body = str_replace('=3D', '', $html); $body = str_replace('=3D', '', $html);
return $body; 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 = []; $replace = [];
foreach ($tags as $key => $tag) { foreach ($tags as $key => $tag) {
$replace[$key] = htmlspecialchars($tag); $replace[$key] = htmlspecialchars($tag);
@@ -341,5 +350,4 @@ class MailController extends Controller {
return $body; return $body;
} }
} }

View File

@@ -22,16 +22,18 @@ use View;
* *
* @author Ladybird <info@ladybirdweb.com> * @author Ladybird <info@ladybirdweb.com>
*/ */
class NotificationController extends Controller { class NotificationController extends Controller
{
public function __construct(PhpMailController $PhpMailController) { public function __construct(PhpMailController $PhpMailController)
{
$this->PhpMailController = $PhpMailController; $this->PhpMailController = $PhpMailController;
} }
/** /**
* This function is for sending daily report/notification about the system. * This function is for sending daily report/notification about the system.
* */ * */
public function send_notification() { public function send_notification()
{
//fetching email settings //fetching email settings
$email = Email::where('id', '=', '1')->first(); $email = Email::where('id', '=', '1')->first();
// checking if the daily notification is enabled or not // checking if the daily notification is enabled or not
@@ -40,7 +42,6 @@ class NotificationController extends Controller {
$notification = Log_notification::where('log', '=', 'NOT-1')->orderBy('id', 'DESC')->first(); $notification = Log_notification::where('log', '=', 'NOT-1')->orderBy('id', 'DESC')->first();
$date = explode(' ', $notification->created_at); $date = explode(' ', $notification->created_at);
if (date('Y-m-d') == $date[0]) { if (date('Y-m-d') == $date[0]) {
} else { } else {
// creating a daily notification log // creating a daily notification log
Log_notification::create(['log' => 'NOT-1']); Log_notification::create(['log' => 'NOT-1']);
@@ -64,7 +65,8 @@ class NotificationController extends Controller {
* *
* @return mail * @return mail
* */ * */
public function send_notification_to_admin($company) { public function send_notification_to_admin($company)
{
// get all admin users // get all admin users
$users = User::where('role', '=', 'admin')->get(); $users = User::where('role', '=', 'admin')->get();
foreach ($users as $user) { foreach ($users as $user) {
@@ -76,12 +78,12 @@ class NotificationController extends Controller {
$from = $this->PhpMailController->mailfrom('1', '0'); $from = $this->PhpMailController->mailfrom('1', '0');
$to = [ $to = [
'name' => $user_name, 'name' => $user_name,
'email' => $email 'email' => $email,
]; ];
$message = [ $message = [
'subject' => 'Daily Report', 'subject' => 'Daily Report',
'scenario' => null, 'scenario' => null,
'body' => $contents 'body' => $contents,
]; ];
$this->dispatch((new \App\Jobs\SendEmail($from, $to, $message))->onQueue('emails')); $this->dispatch((new \App\Jobs\SendEmail($from, $to, $message))->onQueue('emails'));
//$this->PhpMailController->sendEmail($from,$to,$message); //$this->PhpMailController->sendEmail($from,$to,$message);
@@ -93,7 +95,8 @@ class NotificationController extends Controller {
* *
* @return mail * @return mail
* */ * */
public function send_notification_to_manager($company) { public function send_notification_to_manager($company)
{
// get all department managers // get all department managers
$depts = Department::all(); $depts = Department::all();
foreach ($depts as $dept) { foreach ($depts as $dept) {
@@ -117,7 +120,8 @@ class NotificationController extends Controller {
* *
* @return mail * @return mail
* */ * */
public function send_notification_to_team_lead($company) { public function send_notification_to_team_lead($company)
{
// get all Team leads // get all Team leads
$teams = Teams::all(); $teams = Teams::all();
foreach ($teams as $team) { foreach ($teams as $team) {
@@ -141,7 +145,8 @@ class NotificationController extends Controller {
* *
* @return mail * @return mail
* */ * */
public function send_notification_to_agent($company) { public function send_notification_to_agent($company)
{
// get all agents users // get all agents users
$users = User::where('role', '=', 'agent')->get(); $users = User::where('role', '=', 'agent')->get();
foreach ($users as $user) { foreach ($users as $user) {
@@ -159,7 +164,8 @@ class NotificationController extends Controller {
* *
* @return type variable * @return type variable
*/ */
public function company() { public function company()
{
// fetching comapny model // fetching comapny model
$company = Company::Where('id', '=', '1')->first(); $company = Company::Where('id', '=', '1')->first();
// fetching company name // fetching company name
@@ -171,5 +177,4 @@ class NotificationController extends Controller {
return $company; return $company;
} }
} }

View File

@@ -3,7 +3,6 @@
namespace App\Http\Controllers\Agent\helpdesk; namespace App\Http\Controllers\Agent\helpdesk;
// controllers // controllers
use App\Http\Controllers\Common\SettingsController;
use App\Http\Controllers\Controller; use App\Http\Controllers\Controller;
// requests // requests
// models // models
@@ -51,8 +50,10 @@ class Ticket2Controller extends Controller
} }
/** /**
* this function returns the list of open tickets of a particular department * this function returns the list of open tickets of a particular department.
*
* @param type $id * @param type $id
*
* @return type * @return type
*/ */
public function getOpenTickets($id) public function getOpenTickets($id)
@@ -63,6 +64,7 @@ class Ticket2Controller extends Controller
$dept = Department::where('id', '=', Auth::user()->primary_dpt)->first(); $dept = Department::where('id', '=', Auth::user()->primary_dpt)->first();
$tickets = Tickets::where('status', '=', 1)->where('isanswered', '=', 0)->where('dept_id', '=', $dept->id)->get(); $tickets = Tickets::where('status', '=', 1)->where('isanswered', '=', 0)->where('dept_id', '=', $dept->id)->get();
} }
return Ttable::getTable($tickets); return Ttable::getTable($tickets);
} }
@@ -86,8 +88,10 @@ class Ticket2Controller extends Controller
} }
/** /**
* this function returns the list of close tickets of a particular department * this function returns the list of close tickets of a particular department.
*
* @param type $id * @param type $id
*
* @return type * @return type
*/ */
public function getCloseTickets($id) public function getCloseTickets($id)
@@ -98,12 +102,15 @@ class Ticket2Controller extends Controller
$dept = Department::where('id', '=', Auth::user()->primary_dpt)->first(); $dept = Department::where('id', '=', Auth::user()->primary_dpt)->first();
$tickets = Tickets::where('status', '=', '2')->where('status', '=', '3')->where('dept_id', '=', $dept->id)->get(); $tickets = Tickets::where('status', '=', '2')->where('status', '=', '3')->where('dept_id', '=', $dept->id)->get();
} }
return Ttable::getTable($tickets); return Ttable::getTable($tickets);
} }
/** /**
* this function returns the list of close tickets of a particular department * this function returns the list of close tickets of a particular department.
*
* @param type $id * @param type $id
*
* @return type * @return type
*/ */
public function deptinprogress($id) public function deptinprogress($id)
@@ -136,5 +143,4 @@ class Ticket2Controller extends Controller
return Ttable::getTable($tickets); return Ttable::getTable($tickets);
} }
} }

File diff suppressed because it is too large Load Diff

View File

@@ -350,6 +350,7 @@ class TicketWorkflowController extends Controller
$ticket_settings_details = $this->changeStatus($workflow_action, $ticket_settings_details); $ticket_settings_details = $this->changeStatus($workflow_action, $ticket_settings_details);
} }
} }
return $ticket_settings_details; return $ticket_settings_details;
} }

View File

@@ -3,8 +3,8 @@
namespace App\Http\Controllers\Agent\helpdesk; namespace App\Http\Controllers\Agent\helpdesk;
// controllers // controllers
use App\Http\Controllers\Controller;
use App\Http\Controllers\Common\PhpMailController; use App\Http\Controllers\Common\PhpMailController;
use App\Http\Controllers\Controller;
// requests // requests
/* Include Sys_user Model */ /* Include Sys_user Model */
use App\Http\Requests\helpdesk\ProfilePassword; use App\Http\Requests\helpdesk\ProfilePassword;
@@ -79,7 +79,7 @@ class UserController extends Controller
public function user_list() public function user_list()
{ {
// displaying list of users with chumper datatables // displaying list of users with chumper datatables
return \Datatable::collection(User::where('role',"=","user")->get()) return \Datatable::collection(User::where('role', '=', 'user')->get())
/* searchable column username and email */ /* searchable column username and email */
->searchColumns('user_name', 'email', 'phone') ->searchColumns('user_name', 'email', 'phone')
/* order column username and email */ /* order column username and email */
@@ -511,7 +511,6 @@ class UserController extends Controller
} }
} }
/** /**
* Generate a random string for password. * Generate a random string for password.
* *
@@ -534,5 +533,4 @@ class UserController extends Controller
// return random string // return random string
return $randomString; return $randomString;
} }
} }

View File

@@ -77,6 +77,7 @@ class CategoryController extends Controller
/* add column name */ /* add column name */
->addColumn('name', function ($model) { ->addColumn('name', function ($model) {
$string = strip_tags($model->name); $string = strip_tags($model->name);
return str_limit($string, 20); return str_limit($string, 20);
}) })
/* add column Created */ /* add column Created */
@@ -147,6 +148,7 @@ class CategoryController extends Controller
// send success message to index page // send success message to index page
try { try {
$category->fill($request->input())->save(); $category->fill($request->input())->save();
return Redirect::back()->with('success', Lang::get('lang.category_inserted_successfully')); return Redirect::back()->with('success', Lang::get('lang.category_inserted_successfully'));
} catch (Exception $e) { } catch (Exception $e) {
return Redirect::back()->with('fails', Lang::get('lang.category_not_inserted').'<li>'.$e->getMessage().'</li>'); return Redirect::back()->with('fails', Lang::get('lang.category_not_inserted').'<li>'.$e->getMessage().'</li>');
@@ -191,6 +193,7 @@ class CategoryController extends Controller
try { try {
$category->slug = $slug; $category->slug = $slug;
$category->fill($request->input())->save(); $category->fill($request->input())->save();
return redirect('category')->with('success', Lang::get('lang.category_updated_successfully')); return redirect('category')->with('success', Lang::get('lang.category_updated_successfully'));
} catch (Exception $e) { } catch (Exception $e) {
//redirect to index with fails message //redirect to index with fails message

View File

@@ -33,8 +33,8 @@ use Illuminate\Support\Collection;
* *
* @version v1 * @version v1
*/ */
class ApiController extends Controller { class ApiController extends Controller
{
public $user; public $user;
public $request; public $request;
public $ticket; public $ticket;
@@ -54,7 +54,8 @@ class ApiController extends Controller {
/** /**
* @param Request $request * @param Request $request
*/ */
public function __construct(Request $request) { public function __construct(Request $request)
{
$this->request = $request; $this->request = $request;
$this->middleware('jwt.auth'); $this->middleware('jwt.auth');
@@ -63,9 +64,7 @@ class ApiController extends Controller {
$user = \JWTAuth::parseToken()->authenticate(); $user = \JWTAuth::parseToken()->authenticate();
$this->user = $user; $this->user = $user;
} catch (\Tymon\JWTAuth\Exceptions\TokenExpiredException $e) { } catch (\Tymon\JWTAuth\Exceptions\TokenExpiredException $e) {
} catch (\Tymon\JWTAuth\Exceptions\JWTException $e) { } catch (\Tymon\JWTAuth\Exceptions\JWTException $e) {
} }
$ticket = new TicketController(); $ticket = new TicketController();
@@ -120,7 +119,8 @@ class ApiController extends Controller {
* *
* @return json * @return json
*/ */
public function createTicket() { public function createTicket()
{
try { try {
$v = \Validator::make($this->request->all(), [ $v = \Validator::make($this->request->all(), [
'user_id' => 'required|exists:users,id', 'user_id' => 'required|exists:users,id',
@@ -189,7 +189,8 @@ class ApiController extends Controller {
* *
* @return json * @return json
*/ */
public function ticketReply() { public function ticketReply()
{
//dd($this->request->all()); //dd($this->request->all());
try { try {
$v = \Validator::make($this->request->all(), [ $v = \Validator::make($this->request->all(), [
@@ -223,7 +224,8 @@ class ApiController extends Controller {
* *
* @return json * @return json
*/ */
public function editTicket() { public function editTicket()
{
try { try {
$v = \Validator::make($this->request->all(), [ $v = \Validator::make($this->request->all(), [
'ticket_id' => 'required|exists:tickets,id', 'ticket_id' => 'required|exists:tickets,id',
@@ -260,7 +262,8 @@ class ApiController extends Controller {
* *
* @return json * @return json
*/ */
public function deleteTicket() { public function deleteTicket()
{
try { try {
$v = \Validator::make($this->request->all(), [ $v = \Validator::make($this->request->all(), [
'ticket_id' => 'required|exists:tickets,id', 'ticket_id' => 'required|exists:tickets,id',
@@ -293,7 +296,8 @@ class ApiController extends Controller {
* *
* @return json * @return json
*/ */
public function openedTickets() { public function openedTickets()
{
try { try {
// $result = $this->model->where('status', '=', 1)->where('isanswered', '=', 0)->where('assigned_to', '=', null)->orderBy('id', 'DESC')->get(); // $result = $this->model->where('status', '=', 1)->where('isanswered', '=', 0)->where('assigned_to', '=', null)->orderBy('id', 'DESC')->get();
// return response()->json(compact('result')); // return response()->json(compact('result'));
@@ -337,7 +341,8 @@ class ApiController extends Controller {
* *
* @return json * @return json
*/ */
public function unassignedTickets() { public function unassignedTickets()
{
try { try {
//dd('sdhjbc'); //dd('sdhjbc');
// $result = $this->model->where('assigned_to', '=', null)->where('status', '1')->orderBy('id', 'DESC')->get(); // $result = $this->model->where('assigned_to', '=', null)->where('status', '1')->orderBy('id', 'DESC')->get();
@@ -381,7 +386,8 @@ class ApiController extends Controller {
* *
* @return json * @return json
*/ */
public function closeTickets() { public function closeTickets()
{
try { try {
// $result = $this->model->where('status', '>', 1)->where('status', '<', 4)->orderBy('id', 'DESC')->get(); // $result = $this->model->where('status', '>', 1)->where('status', '<', 4)->orderBy('id', 'DESC')->get();
// return response()->json(compact('result')); // return response()->json(compact('result'));
@@ -425,7 +431,8 @@ class ApiController extends Controller {
* *
* @return json * @return json
*/ */
public function getAgents() { public function getAgents()
{
try { try {
$result = $this->faveoUser->where('role', 'agent')->orWhere('role', 'admin')->where('active', 1)->get(); $result = $this->faveoUser->where('role', 'agent')->orWhere('role', 'admin')->where('active', 1)->get();
@@ -448,7 +455,8 @@ class ApiController extends Controller {
* *
* @return json * @return json
*/ */
public function getTeams() { public function getTeams()
{
try { try {
$result = $this->team->get(); $result = $this->team->get();
@@ -471,7 +479,8 @@ class ApiController extends Controller {
* *
* @return json * @return json
*/ */
public function assignTicket() { public function assignTicket()
{
try { try {
$v = \Validator::make($this->request->all(), [ $v = \Validator::make($this->request->all(), [
'ticket_id' => 'required', 'ticket_id' => 'required',
@@ -509,7 +518,8 @@ class ApiController extends Controller {
* *
* @return json * @return json
*/ */
public function getCustomers() { public function getCustomers()
{
try { try {
$v = \Validator::make($this->request->all(), [ $v = \Validator::make($this->request->all(), [
'search' => 'required', 'search' => 'required',
@@ -543,7 +553,8 @@ class ApiController extends Controller {
* *
* @return json * @return json
*/ */
public function getCustomersWith() { public function getCustomersWith()
{
try { try {
$users = $this->user $users = $this->user
->leftJoin('user_assign_organization', 'user_assign_organization.user_id', '=', 'users.id') ->leftJoin('user_assign_organization', 'user_assign_organization.user_id', '=', 'users.id')
@@ -574,7 +585,8 @@ class ApiController extends Controller {
* *
* @return json * @return json
*/ */
public function getCustomer() { public function getCustomer()
{
try { try {
$v = \Validator::make($this->request->all(), [ $v = \Validator::make($this->request->all(), [
'user_id' => 'required', 'user_id' => 'required',
@@ -606,7 +618,8 @@ class ApiController extends Controller {
* *
* @return json * @return json
*/ */
public function searchTicket() { public function searchTicket()
{
try { try {
$v = \Validator::make($this->request->all(), [ $v = \Validator::make($this->request->all(), [
'search' => 'required', 'search' => 'required',
@@ -638,7 +651,8 @@ class ApiController extends Controller {
* *
* @return json * @return json
*/ */
public function ticketThreads() { public function ticketThreads()
{
try { try {
$v = \Validator::make($this->request->all(), [ $v = \Validator::make($this->request->all(), [
'id' => 'required', 'id' => 'required',
@@ -675,7 +689,8 @@ class ApiController extends Controller {
* *
* @return json * @return json
*/ */
public function checkUrl() { public function checkUrl()
{
//dd($this->request); //dd($this->request);
try { try {
$v = \Validator::make($this->request->all(), [ $v = \Validator::make($this->request->all(), [
@@ -712,7 +727,8 @@ class ApiController extends Controller {
* *
* @return string * @return string
*/ */
public function urlResult() { public function urlResult()
{
return 'success'; return 'success';
} }
@@ -723,7 +739,8 @@ class ApiController extends Controller {
* *
* @return type int|string|json * @return type int|string|json
*/ */
public function callGetApi($url) { public function callGetApi($url)
{
$curl = curl_init($url); $curl = curl_init($url);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_URL, $url);
@@ -747,7 +764,8 @@ class ApiController extends Controller {
* *
* @return type int|string|json * @return type int|string|json
*/ */
public function callPostApi($url, $data) { public function callPostApi($url, $data)
{
$curl = curl_init($url); $curl = curl_init($url);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_URL, $url);
@@ -769,7 +787,8 @@ class ApiController extends Controller {
* *
* @return type | json * @return type | json
*/ */
public function generateApiKey() { public function generateApiKey()
{
try { try {
$set = $this->setting->where('id', '1')->first(); $set = $this->setting->where('id', '1')->first();
//dd($set); //dd($set);
@@ -803,7 +822,8 @@ class ApiController extends Controller {
* *
* @return json * @return json
*/ */
public function getHelpTopic() { public function getHelpTopic()
{
try { try {
$result = $this->helptopic->get(); $result = $this->helptopic->get();
@@ -826,7 +846,8 @@ class ApiController extends Controller {
* *
* @return json * @return json
*/ */
public function getSlaPlan() { public function getSlaPlan()
{
try { try {
$result = $this->slaPlan->get(); $result = $this->slaPlan->get();
@@ -849,7 +870,8 @@ class ApiController extends Controller {
* *
* @return json * @return json
*/ */
public function getPriority() { public function getPriority()
{
try { try {
$result = $this->priority->get(); $result = $this->priority->get();
@@ -872,7 +894,8 @@ class ApiController extends Controller {
* *
* @return json * @return json
*/ */
public function getDepartment() { public function getDepartment()
{
try { try {
$result = $this->department->get(); $result = $this->department->get();
@@ -895,7 +918,8 @@ class ApiController extends Controller {
* *
* @return type json * @return type json
*/ */
public function getTickets() { public function getTickets()
{
try { try {
$tickets = $this->model->orderBy('created_at', 'desc')->paginate(10); $tickets = $this->model->orderBy('created_at', 'desc')->paginate(10);
$tickets->toJson(); $tickets->toJson();
@@ -919,9 +943,9 @@ class ApiController extends Controller {
* *
* @return type json * @return type json
*/ */
public function inbox() { public function inbox()
{
try { try {
$inbox = $this->user->join('tickets', function ($join) { $inbox = $this->user->join('tickets', function ($join) {
$join->on('users.id', '=', 'tickets.user_id') $join->on('users.id', '=', 'tickets.user_id')
->where('status', '=', 1); ->where('status', '=', 1);
@@ -961,7 +985,8 @@ class ApiController extends Controller {
* *
* @return type json * @return type json
*/ */
public function internalNote() { public function internalNote()
{
try { try {
$v = \Validator::make($this->request->all(), [ $v = \Validator::make($this->request->all(), [
'userid' => 'required|exists:users,id', 'userid' => 'required|exists:users,id',
@@ -993,7 +1018,8 @@ class ApiController extends Controller {
} }
} }
public function getTrash() { public function getTrash()
{
try { try {
$trash = $this->user->join('tickets', function ($join) { $trash = $this->user->join('tickets', function ($join) {
$join->on('users.id', '=', 'tickets.user_id') $join->on('users.id', '=', 'tickets.user_id')
@@ -1029,7 +1055,8 @@ class ApiController extends Controller {
} }
} }
public function getMyTicketsAgent() { public function getMyTicketsAgent()
{
try { try {
$v = \Validator::make($this->request->all(), [ $v = \Validator::make($this->request->all(), [
'user_id' => 'required|exists:users,id', 'user_id' => 'required|exists:users,id',
@@ -1081,7 +1108,8 @@ class ApiController extends Controller {
} }
} }
public function getMyTicketsUser() { public function getMyTicketsUser()
{
try { try {
$v = \Validator::make($this->request->all(), [ $v = \Validator::make($this->request->all(), [
'user_id' => 'required|exists:users,id', 'user_id' => 'required|exists:users,id',
@@ -1132,7 +1160,8 @@ class ApiController extends Controller {
} }
} }
public function getTicketById() { public function getTicketById()
{
try { try {
$v = \Validator::make($this->request->all(), [ $v = \Validator::make($this->request->all(), [
'id' => 'required|exists:tickets,id', 'id' => 'required|exists:tickets,id',
@@ -1171,7 +1200,8 @@ class ApiController extends Controller {
} }
} }
public function createPagination($array, $perPage) { public function createPagination($array, $perPage)
{
try { try {
//Get current page form url e.g. &page=6 //Get current page form url e.g. &page=6
$currentPage = LengthAwarePaginator::resolveCurrentPage(); $currentPage = LengthAwarePaginator::resolveCurrentPage();
@@ -1199,7 +1229,8 @@ class ApiController extends Controller {
} }
} }
public function collaboratorSearch() { public function collaboratorSearch()
{
$this->validate($this->request, ['term' => 'required']); $this->validate($this->request, ['term' => 'required']);
try { try {
$emails = $this->ticket->autosearch(); $emails = $this->ticket->autosearch();
@@ -1226,7 +1257,8 @@ class ApiController extends Controller {
} }
} }
public function avatarUrl($email) { public function avatarUrl($email)
{
try { try {
$user = new User(); $user = new User();
$user = $user->where('email', $email)->first(); $user = $user->where('email', $email)->first();
@@ -1243,7 +1275,8 @@ class ApiController extends Controller {
} }
} }
public function addCollaboratorForTicket() { public function addCollaboratorForTicket()
{
try { try {
$v = \Validator::make(\Input::get(), [ $v = \Validator::make(\Input::get(), [
'email' => 'required|email|unique:users', 'email' => 'required|email|unique:users',
@@ -1273,7 +1306,8 @@ class ApiController extends Controller {
} }
} }
public function getCollaboratorForTicket() { public function getCollaboratorForTicket()
{
try { try {
$v = \Validator::make(\Input::get(), [ $v = \Validator::make(\Input::get(), [
'ticket_id' => 'required', 'ticket_id' => 'required',
@@ -1302,7 +1336,8 @@ class ApiController extends Controller {
} }
} }
public function deleteCollaborator() { public function deleteCollaborator()
{
try { try {
$v = \Validator::make(\Input::get(), [ $v = \Validator::make(\Input::get(), [
'ticketid' => 'required', 'ticketid' => 'required',
@@ -1326,7 +1361,8 @@ class ApiController extends Controller {
} }
} }
public function dependency() { public function dependency()
{
try { try {
$department = $this->department->select('name', 'id')->get()->toArray(); $department = $this->department->select('name', 'id')->get()->toArray();
$sla = $this->slaPlan->select('name', 'id')->get()->toArray(); $sla = $this->slaPlan->select('name', 'id')->get()->toArray();
@@ -1349,7 +1385,8 @@ class ApiController extends Controller {
} }
} }
public function differenciateHelpTopic($query){ public function differenciateHelpTopic($query)
{
$ticket = $query->first(); $ticket = $query->first();
$check = 'department'; $check = 'department';
if ($ticket) { if ($ticket) {
@@ -1365,7 +1402,8 @@ class ApiController extends Controller {
} }
} }
public function getSystem($check,$query){ public function getSystem($check, $query)
{
switch ($check) { switch ($check) {
case 'department': case 'department':
return $query->select('tickets.dept_id'); return $query->select('tickets.dept_id');
@@ -1375,6 +1413,7 @@ class ApiController extends Controller {
return $query->select('tickets.dept_id'); return $query->select('tickets.dept_id');
} }
} }
/** /**
* Register a user with username and password. * Register a user with username and password.
* *
@@ -1400,7 +1439,7 @@ class ApiController extends Controller {
$password = \Hash::make($request->input('password')); $password = \Hash::make($request->input('password'));
$role = $request->input('role'); $role = $request->input('role');
if ($auth->role == 'agent') { if ($auth->role == 'agent') {
$role = "user"; $role = 'user';
} }
$user = new User(); $user = new User();
$user->password = $password; $user->password = $password;
@@ -1408,6 +1447,7 @@ class ApiController extends Controller {
$user->email = $email; $user->email = $email;
$user->role = $role; $user->role = $role;
$user->save(); $user->save();
return response()->json(compact('user')); return response()->json(compact('user'));
} catch (\Exception $e) { } catch (\Exception $e) {
$error = $e->getMessage(); $error = $e->getMessage();
@@ -1415,6 +1455,4 @@ class ApiController extends Controller {
return response()->json(compact('error')); return response()->json(compact('error'));
} }
} }
} }

View File

@@ -5,33 +5,31 @@ namespace App\Http\Controllers\Api\v1;
// Controllers // Controllers
use App\Http\Controllers\Controller; use App\Http\Controllers\Controller;
// Requests // Requests
use Illuminate\Http\Request;
// Models
use App\User;
use App\Model\helpdesk\Ticket\Tickets;
use App\Model\helpdesk\Ticket\Ticket_Thread; use App\Model\helpdesk\Ticket\Ticket_Thread;
// Models
use App\Model\helpdesk\Ticket\Tickets;
use App\User;
use FCM;
// classes // classes
use LaravelFCM\Message\PayloadNotificationBuilder; use Illuminate\Http\Request;
use LaravelFCM\Message\Topics;
use LaravelFCM\Message\OptionsBuilder; use LaravelFCM\Message\OptionsBuilder;
use LaravelFCM\Message\PayloadDataBuilder; use LaravelFCM\Message\PayloadDataBuilder;
use LaravelFCM\Message\PayloadNotificationBuilder;
use LaravelFCM\Response\DownstreamResponse; use LaravelFCM\Response\DownstreamResponse;
use FCM;
use FCMGroup;
/** /**
* ********************************************** * **********************************************
* PushNotificationController * PushNotificationController
* ********************************************** * **********************************************
* This controller is used to send notification to FCM cloud which later will * This controller is used to send notification to FCM cloud which later will
* foreward notification to Mobile Application * foreward notification to Mobile Application.
* *
* @author Ladybird <info@ladybirdweb.com> * @author Ladybird <info@ladybirdweb.com>
*/ */
class PushNotificationController extends Controller { class PushNotificationController extends Controller
{
public function Response($token, $body, $ticket_id = null) { public function Response($token, $body, $ticket_id = null)
{
$optionBuiler = new OptionsBuilder(); $optionBuiler = new OptionsBuilder();
$optionBuiler->setTimeToLive(60 * 60); $optionBuiler->setTimeToLive(60 * 60);
@@ -76,15 +74,18 @@ class PushNotificationController extends Controller {
/** /**
* function to get the fcm token from the api under a user. * function to get the fcm token from the api under a user.
*
* @param \Illuminate\Http\Request $request * @param \Illuminate\Http\Request $request
*
* @return type * @return type
*/ */
public function fcmToken(Request $request, User $user) { public function fcmToken(Request $request, User $user)
{
// get the requested details // get the requested details
$user_id = $request->input('user_id'); $user_id = $request->input('user_id');
$fcm_token = $request->input('fcm_token'); $fcm_token = $request->input('fcm_token');
// check for all the valid details // check for all the valid details
if($user_id != null && $user_id != "" && $fcm_token != null && $fcm_token != "") { if ($user_id != null && $user_id != '' && $fcm_token != null && $fcm_token != '') {
// search the user_id in database // search the user_id in database
$user = $user->where('id', '=', $user_id)->first(); $user = $user->where('id', '=', $user_id)->first();
if ($user != null) { if ($user != null) {
@@ -101,5 +102,4 @@ class PushNotificationController extends Controller {
return ['response' => 'fail', 'reason' => 'Invalid Credentials']; return ['response' => 'fail', 'reason' => 'Invalid Credentials'];
} }
} }
} }

View File

@@ -4,7 +4,6 @@ namespace App\Http\Controllers\Auth;
// controllers // controllers
use App\Http\Controllers\Common\PhpMailController; use App\Http\Controllers\Common\PhpMailController;
use App\Http\Controllers\Common\SettingsController;
use App\Http\Controllers\Controller; use App\Http\Controllers\Controller;
// requests // requests
use App\Http\Requests\helpdesk\LoginRequest; use App\Http\Requests\helpdesk\LoginRequest;
@@ -279,14 +278,14 @@ class AuthController extends Controller
$attempts = $data->Attempts + 1; $attempts = $data->Attempts + 1;
if ($attempts == $apt) { if ($attempts == $apt) {
// $result = DB::select('UPDATE login_attempts SET Attempts='.$attempts.", LastLogin=NOW() WHERE IP = '$value' OR User = '$field'"); // $result = DB::select('UPDATE login_attempts SET Attempts='.$attempts.", LastLogin=NOW() WHERE IP = '$value' OR User = '$field'");
$result = DB::table('login_attempts')->where('IP', '=', $value)->orWhere('User', '=', $field)->update(['Attempts' => $attempts, 'LastLogin' => Date('Y-m-d H:i:s')]); $result = DB::table('login_attempts')->where('IP', '=', $value)->orWhere('User', '=', $field)->update(['Attempts' => $attempts, 'LastLogin' => date('Y-m-d H:i:s')]);
} else { } else {
$result = DB::table('login_attempts')->where('IP', '=', $value)->orWhere('User', '=', $field)->update(['Attempts' => $attempts]); $result = DB::table('login_attempts')->where('IP', '=', $value)->orWhere('User', '=', $field)->update(['Attempts' => $attempts]);
// $result = DB::select("UPDATE login_attempts SET Attempts=".$attempts." WHERE IP = '$value' OR User = '$field'"); // $result = DB::select("UPDATE login_attempts SET Attempts=".$attempts." WHERE IP = '$value' OR User = '$field'");
} }
} else { } else {
// $result = DB::select("INSERT INTO login_attempts (Attempts,User,IP,LastLogin) values (1,'$field','$value', NOW())"); // $result = DB::select("INSERT INTO login_attempts (Attempts,User,IP,LastLogin) values (1,'$field','$value', NOW())");
$result = DB::table('login_attempts')->update(['Attempts' => 1, 'User' => $field, 'IP' => $value, 'LastLogin' => Date('Y-m-d H:i:s')]); $result = DB::table('login_attempts')->update(['Attempts' => 1, 'User' => $field, 'IP' => $value, 'LastLogin' => date('Y-m-d H:i:s')]);
} }
} }
@@ -329,6 +328,7 @@ class AuthController extends Controller
return 1; return 1;
} else { } else {
$this->clearLoginAttempts($value, $field); $this->clearLoginAttempts($value, $field);
return 0; return 0;
} }
} }

View File

@@ -4,7 +4,6 @@ namespace App\Http\Controllers\Auth;
// controllers // controllers
use App\Http\Controllers\Common\PhpMailController; use App\Http\Controllers\Common\PhpMailController;
use App\Http\Controllers\Common\SettingsController;
use App\Http\Controllers\Controller; use App\Http\Controllers\Controller;
// request // request
use App\User; use App\User;
@@ -53,7 +52,7 @@ class PasswordController extends Controller
{ {
$date = date('Y-m-d H:i:s'); $date = date('Y-m-d H:i:s');
$this->validate($request, ['email' => 'required|email']); $this->validate($request, ['email' => 'required|email']);
\Event::fire('reset.password',array()); \Event::fire('reset.password', []);
$user = User::where('email', '=', $request->only('email'))->first(); $user = User::where('email', '=', $request->only('email'))->first();
if (isset($user)) { if (isset($user)) {
$user1 = $user->email; $user1 = $user->email;

View File

@@ -33,15 +33,16 @@ use Redirect;
* *
* @author Ladybird <info@ladybirdweb.com> * @author Ladybird <info@ladybirdweb.com>
*/ */
class FormController extends Controller { class FormController extends Controller
{
/** /**
* Create a new controller instance. * Create a new controller instance.
* Constructor to check. * Constructor to check.
* *
* @return void * @return void
*/ */
public function __construct(TicketWorkflowController $TicketWorkflowController) { public function __construct(TicketWorkflowController $TicketWorkflowController)
{
$this->middleware('board'); $this->middleware('board');
// creating a TicketController instance // creating a TicketController instance
$this->TicketWorkflowController = $TicketWorkflowController; $this->TicketWorkflowController = $TicketWorkflowController;
@@ -54,7 +55,8 @@ class FormController extends Controller {
* *
* @return type * @return type
*/ */
public function getForm(Help_topic $topic, CountryCode $code) { public function getForm(Help_topic $topic, CountryCode $code)
{
if (\Config::get('database.install') == '%0%') { if (\Config::get('database.install') == '%0%') {
return \Redirect::route('licence'); return \Redirect::route('licence');
} }
@@ -66,8 +68,9 @@ class FormController extends Controller {
if ($phonecode->phonecode) { if ($phonecode->phonecode) {
$phonecode = $phonecode->phonecode; $phonecode = $phonecode->phonecode;
} else { } else {
$phonecode = ""; $phonecode = '';
} }
return view('themes.default1.client.helpdesk.form', compact('topics', 'codes'))->with('phonecode', $phonecode); return view('themes.default1.client.helpdesk.form', compact('topics', 'codes'))->with('phonecode', $phonecode);
} else { } else {
return \Redirect::route('home'); return \Redirect::route('home');
@@ -82,35 +85,35 @@ class FormController extends Controller {
* *
* @return type string * @return type string
*/ */
public function postForm($id, Help_topic $topic) { public function postForm($id, Help_topic $topic)
{
if ($id != 0) { if ($id != 0) {
$helptopic = $topic->where('id', '=', $id)->first(); $helptopic = $topic->where('id', '=', $id)->first();
$custom_form = $helptopic->custom_form; $custom_form = $helptopic->custom_form;
$values = Fields::where('forms_id', '=', $custom_form)->get(); $values = Fields::where('forms_id', '=', $custom_form)->get();
if (!$values) { if (!$values) {
} }
if ($values) { if ($values) {
foreach ($values as $form_data) { foreach ($values as $form_data) {
if ($form_data->type == "select") { if ($form_data->type == 'select') {
$form_fields = explode(',', $form_data->value); $form_fields = explode(',', $form_data->value);
$var = ""; $var = '';
foreach ($form_fields as $form_field) { foreach ($form_fields as $form_field) {
$var .= '<option value="'.$form_field.'">'.$form_field.'</option>'; $var .= '<option value="'.$form_field.'">'.$form_field.'</option>';
} }
echo '<br/><label>'.ucfirst($form_data->label).'</label><select class="form-control" name="'.$form_data->name.'">'.$var.'</select>'; echo '<br/><label>'.ucfirst($form_data->label).'</label><select class="form-control" name="'.$form_data->name.'">'.$var.'</select>';
} elseif ($form_data->type == "radio") { } elseif ($form_data->type == 'radio') {
$type2 = $form_data->value; $type2 = $form_data->value;
$vals = explode(',', $type2); $vals = explode(',', $type2);
echo '<br/><label>'.ucfirst($form_data->label).'</label><br/>'; echo '<br/><label>'.ucfirst($form_data->label).'</label><br/>';
foreach ($vals as $val) { foreach ($vals as $val) {
echo '<input type="'.$form_data->type.'" name="'.$form_data->name.'"> '.$val.'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'; echo '<input type="'.$form_data->type.'" name="'.$form_data->name.'"> '.$val.'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
} }
echo "<br/>"; echo '<br/>';
} elseif ($form_data->type == "textarea") { } elseif ($form_data->type == 'textarea') {
$type3 = $form_data->value; $type3 = $form_data->value;
echo '<br/><label>'.$form_data->label.'</label></br><textarea id="unique-textarea" name="'.$form_data->name.'" class="form-control" style="height:15%;"></textarea>'; echo '<br/><label>'.$form_data->label.'</label></br><textarea id="unique-textarea" name="'.$form_data->name.'" class="form-control" style="height:15%;"></textarea>';
} elseif ($form_data->type == "checkbox") { } elseif ($form_data->type == 'checkbox') {
$type4 = $form_data->value; $type4 = $form_data->value;
$checks = explode(',', $type4); $checks = explode(',', $type4);
echo '<br/><label>'.ucfirst($form_data->label).'</label><br/>'; echo '<br/><label>'.ucfirst($form_data->label).'</label><br/>';
@@ -134,7 +137,8 @@ class FormController extends Controller {
* @param type Request $request * @param type Request $request
* @param type User $user * @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'); $form_extras = $request->except('Name', 'Phone', 'Email', 'Subject', 'Details', 'helptopic', '_wysihtml5_mode', '_token');
$name = $request->input('Name'); $name = $request->input('Name');
@@ -215,7 +219,8 @@ class FormController extends Controller {
* *
* @return type view * @return type view
*/ */
public function post_ticket_reply($id, Request $request) { public function post_ticket_reply($id, Request $request)
{
try { try {
if ($comment != null) { if ($comment != null) {
$tickets = Tickets::where('id', '=', $id)->first(); $tickets = Tickets::where('id', '=', $id)->first();
@@ -255,13 +260,14 @@ class FormController extends Controller {
} }
} }
public function getCustomForm(Request $request) { public function getCustomForm(Request $request)
$html = ""; {
$html = '';
$helptopic_id = $request->input('helptopic'); $helptopic_id = $request->input('helptopic');
$helptopics = new Help_topic(); $helptopics = new Help_topic();
$helptopic = $helptopics->find($helptopic_id); $helptopic = $helptopics->find($helptopic_id);
if (!$helptopic) { if (!$helptopic) {
throw new Exception("We can not find your request"); throw new Exception('We can not find your request');
} }
$custom_form = $helptopic->custom_form; $custom_form = $helptopic->custom_form;
if ($custom_form) { if ($custom_form) {
@@ -270,7 +276,7 @@ class FormController extends Controller {
$form_controller = new \App\Http\Controllers\Admin\helpdesk\FormController($fields, $forms); $form_controller = new \App\Http\Controllers\Admin\helpdesk\FormController($fields, $forms);
$html = $form_controller->renderForm($custom_form); $html = $form_controller->renderForm($custom_form);
} }
return $html; return $html;
} }
} }

View File

@@ -11,12 +11,12 @@ use App\Http\Requests\helpdesk\ProfileRequest;
use App\Http\Requests\helpdesk\TicketRequest; use App\Http\Requests\helpdesk\TicketRequest;
use App\Model\helpdesk\Manage\Help_topic; use App\Model\helpdesk\Manage\Help_topic;
// models // models
use App\Model\helpdesk\Settings\CommonSettings;
use App\Model\helpdesk\Settings\Company; use App\Model\helpdesk\Settings\Company;
use App\Model\helpdesk\Settings\System; use App\Model\helpdesk\Settings\System;
use App\Model\helpdesk\Ticket\Ticket_Thread; use App\Model\helpdesk\Ticket\Ticket_Thread;
use App\Model\helpdesk\Ticket\Tickets; use App\Model\helpdesk\Ticket\Tickets;
use App\Model\helpdesk\Utility\CountryCode; use App\Model\helpdesk\Utility\CountryCode;
use App\Model\helpdesk\Settings\CommonSettings;
use App\User; use App\User;
use Auth; use Auth;
// classes // classes
@@ -323,6 +323,7 @@ class GuestController extends Controller
$common_setting = $common_settings->select('status') $common_setting = $common_settings->select('status')
->where('option_name', '=', 'user_set_ticket_status') ->where('option_name', '=', 'user_set_ticket_status')
->first(); ->first();
return view('themes.default1.client.helpdesk.ckeckticket', compact('id', 'common_setting')); return view('themes.default1.client.helpdesk.ckeckticket', compact('id', 'common_setting'));
} }

View File

@@ -24,9 +24,10 @@ use Lang;
use Mail; use Mail;
use Redirect; use Redirect;
class UserController extends Controller { class UserController extends Controller
{
public function __construct() { public function __construct()
{
$this->middleware('board'); $this->middleware('board');
} }
@@ -35,7 +36,8 @@ class UserController extends Controller {
* *
* @return response * @return response
*/ */
public function getArticle(Article $article, Category $category, Settings $settings) { public function getArticle(Article $article, Category $category, Settings $settings)
{
$setting = $settings->first(); $setting = $settings->first();
$pagination = $setting->pagination; $pagination = $setting->pagination;
if (!Auth::check() || \Auth::user()->role == 'user') { if (!Auth::check() || \Auth::user()->role == 'user') {
@@ -47,6 +49,7 @@ class UserController extends Controller {
$article->setPath('article-list'); $article->setPath('article-list');
$categorys = $category->get(); $categorys = $category->get();
return view('themes.default1.client.kb.article-list.articles', compact('time', 'categorys', 'article')); return view('themes.default1.client.kb.article-list.articles', compact('time', 'categorys', 'article'));
} }
@@ -59,7 +62,8 @@ class UserController extends Controller {
* *
* @return string excerpt * @return string excerpt
*/ */
public static function getExcerpt($str, $startPos = 0, $maxLength = 50) { public static function getExcerpt($str, $startPos = 0, $maxLength = 50)
{
if (strlen($str) > $maxLength) { if (strlen($str) > $maxLength) {
$excerpt = substr($str, $startPos, $maxLength - 3); $excerpt = substr($str, $startPos, $maxLength - 3);
$lastSpace = strrpos($excerpt, ' '); $lastSpace = strrpos($excerpt, ' ');
@@ -82,7 +86,8 @@ class UserController extends Controller {
* *
* @return type view * @return type view
*/ */
public function search(SearchRequest $request, Category $category, Article $article, Settings $settings) { public function search(SearchRequest $request, Category $category, Article $article, Settings $settings)
{
$settings = $settings->first(); $settings = $settings->first();
$pagination = $settings->pagination; $pagination = $settings->pagination;
$search = $request->input('s'); $search = $request->input('s');
@@ -101,7 +106,8 @@ class UserController extends Controller {
* *
* @return response * @return response
*/ */
public function show($slug, Article $article, Category $category) { public function show($slug, Article $article, Category $category)
{
//ArticleController::timezone(); //ArticleController::timezone();
$tz = \App\Model\helpdesk\Settings\System::where('id', '1')->first()->time_zone; $tz = \App\Model\helpdesk\Settings\System::where('id', '1')->first()->time_zone;
$tz = \App\Model\helpdesk\Utility\Timezones::where('id', $tz)->first()->name; $tz = \App\Model\helpdesk\Utility\Timezones::where('id', $tz)->first()->name;
@@ -125,7 +131,8 @@ class UserController extends Controller {
} }
} }
public function getCategory($slug, Article $article, Category $category, Relationship $relation) { public function getCategory($slug, Article $article, Category $category, Relationship $relation)
{
/* get the article_id where category_id == current category */ /* get the article_id where category_id == current category */
$catid = $category->where('slug', $slug)->first(); $catid = $category->where('slug', $slug)->first();
if (!$catid) { if (!$catid) {
@@ -141,7 +148,8 @@ class UserController extends Controller {
return view('themes.default1.client.kb.article-list.category', compact('all', 'id', 'categorys', 'article_id')); return view('themes.default1.client.kb.article-list.category', compact('all', 'id', 'categorys', 'article_id'));
} }
public function home(Article $article, Category $category, Relationship $relation) { public function home(Article $article, Category $category, Relationship $relation)
{
if (Config::get('database.install') == '%0%') { if (Config::get('database.install') == '%0%') {
return redirect('step1'); return redirect('step1');
} else { } else {
@@ -153,7 +161,8 @@ class UserController extends Controller {
} }
} }
public function Faq(Faq $faq, Category $category) { public function Faq(Faq $faq, Category $category)
{
$faq = $faq->where('id', '1')->first(); $faq = $faq->where('id', '1')->first();
$categorys = $category->get(); $categorys = $category->get();
@@ -165,7 +174,8 @@ class UserController extends Controller {
* *
* @return response * @return response
*/ */
public function contact(Category $category, Settings $settings) { public function contact(Category $category, Settings $settings)
{
$settings = $settings->whereId('1')->first(); $settings = $settings->whereId('1')->first();
$categorys = $category->get(); $categorys = $category->get();
@@ -177,7 +187,8 @@ class UserController extends Controller {
* *
* @return response * @return response
*/ */
public function postContact(ContactRequest $request, Contact $contact) { public function postContact(ContactRequest $request, Contact $contact)
{
$this->port(); $this->port();
$this->host(); $this->host();
$this->encryption(); $this->encryption();
@@ -204,7 +215,8 @@ class UserController extends Controller {
} }
} }
public function contactDetails() { public function contactDetails()
{
return view('themes.default1.client.kb.article-list.contact-details'); return view('themes.default1.client.kb.article-list.contact-details');
} }
@@ -218,7 +230,8 @@ class UserController extends Controller {
* *
* @return type response * @return type response
*/ */
public function postComment($slug, Article $article, CommentRequest $request, Comment $comment) { public function postComment($slug, Article $article, CommentRequest $request, Comment $comment)
{
$article = $article->where('slug', $slug)->first(); $article = $article->where('slug', $slug)->first();
if (!$article) { if (!$article) {
return Redirect::back()->with('fails', Lang::get('lang.sorry_not_processed')); return Redirect::back()->with('fails', Lang::get('lang.sorry_not_processed'));
@@ -232,7 +245,8 @@ class UserController extends Controller {
} }
} }
public function getPage($name, Page $page) { public function getPage($name, Page $page)
{
$page = $page->where('slug', $name)->first(); $page = $page->where('slug', $name)->first();
if ($page) { if ($page) {
return view('themes.default1.client.kb.article-list.pages', compact('page')); return view('themes.default1.client.kb.article-list.pages', compact('page'));
@@ -241,33 +255,39 @@ class UserController extends Controller {
} }
} }
public static function port() { public static function port()
{
$setting = Settings::whereId('1')->first(); $setting = Settings::whereId('1')->first();
Config::set('mail.port', $setting->port); Config::set('mail.port', $setting->port);
} }
public static function host() { public static function host()
{
$setting = Settings::whereId('1')->first(); $setting = Settings::whereId('1')->first();
Config::set('mail.host', $setting->host); Config::set('mail.host', $setting->host);
} }
public static function encryption() { public static function encryption()
{
$setting = Settings::whereId('1')->first(); $setting = Settings::whereId('1')->first();
Config::set(['mail.encryption' => $setting->encryption, 'mail.username' => $setting->email]); Config::set(['mail.encryption' => $setting->encryption, 'mail.username' => $setting->email]);
} }
public static function email() { public static function email()
{
$setting = Settings::whereId('1')->first(); $setting = Settings::whereId('1')->first();
Config::set(['mail.from' => ['address' => $setting->email, 'name' => 'asd']]); Config::set(['mail.from' => ['address' => $setting->email, 'name' => 'asd']]);
//dd(Config::get('mail')); //dd(Config::get('mail'));
} }
public static function password() { public static function password()
{
$setting = Settings::whereId('1')->first(); $setting = Settings::whereId('1')->first();
Config::set(['mail.password' => $setting->password, 'mail.sendmail' => $setting->email]); Config::set(['mail.password' => $setting->password, 'mail.sendmail' => $setting->email]);
} }
public function getCategoryList(Article $article, Category $category, Relationship $relation) { public function getCategoryList(Article $article, Category $category, Relationship $relation)
{
//$categorys = $category->get(); //$categorys = $category->get();
$categorys = $category->get(); $categorys = $category->get();
// $categorys->setPath('home'); // $categorys->setPath('home');
@@ -289,13 +309,15 @@ class UserController extends Controller {
// //return substr($date, 0, -6); // //return substr($date, 0, -6);
// } // }
public function clientProfile() { public function clientProfile()
{
$user = Auth::user(); $user = Auth::user();
return view('themes.default1.client.kb.article-list.profile', compact('user')); return view('themes.default1.client.kb.article-list.profile', compact('user'));
} }
public function postClientProfile($id, ProfileRequest $request) { public function postClientProfile($id, ProfileRequest $request)
{
$user = Auth::user(); $user = Auth::user();
$user->gender = $request->input('gender'); $user->gender = $request->input('gender');
$user->save(); $user->save();
@@ -328,7 +350,8 @@ class UserController extends Controller {
} }
} }
public function postClientProfilePassword($id, ProfilePassword $request) { public function postClientProfilePassword($id, ProfilePassword $request)
{
$user = Auth::user(); $user = Auth::user();
//echo $user->password; //echo $user->password;
if (Hash::check($request->input('old_password'), $user->getAuthPassword())) { if (Hash::check($request->input('old_password'), $user->getAuthPassword())) {
@@ -340,5 +363,4 @@ class UserController extends Controller {
return redirect()->back()->with('fails', Lang::get('lang.password_was_not_updated')); return redirect()->back()->with('fails', Lang::get('lang.password_was_not_updated'));
} }
} }
} }

View File

@@ -4,9 +4,10 @@ namespace App\Http\Controllers\Common;
use App\Http\Controllers\Controller; use App\Http\Controllers\Controller;
class FileuploadController extends Controller { class FileuploadController extends Controller
{
public function __construct() { public function __construct()
{
// checking authentication // checking authentication
$this->middleware('auth'); $this->middleware('auth');
// checking if role is agent // checking if role is agent
@@ -15,7 +16,8 @@ class FileuploadController extends Controller {
// Returns a file size limit in bytes based on the PHP upload_max_filesize // Returns a file size limit in bytes based on the PHP upload_max_filesize
// and post_max_size // and post_max_size
function file_upload_max_size() { public function file_upload_max_size()
{
static $max_size = -1; static $max_size = -1;
if ($max_size < 0) { if ($max_size < 0) {
@@ -31,11 +33,13 @@ class FileuploadController extends Controller {
$max_size_in_actual = ini_get('upload_max_filesize'); $max_size_in_actual = ini_get('upload_max_filesize');
} }
} }
return ['0' => $max_size_in_bytes, '1' => $max_size_in_actual]; return ['0' => $max_size_in_bytes, '1' => $max_size_in_actual];
// return $max_size_in_bytes; // return $max_size_in_bytes;
} }
function parse_size($size) { public function parse_size($size)
{
$unit = preg_replace('/[^bkmgtpezy]/i', '', $size); // Remove the non-unit characters from the size. $unit = preg_replace('/[^bkmgtpezy]/i', '', $size); // Remove the non-unit characters from the size.
$size = preg_replace('/[^0-9\.]/', '', $size); // Remove the non-numeric characters from the size. $size = preg_replace('/[^0-9\.]/', '', $size); // Remove the non-numeric characters from the size.
if ($unit) { if ($unit) {
@@ -45,5 +49,4 @@ class FileuploadController extends Controller {
return round($size); return round($size);
} }
} }
} }

View File

@@ -2,15 +2,16 @@
namespace App\Http\Controllers\Common; namespace App\Http\Controllers\Common;
use App\Http\Controllers\Api\v1\PushNotificationController;
use App\Http\Controllers\Controller; use App\Http\Controllers\Controller;
use App\Model\helpdesk\Notification\Notification; use App\Model\helpdesk\Notification\Notification;
use App\Model\helpdesk\Notification\NotificationType;
use App\Model\helpdesk\Notification\UserNotification; use App\Model\helpdesk\Notification\UserNotification;
use App\Model\helpdesk\Ticket\Tickets; use App\Model\helpdesk\Ticket\Tickets;
use App\User; use App\User;
use App\Http\Controllers\Api\v1\PushNotificationController;
use App\Model\helpdesk\Notification\NotificationType;
class NotificationController extends Controller { class NotificationController extends Controller
{
/** /**
********************************************* *********************************************
* Class Notification Controller * Class Notification Controller
@@ -19,17 +20,17 @@ class NotificationController extends Controller {
* under the folling occurrence * under the folling occurrence
* 1. Ticket Creation * 1. Ticket Creation
* 2. Ticket Reply * 2. Ticket Reply
* 3. User Creation * 3. User Creation.
* *
* @author Ladybird <info@ladybirdweb.com> * @author Ladybird <info@ladybirdweb.com>
*/ */
public $user; public $user;
/** /**
* Constructor * Constructor.
*/ */
public function __construct(PushNotificationController $PushNotificationController) { public function __construct(PushNotificationController $PushNotificationController)
{
$this->PushNotificationController = $PushNotificationController; $this->PushNotificationController = $PushNotificationController;
$user = new User(); $user = new User();
$this->user = $user; $this->user = $user;
@@ -41,12 +42,14 @@ class NotificationController extends Controller {
/** /**
* This function is used to create in app notifications. * This function is used to create in app notifications.
*
* @param type $model_id * @param type $model_id
* @param type $userid_created * @param type $userid_created
* @param type $type_id * @param type $type_id
* @param type $forwhome * @param type $forwhome
*/ */
public function create($model_id, $userid_created, $type_id, $forwhome = []) { public function create($model_id, $userid_created, $type_id, $forwhome = [])
{
try { try {
if (empty($forwhome)) { if (empty($forwhome)) {
$ticket = Tickets::where('id', '=', $model_id)->first(); $ticket = Tickets::where('id', '=', $model_id)->first();
@@ -67,48 +70,62 @@ class NotificationController extends Controller {
} }
/** /**
* This function is to mark all ticket to read status * This function is to mark all ticket to read status.
*
* @param type $id * @param type $id
*
* @return int * @return int
*/ */
public function markAllRead($id) { public function markAllRead($id)
{
$markasread = UserNotification::where('user_id', '=', \Auth::user()->id)->where('is_read', '=', '0')->get(); $markasread = UserNotification::where('user_id', '=', \Auth::user()->id)->where('is_read', '=', '0')->get();
foreach ($markasread as $mark) { foreach ($markasread as $mark) {
$mark->is_read = '1'; $mark->is_read = '1';
$mark->save(); $mark->save();
} }
return 1; return 1;
} }
/** /**
* This function to mark read * This function to mark read.
*
* @param type $id * @param type $id
*
* @return int * @return int
*/ */
public function markRead($id) { public function markRead($id)
{
$markasread = UserNotification::where('notification_id', '=', $id)->where('user_id', '=', \Auth::user()->id)->where('is_read', '=', '0')->get(); $markasread = UserNotification::where('notification_id', '=', $id)->where('user_id', '=', \Auth::user()->id)->where('is_read', '=', '0')->get();
foreach ($markasread as $mark) { foreach ($markasread as $mark) {
$mark->is_read = '1'; $mark->is_read = '1';
$mark->save(); $mark->save();
} }
return 1; return 1;
} }
/** /**
* function to show all the notifications * function to show all the notifications.
*
* @return type * @return type
*/ */
public function show() { public function show()
{
$notifications = $this->getNotifications(); $notifications = $this->getNotifications();
return view('notifications-all', compact('notifications')); return view('notifications-all', compact('notifications'));
} }
/** /**
* function to delete notifications * function to delete notifications.
*
* @param type $id * @param type $id
*
* @return int * @return int
*/ */
public function delete($id) { public function delete($id)
{
$markasread = UserNotification::where('notification_id', '=', $id)->where('user_id', '=', \Auth::user()->id)->get(); $markasread = UserNotification::where('notification_id', '=', $id)->where('user_id', '=', \Auth::user()->id)->get();
foreach ($markasread as $mark) { foreach ($markasread as $mark) {
$mark->delete(); $mark->delete();
@@ -119,14 +136,16 @@ class NotificationController extends Controller {
/** /**
* get the page to list the notifications. * get the page to list the notifications.
*
* @return response * @return response
*/ */
public static function getNotifications() { public static function getNotifications()
{
$notifications = UserNotification::join('notifications', 'user_notification.notification_id', '=', 'notifications.id') $notifications = UserNotification::join('notifications', 'user_notification.notification_id', '=', 'notifications.id')
->join('notification_types', 'notifications.type_id', '=', 'notification_types.id') ->join('notification_types', 'notifications.type_id', '=', 'notification_types.id')
->where('user_notification.user_id', '=', \Auth::user()->id) ->where('user_notification.user_id', '=', \Auth::user()->id)
->paginate(10); ->paginate(10);
return $notifications; return $notifications;
} }
} }

View File

@@ -6,16 +6,18 @@ use App\Http\Controllers\Controller;
use App\Model\Common\TemplateType; use App\Model\Common\TemplateType;
use App\Model\helpdesk\Agent\Department; use App\Model\helpdesk\Agent\Department;
use App\Model\helpdesk\Email\Emails; use App\Model\helpdesk\Email\Emails;
use App\Model\helpdesk\Settings\CommonSettings;
use App\Model\helpdesk\Settings\Company; use App\Model\helpdesk\Settings\Company;
use App\Model\helpdesk\Settings\Email; use App\Model\helpdesk\Settings\Email;
use App\Model\helpdesk\Settings\CommonSettings;
use App\User; use App\User;
use Auth; use Auth;
class PhpMailController extends Controller { class PhpMailController extends Controller
{
public function fetch_smtp_details($id) { public function fetch_smtp_details($id)
{
$emails = Emails::where('id', '=', $id)->first(); $emails = Emails::where('id', '=', $id)->first();
return $emails; return $emails;
} }
@@ -24,7 +26,8 @@ class PhpMailController extends Controller {
* *
* @return Mail * @return Mail
*/ */
public function sendmail($from, $to, $message, $template_variables) { public function sendmail($from, $to, $message, $template_variables)
{
// try { // try {
// dd($from); // dd($from);
$from_address = $this->fetch_smtp_details($from); $from_address = $this->fetch_smtp_details($from);
@@ -262,7 +265,7 @@ class PhpMailController extends Controller {
$mail->addAttachment($file_path, $file_name); $mail->addAttachment($file_path, $file_name);
} }
} }
$mail->CharSet = "utf8"; $mail->CharSet = 'utf8';
$mail->Subject = $subject; $mail->Subject = $subject;
if ($template == 'ticket-reply-agent') { if ($template == 'ticket-reply-agent') {
$line = '---Reply above this line--- <br/><br/>'; $line = '---Reply above this line--- <br/><br/>';
@@ -291,7 +294,8 @@ class PhpMailController extends Controller {
* *
* @return MailNotification * @return MailNotification
*/ */
public function sendEmail($from, $to, $message) { public function sendEmail($from, $to, $message)
{
try { try {
$from_address = $this->fetch_smtp_details($from); $from_address = $this->fetch_smtp_details($from);
if ($from_address == null) { if ($from_address == null) {
@@ -403,7 +407,7 @@ class PhpMailController extends Controller {
$mail->addAttachment($file_path, $file_name); $mail->addAttachment($file_path, $file_name);
} }
} }
$mail->CharSet = "utf8"; $mail->CharSet = 'utf8';
$mail->Subject = $subject; $mail->Subject = $subject;
$mail->Body = $content; $mail->Body = $content;
if (!$mail->send()) { if (!$mail->send()) {
@@ -422,7 +426,8 @@ class PhpMailController extends Controller {
* *
* @return type * @return type
*/ */
public function company() { public function company()
{
$company = Company::Where('id', '=', '1')->first(); $company = Company::Where('id', '=', '1')->first();
if ($company->company_name == null) { if ($company->company_name == null) {
$company = 'Support Center'; $company = 'Support Center';
@@ -441,7 +446,8 @@ class PhpMailController extends Controller {
* *
* @return type integer * @return type integer
*/ */
public function mailfrom($reg, $dept_id) { public function mailfrom($reg, $dept_id)
{
$email = Email::where('id', '=', '1')->first(); $email = Email::where('id', '=', '1')->first();
if ($reg == 1) { if ($reg == 1) {
return $email->sys_email; return $email->sys_email;
@@ -454,5 +460,4 @@ class PhpMailController extends Controller {
} }
} }
} }
} }

View File

@@ -5,39 +5,35 @@ namespace App\Http\Controllers\Common;
// Controllers // Controllers
use App\Http\Controllers\Controller; use App\Http\Controllers\Controller;
// Requests // Requests
use Illuminate\Http\Request;
// Models
use App\User; use App\User;
// classes // Models
use LaravelFCM\Message\PayloadNotificationBuilder;
use LaravelFCM\Message\Topics;
use LaravelFCM\Message\OptionsBuilder;
use LaravelFCM\Message\PayloadDataBuilder;
use LaravelFCM\Response\DownstreamResponse;
use FCM; use FCM;
use FCMGroup; // classes
use Illuminate\Http\Request;
/** /**
* ********************************************** * **********************************************
* PushNotificationController * PushNotificationController
* ********************************************** * **********************************************
* This controller is used to send notification to FCM cloud which later will * This controller is used to send notification to FCM cloud which later will
* foreward notification to Mobile Application * foreward notification to Mobile Application.
* *
* @author Ladybird <info@ladybirdweb.com> * @author Ladybird <info@ladybirdweb.com>
*/ */
class PushNotificationController extends Controller { class PushNotificationController extends Controller
{
public function response($token, User $user) { public function response($token, User $user)
{
} }
/** /**
* function to get the fcm token from the api under a user. * function to get the fcm token from the api under a user.
*
* @param \Illuminate\Http\Request $request * @param \Illuminate\Http\Request $request
*
* @return type * @return type
*/ */
public function fcmToken(Request $request, User $user) { public function fcmToken(Request $request, User $user)
{
} }
} }

View File

@@ -11,7 +11,6 @@ use App\Model\helpdesk\Email\Smtp;
// models // models
use App\Model\helpdesk\Settings\Plugin; use App\Model\helpdesk\Settings\Plugin;
use App\Model\helpdesk\Theme\Widgets; use App\Model\helpdesk\Theme\Widgets;
use App\Model\helpdesk\Utility\Version_Check;
use Config; use Config;
// classes // classes
use Crypt; use Crypt;
@@ -27,14 +26,15 @@ use Lang;
* *************************** * ***************************
* Controller to keep smtp details and fetch where ever needed. * Controller to keep smtp details and fetch where ever needed.
*/ */
class SettingsController extends Controller { class SettingsController extends Controller
{
/** /**
* Create a new controller instance. * Create a new controller instance.
* *
* @return type void * @return type void
*/ */
public function __construct() { public function __construct()
{
$this->middleware('auth'); $this->middleware('auth');
$this->middleware('roles'); $this->middleware('roles');
} }
@@ -44,7 +44,8 @@ class SettingsController extends Controller {
* *
* @return response * @return response
*/ */
public function widgets() { public function widgets()
{
return view('themes.default1.admin.helpdesk.theme.widgets'); return view('themes.default1.admin.helpdesk.theme.widgets');
} }
@@ -53,7 +54,8 @@ class SettingsController extends Controller {
* *
* @return response * @return response
*/ */
public function list_widget() { public function list_widget()
{
return \Datatable::collection(Widgets::where('id', '<', '7')->get()) return \Datatable::collection(Widgets::where('id', '<', '7')->get())
->searchColumns('name') ->searchColumns('name')
->orderColumns('name', 'title', 'value') ->orderColumns('name', 'title', 'value')
@@ -112,12 +114,14 @@ class SettingsController extends Controller {
* *
* @return type response * @return type response
*/ */
public function edit_widget($id, Widgets $widgets, Request $request) { public function edit_widget($id, Widgets $widgets, Request $request)
{
$widget = $widgets->where('id', '=', $id)->first(); $widget = $widgets->where('id', '=', $id)->first();
$widget->title = $request->title; $widget->title = $request->title;
$widget->value = $request->content; $widget->value = $request->content;
try { try {
$widget->save(); $widget->save();
return redirect()->back()->with('success', $widget->name.Lang::get('lang.saved_successfully')); return redirect()->back()->with('success', $widget->name.Lang::get('lang.saved_successfully'));
} catch (Exception $e) { } catch (Exception $e) {
return redirect()->back()->with('fails', $e->getMessage()); return redirect()->back()->with('fails', $e->getMessage());
@@ -129,7 +133,8 @@ class SettingsController extends Controller {
* *
* @return response * @return response
*/ */
public function social_buttons() { public function social_buttons()
{
return view('themes.default1.admin.helpdesk.theme.social'); return view('themes.default1.admin.helpdesk.theme.social');
} }
@@ -138,7 +143,8 @@ class SettingsController extends Controller {
* *
* @return response * @return response
*/ */
public function list_social_buttons() { public function list_social_buttons()
{
return \Datatable::collection(Widgets::where('id', '>', '6')->get()) return \Datatable::collection(Widgets::where('id', '>', '6')->get())
->searchColumns('name') ->searchColumns('name')
->orderColumns('name', 'value') ->orderColumns('name', 'value')
@@ -185,7 +191,8 @@ class SettingsController extends Controller {
* *
* @return type response * @return type response
*/ */
public function edit_social_buttons($id, Widgets $widgets, Request $request) { public function edit_social_buttons($id, Widgets $widgets, Request $request)
{
$widget = $widgets->where('id', '=', $id)->first(); $widget = $widgets->where('id', '=', $id)->first();
$widget->title = $request->title; $widget->title = $request->title;
$widget->value = $request->content; $widget->value = $request->content;
@@ -203,8 +210,10 @@ class SettingsController extends Controller {
* *
* @return type view * @return type view
*/ */
public function getsmtp() { public function getsmtp()
{
$settings = Smtp::where('id', '=', '1')->first(); $settings = Smtp::where('id', '=', '1')->first();
return view('themes.default1.admin.helpdesk.emails.smtp', compact('settings')); return view('themes.default1.admin.helpdesk.emails.smtp', compact('settings'));
} }
@@ -213,7 +222,8 @@ class SettingsController extends Controller {
* *
* @return type view * @return type view
*/ */
public function postsmtp(SmtpRequest $request) { public function postsmtp(SmtpRequest $request)
{
$data = Smtp::where('id', '=', 1)->first(); $data = Smtp::where('id', '=', 1)->first();
$data->driver = $request->input('driver'); $data->driver = $request->input('driver');
$data->host = $request->input('host'); $data->host = $request->input('host');
@@ -224,6 +234,7 @@ class SettingsController extends Controller {
$data->password = Crypt::encrypt($request->input('password')); $data->password = Crypt::encrypt($request->input('password'));
try { try {
$data->save(); $data->save();
return \Redirect::route('getsmtp')->with('success', 'success'); return \Redirect::route('getsmtp')->with('success', 'success');
} catch (Exception $e) { } catch (Exception $e) {
return \Redirect::route('getsmtp')->with('fails', $e->errorInfo[2]); return \Redirect::route('getsmtp')->with('fails', $e->errorInfo[2]);
@@ -238,7 +249,8 @@ class SettingsController extends Controller {
* *
* @return type view * @return type view
*/ */
public function PostSettings(Settings $set, Request $request) { public function PostSettings(Settings $set, Request $request)
{
$settings = $set->where('id', '1')->first(); $settings = $set->where('id', '1')->first();
$pass = $request->input('password'); $pass = $request->input('password');
$password = Crypt::encrypt($pass); $password = Crypt::encrypt($pass);
@@ -265,11 +277,13 @@ class SettingsController extends Controller {
} }
} }
public function Plugins() { public function Plugins()
{
return view('themes.default1.admin.helpdesk.settings.plugins'); return view('themes.default1.admin.helpdesk.settings.plugins');
} }
public function GetPlugin() { public function GetPlugin()
{
$plugins = $this->fetchConfig(); $plugins = $this->fetchConfig();
return \Datatable::collection(new Collection($plugins)) return \Datatable::collection(new Collection($plugins))
@@ -330,7 +344,8 @@ class SettingsController extends Controller {
* *
* @return type * @return type
*/ */
public function ReadPlugins() { public function ReadPlugins()
{
$dir = app_path().DIRECTORY_SEPARATOR.'Plugins'; $dir = app_path().DIRECTORY_SEPARATOR.'Plugins';
$plugins = array_diff(scandir($dir), ['.', '..']); $plugins = array_diff(scandir($dir), ['.', '..']);
@@ -344,7 +359,8 @@ class SettingsController extends Controller {
* *
* @return type * @return type
*/ */
public function PostPlugins(Request $request) { public function PostPlugins(Request $request)
{
$this->validate($request, ['plugin' => 'required|mimes:application/zip,zip,Zip']); $this->validate($request, ['plugin' => 'required|mimes:application/zip,zip,Zip']);
try { try {
if (!extension_loaded('zip')) { if (!extension_loaded('zip')) {
@@ -433,7 +449,8 @@ class SettingsController extends Controller {
* *
* @return bool * @return bool
*/ */
public function deleteDirectory($dir) { public function deleteDirectory($dir)
{
if (!file_exists($dir)) { if (!file_exists($dir)) {
return true; return true;
} }
@@ -454,7 +471,8 @@ class SettingsController extends Controller {
return rmdir($dir); return rmdir($dir);
} }
public function ReadConfigs() { public function ReadConfigs()
{
$dir = app_path().DIRECTORY_SEPARATOR.'Plugins'.DIRECTORY_SEPARATOR; $dir = app_path().DIRECTORY_SEPARATOR.'Plugins'.DIRECTORY_SEPARATOR;
$directories = scandir($dir); $directories = scandir($dir);
$files = []; $files = [];
@@ -495,7 +513,8 @@ class SettingsController extends Controller {
} }
} }
public function fetchConfig() { public function fetchConfig()
{
$configs = $this->ReadConfigs(); $configs = $this->ReadConfigs();
//dd($configs); //dd($configs);
$plugs = new Plugin(); $plugs = new Plugin();
@@ -531,7 +550,8 @@ class SettingsController extends Controller {
return $attributes; return $attributes;
} }
public function DeletePlugin($slug) { public function DeletePlugin($slug)
{
$dir = app_path().DIRECTORY_SEPARATOR.'Plugins'.DIRECTORY_SEPARATOR.$slug; $dir = app_path().DIRECTORY_SEPARATOR.'Plugins'.DIRECTORY_SEPARATOR.$slug;
$this->deleteDirectory($dir); $this->deleteDirectory($dir);
/* /*
@@ -551,7 +571,8 @@ class SettingsController extends Controller {
return redirect()->back()->with('success', 'Deleted Successfully'); return redirect()->back()->with('success', 'Deleted Successfully');
} }
public function StatusPlugin($slug) { public function StatusPlugin($slug)
{
$plugs = new Plugin(); $plugs = new Plugin();
$plug = $plugs->where('name', $slug)->first(); $plug = $plugs->where('name', $slug)->first();
if (!$plug) { if (!$plug) {

View File

@@ -3,7 +3,6 @@
namespace App\Http\Controllers; namespace App\Http\Controllers;
use App\Model\helpdesk\Ticket\Tickets; use App\Model\helpdesk\Ticket\Tickets;
use App\Http\Controllers\Controller;
class HomeController extends Controller class HomeController extends Controller
{ {

View File

@@ -9,16 +9,18 @@ use Artisan;
use Exception; use Exception;
use Illuminate\Http\Request; use Illuminate\Http\Request;
class UpgradeController extends Controller { class UpgradeController extends Controller
{
public $dir; public $dir;
public function __construct() { public function __construct()
{
$dir = base_path(); $dir = base_path();
$this->dir = $dir; $this->dir = $dir;
} }
public function getLatestVersion() { public function getLatestVersion()
{
try { try {
$name = \Config::get('app.name'); $name = \Config::get('app.name');
//dd($name); //dd($name);
@@ -38,7 +40,7 @@ class UpgradeController extends Controller {
$data = Utility::encryptByFaveoPublicKey(json_encode($data)); $data = Utility::encryptByFaveoPublicKey(json_encode($data));
//dd($data); //dd($data);
$post_data = [ $post_data = [
'data' => $data 'data' => $data,
]; ];
$url = 'http://faveohelpdesk.com/billing/public/verification'; $url = 'http://faveohelpdesk.com/billing/public/verification';
if (str_contains($url, ' ')) { if (str_contains($url, ' ')) {
@@ -59,7 +61,8 @@ class UpgradeController extends Controller {
} }
} }
public function downloadLatestCode() { public function downloadLatestCode()
{
$name = \Config::get('app.name'); $name = \Config::get('app.name');
$durl = 'http://www.faveohelpdesk.com/billing/public/download-url'; $durl = 'http://www.faveohelpdesk.com/billing/public/download-url';
if (str_contains($durl, ' ')) { if (str_contains($durl, ' ')) {
@@ -75,7 +78,8 @@ class UpgradeController extends Controller {
return $download_url; return $download_url;
} }
public function saveLatestCodeAtTemp($download_url) { public function saveLatestCodeAtTemp($download_url)
{
echo '<p>Downloading New Update</p>'; echo '<p>Downloading New Update</p>';
$context = stream_context_create( $context = stream_context_create(
[ [
@@ -99,19 +103,22 @@ class UpgradeController extends Controller {
echo '<p>Update Downloaded And Saved</p>'; echo '<p>Update Downloaded And Saved</p>';
} }
public function doUpdate() { public function doUpdate()
{
try { try {
$memory_limit = ini_get('memory_limit'); $memory_limit = ini_get('memory_limit');
if ($memory_limit < 256) { if ($memory_limit < 256) {
echo '<ul class=list-unstyled>'; echo '<ul class=list-unstyled>';
echo "<li style='color:red;'>Sorry we can not process your request because of limited memory! You have only $memory_limit. For this you need atleast 256 MB</li>"; echo "<li style='color:red;'>Sorry we can not process your request because of limited memory! You have only $memory_limit. For this you need atleast 256 MB</li>";
echo '</ul>'; echo '</ul>';
return 0; return 0;
} }
if (!extension_loaded('zip')) { if (!extension_loaded('zip')) {
echo '<ul class=list-unstyled>'; echo '<ul class=list-unstyled>';
echo "<li style='color:red;'>Sorry we can not process your request because you don't have ZIP extension contact your system admin</li>"; echo "<li style='color:red;'>Sorry we can not process your request because you don't have ZIP extension contact your system admin</li>";
echo '</ul>'; echo '</ul>';
return 0; return 0;
} }
//Artisan::call('down'); //Artisan::call('down');
@@ -166,12 +173,13 @@ class UpgradeController extends Controller {
return true; return true;
} catch (Exception $ex) { } catch (Exception $ex) {
echo '<ul class=list-unstyled>'; echo '<ul class=list-unstyled>';
echo "<li style='color:red;'>" . $ex->getMessage() . "</li>"; echo "<li style='color:red;'>".$ex->getMessage().'</li>';
echo '</ul>'; echo '</ul>';
} }
} }
public function copyToActualDirectory($latest_version) { public function copyToActualDirectory($latest_version)
{
try { try {
echo '<ul class=list-unstyled>'; echo '<ul class=list-unstyled>';
$directory = "$this->dir/UPDATES"; $directory = "$this->dir/UPDATES";
@@ -190,17 +198,18 @@ class UpgradeController extends Controller {
$this->deleteBarNotification('new-version'); $this->deleteBarNotification('new-version');
echo "<li style='color:green;'>&raquo; Faveo Updated to v" . Utility::getFileVersion() . "</li>"; echo "<li style='color:green;'>&raquo; Faveo Updated to v".Utility::getFileVersion().'</li>';
echo '</ul>'; echo '</ul>';
} catch (Exception $ex) { } catch (Exception $ex) {
echo '<ul class=list-unstyled>'; echo '<ul class=list-unstyled>';
echo "<li style='color:red;'>" . $ex->getMessage() . "</li>"; echo "<li style='color:red;'>".$ex->getMessage().'</li>';
echo '</ul>'; echo '</ul>';
} }
exit(); exit();
} }
public function deleteBarNotification($key) { public function deleteBarNotification($key)
{
try { try {
$noti = new BarNotification(); $noti = new BarNotification();
$notifications = $noti->where('key', $key)->get(); $notifications = $noti->where('key', $key)->get();
@@ -212,20 +221,24 @@ class UpgradeController extends Controller {
} }
} }
public function fileUpdate() { public function fileUpdate()
{
try { try {
$latest_version = $this->getLatestVersion(); $latest_version = $this->getLatestVersion();
if (Utility::getFileVersion() < $latest_version) { if (Utility::getFileVersion() < $latest_version) {
$url = url('file-upgrade'); $url = url('file-upgrade');
return view('themes.default1.update.file', compact('url')); return view('themes.default1.update.file', compact('url'));
} }
return redirect('dashboard')->with('fails', 'Could not find latest realeases from repository.'); return redirect('dashboard')->with('fails', 'Could not find latest realeases from repository.');
} catch (Exception $ex) { } catch (Exception $ex) {
return redirect()->back()->with('fails', $ex->getMessage()); return redirect()->back()->with('fails', $ex->getMessage());
} }
} }
public function fileUpgrading(Request $request) { public function fileUpgrading(Request $request)
{
try { try {
// //
$latest_version = $this->getLatestVersion(); $latest_version = $this->getLatestVersion();
@@ -233,10 +246,10 @@ class UpgradeController extends Controller {
$current_version = Utility::getFileVersion(); $current_version = Utility::getFileVersion();
if ($latest_version != '') { if ($latest_version != '') {
if (Utility::getFileVersion() < $latest_version) { if (Utility::getFileVersion() < $latest_version) {
return view('themes.default1.update.update', compact('latest_version', 'current_version', 'request')); return view('themes.default1.update.update', compact('latest_version', 'current_version', 'request'));
} }
} }
return redirect('dashboard')->with('fails', 'Could not find latest realeases from repository.'); return redirect('dashboard')->with('fails', 'Could not find latest realeases from repository.');
@@ -248,7 +261,8 @@ class UpgradeController extends Controller {
} }
} }
public function testScroll() { public function testScroll()
{
$ex = 1000; $ex = 1000;
echo '<ul style=list-unstyled>'; echo '<ul style=list-unstyled>';
for ($i = 0; $i < $ex; $i++) { for ($i = 0; $i < $ex; $i++) {
@@ -257,7 +271,8 @@ class UpgradeController extends Controller {
echo '</ul>'; echo '</ul>';
} }
public function fileUpgrading1(Request $request) { public function fileUpgrading1(Request $request)
{
if (Utility::getFileVersion() < Utility::getDatabaseVersion()) { if (Utility::getFileVersion() < Utility::getDatabaseVersion()) {
$latest_version = $this->getLatestVersion(); $latest_version = $this->getLatestVersion();
// dd($latest_version); // dd($latest_version);
@@ -307,11 +322,12 @@ class UpgradeController extends Controller {
} }
} }
public function getCurl($url) { public function getCurl($url)
{
try { try {
$curl = Utility::_isCurl(); $curl = Utility::_isCurl();
if (!$curl) { if (!$curl) {
throw new Exception("Please enable your curl function to check latest update"); throw new Exception('Please enable your curl function to check latest update');
} }
$ch = curl_init(); $ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
@@ -328,11 +344,12 @@ class UpgradeController extends Controller {
} }
} }
public function postDownloadCurl($url, $data) { public function postDownloadCurl($url, $data)
{
try { try {
$curl = Utility::_isCurl(); $curl = Utility::_isCurl();
if (!$curl) { if (!$curl) {
throw new Exception("Please enable your curl function to check latest update"); throw new Exception('Please enable your curl function to check latest update');
} }
$ch = curl_init(); $ch = curl_init();
curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POST, 1);
@@ -344,17 +361,19 @@ class UpgradeController extends Controller {
} }
$data = curl_exec($ch); $data = curl_exec($ch);
curl_close($ch); curl_close($ch);
return json_decode($data, true); return json_decode($data, true);
} catch (Exception $ex) { } catch (Exception $ex) {
return redirect()->back()->with('fails', $ex->getMessage()); return redirect()->back()->with('fails', $ex->getMessage());
} }
} }
public function postCurl($url, $data) { public function postCurl($url, $data)
{
try { try {
$curl = Utility::_isCurl(); $curl = Utility::_isCurl();
if (!$curl) { if (!$curl) {
throw new Exception("Please enable your curl function to check latest update"); throw new Exception('Please enable your curl function to check latest update');
} }
$ch = curl_init(); $ch = curl_init();
curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POST, 1);
@@ -367,13 +386,15 @@ class UpgradeController extends Controller {
$data = curl_exec($ch); $data = curl_exec($ch);
curl_close($ch); curl_close($ch);
$data = Utility::decryptByFaveoPrivateKey($data); $data = Utility::decryptByFaveoPrivateKey($data);
return json_decode($data, true); return json_decode($data, true);
} catch (Exception $ex) { } catch (Exception $ex) {
return redirect()->back()->with('fails', $ex->getMessage()); return redirect()->back()->with('fails', $ex->getMessage());
} }
} }
public function databaseUpdate() { public function databaseUpdate()
{
try { try {
if (Utility::getFileVersion() > Utility::getDatabaseVersion()) { if (Utility::getFileVersion() > Utility::getDatabaseVersion()) {
$url = url('database-upgrade'); $url = url('database-upgrade');
@@ -387,7 +408,8 @@ class UpgradeController extends Controller {
} }
} }
public function databaseUpgrade() { public function databaseUpgrade()
{
try { try {
if (Utility::getFileVersion() > Utility::getDatabaseVersion()) { if (Utility::getFileVersion() > Utility::getDatabaseVersion()) {
Artisan::call('migrate', ['--force' => true]); Artisan::call('migrate', ['--force' => true]);
@@ -400,5 +422,4 @@ class UpgradeController extends Controller {
return redirect()->back()->with('fails', $ex->getMessage()); return redirect()->back()->with('fails', $ex->getMessage());
} }
} }
} }

View File

@@ -7,9 +7,10 @@ use Config;
use Exception; use Exception;
use Schema; use Schema;
class LibraryController extends Controller { class LibraryController extends Controller
{
public static function getFileVersion() { public static function getFileVersion()
{
try { try {
$app = Config::get('app.version'); $app = Config::get('app.version');
if ($app) { if ($app) {
@@ -22,7 +23,8 @@ class LibraryController extends Controller {
} }
} }
public static function getDatabaseVersion() { public static function getDatabaseVersion()
{
try { try {
$database = self::isDatabaseSetup(); $database = self::isDatabaseSetup();
if ($database == true) { if ($database == true) {
@@ -39,7 +41,8 @@ class LibraryController extends Controller {
} }
} }
public static function isDatabaseSetup() { public static function isDatabaseSetup()
{
try { try {
if (Schema::hasTable('settings_system')) { if (Schema::hasTable('settings_system')) {
return true; return true;
@@ -49,28 +52,30 @@ class LibraryController extends Controller {
} }
} }
public static function encryptByFaveoPublicKey($data) { public static function encryptByFaveoPublicKey($data)
{
try { try {
$path = storage_path().DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'public.key'; $path = storage_path().DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'public.key';
//dd($path); //dd($path);
$key_content = file_get_contents($path); $key_content = file_get_contents($path);
$public_key = openssl_get_publickey($key_content); $public_key = openssl_get_publickey($key_content);
$encrypted = $e = NULL; $encrypted = $e = null;
openssl_seal($data, $encrypted, $e, array($public_key)); openssl_seal($data, $encrypted, $e, [$public_key]);
$sealed_data = base64_encode($encrypted); $sealed_data = base64_encode($encrypted);
$envelope = base64_encode($e[0]); $envelope = base64_encode($e[0]);
$result = ['seal' => $sealed_data, 'envelope' => $envelope]; $result = ['seal' => $sealed_data, 'envelope' => $envelope];
return json_encode($result); return json_encode($result);
} catch (Exception $ex) { } catch (Exception $ex) {
throw new Exception($ex->getMessage()); throw new Exception($ex->getMessage());
} }
} }
public static function decryptByFaveoPrivateKey($encrypted) { public static function decryptByFaveoPrivateKey($encrypted)
{
try { try {
$encrypted = json_decode($encrypted); $encrypted = json_decode($encrypted);
$sealed_data = $encrypted->seal; $sealed_data = $encrypted->seal;
@@ -80,16 +85,17 @@ class LibraryController extends Controller {
$path = storage_path('app'.DIRECTORY_SEPARATOR.'private.key'); $path = storage_path('app'.DIRECTORY_SEPARATOR.'private.key');
$key_content = file_get_contents($path); $key_content = file_get_contents($path);
$private_key = openssl_get_privatekey($key_content); $private_key = openssl_get_privatekey($key_content);
$plaintext = NULL; $plaintext = null;
openssl_open($input, $plaintext, $einput, $private_key); openssl_open($input, $plaintext, $einput, $private_key);
return $plaintext; return $plaintext;
} catch (Exception $ex) { } catch (Exception $ex) {
// dd($ex); // dd($ex);
} }
} }
public static function _isCurl() { public static function _isCurl()
{
return function_exists('curl_version'); return function_exists('curl_version');
} }
} }

View File

@@ -3,6 +3,7 @@
namespace App\Http\Requests\helpdesk; namespace App\Http\Requests\helpdesk;
use App\Http\Requests\Request; use App\Http\Requests\Request;
//use Illuminate\Http\Request as Req; //use Illuminate\Http\Request as Req;
/** /**
* Sys_userUpdate. * Sys_userUpdate.

View File

@@ -9,14 +9,15 @@ use App\Http\Requests\Request;
* *
* @author Ladybird <info@ladybirdweb.com> * @author Ladybird <info@ladybirdweb.com>
*/ */
class TicketRequest extends Request { class TicketRequest extends Request
{
/** /**
* Determine if the user is authorized to make this request. * Determine if the user is authorized to make this request.
* *
* @return bool * @return bool
*/ */
public function authorize() { public function authorize()
{
return true; return true;
} }
@@ -25,12 +26,13 @@ class TicketRequest extends Request {
* *
* @return array * @return array
*/ */
public function rules() { public function rules()
$error = ""; {
$error = '';
try { try {
$size = $this->size(); $size = $this->size();
if ($size > 800 || $size == 0) { if ($size > 800 || $size == 0) {
throw new \Exception("File size exceeded", 422); throw new \Exception('File size exceeded', 422);
} }
} catch (\Exception $ex) { } catch (\Exception $ex) {
dd($ex); dd($ex);
@@ -41,10 +43,11 @@ class TicketRequest extends Request {
// ]; // ];
} }
public function size() { public function size()
{
$files = $this->file('attachment'); $files = $this->file('attachment');
if (!$files) { if (!$files) {
throw new \Exception("exceeded", 422); throw new \Exception('exceeded', 422);
} }
$size = 0; $size = 0;
if (count($files) > 0) { if (count($files) > 0) {
@@ -52,12 +55,13 @@ class TicketRequest extends Request {
$size += $file->getSize(); $size += $file->getSize();
} }
} }
return $size; return $size;
} }
public function error($e) { public function error($e)
{
if ($this->ajax() || $this->wantsJson()) { if ($this->ajax() || $this->wantsJson()) {
$message = $e->getMessage(); $message = $e->getMessage();
if (is_object($message)) { if (is_object($message)) {
$message = $message->toArray(); $message = $message->toArray();
@@ -66,5 +70,4 @@ class TicketRequest extends Request {
return $message; return $message;
} }
} }
} }

View File

@@ -24,6 +24,7 @@ class CategoryRequest extends Request
public function rules() public function rules()
{ {
$id = $this->segment(2); $id = $this->segment(2);
return [ return [
'name' => 'required|max:250|unique:kb_category,name,'.$id, 'name' => 'required|max:250|unique:kb_category,name,'.$id,
'description' => 'required', 'description' => 'required',

View File

@@ -24,8 +24,9 @@ class PageRequest extends Request
public function rules() public function rules()
{ {
$slug = $this->segment(2); $slug = $this->segment(2);
return [ return [
'name' => 'required|unique:kb_pages,slug,'.$slug 'name' => 'required|unique:kb_pages,slug,'.$slug,
]; ];
} }
} }

View File

@@ -1114,5 +1114,4 @@ Route::group(['middleware' => ['web']], function () {
Route::get('test', ['as' => 'test', 'uses' => 'Common\PushNotificationController@response']); Route::get('test', ['as' => 'test', 'uses' => 'Common\PushNotificationController@response']);
}); });

View File

@@ -2,11 +2,10 @@
namespace App\Jobs; namespace App\Jobs;
use App\Jobs\Job;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use App\Http\Controllers\Common\PhpMailController; use App\Http\Controllers\Common\PhpMailController;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
class SendEmail extends Job implements ShouldQueue class SendEmail extends Job implements ShouldQueue
{ {
@@ -16,6 +15,7 @@ class SendEmail extends Job implements ShouldQueue
protected $from; protected $from;
protected $to; protected $to;
protected $message; protected $message;
/** /**
* Create a new job instance. * Create a new job instance.
* *

View File

@@ -6,8 +6,6 @@ use Illuminate\Database\Eloquent\Model;
class FieldValue extends Model class FieldValue extends Model
{ {
protected $table = "field_values"; protected $table = 'field_values';
protected $fillable = ['field_id', 'parent_id', 'field_key', 'field_value']; protected $fillable = ['field_id', 'parent_id', 'field_key', 'field_value'];
} }

View File

@@ -4,8 +4,8 @@ namespace App\Model\helpdesk\Form;
use App\BaseModel; use App\BaseModel;
class Fields extends BaseModel { class Fields extends BaseModel
{
protected $table = 'custom_form_fields'; protected $table = 'custom_form_fields';
/** /**
@@ -15,17 +15,22 @@ class Fields extends BaseModel {
*/ */
protected $fillable = ['forms_id', 'label', 'name', 'type', 'value', 'required']; protected $fillable = ['forms_id', 'label', 'name', 'type', 'value', 'required'];
public function valueRelation() { public function valueRelation()
{
$related = "App\Model\helpdesk\Form\FieldValue"; $related = "App\Model\helpdesk\Form\FieldValue";
return $this->hasMany($related, 'field_id'); return $this->hasMany($related, 'field_id');
} }
public function values() { public function values()
{
$value = $this->valueRelation(); $value = $this->valueRelation();
return $value; return $value;
} }
public function deleteValues() { public function deleteValues()
{
$values = $this->values()->get(); $values = $this->values()->get();
if ($values->count() > 0) { if ($values->count() > 0) {
foreach ($values as $value) { foreach ($values as $value) {
@@ -34,9 +39,8 @@ class Fields extends BaseModel {
} }
} }
public function delete() { public function delete()
{
parent::delete(); parent::delete();
} }
} }

View File

@@ -15,18 +15,22 @@ class Forms extends BaseModel
*/ */
protected $fillable = ['formname']; protected $fillable = ['formname'];
public function fieldRelation()
public function fieldRelation(){ {
$related = "App\Model\helpdesk\Form\Fields"; $related = "App\Model\helpdesk\Form\Fields";
return $this->hasMany($related); return $this->hasMany($related);
} }
public function fields(){ public function fields()
{
$relation = $this->fieldRelation()->get(); $relation = $this->fieldRelation()->get();
return $relation; return $relation;
} }
public function fieldsDelete(){ public function fieldsDelete()
{
$fields = $this->fields(); $fields = $this->fields();
if ($fields->count() > 0) { if ($fields->count() > 0) {
foreach ($fields as $field) { foreach ($fields as $field) {
@@ -35,29 +39,34 @@ class Forms extends BaseModel
} }
} }
public function formValueRelation(){ public function formValueRelation()
{
$related = "App\Model\helpdesk\Form\FieldValue"; $related = "App\Model\helpdesk\Form\FieldValue";
return $this->hasMany($related, 'child_id'); return $this->hasMany($related, 'child_id');
} }
public function formValueChild(){ public function formValueChild()
{
$childs = $this->formValueRelation()->get(); $childs = $this->formValueRelation()->get();
return $childs; return $childs;
} }
public function deleteFormChild(){ public function deleteFormChild()
{
$childs = $this->formValueChild(); $childs = $this->formValueChild();
if ($childs->count() > 0) { if ($childs->count() > 0) {
foreach ($childs as $child) { foreach ($childs as $child) {
$child->child_id = NULL; $child->child_id = null;
$child->save(); $child->save();
} }
} }
} }
public function delete() { public function delete()
{
$this->fieldsDelete(); $this->fieldsDelete();
parent::delete(); parent::delete();
} }
} }

View File

@@ -28,7 +28,7 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
protected $fillable = ['user_name', 'email', 'password', 'active', 'first_name', 'last_name', 'ban', 'ext', 'mobile', 'profile_pic', protected $fillable = ['user_name', 'email', 'password', 'active', 'first_name', 'last_name', 'ban', 'ext', 'mobile', 'profile_pic',
'phone_number', 'company', 'agent_sign', 'account_type', 'account_status', 'phone_number', 'company', 'agent_sign', 'account_type', 'account_status',
'assign_group', 'primary_dpt', 'agent_tzone', 'daylight_save', 'limit_access', 'assign_group', 'primary_dpt', 'agent_tzone', 'daylight_save', 'limit_access',
'directory_listing', 'vacation_mode', 'role', 'internal_note', 'country_code','fcm_token' ]; 'directory_listing', 'vacation_mode', 'role', 'internal_note', 'country_code', 'fcm_token', ];
/** /**
* The attributes excluded from the model's JSON form. * The attributes excluded from the model's JSON form.

View File

@@ -1,6 +1,6 @@
<?php <?php
return array( return [
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@@ -26,13 +26,13 @@ return array(
| can also be used. For PDO, run the package migrations first. | can also be used. For PDO, run the package migrations first.
| |
*/ */
'storage' => array( 'storage' => [
'enabled' => true, 'enabled' => true,
'driver' => 'file', // redis, file, pdo, custom 'driver' => 'file', // redis, file, pdo, custom
'path' => storage_path('debugbar'), // For file driver 'path' => storage_path('debugbar'), // For file driver
'connection' => null, // Leave null for default connection (Redis/PDO) 'connection' => null, // Leave null for default connection (Redis/PDO)
'provider' => '' // Instance of StorageInterface for custom driver 'provider' => '', // Instance of StorageInterface for custom driver
), ],
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@@ -82,7 +82,7 @@ return array(
| |
*/ */
'collectors' => array( 'collectors' => [
'phpinfo' => true, // Php version 'phpinfo' => true, // Php version
'messages' => true, // Messages 'messages' => true, // Messages
'time' => true, // Time Datalogger 'time' => true, // Time Datalogger
@@ -103,7 +103,7 @@ return array(
'auth' => false, // Display Laravel authentication status 'auth' => false, // Display Laravel authentication status
'gate' => false, // Display Laravel Gate checks 'gate' => false, // Display Laravel Gate checks
'session' => true, // Display session data 'session' => true, // Display session data
), ],
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@@ -114,33 +114,33 @@ return array(
| |
*/ */
'options' => array( 'options' => [
'auth' => array( 'auth' => [
'show_name' => false, // Also show the users name/email in the debugbar 'show_name' => false, // Also show the users name/email in the debugbar
), ],
'db' => array( 'db' => [
'with_params' => true, // Render SQL with the parameters substituted 'with_params' => true, // Render SQL with the parameters substituted
'timeline' => false, // Add the queries to the timeline 'timeline' => false, // Add the queries to the timeline
'backtrace' => false, // EXPERIMENTAL: Use a backtrace to find the origin of the query in your files. 'backtrace' => false, // EXPERIMENTAL: Use a backtrace to find the origin of the query in your files.
'explain' => array( // EXPERIMENTAL: Show EXPLAIN output on queries 'explain' => [ // EXPERIMENTAL: Show EXPLAIN output on queries
'enabled' => false, 'enabled' => false,
'types' => array('SELECT'), // array('SELECT', 'INSERT', 'UPDATE', 'DELETE'); for MySQL 5.6.3+ 'types' => ['SELECT'], // array('SELECT', 'INSERT', 'UPDATE', 'DELETE'); for MySQL 5.6.3+
), ],
'hints' => true, // Show hints for common mistakes 'hints' => true, // Show hints for common mistakes
), ],
'mail' => array( 'mail' => [
'full_log' => false 'full_log' => false,
), ],
'views' => array( 'views' => [
'data' => false, //Note: Can slow down the application, because the data can be quite large.. 'data' => false, //Note: Can slow down the application, because the data can be quite large..
), ],
'route' => array( 'route' => [
'label' => true // show complete route on bar 'label' => true, // show complete route on bar
), ],
'logs' => array( 'logs' => [
'file' => null 'file' => null,
), ],
), ],
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@@ -167,4 +167,4 @@ return array(
*/ */
'route_prefix' => '_debugbar', 'route_prefix' => '_debugbar',
); ];

View File

@@ -10,5 +10,5 @@ return [
'server_send_url' => 'https://fcm.googleapis.com/fcm/send', 'server_send_url' => 'https://fcm.googleapis.com/fcm/send',
'server_group_url' => 'https://android.googleapis.com/gcm/notification', 'server_group_url' => 'https://android.googleapis.com/gcm/notification',
'timeout' => 30.0, // in second 'timeout' => 30.0, // in second
] ],
]; ];

View File

@@ -1,6 +1,5 @@
<?php <?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Migrations\Migration;
class Version1079table extends Migration class Version1079table extends Migration
@@ -24,7 +23,5 @@ class Version1079table extends Migration
['option_name' => 'user_set_ticket_status', 'status' => 1] ['option_name' => 'user_set_ticket_status', 'status' => 1]
); );
} }
} }
} }

View File

@@ -26,6 +26,7 @@ use App\Model\helpdesk\Utility\CountryCode;
use App\Model\helpdesk\Utility\Date_format; use App\Model\helpdesk\Utility\Date_format;
use App\Model\helpdesk\Utility\Date_time_format; use App\Model\helpdesk\Utility\Date_time_format;
use App\Model\helpdesk\Utility\Languages; use App\Model\helpdesk\Utility\Languages;
use App\Model\helpdesk\Utility\Limit_Login;
use App\Model\helpdesk\Utility\Log_notification; use App\Model\helpdesk\Utility\Log_notification;
use App\Model\helpdesk\Utility\MailboxProtocol; use App\Model\helpdesk\Utility\MailboxProtocol;
use App\Model\helpdesk\Utility\Time_format; use App\Model\helpdesk\Utility\Time_format;
@@ -33,7 +34,6 @@ use App\Model\helpdesk\Utility\Timezones;
use App\Model\helpdesk\Utility\Version_Check; use App\Model\helpdesk\Utility\Version_Check;
use App\Model\helpdesk\Workflow\WorkflowClose; use App\Model\helpdesk\Workflow\WorkflowClose;
use App\Model\kb\Settings; use App\Model\kb\Settings;
use App\Model\helpdesk\Utility\Limit_Login;
use App\Model\Update\BarNotification; use App\Model\Update\BarNotification;
// Knowledge base // Knowledge base
use Illuminate\Database\Seeder; use Illuminate\Database\Seeder;

View File

@@ -35,13 +35,10 @@ if (!empty($_POST)) {
$value = htmlspecialchars(stripslashes((string) $value)); $value = htmlspecialchars(stripslashes((string) $value));
} else { } else {
$value = htmlspecialchars((string) $value); $value = htmlspecialchars((string) $value);
} } ?>
?>
<tr> <tr>
<th style="vertical-align: top"><?php echo htmlspecialchars((string) $key); <th style="vertical-align: top"><?php echo htmlspecialchars((string) $key); ?></th>
?></th> <td><pre class="samples"><?php echo $value; ?></pre></td>
<td><pre class="samples"><?php echo $value;
?></pre></td>
</tr> </tr>
<?php <?php

View File

@@ -1007,7 +1007,7 @@ return [
'organization_profile' => 'Organization Profile', 'organization_profile' => 'Organization Profile',
'organization-s_head' => "Organization's Head", 'organization-s_head' => "Organization's Head",
'select_department_manager' => 'Select Department Manager', 'select_department_manager' => 'Select Department Manager',
'select_organization_manager' => "Select Organization Manager", 'select_organization_manager' => 'Select Organization Manager',
'users_of' => 'Users of', 'users_of' => 'Users of',
'organization_created_successfully' => 'Organization Created Successfully', 'organization_created_successfully' => 'Organization Created Successfully',
'organization_can_not_create' => 'Organization can not Create', 'organization_can_not_create' => 'Organization can not Create',