This commit is contained in:
sujitprasad
2015-12-24 18:39:37 +05:30
parent 0e085c7beb
commit 5fc77c9205
21 changed files with 172 additions and 73 deletions

View File

@@ -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))
{

View File

@@ -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');

View File

@@ -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);

View File

@@ -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);
}
}
}
/**

View File

@@ -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');
});
}

View File

@@ -0,0 +1,11 @@
<?php namespace App\Model\helpdesk\Utility;
use Illuminate\Database\Eloquent\Model;
class Log_notification extends Model {
protected $table = 'log_notification';
protected $fillable = ['id', 'log'];
}

View File

@@ -15,6 +15,20 @@ return [
'debug' => 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',
/*
|--------------------------------------------------------------------------

View File

@@ -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');

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateNotificationLogTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('log_notification', function (Blueprint $table) {
$table->increments('id');
$table->string('log');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('log_notification');
}
}

View File

@@ -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']);
}
}

View File

@@ -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',
/*
|--------------------------------------

View File

@@ -179,7 +179,7 @@ class="active"
{!! Form::label('primary_dpt',Lang::get('lang.primary_department')) !!}
{!! $errors->first('primary_dpt', '<spam class="help-block">:message</spam>') !!}
{!!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']) !!}
</div>

View File

@@ -37,7 +37,7 @@ class="active"
</div>
@endif
{!! Form::model($settings,['url'=>'','method'=>'PATCH']) !!}
{!! Form::model($settings,['url'=>'post-smtp','method'=>'PATCH']) !!}
<div class="box box-primary">
<div class="box-header">
<h3 class="box-title">{!! Lang::get('lang.outgoing_emails') !!}</h3>
@@ -56,7 +56,6 @@ class="active"
<option> select </option>
<option <?php if($settings->driver == "smtp"){ echo "selected='selected'"; } ?> value="smtp">smtp</option>
<option <?php if($settings->driver == "mail"){ echo "selected='selected'"; } ?> value="mail">mail</option>
</select>
</div>
@@ -97,11 +96,14 @@ class="active"
<div class="col-md-4 form-group {{ $errors->has('password') ? 'has-error' : '' }}">
{!! Form::label('password',Lang::get('lang.password')) !!}
{!! $errors->first('password', '<spam class="help-block">:message</spam>') !!}
<input type="password" name="" value="*********" class="form-control">
@if(isset($settings->password))
<input type="password" name="password" class="form-control" value="{!! Crypt::decrypt($settings->password) !!}">
@else
<input type="password" name="password" class="form-control" value="">
@endif
</div>
</div>
</div>
</div>
@stop

View File

@@ -108,6 +108,13 @@ class="active"
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
{!! Form::checkbox('notification_cron',1,true) !!}&nbsp;{{Lang::get('lang.cron_notification')}}
</div>
</div>
</div>
<!-- Accept All Emails: CHECKBOX: Accept email from unknown Users -->
<div class="row">
<div class="col-md-6">

View File

@@ -258,10 +258,11 @@ $i = count($tickets);
</ul>
</div>
<div class="tabs-pane @yield('plugin-bar')" id="tabP">
{{-- Event fire --}}
<ul class="nav navbar-nav"><?php \Event::fire(new App\Events\TopNavEvent()); ?>
<li id="bar" @yield('plugin')><a href="{{ url('plugins') }}" >{!! Lang::get('lang.plugin') !!}</a></li></a></li>
<li id="bar" @yield('plugin')>
<a href="{{ url('plugins') }}" >{!! Lang::get('lang.plugin') !!}</a>
</li>
</ul>
</div>
</div>

View File

@@ -45,6 +45,29 @@ class="active"
{{Session::get('fails')}}
</div>
@endif
@if(Session::has('errors'))
<div class="alert alert-danger alert-dismissable">
<i class="fa fa-ban"></i>
<b>Alert!</b>
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
<br/>
@if($errors->first('email'))
<li class="error-message-padding">{!! $errors->first('email', ':message') !!}</li>
@endif
@if($errors->first('fullname'))
<li class="error-message-padding">{!! $errors->first('fullname', ':message') !!}</li>
@endif
@if($errors->first('phone'))
<li class="error-message-padding">{!! $errors->first('phone', ':message') !!}</li>
@endif
@if($errors->first('subject'))
<li class="error-message-padding">{!! $errors->first('subject', ':message') !!}</li>
@endif
@if($errors->first('body'))
<li class="error-message-padding">{!! $errors->first('body', ':message') !!}</li>
@endif
</div>
@endif
<div class="form-group">
<h4><b>{!! Lang::get('lang.user_details') !!}:<b></h4>
{{-- <div class="row"> --}}
@@ -60,26 +83,24 @@ class="active"
<div class="row">
<div class="col-md-4">
<!-- email -->
<div class="form-group">
<label>{!! Lang::get('lang.email') !!}:</label>
<input type="text" name="email" id="" class="form-control">
{!! $errors->first('email', '<spam class="help-block text-red">:message</spam>') !!}
<div class="form-group {{ $errors->has('email') ? 'has-error' : '' }}">
{!! Form::label('email',Lang::get('lang.email')) !!}
{!! Form::text('email',null,['class' => 'form-control']) !!}
</div>
</div>
<div class="col-md-4">
<!-- full name -->
<div class="form-group">
<label>{!! Lang::get('lang.full_name') !!}:</label>
<input type="text" name="fullname" id="" class="form-control">
{!! $errors->first('fullname', '<spam class="help-block text-red">:message</spam>') !!}
<div class="form-group {{ $errors->has('fullname') ? 'has-error' : '' }}">
{!! Form::label('fullname',Lang::get('lang.full_name')) !!}
{!! Form::text('fullname',null,['class' => 'form-control']) !!}
</div>
</div>
<div class="col-md-4">
<!-- phone -->
<div class="form-group">
<div class="form-group {{ $errors->has('phone') ? 'has-error' : '' }}">
<label>{!! Lang::get('lang.phone') !!}:</label>
<input type="number" name="phone" id="" class="form-control">
{!! Form::input('number','phone',null,['class' => 'form-control']) !!}
{!! $errors->first('phone', '<spam class="help-block text-red">:message</spam>') !!}
</div>
</div>
@@ -101,13 +122,8 @@ class="active"
<div class="form-group">
<label>{!! Lang::get('lang.help_topic') !!}:</label>
<!-- helptopic -->
<select class="form-control" name="helptopic">
<!-- <option>--select--</option> -->
<?php $helptopic = App\Model\helpdesk\Manage\Help_topic::all();?>
@foreach($helptopic as $topic)
<option value="{!! $topic->id !!}">{!! $topic->topic !!}</option>
@endforeach
</select>
{!! Form::select('helptopic', ['Helptopic'=>$helptopic->lists('topic','id')],null,['class' => 'form-control select']) !!}
{!! $errors->first('helptopic', '<spam class="help-block text-red">:message</spam>') !!}
</div>
</div>
@@ -115,13 +131,8 @@ class="active"
<!-- sla plan -->
<div class="form-group">
<label>{!! Lang::get('lang.sla_plan') !!}:</label>
<select class="form-control" name="sla">
<!-- <option>--select--</option> -->
<?php $sla_plan = App\Model\helpdesk\Manage\Sla_plan::all();?>
@foreach($sla_plan as $sla)
<option value="{!! $sla->id !!}">{!! $sla->grace_period !!}</option>
@endforeach
</select>
<?php $sla_plan = App\Model\helpdesk\Manage\Sla_plan::all();?>
{!! Form::select('sla', ['SLA'=>$sla_plan->lists('grace_period','id')],null,['class' => 'form-control select']) !!}
{!! $errors->first('sla', '<spam class="help-block text-red">:message</spam>') !!}
</div>
</div>
@@ -129,23 +140,17 @@ class="active"
<!-- due date -->
<div class="form-group">
<label>{!! Lang::get('lang.due_date') !!}:</label>
<input type="text" class="form-control" name="duedate" id="datemask">
{{-- <input type="text" class="form-control" name="duedate" id="datemask"> --}}
{!! Form::text('duedate',null,['class' => 'form-control','id'=>'datemask']) !!}
</div>
</div>
<div class="col-md-3">
<!-- assign to -->
<div class="form-group">
<label>{!! Lang::get('lang.assign_to') !!}:</label>
<select class="form-control" name="assignto">
<!-- <option>--select--</option> -->
<?php $agents = App\User::where('role','!=','user')->get();?>
<option value="">--- select ---</option>
@foreach($agents as $agent)
<option value="{!! $agent->id !!}">
{!! $agent->first_name !!} {!! $agent->last_name !!}
</option>
@endforeach
</select>
{!! Form::select('assignto', ['Agents'=>$agents->lists('first_name','id')],null,['class' => 'form-control select']) !!}
</div>
</div>
</div>
@@ -154,26 +159,26 @@ class="active"
<div class="form-group">
<h4><b>{!! Lang::get('lang.ticket_detail') !!}<b></h4>
<!-- subject -->
<div class="form-group">
<div class="form-group {{ $errors->has('subject') ? 'has-error' : '' }}">
<div class="row">
<div class="col-md-1">
<label>{!! Lang::get('lang.subject') !!}:</label>
</div>
<div class="col-md-4">
<input type="text" name="subject" class="form-control">
{!! $errors->first('subject', '<spam class="help-block text-red">:message</spam>') !!}
{!! Form::text('subject',null,['class' => 'form-control']) !!}
</div>
</div>
</div>
<div class="form-group">
<div class="form-group {{ $errors->has('body') ? 'has-error' : '' }}">
<!-- details -->
<div class="row">
<div class="col-md-1">
<label>{!! Lang::get('lang.detail') !!}:</label>
</div>
<div class="col-md-9">
<textarea class="form-control" id="body" name="body" style="width:100%; height:100px;"></textarea>
{!! $errors->first('body', '<spam class="help-block text-red">:message</spam>') !!}
{!! Form::textarea('body',null,['class' => 'form-control','id' => 'body', 'style'=>"width:100%; height:150px;"]) !!}
</div>
</div>
</div>
@@ -184,14 +189,8 @@ class="active"
<label>{!! Lang::get('lang.priority') !!}:</label>
</div>
<div class="col-md-3">
<select class="form-control" name="priority">
<!-- <option>--select--</option> -->
<?php $Priority = App\Model\helpdesk\Ticket\Ticket_Priority::all();?>
@foreach($Priority as $priority)
<option value="{{$priority->priority_id}}">{!! $priority->priority_desc !!}</option>
@endforeach
</select>
{!! $errors->first('priority', '<spam class="help-block text-red">:message</spam>') !!}
<?php $Priority = App\Model\helpdesk\Ticket\Ticket_Priority::all();?>
{!! Form::select('priority', ['Priority'=>$Priority->lists('priority_desc','priority_id')],null,['class' => 'form-control select']) !!}
</div>
</div>
</div>
@@ -211,8 +210,15 @@ class="active"
{!! Form::close() !!}
<script type="text/javascript">
$(function () {
$("textarea").wysihtml5();
});
$(function() {
$('#datemask').datepicker({changeMonth: true, changeYear: true}).mask('99/99/9999');
});
</script>
@stop

View File

@@ -290,7 +290,7 @@ $canneds = App\Model\helpdesk\Agent_panel\Canned::where('user_id','=',Auth::user
?>
<option value="zzz">{!! Lang::get('lang.select_a_canned_response') !!}</option>
@foreach($canneds as $canned)
<option value="{!! $canned->id !!}" >{!! $canned->title !!}</option>
<option value="{!! $canned->id !!}" >{!! $canned->title !!}</option>
@endforeach
{{-- <option>Last Message</option> --}}
</select>

View File

@@ -61,6 +61,13 @@ class="active"
$users = App\User::where('role','=','user')->orderBy('id', 'ASC')->paginate(20);
?>
<table class="table table-hover" style="overflow:hidden;">
</table>
<div class="pull-right">
<?php echo $users->setPath(url('/user'))->render();?>&nbsp;
</div>
<div class="col-xs-12">
<div class="row">
{!! 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() !!}
</table>
</div>
</div>
</div>
</div>

View File

@@ -42,7 +42,7 @@
<body class="skin-yellow skin-green fixed">
<div class="wrapper">
<header class="main-header">
<a href="" class="logo"><b>Faveo </b>HELPDESK</a>
<a href="http://www.faveohelpdesk.com" class="logo"><img src="{{ asset('lb-faveo/dist/img/logo.png') }}"></a>
<?php
$company = App\Model\helpdesk\Settings\Company::where('id', '=', '1')->first();
if ($company != null) {

View File

@@ -31,7 +31,7 @@
</blockquote>
<div class="archive-list archive-article">
<?php foreach ($article_id as $id) { ?>
<?php $article = App\Model\kb\Article::where('id', $id)->get(); ?>
<?php $article = App\Model\kb\Article::where('id', $id)->orderBy('created_at', 'ASC')->get(); ?>
@foreach($article as $arti)
<article class="hentry">
<header class="entry-header">

View File

@@ -73,7 +73,7 @@
$len = strlen($str);
$excerpt = App\Http\Controllers\Client\kb\UserController::getExcerpt($str, $startPos = 0, $maxLength = 50); ?>
{!!$excerpt!!} <br/><a class="more-link text-center" href="{{url('show/'.$arti->slug)}}" style="color: orange">{!! Lang::get('lang.read_more') !!}</a>
{!! $excerpt !!} <br/><a class="more-link text-center" href="{{url('show/'.$arti->slug)}}" style="color: orange">{!! Lang::get('lang.read_more') !!}</a>
</li>
@endforeach
<?php } ?>