diff --git a/application/views/admin/token/browse.php b/application/views/admin/token/browse.php index fb66bc6dcf4..58f854c28a2 100644 --- a/application/views/admin/token/browse.php +++ b/application/views/admin/token/browse.php @@ -110,7 +110,9 @@ var sBounceProcessing = "eT("Start bounce processing") ?>"; var sBounceProcessingURL = "getController()->createUrl("admin/tokens/sa/bounceprocessing/surveyid/{$surveyid}"); ?>"; var participantlinkUrl="getController()->createUrl("admin/participants/sa/displayParticipants"); ?>"; - var searchtypes = ["eT("Equals") ?>","eT("Contains") ?>","eT("Not equal") ?>","eT("Not contains") ?>","eT("Greater than") ?>","eT("Less than") ?>"] + var andTxt="eT("AND") ?>"; + var orTxt="eT("OR") ?>"; + var searchtypes = ["eT("Equals") ?>","eT("Contains") ?>","eT("Not equal") ?>","eT("Not contains") ?>","eT("Greater than") ?>","eT("Less than") ?>"]; var colNames = ["ID","eT("Action") ?>","eT("First name") ?>","eT("Last name") ?>","eT("Email address") ?>","eT("Email status") ?>","eT("Token") ?>","eT("Language") ?>","eT("Invitation sent?") ?>","eT("Reminder sent?") ?>","eT("Reminder count") ?>","eT("Completed?") ?>","eT("Uses left") ?>","eT("Valid from") ?>","eT("Valid until") ?>"]; var colModels = [ { "name":"tid", "index":"tid", "width":30, "align":"center", "sorttype":"int", "sortable": true, "editable":false, "hidden":false}, diff --git a/scripts/admin/tokens.js b/scripts/admin/tokens.js index 59f33c169b1..0f177e54443 100644 --- a/scripts/admin/tokens.js +++ b/scripts/admin/tokens.js @@ -1,6 +1,6 @@ // $Id: tokens.js 8633 2010-04-25 12:57:33Z c_schmitz -var idexternal=parseInt(3); - +//var idexternal=parseInt(3); +var conditionid=1; function checkbounces() { $("#dialog-modal").dialog('open'); $('#dialog-modal').html('

'); @@ -9,25 +9,26 @@ function checkbounces() { function addcondition() { - id=2; - html = ""; + // Seems unused + conditionid++; + html = ""; for(col in colInformation){ if(colInformation[col]['search']) html2 += ""; } html2 += "\n\ - \n\ \n\ - \n\\n\ - \n\ + \n\\n\ + \n\ "; //$('#searchtable > tbody > tr').eq(id).after(html); - $('#searchtable > tbody > tr').eq(idexternal).after(html); - idexternal++; - $('#searchtable > tbody > tr').eq(idexternal).after(html2); - idexternal++; + $('#searchtable > tbody > tr').eq(conditionid).after(html); + conditionid++; + $('#searchtable > tbody > tr').eq(conditionid).after(html2); + //idexternal++; } @@ -92,28 +93,29 @@ $(document).ready(function() { }; }; // Code for AJAX download - var id=1; $(document).on("click",".addcondition-button",function(){ - id=2; - html = "\n"; + conditionid++; + html = "\n"; for(col in colInformation){ if(colInformation[col]['search']) html += ""; } html += "\n\\n\\n\ - \n\ \n\ \n\ \n\ \n\ \n\ \n\ - \n\\n\ - \n\ + \n\\n\ + \n\ "; $('#searchtable tr:last').after(html); }); - var searchconditions = {}; + if(typeof searchconditions === "undefined") { + searchconditions = {}; + } var field; $('#searchbutton').click(function(){ @@ -281,12 +283,9 @@ $(document).ready(function() { buttons: dialog_buttons }); } else { - if(id == 1) { - searchconditions = searchconditions + $('#field_1').val()+"||"+$('#condition_1').val()+"||"+$('#conditiontext_1').val(); - //jQuery("#displaytokens").jqGrid('setGridParam',{url:jsonSearchUrl+'/'+searchconditions}).trigger("reloadGrid"); - } else { - searchconditions = $('#field_1').val()+"||"+$('#condition_1').val()+"||"+$('#conditiontext_1').val(); - for( i=2 ; i<=idexternal; i++) { + searchconditions = searchconditions + $('#field_1').val()+"||"+$('#condition_1').val()+"||"+$('#conditiontext_1').val(); + if(conditionid > 1) { + for( i=2 ; i<=conditionid; i++) { if($('#field_'+i).val()) { searchconditions = searchconditions + "||"+ $('#join_'+(i)).val()+"||"+$('#field_'+i).val()+"||"+$('#condition_'+i).val()+"||"+$('#conditiontext_'+i).val(); }