attachments work
This commit is contained in:
parent
412ffc0e87
commit
203d845825
|
|
@ -6,6 +6,9 @@
|
|||
/storage/*.key
|
||||
/vendor
|
||||
.env
|
||||
.zip
|
||||
/chat.kundesone.no
|
||||
/mailgun.kundesone.no
|
||||
.env.backup
|
||||
.env.production
|
||||
.phpunit.result.cache
|
||||
|
|
|
|||
|
|
@ -43,6 +43,11 @@ RewriteRule ^(/)?$ public/index.php [L]
|
|||
php_flag zlib.output_compression Off
|
||||
</IfModule>
|
||||
# END cPanel-generated php ini directives, do not edit
|
||||
# Deny access to .env files
|
||||
<Files .env>
|
||||
Order allow,deny
|
||||
Deny from all
|
||||
</Files>
|
||||
|
||||
# php -- BEGIN cPanel-generated handler, do not edit
|
||||
# Set the “ea-php81” package as the default “PHP” programming language.
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@
|
|||
use App\Models\Company;
|
||||
use App\Models\ChatGroup;
|
||||
use App\Models\Message;
|
||||
use App\Models\Tag;
|
||||
use App\Models\CompanyUser;
|
||||
|
||||
function get_company_users($company_id){
|
||||
|
|
@ -19,6 +20,11 @@ function get_company_users($company_id){
|
|||
|
||||
}
|
||||
|
||||
function getCompanyTags($companyId) {
|
||||
$tags = Tag::where('company_id', $companyId)->get();
|
||||
return $tags;
|
||||
}
|
||||
|
||||
|
||||
function get_company($key,$value){
|
||||
return Company::where($key,$value)->first();
|
||||
|
|
@ -280,10 +286,26 @@ function getMessagesByChatId($chatId)
|
|||
|
||||
function setTicketMeta(int $ticketId, string $key, $value, string $type = 'string')
|
||||
{
|
||||
return TicketMeta::updateOrCreate(
|
||||
['ticket_id' => $ticketId, 'key' => $key],
|
||||
['value' => json_encode($value), 'type' => $type]
|
||||
);
|
||||
$ticket_metas = [];
|
||||
// return TicketMeta::updateOrCreate(
|
||||
// ['ticket_id' => $ticketId, 'key' => $key],
|
||||
// ['value' => json_encode($value), 'type' => $type]
|
||||
// );
|
||||
|
||||
foreach($value as $tag)
|
||||
{
|
||||
$ticket_meta = TicketMeta::updateOrCreate([
|
||||
'ticket_id' => $ticketId,
|
||||
'key' => $key
|
||||
],[
|
||||
'value' => $tag,
|
||||
'type' => $type
|
||||
]);
|
||||
|
||||
$ticket_metas[] = $ticket_meta;
|
||||
}
|
||||
|
||||
return $ticket_metas;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -299,9 +321,9 @@ function getTicketMeta(int $ticketId, string $key)
|
|||
return $meta ? json_decode($meta->value) : null;
|
||||
}
|
||||
|
||||
function getChatSetting($key)
|
||||
function getChatSetting($key, $company_id = null)
|
||||
{
|
||||
$companyId = getSelectedCompany();
|
||||
$companyId = $company_id??getSelectedCompany();
|
||||
$get_chat_setting = CompanyMeta::where('company_id', $companyId)->where('key', $key)->where('type', 'Chat Setting')->first();
|
||||
return $get_chat_setting;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,6 +14,10 @@
|
|||
class ChatController extends Controller
|
||||
{
|
||||
|
||||
public function chatDemo(Request $request){
|
||||
return view('chat.demo');
|
||||
}
|
||||
|
||||
public function CloseChat(Request $request){
|
||||
$chat_id = $request->chat_id;
|
||||
|
||||
|
|
@ -66,13 +70,13 @@ public function startChat(Request $request)
|
|||
|
||||
$company_id = $request->company_id;
|
||||
|
||||
$user_id = $this->select_user($company_id);
|
||||
$user = $this->select_user($company_id);
|
||||
|
||||
if($user_id){
|
||||
if($user){
|
||||
|
||||
$data = [
|
||||
'company_id' => $company_id,
|
||||
'user_id' => $user_id,
|
||||
'user_id' => $user->user_id,
|
||||
'customer_id' => $request->customer_id,
|
||||
'name' => $request->name,
|
||||
'email' => $request->email,
|
||||
|
|
@ -139,7 +143,8 @@ public function select_user($company_id){
|
|||
$access = json_decode($user->access);
|
||||
|
||||
if(in_array('chat',$access)){
|
||||
$selected = $user->user_id;
|
||||
$selected = $user;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -171,12 +176,16 @@ public function checkChat(Request $request){
|
|||
// Str::contains('This is my name', 'my')
|
||||
if( $company->domain == $domain ){
|
||||
|
||||
$user_id = $this->select_user($company_id);
|
||||
$start_message = getChatSetting('start_message',$company_id)?getChatSetting('start_message',$company_id)->value:"What can we help you with?"; //welcome message
|
||||
$message_when_chat_is_closed = getChatSetting('message_when_chat_is_closed',$company_id)?getChatSetting('message_when_chat_is_closed',$company_id)->value:"No user is availble right now! Try later.";
|
||||
$wellcome_text = getChatSetting('wellcome_text',$company_id)?getChatSetting('wellcome_text',$company_id)->value:"Hi, welcome how i can help you today?";
|
||||
|
||||
if($user_id){
|
||||
return response()->json(['status' => 'success']);
|
||||
$user = $this->select_user($company_id);
|
||||
|
||||
if($user){
|
||||
return response()->json(['status' => 'success','data' => ['welcome' => $wellcome_text, 'start_message' => $start_message, 'user' => $user->user->name] ]);
|
||||
}else{
|
||||
return response()->json(['status' => 'error', 'message' => "No user is availble right now!"]);
|
||||
return response()->json(['status' => 'error', 'message' => $message_when_chat_is_closed]);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -33,13 +33,14 @@ public function storeFlowSetting(Request $request)
|
|||
'logout_editor_who_missed_chat' => $request->logout_editor_who_missed_chat,
|
||||
'logout_everyone_automatically' => $request->logout_everyone_automatically,
|
||||
'chat_assistant_show_suggestion_form' => $request->chat_assistant_show_suggestion_form,
|
||||
'message_sent_to' => $request->message_sent_to,
|
||||
];
|
||||
|
||||
foreach($flow_setting as $key => $value) {
|
||||
if(!is_null($value)) {
|
||||
CompanyMeta::updateOrCreate([
|
||||
'key' => $key,
|
||||
'value' => $value
|
||||
'company_id' => $companyId,
|
||||
],[
|
||||
'company_id' => $companyId,
|
||||
'key' => $key,
|
||||
|
|
@ -290,4 +291,24 @@ public function settingAllChat(Request $request)
|
|||
]);
|
||||
return redirect()->back()->with('success', 'Chat Setting Updated Successfully');
|
||||
}
|
||||
|
||||
public function blockIpAdresses(Request $request)
|
||||
{
|
||||
$this->validate($request, [
|
||||
'ip_addresses' => 'required'
|
||||
]);
|
||||
|
||||
$companyId = getSelectedCompany();
|
||||
CompanyMeta::updateOrCreate([
|
||||
'key' => 'ip_addresses',
|
||||
'company_id' => $companyId,
|
||||
],[
|
||||
'company_id' => $companyId,
|
||||
'key' => 'ip_addresses',
|
||||
'value' => $request->ip_addresses,
|
||||
'type' => 'Chat Setting'
|
||||
]);
|
||||
|
||||
return redirect()->back()->with('success', 'Chat Setting Updated Successfully');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,9 @@ class DashboardController extends Controller
|
|||
public function dashboard()
|
||||
{
|
||||
$tickets = get_current_company_tickets(['type' => 'inbox']);
|
||||
return view('index', ['tickets' => $tickets]);
|
||||
$companyId = getSelectedCompany();
|
||||
$tags = getCompanyTags($companyId);
|
||||
return view('index', ['tickets' => $tickets, 'tags' => $tags]);
|
||||
}
|
||||
|
||||
public function profile()
|
||||
|
|
|
|||
|
|
@ -9,6 +9,8 @@
|
|||
use App\Models\Comment;
|
||||
use App\Models\Response;
|
||||
use App\Models\Language;
|
||||
use App\Models\Tag;
|
||||
use App\Models\Rule;
|
||||
use App\Models\CompanyMeta;
|
||||
use App\Models\CompanyUser;
|
||||
use Carbon\Carbon;
|
||||
|
|
@ -33,10 +35,14 @@ public function inboxSetting()
|
|||
$canned_response = $this->get_canned_responses();
|
||||
$spam_handling = CompanyMeta::where('company_id', $companyId)->where('type', 'Spam Handling')->first();
|
||||
$email_signature = CompanyMeta::where('company_id', $companyId)->where('type', 'Email Signature')->first();
|
||||
$company_users = get_company_users($companyId);
|
||||
$tags = Tag::where('company_id', $companyId)->get();
|
||||
$rule = Rule::where('company_id', $companyId)->first();
|
||||
|
||||
|
||||
return view('inbox-setting', ['timezones' => $timezones, 'basic_setting' => $basic_setting, 'spam_handling' => $spam_handling,
|
||||
'email_signature' => $email_signature, 'canned_response' => $canned_response, 'languages' => $languages, 'company' => get_company('id',$companyId)]);
|
||||
'email_signature' => $email_signature, 'canned_response' => $canned_response, 'languages' => $languages, 'company' => get_company('id',$companyId),
|
||||
'company_users' => $company_users, 'tags' => $tags, 'rule' => $rule]);
|
||||
}
|
||||
|
||||
public function basicSetting(Request $request)
|
||||
|
|
@ -429,4 +435,30 @@ public function deleteComment($commentId)
|
|||
|
||||
return response()->json(['message' => 'Comment Deleted Successfully']);
|
||||
}
|
||||
|
||||
public function updateRule(Request $request)
|
||||
{
|
||||
$companyId = getSelectedCompany();
|
||||
|
||||
//Update Rule
|
||||
Rule::updateOrCreate([
|
||||
'company_id' => $companyId,
|
||||
],[
|
||||
'company_id' => $companyId,
|
||||
'from' => $request->from,
|
||||
'to' => $request->to,
|
||||
'subject_contains' => $request->subject_contains,
|
||||
'text_contains' => $request->text_contains,
|
||||
'subject1_contains' => $request->subject1_contains,
|
||||
'tag_id' => $request->tag_id,
|
||||
'name' => $request->name,
|
||||
'assign_to' => $request->assign_to,
|
||||
'status' => $request->status,
|
||||
'priority' => $request->priority,
|
||||
'message_to_assigned_editor' => $request->message_to_assigned_editor,
|
||||
'all_emails_automatically_mark_as_spam' => $request->all_emails_automatically_mark_as_spam,
|
||||
]);
|
||||
|
||||
return redirect()->back()->with('success', 'Setting Updated successfully.');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,14 +5,14 @@
|
|||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
class EmailController extends Controller
|
||||
{
|
||||
public function saveEmail(Request $request){
|
||||
|
||||
DB::beginTransaction();
|
||||
// DB::beginTransaction();
|
||||
|
||||
try {
|
||||
// try {
|
||||
|
||||
$token = $request->input('token');
|
||||
$timestamp = $request->input('timestamp');
|
||||
|
|
@ -36,18 +36,40 @@ public function saveEmail(Request $request){
|
|||
|
||||
if($company){
|
||||
$ticket = insertTicket($data['from_email'], $company->email, $data['subject'], $message,'inbox',$data['from_name'] );
|
||||
if($ticket)
|
||||
if($ticket){
|
||||
$response = createResponse($ticket->id,$message);
|
||||
|
||||
$attachmentCount = $request->input('attachment-count', 0);
|
||||
|
||||
update_setting('aw_test',$attachmentCount);
|
||||
|
||||
for ($i = 1; $i <= $attachmentCount; $i++) {
|
||||
$attachment = $request->file("attachment-$i");
|
||||
update_setting('aw_test',$attachment->getClientOriginalName());
|
||||
if ($attachment && $attachment->isValid()) {
|
||||
// Define a unique filename, possibly using the original filename and appending a timestamp or a unique id
|
||||
$filename = time() . '_' . $attachment->getClientOriginalName();
|
||||
|
||||
// Save the attachment to the local or specific disk
|
||||
$filePath = $attachment->storeAs('tickets/' . $ticket->id, $filename, 'public');
|
||||
$fileUrl = url(Storage::url($filePath));
|
||||
update_setting('aw_test',$fileUrl);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}else{}
|
||||
|
||||
// update_setting('aw_test',json_encode($request->all()));
|
||||
|
||||
DB::commit();
|
||||
} catch (\Exception $e) {
|
||||
update_setting('aw_test',$e->getMessage());
|
||||
DB::rollBack();
|
||||
// Handle the exception
|
||||
}
|
||||
// DB::commit();
|
||||
// } catch (\Exception $e) {
|
||||
|
||||
// DB::rollBack();
|
||||
// update_setting('aw_test',json_encode($e->getMessage()));
|
||||
// sendEmailViaMailgun( 'ai.rapidev.tech', 'support@ai.rapidev.tech', '16bsse18212@gmail.com', 'error', json_encode($e->getMessage()));
|
||||
// // Handle the exception
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -60,7 +82,7 @@ public function extractMailgunData($data) {
|
|||
'to_email' => $data['To'],
|
||||
'from_name' => '', // This will be extracted from the 'from' field
|
||||
'subject' => $data['subject'],
|
||||
'message' => $data['body-plain'],
|
||||
'message' => $data['body-html'],
|
||||
'mime_version' => $data['Mime-Version'],
|
||||
'dkim_signature' => $data['Dkim-Signature']
|
||||
];
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@
|
|||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Models\Ticket;
|
||||
use App\Models\TicketMeta;
|
||||
use App\Models\TicketNote;
|
||||
use App\Models\Comment;
|
||||
use App\Models\Response;
|
||||
use App\Models\Company;
|
||||
|
|
@ -16,14 +18,16 @@
|
|||
class TicketController extends Controller
|
||||
{
|
||||
public function get_canned_responses(){
|
||||
$companyId = getSelectedCompany();;
|
||||
$companyId = getSelectedCompany();
|
||||
return CompanyMeta::where('company_id', $companyId)->where('key', 'canned_responses')->get();
|
||||
}
|
||||
|
||||
public function allTickets()
|
||||
{
|
||||
$companyId = getSelectedCompany();
|
||||
$tickets = get_current_company_tickets();
|
||||
return view('all-tickets', ['tickets' => $tickets]);
|
||||
$tags = Tag::where('company_id', $companyId)->get();
|
||||
return view('all-tickets', ['tickets' => $tickets, 'tags' => $tags]);
|
||||
}
|
||||
|
||||
public function waiting()
|
||||
|
|
@ -118,4 +122,185 @@ public function storeTags(Request $request)
|
|||
|
||||
return response()->json(['success' => true, 'message' => 'Tags Added Successfully']);
|
||||
}
|
||||
|
||||
public function AssignTicket(Request $request)
|
||||
{
|
||||
$this->validate($request, [
|
||||
'user_assigned' => 'required|integer',
|
||||
'message' => 'required|string',
|
||||
'ticket_ids' => 'required|string',
|
||||
]);
|
||||
|
||||
$companyId = getSelectedCompany();
|
||||
|
||||
$ticketIds = explode(',', $request->ticket_ids);
|
||||
foreach ($ticketIds as $ticket_id) {
|
||||
$ticket = Ticket::find($ticket_id);
|
||||
|
||||
if ($ticket) {
|
||||
// Update Ticket
|
||||
$ticket->user_assigned = $request->user_assigned;
|
||||
$ticket->save();
|
||||
|
||||
//Send Mail
|
||||
$company = Company::find($companyId);
|
||||
sendEmailViaMailgun($company->domain, $company->email, $ticket->from_email, $ticket->subject, $request->message);
|
||||
//Create Response
|
||||
$formattedMessage = '<p>' . $request->message . '</p>';
|
||||
createResponse($ticket_id,$formattedMessage,auth()->id());
|
||||
}
|
||||
}
|
||||
|
||||
return response()->json(['success' => true, 'message' => 'Post Assigned Successfully']);
|
||||
}
|
||||
|
||||
public function deleteTickets(Request $request)
|
||||
{
|
||||
$this->validate($request, [
|
||||
'ticket_ids' => 'required|string',
|
||||
]);
|
||||
|
||||
$ticketIds = explode(',', $request->ticket_ids);
|
||||
foreach ($ticketIds as $ticket_id) {
|
||||
$ticket = Ticket::find($ticket_id);
|
||||
|
||||
if ($ticket) {
|
||||
// Delete Ticket
|
||||
Comment::where('ticket_id', $ticket_id)->delete();
|
||||
TicketMeta::where('ticket_id', $ticket_id)->delete();
|
||||
Response::where('ticket_id', $ticket_id)->delete();
|
||||
TicketNote::where('ticket_id', $ticket_id)->delete();
|
||||
$ticket->delete();
|
||||
}
|
||||
}
|
||||
|
||||
return response()->json(['success' => true, 'message' => 'Tickets Deleted Successfully']);
|
||||
}
|
||||
|
||||
public function updateTicketStatus(Request $request)
|
||||
{
|
||||
$this->validate($request, [
|
||||
'ticket_ids' => 'required|string',
|
||||
'status' => 'required|string'
|
||||
]);
|
||||
|
||||
$ticketIds = explode(',', $request->ticket_ids);
|
||||
foreach ($ticketIds as $ticket_id) {
|
||||
$ticket = Ticket::find($ticket_id);
|
||||
|
||||
if ($ticket) {
|
||||
// Delete Ticket
|
||||
$ticket->status = $request->status;
|
||||
$ticket->save();
|
||||
}
|
||||
}
|
||||
|
||||
return response()->json(['success' => true, 'message' => 'Tickets Status Updated Successfully']);
|
||||
}
|
||||
|
||||
public function filter(Request $request)
|
||||
{
|
||||
$this->validate($request, [
|
||||
'filter' => 'required|string',
|
||||
'status' => 'required|string',
|
||||
]);
|
||||
|
||||
$companyId = getSelectedCompany();
|
||||
$company = get_company('id',$companyId);
|
||||
$now = \Carbon\Carbon::now();
|
||||
|
||||
if(isset($request->type)) {
|
||||
$tickets = Ticket::where('to_email', $company->email)->where('type', $request->type)->where('status', '!=', 'done')->orderBy('created_at','desc');
|
||||
} else {
|
||||
$tickets = Ticket::where('to_email', $company->email)->where('status', '!=', 'done')->orderBy('created_at','desc');
|
||||
}
|
||||
|
||||
if($request->filter == 'Assigned to') {
|
||||
$all_tickets = $tickets->where('user_assigned', $request->status)->get();
|
||||
return response()->json(['tickets' => $all_tickets]);
|
||||
} elseif($request->filter == 'With activity') {
|
||||
|
||||
if ($request->status === 'last 24 hours') {
|
||||
$all_tickets = $tickets->where('updated_at', '>=', $now->subDay());
|
||||
} elseif ($request->status === 'last 3 days') {
|
||||
$all_tickets = $tickets->where('updated_at', '>=', $now->subDays(3));
|
||||
} elseif ($request->status === 'last week') {
|
||||
$all_tickets = $tickets->where('updated_at', '>=', $now->subWeek());
|
||||
} elseif ($request->status === 'last month') {
|
||||
$all_tickets = $tickets->where('updated_at', '>=', $now->subMonth());
|
||||
} elseif ($request->status === 'last 3 months') {
|
||||
$all_tickets = $tickets->where('updated_at', '>=', $now->subMonths(3));
|
||||
} elseif ($request->status === 'last 6 months') {
|
||||
$all_tickets = $tickets->where('updated_at', '>=', $now->subMonths(6));
|
||||
} elseif ($request->status === 'last year') {
|
||||
$all_tickets = $tickets->where('updated_at', '>=', $now->subYear());
|
||||
} elseif ($request->status === 'the past 2 years') {
|
||||
$all_tickets = $tickets->where('updated_at', '>=', $now->subYears(2));
|
||||
} elseif ($request->status === 'the past 3 years') {
|
||||
$all_tickets = $tickets->where('updated_at', '>=', $now->subYears(3));
|
||||
} elseif ($request->status === 'the past 4 years') {
|
||||
$all_tickets = $tickets->where('updated_at', '>=', $now->subYears(4));
|
||||
} elseif ($request->status === 'the past 5 years') {
|
||||
$all_tickets = $tickets->where('updated_at', '>=', $now->subYears(5));
|
||||
}
|
||||
|
||||
$activity_tickets = $all_tickets->get();
|
||||
return response()->json(['tickets' => $activity_tickets]);
|
||||
} elseif($request->filter == 'No activity') {
|
||||
|
||||
if ($request->status === 'last 24 hours') {
|
||||
$all_tickets = $tickets->where('updated_at', '<=', $now->subDay());
|
||||
} elseif ($request->status === 'last 3 days') {
|
||||
$all_tickets = $tickets->where('updated_at', '<=', $now->subDays(3));
|
||||
} elseif ($request->status === 'last week') {
|
||||
$all_tickets = $tickets->where('updated_at', '<=', $now->subWeek());
|
||||
} elseif ($request->status === 'last month') {
|
||||
$all_tickets = $tickets->where('updated_at', '<=', $now->subMonth());
|
||||
} elseif ($request->status === 'last 3 months') {
|
||||
$all_tickets = $tickets->where('updated_at', '<=', $now->subMonths(3));
|
||||
} elseif ($request->status === 'last 6 months') {
|
||||
$all_tickets = $tickets->where('updated_at', '<=', $now->subMonths(6));
|
||||
} elseif ($request->status === 'last year') {
|
||||
$all_tickets = $tickets->where('updated_at', '<=', $now->subYear());
|
||||
} elseif ($request->status === 'the past 2 years') {
|
||||
$all_tickets = $tickets->where('updated_at', '<=', $now->subYears(2));
|
||||
} elseif ($request->status === 'the past 3 years') {
|
||||
$all_tickets = $tickets->where('updated_at', '<=', $now->subYears(3));
|
||||
} elseif ($request->status === 'the past 4 years') {
|
||||
$all_tickets = $tickets->where('updated_at', '<=', $now->subYears(4));
|
||||
} elseif ($request->status === 'the past 5 years') {
|
||||
$all_tickets = $tickets->where('updated_at', '<=', $now->subYears(5));
|
||||
}
|
||||
|
||||
|
||||
$no_activity_tickets = $all_tickets->get();
|
||||
return response()->json(['tickets' => $no_activity_tickets]);
|
||||
} elseif($request->filter == 'Spam') {
|
||||
$all_tickets = $tickets->where('status', $request->status)->get();
|
||||
return response()->json(['tickets' => $all_tickets]);
|
||||
} elseif($request->filter == 'Status') {
|
||||
$all_tickets = $tickets->where('status', $request->status)->get();
|
||||
return response()->json(['tickets' => $all_tickets]);
|
||||
} elseif($request->filter == 'Tags') {
|
||||
$ticket_meta = TicketMeta::where('value', $request->status)->pluck('ticket_id')->toArray();
|
||||
if(isset($request->type)) {
|
||||
$all_tickets = Ticket::where('to_email', $company->email)->where('type', $request->type)->where('status', '!=', 'done')->orderBy('created_at','desc')->whereIn('id', $ticket_meta)->get();
|
||||
} else {
|
||||
$all_tickets = Ticket::where('to_email', $company->email)->orderBy('created_at','desc')->where('status', '!=', 'done')->whereIn('id', $ticket_meta)->get();
|
||||
}
|
||||
return response()->json(['tickets' => $all_tickets]);
|
||||
}
|
||||
}
|
||||
|
||||
public function defaultAllTickets(Request $request)
|
||||
{
|
||||
$companyId = getSelectedCompany();
|
||||
$company = get_company('id',$companyId);
|
||||
if(isset($request->type)) {
|
||||
$tickets = get_current_company_tickets(['type' => $request->type]);
|
||||
} else {
|
||||
$tickets = get_current_company_tickets();
|
||||
}
|
||||
return response()->json(['tickets' => $tickets]);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,8 @@
|
|||
use App\Models\User;
|
||||
use App\Models\CompanyUser;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Carbon\Carbon;
|
||||
|
||||
class UserController extends Controller
|
||||
{
|
||||
|
|
@ -44,4 +46,31 @@ public function deleteUser($id)
|
|||
$user->delete();
|
||||
return redirect()->back()->with('success', 'User Deleted Successfully');
|
||||
}
|
||||
|
||||
public function updateChatAvailability(Request $request)
|
||||
{
|
||||
$user = Auth::user();
|
||||
|
||||
//update user
|
||||
if($request->status == "on") {
|
||||
$user->is_available = 1;
|
||||
$user->save();
|
||||
} else {
|
||||
$user->is_available = 0;
|
||||
$user->save();
|
||||
}
|
||||
|
||||
return response()->json(['success' => 'Updated Successfully']);
|
||||
}
|
||||
|
||||
public function updateLastOnline()
|
||||
{
|
||||
$user = Auth::user();
|
||||
|
||||
//update last online
|
||||
$user->last_online = Carbon::now();
|
||||
$user->save();
|
||||
|
||||
return response()->json(['success' => true]);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,13 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Rule extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $guarded = [];
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->string('last_online')->nullable();
|
||||
$table->boolean('is_available')->default(true);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
//
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('rules', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('company_id')->constrained('companies')->onDelete('cascade');
|
||||
$table->integer('tag_id')->nullable();
|
||||
$table->string('name')->nullable();
|
||||
$table->string('from')->nullable();
|
||||
$table->string('to')->nullable();
|
||||
$table->string('subject_contains')->nullable();
|
||||
$table->string('text_contains')->nullable();
|
||||
$table->string('subject1_contains')->nullable();
|
||||
$table->string('assign_to')->nullable();
|
||||
$table->string('message_to_assigned_editor')->nullable();
|
||||
$table->string('all_emails_automatically_mark_as_spam')->nullable();
|
||||
$table->string('status');
|
||||
$table->string('priority');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('rules');
|
||||
}
|
||||
};
|
||||
|
|
@ -4,6 +4,29 @@
|
|||
|
||||
@section('content')
|
||||
|
||||
<script>
|
||||
|
||||
$(document).ready(function(){
|
||||
$('.side-bar-links a').removeClass('bg-light-color');
|
||||
$('.aw-a-inbox').addClass('bg-light-color');
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<!-- Toastr CSS -->
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.css" rel="stylesheet">
|
||||
<!-- Toastr JS -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.js"></script>
|
||||
<!-- SweetAlert2 CSS -->
|
||||
<link href="https://cdn.jsdelivr.net/npm/sweetalert2@11/dist/sweetalert2.min.css" rel="stylesheet">
|
||||
<!-- SweetAlert2 JS -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11/dist/sweetalert2.all.min.js"></script>
|
||||
|
||||
@php
|
||||
$companyId = getSelectedCompany();
|
||||
$company_users = get_company_users($companyId);
|
||||
@endphp
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
// Toggle filter dropdown on button click
|
||||
|
|
@ -24,13 +47,13 @@
|
|||
$('.handle_multiple__options .tags button').prop('disabled', true);
|
||||
|
||||
// Enable/disable buttons based on the select all checkbox
|
||||
$('#select-all').change(function() {
|
||||
if ($(this).is(':checked')) {
|
||||
$('.handle_multiple__options .tags button').prop('disabled', false);
|
||||
} else {
|
||||
$('.handle_multiple__options .tags button').prop('disabled', true);
|
||||
}
|
||||
});
|
||||
// $('#select-all').change(function() {
|
||||
// if ($(this).is(':checked')) {
|
||||
// $('.handle_multiple__options .tags button').prop('disabled', false);
|
||||
// } else {
|
||||
// $('.handle_multiple__options .tags button').prop('disabled', true);
|
||||
// }
|
||||
// });
|
||||
|
||||
// Show the modal when "Assign post" button is clicked
|
||||
$('.handle_multiple__options .tags button:contains("Assign post")').click(function(e) {
|
||||
|
|
@ -75,33 +98,58 @@ function updateStatusOptions(selectedFilter) {
|
|||
console.log("Updating status options for:", selectedFilter); // Debugging log
|
||||
switch (selectedFilter) {
|
||||
case 'Assigned to':
|
||||
$('#status-select').html(`
|
||||
<option disabled value="">Select assigned to</option>
|
||||
<option value="Assigned">Assigned</option>
|
||||
<option value="Unassigned">Unassigned</option>
|
||||
<option value="Margin">Margin</option>
|
||||
`);
|
||||
// $('#status-select').html(`
|
||||
// <option disabled value="">Select assigned to</option>
|
||||
// <option value="Assigned">Assigned</option>
|
||||
// <option value="Unassigned">Unassigned</option>
|
||||
// <option value="Margin">Margin</option>
|
||||
// `);
|
||||
var options = '<option value="">Select assigned to</option>';
|
||||
// Loop through the company_users array
|
||||
@foreach($company_users as $company_user)
|
||||
options += '<option value="{{ $company_user->user->id }}">{{ $company_user->user->name }}</option>';
|
||||
@endforeach
|
||||
|
||||
$('#status-select').html(options);
|
||||
$('.filter_based__data').show();
|
||||
break;
|
||||
case 'Which activity':
|
||||
case 'With activity':
|
||||
$('#status-select').html(`
|
||||
<option disabled value="">Select activity</option>
|
||||
<option value="Marked as spam">Marked as spam</option>
|
||||
<option value="Not spam">Not spam</option>
|
||||
<option value="">Select No activity</option>
|
||||
<option value="last 24 hours">Last 24 hours</option>
|
||||
<option value="last 3 days">Last 3 days</option>
|
||||
<option value="last week">Last week</option>
|
||||
<option value="last month">Last month</option>
|
||||
<option value="last 3 months">Last 3 months</option>
|
||||
<option value="last 6 months">Last 6 months</option>
|
||||
<option value="last year">Last year</option>
|
||||
<option value="the past 2 years">The past 2 years</option>
|
||||
<option value="the past 3 years">The past 3 years</option>
|
||||
<option value="the past 4 years">The past 4 years</option>
|
||||
<option value="the past 5 years">The past 5 years</option>
|
||||
`);
|
||||
$('.filter_based__data').show();
|
||||
break;
|
||||
case 'No activity':
|
||||
$('#status-select').html(`
|
||||
<option disabled value="">Select No activity</option>
|
||||
<option value="Exercise">Exercise</option>
|
||||
<option value="Not Yoga">Not Yoga</option>
|
||||
<option value="">Select No activity</option>
|
||||
<option value="last 24 hours">Last 24 hours</option>
|
||||
<option value="last 3 days">Last 3 days</option>
|
||||
<option value="last week">Last week</option>
|
||||
<option value="last month">Last month</option>
|
||||
<option value="last 3 months">Last 3 months</option>
|
||||
<option value="last 6 months">Last 6 months</option>
|
||||
<option value="last year">Last year</option>
|
||||
<option value="the past 2 years">The past 2 years</option>
|
||||
<option value="the past 3 years">The past 3 years</option>
|
||||
<option value="the past 4 years">The past 4 years</option>
|
||||
<option value="the past 5 years">The past 5 years</option>
|
||||
`);
|
||||
$('.filter_based__data').show();
|
||||
break;
|
||||
case 'Editor':
|
||||
$('#status-select').html(`
|
||||
<option disabled value="">Select Editor</option>
|
||||
<option value="">Select Editor</option>
|
||||
<option value="Computer tool">Computer tool</option>
|
||||
<option value="Direct editor">Direct editor</option>
|
||||
`);
|
||||
|
|
@ -109,34 +157,47 @@ function updateStatusOptions(selectedFilter) {
|
|||
break;
|
||||
case 'Spam':
|
||||
$('#status-select').html(`
|
||||
<option disabled>Select Spam</option>
|
||||
<option value="Marked as spam">Marked as spam</option>
|
||||
<option value="Not spam">Not spam</option>
|
||||
<option value="">Select Spam</option>
|
||||
<option value="marked as spam">Marked as spam</option>
|
||||
<option value="marked as not spam">Marked as not spam</option>
|
||||
`);
|
||||
$('.filter_based__data').show();
|
||||
break;
|
||||
case 'Status':
|
||||
$('#status-select').html(`
|
||||
<option disabled value="">Select status</option>
|
||||
<option value="Completed">Completed</option>
|
||||
<option value="Not Completed">Not Completed</option>
|
||||
<option value="">Select status</option>
|
||||
<option value="open">Open</option>
|
||||
<option value="waiting">Waiting</option>
|
||||
<option value="done">Done</option>
|
||||
`);
|
||||
$('.filter_based__data').show();
|
||||
break;
|
||||
case 'Tags':
|
||||
$('#status-select').html(`
|
||||
<option disabled value="">Select Tags</option>
|
||||
<option value="Target">Target</option>
|
||||
<option value="Mustafa">Mustafa</option>
|
||||
`);
|
||||
|
||||
var options = '<option value="">Select Tags</option>';
|
||||
@foreach($tags as $tag)
|
||||
options += '<option value="{{$tag->name}}">{{$tag->name}}</option>';
|
||||
@endforeach
|
||||
|
||||
$('#status-select').html(options);
|
||||
|
||||
$('.filter_based__data').show();
|
||||
break;
|
||||
case 'Users':
|
||||
$('#status-select').html(`
|
||||
<option disabled value="">Select Users</option>
|
||||
<option value="Merrs">Merrs</option>
|
||||
<option value="Abdullah">Abdullah</option>
|
||||
`);
|
||||
|
||||
var options = '<option value="">Select Users</option>';
|
||||
// Loop through the company_users array
|
||||
@foreach($company_users as $company_user)
|
||||
options += '<option value="{{ $company_user->user->id }}">{{ $company_user->user->name }}</option>';
|
||||
@endforeach
|
||||
// $('#status-select').html(`
|
||||
// <option disabled value="">Select Users</option>`
|
||||
// @foreah($company_users as $company_user)
|
||||
// `<option value="`{{$company_user->user->id}}`">`{{$company_user->user->name}}`</option>
|
||||
// <option value="Abdullah">Abdullah</option>
|
||||
// `);
|
||||
// Update the select element with the generated options
|
||||
$('#status-select').html(options);
|
||||
$('.filter_based__data').show();
|
||||
break;
|
||||
default:
|
||||
|
|
@ -270,6 +331,15 @@ function updateStatusOptions(selectedFilter) {
|
|||
border-radius: 5px;
|
||||
border: 1px solid #ccc;
|
||||
}
|
||||
/* Hide checkboxes initially */
|
||||
.checkbox-wrapper {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* Show checkboxes when 'Handle Multiple' is active */
|
||||
.handle-multiple-active .checkbox-wrapper {
|
||||
display: block;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
@ -297,15 +367,15 @@ function updateStatusOptions(selectedFilter) {
|
|||
<div class="filter">
|
||||
<span> <b>Filter on:</b> </span>
|
||||
<select id="filter-select" name="">
|
||||
<option disabled >Select filter</option>
|
||||
<option value="select_filter_default">Select filter</option>
|
||||
<option value="Assigned to">Assigned to</option>
|
||||
<option value="Which activity">Which activity</option>
|
||||
<option value="With activity">With activity</option>
|
||||
<option value="No activity">No activity</option>
|
||||
<option value="Editor">Editor</option>
|
||||
<!--<option value="Editor">Editor</option>-->
|
||||
<option value="Spam">Spam</option>
|
||||
<option value="Status">Status</option>
|
||||
<option value="Tags">Tags</option>
|
||||
<option value="Users">Users</option>
|
||||
<!--<option value="Users">Users</option>-->
|
||||
</select>
|
||||
<div class="filter_based__data">
|
||||
<select id="status-select" name="">
|
||||
|
|
@ -320,13 +390,13 @@ function updateStatusOptions(selectedFilter) {
|
|||
<label for="select-all"> <input type="checkbox" name="" id="select-all"> Select all</label>
|
||||
<div class="tags">
|
||||
<button>Assign post</button>
|
||||
<button>Delete</button>
|
||||
<button>Move</button>
|
||||
<button>Open</button>
|
||||
<button>Waiting</button>
|
||||
<button>Done</button>
|
||||
<button>Tag</button>
|
||||
<button>Not spam</button>
|
||||
<button id="delete-posts">Delete</button>
|
||||
<!--<button>Move</button>-->
|
||||
<button data-status="open" class="update-posts-status">Open</button>
|
||||
<button data-status="waiting" class="update-posts-status">Waiting</button>
|
||||
<button data-status="done" class="update-posts-status">Done</button>
|
||||
<!--<button>Tag</button>-->
|
||||
<!--<button>Not spam</button>-->
|
||||
<button>Reply to multiple</button>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -336,6 +406,9 @@ function updateStatusOptions(selectedFilter) {
|
|||
@foreach($tickets as $ticket)
|
||||
<li>
|
||||
<a href="{{ route('show.ticket', $ticket->id) }}" class="chat-detail-item d-flex align-items-center">
|
||||
<div class="checkbox-wrapper">
|
||||
<input type="checkbox" class="ticket-checkbox" id="ticket-{{$ticket->id}}">
|
||||
</div>
|
||||
<div class="chat-user-img all-tickets position-relative">
|
||||
<img src="{{ asset('images/Avatar.png') }}" alt="User">
|
||||
<div
|
||||
|
|
@ -370,52 +443,133 @@ class="chat-status-icon rounded-circle text-center align-content-center position
|
|||
|
||||
</div>
|
||||
</div>
|
||||
<!-- Custom Modal post -->
|
||||
<div id="customModal" class="modal">
|
||||
<div class="modal-content">
|
||||
<span class="modal-close">×</span>
|
||||
<h5>Assign Post</h5>
|
||||
<form>
|
||||
<div class="mb-3">
|
||||
<label for="recipient-name" class="col-form-label">Recipient:</label>
|
||||
<input type="text" class="form-control" id="recipient-name">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="message-text" class="col-form-label">Message:</label>
|
||||
<textarea class="form-control" id="message-text"></textarea>
|
||||
</div>
|
||||
</form>
|
||||
<button type="button" class="btn btn-primary">Send</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Custom Modal move-->
|
||||
<div id="customModal2" class="modal">
|
||||
<div class="modal-content">
|
||||
<span class="modal-close">×</span>
|
||||
<h5>Move</h5>
|
||||
<form>
|
||||
<div class="mb-3">
|
||||
<label for="recipient-name" class="col-form-label">Conversation moved:</label>
|
||||
<input type="text" class="form-control" id="recipient-name" placeholder="Inbox">
|
||||
</div>
|
||||
|
||||
</form>
|
||||
<button type="button" class="btn btn-primary">Confirm</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Custom Modal Replay to multiple-->
|
||||
<div id="customModal3" class="modal">
|
||||
<div class="modal-content">
|
||||
<span class="modal-close">×</span>
|
||||
<h5>Replay to multiple</h5>
|
||||
<form>
|
||||
<div class="mb-3 mt-4">
|
||||
<p>Please choose only email conversations and try again</p>
|
||||
</div>
|
||||
<!--Filter Status Code-->
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
const filterSelect = $('#filter-select');
|
||||
const statusSelect = $('#status-select');
|
||||
const statusOptions = $('#status-options');
|
||||
const chatDetails = $('.chat-details');
|
||||
|
||||
</form>
|
||||
// Handle status change
|
||||
$('#status-select').change(function() {
|
||||
fetchTickets();
|
||||
});
|
||||
|
||||
// Fetch tickets based on filter
|
||||
function fetchTickets() {
|
||||
const filter = filterSelect.val();
|
||||
const status = $('#status-select').val();
|
||||
|
||||
$.ajax({
|
||||
url: '/filter',
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': "{{ csrf_token() }}"
|
||||
},
|
||||
data: {
|
||||
filter: filter,
|
||||
status: status,
|
||||
},
|
||||
success: function(data) {
|
||||
chatDetails.empty();
|
||||
$.each(data.tickets, function(index, ticket) {
|
||||
chatDetails.append(`
|
||||
<li>
|
||||
<a href="{{ route('show.ticket', $ticket->id) }}" class="chat-detail-item d-flex align-items-center">
|
||||
<div class="checkbox-wrapper">
|
||||
<input type="checkbox" class="ticket-checkbox" id="ticket-${ticket.id}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="chat-user-img">
|
||||
<img src="/images/Avatar.png" alt="User">
|
||||
</div>
|
||||
<div class="chat-message-info d-flex align-self-baseline">
|
||||
<div class="chat-ticket-row d-flex justify-content-between">
|
||||
<div class="ticket-status d-flex">
|
||||
<p class="color-light-green">#${ticket.id}</p>
|
||||
<div class="ui tiny label bg-dark-green-color color-light">
|
||||
${ticket.status}
|
||||
</div>
|
||||
</div>
|
||||
<p class="color-dark-green">${new Date(ticket.created_at).toLocaleDateString()}</p>
|
||||
</div>
|
||||
<div class="chat-ticket-row d-flex justify-content-between">
|
||||
<div class="ticket-status d-flex">
|
||||
<p class="color-dark-green receiver-name">${ticket.sender_name}</p>
|
||||
<p class="receiver-message"> - ${ticket.subject}</p>
|
||||
</div>
|
||||
<p class="color-dark-green bold message-time">${new Date(ticket.created_at).toLocaleTimeString()}</p>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
`);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
const chatDetails = $('.chat-details');
|
||||
const filterSelect = $('#filter-select');
|
||||
filterSelect.change(function() {
|
||||
const selectedFilter = $(this).val();
|
||||
|
||||
if (selectedFilter === 'select_filter_default') {
|
||||
$.ajax({
|
||||
url: 'default/all-tickets',
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': "{{ csrf_token() }}"
|
||||
},
|
||||
success: function(data) {
|
||||
chatDetails.empty();
|
||||
$.each(data.tickets, function(index, ticket) {
|
||||
chatDetails.append(`
|
||||
<li>
|
||||
<a href="{{ route('show.ticket', $ticket->id) }}" class="chat-detail-item d-flex align-items-center">
|
||||
<div class="checkbox-wrapper">
|
||||
<input type="checkbox" class="ticket-checkbox" id="ticket-${ticket.id}">
|
||||
</div>
|
||||
<div class="chat-user-img">
|
||||
<img src="/images/Avatar.png" alt="User">
|
||||
</div>
|
||||
<div class="chat-message-info d-flex align-self-baseline">
|
||||
<div class="chat-ticket-row d-flex justify-content-between">
|
||||
<div class="ticket-status d-flex">
|
||||
<p class="color-light-green">#${ticket.id}</p>
|
||||
<div class="ui tiny label bg-dark-green-color color-light">
|
||||
${ticket.status}
|
||||
</div>
|
||||
</div>
|
||||
<p class="color-dark-green">${new Date(ticket.created_at).toLocaleDateString()}</p>
|
||||
</div>
|
||||
<div class="chat-ticket-row d-flex justify-content-between">
|
||||
<div class="ticket-status d-flex">
|
||||
<p class="color-dark-green receiver-name">${ticket.sender_name}</p>
|
||||
<p class="receiver-message"> - ${ticket.subject}</p>
|
||||
</div>
|
||||
<p class="color-dark-green bold message-time">${new Date(ticket.created_at).toLocaleTimeString()}</p>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
`);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
<x-custom-modals />
|
||||
|
||||
@endsection
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
<button type="button">Abuse</button>
|
||||
<button type="button">Canned Responses</button>
|
||||
<button type="button">Personal Data & Policy</button>
|
||||
<button type="button">Tags</button>
|
||||
<!--<button type="button">Tags</button>-->
|
||||
<button type="button">Chat Button</button>
|
||||
</div>
|
||||
|
||||
|
|
@ -74,7 +74,7 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="dev-input-group">
|
||||
<!-- <div class="dev-input-group">
|
||||
<label class="dev-checkbox-wrapper"> Allow visitors to send messages
|
||||
@php
|
||||
$allow_visitor_to_send_messages = getChatSetting('allow_visitor_to_send_messages')
|
||||
|
|
@ -87,13 +87,15 @@
|
|||
<span>When no editor is available, visitors can still send
|
||||
messages.</span>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="dev-input-group">
|
||||
<label>Email address that messages should be sent to</label>
|
||||
<label>Email address that messages should be sent to
|
||||
@php
|
||||
$message_sent_to = getChatSetting('message_sent_to')
|
||||
@endphp
|
||||
<input type="email" name"message_sent_to" placeholder="Please enter your email" value="{{$message_sent_to->value ?? ''}}">
|
||||
<input type="email" name="message_sent_to" placeholder="Please enter your email" value="{{$message_sent_to->value ?? ''}}">
|
||||
</label>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
|
@ -115,7 +117,7 @@
|
|||
|
||||
|
||||
|
||||
<div class="dev-input-group dev-input-group-input-info">
|
||||
<!-- <div class="dev-input-group dev-input-group-input-info">
|
||||
<label>Log everyone out automatically</label>
|
||||
@php
|
||||
$logout_everyone_automatically = getChatSetting('logout_everyone_automatically')
|
||||
|
|
@ -133,7 +135,7 @@
|
|||
of
|
||||
day.</span>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="dev-input-group">
|
||||
<label class="dev-checkbox-wrapper"> Log out editor who has missed a
|
||||
chat
|
||||
|
|
@ -166,7 +168,7 @@
|
|||
<span>Editors can always send images and files.</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="dev-input-group">
|
||||
<!-- <div class="dev-input-group">
|
||||
<label class="dev-checkbox-wrapper"> Guest must write Name and Email to
|
||||
chat
|
||||
@php
|
||||
|
|
@ -183,7 +185,7 @@
|
|||
anonymously. Cross this out if the chat will be started
|
||||
automatically.</span>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="dev-input-group">
|
||||
<label class="dev-checkbox-wrapper"> Save email address for anonymous
|
||||
chats
|
||||
|
|
@ -227,7 +229,7 @@
|
|||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="dev-input-group dev-input-group-input-info">
|
||||
<!-- <div class="dev-input-group dev-input-group-input-info">
|
||||
<label>The chat assistant shows suggestions from:</label>
|
||||
@php
|
||||
$chat_assistant_show_suggestion_form = getChatSetting('chat_assistant_show_suggestion_form')
|
||||
|
|
@ -247,13 +249,13 @@
|
|||
chat. The chat code must be entered in the forum or knowledge
|
||||
base.</span>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="dev-input-group dev-input-group-input-info">
|
||||
<label>Delay for automatic deletion</label>
|
||||
@php
|
||||
$delay_for_automatic_deletion = getChatSetting('delay_for_automatic_deletion')
|
||||
@endphp
|
||||
<input type="text" name="delay_for_automatic_deletion" placeholder="Type here..." value="{{$delay_for_automatic_deletion->value ?? '' }}">
|
||||
<input type="number" name="delay_for_automatic_deletion" placeholder="Type here..." value="{{$delay_for_automatic_deletion->value ?? '' }}">
|
||||
<div class="dev-input-info">
|
||||
<img src="{{ asset('images/info.svg') }}" alt="info">
|
||||
<span>The number of days a conversation should be stored in Kundo
|
||||
|
|
@ -488,13 +490,13 @@ class="form-control input-reply-textarea message_when_chat_is_closed">{!! $messa
|
|||
</div>
|
||||
<form>
|
||||
<div class="col col-left">
|
||||
<div class="dev-input-group dev-input-group-input-info">
|
||||
<label>Test in the answer box</label>
|
||||
<!--<div class="dev-input-group dev-input-group-input-info">-->
|
||||
<!-- <label>Test in the answer box</label>-->
|
||||
@php
|
||||
$test_in_answer_box = getChatSetting('test_in_answer_box')
|
||||
@endphp
|
||||
<input type="text" placeholder="What can i help you with!" name="test_in_answer_box" class="test_in_answer_box" value="{{$test_in_answer_box->value ?? ''}}">
|
||||
</div>
|
||||
<input type="hidden" placeholder="What can i help you with!" name="test_in_answer_box" class="test_in_answer_box" value="{{$test_in_answer_box->value ?? ''}}">
|
||||
<!--</div>-->
|
||||
<div class="dev-input-group dev-input-group-input-info">
|
||||
<label>Start message</label>
|
||||
@php
|
||||
|
|
@ -565,7 +567,7 @@ class="form-control input-reply-textarea message_when_chat_is_closed">{!! $messa
|
|||
</div>
|
||||
<script src="https://cdn.ckeditor.com/4.16.0/standard/ckeditor.js"></script>
|
||||
<script>
|
||||
CKEDITOR.replace('editor1');
|
||||
//CKEDITOR.replace('editor1');
|
||||
</script>
|
||||
<!-- -->
|
||||
<div class="dev-tabcontent dev-tabcontent-style">
|
||||
|
|
@ -695,22 +697,26 @@ class="form-control input-reply-textarea message_when_chat_is_closed">{!! $messa
|
|||
</div>
|
||||
<div class="dev-content-inner">
|
||||
<h2>Block IP addresses</h2>
|
||||
<form>
|
||||
<form method="POST" action="{{ route('block.ip.addresses') }}">
|
||||
@csrf
|
||||
<div class="dev-input-group dev-input-group-input-info">
|
||||
<label>IP address *</label>
|
||||
<input type="text" placeholder="Enter here">
|
||||
@php
|
||||
$ip_addresses = getChatSetting('ip_addresses');
|
||||
@endphp
|
||||
<input type="text" name="ip_addresses" placeholder="Enter here" value="{{ $ip_addresses->value ?? '' }}">
|
||||
<div class="dev-input-info">
|
||||
<img src="{{ asset('images/info.svg') }}" alt="info">
|
||||
<span>A full or partial IP address. E.g. 127.0.0.1 or 127.0.0</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="dev-input-group">
|
||||
<label class="dev-checkbox-wrapper">Delete
|
||||
<input type="checkbox">
|
||||
<span class="checkmark"></span>
|
||||
</label>
|
||||
</div>
|
||||
<button type="button" class="dev-form-submit-btn">Save</button>
|
||||
<!--<div class="dev-input-group">-->
|
||||
<!-- <label class="dev-checkbox-wrapper">Delete-->
|
||||
<!-- <input type="checkbox">-->
|
||||
<!-- <span class="checkmark"></span>-->
|
||||
<!-- </label>-->
|
||||
<!--</div>-->
|
||||
<button type="submit" class="dev-form-submit-btn">Save</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -755,9 +761,9 @@ class="form-control input-reply-textarea message_when_chat_is_closed">{!! $messa
|
|||
<h3>{{ $result->name }}</h3>
|
||||
<span>{{ $result->text }}</span>
|
||||
</div>
|
||||
<div class="dev-icon">
|
||||
<img src="{{ asset('images/settingss.svg') }}" alt="">
|
||||
</div>
|
||||
<!--<div class="dev-icon">-->
|
||||
<!-- <img src="{{ asset('images/settingss.svg') }}" alt="">-->
|
||||
<!--</div>-->
|
||||
<div class="dev-icon">
|
||||
<a style="cursor:pointer;" href="{{ route('delete.chat.canned.responses', $value->id) }}" class="delete-display-chat"><img src="{{ asset('images/binn.svg') }}" alt=""></a>
|
||||
</div>
|
||||
|
|
@ -823,55 +829,55 @@ class="form-control input-reply-textarea message_when_chat_is_closed">{!! $messa
|
|||
</div>
|
||||
</div>
|
||||
<!-- -->
|
||||
<div class="dev-tabcontent dev-tabcontent-tags">
|
||||
<div class="dev-tabcontent-outers">
|
||||
<div class="dev-title-row">
|
||||
<h2>Tags</h2>
|
||||
</div>
|
||||
<div class="dev-content-inner">
|
||||
<form method="POST" action="{{ route('store.tags') }}">
|
||||
<!--<div class="dev-tabcontent dev-tabcontent-tags">-->
|
||||
<!-- <div class="dev-tabcontent-outers">-->
|
||||
<!-- <div class="dev-title-row">-->
|
||||
<!-- <h2>Tags</h2>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div class="dev-content-inner">-->
|
||||
<!-- <form method="POST" action="{{ route('store.tags') }}">-->
|
||||
@csrf
|
||||
<div class="dev-input-group">
|
||||
<label class="dev-checkbox-wrapper">Allow new tags to be created when
|
||||
tagging
|
||||
<!-- <div class="dev-input-group">-->
|
||||
<!-- <label class="dev-checkbox-wrapper">Allow new tags to be created when-->
|
||||
<!-- tagging-->
|
||||
@php
|
||||
$new_tags_to_be_created_when_tagging = getChatSetting('new_tags_to_be_created_when_tagging')
|
||||
@endphp
|
||||
<input type="checkbox" name="new_tags_to_be_created_when_tagging" @if($new_tags_to_be_created_when_tagging) checked @endif>
|
||||
<span class="checkmark"></span>
|
||||
</label>
|
||||
</div>
|
||||
<button type="submit" class="dev-form-submit-btn">Save</button>
|
||||
</form>
|
||||
</div>
|
||||
<!-- <input type="checkbox" name="new_tags_to_be_created_when_tagging" @if($new_tags_to_be_created_when_tagging) checked @endif>-->
|
||||
<!-- <span class="checkmark"></span>-->
|
||||
<!-- </label>-->
|
||||
<!-- </div>-->
|
||||
<!-- <button type="submit" class="dev-form-submit-btn">Save</button>-->
|
||||
<!-- </form>-->
|
||||
<!-- </div>-->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!-- </div>-->
|
||||
<!--</div>-->
|
||||
<!-- -->
|
||||
<div class="dev-tabcontent dev-tabcontent-chats">
|
||||
<div class="dev-tabcontent-outers">
|
||||
<div class="dev-title-row">
|
||||
<h2>Settings for all chats</h2>
|
||||
</div>
|
||||
<div class="dev-content-inner">
|
||||
<form method="POST" action="{{ route('setting.all.chat') }}">
|
||||
<!--<div class="dev-tabcontent-outers">-->
|
||||
<!-- <div class="dev-title-row">-->
|
||||
<!-- <h2>Settings for all chats</h2>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div class="dev-content-inner">-->
|
||||
<!-- <form method="POST" action="{{ route('setting.all.chat') }}">-->
|
||||
@csrf
|
||||
<div class="dev-input-group dev-input-group-input-info">
|
||||
<label>Heading when selecting chat flow</label>
|
||||
<!-- <div class="dev-input-group dev-input-group-input-info">-->
|
||||
<!-- <label>Heading when selecting chat flow</label>-->
|
||||
@php
|
||||
$heading_for_chat_flow = getChatSetting('heading_for_chat_flow');
|
||||
@endphp
|
||||
<textarea rows="6" required name="heading_for_chat_flow">{{$heading_for_chat_flow->value ?? ''}}</textarea>
|
||||
<div class="dev-input-info">
|
||||
<img src="{{ asset('images/info.svg') }}" alt="info">
|
||||
<span>Displayed when the visitor can choose between different chat
|
||||
flows.</span>
|
||||
</div>
|
||||
</div>
|
||||
<button type="submit" class="dev-form-submit-btn">Save</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <textarea rows="6" required name="heading_for_chat_flow">{{$heading_for_chat_flow->value ?? ''}}</textarea>-->
|
||||
<!-- <div class="dev-input-info">-->
|
||||
<!-- <img src="{{ asset('images/info.svg') }}" alt="info">-->
|
||||
<!-- <span>Displayed when the visitor can choose between different chat-->
|
||||
<!-- flows.</span>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- <button type="submit" class="dev-form-submit-btn">Save</button>-->
|
||||
<!-- </form>-->
|
||||
<!-- </div>-->
|
||||
<!--</div>-->
|
||||
<div class="dev-tabcontent-outers">
|
||||
<div class="dev-title-row">
|
||||
<div>
|
||||
|
|
@ -880,8 +886,16 @@ class="form-control input-reply-textarea message_when_chat_is_closed">{!! $messa
|
|||
you.
|
||||
</p>
|
||||
</div>
|
||||
<button type="button" class="dev-form-submit-btn">DEMO <img
|
||||
src="{{ asset('images/Arrow_right_stop.svg') }}" alt=""></button>
|
||||
|
||||
<?php
|
||||
|
||||
$comp = get_company('id',getSelectedCompany());
|
||||
|
||||
?>
|
||||
|
||||
|
||||
<a href="{{route('chat.demo')}}?aw_domain={{$comp->domain}}" type="button" class="dev-form-submit-btn">DEMO <img
|
||||
src="{{ asset('images/Arrow_right_stop.svg') }}" alt=""></a>
|
||||
</div>
|
||||
<div class="dev-content-inner">
|
||||
<h2>Add the code to your website</h2>
|
||||
|
|
@ -890,16 +904,9 @@ class="form-control input-reply-textarea message_when_chat_is_closed">{!! $messa
|
|||
pages where the chat should be visible.</p>
|
||||
<form>
|
||||
<div class="dev-input-group dev-input-group-input-info">
|
||||
<textarea rows="11"> <script>
|
||||
(function (w) {
|
||||
w.$kundo_chat = w.$kundo_chat || {};
|
||||
w.$kundo_chat.custom_texts = {
|
||||
START_TEXT: 'Chat with us',
|
||||
};
|
||||
}(this));
|
||||
</script>
|
||||
<script src="https://static-chat.kundo.se/chat-js/org/1779/widget.js" async defer></script>
|
||||
</textarea>
|
||||
<textarea readonly rows="11"><link rel="stylesheet" href="https://chat.rapidev.tech/chat/chat.css">
|
||||
<div id="aw-root-chat" data-company="{{getSelectedCompany()}}"></div>
|
||||
<script src="https://chat.rapidev.tech/chat/chat.js"></script> </textarea>
|
||||
<div class="dev-input-info">
|
||||
<img src="{{ asset('images/info.svg') }}" alt="info">
|
||||
<span>Displayed when the visitor can choose between different chat
|
||||
|
|
@ -907,23 +914,23 @@ class="form-control input-reply-textarea message_when_chat_is_closed">{!! $messa
|
|||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<h2>Customized chat</h2>
|
||||
<p>It's possible to customize how the chat works on your website. The code below can
|
||||
be
|
||||
used to automatically
|
||||
fill out the users name and email when the chat is started. It can be added
|
||||
anywhere
|
||||
on the page where the chat is loaded.
|
||||
</p>
|
||||
<form>
|
||||
<div class="dev-input-group dev-input-group-input-info">
|
||||
<textarea rows="6"> window.$kundo_chat=window.$kundo_chat
|
||||
||{};window.$kundo_chat.user={
|
||||
"name": "Användare Användarsson","email":
|
||||
"anvandare@example.com",};
|
||||
</textarea>
|
||||
</div>
|
||||
</form>
|
||||
<!--<h2>Customized chat</h2>-->
|
||||
<!--<p>It's possible to customize how the chat works on your website. The code below can-->
|
||||
<!-- be-->
|
||||
<!-- used to automatically-->
|
||||
<!-- fill out the users name and email when the chat is started. It can be added-->
|
||||
<!-- anywhere-->
|
||||
<!-- on the page where the chat is loaded.-->
|
||||
<!--</p>-->
|
||||
<!--<form>-->
|
||||
<!-- <div class="dev-input-group dev-input-group-input-info">-->
|
||||
<!-- <textarea rows="6"> window.$kundo_chat=window.$kundo_chat-->
|
||||
<!-- ||{};window.$kundo_chat.user={-->
|
||||
<!-- "name": "Användare Användarsson","email":-->
|
||||
<!-- "anvandare@example.com",};-->
|
||||
<!-- </textarea>-->
|
||||
<!-- </div>-->
|
||||
<!--</form>-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -969,7 +976,7 @@ class="form-control input-reply-textarea message_when_chat_is_closed">{!! $messa
|
|||
const start_message = $('.start_message').val();
|
||||
const test_in_answer_box = $('.test_in_answer_box').val();
|
||||
// Get the value from CKEditor
|
||||
const message_when_chat_is_closed = CKEDITOR.instances.editor1.getData();
|
||||
const message_when_chat_is_closed = $('#editor1').val();// CKEDITOR.instances.editor1.getData();
|
||||
|
||||
$.ajax({
|
||||
url: '/store/text',
|
||||
|
|
|
|||
|
|
@ -0,0 +1,3 @@
|
|||
<link rel="stylesheet" href="https://chat.rapidev.tech/chat/chat.css">
|
||||
<div id="aw-root-chat" data-company="{{getSelectedCompany()}}"></div>
|
||||
<script src="https://chat.rapidev.tech/chat/chat.js"></script>
|
||||
|
|
@ -285,6 +285,10 @@ function loadChats(){
|
|||
success: function(response) {
|
||||
console.log(response);
|
||||
|
||||
socket.emit('chat_closed',
|
||||
{ customer_id:activeChat.customer_id, chat_id: activeChat.id }
|
||||
);
|
||||
|
||||
Swal.fire({
|
||||
title: 'Success',
|
||||
text: "Chat is closed.",
|
||||
|
|
@ -497,17 +501,37 @@ function loadChats(){
|
|||
}
|
||||
|
||||
|
||||
socket.on('chat_created',function(data){
|
||||
loadChats();
|
||||
console.log(data);
|
||||
playMessageSound();
|
||||
});
|
||||
|
||||
|
||||
socket.on('chat message', function(msg) {
|
||||
playMessageSound();
|
||||
|
||||
if(msg.id == activeChat.id){
|
||||
|
||||
var sms = msg;
|
||||
|
||||
var content = sms.sms;
|
||||
|
||||
if(sms.type == 'image'){
|
||||
content = '<img src="'+content+'"/>';
|
||||
}
|
||||
|
||||
if(sms.type == 'file'){
|
||||
content = '<a target="_blank" href="'+content+'"> View File </a>';
|
||||
}
|
||||
|
||||
|
||||
//<img class="align-self-end" src="{{ asset('images/Avatar.png') }}" alt="Dummy User">
|
||||
inbox.append(` <div class="item">
|
||||
<div class="single-user-content d-flex">
|
||||
<div class="chat-user-img-box receiver-message-box d-flex">
|
||||
|
||||
<p>${msg.sms}</p>
|
||||
<p>${content}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>`);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,280 @@
|
|||
<!-- Custom Modal post -->
|
||||
<div id="customModal" class="modal">
|
||||
<div class="modal-content">
|
||||
<span class="modal-close">×</span>
|
||||
<h5>Assign Post</h5>
|
||||
<form id="assignForm">
|
||||
<input type="hidden" id="ticket-ids" name="ticket_ids">
|
||||
<div class="mb-3">
|
||||
<label for="recipient-name" class="col-form-label">Recipient:</label>
|
||||
@php
|
||||
$companyId = getSelectedCompany();
|
||||
$company_users = get_company_users($companyId);
|
||||
@endphp
|
||||
<select name="user_assigned" class="form-control" required>
|
||||
<option>Select User</option>
|
||||
@foreach($company_users as $company_user)
|
||||
<option value="{{$company_user->user->id}}">{{$company_user->user->name}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="message-text" class="col-form-label">Message:</label>
|
||||
<textarea class="form-control" id="message-text" name="message" required></textarea>
|
||||
</div>
|
||||
</form>
|
||||
<button type="button" class="btn btn-primary assign-post">Send</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Custom Modal move-->
|
||||
<div id="customModal2" class="modal">
|
||||
<div class="modal-content">
|
||||
<span class="modal-close">×</span>
|
||||
<h5>Move</h5>
|
||||
<form>
|
||||
<div class="mb-3">
|
||||
<label for="recipient-name" class="col-form-label">Conversation moved:</label>
|
||||
<input type="text" class="form-control" id="recipient-name" placeholder="Inbox">
|
||||
</div>
|
||||
|
||||
</form>
|
||||
<button type="button" class="btn btn-primary">Confirm</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Custom Modal Replay to multiple-->
|
||||
<div id="customModal3" class="modal">
|
||||
<div class="modal-content">
|
||||
<span class="modal-close">×</span>
|
||||
<h5>Replay to multiple</h5>
|
||||
<form>
|
||||
<div class="mb-3 mt-4">
|
||||
<p>Please choose only email conversations and try again</p>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
var $handleMultipleButton = $('.handle-multiple-btn');
|
||||
var $selectAllCheckbox = $('#select-all');
|
||||
var $ticketCheckboxes = $('.ticket-checkbox');
|
||||
var $actionButtons = $('.handle_multiple__options .tags button');
|
||||
|
||||
// Function to toggle button states
|
||||
function updateButtonStates() {
|
||||
var selectedCount = $ticketCheckboxes.filter(':checked').length;
|
||||
$actionButtons.prop('disabled', selectedCount === 0);
|
||||
}
|
||||
|
||||
// Toggle checkboxes visibility
|
||||
$handleMultipleButton.on('click', function() {
|
||||
$('.content').toggleClass('handle-multiple-active');
|
||||
});
|
||||
|
||||
// Toggle all checkboxes based on 'Select all'
|
||||
$selectAllCheckbox.on('change', function() {
|
||||
$ticketCheckboxes.prop('checked', $selectAllCheckbox.prop('checked'));
|
||||
updateButtonStates();
|
||||
});
|
||||
|
||||
// Toggle button states when individual checkboxes change
|
||||
$ticketCheckboxes.on('change', function() {
|
||||
updateButtonStates();
|
||||
});
|
||||
|
||||
// Initialize button states
|
||||
updateButtonStates();
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<!--Assigned Post Start-->
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('.assign-post').on('click', function() {
|
||||
|
||||
var selectedTickets = [];
|
||||
$('.ticket-checkbox:checked').each(function() {
|
||||
selectedTickets.push($(this).attr('id').replace('ticket-', ''));
|
||||
});
|
||||
$('#ticket-ids').val(selectedTickets.join(','));
|
||||
|
||||
// SweetAlert2 confirmation dialog
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: 'You are about to send this message.',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Yes, send it!',
|
||||
cancelButtonText: 'Cancel'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
// Get form data
|
||||
var formData = $('#assignForm').serialize();
|
||||
|
||||
// AJAX request to submit the form
|
||||
$.ajax({
|
||||
url: 'assign/ticket',
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': "{{ csrf_token() }}"
|
||||
},
|
||||
data: formData,
|
||||
success: function(response) {
|
||||
// Show success notification
|
||||
Swal.fire(
|
||||
'Assigned!',
|
||||
'Post Assigned Successfully!',
|
||||
'success'
|
||||
);
|
||||
|
||||
location.reload();
|
||||
// Hide the modal
|
||||
$('#customModal').modal('hide');
|
||||
},
|
||||
error: function(xhr) {
|
||||
// Show error notification
|
||||
Swal.fire(
|
||||
'Error!',
|
||||
'An error occurred. Please try again.',
|
||||
'error'
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<!--Assigned Post End-->
|
||||
|
||||
<!--Delete Post Start-->
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('#delete-posts').on('click', function() {
|
||||
|
||||
var selectedTickets = [];
|
||||
$('.ticket-checkbox:checked').each(function() {
|
||||
selectedTickets.push($(this).attr('id').replace('ticket-', ''));
|
||||
});
|
||||
|
||||
var ticket_ids = selectedTickets.join(',');
|
||||
|
||||
// SweetAlert2 confirmation dialog
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: 'You are about to delete selected tickets.',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Yes, delete them!',
|
||||
cancelButtonText: 'Cancel'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
// AJAX request to delete the tickets
|
||||
$.ajax({
|
||||
url: 'delete/tickets',
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': "{{ csrf_token() }}"
|
||||
},
|
||||
data: {
|
||||
ticket_ids: ticket_ids
|
||||
},
|
||||
success: function(response) {
|
||||
// Show success notification
|
||||
Swal.fire(
|
||||
'Deleted!',
|
||||
'Tickets have been deleted successfully.',
|
||||
'success'
|
||||
);
|
||||
// Reload the page or update the UI as needed
|
||||
location.reload();
|
||||
},
|
||||
error: function(xhr) {
|
||||
// Show error notification
|
||||
Swal.fire(
|
||||
'Error!',
|
||||
'An error occurred. Please try again.',
|
||||
'error'
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<!--Delete Post End-->
|
||||
|
||||
<!--Update Status Start-->
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('.update-posts-status').on('click', function() {
|
||||
|
||||
var status = $(this).data('status');
|
||||
|
||||
var selectedTickets = [];
|
||||
$('.ticket-checkbox:checked').each(function() {
|
||||
selectedTickets.push($(this).attr('id').replace('ticket-', ''));
|
||||
});
|
||||
|
||||
var ticket_ids = selectedTickets.join(',');
|
||||
|
||||
// SweetAlert2 confirmation dialog
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: 'You are about to update the status of selected tickets.',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Yes, update it!',
|
||||
cancelButtonText: 'Cancel'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
// AJAX request to submit the form
|
||||
$.ajax({
|
||||
url: 'update/ticket/status',
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': "{{ csrf_token() }}"
|
||||
},
|
||||
data: {
|
||||
ticket_ids: ticket_ids,
|
||||
status: status
|
||||
},
|
||||
success: function(response) {
|
||||
// Show success notification
|
||||
Swal.fire(
|
||||
'Updated!',
|
||||
'Tickets status has been updated successfully.',
|
||||
'success'
|
||||
);
|
||||
// Optionally reload or update the page
|
||||
location.reload();
|
||||
},
|
||||
error: function(xhr) {
|
||||
// Show error notification
|
||||
Swal.fire(
|
||||
'Error!',
|
||||
'An error occurred. Please try again.',
|
||||
'error'
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<!--Update Status End-->
|
||||
|
|
@ -0,0 +1,88 @@
|
|||
<script>
|
||||
$(document).ready(function() {
|
||||
// Toggle filter dropdown on button click
|
||||
$('.list-filter-btn').click(function() {
|
||||
$('.filter-options').toggle();
|
||||
});
|
||||
|
||||
// Initial hide for handle_multiple__options
|
||||
$('.filter-options').hide();
|
||||
$('.handle_multiple__options').hide();
|
||||
|
||||
// Toggle visibility of handle_multiple__options on button click
|
||||
$('.handle-multiple-btn').click(function() {
|
||||
$('.handle_multiple__options').toggle();
|
||||
});
|
||||
|
||||
// Initially disable all the buttons
|
||||
$('.handle_multiple__options .tags button').prop('disabled', true);
|
||||
|
||||
// Enable/disable buttons based on the select all checkbox
|
||||
// $('#select-all').change(function() {
|
||||
// if ($(this).is(':checked')) {
|
||||
// $('.handle_multiple__options .tags button').prop('disabled', false);
|
||||
// } else {
|
||||
// $('.handle_multiple__options .tags button').prop('disabled', true);
|
||||
// }
|
||||
// });
|
||||
|
||||
// Show the modal when "Assign post" button is clicked
|
||||
$('.handle_multiple__options .tags button:contains("Assign post")').click(function(e) {
|
||||
e.preventDefault();
|
||||
$('#customModal').show();
|
||||
});
|
||||
|
||||
// Show the modal when "Move" button is clicked
|
||||
$('.handle_multiple__options .tags button:contains("Move")').click(function(e) {
|
||||
e.preventDefault();
|
||||
$('#customModal2').show();
|
||||
});
|
||||
|
||||
// Show the modal when "Reply to multiple" button is clicked
|
||||
$('.handle_multiple__options .tags button:contains("Reply to multiple")').click(function(e) {
|
||||
e.preventDefault();
|
||||
$('#customModal3').show();
|
||||
});
|
||||
|
||||
// Close the modal when the close button or outside the modal is clicked
|
||||
$('.modal-close, .modal').click(function() {
|
||||
$('.modal').hide();
|
||||
});
|
||||
|
||||
// Prevent modal content from closing the modal when clicked
|
||||
$('.modal-content').click(function(e) {
|
||||
e.stopPropagation();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<div class="content chat-card-header d-flex align-items-center justify-content-between">
|
||||
<div class="header">Chats</div>
|
||||
<div class="data-actions d-flex justify-content-end">
|
||||
|
||||
<button class="action-button bg-dark-green-color color-light handle-multiple-btn">
|
||||
<img src="{{ asset('images/icons/Add_Plus.png') }}" alt="Plus Icon">
|
||||
<span>Handle Multiple</span>
|
||||
</button>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="handle_multiple__options">
|
||||
<div class="common_shre">
|
||||
<label for="select-all"> <input type="checkbox" name="" id="select-all"> Select all</label>
|
||||
<div class="tags">
|
||||
<button>Assign post</button>
|
||||
<button id="delete-posts">Delete</button>
|
||||
<!--<button>Move</button>-->
|
||||
<button data-status="open" class="update-posts-status">Open</button>
|
||||
<button data-status="waiting" class="update-posts-status">Waiting</button>
|
||||
<button data-status="done" class="update-posts-status">Done</button>
|
||||
<!--<button>Tag</button>-->
|
||||
<!--<button>Not spam</button>-->
|
||||
<button>Reply to multiple</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1,3 +1,67 @@
|
|||
<style>
|
||||
/* The switch - the box around the slider */
|
||||
.switch {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
width: 60px;
|
||||
height: 34px;
|
||||
}
|
||||
|
||||
/* Hide default HTML checkbox */
|
||||
.switch input {
|
||||
opacity: 0;
|
||||
width: 0;
|
||||
height: 0;
|
||||
}
|
||||
|
||||
/* The slider */
|
||||
.slider {
|
||||
position: absolute;
|
||||
cursor: pointer;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background-color: #ccc;
|
||||
-webkit-transition: .4s;
|
||||
transition: .4s;
|
||||
}
|
||||
|
||||
.slider:before {
|
||||
position: absolute;
|
||||
content: "";
|
||||
height: 26px;
|
||||
width: 26px;
|
||||
left: 4px;
|
||||
bottom: 4px;
|
||||
background-color: white;
|
||||
-webkit-transition: .4s;
|
||||
transition: .4s;
|
||||
}
|
||||
|
||||
input:checked + .slider {
|
||||
background-color: #2196F3;
|
||||
}
|
||||
|
||||
input:focus + .slider {
|
||||
box-shadow: 0 0 1px #2196F3;
|
||||
}
|
||||
|
||||
input:checked + .slider:before {
|
||||
-webkit-transform: translateX(26px);
|
||||
-ms-transform: translateX(26px);
|
||||
transform: translateX(26px);
|
||||
}
|
||||
|
||||
/* Rounded sliders */
|
||||
.slider.round {
|
||||
border-radius: 34px;
|
||||
}
|
||||
|
||||
.slider.round:before {
|
||||
border-radius: 50%;
|
||||
}
|
||||
</style>
|
||||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@10"></script>
|
||||
<header>
|
||||
<div class="row">
|
||||
|
|
@ -13,6 +77,10 @@
|
|||
<input type="text" class="color-dark-green" placeholder="Search...">
|
||||
</div>
|
||||
<div class="nav-links d-flex align-items-center">
|
||||
<label class="switch">
|
||||
<input type="checkbox" id="toggleSwitch" @if(auth()->user()->is_available == 1) checked @endif>
|
||||
<span class="slider round"></span>
|
||||
</label>
|
||||
<form method="POST" action="{{route('logout')}}">
|
||||
@csrf
|
||||
<button class="nav-btn bg-dark-green-color">
|
||||
|
|
@ -100,6 +168,8 @@ class="ui secondary basic button shadow-none setting-btn text-white align-conten
|
|||
</div>
|
||||
</header>
|
||||
<script src="https://cdn.ckeditor.com/4.16.0/standard/ckeditor.js"></script>
|
||||
<!-- Toastr JS -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.js"></script>
|
||||
|
||||
<style>
|
||||
|
||||
|
|
@ -108,3 +178,64 @@ class="ui secondary basic button shadow-none setting-btn text-white align-conten
|
|||
}
|
||||
|
||||
</style>
|
||||
<script>
|
||||
document.getElementById('toggleButton').addEventListener('click', function() {
|
||||
this.classList.toggle('btn-success');
|
||||
this.classList.toggle('btn-primary');
|
||||
this.textContent = this.classList.contains('btn-success') ? 'On' : 'Off';
|
||||
});
|
||||
</script>
|
||||
|
||||
<!--chat avialability ajax-->
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('#toggleSwitch').on('change', function() {
|
||||
const isChecked = $(this).is(':checked');
|
||||
|
||||
if (isChecked) {
|
||||
// Call route when toggle is ON
|
||||
$.ajax({
|
||||
url: 'update/chat-availability',
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': "{{ csrf_token() }}"
|
||||
},
|
||||
data: {
|
||||
status: 'on'
|
||||
},
|
||||
success: function(response) {
|
||||
console.log('Success:', response);
|
||||
if(response.success) {
|
||||
toastr.success('Chat Availability Updated Successfully');
|
||||
}
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error('Error:', error);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// Call route when toggle is OFF
|
||||
$.ajax({
|
||||
url: 'update/chat-availability',
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': "{{ csrf_token() }}"
|
||||
},
|
||||
data: {
|
||||
status: 'off'
|
||||
},
|
||||
success: function(response) {
|
||||
console.log('Success:', response);
|
||||
if(response.success) {
|
||||
toastr.success('Chat Availability Updated Successfully');
|
||||
}
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error('Error:', error);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -505,9 +505,9 @@ function toggleClosed(day) {
|
|||
<h3>{{ $result->name }}</h3>
|
||||
<span>{{ $result->text }}</span>
|
||||
</div>
|
||||
<div class="dev-icon">
|
||||
<img src="{{ asset('images/settingss.svg') }}" alt="">
|
||||
</div>
|
||||
<!--<div class="dev-icon">-->
|
||||
<!-- <img src="{{ asset('images/settingss.svg') }}" alt="">-->
|
||||
<!--</div>-->
|
||||
<div class="dev-icon">
|
||||
<a style="cursor:pointer;" href="{{ route('delete.canned.response', $value->id) }}" class="delete-user"><img src="{{ asset('images/binn.svg') }}" alt=""></a>
|
||||
</div>
|
||||
|
|
@ -669,16 +669,16 @@ class="form-control input-reply-textarea">{!! $automatic_reply_text->value ?? ''
|
|||
</p>
|
||||
</div>
|
||||
<h2>Create a new rule</h2>
|
||||
<form>
|
||||
<form method="POST" action="{{ route('update.rule') }}">
|
||||
@csrf
|
||||
<div class="dev-input-group dev-input-group-input-info">
|
||||
<label>Name</label>
|
||||
<input type="text" placeholder="Type here..">
|
||||
<input name="name" type="text" placeholder="Type here.." value="{{$rule->name ?? ''}}">
|
||||
<div class="dev-input-info">
|
||||
<img src="{{ asset('images/info.svg') }}" alt="info">
|
||||
<span>Tag everything from the sales department</span>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<h3>Filter</h3>
|
||||
<p>If you complete the From, To, and Subject fields, they must all match an email for
|
||||
the rule to be activated. Leave any field empty to avoid having to match that part.
|
||||
|
|
@ -692,12 +692,11 @@ class="form-control input-reply-textarea">{!! $automatic_reply_text->value ?? ''
|
|||
If you want to activate a rule for all emails that come from a group of email
|
||||
addresses, you can write *@kundo.se in the "from" field.
|
||||
</p>
|
||||
<form>
|
||||
<div class="dev-form-inner">
|
||||
<div class="col-left">
|
||||
<div class="dev-input-group dev-input-group-input-info">
|
||||
<label>From</label>
|
||||
<input type="text" placeholder="Type here..">
|
||||
<input type="email" name="from" placeholder="Type here.." value="{{$rule->from ?? ''}}">
|
||||
<div class="dev-input-info">
|
||||
<img src="{{ asset('images/info.svg') }}" alt="info">
|
||||
<span>E.g. example@example.com or *@example.com</span>
|
||||
|
|
@ -705,7 +704,7 @@ class="form-control input-reply-textarea">{!! $automatic_reply_text->value ?? ''
|
|||
</div>
|
||||
<div class="dev-input-group dev-input-group-input-info">
|
||||
<label>To</label>
|
||||
<input type="text" placeholder="Type here..">
|
||||
<input type="email" name="to" placeholder="Type here.." value="{{$rule->to ?? ''}}">
|
||||
<div class="dev-input-info">
|
||||
<img src="{{ asset('images/info.svg') }}" alt="info">
|
||||
<span>E.g. test@example.com</span>
|
||||
|
|
@ -715,7 +714,7 @@ class="form-control input-reply-textarea">{!! $automatic_reply_text->value ?? ''
|
|||
<div class="col-right">
|
||||
<div class="dev-input-group dev-input-group-input-info">
|
||||
<label>Subject Contains</label>
|
||||
<input type="text" placeholder="Type here..">
|
||||
<input type="text" name="subject_contains" placeholder="Type here.." value="{{$rule->subject_contains ?? ''}}">
|
||||
<div class="dev-input-info">
|
||||
<img src="{{ asset('images/info.svg') }}" alt="info">
|
||||
<span>E.g. Great deals!</span>
|
||||
|
|
@ -723,7 +722,7 @@ class="form-control input-reply-textarea">{!! $automatic_reply_text->value ?? ''
|
|||
</div>
|
||||
<div class="dev-input-group dev-input-group-input-info">
|
||||
<label>Text Contains</label>
|
||||
<input type="text" placeholder="Type here..">
|
||||
<input type="text" name="text_contains" placeholder="Type here.." value="{{$rule->text_contains ?? ''}}">
|
||||
<div class="dev-input-info">
|
||||
<img src="{{ asset('images/info.svg') }}" alt="info">
|
||||
<span>E.g. Great deals!</span>
|
||||
|
|
@ -733,107 +732,101 @@ class="form-control input-reply-textarea">{!! $automatic_reply_text->value ?? ''
|
|||
</div>
|
||||
<div class="dev-input-group">
|
||||
<label class="dev-checkbox-wrapper">All e-mails automatically marked as spam
|
||||
<input type="checkbox">
|
||||
<input name="all_emails_automatically_mark_as_spam" type="checkbox" @if($rule && !is_null($rule->all_emails_automatically_mark_as_spam)) checked @endif>
|
||||
<span class="checkmark"></span>
|
||||
</label>
|
||||
</div>
|
||||
</form>
|
||||
<h3>Exceptions</h3>
|
||||
<p>Email that matches the filter above but for which the rule should not be activated.
|
||||
</p>
|
||||
<form>
|
||||
<div class="dev-form-inner">
|
||||
<div class="col-left">
|
||||
<div class="dev-input-group dev-input-group-input-info">
|
||||
<label>Subject Contains</label>
|
||||
<textarea rows="6">Type here..</textarea>
|
||||
<textarea rows="6" name="subject1_contains">{{$rule->subject1_contains ?? ''}}</textarea>
|
||||
<div class="dev-input-info">
|
||||
<img src="{{ asset('images/info.svg') }}" alt="info">
|
||||
<span>Order Confirmation</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-right">
|
||||
<div class="dev-input-group dev-input-group-input-info">
|
||||
<label>Text Contains</label>
|
||||
<textarea rows="6">Type here..</textarea>
|
||||
<div class="dev-input-info">
|
||||
<img src="{{ asset('images/info.svg') }}" alt="info">
|
||||
<span>Your Order</span>
|
||||
<!--<div class="col-right">-->
|
||||
<!-- <div class="dev-input-group dev-input-group-input-info">-->
|
||||
<!-- <label>Text Contains</label>-->
|
||||
<!-- <textarea rows="6">Type here..</textarea>-->
|
||||
<!-- <div class="dev-input-info">-->
|
||||
<!-- <img src="{{ asset('images/info.svg') }}" alt="info">-->
|
||||
<!-- <span>Your Order</span>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!--</div>-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<h3>Effect</h3>
|
||||
<p>The effect describes what should happen when the filter above matches. It happens
|
||||
automatically, before the e-mail shows up in
|
||||
the dashboard.</p>
|
||||
<form>
|
||||
<div class="dev-content-schedule">
|
||||
<label>Monday</label>
|
||||
<label>Assign To</label>
|
||||
<div class="schedule-box">
|
||||
<input type="text" placeholder="08:00">
|
||||
<img src="{{ asset('images/downn.svg') }}" alt="">
|
||||
<select name="assign_to">
|
||||
@foreach($company_users as $company_user)
|
||||
<option value="{{$company_user->user->id}}" @if($rule && !is_null($rule->assign_to) && $rule->assign_to == $company_user->user->id) selected @endif>{{$company_user->user->name}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="dev-form-inner">
|
||||
<div class="col-left">
|
||||
<div class="dev-input-group dev-input-group-input-info">
|
||||
<label>Message to assigned editor</label>
|
||||
<textarea rows="6">Hi! Feel free to contact us via chat if you are wondering about anything.
|
||||
</textarea>
|
||||
</div>
|
||||
<div class="dev-input-group">
|
||||
<label class="dev-checkbox-wrapper">Remove and hide from the statistics
|
||||
<input type="checkbox">
|
||||
<span class="checkmark"></span>
|
||||
</label>
|
||||
<textarea rows="6" name="message_to_assigned_editor">{{$rule->message_to_assigned_editor ?? ''}}</textarea>
|
||||
</div>
|
||||
<!--<div class="dev-input-group">-->
|
||||
<!-- <label class="dev-checkbox-wrapper">Remove and hide from the statistics -->
|
||||
<!-- <input type="checkbox">-->
|
||||
<!-- <span class="checkmark"></span>-->
|
||||
<!-- </label>-->
|
||||
<!--</div>-->
|
||||
</div>
|
||||
<div class="col-right">
|
||||
<div class="dev-content-schedule">
|
||||
<label>Add tags</label>
|
||||
<div class="schedule-box">
|
||||
<input type="text" placeholder="Add tags">
|
||||
<img src="{{ asset('images/downn.svg') }}" alt="">
|
||||
<select name="tag_id">
|
||||
@foreach($tags as $tag)
|
||||
<option value="{{$tag->id}}" @if($rule && !is_null($rule->tag_id) && $rule->tag_id == $tag->id) selected @endif>{{$tag->name}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="checkbox-box">
|
||||
<div class="dev-input-group">
|
||||
<label class="dev-checkbox-wrapper">Set as done
|
||||
<input type="checkbox">
|
||||
<span class="checkmark"></span>
|
||||
</label>
|
||||
<input type="radio" value="set as done" name="status" @if($rule && !is_null($rule->status) && $rule->status == 'set as done') checked @endif>
|
||||
<label class="dev-checkbox-wrapper">Set as done</label>
|
||||
</div>
|
||||
<div class="dev-input-group">
|
||||
<label class="dev-checkbox-wrapper">Set highest priority
|
||||
<input type="checkbox">
|
||||
<span class="checkmark"></span>
|
||||
</label>
|
||||
<label class="dev-checkbox-wrapper">Set highest priority</label>
|
||||
<input type="radio" value="Set highest priority" name="priority" @if($rule && !is_null($rule->priority) && $rule->priority == 'Set highest priority') checked @endif>
|
||||
</div>
|
||||
<div class="dev-input-group">
|
||||
<label class="dev-checkbox-wrapper">Mark as spam
|
||||
<input type="checkbox">
|
||||
<span class="checkmark"></span>
|
||||
</label>
|
||||
<label class="dev-checkbox-wrapper">Mark as spam</label>
|
||||
<input type="radio" value="mask as spam" name="status" @if($rule && !is_null($rule->status) && $rule->status == 'mask as spam') checked @endif>
|
||||
</div>
|
||||
<div class="dev-input-group">
|
||||
<label class="dev-checkbox-wrapper">Set lowest priority
|
||||
<input type="checkbox">
|
||||
<span class="checkmark"></span>
|
||||
</label>
|
||||
<label class="dev-checkbox-wrapper">Set lowest priority</label>
|
||||
<input type="radio" value="Set lowest priority" name="priority" @if($rule && !is_null($rule->priority) && $rule->priority == 'Set lowest priority') checked @endif>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<button type="submit" class="dev-form-submit-btn">Save</button>
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<button type="button" class="dev-form-submit-btn">Save</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
|
@ -885,9 +878,9 @@ class="form-control input-reply-textarea">{!! $automatic_reply_text->value ?? ''
|
|||
<h3>{{ $values->spam_email }}</h3>
|
||||
<span>{{ $values->marking_radio }}</span>
|
||||
</div>
|
||||
<div class="dev-icon">
|
||||
<img src="{{ asset('images/settingss.svg') }}" alt="">
|
||||
</div>
|
||||
<!--<div class="dev-icon">-->
|
||||
<!-- <img src="{{ asset('images/settingss.svg') }}" alt="">-->
|
||||
<!--</div>-->
|
||||
<div class="dev-icon">
|
||||
<a href="{{ route('delete.spam.handling', $index) }}" style="cursor:pointer;" class="delete-user"><img src="{{ asset('images/binn.svg') }}" alt=""></a>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -13,6 +13,20 @@
|
|||
|
||||
</script>
|
||||
|
||||
<!-- Toastr CSS -->
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.css" rel="stylesheet">
|
||||
<!-- Toastr JS -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.js"></script>
|
||||
<!-- SweetAlert2 CSS -->
|
||||
<link href="https://cdn.jsdelivr.net/npm/sweetalert2@11/dist/sweetalert2.min.css" rel="stylesheet">
|
||||
<!-- SweetAlert2 JS -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11/dist/sweetalert2.all.min.js"></script>
|
||||
|
||||
@php
|
||||
$companyId = getSelectedCompany();
|
||||
$company_users = get_company_users($companyId);
|
||||
@endphp
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
// Toggle filter dropdown on button click
|
||||
|
|
@ -33,13 +47,13 @@
|
|||
$('.handle_multiple__options .tags button').prop('disabled', true);
|
||||
|
||||
// Enable/disable buttons based on the select all checkbox
|
||||
$('#select-all').change(function() {
|
||||
if ($(this).is(':checked')) {
|
||||
$('.handle_multiple__options .tags button').prop('disabled', false);
|
||||
} else {
|
||||
$('.handle_multiple__options .tags button').prop('disabled', true);
|
||||
}
|
||||
});
|
||||
// $('#select-all').change(function() {
|
||||
// if ($(this).is(':checked')) {
|
||||
// $('.handle_multiple__options .tags button').prop('disabled', false);
|
||||
// } else {
|
||||
// $('.handle_multiple__options .tags button').prop('disabled', true);
|
||||
// }
|
||||
// });
|
||||
|
||||
// Show the modal when "Assign post" button is clicked
|
||||
$('.handle_multiple__options .tags button:contains("Assign post")').click(function(e) {
|
||||
|
|
@ -84,33 +98,58 @@ function updateStatusOptions(selectedFilter) {
|
|||
console.log("Updating status options for:", selectedFilter); // Debugging log
|
||||
switch (selectedFilter) {
|
||||
case 'Assigned to':
|
||||
$('#status-select').html(`
|
||||
<option disabled value="">Select assigned to</option>
|
||||
<option value="Assigned">Assigned</option>
|
||||
<option value="Unassigned">Unassigned</option>
|
||||
<option value="Margin">Margin</option>
|
||||
`);
|
||||
// $('#status-select').html(`
|
||||
// <option disabled value="">Select assigned to</option>
|
||||
// <option value="Assigned">Assigned</option>
|
||||
// <option value="Unassigned">Unassigned</option>
|
||||
// <option value="Margin">Margin</option>
|
||||
// `);
|
||||
var options = '<option value="">Select assigned to</option>';
|
||||
// Loop through the company_users array
|
||||
@foreach($company_users as $company_user)
|
||||
options += '<option value="{{ $company_user->user->id }}">{{ $company_user->user->name }}</option>';
|
||||
@endforeach
|
||||
|
||||
$('#status-select').html(options);
|
||||
$('.filter_based__data').show();
|
||||
break;
|
||||
case 'Which activity':
|
||||
case 'With activity':
|
||||
$('#status-select').html(`
|
||||
<option disabled value="">Select activity</option>
|
||||
<option value="Marked as spam">Marked as spam</option>
|
||||
<option value="Not spam">Not spam</option>
|
||||
<option value="">Select No activity</option>
|
||||
<option value="last 24 hours">Last 24 hours</option>
|
||||
<option value="last 3 days">Last 3 days</option>
|
||||
<option value="last week">Last week</option>
|
||||
<option value="last month">Last month</option>
|
||||
<option value="last 3 months">Last 3 months</option>
|
||||
<option value="last 6 months">Last 6 months</option>
|
||||
<option value="last year">Last year</option>
|
||||
<option value="the past 2 years">The past 2 years</option>
|
||||
<option value="the past 3 years">The past 3 years</option>
|
||||
<option value="the past 4 years">The past 4 years</option>
|
||||
<option value="the past 5 years">The past 5 years</option>
|
||||
`);
|
||||
$('.filter_based__data').show();
|
||||
break;
|
||||
case 'No activity':
|
||||
$('#status-select').html(`
|
||||
<option disabled value="">Select No activity</option>
|
||||
<option value="Exercise">Exercise</option>
|
||||
<option value="Not Yoga">Not Yoga</option>
|
||||
<option value="">Select No activity</option>
|
||||
<option value="last 24 hours">Last 24 hours</option>
|
||||
<option value="last 3 days">Last 3 days</option>
|
||||
<option value="last week">Last week</option>
|
||||
<option value="last month">Last month</option>
|
||||
<option value="last 3 months">Last 3 months</option>
|
||||
<option value="last 6 months">Last 6 months</option>
|
||||
<option value="last year">Last year</option>
|
||||
<option value="the past 2 years">The past 2 years</option>
|
||||
<option value="the past 3 years">The past 3 years</option>
|
||||
<option value="the past 4 years">The past 4 years</option>
|
||||
<option value="the past 5 years">The past 5 years</option>
|
||||
`);
|
||||
$('.filter_based__data').show();
|
||||
break;
|
||||
case 'Editor':
|
||||
$('#status-select').html(`
|
||||
<option disabled value="">Select Editor</option>
|
||||
<option value="">Select Editor</option>
|
||||
<option value="Computer tool">Computer tool</option>
|
||||
<option value="Direct editor">Direct editor</option>
|
||||
`);
|
||||
|
|
@ -118,34 +157,47 @@ function updateStatusOptions(selectedFilter) {
|
|||
break;
|
||||
case 'Spam':
|
||||
$('#status-select').html(`
|
||||
<option disabled>Select Spam</option>
|
||||
<option value="Marked as spam">Marked as spam</option>
|
||||
<option value="Not spam">Not spam</option>
|
||||
<option value="">Select Spam</option>
|
||||
<option value="marked as spam">Marked as spam</option>
|
||||
<option value="marked as not spam">Marked as not spam</option>
|
||||
`);
|
||||
$('.filter_based__data').show();
|
||||
break;
|
||||
case 'Status':
|
||||
$('#status-select').html(`
|
||||
<option disabled value="">Select status</option>
|
||||
<option value="Completed">Completed</option>
|
||||
<option value="Not Completed">Not Completed</option>
|
||||
<option value="">Select status</option>
|
||||
<option value="open">Open</option>
|
||||
<option value="waiting">Waiting</option>
|
||||
<option value="done">Done</option>
|
||||
`);
|
||||
$('.filter_based__data').show();
|
||||
break;
|
||||
case 'Tags':
|
||||
$('#status-select').html(`
|
||||
<option disabled value="">Select Tags</option>
|
||||
<option value="Target">Target</option>
|
||||
<option value="Mustafa">Mustafa</option>
|
||||
`);
|
||||
|
||||
var options = '<option value="">Select Tags</option>';
|
||||
@foreach($tags as $tag)
|
||||
options += '<option value="{{$tag->name}}">{{$tag->name}}</option>';
|
||||
@endforeach
|
||||
|
||||
$('#status-select').html(options);
|
||||
|
||||
$('.filter_based__data').show();
|
||||
break;
|
||||
case 'Users':
|
||||
$('#status-select').html(`
|
||||
<option disabled value="">Select Users</option>
|
||||
<option value="Merrs">Merrs</option>
|
||||
<option value="Abdullah">Abdullah</option>
|
||||
`);
|
||||
|
||||
var options = '<option value="">Select Users</option>';
|
||||
// Loop through the company_users array
|
||||
@foreach($company_users as $company_user)
|
||||
options += '<option value="{{ $company_user->user->id }}">{{ $company_user->user->name }}</option>';
|
||||
@endforeach
|
||||
// $('#status-select').html(`
|
||||
// <option disabled value="">Select Users</option>`
|
||||
// @foreah($company_users as $company_user)
|
||||
// `<option value="`{{$company_user->user->id}}`">`{{$company_user->user->name}}`</option>
|
||||
// <option value="Abdullah">Abdullah</option>
|
||||
// `);
|
||||
// Update the select element with the generated options
|
||||
$('#status-select').html(options);
|
||||
$('.filter_based__data').show();
|
||||
break;
|
||||
default:
|
||||
|
|
@ -159,6 +211,58 @@ function updateStatusOptions(selectedFilter) {
|
|||
});
|
||||
|
||||
</script>
|
||||
<!--chat avialability ajax-->
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('#toggleSwitch').on('change', function() {
|
||||
const isChecked = $(this).is(':checked');
|
||||
|
||||
if (isChecked) {
|
||||
// Call route when toggle is ON
|
||||
$.ajax({
|
||||
url: 'update/chat-availability',
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': "{{ csrf_token() }}"
|
||||
},
|
||||
data: {
|
||||
status: 'on'
|
||||
},
|
||||
success: function(response) {
|
||||
console.log('Success:', response);
|
||||
if(response.success) {
|
||||
toastr.success('Chat Availability Updated Successfully');
|
||||
}
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error('Error:', error);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// Call route when toggle is OFF
|
||||
$.ajax({
|
||||
url: 'update/chat-availability',
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': "{{ csrf_token() }}"
|
||||
},
|
||||
data: {
|
||||
status: 'off'
|
||||
},
|
||||
success: function(response) {
|
||||
console.log('Success:', response);
|
||||
if(response.success) {
|
||||
toastr.success('Chat Availability Updated Successfully');
|
||||
}
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error('Error:', error);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
<style>
|
||||
|
|
@ -279,6 +383,15 @@ function updateStatusOptions(selectedFilter) {
|
|||
border-radius: 5px;
|
||||
border: 1px solid #ccc;
|
||||
}
|
||||
/* Hide checkboxes initially */
|
||||
.checkbox-wrapper {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* Show checkboxes when 'Handle Multiple' is active */
|
||||
.handle-multiple-active .checkbox-wrapper {
|
||||
display: block;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
@ -289,13 +402,13 @@ function updateStatusOptions(selectedFilter) {
|
|||
<div class="content chat-card-header d-flex align-items-center justify-content-between">
|
||||
<div class="header">Chats</div>
|
||||
<div class="data-actions d-flex justify-content-end">
|
||||
<div class="date-filter d-flex align-items-center">
|
||||
<img src="{{ asset('images/icons/calendar.png') }}" alt="Calendar">
|
||||
<!--<div class="date-filter d-flex align-items-center">-->
|
||||
<!-- <img src="{{ asset('images/icons/calendar.png') }}" alt="Calendar">-->
|
||||
|
||||
<select class="date-filter-selectbox" name="">
|
||||
<option value="">Last 7 Days</option>
|
||||
</select>
|
||||
</div>
|
||||
<!-- <select class="date-filter-selectbox" name="">-->
|
||||
<!-- <option value="">Last 7 Days</option>-->
|
||||
<!-- </select>-->
|
||||
<!--</div>-->
|
||||
<button class="action-button d-flex align-items-center list-filter-btn">
|
||||
<img src="{{ asset('images/icons/list-filter.png') }}" alt="">
|
||||
</button>
|
||||
|
|
@ -312,15 +425,15 @@ function updateStatusOptions(selectedFilter) {
|
|||
<div class="filter">
|
||||
<span> <b>Filter on:</b> </span>
|
||||
<select id="filter-select" name="">
|
||||
<option disabled >Select filter</option>
|
||||
<option value="select_filter_default">Select filter</option>
|
||||
<option value="Assigned to">Assigned to</option>
|
||||
<option value="Which activity">Which activity</option>
|
||||
<option value="With activity">With activity</option>
|
||||
<option value="No activity">No activity</option>
|
||||
<option value="Editor">Editor</option>
|
||||
<!--<option value="Editor">Editor</option>-->
|
||||
<option value="Spam">Spam</option>
|
||||
<option value="Status">Status</option>
|
||||
<option value="Tags">Tags</option>
|
||||
<option value="Users">Users</option>
|
||||
<!--<option value="Users">Users</option>-->
|
||||
</select>
|
||||
<div class="filter_based__data">
|
||||
<select id="status-select" name="">
|
||||
|
|
@ -335,13 +448,13 @@ function updateStatusOptions(selectedFilter) {
|
|||
<label for="select-all"> <input type="checkbox" name="" id="select-all"> Select all</label>
|
||||
<div class="tags">
|
||||
<button>Assign post</button>
|
||||
<button>Delete</button>
|
||||
<button>Move</button>
|
||||
<button>Open</button>
|
||||
<button>Waiting</button>
|
||||
<button>Done</button>
|
||||
<button>Tag</button>
|
||||
<button>Not spam</button>
|
||||
<button id="delete-posts">Delete</button>
|
||||
<!--<button>Move</button>-->
|
||||
<button data-status="open" class="update-posts-status">Open</button>
|
||||
<button data-status="waiting" class="update-posts-status">Waiting</button>
|
||||
<button data-status="done" class="update-posts-status">Done</button>
|
||||
<!--<button>Tag</button>-->
|
||||
<!--<button>Not spam</button>-->
|
||||
<button>Reply to multiple</button>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -351,6 +464,9 @@ function updateStatusOptions(selectedFilter) {
|
|||
@foreach($tickets as $ticket)
|
||||
<li>
|
||||
<a href="{{ route('show.ticket', $ticket->id) }}" class="chat-detail-item d-flex align-items-center">
|
||||
<div class="checkbox-wrapper">
|
||||
<input type="checkbox" class="ticket-checkbox" id="ticket-{{$ticket->id}}">
|
||||
</div>
|
||||
<div class="chat-user-img">
|
||||
<img src="{{ asset('images/Avatar.png') }}" alt="User">
|
||||
</div>
|
||||
|
|
@ -381,51 +497,137 @@ function updateStatusOptions(selectedFilter) {
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Custom Modal post -->
|
||||
<div id="customModal" class="modal">
|
||||
<div class="modal-content">
|
||||
<span class="modal-close">×</span>
|
||||
<h5>Assign Post</h5>
|
||||
<form>
|
||||
<div class="mb-3">
|
||||
<label for="recipient-name" class="col-form-label">Recipient:</label>
|
||||
<input type="text" class="form-control" id="recipient-name">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="message-text" class="col-form-label">Message:</label>
|
||||
<textarea class="form-control" id="message-text"></textarea>
|
||||
</div>
|
||||
</form>
|
||||
<button type="button" class="btn btn-primary">Send</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Custom Modal move-->
|
||||
<div id="customModal2" class="modal">
|
||||
<div class="modal-content">
|
||||
<span class="modal-close">×</span>
|
||||
<h5>Move</h5>
|
||||
<form>
|
||||
<div class="mb-3">
|
||||
<label for="recipient-name" class="col-form-label">Conversation moved:</label>
|
||||
<input type="text" class="form-control" id="recipient-name" placeholder="Inbox">
|
||||
</div>
|
||||
<!--Filter Status Code-->
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
const filterSelect = $('#filter-select');
|
||||
const statusSelect = $('#status-select');
|
||||
const statusOptions = $('#status-options');
|
||||
const chatDetails = $('.chat-details');
|
||||
|
||||
</form>
|
||||
<button type="button" class="btn btn-primary">Confirm</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Custom Modal Replay to multiple-->
|
||||
<div id="customModal3" class="modal">
|
||||
<div class="modal-content">
|
||||
<span class="modal-close">×</span>
|
||||
<h5>Replay to multiple</h5>
|
||||
<form>
|
||||
<div class="mb-3 mt-4">
|
||||
<p>Please choose only email conversations and try again</p>
|
||||
</div>
|
||||
// Handle status change
|
||||
$('#status-select').change(function() {
|
||||
fetchTickets();
|
||||
});
|
||||
|
||||
</form>
|
||||
// Fetch tickets based on filter
|
||||
function fetchTickets() {
|
||||
const filter = filterSelect.val();
|
||||
const status = $('#status-select').val();
|
||||
|
||||
$.ajax({
|
||||
url: '/filter',
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': "{{ csrf_token() }}"
|
||||
},
|
||||
data: {
|
||||
filter: filter,
|
||||
status: status,
|
||||
type: 'inbox',
|
||||
},
|
||||
success: function(data) {
|
||||
chatDetails.empty();
|
||||
$.each(data.tickets, function(index, ticket) {
|
||||
chatDetails.append(`
|
||||
<li>
|
||||
<a href="{{ route('show.ticket', $ticket->id) }}" class="chat-detail-item d-flex align-items-center">
|
||||
<div class="checkbox-wrapper">
|
||||
<input type="checkbox" class="ticket-checkbox" id="ticket-${ticket.id}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="chat-user-img">
|
||||
<img src="/images/Avatar.png" alt="User">
|
||||
</div>
|
||||
<div class="chat-message-info d-flex align-self-baseline">
|
||||
<div class="chat-ticket-row d-flex justify-content-between">
|
||||
<div class="ticket-status d-flex">
|
||||
<p class="color-light-green">#${ticket.id}</p>
|
||||
<div class="ui tiny label bg-dark-green-color color-light">
|
||||
${ticket.status}
|
||||
</div>
|
||||
</div>
|
||||
<p class="color-dark-green">${new Date(ticket.created_at).toLocaleDateString()}</p>
|
||||
</div>
|
||||
<div class="chat-ticket-row d-flex justify-content-between">
|
||||
<div class="ticket-status d-flex">
|
||||
<p class="color-dark-green receiver-name">${ticket.sender_name}</p>
|
||||
<p class="receiver-message"> - ${ticket.subject}</p>
|
||||
</div>
|
||||
<p class="color-dark-green bold message-time">${new Date(ticket.created_at).toLocaleTimeString()}</p>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
`);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
const chatDetails = $('.chat-details');
|
||||
const filterSelect = $('#filter-select');
|
||||
filterSelect.change(function() {
|
||||
const selectedFilter = $(this).val();
|
||||
|
||||
if (selectedFilter === 'select_filter_default') {
|
||||
$.ajax({
|
||||
url: 'default/all-tickets',
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': "{{ csrf_token() }}"
|
||||
},
|
||||
data: {
|
||||
type: 'inbox'
|
||||
},
|
||||
success: function(data) {
|
||||
chatDetails.empty();
|
||||
$.each(data.tickets, function(index, ticket) {
|
||||
chatDetails.append(`
|
||||
<li>
|
||||
<a href="{{ route('show.ticket', $ticket->id) }}" class="chat-detail-item d-flex align-items-center">
|
||||
<div class="checkbox-wrapper">
|
||||
<input type="checkbox" class="ticket-checkbox" id="ticket-${ticket.id}">
|
||||
</div>
|
||||
<div class="chat-user-img">
|
||||
<img src="/images/Avatar.png" alt="User">
|
||||
</div>
|
||||
<div class="chat-message-info d-flex align-self-baseline">
|
||||
<div class="chat-ticket-row d-flex justify-content-between">
|
||||
<div class="ticket-status d-flex">
|
||||
<p class="color-light-green">#${ticket.id}</p>
|
||||
<div class="ui tiny label bg-dark-green-color color-light">
|
||||
${ticket.status}
|
||||
</div>
|
||||
</div>
|
||||
<p class="color-dark-green">${new Date(ticket.created_at).toLocaleDateString()}</p>
|
||||
</div>
|
||||
<div class="chat-ticket-row d-flex justify-content-between">
|
||||
<div class="ticket-status d-flex">
|
||||
<p class="color-dark-green receiver-name">${ticket.sender_name}</p>
|
||||
<p class="receiver-message"> - ${ticket.subject}</p>
|
||||
</div>
|
||||
<p class="color-dark-green bold message-time">${new Date(ticket.created_at).toLocaleTimeString()}</p>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
`);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
<x-custom-modals />
|
||||
|
||||
|
||||
|
||||
@endsection
|
||||
|
|
@ -30,5 +30,29 @@
|
|||
crossorigin="anonymous"></script>
|
||||
</body>
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
function updateLastOnline() {
|
||||
$.ajax({
|
||||
url: '/update-last-online',
|
||||
method: 'GET',
|
||||
success: function(response) {
|
||||
if (response.success) {
|
||||
console.log('Last online updated successfully.');
|
||||
}
|
||||
},
|
||||
error: function(xhr) {
|
||||
console.error('An error occurred:', xhr.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Update last online every minute (60000 milliseconds)
|
||||
setInterval(updateLastOnline, 60000);
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
</html>
|
||||
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@
|
|||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<!-- CSRF Token Meta Tag -->
|
||||
<meta name="csrf-token" content="{{ csrf_token() }}">
|
||||
<title>Inbox</title>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/jquery@3.7.1/dist/jquery.min.js"></script>
|
||||
|
|
@ -109,4 +111,27 @@
|
|||
</style>
|
||||
</body>
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
function updateLastOnline() {
|
||||
$.ajax({
|
||||
url: '/update-last-online',
|
||||
method: 'GET',
|
||||
success: function(response) {
|
||||
if (response.success) {
|
||||
console.log('Last online updated successfully.');
|
||||
}
|
||||
},
|
||||
error: function(xhr) {
|
||||
console.error('An error occurred:', xhr.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Update last online every minute (60000 milliseconds)
|
||||
setInterval(updateLastOnline, 60000);
|
||||
});
|
||||
</script>
|
||||
|
||||
</html>
|
||||
|
|
@ -129,6 +129,27 @@ class="side-bar-link bg-light-color d-flex align-items-center justify-content-be
|
|||
@endif
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
function updateLastOnline() {
|
||||
$.ajax({
|
||||
url: '/update-last-online',
|
||||
method: 'GET',
|
||||
success: function(response) {
|
||||
if (response.success) {
|
||||
console.log('Last online updated successfully.');
|
||||
}
|
||||
},
|
||||
error: function(xhr) {
|
||||
console.error('An error occurred:', xhr.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Update last online every minute (60000 milliseconds)
|
||||
setInterval(updateLastOnline, 60000);
|
||||
});
|
||||
</script>
|
||||
<!-- Main Custom Js -->
|
||||
<script src="{{ asset('assets/script.js') }}"></script>
|
||||
</body>
|
||||
|
|
|
|||
|
|
@ -132,11 +132,14 @@
|
|||
|
||||
$tags = [];
|
||||
$db_tags = getTicketMeta($ticket->id,'tags');
|
||||
|
||||
if($db_tags){
|
||||
|
||||
foreach($db_tags as $tag){
|
||||
$tags[] = $tag->value;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
?>
|
||||
|
||||
<input type="text" name="tags" id="tags" value="{{implode(',',$tags)}}" placeholder="Type and press Enter"
|
||||
|
|
@ -223,10 +226,10 @@ class="form-control input-reply-textarea input-comment-textarea" id="add-comment
|
|||
<p class="response-comment-user-name">{{ $comment->user->name }}</p>
|
||||
</div>
|
||||
<div class="right-area d-flex">
|
||||
<button
|
||||
class="ui button comment--btn bg-dark-green-color color-light comment-edit-btn ">
|
||||
<i class="edit outline icon"></i>
|
||||
</button>
|
||||
<!--<button-->
|
||||
<!-- class="ui button comment--btn bg-dark-green-color color-light comment-edit-btn ">-->
|
||||
<!-- <i class="edit outline icon"></i>-->
|
||||
<!--</button>-->
|
||||
<button
|
||||
class="ui button comment--btn bg-light-green-color color-light comment-delete-btn" data-comment-id="{{ $comment->id }}">
|
||||
<i class="trash alternate outline icon"></i>
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
<img src="{{ asset('images/Avatar.png') }}" alt="User">
|
||||
</div>
|
||||
<div class="single-message-chat">
|
||||
<p class="user-message">{!!$message->message!!}</p>
|
||||
<div class="user-message">{!!$message->message!!}</div>
|
||||
<p class="message-time">{{ \Carbon\Carbon::parse($message->created_at)->format('h:i A') }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -12,6 +12,10 @@
|
|||
.receiver-message{
|
||||
word-break: break-all;
|
||||
}
|
||||
.single-message-chat img{
|
||||
width: 100% !important;
|
||||
height: auto !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<input type="hidden" value="{{$single_ticket->id}}" id="aw-ticket_id"/>
|
||||
|
|
@ -75,7 +79,7 @@
|
|||
<!-- </div>-->
|
||||
<!--</div>-->
|
||||
|
||||
@if($single_ticket->status != 'done')
|
||||
@if($single_ticket->type != 'chat')
|
||||
|
||||
<div class="content d-flex align-items-end flex-column message-writing-content-area">
|
||||
<textarea rows="7" placeholder="Your Message"
|
||||
|
|
|
|||
|
|
@ -13,153 +13,14 @@
|
|||
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
// Toggle filter dropdown on button click
|
||||
$('.list-filter-btn').click(function() {
|
||||
$('.filter-options').toggle();
|
||||
});
|
||||
|
||||
// Initial hide for handle_multiple__options
|
||||
$('.filter-options').hide();
|
||||
$('.handle_multiple__options').hide();
|
||||
|
||||
// Toggle visibility of handle_multiple__options on button click
|
||||
$('.handle-multiple-btn').click(function() {
|
||||
$('.handle_multiple__options').toggle();
|
||||
});
|
||||
|
||||
// Initially disable all the buttons
|
||||
$('.handle_multiple__options .tags button').prop('disabled', true);
|
||||
|
||||
// Enable/disable buttons based on the select all checkbox
|
||||
$('#select-all').change(function() {
|
||||
if ($(this).is(':checked')) {
|
||||
$('.handle_multiple__options .tags button').prop('disabled', false);
|
||||
} else {
|
||||
$('.handle_multiple__options .tags button').prop('disabled', true);
|
||||
}
|
||||
});
|
||||
|
||||
// Show the modal when "Assign post" button is clicked
|
||||
$('.handle_multiple__options .tags button:contains("Assign post")').click(function(e) {
|
||||
e.preventDefault();
|
||||
$('#customModal').show();
|
||||
});
|
||||
|
||||
// Show the modal when "Move" button is clicked
|
||||
$('.handle_multiple__options .tags button:contains("Move")').click(function(e) {
|
||||
e.preventDefault();
|
||||
$('#customModal2').show();
|
||||
});
|
||||
|
||||
// Show the modal when "Reply to multiple" button is clicked
|
||||
$('.handle_multiple__options .tags button:contains("Reply to multiple")').click(function(e) {
|
||||
e.preventDefault();
|
||||
$('#customModal3').show();
|
||||
});
|
||||
|
||||
// Close the modal when the close button or outside the modal is clicked
|
||||
$('.modal-close, .modal').click(function() {
|
||||
$('.modal').hide();
|
||||
});
|
||||
|
||||
// Prevent modal content from closing the modal when clicked
|
||||
$('.modal-content').click(function(e) {
|
||||
e.stopPropagation();
|
||||
});
|
||||
|
||||
// Update Select status options based on Select filter selection
|
||||
$('#filter-select').change(function() {
|
||||
var selectedFilter = $(this).val();
|
||||
console.log("Selected filter:", selectedFilter); // Debugging log
|
||||
updateStatusOptions(selectedFilter);
|
||||
});
|
||||
|
||||
// Initially hide filter based data section
|
||||
$('.filter_based__data').hide();
|
||||
|
||||
// Function to update status options based on selectedFilter
|
||||
function updateStatusOptions(selectedFilter) {
|
||||
console.log("Updating status options for:", selectedFilter); // Debugging log
|
||||
switch (selectedFilter) {
|
||||
case 'Assigned to':
|
||||
$('#status-select').html(`
|
||||
<option disabled value="">Select assigned to</option>
|
||||
<option value="Assigned">Assigned</option>
|
||||
<option value="Unassigned">Unassigned</option>
|
||||
<option value="Margin">Margin</option>
|
||||
`);
|
||||
$('.filter_based__data').show();
|
||||
break;
|
||||
case 'Which activity':
|
||||
$('#status-select').html(`
|
||||
<option disabled value="">Select activity</option>
|
||||
<option value="Marked as spam">Marked as spam</option>
|
||||
<option value="Not spam">Not spam</option>
|
||||
`);
|
||||
$('.filter_based__data').show();
|
||||
break;
|
||||
case 'No activity':
|
||||
$('#status-select').html(`
|
||||
<option disabled value="">Select No activity</option>
|
||||
<option value="Exercise">Exercise</option>
|
||||
<option value="Not Yoga">Not Yoga</option>
|
||||
`);
|
||||
$('.filter_based__data').show();
|
||||
break;
|
||||
case 'Editor':
|
||||
$('#status-select').html(`
|
||||
<option disabled value="">Select Editor</option>
|
||||
<option value="Computer tool">Computer tool</option>
|
||||
<option value="Direct editor">Direct editor</option>
|
||||
`);
|
||||
$('.filter_based__data').show();
|
||||
break;
|
||||
case 'Spam':
|
||||
$('#status-select').html(`
|
||||
<option disabled>Select Spam</option>
|
||||
<option value="Marked as spam">Marked as spam</option>
|
||||
<option value="Not spam">Not spam</option>
|
||||
`);
|
||||
$('.filter_based__data').show();
|
||||
break;
|
||||
case 'Status':
|
||||
$('#status-select').html(`
|
||||
<option disabled value="">Select status</option>
|
||||
<option value="Completed">Completed</option>
|
||||
<option value="Not Completed">Not Completed</option>
|
||||
`);
|
||||
$('.filter_based__data').show();
|
||||
break;
|
||||
case 'Tags':
|
||||
$('#status-select').html(`
|
||||
<option disabled value="">Select Tags</option>
|
||||
<option value="Target">Target</option>
|
||||
<option value="Mustafa">Mustafa</option>
|
||||
`);
|
||||
$('.filter_based__data').show();
|
||||
break;
|
||||
case 'Users':
|
||||
$('#status-select').html(`
|
||||
<option disabled value="">Select Users</option>
|
||||
<option value="Merrs">Merrs</option>
|
||||
<option value="Abdullah">Abdullah</option>
|
||||
`);
|
||||
$('.filter_based__data').show();
|
||||
break;
|
||||
default:
|
||||
$('#status-select').html(`
|
||||
<option disabled value="">Select status</option>
|
||||
`);
|
||||
$('.filter_based__data').show();
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
||||
<!-- Toastr CSS -->
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.css" rel="stylesheet">
|
||||
<!-- Toastr JS -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.js"></script>
|
||||
<!-- SweetAlert2 CSS -->
|
||||
<link href="https://cdn.jsdelivr.net/npm/sweetalert2@11/dist/sweetalert2.min.css" rel="stylesheet">
|
||||
<!-- SweetAlert2 JS -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11/dist/sweetalert2.all.min.js"></script>
|
||||
|
||||
|
||||
|
||||
|
|
@ -281,6 +142,15 @@ function updateStatusOptions(selectedFilter) {
|
|||
border-radius: 5px;
|
||||
border: 1px solid #ccc;
|
||||
}
|
||||
/* Hide checkboxes initially */
|
||||
.checkbox-wrapper {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* Show checkboxes when 'Handle Multiple' is active */
|
||||
.handle-multiple-active .checkbox-wrapper {
|
||||
display: block;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
@ -288,65 +158,18 @@ function updateStatusOptions(selectedFilter) {
|
|||
|
||||
<div class="content-wrapper">
|
||||
<div class="ui card chat-card waiting-chat-card">
|
||||
<div class="content chat-card-header d-flex align-items-center justify-content-between">
|
||||
<div class="header">Waiting</div>
|
||||
<div class="data-actions d-flex justify-content-end">
|
||||
<button class="action-button d-flex align-items-center list-filter-btn">
|
||||
<img src="{{ asset('images/icons/list-filter.png') }}" alt="">
|
||||
</button>
|
||||
<!--handle multiple-->
|
||||
<x-handle-filter />
|
||||
|
||||
<button class="action-button bg-dark-green-color color-light handle-multiple-btn">
|
||||
<img src="{{ asset('images/icons/Add_Plus.png') }}" alt="Plus Icon">
|
||||
<span>Handle Multiple</span>
|
||||
</button>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="filter-options">
|
||||
<div class="filter">
|
||||
<span> <b>Filter on:</b> </span>
|
||||
<select id="filter-select" name="">
|
||||
<option disabled >Select filter</option>
|
||||
<option value="Assigned to">Assigned to</option>
|
||||
<option value="Which activity">Which activity</option>
|
||||
<option value="No activity">No activity</option>
|
||||
<option value="Editor">Editor</option>
|
||||
<option value="Spam">Spam</option>
|
||||
<option value="Status">Status</option>
|
||||
<option value="Tags">Tags</option>
|
||||
<option value="Users">Users</option>
|
||||
</select>
|
||||
<div class="filter_based__data">
|
||||
<select id="status-select" name="">
|
||||
<option disabled>Select status</option>
|
||||
<!-- Options will be dynamically updated based on selected filter -->
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="handle_multiple__options">
|
||||
<div class="common_shre">
|
||||
<label for="select-all"> <input type="checkbox" name="" id="select-all"> Select all</label>
|
||||
<div class="tags">
|
||||
<button>Assign post</button>
|
||||
<button>Delete</button>
|
||||
<button>Move</button>
|
||||
<button>Open</button>
|
||||
<button>Waiting</button>
|
||||
<button>Done</button>
|
||||
<button>Tag</button>
|
||||
<button>Not spam</button>
|
||||
<button>Reply to multiple</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@if(count($tickets) > 0)
|
||||
<div class="content chat-content">
|
||||
<ul class="chat-details">
|
||||
@foreach($tickets as $ticket)
|
||||
<li>
|
||||
<a href="{{ route('show.ticket', $ticket->id) }}" class="chat-detail-item d-flex align-items-center">
|
||||
<div class="checkbox-wrapper">
|
||||
<input type="checkbox" class="ticket-checkbox" id="ticket-{{$ticket->id}}">
|
||||
</div>
|
||||
<div class="chat-user-img">
|
||||
<img src="{{ asset('images/Avatar.png') }}" alt="User">
|
||||
</div>
|
||||
|
|
@ -382,51 +205,5 @@ function updateStatusOptions(selectedFilter) {
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Custom Modal post -->
|
||||
<div id="customModal" class="modal">
|
||||
<div class="modal-content">
|
||||
<span class="modal-close">×</span>
|
||||
<h5>Assign Post</h5>
|
||||
<form>
|
||||
<div class="mb-3">
|
||||
<label for="recipient-name" class="col-form-label">Recipient:</label>
|
||||
<input type="text" class="form-control" id="recipient-name">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="message-text" class="col-form-label">Message:</label>
|
||||
<textarea class="form-control" id="message-text"></textarea>
|
||||
</div>
|
||||
</form>
|
||||
<button type="button" class="btn btn-primary">Send</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Custom Modal move-->
|
||||
<div id="customModal2" class="modal">
|
||||
<div class="modal-content">
|
||||
<span class="modal-close">×</span>
|
||||
<h5>Move</h5>
|
||||
<form>
|
||||
<div class="mb-3">
|
||||
<label for="recipient-name" class="col-form-label">Conversation moved:</label>
|
||||
<input type="text" class="form-control" id="recipient-name" placeholder="Inbox">
|
||||
</div>
|
||||
|
||||
</form>
|
||||
<button type="button" class="btn btn-primary">Confirm</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Custom Modal Replay to multiple-->
|
||||
<div id="customModal3" class="modal">
|
||||
<div class="modal-content">
|
||||
<span class="modal-close">×</span>
|
||||
<h5>Replay to multiple</h5>
|
||||
<form>
|
||||
<div class="mb-3 mt-4">
|
||||
<p>Please choose only email conversations and try again</p>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<x-custom-modals />
|
||||
@endsection
|
||||
|
|
@ -38,6 +38,9 @@
|
|||
|
||||
// In routes/web.php
|
||||
Route::get('/chatgroups', [ChatController::class, 'getChatGroupsByCompany'])->name('chatgroups.get');
|
||||
|
||||
Route::get('/chat-demo', [ChatController::class, 'chatDemo'])->name('chat.demo');
|
||||
|
||||
Route::post('/close-chat', [ChatController::class, 'CloseChat'])->name('CloseChat');
|
||||
|
||||
|
||||
|
|
@ -47,6 +50,11 @@
|
|||
|
||||
Route::post('/verify-domain', [MailgunController::class, 'verifyDomain'])->name('verifyDomain');
|
||||
|
||||
//Filter Route
|
||||
Route::post('filter', [TicketController::class, 'filter']);
|
||||
Route::post('default/all-tickets', [TicketController::class, 'defaultAllTickets']);
|
||||
Route::get('update-last-online', [UserController::class, 'updateLastOnline']);
|
||||
|
||||
Route::get('/dashboard', [DashboardController::class, 'dashboard'])->name('index')->middleware('verifyDomain');;
|
||||
Route::get('/profile', [DashboardController::class, 'profile'])->name('profile');
|
||||
Route::get('company-info', [CompanyController::class, 'getCompanyInfo'])->name('get.company.info');
|
||||
|
|
@ -63,6 +71,11 @@
|
|||
Route::post('store-comment', [InboxController::class, 'storeComment']);
|
||||
Route::get('delete-comment/{commentId}', [InboxController::class, 'deleteComment']);
|
||||
Route::post('store/response', [InboxController::class, 'storeResponse'])->name('store.response');
|
||||
Route::post('update/chat-availability', [UserController::class, 'updateChatAvailability']);
|
||||
Route::post('assign/ticket', [TicketController::class, 'AssignTicket']);
|
||||
Route::post('delete/tickets', [TicketController::class, 'deleteTickets']);
|
||||
Route::post('update/ticket/status', [TicketController::class, 'updateTicketStatus']);
|
||||
Route::post('update/rule', [InboxController::class, 'updateRule'])->name('update.rule');
|
||||
//Basic Setting Route
|
||||
Route::post('inbox/basic-setting', [InboxController::class, 'basicSetting'])->name('inbox.basic.setting');
|
||||
//User Routes
|
||||
|
|
@ -93,6 +106,7 @@
|
|||
Route::post('store/personal-data', [ChatSettingController::class, 'storePersonalData'])->name('store.personal.data');
|
||||
Route::post('store/tags', [ChatSettingController::class, 'storeTags'])->name('store.tags');
|
||||
Route::post('setting/all-chat', [ChatSettingController::class, 'settingAllChat'])->name('setting.all.chat');
|
||||
Route::post('block/ip-addresses', [ChatSettingController::class, 'blockIpAdresses'])->name('block.ip.addresses');
|
||||
|
||||
Route::get('/home', [App\Http\Controllers\HomeController::class, 'index'])->name('home');
|
||||
Route::post('logout', [LoginController::class, 'logout'])->name('logout');
|
||||
|
|
|
|||
Loading…
Reference in New Issue