Applied fixes from StyleCI

This commit is contained in:
Sujit Prasad
2016-06-15 00:52:21 -04:00
committed by StyleCI Bot
parent b158c8e1ee
commit a6a7c762dc
41 changed files with 1456 additions and 1297 deletions

View File

@@ -3,20 +3,19 @@
namespace App\Exceptions;
// controller
use Exception;
use Bugsnag;
//use Illuminate\Validation\ValidationException;
use Illuminate\Foundation\Validation\ValidationException;
use Bugsnag\BugsnagLaravel\BugsnagExceptionHandler as ExceptionHandler;
use Exception;
use Illuminate\Auth\Access\AuthorizationException;
use Illuminate\Database\Eloquent\ModelNotFoundException;
// use Symfony\Component\HttpKernel\Exception\HttpException;
// use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Bugsnag\BugsnagLaravel\BugsnagExceptionHandler as ExceptionHandler;
use Bugsnag;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Illuminate\Foundation\Validation\ValidationException;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
class Handler extends ExceptionHandler {
class Handler extends ExceptionHandler
{
/**
* A list of the exception types that should not be reported.
*
@@ -53,7 +52,8 @@ class Handler extends ExceptionHandler {
*
* @return void
*/
public function report(Exception $e) {
public function report(Exception $e)
{
$debug = \Config::get('app.bugsnag_reporting');
$debug = ($debug) ? 'true' : 'false';
if ($debug == 'false') {
@@ -61,6 +61,7 @@ class Handler extends ExceptionHandler {
return false;
});
}
return parent::report($e);
}
@@ -128,12 +129,14 @@ class Handler extends ExceptionHandler {
/**
* Render an exception into an HTTP response.
*
* @param type $request
* @param Exception $e
*
* @return type mixed
*/
public function render($request, Exception $e) {
public function render($request, Exception $e)
{
switch ($e) {
case $e instanceof \Illuminate\Http\Exception\HttpResponseException:
return parent::render($request, $e);
@@ -147,38 +150,49 @@ class Handler extends ExceptionHandler {
}
/**
* Function to render 500 error page
* Function to render 500 error page.
*
* @param type $request
* @param type $e
*
* @return type mixed
*/
public function render500($request, $e) {
public function render500($request, $e)
{
if (config('app.debug') == true) {
return parent::render($request, $e);
}
return redirect()->route('error500', []);
}
/**
* Function to render 404 error page
* Function to render 404 error page.
*
* @param type $request
* @param type $e
*
* @return type mixed
*/
public function render404($request, $e) {
public function render404($request, $e)
{
if (config('app.debug') == true) {
return parent::render($request, $e);
}
return redirect()->route('error404', []);
}
/**
* Common finction to render both types of codes
* Common finction to render both types of codes.
*
* @param type $request
* @param type $e
*
* @return type mixed
*/
public function common($request, $e) {
public function common($request, $e)
{
switch ($e) {
case $e instanceof HttpException:
return $this->render404($request, $e);
@@ -187,7 +201,7 @@ class Handler extends ExceptionHandler {
default:
return $this->render500($request, $e);
}
return parent::render($request, $e);
}
}

View File

@@ -175,7 +175,6 @@ class DepartmentController extends Controller
{
// dd($id);
try {
$table = $group_assign_department->where('department_id', $id);
$table->delete();
$requests = $request->input('group_id');

View File

@@ -28,14 +28,15 @@ use Lang;
*
* @author Ladybird <info@ladybirdweb.com>
*/
class EmailsController extends Controller {
class EmailsController extends Controller
{
/**
* Defining constructor variables.
*
* @return type
*/
public function __construct() {
public function __construct()
{
$this->middleware('auth');
$this->middleware('roles');
}
@@ -47,7 +48,8 @@ class EmailsController extends Controller {
*
* @return type view
*/
public function index(Emails $email) {
public function index(Emails $email)
{
try {
// fetch all the emails from emails table
$emails = $email->get();
@@ -68,7 +70,8 @@ class EmailsController extends Controller {
*
* @return type Response
*/
public function create(Department $department, Help_topic $help, Ticket_Priority $ticket_priority, MailboxProtocol $mailbox_protocol) {
public function create(Department $department, Help_topic $help, Ticket_Priority $ticket_priority, MailboxProtocol $mailbox_protocol)
{
try {
// fetch all the departments from the department table
$departments = $department->get();
@@ -93,7 +96,8 @@ class EmailsController extends Controller {
*
* @return int
*/
public function validatingEmailSettings(Request $request) {
public function validatingEmailSettings(Request $request)
{
$validator = \Validator::make(
[
'email_address' => $request->input('email_address'),
@@ -173,7 +177,8 @@ class EmailsController extends Controller {
*
* @return type Redirect
*/
public function store($request, $imap_check) {
public function store($request, $imap_check)
{
$email = new Emails();
try {
// saving all the fields to the database
@@ -255,7 +260,8 @@ class EmailsController extends Controller {
*
* @return type Response
*/
public function edit($id, Department $department, Help_topic $help, Emails $email, Ticket_Priority $ticket_priority, MailboxProtocol $mailbox_protocol) {
public function edit($id, Department $department, Help_topic $help, Emails $email, Ticket_Priority $ticket_priority, MailboxProtocol $mailbox_protocol)
{
try {
$sys_email = \DB::table('settings_email')->select('sys_email')->where('id', '=', 1)->first();
// dd($sys_email);
@@ -286,7 +292,8 @@ class EmailsController extends Controller {
*
* @return int
*/
public function validatingEmailSettingsUpdate($id, Request $request) {
public function validatingEmailSettingsUpdate($id, Request $request)
{
$validator = \Validator::make(
[
'email_address' => $request->input('email_address'),
@@ -368,7 +375,8 @@ class EmailsController extends Controller {
*
* @return type Response
*/
public function update($id, $request, $imap_check) {
public function update($id, $request, $imap_check)
{
try {
// fetch the selected emails
$emails = Emails::whereId($id)->first();
@@ -445,7 +453,8 @@ class EmailsController extends Controller {
*
* @return type Redirect
*/
public function destroy($id, Emails $email) {
public function destroy($id, Emails $email)
{
// fetching the details on the basis of the $id passed to the function
$default_system_email = Email::where('id', '=', '1')->first();
if ($default_system_email->sys_email) {
@@ -476,7 +485,8 @@ class EmailsController extends Controller {
*
* @return type int
*/
public function getImapStream($request, $validate) {
public function getImapStream($request, $validate)
{
$fetching_status = $request->input('fetching_status');
$username = $request->input('email_address');
$password = $request->input('password');
@@ -518,7 +528,8 @@ class EmailsController extends Controller {
*
* @return type int
*/
public function checkImapStream($imap_stream) {
public function checkImapStream($imap_stream)
{
$check_imap_stream = imap_check($imap_stream);
if ($check_imap_stream) {
$imap_stream = 1;
@@ -536,7 +547,8 @@ class EmailsController extends Controller {
*
* @return int
*/
public function getSmtp($request) {
public function getSmtp($request)
{
$sending_status = $request->input('sending_status');
// cheking for the sending protocol
if ($request->input('sending_protocol') == 'smtp') {
@@ -585,7 +597,8 @@ class EmailsController extends Controller {
*
* @return type string or null
*/
public function departmentValue($dept) {
public function departmentValue($dept)
{
if ($dept) {
$email_department = $dept;
} else {
@@ -602,7 +615,8 @@ class EmailsController extends Controller {
*
* @return type string or null
*/
public function priorityValue($priority) {
public function priorityValue($priority)
{
if ($priority) {
$email_priority = $priority;
} else {
@@ -619,7 +633,8 @@ class EmailsController extends Controller {
*
* @return type string or null
*/
public function helpTopicValue($help_topic) {
public function helpTopicValue($help_topic)
{
if ($help_topic) {
$email_help_topic = $help_topic;
} else {
@@ -628,5 +643,4 @@ class EmailsController extends Controller {
return $email_help_topic;
}
}

View File

@@ -3,16 +3,15 @@
namespace App\Http\Controllers\Admin\helpdesk;
// controller
use App\Http\Controllers\Common\PhpMailController;
use App\Http\Controllers\Controller;
// request
use Exception;
use Lang;
use File;
use Lang;
/**
* ErrorAndDebuggingController
* ErrorAndDebuggingController.
*
* @author Ladybird <info@ladybirdweb.com>
*/
@@ -31,20 +30,25 @@ class ErrorAndDebuggingController extends Controller
}
/**
* function to show error and debugging setting page
* function to show error and debugging setting page.
*
* @param void
*
* @return response
*/
public function showSettings()
{
$debug = \Config::get('app.debug');
$bugsnag = \Config::get('app.bugsnag_reporting');
return view('themes.default1.admin.helpdesk.settings.error-and-logs.error-debug')->with(['debug' => $debug, 'bugsnag' => $bugsnag]);
}
/**
* funtion to update error and debugging settings
* funtion to update error and debugging settings.
*
* @param void
*
* @return
*/
public function postSettings()
@@ -78,6 +82,7 @@ class ErrorAndDebuggingController extends Controller
"'bugsnag_reporting' => ".\Input::get('bugsnag'),
$datacontent2);
File::put($bugsnag_debug_new, $datacontent2);
return redirect()->back()->with('success',
Lang::get('lang.error-debug-settings-saved-message'));
} else {
@@ -91,8 +96,10 @@ class ErrorAndDebuggingController extends Controller
}
/**
* function to show error log table page
* function to show error log table page.
*
* @param void
*
* @return response view
*/
public function showErrorLogs()

View File

@@ -104,6 +104,7 @@ class SlaController extends Controller
$slas = Sla_plan::whereId($id)->first();
$slas->get();
$sla = \DB::table('settings_ticket')->select('sla')->where('id', '=', 1)->first();
return view('themes.default1.admin.helpdesk.manage.sla.edit', compact('slas', 'sla'));
} catch (Exception $e) {
return redirect()->back()->with('fails', $e->getMessage());
@@ -137,6 +138,7 @@ class SlaController extends Controller
->where('id', '=', 1)
->update(['sla' => $id]);
}
return redirect('sla')->with('success', Lang::get('lang.sla_plan_updated_successfully'));
} catch (Exception $e) {
/* redirect to Index page with Fails Message */

View File

@@ -24,14 +24,15 @@ use Lang;
*
* @author Ladybird <info@ladybirdweb.com>
*/
class TemplateController extends Controller {
class TemplateController extends Controller
{
/**
* Create a new controller instance.
*
* @return type void
*/
public function __construct(PhpMailController $PhpMailController) {
public function __construct(PhpMailController $PhpMailController)
{
$this->PhpMailController = $PhpMailController;
$this->middleware('auth');
$this->middleware('roles');
@@ -44,7 +45,8 @@ class TemplateController extends Controller {
*
* @return type Response
*/
public function index(Template $template) {
public function index(Template $template)
{
try {
$templates = $template->get();
@@ -62,7 +64,8 @@ class TemplateController extends Controller {
*
* @return type Response
*/
public function create(Languages $language, Template $template) {
public function create(Languages $language, Template $template)
{
try {
$templates = $template->get();
$languages = $language->get();
@@ -81,7 +84,8 @@ class TemplateController extends Controller {
*
* @return type Response
*/
public function store(Template $template, TemplateRequest $request) {
public function store(Template $template, TemplateRequest $request)
{
try {
/* Check whether function success or not */
if ($template->fill($request->input())->save() == true) {
@@ -104,7 +108,8 @@ class TemplateController extends Controller {
*
* @return Response
*/
public function show($id) {
public function show($id)
{
//
}
@@ -117,7 +122,8 @@ class TemplateController extends Controller {
*
* @return type Response
*/
public function listdirectories() {
public function listdirectories()
{
$path = \Config::get('view.paths')[0].'/emails/';
$directories = scandir($path);
$directory = str_replace('/', '-', $path);
@@ -125,7 +131,8 @@ class TemplateController extends Controller {
return view('themes.default1.admin.helpdesk.emails.template.listdirectories', compact('directories', 'directory'));
}
public function listtemplates($template, $path) {
public function listtemplates($template, $path)
{
$paths = str_replace('-', '/', $path);
$directory2 = $paths.$template;
@@ -135,7 +142,8 @@ class TemplateController extends Controller {
return view('themes.default1.admin.helpdesk.emails.template.listtemplates', compact('templates', 'directory'));
}
public function readtemplate($template, $path) {
public function readtemplate($template, $path)
{
$directory = str_replace('-', '/', $path);
$handle = fopen($directory.$template, 'r');
$contents = fread($handle, filesize($directory.$template));
@@ -144,7 +152,8 @@ class TemplateController extends Controller {
return view('themes.default1.admin.helpdesk.emails.template.readtemplates', compact('contents', 'template', 'path'));
}
public function createtemplate() {
public function createtemplate()
{
$directory = '../resources/views/emails/';
$fname = Input::get('folder_name');
$filename = $directory.$fname;
@@ -176,7 +185,8 @@ class TemplateController extends Controller {
return \Redirect::back()->with('success', 'Successfully copied');
}
public function writetemplate($template, $path) {
public function writetemplate($template, $path)
{
$directory = str_replace('-', '/', $path);
$b = Input::get('templatedata');
@@ -185,7 +195,8 @@ class TemplateController extends Controller {
return \Redirect::back()->with('success', 'Successfully updated');
}
public function deletetemplate($template, $path) {
public function deletetemplate($template, $path)
{
$directory = str_replace('-', '/', $path);
$dir = $directory.$template;
$status = \DB::table('settings_email')->first();
@@ -207,13 +218,15 @@ class TemplateController extends Controller {
return \Redirect::back()->with('success', 'Successfully Deleted');
}
public function activateset($setname) {
public function activateset($setname)
{
\DB::table('settings_email')->update(['template' => $setname]);
return \Redirect::back()->with('success', 'You have Successfully Activated this Set');
}
public function edit($id, Template $template, Languages $language) {
public function edit($id, Template $template, Languages $language)
{
try {
$templates = $template->whereId($id)->first();
$languages = $language->get();
@@ -233,7 +246,8 @@ class TemplateController extends Controller {
*
* @return type Response
*/
public function update($id, Template $template, TemplateUdate $request) {
public function update($id, Template $template, TemplateUdate $request)
{
try {
//TODO validation
$templates = $template->whereId($id)->first();
@@ -259,7 +273,8 @@ class TemplateController extends Controller {
*
* @return type Response
*/
public function destroy($id, Template $template) {
public function destroy($id, Template $template)
{
try {
$templates = $template->whereId($id)->first();
/* Check whether function success or not */
@@ -283,7 +298,8 @@ class TemplateController extends Controller {
*
* @return type Response
*/
public function formDiagno(Emails $email) {
public function formDiagno(Emails $email)
{
try {
$emails = $email->get();
@@ -300,7 +316,8 @@ class TemplateController extends Controller {
*
* @return type
*/
public function postDiagno(DiagnosRequest $request) {
public function postDiagno(DiagnosRequest $request)
{
try {
$email_details = Emails::where('id', '=', $request->from)->first();
if ($email_details->sending_protocol == 'mail') {
@@ -346,10 +363,10 @@ class TemplateController extends Controller {
$return = Lang::get('lang.message_has_been_sent');
}
}
return redirect()->back()->with('success', $return);
} catch (Exception $e) {
return redirect()->back()->with('fails', $e->getMessage());
}
}
}

View File

@@ -144,7 +144,7 @@ class WorkflowController extends Controller
*/
public function create(Emails $emails)
{
$email_data = "";
$email_data = '';
foreach ($emails->lists('email_address', 'id') as $key => $email) {
$email_data["E-$key"] = $email;
}
@@ -167,7 +167,7 @@ class WorkflowController extends Controller
{
try {
// store a new workflow credentials in to the system
$workflow_name = new WorkflowName;
$workflow_name = new WorkflowName();
$workflow_name->name = $request->name;
$workflow_name->status = $request->status;
$workflow_name->order = $request->execution_order;

View File

@@ -27,15 +27,16 @@ use PhpImap\Mailbox as ImapMailbox;
*
* @author Ladybird <info@ladybirdweb.com>
*/
class MailController extends Controller {
class MailController extends Controller
{
/**
* constructor
* Create a new controller instance.
*
* @param type TicketController $TicketController
*/
public function __construct(TicketWorkflowController $TicketWorkflowController) {
public function __construct(TicketWorkflowController $TicketWorkflowController)
{
$this->middleware('board');
$this->TicketWorkflowController = $TicketWorkflowController;
}
@@ -45,7 +46,8 @@ class MailController extends Controller {
*
* @return type
*/
public function readmails(Emails $emails, Email $settings_email, System $system, Ticket $ticket) {
public function readmails(Emails $emails, Email $settings_email, System $system, Ticket $ticket)
{
// $path_url = $system->first()->url;
if ($settings_email->first()->email_fetching == 1) {
if ($settings_email->first()->all_emails == 1) {
@@ -224,7 +226,8 @@ class MailController extends Controller {
*
* @return type string
*/
public function separate_reply($body) {
public function separate_reply($body)
{
$body2 = explode('---Reply above this line---', $body);
$body3 = $body2[0];
@@ -238,7 +241,8 @@ class MailController extends Controller {
*
* @return type string
*/
public function decode_imap_text($str) {
public function decode_imap_text($str)
{
$result = '';
$decode_header = imap_mime_header_decode($str);
foreach ($decode_header as $obj) {
@@ -253,7 +257,8 @@ class MailController extends Controller {
*
* @return type
*/
public function fetch_attachments() {
public function fetch_attachments()
{
$uploads = Upload::all();
foreach ($uploads as $attachment) {
$image = @imagecreatefromstring($attachment->file);
@@ -273,7 +278,8 @@ class MailController extends Controller {
*
* @return type file
*/
public function get_data($id) {
public function get_data($id)
{
$attachments = App\Model\helpdesk\Ticket\Ticket_attachments::where('id', '=', $id)->get();
foreach ($attachments as $attachment) {
header('Content-type: application/'.$attachment->type.'');
@@ -283,7 +289,8 @@ class MailController extends Controller {
}
}
public static function trimTableTag($html) {
public static function trimTableTag($html)
{
if (strpos('<table>', $html) != false) {
$first_pos = strpos($html, '<table');
$fist_string = substr_replace($html, '', 0, $first_pos);
@@ -292,23 +299,28 @@ class MailController extends Controller {
$diff = $total - $last_pos;
$str = substr_replace($fist_string, '', $last_pos, -1);
$final_str = str_finish($str, '</table>');
return $final_str;
}
return $html;
}
public static function trim3D($html) {
public static function trim3D($html)
{
$body = str_replace('=3D', '', $html);
return $body;
}
public static function trimInjections($html, $tags = ['<script>', '</script>', '<style>', '</style>', '<?php', '?>']) {
public static function trimInjections($html, $tags = ['<script>', '</script>', '<style>', '</style>', '<?php', '?>'])
{
$replace = [];
foreach ($tags as $key => $tag) {
$replace[$key] = htmlspecialchars($tag);
}
$body = str_replace($tags, $replace, $html);
return $body;
}
}

View File

@@ -16,6 +16,8 @@ use App\Model\helpdesk\Email\Emails;
use App\Model\helpdesk\Form\Fields;
use App\Model\helpdesk\Manage\Help_topic;
use App\Model\helpdesk\Manage\Sla_plan;
use App\Model\helpdesk\Notification\Notification;
use App\Model\helpdesk\Notification\UserNotification;
use App\Model\helpdesk\Settings\Alert;
use App\Model\helpdesk\Settings\Company;
use App\Model\helpdesk\Settings\Email;
@@ -31,8 +33,6 @@ use App\Model\helpdesk\Ticket\Tickets;
use App\Model\helpdesk\Utility\CountryCode;
use App\Model\helpdesk\Utility\Date_time_format;
use App\Model\helpdesk\Utility\Timezones;
use App\Model\helpdesk\Notification\Notification;
use App\Model\helpdesk\Notification\UserNotification;
use App\User;
use Auth;
use DB;

View File

@@ -91,6 +91,7 @@ class UserController extends Controller
} else {
$stringCut = $model->user_name;
}
return $stringCut;
})
/* column email */

View File

@@ -29,8 +29,8 @@ use Redirect;
*
* @author Ladybird <info@ladybirdweb.com>
*/
class ArticleController extends Controller {
class ArticleController extends Controller
{
/**
* Create a new controller instance.
* constructor to check
@@ -40,7 +40,8 @@ class ArticleController extends Controller {
*
* @return void
*/
public function __construct() {
public function __construct()
{
// checking authentication
$this->middleware('auth');
// checking roles
@@ -48,7 +49,8 @@ class ArticleController extends Controller {
SettingsController::language();
}
public function test() {
public function test()
{
//$table = $this->setDatatable();
return view('themes.default1.agent.kb.article.test');
}
@@ -58,7 +60,8 @@ class ArticleController extends Controller {
*
* @return type void
*/
public function getData() {
public function getData()
{
$article = new Article();
// returns chumper datatable
return Datatable::query($article)
@@ -68,7 +71,6 @@ class ArticleController extends Controller {
->orderColumns('name', 'description')
/* add column name */
->addColumn('name', function ($model) {
$string = strip_tags($model->name);
if (strlen($string) > 40) {
// truncate string
@@ -76,6 +78,7 @@ class ArticleController extends Controller {
} else {
$stringCut = $model->name;
}
return $stringCut.'...';
})
/* add column Created */
@@ -114,7 +117,8 @@ class ArticleController extends Controller {
*
* @return type view
*/
public function index() {
public function index()
{
/* show article list */
try {
return view('themes.default1.agent.kb.article.index');
@@ -130,7 +134,8 @@ class ArticleController extends Controller {
*
* @return type view
*/
public function create(Category $category) {
public function create(Category $category)
{
/* get the attributes of the category */
$category = $category->lists('id', 'name');
/* get the create page */
@@ -149,7 +154,8 @@ class ArticleController extends Controller {
*
* @return type redirect
*/
public function store(Article $article, ArticleRequest $request) {
public function store(Article $article, ArticleRequest $request)
{
// requesting the values to store article data
$publishTime = $request->input('year').'-'.$request->input('month').'-'.$request->input('day').' '.$request->input('hour').':'.$request->input('minute').':00';
@@ -185,7 +191,8 @@ class ArticleController extends Controller {
*
* @return view
*/
public function edit($slug) {
public function edit($slug)
{
$article = new Article();
$relation = new Relationship();
$category = new Category();
@@ -216,7 +223,8 @@ class ArticleController extends Controller {
*
* @return Response
*/
public function update($slug, ArticleUpdate $request) {
public function update($slug, ArticleUpdate $request)
{
$article = new Article();
$relation = new Relationship();
$aid = $article->where('id', $slug)->first();
@@ -259,7 +267,8 @@ class ArticleController extends Controller {
*
* @return Response
*/
public function destroy($slug, Article $article, Relationship $relation, Comment $comment) {
public function destroy($slug, Article $article, Relationship $relation, Comment $comment)
{
/* delete the selected article from the table */
$article = $article->where('slug', $slug)->first(); //get the selected article via id
$id = $article->id;
@@ -293,7 +302,8 @@ class ArticleController extends Controller {
*
* @return type
*/
public static function usertimezone($utc) {
public static function usertimezone($utc)
{
$user = Auth::user();
$tz = $user->timezone;
$set = Settings::whereId('1')->first();
@@ -304,5 +314,4 @@ class ArticleController extends Controller {
$date = date($format, strtotime($utc) + $offset);
echo $date;
}
}

View File

@@ -23,8 +23,8 @@ use Redirect;
*
* @author Ladybird <info@ladybirdweb.com>
*/
class CategoryController extends Controller {
class CategoryController extends Controller
{
/**
* Create a new controller instance.
* constructor to check
@@ -34,7 +34,8 @@ class CategoryController extends Controller {
*
* @return void
*/
public function __construct() {
public function __construct()
{
// checking authentication
$this->middleware('auth');
// checking roles
@@ -49,7 +50,8 @@ class CategoryController extends Controller {
*
* @return Response
*/
public function index() {
public function index()
{
/* get the view of index of the catogorys with all attributes
of category model */
try {
@@ -64,7 +66,8 @@ class CategoryController extends Controller {
*
* @return type chumper datatable
*/
public function getData() {
public function getData()
{
/* fetching chumper datatables */
return Datatable::collection(Category::All())
/* search column name */
@@ -73,7 +76,6 @@ class CategoryController extends Controller {
->orderColumns('name', 'description')
/* add column name */
->addColumn('name', function ($model) {
$string = strip_tags($model->name);
if (strlen($string) > 40) {
// truncate string
@@ -81,6 +83,7 @@ class CategoryController extends Controller {
} else {
$stringCut = $model->name;
}
return $stringCut.'...';
})
/* add column Created */
@@ -121,7 +124,8 @@ class CategoryController extends Controller {
*
* @return type view
*/
public function create(Category $category) {
public function create(Category $category)
{
/* Get the all attributes in the category model */
$category = $category->get();
/* get the view page to create new category with all attributes
@@ -141,7 +145,8 @@ class CategoryController extends Controller {
*
* @return type Redirect
*/
public function store(Category $category, CategoryRequest $request) {
public function store(Category $category, CategoryRequest $request)
{
/* Get the whole request from the form and insert into table via model */
$sl = $request->input('slug');
$slug = str_slug($sl, '-');
@@ -164,7 +169,8 @@ class CategoryController extends Controller {
*
* @return type view
*/
public function edit($slug) {
public function edit($slug)
{
// fetch the category
$cid = Category::where('id', $slug)->first();
$id = $cid->id;
@@ -183,7 +189,8 @@ class CategoryController extends Controller {
*
* @return type redirect
*/
public function update($slug, CategoryUpdate $request) {
public function update($slug, CategoryUpdate $request)
{
/* Edit the selected category via id */
$category = Category::where('id', $slug)->first();
@@ -197,6 +204,7 @@ class CategoryController extends Controller {
$category->fill($request->all())->save();
$category->slug = $slug;
$category->save();
return redirect('category')->with('success', Lang::get('lang.category_updated_successfully'));
} catch (Exception $e) {
//redirect to index with fails message
@@ -213,7 +221,8 @@ class CategoryController extends Controller {
*
* @return type Redirect
*/
public function destroy($id, Category $category, Relationship $relation) {
public function destroy($id, Category $category, Relationship $relation)
{
$relation = $relation->where('category_id', $id)->first();
if ($relation != null) {
return Redirect::back()->with('fails', Lang::get('lang.category_not_deleted'));
@@ -230,5 +239,4 @@ class CategoryController extends Controller {
}
}
}
}

View File

@@ -21,8 +21,8 @@ use Lang;
*
* @author Ladybird <info@ladybirdweb.com>
*/
class PageController extends Controller {
class PageController extends Controller
{
/**
* Create a new controller instance.
* constructor to check
@@ -32,7 +32,8 @@ class PageController extends Controller {
*
* @return void
*/
public function __construct(Page $page) {
public function __construct(Page $page)
{
// checking authentication
$this->middleware('auth');
// checking roles
@@ -46,7 +47,8 @@ class PageController extends Controller {
*
* @return type
*/
public function index() {
public function index()
{
$pages = $this->page->paginate(3);
$pages->setPath('page');
try {
@@ -61,7 +63,8 @@ class PageController extends Controller {
*
* @return type
*/
public function getData() {
public function getData()
{
/* fetching chumper datatables */
return Datatable::collection(Page::All())
/* search column name */
@@ -108,7 +111,8 @@ class PageController extends Controller {
*
* @return type view
*/
public function create() {
public function create()
{
return view('themes.default1.agent.kb.pages.create');
}
@@ -119,7 +123,8 @@ class PageController extends Controller {
*
* @return type
*/
public function store(PageRequest $request) {
public function store(PageRequest $request)
{
$sl = $request->input('slug');
$slug = str_slug($sl, '-');
$this->page->slug = $slug;
@@ -139,7 +144,8 @@ class PageController extends Controller {
*
* @return type view
*/
public function edit($slug) {
public function edit($slug)
{
try {
$page = $this->page->where('slug', $slug)->first();
@@ -157,7 +163,8 @@ class PageController extends Controller {
*
* @return type redirect
*/
public function update($slug, PageUpdate $request) {
public function update($slug, PageUpdate $request)
{
// get pages with respect to slug
$pages = $this->page->where('slug', $slug)->first();
$sl = $request->input('slug');
@@ -181,7 +188,8 @@ class PageController extends Controller {
*
* @return type redirect
*/
public function destroy($id) {
public function destroy($id)
{
try {
// get the page to be deleted
$page = $this->page->whereId($id)->first();
@@ -192,5 +200,4 @@ class PageController extends Controller {
return redirect('page')->with('fails', $e->getMessage());
}
}
}

View File

@@ -29,8 +29,8 @@ use Mail;
*
* @author Ladybird <info@ladybirdweb.com>
*/
class AuthController extends Controller {
class AuthController extends Controller
{
use AuthenticatesAndRegistersUsers;
/* to redirect after login */
@@ -50,7 +50,8 @@ class AuthController extends Controller {
*
* @return void
*/
public function __construct(PhpMailController $PhpMailController) {
public function __construct(PhpMailController $PhpMailController)
{
$this->PhpMailController = $PhpMailController;
SettingsController::smtp();
$this->middleware('guest', ['except' => 'getLogout']);
@@ -61,7 +62,8 @@ class AuthController extends Controller {
*
* @return type Response
*/
public function getRegister() {
public function getRegister()
{
// Event for login
\Event::fire(new \App\Events\FormRegisterEvent());
if (Auth::user()) {
@@ -83,7 +85,8 @@ class AuthController extends Controller {
*
* @return type Response
*/
public function postRegister(User $user, RegisterRequest $request) {
public function postRegister(User $user, RegisterRequest $request)
{
// Event for login
\Event::fire(new \App\Events\LoginEvent($request));
$password = Hash::make($request->input('password'));
@@ -96,28 +99,34 @@ class AuthController extends Controller {
$code = str_random(60);
$user->remember_token = $code;
$user->save();
$message12 = "";
$message12 = '';
$var = $this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('1', '0'), $to = ['name' => $name, 'email' => $request->input('email')], $message = ['subject' => 'Activate your Account', 'scenario' => 'registration'], $template_variables = ['user' => $name, 'email_address' => $request->input('email'), 'password_reset_link' => url('account/activate/'.$code)]);
if ($var == null) {
$message12 = Lang::get('lang.failed_to_send_email_contact_administrator');
return redirect('home')->with('warning', $message12);
} else {
$message12 = Lang::get('lang.activate_your_account_click_on_Link_that_send_to_your_mail');
}
return redirect('home')->with('success', $message12);
}
/**
* Function to activate account
* Function to activate account.
*
* @param type $token
*
* @return type redirect
*/
public function accountActivate($token) {
public function accountActivate($token)
{
$user = User::where('remember_token', '=', $token)->first();
if ($user) {
$user->active = 1;
$user->remember_token = NULL;
$user->remember_token = null;
$user->save();
return redirect('/auth/login')->with('status', 'Acount activated. Login to start');
} else {
return redirect('/auth/login')->with('fails', 'Invalid Token');
@@ -132,7 +141,8 @@ class AuthController extends Controller {
*
* @return type Response
*/
public function getMail($token, User $user) {
public function getMail($token, User $user)
{
$user = $user->where('remember_token', $token)->where('active', 0)->first();
if ($user) {
$user->active = 1;
@@ -149,7 +159,8 @@ class AuthController extends Controller {
*
* @return type Response
*/
public function getLogin() {
public function getLogin()
{
if (Auth::user()) {
if (Auth::user()->role == 'admin' || Auth::user()->role == 'agent') {
return \Redirect::route('dashboard');
@@ -168,7 +179,8 @@ class AuthController extends Controller {
*
* @return type Response
*/
public function postLogin(LoginRequest $request) {
public function postLogin(LoginRequest $request)
{
// Set login attempts and login time
$value = $_SERVER['REMOTE_ADDR'];
$usernameinput = $request->input('email');
@@ -251,7 +263,8 @@ class AuthController extends Controller {
*
* @return type Response
*/
public function addLoginAttempt($value, $field) {
public function addLoginAttempt($value, $field)
{
$result = DB::table('login_attempts')->where('IP', '=', $value)->first();
$data = $result;
$security = Security::whereId('1')->first();
@@ -276,7 +289,8 @@ class AuthController extends Controller {
*
* @return type Response
*/
public function clearLoginAttempts($value, $field) {
public function clearLoginAttempts($value, $field)
{
$data = DB::table('login_attempts')->where('IP', '=', $value)->orWhere('User', '=', $field)->update(['attempts' => '0']);
return $data;
@@ -289,7 +303,8 @@ class AuthController extends Controller {
*
* @return type Response
*/
public function confirmIPAddress($value, $field) {
public function confirmIPAddress($value, $field)
{
$security = Security::whereId('1')->first();
$time = $security->lockout_period;
$max_attempts = $security->backlist_threshold;
@@ -319,8 +334,8 @@ class AuthController extends Controller {
*
* @return type string
*/
protected function getFailedLoginMessage() {
protected function getFailedLoginMessage()
{
return Lang::get('lang.this_field_do_not_match_our_records');
}
}

View File

@@ -33,15 +33,16 @@ use Redirect;
*
* @author Ladybird <info@ladybirdweb.com>
*/
class FormController extends Controller {
class FormController extends Controller
{
/**
* Create a new controller instance.
* Constructor to check.
*
* @return void
*/
public function __construct(TicketWorkflowController $TicketWorkflowController) {
public function __construct(TicketWorkflowController $TicketWorkflowController)
{
$this->middleware('board');
// creating a TicketController instance
$this->TicketWorkflowController = $TicketWorkflowController;
@@ -54,7 +55,8 @@ class FormController extends Controller {
*
* @return type
*/
public function getForm(Help_topic $topic, CountryCode $code) {
public function getForm(Help_topic $topic, CountryCode $code)
{
if (\Config::get('database.install') == '%0%') {
return \Redirect::route('license');
}
@@ -78,13 +80,13 @@ class FormController extends Controller {
*
* @return type string
*/
public function postForm($id, Help_topic $topic) {
public function postForm($id, Help_topic $topic)
{
if ($id != 0) {
$helptopic = $topic->where('id', '=', $id)->first();
$custom_form = $helptopic->custom_form;
$values = Fields::where('forms_id', '=', $custom_form)->get();
if (!$values) {
}
if ($values) {
foreach ($values as $value) {
@@ -130,8 +132,8 @@ class FormController extends Controller {
* @param type Request $request
* @param type User $user
*/
public function postedForm(User $user, ClientRequest $request, Ticket $ticket_settings, Ticket_source $ticket_source, Ticket_attachments $ta, CountryCode $code) {
public function postedForm(User $user, ClientRequest $request, Ticket $ticket_settings, Ticket_source $ticket_source, Ticket_attachments $ta, CountryCode $code)
{
$form_extras = $request->except('Name', 'Phone', 'Email', 'Subject', 'Details', 'helptopic', '_wysihtml5_mode', '_token');
$name = $request->input('Name');
@@ -207,7 +209,8 @@ class FormController extends Controller {
*
* @return type view
*/
public function post_ticket_reply($id, Request $request) {
public function post_ticket_reply($id, Request $request)
{
try {
if ($comment != null) {
$tickets = Tickets::where('id', '=', $id)->first();
@@ -270,5 +273,4 @@ class FormController extends Controller {
// return \Redirect::back()->with('fails1', Lang::get('lang.please_fill_some_data'));
// }
}
}

View File

@@ -15,9 +15,10 @@ use Redirect;
*
* @author Ladybird <info@ladybirdweb.com>
*/
class WelcomepageController extends Controller {
public function __construct() {
class WelcomepageController extends Controller
{
public function __construct()
{
// $this->middleware('board');
}
@@ -26,7 +27,8 @@ class WelcomepageController extends Controller {
*
* @return Response
*/
public function get(System $note) {
public function get(System $note)
{
if (Config::get('database.install') == '%0%') {
return Redirect::route('licence');
}
@@ -38,12 +40,12 @@ class WelcomepageController extends Controller {
return view('themes.default1.client.guest-user.guest', compact('heading', 'content'));
}
public function index() {
public function index()
{
if (Config::get('database.install') == '%0%') {
return Redirect::route('licence');
}
return view('themes.default1.client.helpdesk.guest-user.index');
}
}

View File

@@ -7,11 +7,12 @@ use App\Model\helpdesk\Notification\Notification;
use App\Model\helpdesk\Notification\UserNotification;
use App\User;
class NotificationController extends Controller {
class NotificationController extends Controller
{
public $user;
public function __construct() {
public function __construct()
{
$user = new User();
$this->user = $user;
}
@@ -21,7 +22,8 @@ class NotificationController extends Controller {
*
* @return response
*/
public static function getNotifications() {
public static function getNotifications()
{
$notifications = UserNotification::join('notifications', 'user_notification.notification_id', '=', 'notifications.id')
->join('notification_types', 'notifications.type_id', '=', 'notification_types.id')
->where('user_notification.user_id', '=', \Auth::user()->id)
@@ -30,7 +32,8 @@ class NotificationController extends Controller {
return $notifications;
}
public function create($model_id, $userid_created, $type_id, $forwhome = []) {
public function create($model_id, $userid_created, $type_id, $forwhome = [])
{
try {
if (empty($forwhome)) {
$forwhome = $this->user->where('role', '!=', 'user')->get()->toArray();
@@ -49,16 +52,19 @@ class NotificationController extends Controller {
}
}
public function markAllRead($id) {
public function markAllRead($id)
{
$markasread = UserNotification::where('user_id', '=', \Auth::user()->id)->where('is_read', '=', '0')->get();
foreach ($markasread as $mark) {
$mark->is_read = '1';
$mark->save();
}
return 1;
}
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();
foreach ($markasread as $mark) {
$mark->is_read = '1';
@@ -68,13 +74,15 @@ class NotificationController extends Controller {
return 1;
}
public function show() {
public function show()
{
$notifications = $this->getNotifications();
return view('notifications-all', compact('notifications'));
}
public function delete($id) {
public function delete($id)
{
$markasread = UserNotification::where('notification_id', '=', $id)->where('user_id', '=', \Auth::user()->id)->get();
foreach ($markasread as $mark) {
$mark->delete();
@@ -82,5 +90,4 @@ class NotificationController extends Controller {
return 1;
}
}

View File

@@ -11,10 +11,12 @@ use App\Model\helpdesk\Settings\Email;
use App\User;
use Auth;
class PhpMailController extends Controller {
public function fetch_smtp_details($id) {
class PhpMailController extends Controller
{
public function fetch_smtp_details($id)
{
$emails = Emails::where('id', '=', $id)->first();
return $emails;
}
@@ -23,7 +25,8 @@ class PhpMailController extends Controller {
*
* @return Mail
*/
public function sendmail($from, $to, $message, $template_variables) {
public function sendmail($from, $to, $message, $template_variables)
{
// dd($from);
$from_address = $this->fetch_smtp_details($from);
if ($from_address == null) {
@@ -215,8 +218,7 @@ class PhpMailController extends Controller {
// dd($messagebody);
//$mail->SMTPDebug = 3; // Enable verbose debug output
if ($protocol == "smtp") {
if ($protocol == 'smtp') {
$mail->isSMTP(); // Set mailer to use SMTP
$mail->Host = $host; // Specify main and backup SMTP servers
$mail->SMTPAuth = true; // Enable SMTP authentication
@@ -225,7 +227,7 @@ class PhpMailController extends Controller {
$mail->SMTPSecure = $smtpsecure; // Enable TLS encryption, `ssl` also accepted
$mail->Port = $port; // TCP port to connect to
$mail->setFrom($username, $fromname);
} elseif ($protocol == "mail") {
} elseif ($protocol == 'mail') {
$mail->IsSendmail(); // telling the class to use SendMail transport
if ($username == $fromname) {
$mail->setFrom($username);
@@ -286,7 +288,8 @@ class PhpMailController extends Controller {
*
* @return MailNotification
*/
public function sendEmail($from, $to, $message) {
public function sendEmail($from, $to, $message)
{
// dd($from);
$from_address = $this->fetch_smtp_details($from);
@@ -412,7 +415,8 @@ class PhpMailController extends Controller {
*
* @return type
*/
public function company() {
public function company()
{
$company = Company::Where('id', '=', '1')->first();
if ($company->company_name == null) {
$company = 'Support Center';
@@ -474,7 +478,8 @@ class PhpMailController extends Controller {
*
* @return type integer
*/
public function mailfrom($reg, $dept_id) {
public function mailfrom($reg, $dept_id)
{
$email = Email::where('id', '=', '1')->first();
if ($reg == 1) {
return $email->sys_email;
@@ -487,5 +492,4 @@ class PhpMailController extends Controller {
}
}
}
}

View File

@@ -27,14 +27,15 @@ use Lang;
* ***************************
* Controller to keep smtp details and fetch where ever needed.
*/
class SettingsController extends Controller {
class SettingsController extends Controller
{
/**
* Create a new controller instance.
*
* @return type void
*/
public function __construct() {
public function __construct()
{
// $this->smtp();
$this->middleware('auth');
$this->middleware('roles');
@@ -52,7 +53,8 @@ class SettingsController extends Controller {
*
* @return response
*/
public function widgets() {
public function widgets()
{
return view('themes.default1.admin.helpdesk.theme.widgets');
}
@@ -61,7 +63,8 @@ class SettingsController extends Controller {
*
* @return response
*/
public function list_widget() {
public function list_widget()
{
return \Datatable::collection(Widgets::where('id', '<', '7')->get())
->searchColumns('name')
->orderColumns('name', 'title', 'value')
@@ -120,7 +123,8 @@ class SettingsController extends Controller {
*
* @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->title = $request->title;
$widget->value = $request->content;
@@ -138,7 +142,8 @@ class SettingsController extends Controller {
*
* @return response
*/
public function social_buttons() {
public function social_buttons()
{
return view('themes.default1.admin.helpdesk.theme.social');
}
@@ -147,7 +152,8 @@ class SettingsController extends Controller {
*
* @return response
*/
public function list_social_buttons() {
public function list_social_buttons()
{
return \Datatable::collection(Widgets::where('id', '>', '6')->get())
->searchColumns('name')
->orderColumns('name', 'value')
@@ -194,7 +200,8 @@ class SettingsController extends Controller {
*
* @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->title = $request->title;
$widget->value = $request->content;
@@ -212,7 +219,8 @@ class SettingsController extends Controller {
*
* @return type void
*/
public static function driver() {
public static function driver()
{
$set = new Smtp();
$settings = Smtp::where('id', '=', '1')->first();
Config::set('mail.host', $settings->driver);
@@ -223,7 +231,8 @@ class SettingsController extends Controller {
*
* @return type void
*/
public static function host() {
public static function host()
{
$set = new Smtp();
$settings = Smtp::where('id', '=', '1')->first();
Config::set('mail.host', $settings->host);
@@ -234,7 +243,8 @@ class SettingsController extends Controller {
*
* @return type void
*/
public static function port() {
public static function port()
{
$set = new Smtp();
$settings = Smtp::where('id', '=', '1')->first();
Config::set('mail.port', intval($settings->port));
@@ -245,7 +255,8 @@ class SettingsController extends Controller {
*
* @return type void
*/
public static function from() {
public static function from()
{
$set = new Smtp();
$settings = Smtp::where('id', '=', '1')->first();
Config::set('mail.from', ['address' => $settings->email, 'name' => $settings->company_name]);
@@ -256,7 +267,8 @@ class SettingsController extends Controller {
*
* @return type void
*/
public static function encryption() {
public static function encryption()
{
$set = new Smtp();
$settings = Smtp::where('id', '=', '1')->first();
Config::set('mail.encryption', $settings->encryption);
@@ -267,7 +279,8 @@ class SettingsController extends Controller {
*
* @return type void
*/
public static function username() {
public static function username()
{
$set = new Smtp();
$settings = Smtp::where('id', '=', '1')->first();
Config::set('mail.username', $settings->email);
@@ -278,7 +291,8 @@ class SettingsController extends Controller {
*
* @return type void
*/
public static function password() {
public static function password()
{
$settings = Smtp::first();
if ($settings->password) {
$pass = $settings->password;
@@ -292,7 +306,8 @@ class SettingsController extends Controller {
*
* @return type view
*/
public function getsmtp() {
public function getsmtp()
{
$settings = Smtp::where('id', '=', '1')->first();
return view('themes.default1.admin.helpdesk.emails.smtp', compact('settings'));
@@ -303,7 +318,8 @@ class SettingsController extends Controller {
*
* @return type view
*/
public function postsmtp(SmtpRequest $request) {
public function postsmtp(SmtpRequest $request)
{
$data = Smtp::where('id', '=', 1)->first();
$data->driver = $request->input('driver');
$data->host = $request->input('host');
@@ -326,7 +342,8 @@ class SettingsController extends Controller {
*
* @return type void
*/
public static function smtp() {
public static function smtp()
{
$settings = Smtp::where('id', '=', '1')->first();
if ($settings->password) {
$password = Crypt::decrypt($settings->password);
@@ -347,7 +364,8 @@ class SettingsController extends Controller {
*
* @return type view\
*/
public function settings(Smtp $set) {
public function settings(Smtp $set)
{
$settings = $set->where('id', '1')->first();
return view('themes.default1.admin.settings', compact('settings'));
@@ -361,7 +379,8 @@ class SettingsController extends Controller {
*
* @return type view
*/
public function PostSettings(Settings $set, Request $request) {
public function PostSettings(Settings $set, Request $request)
{
$settings = $set->where('id', '1')->first();
$pass = $request->input('password');
$password = Crypt::encrypt($pass);
@@ -393,7 +412,8 @@ class SettingsController extends Controller {
*
* @return type
*/
public function version_check() {
public function version_check()
{
$response_url = \URL::route('post-version-check');
echo "<form action='http://www.faveohelpdesk.com/billing/public/version' method='post' name='redirect'>";
echo "<input type='hidden' name='_token' value='csrf_token()'/>";
@@ -408,7 +428,8 @@ class SettingsController extends Controller {
*
* @return type
*/
public function post_version_check(Request $request) {
public function post_version_check(Request $request)
{
// dd($request);
$current_version = \Config::get('app.version');
$current_version = explode(' ', $current_version);
@@ -421,21 +442,25 @@ class SettingsController extends Controller {
$version->current_version = $current_version;
$version->new_version = $new_version;
$version->save();
return redirect()->route('checkupdate')->with('info', ' Version '.$new_version.' is Available');
} else {
return redirect()->route('checkupdate')->with('info', ' Error Checking Version');
}
}
public function getupdate() {
public function getupdate()
{
return \View::make('themes.default1.admin.helpdesk.settings.checkupdate');
}
public function Plugins() {
public function Plugins()
{
return view('themes.default1.admin.helpdesk.settings.plugins');
}
public function GetPlugin() {
public function GetPlugin()
{
$plugins = $this->fetchConfig();
return \Datatable::collection(new Collection($plugins))
@@ -496,7 +521,8 @@ class SettingsController extends Controller {
*
* @return type
*/
public function ReadPlugins() {
public function ReadPlugins()
{
$dir = app_path().DIRECTORY_SEPARATOR.'Plugins';
$plugins = array_diff(scandir($dir), ['.', '..']);
@@ -510,7 +536,8 @@ class SettingsController extends Controller {
*
* @return type
*/
public function PostPlugins(Request $request) {
public function PostPlugins(Request $request)
{
$v = $this->validate($request, ['plugin' => 'required|mimes:application/zip,zip,Zip']);
$plug = new Plugin();
$file = $request->file('plugin');
@@ -588,7 +615,8 @@ class SettingsController extends Controller {
*
* @return bool
*/
public function deleteDirectory($dir) {
public function deleteDirectory($dir)
{
if (!file_exists($dir)) {
return true;
}
@@ -609,7 +637,8 @@ class SettingsController extends Controller {
return rmdir($dir);
}
public function ReadConfigs() {
public function ReadConfigs()
{
$dir = app_path().DIRECTORY_SEPARATOR.'Plugins'.DIRECTORY_SEPARATOR;
$directories = scandir($dir);
$files = [];
@@ -650,7 +679,8 @@ class SettingsController extends Controller {
}
}
public function fetchConfig() {
public function fetchConfig()
{
$configs = $this->ReadConfigs();
//dd($configs);
$plugs = new Plugin();
@@ -686,7 +716,8 @@ class SettingsController extends Controller {
return $attributes;
}
public function DeletePlugin($slug) {
public function DeletePlugin($slug)
{
$dir = app_path().DIRECTORY_SEPARATOR.'Plugins'.DIRECTORY_SEPARATOR.$slug;
$this->deleteDirectory($dir);
/*
@@ -706,7 +737,8 @@ class SettingsController extends Controller {
return redirect()->back()->with('success', 'Deleted Successfully');
}
public function StatusPlugin($slug) {
public function StatusPlugin($slug)
{
$plugs = new Plugin();
$plug = $plugs->where('name', $slug)->first();
if (!$plug) {

View File

@@ -7,19 +7,22 @@ use Closure;
/**
* CheckBoard.
* Checking if the system board is online or offline
* Checking if the system board is online or offline.
*
* @author Ladybird <info@ladybirdweb.com>
*/
class CheckBoard {
class CheckBoard
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
*
* @return type Mixed
*/
public function handle($request, Closure $next) {
public function handle($request, Closure $next)
{
if ($this->checkBoard() == '1') {
return $next($request);
} else {
@@ -28,16 +31,18 @@ class CheckBoard {
}
/**
* Function to get the system offline details
* Function to get the system offline details.
*
* @return type Mixed
*/
public function checkBoard() {
public function checkBoard()
{
$res = 0;
$system = new System;
$system = new System();
if ($system->first()) {
$res = $system->first()->status;
}
return $res;
}
}

View File

@@ -31,6 +31,7 @@ class CheckUpdate
return redirect('file-update');
}
}
return $next($request);
}

View File

@@ -336,12 +336,12 @@ Route::group(['middleware' => 'roles', 'middleware' => 'auth', 'middleware' => '
//route for submit error and debugging setting form page
Route::post('post-settings', ['as' => 'post.error.debug.settings',
'uses' => 'Admin\helpdesk\ErrorAndDebuggingController@postSettings']);
'uses' => 'Admin\helpdesk\ErrorAndDebuggingController@postSettings', ]);
//route to error logs table page
Route::get('show-error-logs', [
'as' => 'error.logs',
'uses' => 'Admin\helpdesk\ErrorAndDebuggingController@showErrorLogs'
'uses' => 'Admin\helpdesk\ErrorAndDebuggingController@showErrorLogs',
]);
});

View File

@@ -26,7 +26,8 @@ class Ticket_Thread extends BaseModel
// $this->attributes['title'] = str_replace('"', "'", $value);
// }
public function getTitleAttribute($value) {
public function getTitleAttribute($value)
{
return str_replace('"', "'", $value);
}
}

View File

@@ -1,6 +1,6 @@
<?php
return array(
return [
/*
|--------------------------------------------------------------------------
@@ -49,7 +49,7 @@ return array(
| contain these strings will be filtered.
|
*/
'filters' => env('BUGSNAG_FILTERS', array('password')),
'filters' => env('BUGSNAG_FILTERS', ['password']),
/*
|--------------------------------------------------------------------------
@@ -72,6 +72,6 @@ return array(
| )
|
*/
'proxy' => env('BUGSNAG_PROXY', null)
'proxy' => env('BUGSNAG_PROXY', null),
);
];

View File

@@ -10,7 +10,9 @@ use App\Model\helpdesk\Email\Smtp;
use App\Model\helpdesk\Manage\Help_topic;
use App\Model\helpdesk\Manage\Sla_plan;
use App\Model\helpdesk\Notification\NotificationType;
use App\Model\helpdesk\Ratings\Rating;
use App\Model\helpdesk\Settings\Alert;
use App\Model\helpdesk\Settings\CommonSettings;
use App\Model\helpdesk\Settings\Company;
use App\Model\helpdesk\Settings\Email;
use App\Model\helpdesk\Settings\Responder;
@@ -31,8 +33,6 @@ use App\Model\helpdesk\Utility\Time_format;
use App\Model\helpdesk\Utility\Timezones;
use App\Model\helpdesk\Utility\Version_Check;
use App\Model\helpdesk\Workflow\WorkflowClose;
use App\Model\helpdesk\Settings\CommonSettings;
use App\Model\helpdesk\Ratings\Rating;
use App\Model\kb\Settings;
// Knowledge base
use Illuminate\Database\Seeder;
@@ -2009,12 +2009,12 @@ class DatabaseSeeder extends Seeder
Template::create(['id' => '12', 'name' => 'registration', 'type' => '12', 'message' => '<span><p>Hello {!!$user!!} ,&nbsp;</p><p>This email is confirmation that you are now registered at our helpdesk.</p><p>Registered Email: {!!$email_address!!}</p><p>Please click on the below link to activate your account and Login to the system {!!$password_reset_link!!}</p><p>Thank You.</p><p>Kind Regards,</p><p>{!!$system_from!!}&nbsp;</p></span>', 'set_id' => '1']);
/**
/*
* All the common settings will be listed here
*/
CommonSettings::create(['id' => '1', 'option_name' => 'ticket_token_time_duration', 'option_value' => '1']);
/**
/*
* Ratings
*/
Rating::create(['id' => '1', 'name' => 'OverAll Satisfaction', 'display_order' => '1', 'allow_modification' => '1', 'rating_scale' => '5', 'rating_area' => 'Helpdesk Area']);

View File

@@ -1,4 +1,4 @@

<?php
return [

View File

@@ -1,4 +1,4 @@
<?php
<?php
return [

View File

@@ -1,4 +1,4 @@
<?php
<?php
return [
@@ -14,7 +14,7 @@ return [
*/
'password' => 'Passwörter müssen mindestens sechs Zeichen lang sein und der Bestätigung entsprechen.',
'user' => "Wir können keinen Benutzer mit dieser E-Mail-Adresse finden.",
'user' => 'Wir können keinen Benutzer mit dieser E-Mail-Adresse finden.',
'token' => 'Dieser Passwort-Reset-Token ist ungültig.',
'sent' => 'Wir haben dir einen Passwort-Reset-Link per E-Mail zukommen lassen!',
'reset' => 'Dein Passwort wurde zurückgesetzt!',

View File

@@ -1,4 +1,4 @@
<?php
<?php
return [

View File

@@ -14,7 +14,7 @@ return [
*/
'password' => 'Le Passwords devono essere almeno di sei caratteri e combaciare.',
'user' => "Non esiste un utente con questo indirizzo e-mail.",
'user' => 'Non esiste un utente con questo indirizzo e-mail.',
'token' => 'Il token per il reset della password non è valido.',
'sent' => 'Una email con il link al reset della passowrd ti è stato inviato!',
'reset' => 'La tua password è stata resettata!',

View File

@@ -1,7 +1,7 @@

<?php
return array(
return [
/*
|----------------------------------------------------------------------------------------
| Authentication Pages [English(en)]
@@ -312,7 +312,7 @@ return array(
'iso-code' => 'ISO-CODE',
'download' => 'Downlaod',
'upload_file' => 'Загрузить файл',
'enter_iso-code' => "Enter ISO-CODE",
'enter_iso-code' => 'Enter ISO-CODE',
'eg.' => 'Example',
'for' => 'for',
'english' => 'Английский',
@@ -321,15 +321,15 @@ return array(
'read-more' => 'Подробнее.',
'enable_lang' => 'Enable it.',
'add-lang-package' => 'Add new language package',
'package_exist' => "Package already exists.",
'iso-code-error' => "Error in iso-code. enter correct iso-code.",
'package_exist' => 'Package already exists.',
'iso-code-error' => 'Error in iso-code. enter correct iso-code.',
'zipp-error' => 'Error in zip file. Zip must contian language php files only.',
'upload-success' => "Загрузка произошла успешна.",
"file-error" => 'Error in file or invalid file.',
'upload-success' => 'Загрузка произошла успешна.',
'file-error' => 'Error in file or invalid file.',
'delete-success' => 'Языковой пакет успешно удален.',
'lang-doesnot-exist' => 'Языковой пакет не существует.',
'active-lang-error' => 'Языковой пакет не может быть удален, когда он активен.',
"language-error" => 'Языковой пакет не найден в указанной дериктории.',
'language-error' => 'Языковой пакет не найден в указанной дериктории.',
/*
|----------------------------------------------------------------------------------------
| Manage Pages [English(en)]
@@ -405,10 +405,10 @@ return array(
'are_you_sure_you_want_to_delete' => 'Вы уверены, что хотите удалить',
'close' => 'Закрыть',
'instructions' => 'Инструкции',
"instructions_on_creating_form" => "Select field type you want to add to the form below and click on 'Type' dropdown. Don't forget to set field options if type is select,checkbox or radio..Separate each option by a coma. After you finish creating the form, you can save the form by clicking Save Form button",
'instructions_on_creating_form' => "Select field type you want to add to the form below and click on 'Type' dropdown. Don't forget to set field options if type is select,checkbox or radio..Separate each option by a coma. After you finish creating the form, you can save the form by clicking Save Form button",
'form_properties' => 'Свойства Формы',
'adding_fields' => 'Добавление полей',
"click_add_fields_button_to_add_fields" => "Click <b>'Add Fields'</b> button to add Fields",
'click_add_fields_button_to_add_fields' => "Click <b>'Add Fields'</b> button to add Fields",
'add_fields' => 'Добавить поле',
'save_form' => 'Сохранить Форму',
'label' => 'Метки',
@@ -634,7 +634,7 @@ return array(
'please_select_an_organization' => 'Пожалуйста, выберите организацию',
'please_select_an_user' => 'Пожалуйста, выберите пользователя',
'organization_profile' => 'Профиль Организации',
'organization-s_head' => "Страница руководителя",
'organization-s_head' => 'Страница руководителя',
'select_department_manager' => 'Выберите Менеджера Отдела',
'users_of' => 'Пользователи',
/*
@@ -824,4 +824,4 @@ return array(
'post_comment' => 'Отправить Комментарий',
'plugin' => 'Плагин',
'end_date' => 'Конец Даты',
);
];

View File

@@ -13,10 +13,10 @@ return [
|
*/
"password" => "Пароль должен содержать не менее шести символов и соответствовать подтверждения.",
"user" => "Мы не можем найти пользователя с данным адресом электронной почты.",
"token" => "Этот пароль сбросить маркер недействителен.",
"sent" => "Мы по электронной почте Ваш пароль сбросить ссылку!",
"reset" => "Ваш пароль был сброшен!",
'password' => 'Пароль должен содержать не менее шести символов и соответствовать подтверждения.',
'user' => 'Мы не можем найти пользователя с данным адресом электронной почты.',
'token' => 'Этот пароль сбросить маркер недействителен.',
'sent' => 'Мы по электронной почте Ваш пароль сбросить ссылку!',
'reset' => 'Ваш пароль был сброшен!',
];

View File

@@ -13,66 +13,66 @@ return [
|
*/
"accepted" => "The :attribute must be accepted.",
"active_url" => "The :attribute is not a valid URL.",
"after" => "The :attribute must be a date after :date.",
"alpha" => "The :attribute may only contain letters.",
"alpha_dash" => "The :attribute may only contain letters, numbers, and dashes.",
"alpha_num" => "The :attribute may only contain letters and numbers.",
"array" => "The :attribute must be an array.",
"before" => "The :attribute must be a date before :date.",
"between" => [
"numeric" => "The :attribute must be between :min and :max.",
"file" => "The :attribute must be between :min and :max kilobytes.",
"string" => "The :attribute must be between :min and :max characters.",
"array" => "The :attribute must have between :min and :max items.",
'accepted' => 'The :attribute must be accepted.',
'active_url' => 'The :attribute is not a valid URL.',
'after' => 'The :attribute must be a date after :date.',
'alpha' => 'The :attribute may only contain letters.',
'alpha_dash' => 'The :attribute may only contain letters, numbers, and dashes.',
'alpha_num' => 'The :attribute may only contain letters and numbers.',
'array' => 'The :attribute must be an array.',
'before' => 'The :attribute must be a date before :date.',
'between' => [
'numeric' => 'The :attribute must be between :min and :max.',
'file' => 'The :attribute must be between :min and :max kilobytes.',
'string' => 'The :attribute must be between :min and :max characters.',
'array' => 'The :attribute must have between :min and :max items.',
],
"boolean" => "The :attribute field must be true or false.",
"confirmed" => "The :attribute confirmation does not match.",
"date" => "The :attribute is not a valid date.",
"date_format" => "The :attribute does not match the format :format.",
"different" => "The :attribute and :other must be different.",
"digits" => "The :attribute must be :digits digits.",
"digits_between" => "The :attribute must be between :min and :max digits.",
"email" => "The :attribute must be a valid email address.",
"filled" => "The :attribute field is required.",
"exists" => "The selected :attribute is invalid.",
"image" => "The :attribute must be an image.",
"in" => "The selected :attribute is invalid.",
"integer" => "The :attribute must be an integer.",
"ip" => "The :attribute must be a valid IP address.",
"max" => [
"numeric" => "The :attribute may not be greater than :max.",
"file" => "The :attribute may not be greater than :max kilobytes.",
"string" => "The :attribute may not be greater than :max characters.",
"array" => "The :attribute may not have more than :max items.",
'boolean' => 'The :attribute field must be true or false.',
'confirmed' => 'The :attribute confirmation does not match.',
'date' => 'The :attribute is not a valid date.',
'date_format' => 'The :attribute does not match the format :format.',
'different' => 'The :attribute and :other must be different.',
'digits' => 'The :attribute must be :digits digits.',
'digits_between' => 'The :attribute must be between :min and :max digits.',
'email' => 'The :attribute must be a valid email address.',
'filled' => 'The :attribute field is required.',
'exists' => 'The selected :attribute is invalid.',
'image' => 'The :attribute must be an image.',
'in' => 'The selected :attribute is invalid.',
'integer' => 'The :attribute must be an integer.',
'ip' => 'The :attribute must be a valid IP address.',
'max' => [
'numeric' => 'The :attribute may not be greater than :max.',
'file' => 'The :attribute may not be greater than :max kilobytes.',
'string' => 'The :attribute may not be greater than :max characters.',
'array' => 'The :attribute may not have more than :max items.',
],
"mimes" => "The :attribute must be a file of type: :values.",
"min" => [
"numeric" => "The :attribute must be at least :min.",
"file" => "The :attribute must be at least :min kilobytes.",
"string" => "The :attribute must be at least :min characters.",
"array" => "The :attribute must have at least :min items.",
'mimes' => 'The :attribute must be a file of type: :values.',
'min' => [
'numeric' => 'The :attribute must be at least :min.',
'file' => 'The :attribute must be at least :min kilobytes.',
'string' => 'The :attribute must be at least :min characters.',
'array' => 'The :attribute must have at least :min items.',
],
"not_in" => "The selected :attribute is invalid.",
"numeric" => "The :attribute must be a number.",
"regex" => "The :attribute format is invalid.",
"required" => "The :attribute field is required.",
"required_if" => "The :attribute field is required when :other is :value.",
"required_with" => "The :attribute field is required when :values is present.",
"required_with_all" => "The :attribute field is required when :values is present.",
"required_without" => "The :attribute field is required when :values is not present.",
"required_without_all" => "The :attribute field is required when none of :values are present.",
"same" => "The :attribute and :other must match.",
"size" => [
"numeric" => "The :attribute must be :size.",
"file" => "The :attribute must be :size kilobytes.",
"string" => "The :attribute must be :size characters.",
"array" => "The :attribute must contain :size items.",
'not_in' => 'The selected :attribute is invalid.',
'numeric' => 'The :attribute must be a number.',
'regex' => 'The :attribute format is invalid.',
'required' => 'The :attribute field is required.',
'required_if' => 'The :attribute field is required when :other is :value.',
'required_with' => 'The :attribute field is required when :values is present.',
'required_with_all' => 'The :attribute field is required when :values is present.',
'required_without' => 'The :attribute field is required when :values is not present.',
'required_without_all' => 'The :attribute field is required when none of :values are present.',
'same' => 'The :attribute and :other must match.',
'size' => [
'numeric' => 'The :attribute must be :size.',
'file' => 'The :attribute must be :size kilobytes.',
'string' => 'The :attribute must be :size characters.',
'array' => 'The :attribute must contain :size items.',
],
"unique" => "The :attribute has already been taken.",
"url" => "The :attribute format is invalid.",
"timezone" => "The :attribute must be a valid zone.",
'unique' => 'The :attribute has already been taken.',
'url' => 'The :attribute format is invalid.',
'timezone' => 'The :attribute must be a valid zone.',
/*
|--------------------------------------------------------------------------