Update v1.0.6.6
This commit is contained in:
16
.env
16
.env
@@ -1,17 +1,17 @@
|
||||
APP_ENV=local
|
||||
APP_DEBUG=false
|
||||
APP_KEY=SomeRandomString
|
||||
DB_TYPE=mysql
|
||||
DB_HOST=localhost
|
||||
DB_DATABASE=faveo-dev
|
||||
DB_USERNAME=ladybird
|
||||
DB_PASSWORD=ladybird
|
||||
CACHE_DRIVER=file
|
||||
SESSION_DRIVER=file
|
||||
QUEUE_DRIVER=sync
|
||||
DB_PORT=
|
||||
DB_DATABASE=faveo
|
||||
DB_USERNAME=root
|
||||
DB_PASSWORD=
|
||||
MAIL_DRIVER=smtp
|
||||
MAIL_HOST=mailtrap.io
|
||||
MAIL_PORT=2525
|
||||
MAIL_USERNAME=null
|
||||
MAIL_PASSWORD=null
|
||||
DB_TYPE=mysql
|
||||
DB_PORT=
|
||||
CACHE_DRIVER=file
|
||||
SESSION_DRIVER=file
|
||||
QUEUE_DRIVER=sync
|
||||
|
@@ -1,10 +1,10 @@
|
||||
<h3>About Faveo</h3>
|
||||
<br><img src="https://travis-ci.org/ladybirdweb/faveo-helpdesk.svg?branch=master"> <img src="https://img.shields.io/badge/License-OSL-blue.svg"> <a href="https://gitter.im/ladybirdweb/faveo-helpdesk" target="_blank"><img src="https://badges.gitter.im/ladybirdweb/faveo-helpdesk.svg"></a> <a href="https://styleci.io/repos/34716238"><img src="https://styleci.io/repos/34716238/shield" alt="StyleCI" height="19px"></a> <a href="http://squizlabs.github.io/PHP_CodeSniffer/analysis/ladybirdweb/faveo-helpdesk/index.html" target="_blank"><img src="http://squizlabs.github.io/PHP_CodeSniffer/analysis/ladybirdweb/faveo-helpdesk/grade.svg" height="20px"></a> <a href="https://scrutinizer-ci.com/g/ladybirdweb/faveo-helpdesk/?branch=master" target="_blank"><img src="https://scrutinizer-ci.com/g/ladybirdweb/faveo-helpdesk/badges/quality-score.png?b=master" height="20px"></a></br>
|
||||
<h3>Development Branch of Faveo</h3>
|
||||
<br><a href="https://travis-ci.org/mverma16/faveo-helpdesk"><img src="https://travis-ci.org/mverma16/faveo-helpdesk.svg?branch=master"></a> <img src="https://img.shields.io/badge/License-OSL-blue.svg"> <a href="https://gitter.im/ladybirdweb/faveo-helpdesk" target="_blank"><img src="https://badges.gitter.im/ladybirdweb/faveo-helpdesk.svg"></a> <a href="https://styleci.io/repos/52062487"><img src="https://styleci.io/repos/52062487/shield" alt="StyleCI"></a> <a href="http://squizlabs.github.io/PHP_CodeSniffer/analysis/ladybirdweb/faveo-helpdesk/index.html" target="_blank"><img src="http://squizlabs.github.io/PHP_CodeSniffer/analysis/ladybirdweb/faveo-helpdesk/grade.svg" height="21px"></a></br>
|
||||
<p>Headquartered in Bangalore, Faveo HELPDESK provides Businesses with an automated Helpdesk system to manage customer support.
|
||||
<br/><br/>
|
||||
The word Faveo comes from Latin which means to be favourable. Which truly highlights vision and the scope as well as the functionality of the product that Faveo is. It is specifically designed to cater the needs of startups and SME’s empowering them with state of art, ticket based support system. In today’s competitive startup scenario customer retention is one of the major challenges. Handling client query diligently is all the difference between retaining or losing a long lasting relationship. The company is driven with passion of providing tools for managing consumer queries for strategic insights and helping companies take those decisive decisions.
|
||||
<br/><br/>
|
||||
To date, Faveo has been integrated with 3 platforms and every month there is 1 to 2 update releases with new features & platform integration.
|
||||
To date, Faveo has been integrated with 6 platforms and every month there is 1 to 2 update releases with new features & platform integration.
|
||||
<br/><br/>
|
||||
Faveo can also be customised according to requirement and we do undertake such request.
|
||||
<br/><br/>
|
||||
|
@@ -54,29 +54,30 @@ class Handler extends ExceptionHandler
|
||||
*/
|
||||
public function render($request, Exception $e)
|
||||
{
|
||||
if ($e instanceof \Tymon\JWTAuth\Exceptions\TokenExpiredException) {
|
||||
return response()->json(['message' => $e->getMessage(), 'code' => $e->getStatusCode()]);
|
||||
} elseif ($e instanceof \Tymon\JWTAuth\Exceptions\TokenInvalidException) {
|
||||
return response()->json(['message' => $e->getMessage(), 'code' => $e->getStatusCode()]);
|
||||
}
|
||||
// This is to check if the debug is true or false
|
||||
if (config('app.debug') == false) {
|
||||
// checking if the error is actually an error page or if its an system error page
|
||||
if ($this->isHttpException($e) && $e->getStatusCode() == 404) {
|
||||
return response()->view('errors.404', []);
|
||||
} else {
|
||||
// checking if the application is installed
|
||||
if (\Config::get('database.install') == 1) {
|
||||
// checking if the error log send to Ladybirdweb is enabled or not
|
||||
if (\Config::get('app.ErrorLog') == '%1%') {
|
||||
//$this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('1', '0'), $to = ['name' => 'faveo logger', 'email' => 'faveoerrorlogger@gmail.com'], $message = ['subject' => 'Faveo downloaded from github has occured error', 'scenario' => 'error-report'], $template_variables = ['e' => $e]);
|
||||
}
|
||||
}
|
||||
|
||||
return response()->view('errors.500', []);
|
||||
}
|
||||
}
|
||||
// returns non oops error message
|
||||
// $phpmail = new PhpMailController;
|
||||
// if ($e instanceof \Tymon\JWTAuth\Exceptions\TokenExpiredException) {
|
||||
// return response()->json(['message' => $e->getMessage(), 'code' => $e->getStatusCode()]);
|
||||
// } elseif ($e instanceof \Tymon\JWTAuth\Exceptions\TokenInvalidException) {
|
||||
// return response()->json(['message' => $e->getMessage(), 'code' => $e->getStatusCode()]);
|
||||
// }
|
||||
// // This is to check if the debug is true or false
|
||||
// if (config('app.debug') == false) {
|
||||
// // checking if the error is actually an error page or if its an system error page
|
||||
// if ($this->isHttpException($e) && $e->getStatusCode() == 404) {
|
||||
// return response()->view('errors.404', []);
|
||||
// } else {
|
||||
// // checking if the application is installed
|
||||
// if (\Config::get('database.install') == 1) {
|
||||
// // checking if the error log send to Ladybirdweb is enabled or not
|
||||
// if (\Config::get('app.ErrorLog') == '1') {
|
||||
// $this->phpmail->sendmail($from = $this->PhpMailController->mailfrom('1', '0'), $to = ['name' => 'faveo logger', 'email' => 'faveoerrorlogger@gmail.com'], $message = ['subject' => 'Faveo downloaded from github has occured error', 'scenario' => 'error-report'], $template_variables = ['e' => $e]);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// return response()->view('errors.500', []);
|
||||
// }
|
||||
// }
|
||||
// // returns non oops error message
|
||||
return parent::render($request, $e);
|
||||
// checking if the error is related to http error i.e. page not found
|
||||
if ($this->isHttpException($e)) {
|
||||
|
@@ -4,7 +4,6 @@ namespace App\Http\Controllers\Admin\helpdesk;
|
||||
|
||||
// controller
|
||||
use App\Http\Controllers\Common\PhpMailController;
|
||||
use App\Http\Controllers\Common\SettingsController;
|
||||
use App\Http\Controllers\Controller;
|
||||
// request
|
||||
use App\Http\Requests\helpdesk\AgentRequest;
|
||||
@@ -14,20 +13,16 @@ use App\Model\helpdesk\Agent\Assign_team_agent;
|
||||
use App\Model\helpdesk\Agent\Department;
|
||||
use App\Model\helpdesk\Agent\Groups;
|
||||
use App\Model\helpdesk\Agent\Teams;
|
||||
use App\Model\helpdesk\Email\Emails;
|
||||
use App\Model\helpdesk\Settings\Company;
|
||||
use App\Model\helpdesk\Settings\Email;
|
||||
use App\Model\helpdesk\Utility\Timezones;
|
||||
use App\User;
|
||||
// classes
|
||||
use DB;
|
||||
use Exception;
|
||||
use Hash;
|
||||
use Mail;
|
||||
|
||||
/**
|
||||
* AgentController
|
||||
* This controller is used to CRUD category.
|
||||
* This controller is used to CRUD Agents.
|
||||
*
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
@@ -44,8 +39,8 @@ class AgentController extends Controller
|
||||
*/
|
||||
public function __construct(PhpMailController $PhpMailController)
|
||||
{
|
||||
// creating an instance for the PhpmailController
|
||||
$this->PhpMailController = $PhpMailController;
|
||||
SettingsController::smtp();
|
||||
// checking authentication
|
||||
$this->middleware('auth');
|
||||
// checking admin roles
|
||||
@@ -55,84 +50,89 @@ class AgentController extends Controller
|
||||
/**
|
||||
* Get all agent list page.
|
||||
*
|
||||
* @param type User $user
|
||||
*
|
||||
* @return type Response
|
||||
* @return type view
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
try {
|
||||
return view('themes.default1.admin.helpdesk.agent.agents.index');
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
return redirect()->back()->with('fails', $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* creating a new agent.
|
||||
*
|
||||
* @param type Assign_team_agent $team_assign_agent
|
||||
* @param type Timezones $timezone
|
||||
* @param type Groups $group
|
||||
* @param type Department $department
|
||||
* @param type Teams $team
|
||||
* @param Assign_team_agent $team_assign_agent
|
||||
* @param Timezones $timezone
|
||||
* @param Groups $group
|
||||
* @param Department $department
|
||||
* @param Teams $team_all
|
||||
*
|
||||
* @return type view
|
||||
*/
|
||||
public function create(Assign_team_agent $team_assign_agent, Timezones $timezone, Groups $group, Department $department, Teams $team)
|
||||
public function create(Timezones $timezone, Groups $group, Department $department, Teams $team_all)
|
||||
{
|
||||
try {
|
||||
$team = $team->get();
|
||||
// gte all the teams
|
||||
$team = $team_all->get();
|
||||
// get all the timezones
|
||||
$timezones = $timezone->get();
|
||||
// get all the groups
|
||||
$groups = $group->get();
|
||||
// get all department
|
||||
$departments = $department->get();
|
||||
// list all the teams in a single variable
|
||||
$teams = $team->lists('id', 'name');
|
||||
|
||||
// returns to the page with all the variables and their datas
|
||||
return view('themes.default1.admin.helpdesk.agent.agents.create', compact('assign', 'teams', 'agents', 'timezones', 'groups', 'departments', 'team'));
|
||||
} catch (Exception $e) {
|
||||
return redirect()->back()->with('fails', $e->errorInfo[2]);
|
||||
// returns if try fails with exception meaagse
|
||||
return redirect()->back()->with('fails', $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* store a new agent.
|
||||
*
|
||||
* @param type User $user
|
||||
* @param type AgentRequest $request
|
||||
* @param type Assign_team_agent $team_assign_agent
|
||||
* @param User $user
|
||||
* @param AgentRequest $request
|
||||
* @param Assign_team_agent $team_assign_agent
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function store(User $user, AgentRequest $request, Assign_team_agent $team_assign_agent)
|
||||
public function store(User $user, AgentRequest $request)
|
||||
{
|
||||
|
||||
// dd($this->system_mail());
|
||||
|
||||
/* Insert to user table */
|
||||
$user->role = 'agent';
|
||||
// fixing the user role to agent
|
||||
$user->fill($request->input())->save();
|
||||
$password = $this->generateRandomString();
|
||||
$user->password = Hash::make($password);
|
||||
// generate password and has immediately to store
|
||||
$user->password = Hash::make($this->generateRandomString());
|
||||
// fetching all the team details checked for this user
|
||||
$requests = $request->input('team_id');
|
||||
// get user id of the inserted user detail
|
||||
$id = $user->id;
|
||||
// insert team
|
||||
foreach ($requests as $req) {
|
||||
// DB::insert('insert into team_assign_agent (team_id, agent_id) values (?,?)', [$req, $id]);
|
||||
// insert all the selected team id to the team and agent relationship table
|
||||
DB::insert('insert into team_assign_agent (team_id, agent_id) values (?,?)', [$req, $id]);
|
||||
}
|
||||
/* Succes And Failure condition */
|
||||
// save user credentails
|
||||
if ($user->save() == true) {
|
||||
// fetch user credentails to send mail
|
||||
$name = $user->user_name;
|
||||
$email = $user->email;
|
||||
$system_from = $this->company();
|
||||
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]);
|
||||
} catch (Exception $e) {
|
||||
// returns if try fails
|
||||
return redirect('agents')->with('fails', 'Some error occured while sending mail to the agent. Please check email settings and try again');
|
||||
}
|
||||
|
||||
// returns for the success case
|
||||
return redirect('agents')->with('success', 'Agent Created sucessfully');
|
||||
} else {
|
||||
// returns if fails
|
||||
return redirect('agents')->with('fails', 'Agent can not Create');
|
||||
}
|
||||
}
|
||||
@@ -209,9 +209,11 @@ class AgentController extends Controller
|
||||
/**
|
||||
* Remove the specified agent from storage.
|
||||
*
|
||||
* @param type int $id
|
||||
* @param type User $user
|
||||
* @param type Assign_team_agent $team_assign_agent
|
||||
* @param type $id
|
||||
* @param User $user
|
||||
* @param Assign_team_agent $team_assign_agent
|
||||
*
|
||||
* @throws Exception
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
@@ -230,8 +232,6 @@ class AgentController extends Controller
|
||||
|
||||
return redirect('agents')->with('success', 'Agent Deleted sucessfully');
|
||||
} catch (\Exception $e) {
|
||||
dd($e->errorInfo);
|
||||
|
||||
return redirect('agents')->with('fails', $error);
|
||||
}
|
||||
}
|
||||
@@ -241,47 +241,21 @@ class AgentController extends Controller
|
||||
*
|
||||
* @param type $length
|
||||
*
|
||||
* @return type string
|
||||
* @return string
|
||||
*/
|
||||
public function generateRandomString($length = 10)
|
||||
{
|
||||
// list of supported characters
|
||||
$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
|
||||
// character length checked
|
||||
$charactersLength = strlen($characters);
|
||||
// creating an empty variable for random string
|
||||
$randomString = '';
|
||||
// fetching random string
|
||||
for ($i = 0; $i < $length; $i++) {
|
||||
$randomString .= $characters[rand(0, $charactersLength - 1)];
|
||||
}
|
||||
|
||||
// return random string
|
||||
return $randomString;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetching comapny name to send mail.
|
||||
*
|
||||
* @return type
|
||||
*/
|
||||
public function company()
|
||||
{
|
||||
$company = Company::Where('id', '=', '1')->first();
|
||||
if ($company->company_name == null) {
|
||||
$company = 'Support Center';
|
||||
} else {
|
||||
$company = $company->company_name;
|
||||
}
|
||||
|
||||
return $company;
|
||||
}
|
||||
|
||||
/*
|
||||
* System default email
|
||||
*/
|
||||
// public function system_mail() {
|
||||
// $emails = Emails::all();
|
||||
// $count_emails = $emails->count();
|
||||
// if($count_emails > 1) {
|
||||
// dd($emails);
|
||||
// }
|
||||
// $email = Email::where('id', '=', '1')->first();
|
||||
// return $email->sys_email;
|
||||
// }
|
||||
}
|
||||
|
@@ -39,11 +39,9 @@ class BanlistController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
* Display a listing of all the banned users.
|
||||
*
|
||||
* @param type Banlist $ban
|
||||
*
|
||||
* @return type Response
|
||||
* @return type
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
@@ -57,7 +55,7 @@ class BanlistController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
* Show the form for creating a banned user.
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
@@ -71,11 +69,10 @@ class BanlistController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
* Store a new banned user credentials.
|
||||
*
|
||||
* @param type banlist $ban
|
||||
* @param type BanRequest $request
|
||||
* @param type User $user
|
||||
* @param BanRequest $request
|
||||
* @param User $user
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
@@ -107,22 +104,10 @@ class BanlistController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
* Editing the details of the banned users.
|
||||
*
|
||||
* @param int $id
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param type int $id
|
||||
* @param type Banlist $ban
|
||||
* @param type $id
|
||||
* @param User $ban
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
@@ -138,11 +123,11 @@ class BanlistController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
* Update the banned users.
|
||||
*
|
||||
* @param type int $id
|
||||
* @param type Banlist $ban
|
||||
* @param type BanlistRequest $request
|
||||
* @param type $id
|
||||
* @param User $ban
|
||||
* @param BanlistRequest $request
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
@@ -152,7 +137,6 @@ class BanlistController extends Controller
|
||||
$bans = $ban->whereId($id)->first();
|
||||
$bans->internal_note = $request->input('internal_note');
|
||||
$bans->ban = $request->input('ban');
|
||||
// dd($request->input('ban'));
|
||||
if ($bans->save()) {
|
||||
return redirect('banlist')->with('success', 'Banned Email Updated sucessfully');
|
||||
} else {
|
||||
@@ -162,22 +146,4 @@ class BanlistController extends Controller
|
||||
return redirect('banlist')->with('fails', 'Banned Email not Updated');
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Remove the specified resource from storage.
|
||||
* @param type int $id
|
||||
* @param type Banlist $ban
|
||||
* @return type Response
|
||||
*/
|
||||
// public function destroy($id, Banlist $ban) {
|
||||
// $bans = $ban->whereId($id)->first();
|
||||
// dd($bans);
|
||||
// /* Success and Falure condition */
|
||||
// try{
|
||||
// $bans->delete();
|
||||
// return redirect('banlist')->with('success', 'Banned Email Deleted sucessfully');
|
||||
// } catch (Exception $e) {
|
||||
// return redirect('banlist')->with('fails', 'Banned Email can not Delete'.'<li>'.$e->errorInfo[2].'</li>');
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
@@ -7,26 +7,32 @@ use App\Http\Controllers\Controller;
|
||||
// request
|
||||
use App\Http\Requests\helpdesk\EmailsEditRequest;
|
||||
use App\Http\Requests\helpdesk\EmailsRequest;
|
||||
// model
|
||||
use App\Model\helpdesk\Agent\Department;
|
||||
// model
|
||||
use App\Model\helpdesk\Email\Emails;
|
||||
use App\Model\helpdesk\Manage\Help_topic;
|
||||
use App\Model\helpdesk\Settings\Email;
|
||||
use App\Model\helpdesk\Ticket\Ticket_Priority;
|
||||
use App\Model\helpdesk\Utility\MailboxProtocol;
|
||||
// classes
|
||||
use Crypt;
|
||||
// classes
|
||||
use Exception;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
//use PhpImap\Mailbox as ImapMailbox;
|
||||
|
||||
/**
|
||||
* ======================================
|
||||
* EmailsController.
|
||||
* ======================================
|
||||
* This Controller is used to define below mentioned set of functions applied to the Emails in the system.
|
||||
*
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class EmailsController extends Controller
|
||||
{
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
* Defining constructor variables.
|
||||
*
|
||||
* @return type
|
||||
*/
|
||||
@@ -37,20 +43,21 @@ class EmailsController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
* Display a listing of the Emails.
|
||||
*
|
||||
* @param type Emails $emails
|
||||
*
|
||||
* @return type Response
|
||||
* @return type view
|
||||
*/
|
||||
public function index(Emails $emails)
|
||||
public function index(Emails $email)
|
||||
{
|
||||
try {
|
||||
$emails = $emails->get();
|
||||
// fetch all the emails from emails table
|
||||
$emails = $email->get();
|
||||
|
||||
return view('themes.default1.admin.helpdesk.emails.emails.index', compact('emails'));
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
return redirect()->back()->with('fails', $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,81 +71,155 @@ class EmailsController extends Controller
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function create(Department $department, Help_topic $help, Ticket_Priority $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();
|
||||
// fetch all the helptopics from the helptopic table
|
||||
$helps = $help->get();
|
||||
$priority = $priority->get();
|
||||
// fetch all the types of priority from the ticket_priority table
|
||||
$priority = $ticket_priority->get();
|
||||
// fetch all the types of mailbox protocols from the mailbox_protocols table
|
||||
$mailbox_protocols = $mailbox_protocol->get();
|
||||
|
||||
// return with all the table data
|
||||
return view('themes.default1.admin.helpdesk.emails.emails.create', compact('mailbox_protocols', 'priority', 'departments', 'helps'));
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
// return error messages if any
|
||||
return redirect()->back()->with('fails', $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check for email input validation.
|
||||
*
|
||||
* @param EmailsRequest $request
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function validatingEmailSettings(Request $request)
|
||||
{
|
||||
$validator = \Validator::make(
|
||||
[
|
||||
'email_address' => $request->email_address,
|
||||
'email_name' => $request->email_name,
|
||||
'password' => $request->password,
|
||||
], [
|
||||
'email_address' => 'required|email|unique:emails',
|
||||
'email_name' => 'required',
|
||||
'password' => 'required',
|
||||
]
|
||||
);
|
||||
if ($validator->fails()) {
|
||||
$jsons = $validator->messages();
|
||||
$val = '';
|
||||
foreach ($jsons->all() as $key => $value) {
|
||||
$val .= $value;
|
||||
}
|
||||
$return_data = rtrim(str_replace('.', ',', $val), ',');
|
||||
|
||||
return $return_data;
|
||||
}
|
||||
if ($request->fetching_status == 'on') {
|
||||
$imap_check = $this->getImapStream($request);
|
||||
if ($imap_check == 0) {
|
||||
return 'Incoming email connection failed';
|
||||
}
|
||||
$need_to_check_imap = 1;
|
||||
} else {
|
||||
$imap_check = 0;
|
||||
$need_to_check_imap = 0;
|
||||
}
|
||||
if ($request->sending_status == 'on') {
|
||||
$smtp_check = $this->getSmtp($request);
|
||||
if ($smtp_check == 0) {
|
||||
return 'Outgoing email connection failed';
|
||||
}
|
||||
$need_to_check_smtp = 1;
|
||||
} else {
|
||||
$smtp_check = 0;
|
||||
$need_to_check_smtp = 0;
|
||||
}
|
||||
|
||||
if ($need_to_check_imap == 1 && $need_to_check_smtp == 1) {
|
||||
if ($imap_check != 0 && $smtp_check != 0) {
|
||||
$this->store($request);
|
||||
$return = 1;
|
||||
}
|
||||
} elseif ($need_to_check_imap == 1 && $need_to_check_smtp == 0) {
|
||||
if ($imap_check != 0 && $smtp_check == 0) {
|
||||
$this->store($request);
|
||||
$return = 1;
|
||||
}
|
||||
} elseif ($need_to_check_imap == 0 && $need_to_check_smtp == 1) {
|
||||
if ($imap_check == 0 && $smtp_check != 0) {
|
||||
$this->store($request);
|
||||
$return = 1;
|
||||
}
|
||||
} elseif ($need_to_check_imap == 0 && $need_to_check_smtp == 0) {
|
||||
if ($imap_check == 0 && $smtp_check == 0) {
|
||||
$this->store($request, null);
|
||||
$return = 1;
|
||||
}
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @param type Emails $email
|
||||
* @param type EmailsRequest $request
|
||||
*
|
||||
* @return type Response
|
||||
* @return type Redirect
|
||||
*/
|
||||
public function store(Emails $email, EmailsRequest $request)
|
||||
public function store($request)
|
||||
{
|
||||
// dd($request);
|
||||
$email = new Emails();
|
||||
try {
|
||||
$password = $request->input('password');
|
||||
$encrypted = Crypt::encrypt($password);
|
||||
$department = $request->input('department');
|
||||
$priority = $request->input('priority');
|
||||
$help_topic = $request->input('help_topic');
|
||||
|
||||
if ($email->fill($request->except('password', 'department', 'priority', 'help_topic'))->save() == true) {
|
||||
if ($request->input('department')) {
|
||||
$email->department = $request->input('department');
|
||||
// getConnection($request->input('email_name'), $request->input('email_address'), $request->input('email_address'))
|
||||
// saving all the fields to the database
|
||||
if ($email->fill($request->except('password', 'department', 'priority', 'help_topic', 'fetching_status', 'sending_status'))->save() == true) {
|
||||
if ($request->fetching_status == 'on') {
|
||||
$email->fetching_status = 1;
|
||||
} else {
|
||||
$email->department = null;
|
||||
$email->fetching_status = 0;
|
||||
}
|
||||
if ($request->input('priority')) {
|
||||
$email->priority = $request->input('priority');
|
||||
if ($request->sending_status == 'on') {
|
||||
$email->sending_status = 1;
|
||||
} else {
|
||||
$email->priority = null;
|
||||
$email->sending_status = 0;
|
||||
}
|
||||
if ($request->input('help_topic')) {
|
||||
$email->help_topic = $request->input('help_topic');
|
||||
} else {
|
||||
$email->help_topic = null;
|
||||
}
|
||||
$email->password = $encrypted;
|
||||
$email->save();
|
||||
|
||||
// fetching department value
|
||||
$email->department = $this->departmentValue($request->input('department'));
|
||||
// fetching priority value
|
||||
$email->priority = $this->priorityValue($request->input('priority'));
|
||||
// fetching helptopic value
|
||||
$email->help_topic = $this->helpTopicValue($request->input('help_topic'));
|
||||
// inserting the encrypted value of password
|
||||
$email->password = Crypt::encrypt($request->input('password'));
|
||||
$email->save(); // run save
|
||||
// Creating a default system email as the first email is inserted to the system
|
||||
$email_settings = Email::where('id', '=', '1')->first();
|
||||
$email_settings->sys_email = $email->id;
|
||||
$email_settings->save();
|
||||
|
||||
return redirect('emails')->with('success', 'Email Created sucessfully');
|
||||
// returns success message for successful email creation
|
||||
// return redirect('emails')->with('success', 'Email Created sucessfully');
|
||||
return 1;
|
||||
} else {
|
||||
return redirect('emails')->with('fails', 'Email can not Create');
|
||||
// returns fail message for unsuccessful save execution
|
||||
// return redirect('emails')->with('fails', 'Email can not Create');
|
||||
return 0;
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
return redirect('emails')->with('fails', 'Email can not Create');
|
||||
// returns if try fails
|
||||
// return redirect()->back()->with('fails', $e->getMessage());
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
@@ -151,21 +232,104 @@ class EmailsController extends Controller
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function edit($id, Department $department, Help_topic $help, Emails $email, Ticket_Priority $priority, MailboxProtocol $mailbox_protocol)
|
||||
public function edit($id, Department $department, Help_topic $help, Emails $email, Ticket_Priority $ticket_priority, MailboxProtocol $mailbox_protocol)
|
||||
{
|
||||
try {
|
||||
// fetch the selected emails
|
||||
$emails = $email->whereId($id)->first();
|
||||
// get all the departments
|
||||
$departments = $department->get();
|
||||
// get all the helptopic
|
||||
$helps = $help->get();
|
||||
$priority = $priority->get();
|
||||
// get all the priority
|
||||
$priority = $ticket_priority->get();
|
||||
// get all the mailbox protocols
|
||||
$mailbox_protocols = $mailbox_protocol->get();
|
||||
|
||||
// return if the execution is succeeded
|
||||
return view('themes.default1.admin.helpdesk.emails.emails.edit', compact('mailbox_protocols', 'priority', 'departments', 'helps', 'emails'));
|
||||
} catch (Exception $e) {
|
||||
return view('404');
|
||||
// return if try fails
|
||||
return redirect()->back()->with('fails', $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check for email input validation.
|
||||
*
|
||||
* @param EmailsRequest $request
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function validatingEmailSettingsUpdate($id, Request $request)
|
||||
{
|
||||
$validator = \Validator::make(
|
||||
[
|
||||
'email_address' => $request->email_address,
|
||||
'email_name' => $request->email_name,
|
||||
'password' => $request->password,
|
||||
], [
|
||||
'email_address' => 'email',
|
||||
'email_name' => 'required',
|
||||
'password' => 'required',
|
||||
]
|
||||
);
|
||||
if ($validator->fails()) {
|
||||
$jsons = $validator->messages();
|
||||
$val = '';
|
||||
foreach ($jsons->all() as $key => $value) {
|
||||
$val .= $value;
|
||||
}
|
||||
$return_data = rtrim(str_replace('.', ',', $val), ',');
|
||||
|
||||
return $return_data;
|
||||
}
|
||||
// return $request;
|
||||
if ($request->fetching_status == 'on') {
|
||||
$imap_check = $this->getImapStream($request);
|
||||
if ($imap_check == 0) {
|
||||
return 'Incoming email connection failed';
|
||||
}
|
||||
$need_to_check_imap = 1;
|
||||
} else {
|
||||
$imap_check = 0;
|
||||
$need_to_check_imap = 0;
|
||||
}
|
||||
if ($request->sending_status == 'on') {
|
||||
$smtp_check = $this->getSmtp($request);
|
||||
if ($smtp_check == 0) {
|
||||
return 'Outgoing email connection failed';
|
||||
}
|
||||
$need_to_check_smtp = 1;
|
||||
} else {
|
||||
$smtp_check = 0;
|
||||
$need_to_check_smtp = 0;
|
||||
}
|
||||
|
||||
if ($need_to_check_imap == 1 && $need_to_check_smtp == 1) {
|
||||
if ($imap_check != 0 && $smtp_check != 0) {
|
||||
$this->update($id, $request);
|
||||
$return = 1;
|
||||
}
|
||||
} elseif ($need_to_check_imap == 1 && $need_to_check_smtp == 0) {
|
||||
if ($imap_check != 0 && $smtp_check == 0) {
|
||||
$this->update($id, $request);
|
||||
$return = 1;
|
||||
}
|
||||
} elseif ($need_to_check_imap == 0 && $need_to_check_smtp == 1) {
|
||||
if ($imap_check == 0 && $smtp_check != 0) {
|
||||
$this->update($id, $request);
|
||||
$return = 1;
|
||||
}
|
||||
} elseif ($need_to_check_imap == 0 && $need_to_check_smtp == 0) {
|
||||
if ($imap_check == 0 && $smtp_check == 0) {
|
||||
$this->update($id, $request);
|
||||
$return = 1;
|
||||
}
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
@@ -175,39 +339,40 @@ class EmailsController extends Controller
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function update($id, Emails $email, EmailsEditRequest $request)
|
||||
public function update($id, $request)
|
||||
{
|
||||
$password = $request->input('password');
|
||||
$encrypted = Crypt::encrypt($password);
|
||||
//echo $encrypted;
|
||||
//$value = Crypt::decrypt($encrypted);
|
||||
//echo $value;
|
||||
try {
|
||||
$emails = $email->whereId($id)->first();
|
||||
// $emails->password = $encrypted;
|
||||
$emails->fill($request->except('password', 'department', 'priority', 'help_topic'))->save();
|
||||
if ($request->input('department')) {
|
||||
$emails->department = $request->input('department');
|
||||
// fetch the selected emails
|
||||
$emails = Emails::whereId($id)->first();
|
||||
// insert all the requested parameters with except
|
||||
$emails->fill($request->except('password', 'department', 'priority', 'help_topic', 'fetching_status', 'sending_status'))->save();
|
||||
if ($request->fetching_status == 'on') {
|
||||
$emails->fetching_status = 1;
|
||||
} else {
|
||||
$emails->department = null;
|
||||
$emails->fetching_status = 0;
|
||||
}
|
||||
if ($request->input('priority')) {
|
||||
$emails->priority = $request->input('priority');
|
||||
if ($request->sending_status == 'on') {
|
||||
$emails->sending_status = 1;
|
||||
} else {
|
||||
$emails->priority = null;
|
||||
$emails->sending_status = 0;
|
||||
}
|
||||
if ($request->input('help_topic')) {
|
||||
$emails->help_topic = $request->input('help_topic');
|
||||
} else {
|
||||
$emails->help_topic = null;
|
||||
}
|
||||
$emails->password = $encrypted;
|
||||
// fetching department value
|
||||
$emails->department = $this->departmentValue($request->input('department'));
|
||||
// fetching priority value
|
||||
$emails->priority = $this->priorityValue($request->input('priority'));
|
||||
// fetching helptopic value
|
||||
$emails->help_topic = $this->helpTopicValue($request->input('help_topic'));
|
||||
// inserting the encrypted value of password
|
||||
$emails->password = Crypt::encrypt($request->input('password'));
|
||||
$emails->save();
|
||||
|
||||
return redirect('emails')->with('success', 'Email Updated sucessfully');
|
||||
// returns success message for successful email update
|
||||
$return = 1;
|
||||
} catch (Exception $e) {
|
||||
return redirect('emails')->with('fails', 'Email not updated');
|
||||
// returns if try fails
|
||||
$return = $e->getMessage();
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -216,25 +381,168 @@ class EmailsController extends Controller
|
||||
* @param type int $id
|
||||
* @param type Emails $email
|
||||
*
|
||||
* @return type Response
|
||||
* @return type Redirect
|
||||
*/
|
||||
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) {
|
||||
// checking if the default system email is the passed email
|
||||
if ($id == $default_system_email->sys_email) {
|
||||
return redirect('emails')->with('fails', 'You cannot delete system default Email');
|
||||
}
|
||||
}
|
||||
try {
|
||||
// fetching the database instance of the current email
|
||||
$emails = $email->whereId($id)->first();
|
||||
// checking if deleting the email is success or if it's carrying any dependencies
|
||||
if ($emails->delete() == true) {
|
||||
return redirect('emails')->with('success', 'Email Deleted sucessfully');
|
||||
} else {
|
||||
return redirect('emails')->with('fails', 'Email can not Delete ');
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
return redirect('emails')->with('fails', 'Email can not Delete ');
|
||||
// returns if the try fails
|
||||
return redirect()->back()->with('fails', $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create imap connection.
|
||||
*
|
||||
* @param type $request
|
||||
*
|
||||
* @return type int
|
||||
*/
|
||||
public function getImapStream($request)
|
||||
{
|
||||
$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');
|
||||
if ($fetching_encryption == 'none') {
|
||||
$fetching_encryption = 'novalidate-cert';
|
||||
}
|
||||
$mailbox_protocol = $fetching_protocol.$fetching_encryption;
|
||||
$host = $request->input('fetching_host');
|
||||
$port = $request->input('fetching_port');
|
||||
$mailbox = '{'.$host.':'.$port.$mailbox_protocol.'}INBOX';
|
||||
try {
|
||||
$imap_stream = imap_open($mailbox, $username, $password);
|
||||
} catch (\Exception $ex) {
|
||||
return $ex->getMessage();
|
||||
}
|
||||
$imap_stream = imap_open($mailbox, $username, $password);
|
||||
if ($imap_stream) {
|
||||
$return = 1;
|
||||
} else {
|
||||
$return = 0;
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check connection.
|
||||
*
|
||||
* @param type $imap_stream
|
||||
*
|
||||
* @return type int
|
||||
*/
|
||||
public function checkImapStream($imap_stream)
|
||||
{
|
||||
$check_imap_stream = imap_check($imap_stream);
|
||||
if ($check_imap_stream) {
|
||||
$imap_stream = 1;
|
||||
} else {
|
||||
$imap_stream = 0;
|
||||
}
|
||||
|
||||
return $imap_stream;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get smtp connection.
|
||||
*
|
||||
* @param type $request
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getSmtp($request)
|
||||
{
|
||||
$sending_status = $request->input('sending_status');
|
||||
$mail = new \PHPMailer();
|
||||
$mail->isSMTP();
|
||||
$mail->Host = $request->input('sending_host');
|
||||
$mail->SMTPAuth = true; // Enable SMTP authentication
|
||||
$mail->Username = $request->input('email_address');
|
||||
$mail->Password = $request->input('password');
|
||||
$mail->SMTPSecure = $request->input('sending_encryption');
|
||||
$mail->Port = $request->input('sending_port');
|
||||
if ($mail->smtpConnect() == true) {
|
||||
$mail->smtpClose();
|
||||
$return = 1;
|
||||
} else {
|
||||
$return = 0;
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checking if department value is null.
|
||||
*
|
||||
* @param type $dept
|
||||
*
|
||||
* @return type string or null
|
||||
*/
|
||||
public function departmentValue($dept)
|
||||
{
|
||||
if ($dept) {
|
||||
$email_department = $dept;
|
||||
} else {
|
||||
$email_department = null;
|
||||
}
|
||||
|
||||
return $email_department;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checking if priority value is null.
|
||||
*
|
||||
* @param type $priority
|
||||
*
|
||||
* @return type string or null
|
||||
*/
|
||||
public function priorityValue($priority)
|
||||
{
|
||||
if ($priority) {
|
||||
$email_priority = $priority;
|
||||
} else {
|
||||
$email_priority = null;
|
||||
}
|
||||
|
||||
return $email_priority;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checking if helptopic value is null.
|
||||
*
|
||||
* @param type $help_topic
|
||||
*
|
||||
* @return type string or null
|
||||
*/
|
||||
public function helpTopicValue($help_topic)
|
||||
{
|
||||
if ($help_topic) {
|
||||
$email_help_topic = $help_topic;
|
||||
} else {
|
||||
$email_help_topic = null;
|
||||
}
|
||||
|
||||
return $email_help_topic;
|
||||
}
|
||||
}
|
||||
|
@@ -24,15 +24,14 @@ use Mail;
|
||||
*
|
||||
* @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;
|
||||
SettingsController::smtp();
|
||||
$this->middleware('auth');
|
||||
@@ -46,8 +45,7 @@ class TemplateController extends Controller
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function index(Template $template)
|
||||
{
|
||||
public function index(Template $template) {
|
||||
try {
|
||||
$templates = $template->get();
|
||||
|
||||
@@ -65,8 +63,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();
|
||||
@@ -85,8 +82,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) {
|
||||
@@ -109,8 +105,7 @@ class TemplateController extends Controller
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
public function show($id) {
|
||||
//
|
||||
}
|
||||
|
||||
@@ -123,8 +118,7 @@ class TemplateController extends Controller
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function listdirectories()
|
||||
{
|
||||
public function listdirectories() {
|
||||
$path = '../resources/views/emails/';
|
||||
$directories = scandir($path);
|
||||
$directory = str_replace('/', '-', $path);
|
||||
@@ -132,32 +126,29 @@ class TemplateController extends Controller
|
||||
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";
|
||||
@@ -169,7 +160,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 === '..') {
|
||||
@@ -177,29 +168,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!');
|
||||
@@ -208,7 +197,7 @@ class TemplateController extends Controller
|
||||
$objects = scandir($dir);
|
||||
foreach ($objects as $object) {
|
||||
if ($object != '.' && $object != '..') {
|
||||
unlink($dir.'/'.$object);
|
||||
unlink($dir . '/' . $object);
|
||||
}
|
||||
}
|
||||
rmdir($dir);
|
||||
@@ -219,15 +208,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();
|
||||
@@ -247,8 +234,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();
|
||||
@@ -274,8 +260,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 */
|
||||
@@ -299,8 +284,7 @@ class TemplateController extends Controller
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function formDiagno(Emails $email)
|
||||
{
|
||||
public function formDiagno(Emails $email) {
|
||||
try {
|
||||
$emails = $email->get();
|
||||
|
||||
@@ -317,15 +301,21 @@ class TemplateController extends Controller
|
||||
*
|
||||
* @return type
|
||||
*/
|
||||
public function postDiagno(Request $request)
|
||||
{
|
||||
public function postDiagno(Request $request) {
|
||||
$email = $request->input('to');
|
||||
if ($email == null) {
|
||||
return redirect('getdiagno')->with('fails', 'Please provide E-mail address !');
|
||||
}
|
||||
// sending mail via php mailer
|
||||
$mail = $this->PhpMailController->sendmail($from = 1, $to = ['email' => $email], $message = ['subject' => 'Checking the connection', 'scenario' => 'error-report', 'content' => 'Email Received Successfully'], $template_variables = ['system_error' => 'hello']);
|
||||
$mail = $this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('1', '0'), $to = ['email' => $email], $message = ['subject' => 'Checking the connection', 'scenario' => 'error-report', 'content' => 'Email Received Successfully'], $template_variables = ['system_error' => 'hello']);
|
||||
|
||||
return redirect('getdiagno')->with('success', 'Please check your mail. An E-mail has been sent to your E-mail address');
|
||||
if($mail == null){
|
||||
return redirect('getdiagno')->with('fails', 'Please check your E-mail settings. Unable to send mails');
|
||||
} else {
|
||||
return redirect('getdiagno')->with('success', 'Please check your mail. An E-mail has been sent to your E-mail address');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -51,137 +51,142 @@ class MailController extends Controller
|
||||
if ($settings_email->first()->email_fetching == 1) {
|
||||
if ($settings_email->first()->all_emails == 1) {
|
||||
// $helptopic = $this->TicketController->default_helptopic();
|
||||
// $sla = $this->TicketController->default_sla();
|
||||
// $sla = $this->TicketController->default_sla();
|
||||
$email = $emails->get();
|
||||
foreach ($email as $e_mail) {
|
||||
$priority = $e_mail->priority;
|
||||
$dept = $e_mail->department;
|
||||
$helptopic = $e_mail->help_topic;
|
||||
|
||||
if ($priority == null) {
|
||||
$priority = $ticket->first()->priority;
|
||||
}
|
||||
|
||||
if ($dept == null) {
|
||||
$dept = $system->first()->department;
|
||||
}
|
||||
|
||||
if ($helptopic == null) {
|
||||
$helptopic = $ticket->first()->help_topic;
|
||||
}
|
||||
// dd($dept);
|
||||
|
||||
$get_helptopic = Help_topic::where('id', '=', $helptopic)->first();
|
||||
$sla = $get_helptopic->sla_plan;
|
||||
// $dept = $e_mail->department;
|
||||
$host = $e_mail->fetching_host;
|
||||
$port = $e_mail->fetching_port;
|
||||
$protocol = $e_mail->mailbox_protocol;
|
||||
$get_mailboxprotocol = MailboxProtocol::where('id', '=', $protocol)->first();
|
||||
$protocol = $get_mailboxprotocol->value;
|
||||
$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')));
|
||||
if (!$mailsIds) {
|
||||
die('Mailbox is empty');
|
||||
}
|
||||
foreach ($mailsIds as $mailId) {
|
||||
$overview = $mailbox->get_overview($mailId);
|
||||
$var = $overview[0]->seen ? 'read' : 'unread';
|
||||
if ($var == 'unread') {
|
||||
$mail = $mailbox->getMail($mailId);
|
||||
if ($settings_email->first()->email_collaborator == 1) {
|
||||
$collaborator = $mail->cc;
|
||||
if ($e_mail->fetching_status == 1) {
|
||||
$priority = $e_mail->priority;
|
||||
$dept = $e_mail->department;
|
||||
$helptopic = $e_mail->help_topic;
|
||||
if ($priority == null) {
|
||||
$priority = $ticket->first()->priority;
|
||||
}
|
||||
if ($dept == null) {
|
||||
$dept = $system->first()->department;
|
||||
}
|
||||
if ($helptopic == null) {
|
||||
$helptopic = $ticket->first()->help_topic;
|
||||
}
|
||||
$get_helptopic = Help_topic::where('id', '=', $helptopic)->first();
|
||||
$sla = $get_helptopic->sla_plan;
|
||||
$host = $e_mail->fetching_host;
|
||||
$port = $e_mail->fetching_port;
|
||||
if ($e_mail->mailbox_protocol) {
|
||||
$protocol_value = $e_mail->mailbox_protocol;
|
||||
$get_mailboxprotocol = MailboxProtocol::where('id', '=', $protocol_value)->first();
|
||||
$protocol = $get_mailboxprotocol->value;
|
||||
} else {
|
||||
if ($e_mail->fetching_protocol) {
|
||||
$fetching_protocol = '/'.$e_mail->fetching_protocol;
|
||||
} else {
|
||||
$collaborator = null;
|
||||
$fetching_protocol = '';
|
||||
}
|
||||
$body = $mail->textHtml;
|
||||
if ($body == null) {
|
||||
$body = $mailbox->backup_getmail($mailId);
|
||||
$body = str_replace('\r\n', '<br/>', $body);
|
||||
// var_dump($body);
|
||||
}
|
||||
$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('Y-m-d H:i:s', strtotime($date));
|
||||
// dd($date);
|
||||
|
||||
if (isset($mail->subject)) {
|
||||
$subject = $mail->subject;
|
||||
if ($e_mail->fetching_encryption) {
|
||||
$fetching_encryption = '/'.$e_mail->fetching_encryption;
|
||||
} else {
|
||||
$subject = 'No Subject';
|
||||
$fetching_encryption = '';
|
||||
}
|
||||
$protocol = $fetching_protocol.$fetching_encryption;
|
||||
}
|
||||
$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')));
|
||||
if (!$mailsIds) {
|
||||
die('Mailbox is empty');
|
||||
}
|
||||
foreach ($mailsIds as $mailId) {
|
||||
$overview = $mailbox->get_overview($mailId);
|
||||
$var = $overview[0]->seen ? 'read' : 'unread';
|
||||
if ($var == 'unread') {
|
||||
$mail = $mailbox->getMail($mailId);
|
||||
if ($settings_email->first()->email_collaborator == 1) {
|
||||
$collaborator = $mail->cc;
|
||||
} else {
|
||||
$collaborator = null;
|
||||
}
|
||||
$body = $mail->textHtml;
|
||||
if ($body == null) {
|
||||
$body = $mailbox->backup_getmail($mailId);
|
||||
$body = str_replace('\r\n', '<br/>', $body);
|
||||
}
|
||||
$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('Y-m-d H:i:s', strtotime($date));
|
||||
if (isset($mail->subject)) {
|
||||
$subject = $mail->subject;
|
||||
} else {
|
||||
$subject = 'No Subject';
|
||||
}
|
||||
$fromname = $mail->fromName;
|
||||
$fromaddress = $mail->fromAddress;
|
||||
$ticket_source = Ticket_source::where('name', '=', 'email')->first();
|
||||
$source = $ticket_source->id;
|
||||
$phone = '';
|
||||
|
||||
// dd($subject);
|
||||
$fromname = $mail->fromName;
|
||||
$fromaddress = $mail->fromAddress;
|
||||
$ticket_source = Ticket_source::where('name', '=', 'email')->first();
|
||||
$source = $ticket_source->id;
|
||||
$phone = '';
|
||||
$assign = $get_helptopic->auto_assign;
|
||||
$form_data = null;
|
||||
$result = $this->TicketController->create_user($fromaddress, $fromname, $subject, $body, $phone, $helptopic, $sla, $priority, $source, $collaborator, $dept, $assign, $form_data);
|
||||
// dd($result);
|
||||
if ($result[1] == true) {
|
||||
$ticket_table = Tickets::where('ticket_number', '=', $result[0])->first();
|
||||
$thread_id = Ticket_Thread::where('ticket_id', '=', $ticket_table->id)->max('id');
|
||||
// $thread_id = Ticket_Thread::whereRaw('id = (select max(`id`) from ticket_thread)')->first();
|
||||
$thread_id = $thread_id;
|
||||
|
||||
$assign = $get_helptopic->auto_assign;
|
||||
$form_data = null;
|
||||
$result = $this->TicketController->create_user($fromaddress, $fromname, $subject, $body, $phone, $helptopic, $sla, $priority, $source, $collaborator, $dept, $assign, $form_data);
|
||||
// dd($result);
|
||||
if ($result[1] == true) {
|
||||
$ticket_table = Tickets::where('ticket_number', '=', $result[0])->first();
|
||||
$thread_id = Ticket_Thread::where('ticket_id', '=', $ticket_table->id)->max('id');
|
||||
// $thread_id = Ticket_Thread::whereRaw('id = (select max(`id`) from ticket_thread)')->first();
|
||||
$thread_id = $thread_id;
|
||||
foreach ($mail->getAttachments() as $attachment) {
|
||||
$support = 'support';
|
||||
// echo $_SERVER['DOCUMENT_ROOT'];
|
||||
$dir_img_paths = __DIR__;
|
||||
$dir_img_path = explode('/code', $dir_img_paths);
|
||||
// dd($attachment->filePath);
|
||||
$filepath = explode('../../../../../public', $attachment->filePath);
|
||||
// var_dump($attachment->filePath);
|
||||
// dd($filepath);
|
||||
// $path = $dir_img_path[0]."/code/public/".$filepath[1];
|
||||
$path = public_path().$filepath[1];
|
||||
// dd($path);
|
||||
$filesize = filesize($path);
|
||||
$file_data = file_get_contents($path);
|
||||
$ext = pathinfo($attachment->filePath, PATHINFO_EXTENSION);
|
||||
$imageid = $attachment->id;
|
||||
$string = str_replace('-', '', $attachment->name);
|
||||
$filename = explode('src', $attachment->filePath);
|
||||
$filename = str_replace('\\', '', $filename);
|
||||
$body = str_replace('cid:'.$imageid, $filepath[1], $body);
|
||||
$pos = strpos($body, $filepath[1]);
|
||||
|
||||
foreach ($mail->getAttachments() as $attachment) {
|
||||
$support = 'support';
|
||||
// echo $_SERVER['DOCUMENT_ROOT'];
|
||||
$dir_img_paths = __DIR__;
|
||||
$dir_img_path = explode('/code', $dir_img_paths);
|
||||
// dd($attachment->filePath);
|
||||
$filepath = explode('../../../../../public', $attachment->filePath);
|
||||
// var_dump($attachment->filePath);
|
||||
// dd($filepath);
|
||||
// $path = $dir_img_path[0]."/code/public/".$filepath[1];
|
||||
$path = public_path().$filepath[1];
|
||||
// dd($path);
|
||||
$filesize = filesize($path);
|
||||
$file_data = file_get_contents($path);
|
||||
$ext = pathinfo($attachment->filePath, PATHINFO_EXTENSION);
|
||||
$imageid = $attachment->id;
|
||||
$string = str_replace('-', '', $attachment->name);
|
||||
$filename = explode('src', $attachment->filePath);
|
||||
$filename = str_replace('\\', '', $filename);
|
||||
$body = str_replace('cid:'.$imageid, $filepath[1], $body);
|
||||
$pos = strpos($body, $filepath[1]);
|
||||
|
||||
if ($pos == false) {
|
||||
if ($settings_email->first()->attachment == 1) {
|
||||
if ($pos == false) {
|
||||
if ($settings_email->first()->attachment == 1) {
|
||||
$upload = new Ticket_attachments();
|
||||
$upload->file = $file_data;
|
||||
$upload->thread_id = $thread_id;
|
||||
$upload->name = $filepath[1];
|
||||
$upload->type = $ext;
|
||||
$upload->size = $filesize;
|
||||
$upload->poster = 'ATTACHMENT';
|
||||
$upload->save();
|
||||
}
|
||||
} else {
|
||||
$upload = new Ticket_attachments();
|
||||
$upload->file = $file_data;
|
||||
$upload->thread_id = $thread_id;
|
||||
$upload->name = $filepath[1];
|
||||
$upload->type = $ext;
|
||||
$upload->size = $filesize;
|
||||
$upload->poster = 'ATTACHMENT';
|
||||
$upload->poster = 'INLINE';
|
||||
$upload->save();
|
||||
}
|
||||
} else {
|
||||
$upload = new Ticket_attachments();
|
||||
$upload->file = $file_data;
|
||||
$upload->thread_id = $thread_id;
|
||||
$upload->name = $filepath[1];
|
||||
$upload->type = $ext;
|
||||
$upload->size = $filesize;
|
||||
$upload->poster = 'INLINE';
|
||||
$upload->save();
|
||||
unlink($path);
|
||||
}
|
||||
unlink($path);
|
||||
$body = Encoding::fixUTF8($body);
|
||||
$thread = Ticket_Thread::where('id', '=', $thread_id)->first();
|
||||
$thread->body = $this->separate_reply($body);
|
||||
$thread->save();
|
||||
}
|
||||
$body = Encoding::fixUTF8($body);
|
||||
$thread = Ticket_Thread::where('id', '=', $thread_id)->first();
|
||||
$thread->body = $this->separate_reply($body);
|
||||
$thread->save();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -81,7 +81,7 @@ class TicketController extends Controller
|
||||
|
||||
return \Datatable::collection(new Collection($tickets))
|
||||
->addColumn('id', function ($ticket) {
|
||||
return "<input type='checkbox' name='select_all[]' id='".$ticket->id."' onclick='someFunction(this.id)' class='selectval icheckbox_flat-blue' value='".$ticket->id."'></input>";
|
||||
return "<input type='checkbox' name='select_all[]' id='".$ticket->id."' onclick='someFunction(this.id)' class='selectval icheckbox_flat-blue' value='".$ticket->id."'></input>";
|
||||
})
|
||||
->addColumn('subject', function ($ticket) {
|
||||
$subject = DB::table('ticket_thread')->select('title')->where('ticket_id', '=', $ticket->id)->first();
|
||||
@@ -102,11 +102,10 @@ class TicketController extends Controller
|
||||
} else {
|
||||
$collabString = null;
|
||||
}
|
||||
// dd($ticket->id);
|
||||
|
||||
$threads = Ticket_Thread::where('ticket_id', '=', $ticket->id)->first(); //
|
||||
$count = Ticket_Thread::where('ticket_id', '=', $ticket->id)->count(); //Ticket_Thread::where('ticket_id', '=', $ticket->id)->get();
|
||||
// $count = count($threads);
|
||||
// dd($threads);
|
||||
|
||||
$attachment = Ticket_attachments::where('thread_id', '=', $threads->id)->get();
|
||||
$attachCount = count($attachment);
|
||||
if ($attachCount > 0) {
|
||||
@@ -114,7 +113,6 @@ class TicketController extends Controller
|
||||
} else {
|
||||
$attachString = '';
|
||||
}
|
||||
//return $threads->id;
|
||||
|
||||
return "<a href='".route('ticket.thread', [$ticket->id])."' title='".$subject->title."'>".$string." <span style='color:green'>(".$count.")<i class='fa fa-comment'></i></span></a>".$collabString.$attachString;
|
||||
})
|
||||
@@ -125,7 +123,6 @@ class TicketController extends Controller
|
||||
$priority = DB::table('ticket_priority')->select('priority_desc', 'priority_color')->where('priority_id', '=', $ticket->priority_id)->first();
|
||||
|
||||
return '<span class="btn btn-'.$priority->priority_color.' btn-xs">'.$priority->priority_desc.'</span>';
|
||||
//return "loda";
|
||||
})
|
||||
->addColumn('from', function ($ticket) {
|
||||
$from = DB::table('users')->select('user_name')->where('id', '=', $ticket->user_id)->first();
|
||||
@@ -182,20 +179,15 @@ class TicketController extends Controller
|
||||
public function get_open()
|
||||
{
|
||||
if (Auth::user()->role == 'admin') {
|
||||
// $tickets = Tickets::where('status','=',1)->get();;
|
||||
|
||||
$tickets = Tickets::where('status', '=', 1)->where('isanswered', '=', 0)->where('assigned_to', '=', 0)->get();
|
||||
$tickets = Tickets::where('status', '=', 1)->where('isanswered', '=', 0)->get();
|
||||
} else {
|
||||
// $dept = DB::table('department')->where('name','=',Auth::user()->primary_dpt)->first();
|
||||
// $tickets = Tickets::where('status',1)->where('dept_id', '=', $dept->id)->get();
|
||||
|
||||
$dept = Department::where('id', '=', Auth::user()->primary_dpt)->first();
|
||||
$tickets = Tickets::where('status', '=', 1)->where('isanswered', '=', 0)->where('assigned_to', '=', 0)->where('dept_id', '=', $dept->id)->get();
|
||||
$tickets = Tickets::where('status', '=', 1)->where('isanswered', '=', 0)->where('dept_id', '=', $dept->id)->get();
|
||||
}
|
||||
|
||||
return \Datatable::collection(new Collection($tickets))
|
||||
->addColumn('id', function ($ticket) {
|
||||
return "<input type='checkbox' name='select_all[]' class='icheckbox_flat-blue' value='".$ticket->id."'></input>";
|
||||
return "<input type='checkbox' name='select_all[]' id='".$ticket->id."' onclick='someFunction(this.id)' class='selectval icheckbox_flat-blue' value='".$ticket->id."'></input>";
|
||||
})
|
||||
->addColumn('subject', function ($ticket) {
|
||||
$subject = DB::table('ticket_thread')->select('title')->where('ticket_id', '=', $ticket->id)->first();
|
||||
@@ -225,7 +217,6 @@ class TicketController extends Controller
|
||||
} else {
|
||||
$attachString = '';
|
||||
}
|
||||
//return $threads->id;
|
||||
|
||||
return "<a href='".route('ticket.thread', [$ticket->id])."' title='".$subject->title."'>".$string." <span style='color:green'>(".$count.")<i class='fa fa-comment'></i></span></a>".$collabString.$attachString;
|
||||
})
|
||||
@@ -236,7 +227,6 @@ class TicketController extends Controller
|
||||
$priority = DB::table('ticket_priority')->select('priority_desc', 'priority_color')->where('priority_id', '=', $ticket->priority_id)->first();
|
||||
|
||||
return '<span class="btn btn-'.$priority->priority_color.' btn-xs">'.$priority->priority_desc.'</span>';
|
||||
//return "loda";
|
||||
})
|
||||
->addColumn('from', function ($ticket) {
|
||||
$from = DB::table('users')->select('user_name')->where('id', '=', $ticket->user_id)->first();
|
||||
@@ -244,7 +234,7 @@ class TicketController extends Controller
|
||||
return "<span style='color:#508983'>".$from->user_name.'</span>';
|
||||
})
|
||||
->addColumn('Last Replier', function ($ticket) {
|
||||
$TicketData = Ticket_Thread::where('ticket_id', '=', $ticket->id)->max('id');
|
||||
$TicketData = Ticket_Thread::where('ticket_id', '=', $ticket->id)->where('is_internal', '=', 0)->max('id');
|
||||
$TicketDatarow = Ticket_Thread::where('id', '=', $TicketData)->first();
|
||||
$LastResponse = User::where('id', '=', $TicketDatarow->user_id)->first();
|
||||
if ($LastResponse->role == 'user') {
|
||||
@@ -273,7 +263,6 @@ class TicketController extends Controller
|
||||
$TicketData = Ticket_Thread::where('ticket_id', '=', $ticket->id)->max('id');
|
||||
$TicketDatarow = Ticket_Thread::select('updated_at')->where('id', '=', $TicketData)->first();
|
||||
|
||||
// return date('d F Y, H:i:s', strtotime($TicketDatarow->updated_at));
|
||||
return UTC::usertimezone($TicketDatarow->updated_at);
|
||||
})
|
||||
->searchColumns('subject', 'from', 'assigned_to', 'ticket_number', 'priority')
|
||||
@@ -294,20 +283,15 @@ class TicketController extends Controller
|
||||
public function get_answered()
|
||||
{
|
||||
if (Auth::user()->role == 'admin') {
|
||||
// $tickets = Tickets::where('status', '=', 1)->where('assigned_to', '=', Auth::user()->id)->get();
|
||||
|
||||
$tickets = Tickets::where('status', '=', 1)->where('isanswered', '=', 1)->get();
|
||||
} else {
|
||||
// $dept = Department::where('name','=',Auth::user()->primary_dpt)->first();
|
||||
// $tickets = Tickets::where('status', '=', 1)->where('assigned_to', '=', Auth::user()->id)->get();
|
||||
|
||||
$dept = Department::where('id', '=', Auth::user()->primary_dpt)->first();
|
||||
$tickets = Tickets::where('status', '=', 1)->where('isanswered', '=', 1)->where('dept_id', '=', $dept->id)->get();
|
||||
}
|
||||
|
||||
return \Datatable::collection(new Collection($tickets))
|
||||
->addColumn('id', function ($ticket) {
|
||||
return "<input type='checkbox' name='select_all[]' class='icheckbox_flat-blue' value='".$ticket->id."'></input>";
|
||||
return "<input type='checkbox' name='select_all[]' id='".$ticket->id."' onclick='someFunction(this.id)' class='selectval icheckbox_flat-blue' value='".$ticket->id."'></input>";
|
||||
})
|
||||
->addColumn('subject', function ($ticket) {
|
||||
$subject = DB::table('ticket_thread')->select('title')->where('ticket_id', '=', $ticket->id)->first();
|
||||
@@ -337,7 +321,6 @@ class TicketController extends Controller
|
||||
} else {
|
||||
$attachString = '';
|
||||
}
|
||||
//return $threads->id;
|
||||
|
||||
return "<a href='".route('ticket.thread', [$ticket->id])."' title='".$subject->title."'>".$string." <span style='color:green'>(".$count.")<i class='fa fa-comment'></i></span></a>".$collabString.$attachString;
|
||||
})
|
||||
@@ -348,7 +331,6 @@ class TicketController extends Controller
|
||||
$priority = DB::table('ticket_priority')->select('priority_desc', 'priority_color')->where('priority_id', '=', $ticket->priority_id)->first();
|
||||
|
||||
return '<span class="btn btn-'.$priority->priority_color.' btn-xs">'.$priority->priority_desc.'</span>';
|
||||
//return "loda";
|
||||
})
|
||||
->addColumn('from', function ($ticket) {
|
||||
$from = DB::table('users')->select('user_name')->where('id', '=', $ticket->user_id)->first();
|
||||
@@ -385,7 +367,6 @@ class TicketController extends Controller
|
||||
$TicketData = Ticket_Thread::where('ticket_id', '=', $ticket->id)->max('id');
|
||||
$TicketDatarow = Ticket_Thread::select('updated_at')->where('id', '=', $TicketData)->first();
|
||||
|
||||
// return date('d F Y, H:i:s', strtotime($TicketDatarow->updated_at));
|
||||
return UTC::usertimezone($TicketDatarow->updated_at);
|
||||
})
|
||||
->searchColumns('subject', 'from', 'assigned_to', 'ticket_number', 'priority')
|
||||
@@ -414,7 +395,7 @@ class TicketController extends Controller
|
||||
|
||||
return \Datatable::collection(new Collection($tickets))
|
||||
->addColumn('id', function ($ticket) {
|
||||
return "<input type='checkbox' name='select_all[]' class='icheckbox_flat-blue' value='".$ticket->id."'></input>";
|
||||
return "<input type='checkbox' name='select_all[]' id='".$ticket->id."' onclick='someFunction(this.id)' class='selectval icheckbox_flat-blue' value='".$ticket->id."'></input>";
|
||||
})
|
||||
->addColumn('subject', function ($ticket) {
|
||||
$subject = DB::table('ticket_thread')->select('title')->where('ticket_id', '=', $ticket->id)->first();
|
||||
@@ -444,7 +425,6 @@ class TicketController extends Controller
|
||||
} else {
|
||||
$attachString = '';
|
||||
}
|
||||
//return $threads->id;
|
||||
|
||||
return "<a href='".route('ticket.thread', [$ticket->id])."' title='".$subject->title."'>".$string." <span style='color:green'>(".$count.")<i class='fa fa-comment'></i></span></a>".$collabString.$attachString;
|
||||
})
|
||||
@@ -455,7 +435,6 @@ class TicketController extends Controller
|
||||
$priority = DB::table('ticket_priority')->select('priority_desc', 'priority_color')->where('priority_id', '=', $ticket->priority_id)->first();
|
||||
|
||||
return '<span class="btn btn-'.$priority->priority_color.' btn-xs">'.$priority->priority_desc.'</span>';
|
||||
//return "loda";
|
||||
})
|
||||
->addColumn('from', function ($ticket) {
|
||||
$from = DB::table('users')->select('user_name')->where('id', '=', $ticket->user_id)->first();
|
||||
@@ -492,7 +471,6 @@ class TicketController extends Controller
|
||||
$TicketData = Ticket_Thread::where('ticket_id', '=', $ticket->id)->max('id');
|
||||
$TicketDatarow = Ticket_Thread::select('updated_at')->where('id', '=', $TicketData)->first();
|
||||
|
||||
// return date('d F Y, H:i:s', strtotime($TicketDatarow->updated_at));
|
||||
return UTC::usertimezone($TicketDatarow->updated_at);
|
||||
})
|
||||
->searchColumns('subject', 'from', 'assigned_to', 'ticket_number', 'priority')
|
||||
@@ -531,7 +509,7 @@ class TicketController extends Controller
|
||||
|
||||
return \Datatable::collection(new Collection($tickets))
|
||||
->addColumn('id', function ($ticket) {
|
||||
return "<input type='checkbox' name='select_all[]' class='icheckbox_flat-blue' value='".$ticket->id."'></input>";
|
||||
return "<input type='checkbox' name='select_all[]' id='".$ticket->id."' onclick='someFunction(this.id)' class='selectval icheckbox_flat-blue' value='".$ticket->id."'></input>";
|
||||
})
|
||||
->addColumn('subject', function ($ticket) {
|
||||
$subject = DB::table('ticket_thread')->select('title')->where('ticket_id', '=', $ticket->id)->first();
|
||||
@@ -561,7 +539,7 @@ class TicketController extends Controller
|
||||
} else {
|
||||
$attachString = '';
|
||||
}
|
||||
//return $threads->id;
|
||||
|
||||
return "<a href='".route('ticket.thread', [$ticket->id])."' title='".$subject->title."'>".$string." <span style='color:green'>(".$count.")<i class='fa fa-comment'></i></span></a>".$collabString.$attachString;
|
||||
})
|
||||
->addColumn('ticket_number', function ($ticket) {
|
||||
@@ -571,7 +549,6 @@ class TicketController extends Controller
|
||||
$priority = DB::table('ticket_priority')->select('priority_desc', 'priority_color')->where('priority_id', '=', $ticket->priority_id)->first();
|
||||
|
||||
return '<span class="btn btn-'.$priority->priority_color.' btn-xs">'.$priority->priority_desc.'</span>';
|
||||
//return "loda";
|
||||
})
|
||||
->addColumn('from', function ($ticket) {
|
||||
$from = DB::table('users')->select('user_name')->where('id', '=', $ticket->user_id)->first();
|
||||
@@ -608,7 +585,6 @@ class TicketController extends Controller
|
||||
$TicketData = Ticket_Thread::where('ticket_id', '=', $ticket->id)->max('id');
|
||||
$TicketDatarow = Ticket_Thread::select('updated_at')->where('id', '=', $TicketData)->first();
|
||||
|
||||
// return date('d F Y, H:i:s', strtotime($TicketDatarow->updated_at));
|
||||
return UTC::usertimezone($TicketDatarow->updated_at);
|
||||
})
|
||||
->searchColumns('subject', 'from', 'assigned_to', 'ticket_number', 'priority')
|
||||
@@ -637,7 +613,7 @@ class TicketController extends Controller
|
||||
|
||||
return \Datatable::collection(new Collection($tickets))
|
||||
->addColumn('id', function ($ticket) {
|
||||
return "<input type='checkbox' name='select_all[]' class='icheckbox_flat-blue' value='".$ticket->id."'></input>";
|
||||
return "<input type='checkbox' name='select_all[]' id='".$ticket->id."' onclick='someFunction(this.id)' class='selectval icheckbox_flat-blue' value='".$ticket->id."'></input>";
|
||||
})
|
||||
->addColumn('subject', function ($ticket) {
|
||||
$subject = DB::table('ticket_thread')->select('title')->where('ticket_id', '=', $ticket->id)->first();
|
||||
@@ -667,7 +643,6 @@ class TicketController extends Controller
|
||||
} else {
|
||||
$attachString = '';
|
||||
}
|
||||
//return $threads->id;
|
||||
|
||||
return "<a href='".route('ticket.thread', [$ticket->id])."' title='".$subject->title."'>".$string." <span style='color:green'>(".$count.")<i class='fa fa-comment'></i></span></a>".$collabString.$attachString;
|
||||
})
|
||||
@@ -678,7 +653,6 @@ class TicketController extends Controller
|
||||
$priority = DB::table('ticket_priority')->select('priority_desc', 'priority_color')->where('priority_id', '=', $ticket->priority_id)->first();
|
||||
|
||||
return '<span class="btn btn-'.$priority->priority_color.' btn-xs">'.$priority->priority_desc.'</span>';
|
||||
//return "loda";
|
||||
})
|
||||
->addColumn('from', function ($ticket) {
|
||||
$from = DB::table('users')->select('user_name')->where('id', '=', $ticket->user_id)->first();
|
||||
@@ -715,7 +689,6 @@ class TicketController extends Controller
|
||||
$TicketData = Ticket_Thread::where('ticket_id', '=', $ticket->id)->max('id');
|
||||
$TicketDatarow = Ticket_Thread::select('updated_at')->where('id', '=', $TicketData)->first();
|
||||
|
||||
// return date('d F Y, H:i:s', strtotime($TicketDatarow->updated_at));
|
||||
return UTC::usertimezone($TicketDatarow->updated_at);
|
||||
})
|
||||
->searchColumns('subject', 'from', 'assigned_to', 'ticket_number', 'priority')
|
||||
@@ -768,8 +741,6 @@ class TicketController extends Controller
|
||||
return Redirect('newticket')->with('fails', 'fails');
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
// dd($e);
|
||||
|
||||
return Redirect()->back()->with('fails', '<li>'.$e->errorInfo.'</li>');
|
||||
}
|
||||
}
|
||||
@@ -783,21 +754,6 @@ class TicketController extends Controller
|
||||
*/
|
||||
public function thread($id)
|
||||
{
|
||||
/* $lock = Tickets::where('id','=',$id)->first();
|
||||
if($lock->lock_by == Auth::user()->id || $lock->lock_at < date('Y-m-d H:i:s', strtotime('-3 minutes', strtotime($lock->lock_at)))) {
|
||||
if(Auth::user()->role == 'agent'){
|
||||
|
||||
$dept = Department::where('id','=',Auth::user()->primary_dpt)->first();
|
||||
|
||||
$tickets = Tickets::where('id', '=', $id)->where('dept_id','=', $dept->id)->first();
|
||||
} else {
|
||||
$tickets = Tickets::where('id', '=', $id)->first();
|
||||
}
|
||||
$thread = Ticket_Thread::where('ticket_id', '=', $id)->first();
|
||||
return view('themes.default1.agent.helpdesk.ticket.timeline', compact('tickets'), compact('thread'));
|
||||
} else {
|
||||
return Redirect()->back()->with('fails', 'This ticket has been locked by other agent');
|
||||
} */
|
||||
if (Auth::user()->role == 'agent') {
|
||||
$dept = Department::where('id', '=', Auth::user()->primary_dpt)->first();
|
||||
|
||||
@@ -807,11 +763,11 @@ class TicketController extends Controller
|
||||
} elseif (Auth::user()->role == 'user') {
|
||||
$thread = Ticket_Thread::where('ticket_id', '=', $id)->first();
|
||||
$ticket_id = \Crypt::encrypt($id);
|
||||
// dd($ticket_id);
|
||||
|
||||
return redirect()->route('check_ticket', compact('ticket_id'));
|
||||
}
|
||||
$thread = Ticket_Thread::where('ticket_id', '=', $id)->first();
|
||||
//$tickets = Tickets::where('id', '=', $id)->first();
|
||||
|
||||
return view('themes.default1.agent.helpdesk.ticket.timeline', compact('tickets'), compact('thread'));
|
||||
}
|
||||
|
||||
@@ -834,16 +790,14 @@ class TicketController extends Controller
|
||||
$source = $eventthread->source;
|
||||
$form_data = $request->except('reply_content', 'ticket_ID', 'attachment');
|
||||
\Event::fire(new \App\Events\ClientTicketFormPost($form_data, $emailadd, $source));
|
||||
// dd($attachments);
|
||||
// }
|
||||
//return $attachments;
|
||||
$reply_content = $request->input('reply_content');
|
||||
|
||||
$thread->ticket_id = $request->input('ticket_ID');
|
||||
$thread->poster = 'support';
|
||||
$thread->body = $request->input('reply_content');
|
||||
$thread->user_id = Auth::user()->id;
|
||||
$ticket_id = $request->input('ticket_ID');
|
||||
//dd($ticket_id);
|
||||
|
||||
$tickets = Tickets::where('id', '=', $ticket_id)->first();
|
||||
$tickets->isanswered = '1';
|
||||
$tickets->save();
|
||||
@@ -871,19 +825,13 @@ class TicketController extends Controller
|
||||
}
|
||||
$thread->save();
|
||||
|
||||
//$atachPath = '';
|
||||
foreach ($attachments as $attachment) {
|
||||
if ($attachment != null) {
|
||||
$name = $attachment->getClientOriginalName();
|
||||
//dd(dirname($attachment));
|
||||
$type = $attachment->getClientOriginalExtension();
|
||||
$size = $attachment->getSize();
|
||||
$data = file_get_contents($attachment->getRealPath());
|
||||
// $tem_path = $attachment->getRealPath();
|
||||
// $tem = basename($tem_path).PHP_EOL;
|
||||
// //dd($tem);
|
||||
$attachPath = $attachment->getRealPath();
|
||||
//dd($attachPath);
|
||||
$ta->create(['thread_id' => $thread->id, 'name' => $name, 'size' => $size, 'type' => $type, 'file' => $data, 'poster' => 'ATTACHMENT']);
|
||||
|
||||
$check_attachment = 1;
|
||||
@@ -914,7 +862,6 @@ class TicketController extends Controller
|
||||
$message = '';
|
||||
if ($check_attachment == 1) {
|
||||
$attachment_files = $attachments;
|
||||
// dd($attachment_files);
|
||||
} else {
|
||||
$attachment_files = null;
|
||||
}
|
||||
@@ -1054,8 +1001,6 @@ class TicketController extends Controller
|
||||
public function create_user($emailadd, $username, $subject, $body, $phone, $helptopic, $sla, $priority, $source, $headers, $dept, $assignto, $from_data)
|
||||
{
|
||||
// define global variables
|
||||
// dd($source);
|
||||
// dd($emailadd);
|
||||
$email;
|
||||
$username;
|
||||
|
||||
@@ -1083,17 +1028,10 @@ class TicketController extends Controller
|
||||
$user_id = $user->id;
|
||||
// Event fire
|
||||
\Event::fire(new \App\Events\ReadMailEvent($user_id, $password));
|
||||
// if (Mail::send('emails.pass', ['password' => $password, 'name' => $username, 'from'=>$company,'emailadd' => $emailadd], function ($message) use ($emailadd, $username,$company) {
|
||||
// $message->to($emailadd, $username)->subject('Welcome to '.$company.' helpdesk');
|
||||
// })) {
|
||||
try {
|
||||
$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]);
|
||||
} catch (\Exception $e) {
|
||||
// return 0;
|
||||
}
|
||||
// $message->to($emailadd, $username)->subject('Welcome to '.$company.' helpdesk');
|
||||
// })) {
|
||||
// need to do something here....
|
||||
}
|
||||
} else {
|
||||
$username = $checkemail->username;
|
||||
@@ -1103,14 +1041,6 @@ class TicketController extends Controller
|
||||
$ticket_number2 = $ticket_number[0];
|
||||
$ticketdata = Tickets::where('ticket_number', '=', $ticket_number2)->first();
|
||||
$threaddata = Ticket_Thread::where('ticket_id', '=', $ticketdata->id)->first();
|
||||
|
||||
// $sending_emails = Emails::where('department', '=', $ticketdata->dept_id)->first();
|
||||
// if($sending_emails == null) {
|
||||
// $from_email = $this->system_mail();
|
||||
// } else {
|
||||
// $from_email = $sending_emails->id;
|
||||
// }
|
||||
// dd($threaddata);
|
||||
$is_reply = $ticket_number[1];
|
||||
$system = $this->system();
|
||||
$updated_subject = $threaddata->title.'[#'.$ticket_number2.']';
|
||||
@@ -1125,19 +1055,12 @@ class TicketController extends Controller
|
||||
}
|
||||
|
||||
if ($source == 3) {
|
||||
// Mail::send('emails.Ticket_Create', ['sign'=>$sign, 'content' => $body, 'name' => $username, 'ticket_number' => $ticket_number2, 'system' => $system], function ($message) use ($emailadd, $username, $ticket_number2, $updated_subject) {
|
||||
// $message->to($emailadd, $username)->subject($updated_subject);
|
||||
// });
|
||||
// dd($body);
|
||||
try {
|
||||
$this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('0', $ticketdata->dept_id), $to = ['name' => $username, 'email' => $emailadd], $message = ['subject' => $updated_subject, 'scenario' => 'create-ticket-by-agent', 'body' => $body], $template_variables = ['agent_sign' => Auth::user()->agent_sign, 'ticket_number' => $ticket_number2]);
|
||||
} catch (\Exception $e) {
|
||||
}
|
||||
} else {
|
||||
$body2 = null;
|
||||
// Mail::send('emails.Ticket_Create', ['sign'=>$sign, 'content' => $body2, 'name' => $username, 'ticket_number' => $ticket_number2, 'system' => $system], function ($message) use ($emailadd, $username, $ticket_number2, $updated_subject) {
|
||||
// $message->to($emailadd, $username)->subject($updated_subject);
|
||||
// });
|
||||
try {
|
||||
$this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('0', $ticketdata->dept_id), $to = ['name' => $username, 'email' => $emailadd], $message = ['subject' => $updated_subject, 'scenario' => 'create-ticket'], $template_variables = ['user' => $username, 'ticket_number' => $ticket_number2, 'department_sign' => '']);
|
||||
} catch (\Exception $e) {
|
||||
@@ -1149,13 +1072,9 @@ class TicketController extends Controller
|
||||
if (Alert::first()->ticket_status == 1 || Alert::first()->ticket_admin_email == 1) {
|
||||
// send email to admin
|
||||
$admins = User::where('role', '=', 'admin')->get();
|
||||
// $ticket_creator = $user->user_name;
|
||||
foreach ($admins as $admin) {
|
||||
$admin_email = $admin->email;
|
||||
$admin_user = $admin->first_name;
|
||||
// Mail::send('emails.'.$mail, ['agent' => $admin_user,'content'=>$body, 'ticket_number' => $ticket_number2, 'from'=>$company, 'email' => $emailadd, 'name' => $ticket_creator, 'system' => $system], function ($message) use ($admin_email, $admin_user, $ticket_number2, $updated_subject) {
|
||||
// $message->to($admin_email, $admin_user)->subject($updated_subject);
|
||||
// });
|
||||
try {
|
||||
$this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('0', $ticketdata->dept_id), $to = ['user' => $admin_user, 'email' => $admin_email], $message = ['subject' => $updated_subject, 'body' => $body, 'scenario' => $mail], $template_variables = ['ticket_agent_name' => $admin_user, 'ticket_client_name' => $username, 'ticket_client_email' => $emailadd, 'user' => $admin_user, 'ticket_number' => $ticket_number2, 'email_address' => $emailadd, 'name' => $ticket_creator]);
|
||||
} catch (\Exception $e) {
|
||||
@@ -1167,16 +1086,12 @@ class TicketController extends Controller
|
||||
if (Alert::first()->ticket_status == 1 || Alert::first()->ticket_department_member == 1) {
|
||||
// send email to agents
|
||||
$agents = User::where('role', '=', 'agent')->get();
|
||||
// dd($agents);
|
||||
foreach ($agents as $agent) {
|
||||
$department_data = Department::where('id', '=', $ticketdata->dept_id)->first();
|
||||
|
||||
if ($department_data->name == $agent->primary_dpt) {
|
||||
$agent_email = $agent->email;
|
||||
$agent_user = $agent->first_name;
|
||||
// Mail::send('emails.'.$mail, ['agent' => $agent_user ,'content'=>$body , 'ticket_number' => $ticket_number2, 'from'=>$company, 'email' => $emailadd, 'name' => $ticket_creator, 'system' => $system], function ($message) use ($agent_email, $agent_user, $ticket_number2, $updated_subject) {
|
||||
// $message->to($agent_email, $agent_user)->subject($updated_subject);
|
||||
// });
|
||||
try {
|
||||
$this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('0', $ticketdata->dept_id), $to = ['user' => $agent_user, 'email' => $agent_email], $message = ['subject' => $updated_subject, 'body' => $body, 'scenario' => $mail], $template_variables = ['ticket_agent_name' => $admin_user, 'ticket_client_name' => $username, 'ticket_client_email' => $emailadd, 'user' => $agent_user, 'ticket_number' => $ticket_number2, 'email_address' => $emailadd, 'name' => $ticket_creator]);
|
||||
} catch (\Exception $e) {
|
||||
@@ -1190,9 +1105,6 @@ class TicketController extends Controller
|
||||
$assigned_to = User::where('id', '=', $ticketdata->assigned_to)->first();
|
||||
$agent_email = $assigned_to->email;
|
||||
$agent_user = $assigned_to->first_name;
|
||||
// Mail::send('emails.'.$mail, ['agent' => $assigned_to->user_name ,'content'=>$body , 'ticket_number' => $ticket_number2, 'from'=>$company, 'email' => $assigned_to->email, 'name' => $ticket_creator, 'system' => $system], function ($message) use ($agent_email, $agent_user, $ticket_number2, $updated_subject) {
|
||||
// $message->to($agent_email, $agent_user)->subject($updated_subject);
|
||||
// });
|
||||
try {
|
||||
$this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('0', $ticketdata->dept_id), $to = ['user' => $agent_user, 'email' => $agent_email], $message = ['subject' => $updated_subject, 'body' => $body, 'scenario' => $mail], $template_variables = ['ticket_agent_name' => $admin_user, 'ticket_client_name' => $username, 'ticket_client_email' => $emailadd, 'user' => $assigned_to->user_name, 'ticket_number' => $ticket_number2, 'email_address' => $assigned_to->email, 'name' => $ticket_creator]);
|
||||
} catch (\Exception $e) {
|
||||
@@ -1253,12 +1165,8 @@ class TicketController extends Controller
|
||||
*/
|
||||
public function check_ticket($user_id, $subject, $body, $helptopic, $sla, $priority, $source, $headers, $dept, $assignto, $form_data)
|
||||
{
|
||||
// $read_ticket_number = substr($subject, 0, 6);
|
||||
$read_ticket_number = explode('[#', $subject);
|
||||
if (isset($read_ticket_number[1])) {
|
||||
// dd($read_ticket_number);
|
||||
// if ($read_ticket_number == 'Re: [#' or $read_ticket_number == 'RE: [#') {
|
||||
// dd($read_ticket_number);
|
||||
$separate = explode(']', $read_ticket_number[1]);
|
||||
$new_subject = substr($separate[0], 0, 20);
|
||||
$find_number = Tickets::where('ticket_number', '=', $new_subject)->first();
|
||||
@@ -1346,18 +1254,15 @@ class TicketController extends Controller
|
||||
|
||||
$sla_plan = Sla_plan::where('id', '=', $sla)->first();
|
||||
$ovdate = $ticket->created_at;
|
||||
// dd($sla_plan->grace_period);
|
||||
$new_date = date_add($ovdate, date_interval_create_from_date_string($sla_plan->grace_period));
|
||||
$ticket->duedate = $new_date;
|
||||
$ticket->save();
|
||||
// dd($ticket->duedate);
|
||||
|
||||
$ticket_number = $ticket->ticket_number;
|
||||
$id = $ticket->id;
|
||||
|
||||
// store Form Data
|
||||
// Form Data comes from raising a ticket from client panel
|
||||
// dd($helptopic);
|
||||
if ($form_data != null) {
|
||||
$help_topic = Help_topic::where('id', '=', $helptopic)->first();
|
||||
$forms = Fields::where('forms_id', '=', $help_topic->custom_form)->get();
|
||||
@@ -1374,7 +1279,6 @@ class TicketController extends Controller
|
||||
}
|
||||
}
|
||||
// store collaborators
|
||||
// dd($headers);
|
||||
$this->storeCollaborators($headers, $id);
|
||||
if ($this->ticketThread($subject, $body, $id, $user_id) == true) {
|
||||
return $ticket_number;
|
||||
@@ -1456,10 +1360,6 @@ class TicketController extends Controller
|
||||
|
||||
$system_from = $this->company();
|
||||
|
||||
// Mail::send('emails.close_ticket', ['ticket_number' => $ticket_number, 'from'=>$company], function ($message) use ($email, $user_name, $ticket_number, $ticket_subject) {
|
||||
// $message->to($email, $user_name)->subject($ticket_subject.'[#' . $ticket_number . ']');
|
||||
// });
|
||||
|
||||
$sending_emails = Emails::where('department', '=', $ticket_status->dept_id)->first();
|
||||
if ($sending_emails == null) {
|
||||
$from_email = $this->system_mail();
|
||||
@@ -1538,15 +1438,15 @@ class TicketController extends Controller
|
||||
{
|
||||
$ticket_delete = $ticket->where('id', '=', $id)->first();
|
||||
if ($ticket_delete->status == 5) {
|
||||
$ticket_delete->delete();
|
||||
$ticket_threads = Ticket_Thread::where('ticket_id', '=', $id)->get();
|
||||
foreach ($ticket_threads as $ticket_thread) {
|
||||
$ticket_attachments = Ticket_attachments::where('thread_id', '=', $ticket_thread->id)->get();
|
||||
foreach ($ticket_attachments as $ticket_attachment) {
|
||||
$ticket_attachment->delete();
|
||||
}
|
||||
$ticket_thread->delete();
|
||||
}
|
||||
$ticket_attachments = Ticket_attachments::where('ticket_id', '=', $id)->get();
|
||||
foreach ($ticket_attachments as $ticket_attachment) {
|
||||
$ticket_attachment->delete();
|
||||
}
|
||||
$ticket_delete->delete();
|
||||
|
||||
return 'your ticket has been delete';
|
||||
} else {
|
||||
@@ -1615,14 +1515,6 @@ class TicketController extends Controller
|
||||
$thread->is_internal = 1;
|
||||
$thread->body = 'This Ticket has been assigned to '.$assignee;
|
||||
$thread->save();
|
||||
|
||||
// $master = Auth::user()->first_name . " " . Auth::user()->last_name;
|
||||
// if(Alert::first()->internal_status == 1 || Alert::first()->internal_assigned_agent == 1) {
|
||||
// // ticket assigned send mail
|
||||
// Mail::send('emails.Ticket_assign', ['agent' => $agent, 'ticket_number' => $ticket_number, 'from'=>$company, 'master' => $master, 'system' => $system], function ($message) use ($agent_email, $agent, $ticket_number, $ticket_subject) {
|
||||
// $message->to($agent_email, $agent)->subject($ticket_subject.'[#' . $ticket_number . ']');
|
||||
// });
|
||||
// }
|
||||
} elseif ($assign_to[0] == 'user') {
|
||||
$ticket->assigned_to = $assign_to[1];
|
||||
$user_detail = User::where('id', '=', $assign_to[1])->first();
|
||||
@@ -1648,24 +1540,11 @@ class TicketController extends Controller
|
||||
$agent_email = $user_detail->email;
|
||||
|
||||
$master = Auth::user()->first_name.' '.Auth::user()->last_name;
|
||||
// if(Alert::first()->internal_status == 1 || Alert::first()->internal_assigned_agent == 1) {
|
||||
// ticket assigned send mail
|
||||
// Mail::send('emails.Ticket_assign', ['agent' => $agent, 'ticket_number' => $ticket_number, 'from'=>$company, 'master' => $master, 'system' => $system], function ($message) use ($agent_email, $agent, $ticket_number, $ticket_subject) {
|
||||
// $message->to($agent_email, $agent)->subject($ticket_subject.'[#' . $ticket_number . ']');
|
||||
// });
|
||||
// $sending_emails = Emails::where('department', '=', $ticket->dept_id)->first();
|
||||
// if($sending_emails == null) {
|
||||
// $from_email = $this->system_mail();
|
||||
// } else {
|
||||
// $from_email = $sending_emails->id;
|
||||
// }
|
||||
try {
|
||||
$this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('0', $ticket->dept_id), $to = ['name' => $agent, 'email' => $agent_email], $message = ['subject' => $ticket_subject.'[#'.$ticket_number.']', 'scenario' => 'assign-ticket'], $template_variables = ['ticket_agent_name' => $agent, 'ticket_number' => $ticket_number, 'ticket_assigner' => $master]);
|
||||
} catch (\Exception $e) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// }
|
||||
}
|
||||
|
||||
return 1;
|
||||
@@ -1685,7 +1564,6 @@ class TicketController extends Controller
|
||||
$NewThread = new Ticket_Thread();
|
||||
$NewThread->ticket_id = $thread->ticket_id;
|
||||
$NewThread->user_id = Auth::user()->id;
|
||||
// $NewThread->thread_type = 'M';
|
||||
$NewThread->is_internal = 1;
|
||||
$NewThread->poster = Auth::user()->role;
|
||||
$NewThread->title = $thread->title;
|
||||
@@ -1705,9 +1583,6 @@ class TicketController extends Controller
|
||||
public function surrender($id)
|
||||
{
|
||||
$ticket = Tickets::where('id', '=', $id)->first();
|
||||
|
||||
// if($ticket->assigned_to == Auth::user()->id)
|
||||
// {
|
||||
$InternalContent = Auth::user()->first_name.' '.Auth::user()->last_name.' has Surrendered the assigned Ticket';
|
||||
$thread = Ticket_Thread::where('ticket_id', '=', $id)->first();
|
||||
$NewThread = new Ticket_Thread();
|
||||
@@ -1718,7 +1593,6 @@ class TicketController extends Controller
|
||||
$NewThread->title = $thread->title;
|
||||
$NewThread->body = $InternalContent;
|
||||
$NewThread->save();
|
||||
// }
|
||||
|
||||
$ticket->assigned_to = null;
|
||||
$ticket->save();
|
||||
@@ -1791,16 +1665,6 @@ class TicketController extends Controller
|
||||
$create_user->password = Hash::make($password);
|
||||
$create_user->save();
|
||||
$user_id = $create_user->id;
|
||||
|
||||
// Mail::send('emails.pass', ['password' => $password, 'name' => $name, 'from'=>$company,'emailadd' => $email], function ($message) use ($email, $name) {
|
||||
// $message->to($email, $name)->subject('password');
|
||||
// });
|
||||
// $sending_emails = Emails::where('department', '=', $ticket_status->dept_id)->first();
|
||||
// if($sending_emails == null) {
|
||||
// $from_email = $this->system_mail();
|
||||
// } else {
|
||||
// $from_email = $sending_emails->id;
|
||||
// }
|
||||
try {
|
||||
$this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('1', '0'), $to = ['name' => $name, 'email' => $email], $message = ['subject' => 'password', 'scenario' => 'registration-notification'], $template_variables = ['user' => $name, 'email_address' => $email, 'user_password' => $password]);
|
||||
} catch (\Exception $e) {
|
||||
@@ -1855,36 +1719,6 @@ class TicketController extends Controller
|
||||
return $system;
|
||||
}
|
||||
|
||||
/**
|
||||
* function to search.
|
||||
*
|
||||
* @return type
|
||||
*/
|
||||
// public function search() {
|
||||
// $product = Input::get('type');
|
||||
// $word = Input::get('name_startsWith');
|
||||
// if ($product == 'product') {
|
||||
// $starts_with = strtoupper($word);
|
||||
// $rows = DB::table('users')->select('user_name')->where('name', 'LIKE', $starts_with . '%')->get();
|
||||
// $data = array();
|
||||
// foreach ($rows as $row) {
|
||||
// array_push($data, $row->name);
|
||||
// }
|
||||
// print_r(json_encode($data));
|
||||
// }
|
||||
// if ($product == 'product_table') {
|
||||
// $row_num = Input::get('row_num');
|
||||
// $starts_with = strtoupper($word);
|
||||
// $rows = DB::table('product')->select('name', 'description', 'cost_price')->where('name', 'LIKE', $starts_with . '%')->get();
|
||||
// $data = array();
|
||||
// foreach ($rows as $row) {
|
||||
// $name = $row->name . '|' . $row->description . '|' . $row->cost_price . '|' . $row_num;
|
||||
// array_push($data, $name);
|
||||
// }
|
||||
// print_r(json_encode($data));
|
||||
// }
|
||||
// }
|
||||
|
||||
/**
|
||||
* shows trashed tickets.
|
||||
*
|
||||
@@ -1898,24 +1732,15 @@ class TicketController extends Controller
|
||||
public function get_trash()
|
||||
{
|
||||
if (Auth::user()->role == 'admin') {
|
||||
// $tickets = Tickets::where('status', '=', 1)->where('assigned_to', '=', Auth::user()->id)->get();
|
||||
|
||||
$tickets = Tickets::where('status', '=', 5)->get();
|
||||
|
||||
// $tickets = Tickets::where('assigned_to', '=', null)->where('status','1')->get();
|
||||
} else {
|
||||
$dept = Department::where('id', '=', Auth::user()->primary_dpt)->first();
|
||||
$tickets = Tickets::where('status', '=', 5)->where('dept_id', '=', $dept->id)->get();
|
||||
|
||||
// $dept = Department::where('name','=',Auth::user()->primary_dpt)->first();
|
||||
// $tickets = Tickets::where('assigned_to', '=', null)->where('dept_id','=',$dept->id)->get();
|
||||
// $dept = Department::where('name','=',Auth::user()->primary_dpt)->first();
|
||||
// $tickets = Tickets::where('status', '=', 1)->where('assigned_to', '=', Auth::user()->id)->get();
|
||||
}
|
||||
|
||||
return \Datatable::collection(new Collection($tickets))
|
||||
->addColumn('id', function ($ticket) {
|
||||
return "<input type='checkbox' name='select_all[]' class='icheckbox_flat-blue' value='".$ticket->id."'></input>";
|
||||
return "<input type='checkbox' name='select_all[]' id='".$ticket->id."' onclick='someFunction(this.id)' class='selectval icheckbox_flat-blue' value='".$ticket->id."'></input>";
|
||||
})
|
||||
->addColumn('subject', function ($ticket) {
|
||||
$subject = DB::table('ticket_thread')->select('title')->where('ticket_id', '=', $ticket->id)->first();
|
||||
@@ -1945,7 +1770,6 @@ class TicketController extends Controller
|
||||
} else {
|
||||
$attachString = '';
|
||||
}
|
||||
//return $threads->id;
|
||||
|
||||
return "<a href='".route('ticket.thread', [$ticket->id])."' title='".$subject->title."'>".$string." <span style='color:green'>(".$count.")<i class='fa fa-comment'></i></span></a>".$collabString.$attachString;
|
||||
})
|
||||
@@ -1956,7 +1780,6 @@ class TicketController extends Controller
|
||||
$priority = DB::table('ticket_priority')->select('priority_desc', 'priority_color')->where('priority_id', '=', $ticket->priority_id)->first();
|
||||
|
||||
return '<span class="btn btn-'.$priority->priority_color.' btn-xs">'.$priority->priority_desc.'</span>';
|
||||
//return "loda";
|
||||
})
|
||||
->addColumn('from', function ($ticket) {
|
||||
$from = DB::table('users')->select('user_name')->where('id', '=', $ticket->user_id)->first();
|
||||
@@ -1993,7 +1816,6 @@ class TicketController extends Controller
|
||||
$TicketData = Ticket_Thread::where('ticket_id', '=', $ticket->id)->max('id');
|
||||
$TicketDatarow = Ticket_Thread::select('updated_at')->where('id', '=', $TicketData)->first();
|
||||
|
||||
// return date('d F Y, H:i:s', strtotime($TicketDatarow->updated_at));
|
||||
return UTC::usertimezone($TicketDatarow->updated_at);
|
||||
})
|
||||
->searchColumns('subject', 'from', 'assigned_to', 'ticket_number', 'priority')
|
||||
@@ -2014,20 +1836,15 @@ class TicketController extends Controller
|
||||
public function get_unassigned()
|
||||
{
|
||||
if (Auth::user()->role == 'admin') {
|
||||
// $tickets = Tickets::where('status', '=', 1)->where('assigned_to', '=', Auth::user()->id)->get();
|
||||
|
||||
$tickets = Tickets::where('assigned_to', '=', null)->where('status', '1')->get();
|
||||
} else {
|
||||
$dept = Department::where('id', '=', Auth::user()->primary_dpt)->first();
|
||||
$tickets = Tickets::where('assigned_to', '=', null)->where('dept_id', '=', $dept->id)->get();
|
||||
|
||||
// $dept = Department::where('name','=',Auth::user()->primary_dpt)->first();
|
||||
// $tickets = Tickets::where('status', '=', 1)->where('assigned_to', '=', Auth::user()->id)->get();
|
||||
}
|
||||
|
||||
return \Datatable::collection(new Collection($tickets))
|
||||
->addColumn('id', function ($ticket) {
|
||||
return "<input type='checkbox' name='select_all[]' class='icheckbox_flat-blue' value='".$ticket->id."'></input>";
|
||||
return "<input type='checkbox' name='select_all[]' id='".$ticket->id."' onclick='someFunction(this.id)' class='selectval icheckbox_flat-blue' value='".$ticket->id."'></input>";
|
||||
})
|
||||
->addColumn('subject', function ($ticket) {
|
||||
$subject = DB::table('ticket_thread')->select('title')->where('ticket_id', '=', $ticket->id)->first();
|
||||
@@ -2057,7 +1874,6 @@ class TicketController extends Controller
|
||||
} else {
|
||||
$attachString = '';
|
||||
}
|
||||
//return $threads->id;
|
||||
|
||||
return "<a href='".route('ticket.thread', [$ticket->id])."' title='".$subject->title."'>".$string." <span style='color:green'>(".$count.")<i class='fa fa-comment'></i></span></a>".$collabString.$attachString;
|
||||
})
|
||||
@@ -2068,7 +1884,6 @@ class TicketController extends Controller
|
||||
$priority = DB::table('ticket_priority')->select('priority_desc', 'priority_color')->where('priority_id', '=', $ticket->priority_id)->first();
|
||||
|
||||
return '<span class="btn btn-'.$priority->priority_color.' btn-xs">'.$priority->priority_desc.'</span>';
|
||||
//return "loda";
|
||||
})
|
||||
->addColumn('from', function ($ticket) {
|
||||
$from = DB::table('users')->select('user_name')->where('id', '=', $ticket->user_id)->first();
|
||||
@@ -2105,7 +1920,6 @@ class TicketController extends Controller
|
||||
$TicketData = Ticket_Thread::where('ticket_id', '=', $ticket->id)->max('id');
|
||||
$TicketDatarow = Ticket_Thread::select('updated_at')->where('id', '=', $TicketData)->first();
|
||||
|
||||
// return date('d F Y, H:i:s', strtotime($TicketDatarow->updated_at));
|
||||
return UTC::usertimezone($TicketDatarow->updated_at);
|
||||
})
|
||||
->searchColumns('subject', 'from', 'assigned_to', 'ticket_number', 'priority')
|
||||
@@ -2222,16 +2036,6 @@ class TicketController extends Controller
|
||||
if ($user->save()) {
|
||||
$user_id = $user->id;
|
||||
|
||||
// Mail::send('emails.pass', ['password' => $password, 'name' => $name, 'from'=>$company,'emailadd'=>$email], function ($message) use ($email, $name) {
|
||||
// $message->to($email, $name)->subject('password');
|
||||
// });
|
||||
// $sending_emails = Emails::where('department', '=', $ticket_status->dept_id)->first();
|
||||
// if($sending_emails == null) {
|
||||
// $from_email = $this->system_mail();
|
||||
// } else {
|
||||
// $from_email = $sending_emails->id;
|
||||
// }
|
||||
|
||||
$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]);
|
||||
}
|
||||
$ticket_collaborator = new Ticket_Collaborator();
|
||||
@@ -2243,7 +2047,6 @@ class TicketController extends Controller
|
||||
|
||||
return '<div id="alert11" class="alert alert-dismissable" style="color:#60B23C;background-color:#F2F2F2;"><button id="dismiss11" type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button><h4><i class="icon fa fa-user"></i>'.$user->user_name.'</h4><div id="message-success1">'.$user->email.'</div></div>';
|
||||
}
|
||||
// return '<div id="alert11" class="alert alert-dismissable" ><button id="dismiss11" type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button><h4><i class="icon fa fa-user"></i>'.$data->user_name.'</h4><div id="message-success1">'.$data->email.'</div></div>';
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2285,6 +2088,7 @@ class TicketController extends Controller
|
||||
$ticket->reopened_at = date('Y-m-d H:i:s');
|
||||
$ticket->closed = 0;
|
||||
$ticket->closed_at = null;
|
||||
|
||||
$ticket->save();
|
||||
}
|
||||
}
|
||||
@@ -2490,9 +2294,9 @@ class TicketController extends Controller
|
||||
$name = Input::get('name');
|
||||
$returnValue = $this->changeOwnerAdd($email, $name, $ticket_id);
|
||||
if ($returnValue === 0) {
|
||||
return 4; //'<div id="alert11" class="alert alert-warning alert-dismissable" ><button id="dismiss11" type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button><h4><i class="icon fa fa-alert"></i>Alert!</h4><div id="message-success1">This user already Exists</div></div>';
|
||||
return 4;
|
||||
} elseif ($returnValue === 2) {
|
||||
return 5; //'<div id="alert11" class="alert alert-warning alert-dismissable" ><button id="dismiss11" type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button><h4><i class="icon fa fa-alert"></i>Alert!</h4><div id="message-success1">Enter valid email address.</div></div>';
|
||||
return 5;
|
||||
} else {
|
||||
//do nothing
|
||||
}
|
||||
@@ -2555,9 +2359,9 @@ class TicketController extends Controller
|
||||
$user = User::where('email', '=', $email)->first();
|
||||
$count = count($user);
|
||||
if ($count === 1) {
|
||||
return 0; //'<div id="alert11" class="alert alert-warning alert-dismissable" ><button id="dismiss11" type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button><h4><i class="icon fa fa-alert"></i>Alert!</h4><div id="message-success1">This user already Exists</div></div>';
|
||||
return 0;
|
||||
} elseif ($validator->fails()) {
|
||||
return 2; //'<div id="alert11" class="alert alert-warning alert-dismissable" ><button id="dismiss11" type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button><h4><i class="icon fa fa-alert"></i>Alert!</h4><div id="message-success1">Enter valid email address. Exists</div></div>';
|
||||
return 2;
|
||||
} else {
|
||||
$company = $this->company();
|
||||
$user = new User();
|
||||
@@ -2571,13 +2375,11 @@ class TicketController extends Controller
|
||||
try {
|
||||
$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]);
|
||||
} catch (\Exception $e) {
|
||||
// dd($e);
|
||||
}
|
||||
}
|
||||
|
||||
return 1; // '<div id="alert11" class="alert alert-dismissable" style="color:#60B23C;background-color:#F2F2F2;"><button id="dismiss11" type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button><h4><i class="icon fa fa-user"></i>'.$user->user_name.'</h4><div id="message-success1">'.$user->email.'</div></div>';
|
||||
return 1;
|
||||
}
|
||||
// return '<div id="alert11" class="alert alert-dismissable" ><button id="dismiss11" type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button><h4><i class="icon fa fa-user"></i>'.$data->user_name.'</h4><div id="message-success1">'.$data->email.'</div></div>';
|
||||
}
|
||||
|
||||
public function getMergeTickets($id)
|
||||
@@ -2693,7 +2495,6 @@ class TicketController extends Controller
|
||||
"'>#".$parent_ticket->ticket_number.'</a><br>'.$reason;
|
||||
$new_thread->format = $thread->format;
|
||||
$new_thread->ip_address = $thread->ip_address;
|
||||
//$new_thread->save();
|
||||
|
||||
$new_parent_thread = new Ticket_thread();
|
||||
$new_parent_thread->ticket_id = $p_id;
|
||||
@@ -2705,7 +2506,6 @@ class TicketController extends Controller
|
||||
$new_parent_thread->body = Lang::get('lang.ticket')." <a href='".route('ticket.thread', [$value])."'>#".$ticket->ticket_number.'</a> '.Lang::get('lang.ticket_merged').'<br>'.$reason;
|
||||
$new_parent_thread->format = $parent_thread->format;
|
||||
$new_parent_thread->ip_address = $parent_thread->ip_address;
|
||||
//$new_parent_thread->save();
|
||||
if ($new_thread->save() && $new_parent_thread->save()) {
|
||||
$success = 1;
|
||||
} else {
|
||||
|
@@ -38,7 +38,6 @@ class UserController extends Controller
|
||||
* 1. authentication
|
||||
* 2. user roles
|
||||
* 3. roles must be agent.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
@@ -51,9 +50,7 @@ class UserController extends Controller
|
||||
|
||||
/**
|
||||
* Display all list of the users.
|
||||
*
|
||||
* @param type User $user
|
||||
*
|
||||
* @return type view
|
||||
*/
|
||||
public function index()
|
||||
@@ -68,15 +65,14 @@ class UserController extends Controller
|
||||
|
||||
/**
|
||||
* This function is used to display the list of users using chumper datatables.
|
||||
*
|
||||
* @return datatable
|
||||
*/
|
||||
public function user_list()
|
||||
{
|
||||
// displaying list of users with chumper datatables
|
||||
return \Datatable::collection(User::where('role', '!=', 'admin')->where('role', '!=', 'agent')->get())
|
||||
/* searchable column username */
|
||||
->searchColumns('user_name')
|
||||
/* searchable column username and email*/
|
||||
->searchColumns('user_name', 'email', 'phone')
|
||||
/* order column username and email */
|
||||
->orderColumns('user_name', 'email')
|
||||
/* column username */
|
||||
@@ -85,14 +81,14 @@ class UserController extends Controller
|
||||
$username = substr($model->user_name, 0, 30);
|
||||
$username = substr($username, 0, strrpos($username, ' ')).' ...';
|
||||
} else {
|
||||
$username = $model->user_name;
|
||||
$username = "<a href='".route('user.edit', $model->id)."'>".$model->user_name."</a>";
|
||||
}
|
||||
|
||||
return $username;
|
||||
})
|
||||
/* column email */
|
||||
->addColumn('email', function ($model) {
|
||||
$email = $model->email;
|
||||
$email = "<a href='".route('user.edit', $model->id)."'>".$model->email."</a>";
|
||||
|
||||
return $email;
|
||||
})
|
||||
@@ -147,7 +143,6 @@ class UserController extends Controller
|
||||
|
||||
/**
|
||||
* Show the form for creating a new users.
|
||||
*
|
||||
* @return type view
|
||||
*/
|
||||
public function create()
|
||||
@@ -161,10 +156,8 @@ class UserController extends Controller
|
||||
|
||||
/**
|
||||
* Store a newly created users in storage.
|
||||
*
|
||||
* @param type User $user
|
||||
* @param type Sys_userRequest $request
|
||||
*
|
||||
* @return type redirect
|
||||
*/
|
||||
public function store(User $user, Sys_userRequest $request)
|
||||
@@ -191,10 +184,8 @@ class UserController extends Controller
|
||||
|
||||
/**
|
||||
* Display the specified users.
|
||||
*
|
||||
* @param type int $id
|
||||
* @param type User $user
|
||||
*
|
||||
* @return type view
|
||||
*/
|
||||
public function show($id, User $user)
|
||||
@@ -211,10 +202,8 @@ class UserController extends Controller
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param type int $id
|
||||
* @param type User $user
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function edit($id, User $user)
|
||||
@@ -231,16 +220,13 @@ class UserController extends Controller
|
||||
|
||||
/**
|
||||
* Update the specified user in storage.
|
||||
*
|
||||
* @param type int $id
|
||||
* @param type User $user
|
||||
* @param type Sys_userUpdate $request
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function update($id, User $user, Sys_userUpdate $request)
|
||||
{
|
||||
|
||||
/* select the field where id = $id(request Id) */
|
||||
$users = $user->whereId($id)->first();
|
||||
/* Update the value by selected field */
|
||||
@@ -257,7 +243,6 @@ class UserController extends Controller
|
||||
|
||||
/**
|
||||
* get agent profile page.
|
||||
*
|
||||
* @return type view
|
||||
*/
|
||||
public function getProfile()
|
||||
@@ -272,7 +257,6 @@ class UserController extends Controller
|
||||
|
||||
/**
|
||||
* get profile edit page.
|
||||
*
|
||||
* @return type view
|
||||
*/
|
||||
public function getProfileedit()
|
||||
@@ -287,10 +271,8 @@ class UserController extends Controller
|
||||
|
||||
/**
|
||||
* post profile edit.
|
||||
*
|
||||
* @param type int $id
|
||||
* @param type ProfileRequest $request
|
||||
*
|
||||
* @return type Redirect
|
||||
*/
|
||||
public function postProfileedit(ProfileRequest $request)
|
||||
@@ -339,10 +321,8 @@ class UserController extends Controller
|
||||
|
||||
/**
|
||||
* Post profile password.
|
||||
*
|
||||
* @param type int $id
|
||||
* @param type ProfilePassword $request
|
||||
*
|
||||
* @return type Redirect
|
||||
*/
|
||||
public function postProfilePassword($id, ProfilePassword $request)
|
||||
@@ -354,7 +334,6 @@ class UserController extends Controller
|
||||
$user->password = Hash::make($request->input('new_password'));
|
||||
try {
|
||||
$user->save();
|
||||
|
||||
return redirect('profile-edit')->with('success1', 'Password Updated sucessfully');
|
||||
} catch (Exception $e) {
|
||||
return redirect('profile-edit')->with('fails', $e->errorInfo[2]);
|
||||
@@ -366,9 +345,7 @@ class UserController extends Controller
|
||||
|
||||
/**
|
||||
* Assigning an user to an organization.
|
||||
*
|
||||
* @param type $id
|
||||
*
|
||||
* @return type boolean
|
||||
*/
|
||||
public function UserAssignOrg($id)
|
||||
@@ -378,15 +355,12 @@ class UserController extends Controller
|
||||
$user_org->org_id = $org;
|
||||
$user_org->user_id = $id;
|
||||
$user_org->save();
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* creating an organization in user profile page via modal popup.
|
||||
*
|
||||
* @param type $id
|
||||
*
|
||||
* @return type
|
||||
*/
|
||||
public function User_Create_Org($id)
|
||||
|
@@ -555,9 +555,10 @@ class ApiController extends Controller
|
||||
$result[$key]['picture'] = $path;
|
||||
}
|
||||
$result = $this->createPagination($result, 10);
|
||||
//dd($result);
|
||||
//$result->toJson();
|
||||
return $result->toJson();
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
$error = $e->getMessage();
|
||||
$line = $e->getLine();
|
||||
$file = $e->getFile();
|
||||
|
114
app/Http/Controllers/Api/v1/ApiExceptAuthController.php
Normal file
114
app/Http/Controllers/Api/v1/ApiExceptAuthController.php
Normal file
@@ -0,0 +1,114 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Api\v1;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
class ApiExceptAuthController extends Controller
|
||||
{
|
||||
public $api_controller;
|
||||
|
||||
public function __construct(Request $request)
|
||||
{
|
||||
$this->request = $request;
|
||||
$this->middleware('api');
|
||||
}
|
||||
|
||||
/**
|
||||
* Check the url is valid or not.
|
||||
*
|
||||
* @return json
|
||||
*/
|
||||
public function checkUrl()
|
||||
{
|
||||
//dd($this->request);
|
||||
try {
|
||||
$v = \Validator::make($this->request->all(), [
|
||||
'url' => 'required|url',
|
||||
]);
|
||||
if ($v->fails()) {
|
||||
$error = $v->errors();
|
||||
|
||||
return response()->json(compact('error'));
|
||||
}
|
||||
|
||||
$url = $this->request->input('url');
|
||||
$url = $url.'/api/v1/helpdesk/check-url';
|
||||
$result = $this->CallGetApi($url);
|
||||
// dd($result);
|
||||
return response()->json(compact('result'));
|
||||
} catch (\Exception $ex) {
|
||||
$error = $ex->getMessage();
|
||||
|
||||
return $error;
|
||||
} catch (\Symfony\Component\HttpKernel\Exception\HttpException $ex) {
|
||||
return ['status' => 'fails', 'code' => $ex->getStatusCode()];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Success for currect url.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function urlResult()
|
||||
{
|
||||
try {
|
||||
$result = ['status' => 'success'];
|
||||
|
||||
return $result;
|
||||
} catch (\Symfony\Component\HttpKernel\Exception\HttpException $ex) {
|
||||
return ['status' => 'fails', 'code' => $ex->getStatusCode()];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Call curl function for Get Method.
|
||||
*
|
||||
* @param type $url
|
||||
*
|
||||
* @return type int|string|json
|
||||
*/
|
||||
public function callGetApi($url)
|
||||
{
|
||||
$curl = curl_init($url);
|
||||
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
|
||||
curl_setopt($curl, CURLOPT_URL, $url);
|
||||
curl_setopt($curl, CURLOPT_HEADER, 0);
|
||||
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
|
||||
$response = curl_exec($curl);
|
||||
|
||||
if (curl_errno($curl)) {
|
||||
//echo 'error:' . curl_error($curl);
|
||||
}
|
||||
|
||||
return $response;
|
||||
curl_close($curl);
|
||||
}
|
||||
|
||||
/**
|
||||
* Call curl function for POST Method.
|
||||
*
|
||||
* @param type $url
|
||||
* @param type $data
|
||||
*
|
||||
* @return type int|string|json
|
||||
*/
|
||||
public function callPostApi($url, $data)
|
||||
{
|
||||
$curl = curl_init($url);
|
||||
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
|
||||
curl_setopt($curl, CURLOPT_URL, $url);
|
||||
curl_setopt($curl, CURLOPT_HEADER, 0);
|
||||
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
|
||||
$response = curl_exec($curl);
|
||||
|
||||
if (curl_errno($curl)) {
|
||||
echo 'error:'.curl_error($curl);
|
||||
}
|
||||
|
||||
return $response;
|
||||
curl_close($curl);
|
||||
}
|
||||
}
|
@@ -473,6 +473,13 @@ class TestController extends Controller
|
||||
public function getCustomersWith()
|
||||
{
|
||||
try {
|
||||
//dd($this->server);
|
||||
$url = $this->server.'helpdesk/customers-custom?api_key=9p41T2XFZ34YRZJUNQAdmM7iV0Rr1CjN&token='.\Config::get('app.token');
|
||||
$_this = new self();
|
||||
$respose = $_this->callGetApi($url);
|
||||
dd($respose);
|
||||
|
||||
return $respose;
|
||||
} catch (\Exception $e) {
|
||||
$error = $e->getMessage();
|
||||
$line = $e->getLine();
|
||||
|
@@ -64,6 +64,7 @@ class ClientTicketController extends Controller
|
||||
$tickets->closed = 0;
|
||||
$tickets->reopened_at = date('Y-m-d H:i:s');
|
||||
$tickets->reopened = 1;
|
||||
$tickets->isanswered = 0;
|
||||
$threads = new Ticket_Thread();
|
||||
$threads->user_id = Auth::user()->id;
|
||||
$threads->ticket_id = $tickets->id;
|
||||
|
@@ -10,13 +10,16 @@ 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 {
|
||||
|
||||
return $emails;
|
||||
public function fetch_smtp_details($id) {
|
||||
$emails = Emails::where('id', '=', $id)->first();
|
||||
if ($emails->sending_status == 1) {
|
||||
return $emails;
|
||||
} else {
|
||||
$emails = null;
|
||||
return $emails;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -24,231 +27,235 @@ 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) {
|
||||
return $from_address;
|
||||
} else {
|
||||
// dd($from_address);
|
||||
$username = $from_address->email_address;
|
||||
$fromname = $from_address->email_name;
|
||||
$password = \Crypt::decrypt($from_address->password);
|
||||
$smtpsecure = $from_address->sending_encryption;
|
||||
$host = $from_address->sending_host;
|
||||
$port = $from_address->sending_port;
|
||||
|
||||
// dd($from_address);
|
||||
$username = $from_address->email_address;
|
||||
$fromname = $from_address->email_name;
|
||||
$password = \Crypt::decrypt($from_address->password);
|
||||
$smtpsecure = $from_address->sending_encryption;
|
||||
$host = $from_address->sending_host;
|
||||
$port = $from_address->sending_port;
|
||||
if (isset($to['email'])) {
|
||||
$recipants = $to['email'];
|
||||
} else {
|
||||
$recipants = null;
|
||||
}
|
||||
if (isset($to['name'])) {
|
||||
$recipantname = $to['name'];
|
||||
} else {
|
||||
$recipantname = null;
|
||||
}
|
||||
if (isset($to['cc'])) {
|
||||
$cc = $to['cc'];
|
||||
} else {
|
||||
$cc = null;
|
||||
}
|
||||
if (isset($to['bc'])) {
|
||||
$bc = $to['bc'];
|
||||
} else {
|
||||
$bc = null;
|
||||
}
|
||||
if (isset($message['subject'])) {
|
||||
$subject = $message['subject'];
|
||||
} else {
|
||||
$subject = null;
|
||||
}
|
||||
if (isset($message['body'])) {
|
||||
$content = $message['body'];
|
||||
} else {
|
||||
$content = null;
|
||||
}
|
||||
if (isset($message['scenario'])) {
|
||||
$template = $message['scenario'];
|
||||
} else {
|
||||
$template = null;
|
||||
}
|
||||
if (isset($message['attachments'])) {
|
||||
$attachment = $message['attachments'];
|
||||
} else {
|
||||
$attachment = null;
|
||||
}
|
||||
|
||||
if (isset($to['email'])) {
|
||||
$recipants = $to['email'];
|
||||
} else {
|
||||
$recipants = null;
|
||||
}
|
||||
if (isset($to['name'])) {
|
||||
$recipantname = $to['name'];
|
||||
} else {
|
||||
$recipantname = null;
|
||||
}
|
||||
if (isset($to['cc'])) {
|
||||
$cc = $to['cc'];
|
||||
} else {
|
||||
$cc = null;
|
||||
}
|
||||
if (isset($to['bc'])) {
|
||||
$bc = $to['bc'];
|
||||
} else {
|
||||
$bc = null;
|
||||
}
|
||||
if (isset($message['subject'])) {
|
||||
$subject = $message['subject'];
|
||||
} else {
|
||||
$subject = null;
|
||||
}
|
||||
if (isset($message['body'])) {
|
||||
$content = $message['body'];
|
||||
} else {
|
||||
$content = null;
|
||||
}
|
||||
if (isset($message['scenario'])) {
|
||||
$template = $message['scenario'];
|
||||
} else {
|
||||
$template = null;
|
||||
}
|
||||
if (isset($message['attachments'])) {
|
||||
$attachment = $message['attachments'];
|
||||
} else {
|
||||
$attachment = null;
|
||||
}
|
||||
// template variables
|
||||
if (Auth::user()) {
|
||||
$agent = Auth::user()->user_name;
|
||||
} else {
|
||||
$agent = null;
|
||||
}
|
||||
if (isset($template_variables['ticket_agent_name'])) {
|
||||
$ticket_agent_name = $template_variables['ticket_agent_name'];
|
||||
} else {
|
||||
$ticket_agent_name = null;
|
||||
}
|
||||
if (isset($template_variables['ticket_number'])) {
|
||||
$ticket_number = $template_variables['ticket_number'];
|
||||
} else {
|
||||
$ticket_number = null;
|
||||
}
|
||||
if (isset($template_variables['ticket_client_name'])) {
|
||||
$ticket_client_name = $template_variables['ticket_client_name'];
|
||||
} else {
|
||||
$ticket_client_name = null;
|
||||
}
|
||||
if (isset($template_variables['ticket_client_email'])) {
|
||||
$ticket_client_email = $template_variables['ticket_client_email'];
|
||||
} else {
|
||||
$ticket_client_email = null;
|
||||
}
|
||||
if (isset($template_variables['ticket_body'])) {
|
||||
$ticket_body = $template_variables['ticket_body'];
|
||||
} else {
|
||||
$ticket_body = null;
|
||||
}
|
||||
if (isset($template_variables['ticket_assigner'])) {
|
||||
$ticket_assigner = $template_variables['ticket_assigner'];
|
||||
} else {
|
||||
$ticket_assigner = null;
|
||||
}
|
||||
if (isset($template_variables['ticket_link_with_number'])) {
|
||||
$ticket_link_with_number = $template_variables['ticket_link_with_number'];
|
||||
} else {
|
||||
$ticket_link_with_number = null;
|
||||
}
|
||||
// if (isset($template_variables['system_from'])) {
|
||||
// $system_from = $template_variables['system_from'];
|
||||
// } else {
|
||||
// $system_from = null;
|
||||
// }
|
||||
if (isset($template_variables['system_link'])) {
|
||||
$system_link = $template_variables['system_link'];
|
||||
} else {
|
||||
$system_link = null;
|
||||
}
|
||||
if (isset($template_variables['system_error'])) {
|
||||
$system_error = $template_variables['system_error'];
|
||||
} else {
|
||||
$system_error = null;
|
||||
}
|
||||
if (isset($template_variables['agent_sign'])) {
|
||||
$agent_sign = $template_variables['agent_sign'];
|
||||
} else {
|
||||
$agent_sign = null;
|
||||
}
|
||||
if (isset($template_variables['department_sign'])) {
|
||||
$department_sign = $template_variables['department_sign'];
|
||||
} else {
|
||||
$department_sign = null;
|
||||
}
|
||||
if (isset($template_variables['password_reset_link'])) {
|
||||
$password_reset_link = $template_variables['password_reset_link'];
|
||||
} else {
|
||||
$password_reset_link = null;
|
||||
}
|
||||
if (isset($template_variables['user_password'])) {
|
||||
$user_password = $template_variables['user_password'];
|
||||
} else {
|
||||
$user_password = null;
|
||||
}
|
||||
if (isset($template_variables['email_address'])) {
|
||||
$email_address = $template_variables['email_address'];
|
||||
} else {
|
||||
$email_address = null;
|
||||
}
|
||||
if (isset($template_variables['user'])) {
|
||||
$user = $template_variables['user'];
|
||||
} else {
|
||||
$user = null;
|
||||
}
|
||||
|
||||
// template variables
|
||||
if (Auth::user()) {
|
||||
$agent = Auth::user()->user_name;
|
||||
} else {
|
||||
$agent = null;
|
||||
}
|
||||
if (isset($template_variables['ticket_agent_name'])) {
|
||||
$ticket_agent_name = $template_variables['ticket_agent_name'];
|
||||
} else {
|
||||
$ticket_agent_name = null;
|
||||
}
|
||||
if (isset($template_variables['ticket_number'])) {
|
||||
$ticket_number = $template_variables['ticket_number'];
|
||||
} else {
|
||||
$ticket_number = null;
|
||||
}
|
||||
if (isset($template_variables['ticket_client_name'])) {
|
||||
$ticket_client_name = $template_variables['ticket_client_name'];
|
||||
} else {
|
||||
$ticket_client_name = null;
|
||||
}
|
||||
if (isset($template_variables['ticket_client_email'])) {
|
||||
$ticket_client_email = $template_variables['ticket_client_email'];
|
||||
} else {
|
||||
$ticket_client_email = null;
|
||||
}
|
||||
if (isset($template_variables['ticket_body'])) {
|
||||
$ticket_body = $template_variables['ticket_body'];
|
||||
} else {
|
||||
$ticket_body = null;
|
||||
}
|
||||
if (isset($template_variables['ticket_assigner'])) {
|
||||
$ticket_assigner = $template_variables['ticket_assigner'];
|
||||
} else {
|
||||
$ticket_assigner = null;
|
||||
}
|
||||
if (isset($template_variables['ticket_link_with_number'])) {
|
||||
$ticket_link_with_number = $template_variables['ticket_link_with_number'];
|
||||
} else {
|
||||
$ticket_link_with_number = null;
|
||||
}
|
||||
// if (isset($template_variables['system_from'])) {
|
||||
// $system_from = $template_variables['system_from'];
|
||||
// } else {
|
||||
// $system_from = null;
|
||||
// }
|
||||
if (isset($template_variables['system_link'])) {
|
||||
$system_link = $template_variables['system_link'];
|
||||
} else {
|
||||
$system_link = null;
|
||||
}
|
||||
if (isset($template_variables['system_error'])) {
|
||||
$system_error = $template_variables['system_error'];
|
||||
} else {
|
||||
$system_error = null;
|
||||
}
|
||||
if (isset($template_variables['agent_sign'])) {
|
||||
$agent_sign = $template_variables['agent_sign'];
|
||||
} else {
|
||||
$agent_sign = null;
|
||||
}
|
||||
if (isset($template_variables['department_sign'])) {
|
||||
$department_sign = $template_variables['department_sign'];
|
||||
} else {
|
||||
$department_sign = null;
|
||||
}
|
||||
if (isset($template_variables['password_reset_link'])) {
|
||||
$password_reset_link = $template_variables['password_reset_link'];
|
||||
} else {
|
||||
$password_reset_link = null;
|
||||
}
|
||||
if (isset($template_variables['user_password'])) {
|
||||
$user_password = $template_variables['user_password'];
|
||||
} else {
|
||||
$user_password = null;
|
||||
}
|
||||
if (isset($template_variables['email_address'])) {
|
||||
$email_address = $template_variables['email_address'];
|
||||
} else {
|
||||
$email_address = null;
|
||||
}
|
||||
if (isset($template_variables['user'])) {
|
||||
$user = $template_variables['user'];
|
||||
} else {
|
||||
$user = null;
|
||||
}
|
||||
$system_link = url('/');
|
||||
|
||||
$system_link = url('/');
|
||||
$system_from = $this->company();
|
||||
|
||||
$system_from = $this->company();
|
||||
$mail = new \PHPMailer();
|
||||
|
||||
$mail = new \PHPMailer();
|
||||
$status = \DB::table('settings_email')->first();
|
||||
|
||||
$status = \DB::table('settings_email')->first();
|
||||
$path2 = \Config::get('view.paths');
|
||||
|
||||
$path2 = \Config::get('view.paths');
|
||||
$directory = $path2[0] . '\emails' . DIRECTORY_SEPARATOR . $status->template . DIRECTORY_SEPARATOR;
|
||||
|
||||
$directory = $path2[0].'\emails'.DIRECTORY_SEPARATOR.$status->template.DIRECTORY_SEPARATOR;
|
||||
$handle = fopen($directory . $template . '.blade.php', 'r');
|
||||
$contents = fread($handle, filesize($directory . $template . '.blade.php'));
|
||||
fclose($handle);
|
||||
|
||||
$handle = fopen($directory.$template.'.blade.php', 'r');
|
||||
$contents = fread($handle, filesize($directory.$template.'.blade.php'));
|
||||
fclose($handle);
|
||||
$variables = ['{!!$user!!}', '{!!$agent!!}', '{!!$ticket_number!!}', '{!!$content!!}', '{!!$from!!}', '{!!$ticket_agent_name!!}', '{!!$ticket_client_name!!}', '{!!$ticket_client_email!!}', '{!!$ticket_body!!}', '{!!$ticket_assigner!!}', '{!!$ticket_link_with_number!!}', '{!!$system_error!!}', '{!!$agent_sign!!}', '{!!$department_sign!!}', '{!!$password_reset_link!!}', '{!!$email_address!!}', '{!!$user_password!!}', '{!!$system_from!!}', '{!!$system_link!!}'];
|
||||
|
||||
$variables = ['{!!$user!!}', '{!!$agent!!}', '{!!$ticket_number!!}', '{!!$content!!}', '{!!$from!!}', '{!!$ticket_agent_name!!}', '{!!$ticket_client_name!!}', '{!!$ticket_client_email!!}', '{!!$ticket_body!!}', '{!!$ticket_assigner!!}', '{!!$ticket_link_with_number!!}', '{!!$system_error!!}', '{!!$agent_sign!!}', '{!!$department_sign!!}', '{!!$password_reset_link!!}', '{!!$email_address!!}', '{!!$user_password!!}', '{!!$system_from!!}', '{!!$system_link!!}'];
|
||||
$data = [$user, $agent, $ticket_number, $content, $from, $ticket_agent_name, $ticket_client_name, $ticket_client_email, $ticket_body, $ticket_assigner, $ticket_link_with_number, $system_error, $agent_sign, $department_sign, $password_reset_link, $email_address, $user_password, $system_from, $system_link];
|
||||
|
||||
$data = [$user, $agent, $ticket_number, $content, $from, $ticket_agent_name, $ticket_client_name, $ticket_client_email, $ticket_body, $ticket_assigner, $ticket_link_with_number, $system_error, $agent_sign, $department_sign, $password_reset_link, $email_address, $user_password, $system_from, $system_link];
|
||||
// dd($variables,$data,$contents);
|
||||
// $messagebody = str_replace($variables, $data, $contents);
|
||||
|
||||
// dd($variables,$data,$contents);
|
||||
// $messagebody = str_replace($variables, $data, $contents);
|
||||
foreach ($variables as $key => $variable) {
|
||||
$messagebody = str_replace($variables[$key], $data[$key], $contents);
|
||||
// dd($messagebody);
|
||||
|
||||
$contents = $messagebody;
|
||||
}
|
||||
|
||||
foreach ($variables as $key => $variable) {
|
||||
$messagebody = str_replace($variables[$key], $data[$key], $contents);
|
||||
// dd($messagebody);
|
||||
//$mail->SMTPDebug = 3; // Enable verbose debug output
|
||||
|
||||
$contents = $messagebody;
|
||||
}
|
||||
$mail->isSMTP(); // Set mailer to use SMTP
|
||||
$mail->Host = $host; // Specify main and backup SMTP servers
|
||||
$mail->SMTPAuth = true; // Enable SMTP authentication
|
||||
$mail->Username = $username; // SMTP username
|
||||
$mail->Password = $password; // SMTP password
|
||||
$mail->SMTPSecure = $smtpsecure; // Enable TLS encryption, `ssl` also accepted
|
||||
$mail->Port = $port; // TCP port to connect to
|
||||
|
||||
// dd($messagebody);
|
||||
//$mail->SMTPDebug = 3; // Enable verbose debug output
|
||||
|
||||
$mail->isSMTP(); // Set mailer to use SMTP
|
||||
$mail->Host = $host; // Specify main and backup SMTP servers
|
||||
$mail->SMTPAuth = true; // Enable SMTP authentication
|
||||
$mail->Username = $username; // SMTP username
|
||||
$mail->Password = $password; // SMTP password
|
||||
$mail->SMTPSecure = $smtpsecure; // Enable TLS encryption, `ssl` also accepted
|
||||
$mail->Port = $port; // TCP port to connect to
|
||||
|
||||
$mail->setFrom($username, $fromname);
|
||||
$mail->addAddress($recipants); // Add a recipient
|
||||
// Name is optional
|
||||
// $mail->addReplyTo('sada059@gmail.com', 'Information');
|
||||
// Optional name
|
||||
$mail->isHTML(true); // Set email format to HTML
|
||||
if ($cc != null) {
|
||||
foreach ($cc as $collaborator) {
|
||||
//mail to collaborators
|
||||
$collab_user_id = $collaborator->user_id;
|
||||
$user_id_collab = User::where('id', '=', $collab_user_id)->first();
|
||||
$collab_email = $user_id_collab->email;
|
||||
$mail->addCC($collab_email);
|
||||
$mail->setFrom($username, $fromname);
|
||||
$mail->addAddress($recipants); // Add a recipient
|
||||
// Name is optional
|
||||
// $mail->addReplyTo('sada059@gmail.com', 'Information');
|
||||
// Optional name
|
||||
$mail->isHTML(true); // Set email format to HTML
|
||||
if ($cc != null) {
|
||||
foreach ($cc as $collaborator) {
|
||||
//mail to collaborators
|
||||
$collab_user_id = $collaborator->user_id;
|
||||
$user_id_collab = User::where('id', '=', $collab_user_id)->first();
|
||||
$collab_email = $user_id_collab->email;
|
||||
$mail->addCC($collab_email);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$mail->addBCC($bc);
|
||||
$mail->addBCC($bc);
|
||||
|
||||
if ($attachment != null) {
|
||||
$size = count($message['attachments']);
|
||||
$attach = $message['attachments'];
|
||||
for ($i = 0; $i < $size; $i++) {
|
||||
$file_path = $attach[$i]->getRealPath();
|
||||
$file_name = $attach[$i]->getClientOriginalName();
|
||||
$mail->addAttachment($file_path, $file_name);
|
||||
if ($attachment != null) {
|
||||
$size = count($message['attachments']);
|
||||
$attach = $message['attachments'];
|
||||
for ($i = 0; $i < $size; $i++) {
|
||||
$file_path = $attach[$i]->getRealPath();
|
||||
$file_name = $attach[$i]->getClientOriginalName();
|
||||
$mail->addAttachment($file_path, $file_name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$mail->Subject = $subject;
|
||||
if ($template == 'ticket-reply-agent') {
|
||||
$line = '---Reply above this line--- <br/><br/>';
|
||||
$mail->Body = $line.$messagebody;
|
||||
} else {
|
||||
$mail->Body = $messagebody;
|
||||
}
|
||||
$mail->Subject = $subject;
|
||||
if ($template == 'ticket-reply-agent') {
|
||||
$line = '---Reply above this line--- <br/><br/>';
|
||||
$mail->Body = $line . $messagebody;
|
||||
} else {
|
||||
$mail->Body = $messagebody;
|
||||
}
|
||||
|
||||
// $mail->AltBody = $altbody;
|
||||
// $mail->AltBody = $altbody;
|
||||
|
||||
if (!$mail->send()) {
|
||||
// echo 'Message could not be sent.';
|
||||
// echo 'Mailer Error: '.$mail->ErrorInfo;
|
||||
} else {
|
||||
// echo 'Message has been sent';
|
||||
if (!$mail->send()) {
|
||||
return null;
|
||||
// echo 'Message could not be sent.';
|
||||
// echo 'Mailer Error: '.$mail->ErrorInfo;
|
||||
} else {
|
||||
return 1;
|
||||
// echo 'Message has been sent';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -257,8 +264,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';
|
||||
@@ -320,8 +326,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;
|
||||
@@ -334,4 +339,5 @@ class PhpMailController extends Controller
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -203,23 +203,30 @@ class InstallController extends Controller
|
||||
$port = Input::get('port');
|
||||
|
||||
// Setting environment values
|
||||
$ENV['APP_ENV'] = 'local';
|
||||
$ENV['APP_DEBUG'] = 'false';
|
||||
$ENV['APP_KEY'] = 'SomeRandomString';
|
||||
$ENV['DB_TYPE'] = $default;
|
||||
$ENV['DB_HOST'] = $host;
|
||||
$ENV['DB_PORT'] = $port;
|
||||
$ENV['DB_DATABASE'] = $database;
|
||||
$ENV['DB_USERNAME'] = $dbusername;
|
||||
$ENV['DB_PASSWORD'] = $dbpassword;
|
||||
$ENV['MAIL_DRIVER'] = 'smtp';
|
||||
$ENV['MAIL_HOST'] = 'mailtrap.io';
|
||||
$ENV['MAIL_PORT'] = '2525';
|
||||
$ENV['MAIL_USERNAME'] = 'null';
|
||||
$ENV['MAIL_PASSWORD'] = 'null';
|
||||
$ENV['CACHE_DRIVER'] = 'file';
|
||||
$ENV['SESSION_DRIVER'] = 'file';
|
||||
$ENV['QUEUE_DRIVER'] = 'sync';
|
||||
// $_ENV['DB_TYPE'] = $default;
|
||||
// $_ENV['DB_HOST'] = $host;
|
||||
// $_ENV['DB_PORT'] = $port;
|
||||
// $_ENV['DB_DATABASE'] = $database;
|
||||
// $_ENV['DB_USERNAME'] = $dbusername;
|
||||
// $_ENV['DB_PASSWORD'] = $dbpassword;
|
||||
|
||||
$ENV['APP_ENV'] = 'local';
|
||||
$ENV['APP_DEBUG'] = 'false';
|
||||
$ENV['APP_KEY'] = 'SomeRandomString';
|
||||
$ENV['DB_TYPE'] = $default;
|
||||
$ENV['DB_HOST'] = $host;
|
||||
$ENV['DB_PORT'] = $port;
|
||||
$ENV['DB_DATABASE'] = $database;
|
||||
$ENV['DB_USERNAME'] = $dbusername;
|
||||
$ENV['DB_PASSWORD'] = $dbpassword;
|
||||
$ENV['MAIL_DRIVER'] = 'smtp';
|
||||
$ENV['MAIL_HOST'] = 'mailtrap.io';
|
||||
$ENV['MAIL_PORT'] = '2525';
|
||||
$ENV['MAIL_USERNAME'] = 'null';
|
||||
$ENV['MAIL_PASSWORD'] = 'null';
|
||||
$ENV['CACHE_DRIVER'] = 'file';
|
||||
$ENV['SESSION_DRIVER'] = 'file';
|
||||
$ENV['QUEUE_DRIVER'] = 'sync';
|
||||
|
||||
$config = '';
|
||||
foreach ($ENV as $key => $val) {
|
||||
|
@@ -26,19 +26,34 @@ class ApiKey
|
||||
public function handle($request, Closure $next)
|
||||
{
|
||||
$set = $this->setting->where('id', '1')->first();
|
||||
if ($set->api_enable == 1) {
|
||||
$key = $set->api_key;
|
||||
if ($key == $request->input('api_key')) {
|
||||
return $next($request);
|
||||
if ($set->api_key_mandatory == 1) {
|
||||
if ($set->api_enable == 1) {
|
||||
$key = $set->api_key;
|
||||
$check = $this->test($key, $request->input('api_key'));
|
||||
if ($check == '1') {
|
||||
return $next($request);
|
||||
}
|
||||
if ($check == '0') {
|
||||
$result = 'wrong api key';
|
||||
|
||||
return response()->json(compact('result'));
|
||||
}
|
||||
} else {
|
||||
$result = 'wrong api key';
|
||||
$result = 'please enable api';
|
||||
|
||||
return response()->json(compact('result'));
|
||||
}
|
||||
} else {
|
||||
$result = 'please enable api';
|
||||
return $next($request);
|
||||
}
|
||||
}
|
||||
|
||||
return response()->json(compact('result'));
|
||||
public function test($v1, $v2)
|
||||
{
|
||||
if ($v1 == $v2) {
|
||||
return '1';
|
||||
} else {
|
||||
return '0';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -32,7 +32,7 @@ class AgentRequest extends Request
|
||||
'user_name' => 'required|unique:users',
|
||||
'first_name' => 'required',
|
||||
'last_name' => 'required',
|
||||
'email' => 'required',
|
||||
'email' => 'required|unique:users',
|
||||
'active' => 'required',
|
||||
// 'account_status' => 'required',
|
||||
'assign_group' => 'required',
|
||||
|
@@ -40,9 +40,9 @@ class EmailsEditRequest extends Request
|
||||
// 'sending_host' => 'required',
|
||||
// 'sending_port' => 'required',
|
||||
//'mailbox_protocol' => 'required'
|
||||
'fetching_host' => 'required',
|
||||
'fetching_port' => 'required',
|
||||
'mailbox_protocol' => 'required',
|
||||
// 'fetching_host' => 'required',
|
||||
// 'fetching_port' => 'required',
|
||||
// 'mailbox_protocol' => 'required',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
@@ -39,9 +39,9 @@ class EmailsRequest extends Request
|
||||
// 'user_name' => 'required',
|
||||
// 'sending_host' => 'required',
|
||||
// 'sending_port' => 'required',
|
||||
'fetching_host' => 'required',
|
||||
'fetching_port' => 'required',
|
||||
'mailbox_protocol' => 'required',
|
||||
// 'fetching_host' => 'required',
|
||||
// 'fetching_port' => 'required',
|
||||
// 'mailbox_protocol' => 'required',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
@@ -180,6 +180,9 @@ Route::group(['middleware' => 'roles', 'middleware' => 'auth'], function () {
|
||||
Route::get('delete-language/{lang}', ['as' => 'lang.delete', 'uses' => 'Admin\helpdesk\LanguageController@deleteLanguage']);
|
||||
|
||||
Route::get('generate-api-key', 'Admin\helpdesk\SettingsController@GenerateApiKey'); // route to generate api key
|
||||
|
||||
Route::post('validating-email-settings', ['as' => 'validating.email.settings', 'uses' => 'Admin\helpdesk\EmailsController@validatingEmailSettings']); // route to check email input validation
|
||||
Route::post('validating-email-settings-on-update/{id}', ['as' => 'validating.email.settings.update', 'uses' => 'Admin\helpdesk\EmailsController@validatingEmailSettingsUpdate']); // route to check email input validation
|
||||
});
|
||||
|
||||
/*
|
||||
@@ -354,7 +357,7 @@ Route::group(['middleware' => 'role.agent', 'middleware' => 'auth'], function ()
|
||||
|
||||
Route::get('/get-parent-tickets/{id}', ['as' => 'get.parent.ticket', 'uses' => 'Agent\helpdesk\TicketController@getParentTickets']);
|
||||
|
||||
Route::patch('/merge-tickets/{id}', 'Agent\helpdesk\TicketController@mergeTickets');
|
||||
Route::patch('/merge-tickets/{id}', ['as' => 'merge.tickets', 'uses' => 'Agent\helpdesk\TicketController@mergeTickets']);
|
||||
|
||||
});
|
||||
|
||||
@@ -633,8 +636,8 @@ Route::group(['prefix' => 'api/v1'], function () {
|
||||
Route::get('customer', 'Api\v1\ApiController@getCustomer');
|
||||
Route::get('ticket-search', 'Api\v1\ApiController@searchTicket');
|
||||
Route::get('ticket-thread', 'Api\v1\ApiController@ticketThreads');
|
||||
Route::get('url', 'Api\v1\ApiController@checkUrl');
|
||||
Route::get('check-url', 'Api\v1\ApiController@urlResult');
|
||||
Route::get('url', 'Api\v1\ApiExceptAuthController@checkUrl');
|
||||
Route::get('check-url', 'Api\v1\ApiExceptAuthController@urlResult');
|
||||
Route::get('api_key', 'Api\v1\ApiController@generateApiKey');
|
||||
Route::get('help-topic', 'Api\v1\ApiController@getHelpTopic');
|
||||
Route::get('sla-plan', 'Api\v1\ApiController@getSlaPlan');
|
||||
@@ -688,7 +691,7 @@ Route::group(['prefix' => 'api/v1'], function () {
|
||||
/*
|
||||
* Newly added
|
||||
*/
|
||||
Route::get('customers-custom', 'Api\v1\TestController@getCustomersWith');
|
||||
Route::get('ticket/customers-custom', 'Api\v1\TestController@getCustomersWith');
|
||||
|
||||
Route::get('generate/token', 'Api\v1\TestController@generateToken');
|
||||
Route::get('get/user', 'Api\v1\TestController@getAuthUser');
|
||||
|
@@ -9,8 +9,8 @@ class Emails extends Model
|
||||
protected $table = 'emails';
|
||||
protected $fillable = [
|
||||
'email_address', 'email_name', 'department', 'priority', 'help_topic',
|
||||
'user_name', 'password', 'fetching_host', 'fetching_port', 'mailbox_protocol',
|
||||
'folder', 'sending_host', 'sending_port', 'sending_encryption', 'internal_notes', 'auto_response',
|
||||
'user_name', 'password', 'fetching_host', 'fetching_port', 'fetching_protocol', 'fetching_encryption', 'mailbox_protocol',
|
||||
'folder', 'sending_host', 'sending_port', 'sending_protocol', 'sending_encryption', 'internal_notes', 'auto_response',
|
||||
'fetching_status', 'move_to_folder', 'delete_email', 'do_nothing',
|
||||
'sending_status', 'authentication', 'header_spoofing', 'imap_config',
|
||||
];
|
||||
|
@@ -12,6 +12,6 @@ class System extends Model
|
||||
protected $fillable = [
|
||||
|
||||
'id', 'status', 'url', 'name', 'department', 'page_size', 'log_level', 'purge_log', 'name_format',
|
||||
'time_farmat', 'date_format', 'date_time_format', 'day_date_time', 'time_zone', 'content', 'api_key', 'api_enable',
|
||||
'time_farmat', 'date_format', 'date_time_format', 'day_date_time', 'time_zone', 'content', 'api_key', 'api_enable', 'api_key_mandatory',
|
||||
];
|
||||
}
|
||||
|
@@ -38,7 +38,7 @@ return [
|
||||
|
|
||||
*/
|
||||
|
||||
'version' => 'Community 1.0.6.5',
|
||||
'version' => 'Community 1.0.6.6',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
@@ -23,11 +23,14 @@ class CreateEmailsTable extends Migration
|
||||
$table->string('password');
|
||||
$table->string('fetching_host');
|
||||
$table->string('fetching_port');
|
||||
$table->string('fetching_protocol');
|
||||
$table->string('fetching_encryption');
|
||||
$table->string('mailbox_protocol');
|
||||
$table->string('imap_config');
|
||||
$table->string('folder');
|
||||
$table->string('sending_host');
|
||||
$table->string('sending_port');
|
||||
$table->string('sending_protocol');
|
||||
$table->string('sending_encryption');
|
||||
$table->string('internal_notes');
|
||||
$table->boolean('auto_response');
|
||||
|
@@ -22,6 +22,7 @@ class CreateSettingsSystemTable extends Migration
|
||||
$table->string('log_level');
|
||||
$table->string('purge_log');
|
||||
$table->integer('api_enable');
|
||||
$table->integer('api_key_mandatory');
|
||||
$table->string('api_key');
|
||||
$table->string('name_format');
|
||||
$table->integer('time_farmat')->unsigned()->nullable()->index('time_farmat');
|
||||
|
0
nbproject/project.properties
Normal file
0
nbproject/project.properties
Normal file
12
nbproject/project.xml
Normal file
12
nbproject/project.xml
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://www.netbeans.org/ns/project/1">
|
||||
<type>org.netbeans.modules.php.project</type>
|
||||
<configuration>
|
||||
<data xmlns="http://www.netbeans.org/ns/php-project/1">
|
||||
<name>laravel</name>
|
||||
</data>
|
||||
<spellchecker-wordlist xmlns="http://www.netbeans.org/ns/spellchecker-wordlist/1">
|
||||
<word>endif</word>
|
||||
</spellchecker-wordlist>
|
||||
</configuration>
|
||||
</project>
|
@@ -6,7 +6,8 @@ $.extend( true, $.fn.dataTable.defaults, {
|
||||
"t"+
|
||||
"<'row'<'col-xs-6'i><'col-xs-6'p>>",
|
||||
"oLanguage": {
|
||||
"sLengthMenu": "_MENU_ records per page"
|
||||
"sLengthMenu": "_MENU_ Records per page",
|
||||
"sSearch" : "Search: "
|
||||
}
|
||||
} );
|
||||
|
||||
|
@@ -87,24 +87,34 @@ return [
|
||||
| Emails Create Page
|
||||
|--------------------------------------
|
||||
*/
|
||||
'emails' => 'Emails',
|
||||
'incoming_emails' => 'Incoming Emails',
|
||||
'reuired_authentication' => 'Reuired Authentication',
|
||||
'fetching_email_via_imap' => 'Fetching Email via IMAP',
|
||||
'create_email' => 'Create Email',
|
||||
'email_address' => 'Email Address',
|
||||
'email_name' => 'Email Name',
|
||||
'help_topic' => 'Help Topic',
|
||||
'auto_response' => 'Auto Response',
|
||||
'host_name' => 'Host Name',
|
||||
'port_number' => 'Port Number',
|
||||
'mail_box_protocol' => 'Mail Box Protocol',
|
||||
'authentication_required' => 'Authentication Required',
|
||||
'yes' => 'Yes',
|
||||
'no' => 'No',
|
||||
'header_spoofing' => 'Header Spoofing',
|
||||
'allow_for_this_email' => 'Allow For This Email',
|
||||
'imap_config' => 'IMAP Configuration',
|
||||
'emails' => 'Emails',
|
||||
'incoming_emails' => 'Incoming Emails',
|
||||
'reuired_authentication' => 'Reuired Authentication',
|
||||
'fetching_email_via_imap' => 'Fetching Email via IMAP',
|
||||
'create_email' => 'Create Email',
|
||||
'email_address' => 'Email Address',
|
||||
'email_name' => 'Email Name',
|
||||
'help_topic' => 'Help Topic',
|
||||
'auto_response' => 'Auto Response',
|
||||
'host_name' => 'Host Name',
|
||||
'port_number' => 'Port Number',
|
||||
'mail_box_protocol' => 'Mail Box Protocol',
|
||||
'authentication_required' => 'Authentication Required',
|
||||
'yes' => 'Yes',
|
||||
'no' => 'No',
|
||||
'header_spoofing' => 'Header Spoofing',
|
||||
'allow_for_this_email' => 'Allow For This Email',
|
||||
'imap_config' => 'IMAP Configuration',
|
||||
'email_information_and_settings' => 'Email Information and Settings',
|
||||
'incoming_email_information' => 'Incoming Email Information',
|
||||
'outgoing_email_information' => 'Outgoing Email Information',
|
||||
'new_ticket_settings' => 'New Ticket Settings',
|
||||
'protocol' => 'Protocol',
|
||||
'fetching_protocol' => 'Fetching Protocol',
|
||||
'transfer_protocol' => 'Transfer Protocol',
|
||||
'from_name' => 'From Name',
|
||||
'add_an_email' => 'Add an Email',
|
||||
'edit_an_email' => 'Edit an Email',
|
||||
/*
|
||||
|--------------------------------------
|
||||
| Ban Emails Create Page
|
||||
@@ -203,6 +213,7 @@ return [
|
||||
'timezone' => 'Default Time Zone',
|
||||
'api' => 'Api',
|
||||
'api_key' => 'Api Key',
|
||||
'api_key_mandatory' => 'Api key mandatory',
|
||||
'api_configurations' => 'Api Configurations',
|
||||
'generate_key' => 'Generate key',
|
||||
/*
|
||||
@@ -443,6 +454,19 @@ return [
|
||||
'footer2' => 'Footer2',
|
||||
'footer3' => 'Footer3',
|
||||
'footer4' => 'Footer4',
|
||||
/*
|
||||
|--------------------------------------
|
||||
| Custom alert box
|
||||
|--------------------------------------
|
||||
*/
|
||||
'ok' => 'Ok',
|
||||
'cancel' => 'Cancel',
|
||||
'select-ticket' => 'Please select tickets.',
|
||||
'confirm' => 'Are you sure?',
|
||||
'delete-tickets' => 'Delete Tickets',
|
||||
'close-tickets' => 'Close Tickets',
|
||||
'open-tickets' => 'Open Tickets',
|
||||
|
||||
/*
|
||||
|----------------------------------------------------------------------------------------
|
||||
| Staff Pages [English(en)]
|
||||
@@ -634,7 +658,7 @@ return [
|
||||
'organization' => 'Organization',
|
||||
'create_organization' => 'Create Organization',
|
||||
'account_manager' => 'Account Manager',
|
||||
'update' => 'update',
|
||||
'update' => 'Update',
|
||||
'please_select_an_organization' => 'Please select an Organization',
|
||||
'please_select_an_user' => 'Please select an user',
|
||||
'organization_profile' => 'Organization Profile',
|
||||
@@ -805,7 +829,7 @@ return [
|
||||
'published' => 'Published',
|
||||
'draft' => 'Draft',
|
||||
'create_a_category' => 'Create a Category',
|
||||
'add' => 'add',
|
||||
'add' => 'Add',
|
||||
'social' => 'Social',
|
||||
'comment' => 'Comment',
|
||||
'not_published' => 'Not Published',
|
||||
|
@@ -16,267 +16,404 @@ class="active"
|
||||
@stop
|
||||
<!-- header -->
|
||||
@section('PageHeader')
|
||||
|
||||
|
||||
<h1>{{Lang::get('lang.add_an_email')}}</h1>
|
||||
@stop
|
||||
<!-- /header -->
|
||||
<!-- breadcrumbs -->
|
||||
@section('breadcrumbs')
|
||||
<ol class="breadcrumb">
|
||||
|
||||
</ol>
|
||||
@stop
|
||||
<!-- /breadcrumbs -->
|
||||
<!-- content -->
|
||||
@section('content')
|
||||
|
||||
<!-- open a form -->
|
||||
|
||||
{!!Form::open(['action'=>'Admin\helpdesk\EmailsController@store','method'=>'POST'])!!}
|
||||
<div class="box box-primary">
|
||||
<div class="box-header">
|
||||
|
||||
<h4 class="box-title">{{Lang::get('lang.create')}}</h4> {!! Form::submit(Lang::get('lang.save'),['class'=>'form-group btn btn-primary pull-right'])!!}
|
||||
|
||||
</div>
|
||||
|
||||
<div class="box-body">
|
||||
|
||||
<div class="row">
|
||||
<!-- email address -->
|
||||
<div class="col-xs-6 form-group {{ $errors->has('email_address') ? 'has-error' : '' }}">
|
||||
|
||||
{!! Form::label('email_address',Lang::get('lang.email_address')) !!}
|
||||
{!! $errors->first('email_address', '<spam class="help-block">:message</spam>') !!}
|
||||
{!! Form::text('email_address',null,['class' => 'form-control']) !!}
|
||||
|
||||
</div>
|
||||
<!-- Email name -->
|
||||
<div class="col-xs-6 form-group {{ $errors->has('email_name') ? 'has-error' : '' }}">
|
||||
|
||||
{!! Form::label('email_name',Lang::get('lang.email_name')) !!}
|
||||
{!! $errors->first('email_name', '<spam class="help-block">:message</spam>') !!}
|
||||
{!! Form::text('email_name',null,['class' => 'form-control']) !!}
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<!-- department -->
|
||||
<div class="col-xs-4 form-group {{ $errors->has('department') ? 'has-error' : '' }}">
|
||||
|
||||
{!! Form::label('department',Lang::get('lang.department')) !!}
|
||||
{!! $errors->first('department', '<spam class="help-block">:message</spam>') !!}
|
||||
{!!Form::select('department', [''=>'--System Default--','departments'=>$departments->lists('name','id')],null,['class' => 'form-control select']) !!}
|
||||
|
||||
</div>
|
||||
<!-- Priority -->
|
||||
<div class="col-xs-4 form-group {{ $errors->has('priority') ? 'has-error' : '' }}">
|
||||
|
||||
{!! Form::label('priority',Lang::get('lang.priority')) !!}
|
||||
{!! $errors->first('priority', '<spam class="help-block">:message</spam>') !!}
|
||||
{!!Form::select('priority', [''=>'--System Default--','Priorities'=>$priority->lists('priority_desc','priority_id')],null,['class' => 'form-control select']) !!}
|
||||
|
||||
</div>
|
||||
<!-- Help topic -->
|
||||
<div class="col-xs-4 form-group {{ $errors->has('help_topic') ? 'has-error' : '' }}">
|
||||
|
||||
{!! Form::label('help_topic',Lang::get('lang.help_topic')) !!}
|
||||
{!! $errors->first('help_topic', '<spam class="help-block">:message</spam>') !!}
|
||||
{!!Form::select('help_topic', [''=>'--System Default--','Help Topics'=>$helps->lists('topic','id')],null,['class' => 'form-control select']) !!}
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-6 form-group">
|
||||
|
||||
<h4>{!! Lang::get('lang.reuired_authentication') !!}</h4>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<!-- password -->
|
||||
<div class="col-xs-6 form-group {{ $errors->has('password') ? 'has-error' : '' }}">
|
||||
|
||||
{!! Form::label('password',Lang::get('lang.password')) !!}
|
||||
{!! $errors->first('password', '<spam class="help-block">:message</spam>') !!}
|
||||
{!! Form::password('password',['class' => 'form-control']) !!}
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-6 form-group">
|
||||
|
||||
<h4>{!! Lang::get('lang.fetching_email_via_imap') !!}</h4>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="form-group">
|
||||
<!-- status -->
|
||||
<div class="col-xs-1 form-group">
|
||||
{!! Form::label('fetching_status',Lang::get('lang.status')) !!}
|
||||
</div>
|
||||
<div class="col-xs-2 form-group">
|
||||
{!! Form::radio('fetching_status','1',true) !!} {{Lang::get('lang.enable')}}
|
||||
</div>
|
||||
<div class="col-xs-2 form-group">
|
||||
{!! Form::radio('fetching_status','0',null) !!} {{Lang::get('lang.disabled')}}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-xs-4 form-group {{ $errors->has('fetching_host') ? 'has-error' : '' }}">
|
||||
|
||||
{!! Form::label('fetching_host',Lang::get('lang.host_name')) !!}
|
||||
{!! $errors->first('fetching_host', '<spam class="help-block">:message</spam>') !!}
|
||||
{!! Form::text('fetching_host',null,['class' => 'form-control']) !!}
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-xs-4 form-group {{ $errors->has('fetching_port') ? 'has-error' : '' }}">
|
||||
|
||||
{!! Form::label('fetching_port',Lang::get('lang.port_number')) !!}
|
||||
{!! $errors->first('fetching_port', '<spam class="help-block">:message</spam>') !!}
|
||||
{!! Form::text('fetching_port',null,['class' => 'form-control']) !!}
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-xs-4 form-group {{ $errors->has('mailbox_protocol') ? 'has-error' : '' }}">
|
||||
|
||||
{!! Form::label('mailbox_protocol',Lang::get('lang.mail_box_protocol')) !!}
|
||||
{!! $errors->first('mailbox_protocol', '<spam class="help-block">:message</spam>') !!}
|
||||
{!!Form::select('mailbox_protocol',['Mailbox Protocols'=>$mailbox_protocols->lists('name','id')],null,['class' => 'form-control select']) !!}
|
||||
|
||||
</div>
|
||||
<!-- imap config -->
|
||||
{{-- <div class="col-md-6 form-group {{ $errors->has('imap_config') ? 'has-error' : '' }}">
|
||||
|
||||
{!! Form::label('imap_config',Lang::get('lang.imap_config')) !!}
|
||||
{!! $errors->first('imap_config', '<spam class="help-block">:message</spam>') !!}
|
||||
{!! Form::text('imap_config',null,['class' => 'form-control']) !!}
|
||||
|
||||
</div> --}}
|
||||
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-6 form-group">
|
||||
|
||||
<h4>Sending Email via SMTP</h4>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<!-- status -->
|
||||
<div class="form-group">
|
||||
|
||||
<div class="col-xs-1 form-group">
|
||||
{!! Form::label('sending_status',Lang::get('lang.status')) !!}
|
||||
</div>
|
||||
<div class="col-xs-2 form-group">
|
||||
{!! Form::radio('sending_status','1',true) !!} {{Lang::get('lang.enable')}}
|
||||
</div>
|
||||
<div class="col-xs-2 form-group">
|
||||
{!! Form::radio('sending_status','0',null) !!} {{Lang::get('lang.disabled')}}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<!-- sending hoost -->
|
||||
<div class="col-xs-4 form-group {{ $errors->has('sending_host') ? 'has-error' : '' }}">
|
||||
|
||||
{!! Form::label('sending_host',Lang::get('lang.host_name')) !!}
|
||||
{!! $errors->first('sending_host', '<spam class="help-block">:message</spam>') !!}
|
||||
{!! Form::text('sending_host',null,['class' => 'form-control']) !!}
|
||||
|
||||
</div>
|
||||
<!-- sending port -->
|
||||
<div class="col-xs-4 form-group {{ $errors->has('sending_port') ? 'has-error' : '' }}">
|
||||
|
||||
{!! Form::label('sending_port',Lang::get('lang.port_number')) !!}
|
||||
{!! $errors->first('sending_port', '<spam class="help-block">:message</spam>') !!}
|
||||
{!! Form::text('sending_port',null,['class' => 'form-control']) !!}
|
||||
|
||||
</div>
|
||||
<!-- Encryption -->
|
||||
<div class="col-xs-4 form-group {{ $errors->has('sending_encryption') ? 'has-error' : '' }}">
|
||||
|
||||
{!! Form::label('sending_encryption',Lang::get('lang.encryption')) !!}
|
||||
{!! $errors->first('sending_encryption', '<spam class="help-block">:message</spam>') !!}
|
||||
{!!Form::select('sending_encryption',['ssl'=>'SSL','tls'=>'TLS'],null,['class' => 'form-control select']) !!}
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- <div class="row"> -->
|
||||
<!-- authentication required -->
|
||||
<!-- <div class="form-group"> -->
|
||||
|
||||
<!-- <div class="col-xs-2 form-group"> -->
|
||||
<!-- {!! Form::label('authentication',Lang::get('lang.authentication_required')) !!} -->
|
||||
<!-- </div> -->
|
||||
<!-- <div class="col-xs-2 form-group"> -->
|
||||
<!-- {!! Form::radio('authentication','1',true) !!} {{Lang::get('lang.enable')}} -->
|
||||
<!-- </div> -->
|
||||
<!-- <div class="col-xs-2 form-group"> -->
|
||||
<!-- {!! Form::radio('authentication','0',null) !!} {{Lang::get('lang.disabled')}} -->
|
||||
<!-- </div> -->
|
||||
|
||||
<!-- </div> -->
|
||||
|
||||
<!-- <div class="form-group"> -->
|
||||
<!-- header snoofing -->
|
||||
<!-- <div class="col-xs-2"> -->
|
||||
|
||||
<!-- // {!! Form::label('',Lang::get('lang.header_spoofing')) !!} -->
|
||||
<!-- // {!! Form::checkbox('header_spoofing',1,null,['class' => 'checkbox']) !!} -->
|
||||
|
||||
<!-- </div> -->
|
||||
|
||||
<!-- </div> -->
|
||||
|
||||
<!-- </div> -->
|
||||
<!-- Internal notes -->
|
||||
<div class="form-group">
|
||||
|
||||
{!! Form::label('internal_notes',Lang::get('lang.internal_notes')) !!}
|
||||
{!! Form::textarea('internal_notes',null,['class' => 'form-control','size' => '30x5']) !!}
|
||||
|
||||
</div>
|
||||
|
||||
{!!Form::close()!!}
|
||||
|
||||
<form id="form">
|
||||
<input type="hidden" name="_token" value="{{ csrf_token() }}">
|
||||
<div class="box box-primary">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">{!! Lang::get('lang.email_information_and_settings') !!}</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<div id="alert" style="display:none;">
|
||||
<div class="alert alert-danger alert-dismissable">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||
<div id="alert-message"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<div class="row">
|
||||
<!-- email address -->
|
||||
<div class="col-xs-4 form-group {!! $errors->has('email_address') ? 'has-error' : '' !!}" id = "email_address_error">
|
||||
{!! Form::label('email_address',Lang::get('lang.email_address')) !!}
|
||||
{!! $errors->first('email_address', '<spam class="help-block">:message</spam>') !!}
|
||||
{!! Form::text('email_address',null,['class' => 'form-control', 'id' => 'email_address']) !!}
|
||||
</div>
|
||||
<!-- Email name -->
|
||||
<div class="col-xs-4 form-group {!! $errors->has('email_name') ? 'has-error' : ''!!}" id="email_name_error">
|
||||
{!! Form::label('email_name',Lang::get('lang.from_name')) !!}
|
||||
{!! $errors->first('email_name', '<spam class="help-block">:message</spam>') !!}
|
||||
{!! Form::text('email_name',null,['class' => 'form-control', 'id' => 'email_name']) !!}
|
||||
</div>
|
||||
<!-- password -->
|
||||
<div class="col-xs-4 form-group {!! $errors->has('password') ? 'has-error' : ''!!}" id="password_error">
|
||||
{!! Form::label('password',Lang::get('lang.password')) !!}
|
||||
{!! $errors->first('password', '<spam class="help-block">:message</spam>') !!}
|
||||
{!! Form::password('password',['class' => 'form-control', 'id' => 'password']) !!}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">{!! Lang::get('lang.new_ticket_settings') !!}</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<div class="row">
|
||||
<!-- department -->
|
||||
<div class="col-xs-4 form-group {!! $errors->has('department') ? 'has-error' : ''!!}" id="department_error">
|
||||
{!! Form::label('department',Lang::get('lang.department')) !!}
|
||||
{!! $errors->first('department', '<spam class="help-block">:message</spam>') !!}
|
||||
{!!Form::select('department', [''=>'--System Default--','departments'=>$departments->lists('name','id')],null,['class' => 'form-control select', 'id' => 'department' ]) !!}
|
||||
</div>
|
||||
<!-- Priority -->
|
||||
<div class="col-xs-4 form-group {!! $errors->has('priority') ? 'has-error' : ''!!}" id="priority_error">
|
||||
{!! Form::label('priority',Lang::get('lang.priority')) !!}
|
||||
{!! $errors->first('priority', '<spam class="help-block">:message</spam>') !!}
|
||||
{!!Form::select('priority', [''=>'--System Default--','Priorities'=>$priority->lists('priority_desc','priority_id')],null,['class' => 'form-control select', 'id' => 'priority']) !!}
|
||||
</div>
|
||||
<!-- Help topic -->
|
||||
<div class="col-xs-4 form-group {!! $errors->has('help_topic') ? 'has-error' : ''!!}" id="help_topic_error">
|
||||
{!! Form::label('help_topic',Lang::get('lang.help_topic')) !!}
|
||||
{!! $errors->first('help_topic', '<spam class="help-block">:message</spam>') !!}
|
||||
{!!Form::select('help_topic', [''=>'--System Default--','Help Topics'=>$helps->lists('topic','id')],null,['class' => 'form-control select', 'id' => 'help_topic']) !!}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">{!! Lang::get('lang.incoming_email_information') !!}</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<div class="row">
|
||||
<div class="form-group">
|
||||
<!-- status -->
|
||||
<div class="col-xs-1 form-group">
|
||||
{!! Form::label('fetching_status',Lang::get('lang.status')) !!}
|
||||
</div>
|
||||
<div class="col-xs-2 form-group">
|
||||
<!--{!! Form::radio('fetching_status','1',true) !!} {{Lang::get('lang.enable')}}-->
|
||||
<input type="checkbox" name="fetching_status" id="fetching_status"> {{Lang::get('lang.enable')}}
|
||||
</div>
|
||||
<div class="col-xs-2 form-group">
|
||||
<!--<input type="radio" name="fetching_status" id="fetching_status" value="0"> {{Lang::get('lang.disabled')}}-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-3 form-group {!! $errors->has('fetching_protocol') ? 'has-error' : ''!!}" id="fetching_protocol_error">
|
||||
{!! Form::label('fetching_protocol',Lang::get('lang.fetching_protocol')) !!}
|
||||
{!! $errors->first('fetching_protocol', '<spam class="help-block">:message</spam>') !!}
|
||||
{!!Form::select('fetching_protocol',['imap' => 'IMAP'],null,['class' => 'form-control select', 'id' => 'fetching_protocol']) !!}
|
||||
</div>
|
||||
<div class="col-xs-3 form-group {!! $errors->has('fetching_host') ? 'has-error' : ''!!}" id="fetching_host_error">
|
||||
{!! Form::label('fetching_host',Lang::get('lang.host_name')) !!}
|
||||
{!! $errors->first('fetching_host', '<spam class="help-block">:message</spam>') !!}
|
||||
{!! Form::text('fetching_host',null,['class' => 'form-control', 'id' => 'fetching_host']) !!}
|
||||
</div>
|
||||
<div class="col-xs-3 form-group {!! $errors->has('fetching_port') ? 'has-error' : ''!!}" id="fetching_port_error">
|
||||
{!! Form::label('fetching_port',Lang::get('lang.port_number')) !!}
|
||||
{!! $errors->first('fetching_port', '<spam class="help-block">:message</spam>') !!}
|
||||
{!! Form::text('fetching_port',null,['class' => 'form-control', 'id' => 'fetching_port']) !!}
|
||||
</div>
|
||||
<div class="col-xs-3 form-group {!! $errors->has('fetching_encryption') ? 'has-error' : ''!!}" id="fetching_encryption_error">
|
||||
{!! Form::label('fetching_encryption',Lang::get('lang.encryption')) !!}
|
||||
{!! $errors->first('fetching_encryption', '<spam class="help-block">:message</spam>') !!}
|
||||
{!!Form::select('fetching_encryption',['none' => 'None', 'ssl' => 'SSL', 'tls' => 'TLS', 'ssl/novalidate-cert' => 'SSL (Accept all certificates)', 'tls/novalidate-cert' => 'TLS (Accept all certificates)'],null,['class' => 'form-control select', 'id' => 'fetching_encryption']) !!}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">{!! Lang::get('lang.outgoing_email_information') !!}</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<div class="row">
|
||||
<!-- status -->
|
||||
<div class="form-group">
|
||||
<div class="col-xs-1 form-group">
|
||||
{!! Form::label('sending_status',Lang::get('lang.status')) !!}
|
||||
</div>
|
||||
<div class="col-xs-2 form-group">
|
||||
<input type="checkbox" name="sending_status" id="sending_status"> {!! Lang::get('lang.enable') !!}
|
||||
</div>
|
||||
<div class="col-xs-2 form-group">
|
||||
<!--<input type="radio" name="sending_status" id="sending_status" value=""> {!! Lang::get('lang.disabled') !!}-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<!-- Encryption -->
|
||||
<div class="col-xs-3 form-group {!! $errors->has('sending_protocol') ? 'has-error' : ''!!}" id="sending_protocol_error">
|
||||
{!! Form::label('sending_protocol',Lang::get('lang.transfer_protocol')) !!}
|
||||
{!! $errors->first('sending_protocol', '<spam class="help-block">:message</spam>') !!}
|
||||
{!!Form::select('sending_protocol',['smtp'=>'SMTP'],null,['class' => 'form-control select']) !!}
|
||||
</div>
|
||||
<!-- sending hoost -->
|
||||
<div class="col-xs-3 form-group {!! $errors->has('sending_host') ? 'has-error' : ''!!}" id="sending_host_error">
|
||||
{!! Form::label('sending_host',Lang::get('lang.host_name')) !!}
|
||||
{!! $errors->first('sending_host', '<spam class="help-block">:message</spam>') !!}
|
||||
{!! Form::text('sending_host',null,['class' => 'form-control']) !!}
|
||||
</div>
|
||||
<!-- sending port -->
|
||||
<div class="col-xs-3 form-group {!! $errors->has('sending_port') ? 'has-error' : ''!!}" id="sending_port_error">
|
||||
{!! Form::label('sending_port',Lang::get('lang.port_number')) !!}
|
||||
{!! $errors->first('sending_port', '<spam class="help-block">:message</spam>') !!}
|
||||
{!! Form::text('sending_port',null,['class' => 'form-control']) !!}
|
||||
</div>
|
||||
<!-- Encryption -->
|
||||
<div class="col-xs-3 form-group {!! $errors->has('sending_encryption') ? 'has-error' : ''!!}" id="sending_encryption_error">
|
||||
{!! Form::label('sending_encryption',Lang::get('lang.encryption')) !!}
|
||||
{!! $errors->first('sending_encryption', '<spam class="help-block">:message</spam>') !!}
|
||||
{!!Form::select('sending_encryption',['ssl'=>'SSL','tls'=>'TLS'],null,['class' => 'form-control select']) !!}
|
||||
</div>
|
||||
</div>
|
||||
<!-- Internal notes -->
|
||||
<div class="form-group">
|
||||
{!! Form::label('internal_notes',Lang::get('lang.internal_notes')) !!}
|
||||
{!! Form::textarea('internal_notes',null,['class' => 'form-control','size' => '30x10']) !!}
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-footer">
|
||||
{!! Form::button('<i id="spin" class="fa fa-spinner" style="display:none;"></i> <b>' . Lang::get("lang.create").'</b>' ,['class'=>'btn btn-primary', 'type' => 'submit'])!!}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="modal fade" id="loadingpopup" style="padding:200px;">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<div id="head">
|
||||
<button type="button" class="close" id="close" data-dismiss="modal" aria-label="Close" style="display:none;"><span aria-hidden="true">×</span></button>
|
||||
<div class="col-md-5"></div><div class="col-md-2"><img src="{{asset("lb-faveo/media/images/gifloader.gif")}}" ></div><div class="col-md-5"></div>
|
||||
<br/>
|
||||
<br/>
|
||||
<br/>
|
||||
<center><h3 style="color:#80DE02;">Testing incoming & outgoing mail server</h3></center>
|
||||
<br/>
|
||||
<center><h4>Please wait while testing is in progress ...</h4></center>
|
||||
<center><h4>(Please do not use "Refresh" or "Back" button)</h4></center>
|
||||
<br/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
||||
|
||||
<button style="display:none" data-toggle="modal" data-target="#loadingpopup" id="click"></button>
|
||||
|
||||
<script type="text/javascript">
|
||||
//submit form
|
||||
$('#form').on('submit', function () {
|
||||
var form_data = $(this).serialize();
|
||||
$("#spin").addClass("fa-spin");
|
||||
var email_address = document.getElementById('email_address').value;
|
||||
var email_name = document.getElementById('email_name').value;
|
||||
var department = document.getElementById('department').value;
|
||||
var priority = document.getElementById('priority').value;
|
||||
var help_topic = document.getElementById('help_topic').value;
|
||||
var password = document.getElementById('password').value;
|
||||
var fetching_status = $('input#fetching_status[type="checkbox"]:checked', this).val();
|
||||
var fetching_protocol = document.getElementById('fetching_protocol').value;
|
||||
var fetching_host = document.getElementById('fetching_host').value;
|
||||
var fetching_port = document.getElementById('fetching_port').value;
|
||||
var fetching_encryption = document.getElementById('fetching_encryption').value;
|
||||
var sending_status = $('input#sending_status[type="checkbox"]:checked', this).val();
|
||||
var sending_protocol = document.getElementById('sending_protocol').value;
|
||||
var sending_host = document.getElementById('sending_host').value;
|
||||
var sending_port = document.getElementById('sending_port').value;
|
||||
var sending_encryption = document.getElementById('sending_encryption').value;
|
||||
|
||||
|
||||
var filter_number = /^([0-9])/;
|
||||
var error_list = [];
|
||||
var error = "";
|
||||
// checking for validation of email
|
||||
if (email_address) {
|
||||
var filter_email = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
|
||||
if (!filter_email.test(email_address)) {
|
||||
var error = "Please provide a valid email address";
|
||||
error_list.push(error);
|
||||
$("#email_address_error").addClass("has-error");
|
||||
}
|
||||
} else if (email_address == "") {
|
||||
var error = "Email Address is a required field";
|
||||
error_list.push(error);
|
||||
$("#email_address_error").addClass("has-error");
|
||||
}
|
||||
// checking for validation of email name
|
||||
if (email_name == "") {
|
||||
var error = "Email Name is a required field";
|
||||
error_list.push(error);
|
||||
$("#email_name_error").addClass("has-error");
|
||||
}
|
||||
// checking for validation of department
|
||||
if (department == "") {
|
||||
} else if (department) {
|
||||
if (!filter_number.test(department)) {
|
||||
var error = "Please provide a valid department";
|
||||
error_list.push(error);
|
||||
$("#department_error").addClass("has-error");
|
||||
}
|
||||
}
|
||||
// checking for validation of priority
|
||||
if (priority == "") {
|
||||
} else if (priority) {
|
||||
if (!filter_number.test(priority)) {
|
||||
var error = "Please provide a valid priority";
|
||||
error_list.push(error);
|
||||
$("#priority_error").addClass("has-error");
|
||||
}
|
||||
}
|
||||
// checking for validation of help topic
|
||||
if (help_topic == "") {
|
||||
} else if (priority) {
|
||||
if (!filter_number.test(priority)) {
|
||||
var error = "Please provide a valid priority";
|
||||
error_list.push(error);
|
||||
$("#priority_error").addClass("has-error");
|
||||
}
|
||||
}
|
||||
// checking for validation of password
|
||||
if (password == "") {
|
||||
var error = "Password is a required field";
|
||||
error_list.push(error);
|
||||
$("#password_error").addClass("has-error");
|
||||
}
|
||||
// checking for validation of fetching host
|
||||
if (fetching_status == 'on') {
|
||||
if (fetching_host == "") {
|
||||
var error = "Fetching Host is a required field";
|
||||
error_list.push(error);
|
||||
$("#fetching_host_error").addClass("has-error");
|
||||
}
|
||||
// checking for validation of fetching port
|
||||
if (fetching_port == "") {
|
||||
var error = "Fetching Port is a required field";
|
||||
error_list.push(error);
|
||||
$("#fetching_port_error").addClass("has-error");
|
||||
}
|
||||
// checking for validation of mailbox protocol
|
||||
if (fetching_encryption == "") {
|
||||
var error = "Fetching Encryption is a required field";
|
||||
error_list.push(error);
|
||||
$("#fetching_encryption_error").addClass("has-error");
|
||||
}
|
||||
// checking for validation of mailbox protocol
|
||||
if (fetching_protocol == "") {
|
||||
var error = "Fetching Protocol is a required field";
|
||||
error_list.push(error);
|
||||
$("#fetching_protocol_error").addClass("has-error");
|
||||
}
|
||||
|
||||
} else {
|
||||
// checking for validation of fetching port
|
||||
if (fetching_port) {
|
||||
if (!filter_number.test(fetching_port)) {
|
||||
var error = "The Fetching Port Number must be an integer";
|
||||
error_list.push(error);
|
||||
$("#fetching_port_error").addClass("has-error");
|
||||
}
|
||||
}
|
||||
}
|
||||
// checking for validation of sending status
|
||||
if (sending_status == 'on') {
|
||||
// checking for validation of sending host
|
||||
if (sending_host == "") {
|
||||
var error = "Sending Host is a required field";
|
||||
error_list.push(error);
|
||||
$("#sending_host_error").addClass("has-error");
|
||||
}
|
||||
// checking for validation of sending port
|
||||
if (sending_port == "") {
|
||||
var error = "Sending Port is a required field";
|
||||
error_list.push(error);
|
||||
$("#sending_port_error").addClass("has-error");
|
||||
}
|
||||
// checking for validation of sending encryption
|
||||
if (sending_encryption == "") {
|
||||
var error = "Sending Encryption is a required field";
|
||||
error_list.push(error);
|
||||
$("#sending_encryption_error").addClass("has-error");
|
||||
}
|
||||
// checking for validation of sending protocol
|
||||
if (sending_protocol == "") {
|
||||
var error = "Transfer Protocol is a required field";
|
||||
error_list.push(error);
|
||||
$("#sending_protocol_error").addClass("has-error");
|
||||
}
|
||||
} else {
|
||||
// checking for validation of fetching port
|
||||
if (sending_port) {
|
||||
if (!filter_number.test(sending_port)) {
|
||||
var error = "The Sending Port Number must be an integer";
|
||||
error_list.push(error);
|
||||
$("#sending_port_error").addClass("has-error");
|
||||
}
|
||||
}
|
||||
}
|
||||
// executing error chatch
|
||||
if (error) {
|
||||
var ssss = "";
|
||||
$.each(error_list, function (key, value) {
|
||||
ssss += "<li class='error-message-padding'>" + value + "</li>";
|
||||
});
|
||||
if (ssss) {
|
||||
var error_result = "<div class='alert alert-danger alert-dismissable'> <i class='fa fa-ban'> </i> <b> Alert!</b><button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×</button><div id='alert-message'>" + ssss + "</div></div>";
|
||||
$('#alert').empty();
|
||||
$('#alert').html(error_result);
|
||||
$('#alert').show();
|
||||
$("#spin").removeClass("fa-spin");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Ajax communicating to backend for further Checking/Saving the details
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "{!! route('validating.email.settings') !!}",
|
||||
dataType: "html",
|
||||
data: form_data,
|
||||
headers: {
|
||||
'X-CSRF-Token': $('meta[name="_token"]').attr('content')
|
||||
},
|
||||
beforeSend: function () {
|
||||
$('#alert').empty();
|
||||
$("#click").trigger("click");
|
||||
|
||||
},
|
||||
success: function (response) {
|
||||
if (response == 1) {
|
||||
$("#close").trigger("click");
|
||||
var error_result = "<div class='alert alert-success alert-dismissable'> <button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×</button><div id='alert-message'>Your details saved successfully</div></div>";
|
||||
$('#alert').html(error_result);
|
||||
$('#alert').show();
|
||||
} else {
|
||||
$("#close").trigger("click");
|
||||
var error_result = "<div class='alert alert-danger alert-dismissable'> <i class='fa fa-ban'> </i> <b> Alert!</b><button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×</button><div id='alert-message'>" + response + "</div></div>";
|
||||
$('#alert').html(error_result);
|
||||
$('#alert').show();
|
||||
}
|
||||
},
|
||||
error: function (response) {
|
||||
$("#close").trigger("click");
|
||||
var errorsHtml = "<div class='alert alert-danger alert-dismissable'> <i class='fa fa-ban'> </i> <b> Alert!</b><button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×</button><div id='alert-message'>Unable to process the details </div></div>";
|
||||
$('#alert').empty();
|
||||
$('#alert').html(errorsHtml);
|
||||
$('#alert').show();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
</script>
|
||||
@stop
|
@@ -16,7 +16,7 @@ class="active"
|
||||
@stop
|
||||
<!-- header -->
|
||||
@section('PageHeader')
|
||||
|
||||
<h1>{{Lang::get('lang.edit_an_email')}}</h1>
|
||||
|
||||
@stop
|
||||
<!-- /header -->
|
||||
@@ -31,226 +31,406 @@ class="active"
|
||||
@section('content')
|
||||
|
||||
<!-- open a form -->
|
||||
|
||||
{!!Form::model($emails,['url'=>'emails/'.$emails->id,'method'=>'PATCH'])!!}
|
||||
<div class="box box-primary">
|
||||
<div class="box-header">
|
||||
|
||||
<h4 class="box-title">{{Lang::get('lang.create')}}</h4> {!! Form::submit(Lang::get('lang.save'),['class'=>'form-group btn btn-primary pull-right'])!!}
|
||||
|
||||
</div>
|
||||
|
||||
<div class="box-body">
|
||||
|
||||
<div class="row">
|
||||
<!-- email address -->
|
||||
<div class="col-xs-6 form-group {{ $errors->has('email_address') ? 'has-error' : '' }}">
|
||||
|
||||
{!! Form::label('email_address',Lang::get('lang.email_address')) !!}
|
||||
{!! $errors->first('email_address', '<spam class="help-block">:message</spam>') !!}
|
||||
{!! Form::text('email_address',null,['disabled'=>'disabled','class' => 'form-control']) !!}
|
||||
|
||||
</div>
|
||||
<!-- email name -->
|
||||
<div class="col-xs-6 form-group {{ $errors->has('email_name') ? 'has-error' : '' }}">
|
||||
|
||||
{!! Form::label('email_name',Lang::get('lang.email_name')) !!}
|
||||
{!! $errors->first('email_name', '<spam class="help-block">:message</spam>') !!}
|
||||
{!! Form::text('email_name',null,['class' => 'form-control']) !!}
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<!-- department -->
|
||||
<div class="col-xs-4 form-group {{ $errors->has('department') ? 'has-error' : '' }}">
|
||||
|
||||
{!! Form::label('department',Lang::get('lang.department')) !!}
|
||||
{!! $errors->first('department', '<spam class="help-block">:message</spam>') !!}
|
||||
{!!Form::select('department', [''=>'--System Default--','departments'=>$departments->lists('name','id')],null,['class' => 'form-control select']) !!}
|
||||
|
||||
</div>
|
||||
<!-- priority -->
|
||||
<div class="col-xs-4 form-group {{ $errors->has('priority') ? 'has-error' : '' }}">
|
||||
|
||||
{!! Form::label('priority',Lang::get('lang.priority')) !!}
|
||||
{!! $errors->first('priority', '<spam class="help-block">:message</spam>') !!}
|
||||
{!!Form::select('priority', [''=>'--System Default--','Priorities'=>$priority->lists('priority_desc','priority_id')],null,['class' => 'form-control select']) !!}
|
||||
|
||||
</div>
|
||||
<!-- help topic -->
|
||||
<div class="col-xs-4 form-group {{ $errors->has('help_topic') ? 'has-error' : '' }}">
|
||||
|
||||
{!! Form::label('help_topic',Lang::get('lang.help_topic')) !!}
|
||||
{!! $errors->first('help_topic', '<spam class="help-block">:message</spam>') !!}
|
||||
{!!Form::select('help_topic', [''=>'--System Default--','Help Topics'=>$helps->lists('topic','id')],null,['class' => 'form-control select']) !!}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- auto response -->
|
||||
{{-- <div class="form-group"> --}}
|
||||
|
||||
{{-- {!! Form::label('',Lang::get('lang.auto_response')) !!} --}}
|
||||
{{-- <div class="col-xs-1"> --}}
|
||||
{{-- {!! Form::checkbox('auto_response',1,null,['class' => 'checkbox']) !!} --}}
|
||||
{{-- </div> --}}
|
||||
{{-- </div> --}}
|
||||
<hr>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-6 form-group">
|
||||
|
||||
<h4>{!! Lang::get('lang.reuired_authentication') !!}</h4>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<!-- password -->
|
||||
<div class="col-xs-6 form-group {{ $errors->has('password') ? 'has-error' : '' }}">
|
||||
|
||||
{!! Form::label('password',Lang::get('lang.password')) !!}
|
||||
{!! $errors->first('password', '<spam class="help-block">:message</spam>') !!}
|
||||
<input type="password" name="password" value="<?php echo Crypt::decrypt($emails->password); ?>" class="form-control" >
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-6 form-group">
|
||||
|
||||
<h4>{!! Lang::get('lang.fetching_email_via_imap') !!}</h4>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="form-group">
|
||||
<!-- status -->
|
||||
<div class="col-xs-1 form-group">
|
||||
{!! Form::label('fetching_status',Lang::get('lang.status')) !!}
|
||||
</div>
|
||||
<div class="col-xs-2 form-group">
|
||||
{!! Form::radio('fetching_status','1',true) !!} {{Lang::get('lang.enable')}}
|
||||
</div>
|
||||
<div class="col-xs-2 form-group">
|
||||
{!! Form::radio('fetching_status','0',null) !!} {{Lang::get('lang.disabled')}}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-xs-4 form-group">
|
||||
|
||||
{!! Form::label('fetching_host',Lang::get('lang.host_name')) !!}
|
||||
{!! Form::text('fetching_host',null,['class' => 'form-control']) !!}
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-xs-4 form-group">
|
||||
|
||||
{!! Form::label('fetching_port',Lang::get('lang.port_number')) !!}
|
||||
{!! Form::text('fetching_port',null,['class' => 'form-control']) !!}
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-xs-4 form-group {{ $errors->has('mailbox_protocol') ? 'has-error' : '' }}">
|
||||
|
||||
{!! Form::label('mailbox_protocol',Lang::get('lang.mail_box_protocol')) !!}
|
||||
{!! $errors->first('mailbox_protocol', '<spam class="help-block">:message</spam>') !!}
|
||||
{!!Form::select('mailbox_protocol',['Mailbox Protocols'=>$mailbox_protocols->lists('name','id')],null,['class' => 'form-control select']) !!}
|
||||
|
||||
</div>
|
||||
<!-- imap config -->
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-6 form-group">
|
||||
|
||||
<h4>Sending Email via SMTP</h4>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<!-- status -->
|
||||
<div class="form-group">
|
||||
|
||||
<div class="col-xs-1 form-group">
|
||||
{!! Form::label('sending_status',Lang::get('lang.status')) !!}
|
||||
</div>
|
||||
<div class="col-xs-2 form-group">
|
||||
{!! Form::radio('sending_status','1',true) !!} {{Lang::get('lang.enable')}}
|
||||
</div>
|
||||
<div class="col-xs-2 form-group">
|
||||
{!! Form::radio('sending_status','0',null) !!} {{Lang::get('lang.disabled')}}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<!-- sending hoost -->
|
||||
<div class="col-xs-4 form-group {{ $errors->has('sending_host') ? 'has-error' : '' }}">
|
||||
|
||||
{!! Form::label('sending_host',Lang::get('lang.host_name')) !!}
|
||||
{!! $errors->first('sending_host', '<spam class="help-block">:message</spam>') !!}
|
||||
{!! Form::text('sending_host',null,['class' => 'form-control']) !!}
|
||||
|
||||
</div>
|
||||
|
||||
<!-- sending port -->
|
||||
<div class="col-xs-4 form-group {{ $errors->has('sending_port') ? 'has-error' : '' }}">
|
||||
|
||||
{!! Form::label('sending_port',Lang::get('lang.port_number')) !!}
|
||||
{!! $errors->first('sending_port', '<spam class="help-block">:message</spam>') !!}
|
||||
{!! Form::text('sending_port',null,['class' => 'form-control']) !!}
|
||||
|
||||
</div>
|
||||
|
||||
<!-- Encryption -->
|
||||
<div class="col-xs-4 form-group {{ $errors->has('sending_encryption') ? 'has-error' : '' }}">
|
||||
|
||||
{!! Form::label('sending_encryption',Lang::get('lang.encryption')) !!}
|
||||
{!! $errors->first('sending_encryption', '<spam class="help-block">:message</spam>') !!}
|
||||
{!!Form::select('sending_encryption',['ssl'=>'SSL','tls'=>'TLS'],null,['class' => 'form-control select']) !!}
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<!-- internal notes -->
|
||||
<div class="form-group">
|
||||
|
||||
{!! Form::label('internal_notes',Lang::get('lang.internal_notes')) !!}
|
||||
{!! Form::textarea('internal_notes',null,['class' => 'form-control','size' => '30x5']) !!}
|
||||
|
||||
</div>
|
||||
|
||||
{!!Form::close()!!}
|
||||
|
||||
{!!Form::model($emails,['url'=>'','id'=>'form'])!!}
|
||||
<input type="hidden" name="_token" value="{{ csrf_token() }}">
|
||||
<div class="box box-primary">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">{!! Lang::get('lang.email_information_and_settings') !!}</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<div id="alert" style="display:none;">
|
||||
<div class="alert alert-danger alert-dismissable">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||
<div id="alert-message"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<div class="row">
|
||||
<!-- email address -->
|
||||
<div class="col-xs-4 form-group {{ $errors->has('email_address') ? 'has-error' : '' }}" id="email_address_error">
|
||||
|
||||
{!! Form::label('email_address',Lang::get('lang.email_address')) !!}
|
||||
{!! $errors->first('email_address', '<spam class="help-block">:message</spam>') !!}
|
||||
{!! Form::text('email_address',null,['class' => 'form-control']) !!}
|
||||
|
||||
</div>
|
||||
<!-- Email name -->
|
||||
<div class="col-xs-4 form-group {!! $errors->has('email_name') ? 'has-error' : ''!!}" id="email_name_error">
|
||||
{!! Form::label('email_name',Lang::get('lang.from_name')) !!}
|
||||
{!! $errors->first('email_name', '<spam class="help-block">:message</spam>') !!}
|
||||
{!! Form::text('email_name',null,['class' => 'form-control', 'id' => 'email_name']) !!}
|
||||
</div>
|
||||
<!-- password -->
|
||||
<div class="col-xs-4 form-group {!! $errors->has('password') ? 'has-error' : ''!!}" id="password_error">
|
||||
{!! Form::label('password',Lang::get('lang.password')) !!}
|
||||
{!! $errors->first('password', '<spam class="help-block">:message</spam>') !!}
|
||||
<input type="password" name="password" class="form-control" id="password" value={!! Crypt::decrypt($emails->password) !!} >
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">{!! Lang::get('lang.new_ticket_settings') !!}</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<div class="row">
|
||||
<!-- department -->
|
||||
<div class="col-xs-4 form-group {{ $errors->has('department') ? 'has-error' : '' }}">
|
||||
|
||||
{!! Form::label('department',Lang::get('lang.department')) !!}
|
||||
{!! $errors->first('department', '<spam class="help-block">:message</spam>') !!}
|
||||
{!!Form::select('department', [''=>'--System Default--','departments'=>$departments->lists('name','id')],null,['class' => 'form-control select']) !!}
|
||||
|
||||
</div>
|
||||
<!-- priority -->
|
||||
<div class="col-xs-4 form-group {{ $errors->has('priority') ? 'has-error' : '' }}">
|
||||
|
||||
{!! Form::label('priority',Lang::get('lang.priority')) !!}
|
||||
{!! $errors->first('priority', '<spam class="help-block">:message</spam>') !!}
|
||||
{!!Form::select('priority', [''=>'--System Default--','Priorities'=>$priority->lists('priority_desc','priority_id')],null,['class' => 'form-control select']) !!}
|
||||
|
||||
</div>
|
||||
<!-- help topic -->
|
||||
<div class="col-xs-4 form-group {{ $errors->has('help_topic') ? 'has-error' : '' }}">
|
||||
|
||||
{!! Form::label('help_topic',Lang::get('lang.help_topic')) !!}
|
||||
{!! $errors->first('help_topic', '<spam class="help-block">:message</spam>') !!}
|
||||
{!!Form::select('help_topic', [''=>'--System Default--','Help Topics'=>$helps->lists('topic','id')],null,['class' => 'form-control select']) !!}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">{!! Lang::get('lang.incoming_email_information') !!}</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<div class="row">
|
||||
<div class="form-group">
|
||||
<!-- status -->
|
||||
<div class="col-xs-1 form-group">
|
||||
{!! Form::label('fetching_status',Lang::get('lang.status')) !!}
|
||||
</div>
|
||||
<div class="col-xs-2 form-group">
|
||||
<!--{!! Form::radio('fetching_status','1',true) !!} {{Lang::get('lang.enable')}}-->
|
||||
<input type="checkbox" name="fetching_status" id="fetching_status" <?php if ($emails->fetching_status == 1) {
|
||||
echo "checked='checked'";
|
||||
} ?>> {{Lang::get('lang.enable')}}
|
||||
</div>
|
||||
<div class="col-xs-2 form-group">
|
||||
<!--<input type="radio" name="fetching_status" id="fetching_status" value="0"> {{Lang::get('lang.disabled')}}-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-3 form-group {!! $errors->has('fetching_protocol') ? 'has-error' : ''!!}" id="fetching_protocol_error">
|
||||
{!! Form::label('fetching_protocol',Lang::get('lang.fetching_protocol')) !!}
|
||||
{!! $errors->first('fetching_protocol', '<spam class="help-block">:message</spam>') !!}
|
||||
{!!Form::select('fetching_protocol',['imap' => 'IMAP'],null,['class' => 'form-control select', 'id' => 'fetching_protocol']) !!}
|
||||
</div>
|
||||
<div class="col-xs-3 form-group {!! $errors->has('fetching_host') ? 'has-error' : ''!!}" id="fetching_host_error">
|
||||
{!! Form::label('fetching_host',Lang::get('lang.host_name')) !!}
|
||||
{!! $errors->first('fetching_host', '<spam class="help-block">:message</spam>') !!}
|
||||
{!! Form::text('fetching_host',null,['class' => 'form-control', 'id' => 'fetching_host']) !!}
|
||||
</div>
|
||||
<div class="col-xs-3 form-group {!! $errors->has('fetching_port') ? 'has-error' : ''!!}" id="fetching_port_error">
|
||||
{!! Form::label('fetching_port',Lang::get('lang.port_number')) !!}
|
||||
{!! $errors->first('fetching_port', '<spam class="help-block">:message</spam>') !!}
|
||||
{!! Form::text('fetching_port',null,['class' => 'form-control', 'id' => 'fetching_port']) !!}
|
||||
</div>
|
||||
<div class="col-xs-3 form-group {!! $errors->has('fetching_encryption') ? 'has-error' : ''!!}" id="fetching_encryption_error">
|
||||
{!! Form::label('fetching_encryption',Lang::get('lang.encryption')) !!}
|
||||
{!! $errors->first('fetching_encryption', '<spam class="help-block">:message</spam>') !!}
|
||||
{!!Form::select('fetching_encryption',['none' => 'None', 'ssl' => 'SSL', 'tls' => 'TLS', 'ssl/novalidate-cert' => 'SSL (Accept all certificates)', 'tls/novalidate-cert' => 'TLS (Accept all certificates)'],null,['class' => 'form-control select', 'id' => 'fetching_encryption']) !!}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">{!! Lang::get('lang.outgoing_email_information') !!}</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<div class="row">
|
||||
<!-- status -->
|
||||
<div class="form-group">
|
||||
<div class="col-xs-1 form-group">
|
||||
{!! Form::label('sending_status',Lang::get('lang.status')) !!}
|
||||
</div>
|
||||
<div class="col-xs-2 form-group">
|
||||
<input type="checkbox" name="sending_status" id="sending_status" <?php if ($emails->sending_status == 1) {
|
||||
echo "checked='checked'";
|
||||
} ?>> {!! Lang::get('lang.enable') !!}
|
||||
</div>
|
||||
<div class="col-xs-2 form-group">
|
||||
<!--<input type="radio" name="sending_status" id="sending_status" value=""> {!! Lang::get('lang.disabled') !!}-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<!-- Encryption -->
|
||||
<div class="col-xs-3 form-group {!! $errors->has('sending_protocol') ? 'has-error' : ''!!}" id="sending_protocol_error">
|
||||
{!! Form::label('sending_protocol',Lang::get('lang.transfer_protocol')) !!}
|
||||
{!! $errors->first('sending_protocol', '<spam class="help-block">:message</spam>') !!}
|
||||
{!!Form::select('sending_protocol',['smtp'=>'SMTP'],null,['class' => 'form-control select']) !!}
|
||||
</div>
|
||||
<!-- sending hoost -->
|
||||
<div class="col-xs-3 form-group {!! $errors->has('sending_host') ? 'has-error' : ''!!}" id="sending_host_error">
|
||||
{!! Form::label('sending_host',Lang::get('lang.host_name')) !!}
|
||||
{!! $errors->first('sending_host', '<spam class="help-block">:message</spam>') !!}
|
||||
{!! Form::text('sending_host',null,['class' => 'form-control']) !!}
|
||||
</div>
|
||||
<!-- sending port -->
|
||||
<div class="col-xs-3 form-group {!! $errors->has('sending_port') ? 'has-error' : ''!!}" id="sending_port_error">
|
||||
{!! Form::label('sending_port',Lang::get('lang.port_number')) !!}
|
||||
{!! $errors->first('sending_port', '<spam class="help-block">:message</spam>') !!}
|
||||
{!! Form::text('sending_port',null,['class' => 'form-control']) !!}
|
||||
</div>
|
||||
<!-- Encryption -->
|
||||
<div class="col-xs-3 form-group {!! $errors->has('sending_encryption') ? 'has-error' : ''!!}" id="sending_encryption_error">
|
||||
{!! Form::label('sending_encryption',Lang::get('lang.encryption')) !!}
|
||||
{!! $errors->first('sending_encryption', '<spam class="help-block">:message</spam>') !!}
|
||||
{!!Form::select('sending_encryption',['ssl'=>'SSL','tls'=>'TLS'],null,['class' => 'form-control select']) !!}
|
||||
</div>
|
||||
</div>
|
||||
<!-- Internal notes -->
|
||||
<div class="form-group">
|
||||
{!! Form::label('internal_notes',Lang::get('lang.internal_notes')) !!}
|
||||
{!! Form::textarea('internal_notes',null,['class' => 'form-control','size' => '30x10']) !!}
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-footer">
|
||||
{!! Form::button('<i id="spin" class="fa fa-spinner" style="display:none;"></i> <b>' . Lang::get("lang.update").'</b>' ,['class'=>'btn btn-primary', 'type' => 'submit'])!!}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
{!!Form::close()!!}
|
||||
|
||||
|
||||
<div class="modal fade" id="loadingpopup" style="padding:200px;">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<div id="head">
|
||||
<button type="button" class="close" id="close" data-dismiss="modal" aria-label="Close" style="display:none;"><span aria-hidden="true">×</span></button>
|
||||
<div class="col-md-5"></div><div class="col-md-2"><img src="{{asset("lb-faveo/media/images/gifloader.gif")}}" ></div><div class="col-md-5"></div>
|
||||
<br/>
|
||||
<br/>
|
||||
<br/>
|
||||
<center><h3 style="color:#80DE02;">Testing incoming & outgoing mail server</h3></center>
|
||||
<br/>
|
||||
<center><h4>Please wait while testing is in progress ...</h4></center>
|
||||
<center><h4>(Please do not use "Refresh" or "Back" button)</h4></center>
|
||||
<br/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button style="display:none" data-toggle="modal" data-target="#loadingpopup" id="click"></button>
|
||||
|
||||
<script>
|
||||
//submit form
|
||||
$('#form').on('submit', function () {
|
||||
var form_data = $(this).serialize();
|
||||
$("#spin").addClass("fa-spin");
|
||||
var email_address = document.getElementById('email_address').value;
|
||||
var email_name = document.getElementById('email_name').value;
|
||||
var department = document.getElementById('department').value;
|
||||
var priority = document.getElementById('priority').value;
|
||||
var help_topic = document.getElementById('help_topic').value;
|
||||
var password = document.getElementById('password').value;
|
||||
var fetching_status = $('input#fetching_status[type="checkbox"]:checked', this).val();
|
||||
var fetching_protocol = document.getElementById('fetching_protocol').value;
|
||||
var fetching_host = document.getElementById('fetching_host').value;
|
||||
var fetching_port = document.getElementById('fetching_port').value;
|
||||
var fetching_encryption = document.getElementById('fetching_encryption').value;
|
||||
var sending_status = $('input#sending_status[type="checkbox"]:checked', this).val();
|
||||
var sending_protocol = document.getElementById('sending_protocol').value;
|
||||
var sending_host = document.getElementById('sending_host').value;
|
||||
var sending_port = document.getElementById('sending_port').value;
|
||||
var sending_encryption = document.getElementById('sending_encryption').value;
|
||||
|
||||
|
||||
var filter_number = /^([0-9])/;
|
||||
var error_list = [];
|
||||
var error = "";
|
||||
// checking for validation of email
|
||||
if (email_address) {
|
||||
var filter_email = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
|
||||
if (!filter_email.test(email_address)) {
|
||||
var error = "Please provide a valid email address";
|
||||
error_list.push(error);
|
||||
$("#email_address_error").addClass("has-error");
|
||||
}
|
||||
} else if (email_address == "") {
|
||||
var error = "Email Address is a required field";
|
||||
error_list.push(error);
|
||||
$("#email_address_error").addClass("has-error");
|
||||
}
|
||||
// checking for validation of email name
|
||||
if (email_name == "") {
|
||||
var error = "Email Name is a required field";
|
||||
error_list.push(error);
|
||||
$("#email_name_error").addClass("has-error");
|
||||
}
|
||||
// checking for validation of department
|
||||
if (department == "") {
|
||||
} else if (department) {
|
||||
if (!filter_number.test(department)) {
|
||||
var error = "Please provide a valid department";
|
||||
error_list.push(error);
|
||||
$("#department_error").addClass("has-error");
|
||||
}
|
||||
}
|
||||
// checking for validation of priority
|
||||
if (priority == "") {
|
||||
} else if (priority) {
|
||||
if (!filter_number.test(priority)) {
|
||||
var error = "Please provide a valid priority";
|
||||
error_list.push(error);
|
||||
$("#priority_error").addClass("has-error");
|
||||
}
|
||||
}
|
||||
// checking for validation of help topic
|
||||
if (help_topic == "") {
|
||||
} else if (priority) {
|
||||
if (!filter_number.test(priority)) {
|
||||
var error = "Please provide a valid priority";
|
||||
error_list.push(error);
|
||||
$("#priority_error").addClass("has-error");
|
||||
}
|
||||
}
|
||||
// checking for validation of password
|
||||
if (password == "") {
|
||||
var error = "Password is a required field";
|
||||
error_list.push(error);
|
||||
$("#password_error").addClass("has-error");
|
||||
}
|
||||
// checking for validation of fetching host
|
||||
if (fetching_status == 'on') {
|
||||
if (fetching_host == "") {
|
||||
var error = "Fetching Host is a required field";
|
||||
error_list.push(error);
|
||||
$("#fetching_host_error").addClass("has-error");
|
||||
}
|
||||
// checking for validation of fetching port
|
||||
if (fetching_port == "") {
|
||||
var error = "Fetching Port is a required field";
|
||||
error_list.push(error);
|
||||
$("#fetching_port_error").addClass("has-error");
|
||||
}
|
||||
// checking for validation of mailbox protocol
|
||||
if (fetching_encryption == "") {
|
||||
var error = "Fetching Encryption is a required field";
|
||||
error_list.push(error);
|
||||
$("#fetching_encryption_error").addClass("has-error");
|
||||
}
|
||||
// checking for validation of mailbox protocol
|
||||
if (fetching_protocol == "") {
|
||||
var error = "Fetching Protocol is a required field";
|
||||
error_list.push(error);
|
||||
$("#fetching_protocol_error").addClass("has-error");
|
||||
}
|
||||
|
||||
} else {
|
||||
// checking for validation of fetching port
|
||||
if (fetching_port) {
|
||||
if (!filter_number.test(fetching_port)) {
|
||||
var error = "The Fetching Port Number must be an integer";
|
||||
error_list.push(error);
|
||||
$("#fetching_port_error").addClass("has-error");
|
||||
}
|
||||
}
|
||||
}
|
||||
// checking for validation of sending status
|
||||
if (sending_status == 'on') {
|
||||
// checking for validation of sending host
|
||||
if (sending_host == "") {
|
||||
var error = "Sending Host is a required field";
|
||||
error_list.push(error);
|
||||
$("#sending_host_error").addClass("has-error");
|
||||
}
|
||||
// checking for validation of sending port
|
||||
if (sending_port == "") {
|
||||
var error = "Sending Port is a required field";
|
||||
error_list.push(error);
|
||||
$("#sending_port_error").addClass("has-error");
|
||||
}
|
||||
// checking for validation of sending encryption
|
||||
if (sending_encryption == "") {
|
||||
var error = "Sending Encryption is a required field";
|
||||
error_list.push(error);
|
||||
$("#sending_encryption_error").addClass("has-error");
|
||||
}
|
||||
// checking for validation of sending protocol
|
||||
if (sending_protocol == "") {
|
||||
var error = "Transfer Protocol is a required field";
|
||||
error_list.push(error);
|
||||
$("#sending_protocol_error").addClass("has-error");
|
||||
}
|
||||
} else {
|
||||
// checking for validation of fetching port
|
||||
if (sending_port) {
|
||||
if (!filter_number.test(sending_port)) {
|
||||
var error = "The Sending Port Number must be an integer";
|
||||
error_list.push(error);
|
||||
$("#sending_port_error").addClass("has-error");
|
||||
}
|
||||
}
|
||||
}
|
||||
// executing error chatch
|
||||
if (error) {
|
||||
var ssss = "";
|
||||
$.each(error_list, function (key, value) {
|
||||
ssss += "<li class='error-message-padding'>" + value + "</li>";
|
||||
});
|
||||
if (ssss) {
|
||||
var error_result = "<div class='alert alert-danger alert-dismissable'> <i class='fa fa-ban'> </i> <b> Alert!</b><button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×</button><div id='alert-message'>" + ssss + "</div></div>";
|
||||
$('#alert').empty();
|
||||
$('#alert').html(error_result);
|
||||
$('#alert').show();
|
||||
$("#spin").removeClass("fa-spin");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Ajax communicating to backend for further Checking/Saving the details
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "{!! route('validating.email.settings.update', $emails->id ) !!}",
|
||||
dataType: "html",
|
||||
data: form_data,
|
||||
headers: {
|
||||
'X-CSRF-Token': $('meta[name="_token"]').attr('content')
|
||||
},
|
||||
beforeSend: function () {
|
||||
$('#alert').empty();
|
||||
$("#click").trigger("click");
|
||||
|
||||
},
|
||||
success: function (response) {
|
||||
if (response == 1) {
|
||||
$("#close").trigger("click");
|
||||
var error_result = "<div class='alert alert-success alert-dismissable'> <button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×</button><div id='alert-message'>Your details saved successfully</div></div>";
|
||||
$('#alert').html(error_result);
|
||||
$('#alert').show();
|
||||
} else {
|
||||
$("#close").trigger("click");
|
||||
var error_result = "<div class='alert alert-danger alert-dismissable'> <i class='fa fa-ban'> </i> <b> Alert!</b><button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×</button><div id='alert-message'>" + response + "</div></div>";
|
||||
$('#alert').html(error_result);
|
||||
$('#alert').show();
|
||||
}
|
||||
},
|
||||
error: function (response) {
|
||||
$("#close").trigger("click");
|
||||
var errorsHtml = "<div class='alert alert-danger alert-dismissable'> <i class='fa fa-ban'> </i> <b> Alert!</b><button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×</button><div id='alert-message'>Unable to process the details </div></div>";
|
||||
$('#alert').empty();
|
||||
$('#alert').html(errorsHtml);
|
||||
$('#alert').show();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
</script>
|
||||
@stop
|
||||
|
@@ -3,9 +3,7 @@
|
||||
@stop
|
||||
<!-- header -->
|
||||
@section('PageHeader')
|
||||
<div class="box-header">
|
||||
<h3 class="box-title">{!! Lang::get('lang.admin_panel') !!}</h3>
|
||||
</div>
|
||||
<h1>{!! Lang::get('lang.admin_panel') !!}</h1>
|
||||
@stop
|
||||
<!-- /header -->
|
||||
<!-- breadcrumbs -->
|
||||
@@ -16,7 +14,6 @@
|
||||
<!-- /breadcrumbs -->
|
||||
<!-- content -->
|
||||
@section('content')
|
||||
|
||||
<div class="box">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">{!! Lang::get('lang.staffs') !!}</h3>
|
||||
|
@@ -29,164 +29,89 @@ class="active"
|
||||
@section('content')
|
||||
|
||||
<!-- open a form -->
|
||||
|
||||
{!! Form::model($emails,['url' => 'postemail/'.$emails->id, 'method' => 'PATCH']) !!}
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-12">
|
||||
|
||||
<div class="box box-primary">
|
||||
<div class="box-header">
|
||||
{!! Form::model($emails,['url' => 'postemail/'.$emails->id, 'method' => 'PATCH']) !!}
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="box box-primary">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title">{{Lang::get('lang.email')}}</h3> <div class="pull-right">
|
||||
{!! Form::submit(Lang::get('lang.save'),['class'=>'btn btn-primary'])!!}
|
||||
</div>
|
||||
{!! Form::submit(Lang::get('lang.save'),['class'=>'btn btn-primary'])!!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- check whether success or not -->
|
||||
|
||||
@if(Session::has('success'))
|
||||
<div class="alert alert-success alert-dismissable">
|
||||
<i class="fa fa-check-circle"></i>
|
||||
<b>Success!</b>
|
||||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||
{{Session::get('success')}}
|
||||
</div>
|
||||
@endif
|
||||
<!-- failure message -->
|
||||
@if(Session::has('fails'))
|
||||
<div class="alert alert-danger alert-dismissable">
|
||||
<i class="fa fa-ban"></i>
|
||||
<b>Fail!</b>
|
||||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||
{{Session::get('fails')}}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
|
||||
<div class="box-body table-responsive"style="overflow:hidden;">
|
||||
<div class="row">
|
||||
<!-- Default Template Set: DROPDOWN value from template table : Required -->
|
||||
{{-- <div class="col-md-3"> --}}
|
||||
{{-- <div class="form-group {{ $errors->has('template') ? 'has-error' : '' }}"> --}}
|
||||
{{-- {!! Form::label('template',Lang::get('lang.default_template')) !!} --}}
|
||||
{{-- {!! $errors->first('template', '<spam class="help-block">:message</spam>') !!} --}}
|
||||
{{-- {!!Form::select('template', $templates->lists('name','name'),null,['class'=>'form-control']) !!} --}}
|
||||
{{-- </div> --}}
|
||||
{{-- </div> --}}
|
||||
|
||||
<!-- Default System Email: DROPDOWN value from emails table : Required -->
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-3 no-padding">
|
||||
<div class="form-group {{ $errors->has('sys_email') ? 'has-error' : '' }}">
|
||||
{!! Form::label('sys_email',Lang::get('lang.default_system_email')) !!}
|
||||
{!! $errors->first('sys_email', '<spam class="help-block">:message</spam>') !!}
|
||||
{!!Form::select('sys_email', [ 'Select an Email', 'Emails' => $emails1->lists('email_name','id')],null,['class'=>'form-control']) !!}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Default Alert Email: DROPDOWN value from emails table : Required -->
|
||||
{{-- <div class="col-md-3"> --}}
|
||||
{{-- <div class="form-group {{ $errors->has('alert_email') ? 'has-error' : '' }}"> --}}
|
||||
{{-- {!! Form::label('alert_email',Lang::get('lang.default_alert_email')) !!} --}}
|
||||
{{-- {!! $errors->first('alert_email', '<spam class="help-block">:message</spam>') !!} --}}
|
||||
{{-- {!!Form::select('alert_email', $emails1->lists('email_address','email_address'),null,['class'=>'form-control']) !!} --}}
|
||||
{{-- </div> --}}
|
||||
{{-- </div> --}}
|
||||
<!-- Default MTA: DROPDOWN : manual -->
|
||||
{{-- <div class="col-md-3"> --}}
|
||||
{{-- <div class="form-group"> --}}
|
||||
{{-- {!! Form::label('alert_email',Lang::get('lang.default_MTA')) !!} --}}
|
||||
{{-- {!!Form::select('alert_email',['use PHP Mail function'],null,['class'=>'form-control']) !!} --}}
|
||||
{{-- </div> --}}
|
||||
{{-- </div> --}}
|
||||
<!-- Email Fetching: CHECKBOX : Enable ,Fetch on auto-cron -->
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
|
||||
{!! Form::label('email_fetching',Lang::get('lang.email_fetch')) !!}<br>
|
||||
{!! Form::checkbox('email_fetching',1,true) !!} {{Lang::get('lang.fetch_auto-corn')}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
{!! Form::checkbox('notification_cron',1,true) !!} {{Lang::get('lang.cron_notification')}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Accept All Emails: CHECKBOX: Accept email from unknown Users -->
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
@if(Session::has('success'))
|
||||
<div class="alert alert-success alert-dismissable">
|
||||
<i class="fa fa-check-circle"></i>
|
||||
<b>Success!</b>
|
||||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||
{{Session::get('success')}}
|
||||
</div>
|
||||
@endif
|
||||
<!-- failure message -->
|
||||
@if(Session::has('fails'))
|
||||
<div class="alert alert-danger alert-dismissable">
|
||||
<i class="fa fa-ban"></i>
|
||||
<b>Fail!</b>
|
||||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||
{{Session::get('fails')}}
|
||||
</div>
|
||||
@endif
|
||||
<div class="box-body table-responsive"style="overflow:hidden;">
|
||||
<div class="row">
|
||||
<!-- Default System Email: DROPDOWN value from emails table : Required -->
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-3 no-padding">
|
||||
<div class="form-group {{ $errors->has('sys_email') ? 'has-error' : '' }}">
|
||||
{!! Form::label('sys_email',Lang::get('lang.default_system_email')) !!}
|
||||
{!! $errors->first('sys_email', '<spam class="help-block">:message</spam>') !!}
|
||||
{!!Form::select('sys_email', [ 'Select an Email', 'Emails' => $emails1->lists('email_name','id')],null,['class'=>'form-control']) !!}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Email Fetching: CHECKBOX : Enable ,Fetch on auto-cron -->
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
{!! Form::checkbox('all_emails',1,true) !!} {{Lang::get('lang.accept_all_email')}}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Admin's Email Address: Text : Required -->
|
||||
<div class="row">
|
||||
{{-- <div class="col-md-6"> --}}
|
||||
{{-- <div class="form-group {{ $errors->has('admin_email') ? 'has-error' : '' }}"> --}}
|
||||
|
||||
{{-- {!! Form::label('admin_email',Lang::get('lang.admin_email')) !!} --}}
|
||||
{{-- {!! $errors->first('admin_email', '<spam class="help-block">:message</spam>') !!} --}}
|
||||
{{-- {!! Form::text('admin_email',null,['class' => 'form-control']) !!} --}}
|
||||
{{-- </div> --}}
|
||||
{{-- </div> --}}
|
||||
<!-- Reply Separator Tag: text -->
|
||||
{{-- <div class="col-md-6"> --}}
|
||||
{{-- <div class="form-group {{ $errors->has('separator') ? 'has-error' : '' }}"> --}}
|
||||
{{-- {!! Form::label('separator',Lang::get('lang.reply_separator')) !!} --}}
|
||||
{{-- {!! $errors->first('separator', '<spam class="help-block">:message</spam>') !!} --}}
|
||||
{{-- {!! Form::text('separator',null,['class' => 'form-control']) !!} --}}
|
||||
{{-- </div> --}}
|
||||
{{-- </div> --}}
|
||||
</div>
|
||||
<!-- Accept Email Collaborators: CHECKBOX : Automatically add collaborators from email fields -->
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
{!! Form::checkbox('email_collaborator',1) !!} {{Lang::get('lang.accept_email_collab')}}
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Strip Quoted Reply: CHECKBOX -->
|
||||
{{-- <div class="row"> --}}
|
||||
{{-- <div class="col-md-4"> --}}
|
||||
{{-- <div class="form-group"> --}}
|
||||
{{-- {!! Form::checkbox('strip',1,['class' => 'form-control']) !!} {{Lang::get('lang.strip_quoted_reply')}} --}}
|
||||
|
||||
|
||||
{{-- </div> --}}
|
||||
{{-- </div> --}}
|
||||
{{-- </div> --}}
|
||||
<!-- Attachments: CHECKBOX : Email attachments to the user -->
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
{!! Form::checkbox('attachment',1) !!} {{Lang::get('lang.attachments')}}
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{!! Form::label('email_fetching',Lang::get('lang.email_fetch')) !!}<br>
|
||||
{!! Form::checkbox('email_fetching',1,true) !!} {{Lang::get('lang.fetch_auto-corn')}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
{!! Form::checkbox('notification_cron',1,true) !!} {{Lang::get('lang.cron_notification')}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Accept All Emails: CHECKBOX: Accept email from unknown Users -->
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
{!! Form::checkbox('all_emails',1,true) !!} {{Lang::get('lang.accept_all_email')}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Admin's Email Address: Text : Required -->
|
||||
<div class="row">
|
||||
</div>
|
||||
<!-- Accept Email Collaborators: CHECKBOX : Automatically add collaborators from email fields -->
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
{!! Form::checkbox('email_collaborator',1) !!} {{Lang::get('lang.accept_email_collab')}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Attachments: CHECKBOX : Email attachments to the user -->
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
{!! Form::checkbox('attachment',1) !!} {{Lang::get('lang.attachments')}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
||||
|
@@ -32,18 +32,18 @@ class="active"
|
||||
|
||||
<!-- open a form -->
|
||||
|
||||
{!! Form::model($systems,['url' => 'postsystem/'.$systems->id, 'method' => 'PATCH' , 'id'=>'formID']) !!}
|
||||
{!! Form::model($systems,['url' => 'postsystem/'.$systems->id, 'method' => 'PATCH' , 'id'=>'formID']) !!}
|
||||
|
||||
<div class="box box-primary">
|
||||
<div class="box box-primary">
|
||||
<div class="box-header">
|
||||
|
||||
<h3 class="box-title">{{Lang::get('lang.system')}}</h3> {!! Form::submit('Save',['onclick'=>'sendForm()','class'=>'btn btn-primary pull-right'])!!}
|
||||
<!-- <input type="submit" value="sumit" onclick="sendForm();"> -->
|
||||
<h3 class="box-title">{{Lang::get('lang.system')}}</h3> {!! Form::submit('Save',['onclick'=>'sendForm()','class'=>'btn btn-primary pull-right'])!!}
|
||||
<!-- <input type="submit" value="sumit" onclick="sendForm();"> -->
|
||||
</div>
|
||||
|
||||
<!-- check whether success or not -->
|
||||
|
||||
@if(Session::has('success'))
|
||||
@if(Session::has('success'))
|
||||
<div class="alert alert-success alert-dismissable">
|
||||
<i class="fa fa-check-circle"></i>
|
||||
<b>Success!</b>
|
||||
@@ -62,122 +62,136 @@ class="active"
|
||||
@endif
|
||||
|
||||
|
||||
<!-- Helpdesk Status: radio Online Offline -->
|
||||
|
||||
<div class="box-body">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
{!! Form::label('status',Lang::get('lang.status')) !!}
|
||||
<div class="row">
|
||||
<div class="col-xs-3">
|
||||
{!! Form::radio('status','1',true) !!} {{Lang::get('lang.online')}}
|
||||
</div>
|
||||
<div class="col-xs-3">
|
||||
{!! Form::radio('status','0') !!} {{Lang::get('lang.offline')}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Helpdesk Status: radio Online Offline -->
|
||||
|
||||
<div class="box-body">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
{!! Form::label('status',Lang::get('lang.status')) !!}
|
||||
<div class="row">
|
||||
<div class="col-xs-3">
|
||||
{!! Form::radio('status','1',true) !!} {{Lang::get('lang.online')}}
|
||||
</div>
|
||||
<div class="col-xs-3">
|
||||
{!! Form::radio('status','0') !!} {{Lang::get('lang.offline')}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Helpdesk Name/Title: text Required -->
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="form-group {{ $errors->has('name') ? 'has-error' : '' }}">
|
||||
{!! Form::label('name',Lang::get('lang.name/title')) !!}
|
||||
{!! $errors->first('name', '<spam class="help-block">:message</spam>') !!}
|
||||
{!! Form::text('name',$systems->name,['class' => 'form-control']) !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Helpdesk URL: text Required -->
|
||||
<div class="col-md-6">
|
||||
<div class="form-group {{ $errors->has('url') ? 'has-error' : '' }}">
|
||||
{!! Form::label('url',Lang::get('lang.url')) !!}
|
||||
{!! $errors->first('url', '<spam class="help-block">:message</spam>') !!}
|
||||
{!! Form::text('url',$systems->url,['class' => 'form-control']) !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Default Department: Dropdown From Department table: required -->
|
||||
<div class="col-md-6">
|
||||
<div class="form-group {{ $errors->has('department') ? 'has-error' : '' }}">
|
||||
|
||||
{!! Form::label('department',Lang::get('lang.default_department')) !!}
|
||||
{!! $errors->first('department', '<spam class="help-block">:message</spam>') !!}
|
||||
{!!Form::select('department', [''=>'Select a Department','Department'=>$departments->lists('name','id')],null,['class'=>'form-control']) !!}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Default Time Zone: Drop down: timezones table : Required -->
|
||||
<div class="col-md-6">
|
||||
<div class="form-group {{ $errors->has('time_zone') ? 'has-error' : '' }}">
|
||||
{!! Form::label('time_zone',Lang::get('lang.timezone')) !!}
|
||||
{!! $errors->first('time_zone', '<spam class="help-block">:message</spam>') !!}
|
||||
{!!Form::select('time_zone',[''=>'Select a Time Zone','Time Zones'=>$timezones->lists('name','id')],null,['class'=>'form-control']) !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Date and Time Format: text: required: eg - 03/25/2015 7:14 am -->
|
||||
<!-- Helpdesk Name/Title: text Required -->
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="form-group {{ $errors->has('date_time_format') ? 'has-error' : '' }}">
|
||||
<div class="form-group {{ $errors->has('name') ? 'has-error' : '' }}">
|
||||
{!! Form::label('name',Lang::get('lang.name/title')) !!}
|
||||
{!! $errors->first('name', '<spam class="help-block">:message</spam>') !!}
|
||||
{!! Form::text('name',$systems->name,['class' => 'form-control']) !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{!! Form::label('date_time_format',Lang::get('lang.date_time')) !!}
|
||||
{!! $errors->first('date_time_format', '<spam class="help-block">:message</spam>') !!}
|
||||
{!! Form::select('date_time_format',[''=>'Select a date Time Format','Date Time Formats'=>$date_time->lists('format','id')],null,['class' => 'form-control']) !!}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!-- Helpdesk URL: text Required -->
|
||||
<div class="col-md-6">
|
||||
<div class="form-group {{ $errors->has('url') ? 'has-error' : '' }}">
|
||||
{!! Form::label('url',Lang::get('lang.url')) !!}
|
||||
{!! $errors->first('url', '<spam class="help-block">:message</spam>') !!}
|
||||
{!! Form::text('url',$systems->url,['class' => 'form-control']) !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- Default Department: Dropdown From Department table: required -->
|
||||
<div class="col-md-6">
|
||||
<div class="form-group {{ $errors->has('department') ? 'has-error' : '' }}">
|
||||
|
||||
<hr/>
|
||||
<h4>{!! Lang::get('lang.api_configurations') !!}</h4>
|
||||
{!! Form::label('department',Lang::get('lang.default_department')) !!}
|
||||
{!! $errors->first('department', '<spam class="help-block">:message</spam>') !!}
|
||||
{!!Form::select('department', [''=>'Select a Department','Department'=>$departments->lists('name','id')],null,['class'=>'form-control']) !!}
|
||||
|
||||
<!-- Guest user page Content -->
|
||||
<div class="row">
|
||||
<!-- Default Time Zone: Drop down: timezones table : Required -->
|
||||
<div class="col-md-3">
|
||||
<div class="form-group {{ $errors->has('api_enable') ? 'has-error' : '' }}">
|
||||
{!! Form::label('api',Lang::get('lang.api')) !!}
|
||||
{!! $errors->first('api_enable', '<spam class="help-block">:message</spam>') !!}
|
||||
<div class="row">
|
||||
<div class="col-xs-5">
|
||||
{!! Form::radio('api_enable','1',true) !!} {{Lang::get('lang.enable')}}
|
||||
</div>
|
||||
<div class="col-xs-5">
|
||||
{!! Form::radio('api_enable','0') !!} {{Lang::get('lang.disable')}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Date and Time Format: text: required: eg - 03/25/2015 7:14 am -->
|
||||
<!-- Default Time Zone: Drop down: timezones table : Required -->
|
||||
<div class="col-md-6">
|
||||
<div class="form-group {{ $errors->has('time_zone') ? 'has-error' : '' }}">
|
||||
{!! Form::label('time_zone',Lang::get('lang.timezone')) !!}
|
||||
{!! $errors->first('time_zone', '<spam class="help-block">:message</spam>') !!}
|
||||
{!!Form::select('time_zone',[''=>'Select a Time Zone','Time Zones'=>$timezones->lists('name','id')],null,['class'=>'form-control']) !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="form-group {{ $errors->has('api_key') ? 'has-error' : '' }}">
|
||||
|
||||
{!! Form::label('api_key',Lang::get('lang.api_key')) !!}
|
||||
{!! $errors->first('api_key', '<spam class="help-block">:message</spam>') !!}
|
||||
{!! Form::text('api_key',$systems->api_key,['class' => 'form-control']) !!}
|
||||
<!-- Date and Time Format: text: required: eg - 03/25/2015 7:14 am -->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group {{ $errors->has('date_time_format') ? 'has-error' : '' }}">
|
||||
|
||||
<div class="col-md-3">
|
||||
<br/>
|
||||
<a class="btn btn-primary" id="generate"> <i class="fa fa-refresh"> </i> {!! Lang::get('lang.generate_key') !!}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<a href="#" id="clickGenerate" data-toggle="modal" data-target="#generateModal"></a>
|
||||
|
||||
<div class="modal fade" id="generateModal">
|
||||
{!! Form::label('date_time_format',Lang::get('lang.date_time')) !!}
|
||||
{!! $errors->first('date_time_format', '<spam class="help-block">:message</spam>') !!}
|
||||
{!! Form::select('date_time_format',[''=>'Select a date Time Format','Date Time Formats'=>$date_time->lists('format','id')],null,['class' => 'form-control']) !!}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<hr/>
|
||||
<h4>{!! Lang::get('lang.api_configurations') !!}</h4>
|
||||
|
||||
<!-- Guest user page Content -->
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="form-group {{ $errors->has('api_enable') ? 'has-error' : '' }}">
|
||||
{!! Form::label('api',Lang::get('lang.api')) !!}
|
||||
{!! $errors->first('api_enable', '<spam class="help-block">:message</spam>') !!}
|
||||
<div class="row">
|
||||
<div class="col-xs-5">
|
||||
{!! Form::radio('api_enable','1',true) !!} {{Lang::get('lang.enable')}}
|
||||
</div>
|
||||
<div class="col-xs-5">
|
||||
{!! Form::radio('api_enable','0') !!} {{Lang::get('lang.disable')}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="form-group {{ $errors->has('api_key_mandatory') ? 'has-error' : '' }}">
|
||||
{!! Form::label('api_key_mandatory',Lang::get('lang.api_key_mandatory')) !!}
|
||||
{!! $errors->first('api_key_mandatory', '<spam class="help-block">:message</spam>') !!}
|
||||
<div class="row">
|
||||
<div class="col-xs-5">
|
||||
{!! Form::radio('api_key_mandatory','1',true) !!} {{Lang::get('lang.enable')}}
|
||||
</div>
|
||||
<div class="col-xs-5">
|
||||
{!! Form::radio('api_key_mandatory','0') !!} {{Lang::get('lang.disable')}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Date and Time Format: text: required: eg - 03/25/2015 7:14 am -->
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="form-group {{ $errors->has('api_key') ? 'has-error' : '' }}">
|
||||
|
||||
{!! Form::label('api_key',Lang::get('lang.api_key')) !!}
|
||||
{!! $errors->first('api_key', '<spam class="help-block">:message</spam>') !!}
|
||||
{!! Form::text('api_key',$systems->api_key,['class' => 'form-control']) !!}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<br/>
|
||||
<a class="btn btn-primary" id="generate"> <i class="fa fa-refresh"> </i> {!! Lang::get('lang.generate_key') !!}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<a href="#" id="clickGenerate" data-toggle="modal" data-target="#generateModal"></a>
|
||||
<div class="modal fade" id="generateModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
@@ -185,7 +199,7 @@ class="active"
|
||||
<h4 class="modal-title">{!! Lang::get('lang.api_key') !!}</h4>
|
||||
</div>
|
||||
<div class="modal-body" id="messageBody">
|
||||
|
||||
|
||||
</div>
|
||||
<div class="modal-footer" id="messageBody">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal" aria-label="Close">{!! Lang::get('lang.close') !!}</button>
|
||||
@@ -193,29 +207,28 @@ class="active"
|
||||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
</div><!-- /.modal -->
|
||||
|
||||
<script src="{{asset("lb-faveo/js/ajax-jquery.min.js")}}"></script>
|
||||
<script type="text/javascript">
|
||||
jQuery(document).ready(function() {
|
||||
<script src="{{asset("lb-faveo/js/ajax-jquery.min.js")}}"></script>
|
||||
<script type="text/javascript">
|
||||
jQuery(document).ready(function () {
|
||||
// Close a ticket
|
||||
$('#generate').on('click', function(e) {
|
||||
$.ajax({
|
||||
$('#generate').on('click', function (e) {
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: "{!! url('generate-api-key') !!}",
|
||||
beforeSend: function() {
|
||||
beforeSend: function () {
|
||||
$("#generate").empty();
|
||||
var message = "<i class='fa fa-refresh fa-spin'> </i> <?php echo Lang::get('lang.generate_key'); ?>";
|
||||
$('#generate').html(message);
|
||||
},
|
||||
success: function(response) {
|
||||
// alert(response);
|
||||
|
||||
$("#messageBody").empty();
|
||||
},
|
||||
success: function (response) {
|
||||
// alert(response);
|
||||
|
||||
$("#messageBody").empty();
|
||||
var message = "<div class='alert alert-default' style='margin-bottom: -5px;'>Copy and paste in the api to set a different Api key</div> <br/><b>Api key</b> : " + response;
|
||||
$('#messageBody').html(message);
|
||||
|
||||
$('#clickGenerate').trigger("click");
|
||||
$("#generate").empty();
|
||||
$('#clickGenerate').trigger("click");
|
||||
$("#generate").empty();
|
||||
var message = "<i class='fa fa-refresh'> </i> <?php echo Lang::get('lang.generate_key'); ?>";
|
||||
$('#generate').html(message);
|
||||
}
|
||||
@@ -223,6 +236,6 @@ class="active"
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
|
||||
@stop
|
||||
@stop
|
||||
|
@@ -1,272 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Faveo Knowledge Base</title>
|
||||
<meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
|
||||
<!-- Bootstrap 3.3.2 -->
|
||||
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
|
||||
<!-- Font Awesome Icons -->
|
||||
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
|
||||
<!-- Ionicons -->
|
||||
<link href="http://code.ionicframework.com/ionicons/2.0.0/css/ionicons.min.css" rel="stylesheet" type="text/css" />
|
||||
<!-- fullCalendar 2.2.5-->
|
||||
<link href="{{asset("lb-faveo/plugins/fullcalendar/fullcalendar.min.css")}}" rel="stylesheet" type="text/css" />
|
||||
|
||||
<link href="{{asset("lb-faveo/plugins/fullcalendar/fullcalendar.print.css")}}" rel="stylesheet" type="text/css" media='print' />
|
||||
<!-- Theme style -->
|
||||
<link href="{{asset("lb-faveo/dist/css/AdminLTE.min.css")}}" rel="stylesheet" type="text/css" />
|
||||
<!-- AdminLTE Skins. Choose a skin from the css/skins
|
||||
folder instead of downloading all of them to reduce the load. -->
|
||||
<link href="{{asset("lb-faveo/dist/css/skins/_all-skins.min.css")}}" rel="stylesheet" type="text/css" />
|
||||
<!-- iCheck -->
|
||||
<link href="{{asset("lb-faveo/plugins/iCheck/flat/blue.css")}}" rel="stylesheet" type="text/css" />
|
||||
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
|
||||
<link rel="stylesheet" href="{{asset("lb-faveo/dist/css/tabby.css")}}" type="text/css">
|
||||
|
||||
<link href="http://www.jqueryscript.net/css/jquerysctipttop.css" rel="stylesheet" type="text/css">
|
||||
|
||||
<link type="text/css" href="http://code.jquery.com/ui/1.9.1/themes/redmond/jquery-ui.css" rel="stylesheet">
|
||||
|
||||
<link href="http://www.jqueryscript.net/css/jquerysctipttop.css" rel="stylesheet" type="text/css">
|
||||
|
||||
<script type="text/javascript" src="//cdn.datatables.net/1.10.0/js/jquery.dataTables.js"></script>
|
||||
|
||||
<link href="{{asset("lb-faveo/plugins/filebrowser/plugin.js")}}" rel="stylesheet" type="text/css" />
|
||||
|
||||
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
|
||||
|
||||
<script type="text/javascript" src="{{asset('lb-faveo/dist/js/nicEdit.js')}}"></script>
|
||||
|
||||
@yield('HeadInclude')
|
||||
</head>
|
||||
<body class="skin-blue">
|
||||
<div class="wrapper" id="RefreshAssign">
|
||||
|
||||
<header class="main-header">
|
||||
<?php $settings = App\Model\kb\Settings::where('id', '=', '1')->first();?>
|
||||
@if($settings->logo)
|
||||
<a href=""><img src="{{asset('lb-faveo/Img/icon/'.$settings->logo)}}" class="logo" alt="KNOWLEDGE BASE"/></a>
|
||||
@else
|
||||
<a href="" class="logo">KNOWLEDGE BASE</a>
|
||||
@endif
|
||||
<!-- Header Navbar: style can be found in header.less -->
|
||||
<nav class="navbar navbar-static-top" role="navigation">
|
||||
<!-- Sidebar toggle button-->
|
||||
<a href="#" class="sidebar-toggle" data-toggle="offcanvas" role="button">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</a>
|
||||
<!-- Collect the nav links, forms, and other content for toggling -->
|
||||
<div class="collapse navbar-collapse" id="navbar-collapse">
|
||||
<ul class="tabs tabs-horizontal nav navbar-nav">
|
||||
</ul>
|
||||
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
|
||||
<li class="dropdown user user-menu">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
|
||||
@if(Auth::user())
|
||||
@if(Auth::user()->profile_pic)
|
||||
<img src="{{asset('lb-faveo/dist/img')}}{{'/'}}{{Auth::user()->profile_pic}}" class="user-image" alt="User Image"/>
|
||||
@else
|
||||
<img src="{{ Gravatar::src(Auth::user()->email) }}" class="user-image" alt="User Image">
|
||||
@endif
|
||||
@endif
|
||||
<span class="hidden-xs">{!! Auth::user()->firstname." ".Auth::user()->lastname !!}</span>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
<!-- User image -->
|
||||
<li class="user-header">
|
||||
@if(Auth::user())
|
||||
@if(Auth::user()->profile_pic)
|
||||
<img src="{{asset('lb-faveo/dist/img')}}{{'/'}}{{Auth::user()->profile_pic}}" class="img-circle" alt="User Image"/>
|
||||
@else
|
||||
<img src="{{ Gravatar::src(Auth::user()->email) }}" class="img-circle" alt="User Image">
|
||||
@endif
|
||||
@endif
|
||||
<p>
|
||||
<span class="hidden-xs">{!! Auth::user()->firstname." ".Auth::user()->lastname !!}</span>
|
||||
</p>
|
||||
</li>
|
||||
<!-- Menu Body -->
|
||||
<!-- Menu Footer-->
|
||||
<li class="user-footer">
|
||||
<div class="pull-left">
|
||||
<a href="{{url('profile')}}" class="btn btn-default btn-flat">{{Lang::get('lang.profile')}}</a>
|
||||
</div>
|
||||
<div class="pull-right">
|
||||
<a href="{{ url('/auth/logout') }}" class="btn btn-default btn-flat">{{Lang::get('lang.signout')}}</a>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<!-- <form class="navbar-form navbar-left" role="search">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" id="navbar-search-input" placeholder="Search">
|
||||
</div>
|
||||
</form> -->
|
||||
|
||||
</div><!-- /.navbar-collapse -->
|
||||
</nav>
|
||||
</header>
|
||||
<!-- Left side column. contains the logo and sidebar -->
|
||||
<aside class="main-sidebar">
|
||||
<!-- sidebar: style can be found in sidebar.less -->
|
||||
<section class="sidebar">
|
||||
<!-- Sidebar user panel -->
|
||||
<!-- search form -->
|
||||
|
||||
<!-- /.search form -->
|
||||
<!-- sidebar menu: : style can be found in sidebar.less -->
|
||||
|
||||
<ul class="sidebar-menu">
|
||||
<div class="user-panel">
|
||||
<div class="pull-left image">
|
||||
@if(Auth::user() && Auth::user()->profile_pic)
|
||||
<img src="{{asset('lb-faveo/dist/img')}}{{'/'}}{{Auth::user()->profile_pic}}" class="img-circle" alt="User Image" />
|
||||
@else
|
||||
<img src="{{ Gravatar::src(Auth::user()->email) }}" class="img-circle" alt="User Image">
|
||||
@endif
|
||||
</div>
|
||||
<div class="pull-left info">
|
||||
@if(Auth::user())
|
||||
<p>{!! Auth::user()->firstname !!}{!! " ". Auth::user()->lastname !!}</p>
|
||||
@endif
|
||||
@if(Auth::user() && Auth::user()->active==1)
|
||||
<a href="#"><i class="fa fa-circle text-success"></i> Online</a>
|
||||
@else
|
||||
<a href="#"><i class="fa fa-circle"></i> Offline</a>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
<li class="treeview @yield('category')">
|
||||
<a href="#">
|
||||
<i class="fa fa-list-ul"></i> <span>{{Lang::get('lang.category')}}</span>
|
||||
<i class="fa fa-angle-left pull-right"></i>
|
||||
</a>
|
||||
<ul class="treeview-menu">
|
||||
<li @yield('add-category')><a href="{{url('category/create')}}"><i class="fa fa-circle-o"></i> {{Lang::get('lang.addcategory')}}</a></li>
|
||||
<li @yield('all-category')><a href="{{url('category')}}"><i class="fa fa-circle-o"></i> {{Lang::get('lang.allcategory')}}</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="treeview @yield('article')">
|
||||
<a href="#">
|
||||
<i class="fa fa-edit"></i> <span>{{Lang::get('lang.article')}}</span>
|
||||
<i class="fa fa-angle-left pull-right"></i>
|
||||
</a>
|
||||
<ul class="treeview-menu">
|
||||
<li @yield('add-article')><a href="{{url('article/create')}}"><i class="fa fa-circle-o"></i> {{Lang::get('lang.addarticle')}}</a></li>
|
||||
<li @yield('all-article')><a href="{{url('article')}}"><i class="fa fa-circle-o"></i> {{Lang::get('lang.allarticle')}}</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li class="treeview @yield('pages')">
|
||||
<a href="#">
|
||||
<i class="fa fa-file-text"></i> <span>{{Lang::get('lang.pages')}}</span>
|
||||
<i class="fa fa-angle-left pull-right"></i>
|
||||
</a>
|
||||
<ul class="treeview-menu">
|
||||
<li @yield('add-pages')><a href="{{url('page/create')}}"><i class="fa fa-circle-o"></i> {{Lang::get('lang.addpages')}}</a></li>
|
||||
<li @yield('all-pages')><a href="{{url('page')}}"><i class="fa fa-circle-o"></i> {{Lang::get('lang.allpages')}}</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="treeview @yield('widget')">
|
||||
<a href="#">
|
||||
<i class="fa fa-th"></i> <span>{{Lang::get('lang.widgets')}}</span>
|
||||
<i class="fa fa-angle-left pull-right"></i>
|
||||
</a>
|
||||
<ul class="treeview-menu">
|
||||
<li @yield('footer1')><a href="{{url('create-footer')}}"><i class="fa fa-circle-o"></i> {{Lang::get('lang.footer1')}}</a></li>
|
||||
<li @yield('footer2')><a href="{{url('create-footer2')}}"><i class="fa fa-circle-o"></i> {{Lang::get('lang.footer2')}}</a></li>
|
||||
<li @yield('footer3')><a href="{{url('create-footer3')}}"><i class="fa fa-circle-o"></i> {{Lang::get('lang.footer3')}}</a></li>
|
||||
<li @yield('footer4')><a href="{{url('create-footer4')}}"><i class="fa fa-circle-o"></i> {{Lang::get('lang.footer4')}}</a></li>
|
||||
<li @yield('side1')><a href="{{url('side1')}}"><i class="fa fa-circle-o"></i> {{Lang::get('lang.sidewidget1')}}</a></li>
|
||||
<li @yield('side2')><a href="{{url('side2')}}"><i class="fa fa-circle-o"></i> {{Lang::get('lang.sidewidget2')}}</a></li>
|
||||
<li @yield('social')><a href="{{url('social')}}"><i class="fa fa-circle-o"></i> Social</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li @yield('comment')>
|
||||
<a href="{{url('comment')}}">
|
||||
<i class="fa fa-comments-o"></i>
|
||||
<span>{{Lang::get('lang.comments')}}</span>
|
||||
</a>
|
||||
</li>
|
||||
<li @yield('settings')>
|
||||
<a href="{{url('settings')}}">
|
||||
<i class="fa fa-wrench"></i>
|
||||
<span>{{Lang::get('lang.settings')}}</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
</section>
|
||||
<!-- /.sidebar -->
|
||||
</aside>
|
||||
|
||||
<!-- Right side column. Contains the navbar and content of the page -->
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<div class="tab-content" style="background-color: white; border-top:1px solid #F0F0F0;">
|
||||
<div class="collapse navbar-collapse" id="navbar-collapse">
|
||||
<div class="tabs-content">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<section class="content-header">
|
||||
@yield('PageHeader')
|
||||
@yield('breadcrumbs')
|
||||
</section>
|
||||
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
|
||||
@yield('content')
|
||||
</section><!-- /.content -->
|
||||
<!-- /.content-wrapper -->
|
||||
</div>
|
||||
<footer class="main-footer">
|
||||
<div class="pull-right hidden-xs">
|
||||
<b>Version</b> {{$settings->version}}
|
||||
</div>
|
||||
<strong>Copyright © {{date("Y")}} <a href="{{$settings->website}}"> {{$settings->company_name}}</a>. Powered By <a href="http://www.faveohelpdesk.com">Faveo</a>.</strong>
|
||||
</footer>
|
||||
</div><!-- ./wrapper -->
|
||||
|
||||
<!-- jQuery 2.1.3 -->
|
||||
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
|
||||
|
||||
<!-- Bootstrap 3.3.2 JS -->
|
||||
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js" type="text/javascript"></script>
|
||||
|
||||
<script type="text/javascript" src="//cdn.datatables.net/1.10.0/js/jquery.dataTables.js"></script>
|
||||
<!-- Slimscroll -->
|
||||
<script src="{{asset("lb-faveo/plugins/slimScroll/jquery.slimscroll.min.js")}}" type="text/javascript"></script>
|
||||
<!-- FastClick -->
|
||||
<script src='{{asset("lb-faveo/plugins/fastclick/fastclick.min.js")}}'></script>
|
||||
<!-- AdminLTE App -->
|
||||
<script src="{{asset("lb-faveo/dist/js/app.min.js")}}" type="text/javascript"></script>
|
||||
<!-- iCheck -->
|
||||
<script src="{{asset("lb-faveo/plugins/iCheck/icheck.min.js")}}" type="text/javascript"></script>
|
||||
|
||||
<script type="text/javascript" src="js/jquery.maskedinput.min.js"></script>
|
||||
|
||||
<script src="{{asset("lb-faveo/plugins/filebrowser/plugin.js")}}"></script>
|
||||
<!-- Bootstrap WYSIHTML5 -->
|
||||
<script src="{{asset('lb-faveo/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js')}}" type="text/javascript"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
bkLib.onDomLoaded(function() { nicEditors.allTextAreas() });
|
||||
</script>
|
||||
|
||||
@yield('FooterInclude')
|
||||
</body>
|
||||
</html>
|
@@ -51,12 +51,13 @@ class="active"
|
||||
@endif
|
||||
<div class="box-body">
|
||||
|
||||
{!! Form::open(['route'=>'select_all','method'=>'post']) !!}
|
||||
{!! Form::open(['id'=>'modalpopup', 'route'=>'select_all','method'=>'post']) !!}
|
||||
<div class="mailbox-controls">
|
||||
<!-- Check all button -->
|
||||
<a class="btn btn-default btn-sm checkbox-toggle"><i class="fa fa-square-o"></i></a>
|
||||
<input type="submit" class="btn btn-default text-orange btn-sm" name="submit" value="{!! Lang::get('lang.delete') !!}">
|
||||
<input type="submit" class="btn btn-default text-yellow btn-sm" name="submit" value="{!! Lang::get('lang.close') !!}">
|
||||
<input type="submit" class="submit btn btn-default text-orange btn-sm" id="delete" name="submit" value="{!! Lang::get('lang.delete') !!}">
|
||||
<input type="submit" class="submit btn btn-default text-yellow btn-sm" id="close" name="submit" value="{!! Lang::get('lang.close') !!}">
|
||||
<button type="button" class="btn btn-sm btn-default text-green" id="Edit_Ticket" data-toggle="modal" data-target="#MergeTickets"><i class="fa fa-code-fork"> </i> {!! Lang::get('lang.merge') !!}</button>
|
||||
|
||||
</div>
|
||||
<div class="mailbox-messages" id="refresh">
|
||||
@@ -82,52 +83,344 @@ class="active"
|
||||
</div><!-- /.box-body -->
|
||||
</div><!-- /. box -->
|
||||
|
||||
<!-- merge tickets modal -->
|
||||
<div class="modal fade" id="MergeTickets">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" id="merge-close" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">{!! Lang::get('lang.merge-ticket') !!} </h4>
|
||||
</div><!-- /.modal-header-->
|
||||
<div class ="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
<div class="col-md-6" id="merge_loader" style="display:none;">
|
||||
<img src="{{asset("lb-faveo/media/images/gifloader.gif")}}"><br/><br/><br/>
|
||||
</div><!-- /.merge-loader -->
|
||||
</div>
|
||||
<div id="merge_body">
|
||||
<div id="merge-body-alert">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div id="merge-succ-alert" class="alert alert-success alert-dismissable" style="display:none;" >
|
||||
<!--<button id="dismiss-merge" type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>-->
|
||||
<h4><i class="icon fa fa-check"></i>Alert!</h4>
|
||||
<div id="message-merge-succ"></div>
|
||||
</div>
|
||||
<div id="merge-err-alert" class="alert alert-danger alert-dismissable" style="display:none;">
|
||||
<!--<button id="dismiss-merge2" type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>-->
|
||||
<h4><i class="icon fa fa-ban"></i>Alert!</h4>
|
||||
<div id="message-merge-err"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- /.merge-alert -->
|
||||
<div id="merge-body-form">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
{!! Form::open(['id'=>'merge-form','method' => 'PATCH'] )!!}
|
||||
<label>{!! Lang::get('lang.title') !!}</label>
|
||||
<input type="text" name='title' class="form-control" value="" placeholder="Optional" />
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label>{!! Lang::get('lang.select-pparent-ticket') !!}</label>
|
||||
<select class="form-control" id="select-merge-parent" name='p_id' data-placeholder="{!! Lang::get('lang.select_tickets') !!}" style="width: 100%;"><option value=""></option></select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<label>{!! Lang::get('lang.merge-reason') !!}</label>
|
||||
<textarea name="reason" class="form-control"></textarea>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div><!-- mereg-body-form -->
|
||||
</div><!-- merge-body -->
|
||||
</div><!-- /.modal-body -->
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal" id="dismis2">{!! Lang::get('lang.close') !!}</button>
|
||||
<input type="submit" id="merge-btn" class="btn btn-primary pull-right" value="{!! Lang::get('lang.merge') !!}"></input>
|
||||
{!! Form::close() !!}
|
||||
</div><!-- /.modal-footer -->
|
||||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
</div><!-- /.modal -->
|
||||
|
||||
<!-- Modal -->
|
||||
<div class="modal fade in" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="false" style="display: none; padding-right: 15px;background-color: rgba(0, 0, 0, 0.7);">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="col-md-2"></div>
|
||||
<div class="col-md-8">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close closemodal" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title" id="myModalLabel"></h4>
|
||||
</div>
|
||||
<div class="modal-body" id="custom-alert-body" >
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-primary pull-left yes" data-dismiss="modal">{{Lang::get('lang.ok')}}</button>
|
||||
<button type="button" class="btn btn-default no">{{Lang::get('lang.cancel')}}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
$(function () {
|
||||
var t_id =[];
|
||||
var option = null;
|
||||
$(function () {
|
||||
//Enable check and uncheck all functionality
|
||||
$(".checkbox-toggle").click(function () {
|
||||
var clicks = $(this).data('clicks');
|
||||
if (clicks) {
|
||||
var clicks = $(this).data('clicks');
|
||||
if (clicks) {
|
||||
//Uncheck all checkboxes
|
||||
$(".mailbox-messages input[type='checkbox']").iCheck("uncheck");
|
||||
$(".fa", this).removeClass("fa-check-square-o").addClass('fa-square-o');
|
||||
} else {
|
||||
//Check all checkboxes
|
||||
$(".mailbox-messages input[type='checkbox']").iCheck("check");
|
||||
$(".fa", this).removeClass("fa-square-o").addClass('fa-check-square-o');
|
||||
}
|
||||
$(this).data("clicks", !clicks);
|
||||
$(".mailbox-messages input[type='checkbox']").iCheck("uncheck");
|
||||
$(".fa", this).removeClass("fa-check-square-o").addClass('fa-square-o');
|
||||
} else {
|
||||
//Check all checkboxes
|
||||
$(".mailbox-messages input[type='checkbox']").iCheck("check");
|
||||
$(".fa", this).removeClass("fa-square-o").addClass('fa-check-square-o');
|
||||
}
|
||||
$(this).data("clicks", !clicks);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
$(function() {
|
||||
// Enable check and uncheck all functionality
|
||||
|
||||
$(".checkbox-toggle").click(function() {
|
||||
var clicks = $(this).data('clicks');
|
||||
if (clicks) {
|
||||
//Uncheck all checkboxes
|
||||
$("input[type='checkbox']", ".mailbox-messages").iCheck("uncheck");
|
||||
// alert($("input[type='checkbox']").val());
|
||||
t_id = $('.selectval').map(function() {
|
||||
return $(this).val();
|
||||
}).get();
|
||||
// alert(checkboxValues);
|
||||
} else {
|
||||
//Check all checkboxes
|
||||
$("input[type='checkbox']", ".mailbox-messages").iCheck("check");
|
||||
// alert('Hallo');
|
||||
t_id = [];
|
||||
}
|
||||
$(this).data("clicks", !clicks);
|
||||
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
$(document).ready(function() { /// Wait till page is loaded
|
||||
$('#click').click(function() {
|
||||
$('#refresh').load('answered #refresh');
|
||||
$('#title_refresh').load('answered #title_refresh');
|
||||
$('#count_refresh').load('answered #count_refresh');
|
||||
$('#refresh').load('inbox #refresh');
|
||||
$('#title_refresh').load('inbox #title_refresh');
|
||||
$('#count_refresh').load('inbox #count_refresh');
|
||||
$("#show").show();
|
||||
});
|
||||
|
||||
$(".select2").select2();
|
||||
|
||||
$('#delete').on('click', function(){
|
||||
option = 0;
|
||||
$('#myModalLabel').html("{{Lang::get('lang.delete-tickets')}}");
|
||||
});
|
||||
|
||||
$('#close').on('click', function(){
|
||||
option = 1;
|
||||
$('#myModalLabel').html("{{Lang::get('lang.close-tickets')}}");
|
||||
});
|
||||
|
||||
$("#modalpopup").on('submit', function(e){
|
||||
e.preventDefault();
|
||||
var msg ="{{Lang::get('lang.confirm')}}";
|
||||
var values = getValues();
|
||||
if(values == ""){
|
||||
msg = "{{Lang::get('lang.select-ticket')}}";
|
||||
$('.yes').html("{{Lang::get('lang.ok')}}");
|
||||
$('#myModalLabel').html("{{Lang::get('lang.alert')}}");
|
||||
} else {
|
||||
$('.yes').html("Yes");
|
||||
}
|
||||
$('#custom-alert-body').html(msg);
|
||||
$("#myModal").css("display", "block");
|
||||
});
|
||||
|
||||
$(".closemodal, .no").click(function(){
|
||||
|
||||
$("#myModal").css("display", "none");
|
||||
|
||||
});
|
||||
|
||||
$('.yes').click(function(){
|
||||
var values = getValues();
|
||||
if(values == ""){
|
||||
$("#myModal").css("display", "none");
|
||||
} else {
|
||||
$("#myModal").css("display", "none");
|
||||
$("#modalpopup").unbind('submit');
|
||||
if (option == 0) {
|
||||
//alert('delete');
|
||||
$('#delete').click();
|
||||
} else {
|
||||
//alert('close');
|
||||
$('#close').click();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function getValues(){
|
||||
var values = $('.selectval:checked').map(function() {
|
||||
return $(this).val();
|
||||
}).get();
|
||||
return values;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//checking merging tickets
|
||||
$('#MergeTickets').on('show.bs.modal', function () {
|
||||
|
||||
// alert("hi");
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: "{{route('check.merge.tickets',0)}}",
|
||||
dataType: "html",
|
||||
data:{data1: t_id},
|
||||
beforeSend: function() {
|
||||
$("#merge_body").hide();
|
||||
$("#merge_loader").show();
|
||||
},
|
||||
success: function(response) {
|
||||
if(response == 0) {
|
||||
$("#merge_body").show();
|
||||
$("#merge-succ-alert").hide();
|
||||
$("#merge-body-alert").show();
|
||||
$("#merge-body-form").hide();
|
||||
$("#merge_loader").hide();
|
||||
$("#merge-btn").attr('disabled', true);
|
||||
var message = "{{Lang::get('lang.select-tickets-to merge')}}";
|
||||
$("#merge-err-alert").show();
|
||||
$('#message-merge-err').html(message);
|
||||
|
||||
} else if(response == 2) {
|
||||
$("#merge_body").show();
|
||||
$("#merge-succ-alert").hide();
|
||||
$("#merge-body-alert").show();
|
||||
$("#merge-body-form").hide();
|
||||
$("#merge_loader").hide();
|
||||
$("#merge-btn").attr('disabled', true);
|
||||
var message = "{{Lang::get('lang.different-users')}}";
|
||||
$("#merge-err-alert").show();
|
||||
$('#message-merge-err').html(message);
|
||||
} else {
|
||||
|
||||
$("#merge_body").show();
|
||||
$("#merge-body-alert").hide();
|
||||
$("#merge-body-form").show();
|
||||
$("#merge_loader").hide();
|
||||
$("#merge-btn").attr('disabled', false);
|
||||
$("#merge_loader").hide();
|
||||
$.ajax({
|
||||
url: "{{ route('get.merge.tickets',0) }}",
|
||||
dataType: "html",
|
||||
data:{data1: t_id},
|
||||
success: function(data) {
|
||||
|
||||
$('#select-merge-parent').html(data);
|
||||
}
|
||||
// return false;
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//submit merging form
|
||||
$('#merge-form').on('submit', function(){
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "{!! url('merge-tickets/') !!}/"+t_id,
|
||||
dataType: "json",
|
||||
data: $(this).serialize(),
|
||||
beforeSend: function() {
|
||||
$("#merge_body").hide();
|
||||
$("#merge_loader").show();
|
||||
|
||||
},
|
||||
success: function(response) {
|
||||
if(response == 0) {
|
||||
$("#merge_body").show();
|
||||
$("#merge-succ-alert").hide();
|
||||
$("#merge-body-alert").show();
|
||||
$("#merge-body-form").hide();
|
||||
$("#merge_loader").hide();
|
||||
$("#merge-btn").attr('disabled', true);
|
||||
var message = "{{Lang::get('lang.merge-error')}}";
|
||||
$("#merge-err-alert").show();
|
||||
$('#message-merge-err').html(message);
|
||||
|
||||
} else {
|
||||
$("#merge_body").show();
|
||||
$("#merge-err-alert").hide();
|
||||
$("#merge-body-alert").show();
|
||||
$("#merge-body-form").hide();
|
||||
$("#merge_loader").hide();
|
||||
$("#merge-btn").attr('disabled', true);
|
||||
var message = "{{Lang::get('lang.merge-success')}}";
|
||||
$("#merge-succ-alert").show();
|
||||
$('#message-merge-succ').html(message);
|
||||
setInterval(function(){
|
||||
$("#alert11").hide();
|
||||
setTimeout(function() {
|
||||
var link = document.querySelector('#load-answered');
|
||||
if(link) {
|
||||
link.click();
|
||||
}
|
||||
}, 500);
|
||||
},2000);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
return false;
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function someFunction(id){
|
||||
if(document.getElementById(id).checked) {
|
||||
t_id.push(id);
|
||||
// alert(t_id);
|
||||
} else {
|
||||
var index = t_id.indexOf(id);
|
||||
t_id.splice(index, 1);
|
||||
// alert(t_id);
|
||||
}
|
||||
|
||||
// thisid.push(id);
|
||||
// alert(thisid);
|
||||
// document.getElementById("demo").innerHTML = thisid;
|
||||
|
||||
|
||||
// push.thisid;
|
||||
// alert(thisid);
|
||||
|
||||
// document.getElementByID('demo').innerHTML = thisid;
|
||||
}
|
||||
|
||||
</script>
|
||||
@stop
|
@@ -43,13 +43,14 @@ class="active"
|
||||
@endif
|
||||
<div class="box-body">
|
||||
|
||||
{!! Form::open(['route'=>'select_all','method'=>'post']) !!}
|
||||
{!! Form::open(['id'=>'modalpopup', 'route'=>'select_all','method'=>'post']) !!}
|
||||
|
||||
<div class="mailbox-controls">
|
||||
<!-- Check all button -->
|
||||
<a class="btn btn-default btn-sm checkbox-toggle"><i class="fa fa-square-o"></i></a>
|
||||
<input type="submit" class="btn btn-default text-orange btn-sm" name="submit" value="{!! Lang::get('lang.delete') !!}">
|
||||
<input type="submit" class="btn btn-default text-yellow btn-sm" name="submit" value="{!! Lang::get('lang.close') !!}">
|
||||
<input type="submit" class="submit btn btn-default text-orange btn-sm" id="delete" name="submit" value="{!! Lang::get('lang.delete') !!}">
|
||||
<input type="submit" class="submit btn btn-default text-yellow btn-sm" id="close" name="submit" value="{!! Lang::get('lang.close') !!}">
|
||||
<button type="button" class="btn btn-sm btn-default text-green" id="Edit_Ticket" data-toggle="modal" data-target="#MergeTickets"><i class="fa fa-code-fork"> </i> {!! Lang::get('lang.merge') !!}</button>
|
||||
</div>
|
||||
<div class="mailbox-messages" id="refresh">
|
||||
<p style="display:none;text-align:center; position:fixed; margin-left:40%;margin-top:-70px;" id="show" class="text-red"><b>{!! Lang::get('lang.loading') !!}...</b></p>
|
||||
@@ -73,85 +74,345 @@ class="active"
|
||||
</div><!-- /.box-body -->
|
||||
</div><!-- /. box -->
|
||||
|
||||
<!-- merge tickets modal -->
|
||||
<div class="modal fade" id="MergeTickets">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" id="merge-close" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">{!! Lang::get('lang.merge-ticket') !!} </h4>
|
||||
</div><!-- /.modal-header-->
|
||||
<div class ="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
<div class="col-md-6" id="merge_loader" style="display:none;">
|
||||
<img src="{{asset("lb-faveo/media/images/gifloader.gif")}}"><br/><br/><br/>
|
||||
</div><!-- /.merge-loader -->
|
||||
</div>
|
||||
<div id="merge_body">
|
||||
<div id="merge-body-alert">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div id="merge-succ-alert" class="alert alert-success alert-dismissable" style="display:none;" >
|
||||
<!--<button id="dismiss-merge" type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>-->
|
||||
<h4><i class="icon fa fa-check"></i>Alert!</h4>
|
||||
<div id="message-merge-succ"></div>
|
||||
</div>
|
||||
<div id="merge-err-alert" class="alert alert-danger alert-dismissable" style="display:none;">
|
||||
<!--<button id="dismiss-merge2" type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>-->
|
||||
<h4><i class="icon fa fa-ban"></i>Alert!</h4>
|
||||
<div id="message-merge-err"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- /.merge-alert -->
|
||||
<div id="merge-body-form">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
{!! Form::open(['id'=>'merge-form','method' => 'PATCH'] )!!}
|
||||
<label>{!! Lang::get('lang.title') !!}</label>
|
||||
<input type="text" name='title' class="form-control" value="" placeholder="Optional" />
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label>{!! Lang::get('lang.select-pparent-ticket') !!}</label>
|
||||
<select class="form-control" id="select-merge-parent" name='p_id' data-placeholder="{!! Lang::get('lang.select_tickets') !!}" style="width: 100%;"><option value=""></option></select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<label>{!! Lang::get('lang.merge-reason') !!}</label>
|
||||
<textarea name="reason" class="form-control"></textarea>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div><!-- mereg-body-form -->
|
||||
</div><!-- merge-body -->
|
||||
</div><!-- /.modal-body -->
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal" id="dismis2">{!! Lang::get('lang.close') !!}</button>
|
||||
<input type="submit" id="merge-btn" class="btn btn-primary pull-right" value="{!! Lang::get('lang.merge') !!}"></input>
|
||||
{!! Form::close() !!}
|
||||
</div><!-- /.modal-footer -->
|
||||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
</div><!-- /.modal -->
|
||||
|
||||
<!-- Modal -->
|
||||
<div class="modal fade in" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="false" style="display: none; padding-right: 15px;background-color: rgba(0, 0, 0, 0.7);">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="col-md-2"></div>
|
||||
<div class="col-md-8">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close closemodal" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title" id="myModalLabel"></h4>
|
||||
</div>
|
||||
<div class="modal-body" id="custom-alert-body" >
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-primary pull-left yes" data-dismiss="modal">{{Lang::get('lang.ok')}}</button>
|
||||
<button type="button" class="btn btn-default no">{{Lang::get('lang.cancel')}}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
$(function () {
|
||||
var t_id =[];
|
||||
var option = null;
|
||||
$(function () {
|
||||
//Enable check and uncheck all functionality
|
||||
$(".checkbox-toggle").click(function () {
|
||||
var clicks = $(this).data('clicks');
|
||||
if (clicks) {
|
||||
var clicks = $(this).data('clicks');
|
||||
if (clicks) {
|
||||
//Uncheck all checkboxes
|
||||
$(".mailbox-messages input[type='checkbox']").iCheck("uncheck");
|
||||
$(".fa", this).removeClass("fa-check-square-o").addClass('fa-square-o');
|
||||
} else {
|
||||
//Check all checkboxes
|
||||
$(".mailbox-messages input[type='checkbox']").iCheck("check");
|
||||
$(".fa", this).removeClass("fa-square-o").addClass('fa-check-square-o');
|
||||
}
|
||||
$(this).data("clicks", !clicks);
|
||||
$(".mailbox-messages input[type='checkbox']").iCheck("uncheck");
|
||||
$(".fa", this).removeClass("fa-check-square-o").addClass('fa-square-o');
|
||||
} else {
|
||||
//Check all checkboxes
|
||||
$(".mailbox-messages input[type='checkbox']").iCheck("check");
|
||||
$(".fa", this).removeClass("fa-square-o").addClass('fa-check-square-o');
|
||||
}
|
||||
$(this).data("clicks", !clicks);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
$(function() {
|
||||
// Enable check and uncheck all functionality
|
||||
|
||||
$(".checkbox-toggle").click(function() {
|
||||
var clicks = $(this).data('clicks');
|
||||
if (clicks) {
|
||||
//Uncheck all checkboxes
|
||||
$("input[type='checkbox']", ".mailbox-messages").iCheck("uncheck");
|
||||
// alert($("input[type='checkbox']").val());
|
||||
t_id = $('.selectval').map(function() {
|
||||
return $(this).val();
|
||||
}).get();
|
||||
// alert(checkboxValues);
|
||||
} else {
|
||||
//Check all checkboxes
|
||||
$("input[type='checkbox']", ".mailbox-messages").iCheck("check");
|
||||
// alert('Hallo');
|
||||
t_id = [];
|
||||
}
|
||||
$(this).data("clicks", !clicks);
|
||||
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
$(document).ready(function() { /// Wait till page is loaded
|
||||
$('#click').click(function() {
|
||||
$('#refresh').load('assigned #refresh');
|
||||
$('#title_refresh').load('assigned #title_refresh');
|
||||
$('#count_refresh').load('assigned #count_refresh');
|
||||
$('#refresh').load('inbox #refresh');
|
||||
$('#title_refresh').load('inbox #title_refresh');
|
||||
$('#count_refresh').load('inbox #count_refresh');
|
||||
$("#show").show();
|
||||
});
|
||||
|
||||
$(".select2").select2();
|
||||
|
||||
$('#delete').on('click', function(){
|
||||
option = 0;
|
||||
$('#myModalLabel').html("{{Lang::get('lang.delete-tickets')}}");
|
||||
});
|
||||
|
||||
$('#close').on('click', function(){
|
||||
option = 1;
|
||||
$('#myModalLabel').html("{{Lang::get('lang.close-tickets')}}");
|
||||
});
|
||||
|
||||
$("#modalpopup").on('submit', function(e){
|
||||
e.preventDefault();
|
||||
var msg ="{{Lang::get('lang.confirm')}}";
|
||||
var values = getValues();
|
||||
if(values == ""){
|
||||
msg = "{{Lang::get('lang.select-ticket')}}";
|
||||
$('.yes').html("{{Lang::get('lang.ok')}}");
|
||||
$('#myModalLabel').html("{{Lang::get('lang.alert')}}");
|
||||
} else {
|
||||
$('.yes').html("Yes");
|
||||
}
|
||||
$('#custom-alert-body').html(msg);
|
||||
$("#myModal").css("display", "block");
|
||||
});
|
||||
|
||||
$(".closemodal, .no").click(function(){
|
||||
|
||||
$("#myModal").css("display", "none");
|
||||
|
||||
});
|
||||
|
||||
$('.yes').click(function(){
|
||||
var values = getValues();
|
||||
if(values == ""){
|
||||
$("#myModal").css("display", "none");
|
||||
} else {
|
||||
$("#myModal").css("display", "none");
|
||||
$("#modalpopup").unbind('submit');
|
||||
if (option == 0) {
|
||||
//alert('delete');
|
||||
$('#delete').click();
|
||||
} else {
|
||||
//alert('close');
|
||||
$('#close').click();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function getValues(){
|
||||
var values = $('.selectval:checked').map(function() {
|
||||
return $(this).val();
|
||||
}).get();
|
||||
return values;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//checking merging tickets
|
||||
$('#MergeTickets').on('show.bs.modal', function () {
|
||||
|
||||
// alert("hi");
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: "{{route('check.merge.tickets',0)}}",
|
||||
dataType: "html",
|
||||
data:{data1: t_id},
|
||||
beforeSend: function() {
|
||||
$("#merge_body").hide();
|
||||
$("#merge_loader").show();
|
||||
},
|
||||
success: function(response) {
|
||||
if(response == 0) {
|
||||
$("#merge_body").show();
|
||||
$("#merge-succ-alert").hide();
|
||||
$("#merge-body-alert").show();
|
||||
$("#merge-body-form").hide();
|
||||
$("#merge_loader").hide();
|
||||
$("#merge-btn").attr('disabled', true);
|
||||
var message = "{{Lang::get('lang.select-tickets-to merge')}}";
|
||||
$("#merge-err-alert").show();
|
||||
$('#message-merge-err').html(message);
|
||||
|
||||
} else if(response == 2) {
|
||||
$("#merge_body").show();
|
||||
$("#merge-succ-alert").hide();
|
||||
$("#merge-body-alert").show();
|
||||
$("#merge-body-form").hide();
|
||||
$("#merge_loader").hide();
|
||||
$("#merge-btn").attr('disabled', true);
|
||||
var message = "{{Lang::get('lang.different-users')}}";
|
||||
$("#merge-err-alert").show();
|
||||
$('#message-merge-err').html(message);
|
||||
} else {
|
||||
|
||||
$("#merge_body").show();
|
||||
$("#merge-body-alert").hide();
|
||||
$("#merge-body-form").show();
|
||||
$("#merge_loader").hide();
|
||||
$("#merge-btn").attr('disabled', false);
|
||||
$("#merge_loader").hide();
|
||||
$.ajax({
|
||||
url: "{{ route('get.merge.tickets',0) }}",
|
||||
dataType: "html",
|
||||
data:{data1: t_id},
|
||||
success: function(data) {
|
||||
|
||||
$('#select-merge-parent').html(data);
|
||||
}
|
||||
// return false;
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//submit merging form
|
||||
$('#merge-form').on('submit', function(){
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "{!! url('merge-tickets/') !!}/"+t_id,
|
||||
dataType: "json",
|
||||
data: $(this).serialize(),
|
||||
beforeSend: function() {
|
||||
$("#merge_body").hide();
|
||||
$("#merge_loader").show();
|
||||
|
||||
},
|
||||
success: function(response) {
|
||||
if(response == 0) {
|
||||
$("#merge_body").show();
|
||||
$("#merge-succ-alert").hide();
|
||||
$("#merge-body-alert").show();
|
||||
$("#merge-body-form").hide();
|
||||
$("#merge_loader").hide();
|
||||
$("#merge-btn").attr('disabled', true);
|
||||
var message = "{{Lang::get('lang.merge-error')}}";
|
||||
$("#merge-err-alert").show();
|
||||
$('#message-merge-err').html(message);
|
||||
|
||||
} else {
|
||||
$("#merge_body").show();
|
||||
$("#merge-err-alert").hide();
|
||||
$("#merge-body-alert").show();
|
||||
$("#merge-body-form").hide();
|
||||
$("#merge_loader").hide();
|
||||
$("#merge-btn").attr('disabled', true);
|
||||
var message = "{{Lang::get('lang.merge-success')}}";
|
||||
$("#merge-succ-alert").show();
|
||||
$('#message-merge-succ').html(message);
|
||||
setInterval(function(){
|
||||
$("#alert11").hide();
|
||||
setTimeout(function() {
|
||||
var link = document.querySelector('#load-assigned');
|
||||
if(link) {
|
||||
link.click();
|
||||
}
|
||||
}, 500);
|
||||
},2000);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
return false;
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
// check box get data
|
||||
// jQuery(function($) {
|
||||
// $("form input[id='check_all']").click(function() { // triggred check
|
||||
|
||||
// var inputs = $("form input[type='checkbox']"); // get the checkbox
|
||||
|
||||
|
||||
// for(var i = 0; i < inputs.length; i++) { // count input tag in the form
|
||||
// var type = inputs[i].getAttribute("type"); // get the type attribute
|
||||
// if(type == "checkbox") {
|
||||
// if(this.checked) {
|
||||
// inputs[i].checked = true; // checked
|
||||
// } else {
|
||||
// inputs[i].checked = false; // unchecked
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
function someFunction(id){
|
||||
if(document.getElementById(id).checked) {
|
||||
t_id.push(id);
|
||||
// alert(t_id);
|
||||
} else {
|
||||
var index = t_id.indexOf(id);
|
||||
t_id.splice(index, 1);
|
||||
// alert(t_id);
|
||||
}
|
||||
|
||||
// $("form input[id='submit']").click(function() { // triggred submit
|
||||
// thisid.push(id);
|
||||
// alert(thisid);
|
||||
// document.getElementById("demo").innerHTML = thisid;
|
||||
|
||||
// var count_checked = $("[name='data[]']:checked").length; // count the checked
|
||||
// if(count_checked == 0) {
|
||||
// alert("Please select a product(s) to delete.");
|
||||
// return false;
|
||||
// }
|
||||
// if(count_checked == 1) {
|
||||
// return confirm("Are you sure you want to delete these product?");
|
||||
// } else {
|
||||
// return confirm("Are you sure you want to delete these products?");
|
||||
// }
|
||||
// });
|
||||
// }); // jquery end
|
||||
|
||||
// push.thisid;
|
||||
// alert(thisid);
|
||||
|
||||
// document.getElementByID('demo').innerHTML = thisid;
|
||||
}
|
||||
|
||||
</script>
|
||||
@stop
|
@@ -43,14 +43,14 @@ class="active"
|
||||
@endif
|
||||
<div class="box-body">
|
||||
|
||||
{!! Form::open(['route'=>'select_all','method'=>'post']) !!}
|
||||
{!! Form::open(['id'=>'modalpopup', 'route'=>'select_all','method'=>'post']) !!}
|
||||
|
||||
<div class="mailbox-controls">
|
||||
<!-- Check all button -->
|
||||
<a class="btn btn-default btn-sm checkbox-toggle"><i class="fa fa-square-o"></i></a>
|
||||
{{-- <a class="btn btn-default btn-sm" id="click"><i class="fa fa-refresh"></i></a> --}}
|
||||
<input type="submit" class="btn btn-default text-orange btn-sm" name="submit" value="{!! Lang::get('lang.delete') !!}">
|
||||
<input type="submit" class="btn btn-default text-blue btn-sm" name="submit" value="{!! Lang::get('lang.open') !!}">
|
||||
<input type="submit" class="btn btn-default text-orange btn-sm" name="submit" id="delete" value="{!! Lang::get('lang.delete') !!}">
|
||||
<input type="submit" class="btn btn-default text-blue btn-sm" name="submit" id="close" value="{!! Lang::get('lang.open') !!}">
|
||||
</div>
|
||||
<div class="mailbox-messages" id="refresh">
|
||||
<p style="display:none;text-align:center; position:fixed; margin-left:40%;margin-top:-70px;" id="show" class="text-red"><b>{!! Lang::get('lang.loading') !!}...</b></p>
|
||||
@@ -75,8 +75,31 @@ class="active"
|
||||
</div><!-- /.box-body -->
|
||||
</div><!-- /. box -->
|
||||
|
||||
<!-- Modal -->
|
||||
<div class="modal fade in" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="false" style="display: none; padding-right: 15px;background-color: rgba(0, 0, 0, 0.7);">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="col-md-2"></div>
|
||||
<div class="col-md-8">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close closemodal" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title" id="myModalLabel"></h4>
|
||||
</div>
|
||||
<div class="modal-body" id="custom-alert-body" >
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-primary pull-left yes" data-dismiss="modal">{{Lang::get('lang.ok')}}</button>
|
||||
<button type="button" class="btn btn-default no">{{Lang::get('lang.cancel')}}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
var option = null;
|
||||
$(function () {
|
||||
//Enable check and uncheck all functionality
|
||||
$(".checkbox-toggle").click(function () {
|
||||
@@ -119,6 +142,62 @@ class="active"
|
||||
$('#count_refresh').load('closed #count_refresh');
|
||||
$("#show").show();
|
||||
});
|
||||
|
||||
$('#delete').on('click', function(){
|
||||
option = 0;
|
||||
$('#myModalLabel').html("{{Lang::get('lang.delete-tickets')}}");
|
||||
});
|
||||
|
||||
$('#close').on('click', function(){
|
||||
option = 1;
|
||||
$('#myModalLabel').html("{{Lang::get('lang.open-tickets')}}");
|
||||
});
|
||||
|
||||
$("#modalpopup").on('submit', function(e){
|
||||
e.preventDefault();
|
||||
var msg ="{{Lang::get('lang.confirm')}}";
|
||||
var values = getValues();
|
||||
if(values == ""){
|
||||
msg = "{{Lang::get('lang.select-ticket')}}";
|
||||
$('.yes').html("{{Lang::get('lang.ok')}}");
|
||||
$('#myModalLabel').html("{{Lang::get('lang.alert')}}");
|
||||
} else {
|
||||
$('.yes').html("Yes");
|
||||
}
|
||||
$('#custom-alert-body').html(msg);
|
||||
$("#myModal").css("display", "block");
|
||||
});
|
||||
|
||||
$(".closemodal, .no").click(function(){
|
||||
|
||||
$("#myModal").css("display", "none");
|
||||
|
||||
});
|
||||
|
||||
$('.yes').click(function(){
|
||||
var values = getValues();
|
||||
if(values == ""){
|
||||
$("#myModal").css("display", "none");
|
||||
} else {
|
||||
$("#myModal").css("display", "none");
|
||||
$("#modalpopup").unbind('submit');
|
||||
if (option == 0) {
|
||||
//alert('delete');
|
||||
$('#delete').click();
|
||||
} else {
|
||||
//alert('close');
|
||||
$('#close').click();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function getValues(){
|
||||
var values = $('.selectval:checked').map(function() {
|
||||
return $(this).val();
|
||||
}).get();
|
||||
return values;
|
||||
}
|
||||
|
||||
});
|
||||
</script>
|
||||
@stop
|
@@ -42,14 +42,14 @@ class="active"
|
||||
</div>
|
||||
@endif
|
||||
<div class="box-body ">
|
||||
{!! Form::open(['route'=>'select_all','method'=>'post']) !!}
|
||||
{!! Form::open(['id'=>'modalpopup', 'route'=>'select_all','method'=>'post']) !!}
|
||||
<div class="mailbox-controls">
|
||||
<!-- Check all button -->
|
||||
<a class="btn btn-default btn-sm checkbox-toggle"><i class="fa fa-square-o"></i></a>
|
||||
{{-- <a class="btn btn-default btn-sm" id="click"><i class="fa fa-refresh"></i></a> --}}
|
||||
<input type="submit" class="btn btn-default text-orange btn-sm" name="submit" value="{!! Lang::get('lang.delete') !!}">
|
||||
<input type="submit" class="btn btn-default text-yellow btn-sm" name="submit" value="{!! Lang::get('lang.close') !!}">
|
||||
<button type="button" class="btn btn-sm btn-default text-yellow" id="Edit_Ticket" data-toggle="modal" data-target="#MergeTickets"><i class="fa fa-chain"> </i> {!! Lang::get('lang.merge') !!}</button>
|
||||
<input type="submit" class="submit btn btn-default text-orange btn-sm" id="delete" name="submit" value="{!! Lang::get('lang.delete') !!}">
|
||||
<input type="submit" class="submit btn btn-default text-yellow btn-sm" id="close" name="submit" value="{!! Lang::get('lang.close') !!}">
|
||||
<button type="button" class="btn btn-sm btn-default text-green" id="Edit_Ticket" data-toggle="modal" data-target="#MergeTickets"><i class="fa fa-code-fork"> </i> {!! Lang::get('lang.merge') !!}</button>
|
||||
|
||||
</div>
|
||||
<div class="mailbox-messages" id="refresh">
|
||||
@@ -95,12 +95,12 @@ class="active"
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div id="merge-succ-alert" class="alert alert-success alert-dismissable" style="display:none;" >
|
||||
<button id="dismiss-merge" type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||
<!--<button id="dismiss-merge" type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>-->
|
||||
<h4><i class="icon fa fa-check"></i>Alert!</h4>
|
||||
<div id="message-merge-succ"></div>
|
||||
</div>
|
||||
<div id="merge-err-alert" class="alert alert-danger alert-dismissable" style="display:none;">
|
||||
<button id="dismiss-merge2" type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||
<!--<button id="dismiss-merge2" type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>-->
|
||||
<h4><i class="icon fa fa-ban"></i>Alert!</h4>
|
||||
<div id="message-merge-err"></div>
|
||||
</div>
|
||||
@@ -139,23 +139,45 @@ class="active"
|
||||
</div><!-- /.modal-dialog -->
|
||||
</div><!-- /.modal -->
|
||||
|
||||
<!-- Modal -->
|
||||
<div class="modal fade in" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="false" style="display: none; padding-right: 15px;background-color: rgba(0, 0, 0, 0.7);">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="col-md-2"></div>
|
||||
<div class="col-md-8">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close closemodal" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title" id="myModalLabel"></h4>
|
||||
</div>
|
||||
<div class="modal-body" id="custom-alert-body" >
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-primary pull-left yes" data-dismiss="modal">{{Lang::get('lang.ok')}}</button>
|
||||
<button type="button" class="btn btn-default no">{{Lang::get('lang.cancel')}}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
var t_id =[];
|
||||
$(function () {
|
||||
var option = null;
|
||||
$(function () {
|
||||
//Enable check and uncheck all functionality
|
||||
$(".checkbox-toggle").click(function () {
|
||||
var clicks = $(this).data('clicks');
|
||||
if (clicks) {
|
||||
var clicks = $(this).data('clicks');
|
||||
if (clicks) {
|
||||
//Uncheck all checkboxes
|
||||
$(".mailbox-messages input[type='checkbox']").iCheck("uncheck");
|
||||
$(".fa", this).removeClass("fa-check-square-o").addClass('fa-square-o');
|
||||
} else {
|
||||
//Check all checkboxes
|
||||
$(".mailbox-messages input[type='checkbox']").iCheck("check");
|
||||
$(".fa", this).removeClass("fa-square-o").addClass('fa-check-square-o');
|
||||
}
|
||||
$(this).data("clicks", !clicks);
|
||||
$(".mailbox-messages input[type='checkbox']").iCheck("uncheck");
|
||||
$(".fa", this).removeClass("fa-check-square-o").addClass('fa-square-o');
|
||||
} else {
|
||||
//Check all checkboxes
|
||||
$(".mailbox-messages input[type='checkbox']").iCheck("check");
|
||||
$(".fa", this).removeClass("fa-square-o").addClass('fa-check-square-o');
|
||||
}
|
||||
$(this).data("clicks", !clicks);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -167,14 +189,25 @@ class="active"
|
||||
if (clicks) {
|
||||
//Uncheck all checkboxes
|
||||
$("input[type='checkbox']", ".mailbox-messages").iCheck("uncheck");
|
||||
// alert($("input[type='checkbox']").val());
|
||||
t_id = $('.selectval').map(function() {
|
||||
return $(this).val();
|
||||
}).get();
|
||||
// alert(checkboxValues);
|
||||
} else {
|
||||
//Check all checkboxes
|
||||
$("input[type='checkbox']", ".mailbox-messages").iCheck("check");
|
||||
// alert('Hallo');
|
||||
t_id = [];
|
||||
}
|
||||
$(this).data("clicks", !clicks);
|
||||
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
$(document).ready(function() { /// Wait till page is loaded
|
||||
$('#click').click(function() {
|
||||
$('#refresh').load('inbox #refresh');
|
||||
@@ -184,13 +217,77 @@ class="active"
|
||||
});
|
||||
|
||||
$(".select2").select2();
|
||||
//checking merging tickets
|
||||
|
||||
$('#delete').on('click', function(){
|
||||
option = 0;
|
||||
$('#myModalLabel').html("{{Lang::get('lang.delete-tickets')}}");
|
||||
});
|
||||
|
||||
$('#close').on('click', function(){
|
||||
option = 1;
|
||||
$('#myModalLabel').html("{{Lang::get('lang.close-tickets')}}");
|
||||
});
|
||||
|
||||
$("#modalpopup").on('submit', function(e){
|
||||
e.preventDefault();
|
||||
var msg ="{{Lang::get('lang.confirm')}}";
|
||||
var values = getValues();
|
||||
if(values == ""){
|
||||
msg = "{{Lang::get('lang.select-ticket')}}";
|
||||
$('.yes').html("{{Lang::get('lang.ok')}}");
|
||||
$('#myModalLabel').html("{{Lang::get('lang.alert')}}");
|
||||
} else {
|
||||
$('.yes').html("Yes");
|
||||
}
|
||||
$('#custom-alert-body').html(msg);
|
||||
$("#myModal").css("display", "block");
|
||||
});
|
||||
|
||||
$(".closemodal, .no").click(function(){
|
||||
|
||||
$("#myModal").css("display", "none");
|
||||
|
||||
});
|
||||
|
||||
$(".closemodal, .no").click(function(){
|
||||
|
||||
$("#myModal").css("display", "none");
|
||||
|
||||
});
|
||||
|
||||
$('.yes').click(function(){
|
||||
var values = getValues();
|
||||
if(values == ""){
|
||||
$("#myModal").css("display", "none");
|
||||
} else {
|
||||
$("#myModal").css("display", "none");
|
||||
$("#modalpopup").unbind('submit');
|
||||
if (option == 0) {
|
||||
//alert('delete');
|
||||
$('#delete').click();
|
||||
} else {
|
||||
//alert('close');
|
||||
$('#close').click();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function getValues(){
|
||||
var values = $('.selectval:checked').map(function() {
|
||||
return $(this).val();
|
||||
}).get();
|
||||
return values;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//checking merging tickets
|
||||
$('#MergeTickets').on('show.bs.modal', function () {
|
||||
|
||||
// alert("hi");
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: "../check-merge-ticket/"+0,
|
||||
url: "{{route('check.merge.tickets',0)}}",
|
||||
dataType: "html",
|
||||
data:{data1: t_id},
|
||||
beforeSend: function() {
|
||||
@@ -200,6 +297,7 @@ class="active"
|
||||
success: function(response) {
|
||||
if(response == 0) {
|
||||
$("#merge_body").show();
|
||||
$("#merge-succ-alert").hide();
|
||||
$("#merge-body-alert").show();
|
||||
$("#merge-body-form").hide();
|
||||
$("#merge_loader").hide();
|
||||
@@ -209,7 +307,8 @@ class="active"
|
||||
$('#message-merge-err').html(message);
|
||||
|
||||
} else if(response == 2) {
|
||||
$("#merge_body").show();
|
||||
$("#merge_body").show();
|
||||
$("#merge-succ-alert").hide();
|
||||
$("#merge-body-alert").show();
|
||||
$("#merge-body-form").hide();
|
||||
$("#merge_loader").hide();
|
||||
@@ -226,7 +325,7 @@ class="active"
|
||||
$("#merge-btn").attr('disabled', false);
|
||||
$("#merge_loader").hide();
|
||||
$.ajax({
|
||||
url: "../get-merge-tickets/"+0,
|
||||
url: "{{ route('get.merge.tickets',0) }}",
|
||||
dataType: "html",
|
||||
data:{data1: t_id},
|
||||
success: function(data) {
|
||||
@@ -241,11 +340,11 @@ class="active"
|
||||
});
|
||||
});
|
||||
|
||||
//submit merging form
|
||||
$('#merge-form').on('submit', function(){
|
||||
$.ajax({
|
||||
//submit merging form
|
||||
$('#merge-form').on('submit', function(){
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "../merge-tickets/"+t_id,
|
||||
url: "{!! url('merge-tickets/') !!}/"+t_id,
|
||||
dataType: "json",
|
||||
data: $(this).serialize(),
|
||||
beforeSend: function() {
|
||||
@@ -256,6 +355,7 @@ class="active"
|
||||
success: function(response) {
|
||||
if(response == 0) {
|
||||
$("#merge_body").show();
|
||||
$("#merge-succ-alert").hide();
|
||||
$("#merge-body-alert").show();
|
||||
$("#merge-body-form").hide();
|
||||
$("#merge_loader").hide();
|
||||
@@ -266,6 +366,7 @@ class="active"
|
||||
|
||||
} else {
|
||||
$("#merge_body").show();
|
||||
$("#merge-err-alert").hide();
|
||||
$("#merge-body-alert").show();
|
||||
$("#merge-body-form").hide();
|
||||
$("#merge_loader").hide();
|
||||
@@ -289,12 +390,7 @@ class="active"
|
||||
})
|
||||
return false;
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
@@ -43,13 +43,14 @@ class="active"
|
||||
@endif
|
||||
<div class="box-body">
|
||||
|
||||
{!! Form::open(['route'=>'select_all','method'=>'post']) !!}
|
||||
{!! Form::open(['id'=>'modalpopup', 'route'=>'select_all','method'=>'post']) !!}
|
||||
<div class="mailbox-controls">
|
||||
<!-- Check all button -->
|
||||
<a class="btn btn-default btn-sm checkbox-toggle"><i class="fa fa-square-o"></i></a>
|
||||
{{-- <a class="btn btn-default btn-sm" id="click"><i class="fa fa-refresh"></i></a> --}}
|
||||
<input type="submit" class="btn btn-default text-orange btn-sm" name="submit" value="{!! Lang::get('lang.delete') !!}">
|
||||
<input type="submit" class="btn btn-default text-yellow btn-sm" name="submit" value="{!! Lang::get('lang.close') !!}">
|
||||
<input type="submit" class="submit btn btn-default text-orange btn-sm" id="delete" name="submit" value="{!! Lang::get('lang.delete') !!}">
|
||||
<input type="submit" class="submit btn btn-default text-yellow btn-sm" id="close" name="submit" value="{!! Lang::get('lang.close') !!}">
|
||||
<button type="button" class="btn btn-sm btn-default text-green" id="Edit_Ticket" data-toggle="modal" data-target="#MergeTickets"><i class="fa fa-code-fork"> </i> {!! Lang::get('lang.merge') !!}</button>
|
||||
</div>
|
||||
<div class="mailbox-messages" id="refresh">
|
||||
<p style="display:none;text-align:center; position:fixed; margin-left:40%;margin-top:-70px;" id="show" class="text-red"><b>{!! Lang::get('lang.loading') !!}...</b></p>
|
||||
@@ -74,50 +75,346 @@ class="active"
|
||||
</div><!-- /.box-body -->
|
||||
</div><!-- /. box -->
|
||||
|
||||
<!-- merge tickets modal -->
|
||||
<div class="modal fade" id="MergeTickets">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" id="merge-close" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">{!! Lang::get('lang.merge-ticket') !!} </h4>
|
||||
</div><!-- /.modal-header-->
|
||||
<div class ="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
<div class="col-md-6" id="merge_loader" style="display:none;">
|
||||
<img src="{{asset("lb-faveo/media/images/gifloader.gif")}}"><br/><br/><br/>
|
||||
</div><!-- /.merge-loader -->
|
||||
</div>
|
||||
<div id="merge_body">
|
||||
<div id="merge-body-alert">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div id="merge-succ-alert" class="alert alert-success alert-dismissable" style="display:none;" >
|
||||
<!--<button id="dismiss-merge" type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>-->
|
||||
<h4><i class="icon fa fa-check"></i>Alert!</h4>
|
||||
<div id="message-merge-succ"></div>
|
||||
</div>
|
||||
<div id="merge-err-alert" class="alert alert-danger alert-dismissable" style="display:none;">
|
||||
<!--<button id="dismiss-merge2" type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>-->
|
||||
<h4><i class="icon fa fa-ban"></i>Alert!</h4>
|
||||
<div id="message-merge-err"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- /.merge-alert -->
|
||||
<div id="merge-body-form">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
{!! Form::open(['id'=>'merge-form','method' => 'PATCH'] )!!}
|
||||
<label>{!! Lang::get('lang.title') !!}</label>
|
||||
<input type="text" name='title' class="form-control" value="" placeholder="Optional" />
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label>{!! Lang::get('lang.select-pparent-ticket') !!}</label>
|
||||
<select class="form-control" id="select-merge-parent" name='p_id' data-placeholder="{!! Lang::get('lang.select_tickets') !!}" style="width: 100%;"><option value=""></option></select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<label>{!! Lang::get('lang.merge-reason') !!}</label>
|
||||
<textarea name="reason" class="form-control"></textarea>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div><!-- mereg-body-form -->
|
||||
</div><!-- merge-body -->
|
||||
</div><!-- /.modal-body -->
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal" id="dismis2">{!! Lang::get('lang.close') !!}</button>
|
||||
<input type="submit" id="merge-btn" class="btn btn-primary pull-right" value="{!! Lang::get('lang.merge') !!}"></input>
|
||||
{!! Form::close() !!}
|
||||
</div><!-- /.modal-footer -->
|
||||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
</div><!-- /.modal -->
|
||||
|
||||
|
||||
<!-- Modal -->
|
||||
<div class="modal fade in" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="false" style="display: none; padding-right: 15px;background-color: rgba(0, 0, 0, 0.7);">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="col-md-2"></div>
|
||||
<div class="col-md-8">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close closemodal" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title" id="myModalLabel"></h4>
|
||||
</div>
|
||||
<div class="modal-body" id="custom-alert-body" >
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-primary pull-left yes" data-dismiss="modal">{{Lang::get('lang.ok')}}</button>
|
||||
<button type="button" class="btn btn-default no">{{Lang::get('lang.cancel')}}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
$(function () {
|
||||
var t_id =[];
|
||||
var option = null;
|
||||
$(function () {
|
||||
//Enable check and uncheck all functionality
|
||||
$(".checkbox-toggle").click(function () {
|
||||
var clicks = $(this).data('clicks');
|
||||
if (clicks) {
|
||||
var clicks = $(this).data('clicks');
|
||||
if (clicks) {
|
||||
//Uncheck all checkboxes
|
||||
$(".mailbox-messages input[type='checkbox']").iCheck("uncheck");
|
||||
$(".fa", this).removeClass("fa-check-square-o").addClass('fa-square-o');
|
||||
} else {
|
||||
//Check all checkboxes
|
||||
$(".mailbox-messages input[type='checkbox']").iCheck("check");
|
||||
$(".fa", this).removeClass("fa-square-o").addClass('fa-check-square-o');
|
||||
}
|
||||
$(this).data("clicks", !clicks);
|
||||
$(".mailbox-messages input[type='checkbox']").iCheck("uncheck");
|
||||
$(".fa", this).removeClass("fa-check-square-o").addClass('fa-square-o');
|
||||
} else {
|
||||
//Check all checkboxes
|
||||
$(".mailbox-messages input[type='checkbox']").iCheck("check");
|
||||
$(".fa", this).removeClass("fa-square-o").addClass('fa-check-square-o');
|
||||
}
|
||||
$(this).data("clicks", !clicks);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
$(function() {
|
||||
// Enable check and uncheck all functionality
|
||||
|
||||
$(".checkbox-toggle").click(function() {
|
||||
var clicks = $(this).data('clicks');
|
||||
if (clicks) {
|
||||
//Uncheck all checkboxes
|
||||
$("input[type='checkbox']", ".mailbox-messages").iCheck("uncheck");
|
||||
// alert($("input[type='checkbox']").val());
|
||||
t_id = $('.selectval').map(function() {
|
||||
return $(this).val();
|
||||
}).get();
|
||||
// alert(checkboxValues);
|
||||
} else {
|
||||
//Check all checkboxes
|
||||
$("input[type='checkbox']", ".mailbox-messages").iCheck("check");
|
||||
// alert('Hallo');
|
||||
t_id = [];
|
||||
}
|
||||
$(this).data("clicks", !clicks);
|
||||
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
$(document).ready(function() { /// Wait till page is loaded
|
||||
$('#click').click(function() {
|
||||
$('#refresh').load('myticket #refresh');
|
||||
$('#title_refresh').load('myticket #title_refresh');
|
||||
$('#count_refresh').load('myticket #count_refresh');
|
||||
$('#refresh').load('inbox #refresh');
|
||||
$('#title_refresh').load('inbox #title_refresh');
|
||||
$('#count_refresh').load('inbox #count_refresh');
|
||||
$("#show").show();
|
||||
});
|
||||
|
||||
$(".select2").select2();
|
||||
|
||||
$('#delete').on('click', function(){
|
||||
option = 0;
|
||||
$('#myModalLabel').html("{{Lang::get('lang.delete-tickets')}}");
|
||||
});
|
||||
|
||||
$('#close').on('click', function(){
|
||||
option = 1;
|
||||
$('#myModalLabel').html("{{Lang::get('lang.close-tickets')}}");
|
||||
});
|
||||
|
||||
$("#modalpopup").on('submit', function(e){
|
||||
e.preventDefault();
|
||||
var msg ="{{Lang::get('lang.confirm')}}";
|
||||
var values = getValues();
|
||||
if(values == ""){
|
||||
msg = "{{Lang::get('lang.select-ticket')}}";
|
||||
$('.yes').html("{{Lang::get('lang.ok')}}");
|
||||
$('#myModalLabel').html("{{Lang::get('lang.alert')}}");
|
||||
} else {
|
||||
$('.yes').html("Yes");
|
||||
}
|
||||
$('#custom-alert-body').html(msg);
|
||||
$("#myModal").css("display", "block");
|
||||
});
|
||||
|
||||
$(".closemodal, .no").click(function(){
|
||||
|
||||
$("#myModal").css("display", "none");
|
||||
|
||||
});
|
||||
|
||||
$('.yes').click(function(){
|
||||
var values = getValues();
|
||||
if(values == ""){
|
||||
$("#myModal").css("display", "none");
|
||||
} else {
|
||||
$("#myModal").css("display", "none");
|
||||
$("#modalpopup").unbind('submit');
|
||||
if (option == 0) {
|
||||
//alert('delete');
|
||||
$('#delete').click();
|
||||
} else {
|
||||
//alert('close');
|
||||
$('#close').click();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function getValues(){
|
||||
var values = $('.selectval:checked').map(function() {
|
||||
return $(this).val();
|
||||
}).get();
|
||||
return values;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//checking merging tickets
|
||||
$('#MergeTickets').on('show.bs.modal', function () {
|
||||
|
||||
// alert("hi");
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: "{{route('check.merge.tickets',0)}}",
|
||||
dataType: "html",
|
||||
data:{data1: t_id},
|
||||
beforeSend: function() {
|
||||
$("#merge_body").hide();
|
||||
$("#merge_loader").show();
|
||||
},
|
||||
success: function(response) {
|
||||
if(response == 0) {
|
||||
$("#merge_body").show();
|
||||
$("#merge-succ-alert").hide();
|
||||
$("#merge-body-alert").show();
|
||||
$("#merge-body-form").hide();
|
||||
$("#merge_loader").hide();
|
||||
$("#merge-btn").attr('disabled', true);
|
||||
var message = "{{Lang::get('lang.select-tickets-to merge')}}";
|
||||
$("#merge-err-alert").show();
|
||||
$('#message-merge-err').html(message);
|
||||
|
||||
} else if(response == 2) {
|
||||
$("#merge_body").show();
|
||||
$("#merge-succ-alert").hide();
|
||||
$("#merge-body-alert").show();
|
||||
$("#merge-body-form").hide();
|
||||
$("#merge_loader").hide();
|
||||
$("#merge-btn").attr('disabled', true);
|
||||
var message = "{{Lang::get('lang.different-users')}}";
|
||||
$("#merge-err-alert").show();
|
||||
$('#message-merge-err').html(message);
|
||||
} else {
|
||||
|
||||
$("#merge_body").show();
|
||||
$("#merge-body-alert").hide();
|
||||
$("#merge-body-form").show();
|
||||
$("#merge_loader").hide();
|
||||
$("#merge-btn").attr('disabled', false);
|
||||
$("#merge_loader").hide();
|
||||
$.ajax({
|
||||
url: "{{ route('get.merge.tickets',0) }}",
|
||||
dataType: "html",
|
||||
data:{data1: t_id},
|
||||
success: function(data) {
|
||||
|
||||
$('#select-merge-parent').html(data);
|
||||
}
|
||||
// return false;
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//submit merging form
|
||||
$('#merge-form').on('submit', function(){
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "{!! url('merge-tickets/') !!}/"+t_id,
|
||||
dataType: "json",
|
||||
data: $(this).serialize(),
|
||||
beforeSend: function() {
|
||||
$("#merge_body").hide();
|
||||
$("#merge_loader").show();
|
||||
|
||||
},
|
||||
success: function(response) {
|
||||
if(response == 0) {
|
||||
$("#merge_body").show();
|
||||
$("#merge-succ-alert").hide();
|
||||
$("#merge-body-alert").show();
|
||||
$("#merge-body-form").hide();
|
||||
$("#merge_loader").hide();
|
||||
$("#merge-btn").attr('disabled', true);
|
||||
var message = "{{Lang::get('lang.merge-error')}}";
|
||||
$("#merge-err-alert").show();
|
||||
$('#message-merge-err').html(message);
|
||||
|
||||
} else {
|
||||
$("#merge_body").show();
|
||||
$("#merge-err-alert").hide();
|
||||
$("#merge-body-alert").show();
|
||||
$("#merge-body-form").hide();
|
||||
$("#merge_loader").hide();
|
||||
$("#merge-btn").attr('disabled', true);
|
||||
var message = "{{Lang::get('lang.merge-success')}}";
|
||||
$("#merge-succ-alert").show();
|
||||
$('#message-merge-succ').html(message);
|
||||
setInterval(function(){
|
||||
$("#alert11").hide();
|
||||
setTimeout(function() {
|
||||
var link = document.querySelector('#load-myticket');
|
||||
if(link) {
|
||||
link.click();
|
||||
}
|
||||
}, 500);
|
||||
},2000);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
return false;
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function someFunction(id){
|
||||
if(document.getElementById(id).checked) {
|
||||
t_id.push(id);
|
||||
// alert(t_id);
|
||||
} else {
|
||||
var index = t_id.indexOf(id);
|
||||
t_id.splice(index, 1);
|
||||
// alert(t_id);
|
||||
}
|
||||
|
||||
// thisid.push(id);
|
||||
// alert(thisid);
|
||||
// document.getElementById("demo").innerHTML = thisid;
|
||||
|
||||
|
||||
// push.thisid;
|
||||
// alert(thisid);
|
||||
|
||||
// document.getElementByID('demo').innerHTML = thisid;
|
||||
}
|
||||
|
||||
</script>
|
||||
@stop
|
@@ -49,12 +49,13 @@ class="active"
|
||||
</div>
|
||||
@endif
|
||||
<div class="box-body">
|
||||
{!! Form::open(['route'=>'select_all','method'=>'post']) !!}
|
||||
{!! Form::open(['id'=>'modalpopup', 'route'=>'select_all','method'=>'post']) !!}
|
||||
<div class="mailbox-controls">
|
||||
<!-- Check all button -->
|
||||
<a class="btn btn-default btn-sm checkbox-toggle"><i class="fa fa-square-o"></i></a>
|
||||
<input type="submit" class="btn btn-default text-orange btn-sm" name="submit" value="{!! Lang::get('lang.delete') !!}">
|
||||
<input type="submit" class="btn btn-default text-yellow btn-sm" name="submit" value="{!! Lang::get('lang.close') !!}">
|
||||
<input type="submit" class="submit btn btn-default text-orange btn-sm" id="delete" name="submit" value="{!! Lang::get('lang.delete') !!}">
|
||||
<input type="submit" class="submit btn btn-default text-yellow btn-sm" id="close" name="submit" value="{!! Lang::get('lang.close') !!}">
|
||||
<button type="button" class="btn btn-sm btn-default text-green" id="Edit_Ticket" data-toggle="modal" data-target="#MergeTickets"><i class="fa fa-code-fork"> </i> {!! Lang::get('lang.merge') !!}</button>
|
||||
</div>
|
||||
<div class="mailbox-messages" id="refresh">
|
||||
<p style="display:none;text-align:center; position:fixed; margin-left:40%;margin-top:-70px;" id="show" class="text-red"><b>{!! Lang::get('lang.loading') !!}...</b></p>
|
||||
@@ -79,51 +80,343 @@ class="active"
|
||||
</div><!-- /.box-body -->
|
||||
</div><!-- /. box -->
|
||||
|
||||
<!-- merge tickets modal -->
|
||||
<div class="modal fade" id="MergeTickets">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" id="merge-close" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">{!! Lang::get('lang.merge-ticket') !!} </h4>
|
||||
</div><!-- /.modal-header-->
|
||||
<div class ="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
<div class="col-md-6" id="merge_loader" style="display:none;">
|
||||
<img src="{{asset("lb-faveo/media/images/gifloader.gif")}}"><br/><br/><br/>
|
||||
</div><!-- /.merge-loader -->
|
||||
</div>
|
||||
<div id="merge_body">
|
||||
<div id="merge-body-alert">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div id="merge-succ-alert" class="alert alert-success alert-dismissable" style="display:none;" >
|
||||
<!--<button id="dismiss-merge" type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>-->
|
||||
<h4><i class="icon fa fa-check"></i>Alert!</h4>
|
||||
<div id="message-merge-succ"></div>
|
||||
</div>
|
||||
<div id="merge-err-alert" class="alert alert-danger alert-dismissable" style="display:none;">
|
||||
<!--<button id="dismiss-merge2" type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>-->
|
||||
<h4><i class="icon fa fa-ban"></i>Alert!</h4>
|
||||
<div id="message-merge-err"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- /.merge-alert -->
|
||||
<div id="merge-body-form">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
{!! Form::open(['id'=>'merge-form','method' => 'PATCH'] )!!}
|
||||
<label>{!! Lang::get('lang.title') !!}</label>
|
||||
<input type="text" name='title' class="form-control" value="" placeholder="Optional" />
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label>{!! Lang::get('lang.select-pparent-ticket') !!}</label>
|
||||
<select class="form-control" id="select-merge-parent" name='p_id' data-placeholder="{!! Lang::get('lang.select_tickets') !!}" style="width: 100%;"><option value=""></option></select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<label>{!! Lang::get('lang.merge-reason') !!}</label>
|
||||
<textarea name="reason" class="form-control"></textarea>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div><!-- mereg-body-form -->
|
||||
</div><!-- merge-body -->
|
||||
</div><!-- /.modal-body -->
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal" id="dismis2">{!! Lang::get('lang.close') !!}</button>
|
||||
<input type="submit" id="merge-btn" class="btn btn-primary pull-right" value="{!! Lang::get('lang.merge') !!}"></input>
|
||||
{!! Form::close() !!}
|
||||
</div><!-- /.modal-footer -->
|
||||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
</div><!-- /.modal -->
|
||||
|
||||
<!-- Modal -->
|
||||
<div class="modal fade in" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="false" style="display: none; padding-right: 15px;background-color: rgba(0, 0, 0, 0.7);">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="col-md-2"></div>
|
||||
<div class="col-md-8">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close closemodal" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title" id="myModalLabel"></h4>
|
||||
</div>
|
||||
<div class="modal-body" id="custom-alert-body" >
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-primary pull-left yes" data-dismiss="modal">{{Lang::get('lang.ok')}}</button>
|
||||
<button type="button" class="btn btn-default no">{{Lang::get('lang.cancel')}}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
$(function () {
|
||||
var t_id =[];
|
||||
$(function () {
|
||||
//Enable check and uncheck all functionality
|
||||
$(".checkbox-toggle").click(function () {
|
||||
var clicks = $(this).data('clicks');
|
||||
if (clicks) {
|
||||
var clicks = $(this).data('clicks');
|
||||
if (clicks) {
|
||||
//Uncheck all checkboxes
|
||||
$(".mailbox-messages input[type='checkbox']").iCheck("uncheck");
|
||||
$(".fa", this).removeClass("fa-check-square-o").addClass('fa-square-o');
|
||||
} else {
|
||||
//Check all checkboxes
|
||||
$(".mailbox-messages input[type='checkbox']").iCheck("check");
|
||||
$(".fa", this).removeClass("fa-square-o").addClass('fa-check-square-o');
|
||||
}
|
||||
$(this).data("clicks", !clicks);
|
||||
$(".mailbox-messages input[type='checkbox']").iCheck("uncheck");
|
||||
$(".fa", this).removeClass("fa-check-square-o").addClass('fa-square-o');
|
||||
} else {
|
||||
//Check all checkboxes
|
||||
$(".mailbox-messages input[type='checkbox']").iCheck("check");
|
||||
$(".fa", this).removeClass("fa-square-o").addClass('fa-check-square-o');
|
||||
}
|
||||
$(this).data("clicks", !clicks);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
$(function() {
|
||||
// Enable check and uncheck all functionality
|
||||
|
||||
$(".checkbox-toggle").click(function() {
|
||||
var clicks = $(this).data('clicks');
|
||||
if (clicks) {
|
||||
//Uncheck all checkboxes
|
||||
$("input[type='checkbox']", ".mailbox-messages").iCheck("uncheck");
|
||||
// alert($("input[type='checkbox']").val());
|
||||
t_id = $('.selectval').map(function() {
|
||||
return $(this).val();
|
||||
}).get();
|
||||
// alert(checkboxValues);
|
||||
} else {
|
||||
//Check all checkboxes
|
||||
$("input[type='checkbox']", ".mailbox-messages").iCheck("check");
|
||||
// alert('Hallo');
|
||||
t_id = [];
|
||||
}
|
||||
$(this).data("clicks", !clicks);
|
||||
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
$(document).ready(function() { /// Wait till page is loaded
|
||||
$('#click').click(function() {
|
||||
$('#refresh').load('open #refresh');
|
||||
$('#title_refresh').load('open #title_refresh');
|
||||
$('#count_refresh').load('open #count_refresh');
|
||||
$('#refresh').load('inbox #refresh');
|
||||
$('#title_refresh').load('inbox #title_refresh');
|
||||
$('#count_refresh').load('inbox #count_refresh');
|
||||
$("#show").show();
|
||||
});
|
||||
|
||||
$(".select2").select2();
|
||||
|
||||
$('#delete').on('click', function(){
|
||||
option = 0;
|
||||
$('#myModalLabel').html("{{Lang::get('lang.delete-tickets')}}");
|
||||
});
|
||||
|
||||
$('#close').on('click', function(){
|
||||
option = 1;
|
||||
$('#myModalLabel').html("{{Lang::get('lang.close-tickets')}}");
|
||||
});
|
||||
|
||||
$("#modalpopup").on('submit', function(e){
|
||||
e.preventDefault();
|
||||
var msg ="{{Lang::get('lang.confirm')}}";
|
||||
var values = getValues();
|
||||
if(values == ""){
|
||||
msg = "{{Lang::get('lang.select-ticket')}}";
|
||||
$('.yes').html("{{Lang::get('lang.ok')}}");
|
||||
$('#myModalLabel').html("{{Lang::get('lang.alert')}}");
|
||||
} else {
|
||||
$('.yes').html("Yes");
|
||||
}
|
||||
$('#custom-alert-body').html(msg);
|
||||
$("#myModal").css("display", "block");
|
||||
});
|
||||
|
||||
$(".closemodal, .no").click(function(){
|
||||
|
||||
$("#myModal").css("display", "none");
|
||||
|
||||
});
|
||||
|
||||
$('.yes').click(function(){
|
||||
var values = getValues();
|
||||
if(values == ""){
|
||||
$("#myModal").css("display", "none");
|
||||
} else {
|
||||
$("#myModal").css("display", "none");
|
||||
$("#modalpopup").unbind('submit');
|
||||
if (option == 0) {
|
||||
//alert('delete');
|
||||
$('#delete').click();
|
||||
} else {
|
||||
//alert('close');
|
||||
$('#close').click();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function getValues(){
|
||||
var values = $('.selectval:checked').map(function() {
|
||||
return $(this).val();
|
||||
}).get();
|
||||
return values;
|
||||
}
|
||||
|
||||
|
||||
//checking merging tickets
|
||||
$('#MergeTickets').on('show.bs.modal', function () {
|
||||
|
||||
// alert("hi");
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: "{{route('check.merge.tickets',0)}}",
|
||||
dataType: "html",
|
||||
data:{data1: t_id},
|
||||
beforeSend: function() {
|
||||
$("#merge_body").hide();
|
||||
$("#merge_loader").show();
|
||||
},
|
||||
success: function(response) {
|
||||
if(response == 0) {
|
||||
$("#merge_body").show();
|
||||
$("#merge-succ-alert").hide();
|
||||
$("#merge-body-alert").show();
|
||||
$("#merge-body-form").hide();
|
||||
$("#merge_loader").hide();
|
||||
$("#merge-btn").attr('disabled', true);
|
||||
var message = "{{Lang::get('lang.select-tickets-to merge')}}";
|
||||
$("#merge-err-alert").show();
|
||||
$('#message-merge-err').html(message);
|
||||
|
||||
} else if(response == 2) {
|
||||
$("#merge_body").show();
|
||||
$("#merge-succ-alert").hide();
|
||||
$("#merge-body-alert").show();
|
||||
$("#merge-body-form").hide();
|
||||
$("#merge_loader").hide();
|
||||
$("#merge-btn").attr('disabled', true);
|
||||
var message = "{{Lang::get('lang.different-users')}}";
|
||||
$("#merge-err-alert").show();
|
||||
$('#message-merge-err').html(message);
|
||||
} else {
|
||||
|
||||
$("#merge_body").show();
|
||||
$("#merge-body-alert").hide();
|
||||
$("#merge-body-form").show();
|
||||
$("#merge_loader").hide();
|
||||
$("#merge-btn").attr('disabled', false);
|
||||
$("#merge_loader").hide();
|
||||
$.ajax({
|
||||
url: "{{ route('get.merge.tickets',0) }}",
|
||||
dataType: "html",
|
||||
data:{data1: t_id},
|
||||
success: function(data) {
|
||||
|
||||
$('#select-merge-parent').html(data);
|
||||
}
|
||||
// return false;
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//submit merging form
|
||||
$('#merge-form').on('submit', function(){
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "{!! url('merge-tickets/') !!}/"+t_id,
|
||||
dataType: "json",
|
||||
data: $(this).serialize(),
|
||||
beforeSend: function() {
|
||||
$("#merge_body").hide();
|
||||
$("#merge_loader").show();
|
||||
|
||||
},
|
||||
success: function(response) {
|
||||
if(response == 0) {
|
||||
$("#merge_body").show();
|
||||
$("#merge-succ-alert").hide();
|
||||
$("#merge-body-alert").show();
|
||||
$("#merge-body-form").hide();
|
||||
$("#merge_loader").hide();
|
||||
$("#merge-btn").attr('disabled', true);
|
||||
var message = "{{Lang::get('lang.merge-error')}}";
|
||||
$("#merge-err-alert").show();
|
||||
$('#message-merge-err').html(message);
|
||||
|
||||
} else {
|
||||
$("#merge_body").show();
|
||||
$("#merge-err-alert").hide();
|
||||
$("#merge-body-alert").show();
|
||||
$("#merge-body-form").hide();
|
||||
$("#merge_loader").hide();
|
||||
$("#merge-btn").attr('disabled', true);
|
||||
var message = "{{Lang::get('lang.merge-success')}}";
|
||||
$("#merge-succ-alert").show();
|
||||
$('#message-merge-succ').html(message);
|
||||
setInterval(function(){
|
||||
$("#alert11").hide();
|
||||
setTimeout(function() {
|
||||
var link = document.querySelector('#load-open');
|
||||
if(link) {
|
||||
link.click();
|
||||
}
|
||||
}, 500);
|
||||
},2000);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
return false;
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function someFunction(id){
|
||||
if(document.getElementById(id).checked) {
|
||||
t_id.push(id);
|
||||
// alert(t_id);
|
||||
} else {
|
||||
var index = t_id.indexOf(id);
|
||||
t_id.splice(index, 1);
|
||||
// alert(t_id);
|
||||
}
|
||||
|
||||
// thisid.push(id);
|
||||
// alert(thisid);
|
||||
// document.getElementById("demo").innerHTML = thisid;
|
||||
|
||||
|
||||
// push.thisid;
|
||||
// alert(thisid);
|
||||
|
||||
// document.getElementByID('demo').innerHTML = thisid;
|
||||
}
|
||||
|
||||
</script>
|
||||
@stop
|
@@ -113,7 +113,7 @@ active
|
||||
</button>
|
||||
<ul class="dropdown-menu pull-right">
|
||||
<li data-toggle="modal" data-target="#ChangeOwner"><a href="#"><i class="fa fa-users" style="color:green;"> </i>Change Owner</a></li>
|
||||
<li data-toggle="modal" data-target="#MergeTickets"><a href="#"><i class="fa fa-chain" style="color:teal;"> </i>{!! Lang::get('lang.merge-ticket') !!}</a></li>
|
||||
<li data-toggle="modal" data-target="#MergeTickets"><a href="#"><i class="fa fa-code-fork" style="color:teal;"> </i>{!! Lang::get('lang.merge-ticket') !!}</a></li>
|
||||
<?php if ($group->can_delete_ticket == 1) {?>
|
||||
<li id="delete"><a href="#"><i class="fa fa-trash-o" style="color:red;"> </i>{!! Lang::get('lang.delete_ticket') !!}</a></li>
|
||||
<?php }
|
||||
@@ -1163,12 +1163,12 @@ $count_teams = count($teams);
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div id="merge-succ-alert" class="alert alert-success alert-dismissable" style="display:none;" >
|
||||
<button id="dismiss-merge" type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||
<!-- <button id="dismiss-merge" type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button> -->
|
||||
<h4><i class="icon fa fa-check"></i>Alert!</h4>
|
||||
<div id="message-merge-succ"></div>
|
||||
</div>
|
||||
<div id="merge-err-alert" class="alert alert-danger alert-dismissable" style="display:none;">
|
||||
<button id="dismiss-merge2" type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||
<!-- <button id="dismiss-merge2" type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button> -->
|
||||
<h4><i class="icon fa fa-ban"></i>Alert!</h4>
|
||||
<div id="message-merge-err"></div>
|
||||
</div>
|
||||
@@ -1803,6 +1803,7 @@ jQuery(document).ready(function() {
|
||||
success: function(response) {
|
||||
if(response == 0) {
|
||||
$("#merge_body").show();
|
||||
$("#merge-succ-alert").hide();
|
||||
$("#merge-body-alert").show();
|
||||
$("#merge-body-form").hide();
|
||||
$("#merge_loader").hide();
|
||||
@@ -1848,6 +1849,7 @@ jQuery(document).ready(function() {
|
||||
success: function(response) {
|
||||
if(response == 0) {
|
||||
$("#merge_body").show();
|
||||
$("#merge-succ-alert").hide();
|
||||
$("#merge-body-alert").show();
|
||||
$("#merge-body-form").hide();
|
||||
$("#merge_loader").hide();
|
||||
@@ -1858,6 +1860,7 @@ jQuery(document).ready(function() {
|
||||
|
||||
} else if(response == 2) {
|
||||
$("#merge_body").show();
|
||||
$("#merge-succ-alert").hide();
|
||||
$("#merge-body-alert").show();
|
||||
$("#merge-body-form").hide();
|
||||
$("#merge_loader").hide();
|
||||
@@ -1868,6 +1871,7 @@ jQuery(document).ready(function() {
|
||||
|
||||
} else {
|
||||
$("#merge_body").show();
|
||||
$("#merge-err-alert").hide();
|
||||
$("#merge-body-alert").show();
|
||||
$("#merge-body-form").hide();
|
||||
$("#merge_loader").hide();
|
||||
|
@@ -45,12 +45,12 @@ class="active"
|
||||
@endif
|
||||
<div class="box-body">
|
||||
|
||||
{!! Form::open(['route'=>'select_all','method'=>'post']) !!}
|
||||
{!! Form::open(['id'=>'modalpopup', 'route'=>'select_all','method'=>'post']) !!}
|
||||
<div class="mailbox-controls">
|
||||
<!-- Check all button -->
|
||||
<a class="btn btn-default btn-sm checkbox-toggle"><i class="fa fa-square-o"></i></a>
|
||||
<input type="submit" class="btn btn-default text-blue btn-sm" name="submit" value="{!! Lang::get('lang.open') !!}">
|
||||
<input type="submit" class="btn btn-default text-yellow btn-sm" name="submit" value="{!! Lang::get('lang.close') !!}">
|
||||
<input type="submit" class="btn btn-default text-blue btn-sm" id="delete" name="submit" value="{!! Lang::get('lang.open') !!}">
|
||||
<input type="submit" class="btn btn-default text-yellow btn-sm" name="submit" id="close" value="{!! Lang::get('lang.close') !!}">
|
||||
|
||||
</div>
|
||||
<div class="mailbox-messages" id="refresh">
|
||||
@@ -76,8 +76,30 @@ class="active"
|
||||
{!! Form::close() !!}
|
||||
</div><!-- /.box-body -->
|
||||
</div><!-- /. box -->
|
||||
<!-- Modal -->
|
||||
<div class="modal fade in" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="false" style="display: none; padding-right: 15px;background-color: rgba(0, 0, 0, 0.7);">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="col-md-2"></div>
|
||||
<div class="col-md-8">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close closemodal" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title" id="myModalLabel"></h4>
|
||||
</div>
|
||||
<div class="modal-body" id="custom-alert-body" >
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-primary pull-left yes" data-dismiss="modal">{{Lang::get('lang.ok')}}</button>
|
||||
<button type="button" class="btn btn-default no">{{Lang::get('lang.cancel')}}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
var option = null;
|
||||
$(function () {
|
||||
//Enable check and uncheck all functionality
|
||||
$(".checkbox-toggle").click(function () {
|
||||
@@ -117,6 +139,61 @@ class="active"
|
||||
$('#count_refresh').load('trash #count_refresh');
|
||||
$("#show").show();
|
||||
});
|
||||
|
||||
$('#delete').on('click', function(){
|
||||
option = 0;
|
||||
$('#myModalLabel').html("{{Lang::get('lang.open-tickets')}}");
|
||||
});
|
||||
|
||||
$('#close').on('click', function(){
|
||||
option = 1;
|
||||
$('#myModalLabel').html("{{Lang::get('lang.close-tickets')}}");
|
||||
});
|
||||
|
||||
$("#modalpopup").on('submit', function(e){
|
||||
e.preventDefault();
|
||||
var msg ="{{Lang::get('lang.confirm')}}";
|
||||
var values = getValues();
|
||||
if(values == ""){
|
||||
msg = "{{Lang::get('lang.select-ticket')}}";
|
||||
$('.yes').html("{{Lang::get('lang.ok')}}");
|
||||
$('#myModalLabel').html("{{Lang::get('lang.alert')}}");
|
||||
} else {
|
||||
$('.yes').html("Yes");
|
||||
}
|
||||
$('#custom-alert-body').html(msg);
|
||||
$("#myModal").css("display", "block");
|
||||
});
|
||||
$(".closemodal, .no").click(function(){
|
||||
|
||||
$("#myModal").css("display", "none");
|
||||
|
||||
});
|
||||
|
||||
$('.yes').click(function(){
|
||||
var values = getValues();
|
||||
if(values == ""){
|
||||
$("#myModal").css("display", "none");
|
||||
} else {
|
||||
$("#myModal").css("display", "none");
|
||||
$("#modalpopup").unbind('submit');
|
||||
if (option == 0) {
|
||||
//alert('delete');
|
||||
$('#delete').click();
|
||||
} else {
|
||||
//alert('close');
|
||||
$('#close').click();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function getValues(){
|
||||
var values = $('.selectval:checked').map(function() {
|
||||
return $(this).val();
|
||||
}).get();
|
||||
return values;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
@@ -47,13 +47,14 @@ class="active"
|
||||
@endif
|
||||
<div class="box-body">
|
||||
|
||||
{!! Form::open(['route'=>'select_all','method'=>'post']) !!}
|
||||
{!! Form::open(['id'=>'modalpopup', 'route'=>'select_all','method'=>'post']) !!}
|
||||
|
||||
<div class="mailbox-controls">
|
||||
<!-- Check all button -->
|
||||
<a class="btn btn-default btn-sm checkbox-toggle"><i class="fa fa-square-o"></i></a>
|
||||
<input type="submit" class="btn btn-default text-orange btn-sm" name="submit" value="{!! Lang::get('lang.delete') !!}">
|
||||
<input type="submit" class="btn btn-default text-yellow btn-sm" name="submit" value="{!! Lang::get('lang.close') !!}">
|
||||
<input type="submit" class="submit btn btn-default text-orange btn-sm" id="delete" name="submit" value="{!! Lang::get('lang.delete') !!}">
|
||||
<input type="submit" class="submit btn btn-default text-yellow btn-sm" id="close" name="submit" value="{!! Lang::get('lang.close') !!}">
|
||||
<button type="button" class="btn btn-sm btn-default text-green" id="Edit_Ticket" data-toggle="modal" data-target="#MergeTickets"><i class="fa fa-code-fork"> </i> {!! Lang::get('lang.merge') !!}</button>
|
||||
</div>
|
||||
<div class="mailbox-messages" id="refresh">
|
||||
<p style="display:none;text-align:center; position:fixed; margin-left:40%;margin-top:-70px;" id="show" class="text-red"><b>{!! Lang::get('lang.loading') !!}...</b></p>
|
||||
@@ -79,52 +80,341 @@ class="active"
|
||||
</div><!-- /.box-body -->
|
||||
</div><!-- /. box -->
|
||||
|
||||
<!-- merge tickets modal -->
|
||||
<div class="modal fade" id="MergeTickets">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" id="merge-close" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">{!! Lang::get('lang.merge-ticket') !!} </h4>
|
||||
</div><!-- /.modal-header-->
|
||||
<div class ="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
<div class="col-md-6" id="merge_loader" style="display:none;">
|
||||
<img src="{{asset("lb-faveo/media/images/gifloader.gif")}}"><br/><br/><br/>
|
||||
</div><!-- /.merge-loader -->
|
||||
</div>
|
||||
<div id="merge_body">
|
||||
<div id="merge-body-alert">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div id="merge-succ-alert" class="alert alert-success alert-dismissable" style="display:none;" >
|
||||
<!--<button id="dismiss-merge" type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>-->
|
||||
<h4><i class="icon fa fa-check"></i>Alert!</h4>
|
||||
<div id="message-merge-succ"></div>
|
||||
</div>
|
||||
<div id="merge-err-alert" class="alert alert-danger alert-dismissable" style="display:none;">
|
||||
<!--<button id="dismiss-merge2" type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>-->
|
||||
<h4><i class="icon fa fa-ban"></i>Alert!</h4>
|
||||
<div id="message-merge-err"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- /.merge-alert -->
|
||||
<div id="merge-body-form">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
{!! Form::open(['id'=>'merge-form','method' => 'PATCH'] )!!}
|
||||
<label>{!! Lang::get('lang.title') !!}</label>
|
||||
<input type="text" name='title' class="form-control" value="" placeholder="Optional" />
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label>{!! Lang::get('lang.select-pparent-ticket') !!}</label>
|
||||
<select class="form-control" id="select-merge-parent" name='p_id' data-placeholder="{!! Lang::get('lang.select_tickets') !!}" style="width: 100%;"><option value=""></option></select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<label>{!! Lang::get('lang.merge-reason') !!}</label>
|
||||
<textarea name="reason" class="form-control"></textarea>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div><!-- mereg-body-form -->
|
||||
</div><!-- merge-body -->
|
||||
</div><!-- /.modal-body -->
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal" id="dismis2">{!! Lang::get('lang.close') !!}</button>
|
||||
<input type="submit" id="merge-btn" class="btn btn-primary pull-right" value="{!! Lang::get('lang.merge') !!}"></input>
|
||||
{!! Form::close() !!}
|
||||
</div><!-- /.modal-footer -->
|
||||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
</div><!-- /.modal -->
|
||||
|
||||
<!-- Modal -->
|
||||
<div class="modal fade in" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="false" style="display: none; padding-right: 15px;background-color: rgba(0, 0, 0, 0.7);">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="col-md-2"></div>
|
||||
<div class="col-md-8">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close closemodal" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title" id="myModalLabel"></h4>
|
||||
</div>
|
||||
<div class="modal-body" id="custom-alert-body" >
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-primary pull-left yes" data-dismiss="modal">{{Lang::get('lang.ok')}}</button>
|
||||
<button type="button" class="btn btn-default no">{{Lang::get('lang.cancel')}}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
$(function () {
|
||||
var t_id =[];
|
||||
var option = null;
|
||||
$(function () {
|
||||
//Enable check and uncheck all functionality
|
||||
$(".checkbox-toggle").click(function () {
|
||||
var clicks = $(this).data('clicks');
|
||||
if (clicks) {
|
||||
var clicks = $(this).data('clicks');
|
||||
if (clicks) {
|
||||
//Uncheck all checkboxes
|
||||
$(".mailbox-messages input[type='checkbox']").iCheck("uncheck");
|
||||
$(".fa", this).removeClass("fa-check-square-o").addClass('fa-square-o');
|
||||
} else {
|
||||
//Check all checkboxes
|
||||
$(".mailbox-messages input[type='checkbox']").iCheck("check");
|
||||
$(".fa", this).removeClass("fa-square-o").addClass('fa-check-square-o');
|
||||
}
|
||||
$(this).data("clicks", !clicks);
|
||||
$(".mailbox-messages input[type='checkbox']").iCheck("uncheck");
|
||||
$(".fa", this).removeClass("fa-check-square-o").addClass('fa-square-o');
|
||||
} else {
|
||||
//Check all checkboxes
|
||||
$(".mailbox-messages input[type='checkbox']").iCheck("check");
|
||||
$(".fa", this).removeClass("fa-square-o").addClass('fa-check-square-o');
|
||||
}
|
||||
$(this).data("clicks", !clicks);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
$(function() {
|
||||
// Enable check and uncheck all functionality
|
||||
|
||||
$(".checkbox-toggle").click(function() {
|
||||
var clicks = $(this).data('clicks');
|
||||
if (clicks) {
|
||||
//Uncheck all checkboxes
|
||||
$("input[type='checkbox']", ".mailbox-messages").iCheck("uncheck");
|
||||
// alert($("input[type='checkbox']").val());
|
||||
t_id = $('.selectval').map(function() {
|
||||
return $(this).val();
|
||||
}).get();
|
||||
// alert(checkboxValues);
|
||||
} else {
|
||||
//Check all checkboxes
|
||||
$("input[type='checkbox']", ".mailbox-messages").iCheck("check");
|
||||
// alert('Hallo');
|
||||
t_id = [];
|
||||
}
|
||||
$(this).data("clicks", !clicks);
|
||||
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
$(document).ready(function() { /// Wait till page is loaded
|
||||
$('#click').click(function() {
|
||||
$('#refresh').load('unassigned #refresh');
|
||||
$('#title_refresh').load('unassigned #title_refresh');
|
||||
$('#count_refresh').load('unassigned #count_refresh');
|
||||
$("#show").show();
|
||||
$('#refresh').load('inbox #refresh');
|
||||
$('#title_refresh').load('inbox #title_refresh');
|
||||
$('#count_refresh').load('inbox #count_refresh');
|
||||
$("#show").show();
|
||||
});
|
||||
|
||||
$(".select2").select2();
|
||||
|
||||
$('#delete').on('click', function(){
|
||||
option = 0;
|
||||
$('#myModalLabel').html("{{Lang::get('lang.delete-tickets')}}");
|
||||
});
|
||||
|
||||
$('#close').on('click', function(){
|
||||
option = 1;
|
||||
$('#myModalLabel').html("{{Lang::get('lang.close-tickets')}}");
|
||||
});
|
||||
|
||||
$("#modalpopup").on('submit', function(e){
|
||||
e.preventDefault();
|
||||
var msg ="{{Lang::get('lang.confirm')}}";
|
||||
var values = getValues();
|
||||
if(values == ""){
|
||||
msg = "{{Lang::get('lang.select-ticket')}}";
|
||||
$('.yes').html("{{Lang::get('lang.ok')}}");
|
||||
$('#myModalLabel').html("{{Lang::get('lang.alert')}}");
|
||||
} else {
|
||||
$('.yes').html("Yes");
|
||||
}
|
||||
$('#custom-alert-body').html(msg);
|
||||
$("#myModal").css("display", "block");
|
||||
});
|
||||
|
||||
$(".closemodal, .no").click(function(){
|
||||
|
||||
$("#myModal").css("display", "none");
|
||||
|
||||
});
|
||||
|
||||
$('.yes').click(function(){
|
||||
var values = getValues();
|
||||
if(values == ""){
|
||||
$("#myModal").css("display", "none");
|
||||
} else {
|
||||
$("#myModal").css("display", "none");
|
||||
$("#modalpopup").unbind('submit');
|
||||
if (option == 0) {
|
||||
//alert('delete');
|
||||
$('#delete').click();
|
||||
} else {
|
||||
//alert('close');
|
||||
$('#close').click();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function getValues(){
|
||||
var values = $('.selectval:checked').map(function() {
|
||||
return $(this).val();
|
||||
}).get();
|
||||
return values;
|
||||
}
|
||||
|
||||
//checking merging tickets
|
||||
$('#MergeTickets').on('show.bs.modal', function () {
|
||||
|
||||
// alert("hi");
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: "{{route('check.merge.tickets',0)}}",
|
||||
dataType: "html",
|
||||
data:{data1: t_id},
|
||||
beforeSend: function() {
|
||||
$("#merge_body").hide();
|
||||
$("#merge_loader").show();
|
||||
},
|
||||
success: function(response) {
|
||||
if(response == 0) {
|
||||
$("#merge_body").show();
|
||||
$("#merge-succ-alert").hide();
|
||||
$("#merge-body-alert").show();
|
||||
$("#merge-body-form").hide();
|
||||
$("#merge_loader").hide();
|
||||
$("#merge-btn").attr('disabled', true);
|
||||
var message = "{{Lang::get('lang.select-tickets-to merge')}}";
|
||||
$("#merge-err-alert").show();
|
||||
$('#message-merge-err').html(message);
|
||||
|
||||
} else if(response == 2) {
|
||||
$("#merge_body").show();
|
||||
$("#merge-succ-alert").hide();
|
||||
$("#merge-body-alert").show();
|
||||
$("#merge-body-form").hide();
|
||||
$("#merge_loader").hide();
|
||||
$("#merge-btn").attr('disabled', true);
|
||||
var message = "{{Lang::get('lang.different-users')}}";
|
||||
$("#merge-err-alert").show();
|
||||
$('#message-merge-err').html(message);
|
||||
} else {
|
||||
|
||||
$("#merge_body").show();
|
||||
$("#merge-body-alert").hide();
|
||||
$("#merge-body-form").show();
|
||||
$("#merge_loader").hide();
|
||||
$("#merge-btn").attr('disabled', false);
|
||||
$("#merge_loader").hide();
|
||||
$.ajax({
|
||||
url: "{{ route('get.merge.tickets',0) }}",
|
||||
dataType: "html",
|
||||
data:{data1: t_id},
|
||||
success: function(data) {
|
||||
|
||||
$('#select-merge-parent').html(data);
|
||||
}
|
||||
// return false;
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//submit merging form
|
||||
$('#merge-form').on('submit', function(){
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "{!! url('merge-tickets/') !!}/"+t_id,
|
||||
dataType: "json",
|
||||
data: $(this).serialize(),
|
||||
beforeSend: function() {
|
||||
$("#merge_body").hide();
|
||||
$("#merge_loader").show();
|
||||
|
||||
},
|
||||
success: function(response) {
|
||||
if(response == 0) {
|
||||
$("#merge_body").show();
|
||||
$("#merge-succ-alert").hide();
|
||||
$("#merge-body-alert").show();
|
||||
$("#merge-body-form").hide();
|
||||
$("#merge_loader").hide();
|
||||
$("#merge-btn").attr('disabled', true);
|
||||
var message = "{{Lang::get('lang.merge-error')}}";
|
||||
$("#merge-err-alert").show();
|
||||
$('#message-merge-err').html(message);
|
||||
|
||||
} else {
|
||||
$("#merge_body").show();
|
||||
$("#merge-err-alert").hide();
|
||||
$("#merge-body-alert").show();
|
||||
$("#merge-body-form").hide();
|
||||
$("#merge_loader").hide();
|
||||
$("#merge-btn").attr('disabled', true);
|
||||
var message = "{{Lang::get('lang.merge-success')}}";
|
||||
$("#merge-succ-alert").show();
|
||||
$('#message-merge-succ').html(message);
|
||||
setInterval(function(){
|
||||
$("#alert11").hide();
|
||||
setTimeout(function() {
|
||||
var link = document.querySelector('#load-unassigned');
|
||||
if(link) {
|
||||
link.click();
|
||||
}
|
||||
}, 500);
|
||||
},2000);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
return false;
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function someFunction(id){
|
||||
if(document.getElementById(id).checked) {
|
||||
t_id.push(id);
|
||||
// alert(t_id);
|
||||
} else {
|
||||
var index = t_id.indexOf(id);
|
||||
t_id.splice(index, 1);
|
||||
// alert(t_id);
|
||||
}
|
||||
|
||||
// thisid.push(id);
|
||||
// alert(thisid);
|
||||
// document.getElementById("demo").innerHTML = thisid;
|
||||
|
||||
|
||||
// push.thisid;
|
||||
// alert(thisid);
|
||||
|
||||
// document.getElementByID('demo').innerHTML = thisid;
|
||||
}
|
||||
|
||||
</script>
|
||||
@stop
|
@@ -1,6 +1,5 @@
|
||||
@extends('themes.default1.agent.layout.agent')
|
||||
|
||||
|
||||
@section('Users')
|
||||
class="active"
|
||||
@stop
|
||||
@@ -17,118 +16,102 @@ class="active"
|
||||
@stop
|
||||
<!-- header -->
|
||||
@section('PageHeader')
|
||||
|
||||
|
||||
<h1>{!! Lang::get('lang.create') !!}</h1>
|
||||
@stop
|
||||
<!-- /header -->
|
||||
<!-- breadcrumbs -->
|
||||
@section('breadcrumbs')
|
||||
<ol class="breadcrumb">
|
||||
|
||||
</ol>
|
||||
@stop
|
||||
<!-- /breadcrumbs -->
|
||||
<!-- content -->
|
||||
@section('content')
|
||||
|
||||
<!-- open a form -->
|
||||
|
||||
{!! Form::open(['action'=>'Agent\helpdesk\UserController@store','method'=>'post']) !!}
|
||||
|
||||
<div class="box box-primary">
|
||||
<div class="content-header">
|
||||
|
||||
<h4>{!! Lang::get('lang.create') !!} {!! Form::submit(Lang::get('lang.save'),['class'=>'form-group btn btn-primary pull-right'])!!}</h4>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="box-body">
|
||||
|
||||
<!-- Email Address : Email : Required -->
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-xs-4 form-group {{ $errors->has('email') ? 'has-error' : '' }}">
|
||||
|
||||
{!! Form::label('email',Lang::get('lang.email')) !!}
|
||||
{!! $errors->first('email', '<spam class="help-block">:message</spam>') !!}
|
||||
{!! Form::email('email',null,['class' => 'form-control']) !!}
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<!-- Full Name : Text : Required-->
|
||||
|
||||
<div class="col-xs-4 form-group {{ $errors->has('full_name') ? 'has-error' : '' }}">
|
||||
|
||||
{!! Form::label('full_name',Lang::get('lang.full_name')) !!}
|
||||
{!! $errors->first('full_name', '<spam class="help-block">:message</spam>') !!}
|
||||
{!! Form::text('full_name',null,['class' => 'form-control']) !!}
|
||||
|
||||
</div>
|
||||
|
||||
<!-- mobile Number : Text : -->
|
||||
|
||||
<div class="col-md-4 form-group {{ $errors->has('mobile') ? 'has-error' : '' }}">
|
||||
|
||||
{!! Form::label('mobile',Lang::get('lang.mobile')) !!}
|
||||
{!! $errors->first('mobile', '<spam class="help-block">:message</spam>') !!}
|
||||
{!! Form::text('mobile',null,['class' => 'form-control']) !!}
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-xs-1 form-group {{ $errors->has('ext') ? 'has-error' : '' }}">
|
||||
|
||||
<label for="ext">{!! Lang::get('lang.ext') !!}</label>
|
||||
{!! $errors->first('ext', '<spam class="help-block">:message</spam>') !!}
|
||||
{!! Form::text('ext',null,['class' => 'form-control']) !!}
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-xs-5 form-group {{ $errors->has('phone_number') ? 'has-error' : '' }}">
|
||||
|
||||
<label for="phone_number">{!! Lang::get('lang.phone') !!}</label>
|
||||
{!! $errors->first('phone_number', '<spam class="help-block">:message</spam>') !!}
|
||||
{!! Form::text('phone_number',null,['class' => 'form-control']) !!}
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-md-4 form-group {{ $errors->has('active') ? 'has-error' : '' }}">
|
||||
|
||||
{!! Form::label('active',Lang::get('lang.status')) !!}
|
||||
{!! $errors->first('active', '<spam class="help-block">:message</spam>') !!}
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
{!! Form::radio('active','1',true) !!} {{Lang::get('lang.active')}}
|
||||
</div>
|
||||
<div class="col-xs-12">
|
||||
{!! Form::radio('active','0') !!} {{Lang::get('lang.inactive')}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- Internal Notes : Textarea -->
|
||||
|
||||
<div class="form-group">
|
||||
|
||||
{!! Form::label('internal_note',Lang::get('lang.internal_notes')) !!}
|
||||
{!! Form::textarea('internal_note',null,['class' => 'form-control']) !!}
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">
|
||||
User Credentials
|
||||
</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
@if(Session::has('errors'))
|
||||
<div class="alert alert-danger alert-dismissable">
|
||||
<i class="fa fa-ban"></i>
|
||||
<b>Alert!</b>
|
||||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||
<br/>
|
||||
@if($errors->first('email'))
|
||||
<li class="error-message-padding">{!! $errors->first('email', ':message') !!}</li>
|
||||
@endif
|
||||
@if($errors->first('full_name'))
|
||||
<li class="error-message-padding">{!! $errors->first('full_name', ':message') !!}</li>
|
||||
@endif
|
||||
@if($errors->first('mobile'))
|
||||
<li class="error-message-padding">{!! $errors->first('mobile', ':message') !!}</li>
|
||||
@endif
|
||||
@if($errors->first('ext'))
|
||||
<li class="error-message-padding">{!! $errors->first('ext', ':message') !!}</li>
|
||||
@endif
|
||||
@if($errors->first('phone_number'))
|
||||
<li class="error-message-padding">{!! $errors->first('phone_number', ':message') !!}</li>
|
||||
@endif
|
||||
@if($errors->first('active'))
|
||||
<li class="error-message-padding">{!! $errors->first('active', ':message') !!}</li>
|
||||
@endif
|
||||
</div>
|
||||
@endif
|
||||
<!-- Email Address : Email : Required -->
|
||||
<div class="row">
|
||||
<div class="col-xs-4 form-group {{ $errors->has('email') ? 'has-error' : '' }}">
|
||||
{!! Form::label('email',Lang::get('lang.email')) !!}
|
||||
{!! Form::email('email',null,['class' => 'form-control']) !!}
|
||||
</div>
|
||||
<!-- Full Name : Text : Required-->
|
||||
<div class="col-xs-4 form-group {{ $errors->has('full_name') ? 'has-error' : '' }}">
|
||||
{!! Form::label('full_name',Lang::get('lang.full_name')) !!}
|
||||
{!! Form::text('full_name',null,['class' => 'form-control']) !!}
|
||||
</div>
|
||||
<!-- mobile Number : Text : -->
|
||||
<div class="col-md-4 form-group {{ $errors->has('mobile') ? 'has-error' : '' }}">
|
||||
{!! Form::label('mobile',Lang::get('lang.mobile')) !!}
|
||||
{!! Form::text('mobile',null,['class' => 'form-control']) !!}
|
||||
</div>
|
||||
<div class="col-xs-1 form-group {{ $errors->has('ext') ? 'has-error' : '' }}">
|
||||
<label for="ext">{!! Lang::get('lang.ext') !!}</label>
|
||||
{!! Form::text('ext',null,['class' => 'form-control']) !!}
|
||||
</div>
|
||||
<div class="col-xs-5 form-group {{ $errors->has('phone_number') ? 'has-error' : '' }}">
|
||||
<label for="phone_number">{!! Lang::get('lang.phone') !!}</label>
|
||||
{!! Form::text('phone_number',null,['class' => 'form-control']) !!}
|
||||
</div>
|
||||
<div class="col-md-4 form-group {{ $errors->has('active') ? 'has-error' : '' }}">
|
||||
{!! Form::label('active',Lang::get('lang.status')) !!}
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
{!! Form::radio('active','1',true) !!} {{Lang::get('lang.active')}}
|
||||
</div>
|
||||
<div class="col-xs-12">
|
||||
{!! Form::radio('active','0') !!} {{Lang::get('lang.inactive')}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Internal Notes : Textarea -->
|
||||
<div class="form-group">
|
||||
{!! Form::label('internal_note',Lang::get('lang.internal_notes')) !!}
|
||||
{!! Form::textarea('internal_note',null,['class' => 'form-control', 'size' => '30x5']) !!}
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-footer">
|
||||
{!! Form::submit(Lang::get('lang.save'),['class'=>'form-group btn btn-primary'])!!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
$(function () {
|
||||
$("textarea").wysihtml5();
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
$(function () {
|
||||
$("textarea").wysihtml5();
|
||||
});
|
||||
</script>
|
||||
@stop
|
||||
|
@@ -13,117 +13,109 @@ active
|
||||
class="active"
|
||||
@stop
|
||||
|
||||
<!-- /breadcrumbs -->
|
||||
<!-- header -->
|
||||
@section('PageHeader')
|
||||
<h1>{!! Lang::get('lang.edit') !!}</h1>
|
||||
@stop
|
||||
<!-- /header -->
|
||||
|
||||
<!-- content -->
|
||||
@section('content')
|
||||
|
||||
<!-- open a form -->
|
||||
|
||||
{!! Form::model($users,['url'=>'user/'.$users->id,'method'=>'PATCH']) !!}
|
||||
|
||||
<div class="box box-primary">
|
||||
<div class="content-header">
|
||||
|
||||
<h4>{{Lang::get('lang.edit')}} {!! Form::submit(Lang::get('lang.save'),['class'=>'form-group btn btn-primary pull-right'])!!}</h4>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="box-body">
|
||||
|
||||
<!-- Email Address : Email : Required -->
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-4 form-group {{ $errors->has('email') ? 'has-error' : '' }}">
|
||||
|
||||
{!! Form::label('email',Lang::get('lang.email')) !!}
|
||||
{!! $errors->first('email', '<spam class="help-block">:message</spam>') !!}
|
||||
{!! Form::email('email',null,['disabled'=>'disabled', 'class' => 'form-control']) !!}
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<!-- Full Name : Text : Required-->
|
||||
|
||||
<div class="col-md-4 form-group {{ $errors->has('user_name') ? 'has-error' : '' }}">
|
||||
|
||||
{!! Form::label('user_name',Lang::get('lang.full_name')) !!}
|
||||
{!! $errors->first('user_name', '<spam class="help-block">:message</spam>') !!}
|
||||
{!! Form::text('user_name',null,['class' => 'form-control']) !!}
|
||||
|
||||
</div>
|
||||
|
||||
<!-- mobile Number : Text : -->
|
||||
|
||||
<div class="col-md-4 form-group {{ $errors->has('mobile') ? 'has-error' : '' }}">
|
||||
|
||||
{!! Form::label('mobile',Lang::get('lang.mobile')) !!}
|
||||
{!! $errors->first('mobile', '<spam class="help-block">:message</spam>') !!}
|
||||
{!! Form::text('mobile',null,['class' => 'form-control']) !!}
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-xs-1 form-group {{ $errors->has('ext') ? 'has-error' : '' }}">
|
||||
|
||||
<label for="ext">{!! Lang::get('lang.ext') !!}</label>
|
||||
{!! $errors->first('ext', '<spam class="help-block">:message</spam>') !!}
|
||||
{!! Form::text('ext',null,['class' => 'form-control']) !!}
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-xs-5 form-group {{ $errors->has('phone_number') ? 'has-error' : '' }}">
|
||||
|
||||
<label for="phone_number">{!! Lang::get('lang.phone') !!}</label>
|
||||
{!! $errors->first('phone_number', '<spam class="help-block">:message</spam>') !!}
|
||||
{!! Form::text('phone_number',null,['class' => 'form-control']) !!}
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-xs-3 form-group {{ $errors->has('active') ? 'has-error' : '' }}">
|
||||
|
||||
{!! Form::label('active',Lang::get('lang.status')) !!}
|
||||
{!! $errors->first('active', '<spam class="help-block">:message</spam>') !!}
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
{!! Form::radio('active','1',true) !!} {{Lang::get('lang.active')}}
|
||||
</div>
|
||||
<div class="col-xs-12">
|
||||
{!! Form::radio('active','0') !!} {{Lang::get('lang.inactive')}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-xs-3 form-group {{ $errors->has('ban') ? 'has-error' : '' }}">
|
||||
|
||||
{!! Form::label('ban',Lang::get('lang.ban')) !!}
|
||||
{!! $errors->first('ban', '<spam class="help-block">:message</spam>') !!}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
{!! Form::radio('ban','1',true) !!} {{Lang::get('lang.enable')}}
|
||||
</div>
|
||||
<div class="col-xs-12">
|
||||
{!! Form::radio('ban','0') !!} {{Lang::get('lang.disable')}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Internal Notes : Textarea -->
|
||||
<div class="form-group">
|
||||
|
||||
{!! Form::label('internal_note',Lang::get('lang.internal_notes')) !!}
|
||||
{!! Form::textarea('internal_note',null,['class' => 'form-control']) !!}
|
||||
|
||||
</div>
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">
|
||||
User Credentials
|
||||
</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
@if(Session::has('errors'))
|
||||
<div class="alert alert-danger alert-dismissable">
|
||||
<i class="fa fa-ban"></i>
|
||||
<b>Alert!</b>
|
||||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||
<br/>
|
||||
@if($errors->first('email'))
|
||||
<li class="error-message-padding">{!! $errors->first('email', ':message') !!}</li>
|
||||
@endif
|
||||
@if($errors->first('user_name'))
|
||||
<li class="error-message-padding">{!! $errors->first('user_name', ':message') !!}</li>
|
||||
@endif
|
||||
@if($errors->first('mobile'))
|
||||
<li class="error-message-padding">{!! $errors->first('mobile', ':message') !!}</li>
|
||||
@endif
|
||||
@if($errors->first('ext'))
|
||||
<li class="error-message-padding">{!! $errors->first('ext', ':message') !!}</li>
|
||||
@endif
|
||||
@if($errors->first('phone_number'))
|
||||
<li class="error-message-padding">{!! $errors->first('phone_number', ':message') !!}</li>
|
||||
@endif
|
||||
@if($errors->first('active'))
|
||||
<li class="error-message-padding">{!! $errors->first('active', ':message') !!}</li>
|
||||
@endif
|
||||
</div>
|
||||
@endif
|
||||
<!-- Email Address : Email : Required -->
|
||||
<div class="row">
|
||||
<div class="col-md-4 form-group {{ $errors->has('email') ? 'has-error' : '' }}">
|
||||
{!! Form::label('email',Lang::get('lang.email')) !!}
|
||||
{!! Form::email('email',null,['disabled'=>'disabled', 'class' => 'form-control']) !!}
|
||||
</div>
|
||||
<!-- Full Name : Text : Required-->
|
||||
<div class="col-md-4 form-group {{ $errors->has('user_name') ? 'has-error' : '' }}">
|
||||
{!! Form::label('user_name',Lang::get('lang.full_name')) !!}
|
||||
{!! Form::text('user_name',null,['class' => 'form-control']) !!}
|
||||
</div>
|
||||
<!-- mobile Number : Text : -->
|
||||
<div class="col-md-4 form-group {{ $errors->has('mobile') ? 'has-error' : '' }}">
|
||||
{!! Form::label('mobile',Lang::get('lang.mobile')) !!}
|
||||
{!! Form::text('mobile',null,['class' => 'form-control']) !!}
|
||||
</div>
|
||||
<div class="col-xs-1 form-group {{ $errors->has('ext') ? 'has-error' : '' }}">
|
||||
<label for="ext">{!! Lang::get('lang.ext') !!}</label>
|
||||
{!! Form::text('ext',null,['class' => 'form-control']) !!}
|
||||
</div>
|
||||
<div class="col-xs-5 form-group {{ $errors->has('phone_number') ? 'has-error' : '' }}">
|
||||
<label for="phone_number">{!! Lang::get('lang.phone') !!}</label>
|
||||
{!! Form::text('phone_number',null,['class' => 'form-control']) !!}
|
||||
</div>
|
||||
<div class="col-xs-3 form-group {{ $errors->has('active') ? 'has-error' : '' }}">
|
||||
{!! Form::label('active',Lang::get('lang.status')) !!}
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
{!! Form::radio('active','1',true) !!} {{Lang::get('lang.active')}}
|
||||
</div>
|
||||
<div class="col-xs-12">
|
||||
{!! Form::radio('active','0') !!} {{Lang::get('lang.inactive')}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-3 form-group {{ $errors->has('ban') ? 'has-error' : '' }}">
|
||||
{!! Form::label('ban',Lang::get('lang.ban')) !!}
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
{!! Form::radio('ban','1',true) !!} {{Lang::get('lang.enable')}}
|
||||
</div>
|
||||
<div class="col-xs-12">
|
||||
{!! Form::radio('ban','0') !!} {{Lang::get('lang.disable')}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Internal Notes : Textarea -->
|
||||
<div class="form-group">
|
||||
{!! Form::label('internal_note',Lang::get('lang.internal_notes')) !!}
|
||||
{!! Form::textarea('internal_note',null,['class' => 'form-control']) !!}
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-footer">
|
||||
{!! Form::submit(Lang::get('lang.save'),['class'=>'form-group btn btn-primary'])!!}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(function () {
|
||||
$("textarea").wysihtml5();
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
$(function () {
|
||||
$("textarea").wysihtml5();
|
||||
});
|
||||
</script>
|
||||
@stop
|
@@ -1,6 +1,5 @@
|
||||
@extends('themes.default1.agent.layout.agent')
|
||||
|
||||
|
||||
@section('Users')
|
||||
class="active"
|
||||
@stop
|
||||
@@ -17,62 +16,53 @@ class="active"
|
||||
@stop
|
||||
<!-- header -->
|
||||
@section('PageHeader')
|
||||
|
||||
|
||||
@stop
|
||||
<!-- /header -->
|
||||
<!-- breadcrumbs -->
|
||||
@section('breadcrumbs')
|
||||
<ol class="breadcrumb">
|
||||
|
||||
</ol>
|
||||
@stop
|
||||
<!-- /breadcrumbs -->
|
||||
<!-- content -->
|
||||
@section('content')
|
||||
|
||||
<!-- open a form -->
|
||||
|
||||
<div class="box box-primary">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title">{{Lang::get('lang.user')}}</h3><a href="{{route('user.create')}}" class="btn btn-primary pull-right">{{Lang::get('lang.create_user')}}</a></div>
|
||||
|
||||
<div class="box-body">
|
||||
<!-- check whether success or not -->
|
||||
|
||||
@if(Session::has('success'))
|
||||
<div class="alert alert-success alert-dismissable">
|
||||
<i class="fa fa-check-circle"></i>
|
||||
<b>Success</b>
|
||||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||
{{Session::get('success')}}
|
||||
</div>
|
||||
@endif
|
||||
<!-- failure message -->
|
||||
@if(Session::has('fails'))
|
||||
<div class="alert alert-danger alert-dismissable">
|
||||
<i class="fa fa-ban"></i>
|
||||
<b>Fail!</b>
|
||||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||
{{Session::get('fails')}}
|
||||
</div>
|
||||
@endif
|
||||
<?php
|
||||
$users = App\User::where('role','=','user')->orderBy('id', 'ASC')->paginate(20);
|
||||
?>
|
||||
{!! Datatable::table()
|
||||
->addColumn(Lang::get('lang.name'),
|
||||
Lang::get('lang.email'),
|
||||
Lang::get('lang.phone'),
|
||||
Lang::get('lang.status'),
|
||||
Lang::get('lang.ban'),
|
||||
Lang::get('lang.last_login'),
|
||||
Lang::get('lang.action')) // these are the column headings to be shown
|
||||
->setUrl(route('user.list')) // this is the route where data will be retrieved
|
||||
->render() !!}
|
||||
|
||||
<div class="box-header">
|
||||
<h3 class="box-title">{{Lang::get('lang.user')}}</h3><a href="{{route('user.create')}}" class="btn btn-primary pull-right">{{Lang::get('lang.create_user')}}</a></div>
|
||||
<div class="box-body">
|
||||
<!-- check whether success or not -->
|
||||
@if(Session::has('success'))
|
||||
<div class="alert alert-success alert-dismissable">
|
||||
<i class="fa fa-check-circle"></i>
|
||||
<b>Success</b>
|
||||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||
{{Session::get('success')}}
|
||||
</div>
|
||||
@endif
|
||||
<!-- failure message -->
|
||||
@if(Session::has('fails'))
|
||||
<div class="alert alert-danger alert-dismissable">
|
||||
<i class="fa fa-ban"></i>
|
||||
<b>Fail!</b>
|
||||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||
{{Session::get('fails')}}
|
||||
</div>
|
||||
@endif
|
||||
<?php
|
||||
$users = App\User::where('role', '=', 'user')->orderBy('id', 'ASC')->paginate(20);
|
||||
?>
|
||||
{!! Datatable::table()
|
||||
->addColumn(Lang::get('lang.name'),
|
||||
Lang::get('lang.email'),
|
||||
Lang::get('lang.phone'),
|
||||
Lang::get('lang.status'),
|
||||
Lang::get('lang.ban'),
|
||||
Lang::get('lang.last_login'),
|
||||
Lang::get('lang.action')) // these are the column headings to be shown
|
||||
->setUrl(route('user.list')) // this is the route where data will be retrieved
|
||||
->render() !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@stop
|
||||
<!-- /content -->
|
@@ -16,7 +16,7 @@ class="active"
|
||||
@stop
|
||||
<!-- header -->
|
||||
@section('PageHeader')
|
||||
<div class="box-header" style="margin-top:-15px;margin-bottom:-15px;"><h3 class="box-title">{!! Lang::get('lang.user_profile') !!}</h3><a href="{{route('user.edit', $users->id)}}" class="btn btn-info btn-sm btn-flat pull-right"><i class="fa fa-edit" style="color:black;"> </i> {!! Lang::get('lang.edit') !!}</a></div>
|
||||
<h1>{!! Lang::get('lang.user_profile') !!} <a href="{{route('user.edit', $users->id)}}" class="btn btn-info btn-sm btn-flat pull-right"><i class="fa fa-edit" style="color:black;"> </i> {!! Lang::get('lang.edit') !!}</a></h1>
|
||||
@stop
|
||||
<!-- /header -->
|
||||
<!-- breadcrumbs -->
|
||||
@@ -26,7 +26,6 @@ class="active"
|
||||
<!-- /breadcrumbs -->
|
||||
<!-- content -->
|
||||
@section('content')
|
||||
{{-- style="display:none" --}}
|
||||
<!-- success message -->
|
||||
<div id="alert-success" class="alert alert-success alert-dismissable" style="display:none;">
|
||||
<i class="fa fa-check-circle"> </i> <b> Success <span id="get-success"></span></b>
|
||||
@@ -165,7 +164,6 @@ $deleted = count(App\Model\helpdesk\Ticket\Tickets::where('user_id', '=', $users
|
||||
<th>{!! Lang::get('lang.subject') !!}</th>
|
||||
<th>{!! Lang::get('lang.ticket_id') !!}</th>
|
||||
<th>{!! Lang::get('lang.priority') !!}</th>
|
||||
<th>{!! Lang::get('lang.from') !!}</th>
|
||||
<th>{!! Lang::get('lang.last_replier') !!}</th>
|
||||
<th>{!! Lang::get('lang.assigned_to') !!}</th>
|
||||
<th>{!! Lang::get('lang.last_activity') !!}</th>
|
||||
@@ -220,11 +218,6 @@ $deleted = count(App\Model\helpdesk\Ticket\Tickets::where('user_id', '=', $users
|
||||
<?php $priority = App\Model\helpdesk\Ticket\Ticket_Priority::where('priority_id', '=', $ticket->priority_id)->first();?>
|
||||
<td class="mailbox-priority"><spam class="btn btn-{{$priority->priority_color}} btn-xs">{{$priority->priority}}</spam></td>
|
||||
<?php $from = App\User::where('id','=',$ticket->user_id)->first(); ?>
|
||||
@if($from->role == "user")
|
||||
<td class="mailbox-from" >{!! $from->user_name !!}</td>
|
||||
@else
|
||||
<td class="mailbox-from" >{!! $from->first_name." ".$from->last_name !!}</td>
|
||||
@endif
|
||||
<td class="mailbox-last-reply" style="color:{!! $rep !!}">{!! $username !!}</td>
|
||||
<td>{!! $assigned !!}</td>
|
||||
<td class="mailbox-last-activity">{!! UTC::usertimezone($title->updated_at) !!}</td>
|
||||
@@ -288,7 +281,6 @@ $deleted = count(App\Model\helpdesk\Ticket\Tickets::where('user_id', '=', $users
|
||||
<th>{!! Lang::get('lang.subject') !!}</th>
|
||||
<th>{!! Lang::get('lang.ticket_id') !!}</th>
|
||||
<th>{!! Lang::get('lang.priority') !!}</th>
|
||||
<th>{!! Lang::get('lang.from') !!}</th>
|
||||
<th>{!! Lang::get('lang.last_replier') !!}</th>
|
||||
<th>{!! Lang::get('lang.assigned_to') !!}</th>
|
||||
<th>{!! Lang::get('lang.last_activity') !!}</th>
|
||||
@@ -342,11 +334,6 @@ $deleted = count(App\Model\helpdesk\Ticket\Tickets::where('user_id', '=', $users
|
||||
<?php $priority = App\Model\helpdesk\Ticket\Ticket_Priority::where('priority_id', '=', $ticket->priority_id)->first();?>
|
||||
<td class="mailbox-priority"><spam class="btn btn-{{$priority->priority_color}} btn-xs">{{$priority->priority}}</spam></td>
|
||||
<?php $from = App\User::where('id','=',$ticket->user_id)->first(); ?>
|
||||
@if($from->role == "user")
|
||||
<td class="mailbox-from" >{!! $from->user_name !!}</td>
|
||||
@else
|
||||
<td class="mailbox-from" >{!! $from->first_name." ".$from->last_name !!}</td>
|
||||
@endif
|
||||
<td class="mailbox-last-reply" style="color:{!! $rep !!}">{!! $username !!}</td>
|
||||
<td>{!! $assigned !!}</td>
|
||||
<td class="mailbox-last-activity">{!! UTC::usertimezone($title->updated_at) !!}</td>
|
||||
@@ -413,7 +400,6 @@ $deleted = count(App\Model\helpdesk\Ticket\Tickets::where('user_id', '=', $users
|
||||
<th>{!! Lang::get('lang.subject') !!}</th>
|
||||
<th>{!! Lang::get('lang.ticket_id') !!}</th>
|
||||
<th>{!! Lang::get('lang.priority') !!}</th>
|
||||
<th>{!! Lang::get('lang.from') !!}</th>
|
||||
<th>{!! Lang::get('lang.last_replier') !!}</th>
|
||||
<th>{!! Lang::get('lang.assigned_to') !!}</th>
|
||||
<th>{!! Lang::get('lang.last_activity') !!}</th>
|
||||
@@ -472,11 +458,6 @@ $deleted = count(App\Model\helpdesk\Ticket\Tickets::where('user_id', '=', $users
|
||||
<?php $priority = App\Model\helpdesk\Ticket\Ticket_Priority::where('priority_id', '=', $ticket->priority_id)->first();?>
|
||||
<td class="mailbox-priority"><spam class="btn btn-{{$priority->priority_color}} btn-xs">{{$priority->priority}}</spam></td>
|
||||
<?php $from = App\User::where('id','=',$ticket->user_id)->first(); ?>
|
||||
@if($from->role == "user")
|
||||
<td class="mailbox-from" >{!! $from->user_name !!}</td>
|
||||
@else
|
||||
<td class="mailbox-from" >{!! $from->first_name." ".$from->last_name !!}</td>
|
||||
@endif
|
||||
<td class="mailbox-last-reply" style="color:{!! $rep !!}">{!! $username !!}</td>
|
||||
<td>{!! $assigned !!}</td>
|
||||
<td class="mailbox-last-activity">{!! UTC::usertimezone($title->updated_at) !!}</td>
|
||||
@@ -750,6 +731,10 @@ $orgs = App\Model\helpdesk\Agent_panel\Organization::all();
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<script>
|
||||
$(function () {
|
||||
$("textarea").wysihtml5();
|
||||
});
|
||||
</script>
|
||||
@stop
|
||||
<!-- /content -->
|
@@ -34,7 +34,7 @@
|
||||
|
||||
<link href="{{asset("lb-faveo/css/jquery.rating.css")}}" rel="stylesheet" type="text/css" />
|
||||
|
||||
<!-- Select2 -->
|
||||
<!-- Select2 -->
|
||||
<link rel="stylesheet" href="{{asset("lb-faveo/plugins/select2/select2.min.css")}}">
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
|
||||
@@ -177,13 +177,13 @@ $i = count($tickets);
|
||||
<i class="fa fa-envelope"></i> <span>{!! Lang::get('lang.inbox') !!}</span> <small class="label pull-right bg-green"><?php echo $i;?></small> </a>
|
||||
</li>
|
||||
<li @yield('myticket')>
|
||||
<a href="{{url('ticket/myticket')}}">
|
||||
<a href="{{url('ticket/myticket')}}" id="load-myticket">
|
||||
<i class="fa fa-user"></i> <span>{!! Lang::get('lang.my_tickets') !!} </span>
|
||||
<small class="label pull-right bg-green">{{count($myticket) }}</small>
|
||||
</a>
|
||||
</li>
|
||||
<li @yield('unassigned')>
|
||||
<a href="{{url('unassigned')}}">
|
||||
<a href="{{url('unassigned')}}" id="load-unassigned">
|
||||
<i class="fa fa-th"></i> <span>{!! Lang::get('lang.unassigned') !!}</span>
|
||||
<small class="label pull-right bg-green">{{count($unassigned)}}</small>
|
||||
</a>
|
||||
@@ -262,12 +262,12 @@ $group = App\Model\helpdesk\Agent\Groups::where('id', '=', $agent_group)->where(
|
||||
</div>
|
||||
<div class="tabs-pane @yield('ticket-bar')" id="tabC">
|
||||
<ul class="nav navbar-nav">
|
||||
<li id="bar" @yield('open')><a href="{{ url('/ticket/open') }}" >{!! Lang::get('lang.open') !!}</a></li>
|
||||
<li id="bar" @yield('answered')><a href="{{ url('/ticket/answered') }}" >{!! Lang::get('lang.answered') !!}</a></li>
|
||||
<li id="bar" @yield('open')><a href="{{ url('/ticket/open') }}" id="load-open">{!! Lang::get('lang.open') !!}</a></li>
|
||||
<li id="bar" @yield('answered')><a href="{{ url('/ticket/answered') }}" id="load-answered">{!! Lang::get('lang.answered') !!}</a></li>
|
||||
<li id="bar" @yield('myticket')><a href="{{ url('/ticket/myticket') }}" >{!! Lang::get('lang.my_tickets') !!}</a></li>
|
||||
{{-- <li id="bar" @yield('ticket')><a href="{{ url('ticket') }}" >Ticket</a></li> --}}
|
||||
{{-- <li id="bar" @yield('overdue')><a href="{{ url('/ticket/overdue') }}" >Overdue</a></li> --}}
|
||||
<li id="bar" @yield('assigned')><a href="{{ url('/ticket/assigned') }}" >{!! Lang::get('lang.assigned') !!}</a></li>
|
||||
<li id="bar" @yield('assigned')><a href="{{ url('/ticket/assigned') }}" id="load-assigned" >{!! Lang::get('lang.assigned') !!}</a></li>
|
||||
<li id="bar" @yield('closed')><a href="{{ url('/ticket/closed') }}" >{!! Lang::get('lang.closed') !!}</a></li>
|
||||
<?php if ($group->can_create_ticket == 1) {?>
|
||||
<li id="bar" @yield('newticket')><a href="{{ url('/newticket') }}" >{!! Lang::get('lang.create_ticket') !!}</a></li>
|
||||
|
@@ -383,11 +383,11 @@ $data = $ConvDate[0];
|
||||
$(document).ready(function() {
|
||||
var Data = $('input[name="rating"]:checked').val();
|
||||
var Data2 = $('input[name="rating2"]:checked').val();
|
||||
// if (Data) {
|
||||
// $('input[name=rating]').rating('readOnly');
|
||||
// jQuery('.star').attr('disabled', true);
|
||||
if (Data) {
|
||||
$('input[name=rating]').rating('readOnly');
|
||||
jQuery('.star').attr('disabled', true);
|
||||
|
||||
// }
|
||||
}
|
||||
$('input[name=rating]').change(function() {
|
||||
$('#foo').submit();
|
||||
});
|
||||
@@ -551,4 +551,4 @@ $('#foo2').submit();
|
||||
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user