|
|
|
|
@@ -285,183 +285,319 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<script src="{% static '/candidate/bulk.js' %}"></script>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
$("#allCandidate").click(function (e) {
|
|
|
|
|
var is_checked = $(this).is(":checked");
|
|
|
|
|
if (is_checked) {
|
|
|
|
|
$(".all-candidate-row").prop("checked", true);
|
|
|
|
|
} else {
|
|
|
|
|
$(".all-candidate-row").prop("checked", false);
|
|
|
|
|
}
|
|
|
|
|
addingCandidateIds();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$(".all-candidate-row").change(function () {
|
|
|
|
|
addingCandidateIds();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$(document).ready(function () {
|
|
|
|
|
var excelMessages = {
|
|
|
|
|
ar: "هل ترغب في تنزيل ملف Excel؟",
|
|
|
|
|
de: "Möchten Sie die Excel-Datei herunterladen?",
|
|
|
|
|
es: "¿Desea descargar el archivo de Excel?",
|
|
|
|
|
en: "Do you want to download the excel file?",
|
|
|
|
|
fr: "Voulez-vous télécharger le fichier Excel?",
|
|
|
|
|
};
|
|
|
|
|
var archive_CanMessages = {
|
|
|
|
|
ar: "هل ترغب حقًا في أرشفة جميع المرشحين المحددين؟",
|
|
|
|
|
de: "Möchten Sie wirklich alle ausgewählten Kandidaten archivieren?",
|
|
|
|
|
es: "¿Realmente deseas archivar a todos los candidatos seleccionados?",
|
|
|
|
|
en: "Do you really want to archive all the selected candidates?",
|
|
|
|
|
fr: "Voulez-vous vraiment archiver tous les candidats sélectionnés?",
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var unarchive_CanMessages = {
|
|
|
|
|
ar: "هل ترغب حقًا في إلغاء أرشفة جميع المرشحين المحددين؟",
|
|
|
|
|
de: "Möchten Sie wirklich alle ausgewählten Kandidaten aus der Archivierung nehmen?",
|
|
|
|
|
es: "¿Realmente deseas desarchivar a todos los candidatos seleccionados?",
|
|
|
|
|
en: "Do you really want to unarchive all the selected candidates?",
|
|
|
|
|
fr: "Voulez-vous vraiment désarchiver tous les candidats sélectionnés?",
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var delete_CanMessages = {
|
|
|
|
|
ar: "هل ترغب حقًا في حذف جميع المرشحين المحددين؟",
|
|
|
|
|
de: "Möchten Sie wirklich alle ausgewählten Kandidaten löschen?",
|
|
|
|
|
es: "¿Realmente deseas eliminar a todos los candidatos seleccionados?",
|
|
|
|
|
en: "Do you really want to delete all the selected candidates?",
|
|
|
|
|
fr: "Voulez-vous vraiment supprimer tous les candidats sélectionnés?",
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var noRowMessages = {
|
|
|
|
|
ar: "لم يتم تحديد أي صفوف.",
|
|
|
|
|
de: "Es wurden keine Zeilen ausgewählt.",
|
|
|
|
|
es: "No se han seleccionado filas.",
|
|
|
|
|
en: "No rows have been selected.",
|
|
|
|
|
fr: "Aucune ligne n'a été sélectionnée.",
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var rowMessages = {
|
|
|
|
|
ar: " تم الاختيار",
|
|
|
|
|
de: " Ausgewählt",
|
|
|
|
|
es: " Seleccionado",
|
|
|
|
|
en: " Selected",
|
|
|
|
|
fr: " Sélectionné",
|
|
|
|
|
};
|
|
|
|
|
function tickCandidateCheckboxes() {
|
|
|
|
|
var ids = JSON.parse($("#selectedInstances").attr("data-ids") || "[]");
|
|
|
|
|
var uniqueIds = makeListUnique1(ids);
|
|
|
|
|
toggleHighlight(uniqueIds);
|
|
|
|
|
var selectedCount = uniqueIds.length;
|
|
|
|
|
var message1 = rowMessages[languageCode];
|
|
|
|
|
if (selectedCount > 0) {
|
|
|
|
|
$("#exportCandidates").css("display", "inline-flex");
|
|
|
|
|
$("#unselectAllInstances").css("display", "inline-flex");
|
|
|
|
|
$("#unselectAllInstances").css("display", "inline-flex");
|
|
|
|
|
$("#selectedCandidate").text(selectedCount + " -" + message1);
|
|
|
|
|
$("#selectedCandidate").css("display", "inline-flex");
|
|
|
|
|
} else {
|
|
|
|
|
$("#exportCandidates").css("display", "none");
|
|
|
|
|
$("#selectedCandidate").css("display", "none");
|
|
|
|
|
$("#unselectAllInstances").css("display", "none");
|
|
|
|
|
|
|
|
|
|
$("#selectedCandidate").css("display", "none");
|
|
|
|
|
var message = rowMessages[languageCode];
|
|
|
|
|
click = $("#selectedInstances").attr("data-clicked");
|
|
|
|
|
if (click === "1") {
|
|
|
|
|
$(".all-candidate").prop("checked", true);
|
|
|
|
|
$("#allCandidate").prop("checked", true);
|
|
|
|
|
}
|
|
|
|
|
$("#selectAllInstances").click(function () {
|
|
|
|
|
$("#selectedInstances").attr("data-clicked", 1);
|
|
|
|
|
var savedFilters = JSON.parse(localStorage.getItem("savedFilters"));
|
|
|
|
|
if (savedFilters && savedFilters["filterData"] !== null) {
|
|
|
|
|
var filter = savedFilters["filterData"];
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: '{% url "candidate-select-filter" %}',
|
|
|
|
|
data: { page: "all", filter: JSON.stringify(filter) },
|
|
|
|
|
type: "GET",
|
|
|
|
|
dataType: "json",
|
|
|
|
|
success: function (response) {
|
|
|
|
|
var employeeIds = response.employee_ids;
|
|
|
|
|
var selectedCount = employeeIds.length;
|
|
|
|
|
var selectedCount = employeeIds.length;
|
|
|
|
|
|
|
|
|
|
var selectedCount = employeeIds.length;
|
|
|
|
|
|
|
|
|
|
for (var i = 0; i < employeeIds.length; i++) {
|
|
|
|
|
var empId = employeeIds[i];
|
|
|
|
|
$("#" + empId).prop("checked", true);
|
|
|
|
|
}
|
|
|
|
|
var previousIds = $("#selectedInstances").attr("data-ids")
|
|
|
|
|
$("#selectedInstances").attr("data-ids", JSON.stringify(Array.from(new Set([...employeeIds,...JSON.parse(previousIds)]))));
|
|
|
|
|
count = makeListUnique1(employeeIds);
|
|
|
|
|
tickCandidateCheckboxes(count);
|
|
|
|
|
},
|
|
|
|
|
error: function (xhr, status, error) {
|
|
|
|
|
console.error("Error:", error);
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
uniqueIds.forEach(function (id) {
|
|
|
|
|
$("#" + id).prop("checked", true);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
getCurrentLanguageCode(function (code) {
|
|
|
|
|
languageCode = code;
|
|
|
|
|
if (selectedCount > 0) {
|
|
|
|
|
$("#exportCandidates").css("display", "inline-flex");
|
|
|
|
|
$("#unselectAllInstances").css("display", "inline-flex");
|
|
|
|
|
$("#selectedCandidate").text(selectedCount + " -" + message);
|
|
|
|
|
$("#selectedCandidate").css("display", "inline-flex");
|
|
|
|
|
} else {
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: '{% url "candidate-select" %}',
|
|
|
|
|
data: { page: "all" },
|
|
|
|
|
type: "GET",
|
|
|
|
|
dataType: "json",
|
|
|
|
|
success: function (response) {
|
|
|
|
|
var employeeIds = response.employee_ids;
|
|
|
|
|
var selectedCount = employeeIds.length;
|
|
|
|
|
for (var i = 0; i < employeeIds.length; i++) {
|
|
|
|
|
var empId = employeeIds[i];
|
|
|
|
|
$("#" + empId).prop("checked", true);
|
|
|
|
|
}
|
|
|
|
|
$("#selectedInstances").attr(
|
|
|
|
|
"data-ids",
|
|
|
|
|
JSON.stringify(employeeIds)
|
|
|
|
|
);
|
|
|
|
|
count = makeListUnique1(employeeIds);
|
|
|
|
|
tickCandidateCheckboxes(count);
|
|
|
|
|
},
|
|
|
|
|
error: function (xhr, status, error) {
|
|
|
|
|
console.error("Error:", error);
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
$("#exportCandidates").css("display", "none");
|
|
|
|
|
$("#unselectAllInstances").css("display", "none");
|
|
|
|
|
$("#selectedCandidate").css("display", "none");
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
$("#unselectAllInstances").click(function () {
|
|
|
|
|
$("#selectedInstances").attr("data-clicked", 0);
|
|
|
|
|
var ids = JSON.parse($("#selectedInstances").attr("data-ids") || "[]");
|
|
|
|
|
$("#selectedInstances").attr("data-ids", JSON.stringify(ids));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
tickCandidateCheckboxes();
|
|
|
|
|
|
|
|
|
|
function getCurrentLanguageCode(callback) {
|
|
|
|
|
var languageCode = $("#main-section-data").attr("data-lang");
|
|
|
|
|
var allowedLanguageCodes = ["ar", "de", "es", "en", "fr"];
|
|
|
|
|
if (allowedLanguageCodes.includes(languageCode)) {
|
|
|
|
|
callback(languageCode);
|
|
|
|
|
} else {
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: '{% url "candidate-select" %}',
|
|
|
|
|
data: { page: "unselect", filter: "{}" },
|
|
|
|
|
type: "GET",
|
|
|
|
|
dataType: "json",
|
|
|
|
|
url: "/employee/get-language-code/",
|
|
|
|
|
success: function (response) {
|
|
|
|
|
var employeeIds = response.employee_ids;
|
|
|
|
|
for (var i = 0; i < employeeIds.length; i++) {
|
|
|
|
|
var empId = employeeIds[i];
|
|
|
|
|
$("#" + empId).prop("checked", false);
|
|
|
|
|
$("#allCandidate").prop("checked", false);
|
|
|
|
|
}
|
|
|
|
|
var ids = JSON.parse($("#selectedInstances").attr("data-ids") || "[]");
|
|
|
|
|
var uniqueIds = makeListUnique(ids);
|
|
|
|
|
toggleHighlight(uniqueIds);
|
|
|
|
|
$("#selectedInstances").attr("data-ids", JSON.stringify([]));
|
|
|
|
|
count = [];
|
|
|
|
|
tickCandidateCheckboxes(count);
|
|
|
|
|
var ajaxLanguageCode = response.language_code;
|
|
|
|
|
$("#main-section-data").attr("data-lang", ajaxLanguageCode);
|
|
|
|
|
callback(
|
|
|
|
|
allowedLanguageCodes.includes(ajaxLanguageCode)
|
|
|
|
|
? ajaxLanguageCode
|
|
|
|
|
: "en"
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
error: function (xhr, status, error) {
|
|
|
|
|
console.error("Error:", error);
|
|
|
|
|
error: function () {
|
|
|
|
|
callback("en");
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function makeListUnique1(list) {
|
|
|
|
|
return Array.from(new Set(list));
|
|
|
|
|
}
|
|
|
|
|
function addingCandidateIds() {
|
|
|
|
|
var ids = JSON.parse($("#selectedInstances").attr("data-ids") || "[]");
|
|
|
|
|
var selectedCount = 0;
|
|
|
|
|
|
|
|
|
|
$(".all-candidate-row").each(function () {
|
|
|
|
|
if ($(this).is(":checked")) {
|
|
|
|
|
ids.push(this.id);
|
|
|
|
|
} else {
|
|
|
|
|
var index = ids.indexOf(this.id);
|
|
|
|
|
if (index > -1) {
|
|
|
|
|
ids.splice(index, 1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
$("#exportCandidates").click(function (e) {
|
|
|
|
|
var currentDate = new Date().toISOString().slice(0, 10);
|
|
|
|
|
var languageCode = null;
|
|
|
|
|
ids = [];
|
|
|
|
|
ids.push($("#selectedInstances").attr("data-ids"));
|
|
|
|
|
ids = JSON.parse($("#selectedInstances").attr("data-ids"));
|
|
|
|
|
getCurrentLanguageCode(function (code) {
|
|
|
|
|
languageCode = code;
|
|
|
|
|
var confirmMessage = excelMessages[languageCode];
|
|
|
|
|
Swal.fire({
|
|
|
|
|
text: confirmMessage,
|
|
|
|
|
icon: "question",
|
|
|
|
|
showCancelButton: true,
|
|
|
|
|
confirmButtonColor: "#008000",
|
|
|
|
|
cancelButtonColor: "#d33",
|
|
|
|
|
confirmButtonText: "Confirm",
|
|
|
|
|
}).then(function (result) {
|
|
|
|
|
if (result.isConfirmed) {
|
|
|
|
|
$.ajax({
|
|
|
|
|
type: "GET",
|
|
|
|
|
url: "/recruitment/candidate-info-export",
|
|
|
|
|
data: {
|
|
|
|
|
ids: JSON.stringify(ids),
|
|
|
|
|
},
|
|
|
|
|
dataType: "binary",
|
|
|
|
|
xhrFields: {
|
|
|
|
|
responseType: "blob",
|
|
|
|
|
},
|
|
|
|
|
success: function (response) {
|
|
|
|
|
const file = new Blob([response], {
|
|
|
|
|
type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
|
|
|
});
|
|
|
|
|
const url = URL.createObjectURL(file);
|
|
|
|
|
const link = document.createElement("a");
|
|
|
|
|
link.href = url;
|
|
|
|
|
link.download = "Candidate_file_" + currentDate + ".xlsx";
|
|
|
|
|
document.body.appendChild(link);
|
|
|
|
|
link.click();
|
|
|
|
|
},
|
|
|
|
|
error: function (xhr, textStatus, errorThrown) {
|
|
|
|
|
console.error("Error downloading file:", errorThrown);
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
var ids = makeListUnique1(ids);
|
|
|
|
|
var selectedCount = ids.length;
|
|
|
|
|
getCurrentLanguageCode(function (code) {
|
|
|
|
|
languageCode = code;
|
|
|
|
|
var message = rowMessages[languageCode];
|
|
|
|
|
var previousIds = $("#selectedInstances").attr("data-ids")
|
|
|
|
|
$("#selectedInstances").attr("data-ids", JSON.stringify(Array.from(new Set([...ids,...JSON.parse(previousIds)]))));
|
|
|
|
|
tickCandidateCheckboxes();
|
|
|
|
|
|
|
|
|
|
if (selectedCount > 0) {
|
|
|
|
|
$("#exportCandidates").css("display", "inline-flex");
|
|
|
|
|
$("#unselectAllInstances").css("display", "inline-flex");
|
|
|
|
|
$("#selectedCandidate").text(selectedCount + " -" + message);
|
|
|
|
|
$("#selectedCandidate").css("display", "inline-flex");
|
|
|
|
|
} else {
|
|
|
|
|
$("#exportCandidates").css("display", "none");
|
|
|
|
|
$("#unselectAllInstances").css("display", "none");
|
|
|
|
|
$("#selectedCandidate").css("display", "none");
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
$("#allCandidate").click(function (e) {
|
|
|
|
|
var is_checked = $(this).is(":checked");
|
|
|
|
|
if (is_checked) {
|
|
|
|
|
$(".all-candidate-row").prop("checked", true);
|
|
|
|
|
} else {
|
|
|
|
|
$(".all-candidate-row").prop("checked", false);
|
|
|
|
|
}
|
|
|
|
|
addingCandidateIds();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$(".all-candidate-row").change(function () {
|
|
|
|
|
addingCandidateIds();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$(document).ready(function () {
|
|
|
|
|
var excelMessages = {
|
|
|
|
|
ar: "هل ترغب في تنزيل ملف Excel؟",
|
|
|
|
|
de: "Möchten Sie die Excel-Datei herunterladen?",
|
|
|
|
|
es: "¿Desea descargar el archivo de Excel?",
|
|
|
|
|
en: "Do you want to download the excel file?",
|
|
|
|
|
fr: "Voulez-vous télécharger le fichier Excel?",
|
|
|
|
|
};
|
|
|
|
|
var ids = JSON.parse($("#selectedInstances").attr("data-ids") || "[]");
|
|
|
|
|
var uniqueIds = makeListUnique1(ids);
|
|
|
|
|
var selectedCount = uniqueIds.length;
|
|
|
|
|
var message1 = rowMessages[languageCode];
|
|
|
|
|
if (selectedCount > 0) {
|
|
|
|
|
$("#exportCandidates").css("display", "inline-flex");
|
|
|
|
|
$("#unselectAllInstances").css("display", "inline-flex");
|
|
|
|
|
$("#unselectAllInstances").css("display", "inline-flex");
|
|
|
|
|
$("#selectedCandidate").text(selectedCount + " -" + message1);
|
|
|
|
|
$("#selectedCandidate").css("display", "inline-flex");
|
|
|
|
|
} else {
|
|
|
|
|
$("#exportCandidates").css("display", "none");
|
|
|
|
|
$("#selectedCandidate").css("display", "none");
|
|
|
|
|
$("#unselectAllInstances").css("display", "none");
|
|
|
|
|
|
|
|
|
|
$("#selectedCandidate").css("display", "none");
|
|
|
|
|
}
|
|
|
|
|
$("#selectAllInstances").click(function () {
|
|
|
|
|
$("#selectedInstances").attr("data-clicked", 1);
|
|
|
|
|
var savedFilters = JSON.parse(localStorage.getItem("savedFilters"));
|
|
|
|
|
if (savedFilters && savedFilters["filterData"] !== null) {
|
|
|
|
|
var filter = savedFilters["filterData"];
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: '{% url "candidate-select-filter-onboarding" %}',
|
|
|
|
|
data: { page: "all", filter: JSON.stringify(filter) },
|
|
|
|
|
type: "GET",
|
|
|
|
|
dataType: "json",
|
|
|
|
|
success: function (response) {
|
|
|
|
|
var employeeIds = response.employee_ids;
|
|
|
|
|
var selectedCount = employeeIds.length;
|
|
|
|
|
var selectedCount = employeeIds.length;
|
|
|
|
|
|
|
|
|
|
var selectedCount = employeeIds.length;
|
|
|
|
|
|
|
|
|
|
for (var i = 0; i < employeeIds.length; i++) {
|
|
|
|
|
var empId = employeeIds[i];
|
|
|
|
|
$("#" + empId).prop("checked", true);
|
|
|
|
|
}
|
|
|
|
|
var previousIds = $("#selectedInstances").attr("data-ids")
|
|
|
|
|
$("#selectedInstances").attr("data-ids", JSON.stringify(Array.from(new Set([...employeeIds,...JSON.parse(previousIds)]))));
|
|
|
|
|
count = makeListUnique1(employeeIds);
|
|
|
|
|
// tickCandidateCheckboxes(count);
|
|
|
|
|
},
|
|
|
|
|
error: function (xhr, status, error) {
|
|
|
|
|
console.error("Error:", error);
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: '{% url "candidate-select-onboarding" %}',
|
|
|
|
|
data: { page: "all" },
|
|
|
|
|
type: "GET",
|
|
|
|
|
dataType: "json",
|
|
|
|
|
success: function (response) {
|
|
|
|
|
var employeeIds = response.employee_ids;
|
|
|
|
|
var selectedCount = employeeIds.length;
|
|
|
|
|
for (var i = 0; i < employeeIds.length; i++) {
|
|
|
|
|
var empId = employeeIds[i];
|
|
|
|
|
$("#" + empId).prop("checked", true);
|
|
|
|
|
}
|
|
|
|
|
$("#selectedInstances").attr(
|
|
|
|
|
"data-ids",
|
|
|
|
|
JSON.stringify(employeeIds)
|
|
|
|
|
);
|
|
|
|
|
count = makeListUnique1(employeeIds);
|
|
|
|
|
// tickCandidateCheckboxes(count);
|
|
|
|
|
},
|
|
|
|
|
error: function (xhr, status, error) {
|
|
|
|
|
console.error("Error:", error);
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
$("#unselectAllInstances").click(function () {
|
|
|
|
|
$("#selectedInstances").attr("data-clicked", 0);
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: '{% url "candidate-select-onboarding" %}',
|
|
|
|
|
data: { page: "unselect", filter: "{}" },
|
|
|
|
|
type: "GET",
|
|
|
|
|
dataType: "json",
|
|
|
|
|
success: function (response) {
|
|
|
|
|
var employeeIds = response.employee_ids;
|
|
|
|
|
for (var i = 0; i < employeeIds.length; i++) {
|
|
|
|
|
var empId = employeeIds[i];
|
|
|
|
|
$("#" + empId).prop("checked", false);
|
|
|
|
|
$("#allCandidate").prop("checked", false);
|
|
|
|
|
}
|
|
|
|
|
var ids = JSON.parse($("#selectedInstances").attr("data-ids") || "[]");
|
|
|
|
|
var uniqueIds = makeListUnique(ids);
|
|
|
|
|
toggleHighlight(uniqueIds);
|
|
|
|
|
$("#selectedInstances").attr("data-ids", JSON.stringify([]));
|
|
|
|
|
count = [];
|
|
|
|
|
// tickCandidateCheckboxes(count);
|
|
|
|
|
},
|
|
|
|
|
error: function (xhr, status, error) {
|
|
|
|
|
console.error("Error:", error);
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
$("#exportCandidates").click(function (e) {
|
|
|
|
|
var currentDate = new Date().toISOString().slice(0, 10);
|
|
|
|
|
var languageCode = null;
|
|
|
|
|
ids = [];
|
|
|
|
|
ids.push($("#selectedInstances").attr("data-ids"));
|
|
|
|
|
ids = JSON.parse($("#selectedInstances").attr("data-ids"));
|
|
|
|
|
getCurrentLanguageCode(function (code) {
|
|
|
|
|
languageCode = code;
|
|
|
|
|
var confirmMessage = excelMessages[languageCode];
|
|
|
|
|
Swal.fire({
|
|
|
|
|
text: confirmMessage,
|
|
|
|
|
icon: "question",
|
|
|
|
|
showCancelButton: true,
|
|
|
|
|
confirmButtonColor: "#008000",
|
|
|
|
|
cancelButtonColor: "#d33",
|
|
|
|
|
confirmButtonText: "Confirm",
|
|
|
|
|
}).then(function (result) {
|
|
|
|
|
if (result.isConfirmed) {
|
|
|
|
|
$.ajax({
|
|
|
|
|
type: "GET",
|
|
|
|
|
url: "/recruitment/candidate-info-export",
|
|
|
|
|
data: {
|
|
|
|
|
ids: JSON.stringify(ids),
|
|
|
|
|
},
|
|
|
|
|
dataType: "binary",
|
|
|
|
|
xhrFields: {
|
|
|
|
|
responseType: "blob",
|
|
|
|
|
},
|
|
|
|
|
success: function (response) {
|
|
|
|
|
const file = new Blob([response], {
|
|
|
|
|
type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
|
|
|
});
|
|
|
|
|
const url = URL.createObjectURL(file);
|
|
|
|
|
const link = document.createElement("a");
|
|
|
|
|
link.href = url;
|
|
|
|
|
link.download = "Candidate_file_" + currentDate + ".xlsx";
|
|
|
|
|
document.body.appendChild(link);
|
|
|
|
|
link.click();
|
|
|
|
|
},
|
|
|
|
|
error: function (xhr, textStatus, errorThrown) {
|
|
|
|
|
console.error("Error downloading file:", errorThrown);
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
// toggle columns //
|
|
|
|
|
toggleColumns("candidate-toggle-table","CandidateCells")
|
|
|
|
|
localStorageCandidateCells = localStorage.getItem("candidate_toggle_tab")
|
|
|
|
|
if (!localStorageCandidateCells) {
|
|
|
|
|
$("#CandidateCells").find("[type=checkbox]").prop("checked",true)
|
|
|
|
|
}
|
|
|
|
|
$("[type=checkbox]").change()
|
|
|
|
|
// toggle columns //
|
|
|
|
|
toggleColumns("candidate-toggle-table","CandidateCells")
|
|
|
|
|
localStorageCandidateCells = localStorage.getItem("candidate_toggle_tab")
|
|
|
|
|
if (!localStorageCandidateCells) {
|
|
|
|
|
$("#CandidateCells").find("[type=checkbox]").prop("checked",true)
|
|
|
|
|
}
|
|
|
|
|
$("[type=checkbox]").change()
|
|
|
|
|
</script>
|
|
|
|
|
|