diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index acb681a80..773d0cbe4 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -59,7 +59,7 @@ class Handler extends ExceptionHandler { // } // return response()->view('errors.500', []); // } - // return parent::render($request, $e); + return parent::render($request, $e); if ($this->isHttpException($e)) { diff --git a/app/Http/Controllers/Admin/helpdesk/SettingsController.php b/app/Http/Controllers/Admin/helpdesk/SettingsController.php index 45347f937..84d08da93 100644 --- a/app/Http/Controllers/Admin/helpdesk/SettingsController.php +++ b/app/Http/Controllers/Admin/helpdesk/SettingsController.php @@ -248,6 +248,7 @@ class SettingsController extends Controller { $emails->fill($request->except('email_fetching', 'all_emails', 'email_collaborator', 'strip', 'attachment'))->save(); /* insert checkboxes to database */ $emails->email_fetching = $request->input('email_fetching'); + $emails->notification_cron = $request->input('notification_cron'); $emails->all_emails = $request->input('all_emails'); $emails->email_collaborator = $request->input('email_collaborator'); $emails->strip = $request->input('strip'); diff --git a/app/Http/Controllers/Agent/helpdesk/MailController.php b/app/Http/Controllers/Agent/helpdesk/MailController.php index 80b97bb3e..d2b678aa0 100644 --- a/app/Http/Controllers/Agent/helpdesk/MailController.php +++ b/app/Http/Controllers/Agent/helpdesk/MailController.php @@ -115,10 +115,9 @@ class MailController extends Controller { // echo $_SERVER['DOCUMENT_ROOT']; $dir_img_paths = __DIR__; $dir_img_path = explode('/code', $dir_img_paths); - $filepath = explode('../../../../../../public/',$attachment->filePath); - // dd($filepath); - // $path = $dir_img_path[0]."/public/".$filepath[1]; - $path = public_path().'/'.$filepath[1]; + $filepath = explode('../../../../../public/',$attachment->filePath); + + $path = $dir_img_path[0]."/code/public/".$filepath[1]; // dd($path); $filesize = filesize($path); $file_data = file_get_contents($path); diff --git a/app/Http/Controllers/Agent/helpdesk/NotificationController.php b/app/Http/Controllers/Agent/helpdesk/NotificationController.php index 56d4d2f20..3995e2f5c 100644 --- a/app/Http/Controllers/Agent/helpdesk/NotificationController.php +++ b/app/Http/Controllers/Agent/helpdesk/NotificationController.php @@ -7,6 +7,8 @@ use App\User; use App\Model\helpdesk\Settings\Company; use App\Model\helpdesk\Agent\Teams; use App\Model\helpdesk\Agent\Department; +use App\Model\helpdesk\Utility\Log_notification; +use App\Model\hrlpdesk\settings\Email; /** * UserController @@ -22,12 +24,20 @@ class NotificationController extends Controller { * @return mail **/ public function send_notification() { - // $this->test(); - $company = $this->company(); - // $this->send_notification_to_admin($company); - // $this->send_notification_to_team_lead($company); - // $this->send_notification_to_manager($company); - // $this->send_notification_to_agent($company); + $email = Email::where('id','=','1')->first(); + if($email->notification_cron == 1){ + $notification = Log_notification::where('log','=','NOT-1')->orderBy('id','DESC')->first(); + $date = explode(" " , $notification->created_at); + if(Date('Y-m-d') == $date[0]){ + } else { + Log_notification::create(['log'=>'NOT-1']); + $company = $this->company(); + $this->send_notification_to_admin($company); + $this->send_notification_to_team_lead($company); + $this->send_notification_to_manager($company); + $this->send_notification_to_agent($company); + } + } } /** diff --git a/app/Http/Controllers/Agent/helpdesk/TicketController.php b/app/Http/Controllers/Agent/helpdesk/TicketController.php index ce133ec9e..62a54382d 100644 --- a/app/Http/Controllers/Agent/helpdesk/TicketController.php +++ b/app/Http/Controllers/Agent/helpdesk/TicketController.php @@ -1118,7 +1118,7 @@ class TicketController extends Controller { $create_user->password = Hash::make($password); $create_user->save(); $user_id = $create_user->id; - Mail::send('emails.pass', ['password' => $password, 'name' => $name, 'from'=>$company], function ($message) use ($email, $name) { + Mail::send('emails.pass', ['password' => $password, 'name' => $name, 'from'=>$company,'emailadd' => $email], function ($message) use ($email, $name) { $message->to($email, $name)->subject('password'); }); } @@ -1308,7 +1308,7 @@ class TicketController extends Controller { $user->role = 'user'; if ($user->save()) { $user_id = $user->id; - Mail::send('emails.pass', ['password' => $password, 'name' => $name, 'from'=>$company], function ($message) use ($email, $name) { + Mail::send('emails.pass', ['password' => $password, 'name' => $name, 'from'=>$company,'emailadd'=>$email], function ($message) use ($email, $name) { $message->to($email, $name)->subject('password'); }); } diff --git a/app/Model/helpdesk/Utility/Log_notification.php b/app/Model/helpdesk/Utility/Log_notification.php new file mode 100644 index 000000000..e15465fc6 --- /dev/null +++ b/app/Model/helpdesk/Utility/Log_notification.php @@ -0,0 +1,11 @@ + true, + /* + |-------------------------------------------------------------------------- + | Error Log + |-------------------------------------------------------------------------- + | + | This error log will send email to faveo about the errors. So that before + | reporting about the errors we at faveo will start solving the issues already. + | The errors mails will never share your files or data. it will only share + | the line number and error occured. + | To dissable you may just change '%1%' to 0. + */ + + 'ErrorLog' => '%1%', + /* |-------------------------------------------------------------------------- | Application Version @@ -24,7 +38,7 @@ return [ | */ - 'version' => '1.0.3.3', + 'version' => 'Community 1.0.3.4', /* |-------------------------------------------------------------------------- diff --git a/database/migrations/2015_05_07_043904_create_email_table.php b/database/migrations/2015_05_07_043904_create_email_table.php index 26ab44dbc..a374035a3 100644 --- a/database/migrations/2015_05_07_043904_create_email_table.php +++ b/database/migrations/2015_05_07_043904_create_email_table.php @@ -19,6 +19,7 @@ class CreateEmailTable extends Migration { $table->string('admin_email'); $table->string('mta'); $table->boolean('email_fetching'); + $table->boolean('notification_cron'); $table->boolean('strip'); $table->boolean('separator'); $table->boolean('all_emails'); diff --git a/database/migrations/2015_12_23_074831_create_notification_log_table.php b/database/migrations/2015_12_23_074831_create_notification_log_table.php new file mode 100644 index 000000000..096e8d6ed --- /dev/null +++ b/database/migrations/2015_12_23_074831_create_notification_log_table.php @@ -0,0 +1,32 @@ +increments('id'); + $table->string('log'); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::drop('log_notification'); + } + +} diff --git a/database/seeds/DatabaseSeeder.php b/database/seeds/DatabaseSeeder.php index 65c9e032e..a5cbd123a 100644 --- a/database/seeds/DatabaseSeeder.php +++ b/database/seeds/DatabaseSeeder.php @@ -34,6 +34,7 @@ use App\Model\helpdesk\Theme\Footer4; use App\Model\helpdesk\Email\Smtp; use App\Model\helpdesk\Utility\Version_Check; use App\Model\kb\Options; +use App\Model\helpdesk\Utility\Log_notification; // Knowledge base @@ -278,6 +279,8 @@ class DatabaseSeeder extends Seeder { Priority::create(array('name' => 'low')); Priority::create(array('name' => 'high')); + Log_notification::create(['log'=>'NOT-1']); + Access::create(array('id' => '1')); Alert::create(array('id' => '1')); Company::create(array('id' => '1')); @@ -335,5 +338,7 @@ class DatabaseSeeder extends Seeder { Side2::create(['id'=>'1']); Settings::create(['id'=>'id','paagination' => '10']); + + } } \ No newline at end of file diff --git a/resources/lang/en/lang.php b/resources/lang/en/lang.php index 58192faa0..8c9df92ec 100644 --- a/resources/lang/en/lang.php +++ b/resources/lang/en/lang.php @@ -216,6 +216,7 @@ return array( 'default_alert_email' =>'Default Alert Email', 'attachments' =>'Attachments', 'email_attahment_user' =>'Email attachments to the user', + 'cron_notification' => 'Enable Notification cron', /* |-------------------------------------- diff --git a/resources/views/themes/default1/admin/helpdesk/agent/agents/create.blade.php b/resources/views/themes/default1/admin/helpdesk/agent/agents/create.blade.php index 6c326f738..437fcb705 100644 --- a/resources/views/themes/default1/admin/helpdesk/agent/agents/create.blade.php +++ b/resources/views/themes/default1/admin/helpdesk/agent/agents/create.blade.php @@ -179,7 +179,7 @@ class="active" {!! Form::label('primary_dpt',Lang::get('lang.primary_department')) !!} {!! $errors->first('primary_dpt', ':message') !!} - {!!Form::select('primary_dpt', [''=>'Select a Department','Departments'=>$departments->lists('name','name')],null,['class' => 'form-control select']) !!} + {!! Form::select('primary_dpt', [''=>'Select a Department','Departments'=>$departments->lists('name','name')],null,['class' => 'form-control select']) !!} diff --git a/resources/views/themes/default1/admin/helpdesk/emails/smtp.blade.php b/resources/views/themes/default1/admin/helpdesk/emails/smtp.blade.php index d81618ea8..26a354da2 100644 --- a/resources/views/themes/default1/admin/helpdesk/emails/smtp.blade.php +++ b/resources/views/themes/default1/admin/helpdesk/emails/smtp.blade.php @@ -37,7 +37,7 @@ class="active" @endif -{!! Form::model($settings,['url'=>'','method'=>'PATCH']) !!} +{!! Form::model($settings,['url'=>'post-smtp','method'=>'PATCH']) !!}

{!! Lang::get('lang.outgoing_emails') !!}

@@ -56,7 +56,6 @@ class="active" -
@@ -97,11 +96,14 @@ class="active"
{!! Form::label('password',Lang::get('lang.password')) !!} {!! $errors->first('password', ':message') !!} - + @if(isset($settings->password)) + + @else + + @endif
- @stop \ No newline at end of file diff --git a/resources/views/themes/default1/admin/helpdesk/settings/email.blade.php b/resources/views/themes/default1/admin/helpdesk/settings/email.blade.php index a4b408296..6b5c81585 100644 --- a/resources/views/themes/default1/admin/helpdesk/settings/email.blade.php +++ b/resources/views/themes/default1/admin/helpdesk/settings/email.blade.php @@ -108,6 +108,13 @@ class="active" +
+
+
+ {!! Form::checkbox('notification_cron',1,true) !!} {{Lang::get('lang.cron_notification')}} +
+
+
diff --git a/resources/views/themes/default1/admin/layout/admin.blade.php b/resources/views/themes/default1/admin/layout/admin.blade.php index b05898d8b..027ab1b0e 100644 --- a/resources/views/themes/default1/admin/layout/admin.blade.php +++ b/resources/views/themes/default1/admin/layout/admin.blade.php @@ -258,10 +258,11 @@ $i = count($tickets);
- {{-- Event fire --}}
diff --git a/resources/views/themes/default1/agent/helpdesk/ticket/new.blade.php b/resources/views/themes/default1/agent/helpdesk/ticket/new.blade.php index e04e880ce..013eb1282 100644 --- a/resources/views/themes/default1/agent/helpdesk/ticket/new.blade.php +++ b/resources/views/themes/default1/agent/helpdesk/ticket/new.blade.php @@ -45,6 +45,29 @@ class="active" {{Session::get('fails')}} @endif + @if(Session::has('errors')) +
+ + Alert! + +
+ @if($errors->first('email')) +
  • {!! $errors->first('email', ':message') !!}
  • + @endif + @if($errors->first('fullname')) +
  • {!! $errors->first('fullname', ':message') !!}
  • + @endif + @if($errors->first('phone')) +
  • {!! $errors->first('phone', ':message') !!}
  • + @endif + @if($errors->first('subject')) +
  • {!! $errors->first('subject', ':message') !!}
  • + @endif + @if($errors->first('body')) +
  • {!! $errors->first('body', ':message') !!}
  • + @endif +
    + @endif

    {!! Lang::get('lang.user_details') !!}:

    {{--
    --}} @@ -60,26 +83,24 @@ class="active"
    -
    - - - {!! $errors->first('email', ':message') !!} +
    + {!! Form::label('email',Lang::get('lang.email')) !!} + {!! Form::text('email',null,['class' => 'form-control']) !!}
    -
    - - - {!! $errors->first('fullname', ':message') !!} +
    + {!! Form::label('fullname',Lang::get('lang.full_name')) !!} + {!! Form::text('fullname',null,['class' => 'form-control']) !!}
    -
    +
    - + {!! Form::input('number','phone',null,['class' => 'form-control']) !!} {!! $errors->first('phone', ':message') !!}
    @@ -101,13 +122,8 @@ class="active"
    - + {!! Form::select('helptopic', ['Helptopic'=>$helptopic->lists('topic','id')],null,['class' => 'form-control select']) !!} {!! $errors->first('helptopic', ':message') !!}
    @@ -115,13 +131,8 @@ class="active"
    - + + {!! Form::select('sla', ['SLA'=>$sla_plan->lists('grace_period','id')],null,['class' => 'form-control select']) !!} {!! $errors->first('sla', ':message') !!}
    @@ -129,23 +140,17 @@ class="active"
    - + {{-- --}} + {!! Form::text('duedate',null,['class' => 'form-control','id'=>'datemask']) !!}
    - + + {!! Form::select('assignto', ['Agents'=>$agents->lists('first_name','id')],null,['class' => 'form-control select']) !!}
    @@ -154,26 +159,26 @@ class="active"

    {!! Lang::get('lang.ticket_detail') !!}

    -
    +
    - - {!! $errors->first('subject', ':message') !!} + {!! Form::text('subject',null,['class' => 'form-control']) !!} +
    -
    +
    - - {!! $errors->first('body', ':message') !!} + {!! Form::textarea('body',null,['class' => 'form-control','id' => 'body', 'style'=>"width:100%; height:150px;"]) !!} +
    @@ -184,14 +189,8 @@ class="active"
    - - {!! $errors->first('priority', ':message') !!} + + {!! Form::select('priority', ['Priority'=>$Priority->lists('priority_desc','priority_id')],null,['class' => 'form-control select']) !!}
    @@ -211,8 +210,15 @@ class="active" {!! Form::close() !!} + @stop \ No newline at end of file diff --git a/resources/views/themes/default1/agent/helpdesk/ticket/timeline.blade.php b/resources/views/themes/default1/agent/helpdesk/ticket/timeline.blade.php index 6f38612eb..c0312b660 100644 --- a/resources/views/themes/default1/agent/helpdesk/ticket/timeline.blade.php +++ b/resources/views/themes/default1/agent/helpdesk/ticket/timeline.blade.php @@ -290,7 +290,7 @@ $canneds = App\Model\helpdesk\Agent_panel\Canned::where('user_id','=',Auth::user ?> @foreach($canneds as $canned) - + @endforeach {{-- --}} diff --git a/resources/views/themes/default1/agent/helpdesk/user/index.blade.php b/resources/views/themes/default1/agent/helpdesk/user/index.blade.php index 03a42ab5e..e820bb9a2 100644 --- a/resources/views/themes/default1/agent/helpdesk/user/index.blade.php +++ b/resources/views/themes/default1/agent/helpdesk/user/index.blade.php @@ -61,6 +61,13 @@ class="active" $users = App\User::where('role','=','user')->orderBy('id', 'ASC')->paginate(20); ?> + +
    +
    + setPath(url('/user'))->render();?>  +
    +
    +
    {!! Datatable::table() ->addColumn(Lang::get('lang.name'), Lang::get('lang.email'), @@ -70,7 +77,9 @@ class="active" Lang::get('lang.action')) // these are the column headings to be shown ->setUrl(route('user.list')) // this is the route where data will be retrieved ->render() !!} - + +
    +
    diff --git a/resources/views/themes/default1/agent/layout/agent.blade.php b/resources/views/themes/default1/agent/layout/agent.blade.php index 05e544214..5c801ee92 100644 --- a/resources/views/themes/default1/agent/layout/agent.blade.php +++ b/resources/views/themes/default1/agent/layout/agent.blade.php @@ -42,7 +42,7 @@
    - + first(); if ($company != null) { diff --git a/resources/views/themes/default1/client/kb/article-list/category.blade.php b/resources/views/themes/default1/client/kb/article-list/category.blade.php index 5d95ca2b3..a307e39a9 100644 --- a/resources/views/themes/default1/client/kb/article-list/category.blade.php +++ b/resources/views/themes/default1/client/kb/article-list/category.blade.php @@ -31,7 +31,7 @@
    - get(); ?> + orderBy('created_at', 'ASC')->get(); ?> @foreach($article as $arti)
    diff --git a/resources/views/themes/default1/client/kb/article-list/home.blade.php b/resources/views/themes/default1/client/kb/article-list/home.blade.php index bf6c38336..e66f40520 100644 --- a/resources/views/themes/default1/client/kb/article-list/home.blade.php +++ b/resources/views/themes/default1/client/kb/article-list/home.blade.php @@ -73,7 +73,7 @@ $len = strlen($str); $excerpt = App\Http\Controllers\Client\kb\UserController::getExcerpt($str, $startPos = 0, $maxLength = 50); ?> - {!!$excerpt!!}
    {!! Lang::get('lang.read_more') !!} + {!! $excerpt !!}
    {!! Lang::get('lang.read_more') !!} @endforeach