Merge branch 'dev' of bitbucket.org:jubilian/nhance into dev

This commit is contained in:
Srinivas-Saravanan 2025-03-31 14:27:18 +05:30
commit b9fb15be91
5 changed files with 56 additions and 17 deletions

View File

@ -360,12 +360,13 @@ class EmployeeController extends AdminController
batch_files.status, batch_files.status,
batch_files.client_branch_id, batch_files.client_branch_id,
CASE CASE
WHEN batch_files.status = 'partially success' THEN WHEN batch_files.status = 'partially success' OR batch_files.status = 'in-progress-partially' THEN
batch_files.error_data batch_files.error_data
ELSE ELSE
error_data = null NULL
END AS error_data, END AS error_data,
clients.short_name as client_short_name, clients.short_name as client_short_name,
client_branch.branch_name, client_branch.branch_name,

View File

@ -29,6 +29,7 @@ class ExcelSanitizeHelper
$cleanData[$key] = self::sanitizeArrayData($value); // Recursive call for nested arrays $cleanData[$key] = self::sanitizeArrayData($value); // Recursive call for nested arrays
} elseif (is_string($value)) { } elseif (is_string($value)) {
// Remove non-printable characters and trim whitespace from strings // Remove non-printable characters and trim whitespace from strings
$value = str_replace("\u00a0", " ", $value);
$cleanData[$key] = trim(preg_replace(self::$nonPrintablePattern, '', $value)); $cleanData[$key] = trim(preg_replace(self::$nonPrintablePattern, '', $value));
} else { } else {
$cleanData[$key] = $value; // Keep non-string/non-array data as is $cleanData[$key] = $value; // Keep non-string/non-array data as is

View File

@ -665,3 +665,15 @@ if (!function_exists('check_pay_by_employee_or_company')) {
} }
if (!function_exists('is_json_string')) {
function is_json_string($string)
{
if (!is_string($string)) {
return false;
}
$decoded = json_decode($string, true);
return (json_last_error() === JSON_ERROR_NONE && is_array($decoded));
}
}

View File

@ -90,6 +90,17 @@
   
<?php } ?> <?php } ?>
<?php } else if ($file['status'] == 'in-progress-partially') { ?>
<?php echo $file['status']; ?>
<?php if (!is_json_string($file['error_data'])) { ?>
<a class="fe-alert-circle" style="color: #000;" data-toggle="tooltip"
data-placement="top" title="<?= $file['error_data'] ?>"></a>
&nbsp;
<?php } ?>
<?php } else if ($file['status'] == 'failed-1') { ?> <?php } else if ($file['status'] == 'failed-1') { ?>
failed <a class="fe-alert-circle" style="color: #000;" data-toggle="tooltip" failed <a class="fe-alert-circle" style="color: #000;" data-toggle="tooltip"
@ -146,7 +157,7 @@
onclick="getBatchFileData(this)" class="dropdown-item upload_button" ><i class="mdi mdi-upload mr-2 text-muted font-18 vertical-middle"></i>Re-Upload</a> onclick="getBatchFileData(this)" class="dropdown-item upload_button" ><i class="mdi mdi-upload mr-2 text-muted font-18 vertical-middle"></i>Re-Upload</a>
<?php } ?> <?php } ?>
<?php if (str_starts_with($file['status'], 'failed')) { ?> <?php if ($file['actions'] == "import") { ?>
<a href="<?= base_url('/util/download_import_file/') . $file['id'] ?>" class="dropdown-item" style="color: #000;" aria-hidden="true" target="_blank" ><i class="mdi mdi-download mr-2 text-muted font-18 vertical-middle"></i>Download</a> <a href="<?= base_url('/util/download_import_file/') . $file['id'] ?>" class="dropdown-item" style="color: #000;" aria-hidden="true" target="_blank" ><i class="mdi mdi-download mr-2 text-muted font-18 vertical-middle"></i>Download</a>
<?php } ?> <?php } ?>

View File

@ -71,13 +71,10 @@ $(document).ready(function(){
$('#client_rm_edit').hide() $('#client_rm_edit').hide()
$('#account_manager').multiselect({ $('#account_manager').prop('disabled', true);
nonSelectedText: 'Select Account Manager',
enableFiltering: false, $("textarea.select2-search__field").attr('rows', '1');
enableCaseInsensitiveFiltering: false, $("textarea.select2-search__field").css('resize', 'none');
includeSelectAllOption : false,
buttonWidth:'100%'
});
var data = <?= isset($client_relation) ? json_encode($client_relation) : '[]' ?>; var data = <?= isset($client_relation) ? json_encode($client_relation) : '[]' ?>;
@ -94,10 +91,16 @@ $(document).ready(function(){
} }
}); });
$('#account_manager').multiselect('refresh');
$('#account_manager').select2({
placeholder: "Select Account Manager",
}).prop('disabled', true);
$("textarea.select2-search__field").attr('rows', '1');
$("textarea.select2-search__field").css('resize', 'none');
$('#head').prop('disabled', true); $('#head').prop('disabled', true);
$('#manager').prop('disabled', true); $('#manager').prop('disabled', true);
$('#account_manager').multiselect('disable');
} }
@ -172,14 +175,25 @@ $(document).ready(function(){
$('#manager').prop('disabled', !isDisabled); $('#manager').prop('disabled', !isDisabled);
if (isDisabled) { if (isDisabled) {
$('#account_manager').multiselect('enable'); $('#account_manager').select2({
placeholder: "Select Account Manager",
}).prop('disabled', false);
$('#client_rm_btnSubmit').show(); $('#client_rm_btnSubmit').show();
$(this).html('<span id="rm_icons" class="fa fa-times-circle"></span> Close Edit '); $(this).html('<span id="rm_icons" class="fa fa-times-circle"></span> Close Edit ');
} else { } else {
$('#account_manager').multiselect('disable'); $('#account_manager').select2({
placeholder: "Select Account Manager"
}).prop('disabled', true);
$('#client_rm_btnSubmit').hide(); $('#client_rm_btnSubmit').hide();
$(this).html('<span id="rm_icons" class="mdi mdi-lead-pencil"></span> Edit '); $(this).html('<span id="rm_icons" class="mdi mdi-lead-pencil"></span> Edit ');
} }
$("textarea.select2-search__field").attr('rows', '1');
$("textarea.select2-search__field").css('resize', 'none');
}); });