Updates
This commit is contained in:
@@ -14,15 +14,40 @@ class="active"
|
||||
|
||||
@section('PageHeader')
|
||||
<h1>{{Lang::get('lang.tickets')}}</h1>
|
||||
<style>
|
||||
.tooltip1 {
|
||||
position: relative;
|
||||
/*display: inline-block;*/
|
||||
/*border-bottom: 1px dotted black;*/
|
||||
}
|
||||
|
||||
.tooltip1 .tooltiptext {
|
||||
visibility: hidden;
|
||||
width: 100%;
|
||||
background-color: black;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
border-radius: 6px;
|
||||
padding: 5px 0;
|
||||
|
||||
/* Position the tooltip */
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.tooltip1:hover .tooltiptext {
|
||||
visibility: visible;
|
||||
}
|
||||
</style>
|
||||
@stop
|
||||
@section('content')
|
||||
<?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::whereIn('status', array(1, 7))->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::whereIn('status', array(1, 7))->orderBy('id', 'DESC')->paginate(20);
|
||||
$tickets = App\Model\helpdesk\Ticket\Tickets::whereIn('status', array(1, 7))->orderBy('id', 'DESC')->paginate(20);
|
||||
}
|
||||
?>
|
||||
<!-- Main content -->
|
||||
@@ -49,54 +74,24 @@ if (Auth::user()->role == 'agent') {
|
||||
@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>
|
||||
{{-- <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>
|
||||
<button type="button" class="btn btn-sm btn-default" id="assign_Ticket" data-toggle="modal" data-target="#AssignTickets" style="display: none;"><i class="fa fa-hand-o-right"> </i> {!! Lang::get('lang.assign') !!}</button>
|
||||
<!-- 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>-->
|
||||
|
||||
<button type="button" class="btn btn-sm btn-default" id="assign_Ticket" data-toggle="modal" data-target="#AssignTickets" style="display: none;"><i class="fa fa-hand-o-right"> </i> {!! Lang::get('lang.assign') !!}</button>
|
||||
<p><p/>
|
||||
<div class="mailbox-messages" id="refresh">
|
||||
<!--datatable-->
|
||||
{!! 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('get.inbox.ticket'))
|
||||
{!!$table->render('vendor.Chumper.template')!!}
|
||||
|
||||
|
||||
->setOrder(array(6=>'desc'))
|
||||
->setClass('table table-hover table-bordered table-striped')
|
||||
->setCallbacks("fnCreatedRow", 'function( nRow, aData, iDataIndex ) {
|
||||
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();!!}
|
||||
<!-- /.datatable -->
|
||||
</div><!-- /.mail-box-messages -->
|
||||
{!! Form::close() !!}
|
||||
@@ -166,7 +161,6 @@ if (Auth::user()->role == 'agent') {
|
||||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
</div><!-- /.modal -->
|
||||
|
||||
<!-- Assign ticket model-->
|
||||
<div class="modal fade" id="AssignTickets">
|
||||
<div class="modal-dialog">
|
||||
@@ -201,8 +195,7 @@ if (Auth::user()->role == 'agent') {
|
||||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
</div><!-- /.modal -->
|
||||
<!-- Assign ticket model-->
|
||||
|
||||
<!-- Assign ticket model-->
|
||||
<!-- 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">
|
||||
@@ -223,14 +216,14 @@ if (Auth::user()->role == 'agent') {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
{!! $table->script('vendor.Chumper.ticket-javascript') !!}
|
||||
<script>
|
||||
|
||||
var t_id = [];
|
||||
var option = null;
|
||||
$(function() {
|
||||
$(function () {
|
||||
//Enable check and uncheck all functionality
|
||||
$(".checkbox-toggle").click(function() {
|
||||
$(".checkbox-toggle").click(function () {
|
||||
var clicks = $(this).data('clicks');
|
||||
if (clicks) {
|
||||
//Uncheck all checkboxes
|
||||
@@ -245,20 +238,20 @@ if (Auth::user()->role == 'agent') {
|
||||
});
|
||||
});
|
||||
|
||||
$(function() {
|
||||
$(function () {
|
||||
// Enable check and uncheck all functionality
|
||||
|
||||
$(".checkbox-toggle").click(function() {
|
||||
$(".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() {
|
||||
t_id = $('.selectval').map(function () {
|
||||
return $(this).val();
|
||||
}).get();
|
||||
// alert(checkboxValues);
|
||||
showAssign(t_id);
|
||||
// alert(checkboxValues);
|
||||
} else {
|
||||
//Check all checkboxes
|
||||
$("input[type='checkbox']", ".mailbox-messages").iCheck("check");
|
||||
@@ -274,8 +267,8 @@ if (Auth::user()->role == 'agent') {
|
||||
});
|
||||
|
||||
|
||||
$(document).ready(function() { /// Wait till page is loaded
|
||||
$('#click').click(function() {
|
||||
$(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');
|
||||
@@ -284,17 +277,17 @@ if (Auth::user()->role == 'agent') {
|
||||
|
||||
$(".select2").select2();
|
||||
|
||||
$('#delete').on('click', function() {
|
||||
$('#delete').on('click', function () {
|
||||
option = 0;
|
||||
$('#myModalLabel').html("{{Lang::get('lang.delete-tickets')}}");
|
||||
});
|
||||
|
||||
$('#close').on('click', function() {
|
||||
$('#close').on('click', function () {
|
||||
option = 1;
|
||||
$('#myModalLabel').html("{{Lang::get('lang.close-tickets')}}");
|
||||
});
|
||||
|
||||
$("#modalpopup").on('submit', function(e) {
|
||||
$("#modalpopup").on('submit', function (e) {
|
||||
e.preventDefault();
|
||||
var msg = "{{Lang::get('lang.confirm')}}";
|
||||
var values = getValues();
|
||||
@@ -309,15 +302,15 @@ if (Auth::user()->role == 'agent') {
|
||||
$("#myModal").css("display", "block");
|
||||
});
|
||||
|
||||
$(".closemodal, .no").click(function() {
|
||||
$(".closemodal, .no").click(function () {
|
||||
$("#myModal").css("display", "none");
|
||||
});
|
||||
|
||||
$(".closemodal, .no").click(function() {
|
||||
$(".closemodal, .no").click(function () {
|
||||
$("#myModal").css("display", "none");
|
||||
});
|
||||
|
||||
$('.yes').click(function() {
|
||||
$('.yes').click(function () {
|
||||
var values = getValues();
|
||||
if (values == "") {
|
||||
$("#myModal").css("display", "none");
|
||||
@@ -335,14 +328,14 @@ if (Auth::user()->role == 'agent') {
|
||||
});
|
||||
|
||||
function getValues() {
|
||||
var values = $('.selectval:checked').map(function() {
|
||||
var values = $('.selectval:checked').map(function () {
|
||||
return $(this).val();
|
||||
}).get();
|
||||
return values;
|
||||
}
|
||||
|
||||
//checking merging tickets
|
||||
$('#MergeTickets').on('show.bs.modal', function() {
|
||||
$('#MergeTickets').on('show.bs.modal', function () {
|
||||
|
||||
// alert("hi");
|
||||
$.ajax({
|
||||
@@ -350,11 +343,11 @@ if (Auth::user()->role == 'agent') {
|
||||
url: "{{route('check.merge.tickets',0)}}",
|
||||
dataType: "html",
|
||||
data: {data1: t_id},
|
||||
beforeSend: function() {
|
||||
beforeSend: function () {
|
||||
$("#merge_body").hide();
|
||||
$("#merge_loader").show();
|
||||
},
|
||||
success: function(response) {
|
||||
success: function (response) {
|
||||
if (response == 0) {
|
||||
$("#merge_body").show();
|
||||
$("#merge-succ-alert").hide();
|
||||
@@ -388,7 +381,7 @@ if (Auth::user()->role == 'agent') {
|
||||
url: "{{ route('get.merge.tickets',0) }}",
|
||||
dataType: "html",
|
||||
data: {data1: t_id},
|
||||
success: function(data) {
|
||||
success: function (data) {
|
||||
$('#select-merge-parent').html(data);
|
||||
}
|
||||
// return false;
|
||||
@@ -399,17 +392,17 @@ if (Auth::user()->role == 'agent') {
|
||||
});
|
||||
|
||||
//submit merging form
|
||||
$('#merge-form').on('submit', function() {
|
||||
$('#merge-form').on('submit', function () {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "{!! url('merge-tickets/') !!}/" + t_id,
|
||||
dataType: "json",
|
||||
data: $(this).serialize(),
|
||||
beforeSend: function() {
|
||||
beforeSend: function () {
|
||||
$("#merge_body").hide();
|
||||
$("#merge_loader").show();
|
||||
},
|
||||
success: function(response) {
|
||||
success: function (response) {
|
||||
if (response == 0) {
|
||||
$("#merge_body").show();
|
||||
$("#merge-succ-alert").hide();
|
||||
@@ -430,14 +423,9 @@ if (Auth::user()->role == 'agent') {
|
||||
var message = "{{Lang::get('lang.merge-success')}}";
|
||||
$("#merge-succ-alert").show();
|
||||
$('#message-merge-succ').html(message);
|
||||
setInterval(function() {
|
||||
setTimeout(function () {
|
||||
$("#alert11").hide();
|
||||
setTimeout(function() {
|
||||
var link = document.querySelector('#load-inbox');
|
||||
if (link) {
|
||||
link.click();
|
||||
}
|
||||
}, 100);
|
||||
location.reload();
|
||||
}, 1000);
|
||||
}
|
||||
}
|
||||
@@ -489,18 +477,17 @@ if (Auth::user()->role == 'agent') {
|
||||
})
|
||||
return false;
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function someFunction(id) {
|
||||
if (document.getElementById(id).checked) {
|
||||
t_id.push(id);
|
||||
// alert(t_id);
|
||||
} else if(document.getElementById(id).checked === undefined){
|
||||
} else if (document.getElementById(id).checked === undefined) {
|
||||
var index = t_id.indexOf(id);
|
||||
if (index === -1){
|
||||
if (index === -1) {
|
||||
t_id.push(id);
|
||||
} else{
|
||||
} else {
|
||||
t_id.splice(index, 1);
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user