'+Joomla.JText._("COM_FABRIK_CSV_DOWNLOAD_HERE")+"
";if(typeOf(document.id("csvmsg"))!=="null"){document.id("csvmsg").set("html",h)}this.csvWindow.fitToContent();document.getElements("input.exportCSVButton").removeProperty("disabled")}}}.bind(this)});d.send()},csvExportFilterOpts:function(e){var d=0,g,a=0,f,b=["origvalue","value","condition","join","key","search_type","match","full_words_only","eval","grouped_to_previous","hidden","elementid"];this.getFilters().each(function(h){f=h.name.split("[").getLast().replace("]","").toInt();d=f>d?f:d;e[h.name]=h.get("value")}.bind(this));d++;Object.each(this.options.advancedFilters,function(h,k){if(b.contains(k)){a=0;for(g=0;g0 / '+Joomla.JText._("COM_FABRIK_RECORDS")+".
"+Joomla.JText._("COM_FABRIK_SAVING_TO")+'');this.csvopts=this.options.csvOpts;this.csvfields=this.options.csvFields;this.triggerCSVExport(-1);return a},_csvExportForm:function(){var n=""+Joomla.JText._("JYES");var h=""+Joomla.JText._("JYES");var f=""+Joomla.JText._("JYES");var e=""+Joomla.JText._("JYES");var d="Excel CSV";var a="index.php?option=com_fabrik&view=list&listid="+this.id+"&format=csv&Itemid="+this.options.Itemid;var b={styles:{width:"200px","float":"left"}};var m=new Element("form",{action:a,method:"post"}).adopt([new Element("div",b).set("text",Joomla.JText._("COM_FABRIK_FILE_TYPE")),new Element("label").set("html",d),new Element("label").adopt([new Element("input",{type:"radio",name:"excel",value:"0"}),new Element("span").set("text","CSV")]),new Element("br"),new Element("br"),new Element("div",b).appendText(Joomla.JText._("COM_FABRIK_INCLUDE_FILTERS")),new Element("label").set("html",n),new Element("label").adopt([new Element("input",{type:"radio",name:"incfilters",value:"0"}),new Element("span").set("text",Joomla.JText._("JNO"))]),new Element("br"),new Element("div",b).appendText(Joomla.JText._("COM_FABRIK_INCLUDE_DATA")),new Element("label").set("html",e),new Element("label").adopt([new Element("input",{type:"radio",name:"inctabledata",value:"0"}),new Element("span").set("text",Joomla.JText._("JNO"))]),new Element("br"),new Element("div",b).appendText(Joomla.JText._("COM_FABRIK_INCLUDE_RAW_DATA")),new Element("label").set("html",h),new Element("label").adopt([new Element("input",{type:"radio",name:"incraw",value:"0"}),new Element("span").set("text",Joomla.JText._("JNO"))]),new Element("br"),new Element("div",b).appendText(Joomla.JText._("COM_FABRIK_INLCUDE_CALCULATIONS")),new Element("label").set("html",f),new Element("label").adopt([new Element("input",{type:"radio",name:"inccalcs",value:"0"}),new Element("span").set("text",Joomla.JText._("JNO"))])]);new Element("h4").set("text",Joomla.JText._("COM_FABRIK_SELECT_COLUMNS_TO_EXPORT")).inject(m);var l="";var k=0;$H(this.options.labels).each(function(p,o){if(o.substr(0,7)!=="fabrik_"&&o!=="____form_heading"){var q=o.split("___")[0];if(q!==l){l=q;new Element("h5").set("text",l).inject(m)}var g=""+Joomla.JText._("JYES");p=p.replace(/<\/?[^>]+(>|$)/g,"");var s=new Element("div",b).appendText(p);s.inject(m);new Element("label").set("html",g).inject(m);new Element("label").adopt([new Element("input",{type:"radio",name:"fields["+o+"]",value:"0"}),new Element("span").appendText(Joomla.JText._("JNO"))]).inject(m);new Element("br").inject(m)}k++}.bind(this));if(this.options.formels.length>0){new Element("h5").set("text",Joomla.JText._("COM_FABRIK_FORM_FIELDS")).inject(m);this.options.formels.each(function(o){var g=""+Joomla.JText._("JYES");var p=new Element("div",b).appendText(o.label);p.inject(m);new Element("label").set("html",g).inject(m);new Element("label").adopt([new Element("input",{type:"radio",name:"fields["+o.name+"]",value:"0"}),new Element("span").set("text",Joomla.JText._("JNO"))]).inject(m);new Element("br").inject(m)}.bind(this))}new Element("div",{styles:{"text-align":"right"}}).adopt(new Element("input",{type:"button",name:"submit",value:Joomla.JText._("COM_FABRIK_EXPORT"),"class":"button exportCSVButton",events:{click:function(o){o.stop();o.target.disabled=true;var g=document.id("csvmsg");if(typeOf(g)==="null"){g=new Element("div",{id:"csvmsg"}).inject(o.target,"before")}g.set("html",Joomla.JText._("COM_FABRIK_LOADING")+'
0 / '+Joomla.JText._("COM_FABRIK_RECORDS")+".
"+Joomla.JText._("COM_FABRIK_SAVING_TO")+'');this.triggerCSVExport(0)}.bind(this)}})).inject(m);new Element("input",{type:"hidden",name:"view",value:"table"}).inject(m);new Element("input",{type:"hidden",name:"option",value:"com_fabrik"}).inject(m);new Element("input",{type:"hidden",name:"listid",value:this.id}).inject(m);new Element("input",{type:"hidden",name:"format",value:"csv"}).inject(m);new Element("input",{type:"hidden",name:"c",value:"table"}).inject(m);return m},triggerCSVExport:function(e,b,a){if(e!==0){if(e===-1){e=0;b=this.csvopts;b.fields=this.csvfields}else{b=this.csvopts;a=this.csvfields}}else{if(!b){b={};if(typeOf(document.id("exportcsv"))!=="null"){["incfilters","inctabledata","incraw","inccalcs","excel"].each(function(g){var f=document.id("exportcsv").getElements("input[name="+g+"]");if(f.length>0){b[g]=f.filter(function(h){return h.checked})[0].value}})}}if(!a){a={};if(typeOf(document.id("exportcsv"))!=="null"){document.id("exportcsv").getElements("input[name^=field]").each(function(g){if(g.checked){var f=g.name.replace("fields[","").replace("]","");a[f]=g.get("value")}})}}b.fields=a;this.csvopts=b;this.csvfields=a}b=this.csvExportFilterOpts(b);b.start=e;b.option="com_fabrik";b.view="list";b.format="csv";b.Itemid=this.options.Itemid;b.listid=this.id;b.listref=this.id;this.options.csvOpts.custom_qs.split("&").each(function(f){var g=f.split("=");b[g[0]]=g[1]});var d=new Request.JSON({url:"?"+this.options.csvOpts.custom_qs,method:"post",data:b,onError:function(g,f){fconsole(g,f)},onFailure:function(f){fconsole("failed",d)},onSuccess:function(g){if(g.err){alert(g.err);Fabrik.Windows.exportcsv.close()}else{if(typeOf(document.id("csvcount"))!=="null"){document.id("csvcount").set("text",g.count)}if(typeOf(document.id("csvtotal"))!=="null"){document.id("csvtotal").set("text",g.total)}if(typeOf(document.id("csvfile"))!=="null"){document.id("csvfile").set("text",g.file)}if(g.count '+Joomla.JText._("COM_FABRIK_CSV_DOWNLOAD_HERE")+"
";if(typeOf(document.id("csvmsg"))!=="null"){document.id("csvmsg").set("html",h)}this.csvWindow.fitToContent();document.getElements("input.exportCSVButton").removeProperty("disabled")}}}.bind(this)});d.send()},csvExportFilterOpts:function(e){var d=0,g,a=0,f,b=["origvalue","value","condition","join","key","search_type","match","full_words_only","eval","grouped_to_previous","hidden","elementid"];this.getFilters().each(function(h){f=h.name.split("[").getLast().replace("]","").toInt();d=f>d?f:d;e[h.name]=h.get("value")}.bind(this));d++;Object.each(this.options.advancedFilters,function(h,k){if(b.contains(k)){a=0;for(g=0;g