CMXX - ServiceReport email in user language
This commit is contained in:
@@ -344,7 +344,7 @@ if (!empty($post_content['sn']) && !empty($post_content['testdetails'])) {
|
|||||||
|
|
||||||
foreach ($results as $result){
|
foreach ($results as $result){
|
||||||
$result = json_decode(json_encode($result));
|
$result = json_decode(json_encode($result));
|
||||||
$servicereport = serviceReport($result, 'email');
|
$servicereport = serviceReport($result, 'email', $language);
|
||||||
generatedPDF($servicereport,$last_id,$useremail);
|
generatedPDF($servicereport,$last_id,$useremail);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -329,7 +329,7 @@ if (isset($post_content['sn']) && isset($post_content['payload'])){
|
|||||||
|
|
||||||
foreach ($results as $result){
|
foreach ($results as $result){
|
||||||
$result = json_decode(json_encode($result));
|
$result = json_decode(json_encode($result));
|
||||||
$servicereport = serviceReport($result, 'email');
|
$servicereport = serviceReport($result, 'email', $language);
|
||||||
generatedPDF($servicereport,$last_id,$useremail);
|
generatedPDF($servicereport,$last_id,$useremail);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1025,11 +1025,11 @@ function serviceEvents ($messages,$page){
|
|||||||
// Service report //Input = servicereport
|
// Service report //Input = servicereport
|
||||||
//------------------------------------------
|
//------------------------------------------
|
||||||
|
|
||||||
function serviceReport($history, $request)
|
function serviceReport($history, $request, $country_code)
|
||||||
{
|
{
|
||||||
|
|
||||||
if(isset($_SESSION['country_code'])){
|
if(isset($country_code) && $country_code != ''){
|
||||||
$api_file_language = dirname(__FILE__,2).'/settings/translations/translations_'.strtoupper($_SESSION['country_code']).'.php';
|
$api_file_language = dirname(__FILE__,2).'/settings/translations/translations_'.strtoupper($country_code).'.php';
|
||||||
if (file_exists($api_file_language)){
|
if (file_exists($api_file_language)){
|
||||||
include $api_file_language; //Include the code
|
include $api_file_language; //Include the code
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ $historyID = $_GET['historyID'] ?? '';
|
|||||||
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||||
// Create ServiceReport
|
// Create ServiceReport
|
||||||
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||||
$servicereport_data = serviceReport($history[0], '');
|
$servicereport_data = serviceReport($history[0], '', $_SESSION['country_code']);
|
||||||
$servicereport_name = 'Service report - '.$historyID;
|
$servicereport_name = 'Service report - '.$historyID;
|
||||||
|
|
||||||
//+++++++++++++++++++++++++++++++++++++++++++
|
//+++++++++++++++++++++++++++++++++++++++++++
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ if (empty($history)){
|
|||||||
<td colspan="8" style="text-align:center;">'.$servicereport_no_history.'</td>
|
<td colspan="8" style="text-align:center;">'.$servicereport_no_history.'</td>
|
||||||
</tr>';
|
</tr>';
|
||||||
} else {
|
} else {
|
||||||
$service_events = serviceReport($history[0], 'display');
|
$service_events = serviceReport($history[0], 'display', $_SESSION['country_code']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$view .= '<div class="content-block">
|
$view .= '<div class="content-block">
|
||||||
|
|||||||
Reference in New Issue
Block a user