Merge pull request #23 from ladybirdweb/analysis-qrdwWQ

Applied fixes from StyleCI
This commit is contained in:
Sujit Prasad
2016-02-24 20:49:51 +05:30
4 changed files with 23 additions and 100 deletions

View File

@@ -4,7 +4,6 @@ namespace App\Exceptions;
// controller
use App\Http\Controllers\Common\PhpMailController;
use Exception;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
@@ -19,11 +18,11 @@ class Handler extends ExceptionHandler
'Symfony\Component\HttpKernel\Exception\HttpException',
];
/**
* Create a new controller instance.
* constructor to check
* 1. php mailer
* 1. php mailer.
*
* @return void
*/
public function __construct(PhpMailController $PhpMailController)
@@ -31,7 +30,6 @@ class Handler extends ExceptionHandler
$this->PhpMailController = $PhpMailController;
}
/**
* Report or log an exception.
*
@@ -50,7 +48,7 @@ class Handler extends ExceptionHandler
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
* @param \Exception $e
* @param \Exception $e
*
* @return \Illuminate\Http\Response
*/
@@ -58,7 +56,6 @@ class Handler extends ExceptionHandler
{
if ($e instanceof \Tymon\JWTAuth\Exceptions\TokenExpiredException) {
return response()->json(['message' => $e->getMessage(), 'code' => $e->getStatusCode()]);
} elseif ($e instanceof \Tymon\JWTAuth\Exceptions\TokenInvalidException) {
return response()->json(['message' => $e->getMessage(), 'code' => $e->getStatusCode()]);
}
@@ -71,10 +68,11 @@ class Handler extends ExceptionHandler
// checking if the application is installed
if (\Config::get('database.install') == 1) {
// checking if the error log send to Ladybirdweb is enabled or not
if(\Config::get('app.ErrorLog') == '%1%') {
$this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('1', '0'), $to = ['name' => 'faveo logger', 'email' => 'faveoerrorlogger@gmail.com'], $message = ['subject' => 'Faveo downloaded from github has occured error', 'scenario'=>'error-report'], $template_variables = ['e' => $e]);
if (\Config::get('app.ErrorLog') == '%1%') {
$this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('1', '0'), $to = ['name' => 'faveo logger', 'email' => 'faveoerrorlogger@gmail.com'], $message = ['subject' => 'Faveo downloaded from github has occured error', 'scenario' => 'error-report'], $template_variables = ['e' => $e]);
}
}
return response()->view('errors.500', []);
}
}
@@ -95,8 +93,10 @@ class Handler extends ExceptionHandler
}
/**
* function to generate oops error page
* function to generate oops error page.
*
* @param \Exception $e
*
* @return \Illuminate\Http\Response
*/
protected function renderExceptionWithWhoops(Exception $e)

View File

@@ -32,14 +32,14 @@ use App\Model\helpdesk\Utility\Timezones;
use App\User;
use Auth;
use DB;
use UTC;
// classes
use Exception;
// classes
use Hash;
use Illuminate\support\Collection;
use Input;
use Mail;
use PDF;
use UTC;
/**
* TicketController.
@@ -91,7 +91,7 @@ class TicketController extends Controller
$string = substr($stringCut, 0, strrpos($stringCut, ' ')).' ...';
}
} else {
$string = "(no subject)";
$string = '(no subject)';
}
//collabrations
$collaborators = DB::table('ticket_collaborator')->where('ticket_id', '=', $ticket->id)->get();
@@ -191,6 +191,7 @@ class TicketController extends Controller
$dept = Department::where('id', '=', Auth::user()->primary_dpt)->first();
$tickets = Tickets::where('status', '=', 1)->where('isanswered', '=', 0)->where('assigned_to', '=', 0)->where('dept_id', '=', $dept->id)->get();
}
return \Datatable::collection(new Collection($tickets))
->addColumn('id', function ($ticket) {
return "<input type='checkbox' name='select_all[]' class='icheckbox_flat-blue' value='".$ticket->id."'></input>";
@@ -204,7 +205,7 @@ class TicketController extends Controller
$string = substr($stringCut, 0, strrpos($stringCut, ' ')).' ...';
}
} else {
$string = "(no subject)";
$string = '(no subject)';
}
//collabrations
$collaborators = DB::table('ticket_collaborator')->where('ticket_id', '=', $ticket->id)->get();
@@ -316,7 +317,7 @@ class TicketController extends Controller
$string = substr($stringCut, 0, strrpos($stringCut, ' ')).' ...';
}
} else {
$string = "(no subject)";
$string = '(no subject)';
}
//collabrations
$collaborators = DB::table('ticket_collaborator')->where('ticket_id', '=', $ticket->id)->get();
@@ -423,7 +424,7 @@ class TicketController extends Controller
$string = substr($stringCut, 0, strrpos($stringCut, ' ')).' ...';
}
} else {
$string = "(no subject)";
$string = '(no subject)';
}
//collabrations
$collaborators = DB::table('ticket_collaborator')->where('ticket_id', '=', $ticket->id)->get();
@@ -540,7 +541,7 @@ class TicketController extends Controller
$string = substr($stringCut, 0, strrpos($stringCut, ' ')).' ...';
}
} else {
$string = "(no subject)";
$string = '(no subject)';
}
//collabrations
$collaborators = DB::table('ticket_collaborator')->where('ticket_id', '=', $ticket->id)->get();
@@ -646,7 +647,7 @@ class TicketController extends Controller
$string = substr($stringCut, 0, strrpos($stringCut, ' ')).' ...';
}
} else {
$string = "(no subject)";
$string = '(no subject)';
}
//collabrations
$collaborators = DB::table('ticket_collaborator')->where('ticket_id', '=', $ticket->id)->get();
@@ -1036,8 +1037,6 @@ class TicketController extends Controller
* @param type $emailadd
* @param type $username
* @param type $subject
*
@param type $body
* @param type $phone
* @param type $helptopic
* @param type $sla
@@ -1921,7 +1920,7 @@ class TicketController extends Controller
$string = substr($stringCut, 0, strrpos($stringCut, ' ')).' ...';
}
} else {
$string = "(no subject)";
$string = '(no subject)';
}
//collabrations
$collaborators = DB::table('ticket_collaborator')->where('ticket_id', '=', $ticket->id)->get();
@@ -2033,7 +2032,7 @@ class TicketController extends Controller
$string = substr($stringCut, 0, strrpos($stringCut, ' ')).' ...';
}
} else {
$string = "(no subject)";
$string = '(no subject)';
}
//collabrations
$collaborators = DB::table('ticket_collaborator')->where('ticket_id', '=', $ticket->id)->get();

View File

@@ -281,13 +281,11 @@ class InstallController extends Controller
// checking is the installation was done previously
try {
$check_for_pre_installation = System::all();
if($check_for_pre_installation) {
if ($check_for_pre_installation) {
return redirect()->back()->with('fails', 'The data in database already exist. Please provide fresh database');
}
}
} catch (Exception $e) {
}
// migrate database
Artisan::call('migrate', ['--force' => true]);

View File

@@ -143,80 +143,6 @@ return [
//
/*
* Laravel Framework Service Providers...
*/
@@ -319,7 +245,7 @@ return [
'SMTPS' => 'App\Http\Controllers\HomeController',
'Datatable' => 'Chumper\Datatable\Facades\DatatableFacade',
'Zipper' => 'Chumper\Zipper\Zipper',
'Image' => Intervention\Image\Facades\Image::class,
'Image' => Intervention\Image\Facades\Image::class,
'JWTAuth' => 'Tymon\JWTAuth\Facades\JWTAuth',
'JWTFactory' => 'Tymon\JWTAuth\Facades\JWTFactory',