update v1.0.7.5
This commit is contained in:
@@ -141,7 +141,7 @@ class AgentController extends Controller
|
||||
$email = $user->email;
|
||||
try {
|
||||
// send mail on registration
|
||||
$this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('1', '0'), $to = ['name' => $name, 'email' => $email], $message = ['subject' => 'Password', 'scenario' => 'registration-notification'], $template_variables = ['user' => $name, 'email_address' => $email, 'user_password' => $password]);
|
||||
$this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('1', '0'), $to = ['name' => $name, 'email' => $email], $message = ['subject' => null, 'scenario' => 'registration-notification'], $template_variables = ['user' => $name, 'email_address' => $email, 'user_password' => $password]);
|
||||
} catch (Exception $e) {
|
||||
// returns if try fails
|
||||
return redirect('agents')->with('warning', Lang::get('lang.agent_send_mail_error_on_agent_creation'));
|
||||
|
@@ -143,7 +143,7 @@ class DepartmentController extends Controller
|
||||
public function edit($id, User $user, Group_assign_department $group_assign_department, Template $template, Teams $team, Department $department, Sla_plan $sla, Emails $email, Groups $group)
|
||||
{
|
||||
try {
|
||||
$sys_department = \DB::table('settings_system')
|
||||
$sys_department = \DB::table('settings_system')
|
||||
->select('department')
|
||||
->where('id', '=', 1)
|
||||
->first();
|
||||
@@ -175,6 +175,7 @@ class DepartmentController extends Controller
|
||||
{
|
||||
// dd($id);
|
||||
try {
|
||||
|
||||
$table = $group_assign_department->where('department_id', $id);
|
||||
$table->delete();
|
||||
$requests = $request->input('group_id');
|
||||
|
@@ -28,15 +28,14 @@ use Lang;
|
||||
*
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class EmailsController extends Controller
|
||||
{
|
||||
class EmailsController extends Controller {
|
||||
|
||||
/**
|
||||
* Defining constructor variables.
|
||||
*
|
||||
* @return type
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
public function __construct() {
|
||||
$this->middleware('auth');
|
||||
$this->middleware('roles');
|
||||
}
|
||||
@@ -48,8 +47,7 @@ class EmailsController extends Controller
|
||||
*
|
||||
* @return type view
|
||||
*/
|
||||
public function index(Emails $email)
|
||||
{
|
||||
public function index(Emails $email) {
|
||||
try {
|
||||
// fetch all the emails from emails table
|
||||
$emails = $email->get();
|
||||
@@ -70,8 +68,7 @@ class EmailsController extends Controller
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function create(Department $department, Help_topic $help, Ticket_Priority $ticket_priority, MailboxProtocol $mailbox_protocol)
|
||||
{
|
||||
public function create(Department $department, Help_topic $help, Ticket_Priority $ticket_priority, MailboxProtocol $mailbox_protocol) {
|
||||
try {
|
||||
// fetch all the departments from the department table
|
||||
$departments = $department->get();
|
||||
@@ -96,17 +93,16 @@ class EmailsController extends Controller
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function validatingEmailSettings(Request $request)
|
||||
{
|
||||
public function validatingEmailSettings(Request $request) {
|
||||
$validator = \Validator::make(
|
||||
[
|
||||
'email_address' => $request->input('email_address'),
|
||||
'email_name' => $request->input('email_name'),
|
||||
'password' => $request->input('password'),
|
||||
'email_name' => $request->input('email_name'),
|
||||
'password' => $request->input('password'),
|
||||
], [
|
||||
'email_address' => 'required|email|unique:emails',
|
||||
'email_name' => 'required',
|
||||
'password' => 'required',
|
||||
'email_name' => 'required',
|
||||
'password' => 'required',
|
||||
]
|
||||
);
|
||||
if ($validator->fails()) {
|
||||
@@ -177,8 +173,7 @@ class EmailsController extends Controller
|
||||
*
|
||||
* @return type Redirect
|
||||
*/
|
||||
public function store($request, $imap_check)
|
||||
{
|
||||
public function store($request, $imap_check) {
|
||||
$email = new Emails();
|
||||
try {
|
||||
// saving all the fields to the database
|
||||
@@ -260,8 +255,7 @@ class EmailsController extends Controller
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function edit($id, Department $department, Help_topic $help, Emails $email, Ticket_Priority $ticket_priority, MailboxProtocol $mailbox_protocol)
|
||||
{
|
||||
public function edit($id, Department $department, Help_topic $help, Emails $email, Ticket_Priority $ticket_priority, MailboxProtocol $mailbox_protocol) {
|
||||
try {
|
||||
$sys_email = \DB::table('settings_email')->select('sys_email')->where('id', '=', 1)->first();
|
||||
// dd($sys_email);
|
||||
@@ -292,17 +286,16 @@ class EmailsController extends Controller
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function validatingEmailSettingsUpdate($id, Request $request)
|
||||
{
|
||||
public function validatingEmailSettingsUpdate($id, Request $request) {
|
||||
$validator = \Validator::make(
|
||||
[
|
||||
'email_address' => $request->input('email_address'),
|
||||
'email_name' => $request->input('email_name'),
|
||||
'password' => $request->input('password'),
|
||||
'email_name' => $request->input('email_name'),
|
||||
'password' => $request->input('password'),
|
||||
], [
|
||||
'email_address' => 'email',
|
||||
'email_name' => 'required',
|
||||
'password' => 'required',
|
||||
'email_name' => 'required',
|
||||
'password' => 'required',
|
||||
]
|
||||
);
|
||||
if ($validator->fails()) {
|
||||
@@ -375,8 +368,7 @@ class EmailsController extends Controller
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function update($id, $request, $imap_check)
|
||||
{
|
||||
public function update($id, $request, $imap_check) {
|
||||
try {
|
||||
// fetch the selected emails
|
||||
$emails = Emails::whereId($id)->first();
|
||||
@@ -426,12 +418,12 @@ class EmailsController extends Controller
|
||||
// $emails->password = Crypt::encrypt($request->input('password'));
|
||||
$emails->save();
|
||||
//dd($request->sys_email);
|
||||
if ($request->sys_email == 'on') {
|
||||
if($request->sys_email == 'on') {
|
||||
$system = \DB::table('settings_email')
|
||||
->where('id', '=', 1)
|
||||
->update(['sys_email' => $id]);
|
||||
} elseif ($request->input('count') <= 1 && $request->sys_email == null) {
|
||||
$system = \DB::table('settings_email')
|
||||
$system = \DB::table('settings_email')
|
||||
->where('id', '=', 1)
|
||||
->update(['sys_email' => null]);
|
||||
}
|
||||
@@ -453,8 +445,7 @@ class EmailsController extends Controller
|
||||
*
|
||||
* @return type Redirect
|
||||
*/
|
||||
public function destroy($id, Emails $email)
|
||||
{
|
||||
public function destroy($id, Emails $email) {
|
||||
// fetching the details on the basis of the $id passed to the function
|
||||
$default_system_email = Email::where('id', '=', '1')->first();
|
||||
if ($default_system_email->sys_email) {
|
||||
@@ -485,26 +476,25 @@ class EmailsController extends Controller
|
||||
*
|
||||
* @return type int
|
||||
*/
|
||||
public function getImapStream($request, $validate)
|
||||
{
|
||||
public function getImapStream($request, $validate) {
|
||||
$fetching_status = $request->input('fetching_status');
|
||||
$username = $request->input('email_address');
|
||||
$password = $request->input('password');
|
||||
$protocol_id = $request->input('mailbox_protocol');
|
||||
$fetching_protocol = '/'.$request->input('fetching_protocol');
|
||||
$fetching_encryption = '/'.$request->input('fetching_encryption');
|
||||
$fetching_protocol = '/' . $request->input('fetching_protocol');
|
||||
$fetching_encryption = '/' . $request->input('fetching_encryption');
|
||||
if ($fetching_encryption == '/none') {
|
||||
$fetching_encryption2 = '/novalidate-cert';
|
||||
$mailbox_protocol = $fetching_encryption2;
|
||||
$host = $request->input('fetching_host');
|
||||
$port = $request->input('fetching_port');
|
||||
$mailbox = '{'.$host.':'.$port.$mailbox_protocol.'}INBOX';
|
||||
$mailbox = '{' . $host . ':' . $port . $mailbox_protocol . '}INBOX';
|
||||
} else {
|
||||
$mailbox_protocol = $fetching_protocol.$fetching_encryption;
|
||||
$mailbox_protocol = $fetching_protocol . $fetching_encryption;
|
||||
$host = $request->input('fetching_host');
|
||||
$port = $request->input('fetching_port');
|
||||
$mailbox = '{'.$host.':'.$port.$mailbox_protocol.$validate.'}INBOX';
|
||||
$mailbox_protocol = $fetching_encryption.$validate;
|
||||
$mailbox = '{' . $host . ':' . $port . $mailbox_protocol . $validate . '}INBOX';
|
||||
$mailbox_protocol = $fetching_encryption . $validate;
|
||||
}
|
||||
try {
|
||||
$imap_stream = imap_open($mailbox, $username, $password);
|
||||
@@ -528,8 +518,7 @@ class EmailsController extends Controller
|
||||
*
|
||||
* @return type int
|
||||
*/
|
||||
public function checkImapStream($imap_stream)
|
||||
{
|
||||
public function checkImapStream($imap_stream) {
|
||||
$check_imap_stream = imap_check($imap_stream);
|
||||
if ($check_imap_stream) {
|
||||
$imap_stream = 1;
|
||||
@@ -547,8 +536,7 @@ class EmailsController extends Controller
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getSmtp($request)
|
||||
{
|
||||
public function getSmtp($request) {
|
||||
$sending_status = $request->input('sending_status');
|
||||
// cheking for the sending protocol
|
||||
if ($request->input('sending_protocol') == 'smtp') {
|
||||
@@ -564,8 +552,8 @@ class EmailsController extends Controller
|
||||
$mail->SMTPAuth = true; // Enable SMTP authentication
|
||||
$mail->SMTPOptions = [
|
||||
'ssl' => [
|
||||
'verify_peer' => false,
|
||||
'verify_peer_name' => false,
|
||||
'verify_peer' => false,
|
||||
'verify_peer_name' => false,
|
||||
'allow_self_signed' => true,
|
||||
],
|
||||
];
|
||||
@@ -597,8 +585,7 @@ class EmailsController extends Controller
|
||||
*
|
||||
* @return type string or null
|
||||
*/
|
||||
public function departmentValue($dept)
|
||||
{
|
||||
public function departmentValue($dept) {
|
||||
if ($dept) {
|
||||
$email_department = $dept;
|
||||
} else {
|
||||
@@ -615,8 +602,7 @@ class EmailsController extends Controller
|
||||
*
|
||||
* @return type string or null
|
||||
*/
|
||||
public function priorityValue($priority)
|
||||
{
|
||||
public function priorityValue($priority) {
|
||||
if ($priority) {
|
||||
$email_priority = $priority;
|
||||
} else {
|
||||
@@ -633,8 +619,7 @@ class EmailsController extends Controller
|
||||
*
|
||||
* @return type string or null
|
||||
*/
|
||||
public function helpTopicValue($help_topic)
|
||||
{
|
||||
public function helpTopicValue($help_topic) {
|
||||
if ($help_topic) {
|
||||
$email_help_topic = $help_topic;
|
||||
} else {
|
||||
@@ -643,4 +628,5 @@ class EmailsController extends Controller
|
||||
|
||||
return $email_help_topic;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -3,21 +3,22 @@
|
||||
namespace App\Http\Controllers\Admin\helpdesk;
|
||||
|
||||
// controller
|
||||
use App\Http\Controllers\Common\PhpMailController;
|
||||
use App\Http\Controllers\Controller;
|
||||
// request
|
||||
|
||||
use Exception;
|
||||
use File;
|
||||
use Lang;
|
||||
use File;
|
||||
|
||||
/**
|
||||
* ErrorAndDebuggingController.
|
||||
* ErrorAndDebuggingController
|
||||
*
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class ErrorAndDebuggingController extends Controller
|
||||
{
|
||||
/**
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
@@ -30,76 +31,68 @@ class ErrorAndDebuggingController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* function to show error and debugging setting page.
|
||||
*
|
||||
* function to show error and debugging setting page
|
||||
* @param void
|
||||
*
|
||||
* @return response
|
||||
* @return response
|
||||
*/
|
||||
public function showSettings()
|
||||
{
|
||||
$debug = \Config::get('app.debug');
|
||||
$bugsnag = \Config::get('app.bugsnag_reporting');
|
||||
public function showSettings()
|
||||
{
|
||||
$debug = \Config::get('app.debug');
|
||||
$bugsnag = \Config::get('app.bugsnag_reporting');
|
||||
return view('themes.default1.admin.helpdesk.settings.error-and-logs.error-debug')->with(['debug'=> $debug, 'bugsnag' => $bugsnag]);
|
||||
}
|
||||
|
||||
return view('themes.default1.admin.helpdesk.settings.error-and-logs.error-debug')->with(['debug' => $debug, 'bugsnag' => $bugsnag]);
|
||||
}
|
||||
|
||||
/**
|
||||
* funtion to update error and debugging settings.
|
||||
*
|
||||
* @param void
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public function postSettings()
|
||||
{
|
||||
try {
|
||||
$debug = \Config::get('app.debug');
|
||||
$debug = ($debug) ? 'true' : 'false';
|
||||
$bugsnag_debug = \Config::get('app.bugsnag_reporting');
|
||||
$bugsnag_debug = ($bugsnag_debug) ? 'true' : 'false';
|
||||
if ($debug != \Input::get('debug') || $bugsnag_debug != \Input::get('bugsnag')) {
|
||||
// dd($request->input());
|
||||
$debug_new = base_path()
|
||||
.DIRECTORY_SEPARATOR.
|
||||
'config'
|
||||
.DIRECTORY_SEPARATOR.
|
||||
'app.php';
|
||||
$datacontent = File::get($debug_new);
|
||||
$datacontent = str_replace("'debug' => ".$debug,
|
||||
"'debug' => ".\Input::get('debug'),
|
||||
$datacontent);
|
||||
File::put($debug_new, $datacontent);
|
||||
|
||||
// dd($request->input());
|
||||
$bugsnag_debug_new = base_path()
|
||||
.DIRECTORY_SEPARATOR.
|
||||
'config'
|
||||
.DIRECTORY_SEPARATOR.
|
||||
'app.php';
|
||||
$datacontent2 = File::get($bugsnag_debug_new);
|
||||
$datacontent2 = str_replace("'bugsnag_reporting' => ".$bugsnag_debug,
|
||||
"'bugsnag_reporting' => ".\Input::get('bugsnag'),
|
||||
$datacontent2);
|
||||
File::put($bugsnag_debug_new, $datacontent2);
|
||||
|
||||
return redirect()->back()->with('success',
|
||||
Lang::get('lang.error-debug-settings-saved-message'));
|
||||
} else {
|
||||
return redirect()->back()->with('fails',
|
||||
Lang::get('lang.error-debug-settings-error-message'));
|
||||
}
|
||||
/**
|
||||
* funtion to update error and debugging settings
|
||||
* @param void
|
||||
* @return
|
||||
*/
|
||||
public function postSettings()
|
||||
{
|
||||
try{
|
||||
$debug = \Config::get('app.debug');
|
||||
$debug = ($debug) ? 'true' : 'false';
|
||||
$bugsnag_debug = \Config::get('app.bugsnag_reporting');
|
||||
$bugsnag_debug = ($bugsnag_debug) ? 'true' : 'false';
|
||||
if ($debug != \Input::get('debug') || $bugsnag_debug != \Input::get('bugsnag')) {
|
||||
// dd($request->input());
|
||||
$debug_new = base_path()
|
||||
.DIRECTORY_SEPARATOR.
|
||||
'config'
|
||||
.DIRECTORY_SEPARATOR.
|
||||
'app.php';
|
||||
$datacontent = File::get($debug_new);
|
||||
$datacontent = str_replace("'debug' => ".$debug,
|
||||
"'debug' => ".\Input::get('debug'),
|
||||
$datacontent);
|
||||
File::put($debug_new, $datacontent);
|
||||
|
||||
// dd($request->input());
|
||||
$bugsnag_debug_new = base_path()
|
||||
.DIRECTORY_SEPARATOR.
|
||||
'config'
|
||||
.DIRECTORY_SEPARATOR.
|
||||
'app.php';
|
||||
$datacontent2 = File::get($bugsnag_debug_new);
|
||||
$datacontent2 = str_replace("'bugsnag_reporting' => ".$bugsnag_debug,
|
||||
"'bugsnag_reporting' => ".\Input::get('bugsnag'),
|
||||
$datacontent2);
|
||||
File::put($bugsnag_debug_new, $datacontent2);
|
||||
return redirect()->back()->with('success',
|
||||
Lang::get('lang.error-debug-settings-saved-message'));
|
||||
} else {
|
||||
return redirect()->back()->with('fails',
|
||||
Lang::get('lang.error-debug-settings-error-message'));
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect()->back()->with('fails', $e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* function to show error log table page.
|
||||
*
|
||||
* function to show error log table page
|
||||
* @param void
|
||||
*
|
||||
* @return response view
|
||||
*/
|
||||
public function showErrorLogs()
|
||||
|
@@ -152,7 +152,7 @@ class HelptopicController extends Controller
|
||||
$sys_help_topic = \DB::table('settings_ticket')
|
||||
->select('help_topic')
|
||||
->where('id', '=', 1)->first();
|
||||
|
||||
|
||||
return view('themes.default1.admin.helpdesk.manage.helptopic.edit', compact('priority', 'departments', 'topics', 'forms', 'agents', 'slas', 'sys_help_topic'));
|
||||
} catch (Exception $e) {
|
||||
return redirect('helptopic')->with('fails', '<li>'.$e->getMessage().'</li>');
|
||||
|
@@ -29,6 +29,7 @@ use App\Model\helpdesk\Utility\Date_format;
|
||||
use App\Model\helpdesk\Utility\Date_time_format;
|
||||
use App\Model\helpdesk\Utility\Time_format;
|
||||
use App\Model\helpdesk\Utility\Timezones;
|
||||
use App\Model\helpdesk\Workflow\WorkflowClose;
|
||||
use DateTime;
|
||||
// classes
|
||||
use DB;
|
||||
@@ -182,7 +183,7 @@ class SettingsController extends Controller
|
||||
/* Check whether function success or not */
|
||||
$systems->fill($request->input())->save();
|
||||
/* redirect to Index page with Success Message */
|
||||
|
||||
|
||||
// dd($datacontent);
|
||||
//\Config::set('app.debug', $request->input('debug'));
|
||||
return redirect('getsystem')->with('success', Lang::get('lang.system_updated_successfully'));
|
||||
@@ -320,7 +321,7 @@ class SettingsController extends Controller
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function getSchedular(Email $email, Template $template, Emails $email1)
|
||||
public function getSchedular(Email $email, Template $template, Emails $email1, WorkflowClose $workflow)
|
||||
{
|
||||
// try {
|
||||
/* fetch the values of email from Email table */
|
||||
@@ -330,7 +331,9 @@ class SettingsController extends Controller
|
||||
/* Fetch the values from Emails table */
|
||||
$emails1 = $email1->get();
|
||||
|
||||
return view('themes.default1.admin.helpdesk.settings.crone', compact('emails', 'templates', 'emails1'));
|
||||
$workflow = $workflow->whereId('1')->first();
|
||||
|
||||
return view('themes.default1.admin.helpdesk.settings.crone', compact('emails', 'templates', 'emails1', 'workflow'));
|
||||
// } catch {
|
||||
// }
|
||||
}
|
||||
@@ -343,7 +346,7 @@ class SettingsController extends Controller
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function postSchedular(Email $email, Template $template, Emails $email1, Request $request)
|
||||
public function postSchedular(Email $email, Template $template, Emails $email1, Request $request, WorkflowClose $workflow)
|
||||
{
|
||||
// dd($request);
|
||||
try {
|
||||
@@ -360,6 +363,14 @@ class SettingsController extends Controller
|
||||
$emails->notification_cron = 0;
|
||||
}
|
||||
$emails->save();
|
||||
//workflow
|
||||
$work = $workflow->whereId('1')->first();
|
||||
if ($request->condition == 'on') {
|
||||
$work->condition = 1;
|
||||
} else {
|
||||
$work->condition = 0;
|
||||
}
|
||||
$work->save();
|
||||
/* redirect to Index page with Success Message */
|
||||
return redirect('job-scheduler')->with('success', Lang::get('lang.job-scheduler-success'));
|
||||
} catch (Exception $e) {
|
||||
|
@@ -104,8 +104,7 @@ class SlaController extends Controller
|
||||
$slas = Sla_plan::whereId($id)->first();
|
||||
$slas->get();
|
||||
$sla = \DB::table('settings_ticket')->select('sla')->where('id', '=', 1)->first();
|
||||
|
||||
return view('themes.default1.admin.helpdesk.manage.sla.edit', compact('slas', 'sla'));
|
||||
return view('themes.default1.admin.helpdesk.manage.sla.edit', compact('slas','sla'));
|
||||
} catch (Exception $e) {
|
||||
return redirect()->back()->with('fails', $e->getMessage());
|
||||
}
|
||||
@@ -138,7 +137,6 @@ class SlaController extends Controller
|
||||
->where('id', '=', 1)
|
||||
->update(['sla' => $id]);
|
||||
}
|
||||
|
||||
return redirect('sla')->with('success', Lang::get('lang.sla_plan_updated_successfully'));
|
||||
} catch (Exception $e) {
|
||||
/* redirect to Index page with Fails Message */
|
||||
|
@@ -24,15 +24,14 @@ use Lang;
|
||||
*
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class TemplateController extends Controller
|
||||
{
|
||||
class TemplateController extends Controller {
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return type void
|
||||
*/
|
||||
public function __construct(PhpMailController $PhpMailController)
|
||||
{
|
||||
public function __construct(PhpMailController $PhpMailController) {
|
||||
$this->PhpMailController = $PhpMailController;
|
||||
$this->middleware('auth');
|
||||
$this->middleware('roles');
|
||||
@@ -45,8 +44,7 @@ class TemplateController extends Controller
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function index(Template $template)
|
||||
{
|
||||
public function index(Template $template) {
|
||||
try {
|
||||
$templates = $template->get();
|
||||
|
||||
@@ -64,8 +62,7 @@ class TemplateController extends Controller
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function create(Languages $language, Template $template)
|
||||
{
|
||||
public function create(Languages $language, Template $template) {
|
||||
try {
|
||||
$templates = $template->get();
|
||||
$languages = $language->get();
|
||||
@@ -84,8 +81,7 @@ class TemplateController extends Controller
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function store(Template $template, TemplateRequest $request)
|
||||
{
|
||||
public function store(Template $template, TemplateRequest $request) {
|
||||
try {
|
||||
/* Check whether function success or not */
|
||||
if ($template->fill($request->input())->save() == true) {
|
||||
@@ -108,8 +104,7 @@ class TemplateController extends Controller
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
public function show($id) {
|
||||
//
|
||||
}
|
||||
|
||||
@@ -122,41 +117,37 @@ class TemplateController extends Controller
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function listdirectories()
|
||||
{
|
||||
$path = \Config::get('view.paths')[0].'/emails/';
|
||||
public function listdirectories() {
|
||||
$path = \Config::get('view.paths')[0] . '/emails/';
|
||||
$directories = scandir($path);
|
||||
$directory = str_replace('/', '-', $path);
|
||||
|
||||
return view('themes.default1.admin.helpdesk.emails.template.listdirectories', compact('directories', 'directory'));
|
||||
}
|
||||
|
||||
public function listtemplates($template, $path)
|
||||
{
|
||||
public function listtemplates($template, $path) {
|
||||
$paths = str_replace('-', '/', $path);
|
||||
$directory2 = $paths.$template;
|
||||
$directory2 = $paths . $template;
|
||||
|
||||
$templates = scandir($directory2);
|
||||
$directory = str_replace('/', '-', $directory2.'/');
|
||||
$directory = str_replace('/', '-', $directory2 . '/');
|
||||
|
||||
return view('themes.default1.admin.helpdesk.emails.template.listtemplates', compact('templates', 'directory'));
|
||||
}
|
||||
|
||||
public function readtemplate($template, $path)
|
||||
{
|
||||
public function readtemplate($template, $path) {
|
||||
$directory = str_replace('-', '/', $path);
|
||||
$handle = fopen($directory.$template, 'r');
|
||||
$contents = fread($handle, filesize($directory.$template));
|
||||
$handle = fopen($directory . $template, 'r');
|
||||
$contents = fread($handle, filesize($directory . $template));
|
||||
fclose($handle);
|
||||
|
||||
return view('themes.default1.admin.helpdesk.emails.template.readtemplates', compact('contents', 'template', 'path'));
|
||||
}
|
||||
|
||||
public function createtemplate()
|
||||
{
|
||||
public function createtemplate() {
|
||||
$directory = '../resources/views/emails/';
|
||||
$fname = Input::get('folder_name');
|
||||
$filename = $directory.$fname;
|
||||
$filename = $directory . $fname;
|
||||
|
||||
// images folder creation using php
|
||||
// $mydir = dirname( __FILE__ )."/html/images";
|
||||
@@ -168,7 +159,7 @@ class TemplateController extends Controller
|
||||
if (!file_exists($filename)) {
|
||||
mkdir($filename, 0777);
|
||||
}
|
||||
$files = array_filter(scandir($directory.'default'));
|
||||
$files = array_filter(scandir($directory . 'default'));
|
||||
|
||||
foreach ($files as $file) {
|
||||
if ($file === '.' or $file === '..') {
|
||||
@@ -176,29 +167,27 @@ class TemplateController extends Controller
|
||||
}
|
||||
if (!is_dir($file)) {
|
||||
// $file_to_go = str_replace("code/resources/views/emails/",'code/resources/views/emails/'.$fname,$file);
|
||||
$destination = $directory.$fname.'/';
|
||||
$destination = $directory . $fname . '/';
|
||||
|
||||
copy($directory.'default/'.$file, $destination.$file);
|
||||
copy($directory . 'default/' . $file, $destination . $file);
|
||||
}
|
||||
}
|
||||
|
||||
return \Redirect::back()->with('success', 'Successfully copied');
|
||||
}
|
||||
|
||||
public function writetemplate($template, $path)
|
||||
{
|
||||
public function writetemplate($template, $path) {
|
||||
$directory = str_replace('-', '/', $path);
|
||||
$b = Input::get('templatedata');
|
||||
|
||||
file_put_contents($directory.$template, print_r($b, true));
|
||||
file_put_contents($directory . $template, print_r($b, true));
|
||||
|
||||
return \Redirect::back()->with('success', 'Successfully updated');
|
||||
}
|
||||
|
||||
public function deletetemplate($template, $path)
|
||||
{
|
||||
public function deletetemplate($template, $path) {
|
||||
$directory = str_replace('-', '/', $path);
|
||||
$dir = $directory.$template;
|
||||
$dir = $directory . $template;
|
||||
$status = \DB::table('settings_email')->first();
|
||||
if ($template == 'default' or $template == $status->template) {
|
||||
return \Redirect::back()->with('fails', 'You cannot delete a default or active directory!');
|
||||
@@ -207,7 +196,7 @@ class TemplateController extends Controller
|
||||
$objects = scandir($dir);
|
||||
foreach ($objects as $object) {
|
||||
if ($object != '.' && $object != '..') {
|
||||
unlink($dir.'/'.$object);
|
||||
unlink($dir . '/' . $object);
|
||||
}
|
||||
}
|
||||
rmdir($dir);
|
||||
@@ -218,15 +207,13 @@ class TemplateController extends Controller
|
||||
return \Redirect::back()->with('success', 'Successfully Deleted');
|
||||
}
|
||||
|
||||
public function activateset($setname)
|
||||
{
|
||||
public function activateset($setname) {
|
||||
\DB::table('settings_email')->update(['template' => $setname]);
|
||||
|
||||
return \Redirect::back()->with('success', 'You have Successfully Activated this Set');
|
||||
}
|
||||
|
||||
public function edit($id, Template $template, Languages $language)
|
||||
{
|
||||
public function edit($id, Template $template, Languages $language) {
|
||||
try {
|
||||
$templates = $template->whereId($id)->first();
|
||||
$languages = $language->get();
|
||||
@@ -246,8 +233,7 @@ class TemplateController extends Controller
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function update($id, Template $template, TemplateUdate $request)
|
||||
{
|
||||
public function update($id, Template $template, TemplateUdate $request) {
|
||||
try {
|
||||
//TODO validation
|
||||
$templates = $template->whereId($id)->first();
|
||||
@@ -273,8 +259,7 @@ class TemplateController extends Controller
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function destroy($id, Template $template)
|
||||
{
|
||||
public function destroy($id, Template $template) {
|
||||
try {
|
||||
$templates = $template->whereId($id)->first();
|
||||
/* Check whether function success or not */
|
||||
@@ -298,8 +283,7 @@ class TemplateController extends Controller
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function formDiagno(Emails $email)
|
||||
{
|
||||
public function formDiagno(Emails $email) {
|
||||
try {
|
||||
$emails = $email->get();
|
||||
|
||||
@@ -316,8 +300,7 @@ class TemplateController extends Controller
|
||||
*
|
||||
* @return type
|
||||
*/
|
||||
public function postDiagno(DiagnosRequest $request)
|
||||
{
|
||||
public function postDiagno(DiagnosRequest $request) {
|
||||
try {
|
||||
$email_details = Emails::where('id', '=', $request->from)->first();
|
||||
if ($email_details->sending_protocol == 'mail') {
|
||||
@@ -325,12 +308,12 @@ class TemplateController extends Controller
|
||||
$mail->IsSendmail(); // telling the class to use SendMail transport
|
||||
$mail->SetFrom($email_details->email_address, $email_details->email_name); // sender details
|
||||
$address = $request->to; // receiver email
|
||||
$mail->AddAddress($address);
|
||||
$mail->AddAddress($address);
|
||||
$mail->Subject = $request->subject; // subject of the email
|
||||
$body = $request->message; // body of the email
|
||||
$mail->MsgHTML($body);
|
||||
if (!$mail->Send()) {
|
||||
$return = Lang::get('lang.mailer_error').': '.$mail->ErrorInfo;
|
||||
$mail->MsgHTML($body);
|
||||
if (!$mail->Send()) {
|
||||
$return = Lang::get('lang.mailer_error') . ': ' . $mail->ErrorInfo;
|
||||
} else {
|
||||
$return = Lang::get('lang.message_has_been_sent');
|
||||
}
|
||||
@@ -340,8 +323,8 @@ class TemplateController extends Controller
|
||||
if ($email_details->smtp_validate == '1') {
|
||||
$mail->SMTPOptions = [
|
||||
'ssl' => [
|
||||
'verify_peer' => false,
|
||||
'verify_peer_name' => false,
|
||||
'verify_peer' => false,
|
||||
'verify_peer_name' => false,
|
||||
'allow_self_signed' => true,
|
||||
],
|
||||
];
|
||||
@@ -358,15 +341,15 @@ class TemplateController extends Controller
|
||||
$mail->Subject = $request->subject;
|
||||
$mail->Body = utf8_decode($request->message);
|
||||
if (!$mail->send()) {
|
||||
$return = Lang::get('lang.mailer_error').': '.$mail->ErrorInfo;
|
||||
$return = Lang::get('lang.mailer_error') . ': ' . $mail->ErrorInfo;
|
||||
} else {
|
||||
$return = Lang::get('lang.message_has_been_sent');
|
||||
}
|
||||
}
|
||||
|
||||
return redirect()->back()->with('success', $return);
|
||||
} catch (Exception $e) {
|
||||
return redirect()->back()->with('fails', $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -144,7 +144,7 @@ class WorkflowController extends Controller
|
||||
*/
|
||||
public function create(Emails $emails)
|
||||
{
|
||||
$email_data = '';
|
||||
$email_data = "";
|
||||
foreach ($emails->lists('email_address', 'id') as $key => $email) {
|
||||
$email_data["E-$key"] = $email;
|
||||
}
|
||||
@@ -167,7 +167,7 @@ class WorkflowController extends Controller
|
||||
{
|
||||
try {
|
||||
// store a new workflow credentials in to the system
|
||||
$workflow_name = new WorkflowName();
|
||||
$workflow_name = new WorkflowName;
|
||||
$workflow_name->name = $request->name;
|
||||
$workflow_name->status = $request->status;
|
||||
$workflow_name->order = $request->execution_order;
|
||||
|
@@ -27,16 +27,15 @@ use PhpImap\Mailbox as ImapMailbox;
|
||||
*
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class MailController extends Controller
|
||||
{
|
||||
class MailController extends Controller {
|
||||
|
||||
/**
|
||||
* constructor
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @param type TicketController $TicketController
|
||||
*/
|
||||
public function __construct(TicketWorkflowController $TicketWorkflowController)
|
||||
{
|
||||
public function __construct(TicketWorkflowController $TicketWorkflowController) {
|
||||
$this->middleware('board');
|
||||
$this->TicketWorkflowController = $TicketWorkflowController;
|
||||
}
|
||||
@@ -46,8 +45,7 @@ class MailController extends Controller
|
||||
*
|
||||
* @return type
|
||||
*/
|
||||
public function readmails(Emails $emails, Email $settings_email, System $system, Ticket $ticket)
|
||||
{
|
||||
public function readmails(Emails $emails, Email $settings_email, System $system, Ticket $ticket) {
|
||||
// $path_url = $system->first()->url;
|
||||
if ($settings_email->first()->email_fetching == 1) {
|
||||
if ($settings_email->first()->all_emails == 1) {
|
||||
@@ -82,7 +80,7 @@ class MailController extends Controller
|
||||
$protocol = $fetching_encryption2;
|
||||
} else {
|
||||
if ($e_mail->fetching_protocol) {
|
||||
$fetching_protocol = '/'.$e_mail->fetching_protocol;
|
||||
$fetching_protocol = '/' . $e_mail->fetching_protocol;
|
||||
} else {
|
||||
$fetching_protocol = '';
|
||||
}
|
||||
@@ -91,13 +89,13 @@ class MailController extends Controller
|
||||
} else {
|
||||
$fetching_encryption = '';
|
||||
}
|
||||
$protocol = $fetching_protocol.$fetching_encryption;
|
||||
$protocol = $fetching_protocol . $fetching_encryption;
|
||||
}
|
||||
$imap_config = '{'.$host.':'.$port.$protocol.'}INBOX';
|
||||
$imap_config = '{' . $host . ':' . $port . $protocol . '}INBOX';
|
||||
$password = Crypt::decrypt($e_mail->password);
|
||||
$mailbox = new ImapMailbox($imap_config, $e_mail->email_address, $password, __DIR__);
|
||||
$mails = [];
|
||||
$mailsIds = $mailbox->searchMailBox('SINCE '.date('d-M-Y', strtotime('-1 day')));
|
||||
$mailsIds = $mailbox->searchMailBox('SINCE ' . date('d-M-Y', strtotime('-1 day')));
|
||||
if (!$mailsIds) {
|
||||
die('Mailbox is empty');
|
||||
}
|
||||
@@ -137,7 +135,7 @@ class MailController extends Controller
|
||||
$date = $mail->date;
|
||||
$datetime = $overview[0]->date;
|
||||
$date_time = explode(' ', $datetime);
|
||||
$date = $date_time[1].'-'.$date_time[2].'-'.$date_time[3].' '.$date_time[4];
|
||||
$date = $date_time[1] . '-' . $date_time[2] . '-' . $date_time[3] . ' ' . $date_time[4];
|
||||
$date = date('Y-m-d H:i:s', strtotime($date));
|
||||
if (isset($mail->subject)) {
|
||||
$subject = $mail->subject;
|
||||
@@ -172,7 +170,7 @@ class MailController extends Controller
|
||||
// var_dump($attachment->filePath);
|
||||
// dd($filepath);
|
||||
// $path = $dir_img_path[0]."/code/public/".$filepath[1];
|
||||
$path = public_path().$filepath[1];
|
||||
$path = public_path() . $filepath[1];
|
||||
// dd($path);
|
||||
$filesize = filesize($path);
|
||||
$file_data = file_get_contents($path);
|
||||
@@ -181,7 +179,7 @@ class MailController extends Controller
|
||||
$string = str_replace('-', '', $attachment->name);
|
||||
$filename = explode('src', $attachment->filePath);
|
||||
$filename = str_replace('\\', '', $filename);
|
||||
$body = str_replace('cid:'.$imageid, $filepath[1], $body);
|
||||
$body = str_replace('cid:' . $imageid, $filepath[1], $body);
|
||||
$pos = strpos($body, $filepath[1]);
|
||||
if ($pos == false) {
|
||||
if ($settings_email->first()->attachment == 1) {
|
||||
@@ -226,8 +224,7 @@ class MailController extends Controller
|
||||
*
|
||||
* @return type string
|
||||
*/
|
||||
public function separate_reply($body)
|
||||
{
|
||||
public function separate_reply($body) {
|
||||
$body2 = explode('---Reply above this line---', $body);
|
||||
$body3 = $body2[0];
|
||||
|
||||
@@ -241,8 +238,7 @@ class MailController extends Controller
|
||||
*
|
||||
* @return type string
|
||||
*/
|
||||
public function decode_imap_text($str)
|
||||
{
|
||||
public function decode_imap_text($str) {
|
||||
$result = '';
|
||||
$decode_header = imap_mime_header_decode($str);
|
||||
foreach ($decode_header as $obj) {
|
||||
@@ -257,8 +253,7 @@ class MailController extends Controller
|
||||
*
|
||||
* @return type
|
||||
*/
|
||||
public function fetch_attachments()
|
||||
{
|
||||
public function fetch_attachments() {
|
||||
$uploads = Upload::all();
|
||||
foreach ($uploads as $attachment) {
|
||||
$image = @imagecreatefromstring($attachment->file);
|
||||
@@ -266,8 +261,8 @@ class MailController extends Controller
|
||||
imagejpeg($image, null, 80);
|
||||
$data = ob_get_contents();
|
||||
ob_end_clean();
|
||||
$var = '<a href="" target="_blank"><img src="data:image/jpg;base64,'.base64_encode($data).'"/></a>';
|
||||
echo '<br/><span class="mailbox-attachment-icon has-img">'.$var.'</span>';
|
||||
$var = '<a href="" target="_blank"><img src="data:image/jpg;base64,' . base64_encode($data) . '"/></a>';
|
||||
echo '<br/><span class="mailbox-attachment-icon has-img">' . $var . '</span>';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -278,19 +273,17 @@ class MailController extends Controller
|
||||
*
|
||||
* @return type file
|
||||
*/
|
||||
public function get_data($id)
|
||||
{
|
||||
public function get_data($id) {
|
||||
$attachments = App\Model\helpdesk\Ticket\Ticket_attachments::where('id', '=', $id)->get();
|
||||
foreach ($attachments as $attachment) {
|
||||
header('Content-type: application/'.$attachment->type.'');
|
||||
header('Content-Disposition: inline; filename='.$attachment->name.'');
|
||||
header('Content-type: application/' . $attachment->type . '');
|
||||
header('Content-Disposition: inline; filename=' . $attachment->name . '');
|
||||
header('Content-Transfer-Encoding: binary');
|
||||
echo $attachment->file;
|
||||
}
|
||||
}
|
||||
|
||||
public static function trimTableTag($html)
|
||||
{
|
||||
public static function trimTableTag($html) {
|
||||
if (strpos('<table>', $html) != false) {
|
||||
$first_pos = strpos($html, '<table');
|
||||
$fist_string = substr_replace($html, '', 0, $first_pos);
|
||||
@@ -299,28 +292,23 @@ class MailController extends Controller
|
||||
$diff = $total - $last_pos;
|
||||
$str = substr_replace($fist_string, '', $last_pos, -1);
|
||||
$final_str = str_finish($str, '</table>');
|
||||
|
||||
return $final_str;
|
||||
}
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
||||
public static function trim3D($html)
|
||||
{
|
||||
public static function trim3D($html) {
|
||||
$body = str_replace('=3D', '', $html);
|
||||
|
||||
return $body;
|
||||
}
|
||||
|
||||
public static function trimInjections($html, $tags = ['<script>', '</script>', '<style>', '</style>', '<?php', '?>'])
|
||||
{
|
||||
public static function trimInjections($html, $tags = ['<script>', '</script>', '<style>', '</style>', '<?php', '?>']) {
|
||||
$replace = [];
|
||||
foreach ($tags as $key => $tag) {
|
||||
$replace[$key] = htmlspecialchars($tag);
|
||||
}
|
||||
$body = str_replace($tags, $replace, $html);
|
||||
|
||||
return $body;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -16,8 +16,6 @@ use App\Model\helpdesk\Email\Emails;
|
||||
use App\Model\helpdesk\Form\Fields;
|
||||
use App\Model\helpdesk\Manage\Help_topic;
|
||||
use App\Model\helpdesk\Manage\Sla_plan;
|
||||
use App\Model\helpdesk\Notification\Notification;
|
||||
use App\Model\helpdesk\Notification\UserNotification;
|
||||
use App\Model\helpdesk\Settings\Alert;
|
||||
use App\Model\helpdesk\Settings\Company;
|
||||
use App\Model\helpdesk\Settings\Email;
|
||||
@@ -33,6 +31,8 @@ use App\Model\helpdesk\Ticket\Tickets;
|
||||
use App\Model\helpdesk\Utility\CountryCode;
|
||||
use App\Model\helpdesk\Utility\Date_time_format;
|
||||
use App\Model\helpdesk\Utility\Timezones;
|
||||
use App\Model\helpdesk\Notification\Notification;
|
||||
use App\Model\helpdesk\Notification\UserNotification;
|
||||
use App\User;
|
||||
use Auth;
|
||||
use DB;
|
||||
@@ -621,7 +621,7 @@ class TicketController extends Controller
|
||||
\Event::fire(new \App\Events\ReadMailEvent($user_id, $password));
|
||||
try {
|
||||
if ($auto_response == 0) {
|
||||
$this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('1', '0'), $to = ['name' => $username, 'email' => $emailadd], $message = ['subject' => 'Welcome to '.$company.' helpdesk', 'scenario' => 'registration-notification'], $template_variables = ['user' => $username, 'email_address' => $emailadd, 'user_password' => $password]);
|
||||
$this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('1', '0'), $to = ['name' => $username, 'email' => $emailadd], $message = ['subject' => null, 'scenario' => 'registration-notification'], $template_variables = ['user' => $username, 'email_address' => $emailadd, 'user_password' => $password]);
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
}
|
||||
|
@@ -91,7 +91,6 @@ class UserController extends Controller
|
||||
} else {
|
||||
$stringCut = $model->user_name;
|
||||
}
|
||||
|
||||
return $stringCut;
|
||||
})
|
||||
/* column email */
|
||||
|
@@ -29,8 +29,8 @@ use Redirect;
|
||||
*
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class ArticleController extends Controller
|
||||
{
|
||||
class ArticleController extends Controller {
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
* constructor to check
|
||||
@@ -40,8 +40,7 @@ class ArticleController extends Controller
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
public function __construct() {
|
||||
// checking authentication
|
||||
$this->middleware('auth');
|
||||
// checking roles
|
||||
@@ -49,8 +48,7 @@ class ArticleController extends Controller
|
||||
SettingsController::language();
|
||||
}
|
||||
|
||||
public function test()
|
||||
{
|
||||
public function test() {
|
||||
//$table = $this->setDatatable();
|
||||
return view('themes.default1.agent.kb.article.test');
|
||||
}
|
||||
@@ -60,8 +58,7 @@ class ArticleController extends Controller
|
||||
*
|
||||
* @return type void
|
||||
*/
|
||||
public function getData()
|
||||
{
|
||||
public function getData() {
|
||||
$article = new Article();
|
||||
// returns chumper datatable
|
||||
return Datatable::query($article)
|
||||
@@ -71,6 +68,7 @@ class ArticleController extends Controller
|
||||
->orderColumns('name', 'description')
|
||||
/* add column name */
|
||||
->addColumn('name', function ($model) {
|
||||
|
||||
$string = strip_tags($model->name);
|
||||
if (strlen($string) > 40) {
|
||||
// truncate string
|
||||
@@ -78,8 +76,7 @@ class ArticleController extends Controller
|
||||
} else {
|
||||
$stringCut = $model->name;
|
||||
}
|
||||
|
||||
return $stringCut.'...';
|
||||
return $stringCut . '...';
|
||||
})
|
||||
/* add column Created */
|
||||
->addColumn('publish_time', function ($model) {
|
||||
@@ -90,8 +87,8 @@ class ArticleController extends Controller
|
||||
/* add column action */
|
||||
->addColumn('Actions', function ($model) {
|
||||
/* here are all the action buttons and modal popup to delete articles with confirmations */
|
||||
return '<span data-toggle="modal" data-target="#deletearticle'.$model->id.'"><a href="#" ><button class="btn btn-danger btn-xs"></a> '.\Lang::get('lang.delete').' </button></span> <a href=article/'.$model->id.'/edit class="btn btn-warning btn-xs">'.\Lang::get('lang.edit').'</a> <a href=show/'.$model->slug.' class="btn btn-primary btn-xs">'.\Lang::get('lang.view').'</a>
|
||||
<div class="modal fade" id="deletearticle'.$model->id.'">
|
||||
return '<span data-toggle="modal" data-target="#deletearticle' . $model->id . '"><a href="#" ><button class="btn btn-danger btn-xs"></a> ' . \Lang::get('lang.delete') . ' </button></span> <a href=article/' . $model->id . '/edit class="btn btn-warning btn-xs">' . \Lang::get('lang.edit') . '</a> <a href=show/' . $model->slug . ' class="btn btn-primary btn-xs">' . \Lang::get('lang.view') . '</a>
|
||||
<div class="modal fade" id="deletearticle' . $model->id . '">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
@@ -99,11 +96,11 @@ class ArticleController extends Controller
|
||||
<h4 class="modal-title">Are You Sure ?</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
'.$model->name.'
|
||||
' . $model->name . '
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal" id="dismis2">Close</button>
|
||||
<a href="article/delete/'.$model->slug.'"><button class="btn btn-danger">delete</button></a>
|
||||
<a href="article/delete/' . $model->slug . '"><button class="btn btn-danger">delete</button></a>
|
||||
</div>
|
||||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
@@ -117,8 +114,7 @@ class ArticleController extends Controller
|
||||
*
|
||||
* @return type view
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
public function index() {
|
||||
/* show article list */
|
||||
try {
|
||||
return view('themes.default1.agent.kb.article.index');
|
||||
@@ -134,8 +130,7 @@ class ArticleController extends Controller
|
||||
*
|
||||
* @return type view
|
||||
*/
|
||||
public function create(Category $category)
|
||||
{
|
||||
public function create(Category $category) {
|
||||
/* get the attributes of the category */
|
||||
$category = $category->lists('id', 'name');
|
||||
/* get the create page */
|
||||
@@ -154,10 +149,9 @@ class ArticleController extends Controller
|
||||
*
|
||||
* @return type redirect
|
||||
*/
|
||||
public function store(Article $article, ArticleRequest $request)
|
||||
{
|
||||
public function store(Article $article, ArticleRequest $request) {
|
||||
// requesting the values to store article data
|
||||
$publishTime = $request->input('year').'-'.$request->input('month').'-'.$request->input('day').' '.$request->input('hour').':'.$request->input('minute').':00';
|
||||
$publishTime = $request->input('year') . '-' . $request->input('month') . '-' . $request->input('day') . ' ' . $request->input('hour') . ':' . $request->input('minute') . ':00';
|
||||
|
||||
$sl = $request->input('name');
|
||||
$slug = str_slug($sl, '-');
|
||||
@@ -177,7 +171,7 @@ class ArticleController extends Controller
|
||||
|
||||
return redirect('article')->with('success', Lang::get('lang.article_inserted_successfully'));
|
||||
} catch (Exception $e) {
|
||||
return redirect('article')->with('fails', Lang::get('lang.article_not_inserted').'<li>'.$e->getMessage().'</li>');
|
||||
return redirect('article')->with('fails', Lang::get('lang.article_not_inserted') . '<li>' . $e->getMessage() . '</li>');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -191,8 +185,7 @@ class ArticleController extends Controller
|
||||
*
|
||||
* @return view
|
||||
*/
|
||||
public function edit($slug)
|
||||
{
|
||||
public function edit($slug) {
|
||||
$article = new Article();
|
||||
$relation = new Relationship();
|
||||
$category = new Category();
|
||||
@@ -223,12 +216,11 @@ class ArticleController extends Controller
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function update($slug, ArticleUpdate $request)
|
||||
{
|
||||
public function update($slug, ArticleUpdate $request) {
|
||||
$article = new Article();
|
||||
$relation = new Relationship();
|
||||
$aid = $article->where('id', $slug)->first();
|
||||
$publishTime = $request->input('year').'-'.$request->input('month').'-'.$request->input('day').' '.$request->input('hour').':'.$request->input('minute').':00';
|
||||
$publishTime = $request->input('year') . '-' . $request->input('month') . '-' . $request->input('day') . ' ' . $request->input('hour') . ':' . $request->input('minute') . ':00';
|
||||
|
||||
$id = $aid->id;
|
||||
$sl = $request->input('slug');
|
||||
@@ -255,7 +247,7 @@ class ArticleController extends Controller
|
||||
|
||||
return redirect('article')->with('success', Lang::get('lang.article_updated_successfully'));
|
||||
} catch (Exception $e) {
|
||||
return redirect('article')->with('fails', Lang::get('lang.article_not_updated').'<li>'.$e->getMessage().'</li>');
|
||||
return redirect('article')->with('fails', Lang::get('lang.article_not_updated') . '<li>' . $e->getMessage() . '</li>');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -267,8 +259,7 @@ class ArticleController extends Controller
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function destroy($slug, Article $article, Relationship $relation, Comment $comment)
|
||||
{
|
||||
public function destroy($slug, Article $article, Relationship $relation, Comment $comment) {
|
||||
/* delete the selected article from the table */
|
||||
$article = $article->where('slug', $slug)->first(); //get the selected article via id
|
||||
$id = $article->id;
|
||||
@@ -302,8 +293,7 @@ class ArticleController extends Controller
|
||||
*
|
||||
* @return type
|
||||
*/
|
||||
public static function usertimezone($utc)
|
||||
{
|
||||
public static function usertimezone($utc) {
|
||||
$user = Auth::user();
|
||||
$tz = $user->timezone;
|
||||
$set = Settings::whereId('1')->first();
|
||||
@@ -314,4 +304,5 @@ class ArticleController extends Controller
|
||||
$date = date($format, strtotime($utc) + $offset);
|
||||
echo $date;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -23,8 +23,8 @@ use Redirect;
|
||||
*
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class CategoryController extends Controller
|
||||
{
|
||||
class CategoryController extends Controller {
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
* constructor to check
|
||||
@@ -34,8 +34,7 @@ class CategoryController extends Controller
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
public function __construct() {
|
||||
// checking authentication
|
||||
$this->middleware('auth');
|
||||
// checking roles
|
||||
@@ -50,8 +49,7 @@ class CategoryController extends Controller
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
public function index() {
|
||||
/* get the view of index of the catogorys with all attributes
|
||||
of category model */
|
||||
try {
|
||||
@@ -66,8 +64,7 @@ class CategoryController extends Controller
|
||||
*
|
||||
* @return type chumper datatable
|
||||
*/
|
||||
public function getData()
|
||||
{
|
||||
public function getData() {
|
||||
/* fetching chumper datatables */
|
||||
return Datatable::collection(Category::All())
|
||||
/* search column name */
|
||||
@@ -76,6 +73,7 @@ class CategoryController extends Controller
|
||||
->orderColumns('name', 'description')
|
||||
/* add column name */
|
||||
->addColumn('name', function ($model) {
|
||||
|
||||
$string = strip_tags($model->name);
|
||||
if (strlen($string) > 40) {
|
||||
// truncate string
|
||||
@@ -83,7 +81,6 @@ class CategoryController extends Controller
|
||||
} else {
|
||||
$stringCut = $model->name;
|
||||
}
|
||||
|
||||
return $stringCut.'...';
|
||||
})
|
||||
/* add column Created */
|
||||
@@ -95,20 +92,20 @@ class CategoryController 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="#deletecategory'.$model->slug.'"><a href="#" ><button class="btn btn-danger btn-xs"></a>'.\Lang::get('lang.delete').'</button></span> <a href=category/'.$model->id.'/edit class="btn btn-warning btn-xs">'.\Lang::get('lang.edit').'</a> <a href=article-list class="btn btn-primary btn-xs">'.\Lang::get('lang.view').'</a>
|
||||
<div class="modal fade" id="deletecategory'.$model->slug.'">
|
||||
return '<span data-toggle="modal" data-target="#deletecategory' . $model->slug . '"><a href="#" ><button class="btn btn-danger btn-xs"></a>' . \Lang::get('lang.delete') . '</button></span> <a href=category/' . $model->id . '/edit class="btn btn-warning btn-xs">' . \Lang::get('lang.edit') . '</a> <a href=article-list class="btn btn-primary btn-xs">' . \Lang::get('lang.view') . '</a>
|
||||
<div class="modal fade" id="deletecategory' . $model->slug . '">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">'.Lang::get('lang.are_you_sure_you_want_to_delete').'</h4>
|
||||
<h4 class="modal-title">' . Lang::get('lang.are_you_sure_you_want_to_delete') . '</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
'.$model->name.'
|
||||
' . $model->name . '
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal" id="dismis2">'.Lang::get('lang.close').'</button>
|
||||
<a href="category/delete/'.$model->id.'"><button class="btn btn-danger">'.Lang::get('lang.delete').'</button></a>
|
||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal" id="dismis2">' . Lang::get('lang.close') . '</button>
|
||||
<a href="category/delete/' . $model->id . '"><button class="btn btn-danger">' . Lang::get('lang.delete') . '</button></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -124,8 +121,7 @@ class CategoryController extends Controller
|
||||
*
|
||||
* @return type view
|
||||
*/
|
||||
public function create(Category $category)
|
||||
{
|
||||
public function create(Category $category) {
|
||||
/* Get the all attributes in the category model */
|
||||
$category = $category->get();
|
||||
/* get the view page to create new category with all attributes
|
||||
@@ -145,8 +141,7 @@ class CategoryController extends Controller
|
||||
*
|
||||
* @return type Redirect
|
||||
*/
|
||||
public function store(Category $category, CategoryRequest $request)
|
||||
{
|
||||
public function store(Category $category, CategoryRequest $request) {
|
||||
/* Get the whole request from the form and insert into table via model */
|
||||
$sl = $request->input('slug');
|
||||
$slug = str_slug($sl, '-');
|
||||
@@ -157,7 +152,7 @@ class CategoryController extends Controller
|
||||
|
||||
return Redirect::back()->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::back()->with('fails', Lang::get('lang.category_not_inserted') . '<li>' . $e->getMessage() . '</li>');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -169,8 +164,7 @@ class CategoryController extends Controller
|
||||
*
|
||||
* @return type view
|
||||
*/
|
||||
public function edit($slug)
|
||||
{
|
||||
public function edit($slug) {
|
||||
// fetch the category
|
||||
$cid = Category::where('id', $slug)->first();
|
||||
$id = $cid->id;
|
||||
@@ -189,8 +183,7 @@ class CategoryController extends Controller
|
||||
*
|
||||
* @return type redirect
|
||||
*/
|
||||
public function update($slug, CategoryUpdate $request)
|
||||
{
|
||||
public function update($slug, CategoryUpdate $request) {
|
||||
|
||||
/* Edit the selected category via id */
|
||||
$category = Category::where('id', $slug)->first();
|
||||
@@ -204,11 +197,10 @@ class CategoryController extends Controller
|
||||
$category->fill($request->all())->save();
|
||||
$category->slug = $slug;
|
||||
$category->save();
|
||||
|
||||
return redirect('category')->with('success', Lang::get('lang.category_updated_successfully'));
|
||||
} catch (Exception $e) {
|
||||
//redirect to index with fails message
|
||||
return redirect('category')->with('fails', Lang::get('lang.category_not_updated').'<li>'.$e->getMessage().'</li>');
|
||||
return redirect('category')->with('fails', Lang::get('lang.category_not_updated') . '<li>' . $e->getMessage() . '</li>');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -221,8 +213,7 @@ class CategoryController extends Controller
|
||||
*
|
||||
* @return type Redirect
|
||||
*/
|
||||
public function destroy($id, Category $category, Relationship $relation)
|
||||
{
|
||||
public function destroy($id, Category $category, Relationship $relation) {
|
||||
$relation = $relation->where('category_id', $id)->first();
|
||||
if ($relation != null) {
|
||||
return Redirect::back()->with('fails', Lang::get('lang.category_not_deleted'));
|
||||
@@ -235,8 +226,9 @@ class CategoryController extends Controller
|
||||
|
||||
return Redirect::back()->with('success', Lang::get('lang.category_deleted_successfully'));
|
||||
} catch (Exception $e) {
|
||||
return Redirect::back()->with('fails', Lang::get('lang.category_not_deleted').'<li>'.$e->getMessage().'</li>');
|
||||
return Redirect::back()->with('fails', Lang::get('lang.category_not_deleted') . '<li>' . $e->getMessage() . '</li>');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -21,8 +21,8 @@ use Lang;
|
||||
*
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class PageController extends Controller
|
||||
{
|
||||
class PageController extends Controller {
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
* constructor to check
|
||||
@@ -32,8 +32,7 @@ class PageController extends Controller
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Page $page)
|
||||
{
|
||||
public function __construct(Page $page) {
|
||||
// checking authentication
|
||||
$this->middleware('auth');
|
||||
// checking roles
|
||||
@@ -47,8 +46,7 @@ class PageController extends Controller
|
||||
*
|
||||
* @return type
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
public function index() {
|
||||
$pages = $this->page->paginate(3);
|
||||
$pages->setPath('page');
|
||||
try {
|
||||
@@ -63,8 +61,7 @@ class PageController extends Controller
|
||||
*
|
||||
* @return type
|
||||
*/
|
||||
public function getData()
|
||||
{
|
||||
public function getData() {
|
||||
/* fetching chumper datatables */
|
||||
return Datatable::collection(Page::All())
|
||||
/* search column name */
|
||||
@@ -84,8 +81,8 @@ 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> <a href=page/'.$model->slug.'/edit class="btn btn-warning btn-xs">'.\Lang::get('lang.edit').'</a> <a href=pages/'.$model->slug.' class="btn btn-primary btn-xs">'.\Lang::get('lang.view').'</a>
|
||||
<div class="modal fade" id="deletepage'.$model->id.'">
|
||||
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> <a href=page/' . $model->slug . '/edit class="btn btn-warning btn-xs">' . \Lang::get('lang.edit') . '</a> <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">
|
||||
@@ -93,11 +90,11 @@ class PageController extends Controller
|
||||
<h4 class="modal-title">Are You Sure ?</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
'.$model->name.'
|
||||
' . $model->name . '
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal" id="dismis2">Close</button>
|
||||
<a href="page/delete/'.$model->id.'"><button class="btn btn-danger">delete</button></a>
|
||||
<a href="page/delete/' . $model->id . '"><button class="btn btn-danger">delete</button></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -111,8 +108,7 @@ class PageController extends Controller
|
||||
*
|
||||
* @return type view
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
public function create() {
|
||||
return view('themes.default1.agent.kb.pages.create');
|
||||
}
|
||||
|
||||
@@ -123,8 +119,7 @@ class PageController extends Controller
|
||||
*
|
||||
* @return type
|
||||
*/
|
||||
public function store(PageRequest $request)
|
||||
{
|
||||
public function store(PageRequest $request) {
|
||||
$sl = $request->input('slug');
|
||||
$slug = str_slug($sl, '-');
|
||||
$this->page->slug = $slug;
|
||||
@@ -144,8 +139,7 @@ class PageController extends Controller
|
||||
*
|
||||
* @return type view
|
||||
*/
|
||||
public function edit($slug)
|
||||
{
|
||||
public function edit($slug) {
|
||||
try {
|
||||
$page = $this->page->where('slug', $slug)->first();
|
||||
|
||||
@@ -163,8 +157,7 @@ class PageController extends Controller
|
||||
*
|
||||
* @return type redirect
|
||||
*/
|
||||
public function update($slug, PageUpdate $request)
|
||||
{
|
||||
public function update($slug, PageUpdate $request) {
|
||||
// get pages with respect to slug
|
||||
$pages = $this->page->where('slug', $slug)->first();
|
||||
$sl = $request->input('slug');
|
||||
@@ -188,8 +181,7 @@ class PageController extends Controller
|
||||
*
|
||||
* @return type redirect
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
public function destroy($id) {
|
||||
try {
|
||||
// get the page to be deleted
|
||||
$page = $this->page->whereId($id)->first();
|
||||
@@ -200,4 +192,5 @@ class PageController extends Controller
|
||||
return redirect('page')->with('fails', $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -97,7 +97,7 @@ class AuthController extends Controller {
|
||||
$user->remember_token = $code;
|
||||
$user->save();
|
||||
$message12 = "";
|
||||
$var = $this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('1', '0'), $to = ['name' => $name, 'email' => $request->input('email')], $message = ['subject' => 'Activate your Account', 'scenario' => 'registration'], $template_variables = ['user' => $name, 'email_address' => $request->input('email'), 'password_reset_link' => url('account/activate/' . $code)]);
|
||||
$var = $this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('1', '0'), $to = ['name' => $name, 'email' => $request->input('email')], $message = ['subject' => null, 'scenario' => 'registration'], $template_variables = ['user' => $name, 'email_address' => $request->input('email'), 'password_reset_link' => url('account/activate/' . $code)]);
|
||||
if ($var == null) {
|
||||
$message12 = Lang::get('lang.failed_to_send_email_contact_administrator');
|
||||
return redirect('home')->with('warning', $message12);
|
||||
@@ -259,13 +259,13 @@ class AuthController extends Controller {
|
||||
if ($data) {
|
||||
$attempts = $data->Attempts + 1;
|
||||
if ($attempts == $apt) {
|
||||
$result = DB::update('UPDATE login_attempts SET Attempts=' . $attempts . ", LastLogin=NOW() WHERE IP = '$value' OR User = '$field'");
|
||||
$result = DB::select('UPDATE login_attempts SET Attempts=' . $attempts . ", LastLogin=NOW() WHERE IP = '$value' OR User = '$field'");
|
||||
} else {
|
||||
$result = DB::table('login_attempts')->where('IP', '=', $value)->orWhere('User', '=', $field)->update(['Attempts' => $attempts]);
|
||||
// $result = DB::select("UPDATE login_attempts SET Attempts=".$attempts." WHERE IP = '$value' OR User = '$field'");
|
||||
}
|
||||
} else {
|
||||
$result = DB::insert("INSERT INTO login_attempts (Attempts,User,IP,LastLogin) values (1,'$field','$value', NOW())");
|
||||
$result = DB::select("INSERT INTO login_attempts (Attempts,User,IP,LastLogin) values (1,'$field','$value', NOW())");
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -12,14 +12,15 @@ use App\User;
|
||||
// classes
|
||||
use Illuminate\Foundation\Auth\ResetsPasswords;
|
||||
use Illuminate\Http\Request;
|
||||
use Lang;
|
||||
|
||||
/**
|
||||
* PasswordController.
|
||||
*
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class PasswordController extends Controller
|
||||
{
|
||||
class PasswordController extends Controller {
|
||||
|
||||
use ResetsPasswords;
|
||||
|
||||
/**
|
||||
@@ -27,8 +28,7 @@ class PasswordController extends Controller
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(PhpMailController $PhpMailController)
|
||||
{
|
||||
public function __construct(PhpMailController $PhpMailController) {
|
||||
$this->PhpMailController = $PhpMailController;
|
||||
$this->middleware('guest');
|
||||
SettingsController::smtp();
|
||||
@@ -39,8 +39,7 @@ class PasswordController extends Controller
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function getEmail()
|
||||
{
|
||||
public function getEmail() {
|
||||
return view('auth.password');
|
||||
}
|
||||
|
||||
@@ -49,8 +48,7 @@ class PasswordController extends Controller
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function postEmail(Request $request)
|
||||
{
|
||||
public function postEmail(Request $request) {
|
||||
$date = date('Y-m-d H:i:s');
|
||||
$this->validate($request, ['email' => 'required|email']);
|
||||
$user = User::where('email', '=', $request->only('email'))->first();
|
||||
@@ -66,11 +64,12 @@ class PasswordController extends Controller
|
||||
} else {
|
||||
$create_password_reset = \DB::table('password_resets')->insert(['email' => $user->email, 'token' => $code, 'created_at' => $date]);
|
||||
}
|
||||
$this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('1', '0'), $to = ['name' => $user->user_name, 'email' => $user->email], $message = ['subject' => 'Your Password Reset Link', 'scenario' => 'reset-password'], $template_variables = ['user' => $user->user_name, 'email_address' => $user->email, 'password_reset_link' => url('password/reset/'.$code)]);
|
||||
$this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('1', '0'), $to = ['name' => $user->user_name, 'email' => $user->email], $message = ['subject' => 'Your Password Reset Link', 'scenario' => 'reset-password'], $template_variables = ['user' => $user->user_name, 'email_address' => $user->email, 'password_reset_link' => url('password/reset/' . $code)]);
|
||||
|
||||
return redirect()->back()->with('status', Lang::get('lang.we_have_e-mailed_your_password_reset_link'));
|
||||
} else {
|
||||
return redirect()->back()->with('errors', Lang::get("lang.we_can't_find_a_user_with_that_e-mail_address"));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -57,7 +57,7 @@ class ClientTicketController extends Controller
|
||||
* @return type view
|
||||
*/
|
||||
public function reply($id, Request $request)
|
||||
{
|
||||
{
|
||||
$tickets = Tickets::where('id', '=', $id)->first();
|
||||
$thread = Ticket_Thread::where('ticket_id', '=', $tickets->id)->first();
|
||||
|
||||
|
@@ -33,16 +33,15 @@ use Redirect;
|
||||
*
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class FormController extends Controller
|
||||
{
|
||||
class FormController extends Controller {
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
* Constructor to check.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(TicketWorkflowController $TicketWorkflowController)
|
||||
{
|
||||
public function __construct(TicketWorkflowController $TicketWorkflowController) {
|
||||
$this->middleware('board');
|
||||
// creating a TicketController instance
|
||||
$this->TicketWorkflowController = $TicketWorkflowController;
|
||||
@@ -55,8 +54,7 @@ class FormController extends Controller
|
||||
*
|
||||
* @return type
|
||||
*/
|
||||
public function getForm(Help_topic $topic, CountryCode $code)
|
||||
{
|
||||
public function getForm(Help_topic $topic, CountryCode $code) {
|
||||
if (\Config::get('database.install') == '%0%') {
|
||||
return \Redirect::route('license');
|
||||
}
|
||||
@@ -80,13 +78,13 @@ class FormController extends Controller
|
||||
*
|
||||
* @return type string
|
||||
*/
|
||||
public function postForm($id, Help_topic $topic)
|
||||
{
|
||||
public function postForm($id, Help_topic $topic) {
|
||||
if ($id != 0) {
|
||||
$helptopic = $topic->where('id', '=', $id)->first();
|
||||
$custom_form = $helptopic->custom_form;
|
||||
$values = Fields::where('forms_id', '=', $custom_form)->get();
|
||||
if (!$values) {
|
||||
|
||||
}
|
||||
if ($values) {
|
||||
foreach ($values as $value) {
|
||||
@@ -95,29 +93,29 @@ class FormController extends Controller
|
||||
$value = explode(',', $data);
|
||||
echo '<select class="form-control">';
|
||||
foreach ($value as $option) {
|
||||
echo '<option>'.$option.'</option>';
|
||||
echo '<option>' . $option . '</option>';
|
||||
}
|
||||
echo '</select></br>';
|
||||
} elseif ($value->type == 'radio') {
|
||||
$type2 = $value->value;
|
||||
$val = explode(',', $type2);
|
||||
echo '<label class="radio-inline">'.$value->label.'</label>   <input type="'.$value->type.'" name="'.$value->name.'"> '.$val[0].'
|
||||
   <input type="'.$value->type.'" name="'.$value->name.'"> '.$val[1].'</br>';
|
||||
echo '<label class="radio-inline">' . $value->label . '</label>   <input type="' . $value->type . '" name="' . $value->name . '"> ' . $val[0] . '
|
||||
   <input type="' . $value->type . '" name="' . $value->name . '"> ' . $val[1] . '</br>';
|
||||
} elseif ($value->type == 'textarea') {
|
||||
$type3 = $value->value;
|
||||
$v = explode(',', $type3);
|
||||
//dd($v);
|
||||
if (array_key_exists(1, $v)) {
|
||||
echo '<label>'.$value->label.'</label></br><textarea class=form-control rows="'.$v[0].'" cols="'.$v[1].'"></textarea></br>';
|
||||
echo '<label>' . $value->label . '</label></br><textarea class=form-control rows="' . $v[0] . '" cols="' . $v[1] . '"></textarea></br>';
|
||||
} else {
|
||||
echo '<label>'.$value->label.'</label></br><textarea class=form-control rows="10" cols="60"></textarea></br>';
|
||||
echo '<label>' . $value->label . '</label></br><textarea class=form-control rows="10" cols="60"></textarea></br>';
|
||||
}
|
||||
} elseif ($value->type == 'checkbox') {
|
||||
$type4 = $value->value;
|
||||
$check = explode(',', $type4);
|
||||
echo '<label class="radio-inline">'.$value->label.'   <input type="'.$value->type.'" name="'.$value->name.'">  '.$check[0].'</label><label class="radio-inline"><input type="'.$value->type.'" name="'.$value->name.'">  '.$check[1].'</label></br>';
|
||||
echo '<label class="radio-inline">' . $value->label . '   <input type="' . $value->type . '" name="' . $value->name . '">  ' . $check[0] . '</label><label class="radio-inline"><input type="' . $value->type . '" name="' . $value->name . '">  ' . $check[1] . '</label></br>';
|
||||
} else {
|
||||
echo '<label>'.$value->label.'</label><input type="'.$value->type.'" class="form-control" name="'.$value->name.'" /></br>';
|
||||
echo '<label>' . $value->label . '</label><input type="' . $value->type . '" class="form-control" name="' . $value->name . '" /></br>';
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -132,8 +130,8 @@ class FormController extends Controller
|
||||
* @param type Request $request
|
||||
* @param type User $user
|
||||
*/
|
||||
public function postedForm(User $user, ClientRequest $request, Ticket $ticket_settings, Ticket_source $ticket_source, Ticket_attachments $ta, CountryCode $code)
|
||||
{
|
||||
public function postedForm(User $user, ClientRequest $request, Ticket $ticket_settings, Ticket_source $ticket_source, Ticket_attachments $ta, CountryCode $code) {
|
||||
|
||||
$form_extras = $request->except('Name', 'Phone', 'Email', 'Subject', 'Details', 'helptopic', '_wysihtml5_mode', '_token');
|
||||
|
||||
$name = $request->input('Name');
|
||||
@@ -161,8 +159,8 @@ class FormController extends Controller
|
||||
$geoipcode = $code->where('iso', '=', $location['isoCode'])->first();
|
||||
if ($phonecode == null) {
|
||||
$data = [
|
||||
'fails' => Lang::get('lang.country-code-required-error'),
|
||||
'phonecode' => $geoipcode->phonecode,
|
||||
'fails' => Lang::get('lang.country-code-required-error'),
|
||||
'phonecode' => $geoipcode->phonecode,
|
||||
'country_code_error' => 1,
|
||||
];
|
||||
|
||||
@@ -171,8 +169,8 @@ class FormController extends Controller
|
||||
$code = CountryCode::select('phonecode')->where('phonecode', '=', $phonecode)->get();
|
||||
if (!count($code)) {
|
||||
$data = [
|
||||
'fails' => Lang::get('lang.incorrect-country-code-error'),
|
||||
'phonecode' => $geoipcode->phonecode,
|
||||
'fails' => Lang::get('lang.incorrect-country-code-error'),
|
||||
'phonecode' => $geoipcode->phonecode,
|
||||
'country_code_error' => 1,
|
||||
];
|
||||
|
||||
@@ -198,7 +196,7 @@ class FormController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
return Redirect::back()->with('success', Lang::get('lang.Ticket-has-been-created-successfully-your-ticket-number-is').' '.$result[0].'. '.Lang::get('lang.Please-save-this-for-future-reference'));
|
||||
return Redirect::back()->with('success', Lang::get('lang.Ticket-has-been-created-successfully-your-ticket-number-is') . ' ' . $result[0] . '. ' . Lang::get('lang.Please-save-this-for-future-reference'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -209,14 +207,13 @@ class FormController extends Controller
|
||||
*
|
||||
* @return type view
|
||||
*/
|
||||
public function post_ticket_reply($id, Request $request)
|
||||
{
|
||||
public function post_ticket_reply($id, Request $request) {
|
||||
try {
|
||||
if ($comment != null) {
|
||||
$tickets = Tickets::where('id', '=', $id)->first();
|
||||
$thread = Ticket_Thread::where('ticket_id', '=', $tickets->id)->first();
|
||||
|
||||
$subject = $thread->title.'[#'.$tickets->ticket_number.']';
|
||||
$subject = $thread->title . '[#' . $tickets->ticket_number . ']';
|
||||
$body = $request->input('comment');
|
||||
|
||||
$user_cred = User::where('id', '=', $tickets->user_id)->first();
|
||||
@@ -248,7 +245,7 @@ class FormController extends Controller
|
||||
} catch (Exception $e) {
|
||||
return \Redirect::back()->with('fails1', $e->getMessage());
|
||||
}
|
||||
//
|
||||
//
|
||||
// $comment = $request->input('comment');
|
||||
// if ($comment != null) {
|
||||
// $tickets = Tickets::where('id', '=', $id)->first();
|
||||
@@ -273,4 +270,5 @@ class FormController extends Controller
|
||||
// return \Redirect::back()->with('fails1', Lang::get('lang.please_fill_some_data'));
|
||||
// }
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -65,6 +65,9 @@ class UnAuthController extends Controller
|
||||
$ticket_number = $request->input('ticket_number');
|
||||
// get user details
|
||||
$user_details = User::where('email', '=', $email)->first();
|
||||
if($user_details == null) {
|
||||
return \Redirect::route('form')->with('fails', Lang::get('lang.sorry_that_email_is not_available_in_this_system'));
|
||||
}
|
||||
// get ticket details
|
||||
$ticket = Tickets::where('ticket_number', '=', $ticket_number)->first();
|
||||
if ($ticket == null) {
|
||||
|
@@ -15,11 +15,10 @@ use Redirect;
|
||||
*
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class WelcomepageController extends Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
// $this->middleware('board');
|
||||
class WelcomepageController extends Controller {
|
||||
|
||||
public function __construct() {
|
||||
// $this->middleware('board');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -27,8 +26,7 @@ class WelcomepageController extends Controller
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function get(System $note)
|
||||
{
|
||||
public function get(System $note) {
|
||||
if (Config::get('database.install') == '%0%') {
|
||||
return Redirect::route('licence');
|
||||
}
|
||||
@@ -40,12 +38,12 @@ class WelcomepageController extends Controller
|
||||
return view('themes.default1.client.guest-user.guest', compact('heading', 'content'));
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
public function index() {
|
||||
if (Config::get('database.install') == '%0%') {
|
||||
return Redirect::route('licence');
|
||||
}
|
||||
|
||||
return view('themes.default1.client.helpdesk.guest-user.index');
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -146,6 +146,9 @@ class UserController extends Controller
|
||||
{
|
||||
/* get the article_id where category_id == current category */
|
||||
$catid = $category->where('slug', $slug)->first();
|
||||
if(!$catid){
|
||||
return redirect()->back()->with('fails',Lang::get('lang.we_are_sorry_but_the_page_you_are_looking_for_can_not_be_found'));
|
||||
}
|
||||
$id = $catid->id;
|
||||
$all = $relation->where('category_id', $id)->get();
|
||||
// $all->setPath('');
|
||||
|
@@ -9,6 +9,8 @@ use App\Model\helpdesk\Ticket\Tickets;
|
||||
use Exception;
|
||||
use Illuminate\Http\Request;
|
||||
use Log;
|
||||
use DB;
|
||||
use Input;
|
||||
|
||||
class ApiSettings extends Controller
|
||||
{
|
||||
@@ -26,6 +28,8 @@ class ApiSettings extends Controller
|
||||
public function show()
|
||||
{
|
||||
try {
|
||||
/* fetch the values of system from system table */
|
||||
$systems = DB::table('settings_system')->whereId('1')->first();
|
||||
$details = [];
|
||||
$ticket_detail = '';
|
||||
$settings = $this->api;
|
||||
@@ -36,7 +40,7 @@ class ApiSettings extends Controller
|
||||
$ticket_detail = $details['ticket_detail'];
|
||||
}
|
||||
|
||||
return view('themes.default1.common.api.settings', compact('ticket_detail'));
|
||||
return view('themes.default1.common.api.settings', compact('ticket_detail', 'systems'));
|
||||
} catch (Exception $ex) {
|
||||
return redirect()->back()->with('fails', $ex->getMessage());
|
||||
}
|
||||
@@ -48,6 +52,12 @@ class ApiSettings extends Controller
|
||||
'ticket_detail' => 'url',
|
||||
]);
|
||||
try {
|
||||
// dd($request->input());
|
||||
DB::table('settings_system')
|
||||
->where('id', 1)
|
||||
->update(['api_enable' => Input::get('api_enable'),
|
||||
'api_key_mandatory' =>Input::get('api_key_mandatory') ,
|
||||
'api_key' =>Input::get('api_key')]);
|
||||
$settings = $this->api;
|
||||
if ($settings->get()->count() > 0) {
|
||||
foreach ($settings->get() as $set) {
|
||||
|
@@ -7,12 +7,11 @@ use App\Model\helpdesk\Notification\Notification;
|
||||
use App\Model\helpdesk\Notification\UserNotification;
|
||||
use App\User;
|
||||
|
||||
class NotificationController extends Controller
|
||||
{
|
||||
class NotificationController extends Controller {
|
||||
|
||||
public $user;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
public function __construct() {
|
||||
$user = new User();
|
||||
$this->user = $user;
|
||||
}
|
||||
@@ -22,8 +21,7 @@ class NotificationController extends Controller
|
||||
*
|
||||
* @return response
|
||||
*/
|
||||
public static function getNotifications()
|
||||
{
|
||||
public static function getNotifications() {
|
||||
$notifications = UserNotification::join('notifications', 'user_notification.notification_id', '=', 'notifications.id')
|
||||
->join('notification_types', 'notifications.type_id', '=', 'notification_types.id')
|
||||
->where('user_notification.user_id', '=', \Auth::user()->id)
|
||||
@@ -32,8 +30,7 @@ class NotificationController extends Controller
|
||||
return $notifications;
|
||||
}
|
||||
|
||||
public function create($model_id, $userid_created, $type_id, $forwhome = [])
|
||||
{
|
||||
public function create($model_id, $userid_created, $type_id, $forwhome = []) {
|
||||
try {
|
||||
if (empty($forwhome)) {
|
||||
$forwhome = $this->user->where('role', '!=', 'user')->get()->toArray();
|
||||
@@ -52,19 +49,16 @@ class NotificationController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
public function markAllRead($id)
|
||||
{
|
||||
public function markAllRead($id) {
|
||||
$markasread = UserNotification::where('user_id', '=', \Auth::user()->id)->where('is_read', '=', '0')->get();
|
||||
foreach ($markasread as $mark) {
|
||||
$mark->is_read = '1';
|
||||
$mark->save();
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
public function markRead($id)
|
||||
{
|
||||
public function markRead($id) {
|
||||
$markasread = UserNotification::where('notification_id', '=', $id)->where('user_id', '=', \Auth::user()->id)->where('is_read', '=', '0')->get();
|
||||
foreach ($markasread as $mark) {
|
||||
$mark->is_read = '1';
|
||||
@@ -74,15 +68,13 @@ class NotificationController extends Controller
|
||||
return 1;
|
||||
}
|
||||
|
||||
public function show()
|
||||
{
|
||||
public function show() {
|
||||
$notifications = $this->getNotifications();
|
||||
|
||||
return view('notifications-all', compact('notifications'));
|
||||
}
|
||||
|
||||
public function delete($id)
|
||||
{
|
||||
public function delete($id) {
|
||||
$markasread = UserNotification::where('notification_id', '=', $id)->where('user_id', '=', \Auth::user()->id)->get();
|
||||
foreach ($markasread as $mark) {
|
||||
$mark->delete();
|
||||
@@ -90,4 +82,5 @@ class NotificationController extends Controller
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -11,12 +11,10 @@ use App\Model\helpdesk\Settings\Email;
|
||||
use App\User;
|
||||
use Auth;
|
||||
|
||||
class PhpMailController extends Controller
|
||||
{
|
||||
public function fetch_smtp_details($id)
|
||||
{
|
||||
$emails = Emails::where('id', '=', $id)->first();
|
||||
class PhpMailController extends Controller {
|
||||
|
||||
public function fetch_smtp_details($id) {
|
||||
$emails = Emails::where('id', '=', $id)->first();
|
||||
return $emails;
|
||||
}
|
||||
|
||||
@@ -25,8 +23,7 @@ class PhpMailController extends Controller
|
||||
*
|
||||
* @return Mail
|
||||
*/
|
||||
public function sendmail($from, $to, $message, $template_variables)
|
||||
{
|
||||
public function sendmail($from, $to, $message, $template_variables) {
|
||||
// dd($from);
|
||||
$from_address = $this->fetch_smtp_details($from);
|
||||
if ($from_address == null) {
|
||||
@@ -192,8 +189,15 @@ class PhpMailController extends Controller
|
||||
if (isset($set['id'])) {
|
||||
$template_data = \App\Model\Common\Template::where('set_id', '=', $set->id)->where('type', '=', $template->id)->first();
|
||||
$contents = $template_data->message;
|
||||
if ($template_data->subject) {
|
||||
$subject = $template_data->subject;
|
||||
if ($template_data->variable == 1) {
|
||||
if ($template_data->subject) {
|
||||
$subject = $template_data->subject;
|
||||
if ($ticket_number != null) {
|
||||
$subject = $subject . ' [#' . $ticket_number . ']';
|
||||
}
|
||||
} else {
|
||||
$subject = $message['subject'];
|
||||
}
|
||||
} else {
|
||||
$subject = $message['subject'];
|
||||
}
|
||||
@@ -218,7 +222,8 @@ class PhpMailController extends Controller
|
||||
|
||||
// dd($messagebody);
|
||||
//$mail->SMTPDebug = 3; // Enable verbose debug output
|
||||
if ($protocol == 'smtp') {
|
||||
if ($protocol == "smtp") {
|
||||
|
||||
$mail->isSMTP(); // Set mailer to use SMTP
|
||||
$mail->Host = $host; // Specify main and backup SMTP servers
|
||||
$mail->SMTPAuth = true; // Enable SMTP authentication
|
||||
@@ -227,7 +232,7 @@ class PhpMailController extends Controller
|
||||
$mail->SMTPSecure = $smtpsecure; // Enable TLS encryption, `ssl` also accepted
|
||||
$mail->Port = $port; // TCP port to connect to
|
||||
$mail->setFrom($username, $fromname);
|
||||
} elseif ($protocol == 'mail') {
|
||||
} elseif ($protocol == "mail") {
|
||||
$mail->IsSendmail(); // telling the class to use SendMail transport
|
||||
if ($username == $fromname) {
|
||||
$mail->setFrom($username);
|
||||
@@ -265,7 +270,7 @@ class PhpMailController extends Controller
|
||||
$mail->Subject = $subject;
|
||||
if ($template == 'ticket-reply-agent') {
|
||||
$line = '---Reply above this line--- <br/><br/>';
|
||||
$mail->Body = utf8_decode($line.$messagebody);
|
||||
$mail->Body = utf8_decode($line . $messagebody);
|
||||
} else {
|
||||
$mail->Body = utf8_decode($messagebody);
|
||||
}
|
||||
@@ -288,12 +293,10 @@ class PhpMailController extends Controller
|
||||
*
|
||||
* @return MailNotification
|
||||
*/
|
||||
public function sendEmail($from, $to, $message)
|
||||
{
|
||||
// dd($from);
|
||||
public function sendEmail($from, $to, $message) {
|
||||
|
||||
$from_address = $this->fetch_smtp_details($from);
|
||||
|
||||
// dd($from_address);
|
||||
$username = $from_address->email_address;
|
||||
$fromname = $from_address->email_name;
|
||||
$password = \Crypt::decrypt($from_address->password);
|
||||
@@ -415,8 +418,7 @@ class PhpMailController extends Controller
|
||||
*
|
||||
* @return type
|
||||
*/
|
||||
public function company()
|
||||
{
|
||||
public function company() {
|
||||
$company = Company::Where('id', '=', '1')->first();
|
||||
if ($company->company_name == null) {
|
||||
$company = 'Support Center';
|
||||
@@ -427,49 +429,6 @@ class PhpMailController extends Controller
|
||||
return $company;
|
||||
}
|
||||
|
||||
// public function testmail($host = '', $username = '', $password = '', $smtpsecure = '', $port = '', $from = '', $recipants = '', $subject = '', $scenario = '', $cc = '', $bc = '', $ishtml = '', $altbody = '', $attachment = '', $agent = '', $ticket_number = '', $content = '') {
|
||||
// $mail = new \PHPMailer;
|
||||
// $status = \DB::table('settings_email')->first();
|
||||
// $path = '../resources/views/emails/';
|
||||
// $default = $status->template . '/';
|
||||
// $directory = $path . $default;
|
||||
// $template = "Admin_mail.blade.php";
|
||||
// $handle = fopen($directory . $template, "r");
|
||||
// $contents = fread($handle, filesize($directory . $template));
|
||||
// fclose($handle);
|
||||
// if ($template == 'Admin_mail.blade.php') {
|
||||
// $variables = array('{!! $agent !!}', '{!! $ticket_number !!}', '{!! $name !!}', '{!! $email !!}', '{!! $content !!}', '{!! $from !!}');
|
||||
// $data = array('sada', '12345', 'rahul', 'rahul@test.com', 'DemoContent', 'testing');
|
||||
// $messagebody = str_replace($variables, $data, $contents);
|
||||
// }
|
||||
// //$mail->SMTPDebug = 3; // Enable verbose debug output
|
||||
// $mail->isSMTP(); // Set mailer to use SMTP
|
||||
// $mail->Host = 'smtp.gmail.com'; // Specify main and backup SMTP servers
|
||||
// $mail->SMTPAuth = true; // Enable SMTP authentication
|
||||
// $mail->Username = 'sujitprasad4567@gmail.com'; // SMTP username
|
||||
// $mail->Password = 'pankajprasad22.'; // SMTP password
|
||||
// $mail->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted
|
||||
// $mail->Port = 587; // TCP port to connect to
|
||||
// $mail->setFrom('sujitprasad4567@gmail.com', 'Mailer');
|
||||
// $mail->addAddress('sada059@gmail.com', 'Joe User'); // Add a recipient
|
||||
// // Name is optional
|
||||
// $mail->addReplyTo('sada059@gmail.com', 'Information');
|
||||
// // Optional name
|
||||
// $mail->isHTML(true); // Set email format to HTML
|
||||
// $mail->addCC('cc@example.com');
|
||||
// $mail->addBCC('bcc@example.com');
|
||||
// $mail->addAttachment($attachment);
|
||||
// $mail->Subject = 'Here is the subject';
|
||||
// $mail->Body = $messagebody;
|
||||
// $mail->AltBody = $altbody;
|
||||
// if (!$mail->send()) {
|
||||
// echo 'Message could not be sent.';
|
||||
// echo 'Mailer Error: ' . $mail->ErrorInfo;
|
||||
// } else {
|
||||
// echo 'Message has been sent';
|
||||
// }
|
||||
// }
|
||||
|
||||
/**
|
||||
* Function to choose from address.
|
||||
*
|
||||
@@ -478,8 +437,7 @@ class PhpMailController extends Controller
|
||||
*
|
||||
* @return type integer
|
||||
*/
|
||||
public function mailfrom($reg, $dept_id)
|
||||
{
|
||||
public function mailfrom($reg, $dept_id) {
|
||||
$email = Email::where('id', '=', '1')->first();
|
||||
if ($reg == 1) {
|
||||
return $email->sys_email;
|
||||
@@ -492,4 +450,5 @@ class PhpMailController extends Controller
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -27,15 +27,14 @@ use Lang;
|
||||
* ***************************
|
||||
* Controller to keep smtp details and fetch where ever needed.
|
||||
*/
|
||||
class SettingsController extends Controller
|
||||
{
|
||||
class SettingsController extends Controller {
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return type void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
public function __construct() {
|
||||
// $this->smtp();
|
||||
$this->middleware('auth');
|
||||
$this->middleware('roles');
|
||||
@@ -53,8 +52,7 @@ class SettingsController extends Controller
|
||||
*
|
||||
* @return response
|
||||
*/
|
||||
public function widgets()
|
||||
{
|
||||
public function widgets() {
|
||||
return view('themes.default1.admin.helpdesk.theme.widgets');
|
||||
}
|
||||
|
||||
@@ -63,8 +61,7 @@ class SettingsController extends Controller
|
||||
*
|
||||
* @return response
|
||||
*/
|
||||
public function list_widget()
|
||||
{
|
||||
public function list_widget() {
|
||||
return \Datatable::collection(Widgets::where('id', '<', '7')->get())
|
||||
->searchColumns('name')
|
||||
->orderColumns('name', 'title', 'value')
|
||||
@@ -78,33 +75,33 @@ class SettingsController extends Controller
|
||||
return $model->value;
|
||||
})
|
||||
->addColumn('Actions', function ($model) {
|
||||
return '<span data-toggle="modal" data-target="#edit_widget'.$model->id.'"><a class="btn btn-warning btn-xs">'.\Lang::get('lang.edit').'</a></span>
|
||||
<div class="modal fade" id="edit_widget'.$model->id.'">
|
||||
return '<span data-toggle="modal" data-target="#edit_widget' . $model->id . '"><a class="btn btn-warning btn-xs">' . \Lang::get('lang.edit') . '</a></span>
|
||||
<div class="modal fade" id="edit_widget' . $model->id . '">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<form action="'.url('edit-widget/'.$model->id).'" method="POST">
|
||||
<form action="' . url('edit-widget/' . $model->id) . '" method="POST">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">'.strtoupper($model->name).' </h4>
|
||||
<h4 class="modal-title">' . strtoupper($model->name) . ' </h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="form-group" style="width:100%">
|
||||
<label>'.\Lang::get('lang.title').'</label><br/>
|
||||
<input type="text" name="title" value="'.$model->title.'" class="form-control" style="width:100%">
|
||||
<label>' . \Lang::get('lang.title') . '</label><br/>
|
||||
<input type="text" name="title" value="' . $model->title . '" class="form-control" style="width:100%">
|
||||
</div>
|
||||
<br/>
|
||||
<div class="form-group" style="width:100%">
|
||||
<label>'.\Lang::get('lang.content').'</label><br/>
|
||||
<textarea name="content" class="form-control" style="width:100%" id="Content'.$model->id.'">'.$model->value.'</textarea>
|
||||
<label>' . \Lang::get('lang.content') . '</label><br/>
|
||||
<textarea name="content" class="form-control" style="width:100%" id="Content' . $model->id . '">' . $model->value . '</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal" id="dismis2">'.\Lang::get('lang.close').'</button>
|
||||
<input type="submit" class="btn btn-primary" value="'.\Lang::get('lang.update').'">
|
||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal" id="dismis2">' . \Lang::get('lang.close') . '</button>
|
||||
<input type="submit" class="btn btn-primary" value="' . \Lang::get('lang.update') . '">
|
||||
</div>
|
||||
<script>
|
||||
$(function () {
|
||||
$("#Content'.$model->id.'").wysihtml5();
|
||||
$("#Content' . $model->id . '").wysihtml5();
|
||||
});
|
||||
</script>
|
||||
</form>
|
||||
@@ -123,15 +120,14 @@ class SettingsController extends Controller
|
||||
*
|
||||
* @return type response
|
||||
*/
|
||||
public function edit_widget($id, Widgets $widgets, Request $request)
|
||||
{
|
||||
public function edit_widget($id, Widgets $widgets, Request $request) {
|
||||
$widget = $widgets->where('id', '=', $id)->first();
|
||||
$widget->title = $request->title;
|
||||
$widget->value = $request->content;
|
||||
try {
|
||||
$widget->save();
|
||||
|
||||
return redirect()->back()->with('success', $widget->name.Lang::get('lang.saved_successfully'));
|
||||
return redirect()->back()->with('success', $widget->name . Lang::get('lang.saved_successfully'));
|
||||
} catch (Exception $e) {
|
||||
return redirect()->back()->with('fails', $e->getMessage());
|
||||
}
|
||||
@@ -142,8 +138,7 @@ class SettingsController extends Controller
|
||||
*
|
||||
* @return response
|
||||
*/
|
||||
public function social_buttons()
|
||||
{
|
||||
public function social_buttons() {
|
||||
return view('themes.default1.admin.helpdesk.theme.social');
|
||||
}
|
||||
|
||||
@@ -152,8 +147,7 @@ class SettingsController extends Controller
|
||||
*
|
||||
* @return response
|
||||
*/
|
||||
public function list_social_buttons()
|
||||
{
|
||||
public function list_social_buttons() {
|
||||
return \Datatable::collection(Widgets::where('id', '>', '6')->get())
|
||||
->searchColumns('name')
|
||||
->orderColumns('name', 'value')
|
||||
@@ -164,25 +158,25 @@ class SettingsController extends Controller
|
||||
return $model->value;
|
||||
})
|
||||
->addColumn('Actions', function ($model) {
|
||||
return '<span data-toggle="modal" data-target="#edit_widget'.$model->id.'"><a class="btn btn-warning btn-xs">'.\Lang::get('lang.edit').'</a></span>
|
||||
<div class="modal fade" id="edit_widget'.$model->id.'">
|
||||
return '<span data-toggle="modal" data-target="#edit_widget' . $model->id . '"><a class="btn btn-warning btn-xs">' . \Lang::get('lang.edit') . '</a></span>
|
||||
<div class="modal fade" id="edit_widget' . $model->id . '">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<form action="'.url('edit-widget/'.$model->id).'" method="POST">
|
||||
<form action="' . url('edit-widget/' . $model->id) . '" method="POST">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">'.strtoupper($model->name).' </h4>
|
||||
<h4 class="modal-title">' . strtoupper($model->name) . ' </h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<br/>
|
||||
<div class="form-group" style="width:100%">
|
||||
<label>'.\Lang::get('lang.link').'</label><br/>
|
||||
<input type="url" name="content" class="form-control" style="width:100%" value="'.$model->value.'">
|
||||
<label>' . \Lang::get('lang.link') . '</label><br/>
|
||||
<input type="url" name="content" class="form-control" style="width:100%" value="' . $model->value . '">
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal" id="dismis2">'.\Lang::get('lang.close').'</button>
|
||||
<input type="submit" class="btn btn-primary" value="'.\Lang::get('lang.update').'">
|
||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal" id="dismis2">' . \Lang::get('lang.close') . '</button>
|
||||
<input type="submit" class="btn btn-primary" value="' . \Lang::get('lang.update') . '">
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@@ -200,15 +194,14 @@ class SettingsController extends Controller
|
||||
*
|
||||
* @return type response
|
||||
*/
|
||||
public function edit_social_buttons($id, Widgets $widgets, Request $request)
|
||||
{
|
||||
public function edit_social_buttons($id, Widgets $widgets, Request $request) {
|
||||
$widget = $widgets->where('id', '=', $id)->first();
|
||||
$widget->title = $request->title;
|
||||
$widget->value = $request->content;
|
||||
try {
|
||||
$widget->save();
|
||||
|
||||
return redirect()->back()->with('success', $widget->name.' Saved Successfully');
|
||||
return redirect()->back()->with('success', $widget->name . ' Saved Successfully');
|
||||
} catch (Exception $e) {
|
||||
return redirect()->back()->with('fails', $e->errorInfo[2]);
|
||||
}
|
||||
@@ -219,8 +212,7 @@ class SettingsController extends Controller
|
||||
*
|
||||
* @return type void
|
||||
*/
|
||||
public static function driver()
|
||||
{
|
||||
public static function driver() {
|
||||
$set = new Smtp();
|
||||
$settings = Smtp::where('id', '=', '1')->first();
|
||||
Config::set('mail.host', $settings->driver);
|
||||
@@ -231,8 +223,7 @@ class SettingsController extends Controller
|
||||
*
|
||||
* @return type void
|
||||
*/
|
||||
public static function host()
|
||||
{
|
||||
public static function host() {
|
||||
$set = new Smtp();
|
||||
$settings = Smtp::where('id', '=', '1')->first();
|
||||
Config::set('mail.host', $settings->host);
|
||||
@@ -243,8 +234,7 @@ class SettingsController extends Controller
|
||||
*
|
||||
* @return type void
|
||||
*/
|
||||
public static function port()
|
||||
{
|
||||
public static function port() {
|
||||
$set = new Smtp();
|
||||
$settings = Smtp::where('id', '=', '1')->first();
|
||||
Config::set('mail.port', intval($settings->port));
|
||||
@@ -255,8 +245,7 @@ class SettingsController extends Controller
|
||||
*
|
||||
* @return type void
|
||||
*/
|
||||
public static function from()
|
||||
{
|
||||
public static function from() {
|
||||
$set = new Smtp();
|
||||
$settings = Smtp::where('id', '=', '1')->first();
|
||||
Config::set('mail.from', ['address' => $settings->email, 'name' => $settings->company_name]);
|
||||
@@ -267,8 +256,7 @@ class SettingsController extends Controller
|
||||
*
|
||||
* @return type void
|
||||
*/
|
||||
public static function encryption()
|
||||
{
|
||||
public static function encryption() {
|
||||
$set = new Smtp();
|
||||
$settings = Smtp::where('id', '=', '1')->first();
|
||||
Config::set('mail.encryption', $settings->encryption);
|
||||
@@ -279,8 +267,7 @@ class SettingsController extends Controller
|
||||
*
|
||||
* @return type void
|
||||
*/
|
||||
public static function username()
|
||||
{
|
||||
public static function username() {
|
||||
$set = new Smtp();
|
||||
$settings = Smtp::where('id', '=', '1')->first();
|
||||
Config::set('mail.username', $settings->email);
|
||||
@@ -291,8 +278,7 @@ class SettingsController extends Controller
|
||||
*
|
||||
* @return type void
|
||||
*/
|
||||
public static function password()
|
||||
{
|
||||
public static function password() {
|
||||
$settings = Smtp::first();
|
||||
if ($settings->password) {
|
||||
$pass = $settings->password;
|
||||
@@ -306,8 +292,7 @@ class SettingsController extends Controller
|
||||
*
|
||||
* @return type view
|
||||
*/
|
||||
public function getsmtp()
|
||||
{
|
||||
public function getsmtp() {
|
||||
$settings = Smtp::where('id', '=', '1')->first();
|
||||
|
||||
return view('themes.default1.admin.helpdesk.emails.smtp', compact('settings'));
|
||||
@@ -318,8 +303,7 @@ class SettingsController extends Controller
|
||||
*
|
||||
* @return type view
|
||||
*/
|
||||
public function postsmtp(SmtpRequest $request)
|
||||
{
|
||||
public function postsmtp(SmtpRequest $request) {
|
||||
$data = Smtp::where('id', '=', 1)->first();
|
||||
$data->driver = $request->input('driver');
|
||||
$data->host = $request->input('host');
|
||||
@@ -342,8 +326,7 @@ class SettingsController extends Controller
|
||||
*
|
||||
* @return type void
|
||||
*/
|
||||
public static function smtp()
|
||||
{
|
||||
public static function smtp() {
|
||||
$settings = Smtp::where('id', '=', '1')->first();
|
||||
if ($settings->password) {
|
||||
$password = Crypt::decrypt($settings->password);
|
||||
@@ -364,8 +347,7 @@ class SettingsController extends Controller
|
||||
*
|
||||
* @return type view\
|
||||
*/
|
||||
public function settings(Smtp $set)
|
||||
{
|
||||
public function settings(Smtp $set) {
|
||||
$settings = $set->where('id', '1')->first();
|
||||
|
||||
return view('themes.default1.admin.settings', compact('settings'));
|
||||
@@ -379,8 +361,7 @@ class SettingsController extends Controller
|
||||
*
|
||||
* @return type view
|
||||
*/
|
||||
public function PostSettings(Settings $set, Request $request)
|
||||
{
|
||||
public function PostSettings(Settings $set, Request $request) {
|
||||
$settings = $set->where('id', '1')->first();
|
||||
$pass = $request->input('password');
|
||||
$password = Crypt::encrypt($pass);
|
||||
@@ -393,7 +374,7 @@ class SettingsController extends Controller
|
||||
if (Input::file('logo')) {
|
||||
$name = Input::file('logo')->getClientOriginalName();
|
||||
$destinationPath = 'dist/logo';
|
||||
$fileName = rand(0000, 9999).'.'.$name;
|
||||
$fileName = rand(0000, 9999) . '.' . $name;
|
||||
Input::file('logo')->move($destinationPath, $fileName);
|
||||
$settings->logo = $fileName;
|
||||
$settings->save();
|
||||
@@ -412,13 +393,12 @@ class SettingsController extends Controller
|
||||
*
|
||||
* @return type
|
||||
*/
|
||||
public function version_check()
|
||||
{
|
||||
public function version_check() {
|
||||
$response_url = \URL::route('post-version-check');
|
||||
echo "<form action='http://www.faveohelpdesk.com/billing/public/version' method='post' name='redirect'>";
|
||||
echo "<input type='hidden' name='_token' value='csrf_token()'/>";
|
||||
echo "<input type='hidden' name='title' value='Faveo helpdesk community'/>";
|
||||
echo "<input type='hidden' name='response_url' value='".$response_url."' />";
|
||||
echo "<input type='hidden' name='response_url' value='" . $response_url . "' />";
|
||||
echo '</form>';
|
||||
echo "<script language='javascript'>document.redirect.submit();</script>";
|
||||
}
|
||||
@@ -428,11 +408,10 @@ class SettingsController extends Controller
|
||||
*
|
||||
* @return type
|
||||
*/
|
||||
public function post_version_check(Request $request)
|
||||
{
|
||||
// dd($request);
|
||||
public function post_version_check(Request $request) {
|
||||
// dd($request);
|
||||
$current_version = \Config::get('app.version');
|
||||
$current_version = explode(' ', $current_version);
|
||||
$current_version = explode(' ',$current_version);
|
||||
$current_version = $current_version[1];
|
||||
$new_version = $request->value;
|
||||
if ($current_version == $new_version) {
|
||||
@@ -442,25 +421,21 @@ class SettingsController extends Controller
|
||||
$version->current_version = $current_version;
|
||||
$version->new_version = $new_version;
|
||||
$version->save();
|
||||
|
||||
return redirect()->route('checkupdate')->with('info', ' Version '.$new_version.' is Available');
|
||||
return redirect()->route('checkupdate')->with('info', ' Version ' . $new_version . ' is Available');
|
||||
} else {
|
||||
return redirect()->route('checkupdate')->with('info', ' Error Checking Version');
|
||||
}
|
||||
}
|
||||
|
||||
public function getupdate()
|
||||
{
|
||||
public function getupdate() {
|
||||
return \View::make('themes.default1.admin.helpdesk.settings.checkupdate');
|
||||
}
|
||||
|
||||
public function Plugins()
|
||||
{
|
||||
public function Plugins() {
|
||||
return view('themes.default1.admin.helpdesk.settings.plugins');
|
||||
}
|
||||
|
||||
public function GetPlugin()
|
||||
{
|
||||
public function GetPlugin() {
|
||||
$plugins = $this->fetchConfig();
|
||||
|
||||
return \Datatable::collection(new Collection($plugins))
|
||||
@@ -468,15 +443,15 @@ class SettingsController extends Controller
|
||||
->addColumn('name', function ($model) {
|
||||
if (array_has($model, 'path')) {
|
||||
if ($model['status'] == 0) {
|
||||
$activate = '<a href='.url('plugin/status/'.$model['path']).'>Activate</a>';
|
||||
$activate = '<a href=' . url('plugin/status/' . $model['path']) . '>Activate</a>';
|
||||
$settings = ' ';
|
||||
} else {
|
||||
$settings = '<a href='.url($model['settings']).'>Settings</a> | ';
|
||||
$activate = '<a href='.url('plugin/status/'.$model['path']).'>Deactivate</a>';
|
||||
$settings = '<a href=' . url($model['settings']) . '>Settings</a> | ';
|
||||
$activate = '<a href=' . url('plugin/status/' . $model['path']) . '>Deactivate</a>';
|
||||
}
|
||||
|
||||
$delete = '<a href= id=delete'.$model['path'].' data-toggle=modal data-target=#del'.$model['path']."><span style='color:red'>Delete</span></a>"
|
||||
."<div class='modal fade' id=del".$model['path'].">
|
||||
$delete = '<a href= id=delete' . $model['path'] . ' data-toggle=modal data-target=#del' . $model['path'] . "><span style='color:red'>Delete</span></a>"
|
||||
. "<div class='modal fade' id=del" . $model['path'] . ">
|
||||
<div class='modal-dialog'>
|
||||
<div class=modal-content>
|
||||
<div class=modal-header>
|
||||
@@ -485,8 +460,8 @@ class SettingsController extends Controller
|
||||
<div class=modal-body>
|
||||
<p>Are you Sure ?</p>
|
||||
<div class=modal-footer>
|
||||
<button type=button class='btn btn-default pull-left' data-dismiss=modal id=dismis>".\Lang::get('lang.close').'</button>
|
||||
<a href='.url('plugin/delete/'.$model['path'])."><button class='btn btn-danger'>Delete</button></a>
|
||||
<button type=button class='btn btn-default pull-left' data-dismiss=modal id=dismis>" . \Lang::get('lang.close') . '</button>
|
||||
<a href=' . url('plugin/delete/' . $model['path']) . "><button class='btn btn-danger'>Delete</button></a>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -494,12 +469,12 @@ class SettingsController extends Controller
|
||||
</div>
|
||||
</div>
|
||||
</div>";
|
||||
$action = '<br><br>'.$delete.' | '.$settings.$activate;
|
||||
$action = '<br><br>' . $delete . ' | ' . $settings . $activate;
|
||||
} else {
|
||||
$action = '';
|
||||
}
|
||||
|
||||
return ucfirst($model['name']).$action;
|
||||
return ucfirst($model['name']) . $action;
|
||||
})
|
||||
->addColumn('description', function ($model) {
|
||||
return ucfirst($model['description']);
|
||||
@@ -508,7 +483,7 @@ class SettingsController extends Controller
|
||||
return ucfirst($model['author']);
|
||||
})
|
||||
->addColumn('website', function ($model) {
|
||||
return '<a href='.$model['website'].' target=_blank>'.$model['website'].'</a>';
|
||||
return '<a href=' . $model['website'] . ' target=_blank>' . $model['website'] . '</a>';
|
||||
})
|
||||
->addColumn('version', function ($model) {
|
||||
return $model['version'];
|
||||
@@ -521,9 +496,8 @@ class SettingsController extends Controller
|
||||
*
|
||||
* @return type
|
||||
*/
|
||||
public function ReadPlugins()
|
||||
{
|
||||
$dir = app_path().DIRECTORY_SEPARATOR.'Plugins';
|
||||
public function ReadPlugins() {
|
||||
$dir = app_path() . DIRECTORY_SEPARATOR . 'Plugins';
|
||||
$plugins = array_diff(scandir($dir), ['.', '..']);
|
||||
|
||||
return $plugins;
|
||||
@@ -536,13 +510,12 @@ class SettingsController extends Controller
|
||||
*
|
||||
* @return type
|
||||
*/
|
||||
public function PostPlugins(Request $request)
|
||||
{
|
||||
public function PostPlugins(Request $request) {
|
||||
$v = $this->validate($request, ['plugin' => 'required|mimes:application/zip,zip,Zip']);
|
||||
$plug = new Plugin();
|
||||
$file = $request->file('plugin');
|
||||
//dd($file);
|
||||
$destination = app_path().DIRECTORY_SEPARATOR.'Plugins';
|
||||
$destination = app_path() . DIRECTORY_SEPARATOR . 'Plugins';
|
||||
$zipfile = $file->getRealPath();
|
||||
/*
|
||||
* get the file name and remove .zip
|
||||
@@ -551,30 +524,30 @@ class SettingsController extends Controller
|
||||
$filename2 = str_replace('.zip', '', $filename2);
|
||||
$filename1 = ucfirst($file->getClientOriginalName());
|
||||
$filename = str_replace('.zip', '', $filename1);
|
||||
mkdir($destination.DIRECTORY_SEPARATOR.$filename);
|
||||
mkdir($destination . DIRECTORY_SEPARATOR . $filename);
|
||||
/*
|
||||
* extract the zip file using zipper
|
||||
*/
|
||||
\Zipper::make($zipfile)->folder($filename2)->extractTo($destination.DIRECTORY_SEPARATOR.$filename);
|
||||
\Zipper::make($zipfile)->folder($filename2)->extractTo($destination . DIRECTORY_SEPARATOR . $filename);
|
||||
|
||||
$file = app_path().DIRECTORY_SEPARATOR.'Plugins'.DIRECTORY_SEPARATOR.$filename; // Plugin file path
|
||||
$file = app_path() . DIRECTORY_SEPARATOR . 'Plugins' . DIRECTORY_SEPARATOR . $filename; // Plugin file path
|
||||
|
||||
if (file_exists($file)) {
|
||||
$seviceporvider = $file.DIRECTORY_SEPARATOR.'ServiceProvider.php';
|
||||
$config = $file.DIRECTORY_SEPARATOR.'config.php';
|
||||
$seviceporvider = $file . DIRECTORY_SEPARATOR . 'ServiceProvider.php';
|
||||
$config = $file . DIRECTORY_SEPARATOR . 'config.php';
|
||||
if (file_exists($seviceporvider) && file_exists($config)) {
|
||||
/*
|
||||
* move to faveo config
|
||||
*/
|
||||
$faveoconfig = config_path().DIRECTORY_SEPARATOR.'plugins'.DIRECTORY_SEPARATOR.$filename.'.php';
|
||||
$faveoconfig = config_path() . DIRECTORY_SEPARATOR . 'plugins' . DIRECTORY_SEPARATOR . $filename . '.php';
|
||||
if ($faveoconfig) {
|
||||
|
||||
//copy($config, $faveoconfig);
|
||||
/*
|
||||
* write provider list in app.php line 128
|
||||
*/
|
||||
$app = base_path().DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'app.php';
|
||||
$str = "\n\n\t\t\t'App\\Plugins\\$filename"."\\ServiceProvider',";
|
||||
$app = base_path() . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'app.php';
|
||||
$str = "\n\n\t\t\t'App\\Plugins\\$filename" . "\\ServiceProvider',";
|
||||
$line_i_am_looking_for = 144;
|
||||
$lines = file($app, FILE_IGNORE_NEW_LINES);
|
||||
$lines[$line_i_am_looking_for] = $str;
|
||||
@@ -588,7 +561,7 @@ class SettingsController extends Controller
|
||||
*/
|
||||
$this->deleteDirectory($file);
|
||||
|
||||
return redirect()->back()->with('fails', 'Their is no '.$file);
|
||||
return redirect()->back()->with('fails', 'Their is no ' . $file);
|
||||
}
|
||||
} else {
|
||||
/*
|
||||
@@ -596,7 +569,7 @@ class SettingsController extends Controller
|
||||
*/
|
||||
$this->deleteDirectory($file);
|
||||
|
||||
return redirect()->back()->with('fails', 'Their is no <b>config.php or ServiceProvider.php</b> '.$file);
|
||||
return redirect()->back()->with('fails', 'Their is no <b>config.php or ServiceProvider.php</b> ' . $file);
|
||||
}
|
||||
} else {
|
||||
/*
|
||||
@@ -604,7 +577,7 @@ class SettingsController extends Controller
|
||||
*/
|
||||
$this->deleteDirectory($file);
|
||||
|
||||
return redirect()->back()->with('fails', '<b>Plugin File Path is not exist</b> '.$file);
|
||||
return redirect()->back()->with('fails', '<b>Plugin File Path is not exist</b> ' . $file);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -615,8 +588,7 @@ class SettingsController extends Controller
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function deleteDirectory($dir)
|
||||
{
|
||||
public function deleteDirectory($dir) {
|
||||
if (!file_exists($dir)) {
|
||||
return true;
|
||||
}
|
||||
@@ -627,8 +599,8 @@ class SettingsController extends Controller
|
||||
if ($item == '.' || $item == '..') {
|
||||
continue;
|
||||
}
|
||||
chmod($dir.DIRECTORY_SEPARATOR.$item, 0777);
|
||||
if (!$this->deleteDirectory($dir.DIRECTORY_SEPARATOR.$item)) {
|
||||
chmod($dir . DIRECTORY_SEPARATOR . $item, 0777);
|
||||
if (!$this->deleteDirectory($dir . DIRECTORY_SEPARATOR . $item)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -637,9 +609,8 @@ class SettingsController extends Controller
|
||||
return rmdir($dir);
|
||||
}
|
||||
|
||||
public function ReadConfigs()
|
||||
{
|
||||
$dir = app_path().DIRECTORY_SEPARATOR.'Plugins'.DIRECTORY_SEPARATOR;
|
||||
public function ReadConfigs() {
|
||||
$dir = app_path() . DIRECTORY_SEPARATOR . 'Plugins' . DIRECTORY_SEPARATOR;
|
||||
$directories = scandir($dir);
|
||||
$files = [];
|
||||
foreach ($directories as $key => $file) {
|
||||
@@ -647,7 +618,7 @@ class SettingsController extends Controller
|
||||
continue;
|
||||
}
|
||||
|
||||
if (is_dir($dir.DIRECTORY_SEPARATOR.$file)) {
|
||||
if (is_dir($dir . DIRECTORY_SEPARATOR . $file)) {
|
||||
$files[$key] = $file;
|
||||
}
|
||||
}
|
||||
@@ -656,7 +627,7 @@ class SettingsController extends Controller
|
||||
$plugins = [];
|
||||
if (count($files) > 0) {
|
||||
foreach ($files as $key => $file) {
|
||||
$plugin = $dir.$file;
|
||||
$plugin = $dir . $file;
|
||||
$plugins[$key] = array_diff(scandir($plugin), ['.', '..', 'ServiceProvider.php']);
|
||||
$plugins[$key]['file'] = $plugin;
|
||||
}
|
||||
@@ -666,7 +637,7 @@ class SettingsController extends Controller
|
||||
if ($dh = opendir($dir)) {
|
||||
while (($file = readdir($dh)) !== false) {
|
||||
if ($file == 'config.php') {
|
||||
$config[] = $dir.DIRECTORY_SEPARATOR.$file;
|
||||
$config[] = $dir . DIRECTORY_SEPARATOR . $file;
|
||||
}
|
||||
}
|
||||
closedir($dh);
|
||||
@@ -679,8 +650,7 @@ class SettingsController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
public function fetchConfig()
|
||||
{
|
||||
public function fetchConfig() {
|
||||
$configs = $this->ReadConfigs();
|
||||
//dd($configs);
|
||||
$plugs = new Plugin();
|
||||
@@ -716,15 +686,14 @@ class SettingsController extends Controller
|
||||
return $attributes;
|
||||
}
|
||||
|
||||
public function DeletePlugin($slug)
|
||||
{
|
||||
$dir = app_path().DIRECTORY_SEPARATOR.'Plugins'.DIRECTORY_SEPARATOR.$slug;
|
||||
public function DeletePlugin($slug) {
|
||||
$dir = app_path() . DIRECTORY_SEPARATOR . 'Plugins' . DIRECTORY_SEPARATOR . $slug;
|
||||
$this->deleteDirectory($dir);
|
||||
/*
|
||||
* remove service provider from app.php
|
||||
*/
|
||||
$str = "'App\\Plugins\\$slug"."\\ServiceProvider',";
|
||||
$path_to_file = base_path().DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'app.php';
|
||||
$str = "'App\\Plugins\\$slug" . "\\ServiceProvider',";
|
||||
$path_to_file = base_path() . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'app.php';
|
||||
$file_contents = file_get_contents($path_to_file);
|
||||
$file_contents = str_replace($str, '//', $file_contents);
|
||||
file_put_contents($path_to_file, $file_contents);
|
||||
@@ -737,13 +706,12 @@ class SettingsController extends Controller
|
||||
return redirect()->back()->with('success', 'Deleted Successfully');
|
||||
}
|
||||
|
||||
public function StatusPlugin($slug)
|
||||
{
|
||||
public function StatusPlugin($slug) {
|
||||
$plugs = new Plugin();
|
||||
$plug = $plugs->where('name', $slug)->first();
|
||||
if (!$plug) {
|
||||
$app = base_path().DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'app.php';
|
||||
$str = "\n'App\\Plugins\\$slug"."\\ServiceProvider',";
|
||||
$app = base_path() . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'app.php';
|
||||
$str = "\n'App\\Plugins\\$slug" . "\\ServiceProvider',";
|
||||
$line_i_am_looking_for = 144;
|
||||
$lines = file($app, FILE_IGNORE_NEW_LINES);
|
||||
$lines[$line_i_am_looking_for] = $str;
|
||||
@@ -756,8 +724,8 @@ class SettingsController extends Controller
|
||||
if ($status == 0) {
|
||||
$plug->status = 1;
|
||||
|
||||
$app = base_path().DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'app.php';
|
||||
$str = "\n'App\\Plugins\\$slug"."\\ServiceProvider',";
|
||||
$app = base_path() . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'app.php';
|
||||
$str = "\n'App\\Plugins\\$slug" . "\\ServiceProvider',";
|
||||
$line_i_am_looking_for = 144;
|
||||
$lines = file($app, FILE_IGNORE_NEW_LINES);
|
||||
$lines[$line_i_am_looking_for] = $str;
|
||||
@@ -768,8 +736,8 @@ class SettingsController extends Controller
|
||||
/*
|
||||
* remove service provider from app.php
|
||||
*/
|
||||
$str = "\n'App\\Plugins\\$slug"."\\ServiceProvider',";
|
||||
$path_to_file = base_path().DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'app.php';
|
||||
$str = "\n'App\\Plugins\\$slug" . "\\ServiceProvider',";
|
||||
$path_to_file = base_path() . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'app.php';
|
||||
|
||||
$file_contents = file_get_contents($path_to_file);
|
||||
$file_contents = str_replace($str, '//', $file_contents);
|
||||
|
@@ -16,13 +16,12 @@ use Lang;
|
||||
* |======================================================
|
||||
* This controller is for CRUD email templates.
|
||||
*/
|
||||
class TemplateController extends Controller
|
||||
{
|
||||
class TemplateController extends Controller {
|
||||
|
||||
public $template;
|
||||
public $type;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
public function __construct() {
|
||||
$this->middleware('auth');
|
||||
$this->middleware('roles');
|
||||
|
||||
@@ -38,8 +37,7 @@ class TemplateController extends Controller
|
||||
*
|
||||
* @return type view
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
public function index() {
|
||||
try {
|
||||
return view('themes.default1.common.template.inbox');
|
||||
} catch (\Exception $ex) {
|
||||
@@ -55,8 +53,7 @@ class TemplateController extends Controller
|
||||
*
|
||||
* @return type view
|
||||
*/
|
||||
public function showTemplate($id)
|
||||
{
|
||||
public function showTemplate($id) {
|
||||
try {
|
||||
$templates = Template::where('set_id', '=', $id)->get();
|
||||
|
||||
@@ -73,8 +70,7 @@ class TemplateController extends Controller
|
||||
*
|
||||
* @return type datatable
|
||||
*/
|
||||
public function GetTemplates(Request $request)
|
||||
{
|
||||
public function GetTemplates(Request $request) {
|
||||
$id = $request->input('id');
|
||||
|
||||
return \Datatable::collection($this->template->where('set_id', '=', $id)->select('id', 'name', 'type')->get())
|
||||
@@ -83,7 +79,7 @@ class TemplateController extends Controller
|
||||
return $this->type->where('id', $model->type)->first()->name;
|
||||
})
|
||||
->addColumn('action', function ($model) {
|
||||
return '<a href='.url('templates/'.$model->id.'/edit')." class='btn btn-sm btn-primary'>Edit</a>";
|
||||
return '<a href=' . url('templates/' . $model->id . '/edit') . " class='btn btn-sm btn-primary'>Edit</a>";
|
||||
})
|
||||
->searchColumns('name')
|
||||
->orderColumns('name')
|
||||
@@ -93,12 +89,10 @@ class TemplateController extends Controller
|
||||
/**
|
||||
* @return type view
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
public function create() {
|
||||
try {
|
||||
$i = $this->template->orderBy('created_at', 'desc')->first()->id + 1;
|
||||
$type = $this->type->lists('name', 'id')->toArray();
|
||||
|
||||
return view('themes.default1.common.template.create', compact('type'));
|
||||
} catch (\Exception $ex) {
|
||||
return redirect()->back()->with('fails', $ex->getMessage());
|
||||
@@ -112,20 +106,21 @@ class TemplateController extends Controller
|
||||
*
|
||||
* @return type redirect
|
||||
*/
|
||||
public function store(TemplateRequest $request)
|
||||
{
|
||||
public function store(TemplateRequest $request) {
|
||||
try {
|
||||
//dd($request);
|
||||
$this->template->fill($request->input())->save();
|
||||
|
||||
return redirect('templates')->with('success', Lang::get('lang.template_saved_successfully'));
|
||||
} catch (\Exception $ex) {
|
||||
return redirect()->back()->with('fails', $ex->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
/**
|
||||
* function to get the edit page of template
|
||||
* @param type $id
|
||||
* @return type
|
||||
*/
|
||||
public function edit($id) {
|
||||
try {
|
||||
$i = $this->template->orderBy('created_at', 'desc')->first()->id + 1;
|
||||
$template = $this->template->where('id', $id)->first();
|
||||
@@ -137,8 +132,13 @@ class TemplateController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
public function update($id, TemplateUdate $request)
|
||||
{
|
||||
/**
|
||||
* function to update a template
|
||||
* @param type $id
|
||||
* @param \App\Http\Requests\helpdesk\TemplateUdate $request
|
||||
* @return type
|
||||
*/
|
||||
public function update($id, TemplateUdate $request) {
|
||||
try {
|
||||
//dd($request);
|
||||
$template = $this->template->where('id', $id)->first();
|
||||
@@ -151,14 +151,13 @@ class TemplateController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
* function to delete a template
|
||||
*
|
||||
* @param int $id
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function destroy(Request $request)
|
||||
{
|
||||
public function destroy(Request $request) {
|
||||
try {
|
||||
$ids = $request->input('select');
|
||||
if (!empty($ids)) {
|
||||
@@ -169,9 +168,9 @@ class TemplateController extends Controller
|
||||
} else {
|
||||
echo "<div class='alert alert-danger alert-dismissable'>
|
||||
<i class='fa fa-ban'></i>
|
||||
<b>".\Lang::get('message.alert').'!</b>
|
||||
<b>" . \Lang::get('message.alert') . '!</b>
|
||||
<button type=button class=close data-dismiss=alert aria-hidden=true>×</button>
|
||||
'.\Lang::get('message.no-record').'
|
||||
' . \Lang::get('message.no-record') . '
|
||||
</div>';
|
||||
}
|
||||
}
|
||||
@@ -179,28 +178,32 @@ class TemplateController extends Controller
|
||||
<i class='fa fa-ban'></i>
|
||||
<b>
|
||||
<button type=button class=close data-dismiss=alert aria-hidden=true>×</button>
|
||||
".\Lang::get('message.deleted-successfully').'
|
||||
" . \Lang::get('message.deleted-successfully') . '
|
||||
</div>';
|
||||
} else {
|
||||
echo "<div class='alert alert-danger alert-dismissable'>
|
||||
<i class='fa fa-ban'></i>
|
||||
<b>".\Lang::get('message.alert').'!</b>
|
||||
<b>" . \Lang::get('message.alert') . '!</b>
|
||||
<button type=button class=close data-dismiss=alert aria-hidden=true>×</button>
|
||||
'.\Lang::get('message.select-a-row').'
|
||||
' . \Lang::get('message.select-a-row') . '
|
||||
</div>';
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
echo "<div class='alert alert-danger alert-dismissable'>
|
||||
<i class='fa fa-ban'></i>
|
||||
<b>".\Lang::get('message.alert').'!</b>
|
||||
<b>" . \Lang::get('message.alert') . '!</b>
|
||||
<button type=button class=close data-dismiss=alert aria-hidden=true>×</button>
|
||||
'.$e->getMessage().'
|
||||
' . $e->getMessage() . '
|
||||
</div>';
|
||||
}
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
/**
|
||||
* function to show the templates
|
||||
* @param type $id
|
||||
* @return type Mixed
|
||||
*/
|
||||
public function show($id) {
|
||||
//dd($currency);
|
||||
try {
|
||||
if ($this->template->where('type', 3)->where('id', $id)->first()) {
|
||||
@@ -255,4 +258,5 @@ class TemplateController extends Controller
|
||||
return redirect('/')->with('fails', $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -34,15 +34,20 @@ use View;
|
||||
*
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class InstallController extends Controller
|
||||
{
|
||||
class InstallController extends Controller {
|
||||
|
||||
/**
|
||||
* Get Licence (step 1).
|
||||
*
|
||||
* @return type view
|
||||
*/
|
||||
public function licence()
|
||||
{
|
||||
public function licence() {
|
||||
Session::forget('step1');
|
||||
Session::forget('step2');
|
||||
Session::forget('step3');
|
||||
Session::forget('step4');
|
||||
Session::forget('step5');
|
||||
Session::forget('step6');
|
||||
// checking if the installation is running for the first time or not
|
||||
if (Config::get('database.install') == '%0%') {
|
||||
return view('themes/default1/installer/helpdesk/view1');
|
||||
@@ -57,8 +62,7 @@ class InstallController extends Controller
|
||||
*
|
||||
* @return type view
|
||||
*/
|
||||
public function licencecheck()
|
||||
{
|
||||
public function licencecheck() {
|
||||
// checking if the user have accepted the licence agreement
|
||||
$accept = (Input::has('accept1')) ? true : false;
|
||||
if ($accept == 'accept') {
|
||||
@@ -79,8 +83,7 @@ class InstallController extends Controller
|
||||
*
|
||||
* @return type view
|
||||
*/
|
||||
public function prerequisites()
|
||||
{
|
||||
public function prerequisites() {
|
||||
// checking if the installation is running for the first time or not
|
||||
if (Config::get('database.install') == '%0%') {
|
||||
if (Session::get('step1') == 'step1') {
|
||||
@@ -99,8 +102,7 @@ class InstallController extends Controller
|
||||
*
|
||||
* @return type view
|
||||
*/
|
||||
public function prerequisitescheck()
|
||||
{
|
||||
public function prerequisitescheck() {
|
||||
Session::put('step2', 'step2');
|
||||
|
||||
return Redirect::route('configuration');
|
||||
@@ -112,8 +114,7 @@ class InstallController extends Controller
|
||||
*
|
||||
* @return type view
|
||||
*/
|
||||
public function localization()
|
||||
{
|
||||
public function localization() {
|
||||
// checking if the installation is running for the first time or not
|
||||
if (Config::get('database.install') == '%0%') {
|
||||
if (Session::get('step2') == 'step2') {
|
||||
@@ -132,8 +133,7 @@ class InstallController extends Controller
|
||||
*
|
||||
* @return type view
|
||||
*/
|
||||
public function localizationcheck()
|
||||
{
|
||||
public function localizationcheck() {
|
||||
Session::put('step3', 'step3');
|
||||
Session::put('language', Input::get('language'));
|
||||
Session::put('timezone', Input::get('timezone'));
|
||||
@@ -149,8 +149,7 @@ class InstallController extends Controller
|
||||
*
|
||||
* @return type view
|
||||
*/
|
||||
public function configuration()
|
||||
{
|
||||
public function configuration() {
|
||||
// checking if the installation is running for the first time or not
|
||||
if (Config::get('database.install') == '%0%') {
|
||||
if (Session::get('step2') == 'step2') {
|
||||
@@ -169,8 +168,7 @@ class InstallController extends Controller
|
||||
*
|
||||
* @return type view
|
||||
*/
|
||||
public function configurationcheck(DatabaseRequest $request)
|
||||
{
|
||||
public function configurationcheck(DatabaseRequest $request) {
|
||||
Session::put('step4', 'step4');
|
||||
// dd($request->input('default'));
|
||||
// dd($request->input('host'));
|
||||
@@ -193,8 +191,7 @@ class InstallController extends Controller
|
||||
*
|
||||
* @return type view
|
||||
*/
|
||||
public function postconnection()
|
||||
{
|
||||
public function postconnection() {
|
||||
error_reporting(E_ALL & ~E_NOTICE);
|
||||
$default = Input::get('default');
|
||||
$host = Input::get('host');
|
||||
@@ -211,7 +208,7 @@ class InstallController extends Controller
|
||||
// $_ENV['DB_USERNAME'] = $dbusername;
|
||||
// $_ENV['DB_PASSWORD'] = $dbpassword;
|
||||
|
||||
$ENV['APP_ENV'] = 'local';
|
||||
$ENV['APP_ENV'] = 'local';
|
||||
$ENV['APP_DEBUG'] = 'false';
|
||||
$ENV['APP_KEY'] = 'SomeRandomString';
|
||||
$ENV['DB_TYPE'] = $default;
|
||||
@@ -234,7 +231,7 @@ class InstallController extends Controller
|
||||
$config .= "{$key}={$val}\n";
|
||||
}
|
||||
// Write environment file
|
||||
$fp = fopen(base_path().'/.env', 'w');
|
||||
$fp = fopen(base_path() . '/.env', 'w');
|
||||
fwrite($fp, $config);
|
||||
fclose($fp);
|
||||
|
||||
@@ -247,8 +244,7 @@ class InstallController extends Controller
|
||||
*
|
||||
* @return type view
|
||||
*/
|
||||
public function database()
|
||||
{
|
||||
public function database() {
|
||||
// checking if the installation is running for the first time or not
|
||||
if (Config::get('database.install') == '%0%') {
|
||||
if (Session::get('step4') == 'step4') {
|
||||
@@ -267,8 +263,7 @@ class InstallController extends Controller
|
||||
*
|
||||
* @return type view
|
||||
*/
|
||||
public function account()
|
||||
{
|
||||
public function account() {
|
||||
// checking if the installation is running for the first time or not
|
||||
if (Config::get('database.install') == '%0%') {
|
||||
if (Session::get('step4') == 'step4') {
|
||||
@@ -294,8 +289,7 @@ class InstallController extends Controller
|
||||
*
|
||||
* @return type view
|
||||
*/
|
||||
public function accountcheck(InstallerRequest $request)
|
||||
{
|
||||
public function accountcheck(InstallerRequest $request) {
|
||||
// checking is the installation was done previously
|
||||
try {
|
||||
$check_for_pre_installation = System::all();
|
||||
@@ -303,9 +297,10 @@ class InstallController extends Controller
|
||||
return redirect()->back()->with('fails', 'The data in database already exist. Please provide fresh database');
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
|
||||
}
|
||||
if ($request->input('dummy-data') == 'on') {
|
||||
$path = base_path().'/DB/dummy-data.sql';
|
||||
$path = base_path() . '/DB/dummy-data.sql';
|
||||
// dd($path);
|
||||
DB::unprepared(file_get_contents($path));
|
||||
} else {
|
||||
@@ -327,7 +322,6 @@ class InstallController extends Controller
|
||||
$datetime = $request->input('datetime');
|
||||
|
||||
//\Cache::forever('language', $language);
|
||||
|
||||
//\App::setLocale($language);
|
||||
// $system = System::where('id','=','1')->first();
|
||||
// $system->time_zone = $timezone;
|
||||
@@ -356,15 +350,15 @@ class InstallController extends Controller
|
||||
|
||||
// creating an user
|
||||
$user = User::create([
|
||||
'first_name' => $firstname,
|
||||
'last_name' => $lastname,
|
||||
'email' => $email,
|
||||
'user_name' => $username,
|
||||
'password' => Hash::make($password),
|
||||
'first_name' => $firstname,
|
||||
'last_name' => $lastname,
|
||||
'email' => $email,
|
||||
'user_name' => $username,
|
||||
'password' => Hash::make($password),
|
||||
'assign_group' => 1,
|
||||
'primary_dpt' => 1,
|
||||
'active' => 1,
|
||||
'role' => 'admin',
|
||||
'primary_dpt' => 1,
|
||||
'active' => 1,
|
||||
'role' => 'admin',
|
||||
]);
|
||||
// checking if the user have been created
|
||||
if ($user) {
|
||||
@@ -380,8 +374,7 @@ class InstallController extends Controller
|
||||
*
|
||||
* @return type view
|
||||
*/
|
||||
public function finalize()
|
||||
{
|
||||
public function finalize() {
|
||||
// checking if the installation have been completed or not
|
||||
if (Session::get('step6') == 'step6') {
|
||||
$value = '1';
|
||||
@@ -398,7 +391,7 @@ class InstallController extends Controller
|
||||
$content24 = File::get($path23);
|
||||
$content23 = str_replace('"%smtplink%"', $smtpfilepath, $content23);
|
||||
$content24 = str_replace("'%url%'", $lfmpath, $content24);
|
||||
$link = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
|
||||
$link = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
|
||||
$pos = strpos($link, 'final');
|
||||
$link = substr($link, 0, $pos);
|
||||
$app_url = app_path('../config/app.php');
|
||||
@@ -431,8 +424,7 @@ class InstallController extends Controller
|
||||
*
|
||||
* @return type view
|
||||
*/
|
||||
public function finalcheck()
|
||||
{
|
||||
public function finalcheck() {
|
||||
try {
|
||||
return redirect('/auth/login');
|
||||
} catch (Exception $e) {
|
||||
@@ -440,12 +432,11 @@ class InstallController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
public function changeFilePermission()
|
||||
{
|
||||
$path1 = base_path().DIRECTORY_SEPARATOR.'.env';
|
||||
$path2 = base_path().DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'database.php';
|
||||
$path3 = base_path().DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'Http'.DIRECTORY_SEPARATOR.'routes.php';
|
||||
$path4 = base_path().DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'lfm.php';
|
||||
public function changeFilePermission() {
|
||||
$path1 = base_path() . DIRECTORY_SEPARATOR . '.env';
|
||||
$path2 = base_path() . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'database.php';
|
||||
$path3 = base_path() . DIRECTORY_SEPARATOR . 'app' . DIRECTORY_SEPARATOR . 'Http' . DIRECTORY_SEPARATOR . 'routes.php';
|
||||
$path4 = base_path() . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'lfm.php';
|
||||
if (chmod($path1, 0644) && chmod($path2, 0644) && chmod($path3, 0644) && chmod($path4, 0644)) {
|
||||
$f1 = substr(sprintf('%o', fileperms($path1)), -3);
|
||||
$f2 = substr(sprintf('%o', fileperms($path2)), -3);
|
||||
@@ -461,8 +452,8 @@ class InstallController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
public function jsDisabled()
|
||||
{
|
||||
public function jsDisabled() {
|
||||
return view('themes/default1/installer/helpdesk/check-js')->with('url', $_SERVER['HTTP_REFERER']);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -181,7 +181,7 @@ class UpgradeController extends Controller
|
||||
$notify->delete();
|
||||
}
|
||||
} catch (Exception $ex) {
|
||||
dd($ex);
|
||||
throw new Exception($ex->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -196,7 +196,7 @@ class UpgradeController extends Controller
|
||||
return redirect()->back();
|
||||
}
|
||||
} catch (Exception $ex) {
|
||||
dd($ex);
|
||||
return redirect()->back()->with('fails',$ex->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -218,9 +218,7 @@ class UpgradeController extends Controller
|
||||
return redirect()->back();
|
||||
}
|
||||
} catch (Exception $ex) {
|
||||
dd($ex);
|
||||
|
||||
return redirect()->back()->with('fails', $ex->getMessage());
|
||||
return redirect()->back()->with('fails',$ex->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -328,7 +326,7 @@ class UpgradeController extends Controller
|
||||
return redirect()->back();
|
||||
}
|
||||
} catch (Exception $ex) {
|
||||
dd($ex);
|
||||
return redirect()->back()->with('fails',$ex->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -343,7 +341,7 @@ class UpgradeController extends Controller
|
||||
return redirect()->back();
|
||||
}
|
||||
} catch (Exception $ex) {
|
||||
dd($ex);
|
||||
return redirect()->back()->with('fails',$ex->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -41,6 +41,6 @@ class Kernel extends HttpKernel
|
||||
'jwt.auth' => \Tymon\JWTAuth\Middleware\GetUserFromToken::class,
|
||||
'jwt.refresh' => \Tymon\JWTAuth\Middleware\RefreshToken::class,
|
||||
'update' => \App\Http\Middleware\CheckUpdate::class,
|
||||
'board' => \App\Http\Middleware\CheckBoard::class,
|
||||
'board' => \App\Http\Middleware\CheckBoard::class,
|
||||
];
|
||||
}
|
||||
|
@@ -7,22 +7,19 @@ use Closure;
|
||||
|
||||
/**
|
||||
* CheckBoard.
|
||||
* Checking if the system board is online or offline.
|
||||
* Checking if the system board is online or offline
|
||||
*
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class CheckBoard
|
||||
{
|
||||
class CheckBoard {
|
||||
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Closure $next
|
||||
*
|
||||
* @param \Closure $next
|
||||
* @return type Mixed
|
||||
*/
|
||||
public function handle($request, Closure $next)
|
||||
{
|
||||
public function handle($request, Closure $next) {
|
||||
if ($this->checkBoard() == '1') {
|
||||
return $next($request);
|
||||
} else {
|
||||
@@ -31,18 +28,16 @@ class CheckBoard
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to get the system offline details.
|
||||
*
|
||||
* Function to get the system offline details
|
||||
* @return type Mixed
|
||||
*/
|
||||
public function checkBoard()
|
||||
{
|
||||
public function checkBoard() {
|
||||
$res = 0;
|
||||
$system = new System();
|
||||
$system = new System;
|
||||
if ($system->first()) {
|
||||
$res = $system->first()->status;
|
||||
}
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -31,7 +31,6 @@ class CheckUpdate
|
||||
return redirect('file-update');
|
||||
}
|
||||
}
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
|
||||
@@ -47,11 +46,11 @@ class CheckUpdate
|
||||
public function checkNewUpdate()
|
||||
{
|
||||
$notify = new BarNotification();
|
||||
if (!\Schema::hasTable('bar_notifications')) {
|
||||
if(!\Schema::hasTable('bar_notifications')){
|
||||
$url = url('database-upgrade');
|
||||
//$string = "Your Database is outdated please upgrade <a href=$url>Now !</a>";
|
||||
echo view('themes.default1.update.database', compact('url'));
|
||||
exit;
|
||||
exit;
|
||||
}
|
||||
$not = $notify->get();
|
||||
if ($not->count() > 0) {
|
||||
|
@@ -29,7 +29,7 @@ class TemplateRequest extends Request
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'name' => 'required|unique:template',
|
||||
// 'name' => 'required|unique:template',
|
||||
// 'subject' => 'required',
|
||||
'type' => 'required',
|
||||
'message' => 'required',
|
||||
|
@@ -29,7 +29,7 @@ class TemplateUdate extends Request
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'name' => 'required|max:60',
|
||||
// 'name' => 'required|max:60',
|
||||
// 'subject' => 'required',
|
||||
'type' => 'required',
|
||||
'message' => 'required',
|
||||
|
@@ -25,7 +25,7 @@ class WorkflowCloseRequest extends Request
|
||||
{
|
||||
return [
|
||||
'days' => 'required|integer|min:1',
|
||||
'condition' => 'required|integer',
|
||||
// 'condition' => 'required|integer',
|
||||
'send_email' => 'required|integer',
|
||||
'status' => 'required|integer',
|
||||
];
|
||||
|
@@ -13,7 +13,7 @@
|
||||
|
||||
Route::group(['middleware' => 'update'], function () {
|
||||
Route::controllers([
|
||||
'auth' => 'Auth\AuthController',
|
||||
'auth' => 'Auth\AuthController',
|
||||
'password' => 'Auth\PasswordController',
|
||||
]);
|
||||
});
|
||||
@@ -48,19 +48,102 @@ Route::group(['middleware' => 'roles', 'middleware' => 'auth', 'middleware' => '
|
||||
Route::get('settings-notification', ['as' => 'notification.settings', 'uses' => 'Admin\helpdesk\SettingsController@notificationSettings']);
|
||||
Route::get('delete-read-notification', 'Admin\helpdesk\SettingsController@deleteReadNoti');
|
||||
Route::post('delete-notification-log', 'Admin\helpdesk\SettingsController@deleteNotificationLog');
|
||||
|
||||
|
||||
// resource is a function to process create,edit,read and delete
|
||||
Route::resource('groups', 'Admin\helpdesk\GroupController'); // for group module, for CRUD
|
||||
Breadcrumbs::register('groups.index', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('setting');
|
||||
$breadcrumbs->push(Lang::get('lang.groups'), route('groups.index'));
|
||||
});
|
||||
Breadcrumbs::register('groups.create', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('groups.index');
|
||||
$breadcrumbs->push(Lang::get('lang.create'), route('groups.create'));
|
||||
});
|
||||
Breadcrumbs::register('groups.edit', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('groups.index');
|
||||
$breadcrumbs->push(Lang::get('lang.edit'), url('groups/{groups}/edit'));
|
||||
});
|
||||
|
||||
|
||||
Route::resource('departments', 'Admin\helpdesk\DepartmentController'); // for departments module, for CRUD
|
||||
Breadcrumbs::register('departments.index', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('setting');
|
||||
$breadcrumbs->push(Lang::get('lang.departments'), route('departments.index'));
|
||||
});
|
||||
Breadcrumbs::register('departments.create', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('departments.index');
|
||||
$breadcrumbs->push(Lang::get('lang.create'), route('departments.create'));
|
||||
});
|
||||
Breadcrumbs::register('departments.edit', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('departments.index');
|
||||
$breadcrumbs->push(Lang::get('lang.edit'), url('departments/{departments}/edit'));
|
||||
});
|
||||
|
||||
|
||||
Route::resource('teams', 'Admin\helpdesk\TeamController'); // in teams module, for CRUD
|
||||
Breadcrumbs::register('teams.index', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('setting');
|
||||
$breadcrumbs->push(Lang::get('lang.teams'), route('teams.index'));
|
||||
});
|
||||
Breadcrumbs::register('teams.create', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('teams.index');
|
||||
$breadcrumbs->push(Lang::get('lang.create'), route('teams.create'));
|
||||
});
|
||||
Breadcrumbs::register('teams.edit', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('teams.index');
|
||||
$breadcrumbs->push(Lang::get('lang.edit'), url('teams/{teams}/edit'));
|
||||
});
|
||||
|
||||
|
||||
|
||||
Route::resource('agents', 'Admin\helpdesk\AgentController'); // in agents module, for CRUD
|
||||
Breadcrumbs::register('agents.index', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('setting');
|
||||
$breadcrumbs->push(Lang::get('lang.agents'), route('agents.index'));
|
||||
});
|
||||
Breadcrumbs::register('agents.create', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('agents.index');
|
||||
$breadcrumbs->push(Lang::get('lang.create'), route('agents.create'));
|
||||
});
|
||||
Breadcrumbs::register('agents.edit', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('agents.index');
|
||||
$breadcrumbs->push(Lang::get('lang.edit'), url('agents/{agents}/edit'));
|
||||
});
|
||||
|
||||
|
||||
Route::resource('emails', 'Admin\helpdesk\EmailsController'); // in emails module, for CRUD
|
||||
Breadcrumbs::register('emails.index', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('setting');
|
||||
$breadcrumbs->push(Lang::get('lang.emails'), route('emails.index'));
|
||||
});
|
||||
Breadcrumbs::register('emails.create', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('emails.index');
|
||||
$breadcrumbs->push(Lang::get('lang.create'), route('emails.create'));
|
||||
});
|
||||
Breadcrumbs::register('emails.edit', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('emails.index');
|
||||
$breadcrumbs->push(Lang::get('lang.edit'), url('emails/{emails}/edit'));
|
||||
});
|
||||
|
||||
|
||||
|
||||
Route::resource('banlist', 'Admin\helpdesk\BanlistController'); // in banlist module, for CRUD
|
||||
Breadcrumbs::register('banlist.index', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('setting');
|
||||
$breadcrumbs->push(Lang::get('lang.banlists'), route('banlist.index'));
|
||||
});
|
||||
Breadcrumbs::register('banlist.create', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('banlist.index');
|
||||
$breadcrumbs->push(Lang::get('lang.add'), route('banlist.create'));
|
||||
});
|
||||
Breadcrumbs::register('banlist.edit', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('banlist.index');
|
||||
$breadcrumbs->push(Lang::get('lang.edit'), url('agents/{agents}/edit'));
|
||||
});
|
||||
Route::get('banlist/delete/{id}', ['as' => 'banlist.delete', 'uses' => 'Admin\helpdesk\BanlistController@delete']); // in banlist module, for CRUD
|
||||
|
||||
|
||||
/*
|
||||
* Templates
|
||||
*/
|
||||
@@ -108,56 +191,132 @@ Route::group(['middleware' => 'roles', 'middleware' => 'auth', 'middleware' => '
|
||||
Route::get('delete-template/{template}/{path}', ['as' => 'templates.delete', 'uses' => 'Admin\helpdesk\TemplateController@deletetemplate']);
|
||||
|
||||
Route::get('getdiagno', ['as' => 'getdiagno', 'uses' => 'Admin\helpdesk\TemplateController@formDiagno']); // for getting form for diagnostic
|
||||
Breadcrumbs::register('getdiagno', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('setting');
|
||||
$breadcrumbs->push(Lang::get('lang.email_diagnostic'), route('getdiagno'));
|
||||
});
|
||||
|
||||
Route::post('postdiagno', ['as' => 'postdiagno', 'uses' => 'Admin\helpdesk\TemplateController@postDiagno']); // for getting form for diagnostic
|
||||
|
||||
|
||||
Route::resource('helptopic', 'Admin\helpdesk\HelptopicController'); // in helptopics module, for CRUD
|
||||
Breadcrumbs::register('helptopic.index', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('setting');
|
||||
$breadcrumbs->push(Lang::get('lang.help_topics'), route('helptopic.index'));
|
||||
});
|
||||
Breadcrumbs::register('helptopic.create', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('helptopic.index');
|
||||
$breadcrumbs->push(Lang::get('lang.create'), route('helptopic.create'));
|
||||
});
|
||||
Breadcrumbs::register('helptopic.edit', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('helptopic.index');
|
||||
$breadcrumbs->push(Lang::get('lang.edit'), url('helptopic/{helptopic}/edit'));
|
||||
});
|
||||
|
||||
|
||||
|
||||
Route::resource('sla', 'Admin\helpdesk\SlaController'); // in SLA Plan module, for CRUD
|
||||
Breadcrumbs::register('sla.index', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('setting');
|
||||
$breadcrumbs->push(Lang::get('lang.sla-plans'), route('sla.index'));
|
||||
});
|
||||
Breadcrumbs::register('sla.create', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('sla.index');
|
||||
$breadcrumbs->push(Lang::get('lang.create'), route('sla.create'));
|
||||
});
|
||||
Breadcrumbs::register('sla.edit', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('sla.index');
|
||||
$breadcrumbs->push(Lang::get('lang.edit'), url('sla/{sla}/edit'));
|
||||
});
|
||||
|
||||
|
||||
|
||||
Route::resource('forms', 'Admin\helpdesk\FormController');
|
||||
|
||||
Breadcrumbs::register('forms.index', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('setting');
|
||||
$breadcrumbs->push(Lang::get('lang.forms'), route('forms.index'));
|
||||
});
|
||||
Breadcrumbs::register('forms.create', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('forms.index');
|
||||
$breadcrumbs->push(Lang::get('lang.create'), route('forms.create'));
|
||||
});
|
||||
Breadcrumbs::register('forms.edit', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('forms.index');
|
||||
$breadcrumbs->push(Lang::get('lang.edit'), url('forms/{forms}/edit'));
|
||||
});
|
||||
Breadcrumbs::register('forms.show', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('forms.index');
|
||||
$breadcrumbs->push(Lang::get('lang.view'), url('forms/{forms}'));
|
||||
});
|
||||
Route::get('delete-forms/{id}', ['as' => 'forms.delete', 'uses' => 'Admin\helpdesk\FormController@delete']);
|
||||
|
||||
//$router->model('id','getcompany');
|
||||
|
||||
Route::get('job-scheduler', ['as' => 'get.job.scheder', 'uses' => 'Admin\helpdesk\SettingsController@getSchedular']); //to get ob scheduler form page
|
||||
Breadcrumbs::register('get.job.scheder', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('setting');
|
||||
$breadcrumbs->push(Lang::get('lang.cron-jobs'), route('get.job.scheder'));
|
||||
});
|
||||
|
||||
Route::patch('post-scheduler', ['as' => 'post.job.scheduler', 'uses' => 'Admin\helpdesk\SettingsController@postSchedular']); //to update job scheduler
|
||||
|
||||
Route::get('agent-profile-page/{id}', ['as' => 'agent.profile.page', 'uses' => 'Admin\helpdesk\AgentController@agent_profile']);
|
||||
|
||||
Route::get('getcompany', ['as' => 'getcompany', 'uses' => 'Admin\helpdesk\SettingsController@getcompany']); // direct to company setting page
|
||||
Breadcrumbs::register('getcompany', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('setting');
|
||||
$breadcrumbs->push(Lang::get('lang.company_settings'), route('getcompany'));
|
||||
});
|
||||
|
||||
Route::patch('postcompany/{id}', 'Admin\helpdesk\SettingsController@postcompany'); // Updating the Company table with requests
|
||||
|
||||
Route::get('delete-logo', ['as' => 'delete.logo', 'uses' => 'Admin\helpdesk\SettingsController@deleteLogo']); // deleting a logo
|
||||
|
||||
Route::get('getsystem', ['as' => 'getsystem', 'uses' => 'Admin\helpdesk\SettingsController@getsystem']); // direct to system setting page
|
||||
Breadcrumbs::register('getsystem', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('setting');
|
||||
$breadcrumbs->push(Lang::get('lang.system-settings'), route('getsystem'));
|
||||
});
|
||||
|
||||
Route::patch('postsystem/{id}', 'Admin\helpdesk\SettingsController@postsystem'); // Updating the System table with requests
|
||||
|
||||
Route::get('getticket', ['as' => 'getticket', 'uses' => 'Admin\helpdesk\SettingsController@getticket']); // direct to ticket setting page
|
||||
Breadcrumbs::register('getticket', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('setting');
|
||||
$breadcrumbs->push(Lang::get('lang.ticket-setting'), route('getticket'));
|
||||
});
|
||||
|
||||
Route::patch('postticket/{id}', 'Admin\helpdesk\SettingsController@postticket'); // Updating the Ticket table with requests
|
||||
|
||||
Route::get('getemail', ['as' => 'getemail', 'uses' => 'Admin\helpdesk\SettingsController@getemail']); // direct to email setting page
|
||||
Breadcrumbs::register('getemail', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('setting');
|
||||
$breadcrumbs->push(Lang::get('lang.email-settings'), route('getemail'));
|
||||
});
|
||||
|
||||
Route::patch('postemail/{id}', 'Admin\helpdesk\SettingsController@postemail'); // Updating the Email table with requests
|
||||
// Route::get('getaccess', 'Admin\helpdesk\SettingsController@getaccess'); // direct to access setting page
|
||||
// Route::patch('postaccess/{id}', 'Admin\helpdesk\SettingsController@postaccess'); // Updating the Access table with requests
|
||||
|
||||
Route::get('getresponder', ['as' => 'getresponder', 'uses' => 'Admin\helpdesk\SettingsController@getresponder']); // direct to responder setting page
|
||||
Breadcrumbs::register('getresponder', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('setting');
|
||||
$breadcrumbs->push(Lang::get('lang.auto_responce'), route('getresponder'));
|
||||
});
|
||||
|
||||
Route::patch('postresponder/{id}', 'Admin\helpdesk\SettingsController@postresponder'); // Updating the Responder table with requests
|
||||
|
||||
Route::get('getalert', ['as' => 'getalert', 'uses' => 'Admin\helpdesk\SettingsController@getalert']); // direct to alert setting page
|
||||
Breadcrumbs::register('getalert', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('setting');
|
||||
$breadcrumbs->push(Lang::get('lang.alert_notices_setitngs'), route('getalert'));
|
||||
});
|
||||
|
||||
Route::patch('postalert/{id}', 'Admin\helpdesk\SettingsController@postalert'); // Updating the Alert table with requests
|
||||
// Templates
|
||||
Breadcrumbs::register('security.index', function ($breadcrumbs) {
|
||||
$breadcrumbs->parent('setting');
|
||||
$breadcrumbs->push('Security', route('security.index'));
|
||||
$breadcrumbs->push(Lang::get('lang.security_settings'), route('security.index'));
|
||||
});
|
||||
|
||||
// Templates > Upload Templates
|
||||
@@ -187,17 +346,18 @@ Route::group(['middleware' => 'roles', 'middleware' => 'auth', 'middleware' => '
|
||||
|
||||
Breadcrumbs::register('close-workflow.index', function ($breadcrumbs) {
|
||||
$breadcrumbs->parent('setting');
|
||||
$breadcrumbs->push('Close Ticket Workflow', route('close-workflow.index'));
|
||||
$breadcrumbs->push(Lang::get('lang.close_ticket_workflow_settings'), route('close-workflow.index'));
|
||||
});
|
||||
Route::resource('close-workflow', 'Admin\helpdesk\CloseWrokflowController'); // direct to security setting page
|
||||
|
||||
|
||||
Route::patch('security/{id}', ['as' => 'securitys.update', 'uses' => 'Admin\helpdesk\SecurityController@update']); // direct to security setting page
|
||||
|
||||
Route::get('setting-status', ['as' => 'statuss.index', 'uses' => 'Admin\helpdesk\SettingsController@getStatuses']); // direct to status setting page
|
||||
Breadcrumbs::register('statuss.index', function ($breadcrumbs) {
|
||||
$breadcrumbs->parent('setting');
|
||||
$breadcrumbs->push('All Status', route('statuss.index'));
|
||||
$breadcrumbs->push(Lang::get('lang.status_settings'), route('statuss.index'));
|
||||
});
|
||||
Route::get('setting-status', ['as' => 'statuss.index', 'uses' => 'Admin\helpdesk\SettingsController@getStatuses']); // direct to status setting page
|
||||
|
||||
Route::patch('status-update/{id}', ['as' => 'statuss.update', 'uses' => 'Admin\helpdesk\SettingsController@editStatuses']);
|
||||
Breadcrumbs::register('statuss.create', function ($breadcrumbs) {
|
||||
@@ -212,11 +372,12 @@ Route::group(['middleware' => 'roles', 'middleware' => 'auth', 'middleware' => '
|
||||
Route::get('status-delete/{id}', ['as' => 'statuss.delete', 'uses' => 'Admin\helpdesk\SettingsController@deleteStatuses']);
|
||||
|
||||
Route::get('ticket/status/{id}/{state}', ['as' => 'statuss.state', 'uses' => 'Agent\helpdesk\TicketController@updateStatuses']);
|
||||
|
||||
Route::get('getratings', ['as' => 'ratings.index', 'uses' => 'Admin\helpdesk\SettingsController@RatingSettings']);
|
||||
Breadcrumbs::register('ratings.index', function ($breadcrumbs) {
|
||||
$breadcrumbs->parent('setting');
|
||||
$breadcrumbs->push('All Ratings', route('ratings.index'));
|
||||
$breadcrumbs->push(Lang::get('lang.ratings_settings'), route('ratings.index'));
|
||||
});
|
||||
Route::get('getratings', ['as' => 'ratings.index', 'uses' => 'Admin\helpdesk\SettingsController@RatingSettings']);
|
||||
|
||||
Route::get('deleter/{rating}', ['as' => 'ratings.delete', 'uses' => 'Admin\helpdesk\SettingsController@RatingDelete']);
|
||||
|
||||
@@ -241,7 +402,11 @@ Route::group(['middleware' => 'roles', 'middleware' => 'auth', 'middleware' => '
|
||||
|
||||
Route::get('remove-user-org/{id}', ['as' => 'removeuser.org', 'uses' => 'Agent\helpdesk\UserController@removeUserOrg']);
|
||||
|
||||
Route::get('admin-profile', 'Admin\helpdesk\ProfileController@getProfile'); /* User profile edit get */
|
||||
Route::get('admin-profile', ['as' => 'admin-profile', 'uses' => 'Admin\helpdesk\ProfileController@getProfile']); /* User profile edit get */
|
||||
Breadcrumbs::register('admin-profile', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('dashboard');
|
||||
$breadcrumbs->push(Lang::get('lang.profile'), route('admin-profile'));
|
||||
});
|
||||
|
||||
Route::get('admin-profile-edit', 'Admin\helpdesk\ProfileController@getProfileedit'); /* Admin profile get */
|
||||
|
||||
@@ -250,34 +415,47 @@ Route::group(['middleware' => 'roles', 'middleware' => 'auth', 'middleware' => '
|
||||
Route::patch('admin-profile-password', 'Admin\helpdesk\ProfileController@postProfilePassword'); /* Admin Profile Password Post */
|
||||
|
||||
Route::get('widgets', ['as' => 'widgets', 'uses' => 'Common\SettingsController@widgets']); /* get the create footer page for admin */
|
||||
Breadcrumbs::register('widgets', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('setting');
|
||||
$breadcrumbs->push(Lang::get('lang.widget-settings'), route('widgets'));
|
||||
});
|
||||
|
||||
Route::get('list-widget', 'Common\SettingsController@list_widget'); /* get the list widget page for admin */
|
||||
|
||||
Route::post('edit-widget/{id}', 'Common\SettingsController@edit_widget'); /* get the create footer page for admin */
|
||||
|
||||
Route::get('social-buttons', ['as' => 'social.buttons', 'uses' => 'Common\SettingsController@social_buttons']); /* get the create footer page for admin */
|
||||
Breadcrumbs::register('social.buttons', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('setting');
|
||||
$breadcrumbs->push(Lang::get('lang.social-widget-settings'), route('social.buttons'));
|
||||
});
|
||||
|
||||
Route::get('list-social-buttons', ['as' => 'list.social.buttons', 'uses' => 'Common\SettingsController@list_social_buttons']); /* get the list widget page for admin */
|
||||
|
||||
Route::post('edit-widget/{id}', 'Common\SettingsController@edit_social_buttons'); /* get the create footer page for admin */
|
||||
|
||||
Route::get('getsmtp', ['as' => 'getsmtp', 'uses' => 'Common\SettingsController@getsmtp']); /* get the create footer page for admin */
|
||||
|
||||
Route::patch('post-smtp', ['as' => 'post_smtp', 'uses' => 'Common\SettingsController@postsmtp']); /* post footer to insert to database */
|
||||
|
||||
Route::get('version-check', ['as' => 'version-check', 'uses' => 'Common\SettingsController@version_check']); /* Check version */
|
||||
|
||||
Route::post('post-version-check', ['as' => 'post-version-check', 'uses' => 'Common\SettingsController@post_version_check']); /* post Check version */
|
||||
|
||||
Route::get('checkUpdate', ['as' => 'checkupdate', 'uses' => 'Common\SettingsController@getupdate']); /* get Check update */
|
||||
|
||||
Breadcrumbs::register('setting', function ($breadcrumbs) {
|
||||
$breadcrumbs->push('Admin Panel', route('setting'));
|
||||
Breadcrumbs::register('checkupdate', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('setting');
|
||||
$breadcrumbs->push(Lang::get('lang.update-version'), route('checkupdate'));
|
||||
});
|
||||
|
||||
|
||||
Route::get('admin', ['as' => 'setting', 'uses' => 'Admin\helpdesk\SettingsController@settings']);
|
||||
Breadcrumbs::register('setting', function ($breadcrumbs) {
|
||||
$breadcrumbs->push(Lang::get('lang.admin_panel'), route('setting'));
|
||||
});
|
||||
|
||||
Route::get('plugins', ['as' => 'plugins', 'uses' => 'Common\SettingsController@Plugins']);
|
||||
Breadcrumbs::register('plugins', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('setting');
|
||||
$breadcrumbs->push(Lang::get('lang.plugins'), route('plugins'));
|
||||
});
|
||||
|
||||
Route::get('getplugin', ['as' => 'get.plugin', 'uses' => 'Common\SettingsController@GetPlugin']);
|
||||
|
||||
@@ -291,6 +469,10 @@ Route::group(['middleware' => 'roles', 'middleware' => 'auth', 'middleware' => '
|
||||
|
||||
//Routes for showing language table and switching language
|
||||
Route::get('languages', ['as' => 'LanguageController', 'uses' => 'Admin\helpdesk\LanguageController@index']);
|
||||
Breadcrumbs::register('LanguageController', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('setting');
|
||||
$breadcrumbs->push(Lang::get('lang.language-settings'), route('LanguageController'));
|
||||
});
|
||||
|
||||
Route::get('get-languages', ['as' => 'getAllLanguages', 'uses' => 'Admin\helpdesk\LanguageController@getLanguages']);
|
||||
|
||||
@@ -303,6 +485,10 @@ Route::group(['middleware' => 'roles', 'middleware' => 'auth', 'middleware' => '
|
||||
Route::post('language/add', 'Admin\helpdesk\LanguageController@postForm');
|
||||
|
||||
Route::get('language/add', ['as' => 'add-language', 'uses' => 'Admin\helpdesk\LanguageController@getForm']);
|
||||
Breadcrumbs::register('add-language', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('LanguageController');
|
||||
$breadcrumbs->push(Lang::get('lang.add'), route('add-language'));
|
||||
});
|
||||
|
||||
//Routes for delete language package
|
||||
Route::get('delete-language/{lang}', ['as' => 'lang.delete', 'uses' => 'Admin\helpdesk\LanguageController@deleteLanguage']);
|
||||
@@ -314,11 +500,27 @@ Route::group(['middleware' => 'roles', 'middleware' => 'auth', 'middleware' => '
|
||||
|
||||
|
||||
Route::get('workflow', ['as' => 'workflow', 'uses' => 'Admin\helpdesk\WorkflowController@index']);
|
||||
Breadcrumbs::register('workflow', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('setting');
|
||||
$breadcrumbs->push(Lang::get('lang.ticket_workflow'), route('workflow'));
|
||||
});
|
||||
|
||||
Route::get('workflow-list', ['as' => 'workflow.list', 'uses' => 'Admin\helpdesk\WorkflowController@workFlowList']);
|
||||
|
||||
Route::get('workflow/create', ['as' => 'workflow.create', 'uses' => 'Admin\helpdesk\WorkflowController@create']);
|
||||
Breadcrumbs::register('workflow.create', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('workflow');
|
||||
$breadcrumbs->push(Lang::get('lang.create'), route('workflow.create'));
|
||||
});
|
||||
Route::post('workflow/store', ['as' => 'workflow.store', 'uses' => 'Admin\helpdesk\WorkflowController@store']);
|
||||
|
||||
Route::get('workflow/edit/{id}', ['as' => 'workflow.edit', 'uses' => 'Admin\helpdesk\WorkflowController@edit']);
|
||||
Breadcrumbs::register('workflow.edit', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('workflow');
|
||||
$breadcrumbs->push(Lang::get('lang.edit'), url('workflow/edit/{id}'));
|
||||
});
|
||||
Route::post('workflow/update/{id}', ['as' => 'workflow.update', 'uses' => 'Admin\helpdesk\WorkflowController@update']);
|
||||
|
||||
Route::get('workflow/action-rule/{id}', ['as' => 'workflow.dept', 'uses' => 'Admin\helpdesk\WorkflowController@selectAction']);
|
||||
Route::get('workflow/delete/{id}', ['as' => 'workflow.delete', 'uses' => 'Admin\helpdesk\WorkflowController@destroy']);
|
||||
|
||||
@@ -326,6 +528,10 @@ Route::group(['middleware' => 'roles', 'middleware' => 'auth', 'middleware' => '
|
||||
* Api Settings
|
||||
*/
|
||||
Route::get('api', ['as' => 'api.settings.get', 'uses' => 'Common\ApiSettings@show']);
|
||||
Breadcrumbs::register('api.settings.get', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('setting');
|
||||
$breadcrumbs->push(Lang::get('lang.api_settings'), route('api.settings.get'));
|
||||
});
|
||||
Route::post('api', ['as' => 'api.settings.post', 'uses' => 'Common\ApiSettings@postSettings']);
|
||||
|
||||
/*
|
||||
@@ -333,15 +539,18 @@ Route::group(['middleware' => 'roles', 'middleware' => 'auth', 'middleware' => '
|
||||
*/
|
||||
//route for showing error and debugging setting form page
|
||||
Route::get('error-and-debugging-options', ['as' => 'err.debug.settings', 'uses' => 'Admin\helpdesk\ErrorAndDebuggingController@showSettings']);
|
||||
|
||||
Breadcrumbs::register('err.debug.settings', function ($breadcrumbs) {
|
||||
$breadcrumbs->parent('setting');
|
||||
$breadcrumbs->push(Lang::get('lang.error-debug-settings'), route('err.debug.settings'));
|
||||
});
|
||||
//route for submit error and debugging setting form page
|
||||
Route::post('post-settings', ['as' => 'post.error.debug.settings',
|
||||
'uses' => 'Admin\helpdesk\ErrorAndDebuggingController@postSettings', ]);
|
||||
'uses' => 'Admin\helpdesk\ErrorAndDebuggingController@postSettings']);
|
||||
|
||||
//route to error logs table page
|
||||
Route::get('show-error-logs', [
|
||||
'as' => 'error.logs',
|
||||
'uses' => 'Admin\helpdesk\ErrorAndDebuggingController@showErrorLogs',
|
||||
'as' => 'error.logs',
|
||||
'uses' => 'Admin\helpdesk\ErrorAndDebuggingController@showErrorLogs'
|
||||
]);
|
||||
});
|
||||
|
||||
@@ -370,12 +579,45 @@ Route::group(['middleware' => 'role.agent', 'middleware' => 'auth', 'middleware'
|
||||
|
||||
|
||||
Route::resource('user', 'Agent\helpdesk\UserController'); /* User router is used to control the CRUD of user */
|
||||
Breadcrumbs::register('user.index', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('dashboard');
|
||||
$breadcrumbs->push(Lang::get('lang.user_directory'), route('user.index'));
|
||||
});
|
||||
Breadcrumbs::register('user.create', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('user.index');
|
||||
$breadcrumbs->push(Lang::get('lang.create'), route('user.create'));
|
||||
});
|
||||
Breadcrumbs::register('user.edit', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('user.index');
|
||||
$breadcrumbs->push(Lang::get('lang.edit'), url('user/{user}/edit'));
|
||||
});
|
||||
Breadcrumbs::register('user.show', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('user.index');
|
||||
$breadcrumbs->push(Lang::get('lang.view-profile'), url('user/{user}'));
|
||||
});
|
||||
|
||||
Route::get('user-list', ['as' => 'user.list', 'uses' => 'Agent\helpdesk\UserController@user_list']);
|
||||
|
||||
// Route::get('user/delete/{id}', ['as' => 'user.delete' , 'uses' => 'Agent\helpdesk\UserController@destroy']);
|
||||
|
||||
Route::resource('organizations', 'Agent\helpdesk\OrganizationController'); /* organization router used to deal CRUD function of organization */
|
||||
Breadcrumbs::register('organizations.index', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('dashboard');
|
||||
$breadcrumbs->push(Lang::get('lang.organizations'), route('organizations.index'));
|
||||
});
|
||||
Breadcrumbs::register('organizations.create', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('organizations.index');
|
||||
$breadcrumbs->push(Lang::get('lang.create'), route('organizations.create'));
|
||||
});
|
||||
Breadcrumbs::register('organizations.edit', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('organizations.index');
|
||||
$breadcrumbs->push(Lang::get('lang.edit'), url('organizations/{organizations}/edit'));
|
||||
});
|
||||
Breadcrumbs::register('organizations.show', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('organizations.index');
|
||||
$breadcrumbs->push(Lang::get('lang.view_organization_profile'), url('organizations/{organizations}'));
|
||||
});
|
||||
|
||||
|
||||
Route::get('org-list', ['as' => 'org.list', 'uses' => 'Agent\helpdesk\OrganizationController@org_list']);
|
||||
|
||||
@@ -387,20 +629,40 @@ Route::group(['middleware' => 'role.agent', 'middleware' => 'auth', 'middleware'
|
||||
Route::post('org-chart-range/{id}/{date1}/{date2}', ['as' => 'post.org.chart', 'uses' => 'Agent\helpdesk\OrganizationController@orgChartData']);
|
||||
|
||||
Route::get('profile', ['as' => 'profile', 'uses' => 'Agent\helpdesk\UserController@getProfile']); /* User profile get */
|
||||
Breadcrumbs::register('profile', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('dashboard');
|
||||
$breadcrumbs->push(Lang::get('lang.my_profile'), route('profile'));
|
||||
});
|
||||
|
||||
Route::get('profile-edit', ['as' => 'agent-profile-edit', 'uses' => 'Agent\helpdesk\UserController@getProfileedit']); /* User profile edit get */
|
||||
Breadcrumbs::register('agent-profile-edit', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('profile');
|
||||
$breadcrumbs->push(Lang::get('lang.edit'), url('profile-edit'));
|
||||
});
|
||||
|
||||
Route::patch('agent-profile', ['as' => 'agent-profile', 'uses' => 'Agent\helpdesk\UserController@postProfileedit']); /* User Profile Post */
|
||||
|
||||
Route::patch('agent-profile-password/{id}', 'Agent\helpdesk\UserController@postProfilePassword'); /* Profile Password Post */
|
||||
|
||||
Route::get('canned/list', ['as' => 'canned.list', 'uses' => 'Agent\helpdesk\CannedController@index']); /* Canned list */
|
||||
Breadcrumbs::register('canned.list', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('dashboard');
|
||||
$breadcrumbs->push(Lang::get('lang.canned_response'), route('canned.list'));
|
||||
});
|
||||
|
||||
Route::get('canned/create', ['as' => 'canned.create', 'uses' => 'Agent\helpdesk\CannedController@create']); /* Canned create */
|
||||
Breadcrumbs::register('canned.create', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('canned.list');
|
||||
$breadcrumbs->push(Lang::get('lang.create'), route('canned.create'));
|
||||
});
|
||||
|
||||
Route::patch('canned/store', ['as' => 'canned.store', 'uses' => 'Agent\helpdesk\CannedController@store']); /* Canned store */
|
||||
|
||||
Route::get('canned/edit/{id}', ['as' => 'canned.edit', 'uses' => 'Agent\helpdesk\CannedController@edit']); /* Canned edit */
|
||||
Breadcrumbs::register('canned.edit', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('canned.list');
|
||||
$breadcrumbs->push(Lang::get('lang.edit'), url('canned/edit/{id}'));
|
||||
});
|
||||
|
||||
Route::patch('canned/update/{id}', ['as' => 'canned.update', 'uses' => 'Agent\helpdesk\CannedController@update']); /* Canned update */
|
||||
|
||||
@@ -413,38 +675,78 @@ Route::group(['middleware' => 'role.agent', 'middleware' => 'auth', 'middleware'
|
||||
Route::get('/ticket', ['as' => 'ticket', 'uses' => 'Agent\helpdesk\TicketController@ticket_list']); /* Get Ticket */
|
||||
|
||||
Route::get('/ticket/inbox', ['as' => 'inbox.ticket', 'uses' => 'Agent\helpdesk\TicketController@inbox_ticket_list']); /* Get Inbox Ticket */
|
||||
Breadcrumbs::register('inbox.ticket', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('dashboard');
|
||||
$breadcrumbs->push(Lang::get('lang.inbox'), route('inbox.ticket'));
|
||||
});
|
||||
|
||||
Route::get('/ticket/get-inbox', ['as' => 'get.inbox.ticket', 'uses' => 'Agent\helpdesk\TicketController@get_inbox']); /* Get tickets in datatable */
|
||||
|
||||
Route::get('/ticket/open', ['as' => 'open.ticket', 'uses' => 'Agent\helpdesk\TicketController@open_ticket_list']); /* Get Open Ticket */
|
||||
Breadcrumbs::register('open.ticket', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('dashboard');
|
||||
$breadcrumbs->push(Lang::get('lang.open-tickets'), route('open.ticket'));
|
||||
});
|
||||
|
||||
|
||||
Route::get('/ticket/get-open', ['as' => 'get.open.ticket', 'uses' => 'Agent\helpdesk\TicketController@get_open']); /* Get tickets in datatable */
|
||||
|
||||
|
||||
Route::get('/ticket/answered', ['as' => 'answered.ticket', 'uses' => 'Agent\helpdesk\TicketController@answered_ticket_list']); /* Get Answered Ticket */
|
||||
Breadcrumbs::register('answered.ticket', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('dashboard');
|
||||
$breadcrumbs->push(Lang::get('lang.answered_tickets'), route('answered.ticket'));
|
||||
});
|
||||
|
||||
Route::get('/ticket/get-answered', ['as' => 'get.answered.ticket', 'uses' => 'Agent\helpdesk\TicketController@get_answered']); /* Get tickets in datatable */
|
||||
|
||||
Route::get('/ticket/myticket', ['as' => 'myticket.ticket', 'uses' => 'Agent\helpdesk\TicketController@myticket_ticket_list']); /* Get Tickets Assigned to logged user */
|
||||
Breadcrumbs::register('myticket.ticket', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('dashboard');
|
||||
$breadcrumbs->push(Lang::get('lang.my_tickets'), route('myticket.ticket'));
|
||||
});
|
||||
|
||||
Route::get('/ticket/get-myticket', ['as' => 'get.myticket.ticket', 'uses' => 'Agent\helpdesk\TicketController@get_myticket']); /* Get tickets in datatable */
|
||||
|
||||
Route::get('/ticket/overdue', ['as' => 'overdue.ticket', 'uses' => 'Agent\helpdesk\TicketController@overdue_ticket_list']); /* Get Overdue Ticket */
|
||||
Breadcrumbs::register('overdue.ticket', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('dashboard');
|
||||
$breadcrumbs->push(Lang::get('lang.overdue-tickets'), route('overdue.ticket'));
|
||||
});
|
||||
|
||||
Route::get('/ticket/get-overdue', ['as' => 'get.overdue.ticket', 'uses' => 'Agent\helpdesk\TicketController@getOverdueTickets']); /* Get Overdue Ticket */
|
||||
|
||||
Route::get('/ticket/closed', ['as' => 'closed.ticket', 'uses' => 'Agent\helpdesk\TicketController@closed_ticket_list']); /* Get Closed Ticket */
|
||||
Breadcrumbs::register('closed.ticket', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('dashboard');
|
||||
$breadcrumbs->push(Lang::get('lang.closed_tickets'), route('closed.ticket'));
|
||||
});
|
||||
|
||||
Route::get('/ticket/get-closed', ['as' => 'get.closed.ticket', 'uses' => 'Agent\helpdesk\TicketController@get_closed']); /* Get tickets in datatable */
|
||||
|
||||
Route::get('/ticket/assigned', ['as' => 'assigned.ticket', 'uses' => 'Agent\helpdesk\TicketController@assigned_ticket_list']); /* Get Assigned Ticket */
|
||||
Breadcrumbs::register('assigned.ticket', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('dashboard');
|
||||
$breadcrumbs->push(Lang::get('lang.assigned_tickets'), route('assigned.ticket'));
|
||||
});
|
||||
|
||||
Route::get('/ticket/get-assigned', ['as' => 'get.assigned.ticket', 'uses' => 'Agent\helpdesk\TicketController@get_assigned']); /* Get tickets in datatable */
|
||||
|
||||
Route::get('/newticket', ['as' => 'newticket', 'uses' => 'Agent\helpdesk\TicketController@newticket']); /* Get Create New Ticket */
|
||||
Breadcrumbs::register('newticket', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('dashboard');
|
||||
$breadcrumbs->push(Lang::get('lang.create_ticket'), route('newticket'));
|
||||
});
|
||||
|
||||
Route::post('/newticket/post', ['as' => 'post.newticket', 'uses' => 'Agent\helpdesk\TicketController@post_newticket']); /* Post Create New Ticket */
|
||||
|
||||
Route::get('/thread/{id}', ['as' => 'ticket.thread', 'uses' => 'Agent\helpdesk\TicketController@thread']); /* Get Thread by ID */
|
||||
Breadcrumbs::register('ticket.thread', function($breadcrumbs, $id) {
|
||||
$breadcrumbs->parent('dashboard');
|
||||
$ticket_number = App\Model\helpdesk\Ticket\Tickets::where('id', '=', $id)->first();
|
||||
$breadcrumbs->push($ticket_number->ticket_number, url('/thread/{id}'));
|
||||
});
|
||||
|
||||
|
||||
Route::patch('/thread/reply/{id}', ['as' => 'ticket.reply', 'uses' => 'Agent\helpdesk\TicketController@reply']); /* Patch Thread Reply */
|
||||
|
||||
@@ -471,17 +773,26 @@ Route::group(['middleware' => 'role.agent', 'middleware' => 'auth', 'middleware'
|
||||
Route::get('/aaaa', 'Client\helpdesk\GuestController@ticket_number');
|
||||
|
||||
Route::get('trash', ['as' => 'get-trash', 'uses' => 'Agent\helpdesk\TicketController@trash']); /* To show Deleted Tickets */
|
||||
Breadcrumbs::register('get-trash', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('dashboard');
|
||||
$breadcrumbs->push(Lang::get('lang.trash'), route('get-trash'));
|
||||
});
|
||||
|
||||
Route::get('/ticket/trash', ['as' => 'get.trash.ticket', 'uses' => 'Agent\helpdesk\TicketController@get_trash']); /* Get tickets in datatable */
|
||||
|
||||
Route::get('unassigned', ['as' => 'unassigned', 'uses' => 'Agent\helpdesk\TicketController@unassigned']); /* To show Unassigned Tickets */
|
||||
Breadcrumbs::register('unassigned', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('dashboard');
|
||||
$breadcrumbs->push(Lang::get('lang.unassigned-tickets'), route('unassigned'));
|
||||
});
|
||||
|
||||
Route::get('/ticket/unassigned', ['as' => 'get.unassigned.ticket', 'uses' => 'Agent\helpdesk\TicketController@get_unassigned']); /* Get tickets in datatable */
|
||||
Breadcrumbs::register('dashboard', function ($breadcrumbs) {
|
||||
$breadcrumbs->parent('/');
|
||||
$breadcrumbs->push('Dashboard', route('dashboard'));
|
||||
});
|
||||
|
||||
Route::get('dashboard', ['as' => 'dashboard', 'uses' => 'Agent\helpdesk\DashboardController@index']); /* To show dashboard pages */
|
||||
Breadcrumbs::register('dashboard', function ($breadcrumbs) {
|
||||
//$breadcrumbs->parent('/');
|
||||
$breadcrumbs->push(Lang::get('lang.dashboard'), route('dashboard'));
|
||||
});
|
||||
|
||||
Route::get('agen', 'Agent\helpdesk\DashboardController@ChartData');
|
||||
|
||||
@@ -514,10 +825,22 @@ Route::group(['middleware' => 'role.agent', 'middleware' => 'auth', 'middleware'
|
||||
// Department ticket
|
||||
|
||||
Route::get('/{dept}/open', ['as' => 'dept.open.ticket', 'uses' => 'Agent\helpdesk\TicketController@deptopen']); // Open
|
||||
Breadcrumbs::register('dept.open.ticket', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('dashboard');
|
||||
$breadcrumbs->push(Lang::get('lang.open_tickets'), url('/{dept}/open'));
|
||||
});
|
||||
|
||||
Route::get('/{dept}/inprogress', ['as' => 'dept.inprogress.ticket', 'uses' => 'Agent\helpdesk\TicketController@deptinprogress']); // Inprogress
|
||||
Breadcrumbs::register('dept.inprogress.ticket', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('dashboard');
|
||||
$breadcrumbs->push(Lang::get('lang.inprogress_tickets'), url('/{dept}/inprogress'));
|
||||
});
|
||||
|
||||
Route::get('/{dept}/closed', ['as' => 'dept.closed.ticket', 'uses' => 'Agent\helpdesk\TicketController@deptclose']); // Closed
|
||||
Breadcrumbs::register('dept.closed.ticket', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('dashboard');
|
||||
$breadcrumbs->push(Lang::get('lang.closed_tickets'), url('/{dept}/closed'));
|
||||
});
|
||||
|
||||
Route::post('rating/{id}', ['as' => 'ticket.rating', 'uses' => 'Agent\helpdesk\TicketController@rating']); /* Get overall Ratings */
|
||||
|
||||
@@ -566,7 +889,7 @@ Route::POST('tickets/search/', function () {
|
||||
});
|
||||
Route::any('getdata', function () {
|
||||
$term = Illuminate\Support\Str::lower(Input::get('term'));
|
||||
$data = Illuminate\Support\Facades\DB::table('tickets')->distinct()->select('ticket_number')->where('ticket_number', 'LIKE', $term.'%')->groupBy('ticket_number')->take(10)->get();
|
||||
$data = Illuminate\Support\Facades\DB::table('tickets')->distinct()->select('ticket_number')->where('ticket_number', 'LIKE', $term . '%')->groupBy('ticket_number')->take(10)->get();
|
||||
foreach ($data as $v) {
|
||||
return [
|
||||
'value' => $v->ticket_number,
|
||||
@@ -601,8 +924,8 @@ Route::get('mytickets/{id}', ['as' => 'ticketinfo', 'uses' => 'Client\helpdesk\G
|
||||
Route::post('checkmyticket', 'Client\helpdesk\UnAuthController@PostCheckTicket'); //ticket ckeck
|
||||
Breadcrumbs::register('check_ticket', function ($breadcrumbs, $id) {
|
||||
$page = \App\Model\helpdesk\Ticket\Tickets::whereId(1)->first();
|
||||
$breadcrumbs->parent('/');
|
||||
$breadcrumbs->push('Check Ticket', route('check_ticket', $page->id));
|
||||
$breadcrumbs->parent('dashboard');
|
||||
$breadcrumbs->push('Check Ticket');
|
||||
});
|
||||
Route::get('check_ticket/{id}', ['as' => 'check_ticket', 'uses' => 'Client\helpdesk\GuestController@get_ticket_email']); //detail ticket information
|
||||
// show ticket via have a ticket
|
||||
@@ -677,7 +1000,7 @@ Route::get('/change-file-permission', ['as' => 'change-permission', 'uses' => 'I
|
||||
|=============================================================
|
||||
| Cron Job links
|
||||
|=============================================================
|
||||
| These links are for cron job execution
|
||||
| These links are for cron job execution
|
||||
|
|
||||
*/
|
||||
Route::get('readmails', ['as' => 'readmails', 'uses' => 'Agent\helpdesk\MailController@readmails']);
|
||||
@@ -715,7 +1038,7 @@ Route::get('auto-close-tickets', ['as' => 'auto.close', 'uses' => 'Agent\helpdes
|
||||
|=============================================================
|
||||
*/
|
||||
Route::get('500', ['as' => 'error500', function () {
|
||||
return view('errors.500');
|
||||
return view('errors.500');
|
||||
}]);
|
||||
|
||||
Breadcrumbs::register('error500', function ($breadcrumbs) {
|
||||
@@ -723,7 +1046,7 @@ Breadcrumbs::register('error500', function ($breadcrumbs) {
|
||||
});
|
||||
|
||||
Route::get('404', ['as' => 'error404', function () {
|
||||
return view('errors.404');
|
||||
return view('errors.404');
|
||||
}]);
|
||||
|
||||
Breadcrumbs::register('error404', function ($breadcrumbs) {
|
||||
@@ -731,7 +1054,7 @@ Breadcrumbs::register('error404', function ($breadcrumbs) {
|
||||
});
|
||||
|
||||
Route::get('board-offline', ['as' => 'board.offline', function () {
|
||||
return view('errors.offline');
|
||||
return view('errors.offline');
|
||||
}]);
|
||||
|
||||
Breadcrumbs::register('board.offline', function ($breadcrumbs) {
|
||||
@@ -752,16 +1075,61 @@ Route::get('testmail', function () {
|
||||
|
||||
/* For the crud of catogory */
|
||||
$router->resource('category', 'Agent\kb\CategoryController');
|
||||
Breadcrumbs::register('category.index', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('dashboard');
|
||||
$breadcrumbs->push(Lang::get('lang.category'), route('category.index'));
|
||||
});
|
||||
Breadcrumbs::register('category.create', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('category.index');
|
||||
$breadcrumbs->push(Lang::get('lang.add'), route('category.create'));
|
||||
});
|
||||
Breadcrumbs::register('category.edit', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('category.index');
|
||||
$breadcrumbs->push(Lang::get('lang.edit'), url('category/{category}/edit'));
|
||||
});
|
||||
Breadcrumbs::register('category.show', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('category.index');
|
||||
$breadcrumbs->push(Lang::get('lang.view'), url('category/{category}'));
|
||||
});
|
||||
$router->get('category/delete/{id}', 'Agent\kb\CategoryController@destroy');
|
||||
/* For the crud of article */
|
||||
|
||||
|
||||
$router->resource('article', 'Agent\kb\ArticleController');
|
||||
Breadcrumbs::register('article.index', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('dashboard');
|
||||
$breadcrumbs->push(Lang::get('lang.article'), route('article.index'));
|
||||
});
|
||||
Breadcrumbs::register('article.create', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('article.index');
|
||||
$breadcrumbs->push(Lang::get('lang.add'), route('article.create'));
|
||||
});
|
||||
Breadcrumbs::register('article.edit', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('article.index');
|
||||
$breadcrumbs->push(Lang::get('lang.edit'), url('article/{article}/edit'));
|
||||
});
|
||||
Breadcrumbs::register('article.show', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('article.index');
|
||||
$breadcrumbs->push(Lang::get('lang.view'), url('article/{article}'));
|
||||
});
|
||||
$router->get('article/delete/{id}', 'Agent\kb\ArticleController@destroy');
|
||||
|
||||
/* get settings */
|
||||
$router->get('kb/settings', ['as' => 'settings', 'uses' => 'Agent\kb\SettingsController@settings']);
|
||||
Breadcrumbs::register('settings', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('dashboard');
|
||||
$breadcrumbs->push(Lang::get('lang.settings'), route('settings'));
|
||||
});
|
||||
/* post settings */
|
||||
$router->patch('postsettings/{id}', 'Agent\kb\SettingsController@postSettings');
|
||||
//Route for administrater to access the comment
|
||||
|
||||
$router->get('comment', ['as' => 'comment', 'uses' => 'Agent\kb\SettingsController@comment']);
|
||||
Breadcrumbs::register('comment', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('dashboard');
|
||||
$breadcrumbs->push(Lang::get('lang.comments'), route('comment'));
|
||||
});
|
||||
|
||||
/* Route to define the comment should Published */
|
||||
$router->get('published/{id}', ['as' => 'published', 'uses' => 'Agent\kb\SettingsController@publish']);
|
||||
/* Route for deleting comments */
|
||||
@@ -776,7 +1144,27 @@ $router->delete('deleted/{id}', ['as' => 'deleted', 'uses' => 'Agent\kb\Settings
|
||||
$router->get('delete-logo/{id}', ['as' => 'delete-logo', 'uses' => 'Agent\kb\SettingsController@deleteLogo']);
|
||||
/* delete Background */
|
||||
$router->get('delete-background/{id}', ['as' => 'delete-background', 'uses' => 'Agent\kb\SettingsController@deleteBackground']);
|
||||
|
||||
$router->resource('page', 'Agent\kb\PageController');
|
||||
Breadcrumbs::register('page.index', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('dashboard');
|
||||
$breadcrumbs->push(Lang::get('lang.pages'), route('page.index'));
|
||||
});
|
||||
Breadcrumbs::register('page.create', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('page.index');
|
||||
$breadcrumbs->push(Lang::get('lang.add'), route('page.create'));
|
||||
});
|
||||
Breadcrumbs::register('page.edit', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('page.index');
|
||||
$breadcrumbs->push(Lang::get('lang.edit'), url('page/{page}/edit'));
|
||||
});
|
||||
Breadcrumbs::register('page.show', function($breadcrumbs) {
|
||||
$breadcrumbs->parent('page.index');
|
||||
$breadcrumbs->push(Lang::get('lang.view'), url('page/{page}'));
|
||||
});
|
||||
|
||||
|
||||
|
||||
$router->get('get-pages', ['as' => 'api.page', 'uses' => 'Agent\kb\PageController@getData']);
|
||||
$router->get('page/delete/{id}', ['as' => 'pagedelete', 'uses' => 'Agent\kb\PageController@destroy']);
|
||||
$router->get('comment/delete/{id}', ['as' => 'commentdelete', 'uses' => 'Agent\kb\SettingsController@delete']);
|
||||
|
Reference in New Issue
Block a user