91 lines
2.7 KiB
JavaScript
91 lines
2.7 KiB
JavaScript
|
|
function kolektorCreateResponsePopup(){
|
|
|
|
$("#fullscreen").addClass('PopUpNarrow').addClass('divPopUp');
|
|
$("#fullscreen").load('ajax.php?t=kolektor&a=add_repsonse_popup', function() {
|
|
|
|
$('#fade').fadeTo('slow', 1);
|
|
$('#fullscreen').show();
|
|
});
|
|
}
|
|
|
|
function kolektorCreateResponseClose(){
|
|
|
|
$('#fade').fadeOut('slow');
|
|
$('#fullscreen').fadeOut('slow').html('');
|
|
}
|
|
|
|
function kolektorCreateResponse(){
|
|
|
|
var form = $("#kolektor_add_response_form").serializeArray();
|
|
|
|
$('#kolektor_add_response').load('ajax.php?t=kolektor&a=add_repsonse', form);
|
|
|
|
}
|
|
|
|
|
|
// Oznacevanje ankete pri kreiranju responsa
|
|
function kolektorSelectSurvey(){
|
|
|
|
var survey_sequence = $('input[name="kolektor_survey"]:checked').attr("sequence");
|
|
|
|
console.log(survey_sequence);
|
|
|
|
if(survey_sequence > 0 && survey_sequence < 7){
|
|
|
|
$('#kolektor_respondent_settings').slideDown();
|
|
|
|
if(survey_sequence == 4 || survey_sequence == 5){
|
|
$('input[name="respondent_remote_activation"]').prop("disabled", false);
|
|
$('#kolektor_setting_activation').slideDown();
|
|
}
|
|
else{
|
|
$('input[name="respondent_remote_activation"]').prop("disabled", true);
|
|
$('#kolektor_setting_activation').slideUp();
|
|
}
|
|
}
|
|
else{
|
|
$('#kolektor_respondent_settings').slideUp();
|
|
}
|
|
}
|
|
|
|
// Preklop na drugo funkcijo v podjetju pri kreiranju responsa
|
|
function kolektorOtherFunction(){
|
|
|
|
// Vnos druge funkcije
|
|
if($('input#respondent_funkcija_other').is(':checked')){
|
|
$('#respondent_funkcija_dropdown').prop("disabled", true);
|
|
$('#respondent_funkcija_text').prop("disabled", false).show();
|
|
$('#respondent_funkcija_text').focus();
|
|
}
|
|
// Vnos funkcije iz dropdowna
|
|
else{
|
|
$('#respondent_funkcija_dropdown').prop("disabled", false);
|
|
$('#respondent_funkcija_text').prop("disabled", true).hide();
|
|
$('#respondent_funkcija_dropdown').focus();
|
|
}
|
|
}
|
|
|
|
|
|
// Popup za posiljanje opomnika respondentu
|
|
function kolektorSendRespondentNotificationPopup(respondent_id){
|
|
|
|
$("#fullscreen").addClass('PopUpNarrow').addClass('divPopUp');
|
|
$("#fullscreen").load('ajax.php?t=kolektor&a=send_respondent_notification_popup', {respondent_id: respondent_id}, function() {
|
|
|
|
$('#fade').fadeTo('slow', 1);
|
|
$('#fullscreen').show();
|
|
});
|
|
}
|
|
|
|
// Posiljanje opomnika respondentu
|
|
function kolektorSendRespondentNotification(){
|
|
|
|
var notification = $('textarea[name="respondent_message"]').val();
|
|
var respondent_id = $('input[name="respondent_id"]').val();
|
|
|
|
$('#kolektor_send_respondent_notification').load('ajax.php?t=kolektor&a=send_respondent_notification', {respondent_id:respondent_id, notification:notification});
|
|
|
|
}
|
|
|