summaryrefslogtreecommitdiffstats
path: root/admin/survey/script/postProcess.js
diff options
context:
space:
mode:
Diffstat (limited to 'admin/survey/script/postProcess.js')
-rw-r--r--admin/survey/script/postProcess.js165
1 files changed, 85 insertions, 80 deletions
diff --git a/admin/survey/script/postProcess.js b/admin/survey/script/postProcess.js
index f8133d4..42cbdbd 100644
--- a/admin/survey/script/postProcess.js
+++ b/admin/survey/script/postProcess.js
@@ -22,7 +22,7 @@ function edit_data(event) {
if ( ! target.is('td') ) return;
var target_parent_children = target.parent().children(); // td-ji vrstice kamor smo kliknili
- var table_head_children = $('#dataTable tr:nth-child(3)').children(); // th-ji vrstice header tabele (s spr_id)
+ var table_head_children = $('#dataTable tr:nth-child(2)').children(); // th-ji vrstice header tabele (s spr_id)
var td = target.prevAll('td.data_uid'); // td, ki vsebuje usr_id
@@ -110,7 +110,7 @@ function edit_data_hover (event) {
if ( ! target.is('td') ) return;
var target_parent_children = target.parent().children(); // td-ji vrstice kamor smo kliknili
- var table_head_children = $('#dataTable tr:nth-child(3)').children(); // th-ji vrstice header tabele (s spr_id)
+ var table_head_children = $('#dataTable tr:nth-child(2)').children(); // th-ji vrstice header tabele (s spr_id)
// nad katero celico je kurosr
var cell_over = target_parent_children.index(target);
@@ -162,7 +162,7 @@ function edit_data_inline_edit () {
// povemo koliko stolpcev z ikonicami imamo (se nastavi v html)
var tableIconColspan = parseInt( $("#tableIconColspan").val() ) || 0;
- var tableHeadChildren = $('#dataTable tr:nth-child(3)').children(); // th-ji vrstice header tabele
+ var tableHeadChildren = $('#dataTable tr:nth-child(2)').children(); // th-ji vrstice header tabele
var sprList = [];
@@ -297,19 +297,25 @@ function data_header_hoverout (event) {
function data_header_click (event) {
var target = $(event.target);
- // ce smo kliknili na notranji div z classom: .dataCell
- if ( target.is('.dataCell') ) {
- target = target.parent();
- }
-
- if ( ! target.is('th') ) return;
-
- $("#loading").show();
-
- var sort_seq = target.attr('seq');
- if ( !isNaN(sort_seq) && sort_seq!='' ) {
- var sort_type = target.is('.sort_asc') ? 'sort_dsc' : 'sort_asc'
- vnos_redirect(sort_action_url+'&sort_seq='+sort_seq+'&sort_type='+sort_type);
+ let spr_id = target.attr('spr_id');
+
+ //ignoriramo line number
+ if(spr_id != 'lineNo'){
+ // ce smo kliknili na notranji div z classom: .dataCell
+ if ( target.is('.dataCell') ) {
+ target = target.parent();
+ }
+
+ if ( ! target.is('th') ) return;
+
+ $("#loading").show();
+
+
+ var sort_seq = target.attr('seq');
+ if ( !isNaN(sort_seq) && sort_seq!='') {
+ var sort_type = target.is('.sort_asc') ? 'sort_dsc' : 'sort_asc'
+ vnos_redirect(sort_action_url+'&sort_seq='+sort_seq+'&sort_type='+sort_type);
+ }
}
}
@@ -322,7 +328,7 @@ function coding_click ( el, event ) {
var td_pos = el.parent().children().index(el);
- var spr_id = $('#dataTable tr:nth-child(3) th:eq('+td_pos+')').attr('spr_id');
+ var spr_id = $('#dataTable tr:nth-child(2) th:eq('+td_pos+')').attr('spr_id');
if ( ! spr_id > 0) return;
@@ -360,7 +366,7 @@ function coding_save (usr_id) {
$('#dataTable tbody td').removeClass('cellBlue');
$('#coding').hide();
- $('.coding-refresh').fadeIn();
+ $('.coding-refresh').show();
}
function coding_vrednost_new (spr_id, usr_id, naslov) {
@@ -404,6 +410,11 @@ function coding_filter (seq) {
});
}
+function toggle_coding_div () {
+
+ $('#coding').hide();
+
+}
function coding_merge (spr_id, vre_id, usr_id, merge) {
@@ -439,7 +450,7 @@ function postProcessAddMetaTitles() {
fields['itime'] = 0;
fields['lineNo'] = 0;
fields['meta'] = 0;
- $.each ( $('#dataTable tr:nth-child(3) th') ,function (i, element)
+ $.each ( $('#dataTable tr:nth-child(2) th') ,function (i, element)
{
if ($(element).attr('spr_id') == 'status')
{
@@ -576,13 +587,14 @@ function postProcessAddLurkerTitles(column) {
// povemo koliko stolpcev z ikonicami imamo (se nastavi v html)
var tableIconColspan = parseInt($("#tableIconColspan").val());
// zamenjamo statuse
- // poiščemo elemente z sekvenco: 2-ustreznost 4 - status, 5 - lurker
- var table_head_children = $('#dataTable tr:nth-child(3)').children(); // th-ji vrstice header tabele (s spr_id)
- var table_index = table_head_children.filter("th[seq=5]").index();
+ // poiščemo elemente z sekvenco: 4-ustreznost 3 - email, 5 - lurker
+ var table_head_children = $('#dataTable tr:nth-child(2)').children(); // th-ji vrstice header tabele (s spr_id)
+ var table_index = table_head_children.filter("th[spr_id=lurker]").index();
+
// če sploh prikazujemo statuse
if (table_index > 0) {
//naredimo korekcijo: katera je head celica z spr_id za celico z kurzorjem
- table_index = tableIconColspan+column;
+ table_index = 1+tableIconColspan+column;
var langs = new Array();
// polovimo tekste
@@ -591,31 +603,68 @@ function postProcessAddLurkerTitles(column) {
langs[0]=data.status0;
langs[1]=data.status1;
// preletimo skozi kolono in dodamo title
- $.each ( $('#dataTable tr') ,
+ $.each ( $('#dataTable tbody tr') ,
function (i, value) {
- var element = $(value).find(':nth-child('+(table_index)+')');
+ var element = $(value).find('td:nth-child('+(table_index)+')');
+
if ($(element).is('td')) {
var status = parseInt(element.html());
var new_val = langs[status];
element.attr('title',new_val);
element.html(new_val);
+ element.addClass("cellGreen");
}
-
});
});
}
}
+
+function postProcessAddRelevanceTitles(column) {
+ // povemo koliko stolpcev z ikonicami imamo (se nastavi v html)
+ var tableIconColspan = parseInt($("#tableIconColspan").val());
+ // zamenjamo statuse
+ // poiščemo elemente z sekvenco: 4-ustreznost 3 - email, 5 - lurker
+ var table_head_children = $('#dataTable tr:nth-child(2)').children(); // th-ji vrstice header tabele (s spr_id)
+ var table_index = table_head_children.filter("th[spr_id=relevance]").index();
+
+ // če sploh prikazujemo statuse
+ if (table_index > 0) {
+ //naredimo korekcijo: katera je head celica z spr_sid za celico z kurzorjem
+ table_index = 1+tableIconColspan+column;
+
+ var langs = new Array();
+ // polovimo tekste
+ $.post('ajax.php?a=getDataLurkerTitles', {anketa: srv_meta_anketa_id}, function (data) {
+ data = jQuery.parseJSON(data);
+ langs[0]=data.status0;
+ langs[1]=data.status1;
+ // preletimo skozi kolono in dodamo title
+ $.each ( $('#dataTable tbody tr') ,
+ function (i, value) {
+ var element = $(value).find('td:nth-child('+(table_index)+')');
+ if ($(element).is('td')) {
+ var status = parseInt(element.html());
+ var new_val = langs[status];
+ element.attr('title',new_val);
+ element.html(new_val);
+ element.addClass("cellGreen");
+ }
+ });
+ });
+ }
+}
+
function postProcessAddEmailTitles(column) {
// povemo koliko stolpcev z ikonicami imamo (se nastavi v html)
var tableIconColspan = parseInt($("#tableIconColspan").val());
// zamenjamo statuse
- // poiščemo elemente z sekvenco: 2-ustreznost 3 - status, 5 - lurker
- var table_head_children = $('#dataTable tr:nth-child(3)').children(); // th-ji vrstice header tabele (s spr_id)
- var table_index = table_head_children.filter("th[seq=3]").index();
+ // poiščemo elemente z sekvenco: 4-ustreznost 3 - email, 5 - lurker
+ var table_head_children = $('#dataTable tr:nth-child(2)').children(); // th-ji vrstice header tabele (s spr_id)
+ var table_index = table_head_children.filter("th[spr_id=invitation]").index();
// če sploh prikazujemo statuse
if (table_index > 0) {
//naredimo korekcijo: katera je head celica z spr_sid za celico z kurzorjem
- table_index = tableIconColspan+column;
+ table_index = 1+tableIconColspan+column;
var langs = new Array();
// polovimo tekste
$.post('ajax.php?a=getDataEmailTitles', {anketa: srv_meta_anketa_id}, function (data) {
@@ -627,6 +676,7 @@ function postProcessAddEmailTitles(column) {
$.each ( $('#dataTable tbody tr') ,
function (i, value) {
var element = $(value).find('td:nth-child('+(table_index)+')');
+
if ($(element).is('td')) {
var status = parseInt(element.html());
var new_val = langs[status];
@@ -637,65 +687,20 @@ function postProcessAddEmailTitles(column) {
if(status == 1)
element.addClass("invitation_cell");
}
-
- });
- });
- }
-}
-function postProcessAddRelevanceTitles() {
- // povemo koliko stolpcev z ikonicami imamo (se nastavi v html)
- var tableIconColspan = parseInt($("#tableIconColspan").val());
- // zamenjamo statuse
- // poiščemo elemente z sekvenco: 2-ustreznost 3 - status, 5 - lurker
- var table_head_children = $('#dataTable tr:nth-child(3)').children(); // th-ji vrstice header tabele (s spr_id)
- var table_index = table_head_children.filter("th[seq=2]").index();
- // če sploh prikazujemo statuse
- if (table_index > 0) {
- //naredimo korekcijo: katera je head celica z spr_sid za celico z kurzorjem
- table_index = tableIconColspan+2;
-
- var langs = new Array();
- // polovimo tekste
- $.post('ajax.php?a=getDataLurkerTitles', {anketa: srv_meta_anketa_id}, function (data) {
- data = jQuery.parseJSON(data);
- langs[0]=data.status0;
- langs[1]=data.status1;
- // preletimo skozi kolono in dodamo title
- $.each ( $('#dataTable tbody tr') ,
- function (i, value) {
- var element = $(value).find('td:nth-child('+(table_index)+')');
- if ($(element).is('td')) {
- var status = parseInt(element.html());
- var new_val = langs[status];
- element.attr('title',new_val);
- element.html(new_val);
- element.addClass("cellGreen");
- }
-
});
});
}
}
function showSurveyAnswers(event) {
-/*
- var srv_site_url = $("#srv_site_url").val();
- var target = $(event.target);
- var uid = $(target).parent().find('.data_uid').html();
- var href = srv_site_url+'main/survey/edit_anketa.php?anketa='+srv_meta_anketa_id+'&usr_id='+uid+'&quick_view=1';
- //alert(href);
- //return false;
- if (uid > 0 ){
- window.open(href, '_blank');
- }
-*/
+
// polovimo user id
var srv_site_url = $("#srv_site_url").val();
var target = $(event.target);
var uid = $(target).parent().parent().find('.data_uid').html();
-// var href = srv_site_url+'main/survey/edit_anketa.php?anketa='+srv_meta_anketa_id+'&usr_id='+uid+'&quick_view=1';
var href = srv_site_url+'admin/survey/index.php?anketa='+srv_meta_anketa_id+'&a=data&m=quick_edit&usr_id='+uid+'&quick_view=1';
- if (uid > 0 ){
+
+ if (uid > 0 ){
window.location = href;
}
}
@@ -717,9 +722,9 @@ function dataTableResize (sid) {
$('#dataTable col[seq='+seq+']').width(widths[anketa][seq]);
}
- $('#dataTable tr:nth-child(3) th div.dataCell').append('<div class="tableResize"></div>');
+ $('#dataTable tr:nth-child(2) th div.dataCell').append('<div class="tableResize"></div>');
- $('#dataTable tr:nth-child(3) th .tableResize').bind('mousedown', function (e) {
+ $('#dataTable tr:nth-child(2) th .tableResize').bind('mousedown', function (e) {
startObj = $('#dataTable col[seq='+ $(this).closest('th').attr('seq') +']');
mousedown = true;