summaryrefslogtreecommitdiffstats
path: root/admin/survey/script/statusProfiles.js
diff options
context:
space:
mode:
authorAnton Luka Šijanec <anton@sijanec.eu>2024-05-27 13:08:29 +0200
committerAnton Luka Šijanec <anton@sijanec.eu>2024-05-27 13:08:29 +0200
commit75160b12821f7f4299cce7f0b69c83c1502ae071 (patch)
tree27e25e4ccaef45f0c58b22831164050d1af1d4db /admin/survey/script/statusProfiles.js
parentprvi-commit (diff)
download1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar
1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar.gz
1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar.bz2
1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar.lz
1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar.xz
1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar.zst
1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.zip
Diffstat (limited to 'admin/survey/script/statusProfiles.js')
-rw-r--r--admin/survey/script/statusProfiles.js46
1 files changed, 40 insertions, 6 deletions
diff --git a/admin/survey/script/statusProfiles.js b/admin/survey/script/statusProfiles.js
index 087ac4d..720e963 100644
--- a/admin/survey/script/statusProfiles.js
+++ b/admin/survey/script/statusProfiles.js
@@ -185,20 +185,55 @@ function statusProfileRefreshData(pid) {
return reloadData('status');
}
-function showColectDataSetting() {
- $('#fade').fadeTo('slow', 1);
- $('#fullscreen').html('').fadeIn('slow');
- $("#fullscreen").load('ajax.php?t=statusProfile&a=showColectDataSetting', {anketa:srv_meta_anketa_id});
+// Klik na novo generiranje datoteke s podatki
+function changeColectDataStatus() {
+
+ // Preverimo, ce imamo prevec neustreznih - potem ponudimo popup za brisanje neustreznih
+ let invalid_answers_count = 0;
+ $.post('ajax.php?a=dataCountNeustrezne', {anketa: srv_meta_anketa_id}, function(response) {
+ invalid_answers_count = response;
+
+ // Imamo prevec neustreznih enot - prikazemo popup za brisanje
+ if(invalid_answers_count > 1000){
+ showInvalidResponsesWarning();
+ }
+ // Na novo zgeneriramo datoteko s podatki
+ else{
+ refreshDataFile();
+ }
+ });
}
+// Prikazemo popup za brisanje neustreznih enot
+function showInvalidResponsesWarning() {
+
+ $('#fade').fadeTo('slow', 1);
+ $('#general_popup').addClass('PopUpNarrow');
+ $('#general_popup').html('').fadeIn('slow');
+ //$("#general_popup").load('ajax.php?a=oneClickArchive', {anketa: srv_meta_anketa_id});
+ $("#general_popup").load('ajax.php?t=statusProfile&a=showInvalidResponsesWarning', {anketa:srv_meta_anketa_id});
+}
-function changeColectDataStatus() {
+// Na novo zgeneriramo datoteko s podatki
+function refreshDataFile(){
+
var collect_all_status = $('input[name="collect_all_status"]').is(':checked') ? '0' : '1';
+
$.post('ajax.php?t=statusProfile&a=saveCollectDataSetting', {anketa: srv_meta_anketa_id, collect_all_status:collect_all_status}, function(response) {
return reloadData('status');
});
}
+// Pobrišemo neustrezne enote
+function deleteInvalidAnswers() {
+
+ $.post('ajax.php?a=dataDeleteNeustrezne', {anketa: srv_meta_anketa_id}, function(response) {
+
+ // Potem na novo zgeneriramo datoteko s podatki
+ refreshDataFile();
+ });
+}
+
function changeOnlyValidRadio() {
var checked = $('input[name=statusOnlyValid]:checked').val();
@@ -206,5 +241,4 @@ function changeOnlyValidRadio() {
$.post('ajax.php?t=statusProfile&a=changeOnlyValidRadio', {anketa: srv_meta_anketa_id,meta_akcija: srv_meta_akcija, podstran: srv_meta_podstran, checked:checked}, function(response) {
return reloadData('status');
});
-
} \ No newline at end of file