Merge branch 'development' into change_status

This commit is contained in:
K Naveenraj
2023-10-26 14:16:13 +05:30
committed by GitHub
88 changed files with 3442 additions and 426 deletions

View File

@@ -0,0 +1,7 @@
<?php
return[
'logs' => 'مؤلف',
'system_logs' => 'سجلات النظام',
];

View File

@@ -2,4 +2,5 @@
return [
'logs' => 'Logs',
'system_logs' => 'System logs',
];

View File

@@ -41,10 +41,10 @@ class="nav-link active"
<div class="container-fluid">
<div class="card card-light">
<div class="card-header">
<h3 class="card-title">System Logs</h3>
<h3 class="card-title">{{Lang::get('log::lang.system_logs')}}</h3>
<div class="card-tools">
<a href="?dl={{ base64_encode($current_file) }}" class="btn btn-primary btn-sm text-white"><span class="fas fa-download"></span> Download file</a>
<a id="delete-log" href="?del={{ base64_encode($current_file) }}" class="btn btn-danger btn-sm text-white"><span class="fas fa-trash"></span> Delete file</a>
<a href="?dl={{ base64_encode($current_file) }}" class="btn btn-primary btn-sm text-white"><span class="fas fa-download"></span>{{trans('lang.download_file')}}</a>
<a id="delete-log" href="?del={{ base64_encode($current_file) }}" class="btn btn-danger btn-sm text-white"><span class="fas fa-trash"></span>{{trans('lang.delete_file')}}</a>
</div>
</div>
<div class="card-body">
@@ -61,7 +61,7 @@ class="nav-link active"
<div class="col-md-10 table-container">
@if ($logs === null)
<div>
Log file >50M, please download it.
{{trans('lang.log_file_50M_please_download_it.')}}
</div>
@else
<table id="table-log" class="table table-striped">

View File

@@ -0,0 +1,9 @@
<?php
return[
'storage' => 'تخزين',
'root' => 'جذر',
'system_logs' => 'سجلات النظام',
'default' => 'الافتراضي',
'save' => 'حفظ',
];

View File

@@ -13,4 +13,5 @@ return [
'container' => 'Container',
'endpoint' => 'End Point',
'url_type' => 'Url Type',
'save' => 'Save',
];

View File

@@ -114,7 +114,7 @@ class="nav-link active"
<!-- /.box-body -->
</div>
<div class="card-footer">
{!! Form::submit('Save',['class'=>'btn btn-success']) !!}
{!! Form::submit(Lang::get('storage::lang.save'),['class'=>'btn btn-success']) !!}
{!! Form::close() !!}
</div>
<!-- /.box -->

View File

@@ -763,7 +763,7 @@ class SettingsController extends Controller
{
$days = Input::get('no_of_days');
if ($days == null) {
return redirect()->back()->with('fails', 'Please enter valid no of days');
return redirect()->back()->with('fails', \Illuminate\Support\Facades\Lang::get('lang.please_enter_valid_no_days'));
}
$date = new DateTime();
$date->modify($days.' day');

View File

@@ -36,7 +36,7 @@ class UrlSettingController extends Controller
$string = $string_www.$sting_ssl;
$this->writeHtaccess($string);
return redirect()->back()->with('success', 'updated');
return redirect()->back()->with('success', trans('lang.updated'));
} catch (Exception $ex) {
dd($ex);

View File

@@ -108,15 +108,15 @@ class OrganizationController extends Controller
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Are You Sure ?</h4>
<h4 class="modal-title">'.\Lang::get('lang.are_you_sure').'</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
</div>
<div class="modal-body">
'.$model->user_name.'
</div>
<div class="modal-footer justify-content-between">
<button type="button" class="btn btn-default" data-dismiss="modal" id="dismis2">Close</button>
<a href="'.route('org.delete', $model->id).'"><button class="btn btn-danger">delete</button></a>
<button type="button" class="btn btn-default" data-dismiss="modal" id="dismis2">'.\Lang::get('lang.close').'</button>
<a href="'.route('org.delete', $model->id).'"><button class="btn btn-danger">'.\Lang::get('lang.delete').'</button></a>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->

View File

@@ -437,7 +437,7 @@ class TicketController extends Controller
return response()->json(compact('result'));
}
$result = ['success' => 'Replyed successfully'];
$result = ['success' => Lang::get('lang.you_have_successfully_replied_to_your_ticket')];
return response()->json(compact('result'));
}

View File

@@ -46,7 +46,7 @@ class ArticleController extends Controller
// checking authentication
$this->middleware('auth');
// checking roles
$this->middleware('roles');
$this->middleware('role.agent');
SettingsController::language();
}
@@ -91,15 +91,15 @@ class ArticleController extends Controller
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Delete</h4>
<h4 class="modal-title">'.Lang::get('lang.delete').'</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
</div>
<div class="modal-body">
Are you sure you want to delete <b> '.$model->name.' </b> ?
<span>'.Lang::get('lang.are_you_sure_you_want_to_delete').'</span>&nbsp; <b> '.$model->name.' </b> ?
</div>
<div class="modal-footer justify-content-between">
<button type="button" class="btn btn-default" data-dismiss="modal" id="dismis2">Close</button>
<a href='.url("article/delete/$model->slug").'><button class="btn btn-danger">delete</button></a>
<button type="button" class="btn btn-default" data-dismiss="modal" id="dismis2">'.Lang::get('lang.close').'</button>
<a href='.url("article/delete/$model->slug").'><button class="btn btn-danger">'.Lang::get('lang.delete').'</button></a>
</div>
</div>
</div>

View File

@@ -40,7 +40,7 @@ class CategoryController extends Controller
// checking authentication
$this->middleware('auth');
// checking roles
$this->middleware('roles');
$this->middleware('role.agent');
SettingsController::language();
}
@@ -150,9 +150,9 @@ class CategoryController extends Controller
try {
$category->fill($request->input())->save();
return Redirect::back()->with('success', Lang::get('lang.category_inserted_successfully'));
return redirect('category')->with('success', Lang::get('lang.category_inserted_successfully'));
} catch (Exception $e) {
return Redirect::back()->with('fails', Lang::get('lang.category_not_inserted').'<li>'.$e->getMessage().'</li>');
return redirect('category')->with('fails', Lang::get('lang.category_not_inserted').'<li>'.$e->getMessage().'</li>');
}
}

View File

@@ -6,7 +6,6 @@ use App\Http\Controllers\Agent\helpdesk\TicketController;
use App\Http\Controllers\Controller;
use App\Http\Requests\kb\PageRequest;
// request
use App\Http\Requests\kb\PageUpdate;
use App\Model\kb\Page;
use Datatable;
// Model
@@ -38,7 +37,7 @@ class PageController extends Controller
// checking authentication
$this->middleware('auth');
// checking roles
$this->middleware('roles');
$this->middleware('role.agent');
$this->page = $page;
SettingsController::language();
}
@@ -86,20 +85,20 @@ class PageController extends Controller
/* add column Actions */
/* there are action buttons and modal popup to delete a data column */
->addColumn('Actions', function ($model) {
return '<span data-toggle="modal" data-target="#deletepage'.$model->id.'"><a href="#" ><button class="btn btn-danger btn-xs"></a> '.\Lang::get('lang.delete').'</button></span>&nbsp;<a href=page/'.$model->slug.'/edit class="btn btn-warning btn-xs">'.\Lang::get('lang.edit').'</a>&nbsp;<a href=pages/'.$model->slug.' class="btn btn-primary btn-xs">'.\Lang::get('lang.view').'</a>
return '<span data-toggle="modal" data-target="#deletepage'.$model->id.'"><a href="#" ><button class="btn btn-danger btn-xs"></a> '.\Lang::get('lang.delete').'</button></span>&nbsp;<a href=page/'.$model->id.'/edit class="btn btn-warning btn-xs">'.\Lang::get('lang.edit').'</a>&nbsp;<a href=pages/'.$model->slug.' class="btn btn-primary btn-xs">'.\Lang::get('lang.view').'</a>
<div class="modal fade" id="deletepage'.$model->id.'">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Delete</h4>
<h4 class="modal-title">'.Lang::get('lang.delete').'</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
</div>
<div class="modal-body">
Are you sure you want to delete <b>'.$model->name.'</b> ?
<span>'.Lang::get('lang.are_you_sure_you_want_to_delete').'</span>&nbsp;<b>'.$model->name.'</b> ?
</div>
<div class="modal-footer justify-content-between">
<button type="button" class="btn btn-default" data-dismiss="modal" id="dismis2">Close</button>
<a href="page/delete/'.$model->id.'"><button class="btn btn-danger">Delete</button></a>
<button type="button" class="btn btn-default" data-dismiss="modal" id="dismis2">'.Lang::get('lang.close').'</button>
<a href="page/delete/'.$model->id.'"><button class="btn btn-danger">'.Lang::get('lang.delete').'</button></a>
</div>
</div>
</div>
@@ -150,7 +149,7 @@ class PageController extends Controller
public function edit($slug)
{
try {
$page = $this->page->where('slug', $slug)->first();
$page = $this->page->where('id', $slug)->first();
return view('themes.default1.agent.kb.pages.edit', compact('page'));
} catch (Exception $e) {
@@ -169,7 +168,7 @@ class PageController extends Controller
public function update($slug, PageRequest $request)
{
// get pages with respect to slug
$pages = $this->page->where('slug', $slug)->first();
$pages = $this->page->where('id', $slug)->first();
$sl = $request->input('name');
$slug = Str::slug($sl, '-');

View File

@@ -42,7 +42,7 @@ class SettingsController extends Controller
// checking authentication
$this->middleware('auth');
// checking roles
$this->middleware('roles');
$this->middleware('role.agent');
$this->language();
}

View File

@@ -410,10 +410,11 @@ class AuthController extends Controller
return \Redirect::route($request->input('referer'));
}
return \Redirect::route('/');
} else {
// return \Redirect::route('/');
return redirect()->intended($this->redirectPath());
}
return redirect()->intended($this->redirectPath());
}
}
}

View File

@@ -331,13 +331,13 @@ class UnAuthController extends Controller
*
* @return response
*/
public static function changeLanguage($lang)
public static function changeLanguage($ids, $lang)
{
// if(Cache::has('language'))
// {
// return Cache::get('language');
// } else return 'false';
// Cache::put('language',$);
/* if(Cache::has('language'))
{
return Cache::get('language');
} else return 'false';
Cache::put('language',$);
$path = base_path('lang'); // Path to check available language packages
if (array_key_exists($lang, \Config::get('languages')) && in_array($lang, scandir($path))) {
// dd(array_key_exists($lang, Config::get('languages')));
@@ -351,6 +351,22 @@ class UnAuthController extends Controller
}
return true;
*/
$path = base_path('lang'); // Path to check available language packages
if (array_key_exists($lang, \Config::get('languages')) && in_array($lang, scandir($path))) {
if (Auth::check()) {
$id = Auth::user()->id;
$user = User::find($id);
$user->user_language = $lang;
$user->save();
} else {
Session::put('language', $lang);
}
}
return redirect()->back();
}
// Follow up tickets
@@ -446,4 +462,84 @@ class UnAuthController extends Controller
return redirect()->back();
}
public function close($id, Tickets $ticket)
{
$tickets = Tickets::where('id', '=', $id)->first();
$tickets->status = 3;
$ticket_status = Ticket_Status::where('id', '=', 3)->first();
if ($ticket_status->state == 'closed') {
$tickets->closed = $ticket_status->id;
$tickets->closed_at = date('Y-m-d H:i:s');
}
$tickets->save();
$ticket_thread = Ticket_Thread::where('ticket_id', '=', $ticket_status->id)->first();
$ticket_subject = $ticket_thread->title;
$user = User::where('id', '=', $tickets->user_id)->first();
$thread = new Ticket_Thread();
$thread->ticket_id = $tickets->id;
$thread->user_id = $tickets->user_id;
$thread->is_internal = 1;
$thread->body = $ticket_status->message.' '.$user->user_name;
$thread->save();
$email = $user->email;
$user_name = $user->user_name;
$ticket_number = $tickets->ticket_number;
$sending_emails = Emails::where('department', '=', $ticket_status->dept_id)->first();
if ($sending_emails == null) {
$from_email = $this->system_mail();
} else {
$from_email = $sending_emails->id;
}
try {
$this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('0', $tickets->dept_id), $to = ['name' => $user_name, 'email' => $email], $message = ['subject' => $ticket_subject.'[#'.$ticket_number.']', 'scenario' => 'close-ticket'], $template_variables = ['ticket_number' => $ticket_number]);
} catch (\Exception $e) {
return 0;
}
return Lang::get('lang.your_ticket_has_been').' '.$ticket_status->state;
}
public function open($id, Tickets $ticket)
{
$ticket_status = $ticket->where('id', '=', $id)->first();
$ticket_status->status = 1;
$ticket_status->reopened_at = date('Y-m-d H:i:s');
$ticket_status->save();
$ticket_status_message = Ticket_Status::where('id', '=', $ticket_status->status)->first();
$thread = new Ticket_Thread();
$user = User::where('id', '=', $ticket->user_id)->first();
$thread->ticket_id = $ticket_status->id;
$thread->user_id = $ticket->user_id;
$thread->is_internal = 1;
$thread->body = $ticket_status->message.' '.$user->user_name;
$thread->save();
return 'your ticket'.$ticket_status->ticket_number.' has been opened';
}
public function resolve($id, Tickets $ticket)
{
$ticket_status = $ticket->where('id', '=', $id)->first();
$ticket_status->status = 2;
$ticket_status->closed = 1;
$ticket_status->closed_at = date('Y-m-d H:i:s');
$ticket_status->save();
$ticket_status_message = Ticket_Status::where('id', '=', $ticket_status->status)->first();
$thread = new Ticket_Thread();
$user = User::where('id', '=', $ticket->user_id)->first();
$thread->ticket_id = $ticket_status->id;
$thread->user_id = $ticket->user_id;
$thread->is_internal = 1;
$thread->save();
return Lang::get('lang.your_ticket_has_been').' '.$ticket_status->state;
}
}

View File

@@ -124,7 +124,7 @@ class UserController extends Controller
if ($arti) {
return view('themes.default1.client.kb.article-list.show', compact('arti'));
} else {
return redirect('404');
return Redirect::back()->with('fails', Lang::get('lang.sorry_not_processed'));
}
}
@@ -150,7 +150,6 @@ class UserController extends Controller
if (Config::get('database.install') == '%0%') {
return redirect('step1');
} else {
//$categorys = $category->get();
$categorys = $category->get();
// $categorys->setPath('home');
/* direct to view with $article_id */
@@ -235,7 +234,6 @@ class UserController extends Controller
{
$request->validate([
'comment' => 'required',
]);
$article = $article->where('slug', $slug)->first();
@@ -265,7 +263,16 @@ class UserController extends Controller
public function getPage($name, Page $page)
{
$page = $page->where('slug', $name)->first();
$page = $page->where('slug', $name);
if (!Auth::check() || \Auth::user()->role == 'user') {
$page = $page
->where(['status' => 1, 'visibility'=>1])
->first();
} else {
$page = $page->where('status', 1)->first();
}
if ($page) {
return view('themes.default1.client.kb.article-list.pages', compact('page'));
} else {

View File

@@ -214,7 +214,7 @@ class SettingsController extends Controller
try {
$widget->save();
return redirect()->back()->with('success', $widget->name.' Saved Successfully');
return redirect()->back()->with('success', $widget->name.trans('lang.save-successful'));
} catch (Exception $e) {
return redirect()->back()->with('fails', $e->errorInfo[2]);
}

View File

@@ -70,7 +70,7 @@ class QueueController extends Controller
}
}
return redirect()->back()->with('success', 'Updated');
return redirect()->back()->with('success', trans('lang.updated'));
} catch (Exception $ex) {
return redirect()->back()->with('fails', $ex->getMessage());
}
@@ -95,7 +95,7 @@ class QueueController extends Controller
$queue->status = 1;
$queue->save();
return redirect()->back()->with('success', 'Activated');
return redirect()->back()->with('success', trans('lang.activated'));
} catch (Exception $ex) {
return redirect()->back()->with('fails', $ex->getMessage());
}

View File

@@ -36,9 +36,9 @@ class TaskRequest extends Request
public function messages()
{
return [
'fetching-commands.required_if' => 'Please choose your Email Fetching timing',
'notification-commands.required_if' => 'Please choose your Email Notification timing',
'work-commands.required_if' => 'Please choose your Auto-close Workflow timing',
'fetching-commands.required_if' => trans('lang.Please_choose_your_Email_Fetching_timing'),
'notification-commands.required_if' => trans('lang.Please_choose_your_ Email_ Notification_timing'),
'work-commands.required_if' => trans('lang.Please_choose_your_Auto-close_Workflow_timing'),
'workflow-dailyAt.required_if' => 'Please enter the time for Auto-close Workflow timing',
'notification-dailyAt.required_if' => 'Please enter the time for Email Notification timing',
'fetching-dailyAt.required_if' => 'Please enter the time for Email Fetching timing',

View File

@@ -24,8 +24,7 @@ class ArticleRequest extends Request
public function rules()
{
return [
'name' => 'required',
//'slug' => 'required|unique:kb_article',
'name' => 'required|unique:kb_article',
'description' => 'required',
'category_id' => 'required',
];

View File

@@ -23,11 +23,14 @@ class ArticleUpdate extends Request
*/
public function rules()
{
$id = $this->segments()[1];
//$id = $this->segments()[1];
$segments = $this->segments();
$id = isset($segments[1]) ? $segments[1] : null;
return [
'name' => 'required',
'slug' => 'required|unique:kb_article,slug,'.$id.',id',
'name' => 'required|unique:kb_article,name,'.$id,
'slug' => 'required|unique:kb_article,slug,'.$id,
'description' => 'required',
'category_id' => 'required',
];

View File

@@ -23,10 +23,11 @@ class PageRequest extends Request
*/
public function rules()
{
$slug = $this->segment(2);
$id = $this->segment(2);
return [
'name' => 'required|unique:kb_pages,slug,'.$slug,
'name' => 'required|unique:kb_pages,name,'.$id,
'description' => 'required',
];
}
}

View File

@@ -8,6 +8,7 @@ use Illuminate\Support\Facades\Route;
use Illuminate\Support\ServiceProvider;
use Laravel\Dusk\DuskServiceProvider;
use Queue;
use URL;
class AppServiceProvider extends ServiceProvider
{
@@ -39,6 +40,7 @@ class AppServiceProvider extends ServiceProvider
});
Route::singularResourceParameters(false);
$this->composer();
URL::forceScheme('https');
}
public function composer()

25
lang/ar/datatables.php Normal file
View File

@@ -0,0 +1,25 @@
<?php
return [
'sEmptyTable' => 'لا تتوفر بيانات في الجدول',
'sInfo' => 'عرض _START_ إلى _END_ من إجمالي _TOTAL_ إدخال',
'sInfoEmpty' => 'عرض 0 إلى 0 من إجمالي 0 إدخال',
'sInfoFiltered' => '(منتقاة من إجمالي _MAX_ إدخال)',
'sInfoPostFix' => '',
'sInfoThousands' => ',',
'sLengthMenu' => '_MENU_ سجل لكل صفحة',
'sLoadingRecords' => 'جارٍ التحميل...',
'sProcessing' => 'جارٍ المعالجة...',
'sSearch' => 'بحث:',
'sZeroRecords' => 'لم يتم العثور على سجلات مطابقة',
'oPaginate' => [
'sFirst' => 'الأول',
'sLast' => 'الأخير',
'sNext' => 'التالي',
'sPrevious' => 'السابق',
],
'oAria' => [
'sSortAscending' => ': تفعيل لفرز العمود تصاعديًا',
'sSortDescending' => ': تفعيل لفرز العمود تنازليًا',
],
];

1716
lang/ar/lang.php Normal file

File diff suppressed because it is too large Load Diff

19
lang/ar/pagination.php Normal file
View File

@@ -0,0 +1,19 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Pagination Language Lines
|--------------------------------------------------------------------------
|
| The following language lines are used by the paginator library to build
| the simple pagination links. You are free to change them to anything
| you want to customize your views to better match your application.
|
*/
'previous' => '&laquo; السابق',
'next' => 'التالي &raquo;',
];

22
lang/ar/passwords.php Normal file
View File

@@ -0,0 +1,22 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Password Reminder Language Lines
|--------------------------------------------------------------------------
|
| The following language lines are the default lines which match reasons
| that are given by the password broker for a password update attempt
| has failed, such as for an invalid token or invalid new password.
|
*/
'password' => 'يجب أن تحتوي كلمات المرور على الأقل ستة أحرف وتتطابق مع التأكيد.',
'user' => 'لا يمكننا العثور على مستخدم بهذا البريد الإلكتروني.',
'token' => 'رمز إعادة تعيين كلمة المرور غير صالح.',
'sent' => 'لقد أرسلنا رابط إعادة تعيين كلمة المرور إلى بريدك الإلكتروني!',
'reset' => 'تم إعادة تعيين كلمة المرور الخاصة بك!',
];

108
lang/ar/validation.php Normal file
View File

@@ -0,0 +1,108 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Validation Language Lines
|--------------------------------------------------------------------------
|
| The following language lines contain the default error messages used by
| the validator class. Some of these rules have multiple versions such
| as the size rules. Feel free to tweak each of these messages here.
|
*/
'accepted' => 'يجب قبول :attribute.',
'active_url' => ':attribute ليس عنوان URL صالحًا.',
'after' => 'يجب أن يكون :attribute تاريخًا بعد :date.',
'alpha' => 'يمكن أن يحتوي :attribute على أحرف فقط.',
'alpha_dash' => 'يمكن أن يحتوي :attribute على أحرف وأرقام وشرطات فقط.',
'alpha_num' => 'يمكن أن يحتوي :attribute على أحرف وأرقام فقط.',
'array' => 'يجب أن يكون :attribute مصفوفة.',
'before' => 'يجب أن يكون :attribute تاريخًا قبل :date.',
'between' => [
'numeric' => 'يجب أن يكون :attribute بين :min و :max.',
'file' => 'يجب أن يكون حجم :attribute بين :min و :max كيلوبايت.',
'string' => 'يجب أن يكون طول :attribute بين :min و :max أحرف.',
'array' => 'يجب أن يحتوي :attribute على عدد بين :min و :max عناصر.',
],
'boolean' => 'يجب أن تكون قيمة حقل :attribute صحيحة أو خاطئة.',
'confirmed' => 'تأكيد :attribute غير مطابق.',
'date' => ':attribute ليس تاريخًا صالحًا.',
'date_format' => ':attribute لا يتطابق مع الصيغة :format.',
'different' => ':attribute و :other يجب أن يكونا مختلفين.',
'digits' => 'يجب أن يحتوي :attribute على :digits أرقام.',
'digits_between' => 'يجب أن يكون طول :attribute بين :min و :max أرقام.',
'email' => ':attribute يجب أن يكون عنوان بريد إلكتروني صالح.',
'filled' => 'حقل :attribute مطلوب.',
'exists' => ':attribute المحدد غير صالح.',
'image' => ':attribute يجب أن يكون صورة.',
'in' => ':attribute المحدد غير صالح.',
'integer' => 'يجب أن يكون :attribute عددًا صحيحًا.',
'ip' => 'يجب أن يكون :attribute عنوان IP صالحًا.',
'max' => [
'numeric' => 'لا يجب أن يكون :attribute أكبر من :max.',
'file' => 'لا يجب أن يتجاوز حجم :attribute :max كيلوبايت.',
'string' => 'لا يجب أن يتجاوز طول :attribute :max أحرف.',
'array' => 'لا يجب أن يحتوي :attribute على أكثر من :max عناصر.',
],
'mimes' => 'يجب أن يكون :attribute ملفًا من النوع: :values.',
'min' => [
'numeric' => 'يجب أن يكون :attribute على الأقل :min.',
'file' => 'يجب أن يكون حجم :attribute على الأقل :min كيلوبايت.',
'string' => 'يجب أن يكون طول :attribute على الأقل :min أحرف.',
'array' => 'يجب أن يحتوي :attribute على الأقل :min عناصر.',
],
'not_in' => ':attribute المحدد غير صالح.',
'numeric' => 'يجب أن يكون :attribute عددًا.',
'regex' => 'تنسيق :attribute غير صالح.',
'required' => 'حقل :attribute مطلوب.',
'required_if' => 'حقل :attribute مطلوب عندما يكون :other هو :value.',
'required_with' => 'حقل :attribute مطلوب عندما يكون :values موجودًا.',
'required_with_all' => 'حقل :attribute مطلوب عندما يكون :values موجودًا.',
'required_without' => 'حقل :attribute مطلوب عندما لا يكون :values موجودًا.',
'required_without_all' => 'حقل :attribute مطلوب عندما لا يكون أي من :values موجودًا.',
'same' => ':attribute و :other يجب أن يتطابقا.',
'size' => [
'numeric' => 'يجب أن يكون :attribute بحجم :size.',
'file' => 'يجب أن يكون حجم :attribute :size كيلوبايت.',
'string' => 'يجب أن يكون طول :attribute :size أحرف.',
'array' => 'يجب أن يحتوي :attribute على :size عنصرًا.',
],
'unique' => ':attribute تم أخذه بالفعل.',
'url' => 'تنسيق :attribute غير صالح.',
'timezone' => 'يجب أن يكون :attribute منطقة صالحة.',
/*
|--------------------------------------------------------------------------
| Custom Validation Language Lines
|--------------------------------------------------------------------------
|
| Here you may specify custom validation messages for attributes using the
| convention "attribute.rule" to name the lines. This makes it quick to
| specify a specific custom language line for a given attribute rule.
|
*/
'custom' => [
'attribute-name' => [
'rule-name' => 'رسالة مخصصة',
],
],
/*
|--------------------------------------------------------------------------
| Custom Validation Attributes
|--------------------------------------------------------------------------
|
| The following language lines are used to swap attribute place-holders
| with something more reader friendly such as E-Mail Address instead
| of "email". This simply helps us make messages a little cleaner.
|
*/
'attributes' => [
'email' => 'عنوان البريد الإلكتروني',
'password' => 'كلمة المرور',
// Add more attribute translations in Arabic as needed
],
];

View File

@@ -1158,4 +1158,6 @@ return [
'selected-user-is-already-the-owner' => 'Der ausgewählte Benutzer ist bereits Inhaber dieses Tickets.',
//updated 15-5-2017
'session-expired' => 'Die Sitzung ist abgelaufen oder ungültig. Bitte versuchen Sie es erneut.',
//updated 10-10-2023
'what_should_be_done_with_content_owned_by_this_user'=> 'Was soll mit Inhalten geschehen, die diesem Benutzer gehören',
];

View File

@@ -1283,7 +1283,7 @@ return [
|------------------------------------------------
| Error Pages
|------------------------------------------------
*/'knowledge_base' => 'knowledge base',
*/
'not_found' => 'Not found',
'oops_page_not_found' => 'Oops! Page not found',
'we_could_not_find_the_page_you_were_looking_for' => 'We could not find the page you were looking for',
@@ -1568,7 +1568,6 @@ return [
'deleted_user_directory' => 'Deleted User Directory',
'restore' => 'Restore',
'user_restore_successfully' => 'User restore successfully',
/*** updates 28-11-2016***/
'apply' => 'Apply',
@@ -1660,4 +1659,31 @@ return [
'category_list' => 'Category list',
'check_ticket' => 'Check ticket',
'search_result' => 'Search Results',
'already_got_an_account?' => 'Already got an account?',
'message-choose' => 'Choose File(s)',
'Ticket details' => 'Ticket Conversation',
'provider' => 'Providers',
'facebook' => 'Facebook',
'google' => 'Google',
'github' => 'Github',
'twitter' => 'Twitter',
'linkedin' => 'Linkedin',
'bitbucket' => 'Bitbucket',
'Please_choose_your_Email_Fetching_timing' => 'Please choose your Email Fetching timing',
'Please_choose_your_ Email_ Notification_timing' => 'Please choose your Email Notification timing',
'Please_choose_your_Auto-close_Workflow_timing' => 'Please choose your Auto-close Workflow timing',
'lockout_period:' => 'Lockout Period:',
'Lockout_Message:' => 'Lockout Message:',
'please_enter_valid_no_days' => 'Please enter valid no of days',
'author' => 'Author',
'what_should_be_done_with_content_owned_by_this_user' => 'What should be done with content owned by this user',
'ticket_conversation' => 'Ticket Conversation',
'download_file' => 'Download file',
'delete_file' => 'Delete file',
'log_file_50M_please_download_it.' => 'Log file >50M, please download it.',
'support' => 'Support',
'optional' => 'Optional',
'activated' => 'Activated',
'add-child' => 'Add Child',
'save-successful' => ' Saved Successfully',
];

View File

@@ -671,7 +671,7 @@ return [
'form_name' => 'Nombre del formulario',
'view_this_form' => 'Ver este formulario',
'delete_from' => 'Eliminar formulario',
'are_you_sure_you_want_to_delete' => 'estas seguro que quieres borrarlo',
'are_you_sure_you_want_to_delete' => 'Estas seguro que quieres borrarlo',
'close' => 'Cerca',
'instructions' => 'Instrucciones',
'instructions_on_creating_form' => 'Seleccione el tipo de campo que desea agregar al formulario de abajo y haga clic en el menú desplegable "Tipo". No olvide establecer las opciones de campo si el tipo es select, checkbox o radio. Separe cada opción con una coma. Una vez que haya terminado de crear el formulario, puede guardar el formulario haciendo clic en el botón "Guardar formulario"',
@@ -1664,4 +1664,6 @@ Puede ingresar el número de días de registros de base de datos que se eliminar
//updates 22-2-2017
'invalid-date-range' => 'Invalid date range',
//updated 10-10-2023
'what_should_be_done_with_content_owned_by_this_user' => '¿Qué se debe hacer con el contenido propiedad de este usuario',
];

View File

@@ -1563,5 +1563,7 @@ return [
'selected-user-is-already-the-owner' => 'L\'utilisateur sélectionné est déjà le propriétaire du ticket.',
//updated 15-5-2017
'session-expired' => 'Session expired or invalid, please try again.',
//updated 10-10-2023
'what_should_be_done_with_content_owned_by_this_user' => 'Que faire du contenu appartenant à cet utilisateur',
];

View File

@@ -1594,4 +1594,7 @@ return [
'all-users' => 'Tutti gli utenti',
//update 21-12-2016
'selected-user-is-already-the-owner' => 'L\'utente selezionato è già il proprietario del ticket.',
//updated 10-10-2023
'what_should_be_done_with_content_owned_by_this_user' => 'Cosa si dovrebbe fare con i contenuti di proprietà di questo utente',
];

View File

@@ -1609,4 +1609,6 @@ return [
'selected-user-is-already-the-owner' => 'Selected user is already the owner of this ticket.',
//updated 15-5-2017
'session-expired' => 'Session expired or invalid, please try again.',
//updated 10-10-2023
'what_should_be_done_with_content_owned_by_this_user' => 'Wat moet er gebeuren met de inhoud die eigendom is van deze gebruiker',
];

View File

@@ -1552,5 +1552,7 @@ return [
'selected-user-is-already-the-owner' => 'O usuário selecionado já é o proprietário deste ticket.',
//updated 15-5-2017
'session-expired' => 'Sessão expirada ou inválida, tente novamente.',
//updated 10-10-2023
'what_should_be_done_with_content_owned_by_this_user' => 'O que deve ser feito com o conteúdo de propriedade deste usuário',
];

View File

@@ -1554,5 +1554,7 @@ return [
'selected-user-is-already-the-owner' => 'Selected user is already the owner of this ticket.',
//updated 15-5-2017
'session-expired' => 'Session expired or invalid, please try again.',
//updated 10-10-2023
'what_should_be_done_with_content_owned_by_this_user' => 'O que deve ser feito com o conteúdo de propriedade deste usuário',
];

View File

@@ -1651,4 +1651,6 @@ return [
'ticket-has-x-priority' => 'Приоритет заявки - :priority',
'clean-forever' => 'удалить навсегда',
'mail-sent-to-job-for-process' => 'Почта была отправлена на задание для обработки, она появится в вашем почтовом ящике после обработки выбранной службой очереди. Если вы не получаете почту, проверьте журнал на наличие ошибок или предупреждений.',
//updated 10-10-2023
'what_should_be_done_with_content_owned_by_this_user' => 'Что следует делать с контентом, принадлежащим этому пользователю',
];

View File

@@ -1709,4 +1709,6 @@ return [
'ticket_type_updated_successfully' => '工单类型更新成功',
'ticket_type_deleted_successfully' => '工单类型删除成功',
'create_new_ticket' => '创建工单',
//updated 10-10-2023
'what_should_be_done_with_content_owned_by_this_user' => '应如何处理该用户拥有的内容',
];

View File

@@ -8,6 +8,7 @@
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false">
<testsuites>
<testsuite name="all">
<directory>./tests/</directory>
@@ -34,4 +35,3 @@
<env name="DB_INSTALL" value="1"/>
</php>
</phpunit>

View File

@@ -82,7 +82,7 @@
<div>
<h3 class="box-title" align="center">Forgot your password</h3>
<h3 class="box-title" align="center">{{trans('lang.forgot_password')}}</h3>
</div>
<!-- form open -->

View File

@@ -171,7 +171,7 @@
<div class="checkbox icheck" align="center">
<label class="mb-0">
Already got an account? <a href="{{url('auth/login')}}" class="text-center">{!! Lang::get('lang.login') !!}</a>
{{trans('lang.already_got_an_account?')}} <a href="{{url('auth/login')}}" class="text-center">{!! Lang::get('lang.login') !!}</a>
</label>
</div>
<div class="row">

View File

@@ -81,9 +81,9 @@ class="nav-link active"
@endif
<td>
{!! Form::open(['route'=>['groups.destroy', $group->id],'method'=>'DELETE']) !!}
<a href="{{route('groups.edit', $group->id)}}" class="btn btn-primary btn-xs"><i class="fas fa-edit"> </i> Edit</a>
<a href="{{route('groups.edit', $group->id)}}" class="btn btn-primary btn-xs"><i class="fas fa-edit"> </i> {{trans('lang.edit')}}</a>
<!-- To pop up a confirm Message -->
{!! Form::button('<i class="fas fa-trash"> </i> Delete',
{!! Form::button('<i class="fas fa-trash"> </i>'.trans('lang.delete'),
['type' => 'submit',
'class'=> 'btn btn-danger btn-xs',
'onclick'=>'return confirm("Are you sure?")'])

View File

@@ -114,15 +114,15 @@ class="nav-link active"
<td>{!! UTC::usertimezone($email->updated_at) !!}</td>
<td>
{!! Form::open(['route'=>['emails.destroy', $email->id],'method'=>'DELETE']) !!}
<a href="{{route('emails.edit', $email->id)}}" class="btn btn-primary btn-xs"><i class="fas fa-edit"> </i> Edit</a>
<a href="{{route('emails.edit', $email->id)}}" class="btn btn-primary btn-xs"><i class="fas fa-edit"> </i>{{Lang::get('lang.edit')}}</a>
<!-- To pop up a confirm Message -->
@if($default_email == $email->id)
{!! Form::button('<i class="fas fa-trash"> </i> Delete',
{!! Form::button('<i class="fas fa-trash"> </i>'.Lang::get('lang.delete'),
['class'=> 'btn btn-danger btn-xs '. $disabled])
!!}
@else
{!! Form::button('<i class="fas fa-trash"> </i> Delete',
{!! Form::button('<i class="fas fa-trash"> </i>'.Lang::get('lang.delete'),
['type' => 'submit',
'class'=> 'btn btn-danger btn-xs',
'onclick'=>'return confirm("Are you sure?")'])

View File

@@ -73,7 +73,7 @@ class="nav-link active"
{!! link_to_route('forms.show', Lang::get('lang.view_this_form') ,[$form->id],['id'=>'View','class'=>'btn btn-primary btn-sm']) !!}
</div>
<div class="btn-group">
{!! link_to_route('forms.add.child', 'Add Child' ,[$form->id],['id'=>'add-child','class'=>'btn btn-primary btn-sm']) !!}
{!! link_to_route('forms.add.child', Lang::get('lang.add-child') ,[$form->id],['id'=>'add-child','class'=>'btn btn-primary btn-sm']) !!}
</div>
<div class="btn-group">
<button class="btn btn-danger btn-sm" data-toggle="modal" data-target="#delete{{$form->id}}">{!! Lang::get('lang.delete_from') !!}

View File

@@ -87,8 +87,8 @@ class="nav-link active"
<div class="form-group col-sm-3 {{ $errors->has('ispublic') ? 'has-error' : '' }}">
{!! Form::label('ispublic',Lang::get('lang.visibility')) !!}&nbsp;<span class="text-red"> *</span><br/>
<input type="radio" name="ispublic" value="1" checked>&nbsp;&nbsp;Public&nbsp;&nbsp;
<input type="radio" name="ispublic" value="0" >&nbsp;&nbsp;Private
<input type="radio" name="ispublic" value="1" checked>{{Lang::get('lang.public')}}
<input type="radio" name="ispublic" value="0" >&nbsp;&nbsp;{{Lang::get('lang.private')}}
</div>
</div>
<!-- Admin Note : Textarea : -->

View File

@@ -66,8 +66,8 @@ class="nav-link active"
</a>
<div class="btn-group" id="toggle_event_editing" style="float: right; margin-bottom: 10">
<button type="button" class="btn {{$user_status->status == '0' ? 'btn-info' : 'btn-default'}} locked_active">Inactive</button>
<button type="button" class="btn {{$user_status->status == '1' ? 'btn-info' : 'btn-default'}} unlocked_inactive">Active</button>
<button type="button" class="btn {{$user_status->status == '0' ? 'btn-info' : 'btn-default'}} locked_active">{{Lang::get('lang.inactive')}}</button>
<button type="button" class="btn {{$user_status->status == '1' ? 'btn-info' : 'btn-default'}} unlocked_inactive">{{Lang::get('lang.active')}}</button>
</div>
</div>
<div class="priority-table" style="padding-top: 10px">

View File

@@ -282,7 +282,7 @@ class="nav-link active"
<td>
<select class="form-control" onChange="selectdata({!! $i !!})" id="selected{!! $i !!}" name="action[{!! $i !!}][a]" required>
<option value="">-- {!! Lang::get('lang.select_an_action') !!} --</option>
<optgroup label="Ticket">
<optgroup label={{trans('lang.ticket')}}>
<option value="reject" <?php
if ($workflow_action->condition == 'reject') {
echo "selected='selected'";

View File

@@ -33,7 +33,7 @@ class="nav-link active"
@section('content')
@if (count($errors) > 0)
<div class="alert alert-danger">
<strong>Whoops!</strong> There were some problems with your input.<br><br>
<strong>{{Lang::get('lang.woops')}}</strong> {{Lang::get('lang.theirisproblem')}}<br><br>
<ul>
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>

View File

@@ -656,7 +656,7 @@
</div>
<div class="card card-light">
<div class="card-header">
<h3 class="card-title">Logs</h3>
<h3 class="card-title">{{Lang::get('log::lang.logs')}}</h3>
</div>
<!-- /.box-header -->
<div class="card-body">
@@ -671,7 +671,7 @@
</span>
</a>
</div>
<div class="text-center text-sm">Logs</div>
<div class="text-center text-sm">{{Lang::get('log::lang.logs')}}</div>
</div>
</div>
</div>

View File

@@ -108,7 +108,7 @@ class="nav-link active"
<div class="col-md-2">
<!-- logo -->
{!! Form::label('logo',Lang::get('lang.logo')) !!}
<div class="btn bg-olive btn-file" style="color:blue"> Upload file
<div class="btn bg-olive btn-file" style="color:blue"> {{Lang::get('lang.upload_file')}}
{!! Form::file('logo') !!}
</div>
</div>

View File

@@ -1,7 +1,7 @@
{!! Form::model($emails,['url' => 'post-scheduler', 'method' => 'PATCH']) !!}
@if (count($errors) > 0)
<div class="alert alert-danger">
<strong>Whoops!</strong> There were some problems with your input.<br><br>
<strong>{{Lang::get('lang.woops')}}</strong> {{Lang::get('lang.theirisproblem')}}<br><br>
<ul>
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>

View File

@@ -7,7 +7,7 @@
<div class="box-body table-responsive"style="overflow:hidden;">
@if (count($errors) > 0)
<div class="alert alert-danger">
<strong>Whoops!</strong> There were some problems with your input.<br><br>
<strong>{{Lang::get('lang.woops')}}</strong> {{Lang::get('lang.theirisproblem')}}<br><br>
<ul>
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>

View File

@@ -85,8 +85,13 @@ class="nav-link active"
<div class="card-body">
{!! Datatable::table()
->addColumn('Name','Description','Author','Website','Version') // these are the column headings to be shown
->setUrl('getplugin') // this is the route where data will be retrieved
->addColumn(
trans('lang.name'),
trans('lang.description'), // Translate the 'Description' column heading
trans('lang.author'), // Translate the 'Author' column heading
trans('lang.website'), // Translate the 'Website' column heading
trans('lang.version') // Translate the 'Version' column heading
) ->setUrl('getplugin') // this is the route where data will be retrieved
->render() !!}
</div>
</div>

View File

@@ -56,8 +56,8 @@ class="nav-link active"
<td>{!! $rating->display_order !!}</td>
<td>{!! $rating->rating_area !!}</td>
<td>
{!! link_to_route('rating.edit','Edit Ratings',[$rating->id],['class'=>'btn btn-primary btn-sm']) !!}
<button class="btn btn-danger btn-sm" data-toggle="modal" data-target="#delete{{$rating->id}}">Delete</button>
{!! link_to_route('rating.edit',trans('lang.edit_ratings'),[$rating->id],['class'=>'btn btn-primary btn-sm']) !!}
<button class="btn btn-danger btn-sm" data-toggle="modal" data-target="#delete{{$rating->id}}">{{trans('lang.delete')}}</button>
<div class="modal fade" id="delete{{$rating->id}}">
<div class="modal-dialog">
<div class="modal-content">

View File

@@ -65,7 +65,7 @@ class="nav-link active"
<div class="form-group {{ $errors->has('lockout_message') ? 'has-error' : '' }}">
<div class="row">
<div class="col-md-3">
<label for="title">Lockout Message: <span class="text-red"> *</span></label>
<label for="title">{{trans('lang.Lockout_Message:')}}<span class="text-red"> *</span></label>
</div>
<div class="col-md-9">
<div class="callout callout-default" style="font-style: oblique;">{!! Lang::get('lang.security_msg1') !!}</div>
@@ -87,7 +87,7 @@ class="nav-link active"
<div class="form-group {{ $errors->has('lockout_period') ? 'has-error' : '' }}">
<div class="row">
<div class="col-md-3">
<label for="title">Lockout Period: <span class="text-red"> *</span></label>
<label for="title">{{trans('lang.lockout_period:')}}<span class="text-red"> *</span></label>
</div>
<div class="col-md-8">
<div class="callout callout-default" style="font-style: oblique;">{!! Lang::get('lang.security_msg3') !!}</div>

View File

@@ -20,7 +20,7 @@ class="nav-link active"
@stop
<!-- header -->
@section('PageHeader')
<h1>Social Media</h1>
<h1>{{\Illuminate\Support\Facades\Lang::get('lang.social-media')}}</h1>
@stop
<!-- /header -->
<!-- breadcrumbs -->
@@ -32,7 +32,7 @@ class="nav-link active"
@section('content')
@if (count($errors) > 0)
<div class="alert alert-danger">
<strong>Whoops!</strong> There were some problems with your input.<br><br>
<strong>{{Lang::get('lang.woops')}}</strong> {{Lang::get('lang.theirisproblem')}}<br><br>
<ul>
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@@ -59,7 +59,7 @@ class="nav-link active"
@endif
<div class="card card-light">
<div class="card-header">
<h3 class="card-title">Social Media</h3>
<h3 class="card-title">{{trans('lang.social-media')}}</h3>
</div>
<div class="card-body">
@@ -67,89 +67,83 @@ class="nav-link active"
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>Provider</th>
<th>Status</th>
<th>Action</th>
<th>{{trans('lang.provider')}}</th>
<th>{{trans('lang.status')}}</th>
<th>{{trans('lang.action')}}</th>
</tr>
</thead>
<tbody>
<tr>
<td>Facebook</td>
<td>{{\Illuminate\Support\Facades\Lang::get('lang.facebook')}}</td>
<td>
@if($social->checkActive('facebook')===true)
<span style="color: green">Active</span>
<span style="color: green">{{trans('lang.active')}}</span>
@else
<span style="color: red">Inactive</span>
<span style="color: red">{{trans('lang.inactive')}}</span>
@endif
</td>
<td>
<a href="{{url('social/media/facebook')}}" class="btn btn-primary">Settings</a>
</td>
<a href="{{url('social/media/facebook')}}" class="btn btn-primary">{{trans('lang.settings')}}</a> </td>
</tr>
<tr>
<td>Google</td>
<td>{{\Illuminate\Support\Facades\Lang::get('lang.google')}}</td>
<td>
@if($social->checkActive('google')===true)
<span style="color: green">Active</span>
<span style="color: green">{{trans('lang.active')}}</span>
@else
<span style="color: red">Inactive</span>
<span style="color: red">{{trans('lang.inactive')}}</span>
@endif
</td>
<td>
<a href="{{url('social/media/google')}}" class="btn btn-primary">Settings</a>
</td>
<a href="{{url('social/media/google')}}" class="btn btn-primary">{{trans('lang.settings')}}</a> </td>
</tr>
<tr>
<td>Github</td>
<td>{{\Illuminate\Support\Facades\Lang::get('lang.github')}}</td>
<td>
@if($social->checkActive('github')===true)
<span style="color: green">Active</span>
<span style="color: green">{{trans('lang.active')}}</span>
@else
<span style="color: red">Inactive</span>
<span style="color: red">{{trans('lang.inactive')}}</span>
@endif
</td>
<td>
<a href="{{url('social/media/github')}}" class="btn btn-primary">Settings</a>
</td>
<a href="{{url('social/media/github')}}" class="btn btn-primary">{{trans('lang.settings')}}</a> </td>
</tr>
<tr>
<td>Twitter</td>
<td>{{\Illuminate\Support\Facades\Lang::get('lang.twitter')}}</td>
<td>
@if($social->checkActive('twitter')===true)
<span style="color: green">Active</span>
<span style="color: green">{{trans('lang.active')}}</span>
@else
<span style="color: red">Inactive</span>
<span style="color: red">{{trans('lang.inactive')}}</span>
@endif
</td>
<td>
<a href="{{url('social/media/twitter')}}" class="btn btn-primary">Settings</a>
</td>
<a href="{{url('social/media/twitter')}}" class="btn btn-primary">{{trans('lang.settings')}}</a> </td>
</tr>
<tr>
<td>Linkedin</td>
<td>{{\Illuminate\Support\Facades\Lang::get('lang.linkedin')}}</td>
<td>
@if($social->checkActive('linkedin')===true)
<span style="color: green">Active</span>
<span style="color: green">{{trans('lang.active')}}</span>
@else
<span style="color: red">Inactive</span>
<span style="color: red">{{trans('lang.inactive')}}</span>
@endif
</td>
<td>
<a href="{{url('social/media/linkedin')}}" class="btn btn-primary">Settings</a>
</td>
<a href="{{url('social/media/linkedin')}}" class="btn btn-primary">{{trans('lang.settings')}}</a> </td>
</tr>
<tr>
<td>Bitbucket</td>
<td>{{\Illuminate\Support\Facades\Lang::get('lang.bitbucket')}}</td>
<td>
@if($social->checkActive('bitbucket')===true)
<span style="color: green">Active</span>
<span style="color: green">{{trans('lang.active')}}</span>
@else
<span style="color: red">Inactive</span>
<span style="color: red">{{trans('lang.inactive')}}</span>
@endif
</td>
<td>
<a href="{{url('social/media/bitbucket')}}" class="btn btn-primary">Settings</a>
</td>
<a href="{{url('social/media/bitbucket')}}" class="btn btn-primary">{{trans('lang.settings')}}</a> </td>
</tr>
</tbody>
</table>

View File

@@ -33,7 +33,7 @@ class="nav-link active"
{!! Form::open(['url' => 'social/media/'.$provider, 'method' => 'POST']) !!}
@if (count($errors) > 0)
<div class="alert alert-danger">
<strong>Whoops!</strong> There were some problems with your input.<br><br>
<strong>{{Lang::get('lang.woops')}}</strong> {{Lang::get('lang.theirisproblem')}}<br><br>
<ul>
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@@ -103,10 +103,10 @@ class="nav-link active"
{!! Form::label('status',Lang::get('lang.status')) !!}
</div>
<div class="col-md-6">
<p>{!! Form::radio('status',1,$social->checkActive($provider))!!} Active</p>
<p>{!! Form::radio('status',1,$social->checkActive($provider)) .Lang::get('lang.active')!!}</p>
</div>
<div class="col-md-6">
<p>{!! Form::radio('status',0,$social->checkInactive($provider)) !!} Inactive</p>
<p>{!! Form::radio('status',0,$social->checkInactive($provider)) .Lang::get('lang.inactive')!!} </p>
</div>
<div class="col-md-12">
<i>Activate login via {{ucfirst($provider)}}</i>

View File

@@ -90,7 +90,7 @@ class="nav-link active"
<!-- Default Priority: Required : manual : Dropdowm -->
<div class="form-group col-md-6 {{ $errors->has('priority') ? 'has-error' : '' }}">
{!! Form::label('priority',Lang::get('lang.default_priority')) !!}
{!!Form::select('priority', [''=>'select a priority','Priorities'=>$priority->pluck('priority_desc','priority_id')->toArray()],null,['class' => 'form-control']) !!}
{!!Form::select('priority', [''=>Lang::get('lang.select_a_priority'),Lang::get('lang.priorities')=>$priority->pluck('priority_desc','priority_id')->toArray()],null,['class' => 'form-control']) !!}
</div>
</div>
<div class="row">

View File

@@ -34,7 +34,7 @@ class="nav-link active"
@if (count($errors) > 0)
<div class="alert alert-danger">
<strong>Whoops!</strong> There were some problems with your input.<br><br>
<strong>{{Lang::get('lang.woops')}}</strong> {{Lang::get('lang.theirisproblem')}} <br><br>
<ul>
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@@ -61,7 +61,7 @@ class="nav-link active"
@endif
<div class="card card-light">
<div class="card-header">
<h3 class="card-title">URL Settings</h3>
<h3 class="card-title">URL {{trans('lang.settings')}}</h3>
</div>
<div class="card-body">

View File

@@ -690,7 +690,7 @@
<li class="nav-item">
<a href="{{ url('logs') }}" @yield('Log') class="nav-link">
<i class="nav-icon fas fa-lock"></i>
<p>Logs</p>
<p>{{Lang::get('log::lang.logs')}}</p>
</a>
</li>
@endif

View File

@@ -153,7 +153,7 @@ class="nav-item d-none d-sm-inline-block active"
<div class="row">
<div class='col-sm-2'>
{!! Form::label('date', 'Start Date:') !!}
{!! Form::label('date', trans('lang.start_date')) !!}
{!! Form::text('start_date',null,['class'=>'form-control','id'=>'datepicker4'])!!}
</div>
@@ -184,7 +184,7 @@ class="nav-item d-none d-sm-inline-block active"
<div class='col-sm-2'>
{!! Form::label('start_time', 'End Date:') !!}
{!! Form::label('start_time', trans('lang.end_date')) !!}
{!! Form::text('end_date',null,['class'=>'form-control','id'=>'datetimepicker3'])!!}
</div>
@@ -202,7 +202,7 @@ class="nav-item d-none d-sm-inline-block active"
<div class='col-sm-1'>
{!! Form::label('filter', 'Filter:',['style' => 'visibility:hidden;']) !!}<br>
<input type="submit" class="btn btn-primary">
<button type="submit" class="btn btn-primary">{{trans('lang.submit')}}</button>
</div>
</div>
@@ -253,9 +253,9 @@ class="nav-item d-none d-sm-inline-block active"
$statuses = $flattened->keys();
?>
<tr>
<th>Department</th>
<th>{{trans('lang.department')}}</th>
@forelse($statuses as $status)
<th>{!! $status !!}</th>
<th>{{trans('lang.'.strtolower($status))}}</th>
@empty
@endforelse

View File

@@ -140,7 +140,7 @@ if (Auth::user()->role == 'agent') {
</div>
<div class="col-md-6">
<label>{!! Lang::get('lang.select-pparent-ticket') !!}</label>
<select class="form-control" id="select-merge-parent" name='p_id' data-placeholder="{!! Lang::get('lang.select_tickets') !!}" style="width: 100%;"><option value=""></option></select>
<select class="form-control" id="select-merge-parent" name='p_id' data-placeholder="{!! Lang::get('lang.select_tickets') !!}" style="width: 100%;"><option value=""> {{trans('lang.optional')}}</option></select>
</div>
</div>
<div class="row">

View File

@@ -1,4 +1,4 @@
@extends('themes.default1.agent.layout.agent')
@extends('themes.default1.agent.layout.agent')
@section('Users')
class="nav-link active"

View File

@@ -138,7 +138,7 @@ class="active"
<div class='col-sm-1'>
{!! Form::label('filter', 'Filter:',['style' => 'visibility:hidden;']) !!}<br>
<input type="submit" class="btn btn-primary" value="Submit" id="submit">
<input type="submit" class="btn btn-primary" value="{{trans('lang.submit')}}" id="submit">
</div>
<br/>
<div class="col-md-4">
@@ -149,9 +149,9 @@ class="active"
<div class="float-right">
<div class="btn-group">
<button type="button" class="btn btn-default" id="click_day">Day</button>
<button type="button" class="btn btn-default" id="click_week">Week</button>
<button type="button" class="btn btn-default" id="click_month">Month</button>
<button type="button" class="btn btn-default" id="click_day">{{trans('lang.day')}}</button>
<button type="button" class="btn btn-default" id="click_week">{{trans('lang.week')}}</button>
<button type="button" class="btn btn-default" id="click_month">{{trans('lang.month')}}</button>
</div>
</div>
</div>

View File

@@ -213,7 +213,7 @@ if (Auth::user()->role == 'agent') {
</div>
<div class="modal-footer justify-content-between">
<button type="button" class="btn btn-default no">{{Lang::get('lang.cancel')}}</button>
<button type="button" class="btn btn-primary yes" data-dismiss="modal">{{Lang::get('lang.ok')}}</button>
<button type="button" class="btn btn-primary yes" data-dismiss="modal">{{Lang::get('lang.yes')}}</button>
</div>
</div>
</div>

View File

@@ -57,7 +57,7 @@
<div class="col-md-6">
{!! Form::open(['id'=>'merge-form','method' => 'PATCH'] )!!}
<label>{!! Lang::get('lang.title') !!}</label>
<input type="text" name='title' class="form-control" value="" placeholder="Optional" />
<input type="text" name='title' class="form-control" value="" placeholder="{{trans('lang.optional')}}" />
</div>
<div class="col-md-6">
<label>{!! Lang::get('lang.select-pparent-ticket') !!}</label>

View File

@@ -262,7 +262,7 @@ class="active"
</div>
<div class="col-md-5">
<?php $Priority = App\Model\helpdesk\Ticket\Ticket_Priority::where('status','=',1)->get(); ?>
{!! Form::select('priority', ['Priority'=>$Priority->pluck('priority_desc','priority_id')->toArray()],null,['class' => 'form-control select']) !!}
{!! Form::select('priority', [Lang::get('lang.priorities')=>$Priority->pluck('priority_desc','priority_id')->toArray()],null,['class' => 'form-control select']) !!}
</div>
</div>

View File

@@ -117,7 +117,7 @@ if (Request::has('assigned'))
@elseif($activepage == 'overdue')
{{Lang::get('lang.overdue')}}
@elseif($activepage == 'closed')
{{Lang::get('lang.closed')}}
{{-- {{Lang::get('lang.closed')}}--}}
@elseif($activepage == 'approval')
{{Lang::get('lang.approval')}}
@elseif($activepage == 0)
@@ -185,7 +185,7 @@ if (Request::has('assigned'))
@foreach($statuses as $ticket_status)
<a href="javascript:;" class="dropdown-item" onclick="changeStatus({!! $ticket_status -> id !!}, '{!! $ticket_status->name !!}')"
data-toggle="modal" data-target="#myModal">
{!! $ticket_status->name !!}
{{trans('lang.'.strtolower($ticket_status->name)) }}
</a>
@endforeach
</div>

View File

@@ -1,4 +1,5 @@
@extends('themes.default1.agent.layout.agent')
<meta charset="utf-8">
@section('Tickets')
class="nav-link active"
@@ -138,17 +139,17 @@ if ($thread->title != "") {
if ($group->can_edit_ticket == 1) {
?>
<button type="button" class="btn btn-sm btn-default btn-tool">
<i class="fas fa-edit" style="color:green;"></i> Edit
<i class="fas fa-edit" style="color:green;"></i> {{trans('lang.edit')}}
</button> <?php } ?>
<?php if ($group->can_assign_ticket == 1) { ?>
<button type="button" class="btn btn-sm btn-default btn-tool">
<i class="fas fa-hand-point-right" style="color:orange;"></i> Assign
<i class="fas fa-hand-point-right" style="color:orange;"></i> {{trans('lang.assign')}}
</button> <?php } ?>
@if($tickets->assigned_to == Auth::user()->id)
<button type="button" id="surrender_button" class="btn btn-sm btn-default btn-tool" data-toggle="modal" data-target="#surrender">
<i class="fas fa-arrows-alt" style="color:red;"></i> Surrender
<i class="fas fa-arrows-alt" style="color:red;"></i> {{trans('lang.surrender')}}
</button>
@endif
@@ -156,7 +157,7 @@ if ($thread->title != "") {
<?php \Illuminate\Support\Facades\Event::dispatch('show-add-event-btn', []); ?>
<a href="{{url('ticket/print/'.$tickets->id)}}" target="_blank" class="btn btn-default btn-tool btn-sm">
<i class="fas fa-print"></i> Generate PDF
<i class="fas fa-print"></i> {{trans('lang.generate_pdf')}}
</a> <div class="btn-group">
<button type="button" class="btn btn-sm btn-default dropdown-toggle" data-toggle="dropdown" id="d1"><i class="fas fa-exchange-alt" style="color:teal;" id="hidespin"> </i><i class="fa fa-spinner fa-spin" style="color:teal; display:none;" id="spin"></i>
{!! Lang::get('lang.change_status') !!} <span class="caret"></span>
@@ -200,7 +201,7 @@ if ($thread->title != "") {
<?php }
?>
<?php if ($group->can_ban_email == 1) { ?>
<a href="#" class="dropdown-item" data-toggle="modal" data-target="#banemail"><i class="fas fa-ban" style="color:red;"></i> {!! Lang::get('lang.ban_email') !!}</a>
<a href="#" class="dropdown-item" data-toggle="modal" data-target="#banemail"><i class="fas fa-ban" style="color:red;"></i> {{trans('lang.ban_email')}}</a>
<?php
\Illuminate\Support\Facades\Event::dispatch('ticket.details.more.list',[$tickets]);
}
@@ -328,7 +329,7 @@ if ($thread->title != "") {
<div class="card-header">
<h3 class="card-title">Actions</h3>
<h3 class="card-title">{{trans('lang.action')}}</h3>
</div>
<div class="card-body">
@@ -515,7 +516,7 @@ if ($thread->title != "") {
<div class="card card-light">
<div class="card-header">
<h3 class="card-title">Ticket Conversation</h3>
<h3 class="card-title">{{trans('lang.ticket_conversation')}}</h3>
</div>
<div class="card-body">
@@ -923,7 +924,7 @@ if ($thread->title != "") {
<div class="modal-footer justify-content-between">
<button type="button" class="btn btn-default" data-dismiss="modal" id="dismis2">{!! Lang::get('lang.close') !!}</button>
<button id="ban" type="button" class="btn btn-warning" >{!! Lang::get('lang.ban_email') !!}</button>
<button id="ban" type="button" class="btn btn-warning" >{{trans('lang.ban_email')}}</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
@@ -1829,16 +1830,20 @@ if ($thread->title != "") {
$("#t1").hide();
$("#show3").show();
$('html, body').animate({
scrollTop: $("#form3").offset().top
scrollTop: $("#inboxactions").offset().top
}, 500);
},
success: function(json) {
$("#show3").hide();
$("#t1").show();
setTimeout(function () {
location.reload();
}, 4000);
$("#alert21").show();
$('#message-success2').html(json.result.success);
location.reload();
// $('html, body').animate({ scrollTop: $("#heading").offset().top }, 500);
},
error: function(json) {
$("#show3").hide();
$("#t1").show();
@@ -1851,6 +1856,7 @@ if ($thread->title != "") {
}
})
return false;
});
// Surrender
$('#Surrender').on('click', function() {

View File

@@ -1296,9 +1296,9 @@ class="nav-link active"
</div>
<div class="modal-body">
What should be done with content owned by this user?</br>
<p>{!! Lang::get('lang.what_should_be_done_with_content_owned_by_this_user') !!}?</p>
<br>
<?php $user = App\User::where('id', $users->id)->first(); ?>
@if($user->role == 'agent')
{!! Form::label('delete_all_content',Lang::get('lang.delete_all_content')) !!} <span class="text-red"> *</span>

View File

@@ -83,7 +83,7 @@ class="nav-item menu-open"
<div class="form-group col-sm-12 {{ $errors->has('description') ? 'has-error' : '' }}">
{!! Form::label('description',Lang::get('lang.description')) !!}
<span class="text-red"> *</span>
<div class="form-group" style="background-color:white">
{!! Form::textarea('description',null,['class' => 'form-control color','size' => '110x15','id'=>'myNicEditor','placeholder'=>Lang::get('lang.enter_the_description')]) !!}
</div>

View File

@@ -35,7 +35,7 @@ class="nav-item menu-open"
@section('content')
{!! Form::model($page,['url' => 'page/'.$page->slug, 'method' => 'PATCH','files'=>true]) !!}
{!! Form::model($page,['url' => 'page/'.$page->id, 'method' => 'PATCH','files'=>true]) !!}
@if(Session::has('errors'))
<?php //dd($errors); ?>

View File

@@ -310,7 +310,7 @@
class="img-size-50">
</li>
<li class="dropdown-footer"><a class="text-dark" href="{{ url('notifications-list')}}">View all</a>
<li class="dropdown-footer"><a class="text-dark" href="{{ url('notifications-list')}}">{{trans('lang.view_all')}}</a>
</ul>
</div>
</li>
@@ -445,6 +445,7 @@
<li class="nav-header">{!! Lang::get('lang.Departments') !!}</li>
<?php
$flattened = $department->flatMap(function ($values) {
return $values->keyBy('status');
@@ -472,7 +473,7 @@
<a href="#" @if($dept2 === $name) @yield('ticket-bar') @endif class="nav-link">
<i class="nav-icon fas fa-folder-open"></i>
<p>{!! $name !!}<i class="right fas fa-angle-left"></i></p>
<p>{!!trans('lang.'.strtolower($name))!!}<i class="right fas fa-angle-left"></i></p>
</a>
@foreach($statuses as $status)
@@ -483,7 +484,7 @@
<li class="nav-item">
<a href="{!! url('tickets?departments='.$name.'&status='.$dept->get($status)->status) !!}" @if($status2 == $dept->get($status)->status && $dept2 === $name) @yield('inbox') @endif class="nav-link">
<i class="far fa-circle nav-icon"></i>
<p>{!!$dept->get($status)->status !!}</p>
<p>{!!trans('lang.'.strtolower($dept->get($status)->status)) !!}</p>
<small class="right badge badge-success">{{$dept->get($status)->count}}</small>
</a>
</li>

View File

@@ -9,7 +9,7 @@
@stop
@section('sidebar')
<li class="nav-header">KNOWLEDGE BASE</li>
<li class="nav-header">{{strtoupper(trans('lang.knowledge_base'))}}</li>
<li @yield('category-menu-parent') class="nav-item">

View File

@@ -138,7 +138,8 @@ class="nav-item active"
<td class="mailbox-priority"><spam>{{$priority->priority}}</spam></td>
<td class="mailbox-last-reply" style="color: {!! $rep !!}">{!! $username !!}</td>
<td class="mailbox-last-activity">{!! $title->updated_at !!}</td>
<?php $updated = $title->updated_at ?>
<td class="mailbox-last-activity">{!! UTC::usertimezone($updated) !!}</td>
<?php $status = App\Model\helpdesk\Ticket\Ticket_Status::where('id', '=', $ticket->status)->first(); ?>
<td class="mailbox-date">{!! $status->name !!}</td>
</tr>

View File

@@ -5,48 +5,97 @@
$thread = App\Model\helpdesk\Ticket\Ticket_Thread::where('ticket_id', '=', $tickets->id)->first();
//$user = App\User::where('id','=',$id1)->first();
?>
<style type="text/css">
.caret {
border-left: 4px solid transparent;
border-right: 4px solid transparent;
border-top: 4px solid;
display: inline-block;
height: 0;
margin-left: 2px;
vertical-align: middle;
width: 0;
}
.mailbox-attachments li{float:left;width:200px;border:1px solid #eee;margin-bottom:10px;margin-right:10px}
.mailbox-attachment-name{font-weight:bold;color:#666;word-break: break-word;}
.mailbox-attachment-icon,.mailbox-attachment-info,.mailbox-attachment-size{display:block}
.mailbox-attachment-info{padding:10px;background:#f4f4f4;height: auto;}
.mailbox-attachment-size{color:#999;font-size:12px}
.mailbox-attachment-icon{text-align:center;font-size:65px;color:#666;padding:20px 10px}
.mailbox-attachment-icon.has-img{padding:0}
.mailbox-attachment-icon.has-img>img{max-width:100%;height:auto}
#clearfix {display: inline-block!important;list-style-type: none!important;}
.ml40 {margin-left: -40px!important;}
</style>
<!-- Main content -->
<div class="box box-primary">
<div class="box-header">
<div id="content" class="site-content col-sm-12">
<article class="hentry">
<header class="entry-header">
<div class="row">
<div class="col-md-9">
<section class="content-header"><h3 class="box-title"><i class="fa fa-user"> </i> {{$thread->title}} </h3> ( {{$tickets->ticket_number}} )
</section>
<div class="col-sm-9">
<h3 class="entry-title"><i class="fas fa-ticket-alt"> </i> {{$thread->title}}
<small> ( {{$tickets->ticket_number}} ) </small>
</h3>
</div>
<div class="col-md-3">
<div class="pull-right">
<!-- <button type="button" class="btn btn-default"><i class="fa fa-edit" style="color:green;"> </i> Edit</button> -->
{{-- <button type="button" class="btn btn-default"><i class="fa fa-print" style="color:blue;"> </i> {!! link_to_route('ticket.print','Print',[$tickets->id]) !!}</button> --}}
<!-- </div> -->
<div class="btn-group">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"><i class="fa fa-exchange" style="color:teal;"> </i>
{!! Lang::get('lang.change_status') !!} <span class="caret"></span>
<div class="col-sm-3 text-right">
<div>
<button class="btn btn-light dropdown-toggle" type="button" id="dropdownMenuButton" data-bs-toggle="dropdown" aria-expanded="false" style="background-color: whitesmoke">
<i class="fas fa-exchange-alt" style="color:teal;"> </i>
{!! Lang::get('lang.change_status') !!}
<span class="caret"></span>
</button>
<?php $statuses = \App\Model\helpdesk\Ticket\Ticket_Status::all(); ?>
<ul class="dropdown-menu" id='cc_page'>
@foreach($statuses as $status)
<?php if ($status->name == 'Deleted' or $status->name == 'Accepted') continue; ?>
<li class="search_r"><a href="#" onclick="changeStatus({!! $status->id !!})"><i class="{!! $status->icon_class !!}" style="color:#FFD600;"> </i>{!! $status->name !!}</a>
</li>
@endforeach
<div class="dropdown-menu">
</ul>
<a class="dropdown-item" href="#" id="open">
<i class="fas fa-folder-open" style="color:#FFD600;"> </i> {!! Lang::get('lang.open') !!}
</a>
<a class="dropdown-item" href="#" id="close">
<i class="fas fa-check" style="color:#15F109;"> </i> {!! Lang::get('lang.close') !!}
</a>
<a class="dropdown-item" href="#" id="resolved">
<i class="fas fa-check-circle " style="color:#0EF1BE;"> </i> {!! Lang::get('lang.resolved') !!}
</a>
</div>
</div>
{!! Form::close() !!}
</div>
</div>
</div>
<br/>
<div class="row">
<div class="col-md-12">
<div class="alert alert-success alert-dismissable" id="alert11" style="display:none;">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
<i class="fa fa-check-circle"></i> <span id="message-success1">
</span>
</div>
<div class="ticketratings pull-right">
<table><tbody>
<div class="col-md-12 mb-1">
<div class="ticketratings float-right">
<table>
<tbody>
<?php $ratings = App\Model\helpdesk\Ratings\Rating::orderby('display_order')->get(); ?>
<form id="foo">
{!! csrf_field() !!}
@@ -61,9 +110,13 @@ $thread = App\Model\helpdesk\Ticket\Ticket_Thread::where('ticket_id', '=', $tick
$ratingval = $rating_value->rating_value;
}
?>
<tr>
<th><div class="ticketratingtitle">{!! $rating->name !!} &nbsp;</div></th>&nbsp
<td>
<?php for ($i = 1; $i <= $rating->rating_scale; $i++) { ?>
<input type="radio" class="star" id="star5" name="{!! $rating->name !!}" value="{!! $i !!}"<?php echo ($ratingval == $i) ? 'checked' : '' ?> />
<?php } ?>
@@ -71,33 +124,32 @@ $thread = App\Model\helpdesk\Ticket\Ticket_Thread::where('ticket_id', '=', $tick
</tr>
@endif
@endforeach
</form></tbody> </table>
</form>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class="box-body" style="margin-bottom:-10px">
<div class="row">
<div id="loader" style="display:none;">
<div class="col-xs-5">
</div>
<div class="col-xs-1">
</header>
<div class="entry-content clearfix">
<div class="col-md-12 offset-md-5" id="loader" style="display:none;">
<img src="{{asset("lb-faveo/media/images/gifloader.gif")}}"><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
</div>
<div class="col-xs-6">
</div>
</div>
<section class="content" id="refresh" style="margin-bottom:-10px;margin-top:-10px">
<div class="col-md-12">
<div id="refresh">
<div>
<?php
$priority = App\Model\helpdesk\Ticket\Ticket_Priority::where('priority_id', '=', $tickets->priority_id)->first();
?>
<div class="callout callout-default ">
<div class="alert alert-secondary">
<div class="row">
<div class="col-md-3">
<?php
$sla = $tickets->sla;
$SlaPlan = App\Model\helpdesk\Manage\Sla_plan::where('id', '=', 1)->first();
$SlaPlan = App\Model\helpdesk\Manage\Sla_plan::where('id', '=', $sla)->first();
?>
<b>{!! Lang::get('lang.sla_plan') !!}: {{$SlaPlan->grace_period}} </b>
</div>
@@ -110,7 +162,7 @@ $thread = App\Model\helpdesk\Ticket\Ticket_Thread::where('ticket_id', '=', $tick
$time = $tickets->created_at;
$time = date_create($time);
date_add($time, date_interval_create_from_date_string($SlaPlan->grace_period));
echo UTC::usertimezone(date_format($time, 'd/m/Y H:i:s'));
echo UTC::usertimezone(date_format($time, 'Y-m-d H:i:s'));
?>
</div>
<div class="col-md-3">
@@ -123,52 +175,91 @@ $thread = App\Model\helpdesk\Ticket\Ticket_Thread::where('ticket_id', '=', $tick
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<table class="table table-hover">
<!-- <tr><th></th><th></th></tr> -->
<tr><td><b>{!! Lang::get('lang.status') !!}:</b></td> <?php $status = App\Model\helpdesk\Ticket\Ticket_Status::where('id', '=', $tickets->status)->first(); ?>
<table class="table">
<tr>
<td><b>{!! Lang::get('lang.status') !!}:</b></td>
<?php $status = App\Model\helpdesk\Ticket\Ticket_Status::where('id', '=', $tickets->status)->first(); ?>
@if($status->id == 1)
<td title="{{$status->properties}}" style="color:orange">{{$status->name}}</td></tr>
@elseif($status->id == 2)
<td title="{{$status->properties}}" style="color:green">{{$status->name}}</td></tr>
@elseif($status->id == 3)
<td title="{{$status->properties}}" style="color:green">{{$status->name}}</td></tr>
@endif
<tr><td><b>{!! Lang::get('lang.priority') !!}:</b></td> <?php $priority = App\Model\helpdesk\Ticket\Ticket_Priority::where('priority_id', '=', $tickets->priority_id)->first(); ?>
<td title="{{$status->properties}}" style="color:orange">{{$status->name}}</td>
@elseif($status->id == 2)
<td title="{{$status->properties}}" style="color:green">{{$status->name}}</td>
@elseif($status->id == 3)
<td title="{{$status->properties}}" style="color:green">{{$status->name}}</td>
@endif
</tr>
<tr>
<td><b>{!! Lang::get('lang.priority') !!}:</b></td>
<?php $priority = App\Model\helpdesk\Ticket\Ticket_Priority::where('priority_id', '=', $tickets->priority_id)->first(); ?>
@if($priority->priority_id == 1)
<td title="{{$priority->priority_desc}}" style="color:green">{{$priority->priority_desc}}</td>
@elseif($priority->priority_id == 2)
<td title="{{$priority->priority_desc}}" style="color:orange">{{$priority->priority_desc}}</td>
@elseif($priority->priority_id == 3)
<td title="{{$priority->priority_desc}}" style="color:red">{{$priority->priority_desc}}</td>
@endif
<td title="{{$priority->priority_desc}}" style="color:green">{{$priority->priority_desc}}</td>
@elseif($priority->priority_id == 2)
<td title="{{$priority->priority_desc}}" style="color:orange">{{$priority->priority_desc}}</td>
@elseif($priority->priority_id == 3)
<td title="{{$priority->priority_desc}}" style="color:red">{{$priority->priority_desc}}</td>
@endif
</tr>
<tr><td><b>{!! Lang::get('lang.department') !!}:</b></td>
<tr>
<td><b>{!! Lang::get('lang.department') !!}:</b></td>
<?php
$help_topic = App\Model\helpdesk\Manage\Help_topic::where('id', '=', $tickets->help_topic_id)->first();
$department = App\Model\helpdesk\Agent\Department::where('id', '=', $help_topic->department)->first();
?>
<td title="{{ $department->name }}">{!! $department->name !!}</td></tr>
<td title="{{ $department->name }}">{!! $department->name !!}</td>
</tr>
</table>
<!-- </div> -->
</div>
<div class="col-md-6">
<!-- <div class="callout callout-success"> -->
<table class="table table-hover">
<!-- <tr><th></th><th></th></tr> -->
<tr><td><b>{!! Lang::get('lang.help_topic') !!}:</b></td> <?php $help_topic = App\Model\helpdesk\Manage\Help_topic::where('id', '=', $tickets->help_topic_id)->first(); ?><td title="{{$help_topic->topic}}">{{$help_topic->topic}}</td></tr>
<tr><td><b>{!! Lang::get('lang.last_message') !!}:</b></td> <td>{{ucwords($last->poster)}}</td></tr>
<table class="table">
<tr>
<td><b>{!! Lang::get('lang.help_topic') !!}:</b></td>
<?php $help_topic = App\Model\helpdesk\Manage\Help_topic::where('id', '=', $tickets->help_topic_id)->first(); ?>
<td title="{{$help_topic->topic}}">{{$help_topic->topic}}</td>
</tr>
<tr>
<td><b>{!! Lang::get('lang.last_message') !!}:</b></td>
<td>{{ucwords($last->poster)}}</td>
</tr>
</table>
</div>
<!-- </div> -->
</section>
</div>
</div>
</div>
<div class="comments-area mb-0" id="comments">
<?php
$conversations = App\Model\helpdesk\Ticket\Ticket_Thread::where('ticket_id', '=', $tickets->id)->where('is_internal', '=', 0)->paginate(10);
foreach ($conversations as $conversation) {
@@ -185,6 +276,7 @@ foreach ($conversations as $conversation) {
}
$role = App\User::where('id', '=', $conversation->user_id)->first();
$attachment = App\Model\helpdesk\Ticket\Ticket_attachments::where('thread_id', '=', $conversation->id)->first();
if ($attachment == null) {
$body = $conversation->body;
@@ -237,6 +329,7 @@ foreach ($conversations as $conversation) {
?>
<ol class="comment-list" >
<li class="comment">
<article class="comment-body">
<footer class="comment-meta"<?php if ($role->role == "user") { ?> style="background-color: hsla(100, 100%, 51%, 0.15)" <?php } else { ?> style="background-color:#FFFCB3" <?php } ?> >
<div class="comment-author">
@@ -335,7 +428,7 @@ foreach ($conversations as $conversation) {
<?php }
?>
<div class="pull-right" style="margin-top:-30px;margin-bottom:-30px">
<?php echo $conversations->setPath(route('show.ticket', ['id' => $tickets->id, 'token' => $token]))->render(); ?>
<?php echo $conversations->setPath(route('show.ticket', ['ids' => $tickets->id, 'code' => $token]))->render(); ?>
</div>
<br/><br/>
@if(Session::has('success1'))
@@ -355,48 +448,77 @@ foreach ($conversations as $conversation) {
</div>
@endif
<?php $id2 = $tickets->id; ?>
<div id="respond" class="comment-respond form-border">
<h3 id="reply-title" class="comment-reply-title section-title"><i class="line" style="border-color: rgb(0, 154, 186);"></i>{!! Lang::get('lang.leave_a_reply') !!}</h3>
<div id="respond" class="comment-respond form-border">
<h3 id="reply-title" class="comment-reply-title section-title"><i class="line"></i>{!! Lang::get('lang.leave_a_reply') !!}</h3>
@if(Auth::user())
{!! Form::open(['url'=>'post/reply/'.$id2.'#formabc']) !!}
@else
{!! Form::open(['url'=>'post-ticket-reply/'.$tickets->id.'#formabc']) !!}
@endif
<div class="row">
<div class="form-group">
<div class="col-md-12">
<div class="form-group ">
<textarea class="form-control" name="comment" cols="30" rows="8"></textarea>
</div>
<div class="form-group " style="background-color: white">
<textarea class="form-control" id="reply-input" name="comment" cols="30" rows="8" ></textarea>
</div>
</div>
</div>
<div class="text-right">
<button type="submit" class="btn btn-custom btn-lg">{!! Lang::get('lang.post_comment') !!}</button>
<button type="submit" onClick="return checkFunction();" class="btn btn-custom btn-lg" style="background-color: #009aba; hov: #00c0ef; color: #fff">{!! Lang::get('lang.post_comment') !!}</button>
</div>
{!! Form::close() !!}
</div>
</div>
</div>
</article>
</div>
<script type="text/javascript">
// $("#cc_page").on('click', '.search_r', function() {
// var search_r = $('a', this).attr('id');
// $.ajax({
// type: "GET",
// url: "../ticket/status/{{$tickets->id}}/" + search_r,
// beforeSend: function() {
// $("#refresh").hide();
// $("#loader").show();
// },
// success: function(response) {
// $("#refresh").load("../show-ticket/{!! $tickets->id !!}/{!! $token !!} #refresh");
// $("#refresh").show();
// $("#loader").hide();
// var message = response;
// $("#alert11").show();
// $('#message-success1').html(message);
// setInterval(function() {
// $("#alert11").hide();
// }, 4000);
// }
// });
// return false;
// });
$("#cc_page").on('click', '.search_r', function () {
var search_r = $('a', this).attr('id');
$.ajax({
type: "GET",
url: "../../show/change-status/"+ id +"/"+ {!! $tickets->id !!},
beforeSend: function () {
$("#refresh").hide();
$("#loader").show();
},
success: function (response) {
$("#refresh").load("../show-ticket/{!! $tickets->id !!}/{!! $token !!} #refresh");
$("#refresh").show();
$("#loader").hide();
var message = response;
$("#alert11").show();
$('#message-success1').html(message);
setInterval(function () {
$("#alert11").hide();
}, 4000);
}
});
return false;
});
$(function() {
//Add text editor
$("textarea").summernote({
height: 300,
tabsize: 2,
toolbar: [
['style', ['bold', 'italic', 'underline', 'clear']],
['font', ['strikethrough', 'superscript', 'subscript']],
['fontsize', ['fontsize']],
['color', ['color']],
['para', ['ul', 'ol', 'paragraph']],
['height', ['height']]
]
});
});
$(document).ready(function() {
var Data = $('input[name="rating"]:checked').val();
@@ -473,5 +595,97 @@ foreach ($conversations as $conversation) {
})
return false;
}
jQuery(document).ready(function () {
// Close a ticket
$('#close').on('click', function (e) {
$.ajax({
type: "POST",
url: "../../show/close/{!! $tickets->id !!}",
data:{"_token": "{{ csrf_token() }}"},
beforeSend: function () {
$("#refresh").hide();
$("#loader").show();
},
success: function (response) {
$("#refresh").load("../../show-ticket/{!! $tickets->id !!}/{!! $token !!} #refresh");
$("#refresh").show();
$("#loader").hide();
// $("#d1").trigger("click");
// var message = "Success! Your Ticket have been Closed";
// $("#alert11").show();
// $('#message-success1').html(message);
// setInterval(function(){
// $("#alert11").hide();
// setTimeout(function() {
// var link = document.querySelector('#load-inbox');
// if(link) {
// link.click();
// }
// }, 500);
// },2000);
}
})
return false;
});
// Resolved a ticket
$('#resolved').on('click', function (e) {
$.ajax({
type: "POST",
url: "../../show/resolve/{!! $tickets->id !!}",
data:{"_token": "{{ csrf_token() }}"},
beforeSend: function () {
$("#refresh").hide();
$("#loader").show();
},
success: function (response) {
$("#refresh").load("../../show-ticket/{!! $tickets->id !!}/{!! $token !!} #refresh");
$("#refresh").show();
$("#loader").hide();
var message = "Success! Your Ticket have been Resolved";
$("#alert11").show();
$('#message-success1').html(message);
setInterval(function () {
$("#alert11").hide();
setTimeout(function () {
var link = document.querySelector('#load-inbox');
if (link) {
link.click();
}
}, 500);
}, 2000);
}
})
return false;
});
// Open a ticket
$('#open').on('click', function (e) {
$.ajax({
type: "POST",
url: "../../show/open/{!! $tickets->id !!}",
data:{"_token": "{{ csrf_token() }}"},
beforeSend: function () {
$("#refresh").hide();
$("#loader").show();
},
success: function (response) {
$("#refresh").load("../../show-ticket/{!! $tickets->id !!}/{!! $token !!} #refresh");
$("#refresh").show();
$("#loader").hide();
var message = "Success! Your Ticket have been Opened";
$("#alert11").show();
$('#message-success1').html(message);
setInterval(function () {
$("#alert11").hide();
}, 4000);
}
})
return false;
});
});
</script>
@stop

View File

@@ -138,7 +138,7 @@ $category_id = $all->pluck('category_id')->toArray();
<div class="col-md-4" style="border:#f4f4f4;">
<div data-v-43e70d45="" class="banner-wrapper user-data text-center clearfix" id="ban_ner" style="border-width: 5px 1px 1px; border-style: solid; border-color: rgb(0, 154, 186); border-image: initial; width: 90%" >
<img id="user_avatar" src="{{Auth::user()->profile_pic}}" class="avatar" alt="User Image" style="margin-left: 5% ">
<div STYLE="margin-left:5%"><strong>Hello</strong></div>
<div STYLE="margin-left:5%"><strong>{{trans('lang.hello')}}</strong></div>
<p class="banner-title ellipsize_first_name h4" STYLE="margin-left: 5%">{{Auth::user()->first_name." ".Auth::user()->last_name}}</p>
<div class="banner-content" id="dropdown_content">
<p data-v-43e70d45="">If you are not? </p>
@@ -254,9 +254,22 @@ $category_id = $all->pluck('category_id')->toArray();
$(".form-group").removeClass("has-error");
// Perform your custom validation here
var name = $("#comment-name").val().trim();
var email = $("#comment-email").val().trim();
var comment = $("#comment-comment").val().trim();
var nameElement = $("#comment-name");
var emailElement = $("#comment-email");
var commentElement = $("#comment-comment");
if (nameElement.length > 0) {
var name = nameElement.val().trim();
}
if (emailElement.length > 0) {
var email = emailElement.val().trim();
}
if (commentElement.length > 0) {
var comment = commentElement.val().trim();
}
// Flag to track if there are any errors
var hasErrors = false;

View File

@@ -160,7 +160,11 @@
</ul>
</li>
<?php $pages = App\Model\kb\Page::where('status', '1')->where('visibility', '1')->get();
<?php
if(!Auth::check() || Auth::user()->role == 'user')
$pages = App\Model\kb\Page::where('status', '1')->where('visibility', '1')->get();
else
$pages = App\Model\kb\Page::where('status', '1')->get();
?>
@if(count($pages))
<li @yield('pages') class="nav-item dropdown">
@@ -191,7 +195,7 @@
<img id="user_avatar" src="{{Auth::user()->profile_pic}}"class="avatar" alt="User Image" height="70" width="70"/>
<div><strong>Hello</strong></div>
<div><strong>{{trans('lang.hello')}}</strong></div>
<p class="banner-title ellipsize_first_name h4">{{Auth::user()->first_name." ".Auth::user()->last_name}}</p>
@@ -312,12 +316,12 @@
<div id="header-search" class="site-search clearfix" style="margin-right: 90%; width: 100%"><!-- #header-search -->
{!!Form::open(['route' => 'client.search','class'=>'search-form clearfix'])!!}
<div class="form-border" style="z-index: 0;width: 95%;">
<div class="form-inline">
<div class="form-group input-group" style="width: 100%;">
<input type="text" name="s" class="search-field form-control input-lg mr-3" title="Enter search term" placeholder="Have a question? Type your search term here..." required>
<div class="form-border" style="z-index: 0;width: 85%;">
<div class="form-inline ">
<div class="form-group input-group " style="width: 98% ">
<input type="text" name="s" class="search-field form-control" title="Enter search term" placeholder="{{trans('lang.have_a_question?_type_your_search_term_here')}}" required="" style="width: 80%">
<span class="input-group-btn">
<button type="submit" class="btn btn-custom btn-md" style="border-color: rgb(0, 192, 239); background-color: rgb(0, 154, 186);">Search</button>
<button type="submit" class="btn btn-custom btn-md " style="margin-left: 20% ;background-color: #009aba; hov: #00c0ef; color: #fff ">{{trans('lang.search')}}</button>
</span>
</div>
</div><!----><!----></div>

View File

@@ -44,7 +44,7 @@ class="nav-link active"
<h3 class="card-title">{!! Lang::get('lang.list_of_templates_sets') !!}</h3>
<div class="card-tools">
<button class="btn btn-default btn-tool" data-toggle="modal" data-target="#create" title="Create" id="2create">
<i class="fas fa-plus"> </i> Create
<i class="fas fa-plus"> </i> {{Lang::get('lang.create')}}
</button>
</div>
</div><!-- /.box-header -->
@@ -134,7 +134,7 @@ class="nav-link active"
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
</div>
<div class="modal-body">
<span>Are you sure you want to Delete ?</span>
<span>{{Lang::get('lang.are_you_sure_you_want_to_delete')}}</span>&nbsp;
</div>
<div class="modal-footer justify-content-between">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>

View File

@@ -30,6 +30,29 @@ foreach($segments as $seg){
"sPaginationType": "full_numbers",
"bProcessing": true,
"lengthMenu": [[10, 25, 50, 100, 500], [10, 25, 50, 100, 500]],
"oLanguage": {
"sEmptyTable": "{!! Lang::get('datatables.sEmptyTable') !!}",
"sInfo": "{!! Lang::get('datatables.sInfo') !!}",
"sInfoEmpty": "{!! Lang::get('datatables.sInfoEmpty') !!}",
"sInfoFiltered": "{!! Lang::get('datatables.sInfoFiltered') !!}",
"sInfoPostFix": "{!! Lang::get('datatables.sInfoPostFix') !!}",
"sInfoThousands": "{!! Lang::get('datatables.sInfoThousands') !!}",
"sLengthMenu": "{!! Lang::get('datatables.sLengthMenu') !!}",
"sLoadingRecords": "{!! Lang::get('datatables.sLoadingRecords') !!}",
"sProcessing": "{!! Lang::get('datatables.sProcessing') !!}",
"sSearch": "{!! Lang::get('datatables.sSearch') !!}",
"sZeroRecords": "{!! Lang::get('datatables.sZeroRecords') !!}",
"oPaginate": {
"sFirst": "{!! Lang::get('datatables.oPaginate.sFirst') !!}",
"sLast": "{!! Lang::get('datatables.oPaginate.sLast') !!}",
"sNext": "{!! Lang::get('datatables.oPaginate.sNext') !!}",
"sPrevious": "{!! Lang::get('datatables.oPaginate.sPrevious') !!}"
},
"oAria": {
"sSortAscending": "{!! Lang::get('datatables.oAria.sSortAscending') !!}",
"sSortDescending": "{!! Lang::get('datatables.oAria.sortDescending') !!}"
},
},
"ajax": {
url: "{{url('filter')}}",
data: function (d) {

View File

@@ -26,6 +26,29 @@ foreach($segments as $seg){
"sPaginationType": "full_numbers",
"bProcessing": true,
"bServerSide": true,
"oLanguage": {
"sEmptyTable": "{!! Lang::get('datatables.sEmptyTable') !!}",
"sInfo": "{!! Lang::get('datatables.sInfo') !!}",
"sInfoEmpty": "{!! Lang::get('datatables.sInfoEmpty') !!}",
"sInfoFiltered": "{!! Lang::get('datatables.sInfoFiltered') !!}",
"sInfoPostFix": "{!! Lang::get('datatables.sInfoPostFix') !!}",
"sInfoThousands": "{!! Lang::get('datatables.sInfoThousands') !!}",
"sLengthMenu": "{!! Lang::get('datatables.sLengthMenu') !!}",
"sLoadingRecords": "{!! Lang::get('datatables.sLoadingRecords') !!}",
"sProcessing": "{!! Lang::get('datatables.sProcessing') !!}",
"sSearch": "{!! Lang::get('datatables.sSearch') !!}",
"sZeroRecords": "{!! Lang::get('datatables.sZeroRecords') !!}",
"oPaginate": {
"sFirst": "{!! Lang::get('datatables.oPaginate.sFirst') !!}",
"sLast": "{!! Lang::get('datatables.oPaginate.sLast') !!}",
"sNext": "{!! Lang::get('datatables.oPaginate.sNext') !!}",
"sPrevious": "{!! Lang::get('datatables.oPaginate.sPrevious') !!}"
},
"oAria": {
"sSortAscending": "{!! Lang::get('datatables.oAria.sSortAscending') !!}",
"sSortDescending": "{!! Lang::get('datatables.oAria.sortDescending') !!}"
},
},
"ajax": {
url: "{{url('user-list')}}",
data: function (d) {

View File

@@ -347,6 +347,7 @@ Route::middleware('web')->group(function () {
Route::post('/newticket/post', [Agent\helpdesk\TicketController::class, 'post_newticket'])->name('post.newticket'); /* Post Create New Ticket */
Route::get('/thread/{id}', [Agent\helpdesk\TicketController::class, 'thread'])->name('ticket.thread'); /* Get Thread by ID */
Route::get('ticket/tooltip', [Agent\helpdesk\TicketController::class, 'getTooltip'])->name('ticket.tooltip');
Route::post('/thread/reply/{id}', [Agent\helpdesk\TicketController::class, 'reply'])->name('ticket.reply'); /* Patch Thread Reply */
Route::patch('/internal/note/{id}', [Agent\helpdesk\TicketController::class, 'InternalNote'])->name('Internal.note'); /* Patch Internal Note */
@@ -525,7 +526,7 @@ Route::middleware('web')->group(function () {
Route::get('check_ticket/{id}', [Client\helpdesk\GuestController::class, 'get_ticket_email'])->name('check_ticket'); //detail ticket information
// show ticket via have a ticket
Route::get('show-ticket/{id}/{code}', [Client\helpdesk\UnAuthController::class, 'showTicketCode'])->name('show.ticket'); //detail ticket information
Route::get('show-ticket/{ids}/{code}', [Client\helpdesk\UnAuthController::class, 'showTicketCode'])->name('show.ticket'); //detail ticket information
//testing ckeditor
//===================================================================================
@@ -709,6 +710,10 @@ Route::middleware('web')->group(function () {
Route::post('show/rating/{id}', [Client\helpdesk\UnAuthController::class, 'rating'])->name('show.rating'); /* Get overall Ratings */
Route::post('show/rating2/{id}', [Client\helpdesk\UnAuthController::class, 'ratingReply'])->name('show.rating2'); /* Get reply Ratings */
Route::get('show/change-status/{status}/{id}', [Client\helpdesk\UnAuthController::class, 'changeStatus'])->name('show.change.status'); /* Get reply Ratings */
Route::post('show/close/{id}', [Client\helpdesk\UnAuthController::class, 'close'])->name('show.close'); /* Get reply Ratings */
Route::post('show/open/{id}', [Client\helpdesk\UnAuthController::class, 'open'])->name('show.open'); /* Get reply Ratings */
Route::post('show/resolve/{id}', [Client\helpdesk\UnAuthController::class, 'resolve'])->name('show.resolve'); /* Get reply Ratings */
/* get the home page */
Route::get('knowledgebase', [Client\kb\UserController::class, 'home'])->name('home');
/* get the faq value to user */
@@ -801,7 +806,11 @@ Route::middleware('web')->group(function () {
// });
Route::get('check_ticket/swtich-language/{id}', [Client\helpdesk\UnAuthController::class, 'changeUserLanguage']);
Route::get('category-list/swtich-language/{id}', [Client\helpdesk\UnAuthController::class, 'changeUserLanguage']);
Route::get('show/swtich-language/{id}', [Client\helpdesk\UnAuthController::class, 'changeUserLanguage']);
Route::get('show-ticket/{ids}/swtich-language/{id}', [Client\helpdesk\UnAuthController::class, 'changeLanguage']);
Route::get('pages/swtich-language/{id}', [Client\helpdesk\UnAuthController::class, 'changeUserLanguage'])->name('switch-user-lang');
Route::get('swtich-language/{id}', [Client\helpdesk\UnAuthController::class, 'changeUserLanguage'])->name('switch-user-lang');
Route::get('thread/swtich-language/{id}', [Client\helpdesk\UnAuthController::class, 'changeUserLanguage'])->name('switch-user-lang');
Route::get('ticket/swtich-language/{id}', [Client\helpdesk\UnAuthController::class, 'changeUserLanguage'])->name('switch-user-lang');
Route::get('social/swtich-language/{id}', [Client\helpdesk\UnAuthController::class, 'changeUserLanguage'])->name('switch-user-lang');
Route::get('language/swtich-language/{id}', [Client\helpdesk\UnAuthController::class, 'changeUserLanguage'])->name('switch-user-lang');
});

View File

@@ -0,0 +1,243 @@
<?php
namespace Tests\Unit;
use App\Http\Requests\kb\ArticleRequest;
use App\Http\Requests\kb\ArticleUpdate;
use App\Http\Requests\kb\CategoryRequest;
use App\Model\kb\Article;
use App\Model\kb\Category;
use App\Model\kb\Relationship;
use App\User;
use Faker\Factory as FakerFactory;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Lang;
use Illuminate\Support\Facades\Validator;
use Illuminate\Support\Str;
use Tests\TestCase;
class ArticleControllerTest extends TestCase
{
//use DatabaseTransactions;
protected $user; // Declare a user property
// Set up the authenticated user before each test
public function setUp(): void
{
parent::setUp();
$faker = FakerFactory::create();
//Create User -> Agent
//$str = Str::random(10);
$str = 'demopass';
$password = Hash::make($str);
$email = $faker->unique()->email();
$user = new User([
'first_name' => $faker->firstName(),
'last_name' => $faker->lastName(),
'email' => $email,
'user_name' => $faker->unique()->userName(),
'password' => $password,
'assign_group' => 1,
'primary_dpt' => 1,
'active' => 1,
'role' => 'agent',
'agent_tzone' => 81,
]);
$user->save();
// Check if data is inserted
$this->assertDatabaseHas('users', ['email'=>$email]);
// Authenticate as the created user
$this->actingAs($user);
$this->assertAuthenticated();
}
/** @test */
public function it_can_display_the_article_index_page()
{
$response = $this->get(route('article.index'));
$response->assertStatus(200);
}
public function testStoreArticleWithCategories()
{
// Create a Category model for testing
$data = [
'name' => 'Test Category',
'description' => 'Test Category Description',
];
$validator = Validator::make($data, (new CategoryRequest())->rules());
$this->assertTrue($validator->passes());
$response = $this->post(route('category.store'), $data);
$response->assertStatus(302);
$response->assertSessionHas('success');
$this->assertDatabaseHas('kb_category', $data);
$category = Category::latest()->first();
// Article data
$articleData = [
'name' => 'Test Article',
'description'=> 'Test Article Description',
'category_id'=> $category->id,
'year' => '2023',
'month' => '10',
'day' => '03',
'hour' => '12',
'minute' => '30',
];
$articleRequest = new ArticleRequest($articleData);
// Act
try {
$validator = Validator::make($articleData, (new ArticleRequest())->rules());
$this->assertTrue($validator->passes());
$response = $this->post(route('article.store'), $articleData);
$response->assertStatus(200);
} catch (Exception $e) {
$response = null;
}
// Assert
if ($response) {
$response->assertStatus(200); // Check if the response status code is a redirect (302)
$article = Article::latest()->first();
$article_relationship = new Relationship();
$article_relationship->category_id = $category->id;
$article_relationship->article_id = $article->id;
$article_relationship->save();
// Verify that the article was created and the category relationship exists
$this->assertDatabaseHas('kb_article', [
'name' => $articleData['name'],
'slug' => Str::slug($articleData['name'], '-'),
'publish_time' => $articleData['year'].'-'.$articleData['month'].'-'.$articleData['day'].' '.$articleData['hour'].':'.$articleData['minute'].':00',
]);
// Check if the category relationship exists
$this->assertDatabaseHas('kb_article_relationship', [
'category_id' => $category->id,
'article_id' => Article::latest()->first()->id, // Get the ID of the latest created article
]);
} else {
$this->fail('Exception thrown: '.$e->getMessage());
}
}
public function testEditArticle()
{
// Arrange
$article = Article::latest()->first(); // Create a sample Article for testing
$relationship = Relationship::latest()->first(); // Create a sample Relationship for testing
$category = Category::latest()->first(); // Create a sample Category for testing
$assign = $relationship->where('article_id', 'id')->pluck('category_id');
$category = $category->pluck('id', 'name');
$response = $this->get(
"/article/{$article->id}/edit",
['category' => $category,
'article' => $article,
'assign' => $assign,
]
);
$response->assertStatus(200);
}
public function testUpdateArticle()
{
$article = Article::latest()->first();
$category = Category::latest()->first();
$data = [
'id' => $article->id,
'name' => 'Updated Article Name',
'description' => 'Updated Description',
'slug' => Str::slug('Updated Article Name', '-'),
'category_id' => [1, 2],
'year' => '2023',
'month' => '10',
'day' => '03',
'hour' => '2',
'minute' => '20',
];
$validator = Validator::make($data, (new ArticleUpdate())->rules());
$this->assertTrue($validator->passes());
$response = $this->put(route('article.update', $article->id), $data);
$response->assertStatus(302);
$article_relationship = Relationship::latest()->first();
$article_relationship = $article_relationship->where('article_id', $article->id);
$article_relationship->delete();
$article = Article::latest()->first();
$relation = new Relationship();
$relation->category_id = $category->id;
$relation->article_id = $article->id;
$relation->save();
}
/** @test */
public function it_can_delete_a_category()
{
// Create a sample article, relationship
$article = Article::latest()->first();
$relationship = Relationship::find($article->id);
// Ensure the destroy route works as expected
$response = $this->get("/article/delete/{$article->slug}");
// Assert that success message is flashed
$response->assertSessionHas('success', Lang::get('lang.article_deleted_successfully'));
// Create a category
$category = Category::latest()->first();
// Create a related relationship (you may need to adjust this based on your actual relationships)
$relation = Relationship::find($category->id);
// Call the destroy method with the category ID
$response = $this->get("/category/delete/{$category->id}");
// Assert that the category is deleted from the database
$this->assertDatabaseMissing('kb_category', ['id' => $category->id]);
}
public function it_cannot_delete_a_article_if_related()
{
// Create a category
$article = Article::find(1);
// Call the destroy method with the category ID (without creating related records)
$response = $this->get("/article/delete/{$article->slug}");
// Assert that the category is not deleted from the database
$this->assertDatabaseHas('kb_article', ['id' => $article->id]);
// Assert that the response is a redirect
$response->assertRedirect();
// Assert that the response has a failure message
$response->assertSessionHas('fails', Lang::get('lang.article_not_deleted'));
}
}

View File

@@ -0,0 +1,233 @@
<?php
namespace Tests\Unit;
use App\Http\Requests\kb\CategoryRequest;
use App\Model\kb\Category;
use App\Model\kb\Relationship;
use App\User;
use Faker\Factory as FakerFactory;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Lang;
use Illuminate\Support\Facades\Validator;
use Illuminate\Support\Str;
use Tests\TestCase;
class CategoryControllerTest extends TestCase
{
//use DatabaseTransactions;
protected $user; // Declare a user property
// Set up the authenticated user before each test
public function setUp(): void
{
parent::setUp();
$faker = FakerFactory::create();
//Create User -> Agent
//$str = Str::random(10);
$str = 'demopass';
$password = Hash::make($str);
$email = $faker->unique()->email();
$user = new User([
'first_name' => $faker->firstName(),
'last_name' => $faker->lastName(),
'email' => $email,
'user_name' => $faker->unique()->userName(),
'password' => $password,
'assign_group' => 1,
'primary_dpt' => 1,
'active' => 1,
'role' => 'agent',
'agent_tzone' => 81,
]);
$user->save();
// Check if data is inserted
$this->assertDatabaseHas('users', ['email'=>$email]);
// Authenticate as the created user
$this->actingAs($user);
$this->assertAuthenticated();
}
/** @test */
public function it_can_display_the_category_index_page()
{
$response = $this->get(route('category.index'));
$response->assertStatus(200);
}
public function testValidationPasses()
{
$data = [
'name' => 'New Category',
'description' => 'Category Description',
];
$validator = Validator::make($data, (new CategoryRequest())->rules());
$this->assertTrue($validator->passes());
$response = $this->post(route('category.store'), $data);
$response->assertStatus(302);
$response->assertSessionHas('success');
$this->assertDatabaseHas('kb_category', $data);
}
public function testValidationFailsWhenNameMissing()
{
$data = [
'description' => 'Category Description',
];
$validator = Validator::make($data, (new CategoryRequest())->rules());
$this->assertFalse($validator->passes());
$this->assertTrue($validator->fails());
$this->assertTrue($validator->errors()->has('name'));
}
public function testValidationFailsWhenNameExceedsMaxLength()
{
$data = [
'name' => str_repeat('A', 251),
'description' => 'Category Description',
];
$validator = Validator::make($data, (new CategoryRequest())->rules());
$this->assertFalse($validator->passes());
$this->assertTrue($validator->fails());
$this->assertTrue($validator->errors()->has('name'));
}
public function testValidationFailsWhenNameNotUnique()
{
$data = [
'name' => 'Greetings',
'description' => 'Category Description',
];
$validator = Validator::make($data, (new CategoryRequest())->rules());
$this->assertFalse($validator->passes());
$this->assertTrue($validator->fails());
$this->assertTrue($validator->errors()->has('name'));
}
public function testValidationFailsWhenDescriptionMissing()
{
$data = [
'name' => 'New Category',
];
$validator = Validator::make($data, (new CategoryRequest())->rules());
$this->assertFalse($validator->passes());
$this->assertTrue($validator->fails());
$this->assertTrue($validator->errors()->has('description'));
}
public function testEditCategory()
{
$category = Category::latest()->first();
$categories = Category::pluck('name', 'id')->toArray();
$response = $this->get(
"/category/{$category->id}/edit",
['category' => $category,
'categories' => $categories,
]
);
$response->assertStatus(200);
}
/** @test */
public function it_can_update_an_existing_category()
{
// Retrieve an existing category from the database
$category = Category::latest()->first();
$data = [
'name' => 'Updated Category Name',
'description' => 'Updated Description',
];
$validator = Validator::make($data, (new CategoryRequest())->rules());
$this->assertTrue($validator->passes());
$response = $this->put(route('category.update', $category->id), $data);
$response->assertStatus(302);
$response->assertSessionHas('success');
$this->assertDatabaseHas('kb_category', $data);
}
/** @test */
public function it_cannot_update_an_existing_category()
{
// Retrieve an existing category from the database
$category = Category::latest()->first();
$data = [
'name' => 'Greetings',
'description' => 'Updated Description',
];
$validator = Validator::make($data, (new CategoryRequest())->rules());
$this->assertFalse($validator->passes());
$response = $this->put(route('category.update', $category->id), $data);
$response->assertStatus(302);
$this->assertTrue($validator->fails());
$this->assertTrue($validator->errors()->has('name'));
}
/** @test */
public function it_can_delete_a_category()
{
// Create a category
$category = Category::latest()->first();
// Create a related relationship (you may need to adjust this based on your actual relationships)
$relation = Relationship::find($category->id);
// Call the destroy method with the category ID
$response = $this->get("/category/delete/{$category->id}");
// Assert that the category is deleted from the database
$this->assertDatabaseMissing('kb_category', ['id' => $category->id]);
// Assert that the response is a redirect
$response->assertRedirect();
// Assert that the response has a success message
$response->assertSessionHas('success', Lang::get('lang.category_deleted_successfully'));
}
/** @test */
public function it_cannot_delete_a_category_if_related()
{
// Create a category
$category = Category::find(1);
// Call the destroy method with the category ID (without creating related records)
$response = $this->get("/category/delete/{$category->id}");
// Assert that the category is not deleted from the database
$this->assertDatabaseHas('kb_category', ['id' => $category->id]);
// Assert that the response is a redirect
$response->assertRedirect();
// Assert that the response has a failure message
$response->assertSessionHas('fails', Lang::get('lang.category_not_deleted'));
}
}

View File

@@ -0,0 +1,184 @@
<?php
namespace Tests\Unit;
use App\Http\Requests\kb\PageRequest;
use App\Model\kb\Page;
use App\User;
use Faker\Factory as FakerFactory;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Validator;
use Tests\TestCase;
class PageControllerTest extends TestCase
{
use DatabaseTransactions;
protected $user; // Declare a user property
// Set up the authenticated user before each test
public function setUp(): void
{
parent::setUp();
$faker = FakerFactory::create();
//Create User -> Agent
//$str = Str::random(10);
$str = 'demopass';
$password = Hash::make($str);
$email = $faker->unique()->email();
$user = new User([
'first_name' => $faker->firstName(),
'last_name' => $faker->lastName(),
'email' => $email,
'user_name' => $faker->unique()->userName(),
'password' => $password,
'assign_group' => 1,
'primary_dpt' => 1,
'active' => 1,
'role' => 'agent',
'agent_tzone' => 81,
]);
$user->save();
// Check if data is inserted
$this->assertDatabaseHas('users', ['email'=>$email]);
// Authenticate as the created user
$this->actingAs($user);
$this->assertAuthenticated();
}
/** @test */
public function it_can_display_the_page_index_page()
{
$response = $this->get(route('page.index'));
$response->assertStatus(200);
}
public function testCreateMethod()
{
$response = $this->get('/page/create');
$response->assertStatus(200);
}
public function testValidationPasses()
{
$data = [
'name' => 'New Page',
'description' => 'Page Description',
];
$validator = Validator::make($data, (new PageRequest())->rules());
$this->assertTrue($validator->passes());
$response = $this->post(route('page.store'), $data);
$response->assertStatus(302);
$response->assertSessionHas('success');
$this->assertDatabaseHas('kb_pages', $data);
}
public function testValidationFailsWhenNameMissing()
{
$data = [
'description' => 'Page Description',
];
$validator = Validator::make($data, (new PageRequest())->rules());
$this->assertFalse($validator->passes());
$this->assertTrue($validator->fails());
$this->assertTrue($validator->errors()->has('name'));
}
public function testValidationFailsWhenNameNotUnique()
{
$data = [
'name' => 'Page1',
'description' => 'Page Description',
];
$validator = Validator::make($data, (new PageRequest())->rules());
$this->assertFalse($validator->passes());
$this->assertTrue($validator->fails());
$this->assertTrue($validator->errors()->has('name'));
}
public function testValidationFailsWhenDescriptionMissing()
{
$data = [
'name' => 'New',
];
$validator = Validator::make($data, (new PageRequest())->rules());
$this->assertFalse($validator->passes());
$this->assertTrue($validator->fails());
$this->assertTrue($validator->errors()->has('description'));
}
public function testEditPage()
{
$page = Page::latest()->first();
$response = $this->get('/page/'.$page->id.'/edit');
$response->assertStatus(200);
}
public function testUpdatePage()
{
$page = Page::latest()->first();
$data = [
'name' => 'Updated Page Name',
'description' => 'Updated Description',
];
$validator = Validator::make($data, (new PageRequest())->rules());
$this->assertTrue($validator->passes());
$response = $this->put('/page/'.$page->id, $data);
$response->assertStatus(302); // Assuming a successful update redirects
$this->assertDatabaseHas('kb_pages', $data);
// You can add more assertions as needed.
}
public function testCannotUpdatePage()
{
$page = Page::latest()->first();
$data = [
'name' => 'Page1',
'description' => 'Updated Description',
];
$validator = Validator::make($data, (new PageRequest())->rules());
$this->assertFalse($validator->passes());
$response = $this->put('/page/'.$page->id, $data);
$response->assertStatus(302);
$this->assertTrue($validator->fails());
$this->assertTrue($validator->errors()->has('name'));
}
public function testDestroyMethod()
{
$page = Page::latest()->first();
$response = $this->delete('/page/'.$page->id);
$response->assertStatus(302); // Assuming a successful deletion redirects
$this->assertDatabaseMissing('kb_pages', ['id' => $page->id]);
// You can add more assertions as needed.
}
}

View File

@@ -13,12 +13,12 @@ use Tests\TestCase;
class TicketControllerTest extends TestCase
{
use DatabaseTransactions;
/**
* A basic unit test example.
*
* @return void
*/
public function test_user_change_the_status()
{
$str = 'Demopass@1';
@@ -49,10 +49,12 @@ class TicketControllerTest extends TestCase
'source' => 1,
]
);
$ticket->save();
$ticket->dept_id = 1;
$ticket->save();
$ticket_thread = new Ticket_Thread(
[
'ticket_id' => $ticket->id,
@@ -69,7 +71,6 @@ class TicketControllerTest extends TestCase
$response = $this->post(route('select_all'), [
'select_all' => [$ticket->id],
'submit' => 'Open',
]);
@@ -87,5 +88,6 @@ class TicketControllerTest extends TestCase
$response->assertStatus(302); // Adjust this as needed
$this->assertEquals(3, $ticket->fresh()->status); // Adjust this as needed
$response->assertSessionHas('success', Lang::get('lang.tickets_have_been_closed'));
}
}