update 1.0.8.0
Commits for version update
This commit is contained in:
@@ -4,7 +4,6 @@ namespace App\Http\Controllers\Client\helpdesk;
|
||||
|
||||
// controllers
|
||||
use App\Http\Controllers\Agent\helpdesk\TicketWorkflowController;
|
||||
use App\Http\Controllers\Common\FileuploadController;
|
||||
use App\Http\Controllers\Controller;
|
||||
// requests
|
||||
use App\Http\Requests\helpdesk\ClientRequest;
|
||||
@@ -12,9 +11,11 @@ use App\Model\helpdesk\Agent\Department;
|
||||
// models
|
||||
use App\Model\helpdesk\Form\Fields;
|
||||
use App\Model\helpdesk\Manage\Help_topic;
|
||||
use App\Model\helpdesk\Settings\CommonSettings;
|
||||
use App\Model\helpdesk\Settings\System;
|
||||
use App\Model\helpdesk\Settings\Ticket;
|
||||
use App\Model\helpdesk\Ticket\Ticket_attachments;
|
||||
use App\Model\helpdesk\Ticket\Ticket_Priority;
|
||||
use App\Model\helpdesk\Ticket\Ticket_source;
|
||||
use App\Model\helpdesk\Ticket\Ticket_Thread;
|
||||
use App\Model\helpdesk\Ticket\Tickets;
|
||||
@@ -61,6 +62,11 @@ class FormController extends Controller
|
||||
if (\Config::get('database.install') == '%0%') {
|
||||
return \Redirect::route('licence');
|
||||
}
|
||||
$settings = CommonSettings::select('status')->where('option_name', '=', 'send_otp')->first();
|
||||
$email_mandatory = CommonSettings::select('status')->where('option_name', '=', 'email_mandatory')->first();
|
||||
if (!\Auth::check() && ($settings->status == 1 || $settings->status == '1')) {
|
||||
return redirect('auth/login')->with(['login_require' => 'Please login to your account for submitting a ticket', 'referer' => 'form']);
|
||||
}
|
||||
$location = GeoIP::getLocation();
|
||||
$phonecode = $code->where('iso', '=', $location['isoCode'])->first();
|
||||
if (System::first()->status == 1) {
|
||||
@@ -71,12 +77,8 @@ class FormController extends Controller
|
||||
} else {
|
||||
$phonecode = '';
|
||||
}
|
||||
$fileupload = new FileuploadController();
|
||||
$fileupload = $fileupload->file_upload_max_size();
|
||||
$max_size_in_bytes = $fileupload[0];
|
||||
$max_size_in_actual = $fileupload[1];
|
||||
|
||||
return view('themes.default1.client.helpdesk.form', compact('topics', 'codes', 'max_size_in_bytes', 'max_size_in_actual'))->with('phonecode', $phonecode);
|
||||
return view('themes.default1.client.helpdesk.form', compact('topics', 'codes', 'email_mandatory'))->with('phonecode', $phonecode);
|
||||
} else {
|
||||
return \Redirect::route('home');
|
||||
}
|
||||
@@ -112,7 +114,7 @@ class FormController extends Controller
|
||||
$vals = explode(',', $type2);
|
||||
echo '<br/><label>'.ucfirst($form_data->label).'</label><br/>';
|
||||
foreach ($vals as $val) {
|
||||
echo '<input type="'.$form_data->type.'" name="'.$form_data->name.'"> '.$val.' ';
|
||||
echo '<input type="'.$form_data->type.'" name="'.$form_data->name.'"> '.$form_data->value.' ';
|
||||
}
|
||||
echo '<br/>';
|
||||
} elseif ($form_data->type == 'textarea') {
|
||||
@@ -144,16 +146,26 @@ class FormController extends Controller
|
||||
*/
|
||||
public function postedForm(User $user, ClientRequest $request, Ticket $ticket_settings, Ticket_source $ticket_source, Ticket_attachments $ta, CountryCode $code)
|
||||
{
|
||||
$form_extras = $request->except('Name', 'Phone', 'Email', 'Subject', 'Details', 'helptopic', '_wysihtml5_mode', '_token');
|
||||
|
||||
$form_extras = $request->except('Name', 'Phone', 'Email', 'Subject', 'Details', 'helptopic', '_wysihtml5_mode', '_token', 'mobile', 'Code');
|
||||
$name = $request->input('Name');
|
||||
$phone = $request->input('Phone');
|
||||
$email = $request->input('Email');
|
||||
$to = '';
|
||||
if ($request->input('Email')) {
|
||||
if ($request->input('Email')) {
|
||||
$email = $request->input('Email');
|
||||
} else {
|
||||
$email = null;
|
||||
}
|
||||
} else {
|
||||
$email = null;
|
||||
}
|
||||
$subject = $request->input('Subject');
|
||||
$details = $request->input('Details');
|
||||
$phonecode = $request->input('Code');
|
||||
$mobile_number = $request->input('Mobile');
|
||||
if ($request->input('mobile')) {
|
||||
$mobile_number = $request->input('mobile');
|
||||
} else {
|
||||
$mobile_number = null;
|
||||
}
|
||||
$status = $ticket_settings->first()->status;
|
||||
$helptopic = $request->input('helptopic');
|
||||
$helpTopicObj = Help_topic::where('id', '=', $helptopic);
|
||||
@@ -164,7 +176,15 @@ class FormController extends Controller
|
||||
$department = Help_topic::where('id', '=', $defaultHelpTopicID)->value('department');
|
||||
}
|
||||
$sla = $ticket_settings->first()->sla;
|
||||
$priority = $ticket_settings->first()->priority;
|
||||
|
||||
// $priority = $ticket_settings->first()->priority;
|
||||
$default_priority = Ticket_Priority::where('is_default', '=', 1)->first();
|
||||
$user_priority = CommonSettings::where('id', '=', 6)->first();
|
||||
if ($user_priority->status == 0) {
|
||||
$priority = $default_priority->priority_id;
|
||||
} else {
|
||||
$priority = $request->input('priority');
|
||||
}
|
||||
$source = $ticket_source->where('name', '=', 'web')->first()->id;
|
||||
$attachments = $request->file('attachment');
|
||||
$collaborator = null;
|
||||
@@ -195,14 +215,8 @@ class FormController extends Controller
|
||||
}
|
||||
}
|
||||
}
|
||||
// this param is used for inline attachments via email
|
||||
if (empty($attachments)) {
|
||||
$inline_attachment = $attachments;
|
||||
} else {
|
||||
$inline_attachment = null;
|
||||
}
|
||||
$result = $this->TicketWorkflowController->workflow($email, $name, $to, $subject, $details, $phone, $phonecode, $mobile_number, $helptopic, $sla, $priority, $source, $collaborator, $department, $assignto, $team_assign, $status, $form_extras, $auto_response, $inline_attachment);
|
||||
|
||||
$result = $this->TicketWorkflowController->workflow($email, $name, $subject, $details, $phone, $phonecode, $mobile_number, $helptopic, $sla, $priority, $source, $collaborator, $department, $assignto, $team_assign, $status, $form_extras, $auto_response);
|
||||
// dd($result);
|
||||
if ($result[1] == 1) {
|
||||
$ticketId = Tickets::where('ticket_number', '=', $result[0])->first();
|
||||
$thread = Ticket_Thread::where('ticket_id', '=', $ticketId->id)->first();
|
||||
@@ -220,6 +234,8 @@ class FormController extends Controller
|
||||
}
|
||||
// dd($result);
|
||||
return Redirect::back()->with('success', Lang::get('lang.Ticket-has-been-created-successfully-your-ticket-number-is').' '.$result[0].'. '.Lang::get('lang.Please-save-this-for-future-reference'));
|
||||
} else {
|
||||
return Redirect::back()->withInput($request->except('password'))->with('fails', Lang::get('lang.failed-to-create-user-tcket-as-mobile-has-been-taken'));
|
||||
}
|
||||
// dd($result);
|
||||
}
|
||||
@@ -245,7 +261,6 @@ class FormController extends Controller
|
||||
|
||||
$fromaddress = $user_cred->email;
|
||||
$fromname = $user_cred->user_name;
|
||||
$to = '';
|
||||
$phone = '';
|
||||
$phonecode = '';
|
||||
$mobile_number = '';
|
||||
@@ -262,7 +277,7 @@ class FormController extends Controller
|
||||
$ticket_status = null;
|
||||
$auto_response = 0;
|
||||
|
||||
$this->TicketWorkflowController->workflow($fromaddress, $to, $fromname, $subject, $body, $phone, $phonecode, $mobile_number, $helptopic, $sla, $priority, $source, $collaborator, $dept, $assign, $team_assign, $ticket_status, $form_data, $auto_response);
|
||||
$this->TicketWorkflowController->workflow($fromaddress, $fromname, $subject, $body, $phone, $phonecode, $mobile_number, $helptopic, $sla, $priority, $source, $collaborator, $dept, $assign, $team_assign, $ticket_status, $form_data, $auto_response);
|
||||
|
||||
return \Redirect::back()->with('success1', Lang::get('lang.successfully_replied'));
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user