diff options
Diffstat (limited to '')
-rw-r--r-- | admin/survey/script/telephone.js | 64 |
1 files changed, 56 insertions, 8 deletions
diff --git a/admin/survey/script/telephone.js b/admin/survey/script/telephone.js index 26d126a..f97b082 100644 --- a/admin/survey/script/telephone.js +++ b/admin/survey/script/telephone.js @@ -1,3 +1,34 @@ +// meta podatki
+var srv_meta_anketa_id = $("#srv_meta_anketa").val();
+
+// avtomatsko vsake 30 sekund preverimo, ce se je pojavila kaksna nova stevilka
+function preveri_nove_stevilke () {
+ $.timer(30000, function (timer) {
+
+ $('#preveri_stevilke').load('ajax.php?t=telefon&a=preveri_stevilke', {anketa: srv_meta_anketa_id});
+ timer.stop();
+ });
+}
+
+// dashboard filter na datum
+function tel_date_filter () {
+
+ // Ce imamo nastavljen datum "od"
+ var dateFrom = $('#tel_dash_dateFrom').val();
+ var dateFromText = '';
+ if(dateFrom != '')
+ dateFromText = '&date_from=' + dateFrom;
+
+ // Ce imamo nastavljen datum "do"
+ var dateTo = $('#tel_dash_dateTo').val();
+ var dateToText = '';
+ if(dateTo != '')
+ dateToText = '&date_to=' + dateTo;
+
+ var srv_site_url = $("#srv_site_url").val();
+ srv_site_url += 'admin/survey/index.php?anketa='+srv_meta_anketa_id+'&a=telephone&m=dashboard'+dateFromText+dateToText;
+ window.location.href = srv_site_url;
+}
function showPhnList(pid) {
$("#globalSettingsInner").load('ajax.php?t=telephone&m=recipients_lists', {anketa:srv_meta_anketa_id, pid:pid });
@@ -8,7 +39,7 @@ function phn_settings_save() { form_serialize[form_serialize.length] = {name:'anketa', value:srv_meta_anketa_id}
$("#globalSettingsInner").load('ajax.php?t=telephone&m=settings_save', form_serialize, function(){
- show_success_save();
+ actionNotePopup('success_save', 'success');
});
}
@@ -45,10 +76,10 @@ function phn_add_recipients() { $elm.next().find('a').addClass('active');
$elm.removeClass('inv_ff_left_on').addClass('inv_ff_right_on').next().next().addClass('inv_ff_left_on');
} else {
- alert(lang['srv_invitation_note1']);
+ genericAlertPopup('srv_invitation_note1',null,'PopUpNarrow');
}
} else {
- alert(lang['srv_invitation_note2']);
+ genericAlertPopup('srv_invitation_note2',null,'PopUpNarrow');
}
return true;
@@ -79,7 +110,7 @@ function phnStartSurvey(usr_id){ window.location = return_data.reloadUrl;
return false;
} else {
- alert(return_data.msg);
+ genericAlertPopup('alert_parameter_datamsg');
}
},
async: false
@@ -87,7 +118,7 @@ function phnStartSurvey(usr_id){ }
-function phnNextActionChange() {
+function phnNextActionChange(phnNextAction) {
var phnNextAction = $("input[name=phnNextAction]:checked").val();
$.post('ajax.php?t=telephone&m=setNextAction', {anketa:srv_meta_anketa_id,noNavi:'true',phnNextAction:phnNextAction});
}
@@ -177,13 +208,13 @@ function phnGetNewProfileName() { $('#fullscreen').html('').fadeIn('slow');
$("#fullscreen").load('ajax.php?t=telephone&m=getProfileName', {anketa:srv_meta_anketa_id, recipients_list:recipients_list, fields:fields, noNavi:'true', pid:pid});
} else {
- alert(lang['srv_invitation_note1']);
+ genericAlertPopup('srv_invitation_note1',null,'PopUpNarrow');
}
} else {
- alert(lang['srv_invitation_note2']);
+ genericAlertPopup('srv_invitation_note2',null,'PopUpNarrow');
}
} else {
- alert('Invalid PID!');
+ genericAlertPopup('alert_invalidPID',null,'PopUpNarrow');
}
}
@@ -241,3 +272,20 @@ function phnUndoStatus(usr_id) { phnGoToUser(usr_id);
});
}
+
+// Sortiranje box-ov pri dodajanju respondentov
+function initTelephoneConnectedSortable(){
+
+ // Na mobitelu ne inicializiramo sorrtiranja, ker potem gumbi niso klikabilni (na nekaterih androidih ne deluje ok)
+ if($(window).width() < 850)
+ return false;
+
+ $('ul.connectedSortable').sortable({
+ update: function(){
+ refreshFieldsList();
+ },
+ forcePlaceholderSize:'true',
+ tolerance:'pointer',
+ placeholder:'inv_field_placeholder'
+ });
+}
|