update 1.0.8.0
Commits for version update
This commit is contained in:
@@ -0,0 +1,421 @@
|
||||
@extends('themes.default1.agent.layout.agent')
|
||||
|
||||
@section('Tickets')
|
||||
class="active"
|
||||
@stop
|
||||
|
||||
@section('ticket-bar')
|
||||
active
|
||||
@stop
|
||||
|
||||
@section('open')
|
||||
class="active"
|
||||
@stop
|
||||
|
||||
@section('PageHeader')
|
||||
<h1>{{Lang::get('lang.today-due_tickets')}}</h1>
|
||||
@stop
|
||||
|
||||
@section('content')
|
||||
<?php
|
||||
if (Auth::user()->role == 'admin' || user()->role == 'agent') {
|
||||
$todaytickets = count(App\Model\helpdesk\Ticket\Tickets::where('status', '=', 1)->whereRaw('date(duedate) = ?', [date('Y-m-d')])->get());
|
||||
} else {
|
||||
$dept = App\Model\helpdesk\Agent\Department::where('id', '=', Auth::user()->primary_dpt)->first();
|
||||
$todaytickets = count(App\Model\helpdesk\Ticket\Tickets::where('status', '=', 1)->whereRaw('date(duedate) = ?', [date('Y-m-d')])->where('dept_id', '=', $dept->id)->get());
|
||||
}
|
||||
?>
|
||||
<!-- //no need -->
|
||||
<?php
|
||||
$date_time_format = UTC::getDateTimeFormat();
|
||||
if (Auth::user()->role == 'agent') {
|
||||
$dept = App\Model\helpdesk\Agent\Department::where('id', '=', Auth::user()->primary_dpt)->first();
|
||||
$tickets = App\Model\helpdesk\Ticket\Tickets::where('status', '=', 1)->where('isanswered', '=', 0)->where('dept_id', '=', $dept->id)->orderBy('id', 'DESC')->paginate(20);
|
||||
} else {
|
||||
$tickets = App\Model\helpdesk\Ticket\Tickets::where('status', '=', 1)->where('isanswered', '=', 0)->orderBy('id', 'DESC')->paginate(20);
|
||||
}
|
||||
?>
|
||||
<!-- Main content -->
|
||||
<div class="box box-primary">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">{!! Lang::get('lang.open') !!} </h3> <small id="title_refresh">{!! $todaytickets !!} {!! Lang::get('lang.tickets') !!}</small>
|
||||
<div class="box-tools pull-right">
|
||||
<div class="has-feedback">
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- /.box-header -->
|
||||
<div class="box-body">
|
||||
@if(Session::has('success'))
|
||||
<div class="alert alert-success alert-dismissable">
|
||||
<i class="fa fa-check-circle"> </i>
|
||||
<b> Success </b>
|
||||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||
{{Session::get('success')}}
|
||||
</div>
|
||||
@endif
|
||||
<!-- failure message -->
|
||||
@if(Session::has('fails'))
|
||||
<div class="alert alert-danger alert-dismissable">
|
||||
<i class="fa fa-ban"> </i>
|
||||
<b> Fail! </b>
|
||||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||
{{Session::get('fails')}}
|
||||
</div>
|
||||
@endif
|
||||
{!! Form::open(['id'=>'modalpopup', 'route'=>'select_all','method'=>'post']) !!}
|
||||
<!--<div class="mailbox-controls">-->
|
||||
<!-- Check all button -->
|
||||
<a class="btn btn-default btn-sm checkbox-toggle"><i class="fa fa-square-o"></i></a>
|
||||
<input type="submit" class="submit btn btn-default text-orange btn-sm" id="delete" name="submit" value="{!! Lang::get('lang.delete') !!}">
|
||||
<input type="submit" class="submit btn btn-default text-yellow btn-sm" id="close" name="submit" value="{!! Lang::get('lang.close') !!}">
|
||||
<button type="button" class="btn btn-sm btn-default text-green" id="Edit_Ticket" data-toggle="modal" data-target="#MergeTickets"><i class="fa fa-code-fork"> </i> {!! Lang::get('lang.merge') !!}</button>
|
||||
<!--</div>-->
|
||||
<p><p/>
|
||||
<div class="mailbox-messages" id="refresh">
|
||||
<p style="display:none;text-align:center; position:fixed; margin-left:40%;margin-top:-70px;" id="show" class="text-red"><b>{!! Lang::get('lang.loading') !!}...</b></p>
|
||||
<!-- table -->
|
||||
{!! Datatable::table()
|
||||
->addColumn(
|
||||
"",
|
||||
Lang::get('lang.subject'),
|
||||
Lang::get('lang.ticket_id'),
|
||||
Lang::get('lang.priority'),
|
||||
Lang::get('lang.from'),
|
||||
Lang::get('lang.assigned_to'),
|
||||
Lang::get('lang.last_activity'))
|
||||
->setUrl(route('ticket.post.duetoday'))
|
||||
|
||||
->setOrder(array(6=>'desc'))
|
||||
->setClass('table table-hover table-bordered table-striped')
|
||||
->setCallbacks("fnRowCallback",'function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) {
|
||||
var str = aData[3];
|
||||
if(str.search("#000") == -1) {
|
||||
$("td", nRow).css({"background-color":"#F3F3F3", "font-weight":"600", "border-bottom":"solid 0.5px #ddd", "border-right":"solid 0.5px #F3F3F3"});
|
||||
$("td", nRow).mouseenter(function(){
|
||||
$("td", nRow).css({"background-color":"#DEDFE0", "font-weight":"600", "border-bottom":"solid 0.5px #ddd", "border-right":"solid 0.5px #DEDFE0"});
|
||||
});
|
||||
$("td", nRow).mouseleave(function(){
|
||||
$("td", nRow).css({"background-color":"#F3F3F3", "font-weight":"600", "border-bottom":"solid 0.5px #ddd","border-right":"solid 0.5px #F3F3F3"});
|
||||
});
|
||||
} else {
|
||||
$("td", nRow).css({"background-color":"white", "border-bottom":"solid 0.5px #ddd", "border-right":"solid 0.5px white"});
|
||||
$("td", nRow).mouseenter(function(){
|
||||
$("td", nRow).css({"background-color":"#DEDFE0", "border-bottom":"solid 0.5px #ddd", "border-right":"solid 0.5px #DEDFE0"});
|
||||
});
|
||||
$("td", nRow).mouseleave(function(){
|
||||
$("td", nRow).css({"background-color":"white", "border-bottom":"solid 0.5px #ddd", "border-right":"solid 0.5px white"});
|
||||
});
|
||||
}
|
||||
}')
|
||||
->render();!!}
|
||||
</div><!-- /.mail-box-messages -->
|
||||
{!! Form::close() !!}
|
||||
</div><!-- /.box-body -->
|
||||
</div><!-- /. box -->
|
||||
<!-- merge tickets modal -->
|
||||
<div class="modal fade" id="MergeTickets">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" id="merge-close" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">{!! Lang::get('lang.merge-ticket') !!} </h4>
|
||||
</div><!-- /.modal-header-->
|
||||
<div class ="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
<div class="col-md-6" id="merge_loader" style="display:none;">
|
||||
<img src="{{asset("lb-faveo/media/images/gifloader.gif")}}"><br/><br/><br/>
|
||||
</div><!-- /.merge-loader -->
|
||||
</div>
|
||||
<div id="merge_body">
|
||||
<div id="merge-body-alert">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div id="merge-succ-alert" class="alert alert-success alert-dismissable" style="display:none;" >
|
||||
<!--<button id="dismiss-merge" type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>-->
|
||||
<h4><i class="icon fa fa-check"></i>{!! Lang::get('lang.alert') !!}!</h4>
|
||||
<div id="message-merge-succ"></div>
|
||||
</div>
|
||||
<div id="merge-err-alert" class="alert alert-danger alert-dismissable" style="display:none;">
|
||||
<!--<button id="dismiss-merge2" type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>-->
|
||||
<h4><i class="icon fa fa-ban"></i>{!! Lang::get('lang.alert') !!}!</h4>
|
||||
<div id="message-merge-err"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- /.merge-alert -->
|
||||
<div id="merge-body-form">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
{!! Form::open(['id'=>'merge-form','method' => 'PATCH'] )!!}
|
||||
<label>{!! Lang::get('lang.title') !!}</label>
|
||||
<input type="text" name='title' class="form-control" value="" placeholder="Optional" />
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label>{!! Lang::get('lang.select-pparent-ticket') !!}</label>
|
||||
<select class="form-control" id="select-merge-parent" name='p_id' data-placeholder="{!! Lang::get('lang.select_tickets') !!}" style="width: 100%;"><option value=""></option></select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<label>{!! Lang::get('lang.merge-reason') !!}</label>
|
||||
<textarea name="reason" class="form-control"></textarea>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div><!-- mereg-body-form -->
|
||||
</div><!-- merge-body -->
|
||||
</div><!-- /.modal-body -->
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal" id="dismis2">{!! Lang::get('lang.close') !!}</button>
|
||||
<input type="submit" id="merge-btn" class="btn btn-primary pull-right" value="{!! Lang::get('lang.merge') !!}"></input>
|
||||
{!! Form::close() !!}
|
||||
</div><!-- /.modal-footer -->
|
||||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
</div><!-- /.modal -->
|
||||
|
||||
<!-- Modal -->
|
||||
<div class="modal fade in" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="false" style="display: none; padding-right: 15px;background-color: rgba(0, 0, 0, 0.7);">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="col-md-2"></div>
|
||||
<div class="col-md-8">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close closemodal" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title" id="myModalLabel"></h4>
|
||||
</div>
|
||||
<div class="modal-body" id="custom-alert-body" >
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-primary pull-left yes" data-dismiss="modal">{{Lang::get('lang.ok')}}</button>
|
||||
<button type="button" class="btn btn-default no">{{Lang::get('lang.cancel')}}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var t_id = [];
|
||||
$(function() {
|
||||
//Enable check and uncheck all functionality
|
||||
$(".checkbox-toggle").click(function() {
|
||||
var clicks = $(this).data('clicks');
|
||||
if (clicks) {
|
||||
//Uncheck all checkboxes
|
||||
$(".mailbox-messages input[type='checkbox']").iCheck("uncheck");
|
||||
$(".fa", this).removeClass("fa-check-square-o").addClass('fa-square-o');
|
||||
} else {
|
||||
//Check all checkboxes
|
||||
$(".mailbox-messages input[type='checkbox']").iCheck("check");
|
||||
$(".fa", this).removeClass("fa-square-o").addClass('fa-check-square-o');
|
||||
}
|
||||
$(this).data("clicks", !clicks);
|
||||
});
|
||||
});
|
||||
|
||||
$(function() {
|
||||
// Enable check and uncheck all functionality
|
||||
|
||||
$(".checkbox-toggle").click(function() {
|
||||
var clicks = $(this).data('clicks');
|
||||
if (clicks) {
|
||||
//Uncheck all checkboxes
|
||||
$("input[type='checkbox']", ".mailbox-messages").iCheck("uncheck");
|
||||
// alert($("input[type='checkbox']").val());
|
||||
t_id = $('.selectval').map(function() {
|
||||
return $(this).val();
|
||||
}).get();
|
||||
// alert(checkboxValues);
|
||||
} else {
|
||||
//Check all checkboxes
|
||||
$("input[type='checkbox']", ".mailbox-messages").iCheck("check");
|
||||
// alert('Hallo');
|
||||
t_id = [];
|
||||
}
|
||||
$(this).data("clicks", !clicks);
|
||||
});
|
||||
});
|
||||
|
||||
$(document).ready(function() { /// Wait till page is loaded
|
||||
$('#click').click(function() {
|
||||
$('#refresh').load('inbox #refresh');
|
||||
$('#title_refresh').load('inbox #title_refresh');
|
||||
$('#count_refresh').load('inbox #count_refresh');
|
||||
$("#show").show();
|
||||
});
|
||||
$(".select2").select2();
|
||||
$('#delete').on('click', function() {
|
||||
option = 0;
|
||||
$('#myModalLabel').html("{{Lang::get('lang.delete-tickets')}}");
|
||||
});
|
||||
$('#close').on('click', function() {
|
||||
option = 1;
|
||||
$('#myModalLabel').html("{{Lang::get('lang.close-tickets')}}");
|
||||
});
|
||||
$("#modalpopup").on('submit', function(e) {
|
||||
e.preventDefault();
|
||||
var msg = "{{Lang::get('lang.confirm')}}";
|
||||
var values = getValues();
|
||||
if (values == "") {
|
||||
msg = "{{Lang::get('lang.select-ticket')}}";
|
||||
$('.yes').html("{{Lang::get('lang.ok')}}");
|
||||
$('#myModalLabel').html("{{Lang::get('lang.alert')}}");
|
||||
} else {
|
||||
$('.yes').html("Yes");
|
||||
}
|
||||
$('#custom-alert-body').html(msg);
|
||||
$("#myModal").css("display", "block");
|
||||
});
|
||||
$(".closemodal, .no").click(function() {
|
||||
$("#myModal").css("display", "none");
|
||||
});
|
||||
|
||||
$('.yes').click(function() {
|
||||
var values = getValues();
|
||||
if (values == "") {
|
||||
$("#myModal").css("display", "none");
|
||||
} else {
|
||||
$("#myModal").css("display", "none");
|
||||
$("#modalpopup").unbind('submit');
|
||||
if (option == 0) {
|
||||
//alert('delete');
|
||||
$('#delete').click();
|
||||
} else {
|
||||
//alert('close');
|
||||
$('#close').click();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function getValues() {
|
||||
var values = $('.selectval:checked').map(function() {
|
||||
return $(this).val();
|
||||
}).get();
|
||||
return values;
|
||||
}
|
||||
|
||||
//checking merging tickets
|
||||
$('#MergeTickets').on('show.bs.modal', function() {
|
||||
// alert("hi");
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: "{{route('check.merge.tickets',0)}}",
|
||||
dataType: "html",
|
||||
data: {data1: t_id},
|
||||
beforeSend: function() {
|
||||
$("#merge_body").hide();
|
||||
$("#merge_loader").show();
|
||||
},
|
||||
success: function(response) {
|
||||
if (response == 0) {
|
||||
$("#merge_body").show();
|
||||
$("#merge-succ-alert").hide();
|
||||
$("#merge-body-alert").show();
|
||||
$("#merge-body-form").hide();
|
||||
$("#merge_loader").hide();
|
||||
$("#merge-btn").attr('disabled', true);
|
||||
var message = "{{Lang::get('lang.select-tickets-to merge')}}";
|
||||
$("#merge-err-alert").show();
|
||||
$('#message-merge-err').html(message);
|
||||
} else if (response == 2) {
|
||||
$("#merge_body").show();
|
||||
$("#merge-succ-alert").hide();
|
||||
$("#merge-body-alert").show();
|
||||
$("#merge-body-form").hide();
|
||||
$("#merge_loader").hide();
|
||||
$("#merge-btn").attr('disabled', true);
|
||||
var message = "{{Lang::get('lang.different-users')}}";
|
||||
$("#merge-err-alert").show();
|
||||
$('#message-merge-err').html(message);
|
||||
} else {
|
||||
$("#merge_body").show();
|
||||
$("#merge-body-alert").hide();
|
||||
$("#merge-body-form").show();
|
||||
$("#merge_loader").hide();
|
||||
$("#merge-btn").attr('disabled', false);
|
||||
$("#merge_loader").hide();
|
||||
$.ajax({
|
||||
url: "{{ route('get.merge.tickets',0) }}",
|
||||
dataType: "html",
|
||||
data: {data1: t_id},
|
||||
success: function(data) {
|
||||
$('#select-merge-parent').html(data);
|
||||
}
|
||||
// return false;
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//submit merging form
|
||||
$('#merge-form').on('submit', function() {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "{!! url('merge-tickets/') !!}/" + t_id,
|
||||
dataType: "json",
|
||||
data: $(this).serialize(),
|
||||
beforeSend: function() {
|
||||
$("#merge_body").hide();
|
||||
$("#merge_loader").show();
|
||||
},
|
||||
success: function(response) {
|
||||
if (response == 0) {
|
||||
$("#merge_body").show();
|
||||
$("#merge-succ-alert").hide();
|
||||
$("#merge-body-alert").show();
|
||||
$("#merge-body-form").hide();
|
||||
$("#merge_loader").hide();
|
||||
$("#merge-btn").attr('disabled', true);
|
||||
var message = "{{Lang::get('lang.merge-error')}}";
|
||||
$("#merge-err-alert").show();
|
||||
$('#message-merge-err').html(message);
|
||||
} else {
|
||||
$("#merge_body").show();
|
||||
$("#merge-err-alert").hide();
|
||||
$("#merge-body-alert").show();
|
||||
$("#merge-body-form").hide();
|
||||
$("#merge_loader").hide();
|
||||
$("#merge-btn").attr('disabled', true);
|
||||
var message = "{{Lang::get('lang.merge-success')}}";
|
||||
$("#merge-succ-alert").show();
|
||||
$('#message-merge-succ').html(message);
|
||||
setInterval(function() {
|
||||
$("#alert11").hide();
|
||||
setTimeout(function() {
|
||||
var link = document.querySelector('#load-open');
|
||||
if (link) {
|
||||
link.click();
|
||||
}
|
||||
}, 500);
|
||||
}, 2000);
|
||||
}
|
||||
}
|
||||
})
|
||||
return false;
|
||||
});
|
||||
});
|
||||
|
||||
function someFunction(id) {
|
||||
if (document.getElementById(id).checked) {
|
||||
t_id.push(id);
|
||||
// alert(t_id);
|
||||
} else if(document.getElementById(id).checked === undefined){
|
||||
var index = t_id.indexOf(id);
|
||||
if (index === -1){
|
||||
t_id.push(id);
|
||||
} else{
|
||||
t_id.splice(index, 1);
|
||||
}
|
||||
} else {
|
||||
var index = t_id.indexOf(id);
|
||||
t_id.splice(index, 1);
|
||||
// alert(t_id);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@stop
|
||||
@@ -1,18 +1,23 @@
|
||||
<?php
|
||||
$term=$_GET["term"];
|
||||
$users = app\User::where('email', 'LIKE', '%'.$term.'%')->where('active', '=', 1)->get();
|
||||
$json=array();
|
||||
|
||||
$term = $_GET["term"];
|
||||
$users = app\User::where('email', 'LIKE', '%' . $term . '%')->where('active', '=', 1)->where('role', '=', 'user')->get();
|
||||
$json = array();
|
||||
|
||||
foreach ($users as $user) {
|
||||
|
||||
$json[] = array(
|
||||
'value'=> $user["email"],
|
||||
'label'=>'Name: '.$user["first_name"] .' '.$user["last_name"].' | '.('Email: <'.$user["email"].'>'),
|
||||
'email' =>$user["email"],
|
||||
'user_name' =>$user["user_name"],
|
||||
'first_name' =>$user["first_name"],
|
||||
'last_name' =>$user["last_name"],
|
||||
'country_code' =>$user["country_code"],
|
||||
'mobile' =>$user["mobile"],
|
||||
'phone_number' =>$user["phone_number"]
|
||||
'value' => $user["email"],
|
||||
'label' => 'Name: '.$user["first_name"] .' '.$user["last_name"].' | '.('Email: <'.$user["email"].'>'),
|
||||
'email' => $user["email"],
|
||||
'user_name' => $user["user_name"],
|
||||
'first_name' => $user["first_name"],
|
||||
'last_name' => $user["last_name"],
|
||||
'country_code' => $user["country_code"],
|
||||
'mobile' => $user["mobile"],
|
||||
'phone_number' => $user["phone_number"]
|
||||
|
||||
);
|
||||
}
|
||||
echo json_encode($json);
|
||||
|
||||
echo json_encode($json);
|
||||
|
||||
@@ -20,9 +20,9 @@ class="active"
|
||||
$date_time_format = UTC::getDateTimeFormat();
|
||||
if (Auth::user()->role == 'agent') {
|
||||
$dept = App\Model\helpdesk\Agent\Department::where('id', '=', Auth::user()->primary_dpt)->first();
|
||||
$tickets = App\Model\helpdesk\Ticket\Tickets::where('status', '=', 1)->where('dept_id', '=', $dept->id)->orderBy('id', 'DESC')->paginate(20);
|
||||
$tickets = App\Model\helpdesk\Ticket\Tickets::whereIn('status', array(1, 7))->where('dept_id', '=', $dept->id)->orderBy('id', 'DESC')->paginate(20);
|
||||
} else {
|
||||
$tickets = App\Model\helpdesk\Ticket\Tickets::where('status', '=', 1)->orderBy('id', 'DESC')->paginate(20);
|
||||
$tickets = App\Model\helpdesk\Ticket\Tickets::whereIn('status', array(1, 7))->orderBy('id', 'DESC')->paginate(20);
|
||||
}
|
||||
?>
|
||||
<!-- Main content -->
|
||||
@@ -52,8 +52,11 @@ if (Auth::user()->role == 'agent') {
|
||||
<!-- Check all button -->
|
||||
<a class="btn btn-default btn-sm checkbox-toggle"><i class="fa fa-square-o"></i></a>
|
||||
{{-- <a class="btn btn-default btn-sm" id="click"><i class="fa fa-refresh"></i></a> --}}
|
||||
|
||||
<input type="submit" class="submit btn btn-default text-orange btn-sm" id="delete" name="submit" value="{!! Lang::get('lang.delete') !!}">
|
||||
{{--@if(Auth::user()->role == 'admin')--}}
|
||||
<input type="submit" class="submit btn btn-default text-yellow btn-sm" id="close" name="submit" value="{!! Lang::get('lang.close') !!}">
|
||||
{{--@endif--}}
|
||||
<button type="button" class="btn btn-sm btn-default text-green" id="Edit_Ticket" data-toggle="modal" data-target="#MergeTickets"><i class="fa fa-code-fork"> </i> {!! Lang::get('lang.merge') !!}</button>
|
||||
<!--</div>-->
|
||||
<p><p/>
|
||||
|
||||
@@ -16,10 +16,7 @@ class="active"
|
||||
<h1>{{Lang::get('lang.tickets')}}</h1>
|
||||
@stop
|
||||
|
||||
|
||||
@section('content')
|
||||
|
||||
|
||||
<!-- Main content -->
|
||||
{!! Form::open(['route'=>'post.newticket','method'=>'post','id'=>'form']) !!}
|
||||
<div class="box box-primary">
|
||||
@@ -84,12 +81,15 @@ class="active"
|
||||
<div class="col-md-4">
|
||||
<!-- email -->
|
||||
<div class="form-group {{ $errors->has('email') ? 'has-error' : '' }}">
|
||||
{!! Form::label('email',Lang::get('lang.email')) !!} <span class="text-red"> *</span>
|
||||
<!-- {!! Form::text('email',null,['class' => 'form-control'],['id' => 'email']) !!} -->
|
||||
<input type="text" name="email" id="email" class="form-control">
|
||||
{!! Form::label('email',Lang::get('lang.email')) !!}
|
||||
@if ($email_mandatory->status == 1)
|
||||
<span class="text-red"> *</span>
|
||||
@endif
|
||||
|
||||
{!! Form::text('email',null,['class' => 'form-control', 'id' => 'email']) !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-4">
|
||||
<!-- email -->
|
||||
<div class="form-group {{ $errors->has('first_name') ? 'has-error' : '' }}">
|
||||
@@ -109,16 +109,23 @@ class="active"
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-1 form-group {{ Session::has('country_code_error') ? 'has-error' : '' }}">
|
||||
|
||||
<div class="form-group {{ $errors->has('code') ? 'has-error' : '' }}">
|
||||
{!! Form::label('code',Lang::get('lang.country-code')) !!}
|
||||
@if ($email_mandatory->status == 0 || $settings->status == 1)
|
||||
<span class="text-red"> *</span>
|
||||
@endif
|
||||
|
||||
{!! Form::text('code',null,['class' => 'form-control', 'id' => 'country_code', 'placeholder' => $phonecode, 'title' => Lang::get('lang.enter-country-phone-code')]) !!}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-5">
|
||||
<!-- phone -->
|
||||
<div class="form-group {{ $errors->has('mobile') ? 'has-error' : '' }}">
|
||||
<label>{!! Lang::get('lang.mobile_number') !!}:</label>
|
||||
@if ($email_mandatory->status == 0 || $settings->status == 1)
|
||||
<span class="text-red"> *</span>
|
||||
@endif
|
||||
{!! Form::input('number','mobile',null,['class' => 'form-control', 'id' => 'mobile']) !!}
|
||||
{!! $errors->first('mobile', '<spam class="help-block text-red">:message</spam>') !!}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-5">
|
||||
@@ -151,8 +158,8 @@ class="active"
|
||||
<div class="form-group">
|
||||
<label>{!! Lang::get('lang.help_topic') !!}:</label>
|
||||
<!-- helptopic -->
|
||||
<?php $helptopic = App\Model\helpdesk\Manage\Help_topic::where('status','=',1)->get(); ?>
|
||||
{!! Form::select('helptopic', ['Helptopic'=>$helptopic->lists('topic','id')->toArray()],null,['class' => 'form-control select']) !!}
|
||||
<?php $helptopic = App\Model\helpdesk\Manage\Help_topic::where('status', '=', 1)->get(); ?>
|
||||
{!! Form::select('helptopic', ['Helptopic'=>$helptopic->lists('topic','id')->toArray()],null,['class' => 'form-control select','id'=>'selectid']) !!}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
@@ -178,6 +185,7 @@ class="active"
|
||||
{!! Form::select('assignto', [''=>'Select an Agent','Agents'=>$agents->lists('first_name','id')->toArray()],null,['class' => 'form-control select']) !!}
|
||||
</div>
|
||||
</div>
|
||||
<div id="response" class="col-md-6 form-group"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -217,11 +225,13 @@ class="active"
|
||||
<label>{!! Lang::get('lang.priority') !!}:</label>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<?php $Priority = App\Model\helpdesk\Ticket\Ticket_Priority::all(); ?>
|
||||
<?php $Priority = App\Model\helpdesk\Ticket\Ticket_Priority::where('status','=',1)->get(); ?>
|
||||
{!! Form::select('priority', ['Priority'=>$Priority->lists('priority_desc','priority_id')->toArray()],null,['class' => 'form-control select']) !!}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-footer">
|
||||
@@ -236,30 +246,34 @@ class="active"
|
||||
</div><!-- /. box -->
|
||||
{!! Form::close() !!}
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
$(document).ready(function () {
|
||||
var helpTopic = $("#selectid").val();
|
||||
send(helpTopic);
|
||||
$("#selectid").on("change", function () {
|
||||
helpTopic = $("#selectid").val();
|
||||
send(helpTopic);
|
||||
});
|
||||
function send(helpTopic) {
|
||||
$.ajax({
|
||||
url: "{{url('/get-helptopic-form')}}",
|
||||
data: {'helptopic': helpTopic},
|
||||
type: "GET",
|
||||
dataType: "html",
|
||||
success: function (response) {
|
||||
$("#response").html(response);
|
||||
},
|
||||
error: function (response) {
|
||||
$("#response").html(response);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
$(function () {
|
||||
$("textarea").wysihtml5();
|
||||
});
|
||||
|
||||
$(document).ready(function(){
|
||||
$("#email").autocomplete({
|
||||
source:"{!!URL::route('post.newticket.autofill')!!}",
|
||||
minLength:1,
|
||||
select:function(evt, ui) {
|
||||
// this.form.phone_number.value = ui.item.phone_number;
|
||||
// this.form.user_name.value = ui.item.user_name;
|
||||
this.form.first_name.value = ui.item.first_name;
|
||||
this.form.last_name.value = ui.item.last_name;
|
||||
this.form.country_code.value = ui.item.country_code;
|
||||
this.form.phone_number.value = ui.item.phone_number;
|
||||
this.form.mobile.value = ui.item.mobile;
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
$('#form').submit(function() {
|
||||
$(document).ready(function () {
|
||||
$('#form').submit(function () {
|
||||
var duedate = document.getElementById('datemask').value;
|
||||
if (duedate) {
|
||||
var pattern = /^([0-9]{2})\/([0-9]{2})\/([0-9]{4})$/;
|
||||
@@ -275,12 +289,39 @@ class="active"
|
||||
}
|
||||
});
|
||||
});
|
||||
$(document).ready(function(){
|
||||
$("#email").autocomplete({
|
||||
source:"{!!URL::route('post.newticket.autofill')!!}",
|
||||
minLength:1,
|
||||
select:function(evt, ui) {
|
||||
// this.form.phone_number.value = ui.item.phone_number;
|
||||
// this.form.user_name.value = ui.item.user_name;
|
||||
if(ui.item.first_name) {
|
||||
this.form.first_name.value = ui.item.first_name;
|
||||
}
|
||||
if(ui.item.last_name) {
|
||||
this.form.last_name.value = ui.item.last_name;
|
||||
}
|
||||
if(ui.item.country_code) {
|
||||
this.form.country_code.value = ui.item.country_code;
|
||||
}
|
||||
if(ui.item.phone_number) {
|
||||
this.form.phone_number.value = ui.item.phone_number;
|
||||
}
|
||||
if(ui.item.mobile) {
|
||||
this.form.mobile.value = ui.item.mobile;
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$(function() {
|
||||
$(function () {
|
||||
$('#datemask').datepicker({changeMonth: true, changeYear: true}).mask('99/99/9999');
|
||||
});
|
||||
</script>
|
||||
|
||||
@stop
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
@stop
|
||||
@@ -0,0 +1,66 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>PDF</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<h2>
|
||||
<div id="logo" class="site-logo text-center" style="font-size: 30px;">
|
||||
<center>
|
||||
@if($system->url)
|
||||
<a href="{!! $system->url !!}" rel="home">
|
||||
@else
|
||||
<a href="{{url('/')}}" rel="home" style="text-decoration:none;">
|
||||
@endif
|
||||
@if($company->use_logo == 1)
|
||||
<img src="{!! public_path().'/uploads/company'.'/'.$company->logo !!}" width="100px;"/>
|
||||
@else
|
||||
@if($system->name)
|
||||
{!! $system->name !!}
|
||||
@else
|
||||
<b>SUPPORT</b> CENTER
|
||||
@endif
|
||||
@endif
|
||||
</a>
|
||||
</center>
|
||||
</div>
|
||||
</h2>
|
||||
<hr>
|
||||
<h4>Subject : {!! $thread->title !!}</h4><br/>
|
||||
<table>
|
||||
<tr><td><b>{!! Lang::get('lang.ticket_number') !!}:</b></td> <td>{{$thread->ticket_number}}</td></tr>
|
||||
<tr><td><b>{!! Lang::get('lang.first_name') !!}:</b></td> <td>{{ucfirst($thread->first_name)}}</td></tr>
|
||||
<tr><td><b>{!! Lang::get('lang.last_name') !!}:</b></td> <td>{{ucfirst($thread->last_name)}}</td></tr>
|
||||
<tr><td><b>{!! Lang::get('lang.email') !!}:</b></td> <td>{{$thread->email}}</td></tr>
|
||||
<tr><td><b>{!! Lang::get('lang.phone') !!}:</b></td> <td>{{$thread->phone}}</td></tr>
|
||||
<tr><td><b>{!! Lang::get('lang.mobile') !!}:</b></td> <td>{{$thread->mobile}}</td></tr>
|
||||
|
||||
</table>
|
||||
<hr>
|
||||
@if($ticket->extraFields()->count()>0)
|
||||
<div>
|
||||
<table class="table" style="border: 1px solid black;border-collapse: collapse; width: 100%">
|
||||
|
||||
@foreach($ticket->extraFields() as $ticket_form_data)
|
||||
<tr style="border: 1px solid black;border-collapse: collapse;">
|
||||
<td style="border: 1px solid black;border-collapse: collapse; padding: 14px;"> <b>{!! $ticket_form_data->title !!}</b></td>
|
||||
<td style="border: 1px solid black; width: 100%;border-collapse: collapse;padding: 14px;">{!! $ticket_form_data->content !!}</td>
|
||||
</tr>
|
||||
|
||||
@endforeach
|
||||
|
||||
</table>
|
||||
</div>
|
||||
<hr>
|
||||
@endif
|
||||
<div>
|
||||
<h3>Issue</h3>
|
||||
</div>
|
||||
<div>
|
||||
{!! $thread->body !!}
|
||||
</div>
|
||||
<hr>
|
||||
</body>
|
||||
</html>
|
||||
@@ -75,6 +75,7 @@ $group = App\Model\helpdesk\Agent\Groups::where('id', '=', $agent_group)->where(
|
||||
if ($rating_value == null) {
|
||||
$avg_rating = '0';
|
||||
} else {
|
||||
|
||||
$avg_rate = explode('.', $rating_value);
|
||||
$avg_rating = $avg_rate[0];
|
||||
}
|
||||
@@ -103,11 +104,12 @@ if ($thread->title != "") {
|
||||
<!-- Main content -->
|
||||
<div class="box box-primary">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title" id="refresh2"><i class="fa fa-user"> </i> <?= $title ?></h3>
|
||||
<h3 class="box-title" id="refresh2"><i class="fa fa-user"> </i> {!! $thread->getSubject() !!}</h3>
|
||||
<div class="pull-right">
|
||||
<!-- <button type="button" class="btn btn-default"><i class="fa fa-edit" style="color:green;"> </i> Edit</button> -->
|
||||
<?php
|
||||
Event::fire(new \App\Events\TicketBoxHeader($user->id));
|
||||
|
||||
if ($group->can_edit_ticket == 1) {
|
||||
?>
|
||||
<button type="button" class="btn btn-default" id="Edit_Ticket" data-toggle="modal" data-target="#Edit"><i class="fa fa-edit" style="color:green;"> </i> {!! Lang::get('lang.edit') !!}</button>
|
||||
@@ -121,6 +123,8 @@ if ($thread->title != "") {
|
||||
<button type="button" id="surrender_button" class="btn btn-default" data-toggle="modal" data-target="#surrender"> <i class="fa fa-arrows-alt" style="color:red;"> </i> {!! Lang::get('lang.surrender') !!}</button>
|
||||
@endif
|
||||
|
||||
<?php Event::fire('show-add-event-btn', array()); ?>
|
||||
|
||||
<a href="{{url('ticket/print/'.$tickets->id)}}" target="_blank" class="btn btn-primary"><i class="fa fa-print" > </i> {!! Lang::get('lang.generate_pdf') !!}</a>
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" id="d1"><i class="fa fa-exchange" style="color:teal;" id="hidespin"> </i><i class="fa fa-spinner fa-spin" style="color:teal; display:none;" id="spin"></i>
|
||||
@@ -128,9 +132,25 @@ if ($thread->title != "") {
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
<li id="open"><a href="#"><i class="fa fa-folder-open-o" style="color:red;"> </i>{!! Lang::get('lang.open') !!}</a></li>
|
||||
|
||||
<?php if ( $tickets_approval->status==7) {?>
|
||||
@if(Auth::user()->role == 'admin')
|
||||
<li id="approval_close"><a href="#"><i class="glyphicon glyphicon-thumbs-up" style="color:red;"> </i>{!! Lang::get('lang.approval') !!}</a></li>
|
||||
@endif
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<?php if ( $tickets_approval->status==3) {?>
|
||||
<?php if ($group->can_edit_ticket == 1) {?>
|
||||
<li id="close"><a href="#"><i class="fa fa-check" style="color:green;"> </i>{!! Lang::get('lang.close') !!}</a></li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
|
||||
<?php if ( $tickets_approval->status==1) {?>
|
||||
<?php if ($group->can_edit_ticket == 1) {?>
|
||||
<li id="close"><a href="#"><i class="fa fa-check" style="color:green;"> </i>{!! Lang::get('lang.close') !!}</a></li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<li id="resolved"><a href="#"><i class="fa fa-check-circle-o " style="color:green;"> </i>{!! Lang::get('lang.resolved') !!} </a></li>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -225,7 +245,7 @@ if ($thread->title != "") {
|
||||
<tr><td><b>{!! Lang::get('lang.status') !!}:</b></td> <?php $status = App\Model\helpdesk\Ticket\Ticket_Status::where('id', '=', $tickets->status)->first(); ?><td title="{{$status->properties}}">{{$status->name}}</td></tr>
|
||||
<tr><td><b>{!! Lang::get('lang.priority') !!}:</b></td> <?php $priority = App\Model\helpdesk\Ticket\Ticket_Priority::where('priority_id', '=', $tickets->priority_id)->first(); ?><td title="{{$priority->priority_desc}}">{{$priority->priority_desc}}</td></tr>
|
||||
<tr><td><b>{!! Lang::get('lang.department') !!}:</b></td> <?php $dept123 = App\Model\helpdesk\Agent\Department::where('id', '=', $tickets->dept_id)->first(); ?><td title="{{$dept123->name}}">{{$dept123->name}}</td></tr>
|
||||
<tr><td><b>{!! Lang::get('lang.email') !!}:</b></td> <td>{{$user->email}}</td></tr>
|
||||
<tr><td><b>{!! Lang::get('lang.email') !!}:</b></td> <td>{{str_limit($user->email,30)}}</td></tr>
|
||||
@if($user->ban > 0) <tr><td style="color:orange;"><i class="fa fa-warning"></i><b>
|
||||
{!! Lang::get('lang.this_ticket_is_under_banned_user')!!}</td><td></td></tr>@endif
|
||||
</div>
|
||||
@@ -239,8 +259,10 @@ if ($thread->title != "") {
|
||||
$LastResponse = App\User::where('id', '=', $TicketDatarow->user_id)->first();
|
||||
if ($LastResponse->role == "user") {
|
||||
$rep = "#F39C12";
|
||||
$username = $LastResponse->user_name;
|
||||
} else {
|
||||
$username = $LastResponse->first_name . " " . $LastResponse->last_name;
|
||||
if ($LastResponse->first_name == null || $LastResponse->first_name == '') {
|
||||
$username = $LastResponse->user_name;
|
||||
} } else {
|
||||
$rep = "#000";
|
||||
$username = $LastResponse->first_name . " " . $LastResponse->last_name;
|
||||
if ($LastResponse->first_name == null || $LastResponse->last_name == null) {
|
||||
@@ -257,10 +279,11 @@ if ($thread->title != "") {
|
||||
<div id="refresh3">
|
||||
|
||||
@if($user->phone_number !=null)<tr><td><b>{!! Lang::get('lang.phone') !!}:</b></td> <td>{{$user->phone_number}}</td></tr>@endif
|
||||
@if($user->mobile !=null)<tr><td><b>{!! Lang::get('lang.mobile') !!}:</b></td> <td>{{$user->ext . $user->phone_number}}</td></tr>@endif
|
||||
@if($user->mobile !=null)<tr><td><b>{!! Lang::get('lang.mobile') !!}:</b></td> <td>{{$user->ext . $user->mobile}}</td></tr>@endif
|
||||
<tr><td><b>{!! Lang::get('lang.source') !!}:</b></td> <td>{{$ticket_source}}</td></tr>
|
||||
<tr><td><b>{!! Lang::get('lang.help_topic') !!}:</b></td> <?php $help_topic = App\Model\helpdesk\Manage\Help_topic::where('id', '=', $tickets->help_topic_id)->first(); ?><td title="{{$help_topic->topic}}">{{$help_topic->topic}}</td></tr>
|
||||
<tr><td><b>{!! Lang::get('lang.last_message') !!}:</b></td> <td>{{$username}}</td></tr>
|
||||
<tr><td><b>{!! Lang::get('lang.last_message') !!}:</b></td> <td>{{str_limit($username,30)}}</td></tr>
|
||||
<tr><td><b>{!! Lang::get('lang.organization') !!}:</b></td> <td>{!!$LastResponse->getOrgWithLink()!!}</td></tr>
|
||||
<?php Event::fire(new App\Events\TicketDetailTable($TicketData)); ?>
|
||||
</div>
|
||||
</table>
|
||||
@@ -442,7 +465,7 @@ if ($thread->title != "") {
|
||||
<div class="form-group">
|
||||
<div class="row">
|
||||
<!-- internal note -->
|
||||
<div class="form-group {{ $errors->has('title') ? 'has-error' : '' }}">
|
||||
<div class="form-group {{ $errors->has('title') ? 'has-error' : '' }}" id="internal_content_class">
|
||||
<div class="col-md-2">
|
||||
<label>{!! Lang::get('lang.internal_note') !!}:<span class="text-red"> *</span></label>
|
||||
</div>
|
||||
@@ -489,7 +512,7 @@ if ($thread->title != "") {
|
||||
<?php echo $conversations->setPath(url('/thread/' . $tickets->id))->render(); ?>
|
||||
</ul>
|
||||
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-12" >
|
||||
<link rel="stylesheet" type="text/css" href="{{asset("lb-faveo/css/faveo-css.css")}}">
|
||||
<link href="{{asset("lb-faveo/css/jquery.rating.css")}}" rel="stylesheet" type="text/css" />
|
||||
|
||||
@@ -505,6 +528,7 @@ if ($thread->title != "") {
|
||||
<?php
|
||||
$ConvDate1 = $conversation->created_at;
|
||||
$ConvDate = explode(' ', $ConvDate1);
|
||||
|
||||
$date = $ConvDate[0];
|
||||
$time = $ConvDate[1];
|
||||
$time = substr($time, 0, -3);
|
||||
@@ -518,7 +542,7 @@ if ($thread->title != "") {
|
||||
}
|
||||
if($conversation->user_id != null) {
|
||||
$role = App\User::where('id', '=', $conversation->user_id)->first();
|
||||
}
|
||||
}
|
||||
?>
|
||||
</li>
|
||||
<li>
|
||||
@@ -545,47 +569,45 @@ if ($thread->title != "") {
|
||||
$attachment = App\Model\helpdesk\Ticket\Ticket_attachments::where('thread_id', '=', $conversation->id)->first();
|
||||
if ($attachment == null) {
|
||||
$body = $conversation->body;
|
||||
$body = $conversation->thread($body);
|
||||
} else {
|
||||
// dd($attachment->file);
|
||||
// print $attachment->file;
|
||||
// header("Content-type: image/jpeg");
|
||||
// echo "<img src='".base64_decode($attachment->file)."' style='width:128px;height:128px'/> ";
|
||||
$body = $conversation->body;
|
||||
$body = $conversation->thread($body);
|
||||
$attachments = App\Model\helpdesk\Ticket\Ticket_attachments::where('thread_id', '=', $conversation->id)->orderBy('id', 'DESC')->get();
|
||||
|
||||
// $i = 0;
|
||||
foreach ($attachments as $attachment) {
|
||||
if ($attachment->type == 'jpg' || $attachment->type == 'png' || $attachment->type == 'PNG' || $attachment->type == 'JPG' || $attachment->type == 'jpeg' || $attachment->type == 'JPEG' || $attachment->type == 'gif' || $attachment->type == 'GIF') {
|
||||
if($attachment->size > 0) {
|
||||
$image = @imagecreatefromstring($attachment->file);
|
||||
if($image == false) {
|
||||
} else {
|
||||
ob_start();
|
||||
imagejpeg($image, null, 80);
|
||||
$data = ob_get_contents();
|
||||
ob_end_clean();
|
||||
$var = '<img style="max-width:200px;max-height:200px;" src="data:image/' . $attachment->type . ';base64,' . base64_encode($data) . '" />';
|
||||
// echo $var;
|
||||
// echo $attachment->name;
|
||||
// $body = explode($attachment->name, $body);
|
||||
$body = str_replace($attachment->name, "data:image/" . $attachment->type . ";base64," . base64_encode($data), $body);
|
||||
$string = $body;
|
||||
$start = "<head>";
|
||||
$end = "</head>";
|
||||
if (strpos($string, $start) == false || strpos($string, $start) == false) {
|
||||
// $i++;
|
||||
if (mime($attachment->type)==true) {
|
||||
$image = @imagecreatefromstring($attachment->file);
|
||||
ob_start();
|
||||
imagejpeg($image, null, 80);
|
||||
$data = ob_get_contents();
|
||||
ob_end_clean();
|
||||
$var = '<img style="max-width:200px;max-height:200px;" src="data:image/' . $attachment->type . ';base64,' . base64_encode($data) . '" />';
|
||||
// echo $var;
|
||||
// echo $attachment->name;
|
||||
// $body = explode($attachment->name, $body);
|
||||
$body = str_replace($attachment->name, "data:image/" . $attachment->type . ";base64," . base64_encode($data), $body);
|
||||
|
||||
} else {
|
||||
$ini = strpos($string, $start);
|
||||
$ini += strlen($start);
|
||||
$len = strpos($string, $end, $ini) - $ini;
|
||||
$parsed = substr($string, $ini, $len);
|
||||
$body2 = $parsed;
|
||||
$body = str_replace($body2, " ", $body);
|
||||
}
|
||||
}
|
||||
$string = $body;
|
||||
$start = "<head>";
|
||||
$end = "</head>";
|
||||
if (strpos($string, $start) == false || strpos($string, $start) == false) {
|
||||
|
||||
}
|
||||
} else {
|
||||
$ini = strpos($string, $start);
|
||||
$ini += strlen($start);
|
||||
$len = strpos($string, $end, $ini) - $ini;
|
||||
$parsed = substr($string, $ini, $len);
|
||||
$body2 = $parsed;
|
||||
$body = str_replace($body2, " ", $body);
|
||||
}
|
||||
} else {
|
||||
}
|
||||
}
|
||||
// echo $body;
|
||||
// $body = explode($attachment->file, $body);
|
||||
@@ -620,6 +642,9 @@ if ($thread->title != "") {
|
||||
?>
|
||||
<div class="timeline-item">
|
||||
<span style="color:#fff;"><div class="pull-right"> <table><tbody>
|
||||
@if($role)
|
||||
@if($role->role != null)
|
||||
@if($role->role != 'user' && $conversation->is_internal != 1)
|
||||
@foreach($ratings as $rating)
|
||||
@if($rating->rating_area == 'Comment Area')
|
||||
<?php
|
||||
@@ -632,20 +657,24 @@ if ($thread->title != "") {
|
||||
?>
|
||||
<tr>
|
||||
<th><div class="ticketratingtitle" style="color:#3c8dbc;" >{!! $rating->name !!} </div></th> 
|
||||
<td style="button:disabled;">
|
||||
<td style="button:disabled;">
|
||||
<?php for ($i = 1; $i <= $rating->rating_scale; $i++) { ?>
|
||||
<input type="radio" class="star star-rating-readonly" id="star5" name="{!! $rating->name !!},{!! $conversation->id !!}" value="{!! $i !!}"<?php echo ($ratingval == $i) ? 'checked' : '' ?> />
|
||||
<?php } ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
@endif
|
||||
</tbody></table></div>
|
||||
</span>
|
||||
<h3 class="timeline-header">
|
||||
<?php
|
||||
|
||||
if($conversation->user_id != null) {
|
||||
if ($role->role == "user") {
|
||||
if ($role->first_name == '' || $role->first_name == null) {
|
||||
$usernam = $role->user_name;
|
||||
} else {
|
||||
$usernam = $role->first_name . " " . $role->last_name;
|
||||
@@ -654,35 +683,43 @@ if ($thread->title != "") {
|
||||
$usernam = Lang::get('lang.system');
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="user-block" style="margin-bottom:-5px;margin-top:-2px;">
|
||||
@if($conversation->user_id != null)
|
||||
@if($role->profile_pic != null)
|
||||
<img src="{{$role->profile_pic}}"class="img-circle img-bordered-sm" alt="User Image"/>
|
||||
@else
|
||||
<img src="{{ Gravatar::src($role->email) }}" class="img-circle img-bordered-sm" alt="img-circle img-bordered-sm">
|
||||
@endif
|
||||
@else
|
||||
<img src="{{asset('lb-faveo/media/images/avatar_1.png')}}" class="img-circle img-bordered-sm" alt="img-circle img-bordered-sm">
|
||||
@endif
|
||||
<span class="username" style="margin-bottom:4px;margin-top:2px;">
|
||||
@if($conversation->user_id != null)
|
||||
<a href='{!! url("/user/".$role->id) !!}'>{!! $usernam !!}</a>
|
||||
<a href='{!! url("/user/".$role->id) !!}'>{!! str_limit($usernam,30) !!}</a>
|
||||
@else
|
||||
{!! $usernam !!}
|
||||
{!! str_limit($usernam,30) !!}
|
||||
@endif
|
||||
</span>
|
||||
<span class="description" style="margin-bottom:4px;margin-top:4px;"><i class="fa fa-clock-o"></i> {{UTC::usertimezone($conversation->created_at)}}</span>
|
||||
|
||||
@if($conversation->id == $ij->id)
|
||||
<a href="{{url('genereate-pdf/'.$conversation->id)}}" class= "pull-right fa fa-newspaper-o" title="generate pdf of this thread"></a>
|
||||
@endif
|
||||
</div><!-- /.user-block -->
|
||||
|
||||
|
||||
</h3>
|
||||
<div class="timeline-body" style="padding-left:30px;margin-bottom:-20px">
|
||||
{!! nl2br($body) !!}
|
||||
</div>
|
||||
@if($conversation->id == $ij->id)
|
||||
@if($conversation->firstContent()=='yes')
|
||||
<div class="embed-responsive embed-responsive-16by9">
|
||||
<iframe id="loader_frame{{$conversation->id}}" class="embed-responsive-item">Body of html email here</iframe>
|
||||
</div>
|
||||
<script>
|
||||
$('#loader_frame{{$conversation->id}}')[0].contentDocument.body.innerHTML = '{!!$conversation->purify()!!}';
|
||||
</script>
|
||||
@else
|
||||
{!! $body !!}
|
||||
@endif
|
||||
|
||||
@if($conversation->id == $ij->id)
|
||||
<?php $ticket_form_datas = App\Model\helpdesk\Ticket\Ticket_Form_Data::where('ticket_id', '=', $tickets->id)->get(); ?>
|
||||
@if(isset($ticket_form_datas))
|
||||
<div class="box-body col-md-9">
|
||||
|
||||
<br/>
|
||||
<table class="table table-bordered">
|
||||
<tbody>
|
||||
@@ -693,9 +730,11 @@ if ($thread->title != "") {
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody></table>
|
||||
|
||||
@endif
|
||||
@endif
|
||||
</div>
|
||||
@endif
|
||||
@endif
|
||||
|
||||
<br/><br/>
|
||||
<div class="timeline-footer" style="margin-bottom:-5px">
|
||||
@if(!$conversation->is_internal)
|
||||
@@ -718,32 +757,25 @@ if ($thread->title != "") {
|
||||
<ul class='mailbox-attachments clearfix'>
|
||||
<?php
|
||||
foreach ($attachments as $attachment) {
|
||||
|
||||
$size = $attachment->size;
|
||||
$units = array('B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB');
|
||||
$power = $size > 0 ? floor(log($size, 1024)) : 0;
|
||||
$value = number_format($size / pow(1024, $power), 2, '.', ',') . ' ' . $units[$power];
|
||||
if ($attachment->poster == 'ATTACHMENT') {
|
||||
if ($attachment->type == 'jpg' || $attachment->type == 'JPG' || $attachment->type == 'jpeg' || $attachment->type == 'JPEG' || $attachment->type == 'png' || $attachment->type == 'PNG' || $attachment->type == 'gif' || $attachment->type == 'GIF') {
|
||||
$image = @imagecreatefromstring($attachment->file);
|
||||
|
||||
if($image == false) {
|
||||
$var = '<a style="max-width:200px;height:133px;color:#666;" href="' . URL::route('image', array('image_id' => $attachment->id)) . '" target="_blank"><span class="mailbox-attachment-icon" style="background-color:#fff;">' . strtoupper($attachment->type) . '</span><div class="mailbox-attachment-info"><span ><b style="word-wrap: break-word;">' . $attachment->name . '</b><br/><p>' . $value . '</p></span></div></a>';
|
||||
echo '<li style="background-color:#f4f4f4;">' . $var . '</li>';
|
||||
} else {
|
||||
ob_start();
|
||||
imagejpeg($image, null, 80);
|
||||
$data = ob_get_contents();
|
||||
ob_end_clean();
|
||||
$var = '<a href="' . URL::route('image', array('image_id' => $attachment->id)) . '" target="_blank"><img style="max-width:200px;height:133px;" src="data:image/jpg;base64,' . base64_encode($data) . '"/></a>';
|
||||
echo '<li style="background-color:#f4f4f4;"><span class="mailbox-attachment-icon has-img">' . $var . '</span><div class="mailbox-attachment-info"><b style="word-wrap: break-word;">' . $attachment->name . '</b><br/><p>' . $value . '</p></div></li>';
|
||||
}
|
||||
} else {
|
||||
$var = '<a style="max-width:200px;height:133px;color:#666;" href="' . URL::route('image', array('image_id' => $attachment->id)) . '" target="_blank"><span class="mailbox-attachment-icon" style="background-color:#fff;">' . strtoupper($attachment->type) . '</span><div class="mailbox-attachment-info"><span ><b style="word-wrap: break-word;">' . $attachment->name . '</b><br/><p>' . $value . '</p></span></div></a>';
|
||||
echo '<li style="background-color:#f4f4f4;">' . $var . '</li>';
|
||||
}
|
||||
$size = $attachment->size;
|
||||
$units = array('B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB');
|
||||
$power = $size > 0 ? floor(log($size, 1024)) : 0;
|
||||
$value = number_format($size / pow(1024, $power), 2, '.', ',') . ' ' . $units[$power];
|
||||
if ($attachment->poster == 'ATTACHMENT') {
|
||||
if (mime($attachment->type)==true) {
|
||||
$image = @imagecreatefromstring($attachment->file);
|
||||
ob_start();
|
||||
imagejpeg($image, null, 80);
|
||||
$data = ob_get_contents();
|
||||
ob_end_clean();
|
||||
$var = '<a href="' . URL::route('image', array('image_id' => $attachment->id)) . '" target="_blank"><img style="max-width:200px;height:133px;" src="data:image/jpg;base64,' . base64_encode($data) . '"/></a>';
|
||||
echo '<li style="background-color:#f4f4f4;"><span class="mailbox-attachment-icon has-img">' . $var . '</span><div class="mailbox-attachment-info"><b style="word-wrap: break-word;">' . $attachment->name . '</b><br/><p>' . $value . '</p></div></li>';
|
||||
} else {
|
||||
//$var = '<a href="' . URL::route('image', array('image_id' => $attachment->id)) . '" target="_blank"><img style="max-width:200px;height:133px;" src="data:'.$attachment->type.';base64,' . base64_encode($data) . '"/></a>';
|
||||
$var = '<a style="max-width:200px;height:133px;color:#666;" href="' . URL::route('image', array('image_id' => $attachment->id)) . '" target="_blank"><span class="mailbox-attachment-icon" style="background-color:#fff; font-size:18px;">' . strtoupper($attachment->type) . '</span><div class="mailbox-attachment-info"><span ><b style="word-wrap: break-word;">' . $attachment->name . '</b><br/><p>' . $value . '</p></span></div></a>';
|
||||
echo '<li style="background-color:#f4f4f4;">' . $var . '</li>';
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
@@ -1022,9 +1054,9 @@ if ($thread->title != "") {
|
||||
<p>{!! Lang::get('lang.whome_do_you_want_to_assign_ticket') !!}?</p>
|
||||
<select id="asssign" class="form-control" name="assign_to">
|
||||
<?php
|
||||
$assign = App\User::where('role', '!=', 'user')->get();
|
||||
$assign = App\User::where('role', '!=', 'user')->where('active', '=', '1')->get();
|
||||
$count_assign = count($assign);
|
||||
$teams = App\Model\helpdesk\Agent\Teams::all();
|
||||
$teams = App\Model\helpdesk\Agent\Teams::where('status', '=', '1')->get();
|
||||
$count_teams = count($teams);
|
||||
?>
|
||||
<optgroup label="Teams ( {!! $count_teams !!} )">
|
||||
@@ -1068,7 +1100,7 @@ if ($thread->title != "") {
|
||||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
</div><!-- /.modal -->
|
||||
|
||||
<?php \Event::fire('show-add-calendar-model', array())?>
|
||||
<!-- add or search user Modal -->
|
||||
<div class="modal fade" id="addccc">
|
||||
<div class="modal-dialog">
|
||||
@@ -1086,6 +1118,7 @@ if ($thread->title != "") {
|
||||
<div class="tab-pane active" id="ahah">
|
||||
<div class="modal-body" id="def">
|
||||
<div class="callout callout-info" id="hide1234" ><i class="icon fa fa-info"> </i> {!! Lang::get('lang.search_existing_users_or_add_new_users') !!}</div>
|
||||
<div id="here"></div>
|
||||
<div id="show7" style="display:none;">
|
||||
<div class="row col-md-12">
|
||||
<div class="col-xs-5">
|
||||
@@ -1097,7 +1130,7 @@ if ($thread->title != "") {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="here"></div>
|
||||
|
||||
{!! Form::model($tickets->id, ['id'=>'search-user','method' => 'PATCH'] )!!}
|
||||
<script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
|
||||
<input type="text" class="form-control" name="search" id="tags" placeholder="{!! Lang::get('lang.search_by_email') !!}">
|
||||
@@ -1311,6 +1344,7 @@ if ($thread->title != "") {
|
||||
// $('#cand').wysihtml5();
|
||||
var wysihtml5Editor = $('#reply_content').wysihtml5().data("wysihtml5").editor;
|
||||
$('#select').on('change', function (e) {
|
||||
|
||||
//alert('hello2');
|
||||
var $_token = $('#token').val();
|
||||
var data = $('#select').val();
|
||||
@@ -1324,6 +1358,7 @@ if ($thread->title != "") {
|
||||
dataType : 'json',
|
||||
data : ({data}),
|
||||
success : function(response) {
|
||||
|
||||
// alert(response);
|
||||
wysihtml5Editor.setValue(response, true);
|
||||
console.log(wysihtml5Editor.getValue());
|
||||
@@ -1348,6 +1383,7 @@ if ($thread->title != "") {
|
||||
$("#loader").show();
|
||||
},
|
||||
success: function (response) {
|
||||
|
||||
$("#refresh").load("../thread/{{$tickets->id}} #refresh");
|
||||
$("#refresh").show();
|
||||
$("#loader").hide();
|
||||
@@ -1361,6 +1397,7 @@ if ($thread->title != "") {
|
||||
});
|
||||
});
|
||||
$(document).ready(function () {
|
||||
|
||||
//Initialize Select2 Elements
|
||||
$(".select2").select2();
|
||||
setInterval(function(){
|
||||
@@ -1395,6 +1432,39 @@ if ($thread->title != "") {
|
||||
var message = "{!! Lang::get('lang.your_ticket_have_been_closed') !!}";
|
||||
$("#alert11").show();
|
||||
$('#message-success1').html(message);
|
||||
setTimeout(function() {
|
||||
window.location = document.referrer;
|
||||
}, 500);
|
||||
}
|
||||
})
|
||||
return false;
|
||||
});
|
||||
|
||||
// approval close ticket
|
||||
$('#approval_close').on('click', function(e) {
|
||||
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: "../ticket/close/get-approval/{{$tickets->id}}",//route 600
|
||||
beforeSend: function() {
|
||||
$("#hidespin").hide();
|
||||
$("#spin").show();
|
||||
$("#hide2").hide();
|
||||
$("#show2").show();
|
||||
},
|
||||
|
||||
success: function(response) {
|
||||
|
||||
$("#refresh").load("../thread/{{$tickets->id}} #refresh");
|
||||
|
||||
$("#show2").hide();
|
||||
$("#spin").hide();
|
||||
$("#hide2").show();
|
||||
$("#hidespin").show();
|
||||
$("#d1").trigger("click");
|
||||
var message = "successfull approval";
|
||||
$("#alert11").show();
|
||||
$('#message-success1').html(message);
|
||||
setInterval(function(){
|
||||
$("#alert11").hide();
|
||||
setTimeout(function() {
|
||||
@@ -1405,6 +1475,7 @@ if ($thread->title != "") {
|
||||
})
|
||||
return false;
|
||||
});
|
||||
|
||||
// Resolved a ticket
|
||||
$('#resolved').on('click', function(e) {
|
||||
$.ajax({
|
||||
@@ -1509,11 +1580,13 @@ if ($thread->title != "") {
|
||||
// $('#t1').hide();
|
||||
// $('#t2').show();
|
||||
// });
|
||||
|
||||
// comment a ticket
|
||||
// $('#aa').click(function() {
|
||||
// $('#t1').show();
|
||||
// $('#t2').hide();
|
||||
// });
|
||||
|
||||
// Edit a ticket
|
||||
$('#form').on('submit', function() {
|
||||
$.ajax({
|
||||
@@ -1574,6 +1647,7 @@ if ($thread->title != "") {
|
||||
// var message = "Success";
|
||||
// $('#message-success1').html(message);
|
||||
// setInterval(function(){$("#alert11").hide(); },4000);
|
||||
|
||||
var message = "Success!";
|
||||
$("#alert11").show();
|
||||
$('#message-success1').html(message);
|
||||
@@ -1675,6 +1749,19 @@ if ($thread->title != "") {
|
||||
});
|
||||
// Internal Note
|
||||
$('#form2').on('submit', function() {
|
||||
var internal_content = document.getElementById('InternalContent').value;
|
||||
if(internal_content) {
|
||||
$("#internal_content_class").removeClass('has-error');
|
||||
$("#alert23").hide();
|
||||
} else {
|
||||
var message = "<li>{!! Lang::get('lang.internal_content_is_a_required_field') !!}</li>";
|
||||
$("#internal_content_class").addClass('has-error');
|
||||
$("#alert23").show();
|
||||
$('#message-danger2').html(message);
|
||||
$("#show3").hide();
|
||||
$("#t1").show();
|
||||
return false;
|
||||
}
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "../internal/note/{{ $tickets->id }}",
|
||||
@@ -1685,6 +1772,7 @@ if ($thread->title != "") {
|
||||
$("#show5").show();
|
||||
},
|
||||
success: function(response) {
|
||||
|
||||
if (response == 1)
|
||||
{
|
||||
$("#refresh1").load("../thread/{{$tickets->id}} #refresh1");
|
||||
@@ -1700,6 +1788,16 @@ if ($thread->title != "") {
|
||||
var div1 = document.getElementById('newtextarea1');
|
||||
div1.innerHTML = div1.innerHTML + '<textarea style="width:98%;height:200px;" name="InternalContent" class="form-control" id="InternalContent"/></textarea>';
|
||||
var wysihtml5Editor = $('textarea').wysihtml5().data("wysihtml5").editor;
|
||||
setInterval(function(){
|
||||
var head= document.getElementsByTagName('head')[0];
|
||||
var script= document.createElement('script');
|
||||
script.type= 'text/javascript';
|
||||
script.src= '{{asset("lb-faveo/js/jquery.rating.pack.js")}}';
|
||||
head.appendChild(script);
|
||||
// $('.rating-cancel').hide();
|
||||
// $(".star-rating-control").attr("disabled", "disabled").off('hover');
|
||||
// $(".star-rating-control").addClass("disabled")
|
||||
}, 4000);
|
||||
} else {
|
||||
// alert('fail');
|
||||
var message = "{!! Lang::get('lang.for_some_reason_your_message_was_not_posted_please_try_again_later') !!}";
|
||||
@@ -1756,10 +1854,10 @@ if ($thread->title != "") {
|
||||
var i = Math.floor(Math.log(bytes) / Math.log(k));
|
||||
return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i];
|
||||
}
|
||||
|
||||
$('#form3').on('submit', function() {
|
||||
var fd = new FormData(document.getElementById("form3"));
|
||||
var reply_content = document.getElementById("reply_content").value;
|
||||
|
||||
var reply_content = document.getElementById('reply_content').value;
|
||||
if(reply_content) {
|
||||
$("#reply_content_class").removeClass('has-error');
|
||||
$("#alert23").hide();
|
||||
@@ -1815,9 +1913,9 @@ if ($thread->title != "") {
|
||||
// $(".star-rating-control").attr("disabled", "disabled").off('hover');
|
||||
// $(".star-rating-control").addClass("disabled")
|
||||
}, 4000);
|
||||
$( "#clear-file" ).trigger( "click" );
|
||||
} else {
|
||||
// alert('fail');
|
||||
// $( "#dismis4" ).trigger( "click" );
|
||||
var message = "{!! Lang::get('lang.for_some_reason_your_reply_was_not_posted_please_try_again_later') !!}";
|
||||
$("#alert23").show();
|
||||
$('#message-danger2').html(message);
|
||||
@@ -1839,6 +1937,7 @@ if ($thread->title != "") {
|
||||
type: "GET",
|
||||
url: "../ticket/surrender/{{ $tickets->id }}",
|
||||
success: function(response) {
|
||||
|
||||
if (response == 1)
|
||||
{
|
||||
// alert('ticket has been un assigned');
|
||||
@@ -1870,8 +1969,9 @@ if ($thread->title != "") {
|
||||
dataType: "html",
|
||||
data: $(this).serialize(),
|
||||
beforeSend: function() {
|
||||
$('#show7').show();
|
||||
$('#hide1234').hide();
|
||||
$('#here').html("");
|
||||
$('#show7').show();
|
||||
$('#hide1234').hide();
|
||||
},
|
||||
success: function(response) {
|
||||
$('#show7').hide();
|
||||
@@ -1884,7 +1984,7 @@ if ($thread->title != "") {
|
||||
// if(link) {
|
||||
// link.click();
|
||||
// }
|
||||
$('#cc-close').trigger('click');
|
||||
// $('#cc-close').trigger('click');
|
||||
}, 500);
|
||||
}
|
||||
})
|
||||
@@ -1951,6 +2051,7 @@ if ($thread->title != "") {
|
||||
type: 'GET',
|
||||
data: $(this).serialize(),
|
||||
success: function(data) {
|
||||
|
||||
$('#select-merge-tickts').html(data);
|
||||
}
|
||||
// return false;
|
||||
@@ -2028,12 +2129,15 @@ if ($thread->title != "") {
|
||||
$("#recepients").load("../thread/{{$tickets->id}} #recepients");
|
||||
};
|
||||
// $('#here2').html(response);
|
||||
|
||||
// $("#surrender22").load("../thread/{{$tickets->id}} #surrender22");
|
||||
}
|
||||
})
|
||||
return false;
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
var Vardata = "";
|
||||
var count = 0;
|
||||
$(".select2").on('select2:select', function(){
|
||||
@@ -2069,6 +2173,7 @@ echo $ticket_data->title;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
var locktime = '<?php echo $var->collision_avoid; ?>' * 60 * 1000;
|
||||
var ltf = '<?php echo $var->lock_ticket_frequency;?>';
|
||||
@@ -2096,6 +2201,7 @@ echo $ticket_data->title;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$(this).data("prevType", e.type);
|
||||
});
|
||||
}
|
||||
@@ -2146,7 +2252,9 @@ echo $ticket_data->title;
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
$(function() {
|
||||
|
||||
$('h5').html('<span class="stars">' + parseFloat($('input[name=amount]').val()) + '</span>');
|
||||
$('span.stars').stars();
|
||||
$('h4').html('<span class="stars2">' + parseFloat($('input[name=amt]').val()) + '</span>');
|
||||
@@ -2158,5 +2266,4 @@ echo $ticket_data->title;
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
@stop
|
||||
Reference in New Issue
Block a user