summaryrefslogtreecommitdiffstats
path: root/admin/survey/script/invitations.js
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--admin/survey/script/invitations.js316
1 files changed, 132 insertions, 184 deletions
diff --git a/admin/survey/script/invitations.js b/admin/survey/script/invitations.js
index 05d2a56..71c36f6 100644
--- a/admin/survey/script/invitations.js
+++ b/admin/survey/script/invitations.js
@@ -19,6 +19,7 @@ function inv_delete_recipient() {
}
function editRecipient(inv_rid) {
$('#fade').fadeTo('slow', 1);
+ $('#fullscreen').addClass('divPopUp PopUpNarrow');
$('#fullscreen').html('').fadeIn('slow');
$("#fullscreen").load('ajax.php?t=invitations&a=edit_recipient', {anketa:srv_meta_anketa_id, inv_rid:inv_rid,noNavi:'true'});
}
@@ -61,7 +62,7 @@ function inv_change_import_type() {
}
function toggleInvCheckbox(what) {
var id = $(what).attr("id");
-
+
if ( $(what).is(":checked") ) {
$(what).parent().addClass('inv_field_enabled');
}
@@ -77,7 +78,7 @@ function refreshFieldsList() {
var fields_id = '';
var prefix = '';
var pass_field = false;
-
+
$('ul').children('li.inv_field_enabled').each(function(idx, elm) {
fields = fields + prefix + $(elm).find('label').html();
fields_id = fields_id + prefix + $(elm).attr('id');
@@ -116,7 +117,7 @@ function inv_save_rec_profile() {
inv_add_recipients(data.pid);
} else {
// prikažemo profil
- $(".anketa_edit_main").load('ajax.php?t=invitations&a=use_recipients_list', {anketa:srv_meta_anketa_id, pid:data.pid });
+ $("#anketa_edit").load('ajax.php?t=invitations&a=use_recipients_list', {anketa:srv_meta_anketa_id, pid:data.pid });
}
});
@@ -129,7 +130,7 @@ function inv_update_rec_profile() {
var pid = $('#inv_recipients_profile_name').find('#rec_profile_pid').val();
var profile_name = $('#inv_recipients_profile_name').find('#rec_profile_name').val();
- $("#inv_error_note").addClass('hidden');
+ $("#inv_error_note").addClass('displayNone');
$.post('ajax.php?t=invitations&a=update_rec_profile', {anketa:srv_meta_anketa_id, pid:pid, profile_name:profile_name, noNavi:'true'}, function(data) {
data = jQuery.parseJSON(data);
@@ -137,11 +138,11 @@ function inv_update_rec_profile() {
$('#fade').fadeOut('slow');
$('#fullscreen').fadeOut('slow').html('');
// osvežimo polja
- $(".anketa_edit_main").load('ajax.php?t=invitations&a=use_recipients_list', {anketa:srv_meta_anketa_id, pid:pid});
+ $("#anketa_edit").load('ajax.php?t=invitations&a=use_recipients_list', {anketa:srv_meta_anketa_id, pid:pid});
} else {
$("#inv_error_note").html(data.msg);
$("#inv_error_note").show();
- $("#inv_error_note").removeClass('hidden');
+ $("#inv_error_note").removeClass('displayNone');
}
});
}
@@ -163,17 +164,17 @@ function inv_add_recipients(profile_id) {
});
if (fields.length > 0) {
if (recipients_list.length > 0) {
- $(".anketa_edit_main").load('ajax.php?t=invitations&a=add_recipients', {anketa:srv_meta_anketa_id, recipients_list:recipients_list, fields:fields, pid:pid, save_profile:save_profile});
+ $("#anketa_edit").load('ajax.php?t=invitations&a=add_recipients', {anketa:srv_meta_anketa_id, recipients_list:recipients_list, fields:fields, pid:pid, save_profile:save_profile});
// porihtamo še navigacijo - hardcoded
$elm = $("ul.secondNavigation li.inv_ff_left_on");
$elm.prev().find('a').removeClass('active');
$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');
}
} else {
- alert(lang['srv_invitation_note2']);
+ genericAlertPopup('srv_invitation_note2');
}
}
@@ -210,7 +211,7 @@ function inv_save_recipient() {
// prikažemo obvestilo o napaki
$("#inv_error_note").html(data.msg);
$("#inv_error_note").show();
- $("#inv_error_note").removeClass('hidden');
+ $("#inv_error_note").removeClass('displayNone');
if (data.error_email == '1') {
$("#rec_email").addClass('inv_input_error');
}
@@ -238,27 +239,29 @@ function inv_filter_recipients() {
$("#globalSettingsInner").load('ajax.php?t=invitations&a=view_recipients', {anketa:srv_meta_anketa_id});
}
else{
- $(".anketa_edit_main").load('ajax.php?t=invitations&a=view_recipients', {anketa:srv_meta_anketa_id});
+ $("#anketa_edit").load('ajax.php?t=invitations&a=view_recipients', {anketa:srv_meta_anketa_id});
}
});
}
function inv_add_rec_to_db() {
$('#fade').fadeTo('slow', 1);
- $(".anketa_edit_main").load('ajax.php?t=invitations&a=add_users_to_database', {anketa:srv_meta_anketa_id}, function() {
+ $("#anketa_edit").load('ajax.php?t=invitations&a=add_users_to_database', {anketa:srv_meta_anketa_id}, function() {
$('#fade').fadeOut('slow');
});
}
function recipientsProfileOnlyThisSurvey() {
- //var checked = $("#inv_rec_only_this_survey").is(":checked");
+
var checked = $('input[name=inv_show_list_type]:checked').val() == 1 ? true : false;
+
$.post('ajax.php?t=invitations&a=only_this_survey', {anketa:srv_meta_anketa_id, checked:checked, noNavi:'true'}, function(data) {
var pid = $("#inv_import_list_profiles ol li.active").attr('pid');
if (pid == 'undefined') {
pid = '-1';
}
- $(".anketa_edit_main").load('ajax.php?t=invitations&a=use_recipients_list', {anketa:srv_meta_anketa_id, pid:pid });
+
+ $("#anketa_edit").load('ajax.php?t=invitations&a=use_recipients_list', {anketa:srv_meta_anketa_id, pid:pid });
});
}
@@ -468,11 +471,10 @@ function invitations_init() {
// izbira obstoječega profila prejemnikov
$("#inv_import_list_profiles ol li").live('click', function(event) {
-
- var target = $(event.target);
- var pid = $(target).attr('pid');
+
+ var pid = $(this).attr('pid');
if (pid != 'undefined') {
- $(".anketa_edit_main").load('ajax.php?t=invitations&a=use_recipients_list', {anketa:srv_meta_anketa_id, pid:pid });
+ $("#anketa_edit").load('ajax.php?t=invitations&a=use_recipients_list', {anketa:srv_meta_anketa_id, pid:pid });
}
});
@@ -499,7 +501,7 @@ function invChangeMessage(mid) {
delete CKEDITOR.instances['inv_message_body'];
}
- $(".anketa_edit_main").load('ajax.php?t=invitations&a=make_default',
+ $("#anketa_edit").load('ajax.php?t=invitations&a=make_default',
{anketa:srv_meta_anketa_id, mid:mid },
function(){
if (!CKEDITOR.instances) {
@@ -510,12 +512,18 @@ function invChangeMessage(mid) {
}
function invMessageDelete() {
+
var mid = $("#invitation_messages ol li.active").attr("mid");
- if (confirm(lang['srv_inv_recipients_delete_profile_confirm'])) {
+
+ if (confirm(lang['srv_inv_recipients_delete_message_confirm'])) {
+
if(CKEDITOR.instances['inv_message_body']) {
delete CKEDITOR.instances['inv_message_body'];
}
- $(".anketa_edit_main").load('ajax.php?t=invitations&a=delete_msg_profile', {anketa:srv_meta_anketa_id, mid:mid });
+
+ $("#anketa_edit").load('ajax.php?t=invitations&a=delete_msg_profile', {anketa:srv_meta_anketa_id, mid:mid });
+
+ event.stopPropagation();
}
}
@@ -523,6 +531,7 @@ function invShowMessageRename() {
// prikažemo popup za preimenovanje
var mid = $("#invitation_messages ol li.active").attr("mid");
$('#fade').fadeTo('slow', 1);
+ $('#fullscreen').addClass('divPopUp PopUpNarrow');
$('#fullscreen').html('').fadeIn('slow');
$("#fullscreen").load('ajax.php?t=invitations&a=show_message_rename', {anketa:srv_meta_anketa_id, noNavi:'true', mid:mid});
}
@@ -555,12 +564,17 @@ function invMessageRename() {
}
);
}
+
+// najprej dodatno poeditiramo sporočilo
function inv_message_save_advanced(mid) {
- // najprej dodatno poeditiramo sporočilo
+
$('#fade').fadeTo('slow', 1);
+ $('#fullscreen').addClass('divPopUp PopUpNarrow');
$('#fullscreen').html('').fadeIn('slow');
+
$("#fullscreen").load('ajax.php?t=invitations&a=edit_message_details', {anketa:srv_meta_anketa_id, noNavi:'true', mid:mid});
}
+
function inv_message_save_forward(mid) {
//v kolikor je CKEditor vklopljen potem, ga odstranimo pred skranjevanjem
if(CKEDITOR.instances['inv_message_body']){
@@ -586,7 +600,7 @@ function inv_message_save_forward(mid) {
'border' : 'none'
});
- $("#inv_error_note").addClass('hidden');
+ $("#inv_error_note").addClass('displayNone');
$.post(
'ajax.php?t=invitations&a=message_save_forward',
{
@@ -610,7 +624,7 @@ function inv_message_save_forward(mid) {
}
// prikažemo obvestilo o napaki
$("#inv_error_note").html(data.msg);
- $("#inv_error_note").removeClass('hidden');
+ $("#inv_error_note").removeClass('displayNone');
if (data.inv_message_replyto == '1') {
$("#inv_¸ge_replyto").css({
'border' : '1px solid red'
@@ -651,7 +665,7 @@ function inv_message_save_forward_noEmail(mid) {
'border' : 'none'
});
- $("#inv_error_note").addClass('hidden');
+ $("#inv_error_note").addClass('displayNone');
$.post(
'ajax.php?t=invitations&a=message_save_forward_noEmail',
{
@@ -674,7 +688,7 @@ function inv_message_save_forward_noEmail(mid) {
}
// prikažemo obvestilo o napaki
$("#inv_error_note").html(data.msg);
- $("#inv_error_note").removeClass('hidden');
+ $("#inv_error_note").removeClass('displayNone');
if (data.inv_message_subject == '1') {
$("#inv_message_subject").css({
'border' : '1px solid red'
@@ -712,7 +726,7 @@ function inv_message_save_simple(mid) {
'border' : 'none'
});
- $("#inv_error_note").addClass('hidden');
+ $("#inv_error_note").addClass('displayNone');
$.post(
'ajax.php?t=invitations&a=save_message_simple',
{
@@ -725,15 +739,17 @@ function inv_message_save_simple(mid) {
noNavi : 'true'
},
function(data) {
- create_inv_editor('', true)
+ create_editor('inv_message_body', true);
data = jQuery.parseJSON(data);
+
if (data.error == 0) {
return true;
- }else {
+ }
+ else {
// skrijemo okno in
// prikažemo obvestilo o napaki
$("#inv_error_note").html(data.msg);
- $("#inv_error_note").removeClass('hidden');
+ $("#inv_error_note").removeClass('displayNone');
if (data.inv_message_replyto == '1') {
$("#inv_messge_replyto").css({
'border' : '1px solid red'
@@ -773,7 +789,7 @@ function inv_message_save_simple_noEmail(mid) {
'border' : 'none'
});
- $("#inv_error_note").addClass('hidden');
+ $("#inv_error_note").addClass('displayNone');
$.post(
'ajax.php?t=invitations&a=save_message_simple_noEmail',
{
@@ -785,7 +801,7 @@ function inv_message_save_simple_noEmail(mid) {
noNavi : 'true'
},
function(data) {
- create_inv_editor('', true)
+ create_editor('', true)
data = jQuery.parseJSON(data);
if (data.error == 0) {
return true;
@@ -793,7 +809,7 @@ function inv_message_save_simple_noEmail(mid) {
// skrijemo okno in
// prikažemo obvestilo o napaki
$("#inv_error_note").html(data.msg);
- $("#inv_error_note").removeClass('hidden');
+ $("#inv_error_note").removeClass('displayNone');
if (data.inv_message_subject == '1') {
$("#inv_message_subject").css({
'border' : '1px solid red'
@@ -843,7 +859,7 @@ function inv_message_save_details() {
window.location.reload()
} else {
// so napake
- alert (' '+data.msg);
+ genericAlertPopup('alert_parameter_datamsg',data.msg);
}
}
);
@@ -860,100 +876,6 @@ function inv_new_message_list_change(what) {
}
}
-/*
-function edit_message_save(mid) {
- // shranimo v mid
- var replyto = $("#inv_message_replyto").val();
- var subject = $("#inv_message_subject").val();
- var body = $("#inv_message_body").val();
- var profile_comment = $("#inv_message_comment").val();
- var quickSave = true;
- if (!mid || mid == 'undefined') {
- mid = $("#inv_recipients_profile_name select").val();
- quickSave = false;
- }
- var naslov = $("#rec_profile_name").val();
- var old_mid = $("#invitation_messages ol li.active").attr('mid');
- // resetiramo morebitne prejšne napake
- $("#inv_message_replyto").css({
- 'border' : 'none'
- });
- $("#inv_message_subject").css({
- 'border' : 'none'
- });
- $("#inv_message_body").css({
- 'border' : 'none'
- });
-
- $("#inv_error_note").addClass('hidden');
-
- $.post(
- 'ajax.php?t=invitations&a=save_message',
- {
- anketa : srv_meta_anketa_id,
- mid : mid,
- old_mid:old_mid,
- quickSave:quickSave,
- replyto : replyto,
- subject : subject,
- body : body,
- noNavi : 'true',
- profile_comment : profile_comment,
- naslov:naslov
- },
- function(data) {
- data = jQuery.parseJSON(data);
- if (data.error == "0") {
- // redirektamo na pošiljanje
- //var href = 'index.php?anketa='+srv_meta_anketa_id+'&a=invitations&m=send_message';
- //window.location = href;
- window.location.reload()
- } else {
- // skrijemo okno in
- $('#fade').fadeOut('slow');
- $('#fullscreen').fadeOut('slow').html('')
- // prikažemo obvestilo o napaki
- $("#inv_error_note").html(data.msg);
- $("#inv_error_note").removeClass('hidden');
- if (data.inv_message_replyto == '1') {
- $("#inv_message_replyto").css({
- 'border' : '1px solid red'
- });
- }
- if (data.inv_message_subject == '1') {
- $("#inv_message_subject").css({
- 'border' : '1px solid red'
- });
- }
- if (data.inv_message_body == '1') {
- $("#inv_message_body").css({
- 'border' : '1px solid red'
- });
- }
- }
- });
-
- return false;
-
-}
-
-function invSendMail() {
- var send_type = $('input[name=mailto]:checked').val();
- var prefix = "";
- var checkboxes = "";
-
- $('input[name="mailto_status[]"]:checked').each(function(el) {
- checkboxes = checkboxes+prefix+$(this).val();
- prefix = ",";
- });
-
- $('#fade').fadeTo('slow', 1);
- $('#fullscreen').html('').fadeIn('slow');
-
- $("#fullscreen").load('ajax.php?t=invitations&a=check_send_mail',{anketa:srv_meta_anketa_id, noNavi:'true', send_type:send_type, checkboxes:checkboxes});
-
-};
-*/
function inv_del_rec_profile() {
var pid = $("#inv_import_list_profiles ol li.active").attr("pid");
@@ -970,7 +892,7 @@ function inv_del_rec_profile() {
var new_pid = $("#inv_import_list_profiles ol li").first().next().attr('pid');
}
- $(".anketa_edit_main").load('ajax.php?t=invitations&a=use_recipients_list', {anketa:srv_meta_anketa_id, pid:new_pid });
+ $("#anketa_edit").load('ajax.php?t=invitations&a=use_recipients_list', {anketa:srv_meta_anketa_id, pid:new_pid });
});
}
}
@@ -979,12 +901,13 @@ function inv_edit_rec_profile() {
var pid = $("#inv_import_list_profiles ol li.active").attr("pid");
$('#fade').fadeTo('slow', 1);
+ $('#fullscreen').addClass('divPopUp PopUpNarrow');
$('#fullscreen').html('').fadeIn('slow');
$("#fullscreen").load('ajax.php?t=invitations&a=edit_rec_profile', {anketa:srv_meta_anketa_id, pid:pid, noNavi:'true'});
}
function inv_prepare_add_recipients() {
- alert('Deprecated!');
+ genericAlertPopup('alert_deprecated');
return false;
}
@@ -1005,10 +928,10 @@ function inv_recipients_add_to_list() {
$('#fullscreen').html('').fadeIn('slow');
$("#fullscreen").load('ajax.php?t=invitations&a=get_profile_name', {anketa:srv_meta_anketa_id, recipients_list:recipients_list, fields:fields, noNavi:'true', doAdd:doAdd});
} else {
- alert(lang['srv_invitation_note1']);
+ genericAlertPopup('srv_invitation_note1');
}
} else {
- alert(lang['srv_invitation_note2']);
+ genericAlertPopup('srv_invitation_note2');
}
}
@@ -1064,7 +987,10 @@ function invTogleSend(what) {
}
}
-function inv_selectAll(val){
+function inv_selectAll(checkbox){
+
+ val = $(checkbox).is(':checked');
+
// oznacimo vse checkboxe
$('#tbl_recipients_list tr td input[type="checkbox"]').each(function() {
$(this).attr("checked", val);
@@ -1073,32 +999,33 @@ function inv_selectAll(val){
if(val == true){
$("#inv_switch_on").hide();
$("#inv_switch_off").show();
- } else{
+ }
+ else{
$("#inv_switch_off").hide();
$("#inv_switch_on").show();
}
}
function inv_list_selectAll(val){
- $(document).ready(function(){
- if(val == true){
- $('.test_checkAll').each(function(){
- this.checked = true;
- })
- $("#inv_switch_on").hide();
- $("#inv_switch_off").show();
- }else{
- $('.test_checkAll').each(function(){
- this.checked = false;
- })
- $("#inv_switch_on").show();
- $("#inv_switch_off").hide();
- }
- });
+
+ if(val == true){
+ $('.test_checkAll').each(function(){
+ this.checked = true;
+ })
+ $("#inv_switch_on").hide();
+ $("#inv_switch_off").show();
+ }
+ else{
+ $('.test_checkAll').each(function(){
+ this.checked = false;
+ })
+ $("#inv_switch_on").show();
+ $("#inv_switch_off").hide();
+ }
}
function inv_recipients_form_action(action) {
-
+
var recipents = $('#tbl_recipients_list input[name="inv_rids[]"]:checked');
if (action == 'delete') {
@@ -1116,9 +1043,9 @@ function inv_recipients_form_action(action) {
$.post('ajax.php?t=invitations&a=delete_recipient_all', {anketa:srv_meta_anketa_id,noNavi:'true'}, function(data) {
data = jQuery.parseJSON(data);
if (data.success == 1) {
- $(".anketa_edit_main").load('ajax.php?t=invitations&a=view_recipients', {anketa:srv_meta_anketa_id});
+ $("#anketa_edit").load('ajax.php?t=invitations&a=view_recipients', {anketa:srv_meta_anketa_id});
} else {
- alert(data.error);
+ genericAlertPopup('alert_parameter_dataerror',data.error);
}
});
}
@@ -1132,6 +1059,13 @@ function inv_recipients_form_action(action) {
return false;
}
+ else if (action == 'export_qr_codes') {
+ $("#frm_inv_rec_export").attr("action", "ajax.php?t=invitations&a=export_recipients_qr_codes");
+ $("#frm_inv_rec_export").attr("target", "_blank");
+ $('#frm_inv_rec_export').submit();
+
+ return false;
+ }
else if (action == 'export') {
// imamo akcijo izvozi
//če je kak izbran izvozimo tistega, če ne pa izberemo vse in izvozimo vse
@@ -1186,7 +1120,7 @@ function inv_recipients_list_action(action){
url: "ajax.php?t=invitations&a=deleteRecipientsListMulti",
success: function(data){
//console.log("Tle pride");
- $(".anketa_edit_main").load('ajax.php?t=invitations&a=inv_lists', {anketa:srv_meta_anketa_id});
+ $("#anketa_edit").load('ajax.php?t=invitations&a=inv_lists', {anketa:srv_meta_anketa_id});
}
});
}
@@ -1242,7 +1176,7 @@ function edit_message_save(mid) {
'border' : 'none'
});
- $("#inv_error_note").addClass('hidden');
+ $("#inv_error_note").addClass('displayNone');
$.post(
'ajax.php?t=invitations&a=save_message',
@@ -1271,7 +1205,7 @@ function edit_message_save(mid) {
$('#fullscreen').fadeOut('slow').html('')
// prikažemo obvestilo o napaki
$("#inv_error_note").html(data.msg);
- $("#inv_error_note").removeClass('hidden');
+ $("#inv_error_note").removeClass('displayNone');
if (data.inv_message_replyto == '1') {
$("#inv_message_replyto").css({
'border' : '1px solid red'
@@ -1328,10 +1262,12 @@ function showRecipientTracking(rid) {
function changeInvRecListCheckbox() {
var pids = "";
var prefix = "";
+
$('#inv_edit_rec_list table tr td input:checked').each(function(idx, elm) {
pids = pids + prefix + $(elm).attr('value');
prefix = ',';
});
+
var onlyThisSurvey = $('input[name=inv_show_list_type]:checked').val();
$("#inv_selected_rec_list").load('ajax.php?t=invitations&a=editRecList', {anketa:srv_meta_anketa_id,noNavi:'true',pids:pids, onlyThisSurvey:onlyThisSurvey});
@@ -1372,6 +1308,7 @@ $("#inv_edit_rec_list table tr td").live('click', function(event) {
*/
function inv_list_edit(pid) {
$('#fade').fadeTo('slow', 1);
+ $('#fullscreen').addClass('divPopUp PopUpNarrow');
$('#fullscreen').html('').fadeIn('slow');
$("#fullscreen").load('ajax.php?t=invitations&a=invListEdit', {anketa:srv_meta_anketa_id, pid:pid, noNavi:'true'});
}
@@ -1399,10 +1336,10 @@ function inv_list_get_name(saveNew) {
$('#fullscreen').html('').fadeIn('slow');
$("#fullscreen").load('ajax.php?t=invitations&a=list_get_name', {anketa:srv_meta_anketa_id, recipients_list:recipients_list, fields:fields, noNavi:'true', pid:pid, saveNew:saveNew});
} else {
- alert(lang['srv_invitation_note1']);
+ genericAlertPopup('srv_invitation_note1');
}
} else {
- alert(lang['srv_invitation_note2']);
+ genericAlertPopup('srv_invitation_note2');
}
}
@@ -1420,8 +1357,8 @@ function inv_list_save() {
var recipients_list = $("#inv_prof_recipients_list").val();
var field_list = $("#inv_prof_field_list").val();
var saveNew = ($("#saveNew").val() == 'true') ? 'true': 'false';
- alert(profile_name);
- $(".anketa_edit_main").load('ajax.php?t=invitations&a=inv_list_save', {anketa:srv_meta_anketa_id, recipients_list:recipients_list, field_list:field_list, profile_id:profile_id, profile_name:profile_name, profile_comment:profile_comment, saveNew:saveNew});
+ genericAlertPopup('alert_parameter_profilename',profile_name);
+ $("#anketa_edit").load('ajax.php?t=invitations&a=inv_list_save', {anketa:srv_meta_anketa_id, recipients_list:recipients_list, field_list:field_list, profile_id:profile_id, profile_name:profile_name, profile_comment:profile_comment, saveNew:saveNew});
$('#fade').fadeOut('slow');
$('#fullscreen').fadeOut('slow').html('');
}
@@ -1430,7 +1367,7 @@ function inv_list_edit_save() {
form_serialize[form_serialize.length] = {name:'anketa', value:srv_meta_anketa_id}
form_serialize[form_serialize.length] = {name:'noNavi', value:'true'}
- $(".anketa_edit_main").load('ajax.php?t=invitations&a=invListEditSave', form_serialize);
+ $("#anketa_edit").load('ajax.php?t=invitations&a=invListEditSave', form_serialize);
$('#fade').fadeOut('slow');
$('#fullscreen').fadeOut('slow').html('');
}
@@ -1444,14 +1381,14 @@ function inv_list_save_old(profile_id) {
var rec_profile_name = $("#rec_profile_name").val();
var rec_profile_comment = $("#rec_profile_comment").val();
- $(".anketa_edit_main").load('ajax.php?t=invitations&a=invListSaveOld', {anketa:srv_meta_anketa_id, recipients_list:recipients_list, field_list:fields, profile_id:profile_id, rec_profile_name:rec_profile_name, rec_profile_comment:rec_profile_comment});
+ $("#anketa_edit").load('ajax.php?t=invitations&a=invListSaveOld', {anketa:srv_meta_anketa_id, recipients_list:recipients_list, field_list:fields, profile_id:profile_id, rec_profile_name:rec_profile_name, rec_profile_comment:rec_profile_comment});
$('#fade').fadeOut('slow');
$('#fullscreen').fadeOut('slow').html('');
}
function deleteRecipientsList_confirm(id) {
if (confirm(lang['srv_inv_recipients_delete_list_confirm'])) {
- $(".anketa_edit_main").load('ajax.php?t=invitations&a=deleteRecipientsList', {anketa:srv_meta_anketa_id, id:id});
+ $("#anketa_edit").load('ajax.php?t=invitations&a=deleteRecipientsList', {anketa:srv_meta_anketa_id, id:id});
}
}
@@ -1517,10 +1454,10 @@ function inv_upload_list_check() {
if (extension == 'txt' || extension == 'csv') {
$('#inv_recipients_upload_form').submit();
} else {
- alert("Nepravilna vrsta datoteke!");
+ genericAlertPopup('alert_incorrect_filetype');
}
} else {
- alert("Izberite datoteko!");
+ genericAlertPopup('alert_choose_file');
}
}
@@ -1554,7 +1491,7 @@ function mailSourceMesageChange(what) {
function inv_set_sort_field(field,type) {
$.post('ajax.php?t=invitations&a=setSortField', {anketa:srv_meta_anketa_id,noNavi:'true', field:field,type:type}, function() {
- $(".anketa_edit_main").load('ajax.php?t=invitations&a=view_recipients', {anketa:srv_meta_anketa_id});
+ $("#anketa_edit").load('ajax.php?t=invitations&a=view_recipients', {anketa:srv_meta_anketa_id});
});
}
@@ -1650,16 +1587,18 @@ function invRecipientsForward() {
if (recipients_list.length > 0)
{
// shranimo seznam ali dodamo respondente ali oboje
- $(".anketa_edit_main").load('ajax.php?t=invitations&a=recipientsAddForward', {anketa:srv_meta_anketa_id, doAdd:doAdd, doSave:doSave, recipients_list:recipients_list, fields:fields, profile_name:profile_name, profile_comment:profile_comment, profile_id:profile_id, recipientsDelimiter: recipientsDelimiter});
- }
+ $("#anketa_edit").load('ajax.php?t=invitations&a=recipientsAddForward', {anketa:srv_meta_anketa_id, doAdd:doAdd, doSave:doSave, recipients_list:recipients_list, fields:fields, profile_name:profile_name, profile_comment:profile_comment, profile_id:profile_id, recipientsDelimiter: recipientsDelimiter});
+ /*$.post('ajax.php?t=invitations&a=recipientsAddForward', {anketa:srv_meta_anketa_id, doAdd:doAdd, doSave:doSave, recipients_list:recipients_list, fields:fields, profile_name:profile_name, profile_comment:profile_comment, profile_id:profile_id, recipientsDelimiter: recipientsDelimiter});
+ window.location = 'index.php?anketa='+srv_meta_anketa_id+'&a=invitations&m=view_recipients';*/
+ }
else
{
- alert(lang['srv_invitation_note1']);
+ genericAlertPopup('srv_invitation_note1');
}
}
else
{
- alert(lang['srv_invitation_note2']);
+ genericAlertPopup('srv_invitation_note2');
}
}
@@ -1688,7 +1627,7 @@ function invitationSetCondition(cid)
$('#fullscreen').fadeOut('slow').html('');
$('#fade').fadeOut('slow');
- $(".anketa_edit_main").load('ajax.php?t=invitations&a=setAdvancedCondition', {anketa:srv_meta_anketa_id, cid:cid});
+ $("#anketa_edit").load('ajax.php?t=invitations&a=setAdvancedCondition', {anketa:srv_meta_anketa_id, cid:cid});
}
function noEmailingToggle(value){
@@ -1715,28 +1654,20 @@ function noEmailingType(value){
function smtpAAIPopupShow(){
$('#fade').fadeTo('slow', 1);
- $('#popup_note').html('').fadeIn('slow');
- $("#popup_note").load('ajax.php?t=invitations&a=showAAISmtpPopup', {anketa: srv_meta_anketa_id, noNavi:'true'});
+ $('#general_popup').html('').addClass('PopUpNarrow').fadeIn('slow');
+ $("#general_popup").load('ajax.php?t=invitations&a=showAAISmtpPopup', {anketa: srv_meta_anketa_id, noNavi:'true'});
}
function smtpAAIPopupClose(){
// Ni sprejel - vrnemo radio
$('input[name=SMTPMailMode][value=2]').prop('checked', true);
- $('#popup_note').fadeOut('slow').html('');
- $('#fade').fadeOut('slow');
+ popupClose();
}
function smtpAAISet(){
// Shranimo formo
$("form[name='settingsanketa_"+srv_meta_anketa_id+"']").submit();
-
- // Prikazemo nastavitve za Arnes smtp
- /*$('#send_mail_mode1, #send_mail_mode2').hide();
- $('#send_mail_mode0').show();
-
- // Zapremo popup
- smtpAAIPopupClose();*/
}
function smtpAAIAccept(){
@@ -1751,13 +1682,30 @@ function smtpAAIAccept(){
function squaloSwitch(){
if($('#squalo_mode').prop('checked')){
- $('#send_mail_mode0, #send_mail_mode1, #send_mail_mode2, .mail_mode_switch, #send_mail_mode_test').hide();
+ $('#send_mail_mode0, #send_mail_mode1, #send_mail_mode2, .mail_mode_switch, #send_mail_mode_test').addClass('displayNone');
$('#success_save').hide();
}
else{
- $('.squalo_settings').hide();
- $('#send_mail_mode2, .mail_mode_switch, #send_mail_mode_test').show();
+ $('.squalo_settings').addClass('displayNone');
+ $('#send_mail_mode2, .mail_mode_switch, #send_mail_mode_test').removeClass('displayNone');
$('#success_save').hide();
}
}
+// Sortiranje box-ov pri dodajanju respondentov
+function initInvitationsConnectedSortable(){
+
+ // 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',
+ cancel:'#inv_field_relation'
+ });
+}