Apply fixes from StyleCI

This commit is contained in:
Manish Verma
2018-08-06 05:18:13 +00:00
committed by StyleCI Bot
parent 4ec6000d69
commit c547b2e438
41 changed files with 373 additions and 308 deletions

View File

@@ -9,8 +9,8 @@ use App\Model\helpdesk\Ticket\Ticket_Thread;
use Config; use Config;
use Storage; use Storage;
class StorageController extends Controller { class StorageController extends Controller
{
protected $default; protected $default;
protected $driver; protected $driver;
protected $root; protected $root;
@@ -25,7 +25,8 @@ class StorageController extends Controller {
protected $rackspace_endpoint; protected $rackspace_endpoint;
protected $rackspace_url_type; protected $rackspace_url_type;
public function __construct() { public function __construct()
{
$this->default = $this->defaults(); $this->default = $this->defaults();
$this->driver = $this->driver(); $this->driver = $this->driver();
$this->root = $this->root(); $this->root = $this->root();
@@ -40,7 +41,8 @@ class StorageController extends Controller {
$this->rackspace_username = $this->rackspaceUsername(); $this->rackspace_username = $this->rackspaceUsername();
} }
protected function settings($option) { protected function settings($option)
{
$settings = new CommonSettings(); $settings = new CommonSettings();
$setting = $settings->getOptionValue('storage', $option); $setting = $settings->getOptionValue('storage', $option);
$value = ''; $value = '';
@@ -51,7 +53,8 @@ class StorageController extends Controller {
return $value; return $value;
} }
public function defaults() { public function defaults()
{
$default = 'local'; $default = 'local';
if ($this->settings('default')) { if ($this->settings('default')) {
$default = $this->settings('default'); $default = $this->settings('default');
@@ -60,11 +63,13 @@ class StorageController extends Controller {
return $default; return $default;
} }
public function driver() { public function driver()
{
return $this->settings('default'); return $this->settings('default');
} }
public function root() { public function root()
{
$root = storage_path('app'); $root = storage_path('app');
if ($this->settings('root')) { if ($this->settings('root')) {
$root = $this->settings('root'); $root = $this->settings('root');
@@ -73,47 +78,58 @@ class StorageController extends Controller {
return $root; return $root;
} }
public function s3Key() { public function s3Key()
{
return $this->settings('s3_key'); return $this->settings('s3_key');
} }
public function s3Region() { public function s3Region()
{
return $this->settings('s3_region'); return $this->settings('s3_region');
} }
public function s3Secret() { public function s3Secret()
{
return $this->settings('s3_secret'); return $this->settings('s3_secret');
} }
public function s3Bucket() { public function s3Bucket()
{
return $this->settings('s3_bucket'); return $this->settings('s3_bucket');
} }
public function rackspaceKey() { public function rackspaceKey()
{
return $this->settings('root'); return $this->settings('root');
} }
public function rackspaceRegion() { public function rackspaceRegion()
{
return $this->settings('rackspace_region'); return $this->settings('rackspace_region');
} }
public function rackspaceUsername() { public function rackspaceUsername()
{
return $this->settings('rackspace_username'); return $this->settings('rackspace_username');
} }
public function rackspaceContainer() { public function rackspaceContainer()
{
return $this->settings('rackspace_container'); return $this->settings('rackspace_container');
} }
public function rackspaceEndpoint() { public function rackspaceEndpoint()
{
return $this->settings('rackspace_endpoint'); return $this->settings('rackspace_endpoint');
} }
public function rackspaceUrlType() { public function rackspaceUrlType()
{
return $this->settings('rackspace_url_type'); return $this->settings('rackspace_url_type');
} }
protected function setFileSystem() { protected function setFileSystem()
{
$config = $this->config(); $config = $this->config();
//dd($config); //dd($config);
foreach ($config as $key => $con) { foreach ($config as $key => $con) {
@@ -128,40 +144,43 @@ class StorageController extends Controller {
return Config::get('filesystem'); return Config::get('filesystem');
} }
protected function config() { protected function config()
{
return [ return [
'default' => $this->default, 'default' => $this->default,
'cloud' => 's3', 'cloud' => 's3',
'disks' => $this->disks(), 'disks' => $this->disks(),
]; ];
} }
protected function disks() { protected function disks()
{
return [ return [
'local' => [ 'local' => [
'driver' => 'local', 'driver' => 'local',
'root' => $this->root . '/attachments', 'root' => $this->root.'/attachments',
], ],
's3' => [ 's3' => [
'driver' => 's3', 'driver' => 's3',
'key' => $this->s3_key, 'key' => $this->s3_key,
'secret' => $this->s3_secret, 'secret' => $this->s3_secret,
'region' => $this->s3_region, 'region' => $this->s3_region,
'bucket' => $this->s3_bucket, 'bucket' => $this->s3_bucket,
], ],
'rackspace' => [ 'rackspace' => [
'driver' => 'rackspace', 'driver' => 'rackspace',
'username' => $this->rackspace_username, 'username' => $this->rackspace_username,
'key' => $this->rackspace_key, 'key' => $this->rackspace_key,
'container' => $this->rackspace_container, 'container' => $this->rackspace_container,
'endpoint' => $this->rackspace_endpoint, 'endpoint' => $this->rackspace_endpoint,
'region' => $this->rackspace_region, 'region' => $this->rackspace_region,
'url_type' => $this->rackspace_url_type, 'url_type' => $this->rackspace_url_type,
], ],
]; ];
} }
public function upload($data, $filename, $type, $size, $disposition, $thread_id) { public function upload($data, $filename, $type, $size, $disposition, $thread_id)
{
$upload = new Ticket_attachments(); $upload = new Ticket_attachments();
$upload->thread_id = $thread_id; $upload->thread_id = $thread_id;
$upload->name = $filename; $upload->name = $filename;
@@ -169,11 +188,11 @@ class StorageController extends Controller {
$upload->size = $size; $upload->size = $size;
$upload->poster = $disposition; $upload->poster = $disposition;
$upload->driver = $this->default; $upload->driver = $this->default;
$upload->path = $this->root. DIRECTORY_SEPARATOR.'attachments'; $upload->path = $this->root.DIRECTORY_SEPARATOR.'attachments';
if ($this->default !== 'database') { if ($this->default !== 'database') {
$this->setFileSystem(); $this->setFileSystem();
Storage::disk($this->default)->put($filename, $data); Storage::disk($this->default)->put($filename, $data);
$storagePath = Storage::disk($this->default)->getDriver()->getAdapter()->getPathPrefix() . $filename; $storagePath = Storage::disk($this->default)->getDriver()->getAdapter()->getPathPrefix().$filename;
if (mime(\File::mimeType($storagePath)) != 'image' || mime(\File::extension($storagePath)) != 'image') { if (mime(\File::mimeType($storagePath)) != 'image' || mime(\File::extension($storagePath)) != 'image') {
chmod($storagePath, 1204); chmod($storagePath, 1204);
} }
@@ -185,23 +204,23 @@ class StorageController extends Controller {
} }
} }
public function saveAttachments($thread_id, $attachments = []) { public function saveAttachments($thread_id, $attachments = [])
{
$disposition = 'ATTACHMENT'; $disposition = 'ATTACHMENT';
$thread = ''; $thread = '';
foreach ($attachments as $attachment) { foreach ($attachments as $attachment) {
if (is_object($attachment)) { if (is_object($attachment)) {
if (method_exists($attachment, 'getStructure')) { if (method_exists($attachment, 'getStructure')) {
$structure = $attachment->getStructure(); $structure = $attachment->getStructure();
if (isset($structure->disposition)) { if (isset($structure->disposition)) {
$disposition = $structure->disposition; $disposition = $structure->disposition;
} }
$filename = rand(1111, 9999) . "_" . $attachment->getFileName(); $filename = rand(1111, 9999).'_'.$attachment->getFileName();
$type = $attachment->getMimeType(); $type = $attachment->getMimeType();
$size = $attachment->getSize(); $size = $attachment->getSize();
$data = $attachment->getData(); $data = $attachment->getData();
} else { } else {
$filename = rand(1111, 9999) . "_" . $attachment->getClientOriginalName(); $filename = rand(1111, 9999).'_'.$attachment->getClientOriginalName();
$type = $attachment->getMimeType(); $type = $attachment->getMimeType();
$size = $attachment->getSize(); $size = $attachment->getSize();
$data = file_get_contents($attachment->getRealPath()); $data = file_get_contents($attachment->getRealPath());
@@ -210,10 +229,12 @@ class StorageController extends Controller {
$thread = $this->updateBody($attachment, $thread_id, $filename); $thread = $this->updateBody($attachment, $thread_id, $filename);
} }
} }
return $thread; return $thread;
} }
public function updateBody($attachment, $thread_id, $filename) { public function updateBody($attachment, $thread_id, $filename)
{
$threads = new Ticket_Thread(); $threads = new Ticket_Thread();
$thread = $threads->find($thread_id); $thread = $threads->find($thread_id);
$disposition = 'ATTACHMENT'; $disposition = 'ATTACHMENT';
@@ -225,27 +246,29 @@ class StorageController extends Controller {
} }
} }
} }
if ($disposition == 'INLINE' || $disposition == 'inline') { if ($disposition == 'INLINE' || $disposition == 'inline') {
$id = str_replace('>', '', str_replace('<', '', $structure->id)); $id = str_replace('>', '', str_replace('<', '', $structure->id));
$body = $thread->body; $body = $thread->body;
// dd($id,$filename,$body); // dd($id,$filename,$body);
$body = str_replace('cid:' . $id, $filename, $body); $body = str_replace('cid:'.$id, $filename, $body);
// dd($body); // dd($body);
$thread->body = $body; $thread->body = $body;
$thread->save(); $thread->save();
} }
return $thread; return $thread;
} }
public function getFile($drive, $name, $root) { public function getFile($drive, $name, $root)
if ($drive != "database") { {
$root = $root . DIRECTORY_SEPARATOR . $name; if ($drive != 'database') {
$root = $root.DIRECTORY_SEPARATOR.$name;
if (\File::exists($root)) { if (\File::exists($root)) {
chmod($root, 0755); chmod($root, 0755);
return \File::get($root); return \File::get($root);
} }
} }
} }
} }

View File

@@ -58,26 +58,26 @@ class Finder
return $group->first()->name; return $group->first()->name;
} }
/** /**
* STATUS TYPE * STATUS TYPE
* This function is used for returning status type name with respect to id. * This function is used for returning status type name with respect to id.
* *
* @param $id type int * @param $id type int
* @param $custom type array/null * @param $custom type array/null
* *
* @return type string * @return type string
*/ */
public static function statusType($id, $custom = null) public static function statusType($id, $custom = null)
{ {
if ($custom == null) { if ($custom == null) {
$status_type = TicketStatusType::whereId($id)->select(['name']); $status_type = TicketStatusType::whereId($id)->select(['name']);
} elseif (isset($custom)) { } elseif (isset($custom)) {
$status_type = TicketStatusType::whereId($id)->select($custom); $status_type = TicketStatusType::whereId($id)->select($custom);
}
return $status_type->first()->name;
} }
return $status_type->first()->name;
}
/** /**
* STATUS * STATUS
* This function is used for returning status name with respect to id. * This function is used for returning status name with respect to id.
@@ -137,48 +137,48 @@ class Finder
} }
} }
/** /**
* ANY TYPE STATUS * ANY TYPE STATUS
* This function is used to return the set of status which are of any type passed in the param. * This function is used to return the set of status which are of any type passed in the param.
* *
* @param type $id * @param type $id
* *
* @return type array * @return type array
*/ */
public static function anyTypeStatus($id) public static function anyTypeStatus($id)
{ {
$status_group = Ticket_Status::where('purpose_of_status', '=', $id)->select(['id'])->get(); $status_group = Ticket_Status::where('purpose_of_status', '=', $id)->select(['id'])->get();
foreach ($status_group as $status) { foreach ($status_group as $status) {
$status_group2[] = $status->id; $status_group2[] = $status->id;
}
return $status_group2;
} }
/** return $status_group2;
* RETURNS ALL STATUS }
* This function is used to return all the status given in the system.
*
* @return type array
*/
public static function getAllStatus()
{
$status = Ticket_Status::where('purpose_of_status', '!=', 3)->orwhere('purpose_of_status', '!=', 4)->get();
return $status; /**
* RETURNS ALL STATUS
* This function is used to return all the status given in the system.
*
* @return type array
*/
public static function getAllStatus()
{
$status = Ticket_Status::where('purpose_of_status', '!=', 3)->orwhere('purpose_of_status', '!=', 4)->get();
return $status;
}
/**
* VARIABLE REPLACEMENT
* This function is used to replace the replaceable variables form a given content for templates.
*/
public static function replaceTemplateVariables($variables, $data, $contents)
{
foreach ($variables as $key => $variable) {
$messagebody = str_replace($variables[$key], $data[$key], $contents);
$contents = $messagebody;
} }
/** return $contents;
* VARIABLE REPLACEMENT }
* This function is used to replace the replaceable variables form a given content for templates.
*/
public static function replaceTemplateVariables($variables, $data, $contents)
{
foreach ($variables as $key => $variable) {
$messagebody = str_replace($variables[$key], $data[$key], $contents);
$contents = $messagebody;
}
return $contents;
}
} }

View File

@@ -271,10 +271,12 @@ class AgentController extends Controller
$team_assign_agent = $team_assign_agent->where('agent_id', $id); $team_assign_agent = $team_assign_agent->where('agent_id', $id);
$team_assign_agent->delete(); $team_assign_agent->delete();
$user = $user->whereId($id)->first(); $user = $user->whereId($id)->first();
try { try {
$error = Lang::get('lang.this_staff_is_related_to_some_tickets'); $error = Lang::get('lang.this_staff_is_related_to_some_tickets');
$user->id; $user->id;
$user->delete(); $user->delete();
throw new \Exception($error); throw new \Exception($error);
return redirect('agents')->with('success', Lang::get('lang.agent_deleted_sucessfully')); return redirect('agents')->with('success', Lang::get('lang.agent_deleted_sucessfully'));
} catch (\Exception $e) { } catch (\Exception $e) {

View File

@@ -428,6 +428,7 @@ class EmailsController extends Controller
return redirect('emails')->with('fails', Lang::get('lang.you_cannot_delete_system_default_email')); return redirect('emails')->with('fails', Lang::get('lang.you_cannot_delete_system_default_email'));
} }
} }
try { try {
// fetching the database instance of the current email // fetching the database instance of the current email
$emails = $email->whereId($id)->first(); $emails = $email->whereId($id)->first();

View File

@@ -106,6 +106,7 @@ class FormController extends Controller
return view('themes.default1.admin.helpdesk.manage.form.preview', compact('form', 'fields')); return view('themes.default1.admin.helpdesk.manage.form.preview', compact('form', 'fields'));
} }
throw new Exception("Sorry we can't find your request"); throw new Exception("Sorry we can't find your request");
} catch (Exception $ex) { } catch (Exception $ex) {
return redirect()->back()->with('fails', $ex->getMessage()); return redirect()->back()->with('fails', $ex->getMessage());
@@ -125,6 +126,7 @@ class FormController extends Controller
'name.*' => 'required', 'name.*' => 'required',
'type.*' => 'required', 'type.*' => 'required',
]); ]);
try { try {
$forms = new Forms(); $forms = new Forms();
$require = Input::get('required'); $require = Input::get('required');
@@ -195,6 +197,7 @@ class FormController extends Controller
//dd($fields); //dd($fields);
return view('themes.default1.admin.helpdesk.manage.form.edit', compact('form', 'fields', 'select_forms')); return view('themes.default1.admin.helpdesk.manage.form.edit', compact('form', 'fields', 'select_forms'));
} }
throw new Exception("Sorry we can't find your request"); throw new Exception("Sorry we can't find your request");
} catch (Exception $ex) { } catch (Exception $ex) {
return redirect()->back()->with('fails', $ex->getMessage()); return redirect()->back()->with('fails', $ex->getMessage());
@@ -213,6 +216,7 @@ class FormController extends Controller
//dd($fields); //dd($fields);
return view('themes.default1.admin.helpdesk.manage.form.add-child', compact('form', 'fields', 'select_forms')); return view('themes.default1.admin.helpdesk.manage.form.add-child', compact('form', 'fields', 'select_forms'));
} }
throw new Exception("Sorry we can't find your request"); throw new Exception("Sorry we can't find your request");
} catch (Exception $ex) { } catch (Exception $ex) {
return redirect()->back()->with('fails', $ex->getMessage()); return redirect()->back()->with('fails', $ex->getMessage());
@@ -227,6 +231,7 @@ class FormController extends Controller
'name.*' => 'required', 'name.*' => 'required',
'type.*' => 'required', 'type.*' => 'required',
]); ]);
try { try {
if (!$request->input('formname')) { if (!$request->input('formname')) {
throw new Exception(Lang::get('lang.please_fill_form_name')); throw new Exception(Lang::get('lang.please_fill_form_name'));
@@ -391,6 +396,7 @@ class FormController extends Controller
public function addChild($fieldid, Request $request) public function addChild($fieldid, Request $request)
{ {
$ids = $request->except('_token'); $ids = $request->except('_token');
try { try {
foreach ($ids as $valueid => $formid) { foreach ($ids as $valueid => $formid) {
$field_value = new \App\Model\helpdesk\Form\FieldValue(); $field_value = new \App\Model\helpdesk\Form\FieldValue();

View File

@@ -46,7 +46,7 @@ class PriorityController extends Controller
$user_status = CommonSettings::where('option_name', '=', 'user_priority')->first(); $user_status = CommonSettings::where('option_name', '=', 'user_priority')->first();
// dd( $user_status); // dd( $user_status);
return view('themes.default1.admin.helpdesk.manage.ticket_priority.index', compact('user_status')); return view('themes.default1.admin.helpdesk.manage.ticket_priority.index', compact('user_status'));
} }
/** /**
@@ -172,7 +172,7 @@ class PriorityController extends Controller
public function destroy($priority_id) public function destroy($priority_id)
{ {
$default_priority = Ticket_Priority::where('is_default', '>', '0')->first(); $default_priority = Ticket_Priority::where('is_default', '>', '0')->first();
// dd($default_priority->is_default); // dd($default_priority->is_default);
$topic = DB::table('help_topic')->where('priority', '=', $priority_id)->update(['priority' => $default_priority->is_default]); $topic = DB::table('help_topic')->where('priority', '=', $priority_id)->update(['priority' => $default_priority->is_default]);
// if ($topic > 0) { // if ($topic > 0) {
// if ($topic > 1) { // if ($topic > 1) {

View File

@@ -150,8 +150,8 @@ class SettingsController2 extends Controller
public function createStatuses(\App\Model\helpdesk\Ticket\Ticket_Status $statuss) public function createStatuses(\App\Model\helpdesk\Ticket\Ticket_Status $statuss)
{ {
// try { // try {
/* fetch the values of company from company table */ /* fetch the values of company from company table */
$statuss->name = Input::get('name'); $statuss->name = Input::get('name');
$statuss->icon_class = Input::get('icon_class'); $statuss->icon_class = Input::get('icon_class');
$statuss->email_user = Input::get('email_user'); $statuss->email_user = Input::get('email_user');
$statuss->sort = Input::get('sort'); $statuss->sort = Input::get('sort');
@@ -164,7 +164,7 @@ class SettingsController2 extends Controller
$statuss->sort = Input::get('sort'); $statuss->sort = Input::get('sort');
$statuss->save(); $statuss->save();
/* Direct to Company Settings Page */ /* Direct to Company Settings Page */
return redirect()->back()->with('success', 'Status has been created!'); return redirect()->back()->with('success', 'Status has been created!');
// } catch (Exception $ex) { // } catch (Exception $ex) {
// return redirect()->back()->with('fails', $ex->errorInfo[2]); // return redirect()->back()->with('fails', $ex->errorInfo[2]);
// } // }
@@ -175,9 +175,9 @@ class SettingsController2 extends Controller
try { try {
if ($id > 5) { if ($id > 5) {
/* fetch the values of company from company table */ /* fetch the values of company from company table */
\App\Model\helpdesk\Ticket\Ticket_Status::whereId($id)->delete(); \App\Model\helpdesk\Ticket\Ticket_Status::whereId($id)->delete();
/* Direct to Company Settings Page */ /* Direct to Company Settings Page */
return redirect()->back()->with('success', 'Status has been deleted'); return redirect()->back()->with('success', 'Status has been deleted');
} else { } else {
return redirect()->back()->with('failed', 'You cannot delete this status'); return redirect()->back()->with('failed', 'You cannot delete this status');
} }
@@ -446,12 +446,12 @@ class SettingsController2 extends Controller
public function getSchedular(Email $email, Template $template, Emails $email1) public function getSchedular(Email $email, Template $template, Emails $email1)
{ {
// try { // try {
/* fetch the values of email from Email table */ /* fetch the values of email from Email table */
$emails = $email->whereId('1')->first(); $emails = $email->whereId('1')->first();
/* Fetch the values from Template table */ /* Fetch the values from Template table */
$templates = $template->get(); $templates = $template->get();
/* Fetch the values from Emails table */ /* Fetch the values from Emails table */
$emails1 = $email1->get(); $emails1 = $email1->get();
return view('themes.default1.admin.helpdesk.settings.crone', compact('emails', 'templates', 'emails1')); return view('themes.default1.admin.helpdesk.settings.crone', compact('emails', 'templates', 'emails1'));
// } catch { // } catch {
@@ -503,7 +503,7 @@ class SettingsController2 extends Controller
// try { // try {
// /* fetch the values of access from access table */ // /* fetch the values of access from access table */
// $accesses = $access->whereId('1')->first(); // $accesses = $access->whereId('1')->first();
// // Direct to Access Settings Page // // Direct to Access Settings Page
// return view('themes.default1.admin.helpdesk.settings.access', compact('accesses')); // return view('themes.default1.admin.helpdesk.settings.access', compact('accesses'));
// } catch (Exception $e) { // } catch (Exception $e) {
// return view('404'); // return view('404');

View File

@@ -32,6 +32,7 @@ class SocialMediaController extends Controller
'client_secret' => 'required', 'client_secret' => 'required',
'redirect' => 'required|url', 'redirect' => 'required|url',
]); ]);
try { try {
$requests = $request->except('_token'); $requests = $request->except('_token');
$this->insertProvider($provider, $requests); $this->insertProvider($provider, $requests);

View File

@@ -143,16 +143,16 @@ class TeamController extends Controller
{ {
// dd($request); // dd($request);
// $id = $request->input('show_id'); // $id = $request->input('show_id');
// dd($id); // dd($id);
$users = DB::table('team_assign_agent')->select('team_assign_agent.id', 'team_assign_agent.team_id', 'users.user_name', 'users.first_name', 'users.last_name', 'users.active', 'users.assign_group', 'users.primary_dpt', 'users.role') $users = DB::table('team_assign_agent')->select('team_assign_agent.id', 'team_assign_agent.team_id', 'users.user_name', 'users.first_name', 'users.last_name', 'users.active', 'users.assign_group', 'users.primary_dpt', 'users.role')
->join('users', 'users.id', '=', 'team_assign_agent.agent_id') ->join('users', 'users.id', '=', 'team_assign_agent.agent_id')
->where('team_assign_agent.team_id', '=', $id); ->where('team_assign_agent.team_id', '=', $id);
// ->get(); // ->get();
// dd($users); // dd($users);
return \Datatable::query($users) return \Datatable::query($users)
->showColumns('user_name') ->showColumns('user_name')
->addColumn('first_name', function ($model) { ->addColumn('first_name', function ($model) {

View File

@@ -157,11 +157,11 @@ class TemplateController extends Controller
$fname = Input::get('folder_name'); $fname = Input::get('folder_name');
$filename = $directory.$fname; $filename = $directory.$fname;
// images folder creation using php // images folder creation using php
// $mydir = dirname( __FILE__ )."/html/images"; // $mydir = dirname( __FILE__ )."/html/images";
// if(!is_dir($mydir)){ // if(!is_dir($mydir)){
// mkdir("html/images"); // mkdir("html/images");
// } // }
// Move all images files // Move all images files
if (!file_exists($filename)) { if (!file_exists($filename)) {

View File

@@ -91,7 +91,7 @@ RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]\n";
public function changeHttp() public function changeHttp()
{ {
//$string = "RewriteCond %{HTTPS} off //$string = "RewriteCond %{HTTPS} off
//RewriteRule ^(.*)$ http://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]\n"; //RewriteRule ^(.*)$ http://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]\n";
$string = ''; $string = '';
return $string; return $string;

View File

@@ -149,6 +149,7 @@ class WorkflowController extends Controller
$email_data["E-$key"] = $email; $email_data["E-$key"] = $email;
} }
$emails = $email_data; $emails = $email_data;
try { try {
return view('themes.default1.admin.helpdesk.manage.workflow.create', compact('emails')); return view('themes.default1.admin.helpdesk.manage.workflow.create', compact('emails'));
} catch (Exception $e) { } catch (Exception $e) {

View File

@@ -232,7 +232,7 @@ class FilterController extends Controller
public function table() public function table()
{ {
// if (Auth::user()->role == 'admin') { // if (Auth::user()->role == 'admin') {
$ticket = new Tickets(); $ticket = new Tickets();
$tickets = $ticket $tickets = $ticket
->leftJoin('ticket_thread', function ($join) { ->leftJoin('ticket_thread', function ($join) {
$join->on('tickets.id', '=', 'ticket_thread.ticket_id') $join->on('tickets.id', '=', 'ticket_thread.ticket_id')

View File

@@ -37,10 +37,11 @@ use App\Model\helpdesk\Utility\Date_time_format;
use App\Model\helpdesk\Utility\Timezones; use App\Model\helpdesk\Utility\Timezones;
use App\User; use App\User;
use Auth; use Auth;
use Crypt;
use DB; use DB;
use Exception; use Exception;
use GeoIP;
// classes // classes
use GeoIP;
use Hash; use Hash;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\support\Collection; use Illuminate\support\Collection;
@@ -49,7 +50,6 @@ use Lang;
use Mail; use Mail;
use PDF; use PDF;
use UTC; use UTC;
use Crypt;
/** /**
* TicketController. * TicketController.
@@ -398,6 +398,7 @@ class TicketController extends Controller
public function reply(Ticket_Thread $thread, Request $request, Ticket_attachments $ta, $mail = true, $system_reply = true, $user_id = '') public function reply(Ticket_Thread $thread, Request $request, Ticket_attachments $ta, $mail = true, $system_reply = true, $user_id = '')
{ {
\Event::fire('reply.request', [$request]); \Event::fire('reply.request', [$request]);
try { try {
if (is_array($request->file('attachment'))) { if (is_array($request->file('attachment'))) {
} else { } else {
@@ -541,9 +542,9 @@ class TicketController extends Controller
], ],
$template_variables = [ $template_variables = [
'ticket_number' => $ticket_number, 'ticket_number' => $ticket_number,
'user' => $username, 'user' => $username,
'agent_sign' => $agentsign, 'agent_sign' => $agentsign,
'system_link'=>$link 'system_link' => $link,
] ]
); );
} }
@@ -810,6 +811,7 @@ class TicketController extends Controller
} }
// Event fire // Event fire
\Event::fire(new \App\Events\ReadMailEvent($user_id, $password)); \Event::fire(new \App\Events\ReadMailEvent($user_id, $password));
try { try {
if ($auto_response == 0) { if ($auto_response == 0) {
$this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('1', '0'), $to = ['name' => $user->first_name, 'email' => $emailadd], $message = ['subject' => null, 'scenario' => 'registration-notification'], $template_variables = ['user' => $user->first_name, 'email_address' => $emailadd, 'user_password' => $password]); $this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('1', '0'), $to = ['name' => $user->first_name, 'email' => $emailadd], $message = ['subject' => null, 'scenario' => 'registration-notification'], $template_variables = ['user' => $user->first_name, 'email_address' => $emailadd, 'user_password' => $password]);
@@ -850,11 +852,11 @@ class TicketController extends Controller
if ($auto_response == 0) { if ($auto_response == 0) {
$encoded_ticketid = Crypt::encrypt($ticketdata->id); $encoded_ticketid = Crypt::encrypt($ticketdata->id);
$link = url('check_ticket/'.$encoded_ticketid); $link = url('check_ticket/'.$encoded_ticketid);
$this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('0', $ticketdata->dept_id), $to = ['name' => $username, 'email' => $emailadd], $message = ['subject' => $updated_subject, 'scenario' => 'create-ticket-by-agent', 'body' => $body], $this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('0', $ticketdata->dept_id), $to = ['name' => $username, 'email' => $emailadd], $message = ['subject' => $updated_subject, 'scenario' => 'create-ticket-by-agent', 'body' => $body],
$template_variables = [ $template_variables = [
'agent_sign' => Auth::user()->agent_sign, 'agent_sign' => Auth::user()->agent_sign,
'ticket_number' => $ticket_number2, 'ticket_number' => $ticket_number2,
'system_link'=>$link, 'system_link' => $link,
]); ]);
} }
} catch (\Exception $e) { } catch (\Exception $e) {
@@ -862,13 +864,14 @@ class TicketController extends Controller
} }
} else { } else {
$body2 = null; $body2 = null;
try { try {
if ($auto_response == 0) { if ($auto_response == 0) {
$this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('0', $ticketdata->dept_id), $to = ['name' => $username, 'email' => $emailadd], $message = ['subject' => $updated_subject, 'scenario' => 'create-ticket'], $this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('0', $ticketdata->dept_id), $to = ['name' => $username, 'email' => $emailadd], $message = ['subject' => $updated_subject, 'scenario' => 'create-ticket'],
$template_variables = ['user' => $username, $template_variables = ['user' => $username,
'ticket_number' => $ticket_number2, 'ticket_number' => $ticket_number2,
'department_sign' => '', 'department_sign' => '',
'system_link'=>$link, 'system_link' => $link,
]); ]);
} }
} catch (\Exception $e) { } catch (\Exception $e) {
@@ -1229,10 +1232,10 @@ class TicketController extends Controller
} else { } else {
$ticket_status = $ticket->where('id', '=', $id)->first(); $ticket_status = $ticket->where('id', '=', $id)->first();
} }
// checking for unautherised access attempt on other than owner ticket id // checking for unautherised access attempt on other than owner ticket id
if ($ticket_status == null) { if ($ticket_status == null) {
return redirect()->route('unauth'); return redirect()->route('unauth');
} }
$ticket_status->status = 3; $ticket_status->status = 3;
$ticket_status->closed = 1; $ticket_status->closed = 1;
$ticket_status->closed_at = date('Y-m-d H:i:s'); $ticket_status->closed_at = date('Y-m-d H:i:s');
@@ -1260,6 +1263,7 @@ class TicketController extends Controller
} else { } else {
$from_email = $sending_emails->id; $from_email = $sending_emails->id;
} }
try { try {
$this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('0', $ticket_status->dept_id), $to = ['name' => $user_name, 'email' => $email], $message = ['subject' => $ticket_subject.'[#'.$ticket_number.']', 'scenario' => 'close-ticket'], $template_variables = ['ticket_number' => $ticket_number]); $this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('0', $ticket_status->dept_id), $to = ['name' => $user_name, 'email' => $email], $message = ['subject' => $ticket_subject.'[#'.$ticket_number.']', 'scenario' => 'close-ticket'], $template_variables = ['ticket_number' => $ticket_number]);
} catch (\Exception $e) { } catch (\Exception $e) {
@@ -1496,6 +1500,7 @@ class TicketController extends Controller
$agent_email = $user_detail->email; $agent_email = $user_detail->email;
$ticket_link = route('ticket.thread', $id); $ticket_link = route('ticket.thread', $id);
$master = Auth::user()->first_name.' '.Auth::user()->last_name; $master = Auth::user()->first_name.' '.Auth::user()->last_name;
try { try {
$this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('0', $ticket->dept_id), $to = ['name' => $agent, 'email' => $agent_email], $message = ['subject' => $ticket_subject.'[#'.$ticket_number.']', 'scenario' => 'assign-ticket'], $template_variables = ['ticket_agent_name' => $agent, 'ticket_number' => $ticket_number, 'ticket_assigner' => $master, 'ticket_link' => $ticket_link]); $this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('0', $ticket->dept_id), $to = ['name' => $agent, 'email' => $agent_email], $message = ['subject' => $ticket_subject.'[#'.$ticket_number.']', 'scenario' => 'assign-ticket'], $template_variables = ['ticket_agent_name' => $agent, 'ticket_number' => $ticket_number, 'ticket_assigner' => $master, 'ticket_link' => $ticket_link]);
} catch (\Exception $e) { } catch (\Exception $e) {
@@ -1629,6 +1634,7 @@ class TicketController extends Controller
$create_user->password = Hash::make($password); $create_user->password = Hash::make($password);
$create_user->save(); $create_user->save();
$user_id = $create_user->id; $user_id = $create_user->id;
try { try {
$this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('1', '0'), $to = ['name' => $name, 'email' => $email], $message = ['subject' => 'password', 'scenario' => 'registration-notification'], $template_variables = ['user' => $name, 'email_address' => $email, 'user_password' => $password]); $this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('1', '0'), $to = ['name' => $name, 'email' => $email], $message = ['subject' => 'password', 'scenario' => 'registration-notification'], $template_variables = ['user' => $name, 'email_address' => $email, 'user_password' => $password]);
} catch (\Exception $e) { } catch (\Exception $e) {
@@ -2316,6 +2322,7 @@ class TicketController extends Controller
$user->role = 'user'; $user->role = 'user';
if ($user->save()) { if ($user->save()) {
$user_id = $user->id; $user_id = $user->id;
try { try {
$this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('1', '0'), $to = ['name' => $name, 'email' => $email], $message = ['subject' => 'Password', 'scenario' => 'registration-notification'], $template_variables = ['user' => $name, 'email_address' => $email, 'user_password' => $password]); $this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('1', '0'), $to = ['name' => $name, 'email' => $email], $message = ['subject' => 'Password', 'scenario' => 'registration-notification'], $template_variables = ['user' => $name, 'email_address' => $email, 'user_password' => $password]);
} catch (\Exception $e) { } catch (\Exception $e) {

View File

@@ -149,7 +149,7 @@ class UserController extends Controller
} }
// displaying list of users with chumper datatables // displaying list of users with chumper datatables
// return \Datatable::collection(User::where('role', "!=", "admin")->get()) // return \Datatable::collection(User::where('role', "!=", "admin")->get())
return \Datatables::of($users) return \Datatables::of($users)
/* column username */ /* column username */
->removeColumn('id', 'last_name', 'country_code', 'phone_number') ->removeColumn('id', 'last_name', 'country_code', 'phone_number')
->addColumn('user_name', function ($model) { ->addColumn('user_name', function ($model) {
@@ -218,14 +218,14 @@ class UserController extends Controller
if (Auth::user()->role == 'admin') { if (Auth::user()->role == 'admin') {
// @if(Auth::user()->role == 'admin') // @if(Auth::user()->role == 'admin')
return '<a href="'.route('user.show', $model->id).'" class="btn btn-primary btn-xs">'.\Lang::get('lang.view').'</a>'; return '<a href="'.route('user.show', $model->id).'" class="btn btn-primary btn-xs">'.\Lang::get('lang.view').'</a>';
} }
if (Auth::user()->role == 'agent') { if (Auth::user()->role == 'agent') {
// @if(Auth::user()->role == 'admin') // @if(Auth::user()->role == 'admin')
if ($model->role == 'user') { if ($model->role == 'user') {
return '<a href="'.route('user.show', $model->id).'" class="btn btn-primary btn-xs">'.\Lang::get('lang.view').'</a>'; return '<a href="'.route('user.show', $model->id).'" class="btn btn-primary btn-xs">'.\Lang::get('lang.view').'</a>';
} }
} }
} }
}) })
@@ -235,7 +235,7 @@ class UserController extends Controller
public function restoreUser($id) public function restoreUser($id)
{ {
// dd($id); // dd($id);
// $delete_all = Input::get('delete_all'); // $delete_all = Input::get('delete_all');
$users = User::where('id', '=', $id)->first(); $users = User::where('id', '=', $id)->first();
$users->is_delete = 0; $users->is_delete = 0;
$users->active = 1; $users->active = 1;
@@ -298,6 +298,7 @@ class UserController extends Controller
$password = $this->generateRandomString(); $password = $this->generateRandomString();
$user->password = Hash::make($password); $user->password = Hash::make($password);
$user->role = 'user'; $user->role = 'user';
try { try {
if ($request->get('country_code') == '' && ($request->get('phone_number') != '' || $request->get('mobile') != '')) { if ($request->get('country_code') == '' && ($request->get('phone_number') != '' || $request->get('mobile') != '')) {
return redirect()->back()->with(['fails' => Lang::get('lang.country-code-required-error'), 'country_code_error' => 1])->withInput(); return redirect()->back()->with(['fails' => Lang::get('lang.country-code-required-error'), 'country_code_error' => 1])->withInput();
@@ -514,19 +515,19 @@ class UserController extends Controller
// $ticket_logic4 = User_org::where('user_id', '=', $id)->update(['user_id' => $assign_to[1]]); // $ticket_logic4 = User_org::where('user_id', '=', $id)->update(['user_id' => $assign_to[1]]);
// } // }
// $thread2 = Ticket_Thread::where('ticket_id', '=', $ticket->id)->first(); // $thread2 = Ticket_Thread::where('ticket_id', '=', $ticket->id)->first();
// $thread2->body = 'This Ticket have been Reassigned to' .' '. $assignee; // $thread2->body = 'This Ticket have been Reassigned to' .' '. $assignee;
// $thread2->save(); // $thread2->save();
// UserNotification::where('notification_id', '=', $ticket->id)->delete(); // UserNotification::where('notification_id', '=', $ticket->id)->delete();
// $users = User::where('id', '=', $id)->get(); // $users = User::where('id', '=', $id)->get();
// $organization = User_org::where('user_id', '=', $id)->delete(); // $organization = User_org::where('user_id', '=', $id)->delete();
// Assign_team_agent::where('agent_id', '=', $id)->update(['agent_id' => $assign_to[1]]); // Assign_team_agent::where('agent_id', '=', $id)->update(['agent_id' => $assign_to[1]]);
$tickets = Tickets::where('assigned_to', '=', $id)->get(); $tickets = Tickets::where('assigned_to', '=', $id)->get();
foreach ($tickets as $ticket) { foreach ($tickets as $ticket) {
// code... // code...
$ticket->assigned_to = $assign_to[1]; $ticket->assigned_to = $assign_to[1];
$user_detail = User::where('id', '=', $assign_to[1])->first(); $user_detail = User::where('id', '=', $assign_to[1])->first();
$assignee = $user_detail->first_name.' '.$user_detail->last_name; $assignee = $user_detail->first_name.' '.$user_detail->last_name;
$ticket_number = $ticket->ticket_number; $ticket_number = $ticket->ticket_number;
@@ -561,20 +562,20 @@ class UserController extends Controller
} elseif ($delete_all == 1) { } elseif ($delete_all == 1) {
if ($delete_all) { if ($delete_all) {
// dd('here'); // dd('here');
$tickets = Tickets::where('assigned_to', '=', $id)->get(); $tickets = Tickets::where('assigned_to', '=', $id)->get();
// dd($tickets); // dd($tickets);
foreach ($tickets as $ticket) { foreach ($tickets as $ticket) {
$ticket->assigned_to = null; $ticket->assigned_to = null;
$ticket_number = $ticket->ticket_number; $ticket_number = $ticket->ticket_number;
$ticket->save(); $ticket->save();
$thread = new Ticket_Thread(); $thread = new Ticket_Thread();
$thread->ticket_id = $ticket->id; $thread->ticket_id = $ticket->id;
$thread->user_id = Auth::user()->id; $thread->user_id = Auth::user()->id;
$thread->is_internal = 1; $thread->is_internal = 1;
$thread->body = 'This Ticket has been unassigned '; $thread->body = 'This Ticket has been unassigned ';
$thread->save(); $thread->save();
} }
// $users = User::where('id', '=', $id)->get(); // $users = User::where('id', '=', $id)->get();
$user = User::find($id); $user = User::find($id);
$users->is_delete = 1; $users->is_delete = 1;
@@ -708,6 +709,7 @@ class UserController extends Controller
public function getProfile() public function getProfile()
{ {
$user = Auth::user(); $user = Auth::user();
try { try {
return view('themes.default1.agent.helpdesk.user.profile', compact('user')); return view('themes.default1.agent.helpdesk.user.profile', compact('user'));
} catch (Exception $e) { } catch (Exception $e) {
@@ -727,6 +729,7 @@ class UserController extends Controller
$phonecode = $code->where('iso', '=', $location->iso_code)->first(); $phonecode = $code->where('iso', '=', $location->iso_code)->first();
$settings = CommonSettings::select('status')->where('option_name', '=', 'send_otp')->first(); $settings = CommonSettings::select('status')->where('option_name', '=', 'send_otp')->first();
$status = $settings->status; $status = $settings->status;
try { try {
return view('themes.default1.agent.helpdesk.user.profile-edit', compact('user')) return view('themes.default1.agent.helpdesk.user.profile-edit', compact('user'))
->with(['phonecode' => $phonecode->phonecode, ->with(['phonecode' => $phonecode->phonecode,
@@ -766,13 +769,13 @@ class UserController extends Controller
$name = Input::file('profile_pic')->getClientOriginalName(); $name = Input::file('profile_pic')->getClientOriginalName();
// dd($name); // dd($name);
// dd(str_replace(" ", "_", $name)); // dd(str_replace(" ", "_", $name));
// fetching upload destination path // fetching upload destination path
$destinationPath = 'uploads/profilepic'; $destinationPath = 'uploads/profilepic';
// adding a random value to profile picture filename // adding a random value to profile picture filename
$fileName = rand(0000, 9999).'.'.str_replace(" ", "_", $name); $fileName = rand(0000, 9999).'.'.str_replace(' ', '_', $name);
// moving the picture to a destination folder // moving the picture to a destination folder
Input::file('profile_pic')->move($destinationPath, $fileName); Input::file('profile_pic')->move($destinationPath, $fileName);
// saving filename to database // saving filename to database
$user->profile_pic = $fileName; $user->profile_pic = $fileName;
} }
if ($request->get('mobile')) { if ($request->get('mobile')) {
@@ -805,6 +808,7 @@ class UserController extends Controller
// checking if the old password matches the new password // checking if the old password matches the new password
if (Hash::check($request->input('old_password'), $user->getAuthPassword())) { if (Hash::check($request->input('old_password'), $user->getAuthPassword())) {
$user->password = Hash::make($request->input('new_password')); $user->password = Hash::make($request->input('new_password'));
try { try {
$user->save(); $user->save();

View File

@@ -51,6 +51,7 @@ class PageController extends Controller
{ {
$pages = $this->page->paginate(3); $pages = $this->page->paginate(3);
$pages->setPath('page'); $pages->setPath('page');
try { try {
return view('themes.default1.agent.kb.pages.index', compact('pages')); return view('themes.default1.agent.kb.pages.index', compact('pages'));
} catch (Exception $e) { } catch (Exception $e) {
@@ -128,6 +129,7 @@ class PageController extends Controller
$sl = $request->input('name'); $sl = $request->input('name');
$slug = str_slug($sl, '-'); $slug = str_slug($sl, '-');
$this->page->slug = $slug; $this->page->slug = $slug;
try { try {
$this->page->fill($request->input())->save(); $this->page->fill($request->input())->save();
@@ -169,6 +171,7 @@ class PageController extends Controller
$pages = $this->page->where('slug', $slug)->first(); $pages = $this->page->where('slug', $slug)->first();
$sl = $request->input('name'); $sl = $request->input('name');
$slug = str_slug($sl, '-'); $slug = str_slug($sl, '-');
try { try {
$pages->fill($request->all())->save(); $pages->fill($request->all())->save();
$pages->slug = $slug; $pages->slug = $slug;

View File

@@ -61,6 +61,7 @@ class ApiController extends Controller
$this->middleware('jwt.auth'); $this->middleware('jwt.auth');
$this->middleware('api', ['except' => 'GenerateApiKey']); $this->middleware('api', ['except' => 'GenerateApiKey']);
try { try {
$user = \JWTAuth::parseToken()->authenticate(); $user = \JWTAuth::parseToken()->authenticate();
$this->user = $user; $this->user = $user;
@@ -1092,7 +1093,7 @@ class ApiController extends Controller
$result = $this->user->join('tickets', function ($join) use ($id) { $result = $this->user->join('tickets', function ($join) use ($id) {
$join->on('users.id', '=', 'tickets.assigned_to') $join->on('users.id', '=', 'tickets.assigned_to')
->where('status', '=', 1); ->where('status', '=', 1);
//->where('user_id', '=', $id); //->where('user_id', '=', $id);
}) })
->join('department', 'department.id', '=', 'tickets.dept_id') ->join('department', 'department.id', '=', 'tickets.dept_id')
->join('ticket_priority', 'ticket_priority.priority_id', '=', 'tickets.priority_id') ->join('ticket_priority', 'ticket_priority.priority_id', '=', 'tickets.priority_id')
@@ -1288,6 +1289,7 @@ 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();
//return $emails; //return $emails;

View File

@@ -329,12 +329,12 @@ class TicketController extends Controller
// Mail::send(array('html' => 'emails.ticket_re-reply'), ['content' => $reply_content, 'ticket_number' => $ticket_number, 'From' => $company, 'name' => $username, 'Agent_Signature' => $agentsign], function ($message) use ($email, $user_name, $ticket_number, $ticket_subject, $check_attachment) { // Mail::send(array('html' => 'emails.ticket_re-reply'), ['content' => $reply_content, 'ticket_number' => $ticket_number, 'From' => $company, 'name' => $username, 'Agent_Signature' => $agentsign], function ($message) use ($email, $user_name, $ticket_number, $ticket_subject, $check_attachment) {
// $message->to($email, $user_name)->subject($ticket_subject . '[#' . $ticket_number . ']'); // $message->to($email, $user_name)->subject($ticket_subject . '[#' . $ticket_number . ']');
// // if(isset($attachments)){ // // if(isset($attachments)){
// // if ($check_attachment == 1) { // // if ($check_attachment == 1) {
// // $size = count($attach); // // $size = count($attach);
// // for ($i = 0; $i < $size; $i++) { // // for ($i = 0; $i < $size; $i++) {
// // $message->attach($attachments[$i]->getRealPath(), ['as' => $attachments[$i]->getClientOriginalName(), 'mime' => $attachments[$i]->getClientOriginalExtension()]); // // $message->attach($attachments[$i]->getRealPath(), ['as' => $attachments[$i]->getClientOriginalName(), 'mime' => $attachments[$i]->getClientOriginalExtension()]);
// // } // // }
// // } // // }
// }, true); // }, true);
//dd('reply'); //dd('reply');
/* /*
@@ -361,12 +361,12 @@ class TicketController extends Controller
} }
// Mail::send('emails.ticket_re-reply', ['content' => $reply_content, 'ticket_number' => $ticket_number, 'From' => $company, 'name' => $collab_user_name, 'Agent_Signature' => $agentsign], function ($message) use ($collab_email, $collab_user_name, $ticket_number, $ticket_subject, $check_attachment) { // Mail::send('emails.ticket_re-reply', ['content' => $reply_content, 'ticket_number' => $ticket_number, 'From' => $company, 'name' => $collab_user_name, 'Agent_Signature' => $agentsign], function ($message) use ($collab_email, $collab_user_name, $ticket_number, $ticket_subject, $check_attachment) {
// $message->to($collab_email, $collab_user_name)->subject($ticket_subject . '[#' . $ticket_number . ']'); // $message->to($collab_email, $collab_user_name)->subject($ticket_subject . '[#' . $ticket_number . ']');
// // if ($check_attachment == 1) { // // if ($check_attachment == 1) {
// // $size = sizeOf($attachments); // // $size = sizeOf($attachments);
// // for ($i = 0; $i < $size; $i++) { // // for ($i = 0; $i < $size; $i++) {
// // $message->attach($attachments[$i]->getRealPath(), ['as' => $attachments[$i]->getClientOriginalName(), 'mime' => $attachments[$i]->getClientOriginalExtension()]); // // $message->attach($attachments[$i]->getRealPath(), ['as' => $attachments[$i]->getClientOriginalName(), 'mime' => $attachments[$i]->getClientOriginalExtension()]);
// // } // // }
// // } // // }
// }, true); // }, true);
try { try {
@@ -713,6 +713,7 @@ class TicketController extends Controller
return $collab; return $collab;
} catch (\Exception $ex) { } catch (\Exception $ex) {
return $ex->getMessage(); return $ex->getMessage();
throw new \Exception('get collaborator for ticket fails'); throw new \Exception('get collaborator for ticket fails');
} }
} }

View File

@@ -47,7 +47,7 @@ class TokenAuthController extends Controller
$password = $request->input('password'); $password = $request->input('password');
$field = filter_var($usernameinput, FILTER_VALIDATE_EMAIL) ? 'email' : 'user_name'; $field = filter_var($usernameinput, FILTER_VALIDATE_EMAIL) ? 'email' : 'user_name';
//$credentials = $request->only('email', 'password'); //$credentials = $request->only('email', 'password');
try { try {
if (!$token = JWTAuth::attempt([$field => $usernameinput, 'password' => $password, 'active'=>1])) { if (!$token = JWTAuth::attempt([$field => $usernameinput, 'password' => $password, 'active'=>1])) {
@@ -62,7 +62,7 @@ class TokenAuthController extends Controller
} }
$user_id = \Auth::user()->id; $user_id = \Auth::user()->id;
// if no errors are encountered we can return a JWT // if no errors are encountered we can return a JWT
return response()->json(compact('token', 'user_id')); return response()->json(compact('token', 'user_id'));
} }
@@ -89,7 +89,7 @@ class TokenAuthController extends Controller
return response()->json(compact('error')); return response()->json(compact('error'));
} }
//dd($user); //dd($user);
return response()->json(compact('user')); return response()->json(compact('user'));
} }

View File

@@ -57,8 +57,8 @@ class PasswordController extends Controller
$user = User::where('email', '=', $request->only('email'))->orWhere('mobile', '=', $request->only('email'))->first(); $user = User::where('email', '=', $request->only('email'))->orWhere('mobile', '=', $request->only('email'))->first();
if (isset($user)) { if (isset($user)) {
$user1 = $user->email; $user1 = $user->email;
//gen new code and pass //gen new code and pass
$code = str_random(60); $code = str_random(60);
$password_reset_table = \DB::table('password_resets')->where('email', '=', $user->email)->first(); $password_reset_table = \DB::table('password_resets')->where('email', '=', $user->email)->first();
if (isset($password_reset_table)) { if (isset($password_reset_table)) {
$password_reset_table = \DB::table('password_resets')->where('email', '=', $user->email)->update(['token' => $code, 'created_at' => $date]); $password_reset_table = \DB::table('password_resets')->where('email', '=', $user->email)->update(['token' => $code, 'created_at' => $date]);
@@ -107,7 +107,7 @@ class PasswordController extends Controller
$this->getResetValidationCustomAttributes() $this->getResetValidationCustomAttributes()
); );
$credentials = $this->getResetCredentials($request); $credentials = $this->getResetCredentials($request);
// dd($credentials); // dd($credentials);
$email = $credentials['email']; $email = $credentials['email'];
$password = $credentials['password']; $password = $credentials['password'];
$token = $credentials['token']; $token = $credentials['token'];

View File

@@ -32,7 +32,7 @@ class ClientTicketController extends Controller
$this->TicketWorkflowController = $TicketWorkflowController; $this->TicketWorkflowController = $TicketWorkflowController;
// $this->middleware('auth'); // $this->middleware('auth');
// $this->middleware('role.user'); // $this->middleware('role.user');
$this->middleware('board'); $this->middleware('board');
} }
/** /**

View File

@@ -249,6 +249,7 @@ class FormController extends Controller
} }
} catch (\Exception $ex) { } catch (\Exception $ex) {
dd($ex); dd($ex);
return redirect()->back()->with('fails', $ex->getMessage()); return redirect()->back()->with('fails', $ex->getMessage());
} }
// dd($result); // dd($result);

View File

@@ -98,13 +98,13 @@ class GuestController extends Controller
if (Input::file('profile_pic')) { if (Input::file('profile_pic')) {
// fetching picture name // fetching picture name
$name = Input::file('profile_pic')->getClientOriginalName(); $name = Input::file('profile_pic')->getClientOriginalName();
// fetching upload destination path // fetching upload destination path
$destinationPath = 'uploads/profilepic'; $destinationPath = 'uploads/profilepic';
// adding a random value to profile picture filename // adding a random value to profile picture filename
$fileName = rand(0000, 9999).'.'.str_replace(" ", "_", $name); $fileName = rand(0000, 9999).'.'.str_replace(' ', '_', $name);
// moving the picture to a destination folder // moving the picture to a destination folder
Input::file('profile_pic')->move($destinationPath, $fileName); Input::file('profile_pic')->move($destinationPath, $fileName);
// saving filename to database // saving filename to database
$user->profile_pic = $fileName; $user->profile_pic = $fileName;
} }
if ($request->get('mobile')) { if ($request->get('mobile')) {
@@ -237,6 +237,7 @@ class GuestController extends Controller
//echo $user->password; //echo $user->password;
if (Hash::check($request->input('old_password'), $user->getAuthPassword())) { if (Hash::check($request->input('old_password'), $user->getAuthPassword())) {
$user->password = Hash::make($request->input('new_password')); $user->password = Hash::make($request->input('new_password'));
try { try {
$user->save(); $user->save();

View File

@@ -94,6 +94,7 @@ class UnAuthController extends Controller
$ticket_token->token = $hashed_token; $ticket_token->token = $hashed_token;
$ticket_token->save(); $ticket_token->save();
} }
try { try {
$this->PhpMailController->sendmail( $this->PhpMailController->sendmail(
$from = $this->PhpMailController->mailfrom('1', '0'), $to = ['name' => $username, 'email' => $user_details->email], $message = ['subject' => 'Ticket link Request ['.$ticket_number.']', 'scenario' => 'check-ticket'], $template_variables = ['user' => $username, 'ticket_link_with_number' => url('show-ticket/'.$ticket->id.'/'.$token)] $from = $this->PhpMailController->mailfrom('1', '0'), $to = ['name' => $username, 'email' => $user_details->email], $message = ['subject' => 'Ticket link Request ['.$ticket_number.']', 'scenario' => 'check-ticket'], $template_variables = ['user' => $username, 'ticket_link_with_number' => url('show-ticket/'.$ticket->id.'/'.$token)]
@@ -270,6 +271,7 @@ class UnAuthController extends Controller
} else { } else {
$from_email = $sending_emails->id; $from_email = $sending_emails->id;
} }
try { try {
$this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('0', $tickets->dept_id), $to = ['name' => $user_name, 'email' => $email], $message = ['subject' => $ticket_subject.'[#'.$ticket_number.']', 'scenario' => 'close-ticket'], $template_variables = ['ticket_number' => $ticket_number]); $this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('0', $tickets->dept_id), $to = ['name' => $user_name, 'email' => $email], $message = ['subject' => $ticket_subject.'[#'.$ticket_number.']', 'scenario' => 'close-ticket'], $template_variables = ['ticket_number' => $ticket_number]);
} catch (\Exception $e) { } catch (\Exception $e) {
@@ -337,7 +339,7 @@ class UnAuthController extends Controller
// app()->setLocale($lang); // app()->setLocale($lang);
\Cache::forever('language', $lang); \Cache::forever('language', $lang);
// dd(Cache::get('language')); // dd(Cache::get('language'));
// dd() // dd()
} else { } else {
return false; return false;
@@ -347,11 +349,11 @@ class UnAuthController extends Controller
} }
// Follow up tickets // Follow up tickets
public function followup() public function followup()
{ {
$followup = Followup::whereId('1')->first(); $followup = Followup::whereId('1')->first();
$condition = $followup->condition; $condition = $followup->condition;
// dd($condition); // dd($condition);
switch ($condition) { switch ($condition) {
case 'everyMinute': case 'everyMinute':
@@ -383,34 +385,34 @@ class UnAuthController extends Controller
break; break;
} }
if ($followup->status = 1) { if ($followup->status = 1) {
$tickets = Tickets::where('id', '>=', 1)->where('status', '!=', 5)->get(); $tickets = Tickets::where('id', '>=', 1)->where('status', '!=', 5)->get();
// dd( $tickets); // dd( $tickets);
// $tickets=Tickets::where('id', '>=', 1)->where('status', '!=', 5)->pluck('id'); // $tickets=Tickets::where('id', '>=', 1)->where('status', '!=', 5)->pluck('id');
// dd( $tickets); // dd( $tickets);
// $id=1;
foreach ($tickets as $ticket) {
// $id=1; // $id=1;
// $id++; foreach ($tickets as $ticket) {
// $ticket=Tickets::where('status', '!=', 5)->get(); // $id=1;
// $id++;
// $ticket=Tickets::where('status', '!=', 5)->get();
// dd($ticket); // dd($ticket);
// if($ticket != null){ // if($ticket != null){
// dd('here'); // dd('here');
$ck = date('Y-m-d H:i:s', strtotime($ticket->updated_at.$followup_set)); $ck = date('Y-m-d H:i:s', strtotime($ticket->updated_at.$followup_set));
// dd($ck); // dd($ck);
$current_time = date('Y-m-d H:i:s'); $current_time = date('Y-m-d H:i:s');
if ($current_time > $ck) { if ($current_time > $ck) {
$ticket->follow_up = 1; $ticket->follow_up = 1;
$ticket->save(); $ticket->save();
// Tickets::where('id', '=',$id) // Tickets::where('id', '=',$id)
// ->update(['follow_up' => 1]); // ->update(['follow_up' => 1]);
// } // }
} }
// if($id=2) // if($id=2)
// {dd($ticket);} // {dd($ticket);}
}
} }
} }
}
} }

View File

@@ -51,6 +51,7 @@ class ApiSettings extends Controller
$this->validate($request, [ $this->validate($request, [
'ticket_detail' => 'url', 'ticket_detail' => 'url',
]); ]);
try { try {
// dd($request->input()); // dd($request->input());
DB::table('settings_system') DB::table('settings_system')
@@ -91,6 +92,7 @@ class ApiSettings extends Controller
$this->postHook($data); $this->postHook($data);
} catch (Exception $ex) { } catch (Exception $ex) {
dd($ex); dd($ex);
throw new Exception($ex->getMessage()); throw new Exception($ex->getMessage());
} }
} }
@@ -106,6 +108,7 @@ class ApiSettings extends Controller
} }
} catch (Exception $ex) { } catch (Exception $ex) {
dd($ex); dd($ex);
throw new Exception($ex->getMessage()); throw new Exception($ex->getMessage());
} }
} }

View File

@@ -234,15 +234,15 @@ class PhpMailController extends Controller
if ($cc != null) { if ($cc != null) {
foreach ($cc as $collaborator) { foreach ($cc as $collaborator) {
//mail to collaborators //mail to collaborators
$collab_user_id = $collaborator->user_id; $collab_user_id = $collaborator->user_id;
$user_id_collab = User::where('id', '=', $collab_user_id)->first(); $user_id_collab = User::where('id', '=', $collab_user_id)->first();
$collab_email = $user_id_collab->email; $collab_email = $user_id_collab->email;
$m->cc($collab_email); $m->cc($collab_email);
} }
} }
// $mail->addBCC($bc); // $mail->addBCC($bc);
$size = count($attach); $size = count($attach);
if ($size > 0) { if ($size > 0) {
for ($i = 0; $i < $size; $i++) { for ($i = 0; $i < $size; $i++) {
if (is_array($attach) && array_key_exists($i, $attach)) { if (is_array($attach) && array_key_exists($i, $attach)) {

View File

@@ -120,6 +120,7 @@ class SettingsController extends Controller
$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();
@@ -198,6 +199,7 @@ class SettingsController extends Controller
$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();
@@ -234,6 +236,7 @@ class SettingsController extends Controller
$data->name = $request->input('name'); $data->name = $request->input('name');
$data->email = $request->input('email'); $data->email = $request->input('email');
$data->password = Crypt::encrypt($request->input('password')); $data->password = Crypt::encrypt($request->input('password'));
try { try {
$data->save(); $data->save();
@@ -257,6 +260,7 @@ class SettingsController extends Controller
$pass = $request->input('password'); $pass = $request->input('password');
$password = Crypt::encrypt($pass); $password = Crypt::encrypt($pass);
$settings->password = $password; $settings->password = $password;
try { try {
$settings->save(); $settings->save();
} catch (Exception $e) { } catch (Exception $e) {
@@ -270,6 +274,7 @@ class SettingsController extends Controller
$settings->logo = $fileName; $settings->logo = $fileName;
$settings->save(); $settings->save();
} }
try { try {
$settings->fill($request->except('logo', 'password'))->save(); $settings->fill($request->except('logo', 'password'))->save();
@@ -364,6 +369,7 @@ class SettingsController extends Controller
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')) {
throw new Exception('Please enable zip extension in your php'); throw new Exception('Please enable zip extension in your php');

View File

@@ -364,7 +364,7 @@ class InstallController extends Controller
$datacontent = File::get($install); $datacontent = File::get($install);
$datacontent = str_replace('%0%', $value, $datacontent); $datacontent = str_replace('%0%', $value, $datacontent);
File::put($install, $datacontent); File::put($install, $datacontent);
// setting email settings in route // setting email settings in route
$smtpfilepath = "\App\Http\Controllers\Common\SettingsController::smtp()"; $smtpfilepath = "\App\Http\Controllers\Common\SettingsController::smtp()";
$link = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; $link = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
@@ -375,6 +375,7 @@ class InstallController extends Controller
$datacontent2 = str_replace('http://localhost', $link, $datacontent2); $datacontent2 = str_replace('http://localhost', $link, $datacontent2);
File::put($app_url, $datacontent2); File::put($app_url, $datacontent2);
$language = Cache::get('language'); $language = Cache::get('language');
try { try {
Cache::flush(); Cache::flush();

View File

@@ -43,6 +43,7 @@ class MailController extends Controller
public function getServiceForm($short_name) public function getServiceForm($short_name)
{ {
$form = ''; $form = '';
try { try {
switch ($short_name) { switch ($short_name) {
case 'smtp': case 'smtp':

View File

@@ -49,8 +49,8 @@ class CheckUpdate
$notify = new BarNotification(); $notify = new BarNotification();
if (!\Schema::hasTable('bar_notifications')) { if (!\Schema::hasTable('bar_notifications')) {
$url = url('database-upgrade'); $url = url('database-upgrade');
//$string = "Your Database is outdated please upgrade <a href=$url>Now !</a>"; //$string = "Your Database is outdated please upgrade <a href=$url>Now !</a>";
echo view('themes.default1.update.database', compact('url')); echo view('themes.default1.update.database', compact('url'));
exit; exit;
} }
$not = $notify->get(); $not = $notify->get();

View File

@@ -4,21 +4,19 @@ namespace App\Http\Middleware;
use Closure; use Closure;
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as BaseVerifier; use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as BaseVerifier;
use Lang;
class VerifyCsrfToken extends BaseVerifier class VerifyCsrfToken extends BaseVerifier
{ {
/**
/**
* The URIs that should be excluded from CSRF verification. * The URIs that should be excluded from CSRF verification.
* *
* @var array * @var array
*/ */
protected $except = [ protected $except = [
'CheckSerial', 'CheckSerial',
'api/v1/*' 'api/v1/*',
]; ];
/** /**
* Handle an incoming request. * Handle an incoming request.
* *

View File

@@ -29,6 +29,7 @@ class TicketRequest extends Request
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) {

View File

@@ -28,7 +28,7 @@ Route::group(['middleware' => ['web']], function () {
| Here is defining entire routes for the Admin Panel | Here is defining entire routes for the Admin Panel
| |
*/ */
Route::get('password/email/{one?}/{two?}/{three?}/{four?}/{five?}', ['as' => 'password.email', 'uses' => 'Auth\PasswordController@getEmail']); Route::get('password/email/{one?}/{two?}/{three?}/{four?}/{five?}', ['as' => 'password.email', 'uses' => 'Auth\PasswordController@getEmail']);
Breadcrumbs::register('password.email', function ($breadcrumbs) { Breadcrumbs::register('password.email', function ($breadcrumbs) {
$breadcrumbs->parent('/'); $breadcrumbs->parent('/');
$breadcrumbs->push('Login', url('auth/login')); $breadcrumbs->push('Login', url('auth/login'));
@@ -36,15 +36,15 @@ Route::group(['middleware' => ['web']], function () {
}); });
// register page // register page
Route::get('auth/register/{one?}/{two?}/{three?}/{four?}/{five?}', ['as' => 'auth.register', 'uses' => 'Auth\AuthController@getRegister']); Route::get('auth/register/{one?}/{two?}/{three?}/{four?}/{five?}', ['as' => 'auth.register', 'uses' => 'Auth\AuthController@getRegister']);
Breadcrumbs::register('auth.register', function ($breadcrumbs) { Breadcrumbs::register('auth.register', function ($breadcrumbs) {
$breadcrumbs->parent('/'); $breadcrumbs->parent('/');
$breadcrumbs->push('Login', url('auth/login')); $breadcrumbs->push('Login', url('auth/login'));
$breadcrumbs->push('Create Account', url('auth/register')); $breadcrumbs->push('Create Account', url('auth/register'));
}); });
// Auth login // Auth login
Route::get('auth/login/{one?}/{two?}/{three?}/{four?}/{five?}', ['as' => 'auth.login', 'uses' => 'Auth\AuthController@getLogin']); Route::get('auth/login/{one?}/{two?}/{three?}/{four?}/{five?}', ['as' => 'auth.login', 'uses' => 'Auth\AuthController@getLogin']);
Breadcrumbs::register('auth.login', function ($breadcrumbs) { Breadcrumbs::register('auth.login', function ($breadcrumbs) {
$breadcrumbs->parent('/'); $breadcrumbs->parent('/');
$breadcrumbs->push('Create Account', url('auth/register')); $breadcrumbs->push('Create Account', url('auth/register'));
@@ -83,10 +83,10 @@ Route::group(['middleware' => ['web']], function () {
Route::resource('teams', 'Admin\helpdesk\TeamController'); // in teams module, for CRUD Route::resource('teams', 'Admin\helpdesk\TeamController'); // in teams module, for CRUD
Route::get('/teams/show/{id}', ['as' => 'teams.show', 'uses' => 'Admin\helpdesk\TeamController@show']); /* Get Team View */ Route::get('/teams/show/{id}', ['as' => 'teams.show', 'uses' => 'Admin\helpdesk\TeamController@show']); /* Get Team View */
Breadcrumbs::register('teams.show', function ($breadcrumbs) { Breadcrumbs::register('teams.show', function ($breadcrumbs) {
$breadcrumbs->parent('teams.index'); $breadcrumbs->parent('teams.index');
$breadcrumbs->push(Lang::get('lang.show'), url('teams/{teams}/show')); $breadcrumbs->push(Lang::get('lang.show'), url('teams/{teams}/show'));
}); });
Route::get('getshow/{id}', ['as' => 'teams.getshow.list', 'uses' => 'Admin\helpdesk\TeamController@getshow']); Route::get('getshow/{id}', ['as' => 'teams.getshow.list', 'uses' => 'Admin\helpdesk\TeamController@getshow']);
Route::resource('agents', 'Admin\helpdesk\AgentController'); // in agents module, for CRUD Route::resource('agents', 'Admin\helpdesk\AgentController'); // in agents module, for CRUD
@@ -428,7 +428,7 @@ Route::group(['middleware' => ['web']], function () {
// route to get the data on change // route to get the data on change
Route::post('help-topic-report/{date1}/{date2}/{id}', ['as' => 'report.helptopic', 'uses' => 'Agent\helpdesk\ReportController@chartdataHelptopic']); /* To show dashboard pages */ Route::post('help-topic-report/{date1}/{date2}/{id}', ['as' => 'report.helptopic', 'uses' => 'Agent\helpdesk\ReportController@chartdataHelptopic']); /* To show dashboard pages */
Route::post('help-topic-pdf', ['as' => 'help.topic.pdf', 'uses' => 'Agent\helpdesk\ReportController@helptopicPdf']); Route::post('help-topic-pdf', ['as' => 'help.topic.pdf', 'uses' => 'Agent\helpdesk\ReportController@helptopicPdf']);
// Route to get details of agents // Route to get details of agents
Route::post('get-agents', ['as' => 'get-agents', 'uses' => 'Agent\helpdesk\UserController@getAgentDetails']); Route::post('get-agents', ['as' => 'get-agents', 'uses' => 'Agent\helpdesk\UserController@getAgentDetails']);
/* /*
@@ -446,12 +446,12 @@ Route::group(['middleware' => ['web']], function () {
Route::get('get-tag', ['as'=>'tag.get', 'uses'=>'Agent\helpdesk\Filter\TagController@getTag']); Route::get('get-tag', ['as'=>'tag.get', 'uses'=>'Agent\helpdesk\Filter\TagController@getTag']);
}); });
/* /*
* Followup tickets * Followup tickets
*/ */
Route::get('/ticket/followup', ['as' => 'followup.ticket', 'uses' => 'Agent\helpdesk\TicketController@followupTicketList']); // Get Closed Ticket / Route::get('/ticket/followup', ['as' => 'followup.ticket', 'uses' => 'Agent\helpdesk\TicketController@followupTicketList']); // Get Closed Ticket /
Route::get('/ticket/get-followup', ['as' => 'get.followup.ticket', 'uses' => 'Agent\helpdesk\TicketController@getFollowup']); // Get tickets in datatable / Route::get('/ticket/get-followup', ['as' => 'get.followup.ticket', 'uses' => 'Agent\helpdesk\TicketController@getFollowup']); // Get tickets in datatable /
Route::get('/ticket/close/get-approval/{id}', ['as' => 'get.close.approval.ticket', 'uses' => 'Agent\helpdesk\TicketController@getCloseapproval']); // Get tickets in datatable / Route::get('/ticket/close/get-approval/{id}', ['as' => 'get.close.approval.ticket', 'uses' => 'Agent\helpdesk\TicketController@getCloseapproval']); // Get tickets in datatable /
/* /*
|------------------------------------------------------------------ |------------------------------------------------------------------
@@ -494,11 +494,11 @@ Route::group(['middleware' => ['web']], function () {
Route::get('check_ticket/{id}', ['as' => 'check_ticket', 'uses' => 'Client\helpdesk\GuestController@get_ticket_email']); //detail ticket information Route::get('check_ticket/{id}', ['as' => 'check_ticket', 'uses' => 'Client\helpdesk\GuestController@get_ticket_email']); //detail ticket information
// show ticket via have a ticket // show ticket via have a ticket
Route::get('show-ticket/{id}/{code}', ['as' => 'show.ticket', 'uses' => 'Client\helpdesk\UnAuthController@showTicketCode']); //detail ticket information Route::get('show-ticket/{id}/{code}', ['as' => 'show.ticket', 'uses' => 'Client\helpdesk\UnAuthController@showTicketCode']); //detail ticket information
//testing ckeditor //testing ckeditor
//=================================================================================== //===================================================================================
Route::group(['middleware' => 'role.user', 'middleware' => 'auth'], function () { Route::group(['middleware' => 'role.user', 'middleware' => 'auth'], function () {
Route::get('client-profile', ['as' => 'client.profile', 'uses' => 'Client\helpdesk\GuestController@getProfile']); /* User profile get */ Route::get('client-profile', ['as' => 'client.profile', 'uses' => 'Client\helpdesk\GuestController@getProfile']); /* User profile get */
@@ -511,7 +511,7 @@ Route::group(['middleware' => ['web']], function () {
Route::post('verify-client-number2', ['as' => 'post-client-verify-number', 'uses' => 'Client\helpdesk\GuestController@verifyOTP']); Route::post('verify-client-number2', ['as' => 'post-client-verify-number', 'uses' => 'Client\helpdesk\GuestController@verifyOTP']);
}); });
//==================================================================================== //====================================================================================
Route::get('checkticket', 'Client\helpdesk\ClientTicketController@getCheckTicket'); /* Check your Ticket */ Route::get('checkticket', 'Client\helpdesk\ClientTicketController@getCheckTicket'); /* Check your Ticket */
Route::get('myticket', ['as' => 'ticket', 'uses' => 'Client\helpdesk\GuestController@getMyticket']); /* Get my tickets */ Route::get('myticket', ['as' => 'ticket', 'uses' => 'Client\helpdesk\GuestController@getMyticket']); /* Get my tickets */
Route::get('myticket/{id}', ['as' => 'ticket', 'uses' => 'Client\helpdesk\GuestController@thread']); /* Get my tickets */ Route::get('myticket/{id}', ['as' => 'ticket', 'uses' => 'Client\helpdesk\GuestController@thread']); /* Get my tickets */
@@ -816,8 +816,8 @@ Route::group(['middleware' => ['web']], function () {
Route::post('ticket/priority/edit1', ['as' => 'priority.edit1', 'uses' => 'Admin\helpdesk\PriorityController@priorityEdit1']); Route::post('ticket/priority/edit1', ['as' => 'priority.edit1', 'uses' => 'Admin\helpdesk\PriorityController@priorityEdit1']);
Route::get('ticket/priority/{ticket_priority}/edit', ['as' => 'priority.edit', 'uses' => 'Admin\helpdesk\PriorityController@priorityEdit']); Route::get('ticket/priority/{ticket_priority}/edit', ['as' => 'priority.edit', 'uses' => 'Admin\helpdesk\PriorityController@priorityEdit']);
Route::get('ticket/priority/{ticket_priority}/destroy', ['as' => 'priority.destroy', 'uses' => 'Admin\helpdesk\PriorityController@destroy']); Route::get('ticket/priority/{ticket_priority}/destroy', ['as' => 'priority.destroy', 'uses' => 'Admin\helpdesk\PriorityController@destroy']);
// user---arindam // user---arindam
Route::post('rolechangeadmin/{id}', ['as' => 'user.post.rolechangeadmin', 'uses' =>'Agent\helpdesk\UserController@changeRoleAdmin']); Route::post('rolechangeadmin/{id}', ['as' => 'user.post.rolechangeadmin', 'uses' =>'Agent\helpdesk\UserController@changeRoleAdmin']);
Route::post('rolechangeagent/{id}', ['as' => 'user.post.rolechangeagent', 'uses' =>'Agent\helpdesk\UserController@changeRoleAgent']); Route::post('rolechangeagent/{id}', ['as' => 'user.post.rolechangeagent', 'uses' =>'Agent\helpdesk\UserController@changeRoleAgent']);
Route::post('rolechangeuser/{id}', ['as' => 'user.post.rolechangeuser', 'uses' =>'Agent\helpdesk\UserController@changeRoleUser']); Route::post('rolechangeuser/{id}', ['as' => 'user.post.rolechangeuser', 'uses' =>'Agent\helpdesk\UserController@changeRoleUser']);
Route::get('password', ['as' => 'user.changepassword', 'uses' =>'Agent\helpdesk\UserController@randomPassword']); Route::get('password', ['as' => 'user.changepassword', 'uses' =>'Agent\helpdesk\UserController@randomPassword']);
@@ -825,15 +825,15 @@ Route::group(['middleware' => ['web']], function () {
Route::post('delete/{id}', ['as' => 'user.post.delete', 'uses' =>'Agent\helpdesk\UserController@deleteAgent']); Route::post('delete/{id}', ['as' => 'user.post.delete', 'uses' =>'Agent\helpdesk\UserController@deleteAgent']);
// deleted user list // deleted user list
Route::get('deleted/user', ['as' => 'user.deleted', 'uses' => 'Agent\helpdesk\UserController@deletedUser']); Route::get('deleted/user', ['as' => 'user.deleted', 'uses' => 'Agent\helpdesk\UserController@deletedUser']);
Route::post('restore/{id}', ['as' => 'user.restore', 'uses' => 'Agent\helpdesk\UserController@restoreUser']); Route::post('restore/{id}', ['as' => 'user.restore', 'uses' => 'Agent\helpdesk\UserController@restoreUser']);
//due today ticket //due today ticket
Route::get('duetoday', ['as' => 'ticket.duetoday', 'uses' =>'Agent\helpdesk\TicketController@dueTodayTicketlist']); Route::get('duetoday', ['as' => 'ticket.duetoday', 'uses' =>'Agent\helpdesk\TicketController@dueTodayTicketlist']);
// Route::post('duetoday/list/ticket', ['as' => 'ticket.post.duetoday', 'uses' =>'Agent\helpdesk\TicketController@getDueToday']); // Route::post('duetoday/list/ticket', ['as' => 'ticket.post.duetoday', 'uses' =>'Agent\helpdesk\TicketController@getDueToday']);
Route::get('duetoday/list/ticket', ['as' => 'ticket.post.duetoday', 'uses' =>'Agent\helpdesk\TicketController@getDueToday']); /* Get Open Ticket */ Route::get('duetoday/list/ticket', ['as' => 'ticket.post.duetoday', 'uses' =>'Agent\helpdesk\TicketController@getDueToday']); /* Get Open Ticket */
// Breadcrumbs::register('open.ticket', function ($breadcrumbs) { // Breadcrumbs::register('open.ticket', function ($breadcrumbs) {
// $breadcrumbs->parent('dashboard'); // $breadcrumbs->parent('dashboard');
// $breadcrumbs->push(Lang::get('lang.tickets') . '&nbsp; > &nbsp;' . Lang::get('lang.open'), route('open.ticket')); // $breadcrumbs->push(Lang::get('lang.tickets') . '&nbsp; > &nbsp;' . Lang::get('lang.open'), route('open.ticket'));

View File

@@ -59,7 +59,7 @@ class Notification extends BaseModel
public function delete() public function delete()
{ {
$this->deleteUserNotification(); $this->deleteUserNotification();
// $this->dummyDelete(); // $this->dummyDelete();
parent::delete(); parent::delete();
} }
} }

View File

@@ -35,7 +35,7 @@ class Ticket_attachments extends Model
if ($content) { if ($content) {
$value = base64_encode($content); $value = base64_encode($content);
if (mime($this->type) != 'image') { if (mime($this->type) != 'image') {
$root = $root . "/" . $name; $root = $root.'/'.$name;
chmod($root, 1204); chmod($root, 1204);
} }
} }

View File

@@ -45,17 +45,18 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
$pic = $this->checkArray('avatar', $info); $pic = $this->checkArray('avatar', $info);
} }
if (!$pic && $value) { if (!$pic && $value) {
$pic = ""; $pic = '';
$file = asset('uploads/profilepic/' . $value); $file = asset('uploads/profilepic/'.$value);
if ($file) { if ($file) {
$type = pathinfo($file, PATHINFO_EXTENSION); $type = pathinfo($file, PATHINFO_EXTENSION);
$data = file_get_contents($file); $data = file_get_contents($file);
$pic = 'data:image/' . $type . ';base64,' . base64_encode($data); $pic = 'data:image/'.$type.';base64,'.base64_encode($data);
} }
} }
if (!$value) { if (!$value) {
$pic = \Gravatar::src($this->attributes['email']); $pic = \Gravatar::src($this->attributes['email']);
} }
return $pic; return $pic;
} }

View File

@@ -23,13 +23,13 @@ class CreateWorkflowNameTable extends Migration
}); });
} }
/** /**
* Reverse the migrations. * Reverse the migrations.
* *
* @return void * @return void
*/ */
public function down() public function down()
{ {
Schema::drop('workflow_name'); Schema::drop('workflow_name');
} }
} }

View File

@@ -27,16 +27,16 @@ class CreateWorkflowRuleTable extends Migration
}); });
} }
/** /**
* Reverse the migrations. * Reverse the migrations.
* *
* @return void * @return void
*/ */
public function down() public function down()
{ {
Schema::table('workflow_rules', function (Blueprint $table) { Schema::table('workflow_rules', function (Blueprint $table) {
$table->dropForeign('workflow_rules_1'); $table->dropForeign('workflow_rules_1');
}); });
Schema::drop('workflow_rules'); Schema::drop('workflow_rules');
} }
} }

View File

@@ -24,16 +24,16 @@ class CreateWorkflowActionTable extends Migration
}); });
} }
/** /**
* Reverse the migrations. * Reverse the migrations.
* *
* @return void * @return void
*/ */
public function down() public function down()
{ {
Schema::drop('workflow_action'); Schema::drop('workflow_action');
Schema::table('workflow_action', function (Blueprint $table) { Schema::table('workflow_action', function (Blueprint $table) {
$table->dropForeign('workflow_action_idfk_1'); $table->dropForeign('workflow_action_idfk_1');
}); });
} }
} }

View File

@@ -20,7 +20,7 @@ class CreateBarNotificationsTable extends Migration
}); });
$version = \Config::get('app.version'); $version = \Config::get('app.version');
$date = date('Y-m-d H:i:s'); $date = date('Y-m-d H:i:s');
//\DB::table('bar_notifications')->insert(['key'=>'new-install','value'=>"Congrates ! You have installed $version",'created_at'=>$date]); //\DB::table('bar_notifications')->insert(['key'=>'new-install','value'=>"Congrates ! You have installed $version",'created_at'=>$date]);
} }
/** /**

View File

@@ -41,7 +41,6 @@ if (!empty($_POST)) {
<td><pre class="samples"><?php echo $value; ?></pre></td> <td><pre class="samples"><?php echo $value; ?></pre></td>
</tr> </tr>
<?php <?php
} }
} }
?> ?>