update 1.0.8.0

Commits for version update
This commit is contained in:
Manish Verma
2016-10-17 12:02:27 +05:30
parent dec927987b
commit 76e85db070
9674 changed files with 495757 additions and 58922 deletions

View File

@@ -40,35 +40,33 @@ class TicketWorkflowController extends Controller
*
* @return type response
*/
public function workflow($fromaddress, $fromname, $to, $subject, $body, $phone, $phonecode, $mobile_number, $helptopic, $sla, $priority, $source, $collaborator, $dept, $assign, $team_assign, $ticket_status, $form_data, $auto_response, $mail)
public function workflow($fromaddress, $fromname, $subject, $body, $phone, $phonecode, $mobile_number, $helptopic, $sla, $priority, $source, $collaborator, $dept, $assign, $team_assign, $ticket_status, $form_data, $auto_response)
{
$contact_details = ['email' => $fromaddress, 'email_name' => $fromname, 'email_to' => $to, 'subject' => $subject, 'message' => $body];
$contact_details = ['email' => $fromaddress, 'email_name' => $fromname, 'subject' => $subject, 'message' => $body];
$ticket_settings_details = ['help_topic' => $helptopic, 'sla' => $sla, 'priority' => $priority, 'source' => $source, 'dept' => $dept, 'assign' => $assign, 'team' => $team_assign, 'status' => $ticket_status, 'reject' => false];
// get all the workflow common to the entire system which includes any type of ticket creation where the execution order of the workflow should be starting with ascending order
$workflows = WorkflowName::where('target', '=', 'A-0')->where('status', '=', '1')->orderBy('order', 'asc')->get();
foreach ($workflows as $workflow) {
// checking if any workflow defined in the system
if ($workflow) {
// get all the rules of workflow which has a foreign key of those workflow which are applied to creating any ticket from any source
$workflow_rules = WorkflowRules::where('workflow_id', '=', $workflow->id)->get();
foreach ($workflow_rules as $workflow_rule) {
$worklfow_rules = WorkflowRules::where('workflow_id', '=', $workflow->id)->get();
foreach ($worklfow_rules as $worklfow_rule) {
// checking for the workflow rules to which workflow rule type it is
if ($workflow_rule->matching_scenario == 'email') {
if ($rule_condition = $this->checkRuleCondition($contact_details['email'], $workflow_rule->matching_relation, $workflow_rule->matching_value) == true) {
if ($worklfow_rule->matching_scenario == 'email') {
if ($rule_condition = $this->checkRuleCondition($contact_details['email'], $worklfow_rule->matching_relation, $worklfow_rule->matching_value) == true) {
$ticket_settings_details = $this->applyActionCondition($workflow->id, $ticket_settings_details);
}
} elseif ($workflow_rule->matching_scenario == 'email_name') {
if ($rule_condition = $this->checkRuleCondition($contact_details['email_name'], $workflow_rule->matching_relation, $workflow_rule->matching_value) == true) {
} elseif ($worklfow_rule->matching_scenario == 'email_name') {
if ($rule_condition = $this->checkRuleCondition($contact_details['email_name'], $worklfow_rule->matching_relation, $worklfow_rule->matching_value) == true) {
$ticket_settings_details = $this->applyActionCondition($workflow->id, $ticket_settings_details);
}
} elseif ($workflow_rule->matching_scenario == 'subject') {
} elseif ($worklfow_rule->matching_scenario == 'subject') {
if ($rule_condition = $this->checkRuleCondition($contact_details['subject'], $worklfow_rule->matching_relation, $worklfow_rule->matching_value) == true) {
$ticket_settings_details = $this->applyActionCondition($workflow->id, $ticket_settings_details);
}
} elseif ($workflow_rule->matching_scenario == 'message') {
if ($rule_condition = $this->checkRuleCondition($contact_details['message'], $workflow_rule->matching_relation, $workflow_rule->matching_value) == true) {
} elseif ($worklfow_rule->matching_scenario == 'message') {
if ($rule_condition = $this->checkRuleCondition($contact_details['message'], $worklfow_rule->matching_relation, $worklfow_rule->matching_value) == true) {
$ticket_settings_details = $this->applyActionCondition($workflow->id, $ticket_settings_details);
}
}
@@ -80,24 +78,24 @@ class TicketWorkflowController extends Controller
$workflows_webs = WorkflowName::where('target', '=', 'A-1')->where('status', '=', '1')->orderBy('order', 'asc')->get();
foreach ($workflows_webs as $workflows_web) {
if ($workflows_web) {
$workflow_rules = WorkflowRules::where('workflow_id', '=', $workflows_web->id)->get();
foreach ($workflow_rules as $workflow_rule) {
if ($workflow_rule) {
$worklfow_rules = WorkflowRules::where('workflow_id', '=', $workflows_web->id)->get();
foreach ($worklfow_rules as $worklfow_rule) {
if ($worklfow_rule) {
// checking for the workflow rules to which workflow rule type it is
if ($workflow_rule->matching_scenario == 'email') {
if ($this->checkRuleCondition($contact_details['email'], $workflow_rule->matching_relation, $workflow_rule->matching_value) == true) {
if ($worklfow_rule->matching_scenario == 'email') {
if ($this->checkRuleCondition($contact_details['email'], $worklfow_rule->matching_relation, $worklfow_rule->matching_value) == true) {
$ticket_settings_details = $this->applyActionCondition($workflows_web->id, $ticket_settings_details);
}
} elseif ($workflow_rule->matching_scenario == 'email_name') {
if ($this->checkRuleCondition($contact_details['email_name'], $workflow_rule->matching_relation, $workflow_rule->matching_value) == true) {
} elseif ($worklfow_rule->matching_scenario == 'email_name') {
if ($this->checkRuleCondition($contact_details['email_name'], $worklfow_rule->matching_relation, $worklfow_rule->matching_value) == true) {
$ticket_settings_details = $this->applyActionCondition($workflows_web->id, $ticket_settings_details);
}
} elseif ($workflow_rule->matching_scenario == 'subject') {
if ($this->checkRuleCondition($contact_details['subject'], $workflow_rule->matching_relation, $workflow_rule->matching_value) == true) {
} elseif ($worklfow_rule->matching_scenario == 'subject') {
if ($this->checkRuleCondition($contact_details['subject'], $worklfow_rule->matching_relation, $worklfow_rule->matching_value) == true) {
$ticket_settings_details = $this->applyActionCondition($workflows_web->id, $ticket_settings_details);
}
} elseif ($workflow_rule->matching_scenario == 'message') {
if ($this->checkRuleCondition($contact_details['message'], $workflow_rule->matching_relation, $workflow_rule->matching_value) == true) {
} elseif ($worklfow_rule->matching_scenario == 'message') {
if ($this->checkRuleCondition($contact_details['message'], $worklfow_rule->matching_relation, $worklfow_rule->matching_value) == true) {
$ticket_settings_details = $this->applyActionCondition($workflows_web->id, $ticket_settings_details);
}
}
@@ -111,31 +109,24 @@ class TicketWorkflowController extends Controller
$workflows_emails = WorkflowName::where('target', '=', 'A-2')->where('status', '=', '1')->orderBy('order', 'asc')->get();
foreach ($workflows_emails as $workflows_email) {
if ($workflows_email) {
$workflow_rules = WorkflowRules::where('workflow_id', '=', $workflows_email->id)->get();
foreach ($workflow_rules as $workflow_rule) {
if ($workflow_rule) {
$worklfow_rules = WorkflowRules::where('workflow_id', '=', $workflows_email->id)->get();
foreach ($worklfow_rules as $worklfow_rule) {
if ($worklfow_rule) {
// checking for the workflow rules to which workflow rule type it is
if ($workflow_rule->matching_scenario == 'email') {
if ($rule_condition = $this->checkRuleCondition($contact_details['email'], $workflow_rule->matching_relation, $workflow_rule->matching_value) == true) {
if ($worklfow_rule->matching_scenario == 'email') {
if ($rule_condition = $this->checkRuleCondition($contact_details['email'], $worklfow_rule->matching_relation, $worklfow_rule->matching_value) == true) {
$ticket_settings_details = $this->applyActionCondition($workflows_email->id, $ticket_settings_details);
}
} elseif ($workflow_rule->matching_scenario == 'email_name') {
if ($rule_condition = $this->checkRuleCondition($contact_details['email_name'], $workflow_rule->matching_relation, $workflow_rule->matching_value) == true) {
} elseif ($worklfow_rule->matching_scenario == 'email_name') {
if ($rule_condition = $this->checkRuleCondition($contact_details['email_name'], $worklfow_rule->matching_relation, $worklfow_rule->matching_value) == true) {
$ticket_settings_details = $this->applyActionCondition($workflows_email->id, $ticket_settings_details);
}
} elseif ($workflow_rule->matching_scenario == 'email_to') {
foreach ($contact_details['email_to'] as $email_toaddress => $email_toname) {
if ($rule_condition = $this->checkRuleCondition($email_toaddress, $workflow_rule->matching_relation, $workflow_rule->matching_value) == true) {
$ticket_settings_details = $this->applyActionCondition($workflows_email->id, $ticket_settings_details);
break;
}
}
} elseif ($workflow_rule->matching_scenario == 'subject') {
if ($rule_condition = $this->checkRuleCondition($contact_details['subject'], $workflow_rule->matching_relation, $workflow_rule->matching_value) == true) {
} elseif ($worklfow_rule->matching_scenario == 'subject') {
if ($rule_condition = $this->checkRuleCondition($contact_details['subject'], $worklfow_rule->matching_relation, $worklfow_rule->matching_value) == true) {
$ticket_settings_details = $this->applyActionCondition($workflows_email->id, $ticket_settings_details);
}
} elseif ($workflow_rule->matching_scenario == 'message') {
if ($rule_condition = $this->checkRuleCondition($contact_details['message'], $workflow_rule->matching_relation, $workflow_rule->matching_value) == true) {
} elseif ($worklfow_rule->matching_scenario == 'message') {
if ($rule_condition = $this->checkRuleCondition($contact_details['message'], $worklfow_rule->matching_relation, $worklfow_rule->matching_value) == true) {
$ticket_settings_details = $this->applyActionCondition($workflows_email->id, $ticket_settings_details);
}
}
@@ -149,28 +140,24 @@ class TicketWorkflowController extends Controller
$workflows_apis = WorkflowName::where('target', '=', 'A-4')->where('status', '=', '1')->orderBy('order', 'asc')->get();
foreach ($workflows_apis as $workflows_api) {
if ($workflows_api) {
$workflow_rules = WorkflowRules::where('workflow_id', '=', $workflows_api->id)->get();
foreach ($workflow_rules as $workflow_rule) {
if ($workflow_rule) {
$worklfow_rules = WorkflowRules::where('workflow_id', '=', $workflows_api->id)->get();
foreach ($worklfow_rules as $worklfow_rule) {
if ($worklfow_rule) {
// checking for the workflow rules to which workflow rule type it is
if ($workflow_rule->matching_scenario == 'email') {
if ($rule_condition = $this->checkRuleCondition($contact_details['email'], $workflow_rule->matching_relation, $workflow_rule->matching_value) == true) {
if ($worklfow_rule->matching_scenario == 'email') {
if ($rule_condition = $this->checkRuleCondition($contact_details['email'], $worklfow_rule->matching_relation, $worklfow_rule->matching_value) == true) {
$ticket_settings_details = $this->applyActionCondition($workflows_api->id, $ticket_settings_details);
}
} elseif ($workflow_rule->matching_scenario == 'email_to') {
if ($rule_condition = $this->checkRuleCondition($contact_details['email'], $workflow_rule->matching_relation, $workflow_rule->matching_value) == true) {
} elseif ($worklfow_rule->matching_scenario == 'email_name') {
if ($rule_condition = $this->checkRuleCondition($contact_details['email_name'], $worklfow_rule->matching_relation, $worklfow_rule->matching_value) == true) {
$ticket_settings_details = $this->applyActionCondition($workflows_api->id, $ticket_settings_details);
}
} elseif ($workflow_rule->matching_scenario == 'email_name') {
if ($rule_condition = $this->checkRuleCondition($contact_details['email_name'], $workflow_rule->matching_relation, $workflow_rule->matching_value) == true) {
} elseif ($worklfow_rule->matching_scenario == 'subject') {
if ($rule_condition = $this->checkRuleCondition($contact_details['subject'], $worklfow_rule->matching_relation, $worklfow_rule->matching_value) == true) {
$ticket_settings_details = $this->applyActionCondition($workflows_api->id, $ticket_settings_details);
}
} elseif ($workflow_rule->matching_scenario == 'subject') {
if ($rule_condition = $this->checkRuleCondition($contact_details['subject'], $workflow_rule->matching_relation, $workflow_rule->matching_value) == true) {
$ticket_settings_details = $this->applyActionCondition($workflows_api->id, $ticket_settings_details);
}
} elseif ($workflow_rule->matching_scenario == 'message') {
if ($rule_condition = $this->checkRuleCondition($contact_details['message'], $workflow_rule->matching_relation, $workflow_rule->matching_value) == true) {
} elseif ($worklfow_rule->matching_scenario == 'message') {
if ($rule_condition = $this->checkRuleCondition($contact_details['message'], $worklfow_rule->matching_relation, $worklfow_rule->matching_value) == true) {
$ticket_settings_details = $this->applyActionCondition($workflows_api->id, $ticket_settings_details);
}
}
@@ -179,10 +166,12 @@ class TicketWorkflowController extends Controller
}
}
}
//dd($form_data);
if ($ticket_settings_details['reject'] == true) {
return ['0' => false, '1' => false];
} else {
$create_ticket = $this->TicketController->create_user($contact_details['email'], $contact_details['email_name'], $contact_details['subject'], $contact_details['message'], $phone, $phonecode, $mobile_number, $ticket_settings_details['help_topic'], $ticket_settings_details['sla'], $ticket_settings_details['priority'], $source, $collaborator, $ticket_settings_details['dept'], $ticket_settings_details['assign'], $form_data, $auto_response, $ticket_settings_details['status'], $mail);
$create_ticket = $this->TicketController->create_user($contact_details['email'], $contact_details['email_name'], $contact_details['subject'], $contact_details['message'], $phone, $phonecode, $mobile_number, $ticket_settings_details['help_topic'], $ticket_settings_details['sla'], $ticket_settings_details['priority'], $source, $collaborator, $ticket_settings_details['dept'], $ticket_settings_details['assign'], $form_data, $auto_response, $ticket_settings_details['status']);
return $create_ticket;
}
@@ -217,7 +206,6 @@ class TicketWorkflowController extends Controller
// } elseif($condition == 'not_match') {
//
// }
return $return;
}