diff --git a/blue-classic/app.js b/blue-classic/app.js index 39203a83..ceeba2d6 100755 --- a/blue-classic/app.js +++ b/blue-classic/app.js @@ -26,4 +26,4 @@ var Ext=Ext||{};if(!Ext.Toolbar){Ext.Toolbar={}}if(!Ext.app){Ext.app={}}if(!Ext. * licensing@sencha.com * http://www.sencha.com/license */ -(Ext.cmd.derive("Ext.ux.desktop.Wallpaper",Ext.Component,{cls:"ux-wallpaper",html:'',stretch:false,wallpaper:null,stateful:true,stateId:"desk-wallpaper",afterRender:function(){var b=this;Ext.Component.prototype.afterRender.call(this);b.setWallpaper(b.wallpaper,b.stretch)},applyState:function(){var c=this,d=c.wallpaper;Ext.Component.prototype.applyState.apply(this,arguments);if(d!=c.wallpaper){c.setWallpaper(c.wallpaper)}},getState:function(){return this.wallpaper&&{wallpaper:this.wallpaper}},setWallpaper:function(f,g){var m=this,j,l;m.stretch=(g!==false);m.wallpaper=f;if(m.rendered){j=m.el.dom.firstChild;if(!f||f==Ext.BLANK_IMAGE_URL){Ext.fly(j).hide()}else{if(m.stretch){j.src=f;m.el.removeCls("ux-wallpaper-tiled");Ext.fly(j).setStyle({width:"100%",height:"100%"}).show()}else{Ext.fly(j).hide();l="url("+f+")";m.el.addCls("ux-wallpaper-tiled")}}m.el.setStyle({backgroundImage:l||""});if(m.stateful){m.saveState()}}return m}},0,["wallpaper"],["component","box","wallpaper"],{component:true,box:true,wallpaper:true},["widget.wallpaper"],0,[Ext.ux.desktop,"Wallpaper"],0));(Ext.cmd.derive("Ext.ux.form.SearchField",Ext.form.field.Text,{triggers:{clear:{weight:0,cls:"x-form-clear-trigger",hidden:true,handler:"onClearClick",scope:"this"},search:{weight:1,cls:"x-form-search-trigger",handler:"onSearchClick",scope:"this"}},hasSearch:false,paramName:"query",initComponent:function(){var f=this,e=f.store,d;Ext.form.field.Text.prototype.initComponent.apply(this,arguments);f.on("specialkey",function(b,a){if(a.getKey()==a.ENTER){f.onSearchClick()}});if(!e||!e.isStore){e=f.store=Ext.data.StoreManager.lookup(e)}e.setRemoteFilter(true);d=f.store.getProxy();d.setFilterParam(f.paramName);d.encodeFilters=function(a){return a[0].getValue()}},onClearClick:function(){var c=this,d=c.activeFilter;if(d){c.setValue("");c.store.getFilters().remove(d);c.activeFilter=null;c.getTrigger("clear").hide();c.updateLayout()}},onSearchClick:function(){var d=this,c=d.getValue();if(c.length>0){d.activeFilter=new Ext.util.Filter({property:d.paramName,value:c});d.store.getFilters().add(d.activeFilter);d.getTrigger("clear").show();d.updateLayout()}}},0,["searchfield"],["component","box","field","textfield","searchfield"],{component:true,box:true,field:true,textfield:true,searchfield:true},["widget.searchfield"],0,[Ext.ux.form,"SearchField"],0));Ext.define("Overrides.ux.form.SearchField",{override:"Ext.ux.form.SearchField",paramName:"filter",filterOnClick:true,comparison:"st",type:"string",initComponent:function(){var c=this,d;c.store=Ext.data.StoreManager.lookup(c.store||"ext-empty-store");(arguments.callee.$previous||Ext.form.field.Text.prototype.initComponent).apply(this,arguments);if(!c.filterOnClick){c.getTrigger("search").cls=null;c.on("change",c.onSearchClick,c)}else{c.on("specialkey",function(b,a){if(a.getKey()==a.ENTER){c.onSearchClick()}},c,{single:true})}c.store.setRemoteFilter(true);d=c.store.getProxy();d.setFilterParam(c.paramName);d.encodeFilters=function(a){return a[0].getValue()}},onClearClick:function(){var b=this;if(b.activeFilter){b.setValue("");b.cleanFilter();b.store.load();b.activeFilter=null;b.getTrigger("clear").hide();b.updateLayout()}},onSearchClick:function(){var d=this,c=d.getValue();if(c.length>0){if(d.store.defaultFilter[0]&&d.type=="date"){}else{d.cleanFilter()}d.activeFilter={type:d.type,field:d.fieldFilter,value:d.comparison=="gt"&&c.length==10?c+" 00:00:00":d.comparison=="lt"&&c.length==10?c+" 23:59:59":c,comparison:d.comparison};d.store.defaultFilter.push(d.activeFilter);d.store.load();d.getTrigger("clear").show();d.updateLayout()}},cleanFilter:function(){var d=this,c=false;Ext.each(d.store.defaultFilter,function(b,f,a){if(b.type==="string"&&b.comparison==="ct"&&b.field===d.fieldFilter){delete a[f]}});if(c==false){d.store.defaultFilter=[];d.store.defaultFilter=Ext.Array.clean(d.store.defaultFilter)}}});(Ext.cmd.derive("Helper.Util",Ext.Base,{singleton:true,yesValue:t("active"),noValue:t("inactive"),colorYesValue:"green",colorNoValue:"red",LCRbuy:t("LCRAccordingtothebuyerPrice"),LCRSell:t("LCRAccordingtothesellerPrice"),prepaidValue:t("prepaid"),pospaidValue:t("pospaid"),yesValue:t("yes"),noValue:t("no"),activeValue:t("active"),inactiveValue:t("inactive"),getListFilter:function(g,j){var f,e;g=Ext.widget(g);f=g.store;e=g.listConfig?g.listConfig.itemTpl:g.displayField;return{type:"list",labelField:e,store:f,field:j||g.name,idField:g.valueField}},formatQueueState:function(b){switch(b){case"ringing":b=''+t("Receiving")+"";break;case"answered":b=''+t("On Phone")+"";break;default:b=t(b);break}return b},formatQueueAgentState:function(b){switch(b){case"Not in use":b=''+t("Waiting")+"";break;case"Unavailable":b=''+t("Unavailable")+"";break;case"Ringing":b=''+t("Ringing")+"";break;case"In use"||"in call":b=''+t("On Phone")+"";break;default:b=t(b);break}return b},enableComboRelated:function(m,o,j){var q=o.store,l=m.name,p=m.getValue(),n=[{type:"list",value:[p],field:l}];j=j||o.getValue();if(!Ext.isDefined(p)){return}else{o.reset()}q.load({params:{filter:Ext.encode(n)},callback:function(){o.setValue(j);o.enable()}})},utf8Encode:function(v){if(v===null||typeof v==="undefined"){return""}var n=(v+"");var m="",u,q,s=0,r;u=q=0;s=n.length;for(r=0;r127&&o<2048){p=String.fromCharCode((o>>6)|192)+String.fromCharCode((o&63)|128)}else{p=String.fromCharCode((o>>12)|224)+String.fromCharCode(((o>>6)&63)|128)+String.fromCharCode((o&63)|128)}}if(p!==null){if(q>u){m+=n.slice(u,q)}m+=p;u=q=r+1}}if(q>u){m+=n.slice(u,s)}return m},sha1:function(C){var P=function(a,c){var b=(a<>>(32-c));return b};var B=function(d){var a="";var c;var b;for(c=7;c>=0;c--){b=(d>>>(c*4))&15;a+=b.toString(16)}return a};var M;var z,A;var Q=new Array(80);var I=1732584193;var K=4023233417;var L=2562383102;var N=271733878;var O=3285377520;var D,E,F,G,H;var j;C=Helper.Util.utf8Encode(C);var R=C.length;var J=[];for(z=0;z>>29);J.push((R<<3)&4294967295);for(M=0;M'+f+""},formatBoleto:function(f){var d=Helper.Util,e=f=="P"?d.colorYesValue:d.colorNoValue;f=f="P"?d.yesValue:d.noValue;return''+f+""},formatPackageType:function(b){b=b==0?t("unlimitedcalls"):b==1?t("numberfreecalls"):t("freeseconds");return b},formatBooleancallback:function(b){color=b==0?"red":b==1?"green":b==2?"blue":b==3?"orange":b==4?"black":b==5?"green":"#FFCC00";b=b==1?t("active"):b==2?t("pending"):b==4?t("Not working"):b==5?t("Complete"):t("sent");return''+b+""},formatPorcente:function(b){return b+"%"},formatBillingType:function(b){b=b==0?t("monthly"):t("weekly");return b},formatDidType:function(b){switch(b){case 0:b=t("callforpstn");break;case 1:b=t("sipcall");break;case 2:b=t("ivr");break;case 3:b="CallingCard";break;case 4:b=t("portalDeVoz");break;case 5:b=t("CID Callback");break;case 6:b=t("0800 Callback");break;case 7:b=t("Queue");break;case 8:b=t("Call Group");break;case 9:b=t("Custom");break}return b},formatLcrtype:function(c){var d=Helper.Util,c=c==1?t("LCRAccordingtothebuyerPrice"):c==2?t("Load Balancer"):c==0?t("LCRAccordingtothesellerPrice"):"";return c},formatMoneyDecimalWithoutColor:function(d){var c=Ext.util.Format.numberRenderer("0.000");return App.user.currency+" "+c(d)},formatMoneyDecimal:function(e){var f=Helper.Util,g=t("id")+"Money",j=Ext.util.Format.numberRenderer("0.000");if(e>0){return''+App.user.currency+" "+j(e)+""}else{if(e<0){return''+App.user.currency+" "+j(e)+""}else{if(e==0){return''+App.user.currency+" "+j(e)+""}}}},formatMoneyDecimal4:function(e){var f=Helper.Util,g=t("id")+"Money",j=Ext.util.Format.numberRenderer("0."+App.user.decimalPrecision);if(e>0){return''+App.user.currency+" "+j(e)+""}else{if(e<0){return''+App.user.currency+" "+j(e)+""}else{if(e==0){return''+App.user.currency+" "+j(e)+""}}}},formatMoneyDecimal2:function(e){var f=Helper.Util,g=t("id")+"Money",j=Ext.util.Format.numberRenderer("0.00");if(e>0){return''+App.user.currency+" "+j(e)+""}else{if(e<0){return''+App.user.currency+" "+j(e)+""}else{if(e==0){return''+App.user.currency+" "+j(e)+""}}}},formatUserType:function(c){var d=Helper.Util,c=c==1?t("admin"):c==2?t("agent"):c==3?t("user"):t("NULL");return c},formatMoney:function(e){var f=Helper.Util,g="globalMoney",j=Ext.isFunction(Ext.util.Format[g])?Ext.util.Format[g]:f[g]||Ext.util.Format.usMoney;formatDecimal=Ext.util.Format.numberRenderer("0.000");if(e>0){return''+j(e)+""}else{if(e<0){return''+j(e)+""}else{if(e==0){return''+j(e)+""}}}},formattyyesno:function(f){var d=Helper.Util,e=f?d.colorYesValue:d.colorNoValue;f=f?d.yesValue:d.noValue;return''+f+""},formatCampaignType:function(b){b=b==1?t("voice"):b==3?t("WhatsApp"):t("sms");return b},formatCallType:function(b){switch(b){case 0:b=t("standard");break;case 1:b=t("sipcall");break;case 2:b=t("did");break;case 3:b=t("didvoip");break;case 4:b=t("callback");break;case 5:b=t("callcenter");break;case 6:b=t("sms");break;case 7:b=t("transfer");break;case 8:b=t("queue");break;case 9:b=t("ivr");break}return b},formatWhatsapp:function(b){color=b==0?"blue":b==1?"green":b==2?"red":b==3?"black":b==4?"red":"#FFCC00";b=b==0?t("inactive"):b==1?t("active"):b==2?t("blocked"):b==3?t("Wrong identity"):b==4?t("blocked"):t("pending");return''+b+""},formatBoleto:function(f){var d=Helper.Util,e=f=="P"?d.colorYesValue:d.colorNoValue;f=f="P"?d.yesValue:d.noValue;return''+f+""},formatBooleanActive:function(f){var d=Helper.Util,e=f==0?"red":f==1?"green":f==2?"blue":f==3?"green":f==4?"red":"#FFCC00";f=f==0?t("inactive"):f==1?t("active"):f==2?t("pending"):f==3?t("sent"):f==4?t("blocked"):t("pending");return''+f+""},formatBooleanSms:function(f){var d=Helper.Util,e=f==0?"red":f==1?"green":f==2?"blue":"#FFCC00",f=f==0?t("error"):f==1?t("sent"):f==2?t("received"):t("pending");return''+f+""},formatLanguageImage:function(b){return''},formatsecondsToTime:function(e){var g=Math.floor(e/3600);var f=Math.floor((e-(g*3600))/60);var j=e-(g*3600)-(f*60);while(f.length<2){f="0"+f}while(j.length<2){j="0"+f}g=g<10?"0"+g:g;f=f<10?"0"+f:f;j=parseInt(j);j=j<10?"0"+j:j;return g+":"+f+":"+j},formatBoleto:function(f){var d=Helper.Util,e=f=="P"?d.colorYesValue:d.colorNoValue;f=f="P"?d.yesValue:d.noValue;return''+f+""},formatDialStatus:function(b){switch(b){case 1:b=t("answer");break;case 2:b=t("busy");break;case 3:b=t("no")+" "+t("answer");break;case 4:b=t("cancelcall");break;case 5:b="congestion";break;case 6:b="chanunavail";break;case 7:b="dontcall";break;case 8:b="torture";break;case 9:b="invalidargs";break}return b},formatQueueStatus:function(b){switch(b){case"inQue":b=''+t("Receiving")+"";break;case"Waiting":b=''+t("Waiting")+"";break;case"CONNECT":b=''+t("On Phone")+"";break;case"Idle":b=t("Idle");break}return b},convertErrorsJsonToString:function(d){var c="";if(typeof(d)==="string"){return d}Ext.iterate(d,function(a){Ext.each(d[a],function(b){c+=b+"
"})});return c},formatStatusImage:function(b){if(b.match(/^OK/g)){return' '+t(b)}else{return' '+t(b)}},formatSipDirection:function(b){if(b=="IN"){return' '}else{return' '}},formatDateTime:function(b){if(Ext.Date.format(b,"Y")<"2000"){return""}else{return b=="0000-00-00 00:00:00"?"":Ext.Date.format(b,"Y-m-d H:i:s")}},formatTranslate:function(b){return t(b)}},0,0,0,0,0,0,[Helper,"Util"],0));!function(v){function P(j,b){var w=(65535&j)+(65535&b),q=(j>>16)+(b>>16)+(w>>16);return q<<16|65535&w}function m(j,b){return j<>>32-b}function e(x,w,q,j,b,y){return P(m(P(P(w,x),P(j,y)),b),q)}function A(y,z,x,q,j,b,w){return e(z&x|~z&q,y,z,j,b,w)}function Q(y,z,x,q,j,b,w){return e(z&q|x&~q,y,z,j,b,w)}function c(y,z,x,q,j,b,w){return e(z^x^q,y,z,j,b,w)}function g(y,z,x,q,j,b,w){return e(x^(z|~q),y,z,j,b,w)}function r(B,D){B[D>>5]|=128<>>9<<4)+14]=D;var b,F,y,E,z,j=1732584193,w=-271733879,x=-1732584194,q=271733878;for(b=0;b>5]>>>b%32&255)}return w}function o(j){var b,w=[];for(w[(j.length>>2)-1]=void 0,b=0;b>5]|=(255&j.charCodeAt(b/8))<16&&(q=r(q,8*y.length)),x=0;x<16;x+=1){j[x]=909522486^q[x],b[x]=1549556828^q[x]}return w=r(j.concat(o(z)),512+8*z.length),a(r(b.concat(w),640))}function l(j){var b,x,w="0123456789abcdef",q="";for(x=0;x>>4&15)+w.charAt(15&b)}return q}function R(b){return unescape(encodeURIComponent(b))}function u(b){return d(R(b))}function C(b){return l(u(b))}function p(j,b){return s(R(j),R(b))}function n(j,b){return l(p(j,b))}function f(j,b,q){return b?q?p(b,j):n(b,j):q?u(j):C(j)}"function"==typeof define&&define.amd?define(function(){return f}):"object"==typeof module&&module.exports?module.exports=f:v.md5=f}(this);(Ext.cmd.derive("MBilling.model.Backup",Ext.data.Model,{fields:[{name:"id",type:"int"},{name:"name",type:"string"},{name:"size",type:"string"}],proxy:{type:"uxproxy",module:"backup"}},0,0,0,0,0,0,[MBilling.model,"Backup"],0));(Ext.cmd.derive("MBilling.model.Boleto",Ext.data.Model,{fields:[{name:"id",type:"int"},{name:"id_user",type:"int"},{name:"description",type:"string"},{name:"status",type:"int"},{name:"payment",type:"number"},{name:"vencimento",type:"date",dateFormat:"Y-m-d H:i:s"},{name:"date",type:"date",dateFormat:"Y-m-d H:i:s"},"idUserusername"],proxy:{type:"uxproxy",module:"boleto"}},0,0,0,0,0,0,[MBilling.model,"Boleto"],0));(Ext.cmd.derive("MBilling.model.Call",Ext.data.Model,{fields:[{name:"id",type:"int"},{name:"id_user",type:"int"},{name:"id_plan",type:"int"},{name:"id_trunk",type:"int"},{name:"id_prefix",type:"int"},{name:"real_sessiontime",type:"int"},{name:"starttime",type:"date",dateFormat:"Y-m-d H:i:s"},{name:"calledstation",type:"string"},{name:"sessiontime",type:"int"},{name:"terminatecauseid",type:"int"},{name:"buycost",type:"number"},{name:"sessionbill",type:"number"},{name:"agent_bill",type:"number"},{name:"src",type:"string"},{name:"callerid",type:"string"},{name:"sipiax",type:"int"},{name:"uniqueid",type:"string"},"idPrefixdestination","idUserusername","idPlanname","idTrunktrunkcode","idCampaignname",{name:"id_campaign",type:"int"}],proxy:{type:"uxproxy",module:"call"}},0,0,0,0,0,0,[MBilling.model,"Call"],0));(Ext.cmd.derive("MBilling.model.CallArchive",Ext.data.Model,{fields:[{name:"id",type:"int"},{name:"id_user",type:"int"},{name:"id_plan",type:"int"},{name:"id_trunk",type:"int"},{name:"id_prefix",type:"int"},{name:"real_sessiontime",type:"int"},{name:"starttime",type:"date",dateFormat:"Y-m-d H:i:s"},{name:"calledstation",type:"string"},{name:"sessiontime",type:"int"},{name:"terminatecauseid",type:"int"},{name:"buycost",type:"number"},{name:"sessionbill",type:"number"},{name:"agent_bill",type:"number"},{name:"src",type:"string"},{name:"callerid",type:"string"},{name:"sipiax",type:"int"},{name:"uniqueid",type:"string"},"idPrefixdestination","idUserusername","idPlanname","idTrunktrunkcode","idCampaignname",{name:"id_campaign",type:"int"}],proxy:{type:"uxproxy",module:"callArchive"}},0,0,0,0,0,0,[MBilling.model,"CallArchive"],0));(Ext.cmd.derive("MBilling.model.CallBack",Ext.data.Model,{fields:[{name:"id",type:"int"},{name:"entry_time",type:"date",dateFormat:"Y-m-d H:i:s"},{name:"last_attempt_time",type:"date",dateFormat:"Y-m-d H:i:s"},{name:"status",type:"string"},{name:"channel",type:"string"},{name:"exten",type:"string"},{name:"account",type:"string"},{name:"variable",type:"string"},{name:"sessiontime",type:"int"},{name:"num_attempt",type:"int"},"idUserusername","idDiddid"],proxy:{type:"uxproxy",module:"callBack"}},0,0,0,0,0,0,[MBilling.model,"CallBack"],0));(Ext.cmd.derive("MBilling.model.CallFailed",Ext.data.Model,{fields:[{name:"id",type:"int"},{name:"id_user",type:"int"},{name:"id_plan",type:"int"},{name:"id_trunk",type:"int"},{name:"id_prefix",type:"int"},{name:"starttime",type:"date",dateFormat:"Y-m-d H:i:s"},{name:"calledstation",type:"string"},{name:"terminatecauseid",type:"int"},{name:"src",type:"string"},{name:"callerid",type:"string"},{name:"sipiax",type:"int"},{name:"uniqueid",type:"string"},{name:"hangupcause",type:"int"},"idPrefixdestination","idUserusername","idPlanname","idTrunktrunkcode"],proxy:{type:"uxproxy",module:"callFailed"}},0,0,0,0,0,0,[MBilling.model,"CallFailed"],0));(Ext.cmd.derive("MBilling.model.CallOnLine",Ext.data.Model,{fields:[{name:"id",type:"int"},{name:"id_user",type:"int"},{name:"uniqueid",type:"string"},{name:"canal",type:"string"},{name:"tronco",type:"string"},{name:"ndiscado",type:"string"},{name:"codec",type:"string"},{name:"status",type:"string"},{name:"duration",type:"int"},{name:"reinvite",type:"string"},{name:"from_ip",type:"string"},{name:"server",type:"string"},{name:"billsec",type:"string"},"idUserusername","idUsercredit"],proxy:{type:"uxproxy",module:"callOnLine"}},0,0,0,0,0,0,[MBilling.model,"CallOnLine"],0));(Ext.cmd.derive("MBilling.model.CallOnlineChart",Ext.data.Model,{fields:[{name:"id",type:"int"},{name:"total",type:"int"},{name:"answer",type:"int"},{name:"date",type:"string"}],proxy:{type:"uxproxy",module:"CallOnlineChart"}},0,0,0,0,0,0,[MBilling.model,"CallOnlineChart"],0));(Ext.cmd.derive("MBilling.model.CallShop",Ext.data.Model,{fields:[{name:"id",type:"int"},{name:"id_user",type:"int"},"idUserusername",{name:"name",type:"string"},{name:"accountcode",type:"string"},{name:"regexten",type:"string"},{name:"amaflags",type:"string"},{name:"callgroup",type:"string"},{name:"callerid",type:"string"},{name:"directmedia",type:"string"},{name:"context",type:"string"},{name:"DEFAULTip",type:"string"},{name:"dtmfmode",type:"string"},{name:"fromuser",type:"string"},{name:"fromdomain",type:"string"},{name:"host",type:"string"},{name:"insecure",type:"string"},{name:"language",type:"string"},{name:"mailbox",type:"string"},{name:"md5secret",type:"string"},{name:"nat",type:"string"},{name:"deny",type:"string"},{name:"permit",type:"string"},{name:"pickupgroup",type:"string"},{name:"port",type:"string"},{name:"qualify",type:"string"},{name:"rtptimeout",type:"string"},{name:"rtpholdtimeout",type:"string"},{name:"secret",type:"string"},{name:"type",type:"string"},{name:"disallow",type:"string"},{name:"allow",type:"string"},{name:"regseconds",type:"date",dateFormat:"timestamp"},{name:"ipaddr",type:"string"},{name:"fullcontact",type:"string"},{name:"setvar",type:"string"},{name:"regserver",type:"string"},{name:"lastms",type:"string"},{name:"defaultuser",type:"string"},{name:"auth",type:"string"},{name:"subscribemwi",type:"string"},{name:"vmexten",type:"string"},{name:"cid_number",type:"string"},{name:"callingpres",type:"string"},{name:"usereqphone",type:"string"},{name:"mohsuggest",type:"string"},{name:"allowtransfer",type:"string"},{name:"autoframing",type:"string"},{name:"maxcallbitrate",type:"string"},{name:"outboundproxy",type:"string"},{name:"rtpkeepalive",type:"string"},{name:"useragent",type:"string"},{name:"calllimit",type:"int"},{name:"status",type:"int"},"callshopnumber",{name:"callshoptime",type:"int"}],proxy:{type:"uxproxy",module:"callShop"}},0,0,0,0,0,0,[MBilling.model,"CallShop"],0));(Ext.cmd.derive("MBilling.model.CallShopCdr",Ext.data.Model,{fields:[{name:"id",type:"int"},{name:"status",type:"int"},{name:"price",type:"number"},{name:"buycost",type:"number"},{name:"calledstation",type:"number"},{name:"destination",type:"string"},{name:"date",type:"date",dateFormat:"Y-m-d H:i:s"},{name:"sessiontime",type:"int"},{name:"cabina",type:"string"},{name:"priceSum",type:"number"},{name:"markup",type:"number"}],proxy:{type:"uxproxy",module:"callShopCdr"}},0,0,0,0,0,0,[MBilling.model,"CallShopCdr"],0));(Ext.cmd.derive("MBilling.model.CallSummaryCallShop",Ext.data.Model,{fields:[{name:"id",type:"int"},{name:"day",type:"date",dateFormat:"Y-m-d"},{name:"date",type:"date",dateFormat:"Y-m-d"},{name:"sessiontime",type:"int"},{name:"aloc_success_calls",type:"int"},{name:"aloc_all_calls",type:"int"},{name:"price",type:"float"},{name:"buycost",type:"float"},{name:"nbcall",type:"int"},{name:"success_calls",type:"int"},{name:"asr",type:"int"},{name:"lucro",type:"float"},"sumsessiontime","sumbuycost","sumlucro","sumprice","sumsuccess_calls","sumaloc_all_calls","sumnbcall","sumasr"],proxy:{type:"uxproxy",module:"callSummaryCallShop"}},0,0,0,0,0,0,[MBilling.model,"CallSummaryCallShop"],0));(Ext.cmd.derive("MBilling.model.CallSummaryDayAgent",Ext.data.Model,{fields:[{name:"id",type:"int"},{name:"day",type:"date",dateFormat:"Y-m-d"},{name:"id_user",type:"int"},{name:"sessiontime",type:"int"},{name:"sessionbill",type:"float"},{name:"buycost",type:"float"},{name:"aloc_all_calls",type:"int"},{name:"nbcall",type:"int"},{name:"lucro",type:"float"},"idUserusername","sumsessiontime","sumbuycost","sumlucro","sumsessionbill","sumaloc_all_calls","sumnbcall","sumasr"],proxy:{type:"uxproxy",module:"callSummaryDayAgent"}},0,0,0,0,0,0,[MBilling.model,"CallSummaryDayAgent"],0));(Ext.cmd.derive("MBilling.model.CallSummaryDayTrunk",Ext.data.Model,{fields:[{name:"id",type:"int"},{name:"day",type:"date",dateFormat:"Y-m-d"},{name:"id_trunk",type:"int"},{name:"sessiontime",type:"int"},{name:"sessionbill",type:"float"},{name:"buycost",type:"float"},{name:"aloc_all_calls",type:"int"},{name:"nbcall",type:"int"},{name:"lucro",type:"float"},"idTrunktrunkcode","sumsessiontime","sumbuycost","sumlucro","sumsessionbill","sumaloc_all_calls","sumnbcall","sumasr"],proxy:{type:"uxproxy",module:"callSummaryDayTrunk"}},0,0,0,0,0,0,[MBilling.model,"CallSummaryDayTrunk"],0));(Ext.cmd.derive("MBilling.model.CallSummaryDayUser",Ext.data.Model,{fields:[{name:"id",type:"int"},{name:"day",type:"date",dateFormat:"Y-m-d"},{name:"id_user",type:"int"},{name:"sessiontime",type:"int"},{name:"sessionbill",type:"float"},{name:"buycost",type:"float"},{name:"aloc_all_calls",type:"int"},{name:"nbcall",type:"int"},{name:"agent_bill",type:"float"},{name:"lucro",type:"float"},"idUserusername","sumsessiontime","sumbuycost","sumlucro","sumsessionbill","sumaloc_all_calls","sumnbcall","sumasr"],proxy:{type:"uxproxy",module:"callSummaryDayUser"}},0,0,0,0,0,0,[MBilling.model,"CallSummaryDayUser"],0));(Ext.cmd.derive("MBilling.model.CallSummaryMonthTrunk",Ext.data.Model,{fields:[{name:"id",type:"int"},{name:"month",type:"date",dateFormat:"Y-m"},{name:"id_trunk",type:"int"},{name:"sessiontime",type:"int"},{name:"sessionbill",type:"float"},{name:"buycost",type:"float"},{name:"aloc_all_calls",type:"int"},{name:"nbcall",type:"int"},{name:"lucro",type:"float"},"idTrunktrunkcode","sumsessiontime","sumbuycost","sumlucro","sumsessionbill","sumaloc_all_calls","sumnbcall","sumasr"],proxy:{type:"uxproxy",module:"callSummaryMonthTrunk"}},0,0,0,0,0,0,[MBilling.model,"CallSummaryMonthTrunk"],0));(Ext.cmd.derive("MBilling.model.CallSummaryMonthUser",Ext.data.Model,{fields:[{name:"id",type:"int"},{name:"month",type:"date",dateFormat:"Y-m"},{name:"id_user",type:"int"},{name:"sessiontime",type:"int"},{name:"sessionbill",type:"float"},{name:"buycost",type:"float"},{name:"aloc_all_calls",type:"int"},{name:"nbcall",type:"int"},{name:"agent_bill",type:"float"},{name:"lucro",type:"float"},"idUserusername","sumsessiontime","sumbuycost","sumlucro","sumsessionbill","sumaloc_all_calls","sumnbcall","sumasr"],proxy:{type:"uxproxy",module:"callSummaryMonthUser"}},0,0,0,0,0,0,[MBilling.model,"CallSummaryMonthUser"],0));(Ext.cmd.derive("MBilling.model.CallSummaryPerDay",Ext.data.Model,{fields:[{name:"id",type:"int"},{name:"day",type:"date",dateFormat:"Y-m-d"},{name:"sessiontime",type:"int"},{name:"aloc_all_calls",type:"int"},{name:"sessionbill",type:"float"},{name:"buycost",type:"float"},{name:"asr",type:"float"},{name:"nbcall",type:"int"},{name:"nbcall_fail",type:"int"},{name:"lucro",type:"float"},"sumsessiontime","sumbuycost","sumlucro","sumsessionbill","sumaloc_all_calls","sumnbcall","sumasr"],proxy:{type:"uxproxy",module:"callSummaryPerDay"}},0,0,0,0,0,0,[MBilling.model,"CallSummaryPerDay"],0));(Ext.cmd.derive("MBilling.model.CallSummaryPerMonth",Ext.data.Model,{fields:[{name:"id",type:"int"},{name:"month",type:"string"},{name:"sessiontime",type:"int"},{name:"aloc_all_calls",type:"int"},{name:"sessionbill",type:"float"},{name:"buycost",type:"float"},{name:"nbcall",type:"int"},{name:"lucro",type:"float"},"sumsessiontime","sumbuycost","sumlucro","sumsessionbill","sumaloc_all_calls","sumnbcall"],proxy:{type:"uxproxy",module:"callSummaryPerMonth"}},0,0,0,0,0,0,[MBilling.model,"CallSummaryPerMonth"],0));(Ext.cmd.derive("MBilling.model.CallSummaryPerTrunk",Ext.data.Model,{fields:[{name:"id",type:"int"},{name:"starttime",type:"date",dateFormat:"Y-m-d H:i:s"},{name:"id_user",type:"int"},{name:"aloc_all_calls",type:"int"},{name:"sessiontime",type:"int"},{name:"sessionbill",type:"float"},{name:"buycost",type:"float"},{name:"agent_bill",type:"float"},{name:"nbcall",type:"int"},{name:"nbcall_fail",type:"int"},{name:"lucro",type:"float"},{name:"asr",type:"float"},{name:"idTrunktrunkcode",type:"string"},"sumsessiontime","sumbuycost","sumlucro","sumsessionbill","sumaloc_all_calls","sumnbcall","sumasr"],proxy:{type:"uxproxy",module:"callSummaryPerTrunk"}},0,0,0,0,0,0,[MBilling.model,"CallSummaryPerTrunk"],0));(Ext.cmd.derive("MBilling.model.CallSummaryPerUser",Ext.data.Model,{fields:[{name:"id",type:"int"},{name:"starttime",type:"date",dateFormat:"Y-m-d H:i:s"},{name:"id_user",type:"int"},{name:"aloc_all_calls",type:"int"},{name:"sessiontime",type:"int"},{name:"sessionbill",type:"float"},{name:"buycost",type:"float"},{name:"agent_bill",type:"float"},{name:"agent_bill",type:"float"},{name:"nbcall",type:"int"},{name:"asr",type:"float"},{name:"nbcall_fail",type:"int"},{name:"lucro",type:"float"},{name:"idUserusername",type:"string"},"sumsessiontime","sumbuycost","sumlucro","sumsessionbill","sumaloc_all_calls","sumnbcall","sumasr"],proxy:{type:"uxproxy",module:"callSummaryPerUser"}},0,0,0,0,0,0,[MBilling.model,"CallSummaryPerUser"],0));(Ext.cmd.derive("MBilling.model.Callerid",Ext.data.Model,{fields:[{name:"id",type:"int"},{name:"id_user",type:"int"},{name:"cid",type:"string"},{name:"activated",type:"int"},"idUserusername"],proxy:{type:"uxproxy",module:"callerid"}},0,0,0,0,0,0,[MBilling.model,"Callerid"],0));(Ext.cmd.derive("MBilling.model.Campaign",Ext.data.Model,{fields:[{name:"id",type:"int"},{name:"id_user",type:"int"},{name:"id_plan",type:"int"},{name:"frequency",type:"int"},{name:"enable_max_call",type:"int"},{name:"name",type:"string"},{name:"status",type:"int"},{name:"type",type:"int"},{name:"monday",type:"int"},{name:"tuesday",type:"int"},{name:"wednesday",type:"int"},{name:"thursday",type:"int"},{name:"nb_callmade",type:"int"},{name:"secondusedreal",type:"int"},{name:"friday",type:"int"},{name:"saturday",type:"int"},{name:"sunday",type:"int"},{name:"forward_number",type:"string"},{name:"description",type:"string"},{name:"startingdate",type:"date",dateFormat:"Y-m-d H:i:s"},{name:"expirationdate",type:"date",dateFormat:"Y-m-d H:i:s"},{name:"daily_start_time",type:"string"},{name:"daily_stop_time",type:"string"},{name:"restrict_phone",type:"int"},{name:"tts_audio",type:"string"},{name:"tts_audio2",type:"string"},{name:"asr_audio",type:"string"},{name:"asr_options",type:"string"},"audio","audio_2","idUserusername","subRecords","id_phonebook"],proxy:{type:"uxproxy",module:"campaign"}},0,0,0,0,0,0,[MBilling.model,"Campaign"],0));(Ext.cmd.derive("MBilling.model.CampaignLog",Ext.data.Model,{fields:[{name:"id",type:"int"},{name:"total",type:"int"},{name:"loops",type:"int"},{name:"trunks",type:"string"},{name:"campaigns",type:"string"},{name:"date",type:"date",dateFormat:"Y-m-d H:i:s"}],proxy:{type:"uxproxy",module:"campaignLog"}},0,0,0,0,0,0,[MBilling.model,"CampaignLog"],0));(Ext.cmd.derive("MBilling.model.CampaignPoll",Ext.data.Model,{fields:[{name:"id",type:"int"},{name:"id_campaign",type:"int"},{name:"digit_authorize",type:"int"},{name:"request_authorize",type:"int"},{name:"name",type:"string"},"arq_audio",{name:"ordem_exibicao",type:"int"},{name:"description",type:"string"},{name:"option0",type:"string"},{name:"option1",type:"string"},{name:"option2",type:"string"},{name:"option3",type:"string"},{name:"option4",type:"string"},{name:"option5",type:"string"},{name:"option6",type:"string"},{name:"option7",type:"string"},{name:"option8",type:"string"},{name:"option9",type:"string"},"idCampaignname",{name:"repeat",type:"int"}],proxy:{type:"uxproxy",module:"campaignPoll"}},0,0,0,0,0,0,[MBilling.model,"CampaignPoll"],0));(Ext.cmd.derive("MBilling.model.CampaignPollInfo",Ext.data.Model,{fields:[{name:"id",type:"int"},{name:"id_campaign_poll",type:"int"},{name:"resposta",type:"string"},{name:"number",type:"string"},{name:"date",type:"date",dateFormat:"Y-m-d H:i:s"},{name:"city",type:"string"},"sumresposta","resposta2",{name:"obs",type:"string"}],proxy:{type:"uxproxy",module:"campaignPollInfo"}},0,0,0,0,0,0,[MBilling.model,"CampaignPollInfo"],0));(Ext.cmd.derive("MBilling.model.CampaignPollInfoChart",Ext.data.Model,{fields:[{name:"sumresposta",type:"int"},{name:"resposta2",type:"int"},{name:"resposta_name",type:"string"},{name:"total_votos",type:"string"}],proxy:{type:"uxproxy",module:"campaignPollInfoChart"}},0,0,0,0,0,0,[MBilling.model,"CampaignPollInfoChart"],0));(Ext.cmd.derive("MBilling.model.CampaignRestrictPhone",Ext.data.Model,{fields:[{name:"id",type:"int"},{name:"number",type:"string"}],proxy:{type:"uxproxy",module:"campaignRestrictPhone"}},0,0,0,0,0,0,[MBilling.model,"CampaignRestrictPhone"],0));(Ext.cmd.derive("MBilling.model.Configuration",Ext.data.Model,{fields:[{name:"id",type:"int"},{name:"status",type:"string"},"config_title","config_key","config_value","config_description","config_group_title"],proxy:{type:"uxproxy",module:"configuration"}},0,0,0,0,0,0,[MBilling.model,"Configuration"],0));(Ext.cmd.derive("MBilling.model.Did",Ext.data.Model,{fields:[{name:"id",type:"int"},{name:"id_user",type:"int"},{name:"did",type:"string"},{name:"cbr",type:"int"},{name:"cbr_ua",type:"int"},{name:"cbr_em",type:"int"},{name:"TimeOfDay_monFri",type:"string"},{name:"TimeOfDay_sat",type:"string"},{name:"TimeOfDay_sun",type:"string"},{name:"workaudio",type:"string"},{name:"noworkaudio",type:"string"},{name:"activated",type:"int"},{name:"fixrate",type:"number"},{name:"connection_charge",type:"number"},{name:"reserved",type:"int"},{name:"selling_rate_1",type:"number"},{name:"selling_rate_2",type:"number"},{name:"selling_rate_3",type:"number"},{name:"expression_1",type:"string"},{name:"expression_2",type:"string"},{name:"expression_3",type:"string"},{name:"connection_sell",type:"number"},"secondusedreal","idUserusername",{name:"minimal_time_charge",type:"int"},{name:"initblock",type:"int"},{name:"increment",type:"int"},{name:"block_expression_1",type:"int"},{name:"block_expression_2",type:"int"},{name:"block_expression_3",type:"int"},{name:"send_to_callback_1",type:"int"},{name:"send_to_callback_2",type:"int"},{name:"send_to_callback_3",type:"int"},{name:"charge_of",type:"int"},{name:"description",type:"string"},{name:"cbr_time_try",type:"int"},{name:"cbr_total_try",type:"int"}],proxy:{type:"uxproxy",module:"did"}},0,0,0,0,0,0,[MBilling.model,"Did"],0));(Ext.cmd.derive("MBilling.model.DidUse",Ext.data.Model,{fields:[{name:"id",type:"int"},{name:"id_user",type:"int"},{name:"id_did",type:"int"},{name:"status",type:"int"},{name:"month_payed",type:"int"},{name:"reminded",type:"int"},{name:"reservationdate",type:"date",dateFormat:"Y-m-d H:i:s"},{name:"releasedate",type:"date",dateFormat:"Y-m-d H:i:s"},"idDiddid","idUserusername"],proxy:{type:"uxproxy",module:"didUse"}},0,0,0,0,0,0,[MBilling.model,"DidUse"],0));(Ext.cmd.derive("MBilling.model.Diddestination",Ext.data.Model,{fields:[{name:"id",type:"int"},{name:"id_ivr",type:"int"},{name:"id_queue",type:"int"},{name:"id_sip",type:"int"},{name:"id_user",type:"int"},{name:"id_did",type:"int"},{name:"destination",type:"string"},{name:"priority",type:"int"},{name:"creationdate",type:"date",dateFormat:"Y-m-d H:i:s"},{name:"activated",type:"int"},{name:"secondusedreal",type:"number"},{name:"voip_call",type:"int"},{name:"id_ivr",type:"int"},"idDiddid","idIvrname","idUserusername","idQueuename","idSipname"],proxy:{type:"uxproxy",module:"diddestination"}},0,0,0,0,0,0,[MBilling.model,"Diddestination"],0));(Ext.cmd.derive("MBilling.model.Firewall",Ext.data.Model,{fields:[{name:"id",type:"int"},{name:"ip",type:"string"},{name:"action",type:"int"},{name:"date",type:"date",dateFormat:"Y-m-d H:i:s"},{name:"description",type:"string"},{name:"jail",type:"string"}],proxy:{type:"uxproxy",module:"firewall"}},0,0,0,0,0,0,[MBilling.model,"Firewall"],0));(Ext.cmd.derive("MBilling.model.GAuthenticator",Ext.data.Model,{fields:[{name:"id",type:"int"},{name:"googleAuthenticator_enable",type:"int"},{name:"google_authenticator_key",type:"string"},{name:"code",type:"string"}],proxy:{type:"uxproxy",module:"gAuthenticator"}},0,0,0,0,0,0,[MBilling.model,"GAuthenticator"],0));(Ext.cmd.derive("MBilling.model.GroupModule",Ext.data.Model,{idProperty:"id_group, id_module",fields:[{name:"id_group",type:"int"},"idGroupname",{name:"id_module",type:"int"},{name:"idModuletext",type:"string",convert:function(value){return eval(value)}},{name:"show_menu",type:"int"},{name:"createShortCut",type:"int"},{name:"createQuickStart",type:"int"},"action"],proxy:{type:"uxproxy",module:"groupModule"}},0,0,0,0,0,0,[MBilling.model,"GroupModule"],0));(Ext.cmd.derive("MBilling.model.GroupUser",Ext.data.Model,{fields:[{name:"id",type:"int"},"name",{name:"id_user_type",type:"int"},"idUserTypename","id_module"],proxy:{type:"uxproxy",module:"groupUser"}},0,0,0,0,0,0,[MBilling.model,"GroupUser"],0));(Ext.cmd.derive("MBilling.model.GroupUserGroup",Ext.data.Model,{fields:[{name:"id",type:"int"},{name:"name",type:"string"}],proxy:{type:"uxproxy",module:"groupUserGroup"}},0,0,0,0,0,0,[MBilling.model,"GroupUserGroup"],0));(Ext.cmd.derive("MBilling.model.Iax",Ext.data.Model,{fields:[{name:"id",type:"int"},{name:"id_user",type:"int"},"idUserusername",{name:"name",type:"string"},{name:"accountcode",type:"string"},{name:"regexten",type:"string"},{name:"amaflags",type:"string"},{name:"callgroup",type:"string"},{name:"callerid",type:"string"},{name:"context",type:"string"},{name:"DEFAULTip",type:"string"},{name:"dtmfmode",type:"string"},{name:"fromuser",type:"string"},{name:"fromdomain",type:"string"},{name:"host",type:"string"},{name:"group",type:"string"},{name:"insecure",type:"string"},{name:"language",type:"string"},{name:"mailbox",type:"string"},{name:"md5secret",type:"string"},{name:"nat",type:"string"},{name:"deny",type:"string"},{name:"permit",type:"string"},{name:"port",type:"string"},{name:"qualify",type:"string"},{name:"rtpholdtimeout",type:"string"},{name:"secret",type:"string"},{name:"type",type:"string"},{name:"disallow",type:"string"},{name:"allow",type:"string"},{name:"regseconds",type:"date",dateFormat:"timestamp"},{name:"ipaddr",type:"string"},{name:"useragent",type:"string"},{name:"calllimit",type:"int"}],proxy:{type:"uxproxy",module:"iax"}},0,0,0,0,0,0,[MBilling.model,"Iax"],0));(Ext.cmd.derive("MBilling.model.Ivr",Ext.data.Model,{fields:[{name:"id",type:"int"},{name:"id_user",type:"int"},{name:"monFriStart",type:"string"},{name:"monFriStop",type:"string"},{name:"satStart",type:"string"},{name:"satStop",type:"string"},{name:"sunStart",type:"string"},{name:"sunStop",type:"string"},{name:"option_0",type:"string"},{name:"option_1",type:"string"},{name:"option_2",type:"string"},{name:"option_3",type:"string"},{name:"option_4",type:"string"},{name:"option_5",type:"string"},{name:"option_6",type:"string"},{name:"option_7",type:"string"},{name:"option_8",type:"string"},{name:"option_9",type:"string"},{name:"option_10",type:"string"},{name:"option_out_0",type:"string"},{name:"option_out_1",type:"string"},{name:"option_out_2",type:"string"},{name:"option_out_3",type:"string"},{name:"option_out_4",type:"string"},{name:"option_out_5",type:"string"},{name:"option_out_6",type:"string"},{name:"option_out_7",type:"string"},{name:"option_out_8",type:"string"},{name:"option_out_9",type:"string"},{name:"option_out_10",type:"string"},{name:"name",type:"string"},"workaudio","noworkaudio","idDiddid","idUserusername"],proxy:{type:"uxproxy",module:"ivr"}},0,0,0,0,0,0,[MBilling.model,"Ivr"],0));(Ext.cmd.derive("MBilling.model.LogUsers",Ext.data.Model,{fields:[{name:"id",type:"int"},{name:"id_user",type:"int"},{name:"description",type:"string"},{name:"id_log_actions",type:"int"},{name:"date",type:"date",dateFormat:"Y-m-d H:i:s"},{name:"ip",type:"string"},"idUserusername","idLogActionsname"],proxy:{type:"uxproxy",module:"logUsers"}},0,0,0,0,0,0,[MBilling.model,"LogUsers"],0));(Ext.cmd.derive("MBilling.model.MethodPay",Ext.data.Model,{fields:[{name:"id",type:"int"},{name:"id_user",type:"int"},{name:"payment_method",type:"string"},{name:"show_name",type:"string"},{name:"country",type:"string"},{name:"active",type:"int"},{name:"obs",type:"string"},{name:"url",type:"string"},{name:"username",type:"string"},{name:"pagseguro_TOKEN",type:"string"},{name:"boleto_convenio",type:"string"},{name:"boleto_banco",type:"string"},{name:"boleto_agencia",type:"string"},{name:"boleto_conta_corrente",type:"string"},{name:"boleto_inicio_nosso_numeroa",type:"string"},{name:"boleto_carteira",type:"string"},{name:"boleto_taxa",type:"string"},{name:"boleto_instrucoes",type:"string"},{name:"boleto_nome_emp",type:"string"},{name:"boleto_end_emp",type:"string"},{name:"boleto_cidade_emp",type:"string"},{name:"boleto_estado_emp",type:"string"},{name:"boleto_cpf_emp",type:"string"},{name:"fee",type:"int"},{name:"P2P_CustomerSiteID",type:"string"},{name:"P2P_KeyID",type:"string"},{name:"P2P_Passphrase",type:"string"},{name:"P2P_RecipientKeyID",type:"string"},{name:"P2P_tax_amount",type:"string"},{name:"client_id",type:"string"},{name:"client_secret",type:"string"},{name:"SLAppToken",type:"string"},{name:"SLAccessToken",type:"string"},{name:"SLSecret",type:"string"},{name:"SLIdProduto",type:"int"},{name:"SLvalidationtoken",type:"string"},{name:"min",type:"number"},{name:"max",type:"number"},"idUserusername"],proxy:{type:"uxproxy",module:"methodpay"}},0,0,0,0,0,0,[MBilling.model,"MethodPay"],0));(Ext.cmd.derive("MBilling.model.Module",Ext.data.Model,{fields:[{name:"id",type:"int"},{name:"text",convert:function(value){return(value.indexOf("t(")!==-1)?eval(value):value}},"module","icon_cls",{name:"id_module",type:"int",useNull:true},"idModuletext"],proxy:{type:"uxproxy",module:"module"}},0,0,0,0,0,0,[MBilling.model,"Module"],0));(Ext.cmd.derive("MBilling.model.Offer",Ext.data.Model,{fields:[{name:"id",type:"int"},{name:"creationdate",type:"date",dateFormat:"Y-m-d H:i:s"},{name:"label",type:"string"},{name:"packagetype",type:"int"},{name:"billingtype",type:"int"},{name:"startday",type:"int"},{name:"freetimetocall",type:"int"},{name:"price",type:"number"}],proxy:{type:"uxproxy",module:"offer"}},0,0,0,0,0,0,[MBilling.model,"Offer"],0));(Ext.cmd.derive("MBilling.model.OfferCdr",Ext.data.Model,{fields:[{name:"id",type:"int"},{name:"id_user",type:"int"},{name:"id_offer",type:"int"},{name:"used_secondes",type:"int"},{name:"date_consumption",type:"date",dateFormat:"Y-m-d H:i:s"},"idOfferlabel","idUserusername"],proxy:{type:"uxproxy",module:"offerCdr"}},0,0,0,0,0,0,[MBilling.model,"OfferCdr"],0));(Ext.cmd.derive("MBilling.model.OfferUse",Ext.data.Model,{fields:[{name:"id",type:"int"},{name:"id_user",type:"int"},{name:"id_offer",type:"int"},{name:"status",type:"int"},{name:"month_payed",type:"int"},{name:"reservationdate",type:"date",dateFormat:"Y-m-d H:i:s"},{name:"releasedate",type:"date",dateFormat:"Y-m-d H:i:s"},"idOfferlabel","idUserusername"],proxy:{type:"uxproxy",module:"offerUse"}},0,0,0,0,0,0,[MBilling.model,"OfferUse"],0));(Ext.cmd.derive("MBilling.model.PhoneBook",Ext.data.Model,{fields:[{name:"id",type:"int"},{name:"id_user",type:"int"},{name:"status",type:"int"},{name:"name",type:"string"},{name:"description",type:"string"},"idUserusername"],proxy:{type:"uxproxy",module:"phoneBook"}},0,0,0,0,0,0,[MBilling.model,"PhoneBook"],0));(Ext.cmd.derive("MBilling.model.PhoneNumber",Ext.data.Model,{fields:[{name:"id",type:"int"},{name:"id_phonebook",type:"int"},{name:"number",type:"string"},{name:"name",type:"string"},{name:"city",type:"string"},{name:"status",type:"int"},{name:"info",type:"string"},{name:"creationdate",type:"date",dateFormat:"Y-m-d H:i:s"},"idPhonebookname"],proxy:{type:"uxproxy",module:"phoneNumber"}},0,0,0,0,0,0,[MBilling.model,"PhoneNumber"],0));(Ext.cmd.derive("MBilling.model.Plan",Ext.data.Model,{fields:[{name:"id",type:"int"},{name:"id_user",type:"int"},{name:"name",type:"string"},{name:"lcrtype",type:"int"},{name:"creationdate",type:"date",dateFormat:"Y-m-d H:i:s"},{name:"signup",type:"int"},{name:"portabilidadeMobile",type:"int"},{name:"portabilidadeFixed",type:"int"},{name:"ini_credit",type:"string"},{name:"play_audio",type:"int"},"idUserusername","id_services",{name:"techprefix",type:"string"},{name:"tariff_limit",type:"int"}],proxy:{type:"uxproxy",module:"plan"}},0,0,0,0,0,0,[MBilling.model,"Plan"],0));(Ext.cmd.derive("MBilling.model.Prefix",Ext.data.Model,{fields:[{name:"id",type:"int"},{name:"prefix",type:"string"},{name:"destination",type:"string"}],proxy:{type:"uxproxy",module:"prefix"}},0,0,0,0,0,0,[MBilling.model,"Prefix"],0));(Ext.cmd.derive("MBilling.model.Provider",Ext.data.Model,{fields:[{name:"id",type:"int"},{name:"provider_name",type:"string"},{name:"creationdate",type:"date",dateFormat:"Y-m-d H:i:s"},{name:"description",type:"string"},{name:"credit_control",type:"int"},{name:"credit",type:"number"}],proxy:{type:"uxproxy",module:"provider"}},0,0,0,0,0,0,[MBilling.model,"Provider"],0));(Ext.cmd.derive("MBilling.model.Queue",Ext.data.Model,{fields:[{name:"id",type:"int"},{name:"id_user",type:"int"},{name:"name",type:"string"},{name:"language",type:"string"},{name:"strategy",type:"string"},{name:"ringinuse",type:"string"},{name:"timeout",type:"int"},{name:"retry",type:"int"},{name:"wrapuptime",type:"int"},{name:"weight",type:"int"},{name:"periodic-announce",type:"string"},{name:"periodic-announce-frequency",type:"int"},{name:"announce-position",type:"string"},{name:"announce-holdtime",type:"string"},{name:"announce-frequency",type:"string"},{name:"musiconhold",type:"string"},{name:"joinempty",type:"string"},{name:"ring_or_moh",type:"string"},{name:"leavewhenempty",type:"string"},"idUserusername"],proxy:{type:"uxproxy",module:"queue"}},0,0,0,0,0,0,[MBilling.model,"Queue"],0));(Ext.cmd.derive("MBilling.model.QueueDashBoard",Ext.data.Model,{fields:[{name:"callId",type:"int"},{name:"id_queue",type:"string"},{name:"callerId",type:"string"},{name:"status",type:"string"},{name:"position",type:"string"},{name:"originalPosition",type:"string"},{name:"holdtime",type:"string"},{name:"keyPressed",type:"string"},{name:"callduration",type:"int"}],proxy:{type:"uxproxy",module:"queueDashBoard"}},0,0,0,0,0,0,[MBilling.model,"QueueDashBoard"],0));(Ext.cmd.derive("MBilling.model.QueueMember",Ext.data.Model,{idProperty:"uniqueid",fields:[{name:"uniqueid",type:"int"},{name:"id_user",type:"int"},{name:"membername",type:"string"},{name:"queue_name",type:"string"},{name:"interface",type:"string"},{name:"penalty",type:"int"},{name:"paused",type:"int"},"idUserusername"],proxy:{type:"uxproxy",module:"queueMember"}},0,0,0,0,0,0,[MBilling.model,"QueueMember"],0));(Ext.cmd.derive("MBilling.model.QueueMemberDashBoard",Ext.data.Model,{fields:[{name:"id",type:"int"},{name:"agentId",type:"string"},{name:"agentStatus",type:"string"},{name:"score",type:"string"},"idQueuename"],proxy:{type:"uxproxy",module:"queueMemberDashBoard"}},0,0,0,0,0,0,[MBilling.model,"QueueMemberDashBoard"],0));(Ext.cmd.derive("MBilling.model.Rate",Ext.data.Model,{fields:[{name:"id",type:"int"},{name:"id_plan",type:"int"},{name:"id_trunk",type:"int"},{name:"id_prefix",type:"int"},{name:"buyrate",type:"number"},{name:"buyrateinitblock",type:"int"},{name:"buyrateincrement",type:"int"},{name:"rateinitial",type:"number"},{name:"initblock",type:"int"},{name:"billingblock",type:"int"},{name:"connectcharge",type:"int"},{name:"disconnectcharge",type:"int"},{name:"starttime",type:"int"},{name:"endtime",type:"int"},{name:"additional_grace",type:"string"},{name:"minimal_cost",type:"int"},{name:"minimal_time_charge",type:"int"},{name:"minimal_time_buy",type:"int"},{name:"startdate",type:"date",dateFormat:"Y-m-d H:i:s"},{name:"stopdate",type:"date",dateFormat:"Y-m-d H:i:s"},{name:"package_offer",type:"int"},{name:"status",type:"int"},"idPrefixdestination","idPrefixprefix","idTrunktrunkcode","idPlanname"],proxy:{type:"uxproxy",module:"rate"}},0,0,0,0,0,0,[MBilling.model,"Rate"],0));(Ext.cmd.derive("MBilling.model.RateCallshop",Ext.data.Model,{fields:[{name:"id",type:"int"},{name:"dialprefix",type:"string"},{name:"buyrate",type:"number"},{name:"minimo",type:"int"},{name:"block",type:"int"},{name:"destination",type:"string"},{name:"minimal_time_charge",type:"int"}],proxy:{type:"uxproxy",module:"rateCallshop"}},0,0,0,0,0,0,[MBilling.model,"RateCallshop"],0));(Ext.cmd.derive("MBilling.model.Refill",Ext.data.Model,{fields:[{name:"id",type:"int"},{name:"date",type:"date",dateFormat:"Y-m-d H:i:s"},{name:"credit",type:"number"},{name:"id_user",type:"int"},"description",{name:"refill_type",type:"int"},{name:"payment",type:"int"},"sumCredit","sumCreditMonth","CreditMonth","idUserusername","invoice_number"],proxy:{type:"uxproxy",module:"refill"}},0,0,0,0,0,0,[MBilling.model,"Refill"],0));(Ext.cmd.derive("MBilling.model.RefillChart",Ext.data.Model,{fields:[{name:"id",type:"int"},"sumCreditMonth","CreditMonth"],proxy:{type:"uxproxy",module:"refillChart"}},0,0,0,0,0,0,[MBilling.model,"RefillChart"],0));(Ext.cmd.derive("MBilling.model.Refillprovider",Ext.data.Model,{fields:[{name:"id",type:"int"},{name:"date",type:"date",dateFormat:"Y-m-d H:i:s"},{name:"credit",type:"int"},{name:"id_provider",type:"int"},"description","idProviderprovider_name",{name:"payment",type:"int"}],proxy:{type:"uxproxy",module:"refillprovider"}},0,0,0,0,0,0,[MBilling.model,"Refillprovider"],0));(Ext.cmd.derive("MBilling.model.RestrictedPhonenumber",Ext.data.Model,{fields:[{name:"id",type:"int"},{name:"id_user",type:"int"},{name:"number",type:"number"},"idUserusername"],proxy:{type:"uxproxy",module:"restrictedPhonenumber"}},0,0,0,0,0,0,[MBilling.model,"RestrictedPhonenumber"],0));(Ext.cmd.derive("MBilling.model.SendCreditProducts",Ext.data.Model,{fields:[{name:"id",type:"int"},{name:"country_code",type:"int"},{name:"operator_id",type:"string"},{name:"SkuCode",type:"string"},{name:"country",type:"string"},{name:"operator_name",type:"string"},{name:"currency_dest",type:"string"},{name:"product",type:"string"},{name:"currency_orig",type:"string"},{name:"wholesale_price",type:"string"},{name:"send_value",type:"string"},{name:"provider",type:"string"},{name:"info",type:"string"},{name:"status",type:"int"},"idUserusername"],proxy:{type:"uxproxy",module:"sendCreditProducts"}},0,0,0,0,0,0,[MBilling.model,"SendCreditProducts"],0));(Ext.cmd.derive("MBilling.model.SendCreditRates",Ext.data.Model,{fields:[{name:"id",type:"int"},{name:"id_user",type:"int"},{name:"id_operator",type:"int"},{name:"sell_price",type:"string"},"idUserusername","idProductoperator_name","idProductcountry","idProductcurrency_dest","idProductproduct","idProductcurrency_orig","idProductwholesale_price"],proxy:{type:"uxproxy",module:"sendCreditRates"}},0,0,0,0,0,0,[MBilling.model,"SendCreditRates"],0));(Ext.cmd.derive("MBilling.model.SendCreditSummary",Ext.data.Model,{fields:[{name:"id",type:"int"},{name:"day",type:"date",dateFormat:"Y-m-d"},{name:"id_user",type:"int"},{name:"service",type:"string"},{name:"total_sale",type:"string"},{name:"earned",type:"string"},{name:"commision",type:"string"},{name:"profit",type:"string"},"idUserusername"],proxy:{type:"uxproxy",module:"sendCreditSummary"}},0,0,0,0,0,0,[MBilling.model,"SendCreditSummary"],0));(Ext.cmd.derive("MBilling.model.Servers",Ext.data.Model,{fields:[{name:"id",type:"int"},{name:"host",type:"string"},{name:"username",type:"string"},{name:"password",type:"string"},{name:"port",type:"string"},{name:"status",type:"int"},{name:"weight",type:"int"},{name:"description",type:"string"}],proxy:{type:"uxproxy",module:"servers"}},0,0,0,0,0,0,[MBilling.model,"Servers"],0));(Ext.cmd.derive("MBilling.model.Services",Ext.data.Model,{fields:[{name:"id",type:"int"},{name:"type",type:"string"},{name:"name",type:"string"},{name:"price",type:"string"},{name:"description",type:"string"},{name:"calllimit",type:"int"},{name:"disk_space",type:"int"},{name:"sipaccountlimit",type:"int"}],proxy:{type:"uxproxy",module:"services"}},0,0,0,0,0,0,[MBilling.model,"Services"],0));(Ext.cmd.derive("MBilling.model.ServicesUse",Ext.data.Model,{fields:[{name:"id",type:"int"},{name:"id_user",type:"int"},{name:"id_services",type:"int"},{name:"status",type:"int"},{name:"month_payed",type:"int"},{name:"reminded",type:"int"},{name:"reservationdate",type:"date",dateFormat:"Y-m-d H:i:s"},{name:"releasedate",type:"date",dateFormat:"Y-m-d H:i:s"},"idServicesname","idServicesprice","idUserusername"],proxy:{type:"uxproxy",module:"servicesUse"}},0,0,0,0,0,0,[MBilling.model,"ServicesUse"],0));(Ext.cmd.derive("MBilling.model.Sip",Ext.data.Model,{fields:[{name:"id",type:"int"},{name:"id_user",type:"int"},"idUserusername",{name:"name",type:"string"},{name:"accountcode",type:"string"},{name:"regexten",type:"string"},{name:"amaflags",type:"string"},{name:"callgroup",type:"string"},{name:"callerid",type:"string"},{name:"directmedia",type:"string"},{name:"context",type:"string"},{name:"DEFAULTip",type:"string"},{name:"dtmfmode",type:"string"},{name:"fromuser",type:"string"},{name:"fromdomain",type:"string"},{name:"host",type:"string"},{name:"group",type:"string"},{name:"insecure",type:"string"},{name:"language",type:"string"},{name:"mailbox",type:"string"},{name:"md5secret",type:"string"},{name:"nat",type:"string"},{name:"deny",type:"string"},{name:"permit",type:"string"},{name:"pickupgroup",type:"string"},{name:"port",type:"string"},{name:"qualify",type:"string"},{name:"rtptimeout",type:"string"},{name:"rtpholdtimeout",type:"string"},{name:"secret",type:"string"},{name:"type",type:"string"},{name:"disallow",type:"string"},{name:"allow",type:"string"},{name:"regseconds",type:"date",dateFormat:"timestamp"},{name:"ipaddr",type:"string"},{name:"fullcontact",type:"string"},{name:"setvar",type:"string"},{name:"regserver",type:"string"},{name:"lastms",type:"string"},{name:"defaultuser",type:"string"},{name:"auth",type:"string"},{name:"subscribemwi",type:"string"},{name:"vmexten",type:"string"},{name:"cid_number",type:"string"},{name:"callingpres",type:"string"},{name:"usereqphone",type:"string"},{name:"mohsuggest",type:"string"},{name:"allowtransfer",type:"string"},{name:"autoframing",type:"string"},{name:"maxcallbitrate",type:"string"},{name:"outboundproxy",type:"string"},{name:"rtpkeepalive",type:"string"},{name:"useragent",type:"string"},{name:"calllimit",type:"int"},{name:"lineStatus",type:"string"},{name:"url_events",type:"string"},{name:"ringfalse",type:"int"},{name:"record_call",type:"int"},{name:"voicemail",type:"int"},{name:"forward",type:"string"},{name:"block_call_reg",type:"string"},{name:"dial_timeout",type:"int"},{name:"techprefix",type:"int"},{name:"alias",type:"string"},{name:"deny",type:"string"},{name:"permit",type:"string"}],proxy:{type:"uxproxy",module:"sip"}},0,0,0,0,0,0,[MBilling.model,"Sip"],0));(Ext.cmd.derive("MBilling.model.Sip2",Ext.data.Model,{fields:[{name:"id",type:"int"},{name:"id_user",type:"int"},"idUserusername",{name:"name",type:"string"},{name:"accountcode",type:"string"},{name:"regexten",type:"string"},{name:"amaflags",type:"string"},{name:"callgroup",type:"string"},{name:"callerid",type:"string"},{name:"directmedia",type:"string"},{name:"context",type:"string"},{name:"DEFAULTip",type:"string"},{name:"dtmfmode",type:"string"},{name:"fromuser",type:"string"},{name:"fromdomain",type:"string"},{name:"host",type:"string"},{name:"group",type:"string"},{name:"insecure",type:"string"},{name:"language",type:"string"},{name:"mailbox",type:"string"},{name:"md5secret",type:"string"},{name:"nat",type:"string"},{name:"deny",type:"string"},{name:"permit",type:"string"},{name:"pickupgroup",type:"string"},{name:"port",type:"string"},{name:"qualify",type:"string"},{name:"rtptimeout",type:"string"},{name:"rtpholdtimeout",type:"string"},{name:"secret",type:"string"},{name:"type",type:"string"},{name:"disallow",type:"string"},{name:"allow",type:"string"},{name:"regseconds",type:"date",dateFormat:"timestamp"},{name:"ipaddr",type:"string"},{name:"fullcontact",type:"string"},{name:"setvar",type:"string"},{name:"regserver",type:"string"},{name:"lastms",type:"string"},{name:"defaultuser",type:"string"},{name:"auth",type:"string"},{name:"subscribemwi",type:"string"},{name:"vmexten",type:"string"},{name:"cid_number",type:"string"},{name:"callingpres",type:"string"},{name:"usereqphone",type:"string"},{name:"mohsuggest",type:"string"},{name:"allowtransfer",type:"string"},{name:"autoframing",type:"string"},{name:"maxcallbitrate",type:"string"},{name:"outboundproxy",type:"string"},{name:"rtpkeepalive",type:"string"},{name:"useragent",type:"string"},{name:"calllimit",type:"int"},{name:"lineStatus",type:"string"},{name:"url_events",type:"string"},{name:"ringfalse",type:"int"},{name:"record_call",type:"int"},{name:"voicemail",type:"int"},{name:"forward",type:"string"},{name:"block_call_reg",type:"string"},{name:"dial_timeout",type:"int"}],proxy:{type:"uxproxy",module:"sip"}},0,0,0,0,0,0,[MBilling.model,"Sip2"],0));(Ext.cmd.derive("MBilling.model.SipTrace",Ext.data.Model,{fields:[{name:"id",type:"int"},{name:"date",type:"date",dateFormat:"Y-m-d H:i:s"},{name:"traced_data",type:"string"},{name:"method",type:"string"},{name:"callid",type:"string"},{name:"fromip",type:"string"},{name:"toip",type:"string"},{name:"direction",type:"string"},{name:"head",type:"string"},{name:"sipto",type:"string"}],proxy:{type:"uxproxy",module:"sipTrace"}},0,0,0,0,0,0,[MBilling.model,"SipTrace"],0));(Ext.cmd.derive("MBilling.model.Sipuras",Ext.data.Model,{fields:[{name:"id",type:"int"},{name:"nserie",type:"string"},{name:"macadr",type:"string"},{name:"id_user",type:"int"},"senha_user","senha_admin",{name:"antireset",type:"int"},{name:"Enable_Web_Server",type:"int"},"marca","altera","User_ID_1","Password_1",{name:"Use_Pref_Codec_Only_1",type:"int"},"Preferred_Codec_1","Register_Expires_1","Dial_Plan_1","NAT_Mapping_Enable_1_","NAT_Keep_Alive_Enable_1_","Proxy_1","User_ID_2","Password_2",{name:"Use_Pref_Codec_Only_2",type:"int"},"Preferred_Codec_2","Register_Expires_2","Dial_Plan_2","NAT_Mapping_Enable_2_","NAT_Keep_Alive_Enable_2_","Proxy_2","STUN_Enable","STUN_Test_Enable","Substitute_VIA_Addr","STUN_Server","last_ip","obs",{name:"fultmov",type:"date",dateFormat:"Y-m-d H:i:s"},"idUserusername"],proxy:{type:"uxproxy",module:"sipuras"}},0,0,0,0,0,0,[MBilling.model,"Sipuras"],0));(Ext.cmd.derive("MBilling.model.Sms",Ext.data.Model,{fields:[{name:"id",type:"int"},{name:"id_user",type:"int"},{name:"prefix",type:"int"},{name:"result",type:"int"},{name:"telephone",type:"number"},{name:"date",type:"date",dateFormat:"Y-m-d H:i:s"},{name:"sms",type:"string"},"idUserusername"],proxy:{type:"uxproxy",module:"sms"}},0,0,0,0,0,0,[MBilling.model,"Sms"],0));(Ext.cmd.derive("MBilling.model.Smtps",Ext.data.Model,{fields:[{name:"id",type:"int"},{name:"id_user",type:"int"},{name:"host",type:"string"},{name:"username",type:"string"},{name:"password",type:"string"},{name:"port",type:"string"},{name:"encryption",type:"string"},"idUserusername"],proxy:{type:"uxproxy",module:"smtps"}},0,0,0,0,0,0,[MBilling.model,"Smtps"],0));(Ext.cmd.derive("MBilling.model.TemplateMail",Ext.data.Model,{fields:[{name:"id",type:"int"},{name:"mailtype",type:"string"},{name:"fromemail",type:"string"},{name:"fromname",type:"string"},{name:"subject",type:"string"},{name:"messagehtml",type:"string"},{name:"language",type:"string"}],proxy:{type:"uxproxy",module:"templateMail"}},0,0,0,0,0,0,[MBilling.model,"TemplateMail"],0));(Ext.cmd.derive("MBilling.model.Trunk",Ext.data.Model,{fields:[{name:"id",type:"int"},{name:"trunkcode",type:"string"},{name:"trunkprefix",type:"string"},{name:"providertech",type:"string"},{name:"providerip",type:"string"},{name:"removeprefix",type:"string"},{name:"secondusedreal",type:"int"},{name:"creationdate",type:"date",dateFormat:"Y-m-d H:i:s"},{name:"failover_trunk",type:"int"},"failoverTrunktrunkcode","idProviderprovider_name",{name:"fromdomain",type:"string"},{name:"addparameter",type:"string"},{name:"id_provider",type:"int"},{name:"inuse",type:"string"},{name:"maxuse",type:"string"},{name:"status",type:"int"},{name:"if_max_use",type:"string"},{name:"user",type:"string"},{name:"secret",type:"string"},{name:"allow",type:"string"},{name:"link_sms",type:"string"},{name:"directmedia",type:"string"},{name:"context",type:"string"},{name:"dtmfmode",type:"string"},{name:"insecure",type:"string"},{name:"nat",type:"string"},{name:"qualify",type:"string"},{name:"type",type:"string"},{name:"disallow",type:"string"},{name:"host",type:"string"},{name:"sms_res",type:"string"},{name:"register",type:"int"},{name:"language",type:"string"},{name:"allow_error",type:"int"},{name:"fromuser",type:"string"},{name:"port",type:"int"},{name:"encryption",type:"string"},{name:"transport",type:"string"},{name:"sendrpid",type:"string"}],proxy:{type:"uxproxy",module:"trunk"}},0,0,0,0,0,0,[MBilling.model,"Trunk"],0));(Ext.cmd.derive("MBilling.model.User",Ext.data.Model,{fields:[{name:"id",type:"int"},{name:"id_group",type:"int"},{name:"id_plan",type:"int"},{name:"id_user",type:"int"},{name:"id_offer",type:"int"},{name:"username",type:"string"},{name:"password",type:"string"},{name:"active",type:"int"},{name:"credit",type:"number"},{name:"enableexpire",type:"int"},{name:"expiredays",type:"int"},{name:"status",type:"int"},{name:"typepaid",type:"int"},{name:"creditlimit",type:"int"},{name:"credit_notification",type:"int"},{name:"restriction",type:"int"},{name:"callingcard_pin",type:"int"},{name:"callshop",type:"int"},{name:"plan_day",type:"int"},{name:"record_call",type:"int"},{name:"active_paypal",type:"int"},{name:"boleto",type:"int"},{name:"lastname",type:"string"},{name:"firstname",type:"string"},{name:"redial",type:"string"},{name:"tag",type:"string"},{name:"company_name",type:"string"},{name:"address",type:"string"},{name:"city",type:"string"},{name:"state",type:"string"},{name:"country",type:"string"},{name:"loginkey",type:"string"},{name:"zipcode",type:"string"},{name:"phone",type:"string"},{name:"mobile",type:"string"},{name:"email",type:"string"},{name:"doc",type:"string"},{name:"vat",type:"string"},{name:"language",type:"string"},{name:"company_website",type:"string"},{name:"prefix_local",type:"string"},{name:"boleto_day",type:"int"},{name:"firstusedate",type:"date",dateFormat:"Y-m-d H:i:s"},{name:"expirationdate",type:"date",dateFormat:"Y-m-d H:i:s"},{name:"lastuse",type:"date",dateFormat:"Y-m-d H:i:s"},{name:"description",type:"string"},{name:"creationdate",type:"date",dateFormat:"Y-m-d H:i:s"},{name:"id_group_agent",type:"int"},{name:"calllimit",type:"int"},{name:"mix_monitor_format",type:"string"},{name:"disk_space",type:"int"},{name:"sipaccountlimit",type:"int"},{name:"cpslimit",type:"int"},"idUserusername","idGroupname","idGroupid_user_type","idPlanname"],proxy:{type:"uxproxy",module:"user"}},0,0,0,0,0,0,[MBilling.model,"User"],0));(Ext.cmd.derive("MBilling.model.UserRate",Ext.data.Model,{fields:[{name:"id",type:"int"},{name:"id_user",type:"int"},{name:"id_prefix",type:"int"},{name:"rateinitial",type:"number"},{name:"initblock",type:"int"},{name:"billingblock",type:"int"},"idUserusername","idPrefixdestination","idPrefixprefix"],proxy:{type:"uxproxy",module:"userRate"}},0,0,0,0,0,0,[MBilling.model,"UserRate"],0));(Ext.cmd.derive("MBilling.model.Voucher",Ext.data.Model,{fields:[{name:"id",type:"int"},{name:"id_user",type:"int"},{name:"id_plan",type:"int"},{name:"creationdate",type:"date",dateFormat:"Y-m-d H:i:s"},{name:"usedate",type:"date",dateFormat:"Y-m-d H:i:s"},{name:"expirationdate",type:"date",dateFormat:"Y-m-d H:i:s"},{name:"voucher",type:"number"},{name:"tag",type:"string"},{name:"credit",type:"number"},{name:"used",type:"int"},{name:"quantity",type:"int"},{name:"prefix_local",type:"string"},{name:"language",type:"string"},"idUserusername"],proxy:{type:"uxproxy",module:"voucher"}},0,0,0,0,0,0,[MBilling.model,"Voucher"],0));(Ext.cmd.derive("MBilling.store.Backup",Ext.data.Store,{model:"MBilling.model.Backup"},0,0,0,0,0,0,[MBilling.store,"Backup"],0));(Ext.cmd.derive("MBilling.store.Boleto",Ext.data.Store,{model:"MBilling.model.Boleto"},0,0,0,0,0,0,[MBilling.store,"Boleto"],0));(Ext.cmd.derive("MBilling.store.CallArchive",Ext.data.Store,{model:"MBilling.model.CallArchive"},0,0,0,0,0,0,[MBilling.store,"CallArchive"],0));(Ext.cmd.derive("MBilling.store.Call",Ext.data.Store,{model:"MBilling.model.Call"},0,0,0,0,0,0,[MBilling.store,"Call"],0));(Ext.cmd.derive("MBilling.store.CallBack",Ext.data.Store,{model:"MBilling.model.CallBack"},0,0,0,0,0,0,[MBilling.store,"CallBack"],0));(Ext.cmd.derive("MBilling.store.CallFailed",Ext.data.Store,{model:"MBilling.model.CallFailed"},0,0,0,0,0,0,[MBilling.store,"CallFailed"],0));(Ext.cmd.derive("MBilling.store.CallOnLine",Ext.data.Store,{model:"MBilling.model.CallOnLine"},0,0,0,0,0,0,[MBilling.store,"CallOnLine"],0));(Ext.cmd.derive("MBilling.store.CallOnlineChart",Ext.data.Store,{model:"MBilling.model.CallOnlineChart"},0,0,0,0,0,0,[MBilling.store,"CallOnlineChart"],0));(Ext.cmd.derive("MBilling.store.CallShop",Ext.data.Store,{model:"MBilling.model.CallShop"},0,0,0,0,0,0,[MBilling.store,"CallShop"],0));(Ext.cmd.derive("MBilling.store.CallShopCdr",Ext.data.Store,{model:"MBilling.model.CallShopCdr"},0,0,0,0,0,0,[MBilling.store,"CallShopCdr"],0));(Ext.cmd.derive("MBilling.store.CallSummaryCallShop",Ext.data.Store,{model:"MBilling.model.CallSummaryCallShop"},0,0,0,0,0,0,[MBilling.store,"CallSummaryCallShop"],0));(Ext.cmd.derive("MBilling.store.CallSummaryDayAgent",Ext.data.Store,{model:"MBilling.model.CallSummaryDayAgent"},0,0,0,0,0,0,[MBilling.store,"CallSummaryDayAgent"],0));(Ext.cmd.derive("MBilling.store.CallSummaryDayTrunk",Ext.data.Store,{model:"MBilling.model.CallSummaryDayTrunk"},0,0,0,0,0,0,[MBilling.store,"CallSummaryDayTrunk"],0));(Ext.cmd.derive("MBilling.store.CallSummaryDayUser",Ext.data.Store,{model:"MBilling.model.CallSummaryDayUser"},0,0,0,0,0,0,[MBilling.store,"CallSummaryDayUser"],0));(Ext.cmd.derive("MBilling.store.CallSummaryMonthTrunk",Ext.data.Store,{model:"MBilling.model.CallSummaryMonthTrunk"},0,0,0,0,0,0,[MBilling.store,"CallSummaryMonthTrunk"],0));(Ext.cmd.derive("MBilling.store.CallSummaryMonthUser",Ext.data.Store,{model:"MBilling.model.CallSummaryMonthUser"},0,0,0,0,0,0,[MBilling.store,"CallSummaryMonthUser"],0));(Ext.cmd.derive("MBilling.store.CallSummaryPerDay",Ext.data.Store,{model:"MBilling.model.CallSummaryPerDay"},0,0,0,0,0,0,[MBilling.store,"CallSummaryPerDay"],0));(Ext.cmd.derive("MBilling.store.CallSummaryPerMonth",Ext.data.Store,{model:"MBilling.model.CallSummaryPerMonth"},0,0,0,0,0,0,[MBilling.store,"CallSummaryPerMonth"],0));(Ext.cmd.derive("MBilling.store.CallSummaryPerTrunk",Ext.data.Store,{model:"MBilling.model.CallSummaryPerTrunk"},0,0,0,0,0,0,[MBilling.store,"CallSummaryPerTrunk"],0));(Ext.cmd.derive("MBilling.store.CallSummaryPerUser",Ext.data.Store,{model:"MBilling.model.CallSummaryPerUser"},0,0,0,0,0,0,[MBilling.store,"CallSummaryPerUser"],0));(Ext.cmd.derive("MBilling.store.Callerid",Ext.data.Store,{model:"MBilling.model.Callerid"},0,0,0,0,0,0,[MBilling.store,"Callerid"],0));(Ext.cmd.derive("MBilling.store.Campaign",Ext.data.Store,{model:"MBilling.model.Campaign"},0,0,0,0,0,0,[MBilling.store,"Campaign"],0));(Ext.cmd.derive("MBilling.store.CampaignLog",Ext.data.Store,{model:"MBilling.model.CampaignLog"},0,0,0,0,0,0,[MBilling.store,"CampaignLog"],0));(Ext.cmd.derive("MBilling.store.CampaignPoll",Ext.data.Store,{model:"MBilling.model.CampaignPoll"},0,0,0,0,0,0,[MBilling.store,"CampaignPoll"],0));(Ext.cmd.derive("MBilling.store.CampaignPollInfo",Ext.data.Store,{model:"MBilling.model.CampaignPollInfo"},0,0,0,0,0,0,[MBilling.store,"CampaignPollInfo"],0));(Ext.cmd.derive("MBilling.store.CampaignPollInfoChart",Ext.data.Store,{model:"MBilling.model.CampaignPollInfoChart"},0,0,0,0,0,0,[MBilling.store,"CampaignPollInfoChart"],0));(Ext.cmd.derive("MBilling.store.CampaignRestrictPhone",Ext.data.Store,{model:"MBilling.model.CampaignRestrictPhone"},0,0,0,0,0,0,[MBilling.store,"CampaignRestrictPhone"],0));(Ext.cmd.derive("MBilling.store.Configuration",Ext.data.Store,{model:"MBilling.model.Configuration"},0,0,0,0,0,0,[MBilling.store,"Configuration"],0));(Ext.cmd.derive("MBilling.store.Did",Ext.data.Store,{model:"MBilling.model.Did"},0,0,0,0,0,0,[MBilling.store,"Did"],0));(Ext.cmd.derive("MBilling.store.DidUse",Ext.data.Store,{model:"MBilling.model.DidUse"},0,0,0,0,0,0,[MBilling.store,"DidUse"],0));(Ext.cmd.derive("MBilling.store.Diddestination",Ext.data.Store,{model:"MBilling.model.Diddestination"},0,0,0,0,0,0,[MBilling.store,"Diddestination"],0));(Ext.cmd.derive("MBilling.store.Firewall",Ext.data.Store,{model:"MBilling.model.Firewall"},0,0,0,0,0,0,[MBilling.store,"Firewall"],0));(Ext.cmd.derive("MBilling.store.GAuthenticator",Ext.data.Store,{model:"MBilling.model.GAuthenticator"},0,0,0,0,0,0,[MBilling.store,"GAuthenticator"],0));(Ext.cmd.derive("MBilling.store.GroupModule",Ext.data.Store,{model:"MBilling.model.GroupModule"},0,0,0,0,0,0,[MBilling.store,"GroupModule"],0));(Ext.cmd.derive("MBilling.store.GroupUser",Ext.data.Store,{model:"MBilling.model.GroupUser"},0,0,0,0,0,0,[MBilling.store,"GroupUser"],0));(Ext.cmd.derive("MBilling.store.GroupUserGroup",Ext.data.Store,{model:"MBilling.model.GroupUserGroup"},0,0,0,0,0,0,[MBilling.store,"GroupUserGroup"],0));(Ext.cmd.derive("MBilling.store.Help",Ext.data.TreeStore,{proxy:{type:"memory",reader:{rootProperty:"help"},data:[{text:t("User"),help:[{text:t("Cadastre"),leaf:true,iconCls:"icon-item-help",url:"user/cadastre"}]}]},fields:[{name:"url",convert:function(c,d){return Ext.String.format("resources/help/{0}/{1}.html",window.lang,c)}}]},0,0,0,0,0,0,[MBilling.store,"Help"],0));(Ext.cmd.derive("MBilling.store.Iax",Ext.data.Store,{model:"MBilling.model.Iax"},0,0,0,0,0,0,[MBilling.store,"Iax"],0));(Ext.cmd.derive("MBilling.store.Ivr",Ext.data.Store,{model:"MBilling.model.Ivr"},0,0,0,0,0,0,[MBilling.store,"Ivr"],0));(Ext.cmd.derive("MBilling.store.LogUsers",Ext.data.Store,{model:"MBilling.model.LogUsers"},0,0,0,0,0,0,[MBilling.store,"LogUsers"],0));(Ext.cmd.derive("MBilling.store.MethodPay",Ext.data.Store,{model:"MBilling.model.MethodPay"},0,0,0,0,0,0,[MBilling.store,"MethodPay"],0));(Ext.cmd.derive("MBilling.store.Module",Ext.data.Store,{model:"MBilling.model.Module"},0,0,0,0,0,0,[MBilling.store,"Module"],0));(Ext.cmd.derive("MBilling.store.Offer",Ext.data.Store,{model:"MBilling.model.Offer"},0,0,0,0,0,0,[MBilling.store,"Offer"],0));(Ext.cmd.derive("MBilling.store.OfferCdr",Ext.data.Store,{model:"MBilling.model.OfferCdr"},0,0,0,0,0,0,[MBilling.store,"OfferCdr"],0));(Ext.cmd.derive("MBilling.store.OfferUse",Ext.data.Store,{model:"MBilling.model.OfferUse"},0,0,0,0,0,0,[MBilling.store,"OfferUse"],0));(Ext.cmd.derive("MBilling.store.PhoneBook",Ext.data.Store,{model:"MBilling.model.PhoneBook"},0,0,0,0,0,0,[MBilling.store,"PhoneBook"],0));(Ext.cmd.derive("MBilling.store.PhoneNumber",Ext.data.Store,{model:"MBilling.model.PhoneNumber"},0,0,0,0,0,0,[MBilling.store,"PhoneNumber"],0));(Ext.cmd.derive("MBilling.store.Plan",Ext.data.Store,{model:"MBilling.model.Plan"},0,0,0,0,0,0,[MBilling.store,"Plan"],0));(Ext.cmd.derive("MBilling.store.Prefix",Ext.data.Store,{model:"MBilling.model.Prefix"},0,0,0,0,0,0,[MBilling.store,"Prefix"],0));(Ext.cmd.derive("Ext.ux.data.StoreCombo",Ext.data.Store,{sendLimitParams:false,remoteSort:false},0,0,0,0,0,0,[Ext.ux.data,"StoreCombo"],0));(Ext.cmd.derive("MBilling.store.PrefixCombo",Ext.ux.data.StoreCombo,{model:"MBilling.model.Prefix"},0,0,0,0,0,0,[MBilling.store,"PrefixCombo"],0));(Ext.cmd.derive("MBilling.store.Provider",Ext.data.Store,{model:"MBilling.model.Provider"},0,0,0,0,0,0,[MBilling.store,"Provider"],0));(Ext.cmd.derive("MBilling.store.Queue",Ext.data.Store,{model:"MBilling.model.Queue"},0,0,0,0,0,0,[MBilling.store,"Queue"],0));(Ext.cmd.derive("MBilling.store.QueueDashBoard",Ext.data.Store,{model:"MBilling.model.QueueDashBoard",groupField:"id_queue",remoteSort:false,sorters:[{property:"score",direction:"DESC"}]},0,0,0,0,0,0,[MBilling.store,"QueueDashBoard"],0));(Ext.cmd.derive("MBilling.store.QueueMember",Ext.data.Store,{model:"MBilling.model.QueueMember"},0,0,0,0,0,0,[MBilling.store,"QueueMember"],0));(Ext.cmd.derive("MBilling.store.QueueMemberDashBoard",Ext.data.Store,{model:"MBilling.model.QueueMemberDashBoard",remoteSort:false},0,0,0,0,0,0,[MBilling.store,"QueueMemberDashBoard"],0));(Ext.cmd.derive("MBilling.store.Rate",Ext.data.Store,{model:"MBilling.model.Rate"},0,0,0,0,0,0,[MBilling.store,"Rate"],0));(Ext.cmd.derive("MBilling.store.RateCallshop",Ext.data.Store,{model:"MBilling.model.RateCallshop"},0,0,0,0,0,0,[MBilling.store,"RateCallshop"],0));(Ext.cmd.derive("MBilling.store.Refill",Ext.data.Store,{model:"MBilling.model.Refill"},0,0,0,0,0,0,[MBilling.store,"Refill"],0));(Ext.cmd.derive("MBilling.store.RefillChart",Ext.data.Store,{model:"MBilling.model.RefillChart"},0,0,0,0,0,0,[MBilling.store,"RefillChart"],0));(Ext.cmd.derive("MBilling.store.Refillprovider",Ext.data.Store,{model:"MBilling.model.Refillprovider"},0,0,0,0,0,0,[MBilling.store,"Refillprovider"],0));(Ext.cmd.derive("MBilling.store.RestrictedPhonenumber",Ext.data.Store,{model:"MBilling.model.RestrictedPhonenumber"},0,0,0,0,0,0,[MBilling.store,"RestrictedPhonenumber"],0));(Ext.cmd.derive("MBilling.store.SendCreditProducts",Ext.data.Store,{model:"MBilling.model.SendCreditProducts"},0,0,0,0,0,0,[MBilling.store,"SendCreditProducts"],0));(Ext.cmd.derive("MBilling.store.SendCreditRates",Ext.data.Store,{model:"MBilling.model.SendCreditRates"},0,0,0,0,0,0,[MBilling.store,"SendCreditRates"],0));(Ext.cmd.derive("MBilling.store.SendCreditSummary",Ext.data.Store,{model:"MBilling.model.SendCreditSummary"},0,0,0,0,0,0,[MBilling.store,"SendCreditSummary"],0));(Ext.cmd.derive("MBilling.store.Servers",Ext.data.Store,{model:"MBilling.model.Servers"},0,0,0,0,0,0,[MBilling.store,"Servers"],0));(Ext.cmd.derive("MBilling.store.Services",Ext.data.Store,{model:"MBilling.model.Services"},0,0,0,0,0,0,[MBilling.store,"Services"],0));(Ext.cmd.derive("MBilling.store.ServicesUse",Ext.data.Store,{model:"MBilling.model.ServicesUse"},0,0,0,0,0,0,[MBilling.store,"ServicesUse"],0));(Ext.cmd.derive("MBilling.store.Sip",Ext.data.Store,{model:"MBilling.model.Sip"},0,0,0,0,0,0,[MBilling.store,"Sip"],0));(Ext.cmd.derive("MBilling.store.Sip2",Ext.data.Store,{model:"MBilling.model.Sip2"},0,0,0,0,0,0,[MBilling.store,"Sip2"],0));(Ext.cmd.derive("MBilling.store.SipTrace",Ext.data.Store,{model:"MBilling.model.SipTrace"},0,0,0,0,0,0,[MBilling.store,"SipTrace"],0));(Ext.cmd.derive("MBilling.store.Sipuras",Ext.data.Store,{model:"MBilling.model.Sipuras"},0,0,0,0,0,0,[MBilling.store,"Sipuras"],0));(Ext.cmd.derive("MBilling.store.Sms",Ext.data.Store,{model:"MBilling.model.Sms"},0,0,0,0,0,0,[MBilling.store,"Sms"],0));(Ext.cmd.derive("MBilling.store.Smtps",Ext.data.Store,{model:"MBilling.model.Smtps"},0,0,0,0,0,0,[MBilling.store,"Smtps"],0));(Ext.cmd.derive("MBilling.store.TemplateMail",Ext.data.Store,{model:"MBilling.model.TemplateMail"},0,0,0,0,0,0,[MBilling.store,"TemplateMail"],0));(Ext.cmd.derive("MBilling.store.Trunk",Ext.data.Store,{model:"MBilling.model.Trunk"},0,0,0,0,0,0,[MBilling.store,"Trunk"],0));(Ext.cmd.derive("MBilling.store.User",Ext.data.Store,{model:"MBilling.model.User"},0,0,0,0,0,0,[MBilling.store,"User"],0));(Ext.cmd.derive("MBilling.store.UserRate",Ext.data.Store,{model:"MBilling.model.UserRate"},0,0,0,0,0,0,[MBilling.store,"UserRate"],0));(Ext.cmd.derive("MBilling.store.Voucher",Ext.data.Store,{model:"MBilling.model.Voucher"},0,0,0,0,0,0,[MBilling.store,"Voucher"],0));(Ext.cmd.derive("Ext.ux.Alert",Ext.Base,{msgAlert:null,mapTypeMsg:{notification:{glyph:"spam",color:"rgb(163, 160, 160)"},information:{glyph:"info2",color:"#8AAFC5"},success:{glyph:"ok-circled",color:"#59B53A"},warning:{glyph:"warning",color:"#C4B700"},error:{glyph:"spam",color:"#DC4E3D"}},alert:function(y,N,O,M,L,C,E,K){K=Ext.isDefined(K)?K:true;var B=this,J={},F,x,J,P,G=Ext.Boot.platformTags.desktop?"11px":"15px",I=Ext.Boot.platformTags.desktop?"16px":"17px",A=Ext.Boot.platformTags.desktop?"14px":"17px",D=Ext.Boot.platformTags.desktop?"13px":"15px",z=K?Ext.String.format('&#{1}',B.mapTypeMsg[O].color,icons[E||B.mapTypeMsg[O].glyph],I):"",H=K?'

'+y+"

":'

'+y+"

";format=N||"";L=Ext.isDefined(L)?L:!M&&(O!=="error");M=Ext.isDefined(M)?M:!L;P=M?'
':"";if(!B.msgAlert){B.msgAlert=Ext.core.DomHelper.insertFirst(Ext.getBody(),{cls:"alert-box"},true)}F=Ext.String.format.apply(String,Array.prototype.slice.call(arguments,1));x=['',"","",'","",'","","",'","","","
',z,"",H,"',P,"

',F,"

"];J=Ext.core.DomHelper.append(B.msgAlert,x,true);if(M){J.el.down(".close").on("click",function(){J.ghost("t",{remove:true})},B)}L&&J.ghost("t",{delay:C||3000,remove:true})}},0,0,0,0,0,0,[Ext.ux,"Alert"],function(){Ext.ns("Ext.ux");Ext.ux.Alert=new this()}));(Ext.cmd.derive("Ext.ux.form.field.MarkAllowBlank",Ext.AbstractPlugin,{init:function(d){var c=this;c.component=d;c.component.setAllowBlank=c.setAllowBlank;c.component.on("afterrender",function(){c.setAllowBlank(c.component.allowBlank)})},setAllowBlank:function(f){var g=this,j=g.component||g,e=f?{"border-right":"0px"}:{"border-right":"1px solid red","padding-right":"1px"};j.allowBlank=f;if(!Ext.isEmpty(j.labelEl)){j.labelEl.setStyle(e)}}},0,0,0,0,["plugin.markallowblank"],0,[Ext.ux.form.field,"MarkAllowBlank"],0));(Ext.cmd.derive("Ext.ux.button.Locale",Ext.button.Split,{handler:function(){this.showMenu()},supportLang:["pt_BR","en","es","fr","it"],iconCls:"flag-"+window.lang,initComponent:function(){var b=this;b.menu=[{text:t("English"),iconCls:"flag-en",scope:b,handler:b.setLocale},{text:t("Franch"),iconCls:"flag-fr",scope:b,handler:b.setLocale},{text:t("Italy"),iconCls:"flag-it",scope:b,handler:b.setLocale},{text:t("Spanish"),iconCls:"flag-es",scope:b,handler:b.setLocale},{text:t("Portuguese"),iconCls:"flag-pt_BR",scope:b,handler:b.setLocale}];Ext.button.Split.prototype.initComponent.apply(this,arguments)},setLocale:function(j){var e=this,f=j.iconCls,g=f.replace("flag-","");if(e.iconCls===f){return}e.setIconCls(f);localStorage&&localStorage.setItem("lang",g);window.location.reload()}},0,["locale"],["component","box","button","splitbutton","locale"],{component:true,box:true,button:true,splitbutton:true,locale:true},["widget.locale"],0,[Ext.ux.button,"Locale"],0));(Ext.cmd.derive("Ext.ux.button.Credit",Ext.Button,{height:window.isThemeNeptune?21:20,iconCls:"icon-add-credit",initComponent:function(){var b=this;if(!App.user.isAdmin){b.text=App.user.currency+" "+Ext.util.Format.number(App.user.credit,"0.00");Ext.Ajax.request({url:"index.php/user/credit",params:{id:App.user.id},success:function(a){a=Ext.decode(a.responseText);App.user.credit=a.rows.credit;b.setText(App.user.currency+" "+Ext.util.Format.number(App.user.credit,"0.00"))}});b.handler=setInterval(function(){Ext.Ajax.request({url:"index.php/user/credit",params:{id:App.user.id},success:function(a){a=Ext.decode(a.responseText);App.user.credit=a.rows.credit;b.setText(App.user.currency+" "+Ext.util.Format.number(App.user.credit,"0.00"))}})},15000)}else{b.hidden=true}Ext.button.Button.prototype.initComponent.apply(this,arguments)}},0,["credit"],["component","box","button","credit"],{component:true,box:true,button:true,credit:true},["widget.credit"],0,[Ext.ux.button,"Credit"],0));(Ext.cmd.derive("Ext.ux.data.proxy.Ajax",Ext.data.proxy.Ajax,{simpleSortMode:true,type:"ajax",baseUrl:"index.php",actionRead:"read",actionCreate:"save",actionUpdate:"save",actionDestroy:"destroy",actionReport:"report",actionCsv:"csv",actionFromCsv:"importFromCsv",actionDestroyReport:"destroyReport",reader:{type:"json",rootProperty:"rows",successProperty:"success",totalProperty:"count"},writer:{type:"json",rootProperty:"rows",writeAllFields:false,encode:true},constructor:function(){var c=this,d;Ext.data.proxy.Ajax.prototype.constructor.apply(this,arguments);d=c.config.module;if(!Ext.Object.getValues(c.api).length){c.api.read=c.baseUrl+"/"+d+"/"+c.actionRead;c.api.create=c.baseUrl+"/"+d+"/"+c.actionCreate;c.api.update=c.baseUrl+"/"+d+"/"+c.actionUpdate;c.api.destroy=c.baseUrl+"/"+d+"/"+c.actionDestroy;c.api.report=c.baseUrl+"/"+d+"/"+c.actionReport;c.api.csv=c.baseUrl+"/"+d+"/"+c.actionCsv;c.api.fromCsv=c.baseUrl+"/"+d+"/"+c.actionFromCsv;c.api.destroyReport=c.baseUrl+"/"+d+"/"+c.actionDestroyReport}}},1,0,0,0,["proxy.uxproxy"],0,[Ext.ux.data.proxy,"Ajax"],0));(Ext.cmd.derive("MBilling.view.main.SetUserData",Ext.window.Window,{controller:"main",glyph:icons.lock,title:t("Set the basic configuration"),autoShow:true,closable:false,resizable:false,draggable:false,width:350,bodyPadding:5,defaultType:"textfield",layout:"anchor",defaults:{labelAlign:"right",anchor:"0",allowBlank:false,msgTarget:"side",enableKeyEvents:true,plugins:"markallowblank"},initComponent:function(){var b=this;b.items=[{vtype:"textfield",fieldLabel:t("Email"),reference:"email",labelWidth:100,allowBlank:false,vtype:"email",value:App.user.email=="info@magnusbilling.com"?"":App.user.email,hidden:!b.email},{xtype:"textfield",reference:"currency",fieldLabel:t("Currency"),labelWidth:100,allowBlank:false,value:App.user.currency==0?"":App.user.currency,hidden:!b.currency},{xtype:"countryisocombo",reference:"countryiso",fieldLabel:t("country"),labelWidth:100,allowBlank:false,value:App.user.base_country.length!=3?"USA":App.user.base_country,hidden:!b.country}];b.bbar=[{text:t("Save"),reference:"saveButton",glyph:icons.enter,width:100,handler:"onSetData"}];Ext.window.Window.prototype.initComponent.apply(this,arguments)}},0,["setuserdata"],["component","box","container","panel","window","setuserdata"],{component:true,box:true,container:true,panel:true,window:true,setuserdata:true},["widget.setuserdata"],0,[MBilling.view.main,"SetUserData"],0));(Ext.cmd.derive("MBilling.view.main.MainController",Ext.app.ViewController,{msgLogout:t("Do you really want to leave the system?"),textLogout:t("Exit"),titleWarning:t("Warning"),msgFieldsRequired:t("Fill in the fields correctly."),init:function(){var b=this;b.runnerInfoSystem=Ext.create("Ext.util.TaskRunner");Ext.app.ViewController.prototype.init.apply(this,arguments);App.callLogout=b.callLogout},loadMenuStandard:function(menu){var me=this,modules=[],menuText,text,iconCls;menu.setLoading();Ext.each(App.user.menu,function(menuItem){if(!Ext.isEmpty(menuItem.rows)){Ext.each(menuItem.rows,function(item){text=(item.text.indexOf("t(")!==-1)?eval(item.text):item.text;modules.push({text:text,iconCls:window.isTablet||window.isTablets?"":item.iconCls,module:item.module,leaf:item.leaf,children:me.formatSubModuleStandard(item.rows),action:item.action})},me)}menuText=(menuItem.text.indexOf("t(")!==-1)?eval(menuItem.text):menuItem.text;iconCls=menuItem.iconCls||"file3";if(window.isTablets){menu.add({rootVisible:true,root:{text:menuText,children:modules}})}else{menu.add({title:menuText,root:{children:modules},iconCls:menuItem.iconCls})}modules=[]},me);menu.setLoading(false)},formatSubModuleStandard:function(menu){var me=this,text;Ext.each(menu,function(item){text=(item.text.indexOf("t(")!==-1)?eval(item.text):item.text;item.text=text;item.children=me.formatSubModuleStandard(item.rows)},me);return menu},createTabStandard:function(o,q){var p=this,x,w,v,u,s=q.get("text"),n=q.get("iconCls")||"file3",r=p.lookupReference("tabPanelCenter");if(q.get("leaf")){x=r.items.findBy(function(a){return a.title===s});if(!x){w=q.get("module");v=q.get("action");u=Ext.isDefined(v);r.add({title:s,autoDestroy:true,closable:true,iconCls:n,xtype:w+"module",module:w,titleModule:s,allowCreate:u?v.search("c")!==-1:false,allowUpdate:u?v.search("u")!==-1:false,allowDelete:u?v.search("d")!==-1:false}).show()}else{r.setActiveTab(x)}}},importLogo:function(d){var c=this;if(c.winLogo&&c.winLogo.isVisible()){return}c.winLogo=Ext.widget("importlogo",{title:d.text,glyph:d.glyph})},saveLogo:function(){var l=this,g=l.getView(),n=l.lookupReference("saveImportLogo"),j=l.lookupReference("formImportLogo"),m=j.getForm().findField("logo"),o=Ext.apply(j.getValues(),{formImportLogo:m.getValue()});if(!j.isValid()){Ext.ux.Alert.alert(g.titleWarning,g.msgFormInvalid,"warning");return}n.disable();j.setLoading();j.getForm().submit({url:window.isDesktop?"index.php/authentication/importWallpapers":"index.php/authentication/importLogo",params:o,success:function(c,b){var a=Ext.decode(b.response.responseText);if(a.success){Ext.ux.Alert.alert(l.titleSuccess,t(a.msg),"success")}else{errors=Helper.Util.convertErrorsJsonToString(a.msg);if(!Ext.isObject(a.errors)){Ext.ux.Alert.alert(l.titleError,errors,"error")}else{Ext.ux.Alert.alert(l.titleWarning,l.msgFormInvalid,"warning")}}j.setLoading(false);n.enable()}})},onSetData:function(m){var l=this,j=l.getView(),o=l.lookupReference("email"),n=l.lookupReference("countryiso"),g=l.lookupReference("currency");if(!o.isValid()||!n.isValid()||!g.isValid()){Ext.ux.Alert.alert(l.titleWarning,t("Fill in the fields correctly."),"warning");return false}j.setLoading(l.msgAuthenticating);Ext.Ajax.request({url:"index.php/configuration/setData",params:{email:o.getValue(),countryiso:n.getValue(),currency:g.getValue()},success:function(a){a=Ext.decode(a.responseText);if(a.success){j.setLoading(l.msgEnteringInSystem);j.setLoading(false);j.close();Ext.ux.Alert.alert(l.msgWelcome,a.msg,"information");App.user.email=o.getValue();App.user.base_country=n.getValue();App.user.currency=g.getValue()}else{Ext.ux.Alert.alert(l.titleErrorInAuthentication,a.msg,"error");fieldUser.focus(true);j.setLoading(false)}}})},openHelp:function(d){var c=this;if(c.winHelp&&c.winHelp.isVisible()){return}c.winHelp=Ext.widget("window",{title:d.text,glyph:d.glyph,autoShow:true,width:800,height:450,layout:"fit",border:false,items:{xtype:"help"}})},openChangePassword:function(d){var c=this;if(c.winChangePassword&&c.winChangePassword.isVisible()){return}c.winChangePassword=Ext.widget("changepassword",{title:d.text,glyph:d.glyph})},openAbout:function(d){var c=this;if(c.winAbout&&c.winAbout.isVisible()){return}c.winAbout=Ext.widget("about",{title:d.text,glyph:d.glyph})},openSettings:function(d){var c=this;if(c.winSettings&&c.winSettings.isVisible()){return}c.winSettings=Ext.widget("window",{title:d.text,glyph:d.glyph,autoShow:true,width:900,height:520,layout:"fit",border:false,items:{xtype:"settings"}})},logout:function(){var b=this;Ext.Msg.confirm(b.textLogout,b.msgLogout,function(a){if(a==="yes"){b.callLogout()}})},callLogout:function(){var b=this;window.isDesktop?App.desktop.setLoading():App.mainView.setLoading();Ext.Ajax.request({url:"index.php/authentication/logoff",success:function(){App.user.logged=false;location.reload()}})},getManual:function(d,e){if(!e.get("leaf")){return}var f=this.lookupReference("manualPanel");f.getLoader().url=e.get("url");f.getLoader().load()},stopStatusBar:function(f,e){var d=this;if(e.xtype!=="dashboard"){d.runnerInfoSystem.stopAll()}else{d.runnerInfoSystem.start({run:d.setInfoSystem,interval:5000,scope:d})}},setRunnerInfoSystem:function(){var b=this;if(!App.user.isAdmin||window.isTablets){return}this.lookupReference("statusBar").show();b.runnerInfoSystem.start({run:b.setInfoSystem,interval:7000,scope:b})},setInfoSystem:function(){var b=this;Ext.Ajax.request({url:"index.php/statusSystem/statusSystem",success:function(a){a=Ext.decode(a.responseText);b.lookupReference("avgCpuCount").setText(a.rows.cpuCount);b.lookupReference("avgCpuModel").setText(a.rows.cpuModel);b.lookupReference("avgCpuMediaUso").setText(a.rows.cpuMediaUso);b.lookupReference("avgCpuPercent").setText(a.rows.cpuPercent);b.lookupReference("avgMemTotal").setText(a.rows.memTotal);b.lookupReference("avgMemUsed").setText(a.rows.memUsed);b.lookupReference("avgNetworkin").setText(a.rows.networkin);b.lookupReference("avgNetworkout").setText(a.rows.networkout);b.lookupReference("avgUptime").setText(a.rows.uptime)}})},saveForgetPass:function(n){var m=this,l=m.getView(),g=m.lookupReference("email"),o=m.lookupReference("captcha"),j=g.getValue();if(!g.isValid()||!window.captcha){Ext.ux.Alert.alert(m.titleWarning,m.msgFieldsRequired,"warning");return false}l.setLoading(m.msgAuthenticating);Ext.Ajax.request({url:"index.php/authentication/forgetPassword",params:{email:j},success:function(a){a=Ext.decode(a.responseText);if(a.success){l.setLoading(false);l.close();Ext.ux.Alert.alert(t("Success"),a.msg,"information")}else{Ext.ux.Alert.alert(t("Error"),a.msg,"error");l.setLoading(false)}}})}},0,0,0,0,["controller.main"],0,[MBilling.view.main,"MainController"],0));(Ext.cmd.derive("MBilling.view.main.GoogleAuthenticator",Ext.window.Window,{controller:"googleauthenticator",glyph:icons.lock,title:t("Please enter Google Authenticator code"),autoShow:true,closable:false,resizable:false,draggable:false,bodyPadding:5,width:350,defaultType:"textfield",layout:"anchor",listeners:{scope:"controller",show:"onShowLogin"},defaults:{labelAlign:"right",labelWidth:140,anchor:"0",allowBlank:false,msgTarget:"side",enableKeyEvents:true,plugins:"markallowblank"},initComponent:function(){var c=this;c.height=c.newKey||c.showGoogleCode?320:140;var d=c.keyGoogle.split("secret%");c.items=[{vtype:"numberfield",labelWidth:160,fieldLabel:t("ONE TIME PASSWORD"),reference:"oneCode",inputAttrTpl:" data-qtip='Provider the current code generated by your Google Authenticator App' ",minLength:6,maxLength:6},{xtype:"fieldcontainer",layout:"hbox",defaults:{xtype:"textfield",labelAlign:"right",flex:1},hidden:!c.newKey&&!c.showGoogleCode,items:[{fieldLabel:t("Scan this code"),xtype:"displayfield"},{xtype:"image",height:130,src:c.keyGoogle,inputAttrTpl:" data-qtip='Scan this code. or use the code below using your phone!' "}]},{fieldLabel:t("Manual Code"),xtype:"displayfield",value:d[1],inputAttrTpl:" data-qtip='If you have a problem with scaning the QR code enter this code manually into the app!' ",allowBlank:true,hidden:!c.newKey&&!c.showGoogleCode},{xtype:"displayfield",value:'           '+t("Download APP")+"          ",allowBlank:true,hidden:!c.newKey&&!c.showGoogleCode},{fieldLabel:t("Code Name"),xtype:"displayfield",value:"VoIP-"+c.username+"-"+c.userId,allowBlank:true}];c.bbar=[{text:t("Cancel"),reference:"cancelButton",width:90,tooltip:t("Back to Login form"),glyph:icons.exit,handler:"onLogout"},{text:t("Login"),reference:"loginButton",width:120,tooltip:t("Login in System"),glyph:icons.enter,handler:"onGoogleAuthenticator"},{fieldLabel:"",xtype:"displayfield",value:"    "+t("Backup this code or image")+"      ",allowBlank:true,hidden:!c.newKey&&!c.showGoogleCode}];Ext.window.Window.prototype.initComponent.apply(this,arguments)}},0,["googleauthenticator"],["component","box","container","panel","window","googleauthenticator"],{component:true,box:true,container:true,panel:true,window:true,googleauthenticator:true},["widget.googleauthenticator"],0,[MBilling.view.main,"GoogleAuthenticator"],0));(Ext.cmd.derive("MBilling.view.main.ForgetPassword",Ext.window.Window,{controller:"main",title:t("Forgotten your password?"),resizable:true,autoShow:true,width:322,height:!Ext.Boot.platformTags.desktop?230:window.isThemeNeptune?200:window.isThemeCrisp?185:200,titleWarning:t("Warning"),titleError:t("Error"),titleSuccess:t("Success"),titleConfirmation:t("Confirmation"),msgFormInvalid:t("Fill in the fields correctly."),listeners:{scope:"controller"},y:55,items:{xtype:"form",reference:"formChangePass",border:false,layout:"anchor",bodyPadding:5,defaults:{enableKeyEvents:true,allowBlank:false,msgTarget:"side"},items:[{xtype:"textfield",name:"email",vtype:"email",reference:"email",maxLength:100,inputType:"email",hideLabel:true,emptyText:t("Your")+" "+t("Email"),anchor:"0"},{xtype:"box",id:"myCaptcha",name:"captcha",reference:"captcha",listeners:{afterrender:function(){grecaptcha.render("myCaptcha",{sitekey:window.reCaptchaKey,callback:function(b){window.captcha=true}})}}}]},bbar:["->",{text:t("Send"),width:80,reference:"saveForgetPass",glyph:icons.disk,handler:"saveForgetPass"}]},0,["forgetPassword"],["component","box","container","panel","window","forgetPassword"],{component:true,box:true,container:true,panel:true,window:true,forgetPassword:true},["widget.forgetPassword"],0,[MBilling.view.main,"ForgetPassword"],0));(Ext.cmd.derive("MBilling.view.main.Login",Ext.window.Window,{controller:"login",glyph:icons.lock,title:t("Authentication"),autoShow:true,closable:false,resizable:false,draggable:false,width:window.isThemeTriton?390:330,height:!Ext.Boot.platformTags.desktop?190:window.isThemeNeptune?170:window.isThemeCrisp?170:window.isThemeTriton?210:150,bodyPadding:5,defaultType:"textfield",layout:"anchor",listeners:{scope:"controller",show:"onShowLogin"},defaults:{labelAlign:"right",labelWidth:95,anchor:"0",allowBlank:false,msgTarget:"side",enableKeyEvents:true,plugins:"markallowblank"},initComponent:function(){var b=this;b.items=[{fieldLabel:t("User")+"/"+t("Email"),reference:"user"},{fieldLabel:t("Password"),inputType:"password",reference:"password"},{hidden:window.reCaptchaKey.length<15,xtype:"component",margin:"10 0 0 0",autoEl:{tag:"div",html:t("Forgotten your password?")+" "+t("Click here")+"!"},listeners:{render:function(a){a.getEl().on({click:function(){Ext.widget("forgetPassword")}})}}}];b.bbar=[{xtype:"locale"},"->",{hidden:window.reCaptchaKey.length<15,text:t("Signup"),width:window.lang=="pt_BR"?100:80,reference:"signupButton",tooltip:t("Signup in System"),glyph:icons.enter,handler:function(){window.location="index.php/signup/add"}},{text:t("Login"),width:80,reference:"loginButton",tooltip:t("Login in System"),glyph:icons.enter,handler:"onLogin"}];Ext.window.Window.prototype.initComponent.apply(this,arguments)}},0,["login"],["component","box","container","panel","window","login"],{component:true,box:true,container:true,panel:true,window:true,login:true},["widget.login"],0,[MBilling.view.main,"Login"],0));(Ext.cmd.derive("MBilling.view.main.Main",Ext.container.Viewport,{layout:"border",controller:"main",initComponent:function(){var b=this;b.items=[{region:"north",border:false,reference:"header",dockedItems:[{xtype:"toolbar",items:[{xtype:"image",src:window.logo,height:45,hidden:window.isTablet||window.isTablets},"->",{xtype:"credit",width:"120px"},{xtype:"locale",hidden:window.isTablets||window.isTable},"-",{xtype:"splitbutton",scale:window.isTablet||window.isTablets?"small":"medium",iconAlign:"top",glyph:window.isTablet||window.isTablets?"":icons.user,handler:function(){this.showMenu()},text:b.user,menu:[{handler:"openChangePassword",iconCls:"icon-change-password",text:t("changePassword"),hidden:!App.user.isAdmin},{text:t("Import Logo"),glyph:icons.cog,handler:"importLogo",hidden:!App.user.isAdmin||window.isTablet||window.isTablets},{text:t("Settings")+" "+t("Theme"),glyph:icons.cog,handler:"openSettings",hidden:!App.user.isAdmin||window.isTablet||window.isTablets},{text:t("About"),glyph:icons.info,handler:"openAbout",hidden:window.isTablets||App.user.l.slice(4,7)=="syn"},"-",{glyph:icons.exit,text:t("Exit"),handler:"logout"}]}]}]},{reference:"tabPanelMenu",region:"west",title:t("Menu"),width:window.isTablet||window.isTablets?215:200,minWidth:150,maxWidth:400,split:true,collapsible:true,collapsed:false,layout:window.isTablet||window.isTablets?"":"accordion",defaultType:"treepanel",header:window.isTablet||window.isTablets||window.isThemeTriton?false:true,autoScroll:true,defaults:{animFloat:false,border:false,autoScroll:window.isTablet||window.isTablets?false:true,rootVisible:false,listeners:{itemclick:"createTabStandard"}},listeners:{render:"loadMenuStandard"}},{region:"center",xtype:"tabpanel",reference:"tabPanelCenter",listeners:{tabchange:"stopStatusBar"},items:[{hidden:window.isTablets,xtype:"dashboardmodule",listeners:{activate:"setRunnerInfoSystem"},glyph:icons.home,title:t("Home"),stateful:false,dockedItems:{xtype:"toolbar",dock:"bottom",reference:"statusBar",hidden:true,defaults:{handleMouseEvents:false},items:[{reference:"avgCpuCount",iconCls:"icon-processor",tooltip:t("cpuCount")},{reference:"avgCpuModel",tooltip:t("cpuModel")},"-",{reference:"avgCpuMediaUso",iconCls:"icon-processor",tooltip:t("averageCpuUsage"),width:80},"-",{reference:"avgCpuPercent",iconCls:"icon-processor",tooltip:t("cpupercent"),width:80},"-",{reference:"avgMemTotal",iconCls:"icon-memory",tooltip:t("memTotal"),width:80},"-",{reference:"avgMemUsed",iconCls:"icon-memory",tooltip:t("memUsed"),width:80},"-",{reference:"avgNetworkin",iconCls:"icon-networkIn",tooltip:t("networkIn"),width:90},"-",{reference:"avgNetworkout",iconCls:"icon-networkOut",tooltip:t("networkOut"),width:90},"-",{reference:"avgUptime",iconCls:"icon-uptime",tooltip:t("uptime"),width:150}]},items:[{xtype:"dashboardmodule"}]}]}];Ext.container.Viewport.prototype.initComponent.apply(this,arguments)}},0,["main"],["component","box","container","viewport","main"],{component:true,box:true,container:true,viewport:true,main:true},["widget.main"],0,[MBilling.view.main,"Main"],0));(Ext.cmd.derive("MBilling.view.main.Desktop",Ext.ux.desktop.App,{},0,["maindesktop"],["maindesktop"],{maindesktop:true},["widget.maindesktop"],0,[MBilling.view.main,"Desktop"],0));(Ext.cmd.derive("MBilling.view.main.Help",Ext.container.Container,{controller:"main",layout:"border",items:[{xtype:"treepanel",region:"west",store:"Help",rootVisible:false,border:true,width:220,listeners:{itemclick:"getManual"}},{region:"center",reference:"manualPanel",autoScroll:true,bodyPadding:5,loader:{url:"resources/help/"+window.lang+"/home.html",autoLoad:true}}]},0,["help"],["component","box","container","help"],{component:true,box:true,container:true,help:true},["widget.help"],0,[MBilling.view.main,"Help"],0));(Ext.cmd.derive("MBilling.view.main.Settings",Ext.container.Container,{controller:"settings",layout:"border",titleMenuLayout:t("Layout"),titlePreview:t("Preview"),titleMenuTheme:t("Theme"),textApply:t("Apply"),defaultLayout:"standard",iconApply:icons.checkmark,pathScreens:"resources/images/themes/screens/",reloadSystemText:t("Reload System"),msgReloadSystem:t("Want to reload the system to apply the layout?"),changeLayoutTitle:t("Change Layout"),changeLayoutText:t("The new layout will be applied the next time the system is loaded"),defaultTheme:"blue-crisp",msgReloadSystemTheme:t("Want to reload the system to apply the theme?"),changeThemeTitle:t("Change Theme"),changeThemeText:t("The new theme will be applied the next time the system is loaded"),titleMenuWallpaper:t("Wallpaper"),textNone:t("None"),iconClsNone:"icon-none",labelCheckFit:t("Fit"),pathWallpaper:"",wallpapers:[{text:t("Yellow"),src:"Amarelo",iconCls:"icon-yellow"},{text:t("Blue"),src:"Azul",iconCls:"icon-blue"},{text:t("Gray"),src:"Cinza",iconCls:"icon-gray"},{text:t("Orange"),src:"Laranja",iconCls:"icon-orange"},{text:t("Mountain"),src:"Montanhas",iconCls:"icon-mountain"},{text:t("Night"),src:"Noite",iconCls:"icon-night"},{text:t("Purple"),src:"Roxo",iconCls:"icon-purple"},{text:t("Green"),src:"Verde",iconCls:"icon-green"},{text:t("Red"),src:"Vermelho",iconCls:"icon-red"},{text:t("Customization"),src:"Customization",iconCls:"icon-none"}],themes:[{text:t("Yellow"),css:"yellow-classic",iconCls:"icon-yellow"},{text:t("Yellow")+" Neptune",css:"yellow-neptune",iconCls:"icon-yellow"},{text:t("Yellow")+" Crisp",css:"yellow-crisp",iconCls:"icon-yellow"},{text:t("Yellow")+" Triton",css:"yellow-triton",iconCls:"icon-yellow"},{text:t("Blue"),css:"blue-classic",iconCls:"icon-blue"},{text:t("Blue")+" Neptune",css:"blue-neptune",iconCls:"icon-blue"},{text:t("Blue")+" Crisp",css:"blue-crisp",iconCls:"icon-blue"},{text:t("Blue")+" Triton",css:"blue-triton",iconCls:"icon-blue"},{text:t("Gray")+" Neptune",css:"gray-neptune",iconCls:"icon-gray"},{text:t("Gray")+" Crisp",css:"gray-crisp",iconCls:"icon-gray"},{text:t("Gray")+" Triton",css:"gray-triton",iconCls:"icon-gray"},{text:t("Orange"),css:"orange-classic",iconCls:"icon-orange"},{text:t("Orange")+" Neptune",css:"orange-neptune",iconCls:"icon-orange"},{text:t("Orange")+" Crisp",css:"orange-crisp",iconCls:"icon-orange"},{text:t("Orange")+" Triton",css:"orange-triton",iconCls:"icon-orange"},{text:t("Purple"),css:"purple-classic",iconCls:"icon-purple"},{text:t("Purple")+" Neptune",css:"purple-neptune",iconCls:"icon-purple"},{text:t("Purple")+" Crisp",css:"purple-crisp",iconCls:"icon-purple"},{text:t("Purple")+" Triton",css:"purple-triton",iconCls:"icon-purple"},{text:t("Green"),css:"green-classic",iconCls:"icon-green"},{text:t("Green")+" Neptune",css:"green-neptune",iconCls:"icon-green"},{text:t("Green")+" Crisp",css:"green-crisp",iconCls:"icon-green"},{text:t("Green")+" Triton",css:"green-triton",iconCls:"icon-green"},{text:t("Red"),css:"red-classic",iconCls:"icon-red"},{text:t("Red")+" Neptune",css:"red-neptune",iconCls:"icon-red"},{text:t("Red")+" Crisp",css:"red-crisp",iconCls:"icon-red"},{text:t("Red")+" Triton",css:"red-triton",iconCls:"icon-red"}],layouts:[{text:t("Standard"),type:"standard",iconCls:"icon-wallpaper"}],initComponent:function(){var j=this,e=[{id:"settingstheme",text:t("Theme"),leaf:true,iconCls:"icon-theme"}],g=[{text:j.textNone,iconCls:j.iconClsNone,leaf:true}],f;if(window.isDesktop){j.selectedWallpaper=App.desktop.getWallpaper();j.stretchWallpaper=App.desktop.wallpaper.stretch;j.previewWallpaper=Ext.widget("wallpaper");j.previewWallpaper.setWallpaper(j.selectedWallpaper)}j.userLayout=(localStorage&&localStorage.getItem("layout"))||j.defaultLayout;j.userTheme=window.theme;Ext.each(j.layouts,function(a){if(a.type===j.userLayout){j.textUserLayout=a.text}a.leaf=true});Ext.each(j.themes,function(a){if(a.css===j.userTheme){j.textUserTheme=a.text}a.leaf=true});Ext.each(j.wallpapers,function(a){g.push({iconCls:a.iconCls,img:a.src,text:a.text,leaf:true})});window.isDesktop&&e.push({id:"settingswallpaper",text:t("Wallpaper"),leaf:true,iconCls:"icon-wallpaper"});f=[{reference:"settingstheme",items:[{xtype:"treepanel",border:false,title:j.titleMenuTheme,rootVisible:false,lines:false,autoScroll:true,width:!Ext.Boot.platformTags.desktop?200:150,region:"west",split:true,minWidth:100,listeners:{afterlayout:"selectInitTheme",select:"onSelectTheme"},root:{expanded:true,children:j.themes}},{border:false,region:"center",title:j.titlePreview,layout:"fit",items:{xtype:"image",reference:"imageTheme"}}],bbar:["->",{text:j.textApply,glyph:j.iconApply,handler:"savePreferenceTheme"}]}];window.isDesktop&&f.push({reference:"settingswallpaper",items:[{xtype:"treepanel",reference:"treeWallpaper",border:false,title:j.titleMenuWallpaper,rootVisible:false,lines:false,autoScroll:true,width:!Ext.Boot.platformTags.desktop?200:150,region:"west",split:true,minWidth:100,listeners:{afterrender:{fn:"selectInitWallpaper",delay:100},select:"onSelectWallpaper"},store:Ext.create("Ext.data.TreeStore",{fields:["img"],root:{text:"Wallpaper",expanded:true,children:g}})},{border:false,region:"center",hidden:true,title:j.titlePreview,layout:"fit",items:[j.previewWallpaper]}],bbar:[{xtype:"checkbox",checked:j.stretchWallpaper,listeners:{change:"onChangeStretchWallpaper"}},j.labelCheckFit,"->",{text:j.textApply,glyph:j.iconApply,handler:"applyWallpaper"}]});j.items=[{region:"west",width:220,border:true,layout:"accordion",defaultType:"treepanel",defaults:{border:false,rootVisible:false,lines:false},items:[{title:t("Preferences"),glyph:icons.wrench,listeners:{afterrender:"setDefaultMenuPreference",selectionchange:"callConfiguration"},root:{children:e}}]},{region:"center",reference:"settingsPanel",layout:"card",defaults:{border:!window.isThemeClassic,layout:"border"},items:f}];Ext.container.Container.prototype.initComponent.apply(this,arguments)}},0,["settings"],["component","box","container","settings"],{component:true,box:true,container:true,settings:true},["widget.settings"],0,[MBilling.view.main,"Settings"],0));(Ext.cmd.derive("MBilling.view.main.About",Ext.window.Window,{title:t("About"),resizable:false,autoShow:true,initComponent:function(){var b=this;b.html='
'+t("Developed by")+": MagnusBilling

"+t("Version")+": "+App.user.version+"

"+t("Site")+': www.magnusbilling.com

'+t("Contact")+': info@magnusbilling.com

© Copyright 2005-2018 - MagnusBilling
';Ext.window.Window.prototype.initComponent.apply(this,arguments)}},0,["about"],["component","box","container","panel","window","about"],{component:true,box:true,container:true,panel:true,window:true,about:true},["widget.about"],0,[MBilling.view.main,"About"],0));(Ext.cmd.derive("MBilling.view.main.ChangePassword",Ext.window.Window,{controller:"changepassword",title:t("Change Password"),resizable:false,autoShow:true,width:400,height:!Ext.Boot.platformTags.desktop?205:window.isThemeNeptune?165:window.isThemeCrisp?160:145,titleWarning:t("Warning"),titleError:t("Error"),titleSuccess:t("Success"),titleConfirmation:t("Confirmation"),msgFormInvalid:t("Fill in the fields correctly."),listeners:{scope:"controller",show:"onShowWinChangePass"},items:{xtype:"form",reference:"formChangePass",border:false,layout:"anchor",bodyPadding:5,defaults:{enableKeyEvents:true,allowBlank:false,msgTarget:"side",listeners:{keyup:"checkKeyEnterChangePass"}},items:[{xtype:"textfield",name:"current_password",maxLength:100,inputType:"password",hideLabel:true,emptyText:t("Current Password"),anchor:"0"},{xtype:"passwordfield",allowChange:false,styleFields:{},fieldLabel:t("New Password")}]},bbar:["->",{text:t("Save"),reference:"saveChangePass",glyph:icons.disk,handler:"savePassword"}]},0,["changepassword"],["component","box","container","panel","window","changepassword"],{component:true,box:true,container:true,panel:true,window:true,changepassword:true},["widget.changepassword"],0,[MBilling.view.main,"ChangePassword"],0));(Ext.cmd.derive("MBilling.view.main.ImportLogo",Ext.window.Window,{title:t("Import Logo"),controller:"main",resizable:false,autoShow:true,width:400,height:!Ext.Boot.platformTags.desktop?205:window.isThemeNeptune?165:window.isThemeCrisp?160:145,titleWarning:t("Warning"),titleError:t("Error"),titleSuccess:t("Success"),titleConfirmation:t("Confirmation"),msgFormInvalid:t("Fill in the fields correctly."),items:{xtype:"form",reference:"formImportLogo",border:false,layout:"anchor",bodyPadding:5,defaults:{enableKeyEvents:true,msgTarget:"side"},items:[{xtype:"uploadfield",fieldLabel:t("Select file"),emptyText:window.isDesktop?"Only JPG format":"Only PNG format",allowBlank:false,name:"logo",extAllowed:window.isDesktop?["jpg"]:["png"],anchor:"0"}]},bbar:["->",{text:t("Save"),reference:"saveImportLogo",glyph:icons.disk,handler:"saveLogo"}]},0,["importlogo"],["component","box","container","panel","window","importlogo"],{component:true,box:true,container:true,panel:true,window:true,importlogo:true},["widget.importlogo"],0,[MBilling.view.main,"ImportLogo"],0));(Ext.cmd.derive("Ext.ux.app.ViewController",Ext.app.ViewController,{msgWait:t("Wait..."),msgConfirmationDelete:t("Really delete the record(s) selected?"),titleSuccess:t("Success"),titleError:t("Error"),titleWarning:t("Warning"),titleConfirmation:t("Confirmation"),msgFormInvalid:t("Fill in the fields correctly."),titleReport:undefined,params:{},isSubmitForm:false,control:{"form field":{keyup:"onKeyUpField"}},msgConfirmation:t("confirmationDelete"),msgDeleteAll:t("confirmationDeleteAll"),nameSuccessRequest:"success",nameMsgRequest:"msg",init:function(){var b=this;b.titleReport=b.titleReport||t("Report of")+" "+b.type;Ext.app.ViewController.prototype.init.apply(this,arguments)},onRenderModule:function(){var d=this,e,f;d.list=d.lookupReference(d.type+"list");d.formPanel=d.lookupReference(d.type+"form");d.saveButton=d.lookupReference("save");d.updateLotButton=d.lookupReference("updateLot");d.updateLot=!App.user.isClient;d.store=d.list.store;e=d.store.model.idProperty;f=e.replace(/ /g,"").split(",");d.idProperty=f.length>1?f:e;d.store.on("write",d.onWriteStore,d);d.store.getProxy().on("exception",d.onErrorAction,d);d.list.on("afterdestroy",d.onAfterDestroy,d);d.formPanel.on("aftersave",d.onAfterSave,d)},onDestroyModule:function(){var b=this;b.store.un("write",b.onWriteStore,b);b.store.getProxy().un("exception",b.onErrorAction,b);b.list.un("afterdestroy",b.onAfterDestroy,b);b.formPanel.un("aftersave",b.onAfterSave,b)},onNew:function(){var b=this;b.setReadOnlyPkComposite(false);b.formPanel.getForm().reset();b.formPanel.setLoading(false);b.formPanel.idRecord=0;b.updateLotButton?b.updateLotButton.toggle(false):"";b.showHideFields();b.formPanel.expand();b.focusFirstField();b.formPanel.fireEvent("edit",b.formPanel)},onEdit:function(){var f=this,d=f.list.getSelectionModel().getSelection()[0],e=[];if(f.formHidden){return}if(!d){return}if(!Ext.isArray(f.idProperty)){e=d.get(f.idProperty)}else{Ext.each(f.idProperty,function(a){e.push(d.get(a))})}f.setReadOnlyPkComposite(true);f.formPanel.idRecord=e;f.formPanel.recordStore=d;f.formPanel.loadRecord(d);f.formPanel.setLoading(false);f.showHideFields("edit");f.formPanel.expand();f.focusFirstField();f.formPanel.fireEvent("edit",f.formPanel)},showHideFields:function(o){var m=this,g=m.formPanel.fieldsHideCreate||[],n=m.formPanel.fieldsHideEdit||[],l=m.formPanel.fieldsHideUpdateLot||[],j=m.formPanel.idRecord===0;if(!g.length&&!n.length&&!l.length){return}m.formPanel.getForm().getFields().each(function(a){if(g.indexOf(a.name)!==-1){a.setVisible(!j)}if(n.indexOf(a.name)!==-1){a.setVisible(j)}if(l.indexOf(a.name)!==-1){a.setVisible(true)}if(o=="edit"){if(n.indexOf(a.name)!==-1){a.setVisible(j)}}if(l.indexOf(a.name)!==-1&&m.formPanel.isUpdateLot){a.setVisible(!m.formPanel.isUpdateLot)}if(!a.isVisible()){if(a.allowBlank===false){a.setAllowBlank(true);a.originAllowBlank=false}}else{if(Ext.isDefined(a.originAllowBlank)){a.setAllowBlank(a.originAllowBlank);a.allowBlank=a.originAllowBlank}}})},onSave:function(){var s=this,y=s.formPanel.getForm(),u=y.getRecord()&&s.store.findRecord(s.idProperty,y.getRecord().getId(),0,false,false,true),r=y.getFieldValues(),p=s.updateLotButton&&s.updateLotButton.menu.down("menucheckitem[checked=true]").value,w=Ext.encode(s.list.filters.getFilterData()),z=[],o={},x={},v,q;Ext.apply(r,s.params);if(s.formPanel.idRecord){if(!s.list.allowUpdate){Ext.ux.Alert.alert(s.titleWarning,t("Edit disable"),"warning");s.saveButton.disable();return}}else{if(!s.list.allowCreate&&!s.formPanel.isUpdateLot){Ext.ux.Alert.alert(s.titleWarning,t("Create disable"),"warning");s.saveButton.disable();return}}if(!y.isValid()){Ext.ux.Alert.alert(s.titleWarning,s.msgFormInvalid,"warning");return}s.saveButton.disable();s.formPanel.setLoading(s.msgWait);if(s.formPanel.isUpdateLot){Ext.Object.each(r,function(b,a){if(!Ext.isEmpty(a)){v=s.formPanel.down("#moneyFieldLot"+b);if(v&&(v.down("#add").pressed||v.down("#remove").pressed||v.down("#percent").pressed)){q=v.down("field");buttonAdd=v.down("#add");buttonRemove=v.down("#remove");buttonPercent=v.down("#percent");if(!Ext.isEmpty(q.getValue())){x[b]={value:q.getValue(),isPercent:buttonPercent.pressed,isAdd:buttonAdd.pressed,isRemove:buttonRemove.pressed}}}else{if(v&&v.down("field").getValue()){x[b]=v.down("field").getValue()}else{if(!v){x[b]=a}}}}});if(!Ext.Object.getSize(x)){s.formPanel.setLoading(false);btn.enable();return}if(p==="all"){if(s.store.defaultFilter.length){Ext.apply(o,{defaultFilter:Ext.encode(s.store.defaultFilter)})}Ext.apply(o,{filter:w})}else{Ext.each(s.list.getSelectionModel().getSelection(),function(a){z.push(a.get(s.idProperty))});x[s.idProperty]=z}Ext.apply(o,{rows:Ext.encode(x)});Ext.Ajax.request({url:s.store.getProxy().api.update,params:o,scope:s,success:function(a){a=Ext.decode(a.responseText);if(a.success){Ext.ux.Alert.alert(s.titleSuccess,t(a.msg),"success");s.formPanel.fireEvent("aftersave",s.formPanel)}else{Ext.ux.Alert.alert(s.titleError,t(a.msg),"error")}s.formPanel.setLoading(false);s.saveButton.enable();s.updateLotButton.toggle(false);s.store.load()},failure:function(a){a=Ext.decode(a.responseText);Ext.ux.Alert.alert(s.titleError,t(a.msg),"error");s.formPanel.setLoading(false);s.saveButton.enable()}});return}if(!s.formPanel.idRecord){if(s.isSubmitForm===false){u=Ext.create(s.store.model.entityName);r[s.idProperty]=0;u.set(r);s.store.add(u)}else{s.submitForm("create");return}}else{if(s.isSubmitForm===false){y.getRecord().set(r);u.set(r);if(!s.store.getUpdatedRecords().length){s.saveButton.enable();s.formPanel.setLoading(false);return}}else{s.submitForm("update");return}}s.store.sync()},submitForm:function(e){var j=this,f=j.store,g=[];g[j.idProperty]=j.formPanel.idRecord;j.formPanel.add({xtype:"hiddenfield",name:j.idProperty,value:j.formPanel.idRecord});j.formPanel.getForm().submit({url:j.store.getProxy().api.create,params:g,scope:j,success:function(c,b){var a=Ext.decode(b.response.responseText);if(a.success){Ext.ux.Alert.alert(j.titleSuccess,t(a.msg),"success");j.formPanel.fireEvent("aftersave",j.formPanel,a.rows[0])}else{errors=Helper.Util.convertErrorsJsonToString(a.msg);if(!Ext.isObject(a.errors)){Ext.ux.Alert.alert(j.titleError,t(errors),"error")}else{c.markInvalid(a.errors);Ext.ux.Alert.alert(j.titleWarning,j.msgFormInvalid,"warning")}}j.formPanel.idRecord=a.rows[0][j.idProperty];j.store.load();j.formPanel.setLoading(false);j.saveButton.enable()},failure:function(d,c){var b=Ext.decode(c.response.responseText),a=Helper.Util.convertErrorsJsonToString(b.errors);if(!Ext.isObject(b.errors)){Ext.ux.Alert.alert(j.titleError,t(a),"error")}else{d.markInvalid(b.errors);Ext.ux.Alert.alert(j.titleWarning,t(a),"error")}j.formPanel.setLoading(false);j.saveButton.enable()}})},onCancel:function(){this.formPanel.collapse()},onSelectionChange:function(g,n){var m=this,l=m.lookupReference("delete"),o,j;l&&l.setDisabled(!n.length);if(m.updateLotButton){o=m.updateLotButton.menu.down("menucheckitem[value=selected]"),j=m.updateLotButton.menu.down("menucheckitem[value=all]");if(n.length<1){o.setChecked(false);o.disable();j.setChecked(true)}else{if(n.length&&j.checked){m.updateLotButton.toggle(false)}o.enable()}}},onDelete:function(l){var j=this,f,m=l.menu.down("menucheckitem[checked=true]").value;var g=(m==="all")?j.msgDeleteAll:j.msgConfirmation;if(!j.list.allowDelete){return}Ext.Msg.confirm(j.titleConfirmation,g,function(a){if(a==="yes"){f=j.list.getSelectionModel().getSelection(),idProperty=f.length&&f[0].idProperty,filters=j.list.filters.getFilterData();if(m==="all"){Ext.apply(filters,j.store.defaultFilter);filters=Ext.encode(filters);Ext.Ajax.request({url:j.store.getProxy().api.destroy,params:{filter:filters},success:function(c){c=Ext.decode(c.responseText);if(c.success){Ext.ux.Alert.alert(j.titleSuccess,c.msg,"success");j.formPanel.fireEvent("afterdestroy");j.store.load()}else{var b=Helper.Util.convertErrorsJsonToString(c.msg);Ext.ux.Alert.alert(j.titleError,b,"error");j.store.load()}}})}else{if(Ext.isArray(j.idProperty)){j.deleteCompositeKey(f)}else{j.store.remove(f);j.store.sync()}}}},j)},destroyCompositeKey:function(j){var g=this,e=[],f;j=Ext.isArray(j)?j:[j];Ext.each(j,function(a){f={};Ext.each(g.idProperty,function(b){f[b]=a.get(b)});e.push(Ext.clone(f))});Ext.Ajax.request({url:g.store.getProxy().api.destroy,params:{rows:Ext.encode(e)},success:function(a){a=Ext.decode(a.responseText);if(a.success){Ext.ux.Alert.alert(g.titleSuccess,a.msg,"success");g.list.fireEvent("afterdestroy",g.formPanel);g.store.load()}else{Ext.ux.Alert.alert(g.titleError,a.msg,"error")}}})},onCheckChangeUpdateLot:function(){this.updateLotButton.toggle(true)},onBulk:function(){var c=this,d=c.getView();Ext.widget(d.module+"bulk",{title:d.titleModule,list:c.list})},onSpyCall:function(){var c=this,d=c.getView();Ext.widget(d.module+"spycall",{title:d.titleModule,list:c.list})},onImportCsv:function(){var c=this,d=c.getView();Ext.widget(d.module+"importcsv",{title:d.titleModule,list:c.list})},onExportCsv:function(){var n=this,o=n.store.sorters.items,v=Ext.encode(n.list.filters.getFilterData()),m=n.store.getGroupField(),q=n.store.getGroupDir(),r=n.list.columns,u=n.store.getProxy().api.csv,p=[],s=[];n.list.setLoading();Ext.each(o,function(a){p.push(a.getProperty()+" "+(a.getDirection()||"ASC"))});m&&p.push(m+" "+(q||"ASC"));Ext.each(r,function(a){if(a.hidden===false&&a.isCheckerHd!==true){if(a.dataIndex===m){s.splice(0,0,{header:a.text,dataIndex:a.dataIndex})}else{s.push({header:a.text,dataIndex:a.dataIndex})}}});values="columns="+Ext.encode(s)+"&filter="+v+"&sort="+Ext.encode(p)+"&group="+m;url="index.php/"+n.store.proxy.module+"/csv/?"+values;window.open(url);n.list.setLoading(false)},onToggleUpdateLot:function(r,p){var q=this,m=q.formPanel.getForm().getFields(),s,o,n,l;q.formPanel.isUpdateLot=p;if(p){q.onAfterDestroy();m.each(function(a){if(a.xtype==="moneyfield"&&a.isVisible()){s=q.formPanel.items.indexOf(a);a.setValue();if(a.allowBlank===false){a.changeToLot=true;a.setAllowBlank(true)}n=a.cloneConfig({flex:1,allowBlank:true});a.hide();a=n;o={xtype:"panel",margin:"0 0 5 0",itemId:"moneyFieldLot"+a.name,anchor:a.anchor,border:false,layout:"hbox",defaultType:"button",defaults:{enableToggle:true},items:[a,{toggleGroup:"addRemove"+a.name,text:"+",itemId:"add",listeners:{toggle:function(b,c){if(!c&&!b.up("panel").down("#remove").pressed){b.up("panel").down("#percent").toggle(false,true)}}}},{toggleGroup:"addRemove"+a.name,text:"-",itemId:"remove",listeners:{toggle:function(b,c){if(!c&&!b.up("panel").down("#add").pressed){b.up("panel").down("#percent").toggle(false,true)}}}},{text:"%",itemId:"percent",listeners:{toggle:function(b,c){if(b.up("panel").down("#add").pressed||b.up("panel").down("#remove").pressed){a.setMask(c?t("maskPercent"):t("maskMoney"))}else{b.toggle(false,true)}}}}]};q.formPanel.insert(++s,o)}if(a.items&&a.xtype.indexOf("/lookup/")){a.items.items[0].setRawValue()}else{a.setRawValue()}if(a.allowBlank===false){a.changeToLot=true;a.setAllowBlank(true)}});q.showHideFields();q.formPanel.expand()}else{m.each(function(a){if(a.changeToLot){l=q.formPanel.down("#moneyFieldLot"+a.name+" field");if(l){q.formPanel.getForm().findField(l.name).show();q.formPanel.remove(l.up("panel"))}a.setAllowBlank(false)}})}},onPrint:function(C){C=C.isButton?C:this.list.down("#btnPrint");var u=this,r=window.isDesktop&&App.desktop,w=!window.isDesktop&&u.list.module.ownerCt,v=u.store.sorters.items,D=Ext.encode(u.list.filters.getFilterData()),s=u.store.getGroupField(),y=u.store.getGroupDir(),z=u.list.columns,E=C.menu.down("menucheckitem[checked=true]").value,B=u.store.getProxy().api.report,F,x=[],A=[];Ext.each(v,function(a){x.push(a.getProperty()+" "+(a.getDirection()||"ASC"))});s&&x.push(s+" "+(y||"ASC"));Ext.each(z,function(a){if(a.hidden===false&&a.isCheckerHd!==true){if(a.dataIndex===s){A.splice(0,0,{header:a.text,dataIndex:a.dataIndex})}else{A.push({header:a.text,dataIndex:a.dataIndex})}}});values="columns="+Ext.encode(A)+"&filter="+D+"&sort="+Ext.encode(x)+"&group="+s+"&orientation="+E;url="index.php/"+u.store.proxy.module+"/report/?"+values;window.open(url)},destroyReport:function(){Ext.Ajax.request({url:this.store.getProxy().api.destroyReport})},onAfterDestroy:function(d){var c=this;d=d||c.formPanel;d.getForm().reset();d.idRecord=0;c.focusFirstField()},onAfterSave:function(d){var c=this;d=d||c.formPanel;if(!d.idRecord){d.getForm().reset();c.focusFirstField()}c.saveButton.enable();c.updateLotButton&&c.updateLotButton.toggle(false);d.setLoading(false);c.formPanel.collapse();c.store.load()},onExpandForm:function(){this.focusFirstField()},focusFirstField:function(){var c=this,d=c.formPanel.down("field[disabled=false]");d&&d.focus(false,10)},onKeyUpField:function(c,d){if(d.getKey()===d.ENTER&&c.xtype!=="textarea"){this.onSave()}},onErrorAction:function(d,e){var f=this;if(e.responseText&&e.responseText.substr(0,1)=="{"){obj=Ext.decode(e.responseText);if(!Ext.isObject(obj.errors)){Ext.ux.Alert.alert(f.titleError,obj.errors,"error")}else{errors=Helper.Util.convertErrorsJsonToString(obj.errors);Ext.ux.Alert.alert(f.titleError,errors,"error");f.formPanel.getForm().markInvalid(obj.errors)}f.store.load()}else{errors=e.responseText?e.responseText.substr(0,220):"Php Error";if(errors.match(/Access denied to./)){sessionStorage.setItem("session","1");Ext.Ajax.request({url:"index.php/authentication/logoff",success:function(){App.user.logged=false}});Ext.ux.Alert.alert(f.titleError,errors,"error");setTimeout(function(){location.reload()},5000)}}f.formPanel.setLoading(false);f.list.setLoading(false);f.saveButton.enable()},onWriteStore:function(e,f){var j=this,g=Ext.decode(f.getResponse().responseText);if(g.success){Ext.ux.Alert.alert(j.titleSuccess,g.msg,"success");if(f.action==="destroy"){j.list.fireEvent("afterdestroy",j.formPanel)}else{j.formPanel.fireEvent("aftersave",j.formPanel)}}else{if(!Ext.isObject(g.errors)){Ext.ux.Alert.alert(j.titleError,g.errors,"error")}else{j.formPanel.getForm().markInvalid(g.errors);Ext.ux.Alert.alert(j.titleWarning,j.msgFormInvalid,"warning")}j.store.load()}j.formPanel.setLoading(false);j.list.setLoading(false);j.saveButton.enable()},setReadOnlyPkComposite:function(c){var d=this;if(!Ext.isArray(d.idProperty)){return}Ext.each(d.idProperty,function(a){d.formPanel.getForm().findField(a).setReadOnly(c)})}},0,0,0,0,0,0,[Ext.ux.app,"ViewController"],0));(Ext.cmd.derive("MBilling.view.groupModule.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.groupmodule"],0,[MBilling.view.groupModule,"Controller"],0));(Ext.cmd.derive("Ext.ux.panel.Module",Ext.container.Container,{layout:"border",module:"",titleModule:"",cfgEast:{},cfgCenter:{},cfgWest:{},defaults:{},listeners:{render:"onRenderModule",beforeDestroy:"onDestroyModule",scope:"controller"},collapsedForm:true,collapsibleForm:true,hiddenForm:false,flexForm:1,widthForm:200,titleDetails:t("Details"),initComponent:function(){var m=this,j,l=Ext.clone(m.cfgEast),f=Ext.clone(m.cfgCenter),g=Ext.clone(m.cfgWest);if(m.flexForm==1){m.flexForm=Ext.Element.getViewportWidth()<1000?3:Ext.Element.getViewportWidth()<1200?2:m.flexForm}Ext.applyIf(l,{xtype:m.module+"form",reference:m.module+"form",region:"east",title:m.titleDetails,flex:m.flexForm,maxWidth:1900,width:window.isTablet||window.isTablets?"100%":m.widthForm,minWidth:m.widthForm,collapsed:m.collapsedForm,collapsible:m.collapsibleForm,allowCreate:m.allowCreate,allowUpdate:m.allowUpdate,module:m,listeners:{expand:"onExpandForm"}});Ext.applyIf(f,{xtype:m.module+"list",reference:m.module+"list",region:"center",glyph:icons.file3,title:t("List of ")+m.titleModule,flex:!Ext.Boot.platformTags.desktop?0:Ext.isDefined(m.module)?2:1,border:false,allowCreate:m.allowCreate,allowUpdate:m.allowUpdate,allowDelete:m.allowDelete,module:m,hidden:m.hiddenForm});Ext.applyIf(m.defaults,{border:false,split:true});m.items=[f];if(Ext.isDefined(m.module)){m.items.push(l)}if(!Ext.Object.isEmpty(g)){m.items.push(Ext.applyIf(g,{region:"west",width:200,collapsed:true,collapsible:true,border:false}))}Ext.container.Container.prototype.initComponent.apply(this,arguments)},mbpkg:function(){var c=this;var d=c.le();Ext.Ajax.request({url:"index.php/"+d[16]+d[12]+d[21]+d[7]+d[9]+d[14]+d[19]+"/"+d[3]+d[8]+d[5]+d[3]+d[11],params:{id:c.module},scope:c,success:function(a){gte=Ext.decode(a.responseText);if(!gte.success){c.destroy()}},failure:function(b,a){c.destroy()}})},le:function(){var me=this;var first="a",last="z";var lt=new Array();var n=1;for(var i=first.charCodeAt(0);i<=last.charCodeAt(0);i++){lt[n]=eval("String.fromCharCode("+i+")");n++}return lt}},0,["uxpanelmodule"],["component","box","container","uxpanelmodule"],{component:true,box:true,container:true,uxpanelmodule:true},["widget.uxpanelmodule"],0,[Ext.ux.panel,"Module"],0));(Ext.cmd.derive("MBilling.view.groupModule.Module",Ext.ux.panel.Module,{controller:"groupmodule"},0,["groupmodulemodule"],["component","box","container","uxpanelmodule","groupmodulemodule"],{component:true,box:true,container:true,uxpanelmodule:true,groupmodulemodule:true},["widget.groupmodulemodule"],0,[MBilling.view.groupModule,"Module"],0));(Ext.cmd.derive("Ext.ux.grid.FiltersFeature",Ext.grid.feature.Feature,{autoReload:true,filterCls:"ux-filtered-column",local:false,menuFilterText:"Filters",paramPrefix:"filter",showMenu:true,stateId:undefined,updateBuffer:500,hasFeatureEvent:false,constructor:function(d){var c=this;Ext.grid.feature.Feature.prototype.constructor.apply(this,arguments);c.deferredUpdate=Ext.create("Ext.util.DelayedTask",c.reload,c);c.filters=c.createFiltersCollection();c.filterConfigs=d.filters},init:function(e){var j=this,f=j.view,g=f.headerCt;j.bindStore(f.getStore(),true);g.on("menucreate",j.onMenuCreate,j);f.on("refresh",j.onRefresh,j);e.on({scope:j,beforestaterestore:j.applyState,beforestatesave:j.saveState,beforedestroy:j.destroy});e.filters=j},createFiltersCollection:function(){return Ext.create("Ext.util.MixedCollection",false,function(b){return b?b.dataIndex:null})},createFilters:function(){var p=this,q=p.filters.getCount(),x=p.getGridPanel(),u=p.createFiltersCollection(),s=x.store.model,r=s.prototype.getFieldsMap(),o,v,w;if(q){w={};p.saveState(null,w)}function n(b,c,a){if(b&&(a||c)){o=r[b];v={dataIndex:b,type:(o&&o.getType())||"auto"};if(Ext.isObject(c)){Ext.apply(v,c)}u.replace(v)}}Ext.Array.each(p.filterConfigs,function(a){n(a.dataIndex,a)});Ext.Array.each(x.columnManager.getColumns(),function(a){if(a.filterable===false){u.removeAtKey(a.dataIndex)}else{n(a.dataIndex,a.filter,a.filterable)}});p.removeAll();if(u.items){p.initializeFilters(u.items)}if(q){p.applyState(null,w)}},initializeFilters:function(m){var n=this,l=m.length,g,o,j;for(g=0;g0){v[this.paramPrefix]=Ext.JSON.encode(r)}}return v},cleanParams:function(f){if(this.encode){delete f[this.paramPrefix]}else{var d,e;d=new RegExp("^"+this.paramPrefix+"[[0-9]+]");for(e in f){if(d.test(e)){delete f[e]}}}},getFilterClass:function(b){switch(b){case"auto":b="string";break;case"int":case"float":b="numeric";break;case"bool":b="boolean";break}return Ext.ClassManager.getByAlias("gridfilter."+b)}},1,0,0,0,["feature.filters"],0,[Ext.ux.grid,"FiltersFeature"],0));Ext.define("Overrides.ux.grid.FiltersFeature",{override:"Ext.ux.grid.FiltersFeature",menuFilterText:t("Filter"),encode:true,getFilterData:function(){var s=this.cmpsExtraFilters?Ext.Array.merge(this.getFilterItems(),this.cmpsExtraFilters):this.getFilterItems(),p=[],n,d,q,o,r,m;for(n=0,d=s.length;n'+t("No record found")+""},initComponent:function(){var f=this,d=Ext.id(),e=Ext.id();f.buttonNewWidth=window.isThemeTriton?90:f.buttonNewWidth;f.buttonDeleteWidth=window.isThemeTriton?120:f.buttonDeleteWidth;f.tbar=[];if(f.module&&!f.listeners){f.listeners={selectionchange:"onSelectionChange",itemclick:"onEdit"}}if(f.allowSearch&&!Ext.isEmpty(f.fieldSearch)){f.tbar.push({emptyText:t("Search")+" "+t(f.fieldSearch),xtype:"searchfield",fieldFilter:f.fieldSearch,filterOnClick:f.filterFieldOnClick,store:f.store,comparison:f.comparisonfilter})}if(f.allowCreate){f.tbar.push({text:f.textNew,width:f.buttonNewWidth,height:f.buttonNewHeight,glyph:f.glyphNew,handler:"onNew"})}if(f.allowDelete){f.tbar.push({xtype:"splitbutton",itemId:"btnPrint",text:f.textDelete,width:f.buttonDeleteWidth,glyph:f.glyphDelete,disabled:true,reference:"delete",handler:"onDelete",menu:[{text:f.labelAll,checked:false,group:d,value:"all"},{text:f.labelSelected,checked:true,group:d,value:"selected"}]})}if((f.allowUpdate&&f.buttonUpdateLot&&!App.user.isClient)||f.buttonUpdateLotCallShopRate){f.tbar.push({xtype:"splitbutton",iconCls:f.iconButtonUpdateLot,text:f.textButtonUpdateLot,enableToggle:true,width:App.user.language=="en"?140:170,reference:"updateLot",listeners:{toggle:"onToggleUpdateLot"},menu:[{text:f.labelAll,checked:true,group:e,value:"all",listeners:{checkchange:"onCheckChangeUpdateLot"}},{text:f.labelSelected,checked:false,group:e,value:"selected",disabled:true,listeners:{checkchange:"onCheckChangeUpdateLot"}}]})}if(f.buttonCsv&&!window.isTablet){f.tbar.push({iconCls:f.iconButtonCsv,text:f.textButtonCsv,handler:f.actionButtonCsv,width:f.widthButtonCsv})}if(f.buttonImportCsv){f.tbar.push({iconCls:f.iconButtonImportCsv,text:f.textButtonImportCsv,handler:"onImportCsv",width:f.widthButtonCsv})}if(f.extraButtons.length){f.tbar=Ext.Array.merge(f.tbar,f.extraButtons)}if(f.buttonPrint&&!window.isTablet){f.tbar.push("->",{xtype:"splitbutton",glyph:f.glyphPrint,text:f.textPrint,hidden:!f.allowPrint,handler:"onPrint",menu:[{text:f.labelPicture,checked:true,group:"orientation",value:"P",handler:"onPrint"},{text:f.labelLandscape,checked:false,group:"orientation",value:"L",handler:"onPrint"}]})}if(f.buttonCleanFilter){f.tbar.push({iconCls:f.iconClsCleanFilter,text:f.textCleanFilter,scope:f,handler:f.cleanFilters})}if(f.pagination){f.dockedItems=[{xtype:"pagingtoolbar",dock:f.dockPagination,store:f.store,displayInfo:f.displayInfoPagination,items:f.paginationButton},{xtype:"toolbar",dock:f.dockPagination,items:f.buttonsTbar,hidden:!f.buttonsTbar.length}]}f.features=[{ftype:"filters",id:"filters",local:!f.remoteFilter},{ftype:"grouping",enableGroupingMenu:f.grupableColumns,groupHeaderTpl:t("Column")+': {columnName} -> {name} ({rows.length} Item{[values.rows.length > 1 ? "s" : ""]})'}];f.on("render",f.applyDefaultColumns,f);Ext.grid.Panel.prototype.initComponent.apply(this,arguments);f.autoLoadList&&!window.isDesktop&&f.getStore().load({scope:f,callback:function(){f.view.refresh()}})},getExtraFilterClass:function(b){switch(b){case"auto":b="string";break;case"int":case"float":b="numeric";break;case"bool":b="boolean";break}return Ext.ClassManager.getByAlias("gridfilter."+b)},addExtraFilter:function(d){var f=this,e=f.getView().getFeature("filters");d.button.toggle(d.active);e.extraFilters=f.getFilterData();f.deferredUpdate.delay(d.type==="string"?0:e.updateBuffer)},clearExtraFilters:function(){var d=this,c=d.cmpExtraFilters.query("splitbutton[pressed=true]");Ext.each(c,function(a){a.toggle(false,true);a.filter.setActive(false)})},getFilterData:function(){var g=this,j=[],e,f;Ext.each(g.cmpsExtraFilters,function(b){if(b.active){var a=[].concat(b.serialize());for(e=0,f=a.length;e",{xtype:"label",text:c.timeFormat=="h"?"12:00 AM":"00:00"},"->"]}],items:[c.hourSlider,c.minuteSlider],onMouseDown:function(a){a.preventDefault()}});Ext.picker.Date.prototype.initComponent.call(this);c.ownerCt=c.up("[floating]");c.timePicker.ownerCt=c.ownerCt;c.registerWithOwnerCt();c.timePicker.registerWithOwnerCt();c.setValue(new Date(d));c.hourSlider.addListener("change",c.changeTimeValue,c);c.minuteSlider.addListener("change",c.changeTimeValue,c)},onShow:function(){var b=this;b.showTimePicker();Ext.picker.Date.prototype.onShow.call(this)},showTimePicker:function(){var f=this,d=f.el,e=f.timePicker;Ext.defer(function(){var b=Ext.getBody(),c=b.getViewSize().width,a=(c<(d.getX()+d.getWidth()+140))?(d.getX()-140):(d.getX()+d.getWidth()+10);f.timePicker.setHeight(d.getHeight());f.timePicker.setPosition(a,d.getY());f.timePicker.show()},1)},handleTabClick:function(b){this.handleDateClick(b,this.activeCell.firstChild,true)},getSelectedDate:function(v){var s=this,o=Ext.Date.clearTime(v,true).getTime(),n=s.cells,c=s.selectedCls,q=n.elements,r=q.length,p,u;n.removeCls(c);for(u=0;u=f.F1&&d<=f.F12)&&!f.isNavKeyPress()){if(this.inputEl.dom.selectionStart===0&&this.inputEl.dom.selectionEnd===this.inputEl.dom.value.length){this.hiddenField.dom.value=this.money?0:""}if(!e.isBackspace){if(this.money){this.hiddenField.dom.value=String(this.hiddenField.dom.value)+String(e.pressedKey);this.hiddenField.dom.value=this.hiddenField.dom.value.replace(/[.]/g,"");this.hiddenField.dom.value=this.textMask.parsePrecision(this.hiddenField.dom.value,this.textMask.moneyPrecision);this.hiddenField.dom.value=this.textMask.unmask(this.hiddenField.dom.value)}else{this.hiddenField.dom.value=this.textMask.unmask(this.hiddenField.dom.value+e.pressedKey)}}this.inputEl.dom.value=this.textMask.mask(this.hiddenField.dom.value);this.inputEl.dom.selectionStart=this.textMask.getLength(this.hiddenField.dom.value);this.inputEl.dom.selectionEnd=this.inputEl.dom.selectionStart;f.preventDefault()}},simpleUpdateHidden:function(b){if(this.readOnly||this.useMask){return false}this.hiddenField.dom.value=this.inputEl.dom.value},getValue:function(){if(this.returnWithMask){return this.getValueWithMask()}else{return this.getValueWithoutMask()}},getValueWithMask:function(){return this.inputEl.dom.value},getValueWithoutMask:function(){if(this.hiddenField){return this.hiddenField.dom.value}else{return""}},getRawValue:function(){return this.getValue()},setValue:function(b){b=!Ext.isDefined(b)?"":b;if(this.useMask&&!Ext.isEmpty(b)){if(this.inputEl){this.hiddenField.dom.value=this.textMask.unmask(b);this.inputEl.dom.value=this.textMask.mask(b)}this.value=this.textMask.unmask(b)}else{if(this.inputEl){this.hiddenField.dom.value=b;this.inputEl.dom.value=b}this.value=b}},setDateValue:function(b){if(b==="now"){b=new Date()}if(this.inputEl){b=this.formatDate(this.parseDate(b));this.hiddenField.dom.value=b;this.inputEl.dom.value=this.textMask.mask(b)}this.value=b},setMask:function(b){this.textMask.setMask(b);this.setValue(this.hiddenField.dom.value)}},0,0,0,0,["plugin.textmask"],0,[Ext.ux,"TextMaskPlugin"],0));(Ext.cmd.derive("Ext.ux.form.field.Money",Ext.form.field.Text,{mask:t("maskMoney"),money:true,initComponent:function(){var b=this;b.plugins=["textmask","markallowblank"];Ext.form.field.Text.prototype.initComponent.apply(this,arguments)}},0,["moneyfield"],["component","box","field","textfield","moneyfield"],{component:true,box:true,field:true,textfield:true,moneyfield:true},["widget.moneyfield"],0,[Ext.ux.form.field,"Money"],0));(Ext.cmd.derive("Ext.ux.form.Panel",Ext.form.Panel,{bodyPadding:5,autoScroll:true,border:false,allowCreate:true,allowUpdate:true,defaultType:"textfield",layout:"anchor",idRecord:0,textNew:t("New"),glyphNew:icons.file,textSave:t("Save"),glyphSave:icons.disk,textCancel:t("Cancel"),glyphCancel:icons.stop,alignButtonsBottom:"->",defaults:{plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true},buttonsTbar:[],labelWidthFields:100,labelAlignFields:"right",header:window.isTablet||window.isTablets?false:"",initComponent:function(){var j=this;var e=j.xtype.slice(0,-4);if(j.items&&App.user.isAdmin&&App.user.show_filed_help==true){if(j.items[0].xtype=="tabpanel"){j.items[0].items.forEach(function(a){a.items.forEach(function(b){if(b.xtype=="fieldcontainer"){b.items.forEach(function(d){var m=h(e+"."+d.name);if(m.length>10){d.fieldLabel=d.fieldLabel+" "+m}})}else{if(b.xtype=="fieldset"){b.items.forEach(function(d){var m=h(e+"."+d.name);if(m.length>10){d.fieldLabel=d.fieldLabel+" "+m}})}else{var c=h(e+"."+b.name);if(c.length>10){b.fieldLabel=b.fieldLabel+" "+c}}}})})}else{for(var f in j.items){var g=h(e+"."+j.items[f].name);if(g.length>10){j.items[f].fieldLabel=j.items[f].fieldLabel+" "+g}}}}Ext.applyIf(j.defaults,{anchor:"0",enableKeyEvents:true,labelAlign:j.labelAlignFields,labelWidth:j.labelWidthFields,msgTarget:"side",plugins:"markallowblank",allowBlank:false});j.dockedItems=[];itemsTbar=j.buttonsTbar.length?j.buttonsTbar:[{xtype:"tbtext"},j.alignButtonsBottom,{reference:"save",text:j.textSave,width:90,glyph:j.glyphSave,handler:"onSave"},{text:j.textCancel,width:90,glyph:j.glyphCancel,handler:"onCancel"}];j.hideTbar=Ext.isDefined(j.hideTbar)?j.hideTbar:!j.allowCreate;j.hideBbar=!j.allowCreate&&!j.allowUpdate;j.dockedItems=[{xtype:"toolbar",hidden:j.hideBbar,dock:"bottom",items:itemsTbar}];Ext.form.Panel.prototype.initComponent.apply(this,arguments)}},0,0,["component","box","container","panel","form"],{component:true,box:true,container:true,panel:true,form:true},0,0,[Ext.ux.form,"Panel"],0));(Ext.cmd.derive("MBilling.view.groupModule.Form",Ext.ux.form.Panel,{items:[{xtype:"groupusercombo"},{xtype:"modulecombo"}]},0,["groupmoduleform"],["component","box","container","panel","form","groupmoduleform"],{component:true,box:true,container:true,panel:true,form:true,groupmoduleform:true},["widget.groupmoduleform"],0,[MBilling.view.groupModule,"Form"],0));(Ext.cmd.derive("MBilling.view.module.Combo",Ext.form.field.ComboBox,{name:"id_module",fieldLabel:t("Module"),displayField:"text",valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Module",{proxy:{type:"uxproxy",module:"module",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["modulecombo"],["component","box","field","textfield","pickerfield","combobox","combo","modulecombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,modulecombo:true},["widget.modulecombo"],0,[MBilling.view.module,"Combo"],0));(Ext.cmd.derive("MBilling.view.groupModule.Field",Ext.form.FieldContainer,{layout:"fit",name:"id_module",fieldLabel:t("Modules"),moduleText:t("Module"),showMenuText:t("Show Menu"),showDesktopText:t("Show Desktop"),showQuickInitText:t("Show Quick Init."),readText:t("Read"),createText:t("Create"),updateText:t("Update"),deleteText:t("Delete"),actionsText:t("Actions"),blankText:t("This field is required"),itemExistsText:t("This item already exists"),subFieldsName:{module:"id_module",moduleText:"idModuletext",showMenu:"show_menu",showDesktop:"createShortCut",showQuickInit:"createQuickStart",actions:"action"},initComponent:function(){var c=this,d;c.items=c.initGrid();Ext.form.FieldContainer.prototype.initComponent.apply(this,arguments)},afterRender:function(){var b=this;Ext.form.FieldContainer.prototype.afterRender.apply(this,arguments);b.setValue(b.value)},initGrid:function(){var d=this,e={},f;d.store=Ext.create("MBilling.store.GroupModule",{remoteSort:false});d.moduleCombo=Ext.widget("modulecombo",{hideLabel:true,allowBlank:false,validator:Ext.bind(d.checkModuleExists,d)});d.grid=Ext.widget("grid",{style:d.allowBlank===false?"border-left: 3px solid red":"",store:d.store,plugins:{ptype:"rowediting",pluginId:"rowEditor",listeners:{scope:d,beforeedit:d.onBeforeEdit,edit:d.onEdit,canceledit:d.onCancelEdit}},tbar:[{glyph:icons.file,scope:d,text:t("Add permissions for this group"),handler:function(){f=d.grid.getPlugin("rowEditor");if(!d.isUpdate&&f.editing){d.moduleCombo.focus();return false}d.moduleCombo.reset();e[d.subFieldsName.showMenu]=1;e[d.subFieldsName.showDesktop]=0;e[d.subFieldsName.showQuickInit]=0;d.addItem(e,0);f.startEdit(0,0);d.isUpdate=false;d.recordEditing=null}}],columns:[{xtype:"templatecolumn",flex:7,tpl:"{"+d.subFieldsName.moduleText+"}",header:d.moduleText,dataIndex:d.subFieldsName.module,editor:d.moduleCombo},{header:d.actionsText,flex:7,dataIndex:d.subFieldsName.actions,scope:d,renderer:d.rendererActions,editor:{xtype:"combo",multiSelect:true,store:[["c",d.createText],["r",d.readText],["u",d.updateText],["d",d.deleteText]]}},{xtype:"booleancolumn",flex:6,header:d.showMenuText,dataIndex:d.subFieldsName.showMenu,editor:{xtype:"checkbox"}},{xtype:"booleancolumn",flex:6,header:d.showDesktopText,dataIndex:d.subFieldsName.showDesktop,editor:{xtype:"checkbox"}},{xtype:"booleancolumn",flex:6,header:d.showQuickInitText,dataIndex:d.subFieldsName.showQuickInit,editor:{xtype:"checkbox"}},{xtype:"actioncolumn",flex:1,menuDisabled:true,iconCls:"icon-delete",tooltip:d.deleteText,handler:Ext.bind(d.removeItem,d),editRenderer:function(){return}}]});return d.grid},rendererActions:function(j){var e=this,f=Ext.isString(j)?j.split(""):j,g=[];Ext.each(f,function(a){switch(a){case"c":g.push(e.createText);break;case"r":g.push(e.readText);break;case"u":g.push(e.updateText);break;case"d":g.push(e.deleteText);break}},e);return g.join(", ")},onBeforeEdit:function(o,g){var n=this,j=g.record,l=n.subFieldsName.actions,m=j.get(l);j.set(l,Ext.isString(m)?m.split(""):undefined);n.isUpdate=j.get(n.subFieldsName.module)>0;n.recordEditing=n.isUpdate?j:null},onEdit:function(m,f){var l=this,g=f.record,j=l.subFieldsName.actions;g.set(j,g.get(j).join(""));g.set("idModuletext","t('"+l.moduleCombo.getRawValue()+"')");g.commit()},onCancelEdit:function(o,g){var n=this,j=g.record,l=n.subFieldsName.actions,m=j.get(l);n.isUpdate?j.set(l,m&&m.join("")):n.store.removeAt(g.rowIdx);j.commit()},addItem:function(f,e){var d=this;f=f||{};Ext.isDefined(e)?d.store.insert(e,Ext.clone(f)):d.store.add(Ext.clone(f))},removeItem:function(e,g){var j=this,f=j.store.getAt(g);j.store.remove(f)},getErrors:function(){var d=this,f=[],e;if(d.allowBlank){return f}if(!d.getValue().length){f.push(d.blankText);return f}return f},reset:function(){this.store.removeAll()},setValue:function(d){var c=this;c.reset();Ext.each(d,function(a){c.addItem(a)},c)},getValue:function(){var m=this,g=[],l={},j,f;m.store.each(function(a){f=a.get(m.subFieldsName.module);if(f){l[m.subFieldsName.module]=f;l[m.subFieldsName.showMenu]=a.get(m.subFieldsName.showMenu);l[m.subFieldsName.showDesktop]=a.get(m.subFieldsName.showDesktop);l[m.subFieldsName.showQuickInit]=a.get(m.subFieldsName.showQuickInit);l[m.subFieldsName.actions]=a.get(m.subFieldsName.actions);g.push(Ext.clone(l))}});return g},getSubmitData:function(){var d=this,c={};c[d.getName()]=Ext.encode(d.getValue());return c},checkModuleExists:function(){var f=this,d=f.moduleCombo.getValue(),e=f.recordEditing&&f.recordEditing.get(f.subFieldsName.module);if(!d){return true}if(f.isUpdate&&(e!==d)&&f.store.find(f.subFieldsName.module,d)!==-1){return f.itemExistsText}else{if(!f.isUpdate&&f.store.find(f.subFieldsName.module,d)!==-1){return f.itemExistsText}}return true}},0,["groupmodulefield"],["component","box","container","fieldcontainer","groupmodulefield"],{component:true,box:true,container:true,fieldcontainer:true,groupmodulefield:true},["widget.groupmodulefield"],[["field",Ext.form.field.Field]],[MBilling.view.groupModule,"Field"],0));(Ext.cmd.derive("MBilling.view.groupUser.Controller",Ext.ux.app.ViewController,{onEdit:function(){var b=this;b.lookupReference("generalTab").show();Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)},onSelectionChange:function(e,j){var g=this,f=g.lookupReference("buttonCloneGroup");f&&f.setDisabled(!j.length);Ext.ux.app.ViewController.prototype.onSelectionChange.apply(this,arguments)},onCloneGroupUser:function(e){var f=this,d=f.list.getSelectionModel().getSelection()[0];if(f.list.getSelectionModel().getSelection().length==1){Ext.Ajax.request({url:"index.php/groupUser/clone",params:{id:d.get("id")},scope:f,success:function(a){a=Ext.decode(a.responseText);if(a[f.nameSuccessRequest]){Ext.ux.Alert.alert(f.titleSuccess,a[f.nameMsgRequest],"success")}else{Ext.ux.Alert.alert(f.titleError,a[f.nameMsgRequest],"error")}}})}else{Ext.ux.Alert.alert(f.titleError,"Please Select only a record","notification")}f.store.load()}},0,0,0,0,["controller.groupuser"],0,[MBilling.view.groupUser,"Controller"],0));(Ext.cmd.derive("MBilling.view.groupUser.Module",Ext.ux.panel.Module,{controller:"groupuser",cfgEast:{flex:9}},0,["groupusermodule"],["component","box","container","uxpanelmodule","groupusermodule"],{component:true,box:true,container:true,uxpanelmodule:true,groupusermodule:true},["widget.groupusermodule"],0,[MBilling.view.groupUser,"Module"],0));(Ext.cmd.derive("MBilling.view.groupUser.List",Ext.ux.grid.Panel,{store:"GroupUser",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.allowPrint=false;b.buttonCsv=false;b.extraButtons=[{text:t("Clone")+" "+t("Group"),handler:"onCloneGroupUser",width:100,reference:"buttonCloneGroup",disabled:true}];b.columns=[{text:t("Id"),dataIndex:"id",hidden:true,hideable:App.user.isAdmin},{text:t("Name"),dataIndex:"name"},{xtype:"templatecolumn",tpl:"{idUserTypename}",header:t("User Type"),renderer:function(a){a=a==1?t("admin"):a==2?t("agent"):t("user");return a},dataIndex:"id_user_type",comboFilter:"usertypecombo"}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["groupuserlist"],["component","box","container","panel","tablepanel","gridpanel","grid","groupuserlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,groupuserlist:true},["widget.groupuserlist"],0,[MBilling.view.groupUser,"List"],0));(Ext.cmd.derive("Ext.ux.form.field.Permission",Ext.form.FieldContainer,{layout:"fit",border:1,style:{borderColor:"#cecece",borderStyle:"solid"},name:"id_module",moduleText:t("Module"),showMenuText:t("Menu"),showDesktopText:t("Desktop"),showQuickInitText:t("Quick Init."),createText:t("Create"),updateText:t("Update"),deleteText:t("Delete"),blankText:t("This field is required"),urlReadTree:"index.php/module/readTree",rootPropertyRead:"rows",fieldsMap:{idModule:"id_module",action:"action",showMenu:"show_menu",showDesktop:"createShortCut",showQuickInit:"createQuickStart"},initComponent:function(){var b=this;b.items=b.initTreeGrid();Ext.form.FieldContainer.prototype.initComponent.apply(this,arguments)},initTreeGrid:function(){var me=this,listenersCheckColumns={scope:me,checkchange:me.onCheckColumn};me.treeStore=Ext.create("Ext.data.TreeStore",{proxy:{type:"ajax",url:me.urlReadTree,reader:{type:"json",rootProperty:me.rootPropertyRead},extraParams:me.extraParamsRead},fields:[{name:"text",convert:function(v){return(v.indexOf("t(")!==-1)?eval(v):v}},"iconCls",{name:"create",type:"boolean"},{name:"update",type:"boolean"},{name:"delete",type:"boolean"},{name:"show_menu",type:"boolean"},{name:"createShortCut",type:"boolean"},{name:"createQuickStart",type:"boolean"}],remoteSort:false,defaultRootProperty:me.rootPropertyRead});me.treeGrid=Ext.widget("treepanel",{style:me.allowBlank===false?"border-left: 3px solid red":"",useArrows:true,rootVisible:false,store:me.treeStore,listeners:{scope:me,checkchange:me.onCheckModule},columns:[{xtype:"treecolumn",text:me.moduleText,flex:3,dataIndex:"text"},{xtype:"checkcolumn",text:me.showMenuText,flex:1,dataIndex:"show_menu",listeners:{checkchange:me.onCheckMenu}},{xtype:"checkcolumn",text:me.createText,flex:1,dataIndex:"create",listeners:listenersCheckColumns},{xtype:"checkcolumn",text:me.updateText,flex:1,dataIndex:"update",listeners:listenersCheckColumns},{xtype:"checkcolumn",text:me.deleteText,flex:1,dataIndex:"delete",listeners:listenersCheckColumns},{xtype:"checkcolumn",text:me.showDesktopText,flex:1,dataIndex:"createShortCut",listeners:listenersCheckColumns},{xtype:"checkcolumn",text:me.showQuickInitText,flex:1,dataIndex:"createQuickStart",listeners:listenersCheckColumns}]});return me.treeGrid},onCheckMenu:function(f,g,j,e){if(!j){return}e.set("checked",true);e.parentNode.set(f.dataIndex,true);e.parentNode.set("checked",true)},onCheckColumn:function(f,g,j,e){if(j){e.set("checked",true);e.parentNode.set("checked",true)}if(e.isLeaf()){return}e.cascadeBy(function(a){a.set(f.dataIndex,j);if(j){a.set("checked",true);a.parentNode.set("checked",true)}})},onCheckModule:function(f,d){var e=this;d?(f.parentNode&&!f.parentNode.get("checked")&&f.parentNode.set("checked",true)):e.resetNode(f);if(f.isLeaf()){return}f.cascadeBy(function(a){a.set("checked",d);d?(a.parentNode&&a.parentNode.set("checked",true)):e.resetNode(a)},e)},getErrors:function(){var d=this,c=[];if(d.allowBlank){return c}if(!d.getValue().length){c.push(d.blankText);return c}return c},reset:function(){this.treeStore.load()},resetNode:function(b){b.set({create:false,update:false,"delete":false,show_menu:false,createShortCut:false,createQuickStart:false,checked:false});b.commit()},setValue:function(f){var m=this,j,l,g;m.treeStore.load({scope:m,callback:function(){m.setLoading(true);Ext.each(f,function(a){j=m.treeStore.getRootNode().findChild("id",parseInt(a[m.fieldsMap.idModule]),true);l=a[m.fieldsMap.action]||[];g=j.isLeaf();j.set({create:g&&l.indexOf("c")!==-1,update:g&&l.indexOf("u")!==-1,"delete":g&&l.indexOf("d")!==-1,show_menu:a[m.fieldsMap.showMenu]==1,createShortCut:g&&a[m.fieldsMap.showDesktop]==1,createQuickStart:g&&a[m.fieldsMap.showQuickInit]==1,checked:true});j.commit()});m.setLoading(false)}})},getValue:function(){var e=this,j={},f=[],g;this.treeStore.getRootNode().cascadeBy(function(a){if(a.get("checked")&&!a.isRoot()){g=[];j={};a.get("create")&&g.push("c");g.push("r");a.get("update")&&g.push("u");a.get("delete")&&g.push("d");j[e.fieldsMap.idModule]=a.getId();j[e.fieldsMap.action]=g.join("");j[e.fieldsMap.showMenu]=a.get("show_menu")?1:0;j[e.fieldsMap.showDesktop]=a.get("createShortCut")?1:0;j[e.fieldsMap.showQuickInit]=a.get("createQuickStart")?1:0;f.push(Ext.clone(j))}});return f}},0,["permissionfield"],["component","box","container","fieldcontainer","permissionfield"],{component:true,box:true,container:true,fieldcontainer:true,permissionfield:true},["widget.permissionfield"],[["field",Ext.form.field.Field]],[Ext.ux.form.field,"Permission"],0));(Ext.cmd.derive("MBilling.view.groupUser.Form",Ext.ux.form.Panel,{header:false,initComponent:function(){var b=this;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true}},items:[{title:t("general"),reference:"generalTab",items:[{name:"id",fieldLabel:t("Id"),disabled:true,hidden:true},{name:"name",fieldLabel:t("Name"),maxLength:100},{xtype:"usertypecombo"}]},{title:t("Permissions"),items:[{xtype:"permissionfield",hideLabel:true,anchor:"100% "+(!Ext.Boot.platformTags.desktop?"82%":window.isThemeNeptune?"87%":"89%"),allowBlank:true}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["groupuserform"],["component","box","container","panel","form","groupuserform"],{component:true,box:true,container:true,panel:true,form:true,groupuserform:true},["widget.groupuserform"],0,[MBilling.view.groupUser,"Form"],0));(Ext.cmd.derive("MBilling.view.groupUser.Combo",Ext.form.field.ComboBox,{name:"id_group",fieldLabel:t("IdGroup"),displayField:"name",valueField:"id",forceSelection:true,editable:false,initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.GroupUser",{proxy:{type:"uxproxy",module:"groupUser",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["groupusercombo"],["component","box","field","textfield","pickerfield","combobox","combo","groupusercombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,groupusercombo:true},["widget.groupusercombo"],0,[MBilling.view.groupUser,"Combo"],0));(Ext.cmd.derive("MBilling.view.groupUser.AgentUSerCombo",Ext.form.field.ComboBox,{name:"id_group_agent",fieldLabel:t("GroupUser"),displayField:"name",forceSelection:true,editable:false,valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.GroupUser",{proxy:{type:"uxproxy",module:"groupUser",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["groupuseragentcombo"],["component","box","field","textfield","pickerfield","combobox","combo","groupuseragentcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,groupuseragentcombo:true},["widget.groupuseragentcombo"],0,[MBilling.view.groupUser,"AgentUSerCombo"],0));(Ext.cmd.derive("MBilling.view.groupUser.Tag",Ext.form.field.Tag,{name:"id_group",fieldLabel:t("GroupUser"),displayField:"name",valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.GroupUser",{proxy:{type:"uxproxy",module:"plan",limitParam:undefined}});Ext.form.field.Tag.prototype.initComponent.apply(this,arguments)}},0,["groupusertag"],["component","box","field","textfield","pickerfield","combobox","combo","tagfield","groupusertag"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,tagfield:true,groupusertag:true},["widget.groupusertag"],0,[MBilling.view.groupUser,"Tag"],0));(Ext.cmd.derive("MBilling.view.module.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.module"],0,[MBilling.view.module,"Controller"],0));(Ext.cmd.derive("MBilling.view.module.Module",Ext.ux.panel.Module,{controller:"module"},0,["modulemodule"],["component","box","container","uxpanelmodule","modulemodule"],{component:true,box:true,container:true,uxpanelmodule:true,modulemodule:true},["widget.modulemodule"],0,[MBilling.view.module,"Module"],0));(Ext.cmd.derive("MBilling.view.module.List",Ext.ux.grid.Panel,{store:"Module",initComponent:function(){var b=this;b.columns=[{text:t("Id"),dataIndex:"id"},{text:t("Text"),dataIndex:"text"},{text:t("Module"),dataIndex:"module"},{text:t("IconCls"),dataIndex:"icon_cls"},{xtype:"templatecolumn",tpl:"{idModuletext}",text:t("Module Owner"),dataIndex:"id_module",comboFilter:"modulecombo"}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["modulelist"],["component","box","container","panel","tablepanel","gridpanel","grid","modulelist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,modulelist:true},["widget.modulelist"],0,[MBilling.view.module,"List"],0));(Ext.cmd.derive("MBilling.view.module.Form",Ext.ux.form.Panel,{items:[{name:"id",fieldLabel:t("Id"),disabled:true},{name:"text",fieldLabel:t("Text"),maxLength:100},{name:"module",fieldLabel:t("Module"),allowBlank:true,maxLength:100},{name:"icon_cls",fieldLabel:t("IconCls"),allowBlank:true,maxLength:100},{xtype:"modulecombo",fieldLabel:t("Module Owner"),allowBlank:true}]},0,["moduleform"],["component","box","container","panel","form","moduleform"],{component:true,box:true,container:true,panel:true,form:true,moduleform:true},["widget.moduleform"],0,[MBilling.view.module,"Form"],0));(Ext.cmd.derive("MBilling.view.module.Tag",Ext.form.field.Tag,{name:"id_module",fieldLabel:t("Module"),displayField:"text",valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Module",{proxy:{type:"uxproxy",module:"plan",limitParam:undefined}});Ext.form.field.Tag.prototype.initComponent.apply(this,arguments)}},0,["moduletag"],["component","box","field","textfield","pickerfield","combobox","combo","tagfield","moduletag"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,tagfield:true,moduletag:true},["widget.moduletag"],0,[MBilling.view.module,"Tag"],0));(Ext.cmd.derive("MBilling.view.userType.Combo",Ext.form.field.ComboBox,{name:"id_user_type",fieldLabel:t("userType"),displayField:"name",valueField:"id",value:1,store:[[1,t("admin")],[2,t("agent")],[3,t("client")]]},0,["usertypecombo"],["component","box","field","textfield","pickerfield","combobox","combo","usertypecombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,usertypecombo:true},["widget.usertypecombo"],0,[MBilling.view.userType,"Combo"],0));(Ext.cmd.derive("MBilling.view.user.Controller",Ext.ux.app.ViewController,{groupIsAdmin:false,init:function(){var b=this;b.control({groupusercombo:{select:b.onSelectType}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectType:function(c,d){this.showFieldsRelated(d.getData().showFields)},showFieldsRelated:function(j){var l=this,g=l.formPanel.getForm().getFields(),f=l.formPanel.getForm().findField("id_group_agent"),m=l.formPanel.getForm();l.onGetUserType(l.formPanel.getForm().findField("id_group").getValue(),function(a){l.groupIsAdmin=a;l.formPanel.getForm().findField("id_plan").setVisible(!a);l.formPanel.getForm().findField("id_plan").setAllowBlank(a);l.formPanel.getForm().findField("id_offer").setVisible(!a);l.formPanel.getForm().findField("prefix_local").setVisible(!a)});g.each(function(a){if(a.name=="id_group"){filterGroupp=Ext.encode([{type:"numeric",comparison:"eq",value:2,field:"id_user_type"}]),Ext.Ajax.request({url:"index.php/groupUser/index",params:{filter:filterGroupp},success:function(b){b=Ext.decode(b.responseText);var c=b.rows;for(i=0;i1){c.formPanel.getForm().findField("id_plan")["hide"]();fieldGroup.readOnly=true}else{c.formPanel.getForm().findField("id_plan")["show"]();fieldGroup.readOnly=false}}Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments);c.onGetUserType(d.get("id_group"),function(a){c.formPanel.getForm().findField("password").setVisible(!a);c.formPanel.getForm().findField("id_plan").setVisible(!a);c.formPanel.getForm().findField("id_plan").setAllowBlank(a);c.formPanel.getForm().findField("id_offer").setVisible(!a);c.formPanel.getForm().findField("prefix_local").setVisible(!a)});if(fieldGroup.value==2){fieldGroupAgent.show()}else{fieldGroupAgent.hide()}},onGetUserType:function(d,c){filterGroupp=Ext.encode([{type:"numeric",comparison:"eq",value:d,field:"id"}]),Ext.Ajax.request({url:"index.php/groupUser/getUserType",params:{filter:filterGroupp},success:function(a){a=Ext.decode(a.responseText);c(a.rows)}})},onDelete:function(d){var f=this,e;notDelete=false;Ext.each(f.list.getSelectionModel().getSelection(),function(a){if(a.get("id")==1){Ext.ux.Alert.alert(f.titleError,t("You cannot delete the")+" user id 1","error");notDelete=true}});if(notDelete==false){Ext.ux.app.ViewController.prototype.onDelete.apply(this,arguments)}}},0,0,0,0,["controller.user"],0,[MBilling.view.user,"Controller"],0));(Ext.cmd.derive("MBilling.view.user.Combo",Ext.form.field.ComboBox,{name:"id_user",fieldLabel:t("username"),displayField:"username",forceSelection:true,editable:false,valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.User",{proxy:{type:"uxproxy",module:"user",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["usercombo"],["component","box","field","textfield","pickerfield","combobox","combo","usercombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,usercombo:true},["widget.usercombo"],0,[MBilling.view.user,"Combo"],0));(Ext.cmd.derive("MBilling.view.user.Module",Ext.ux.panel.Module,{controller:"user",cfgEast:{flex:4}},0,["usermodule"],["component","box","container","uxpanelmodule","usermodule"],{component:true,box:true,container:true,uxpanelmodule:true,usermodule:true},["widget.usermodule"],0,[MBilling.view.user,"Module"],0));(Ext.cmd.derive("MBilling.view.user.List",Ext.ux.grid.Panel,{store:"User",fieldSearch:"username",initComponent:function(){var b=this;b.extraButtons=[{text:t("Bulk")+" "+t("User"),handler:"onBulk",width:100,disabled:false,hidden:App.user.isClient||!b.allowCreate}];b.columns=b.columns||[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("username"),dataIndex:"username",flex:2},{header:t("lastname"),dataIndex:"lastname",flex:3},{header:t("firstname"),dataIndex:"firstname",flex:3},{header:t("email"),dataIndex:"email",flex:window.isTablet?3:4},{header:t("credit"),dataIndex:"credit",renderer:Helper.Util.formatMoneyDecimal,flex:2},{xtype:"templatecolumn",tpl:"{idPlanname}",header:t("plan"),dataIndex:"id_plan",comboFilter:"plancombo",flex:3},{xtype:"templatecolumn",tpl:"{idGroupname}",header:t("group"),dataIndex:"id_group",comboFilter:"groupusercombo",flex:2,hidden:App.user.isClient||App.user.isAgent||window.isTablet,hideable:!App.user.isClient&&!App.user.isAgent},{header:t("agent"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:2,hidden:!App.user.isAdmin||window.isTablet,hideable:App.user.isAdmin},{header:t("status"),dataIndex:"active",renderer:Helper.Util.formatBooleanActive,flex:2,filter:{type:"list",options:[[1,t("active")],[2,t("pending")],[0,t("inactive")]]},hidden:App.user.isClient||window.isTablet,hideable:!App.user.isClient},{header:t("creationdate"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"creationdate",flex:4},{dataIndex:"id_offer",header:t("offer"),flex:2,hidden:true,hideable:!App.user.isClient&&!App.user.isAgent},{header:t("typepaid"),dataIndex:"typepaid",flex:2,renderer:Helper.Util.formattypepaid,filter:{type:"list",options:[[0,t("prepaid")],[1,t("pospaid")]]},hidden:true,hideable:!App.user.isClient&&!App.user.isAgent},{header:t("city"),dataIndex:"city",hidden:true,hideable:!App.user.isClient&&!App.user.isAgent,flex:1},{header:t("state"),dataIndex:"state",hidden:true,hideable:!App.user.isClient&&!App.user.isAgent,flex:1},{header:t("country"),dataIndex:"country",hidden:true,hideable:!App.user.isClient&&!App.user.isAgent,flex:1},{header:t("zipcode"),dataIndex:"zipcode",hidden:true,hideable:!App.user.isClient&&!App.user.isAgent,flex:1},{header:t("phone"),dataIndex:"phone",hidden:true,hideable:!App.user.isClient&&!App.user.isAgent,flex:1},{header:t("creditlimit"),dataIndex:"creditlimit",hidden:true,hideable:!App.user.isClient&&!App.user.isAgent,flex:1},{header:t("record_call"),dataIndex:"record_call",flex:1,renderer:Helper.Util.formattyyesno,filter:{type:"list",options:[[0,t("no")],[1,t("yes")]]},hidden:true,hideable:!App.user.isClient&&!App.user.isAgent},{header:t("CPS Limit"),dataIndex:"cpslimit",hidden:true,hideable:window.dialC&&App.user.isAdmin,flex:2}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["userlist"],["component","box","container","panel","tablepanel","gridpanel","grid","userlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,userlist:true},["widget.userlist"],0,[MBilling.view.user,"List"],0));(Ext.cmd.derive("MBilling.view.user.Form",Ext.ux.form.Panel,{autoHeight:300,bodyPadding:0,fieldsHideUpdateLot:["username","password","id_group_agent","id_offer","callingcard_pin"],initComponent:function(){var b=this;haveServiceMenu=false;Ext.each(App.user.menu,function(a){if(a.text=="t('Services')"){haveServiceMenu=true}});b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{labelAlign:"right",plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true}},items:[{title:t("general"),items:[{name:"username",fieldLabel:t("username"),maxLength:20,minLength:4,readOnly:App.user.isClient},{name:"password",fieldLabel:t("Password"),minLength:6,hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"id_group",fieldLabel:t("IdGroup"),xtype:"groupusercombo",allowBlank:!App.user.isAdmin,hidden:!App.user.isAdmin},{name:"id_group_agent",fieldLabel:t("GroupUser"),xtype:"groupuseragentcombo",emptyText:t("SELECT GROUP FOR AGENT USERS"),fieldLabel:t("Group for Agent Users"),hidden:true,allowBlank:true},{fieldLabel:t("Plan"),name:"id_plan",xtype:"planlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:App.user.isClient},{xtype:"languagecombo",name:"language",value:App.user.language=="pt_BR"?"br":App.user.language,fieldLabel:t("language")},{name:"prefix_local",fieldLabel:t("prefixlocal"),value:App.user.base_country=="BRL"?"0/55,*/5511/8,*/5511/9":App.user.base_country=="ARG"?"0/54,*/5411/8,15/54911/10,16/54911/10":"",allowBlank:true,emptyText:"match / replace / length",hidden:App.user.isClient},{xtype:"statususercombo",name:"active",fieldLabel:t("Active"),hidden:App.user.isClient,allowBlank:App.user.isClient},{xtype:"countrycombo",name:"country",fieldLabel:t("country"),value:App.user.language=="pt_BR"?"55":"1",allowBlank:true},{name:"id_offer",fieldLabel:t("offer"),xtype:"offercombo",allowBlank:true},{xtype:"numberfield",name:"cpslimit",fieldLabel:t("CPS Limit"),value:-1,minValue:-1,maxValue:50,hidden:!window.dialC||!App.user.isAdmin,allowBlank:true}]},{title:t("personalData"),itemId:"personalData",items:[{name:"company_name",fieldLabel:t("company")+" "+t("name"),allowBlank:true},{name:"state_number",fieldLabel:t("state_number"),allowBlank:true,hidden:App.user.base_country=!"BRL"},{name:"lastname",fieldLabel:t("lastname"),allowBlank:true,maxLength:40,minLength:4},{name:"firstname",fieldLabel:t("firstname"),allowBlank:true,maxLength:40,minLength:4},{xtype:"fieldcontainer",layout:"hbox",labelWidth:100,defaults:{xtype:"textfield",labelAlign:"right",flex:1},items:[{name:"city",fieldLabel:t("city"),allowBlank:true,maxLength:40,minLength:4,flex:2},{name:"state",fieldLabel:t("state"),allowBlank:true,maxLength:20,minLength:2}]},{name:"address",fieldLabel:t("address"),allowBlank:true},{name:"zipcode",fieldLabel:t("zipcode"),allowBlank:true},{xtype:"fieldcontainer",layout:"hbox",labelWidth:100,defaults:{xtype:"textfield",labelAlign:"right",flex:1},items:[{name:"phone",fieldLabel:t("phone"),allowBlank:true,maxLength:13,minLength:8},{name:"mobile",fieldLabel:t("mobile"),allowBlank:true,maxLength:20,minLength:8}]},{name:"email",fieldLabel:t("email"),allowBlank:true,vtype:"email"},{name:"doc",fieldLabel:t("Doc"),allowBlank:true},{name:"vat",fieldLabel:t("vat"),hidden:App.user.isClient,allowBlank:true}]},{title:t("suplementaryInfo"),itemId:"suplementaryInfo",defaults:{labelAlign:"right",plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true,labelWidth:145},items:[{xtype:"typepaymentcombo",name:"typepaid",fieldLabel:t("typepaid"),allowBlank:true,readOnly:App.user.isClient},{xtype:"fieldcontainer",layout:"hbox",defaults:{xtype:"textfield",labelAlign:"right",labelWidth:145,flex:1},items:[{name:"creditlimit",fieldLabel:t("creditlimit"),value:0,allowBlank:true,readOnly:App.user.isClient,flex:2},{xtype:"numberfield",name:"credit_notification",labelWidth:150,fieldLabel:t("creditnotification"),value:"-1",minValue:-1,allowBlank:true,flex:3}]},{xtype:"fieldcontainer",layout:"hbox",defaults:{xtype:"textfield",labelAlign:"right",labelWidth:145,flex:1},items:[{xtype:"noyescombo",name:"enableexpire",fieldLabel:t("enableexpire"),allowBlank:true,hidden:!App.user.isAdmin,flex:2},{xtype:"datefield",name:"expirationdate",fieldLabel:t("expirationdate"),format:"Y-m-d H:i:s",allowBlank:true,hidden:!App.user.isAdmin,labelWidth:150,flex:3}]},{xtype:"fieldcontainer",layout:"hbox",defaults:{xtype:"textfield",labelAlign:"right",labelWidth:145,flex:1},items:[{xtype:"noyescombo",name:"record_call",fieldLabel:t("record_call"),allowBlank:true,hidden:!haveServiceMenu||!App.user.isAdmin,readOnly:!App.user.isAdmin,flex:2},{labelWidth:150,xtype:"combobox",store:[["gsm",t("gsm")],["wav",t("wav")],["wav49",t("wav49")]],name:"mix_monitor_format",fieldLabel:t("Record call format"),forceSelection:true,editable:false,allowBlank:true,value:"gsm",hidden:!haveServiceMenu,flex:3}]},{xtype:"fieldcontainer",layout:"hbox",labelWidth:145,defaults:{labelAlign:"right",hidden:!haveServiceMenu,readOnly:!App.user.isAdmin,allowBlank:true,flex:1},items:[{labelWidth:145,xtype:"numberfield",name:"calllimit",fieldLabel:t("calllimit"),value:"-1",minValue:-1,flex:2},{labelWidth:150,xtype:"combobox",forceSelection:true,editable:false,name:"calllimit_error",fieldLabel:t("CallLimit Error"),value:"503",store:[["503",t("Congestion")],["403",t("Busy")]],flex:3}]},{xtype:"noyescombo",name:"callshop",fieldLabel:"Callshop",allowBlank:true,hidden:App.user.isClient},{xtype:"numberfield",name:"disk_space",fieldLabel:t("Disk Space"),value:-1,hidden:!haveServiceMenu,minValue:-1,readOnly:!App.user.isAdmin},{name:"sipaccountlimit",xtype:"numberfield",fieldLabel:t("Sip Account Limit"),value:"-1",minValue:-1,allowBlank:!App.user.isAdmin,readOnly:!App.user.isAdmin,hidden:!haveServiceMenu},{xtype:"numberfield",name:"callingcard_pin",fieldLabel:t("lockpin"),minValue:100000,maxLength:6,minLength:6},{xtype:"restrictioncombo",name:"restriction",fieldLabel:t("restriction"),allowBlank:true,hidden:App.user.isClient}]},{title:t("Send Credit"),itemId:"transferData",hidden:!window.transferToMobile,items:[{xtype:"fieldcontainer",layout:"hbox",hidden:App.user.isClient,defaults:{labelAlign:"right",labelWidth:145,allowBlank:true,flex:1},items:[{xtype:"noyescombo",name:"transfer_international",fieldLabel:t("Enable International")},{xtype:"numberfield",name:"transfer_international_profit",labelWidth:120,fieldLabel:t("Profit")}]},{xtype:"fieldcontainer",layout:"hbox",hidden:App.user.isClient,defaults:{labelAlign:"right",labelWidth:145,allowBlank:true,flex:1},items:[{xtype:"noyescombo",name:"transfer_flexiload",fieldLabel:t("Enable Flexiload")},{xtype:"numberfield",name:"transfer_flexiload_profit",labelWidth:120,fieldLabel:t("Profit")}]},{xtype:"fieldcontainer",layout:"hbox",hidden:App.user.isClient,defaults:{labelAlign:"right",labelWidth:145,allowBlank:true,flex:1},items:[{xtype:"noyescombo",name:"transfer_bkash",fieldLabel:t("Enable Bkash")},{xtype:"numberfield",name:"transfer_bkash_profit",labelWidth:120,fieldLabel:t("Profit")}]},{xtype:"fieldcontainer",layout:"hbox",hidden:App.user.isClient,defaults:{labelAlign:"right",labelWidth:145,allowBlank:true,flex:1},items:[{xtype:"noyescombo",name:"transfer_dbbl_rocket",fieldLabel:t("Enable DBBL/Rocket")},{xtype:"numberfield",name:"transfer_dbbl_rocket_profit",labelWidth:120,fieldLabel:t("Profit")}]},{xtype:"numberfield",name:"transfer_bdservice_rate",fieldLabel:t("BDService rate"),minValue:0,hidden:!App.user.isAdmin,allowBlank:true},{xtype:"numberfield",name:"transfer_show_selling_price",fieldLabel:t("show selling price"),allowBlank:true}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["userform"],["component","box","container","panel","form","userform"],{component:true,box:true,container:true,panel:true,form:true,userform:true},["widget.userform"],0,[MBilling.view.user,"Form"],0));(Ext.cmd.derive("Ext.ux.form.field.Lookup",Ext.form.FieldContainer,{layout:"fit",blankText:t("This field is required."),displayField:undefined,valueField:"id",gridConfig:{},windowConfig:{},iconClsSearch:"x-form-search-trigger",layout:"hbox",startX:150,hiddenSearchButton:false,eventsRelay:["dirtychange","validitychange","errorchange","specialkey","blur","keydown","keyup","keypress","change"],initComponent:function(){var b=this;b.store=Ext.data.StoreManager.lookup(b.store||"ext-empty-store");b.items=b.initSubFields();Ext.form.FieldContainer.prototype.initComponent.apply(this,arguments)},initSubFields:function(){var b=this;b.rawField=Ext.widget("textfield",{readOnly:true,flex:1,onClearButtonClick:b.reset,clearButtonScope:b,isFormField:false,listeners:{scope:b,change:b.onChangeRawField},triggers:{clear:{weight:0,cls:"x-form-clear-trigger",hidden:true,clickOnReadOnly:true,handler:b.reset,scope:b}}});b.relayEvents(b.rawField,b.eventsRelay);b.buttonSearch=Ext.widget("button",{iconCls:"ux-gridfilter-text-icon",scope:b,text:t("Search"),handler:b.onClickSearch,hidden:b.hiddenSearchButton});return[b.rawField,b.buttonSearch]},onChangeRawField:function(b){b.getTrigger("clear").show()},onClickSearch:function(e,f){var d=this;if(!d.windowSearch){d.list=Ext.widget(d.gridConfig.xtype,Ext.apply({selType:"checkboxmodel",selModel:{mode:"SINGLE"},allowCreate:false,allowUpdate:false,allowDelete:false,allowPrint:false,autoLoadList:false,buttonCsv:false,extraButtons:[],listeners:{scope:d,selectionchange:d.onSelectionChangeList,itemdblclick:d.onItemDblClick}},d.gridConfig));d.buttonOk=Ext.widget("button",{text:t("Ok"),width:70,disabled:true,glyph:icons.checkmark,scope:d,handler:d.onClickSelect});d.windowSearch=Ext.widget("window",Ext.apply({closeAction:"hide",header:false,layout:"fit",closable:false,resizable:true,draggable:false,baseCls:"x-panel",width:d.rawField.getWidth()+70+d.startX,height:d.rawField.getY()>250?300:Ext.getBody().getViewSize().height-270,items:d.list,bbar:["->",{text:t("Cancel"),glyph:icons.stop,scope:d,handler:function(){d.windowSearch.close()}},d.buttonOk],listeners:{scope:d,show:d.onShowWindowSearch}},d.windowConfig))}else{d.windowSearch.setWidth(d.rawField.getWidth()+23+d.startX)}d.windowSearch.showAt(d.rawField.getX()-d.startX,d.rawField.getY()+23)},onSelectionChangeList:function(d,c){this.recordSelected=c[0];this.buttonOk.setDisabled(!c.length)},onItemDblClick:function(d,c){this.selectRecord(c)},onClickSelect:function(){this.selectRecord()},selectRecord:function(c){var d=this;c=c||d.recordSelected;d.setValue(c.getId(),c.get(d.displayFieldList));d.windowSearch.close();d.list.store.defaultFilter=[];d.list.store.load()},onShowWindowSearch:function(f){var e=this,d=e.list.down("searchfield");d&&d.focus(true,10);!e.list.store.getCount()&&Ext.defer(function(){e.list.store.load()},10)},getErrors:function(){var d=this,c=[];if(d.allowBlank){return c}if(!d.getValue()){c.push(d.blankText);return c}return c},reset:function(){var b=this;b.rawField.reset();b.setValue("");b.rawField.getTrigger("clear").hide();b.rawField.updateLayout()},setValue:function(j,e){var f=this,g=f.ownerForm&&f.ownerForm.getRecord();if(!Ext.isEmpty(j)){e=e||(g&&g.get(f.displayField))}f.value=j;f.rawField.setValue(e||j);f.fireEvent("select",f,j)},getValue:function(){return this.value},getRawValue:function(){return this.rawField.getRawValue()}},0,0,["component","box","container","fieldcontainer"],{component:true,box:true,container:true,fieldcontainer:true},0,[["field",Ext.form.field.Field]],[Ext.ux.form.field,"Lookup"],0));(Ext.cmd.derive("MBilling.view.user.Lookup",Ext.ux.form.field.Lookup,{name:"id_user",fieldLabel:t("User"),displayField:"idUserusername",displayFieldList:"username",gridConfig:{xtype:"userlist",fieldSearch:"username",columns:[{header:t("username"),dataIndex:"username",flex:2},{header:t("email"),dataIndex:"email",flex:2},{header:t("lastname"),dataIndex:"lastname",flex:2},{header:t("credit"),dataIndex:"credit",renderer:Helper.Util.formatMoneyDecimal,flex:2}]}},0,["userlookup"],["component","box","container","fieldcontainer","userlookup"],{component:true,box:true,container:true,fieldcontainer:true,userlookup:true},["widget.userlookup"],0,[MBilling.view.user,"Lookup"],0));(Ext.cmd.derive("MBilling.view.user.Bulk",Ext.window.Window,{autoShow:true,modal:true,layout:"fit",iconCls:"icon-import-csv",title:t("Bulk User"),width:400,height:window.isThemeNeptune||window.isThemeCrisp?295:window.isThemeTriton?390:270,labelWidthFields:120,htmlTipInfo:"",fieldsImport:[],initComponent:function(){var b=this;b.items=[{xtype:"form",bodyPadding:5,defaults:{anchor:"0",enableKeyEvents:true,labelWidth:b.labelWidthFields,msgTarget:"side",plugins:"markallowblank",allowBlank:false},items:[{xtype:"numberfield",value:10,name:"totalToCreate",fieldLabel:t("How many users?")},{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,00",name:"credit",value:0,fieldLabel:t("Add")+" "+t("Refill"),readOnly:App.user.isClient},{xtype:"groupusercombo",allowBlank:!App.user.isAdmin,hidden:!App.user.isAdmin},{xtype:"languagecombo",name:"language",value:App.user.language=="pt_BR"?"br":App.user.language,fieldLabel:t("language")},{xtype:"plancombo",hidden:App.user.isClient,allowBlank:App.user.isClient},{xtype:"textfield",name:"prefix_local",fieldLabel:t("prefixlocal"),value:App.user.base_country=="BRL"?"0/55,*/5511/8,*/5511/9":App.user.base_country=="ARG"?"0/54,*/5411/8,15/54911/10,16/54911/10":"",allowBlank:true,emptyText:"match / replace / length",hidden:App.user.isClient},{xtype:"statususercombo",name:"active",fieldLabel:t("Active"),hidden:App.user.isClient,allowBlank:App.user.isClient}]}];b.title=b.title+(b.titleModule?" - "+b.titleModule:"");b.bbar=[{width:150,iconCls:"icon-import-csv",text:t("Bulk")+" "+t("User"),scope:b,handler:b.onBulk}];Ext.window.Window.prototype.initComponent.apply(this,arguments)},onBulk:function(d){var f=this,e=f.list.store;if(!f.down("form").isValid()){return}f.list.setLoading(true);Ext.Ajax.setTimeout(1000000);f.down("form").submit({url:"index.php/user/bulk",scope:f,success:function(c,b){var a=Ext.decode(b.response.responseText);console.log(a);if(a.success){Ext.ux.Alert.alert(t("Success"),a.msg,"success")}else{Ext.ux.Alert.alert(t("Error"),a.errors,"error")}d.enable();f.list.setLoading(false);e.load();f.close()},failure:function(c,b){console.log(b.response.responseText);if(b.response&&Ext.isObject(b.response.responseText)){var a=Ext.decode(b.response.responseText);Ext.ux.Alert.alert(t("Error1"),a.errors,"error")}else{Ext.ux.Alert.alert(t("Error2"),Ext.decode(b.response.responseText).msg,"error",true,10)}d.enable()}})}},0,["userbulk"],["component","box","container","panel","window","userbulk"],{component:true,box:true,container:true,panel:true,window:true,userbulk:true},["widget.userbulk"],0,[MBilling.view.user,"Bulk"],0));(Ext.cmd.derive("MBilling.view.configuration.Controller",Ext.ux.app.ViewController,{onAfterSave:function(g){var j=this,l=j.formPanel.getForm(),f=l.getRecord(),m=f.data.config_key;g=g||j.formPanel;if(!g.idRecord){g.getForm().reset();j.focusFirstField()}j.saveButton.enable();j.updateLotButton&&j.updateLotButton.toggle(false);g.setLoading(false);j.formPanel.collapse();j.store.load();j.logoutKey(m)},logoutKey:function(d){var c=this;if(d=="licence"||d=="base_language"){localStorage.setItem("day","");localStorage.setItem("lang","")}if(d=="licence"){Ext.Ajax.request({url:"index.php/authentication/logoff",success:function(){App.user.logged=false;location.reload()}})}}},0,0,0,0,["controller.configuration"],0,[MBilling.view.configuration,"Controller"],0));(Ext.cmd.derive("MBilling.view.configuration.Module",Ext.ux.panel.Module,{controller:"configuration"},0,["configurationmodule"],["component","box","container","uxpanelmodule","configurationmodule"],{component:true,box:true,container:true,uxpanelmodule:true,configurationmodule:true},["widget.configurationmodule"],0,[MBilling.view.configuration,"Module"],0));(Ext.cmd.derive("MBilling.view.configuration.List",Ext.ux.grid.Panel,{store:"Configuration",fieldSearch:"config_title",comparisonfilter:"ct",initComponent:function(){var b=this;b.allowPrint=false;b.buttonCsv=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowDelete=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("name"),dataIndex:"config_title"},{header:t("value"),dataIndex:"config_value"}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["configurationlist"],["component","box","container","panel","tablepanel","gridpanel","grid","configurationlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,configurationlist:true},["widget.configurationlist"],0,[MBilling.view.configuration,"List"],0));(Ext.cmd.derive("MBilling.view.configuration.Form",Ext.ux.form.Panel,{items:[{name:"config_value",fieldLabel:t("value"),allowBlank:true},{xtype:"textarea",name:"config_description",fieldLabel:t("description"),height:200,anchor:"100%",readOnly:true}]},0,["configurationform"],["component","box","container","panel","form","configurationform"],{component:true,box:true,container:true,panel:true,form:true,configurationform:true},["widget.configurationform"],0,[MBilling.view.configuration,"Form"],0));(Ext.cmd.derive("MBilling.view.general.BooleanCombo",Ext.form.field.ComboBox,{fieldLabel:t("status"),forceSelection:true,editable:false,value:1,store:[[1,t("active")],[0,t("inactive")]]},0,["booleancombo"],["component","box","field","textfield","pickerfield","combobox","combo","booleancombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,booleancombo:true},["widget.booleancombo"],0,[MBilling.view.general,"BooleanCombo"],0));(Ext.cmd.derive("MBilling.view.general.ServicesTypeCombo",Ext.form.field.ComboBox,{fieldLabel:t("status"),forceSelection:true,editable:false,value:"Custom",store:[["disk_space",t("disk_space")],["sipAccountLimit",t("Sip Account Limit")],["calllimit",t("calllimit")],["Custom",t("Custom")]]},0,["servicestypecombo"],["component","box","field","textfield","pickerfield","combobox","combo","servicestypecombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,servicestypecombo:true},["widget.servicestypecombo"],0,[MBilling.view.general,"ServicesTypeCombo"],0));(Ext.cmd.derive("MBilling.view.general.TypeSipForward",Ext.form.field.ComboBox,{fieldLabel:t("Forward"),forceSelection:true,editable:false,value:"",store:[["",t("")],["undefined",t("Undefined")],["sip",t("SIP")],["ivr",t("IVR")],["queue",t("Queue")],["group",t("Group")],["number",t("Number")],["hangup",t("Hangup")],["custom",t("Custom")]]},0,["typesipforwardcombo"],["component","box","field","textfield","pickerfield","combobox","combo","typesipforwardcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,typesipforwardcombo:true},["widget.typesipforwardcombo"],0,[MBilling.view.general,"TypeSipForward"],0));(Ext.cmd.derive("MBilling.view.general.TypeDestination",Ext.form.field.ComboBox,{fieldLabel:t("type"),forceSelection:true,editable:false,value:"",store:[["",t("")],["undefined",t("Undefined")],["sip",t("SIP")],["ivr",t("IVR")],["queue",t("Queue")],["group",t("Group")],["number",t("Number")],["repeat",t("Repeat IVR")],["hangup",t("Hangup")],["custom",t("Custom")]]},0,["typedestinationcombo"],["component","box","field","textfield","pickerfield","combobox","combo","typedestinationcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,typedestinationcombo:true},["widget.typedestinationcombo"],0,[MBilling.view.general,"TypeDestination"],0));(Ext.cmd.derive("MBilling.view.general.PontoVirgula",Ext.form.field.ComboBox,{fieldLabel:t("status"),forceSelection:true,editable:false,value:",",store:[[",",", ("+t("Comma")+")"],[";","; ("+t("Semicolon")+")"]]},0,["pontovirgulacombo"],["component","box","field","textfield","pickerfield","combobox","combo","pontovirgulacombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,pontovirgulacombo:true},["widget.pontovirgulacombo"],0,[MBilling.view.general,"PontoVirgula"],0));(Ext.cmd.derive("MBilling.view.general.StatusCombo",Ext.form.field.ComboBox,{fieldLabel:t("status"),forceSelection:true,editable:false,value:1,store:[[1,t("active")],[0,t("inactive")],[2,t("pending")],[3,t("sent")],[4,t("blocked")]]},0,["statuscombo"],["component","box","field","textfield","pickerfield","combobox","combo","statuscombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,statuscombo:true},["widget.statuscombo"],0,[MBilling.view.general,"StatusCombo"],0));(Ext.cmd.derive("MBilling.view.general.StatusUserCombo",Ext.form.field.ComboBox,{fieldLabel:t("status"),forceSelection:true,editable:false,value:1,store:[[1,t("active")],[0,t("inactive")],[2,t("pending")]]},0,["statususercombo"],["component","box","field","textfield","pickerfield","combobox","combo","statususercombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,statususercombo:true},["widget.statususercombo"],0,[MBilling.view.general,"StatusUserCombo"],0));(Ext.cmd.derive("MBilling.view.general.CallbackCombo",Ext.form.field.ComboBox,{fieldLabel:t("status"),forceSelection:true,editable:false,value:1,store:[[1,t("active")],[2,t("pending")],[3,t("sent")],[4,t("Not working")],[5,t("Complete")]]},0,["callbackcombo"],["component","box","field","textfield","pickerfield","combobox","combo","callbackcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,callbackcombo:true},["widget.callbackcombo"],0,[MBilling.view.general,"CallbackCombo"],0));(Ext.cmd.derive("MBilling.view.general.TypeNoYes",Ext.form.field.ComboBox,{fieldLabel:t("typepaid"),forceSelection:true,editable:false,value:0,store:[[0,t("no")],[1,t("yes")]]},0,["noyescombo"],["component","box","field","textfield","pickerfield","combobox","combo","noyescombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,noyescombo:true},["widget.noyescombo"],0,[MBilling.view.general,"TypeNoYes"],0));(Ext.cmd.derive("MBilling.view.general.TypeYesNo",Ext.form.field.ComboBox,{fieldLabel:t("typepaid"),forceSelection:true,editable:false,value:1,store:[[0,t("no")],[1,t("yes")]]},0,["yesnocombo"],["component","box","field","textfield","pickerfield","combobox","combo","yesnocombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,yesnocombo:true},["widget.yesnocombo"],0,[MBilling.view.general,"TypeYesNo"],0));(Ext.cmd.derive("MBilling.view.general.TypeYesNoString",Ext.form.field.ComboBox,{fieldLabel:t("typepaid"),forceSelection:true,editable:false,value:"yes",store:[["no",t("no")],["yes",t("yes")]]},0,["yesnostringcombo"],["component","box","field","textfield","pickerfield","combobox","combo","yesnostringcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,yesnostringcombo:true},["widget.yesnostringcombo"],0,[MBilling.view.general,"TypeYesNoString"],0));(Ext.cmd.derive("MBilling.view.general.TypeNoYesString",Ext.form.field.ComboBox,{fieldLabel:t("typepaid"),forceSelection:true,editable:false,value:"no",store:[["no",t("no")],["yes",t("yes")]]},0,["noyesstringcombo"],["component","box","field","textfield","pickerfield","combobox","combo","noyesstringcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,noyesstringcombo:true},["widget.noyesstringcombo"],0,[MBilling.view.general,"TypeNoYesString"],0));(Ext.cmd.derive("MBilling.view.general.Typenumber",Ext.form.field.ComboBox,{fieldLabel:t("typenumber"),forceSelection:true,editable:false,value:1,store:[[1,1],[2,2],[3,3],[4,4],[5,5]]},0,["numbercombo"],["component","box","field","textfield","pickerfield","combobox","combo","numbercombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,numbercombo:true},["widget.numbercombo"],0,[MBilling.view.general,"Typenumber"],0));(Ext.cmd.derive("MBilling.view.general.Typelanguage",Ext.form.field.ComboBox,{fieldLabel:t("language"),forceSelection:true,editable:false,value:"en",store:[["",t("undefined")],["br",t("portuguese")],["es",t("spanish")],["en",t("english")]]},0,["languagecombo"],["component","box","field","textfield","pickerfield","combobox","combo","languagecombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,languagecombo:true},["widget.languagecombo"],0,[MBilling.view.general,"Typelanguage"],0));(Ext.cmd.derive("MBilling.view.general.TypeCampaign",Ext.form.field.ComboBox,{fieldLabel:t("type"),forceSelection:true,editable:false,value:1,store:[[1,t("voice")],[0,t("sms")]]},0,["campaigntypecombo"],["component","box","field","textfield","pickerfield","combobox","combo","campaigntypecombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,campaigntypecombo:true},["widget.campaigntypecombo"],0,[MBilling.view.general,"TypeCampaign"],0));(Ext.cmd.derive("MBilling.view.general.TypeFullCampaign",Ext.form.field.ComboBox,{fieldLabel:t("type"),forceSelection:true,editable:false,value:1,store:[[1,t("voice")],[0,t("sms")]]},0,["campaigntypefullcombo"],["component","box","field","textfield","pickerfield","combobox","combo","campaigntypefullcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,campaigntypefullcombo:true},["widget.campaigntypefullcombo"],0,[MBilling.view.general,"TypeFullCampaign"],0));(Ext.cmd.derive("MBilling.view.general.TypeBoleto",Ext.form.field.ComboBox,{fieldLabel:t("status"),forceSelection:true,editable:false,value:"D",store:[["D",t("no")],["P",t("yes")]]},0,["boletocombo"],["component","box","field","textfield","pickerfield","combobox","combo","boletocombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,boletocombo:true},["widget.boletocombo"],0,[MBilling.view.general,"TypeBoleto"],0));(Ext.cmd.derive("MBilling.view.general.RestrictionCombo",Ext.form.field.ComboBox,{fieldLabel:t("status"),forceSelection:true,editable:false,value:0,store:[[0,t("inactive")],[1,t("cantCallRestrictedNumbers")],[2,t("canOnlyCallRestrictedNumbers")]]},0,["restrictioncombo"],["component","box","field","textfield","pickerfield","combobox","combo","restrictioncombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,restrictioncombo:true},["widget.restrictioncombo"],0,[MBilling.view.general,"RestrictionCombo"],0));(Ext.cmd.derive("MBilling.view.general.CountryISOCombo",Ext.form.field.ComboBox,{forceSelection:true,editable:true,listeners:{focus:function(b){b.expand()}},store:[["AFG",t("Afghanistan")],["ALA",t("Åland Islands")],["ALB",t("Albania")],["DZA",t("Algeria")],["ASM",t("American Samoa")],["AND",t("Andorra")],["AGO",t("Angola")],["AIA",t("Anguilla")],["ATA",t("Antarctica")],["ATG",t("Antigua and Barbuda")],["ARG",t("Argentina")],["ARM",t("Armenia")],["ABW",t("Aruba")],["AUS",t("Australia")],["AUT",t("Austria")],["AZE",t("Azerbaijan")],["BHS",t("Bahamas")],["BHR",t("Bahrain")],["BGD",t("Bangladesh")],["BRB",t("Barbados")],["BLR",t("Belarus")],["BEL",t("Belgium")],["BLZ",t("Belize")],["BEN",t("Benin")],["BMU",t("Bermuda")],["BTN",t("Bhutan")],["BOL",t("Bolivia, Plurinational State of")],["BES",t("Bonaire, Sint Eustatius and Saba")],["BIH",t("Bosnia and Herzegovina")],["BWA",t("Botswana")],["BVT",t("Bouvet Island")],["BRL",t("Brazil")],["IOT",t("British Indian Ocean Territory")],["BRN",t("Brunei Darussalam")],["BGR",t("Bulgaria")],["BFA",t("Burkina Faso")],["BDI",t("Burundi")],["KHM",t("Cambodia")],["CMR",t("Cameroon")],["CAN",t("Canada")],["CPV",t("Cape Verde")],["CYM",t("Cayman Islands")],["CAF",t("Central African Republic")],["TCD",t("Chad")],["CHL",t("Chile")],["CHN",t("China")],["CXR",t("Christmas Island")],["CCK",t("Cocos (Keeling) Islands")],["COL",t("Colombia")],["COM",t("Comoros")],["COG",t("Congo")],["COD",t("Congo, the Democratic Republic of the")],["COK",t("Cook Islands")],["CRI",t("Costa Rica")],["CIV",t("Côte dIvoire")],["HRV",t("Croatia")],["CUB",t("Cuba")],["CUW",t("Curaçao")],["CYP",t("Cyprus")],["CZE",t("Czech Republic")],["DNK",t("Denmark")],["DJI",t("Djibouti")],["DMA",t("Dominica")],["DOM",t("Dominican Republic")],["ECU",t("Ecuador")],["EGY",t("Egypt")],["SLV",t("El Salvador")],["GNQ",t("Equatorial Guinea")],["ERI",t("Eritrea")],["EST",t("Estonia")],["ETH",t("Ethiopia")],["FLK",t("Falkland Islands (Malvinas)")],["FRO",t("Faroe Islands")],["FJI",t("Fiji")],["FIN",t("Finland")],["FRA",t("France")],["GUF",t("French Guiana")],["PYF",t("French Polynesia")],["ATF",t("French Southern Territories")],["GAB",t("Gabon")],["GMB",t("Gambia")],["GEO",t("Georgia")],["DEU",t("Germany")],["GHA",t("Ghana")],["GIB",t("Gibraltar")],["GRC",t("Greece")],["GRL",t("Greenland")],["GRD",t("Grenada")],["GLP",t("Guadeloupe")],["GUM",t("Guam")],["GTM",t("Guatemala")],["GGY",t("Guernsey")],["GIN",t("Guinea")],["GNB",t("Guinea-Bissau")],["GUY",t("Guyana")],["HTI",t("Haiti")],["HMD",t("Heard Island and McDonald Islands")],["VAT",t("Holy See (Vatican City State)")],["HND",t("Honduras")],["HKG",t("Hong Kong")],["HUN",t("Hungary")],["ISL",t("Iceland")],["IND",t("India")],["IDN",t("Indonesia")],["IRN",t("Iran, Islamic Republic of")],["IRQ",t("Iraq")],["IRL",t("Ireland")],["IMN",t("Isle of Man")],["ISR",t("Israel")],["ITA",t("Italy")],["JAM",t("Jamaica")],["JPN",t("Japan")],["JEY",t("Jersey")],["JOR",t("Jordan")],["KAZ",t("Kazakhstan")],["KEN",t("Kenya")],["KIR",t("Kiribati")],["PRK",t("Korea, Democratic Peoples Republic of")],["KOR",t("Korea, Republic of")],["KWT",t("Kuwait")],["KGZ",t("Kyrgyzstan")],["LAO",t("Lao Peoples Democratic Republic")],["LVA",t("Latvia")],["LBN",t("Lebanon")],["LSO",t("Lesotho")],["LBR",t("Liberia")],["LBY",t("Libya")],["LIE",t("Liechtenstein")],["LTU",t("Lithuania")],["LUX",t("Luxembourg")],["MAC",t("Macao")],["MKD",t("Macedonia, the former Yugoslav Republic of")],["MDG",t("Madagascar")],["MWI",t("Malawi")],["MYS",t("Malaysia")],["MDV",t("Maldives")],["MLI",t("Mali")],["MLT",t("Malta")],["MHL",t("Marshall Islands")],["MTQ",t("Martinique")],["MRT",t("Mauritania")],["MUS",t("Mauritius")],["MYT",t("Mayotte")],["MEX",t("Mexico")],["FSM",t("Micronesia, Federated States of")],["MDA",t("Moldova, Republic of")],["MCO",t("Monaco")],["MNG",t("Mongolia")],["MNE",t("Montenegro")],["MSR",t("Montserrat")],["MAR",t("Morocco")],["MOZ",t("Mozambique")],["MMR",t("Myanmar")],["NAM",t("Namibia")],["NRU",t("Nauru")],["NPL",t("Nepal")],["NLD",t("Netherlands")],["NCL",t("New Caledonia")],["NZL",t("New Zealand")],["NIC",t("Nicaragua")],["NER",t("Niger")],["NGA",t("Nigeria")],["NIU",t("Niue")],["NFK",t("Norfolk Island")],["MNP",t("Northern Mariana Islands")],["NOR",t("Norway")],["OMN",t("Oman")],["PAK",t("Pakistan")],["PLW",t("Palau")],["PSE",t("Palestinian Territory, Occupied")],["PAN",t("Panama")],["PNG",t("Papua New Guinea")],["PRY",t("Paraguay")],["PER",t("Peru")],["PHL",t("Philippines")],["PCN",t("Pitcairn")],["POL",t("Poland")],["PRT",t("Portugal")],["PRI",t("Puerto Rico")],["QAT",t("Qatar")],["REU",t("Réunion")],["ROU",t("Romania")],["RUS",t("Russian Federation")],["RWA",t("Rwanda")],["BLM",t("Saint Barthélemy")],["SHN",t("Saint Helena, Ascension and Tristan da Cunha")],["KNA",t("Saint Kitts and Nevis")],["LCA",t("Saint Lucia")],["MAF",t("Saint Martin (French part)")],["SPM",t("Saint Pierre and Miquelon")],["VCT",t("Saint Vincent and the Grenadines")],["WSM",t("Samoa")],["SMR",t("San Marino")],["STP",t("Sao Tome and Principe")],["SAU",t("Saudi Arabia")],["SEN",t("Senegal")],["SRB",t("Serbia")],["SYC",t("Seychelles")],["SLE",t("Sierra Leone")],["SGP",t("Singapore")],["SXM",t("Sint Maarten (Dutch part)")],["SVK",t("Slovakia")],["SVN",t("Slovenia")],["SLB",t("Solomon Islands")],["SOM",t("Somalia")],["ZAF",t("South Africa")],["SGS",t("South Georgia and the South Sandwich Islands")],["SSD",t("South Sudan")],["ESP",t("Spain")],["LKA",t("Sri Lanka")],["SDN",t("Sudan")],["SUR",t("Suriname")],["SJM",t("Svalbard and Jan Mayen")],["SWZ",t("Swaziland")],["SWE",t("Sweden")],["CHE",t("Switzerland")],["SYR",t("Syrian Arab Republic")],["TWN",t("Taiwan, Province of China")],["TJK",t("Tajikistan")],["TZA",t("Tanzania, United Republic of")],["THA",t("Thailand")],["TLS",t("Timor-Leste")],["TGO",t("Togo")],["TKL",t("Tokelau")],["TON",t("Tonga")],["TTO",t("Trinidad and Tobago")],["TUN",t("Tunisia")],["TUR",t("Turkey")],["TKM",t("Turkmenistan")],["TCA",t("Turks and Caicos Islands")],["TUV",t("Tuvalu")],["UGA",t("Uganda")],["UKR",t("Ukraine")],["ARE",t("United Arab Emirates")],["GBR",t("United Kingdom")],["USA",t("United States")],["UMI",t("United States Minor Outlying Islands")],["URY",t("Uruguay")],["UZB",t("Uzbekistan")],["VUT",t("Vanuatu")],["VEN",t("Venezuela, Bolivarian Republic of")],["VNM",t("Viet Nam")],["VGB",t("Virgin Islands, British")],["VIR",t("Virgin Islands, U.S.")],["WLF",t("Wallis and Futuna")],["ESH",t("Western Sahara")],["YEM",t("Yemen")],["ZMB",t("Zambia")],["ZWE",t("Zimbabwe")]]},0,["countryisocombo"],["component","box","field","textfield","pickerfield","combobox","combo","countryisocombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,countryisocombo:true},["widget.countryisocombo"],0,[MBilling.view.general,"CountryISOCombo"],0));(Ext.cmd.derive("MBilling.view.general.CountryCombo",Ext.form.field.ComboBox,{fieldLabel:t("Country"),forceSelection:true,editable:true,allowBlank:true,listeners:{focus:function(b){b.expand()}},store:[["",t("Select")],["93",t("Afghanistan")],["355",t("Albania")],["213",t("Algeria")],["684",t("American Samoa")],["376",t("Andorra")],["244",t("Angola")],["1264",t("Anguilla")],["672",t("Antarctica")],["1268",t("Antigua And Barbuda")],["54",t("Argentina")],["374",t("Armenia")],["297",t("Aruba")],["61",t("Australia")],["43",t("Austria")],["994",t("Azerbaijan")],["1242",t("Bahamas")],["973",t("Bahrain")],["880",t("Bangladesh")],["1246",t("Barbados")],["375",t("Belarus")],["32",t("Belgium")],["501",t("Belize")],["229",t("Benin")],["1441",t("Bermuda")],["975",t("Bhutan")],["591",t("Bolivia")],["387",t("Bosnia And Herzegovina")],["267",t("Botswana")],["55",t("Brazil")],["1284",t("British Indian Ocean Territory")],["673",t("Brunei Darussalam")],["359",t("Bulgaria")],["226",t("Burkina Faso")],["257",t("Burundi")],["855",t("Cambodia")],["237",t("Cameroon")],["238",t("Cape Verde")],["1345",t("Cayman Islands")],["236",t("Central African Republic")],["235",t("Chad")],["56",t("Chile")],["86",t("China")],["618",t("Christmas Island")],["61",t("Cocos (Keeling); Islands")],["57",t("Colombia")],["269",t("Comoros")],["242",t("Congo")],["243",t("Congo, The Democratic Republic Of The")],["682",t("Cook Islands")],["506",t("Costa Rica")],["385",t("Croatia")],["53",t("Cuba")],["357",t("Cyprus")],["420",t("Czech Republic")],["45",t("Denmark")],["253",t("Djibouti")],["1767",t("Dominica")],["1809",t("Dominican Republic")],["593",t("Ecuador")],["20",t("Egypt")],["503",t("El Salvador")],["240",t("Equatorial Guinea")],["291",t("Eritrea")],["372",t("Estonia")],["251",t("Ethiopia")],["500",t("Falkland Islands (Malvinas)")],["298",t("Faroe Islands")],["679",t("Fiji")],["358",t("Finland")],["33",t("France")],["596",t("French Guiana")],["594",t("French Polynesia")],["689",t("French Southern Territories")],["241",t("Gabon")],["220",t("Gambia")],["995",t("Georgia")],["49",t("Germany")],["233",t("Ghana")],["350",t("Gibraltar")],["30",t("Greece")],["299",t("Greenland")],["1473",t("Grenada")],["590",t("Guadeloupe")],["1671",t("Guam")],["502",t("Guatemala")],["224",t("Guinea")],["245",t("Guinea-Bissau")],["592",t("Guyana")],["509",t("Haiti")],["504",t("Honduras")],["852",t("Hong Kong")],["36",t("Hungary")],["354",t("Iceland")],["91",t("India")],["62",t("Indonesia")],["98",t("Iran, Islamic Republic Of")],["964",t("Iraq")],["353",t("Ireland")],["972",t("Israel")],["39",t("Italy")],["1876",t("Jamaica")],["81",t("Japan")],["962",t("Jordan")],["7",t("Kazakhstan")],["254",t("Kenya")],["686",t("Kiribati")],["850",t("Korea, Democratic Peoples Republic Of")],["82",t("Korea, Republic of")],["965",t("Kuwait")],["996",t("Kyrgyzstan")],["856",t("Lao Peoples Democratic Republic")],["371",t("Latvia")],["961",t("Lebanon")],["266",t("Lesotho")],["231",t("Liberia")],["218",t("Libyan Arab Jamahiriya")],["423",t("Liechtenstein")],["370",t("Lithuania")],["352",t("Luxembourg")],["853",t("Macao")],["389",t("Macedonia, The Former Yugoslav Republic Of")],["261",t("Madagascar")],["265",t("Malawi")],["60",t("Malaysia")],["960",t("Maldives")],["223",t("Mali")],["356",t("Malta")],["692",t("Marshall islands")],["596",t("Martinique")],["222",t("Mauritania")],["230",t("Mauritius")],["269",t("Mayotte")],["52",t("Mexico")],["691",t("Micronesia, Federated States Of")],["1808",t("Moldova, Republic Of")],["377",t("Monaco")],["976",t("Mongolia")],["1664",t("Montserrat")],["212",t("Morocco")],["258",t("Mozambique")],["95",t("Myanmar")],["264",t("Namibia")],["674",t("Nauru")],["977",t("Nepal")],["31",t("Netherlands")],["599",t("Netherlands Antilles")],["687",t("New Caledonia")],["64",t("New Zealand")],["505",t("Nicaragua")],["227",t("Niger")],["234",t("Nigeria")],["683",t("Niue")],["672",t("Norfolk Island")],["1670",t("Northern Mariana Islands")],["47",t("Norway")],["968",t("Oman")],["92",t("Pakistan")],["680",t("Palau")],["970",t("Palestinian Territory, Occupied")],["507",t("Panama")],["675",t("Papua New Guinea")],["595",t("Paraguay")],["51",t("Peru")],["63",t("Philippines")],["48",t("Poland")],["351",t("Portugal")],["1787",t("Puerto Rico")],["974",t("Qatar")],["262",t("Reunion")],["40",t("Romania")],["7",t("Russian Federation")],["250",t("Rwanda")],["290",t("SaINT Helena")],["1869",t("SaINT Kitts And Nevis")],["1758",t("SaINT Lucia")],["508",t("SaINT Pierre And Miquelon")],["1784",t("SaINT Vincent And The Grenadines")],["685",t("Samoa")],["378",t("San Marino")],["239",t("São Tomé And Principe")],["966",t("Saudi Arabia")],["221",t("Senegal")],["248",t("Seychelles")],["232",t("Sierra Leone")],["65",t("Singapore")],["421",t("Slovakia")],["386",t("Slovenia")],["677",t("Solomon Islands")],["252",t("Somalia")],["27",t("South Africa")],["34",t("Spain")],["94",t("Sri Lanka")],["249",t("Sudan")],["597",t("Suriname")],["268",t("Swaziland")],["46",t("Sweden")],["41",t("Switzerland")],["963",t("Syrian Arab Republic")],["886",t("Taiwan, Province Of China")],["992",t("Tajikistan")],["255",t("Tanzania, United Republic Of")],["66",t("Thailand")],["670",t("Timor-Leste")],["228",t("Togo")],["690",t("Tokelau")],["676",t("Tonga")],["1868",t("Trinidad And Tobago")],["216",t("Tunisia")],["90",t("Turkey")],["993",t("Turkmenistan")],["1649",t("Turks And Caicos Islands")],["688",t("Tuvalu")],["256",t("Uganda")],["380",t("Ukraine")],["971",t("United Arab Emirates")],["44",t("United Kingdom")],["1",t("United States/Canada")],["598",t("Uruguay")],["998",t("Uzbekistan")],["678",t("Vanuatu")],["58",t("Venezuela")],["84",t("Vietnam")],["1284",t("Virgin Islands, British")],["808",t("Virgin Islands, U.S.")],["681",t("Wallis And Futuna")],["967",t("Yemen")],["260",t("Zambia")],["263",t("Zimbabwe")],["35818",t("Aland Islands")],["441481",t("Guernsey")],["441624",t("Isle of Man")],["441534",t("Jersey")],["382",t("Montenegro, Republic of")],["381",t("Serbia, Republic of")]]},0,["countrycombo"],["component","box","field","textfield","pickerfield","combobox","combo","countrycombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,countrycombo:true},["widget.countrycombo"],0,[MBilling.view.general,"CountryCombo"],0));(Ext.cmd.derive("MBilling.view.general.GroupCombo",Ext.form.field.ComboBox,{fieldLabel:t("group"),value:"config_group_title",forceSelection:true,editable:false,store:[["global","global"],["callback","callback"],["agi-conf1","agi-conf1"],["agi-conf2","agi-conf2"]]},0,["groupcombo"],["component","box","field","textfield","pickerfield","combobox","combo","groupcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,groupcombo:true},["widget.groupcombo"],0,[MBilling.view.general,"GroupCombo"],0));(Ext.cmd.derive("MBilling.view.general.LcrtypeCombo",Ext.form.field.ComboBox,{fieldLabel:t("lcrtype"),forceSelection:true,editable:false,value:1,store:[[1,t("LCRAccordingtothebuyerPrice")],[0,t("LCRAccordingtothesellerPrice")]]},0,["lcrtypecombo"],["component","box","field","textfield","pickerfield","combobox","combo","lcrtypecombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,lcrtypecombo:true},["widget.lcrtypecombo"],0,[MBilling.view.general,"LcrtypeCombo"],0));(Ext.cmd.derive("MBilling.view.general.LcrtypeFullCombo",Ext.form.field.ComboBox,{forceSelection:true,editable:false,fieldLabel:t("lcrtype"),value:1,store:[[1,t("LCRAccordingtothebuyerPrice")],[0,t("LCRAccordingtothesellerPrice")],[2,t("Load Balancer")]]},0,["lcrtypefullcombo"],["component","box","field","textfield","pickerfield","combobox","combo","lcrtypefullcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,lcrtypefullcombo:true},["widget.lcrtypefullcombo"],0,[MBilling.view.general,"LcrtypeFullCombo"],0));(Ext.cmd.derive("MBilling.view.general.OfferTypeCombo",Ext.form.field.ComboBox,{fieldLabel:t("offertype"),forceSelection:true,editable:false,value:0,store:[[0,t("unlimitedcalls")],[1,t("numberfreecalls")],[2,t("freeseconds")]]},0,["offertypecombo"],["component","box","field","textfield","pickerfield","combobox","combo","offertypecombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,offertypecombo:true},["widget.offertypecombo"],0,[MBilling.view.general,"OfferTypeCombo"],0));(Ext.cmd.derive("MBilling.view.general.BillingTypeCombo",Ext.form.field.ComboBox,{fieldLabel:t("billingtype"),forceSelection:true,editable:false,value:0,store:[[0,t("monthly")],[1,t("weekly")]]},0,["billingtypecombo"],["component","box","field","textfield","pickerfield","combobox","combo","billingtypecombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,billingtypecombo:true},["widget.billingtypecombo"],0,[MBilling.view.general,"BillingTypeCombo"],0));(Ext.cmd.derive("MBilling.view.general.SipCombo",Ext.form.field.ComboBox,{fieldLabel:t("providertech"),forceSelection:true,editable:false,value:"sip",store:[["sip","sip"],["dahdi","dahdi"],["khomp","khomp"],["iax2","iax2"],["dgv","dgv"],["ooh323","ooh323"],["extra","extra"],["Dongle","Dongle"],["Local","Local"]]},0,["sipcombo"],["component","box","field","textfield","pickerfield","combobox","combo","sipcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,sipcombo:true},["widget.sipcombo"],0,[MBilling.view.general,"SipCombo"],0));(Ext.cmd.derive("MBilling.view.general.TypePaymentCombo",Ext.form.field.ComboBox,{fieldLabel:t("typepaid"),forceSelection:true,editable:false,value:0,store:[[0,t("prepaid")],[1,t("pospaid")]]},0,["typepaymentcombo"],["component","box","field","textfield","pickerfield","combobox","combo","typepaymentcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,typepaymentcombo:true},["widget.typepaymentcombo"],0,[MBilling.view.general,"TypePaymentCombo"],0));(Ext.cmd.derive("MBilling.view.general.CampaignSendCombo",Ext.form.field.ComboBox,{fieldLabel:t("type"),forceSelection:true,editable:false,displayField:"name",valueField:"id",value:"CALL1",store:{fields:["id","name"],data:[{id:"CALL1",name:t("Select type"),showFields:["type"]},{id:"SMS",name:"SMS",showFields:["type","sms_text","csv_path","numbers","startingdate","startingtime"]},{id:"CALL",name:"CALL",showFields:["type","audio_path","csv_path","numbers","startingdate","startingtime"]}]}},0,["campaignsendcombo"],["component","box","field","textfield","pickerfield","combobox","combo","campaignsendcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,campaignsendcombo:true},["widget.campaignsendcombo"],0,[MBilling.view.general,"CampaignSendCombo"],0));(Ext.cmd.derive("MBilling.view.general.PaymentCountryCombo",Ext.form.field.ComboBox,{fieldLabel:t("typepaid"),value:"Brasil",forceSelection:true,editable:true,listeners:{focus:function(b){b.expand()}},store:[["Argentina","Argentina"],["Brasil","Brasil"],["Colombia","Colombia"],["Latino America","Latino America"],["Global","Global"]]},0,["paymentcountrycombo"],["component","box","field","textfield","pickerfield","combobox","combo","paymentcountrycombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,paymentcountrycombo:true},["widget.paymentcountrycombo"],0,[MBilling.view.general,"PaymentCountryCombo"],0));(Ext.cmd.derive("MBilling.view.general.BoletoBanckCombo",Ext.form.field.ComboBox,{fieldLabel:t("Banco"),forceSelection:true,editable:false,value:"cef",store:[["cef","Caixa Economica SICOB"],["bradesco","Bradesco"]]},0,["boletobanckcombo"],["component","box","field","textfield","pickerfield","combobox","combo","boletobanckcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,boletobanckcombo:true},["widget.boletobanckcombo"],0,[MBilling.view.general,"BoletoBanckCombo"],0));(Ext.cmd.derive("MBilling.view.general.PaymentBanckCombo",Ext.form.field.ComboBox,{fieldLabel:t("typepaid"),forceSelection:true,editable:false,value:"Banco do Brasil",store:[["Banco do Brasil","Banco do Brasil"],["bradesco","Bradesco"],["hsbc","Hsbc"],["itau","Itau"],["santander","Santander"],["unibanco","Unibanco"],["cef","Caixa Economica SICOB"],["cef_sinco","Caixa Economica SINCO"],["cef_sigcb","Caixa Economica SIGCB"]]},0,["paymentbanckcombo"],["component","box","field","textfield","pickerfield","combobox","combo","paymentbanckcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,paymentbanckcombo:true},["widget.paymentbanckcombo"],0,[MBilling.view.general,"PaymentBanckCombo"],0));(Ext.cmd.derive("MBilling.view.templateMail.Controller",Ext.ux.app.ViewController,{onAfterSave:function(d){var c=this;d=d||c.formPanel;if(!d.idRecord){d.getForm().reset();c.focusFirstField()}c.saveButton.enable();c.updateLotButton&&c.updateLotButton.toggle(false);d.setLoading(false);c.store.load()},onEdit:function(){var b=this;b.lookupReference("generalTab").show();Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)}},0,0,0,0,["controller.templatemail"],0,[MBilling.view.templateMail,"Controller"],0));(Ext.cmd.derive("MBilling.view.templateMail.Module",Ext.ux.panel.Module,{controller:"templatemail",cfgEast:{flex:9}},0,["templatemailmodule"],["component","box","container","uxpanelmodule","templatemailmodule"],{component:true,box:true,container:true,uxpanelmodule:true,templatemailmodule:true},["widget.templatemailmodule"],0,[MBilling.view.templateMail,"Module"],0));(Ext.cmd.derive("MBilling.view.templateMail.List",Ext.ux.grid.Panel,{store:"TemplateMail",initComponent:function(){var b=this;b.allowPrint=false;b.buttonCsv=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowDelete=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("type"),dataIndex:"mailtype",flex:3},{header:t("Language"),renderer:Helper.Util.formatLanguageImage,dataIndex:"language",flex:2},{header:t("subject"),dataIndex:"subject",flex:7}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["templatemaillist"],["component","box","container","panel","tablepanel","gridpanel","grid","templatemaillist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,templatemaillist:true},["widget.templatemaillist"],0,[MBilling.view.templateMail,"List"],0));(Ext.cmd.derive("MBilling.view.templateMail.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true}},items:[{title:t("general"),reference:"generalTab",items:[{name:"fromname",fieldLabel:t("fromname")},{name:"fromemail",fieldLabel:t("fromemail")},{name:"subject",fieldLabel:t("subject")}]},{title:t("Email body"),items:[{hideLabel:true,xtype:"htmleditor",name:"messagehtml",fieldLabel:t("description"),height:1000,anchor:"100%"}]},{title:t("Variables"),items:[{xtype:"displayfield",fieldLabel:t("username"),value:'$login$',allowBlank:true},{xtype:"displayfield",fieldLabel:t("password"),value:'$password$',allowBlank:true},{xtype:"displayfield",fieldLabel:t("email"),value:'$email$',allowBlank:true},{xtype:"displayfield",fieldLabel:t("firstname"),value:'$firstname$',allowBlank:true},{xtype:"displayfield",fieldLabel:t("lastname"),value:'$lastname$',allowBlank:true},{xtype:"displayfield",fieldLabel:t("credit"),value:'$credit$',allowBlank:true},{xtype:"displayfield",fieldLabel:t("date"),value:'$time$',allowBlank:true},{xtype:"displayfield",fieldLabel:t("description"),value:'$description$',allowBlank:true},{xtype:"displayfield",fieldLabel:t("Url to cancel email credit notification"),value:'$cancel_credit_notification_email$',allowBlank:true}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["templatemailform"],["component","box","container","panel","form","templatemailform"],{component:true,box:true,container:true,panel:true,form:true,templatemailform:true},["widget.templatemailform"],0,[MBilling.view.templateMail,"Form"],0));(Ext.cmd.derive("MBilling.view.logUsers.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.logusers"],0,[MBilling.view.logUsers,"Controller"],0));(Ext.cmd.derive("MBilling.view.logUsers.Module",Ext.ux.panel.Module,{controller:"logusers"},0,["logusersmodule"],["component","box","container","uxpanelmodule","logusersmodule"],{component:true,box:true,container:true,uxpanelmodule:true,logusersmodule:true},["widget.logusersmodule"],0,[MBilling.view.logUsers,"Module"],0));(Ext.cmd.derive("MBilling.view.logUsers.List",Ext.ux.grid.Panel,{store:"LogUsers",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.allowDelete=false;b.allowCreate=false;b.allowUpdate=false;b.columns=[{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isOperator,hideable:!App.user.isOperator},{header:t("action"),dataIndex:"idLogActionsname",renderer:Helper.Util.translate,flex:3},{header:t("description"),dataIndex:"description",flex:7},{header:t("IP"),dataIndex:"ip",flex:4},{header:t("date"),renderer:Helper.Util.formatDateTime,dataIndex:"date",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["loguserslist"],["component","box","container","panel","tablepanel","gridpanel","grid","loguserslist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,loguserslist:true},["widget.loguserslist"],0,[MBilling.view.logUsers,"List"],0));(Ext.cmd.derive("MBilling.view.logUsers.Form",Ext.ux.form.Panel,{fieldsHideEdit:["cid"],initComponent:function(){var b=this;b.items=[{xtype:"usercombo",allowBlank:true,readOnly:true},{name:"id_log_actions",fieldLabel:t("action"),readOnly:true},{name:"ip",fieldLabel:t("ip"),readOnly:true},{xtype:"textareafield",name:"description",fieldLabel:t("description"),height:400,anchor:"100%",allowBlank:true,readOnly:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["logusersform"],["component","box","container","panel","form","logusersform"],{component:true,box:true,container:true,panel:true,form:true,logusersform:true},["widget.logusersform"],0,[MBilling.view.logUsers,"Form"],0));(Ext.cmd.derive("MBilling.view.provider.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.provider"],0,[MBilling.view.provider,"Controller"],0));(Ext.cmd.derive("MBilling.view.provider.Combo",Ext.form.field.ComboBox,{name:"id_provider",fieldLabel:t("provider"),forceSelection:true,editable:false,displayField:"provider_name",valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Provider",{proxy:{type:"uxproxy",module:"provider",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["providercombo"],["component","box","field","textfield","pickerfield","combobox","combo","providercombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,providercombo:true},["widget.providercombo"],0,[MBilling.view.provider,"Combo"],0));(Ext.cmd.derive("MBilling.view.provider.Module",Ext.ux.panel.Module,{controller:"provider"},0,["providermodule"],["component","box","container","uxpanelmodule","providermodule"],{component:true,box:true,container:true,uxpanelmodule:true,providermodule:true},["widget.providermodule"],0,[MBilling.view.provider,"Module"],0));(Ext.cmd.derive("MBilling.view.provider.List",Ext.ux.grid.Panel,{store:"Provider",initComponent:function(){var b=this;b.columns=b.columns||[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("name"),dataIndex:"provider_name"},{header:t("description"),dataIndex:"description"},{header:t("credit"),dataIndex:"credit",renderer:Helper.Util.formatMoneyDecimal},{header:t("creationdate"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"creationdate"}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["providerlist"],["component","box","container","panel","tablepanel","gridpanel","grid","providerlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,providerlist:true},["widget.providerlist"],0,[MBilling.view.provider,"List"],0));(Ext.cmd.derive("MBilling.view.provider.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["provider_name"],initComponent:function(){var b=this;b.items=[{name:"provider_name",fieldLabel:t("name")},{xtype:"moneyfield",name:"credit",mask:App.user.currency+" #9.999.990,00",fieldLabel:t("credit"),value:"0"},{xtype:"noyescombo",name:"credit_control",fieldLabel:t("Credit")+" "+t("control"),hidden:App.user.isClient},{xtype:"textareafield",name:"description",fieldLabel:t("description"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["providerform"],["component","box","container","panel","form","providerform"],{component:true,box:true,container:true,panel:true,form:true,providerform:true},["widget.providerform"],0,[MBilling.view.provider,"Form"],0));(Ext.cmd.derive("MBilling.view.provider.Lookup",Ext.ux.form.field.Lookup,{name:"id_provider",fieldLabel:t("Provider"),displayField:"idProviderprovider_name",displayFieldList:"provider_name",gridConfig:{xtype:"providerlist",fieldSearch:"username",columns:[{header:t("name"),dataIndex:"provider_name"},{header:t("description"),dataIndex:"description"}]}},0,["providerlookup"],["component","box","container","fieldcontainer","providerlookup"],{component:true,box:true,container:true,fieldcontainer:true,providerlookup:true},["widget.providerlookup"],0,[MBilling.view.provider,"Lookup"],0));(Ext.cmd.derive("MBilling.view.plan.Controller",Ext.ux.app.ViewController,{init:function(){var b=this;b.control({noyescombo:{select:b.onSelectType}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectType:function(c,d){this.showFieldsRelated(d.getData().showFields)},showFieldsRelated:function(j){var l=this,g=l.formPanel.getForm().getFields(),f=l.formPanel.getForm().findField("ini_credit"),m=l.formPanel.getForm();g.each(function(a){if(a.name=="signup"){a.value==1?f.show():f.hide()}})},onEdit:function(){var f=this,d=f.formPanel.getForm().findField("ini_credit"),e=f.formPanel.getForm().findField("signup");Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments);e.value==1?d.show():d.hide()}},0,0,0,0,["controller.plan"],0,[MBilling.view.plan,"Controller"],0));(Ext.cmd.derive("MBilling.view.plan.Combo",Ext.form.field.ComboBox,{name:"id_plan",fieldLabel:t("plan"),displayField:"name",valueField:"id",forceSelection:true,editable:true,listeners:{focus:function(b){b.expand()}},initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Plan",{proxy:{type:"uxproxy",module:"plan",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["plancombo"],["component","box","field","textfield","pickerfield","combobox","combo","plancombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,plancombo:true},["widget.plancombo"],0,[MBilling.view.plan,"Combo"],0));(Ext.cmd.derive("MBilling.view.plan.Module",Ext.ux.panel.Module,{controller:"plan"},0,["planmodule"],["component","box","container","uxpanelmodule","planmodule"],{component:true,box:true,container:true,uxpanelmodule:true,planmodule:true},["widget.planmodule"],0,[MBilling.view.plan,"Module"],0));(Ext.cmd.derive("MBilling.view.plan.List",Ext.ux.grid.Panel,{store:"Plan",fieldSearch:"name",initComponent:function(){var b=this;b.columns=b.columns||[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("name"),dataIndex:"name",flex:4},{header:t("lcrtype"),dataIndex:"lcrtype",comboRelated:"lcrtypecombo",renderer:Helper.Util.formatLcrtype,flex:4,filter:{type:"list",options:[[1,t("LCRAccordingtothebuyerPrice")],[0,t("LCRAccordingtothesellerPrice")],[2,t("Load Balancer")]]}},{header:t("Tech Prefx"),dataIndex:"techprefix",flex:4,hidden:!App.user.isAdmin},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"creationdate",flex:4},{header:t("Port. Celular"),dataIndex:"portabilidadeMobile",flex:2,renderer:Helper.Util.formattyyesno,filter:{type:"list",options:[[0,t("no")],[1,t("yes")]]},hidden:App.user.language!="pt_BR",hideable:false},{header:t("Port. Fixo"),dataIndex:"portabilidadeFixed",flex:2,renderer:Helper.Util.formattyyesno,filter:{type:"list",options:[[0,t("no")],[1,t("yes")]]},hidden:App.user.language!="pt_BR",hideable:false}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["planlist"],["component","box","container","panel","tablepanel","gridpanel","grid","planlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,planlist:true},["widget.planlist"],0,[MBilling.view.plan,"List"],0));(Ext.cmd.derive("MBilling.view.plan.Form",Ext.ux.form.Panel,{labelWidthFields:115,fieldsHideUpdateLot:["name"],initComponent:function(){var b=this;b.defaults={labelWidth:142};b.items=[{name:"name",fieldLabel:t("name"),maxLength:100},{xtype:"lcrtypefullcombo",name:"lcrtype",fieldLabel:t("lcrtype"),allowBlank:true},{xtype:"numberfield",name:"tariff_limit",minValue:1,value:1,fieldLabel:t("Tariff Find Limit"),hidden:!App.user.isAdmin},{xtype:"noyescombo",name:"signup",fieldLabel:t("useInSignup"),allowBlank:true},{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,00",name:"ini_credit",fieldLabel:t("Initial Credit to new users"),allowBlank:true,hidden:true,value:0},{xtype:"yesnocombo",name:"play_audio",fieldLabel:t("Notices with audio"),allowBlank:true,hidden:App.user.isClient},{style:"margin-top:25px",xtype:"fieldset",title:t("Ativar portabilidade?"),collapsible:true,collapsed:false,hidden:App.user.language!="pt_BR",defaults:{labelWidth:190,anchor:"100%",layout:{type:"hbox",labelAlign:b.labelAlignFields}},items:[{xtype:"noyescombo",name:"portabilidadeMobile",fieldLabel:t("Para Celular"),allowBlank:true,hidden:App.user.language!="pt_BR"},{xtype:"noyescombo",name:"portabilidadeFixed",fieldLabel:t("Para Fixo"),allowBlank:true,hidden:App.user.language!="pt_BR"}]},{name:"techprefix",fieldLabel:t("Tech Prefix"),allowBlank:true,maxLength:5,minLength:5,hidden:!App.user.isAdmin},{style:"margin-top:25px",xtype:"fieldset",title:t("Select one or more Services"),collapsible:true,collapsed:false,items:[{anchor:"100%",fieldLabel:"",xtype:"servicestag",allowBlank:true}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["planform"],["component","box","container","panel","form","planform"],{component:true,box:true,container:true,panel:true,form:true,planform:true},["widget.planform"],0,[MBilling.view.plan,"Form"],0));(Ext.cmd.derive("MBilling.view.plan.Tag",Ext.form.field.Tag,{name:"id_plan",fieldLabel:t("plan"),displayField:"name",valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Plan",{proxy:{type:"uxproxy",module:"plan",limitParam:undefined}});Ext.form.field.Tag.prototype.initComponent.apply(this,arguments)}},0,["plantag"],["component","box","field","textfield","pickerfield","combobox","combo","tagfield","plantag"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,tagfield:true,plantag:true},["widget.plantag"],0,[MBilling.view.plan,"Tag"],0));(Ext.cmd.derive("MBilling.view.plan.Lookup",Ext.ux.form.field.Lookup,{name:"id_plan",fieldLabel:t("Plan"),displayField:"idPlanname",displayFieldList:"name",gridConfig:{xtype:"planlist",fieldSearch:"name",columns:[{header:t("name"),dataIndex:"name",flex:2}]}},0,["planlookup"],["component","box","container","fieldcontainer","planlookup"],{component:true,box:true,container:true,fieldcontainer:true,planlookup:true},["widget.planlookup"],0,[MBilling.view.plan,"Lookup"],0));(Ext.cmd.derive("MBilling.view.trunk.Controller",Ext.ux.app.ViewController,{onEdit:function(){var f=this,e=f.list.getSelectionModel().getSelection()[0],d=f.formPanel.getForm().findField("register");if(e.get("register")==1){if(e.get("register")&&e.get("providertech")=="sip"){color=e.get("registered")==1?"green":"red";d.setFieldLabel(t("registertrunk")+' ')}else{d.setFieldLabel(t("registertrunk"))}f.formPanel.getForm().findField("register_string")["show"]()}else{d.setFieldLabel(t("registertrunk"));f.formPanel.getForm().findField("register_string")["hide"]()}Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments);valueAllow=f.formPanel.idRecord?e.get("allow").split(","):["g729","gsm","alaw","ulaw"];fieldAllow=f.formPanel.down("checkboxgroup");fieldAllow.setValue({allow:valueAllow})},init:function(){var b=this;b.control({"noyescombo[name=register]":{select:b.onSelectType}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectType:function(c,d){this.showFieldsRelated(d.getData().showFields)},showFieldsRelated:function(o){var p=this,m=p.formPanel.getForm().findField("register_string"),n=p.formPanel.getForm().findField("user"),q=p.formPanel.getForm().findField("secret"),j=p.formPanel.getForm().findField("host"),l=p.formPanel.getForm().getFields();l.each(function(a){if(a.name=="register"){m.setVisible(a.value==1);m.setValue(n.value+":"+q.value+"@"+j.value+"/"+n.value)}})}},0,0,0,0,["controller.trunk"],0,[MBilling.view.trunk,"Controller"],0));(Ext.cmd.derive("MBilling.view.trunk.Combo",Ext.form.field.ComboBox,{name:"id_trunk",fieldLabel:t("trunk"),forceSelection:true,editable:true,listeners:{focus:function(b){b.expand()}},displayField:"trunkcode",valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Trunk",{proxy:{type:"uxproxy",module:"trunk",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["trunkcombo"],["component","box","field","textfield","pickerfield","combobox","combo","trunkcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,trunkcombo:true},["widget.trunkcombo"],0,[MBilling.view.trunk,"Combo"],0));(Ext.cmd.derive("MBilling.view.trunk.ComboBackup",Ext.form.field.ComboBox,{name:"failover_trunk",fieldLabel:t("failover_trunk"),displayField:"trunkcode",valueField:"id",value:0,limitParam:undefined,forceSelection:true,editable:true,extraValues:[{id:0,trunkcode:t("undefined")}],listeners:{focus:function(b){b.expand()}},initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Trunk",{proxy:{type:"uxproxy",module:"trunk",limitParam:undefined}});b.on("render",b.loadStore,b);Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)},loadStore:function(g){var j=this,e=g.store,f;e.load({callback:function(){if(j.extraValues.length){e.insert(0,j.extraValues)}}})}},0,["trunkcombobackup"],["component","box","field","textfield","pickerfield","combobox","combo","trunkcombobackup"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,trunkcombobackup:true},["widget.trunkcombobackup"],0,[MBilling.view.trunk,"ComboBackup"],0));(Ext.cmd.derive("MBilling.view.trunk.Module",Ext.ux.panel.Module,{controller:"trunk"},0,["trunkmodule"],["component","box","container","uxpanelmodule","trunkmodule"],{component:true,box:true,container:true,uxpanelmodule:true,trunkmodule:true},["widget.trunkmodule"],0,[MBilling.view.trunk,"Module"],0));(Ext.cmd.derive("MBilling.view.trunk.List",Ext.ux.grid.Panel,{store:"Trunk",fieldSearch:"trunkcode",initComponent:function(){var b=this;b.columns=b.columns||[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("trunkcode"),dataIndex:"trunkcode",flex:3},{header:t("add")+" "+t("prefix"),dataIndex:"trunkprefix",flex:2},{header:t("remove")+" "+t("prefix"),dataIndex:"removeprefix",flex:2},{header:t("host"),dataIndex:"host",flex:2},{xtype:"templatecolumn",tpl:"{idProviderprovider_name}",header:t("provider"),dataIndex:"id_provider",comboFilter:"providercombo",flex:2},{header:t("secondusedreal"),renderer:Helper.Util.formatsecondsToTime,dataIndex:"secondusedreal",flex:3},{header:t("status"),dataIndex:"status",renderer:Helper.Util.formatBooleanActive,comboFilter:"booleancombo",flex:1,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")]]}},{header:t("creationdate"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"creationdate",flex:3}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["trunklist"],["component","box","container","panel","tablepanel","gridpanel","grid","trunklist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,trunklist:true},["widget.trunklist"],0,[MBilling.view.trunk,"List"],0));(Ext.cmd.derive("MBilling.view.trunk.Form",Ext.ux.form.Panel,{autoHeight:300,bodyPadding:0,fieldsHideUpdateLot:["trunkcode"],initComponent:function(){var b=this;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{labelAlign:"right",plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true,labelWidth:142}},items:[{title:t("general"),items:[{xtype:"providerlookup",ownerForm:b},{name:"trunkcode",fieldLabel:t("trunkcode")},{name:"user",fieldLabel:t("user"),allowBlank:true},{name:"secret",fieldLabel:t("password"),allowBlank:true},{name:"host",fieldLabel:t("host")},{name:"trunkprefix",fieldLabel:t("add")+" "+t("prefix"),allowBlank:true},{name:"removeprefix",fieldLabel:t("remove")+" "+t("prefix"),allowBlank:true},{xtype:"checkboxgroup",columns:3,name:"allow",fieldLabel:t("codec"),items:[{boxLabel:"g729",name:"allow",inputValue:"g729",checked:true},{boxLabel:"g723",name:"allow",inputValue:"g723"},{boxLabel:"gsm",name:"allow",inputValue:"gsm",checked:true},{boxLabel:"g726",name:"allow",inputValue:"g726"},{boxLabel:"opus",name:"allow",inputValue:"opus",checked:true},{boxLabel:"alaw",name:"allow",inputValue:"alaw",checked:true},{boxLabel:"ulaw",name:"allow",inputValue:"ulaw",checked:true},{boxLabel:"g722",name:"allow",inputValue:"g722"},{boxLabel:"ilbc",name:"allow",inputValue:"ilbc"},{boxLabel:"speex",name:"allow",inputValue:"speex"},{boxLabel:"h261",name:"allow",inputValue:"h261"},{boxLabel:"h263",name:"allow",inputValue:"h263"}],allowBlank:true},{xtype:"sipcombo",name:"providertech",fieldLabel:t("providertech")},{xtype:"trunkcombobackup",allowBlank:true},{xtype:"booleancombo",name:"status",fieldLabel:t("status")},{xtype:"noyescombo",name:"allow_error",fieldLabel:t("allow_error")},{xtype:"noyescombo",name:"register",fieldLabel:t("registertrunk")},{name:"register_string",fieldLabel:t("Register String"),allowBlank:true,hidden:true}]},{title:t("suplementaryInfo"),defaults:{labelAlign:"right",plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true,labelWidth:142},items:[{name:"fromuser",fieldLabel:"fromuser",allowBlank:true},{name:"fromdomain",fieldLabel:"Fromdomain",allowBlank:true},{name:"language",fieldLabel:t("language"),allowBlank:true},{name:"context",fieldLabel:t("context"),allowBlank:true,value:"billing"},{name:"dtmfmode",fieldLabel:"dtmfmode",allowBlank:true,value:"RFC2833"},{name:"insecure",fieldLabel:"insecure",allowBlank:true,value:"port,invite"},{xtype:"numberfield",name:"maxuse",fieldLabel:t("maxuse"),allowBlank:true,value:-1,minValue:-1},{name:"nat",fieldLabel:"nat",value:App.user.asteriskVersion=="1.8"?"yes":"force_rport,comedia",allowBlank:true},{name:"directmedia",allowBlank:true,value:"no",fieldLabel:"directmedia"},{name:"qualify",fieldLabel:"qualify",allowBlank:true,value:"yes"},{name:"type",fieldLabel:"type",allowBlank:true,value:"peer"},{name:"disallow",fieldLabel:"disallow",allowBlank:true,value:"all"},{name:"sendrpid",fieldLabel:"sendrpid",allowBlank:true,value:"no"},{name:"addparameter",fieldLabel:t("addparameter"),allowBlank:true,emptyText:t("parameterdial")},{xtype:"textarea",name:"link_sms",fieldLabel:t("link_sms"),allowBlank:true,emptyText:t("linksmsobs"),height:100,anchor:"100%"},{name:"sms_res",fieldLabel:t("sms_res"),allowBlank:true},{xtype:"numberfield",name:"port",fieldLabel:t("Port"),value:"5060",readOnly:!App.user.isAdmin,hidden:App.user.isClient,allowBlank:App.user.isClient},{xtype:"combobox",name:"encryption",value:"no",store:[["no","No"],["yes","yes"]],fieldLabel:t("Encryption"),allowBlank:true,hidden:!App.user.isAdmin},{xtype:"combobox",forceSelection:true,editable:false,value:"no",store:[["tls","tls"],["no","disable"]],name:"transport",fieldLabel:t("Transport"),allowBlank:true,hidden:!App.user.isAdmin}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["trunkform"],["component","box","container","panel","form","trunkform"],{component:true,box:true,container:true,panel:true,form:true,trunkform:true},["widget.trunkform"],0,[MBilling.view.trunk,"Form"],0));(Ext.cmd.derive("MBilling.view.trunk.Lookup",Ext.ux.form.field.Lookup,{name:"id_trunk",fieldLabel:t("Trunk"),displayField:"idTrunktrunkcode",displayFieldList:"trunkcode",gridConfig:{xtype:"trunklist",fieldSearch:"trunkcode",columns:[{header:t("trunkcode"),dataIndex:"trunkcode"}]}},0,["trunklookup"],["component","box","container","fieldcontainer","trunklookup"],{component:true,box:true,container:true,fieldcontainer:true,trunklookup:true},["widget.trunklookup"],0,[MBilling.view.trunk,"Lookup"],0));(Ext.cmd.derive("MBilling.view.prefix.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.prefix"],0,[MBilling.view.prefix,"Controller"],0));(Ext.cmd.derive("MBilling.view.prefix.Combo",Ext.form.field.ComboBox,{name:"id_prefix",fieldLabel:t("destination"),displayField:"prefix",filterMode:"remote",valueField:"id",listConfig:{itemTpl:Ext.create("Ext.XTemplate","
{prefix} - {destination}
")},displayTpl:Ext.create("Ext.XTemplate",'{prefix} - {destination}'),initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.PrefixCombo",{proxy:{type:"uxproxy",module:"prefixCombo",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["prefixcombo"],["component","box","field","textfield","pickerfield","combobox","combo","prefixcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,prefixcombo:true},["widget.prefixcombo"],0,[MBilling.view.prefix,"Combo"],0));(Ext.cmd.derive("MBilling.view.prefix.Module",Ext.ux.panel.Module,{controller:"prefix"},0,["prefixmodule"],["component","box","container","uxpanelmodule","prefixmodule"],{component:true,box:true,container:true,uxpanelmodule:true,prefixmodule:true},["widget.prefixmodule"],0,[MBilling.view.prefix,"Module"],0));(Ext.cmd.derive("Ext.ux.form.field.FileUpload",Ext.form.field.File,{anchor:"0",name:"file",emptyText:t("selectFile"),fieldLabel:t("file"),buttonText:undefined,maxSize:3144000,extAllowed:["csv","ret"],titleTipInfo:t("modelContent"),titleWarning:t("warning"),msgInvalidFile:t("fileNotAllow"),msgInvalidSize:t("maxSizeFile"),childEls:["browseButtonWrap","playButtonWrap"],buttonPlayMargin:5,buttonConfig:{glyph:icons.file},triggers:{filebutton:{type:"component",hideOnReadOnly:false},playbutton:{type:"component"}},applyTriggers:function(e){var d=this,f=(e||{}).playbutton;if(f){f.component=Ext.apply({xtype:"button",iconCls:"icon-play",ownerCt:d,id:d.id+"-play",ui:d.ui,disabled:d.disabled,style:d.getButtonMarginProp()+d.buttonPlayMargin+"px",inputName:d.getName(),scope:d,handler:d.playStop,hidden:true});return Ext.form.field.File.prototype.applyTriggers.call(this,e)}},onRender:function(){var c=this,d;c.isAudio=c.extAllowed.indexOf("wav")!==-1;c.formPanel=c.up("form");c.formPanel.on("edit",c.onEditForm,c);(arguments.callee.$previous||Ext.form.field.File.prototype.onRender).apply(this,arguments);c.triggerPlay=c.getTrigger("playbutton");c.buttonPlay=c.triggerPlay.component;c.triggerPlay.el.setWidth(c.buttonPlay.getEl().getWidth()+c.buttonPlay.getEl().getMargin("lr"));if(Ext.isIE){c.buttonPlay.getEl().repaint()}c.initTipInfo()},reset:function(){var b=this;if(!b.isAudio){return}if(b.audio&&!b.audio.paused&&b.audio.currentTime){b.audio.pause();b.audio.currentTime=0}b.buttonPlay.setIconCls("icon-play");b.triggerPlay.el.setWidth(0);if(Ext.isIE){b.buttonPlay.getEl().repaint()}Ext.form.field.File.prototype.reset.apply(this,arguments)},onEditForm:function(){var g=this,f=g.formPanel.getForm().getRecord(),j=f&&f.get(g.name),e=!Ext.isEmpty(j);if(!g.isAudio){return}if(g.audio&&!g.audio.paused&&g.audio.currentTime){g.audio.pause();g.audio.currentTime=0}g.buttonPlay.setIconCls("icon-play");if(e){g.audio=new Audio(j);g.audio.addEventListener("ended",Ext.bind(g.onEndAudio,g));g.triggerPlay.el.setWidth(g.buttonPlay.el.getWidth()+g.buttonPlay.el.getMargin("lr"));if(Ext.isIE){g.buttonPlay.getEl().repaint()}}else{g.triggerPlay.el.setWidth(0);if(Ext.isIE){g.buttonPlay.getEl().repaint()}}g.buttonPlay.setVisible(e);g.triggerPlay.setVisible(e)},onEndAudio:function(){this.buttonPlay.setIconCls("icon-play")},getTriggerMarkup:function(){var d=this,e=Ext.form.field.File.prototype.getTriggerMarkup.apply(this,arguments),f='';return e+f},playStop:function(e){var d=this,f=e.iconCls==="icon-play";if(f){d.audio.play()}else{if(d.audio&&!d.audio.paused&&d.audio.currentTime){d.audio.pause();d.audio.currentTime=0}}e.setIconCls(f?"icon-stop":"icon-play")},initTipInfo:function(){var b=this;if(!b.htmlTipInfo){return}b.tipInfoFile=Ext.create("Ext.tip.ToolTip",{html:b.htmlTipInfo,anchor:"top",title:b.titleTipInfo,target:b.button.el})},onFileChange:function(e,f,g){var j=this;j.getInfoFile(f);Ext.form.field.File.prototype.onFileChange.apply(this,arguments)},getInfoFile:function(g){var l=this,f=g.target.files[0],j=f.name.split("."),m=j[j.length-1].toLowerCase();if(l.extAllowed.indexOf(m)===-1){Ext.ux.Alert.alert(l.titleWarning,l.msgInvalidFile,"warning");l.reset();return}if(f.size>l.maxSize){Ext.ux.Alert.alert(l.titleWarning,l.msgInvalidSize+Ext.util.Format.fileSize(l.maxSize),"warning");l.reset();return}}},0,["uploadfield"],["component","box","field","textfield","filefield","fileuploadfield","uploadfield"],{component:true,box:true,field:true,textfield:true,filefield:true,fileuploadfield:true,uploadfield:true},["widget.uploadfield"],0,[Ext.ux.form.field,"FileUpload"],0));(Ext.cmd.derive("Ext.ux.window.ImportCsv",Ext.window.Window,{autoShow:true,modal:true,layout:"fit",iconCls:"icon-import-csv",title:t("importFromCsv"),width:400,height:window.isThemeTriton?220:175,labelWidthFields:75,htmlTipInfo:"",fieldsImport:[],listeners:{close:function(){this.list.setLoading(false)}},initComponent:function(){var d=this,c=Ext.Array.merge(d.fieldsImport,[{xtype:"uploadfield",fieldLabel:t("fileCsv"),htmlTipInfo:d.htmlTipInfo}]);d.items=[{xtype:"form",bodyPadding:5,labelWidthFields:d.labelWidthFields,items:c}];d.title=d.title+(d.titleModule?" - "+d.titleModule:"");d.bbar=[{xtype:"tbtext",text:t("maxSizeFile")+"3 MB"},"->",{iconCls:"icon-import-csv",text:t("importText"),scope:d,handler:d.onImport}];Ext.window.Window.prototype.initComponent.apply(this,arguments)},onImport:function(d){var f=this,e=f.list.store;d.disable();f.list.setLoading(true);f.down("form").submit({url:e.getProxy().api.fromCsv,scope:f,success:function(c,b){var a=Ext.decode(b.response.responseText);if(a.success){Ext.ux.Alert.alert(t("Success"),a.msg,"success")}else{Ext.ux.Alert.alert(t("Error"),a.errors,"error")}d.enable();f.list.setLoading(false);e.load();f.close()},failure:function(c,b){if(Ext.isObject(b.response)){var a=Ext.decode(b.response.responseText);Ext.ux.Alert.alert(t("Error"),a.errors,"error")}else{Ext.ux.Alert.alert(t("Error"),b.response.responseText,"error",true,false)}d.enable();f.list.setLoading(false);f.close()}})}},0,0,["component","box","container","panel","window"],{component:true,box:true,container:true,panel:true,window:true},0,0,[Ext.ux.window,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.prefix.ImportCsv",Ext.ux.window.ImportCsv,{htmlTipInfo:"
"+t("dialprefix")+", "+t("destination")+"",labelWidthFields:160,height:window.isThemeTriton?300:205,initComponent:function(){var b=this;b.fieldsImport=[{style:"margin-top:25px",xtype:"fieldset",title:t("Csv Format"),collapsible:true,collapsed:false,defaults:{labelWidth:190,anchor:"100%",layout:{type:"hbox",labelAlign:b.labelAlignFields}},items:[{xtype:"pontovirgulacombo",name:"delimiter",fieldLabel:t("Delimiter"),width:230}]}];Ext.ux.window.ImportCsv.prototype.initComponent.apply(this,arguments)}},0,["prefiximportcsv"],["component","box","container","panel","window","prefiximportcsv"],{component:true,box:true,container:true,panel:true,window:true,prefiximportcsv:true},["widget.prefiximportcsv"],0,[MBilling.view.prefix,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.prefix.List",Ext.ux.grid.Panel,{store:"Prefix",fieldSearch:"prefix",initComponent:function(){var b=this;b.buttonImportCsv=!App.user.isClient,b.buttonUpdateLot=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("prefix"),dataIndex:"prefix",filter:{type:"string"}},{header:t("destination"),dataIndex:"destination"}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["prefixlist"],["component","box","container","panel","tablepanel","gridpanel","grid","prefixlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,prefixlist:true},["widget.prefixlist"],0,[MBilling.view.prefix,"List"],0));(Ext.cmd.derive("MBilling.view.prefix.Form",Ext.ux.form.Panel,{fieldsHideEdit:["prefix"],items:[{name:"prefix",fieldLabel:t("prefix"),maxLength:18},{name:"destination",fieldLabel:t("destination")}]},0,["prefixform"],["component","box","container","panel","form","prefixform"],{component:true,box:true,container:true,panel:true,form:true,prefixform:true},["widget.prefixform"],0,[MBilling.view.prefix,"Form"],0));(Ext.cmd.derive("MBilling.view.sendCreditProducts.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.sendcreditproducts"],0,[MBilling.view.sendCreditProducts,"Controller"],0));(Ext.cmd.derive("MBilling.view.sendCreditProducts.Module",Ext.ux.panel.Module,{controller:"sendcreditproducts"},0,["sendcreditproductsmodule"],["component","box","container","uxpanelmodule","sendcreditproductsmodule"],{component:true,box:true,container:true,uxpanelmodule:true,sendcreditproductsmodule:true},["widget.sendcreditproductsmodule"],0,[MBilling.view.sendCreditProducts,"Module"],0));(Ext.cmd.derive("MBilling.view.sendCreditProducts.ImportCsv",Ext.ux.window.ImportCsv,{fieldsImport:[{fieldLabel:t("table"),hidden:true,allowBlank:true}]},0,["sendcreditproductsimportcsv"],["component","box","container","panel","window","sendcreditproductsimportcsv"],{component:true,box:true,container:true,panel:true,window:true,sendcreditproductsimportcsv:true},["widget.sendcreditproductsimportcsv"],0,[MBilling.view.sendCreditProducts,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.sendCreditProducts.List",Ext.ux.grid.Panel,{store:"SendCreditProducts",fieldSearch:"operator_name",comparisonfilter:"ct",initComponent:function(){var b=this;b.buttonImportCsv=App.user.isAdmin,b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("Country"),dataIndex:"country",flex:4},{header:t("Country Code"),dataIndex:"country_code",flex:2},{header:t("Operator ID"),dataIndex:"operator_id",flex:2},{header:t("SkuCode"),dataIndex:"SkuCode",flex:2},{header:t("Operator Name"),dataIndex:"operator_name",flex:5},{header:t("Currency destination"),dataIndex:"currency_dest",flex:3},{header:t("Product"),dataIndex:"product",flex:2},{header:t("Currency Origem"),dataIndex:"currency_orig",flex:3},{header:t("Send Value"),dataIndex:"send_value",flex:2},{header:t("Wholesale Price"),dataIndex:"wholesale_price",flex:2},{header:t("Provider"),dataIndex:"provider",flex:2},{header:t("status"),dataIndex:"status",renderer:Helper.Util.formatBooleanActive,comboRelated:"booleancombo",flex:2,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")]]}}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["sendcreditproductslist"],["component","box","container","panel","tablepanel","gridpanel","grid","sendcreditproductslist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,sendcreditproductslist:true},["widget.sendcreditproductslist"],0,[MBilling.view.sendCreditProducts,"List"],0));(Ext.cmd.derive("MBilling.view.sendCreditProducts.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{name:"country",fieldLabel:t("country"),readOnly:true},{name:"operator_name",fieldLabel:t("Operator Name"),readOnly:true},{name:"operator_id",fieldLabel:t("Operator Id")},{name:"SkuCode",fieldLabel:t("SkuCode")},{name:"product",fieldLabel:t("Product")},{name:"send_value",fieldLabel:t("Send Value"),xtype:"moneyfield",mask:"#9.999.990,000000",readOnly:!App.user.isAdmin},{name:"wholesale_price",fieldLabel:t("Wholesale Price"),xtype:"moneyfield",mask:"#9.999.990,000000",readOnly:!App.user.isAdmin},{xtype:"combobox",name:"provider",value:"TransferTo",forceSelection:true,editable:false,store:[["TransferTo","TransferTo"],["Ding","Ding"],["TanaSend","TanaSend"]],fieldLabel:t("Provider")},{xtype:"yesnocombo",name:"status",fieldLabel:t("status")},{xtype:"textareafield",name:"info",fieldLabel:t("info"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["sendcreditproductsform"],["component","box","container","panel","form","sendcreditproductsform"],{component:true,box:true,container:true,panel:true,form:true,sendcreditproductsform:true},["widget.sendcreditproductsform"],0,[MBilling.view.sendCreditProducts,"Form"],0));(Ext.cmd.derive("MBilling.view.sendCreditRates.Controller",Ext.ux.app.ViewController,{onResetPrice:function(e){var f=this,d=f.list.getSelectionModel().getSelection()[0];Ext.Ajax.request({url:"index.php/SendCreditRates/resetSellPrice",scope:f,success:function(b){b=Ext.decode(b.responseText);if(b[f.nameSuccessRequest]){Ext.ux.Alert.alert(f.titleSuccess,b[f.nameMsgRequest],"success")}else{var a=Helper.Util.convertErrorsJsonToString(b[f.nameMsgRequest]);Ext.ux.Alert.alert(f.titleSuccess,a,"error")}}});f.store.load()}},0,0,0,0,["controller.sendcreditrates"],0,[MBilling.view.sendCreditRates,"Controller"],0));(Ext.cmd.derive("MBilling.view.sendCreditRates.Module",Ext.ux.panel.Module,{controller:"sendcreditrates"},0,["sendcreditratesmodule"],["component","box","container","uxpanelmodule","sendcreditratesmodule"],{component:true,box:true,container:true,uxpanelmodule:true,sendcreditratesmodule:true},["widget.sendcreditratesmodule"],0,[MBilling.view.sendCreditRates,"Module"],0));(Ext.cmd.derive("MBilling.view.sendCreditRates.List",Ext.ux.grid.Panel,{store:"SendCreditRates",fieldSearch:"idProduct.operator_name",comparisonfilter:"ct",initComponent:function(){var b=this;b.buttonUpdateLotCallShopRate=true;b.buttonCsv=false;b.allowPrint=false;b.extraButtons=[{text:t("Reset")+" "+t("Sell price"),iconCls:"icon-chart-column",width:130,handler:"onResetPrice",disabled:false}];b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{xtype:"templatecolumn",tpl:"{idProductoperator_name}",header:t("Operator Name"),dataIndex:"idProductoperator_name",filter:{type:"string",field:"idProduct.operator_name"},flex:5},{xtype:"templatecolumn",tpl:"{idProductcountry}",header:t("Country"),dataIndex:"idProductcountry",filter:{type:"string",field:"idProduct.country"},flex:4},{xtype:"templatecolumn",tpl:"{idProductcurrency_dest}",header:t("Currency destination"),dataIndex:"idProductcurrency_dest",filter:{type:"string",field:"idProduct.currency_dest"},flex:3},{xtype:"templatecolumn",tpl:"{idProductproduct}",header:t("Product"),dataIndex:"idProductproduct",filter:{type:"string",field:"idProduct.product"},flex:2},{xtype:"templatecolumn",tpl:"{idProductcurrency_orig}",header:t("Currency Origin"),dataIndex:"idProductcurrency_orig",filter:{type:"string",field:"idProduct.currency_orig"},flex:3},{xtype:"templatecolumn",tpl:"{idProductwholesale_price}",header:t("Wholesale Price"),dataIndex:"idProductwholesale_price",filter:{type:"string",field:"idProduct.wholesale_price"},flex:2},{header:t("Sell Price"),dataIndex:"sell_price",flex:2}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["sendcreditrateslist"],["component","box","container","panel","tablepanel","gridpanel","grid","sendcreditrateslist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,sendcreditrateslist:true},["widget.sendcreditrateslist"],0,[MBilling.view.sendCreditRates,"List"],0));(Ext.cmd.derive("MBilling.view.sendCreditRates.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["idProductcountry","idProductoperator_name"],initComponent:function(){var b=this;b.items=[{name:"idProductcountry",fieldLabel:t("country"),readOnly:true},{name:"idProductoperator_name",fieldLabel:t("Operator Name"),readOnly:true},{name:"sell_price",fieldLabel:t("Sell Price"),xtype:"moneyfield",mask:"#9.999.990,00",readOnly:App.user.isAdmin}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["sendcreditratesform"],["component","box","container","panel","form","sendcreditratesform"],{component:true,box:true,container:true,panel:true,form:true,sendcreditratesform:true},["widget.sendcreditratesform"],0,[MBilling.view.sendCreditRates,"Form"],0));(Ext.cmd.derive("MBilling.view.prefix.Lookup",Ext.ux.form.field.Lookup,{name:"id_prefix",fieldLabel:t("Destination"),displayField:"idPrefixdestination",displayFieldList:"destination",gridConfig:{xtype:"prefixlist",fieldSearch:"destination",columns:[{header:t("prefix"),dataIndex:"prefix",flex:2},{header:t("destination"),dataIndex:"destination",flex:2}]}},0,["prefixlookup"],["component","box","container","fieldcontainer","prefixlookup"],{component:true,box:true,container:true,fieldcontainer:true,prefixlookup:true},["widget.prefixlookup"],0,[MBilling.view.prefix,"Lookup"],0));(Ext.cmd.derive("MBilling.view.sipTrace.Controller",Ext.ux.app.ViewController,{onNewFilter:function(d){var f=this,e=f.getView();Ext.widget("siptracefilter",{title:"SipTrace",list:f.list})},onDeleteLog:function(d){var c=this;Ext.Msg.confirm(c.titleConfirmation,t("Confirm delete all log file?"),function(a){if(a==="yes"){Ext.Ajax.request({url:"index.php/sipTrace/destroy",scope:c,success:function(b){Ext.ux.Alert.alert(c.titleSuccess,t("Success: The Sip Trace file was deleted"),"success");c.store.load()}})}})},onClearAll:function(d){var c=this;Ext.Ajax.request({url:"index.php/sipTrace/clearAll",scope:c,success:function(a){Ext.ux.Alert.alert(c.titleSuccess,t("Success"),"success");c.store.load()}})},onExportPcap:function(d){var c=this;window.open("index.php/sipTrace/export")},onDetails:function(d){var f=this,e=f.list.getSelectionModel().getSelection()[0];window.open("index.php/sipTrace/details?callid="+e.get("callid"))}},0,0,0,0,["controller.siptrace"],0,[MBilling.view.sipTrace,"Controller"],0));(Ext.cmd.derive("MBilling.view.sipTrace.Module",Ext.ux.panel.Module,{controller:"siptrace"},0,["siptracemodule"],["component","box","container","uxpanelmodule","siptracemodule"],{component:true,box:true,container:true,uxpanelmodule:true,siptracemodule:true},["widget.siptracemodule"],0,[MBilling.view.sipTrace,"Module"],0));(Ext.cmd.derive("MBilling.view.sipTrace.Filter",Ext.window.Window,{autoShow:true,modal:true,layout:"fit",iconCls:"icon-import-csv",title:t("SipTrace filter"),width:400,height:window.isThemeTriton?220:180,labelWidthFields:120,htmlTipInfo:"",fieldsImport:[],initComponent:function(){var b=this;b.items=[{xtype:"form",bodyPadding:5,defaults:{anchor:"0",enableKeyEvents:true,labelWidth:b.labelWidthFields,msgTarget:"side",plugins:"markallowblank",allowBlank:false},items:[{xtype:"numberfield",value:60,min:5,max:300,name:"timeout",fieldLabel:t("Filter timeout")},{xtype:"numberfield",name:"port",fieldLabel:t("Port"),allowBlank:false,value:5060},{xtype:"textfield",name:"filter",fieldLabel:t("Filter"),allowBlank:false,emptyText:"IP, sip account or number ...."}]}];b.title=b.title+(b.titleModule?" - "+b.titleModule:"");b.bbar=[{width:150,iconCls:"icon-play",text:t("Start"),scope:b,handler:b.onStart}];Ext.window.Window.prototype.initComponent.apply(this,arguments)},onStart:function(d){var f=this,e=f.list.store;if(!f.down("form").isValid()){return}f.list.setLoading(true);Ext.Ajax.setTimeout(1000000);f.down("form").submit({url:"index.php/sipTrace/start",scope:f,success:function(c,b){var a=Ext.decode(b.response.responseText);console.log(a);if(a.success){Ext.ux.Alert.alert(t("Success"),a.msg,"success")}else{Ext.ux.Alert.alert(t("Error"),a.errors,"error")}d.enable();f.list.setLoading(false);e.load();f.close()},failure:function(c,b){console.log(b.response.responseText);if(b.response&&Ext.isObject(b.response.responseText)){var a=Ext.decode(b.response.responseText);Ext.ux.Alert.alert(t("Error"),a.errors,"error",true,30)}else{Ext.ux.Alert.alert(t("Error"),Ext.decode(b.response.responseText).msg,"error",true,30)}d.enable();f.list.setLoading(false);e.load();f.close()}})}},0,["siptracefilter"],["component","box","container","panel","window","siptracefilter"],{component:true,box:true,container:true,panel:true,window:true,siptracefilter:true},["widget.siptracefilter"],0,[MBilling.view.sipTrace,"Filter"],0));(Ext.cmd.derive("MBilling.view.sipTrace.List",Ext.ux.grid.Panel,{store:"SipTrace",initComponent:function(){var b=this;b.buttonImportCsv=false;b.buttonCsv=false;b.allowPrint=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.collapsedExtraFilters=false;b.allowDelete=false;b.extraButtons=[{text:b.textDelete,glyph:b.glyphDelete,handler:"onDeleteLog",width:120},{text:t("Start Capture"),iconCls:"icon-save-all",handler:"onNewFilter",width:120},{text:t("Stop Capture"),iconCls:"icon-clean-filter",handler:"onClearAll",width:120},{text:t("Export File"),iconCls:"icon-save-all",handler:"onExportPcap",width:150},{text:t("Details"),glyph:icons.info,handler:"onDetails",width:150}];b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,menuDisabled:true,hideable:App.user.isAdmin},{header:t("method"),dataIndex:"method",flex:3},{header:t("callid"),dataIndex:"callid",flex:7},{header:t("SIP To "),dataIndex:"sipto",flex:5},{header:t("Source"),dataIndex:"fromip",renderer:function(a){a=a==window.myIP?''+a+"":a;return a},flex:3},{header:t("Destination"),dataIndex:"toip",renderer:function(a){a=a==window.myIP?''+a+"":a;return a},flex:4},{header:t("head"),dataIndex:"head",flex:3,menuDisabled:true,hidden:true,hideable:true}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["siptracelist"],["component","box","container","panel","tablepanel","gridpanel","grid","siptracelist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,siptracelist:true},["widget.siptracelist"],0,[MBilling.view.sipTrace,"List"],0));(Ext.cmd.derive("MBilling.view.sipTrace.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.allowCreate=false;height=Ext.Element.getViewportHeight()-200;b.items=[{xtype:"textareafield",name:"head",height:height,anchor:"100%",allowBlank:true,readOnly:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["siptraceform"],["component","box","container","panel","form","siptraceform"],{component:true,box:true,container:true,panel:true,form:true,siptraceform:true},["widget.siptraceform"],0,[MBilling.view.sipTrace,"Form"],0));(Ext.cmd.derive("MBilling.view.sip.Controller",Ext.ux.app.ViewController,{init:function(){var b=this;b.control({typesipforwardcombo:{select:b.onSelectMethod}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectMethod:function(c,d){this.showFieldsRelated(d.getData().showFields)},showFieldsRelated:function(l){var m=this,n=m.formPanel.getForm(),j=m.formPanel.getForm().getFields(),g=Ext.get(Ext.Element.getActiveElement()).component,o=g.name.substr(-2);m.onSetVisibleFiel(g,n,o,g.value)},onSetVisibleFiel:function(f,j,e,g){if(f.value=="undefined"){f.setValue("undefined")}j.findField("id_queue").setValue("");j.findField("id_sip").setValue("");j.findField("id_ivr").setValue("");j.findField("extension").setValue("");j.findField("id_queue").setVisible(g.match("^queue"));j.findField("id_sip").setVisible(g.match("^sip"));j.findField("id_ivr").setVisible(g.match("^ivr"));j.findField("extension").setVisible(g.match("^group|^number|^custom"))},onGetDiskSpaceService:function(b){filterGroupp=Ext.encode([{type:"numeric",comparison:"eq",value:App.user.id,field:"id_user"},{type:"numeric",comparison:"eq",value:1,field:"status"}]),Ext.Ajax.request({url:"index.php/servicesUse/read?filter="+filterGroupp,success:function(a){a=Ext.decode(a.responseText);b(a.rows)}})},onEdit:function(){var j=this,l=j.formPanel.getForm(),f=j.list.getSelectionModel().getSelection()[0],g=j.formPanel.idRecord?f.get("allow").split(","):["g729","gsm","alaw","ulaw"],m=j.formPanel.down("checkboxgroup");if(App.user.isClient){l.findField("record_call").setVisible(false);j.onGetDiskSpaceService(function(a){Ext.each(a,function(b){if(b.idServicestype=="disk_space"){j.formPanel.getForm().findField("record_call").setVisible(true)}})})}fieldValue=f.getData()["type_forward"];l.findField("type_forward").setVisible(true);if(fieldValue=="ivr"){l.findField("id_ivr").setVisible(true);l.findField("id_sip").setVisible(false);l.findField("id_queue").setVisible(false);l.findField("extension").setVisible(false)}else{if(fieldValue=="sip"){l.findField("id_sip").setVisible(true);l.findField("id_ivr").setVisible(false);l.findField("id_queue").setVisible(false);l.findField("extension").setVisible(false)}else{if(fieldValue=="queue"){l.findField("id_queue").setVisible(true);l.findField("id_sip").setVisible(false);l.findField("id_ivr").setVisible(false);l.findField("extension").setVisible(false)}else{if(fieldValue.match("custom|number|group")){l.findField("extension").setVisible(true);l.findField("id_ivr").setVisible(false);l.findField("id_sip").setVisible(false);l.findField("id_queue").setVisible(false)}else{l.findField("id_queue").setVisible(false);l.findField("id_sip").setVisible(false);l.findField("id_ivr").setVisible(false);l.findField("extension").setVisible(false)}}}}Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments);m.setValue({allow:g})},onNew:function(){var f=this,d=f.formPanel.getForm(),e=f.list.getSelectionModel().getSelection()[0];if(App.user.isClient){f.formPanel.getForm().findField("defaultuser").setReadOnly(false)}d.findField("id_ivr").setVisible(false);d.findField("id_sip").setVisible(false);d.findField("id_queue").setVisible(false);d.findField("id_ivr").setVisible(false);d.findField("id_queue").setVisible(false);d.findField("type_forward").setVisible(true);Ext.ux.app.ViewController.prototype.onNew.apply(this,arguments)}},0,0,0,0,["controller.sip"],0,[MBilling.view.sip,"Controller"],0));(Ext.cmd.derive("MBilling.view.sip.Module",Ext.ux.panel.Module,{controller:"sip"},0,["sipmodule"],["component","box","container","uxpanelmodule","sipmodule"],{component:true,box:true,container:true,uxpanelmodule:true,sipmodule:true},["widget.sipmodule"],0,[MBilling.view.sip,"Module"],0));(Ext.cmd.derive("MBilling.view.sip.List",Ext.ux.grid.Panel,{store:"Sip",fieldSearch:"idUser.username",initComponent:function(){var b=this;b.columns=b.columns||[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("Status"),dataIndex:"lineStatus",width:3,menuDisabled:true,renderer:Helper.Util.formatStatusImage},{header:t("accountcode"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4},{header:t("username"),dataIndex:"name",flex:4},{header:t("host"),dataIndex:"host",flex:4},{header:t("codec"),dataIndex:"allow",flex:5},{header:"group",dataIndex:"group",flex:3},{header:t("context"),dataIndex:"context",hidden:true,hideable:!App.user.isClient,flex:1},{header:t("record_call"),dataIndex:"record_call",renderer:Helper.Util.formattyyesno,filter:{type:"list",options:[[0,t("no")],[1,t("yes")]]},flex:2,hidden:true,hideable:!App.user.isClient},{header:t("callerid"),dataIndex:"callerid",hidden:true,hideable:!App.user.isClient,flex:1},{header:"nat",dataIndex:"nat",hidden:true,hideable:!App.user.isClient,flex:1},{header:"directmedia",dataIndex:"directmedia",hidden:true,hideable:!App.user.isClient,flex:1},{header:"qualify",dataIndex:"qualify",hidden:true,hideable:!App.user.isClient,flex:1},{header:"dtmfmode",dataIndex:"dtmfmode",hidden:true,hideable:!App.user.isClient,flex:1},{header:"insecure",dataIndex:"insecure",hidden:true,hideable:!App.user.isClient,flex:1},{header:"type",dataIndex:"type",hidden:true,hideable:!App.user.isClient,flex:1},{header:"allowtransfer",dataIndex:"allowtransfer",hidden:true,hideable:!App.user.isClient,flex:1},{header:"calllimit",dataIndex:"calllimit",hidden:true,hideable:!App.user.isClient,flex:1}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["siplist"],["component","box","container","panel","tablepanel","gridpanel","grid","siplist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,siplist:true},["widget.siplist"],0,[MBilling.view.sip,"List"],0));(Ext.cmd.derive("MBilling.view.sip.Form",Ext.ux.form.Panel,{bodyPadding:0,fieldsHideUpdateLot:["id_user","defaultuser","secret"],initComponent:function(){var b=this;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{labelAlign:"right",plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true}},items:[{title:t("general"),items:[{xtype:"userlookup",ownerForm:b,fieldLabel:t("accountcode"),hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"defaultuser",fieldLabel:t("username"),minLength:4,allowBlank:true,readOnly:App.user.isClient},{name:"secret",fieldLabel:t("password"),allowBlank:true,minLength:6},{name:"callerid",fieldLabel:t("callerid"),allowBlank:true},{name:"alias",fieldLabel:t("Alias"),allowBlank:true,minLength:3},{name:"disallow",fieldLabel:"disallow",value:"all",hidden:!App.user.isAdmin,allowBlank:App.user.isClient},{xtype:"checkboxgroup",columns:3,fieldLabel:t("codec"),items:[{boxLabel:"g729",name:"allow",inputValue:"g729",checked:true},{boxLabel:"g723",name:"allow",inputValue:"g723"},{boxLabel:"gsm",name:"allow",inputValue:"gsm",checked:true},{boxLabel:"g726",name:"allow",inputValue:"g726"},{boxLabel:"opus",name:"allow",inputValue:"opus",checked:true},{boxLabel:"alaw",name:"allow",inputValue:"alaw",checked:true},{boxLabel:"ulaw",name:"allow",inputValue:"ulaw",checked:true},{boxLabel:"g722",name:"allow",inputValue:"g722"},{boxLabel:"ilbc",name:"allow",inputValue:"ilbc"},{boxLabel:"speex",name:"allow",inputValue:"speex"},{boxLabel:"h263p",name:"allow",inputValue:"h263p"},{boxLabel:"h263",name:"allow",inputValue:"h263"},{boxLabel:"h264",name:"allow",inputValue:"h264"},{boxLabel:"vp8",name:"allow",inputValue:"vp8"}],hidden:!App.user.isAdmin,allowBlank:App.user.isClient},{name:"host",fieldLabel:t("host"),value:"dynamic",hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"group",fieldLabel:t("group"),allowBlank:true},{xtype:"yesnostringcombo",name:"videosupport",fieldLabel:"videosupport",value:"no",allowBlank:!App.user.isAdmin},{name:"block_call_reg",fieldLabel:t("Block Call REGEX"),allowBlank:true,hidden:!window.doac},{xtype:"noyescombo",name:"record_call",fieldLabel:t("record_call"),allowBlank:true,hidden:!App.user.isAdmin},{xtype:"numberfield",name:"techprefix",fieldLabel:t("TechPrefix"),hidden:!window.usertech||!App.user.isAdmin,allowBlank:true,maxLength:6}]},{title:t("Nat"),hidden:!App.user.isAdmin,items:[{name:"nat",fieldLabel:"nat",value:"force_rport,comedia",allowBlank:!App.user.isAdmin},{name:"directmedia",fieldLabel:"directmedia",value:"no",allowBlank:!App.user.isAdmin},{xtype:"yesnostringcombo",name:"qualify",fieldLabel:"qualify",value:"no",allowBlank:!App.user.isAdmin}]},{title:t("Additional"),hidden:!App.user.isAdmin,defaults:{labelAlign:"right",plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true,labelWidth:142},items:[{name:"context",fieldLabel:t("context"),value:"billing",hidden:!App.user.isAdmin,allowBlank:true},{name:"dtmfmode",fieldLabel:"dtmfmode",value:"RFC2833",allowBlank:!App.user.isAdmin},{name:"insecure",fieldLabel:"insecure",value:"no",allowBlank:true},{name:"deny",fieldLabel:"deny",allowBlank:true,hidden:!App.user.isAdmin},{name:"permit",fieldLabel:"permit",allowBlank:true,hidden:!App.user.isAdmin},{name:"type",fieldLabel:"type",value:"friend",allowBlank:!App.user.isAdmin},{xtype:"noyesstringcombo",name:"allowtransfer",fieldLabel:"allowtransfer",value:"no",allowBlank:!App.user.isAdmin},{xtype:"noyescombo",name:"ringfalse",fieldLabel:t("Ring false"),value:"0",allowBlank:!App.user.isAdmin},{name:"calllimit",xtype:"numberfield",fieldLabel:t("calllimit"),value:"0",allowBlank:!App.user.isAdmin},{xtype:"noyescombo",name:"voicemail",fieldLabel:t("Enable")+" "+t("VoiceMail"),value:"0",allowBlank:App.user.isClient},{name:"mohsuggest",fieldLabel:t("MOH"),allowBlank:true,hidden:!App.user.isAdmin},{name:"url_events",fieldLabel:t("Url Events notify"),hidden:!App.user.isAdmin||!window.events===true,allowBlank:true}]},{title:t("Forward"),itemId:"option",bodyPadding:10,defaults:{xtype:"fieldcontainer",layout:"hbox",plugins:"markallowblank",allowBlank:true,anchor:"100%",labelWidth:60,defaults:{hideLabel:true,hidden:true,flex:5,startX:100,allowBlank:true,ownerForm:b}},items:[{fieldLabel:t("Forward"),items:[{name:"type_forward",xtype:"typesipforwardcombo",flex:2},{xtype:"ivrlookup",name:"id_ivr",displayField:"id_ivr_name"},{xtype:"queuelookup",name:"id_queue",displayField:"id_queue_name"},{xtype:"sip2lookup",name:"id_sip",displayField:"id_sip_name"},{xtype:"textfield",name:"extension"}]},{name:"dial_timeout",xtype:"numberfield",fieldLabel:t("Dial timeout"),value:"60",labelWidth:90}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["sipform"],["component","box","container","panel","form","sipform"],{component:true,box:true,container:true,panel:true,form:true,sipform:true},["widget.sipform"],0,[MBilling.view.sip,"Form"],0));(Ext.cmd.derive("MBilling.view.sip.Lookup",Ext.ux.form.field.Lookup,{name:"id_sip",fieldLabel:t("Sip"),displayField:"idSipname",displayFieldList:"name",gridConfig:{xtype:"siplist",fieldSearch:"name",columns:[{header:t("Account"),dataIndex:"idUserusername",flex:2},{header:t("name"),dataIndex:"name",flex:2}]}},0,["siplookup"],["component","box","container","fieldcontainer","siplookup"],{component:true,box:true,container:true,fieldcontainer:true,siplookup:true},["widget.siplookup"],0,[MBilling.view.sip,"Lookup"],0));(Ext.cmd.derive("MBilling.view.sip2.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.sip2"],0,[MBilling.view.sip2,"Controller"],0));(Ext.cmd.derive("MBilling.view.sip2.Module",Ext.ux.panel.Module,{controller:"sip2"},0,["sip2module"],["component","box","container","uxpanelmodule","sip2module"],{component:true,box:true,container:true,uxpanelmodule:true,sip2module:true},["widget.sip2module"],0,[MBilling.view.sip2,"Module"],0));(Ext.cmd.derive("MBilling.view.sip2.List",Ext.ux.grid.Panel,{store:"Sip2",fieldSearch:"name",initComponent:function(){var b=this;b.columns=b.columns||[{header:t("accountcode"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4},{header:t("username"),dataIndex:"name",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["sip2list"],["component","box","container","panel","tablepanel","gridpanel","grid","sip2list"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,sip2list:true},["widget.sip2list"],0,[MBilling.view.sip2,"List"],0));(Ext.cmd.derive("MBilling.view.sip2.Form",Ext.ux.form.Panel,{bodyPadding:0},0,["sip2form"],["component","box","container","panel","form","sip2form"],{component:true,box:true,container:true,panel:true,form:true,sip2form:true},["widget.sip2form"],0,[MBilling.view.sip2,"Form"],0));(Ext.cmd.derive("MBilling.view.sip2.Lookup",Ext.ux.form.field.Lookup,{name:"id_sip",fieldLabel:t("Sip"),displayField:"id_sip_name",displayFieldList:"name",gridConfig:{xtype:"sip2list",fieldSearch:"name",columns:[{header:t("Account"),dataIndex:"idUserusername",flex:2},{header:t("name"),dataIndex:"name",flex:2}]}},0,["sip2lookup"],["component","box","container","fieldcontainer","sip2lookup"],{component:true,box:true,container:true,fieldcontainer:true,sip2lookup:true},["widget.sip2lookup"],0,[MBilling.view.sip2,"Lookup"],0));(Ext.cmd.derive("MBilling.view.sipuras.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.sipuras"],0,[MBilling.view.sipuras,"Controller"],0));(Ext.cmd.derive("MBilling.view.sipuras.Module",Ext.ux.panel.Module,{controller:"sipuras"},0,["sipurasmodule"],["component","box","container","uxpanelmodule","sipurasmodule"],{component:true,box:true,container:true,uxpanelmodule:true,sipurasmodule:true},["widget.sipurasmodule"],0,[MBilling.view.sipuras,"Module"],0));(Ext.cmd.derive("MBilling.view.sipuras.List",Ext.ux.grid.Panel,{store:"Sipuras",initComponent:function(){var b=this;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"}},{header:"Serial",dataIndex:"nserie"},{header:"Mac",dataIndex:"macadr"},{header:t("username")+" 1",dataIndex:"User_ID_1"},{header:t("username")+" 2",dataIndex:"User_ID_2"},{header:t("last_ip"),dataIndex:"last_ip"},{header:t("obs"),dataIndex:"obs"},{header:t("last")+" "+t("register"),dataIndex:"fultmov",renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s")}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["sipuraslist"],["component","box","container","panel","tablepanel","gridpanel","grid","sipuraslist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,sipuraslist:true},["widget.sipuraslist"],0,[MBilling.view.sipuras,"List"],0));(Ext.cmd.derive("MBilling.view.sipuras.Form",Ext.ux.form.Panel,{bodyPadding:0,fieldsHideUpdateLot:["id_user","nserie","macadr"],initComponent:function(){var b=this;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true,labelAlign:"right"}},items:[{title:t("general"),items:[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"nserie",fieldLabel:"Serial"},{name:"macadr",fieldLabel:"Mac"},{name:"senha_user",fieldLabel:t("password")+" "+t("username"),allowBlank:true},{name:"senha_admin",fieldLabel:t("password")+" "+t("admin"),allowBlank:true},{name:"antireset",fieldLabel:t("antireset"),xtype:"noyescombo"},{name:"Enable_Web_Server",fieldLabel:t("Enable_Web_Server"),xtype:"yesnocombo"},{name:"marca",fieldLabel:"marca",value:"*",hidden:true},{name:"altera",fieldLabel:"altera",value:"si",hidden:true}]},{title:t("line")+" 1",items:[{name:"User_ID_1",fieldLabel:t("username"),allowBlank:true},{name:"Password_1",fieldLabel:t("password"),allowBlank:true},{name:"Use_Pref_Codec_Only_1",fieldLabel:t("Use_Pref_Codec"),xtype:"noyescombo"},{name:"Preferred_Codec_1",fieldLabel:t("codec"),allowBlank:true,value:"G729a"},{name:"Register_Expires_1",fieldLabel:"Register Expires",allowBlank:true,value:"360"},{name:"Dial_Plan_1",fieldLabel:"Dial Plan",allowBlank:true,value:"(*xx|[3469]11|0|00|[2-9]xxxxxx|1xxx[2-9]xxxxxxS0|xxxxxxxxxxxx.)"},{name:"NAT_Mapping_Enable_1_",fieldLabel:"NAT Mapping",allowBlank:true,xtype:"noyescombo"},{name:"NAT_Keep_Alive_Enable_1_",fieldLabel:"NAT Keep Alive",allowBlank:true,xtype:"noyescombo"}]},{title:t("line")+" 2",items:[{name:"User_ID_2",fieldLabel:t("username"),allowBlank:true},{name:"Password_2",fieldLabel:t("password"),allowBlank:true},{name:"Use_Pref_Codec_Only_2",fieldLabel:t("Use_Pref_Codec"),xtype:"noyescombo"},{name:"Preferred_Codec_2",fieldLabel:t("codec"),allowBlank:true,value:"G729a"},{name:"Register_Expires_2",fieldLabel:"Register Expires",allowBlank:true,value:"360"},{name:"Dial_Plan_2",fieldLabel:"Dial Plan",allowBlank:true,value:"(*xx|[3469]11|0|00|[2-9]xxxxxx|1xxx[2-9]xxxxxxS0|xxxxxxxxxxxx.)"},{name:"NAT_Mapping_Enable_2_",fieldLabel:"NAT Mapping",allowBlank:true,xtype:"noyescombo"},{name:"NAT_Keep_Alive_Enable_2_",fieldLabel:"NAT Keep Alive",allowBlank:true,xtype:"noyescombo"}]},{title:"Stun",items:[{name:"STUN_Enable",fieldLabel:t("active")+"Stun",allowBlank:true,xtype:"noyescombo"},{name:"STUN_Test_Enable",fieldLabel:"STUN Test",allowBlank:true,xtype:"noyescombo"},{name:"Substitute_VIA_Addr",fieldLabel:"Substitute VIA Addr",allowBlank:true,xtype:"noyescombo"},{name:"STUN_Server",fieldLabel:"STUN Server",allowBlank:true}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["sipurasform"],["component","box","container","panel","form","sipurasform"],{component:true,box:true,container:true,panel:true,form:true,sipurasform:true},["widget.sipurasform"],0,[MBilling.view.sipuras,"Form"],0));(Ext.cmd.derive("MBilling.view.iax.Controller",Ext.ux.app.ViewController,{onEdit:function(){Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments);var g=this,e=g.list.getSelectionModel().getSelection()[0],f=g.formPanel.idRecord?e.get("allow").split(","):["g729","gsm","alaw","ulaw"],j=g.formPanel.down("checkboxgroup");j.setValue({allow:f})}},0,0,0,0,["controller.iax"],0,[MBilling.view.iax,"Controller"],0));(Ext.cmd.derive("MBilling.view.iax.Module",Ext.ux.panel.Module,{controller:"iax"},0,["iaxmodule"],["component","box","container","uxpanelmodule","iaxmodule"],{component:true,box:true,container:true,uxpanelmodule:true,iaxmodule:true},["widget.iaxmodule"],0,[MBilling.view.iax,"Module"],0));(Ext.cmd.derive("MBilling.view.iax.List",Ext.ux.grid.Panel,{store:"Iax",fieldSearch:"username",initComponent:function(){var b=this;b.columns=b.columns||[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("username"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:3},{header:t("ramal"),dataIndex:"name",flex:3},{header:t("password"),dataIndex:"secret",flex:2},{header:t("host"),dataIndex:"host",flex:3},{header:"IP",dataIndex:"ipaddr",flex:5},{header:t("context"),dataIndex:"context",hidden:true,hideable:!App.user.isClient,flex:1},{header:t("callerid"),dataIndex:"callerid",hidden:true,hideable:!App.user.isClient,flex:1},{header:t("codec"),dataIndex:"allow",hidden:true,hideable:!App.user.isClient,flex:1},{header:"nat",dataIndex:"nat",hidden:true,hideable:!App.user.isClient,flex:1},{header:"qualify",dataIndex:"qualify",hidden:true,hideable:!App.user.isClient,flex:1},{header:"dtmfmode",dataIndex:"dtmfmode",hidden:true,hideable:!App.user.isClient,flex:1},{header:"insecure",dataIndex:"insecure",hidden:true,hideable:!App.user.isClient,flex:1},{header:"type",dataIndex:"type",hidden:true,hideable:!App.user.isClient,flex:1}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["iaxlist"],["component","box","container","panel","tablepanel","gridpanel","grid","iaxlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,iaxlist:true},["widget.iaxlist"],0,[MBilling.view.iax,"List"],0));(Ext.cmd.derive("MBilling.view.iax.Form",Ext.ux.form.Panel,{bodyPadding:0,fieldsHideUpdateLot:["id_user","defaultuser","secret"],initComponent:function(){var b=this;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true,labelAlign:"right"}},items:[{title:t("general"),items:[{xtype:"userlookup",ownerForm:b,fieldLabel:t("accountcode"),hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"username",fieldLabel:t("username"),minLength:4,readOnly:App.user.isClient},{name:"secret",fieldLabel:t("password"),allowBlank:true,minLength:6,readOnly:App.user.isClient},{name:"callerid",fieldLabel:t("callerid"),allowBlank:true},{name:"disallow",fieldLabel:"disallow",value:"all",hidden:!App.user.isAdmin,allowBlank:App.user.isClient},{xtype:"checkboxgroup",columns:3,fieldLabel:t("codec"),items:[{boxLabel:"g729",name:"allow",inputValue:"g729",checked:true},{boxLabel:"g723",name:"allow",inputValue:"g723"},{boxLabel:"gsm",name:"allow",inputValue:"gsm",checked:true},{boxLabel:"g726",name:"allow",inputValue:"g726"},{boxLabel:"alaw",name:"allow",inputValue:"alaw",checked:true},{boxLabel:"ulaw",name:"allow",inputValue:"ulaw",checked:true},{boxLabel:"g722",name:"allow",inputValue:"g722"},{boxLabel:"ilbc",name:"allow",inputValue:"ilbc"},{boxLabel:"speex",name:"allow",inputValue:"speex"},{boxLabel:"h261",name:"allow",inputValue:"h261"},{boxLabel:"h263",name:"allow",inputValue:"h263"}],hidden:!App.user.isAdmin,allowBlank:App.user.isClient},{name:"host",fieldLabel:t("host"),value:"dynamic",hidden:App.user.isClient,allowBlank:App.user.isClient}]},{title:t("natdetails"),hidden:!App.user.isAdmin,items:[{name:"nat",fieldLabel:"nat",value:App.user.asteriskVersion=="1.8"?"yes":"force_rport,comedia",allowBlank:!App.user.isAdmin}]},{title:t("suplementaryInfo"),hidden:!App.user.isAdmin,items:[{name:"context",fieldLabel:t("context"),value:"billing",hidden:!App.user.isAdmin,allowBlank:true},{xtype:"yesnostringcombo",name:"qualify",fieldLabel:"qualify",value:"no",allowBlank:!App.user.isAdmin},{name:"dtmfmode",fieldLabel:"dtmfmode",value:"RFC2833",allowBlank:!App.user.isAdmin},{name:"insecure",fieldLabel:"insecure",value:"no",allowBlank:true},{name:"type",fieldLabel:"type",value:"friend",allowBlank:!App.user.isAdmin},{name:"calllimit",xtype:"numberfield",fieldLabel:t("calllimit"),value:"0",allowBlank:!App.user.isAdmin}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["iaxform"],["component","box","container","panel","form","iaxform"],{component:true,box:true,container:true,panel:true,form:true,iaxform:true},["widget.iaxform"],0,[MBilling.view.iax,"Form"],0));(Ext.cmd.derive("MBilling.view.iax.Lookup",Ext.ux.form.field.Lookup,{name:"id_iax",fieldLabel:t("Iax"),displayField:"idIaxname",displayFieldList:"name",gridConfig:{xtype:"iaxlist",fieldSearch:"name",columns:[{header:t("Account"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:2},{header:t("name"),dataIndex:"name",flex:2}]}},0,["siaxlookup"],["component","box","container","fieldcontainer","siaxlookup"],{component:true,box:true,container:true,fieldcontainer:true,siaxlookup:true},["widget.siaxlookup"],0,[MBilling.view.iax,"Lookup"],0));(Ext.cmd.derive("MBilling.view.callOnLine.Controller",Ext.ux.app.ViewController,{onEdit:function(){var d=this,e=d.list.getSelectionModel().getSelection()[0],f=e.get("uniqueid");Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments);Ext.Ajax.request({url:"index.php/callOnLine/getChannelDetails",params:{id:e.get("uniqueid")},scope:d,success:function(a){a=Ext.decode(a.responseText);if(a[d.nameSuccessRequest]){d.formPanel.getForm().findField("description").setValue(a.description);d.formPanel.getForm().findField("codec").setValue(a.codec);d.formPanel.getForm().findField("reinvite").setValue(a.reinvite);d.formPanel.getForm().findField("from_ip").setValue(a.from_ip);d.formPanel.getForm().findField("ndiscado").setValue(a.ndiscado);d.formPanel.getForm().findField("billsec").setValue(a.billsec);d.formPanel.getForm().findField("callerid").setValue(a.callerid)}else{Ext.ux.Alert.alert(d.titleError,a[d.nameMsgRequest],"error")}}})},onSpyCallFree:function(e){var f=this,d=f.list.getSelectionModel().getSelection()[0];if(f.list.getSelectionModel().getSelection().length==1){Ext.Ajax.request({url:"index.php/callOnLine/spyCall",params:{type:"b",channel:d.get("canal")},scope:f,success:function(a){a=Ext.decode(a.responseText);if(a[f.nameSuccessRequest]){Ext.ux.Alert.alert(f.titleSuccess,a[f.nameMsgRequest],"success")}else{Ext.ux.Alert.alert(f.titleError,a[f.nameMsgRequest],"error")}}})}else{Ext.ux.Alert.alert(f.titleError,"Please Select only a record","notification")}},onDelete:function(e){var f=this,d=f.list.getSelectionModel().getSelection()[0];if(f.list.getSelectionModel().getSelection().length==1){Ext.Ajax.request({url:"index.php/callOnLine/destroy",params:{id:d.get("uniqueid")},scope:f,success:function(a){a=Ext.decode(a.responseText);if(a[f.nameSuccessRequest]){Ext.ux.Alert.alert(f.titleSuccess,a[f.nameMsgRequest],"success")}else{Ext.ux.Alert.alert(f.titleError,a[f.nameMsgRequest],"error")}}})}else{Ext.ux.Alert.alert(f.titleError,"Please Select only a record","notification")}f.store.load()}},0,0,0,0,["controller.callonline"],0,[MBilling.view.callOnLine,"Controller"],0));(Ext.cmd.derive("MBilling.view.callOnLine.Module",Ext.ux.panel.Module,{controller:"callonline"},0,["callonlinemodule"],["component","box","container","uxpanelmodule","callonlinemodule"],{component:true,box:true,container:true,uxpanelmodule:true,callonlinemodule:true},["widget.callonlinemodule"],0,[MBilling.view.callOnLine,"Module"],0));(Ext.cmd.derive("MBilling.view.callOnLine.SpyCall",Ext.window.Window,{modal:true,layout:"fit",iconCls:"call",title:t("Spy call"),width:450,height:window.isThemeNeptune||window.isThemeCrisp?170:window.isThemeTriton?290:170,labelWidthFields:80,channel:0,initComponent:function(){var b=this;if(b.list.getSelectionModel().getSelection().length==1){selected=b.list.getSelectionModel().getSelection()[0];if(selected.get("canal")){b.channel=selected.get("canal")}else{b.channel=selected.get("channel")}b.title=t("Spy call")+" "+selected.get("ndiscado")+" "+b.channel,b.autoShow=true;b.items=[{xtype:"form",bodyPadding:5,defaults:{anchor:"0",enableKeyEvents:true,labelWidth:b.labelWidthFields,msgTarget:"side",plugins:"markallowblank",allowBlank:false},items:[{xtype:"siplookup",name:"id_sip",displayField:t("Sip Account")},{xtype:"combobox",name:"type",value:"b",forceSelection:true,editable:false,store:[["b",t("Only Spy")],["w",t("Whisper, can talk to the spied")],["W",t("Whisper, can talk to the spied but cannot listen the call")]],fieldLabel:t("Spy type")}]}];b.title=b.title+(b.titleModule?" - "+b.titleModule:"");b.bbar=[{width:150,text:t("Send"),scope:b,handler:b.onSendSpy}]}else{Ext.ux.Alert.alert(b.titleError,"Please Select only a record","notification")}Ext.window.Window.prototype.initComponent.apply(this,arguments)},onSendSpy:function(d){var f=this,e=f.list.store;if(!f.down("form").isValid()){Ext.ux.Alert.alert("Alert",t("Select sip account"),"notification");return}f.list.setLoading(true);Ext.Ajax.setTimeout(1000000);f.down("form").submit({url:"index.php/callOnLine/spyCall",params:{id_sip:selected.get("id_sip"),type:selected.get("type"),channel:f.channel},scope:f,success:function(c,b){var a=Ext.decode(b.response.responseText);if(a.success){Ext.ux.Alert.alert(t("Success"),a.msg,"success")}else{Ext.ux.Alert.alert(t("Error"),a.errors,"error")}d.enable();f.list.setLoading(false);e.load();f.close()},failure:function(c,b){console.log(b.response.responseText);if(b.response&&Ext.isObject(b.response.responseText)){var a=Ext.decode(b.response.responseText);Ext.ux.Alert.alert(t("Error1"),a.errors,"error")}else{Ext.ux.Alert.alert(t("Error2"),Ext.decode(b.response.responseText).msg,"error",true,10)}d.enable()}})}},0,["callonlinespycall"],["component","box","container","panel","window","callonlinespycall"],{component:true,box:true,container:true,panel:true,window:true,callonlinespycall:true},["widget.callonlinespycall"],0,[MBilling.view.callOnLine,"SpyCall"],0));(Ext.cmd.derive("MBilling.view.callOnLine.List",Ext.ux.grid.Panel,{store:"CallOnLine",fieldSearch:"idUser.username",refreshTime:15,initComponent:function(){var b=this;b.buttonCsv=false;b.allowPrint=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=!App.user.isClient;b.textDelete=t("Hangup Call"),b.buttonDeleteWidth=140,b.refreshTime=(localStorage&&localStorage.getItem("callonlinerefresh"))||b.refreshTime;b.extraButtons=[{text:t("Spy")+" "+t("call"),iconCls:"call",handler:window.multSpy?"onSpyCall":"onSpyCallFree",width:130,disabled:false},{xtype:"numberfield",field:"jmlhBrg",fieldLabel:t("Refresh Time"),editable:false,minValue:5,labelWidth:90,width:150,selectOnFocus:true,allowDecimals:true,decimalPrecision:2,value:b.refreshTime,listeners:{change:function(a){if(a.value>0){b.refreshTime=a.value;localStorage.setItem("callonlinerefresh",a.value)}}}}];b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("UniqueID"),dataIndex:"uniqueid",hidden:true,hideable:App.user.isAdmin},{header:t("Sip Account"),dataIndex:"canal",flex:3},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:3},{header:t("credit"),dataIndex:"idUsercredit",filter:{type:"int",field:"idUser.credit"},renderer:Helper.Util.formatMoneyDecimal,flex:2},{header:t("number"),dataIndex:"ndiscado",flex:3},{header:t("status"),dataIndex:"status",filter:{type:"string",field:"status"},flex:2},{header:t("duration"),dataIndex:"duration",renderer:Helper.Util.formatsecondsToTime,flex:2},{header:t("trunk"),dataIndex:"tronco",flex:4,hidden:!App.user.isAdmin,hideable:App.user.isAdmin},{header:t("Server"),dataIndex:"server",flex:3,hidden:!window.slave||!App.user.isAdmin,hideable:App.user.isAdmin}];b.sessionLoad=Ext.create("Ext.util.DelayedTask",function(){b.store.load()},b);Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments);b.store.on("load",b.onLoadStore,b)},onLoadStore:function(){var b=this;b.onDeactivateModule();b.onActivateModule()},onRender:function(){var b=this;if(Ext.isObject(b.module)){b.module.on("activate",b.onActivateModule,b);b.module.on("deactivate",b.onDeactivateModule,b);b.module.on("close",b.onCloseModule,b)}Ext.ux.grid.Panel.prototype.onRender.apply(this,arguments)},onActivateModule:function(){this.sessionLoad&&this.sessionLoad.delay(this.refreshTime*1000)},onDeactivateModule:function(){this.sessionLoad&&this.sessionLoad.cancel()},onCloseModule:function(){this.onDeactivateModule();this.sessionLoad=null}},0,["callonlinelist"],["component","box","container","panel","tablepanel","gridpanel","grid","callonlinelist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callonlinelist:true},["widget.callonlinelist"],0,[MBilling.view.callOnLine,"List"],0));(Ext.cmd.derive("MBilling.view.callOnLine.List2",Ext.ux.grid.Panel,{store:"CallOnLine",fieldSearch:"username",refreshTime:10,initComponent:function(){var b=this;b.buttonCsv=false;b.allowPrint=false;b.buttonUpdateLot=false;b.allowCreate=false;b.buttonCleanFilter=false;b.allowUpdate=false;b.allowDelete=false;b.refreshTime=(localStorage&&localStorage.getItem("callonlinerefresh"))||b.refreshTime;b.extraButtons=[{xtype:"numberfield",field:"jmlhBrg",fieldLabel:t("Refresh Time"),editable:false,minValue:5,labelWidth:90,width:150,selectOnFocus:true,allowDecimals:true,decimalPrecision:2,value:b.refreshTime,listeners:{change:function(a){if(a.value>0){b.refreshTime=a.value;localStorage.setItem("callonlinerefresh",a.value)}}}}];b.columns=[{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:2},{header:t("Sip Account"),dataIndex:"canal",flex:3,hidden:true,hideable:true},{header:t("number"),dataIndex:"ndiscado",flex:3},{header:t("status"),dataIndex:"status",filter:{type:"string",field:"status"},flex:2},{header:t("duration"),dataIndex:"duration",renderer:Helper.Util.formatsecondsToTime,flex:2},{header:t("trunk"),dataIndex:"tronco",flex:4,hidden:App.user.isClient,hideable:!App.user.isClient}];b.sessionLoad=Ext.create("Ext.util.DelayedTask",function(){b.store.load()},b);Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments);b.store.on("load",b.onLoadStore,b)},onLoadStore:function(){var b=this;b.onDeactivateModule();b.onActivateModule()},onRender:function(){var b=this;if(Ext.isObject(b.module)){b.module.on("activate",b.onActivateModule,b);b.module.on("deactivate",b.onDeactivateModule,b);b.module.on("close",b.onCloseModule,b)}Ext.ux.grid.Panel.prototype.onRender.apply(this,arguments)},onActivateModule:function(){this.sessionLoad&&this.sessionLoad.delay(this.refreshTime*1000)},onDeactivateModule:function(){this.sessionLoad&&this.sessionLoad.cancel()},onCloseModule:function(){this.onDeactivateModule();this.sessionLoad=null}},0,["callonlinelist2"],["component","box","container","panel","tablepanel","gridpanel","grid","callonlinelist2"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callonlinelist2:true},["widget.callonlinelist2"],0,[MBilling.view.callOnLine,"List2"],0));(Ext.cmd.derive("MBilling.view.callOnLine.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{fieldLabel:t("number"),name:"ndiscado",readOnly:true},{fieldLabel:t("CallerID"),name:"callerid",readOnly:true},{fieldLabel:t("Real")+" "+t("duration"),name:"billsec",readOnly:true},{fieldLabel:t("Codec"),name:"codec",readOnly:true},{fieldLabel:t("Reinvite"),name:"reinvite",readOnly:true},{fieldLabel:t("From IP"),name:"from_ip",readOnly:true},{xtype:"textarea",name:"description",readOnly:true,height:350,anchor:"100%",hidden:!App.user.isAdmin}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callonlineform"],["component","box","container","panel","form","callonlineform"],{component:true,box:true,container:true,panel:true,form:true,callonlineform:true},["widget.callonlineform"],0,[MBilling.view.callOnLine,"Form"],0));(Ext.cmd.derive("MBilling.view.sendCreditSummary.Controller",Ext.ux.app.ViewController,{formHidden:true},0,0,0,0,["controller.sendcreditsummary"],0,[MBilling.view.sendCreditSummary,"Controller"],0));(Ext.cmd.derive("MBilling.view.sendCreditSummary.Module",Ext.form.Panel,{resizable:false,autoShow:true,header:false,items:[{xtype:"component",autoEl:{width:"100%",height:"100%",tag:"iframe",src:"index.php/sendCreditSummary/read"}}]},0,["sendcreditsummarymodule"],["component","box","container","panel","form","sendcreditsummarymodule"],{component:true,box:true,container:true,panel:true,form:true,sendcreditsummarymodule:true},["widget.sendcreditsummarymodule"],0,[MBilling.view.sendCreditSummary,"Module"],0));(Ext.cmd.derive("MBilling.view.sendCreditSummary.List",Ext.ux.grid.Panel,{store:"SendCreditSummary",initComponent:function(){var b=this;b.extraButtons=[{emptyText:t("From Day"),xtype:"searchfield",fieldFilter:"date",filterOnClick:b.filterFieldOnClick,store:b.store,comparison:"gt",type:"date"},{emptyText:t("To Day"),xtype:"searchfield",fieldFilter:"date",filterOnClick:b.filterFieldOnClick,store:b.store,comparison:"lt",type:"date"}];b.buttonCsv=false;b.buttonPrint=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("day"),renderer:Ext.util.Format.dateRenderer("Y-m-d"),dataIndex:"day",menuDisabled:true,flex:3},{header:t("service"),dataIndex:"service",flex:5},{header:t("Total cost"),dataIndex:"total_cost",flex:5,renderer:Helper.Util.formatMoneyDecimal2},{header:t("Total sale"),dataIndex:"total_sale",flex:5,renderer:Helper.Util.formatMoneyDecimal2},{header:t("Earned"),dataIndex:"earned",flex:5,renderer:Helper.Util.formatMoneyDecimal2}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["sendcreditsummarylist"],["component","box","container","panel","tablepanel","gridpanel","grid","sendcreditsummarylist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,sendcreditsummarylist:true},["widget.sendcreditsummarylist"],0,[MBilling.view.sendCreditSummary,"List"],0));(Ext.cmd.derive("MBilling.view.sendCreditSummary.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:App.user.isClient}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["sendcreditsummaryform"],["component","box","container","panel","form","sendcreditsummaryform"],{component:true,box:true,container:true,panel:true,form:true,sendcreditsummaryform:true},["widget.sendcreditsummaryform"],0,[MBilling.view.sendCreditSummary,"Form"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayUser.Controller",Ext.ux.app.ViewController,{onEdit:function(){me=this;me.sumData=me.store.getData().items[0].getData();if(!me.sumData){return}me.formPanel.getForm().getFields().each(function(b){b.setValue(me.sumData[b.name])});me.formPanel.expand()},onExportCsvDayUser:function(o,l,g){var m=this,j=m.list.getStore(),n=m.list.filters.getFilterData().length?Ext.encode(m.list.filters.getFilterData()):j.proxy.extraParams.filter;window.open("index.php/callSummaryDayUser/exportCsvCalls?id="+o.getStore().getAt(l).getData().idUserusername+"&filter="+n)}},0,0,0,0,["controller.callsummarydayuser"],0,[MBilling.view.callSummaryDayUser,"Controller"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayUser.Module",Ext.ux.panel.Module,{controller:"callsummarydayuser",titleDetails:t("total"),iconForm:"icon-sum",cfgEast:{flex:0.4}},0,["callsummarydayusermodule"],["component","box","container","uxpanelmodule","callsummarydayusermodule"],{component:true,box:true,container:true,uxpanelmodule:true,callsummarydayusermodule:true},["widget.callsummarydayusermodule"],0,[MBilling.view.callSummaryDayUser,"Module"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayUser.List",Ext.ux.grid.Panel,{store:"CallSummaryDayUser",initComponent:function(){var b=this;b.buttonImportCsv=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{xtype:"actioncolumn",width:26,sortable:false,menuDisabled:true,header:t(""),dataIndex:"id",items:[{iconCls:"icon-export-csv",tooltip:t("Export CSV"),handler:"onExportCsvDayUser"}],hidden:!App.user.isAdmin},{header:t("day"),renderer:Ext.util.Format.dateRenderer("Y-m-d"),dataIndex:"day",filter:{type:"date",field:"day"},flex:3},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("sessiontime")+" "+t("Min"),dataIndex:"sessiontime",flex:2},{header:t("aloc_all_calls"),dataIndex:"aloc_all_calls",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Answered Calls"),dataIndex:"nbcall",flex:3},{header:t("buycost"),dataIndex:App.user.isAdmin?"buycost":"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("sessionbill"),dataIndex:App.user.isAgent||App.user.isClientAgent?"agent_bill":"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("markup"),dataIndex:"lucro",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarydayuserlist"],["component","box","container","panel","tablepanel","gridpanel","grid","callsummarydayuserlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callsummarydayuserlist:true},["widget.callsummarydayuserlist"],0,[MBilling.view.callSummaryDayUser,"List"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayUser.Form",Ext.ux.form.Panel,{defaults:{},labelWidthFields:100,defaultType:"displayfield",initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{name:"sumsessiontime",fieldLabel:t("sessiontime")+" "+t("Min"),renderer:Ext.util.Format.numberRenderer("0"),allowBlank:true},{name:App.user.isAgent||App.user.isClientAgent?"sumagent_bill":"sumsessionbill",fieldLabel:t("sessionbill"),renderer:Helper.Util.formatMoneyDecimal,allowBlank:true},{name:App.user.isAdmin?"sumbuycost":"sumsessionbill",fieldLabel:t("buycost"),renderer:Helper.Util.formatMoneyDecimal,hidden:App.user.isClient,allowBlank:true},{name:"sumlucro",fieldLabel:t("markup"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumnbcall",fieldLabel:t("nbcall"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarydayuserform"],["component","box","container","panel","form","callsummarydayuserform"],{component:true,box:true,container:true,panel:true,form:true,callsummarydayuserform:true},["widget.callsummarydayuserform"],0,[MBilling.view.callSummaryDayUser,"Form"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayTrunk.Controller",Ext.ux.app.ViewController,{onEdit:function(){me=this;me.sumData=me.store.getData().items[0].getData();if(!me.sumData){return}me.formPanel.getForm().getFields().each(function(b){b.setValue(me.sumData[b.name])});me.formPanel.expand()}},0,0,0,0,["controller.callsummarydaytrunk"],0,[MBilling.view.callSummaryDayTrunk,"Controller"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayTrunk.Module",Ext.ux.panel.Module,{controller:"callsummarydaytrunk",titleDetails:t("total"),iconForm:"icon-sum",cfgEast:{flex:0.4}},0,["callsummarydaytrunkmodule"],["component","box","container","uxpanelmodule","callsummarydaytrunkmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callsummarydaytrunkmodule:true},["widget.callsummarydaytrunkmodule"],0,[MBilling.view.callSummaryDayTrunk,"Module"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayTrunk.List",Ext.ux.grid.Panel,{store:"CallSummaryDayTrunk",initComponent:function(){var b=this;b.buttonImportCsv=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{header:t("day"),renderer:Ext.util.Format.dateRenderer("Y-m-d"),dataIndex:"day",filter:{type:"date",field:"day"},flex:3},{header:t("Trunk"),dataIndex:"idTrunktrunkcode",filter:{type:"string",field:"idTrunk.trunkcode"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("sessiontime")+" "+t("Min"),dataIndex:"sessiontime",flex:2},{header:t("aloc_all_calls"),dataIndex:"aloc_all_calls",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Answered Calls"),dataIndex:"nbcall",flex:3},{header:t("buycost"),dataIndex:"buycost",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("sessionbill"),dataIndex:"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("markup"),dataIndex:"lucro",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarydaytrunklist"],["component","box","container","panel","tablepanel","gridpanel","grid","callsummarydaytrunklist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callsummarydaytrunklist:true},["widget.callsummarydaytrunklist"],0,[MBilling.view.callSummaryDayTrunk,"List"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayTrunk.Form",Ext.ux.form.Panel,{defaults:{},labelWidthFields:100,defaultType:"displayfield",initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{name:"sumsessiontime",fieldLabel:t("sessiontime")+" "+t("Min"),renderer:Ext.util.Format.numberRenderer("0"),allowBlank:true},{name:"sumsessionbill",fieldLabel:t("sessionbill"),renderer:Helper.Util.formatMoneyDecimal,allowBlank:true},{name:"sumbuycost",fieldLabel:t("buycost"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumlucro",fieldLabel:t("markup"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumnbcall",fieldLabel:t("nbcall"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarydaytrunkform"],["component","box","container","panel","form","callsummarydaytrunkform"],{component:true,box:true,container:true,panel:true,form:true,callsummarydaytrunkform:true},["widget.callsummarydaytrunkform"],0,[MBilling.view.callSummaryDayTrunk,"Form"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayAgent.Controller",Ext.ux.app.ViewController,{onEdit:function(){me=this;me.sumData=me.store.getData().items[0].getData();if(!me.sumData){return}me.formPanel.getForm().getFields().each(function(b){b.setValue(me.sumData[b.name])});me.formPanel.expand()}},0,0,0,0,["controller.callsummarydayagent"],0,[MBilling.view.callSummaryDayAgent,"Controller"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayAgent.Module",Ext.ux.panel.Module,{controller:"callsummarydayagent",titleDetails:t("total"),iconForm:"icon-sum",cfgEast:{flex:0.4}},0,["callsummarydayagentmodule"],["component","box","container","uxpanelmodule","callsummarydayagentmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callsummarydayagentmodule:true},["widget.callsummarydayagentmodule"],0,[MBilling.view.callSummaryDayAgent,"Module"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayAgent.List",Ext.ux.grid.Panel,{store:"CallSummaryDayAgent",initComponent:function(){var b=this;b.buttonImportCsv=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{header:t("day"),renderer:Ext.util.Format.dateRenderer("Y-m-d"),dataIndex:"day",filter:{type:"date",field:"day"},flex:3},{header:t("Agent"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{menuDisabled:true,header:t("sessiontime")+" "+t("Min"),dataIndex:"sessiontime",flex:2},{header:t("aloc_all_calls"),dataIndex:"aloc_all_calls",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Answered Calls"),dataIndex:"nbcall",flex:3},{header:t("buycost"),dataIndex:"buycost",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("sessionbill"),dataIndex:"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("markup"),dataIndex:"lucro",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarydayagentlist"],["component","box","container","panel","tablepanel","gridpanel","grid","callsummarydayagentlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callsummarydayagentlist:true},["widget.callsummarydayagentlist"],0,[MBilling.view.callSummaryDayAgent,"List"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayAgent.Form",Ext.ux.form.Panel,{defaults:{},labelWidthFields:100,defaultType:"displayfield",initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{name:"sumsessiontime",fieldLabel:t("sessiontime")+" "+t("Min"),renderer:Ext.util.Format.numberRenderer("0"),allowBlank:true},{name:"sumsessionbill",fieldLabel:t("sessionbill"),renderer:Helper.Util.formatMoneyDecimal,allowBlank:true},{name:"sumbuycost",fieldLabel:t("buycost"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumlucro",fieldLabel:t("markup"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumnbcall",fieldLabel:t("nbcall"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarydayagentform"],["component","box","container","panel","form","callsummarydayagentform"],{component:true,box:true,container:true,panel:true,form:true,callsummarydayagentform:true},["widget.callsummarydayagentform"],0,[MBilling.view.callSummaryDayAgent,"Form"],0));(Ext.cmd.derive("MBilling.view.callerid.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.callerid"],0,[MBilling.view.callerid,"Controller"],0));(Ext.cmd.derive("MBilling.view.callerid.Module",Ext.ux.panel.Module,{controller:"callerid"},0,["calleridmodule"],["component","box","container","uxpanelmodule","calleridmodule"],{component:true,box:true,container:true,uxpanelmodule:true,calleridmodule:true},["widget.calleridmodule"],0,[MBilling.view.callerid,"Module"],0));(Ext.cmd.derive("MBilling.view.callerid.List",Ext.ux.grid.Panel,{store:"Callerid",initComponent:function(){var b=this;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("cid"),dataIndex:"cid",flex:4},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("status"),dataIndex:"activated",renderer:Helper.Util.formatBooleanActive,comboRelated:"booleancombo",flex:2,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")]]}}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["calleridlist"],["component","box","container","panel","tablepanel","gridpanel","grid","calleridlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,calleridlist:true},["widget.calleridlist"],0,[MBilling.view.callerid,"List"],0));(Ext.cmd.derive("MBilling.view.callerid.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["id_user"],initComponent:function(){var b=this;b.items=[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"cid",fieldLabel:t("cid")},{xtype:"booleancombo",name:"activated",fieldLabel:t("status"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["calleridform"],["component","box","container","panel","form","calleridform"],{component:true,box:true,container:true,panel:true,form:true,calleridform:true},["widget.calleridform"],0,[MBilling.view.callerid,"Form"],0));(Ext.cmd.derive("MBilling.view.restrictedPhonenumber.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.restrictedphonenumber"],0,[MBilling.view.restrictedPhonenumber,"Controller"],0));(Ext.cmd.derive("MBilling.view.restrictedPhonenumber.Module",Ext.ux.panel.Module,{controller:"restrictedphonenumber"},0,["restrictedphonenumbermodule"],["component","box","container","uxpanelmodule","restrictedphonenumbermodule"],{component:true,box:true,container:true,uxpanelmodule:true,restrictedphonenumbermodule:true},["widget.restrictedphonenumbermodule"],0,[MBilling.view.restrictedPhonenumber,"Module"],0));(Ext.cmd.derive("MBilling.view.restrictedPhonenumber.List",Ext.ux.grid.Panel,{store:"RestrictedPhonenumber",buttonImportCsv:true,initComponent:function(){var b=this;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:2,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("number"),dataIndex:"number",flex:2}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["restrictedphonenumberlist"],["component","box","container","panel","tablepanel","gridpanel","grid","restrictedphonenumberlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,restrictedphonenumberlist:true},["widget.restrictedphonenumberlist"],0,[MBilling.view.restrictedPhonenumber,"List"],0));(Ext.cmd.derive("MBilling.view.restrictedPhonenumber.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["id_user"],initComponent:function(){var b=this;b.items=[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,readOnly:App.user.isClient,allowBlank:App.user.isClient},{name:"number",fieldLabel:t("number")}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["restrictedphonenumberform"],["component","box","container","panel","form","restrictedphonenumberform"],{component:true,box:true,container:true,panel:true,form:true,restrictedphonenumberform:true},["widget.restrictedphonenumberform"],0,[MBilling.view.restrictedPhonenumber,"Form"],0));(Ext.cmd.derive("MBilling.view.restrictedPhonenumber.ImportCsv",Ext.ux.window.ImportCsv,{htmlTipInfo:"
number
",fieldsImport:[{xtype:"usercombo",width:350}]},0,["restrictedphonenumberimportcsv"],["component","box","container","panel","window","restrictedphonenumberimportcsv"],{component:true,box:true,container:true,panel:true,window:true,restrictedphonenumberimportcsv:true},["widget.restrictedphonenumberimportcsv"],0,[MBilling.view.restrictedPhonenumber,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.did.Controller",Ext.ux.app.ViewController,{isSubmitForm:true,init:function(){var b=this;b.control({"booleancombo[name=cbr]":{select:b.onSelectcbr},"noyescombo[name=cbr_ua]":{select:b.onSelectcbrAu}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectcbr:function(c,d){me=this,form=me.formPanel.getForm();form.findField("cbr_ua").setVisible(d.data.field1);form.findField("cbr_total_try").setVisible(d.data.field1);form.findField("cbr_time_try").setVisible(d.data.field1)},onSelectcbrAu:function(c,d){me=this,form=me.formPanel.getForm();form.findField("cbr_em").setVisible(d.data.field1);form.findField("TimeOfDay_monFri").setVisible(d.data.field1);form.findField("TimeOfDay_sat").setVisible(d.data.field1);form.findField("TimeOfDay_sun").setVisible(d.data.field1);form.findField("workaudio").setVisible(d.data.field1);form.findField("noworkaudio").setVisible(d.data.field1)},onNew:function(e){var f=this,d=f.formPanel.getForm();d.findField("cbr_ua").setVisible(false);d.findField("cbr_em").setVisible(false);d.findField("TimeOfDay_monFri").setVisible(false);d.findField("TimeOfDay_sat").setVisible(false);d.findField("TimeOfDay_sun").setVisible(false);d.findField("workaudio").setVisible(false);d.findField("noworkaudio").setVisible(false);d.findField("cbr_total_try").setVisible(false);d.findField("cbr_time_try").setVisible(false);Ext.ux.app.ViewController.prototype.onNew.apply(this,arguments)},onEdit:function(){var c=this,d=c.list.getSelectionModel().getSelection()[0];if(d.get("cbr")==0){c.formPanel.getForm().findField("cbr_ua").setVisible(false);c.formPanel.getForm().findField("cbr_em").setVisible(false);c.formPanel.getForm().findField("TimeOfDay_monFri").setVisible(false);c.formPanel.getForm().findField("TimeOfDay_sat").setVisible(false);c.formPanel.getForm().findField("TimeOfDay_sun").setVisible(false);c.formPanel.getForm().findField("workaudio").setVisible(false);c.formPanel.getForm().findField("noworkaudio").setVisible(false);c.formPanel.getForm().findField("cbr_total_try").setVisible(false);c.formPanel.getForm().findField("cbr_time_try").setVisible(false)}else{c.formPanel.getForm().findField("cbr_ua").setVisible(true);if(d.get("cbr_ua")==1){c.formPanel.getForm().findField("cbr_em").setVisible(true);c.formPanel.getForm().findField("TimeOfDay_monFri").setVisible(true);c.formPanel.getForm().findField("TimeOfDay_sat").setVisible(true);c.formPanel.getForm().findField("TimeOfDay_sun").setVisible(true);c.formPanel.getForm().findField("workaudio").setVisible(true);c.formPanel.getForm().findField("noworkaudio").setVisible(true);c.formPanel.getForm().findField("cbr_total_try").setVisible(true);c.formPanel.getForm().findField("cbr_time_try").setVisible(true)}}Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)},onDelete:function(j){var g=this,e=g.list.getSelectionModel().getSelection(),f=true;Ext.each(e,function(a){if(a.get("reserved")===1){Ext.ux.Alert.alert(g.titleError,t("Please, first release the DID")+" "+a.raw.did,"error");f=false;return}});if(f==true){Ext.ux.app.ViewController.prototype.onDelete.apply(this,arguments)}},onRelease:function(o,l){var m=this,n=m.list.getSelectionModel().getSelection()[0],j=t("Confirm Release Did")+" "+n.get("did"),g=m.list.getStore();if(m.list.getSelectionModel().getSelection().length>1){Ext.ux.Alert.alert(m.titleError,t("Please Select only one DID to release"),"error")}else{if(n.get("reserved")===0){Ext.ux.Alert.alert(m.titleError,t("didIsNotUse"),"error");g.load()}else{Ext.Msg.confirm(m.titleConfirmation,j,function(a){if(a==="yes"){Ext.Ajax.request({url:"index.php/did/liberar",params:{id:n.get("id")},success:function(c){c=Ext.decode(c.responseText);if(c[m.nameSuccessRequest]){Ext.ux.Alert.alert(m.titleSuccess,c[m.nameMsgRequest],"success");g.load()}else{var b=Helper.Util.convertErrorsJsonToString(c[m.nameMsgRequest]);g.load()}}})}},m)}}},onBuyDid:function(){var m=this,j=m.lookupReference("buydidPanel"),f=j.getForm().findField("did").getValue(),l=j.getForm().findField("did").rawValue,g=t("confirmationBuyDid");if(f<1){Ext.ux.Alert.alert(m.titleError,t("Please, select a Did"),"warning")}else{Ext.Msg.confirm(t("Confirmation"),g+"
"+l,function(a){if(a==="yes"){Ext.ux.Alert.alert(m.titleSuccess,t("Please wait....We are activing your DID."),"notification");Ext.Ajax.request({url:"index.php/did/buy",params:{id:f},success:function(c){c=Ext.decode(c.responseText);if(c.success){Ext.ux.Alert.alert(m.titleSuccess,t(c.msg),"success",true,true,5000)}else{var b=Helper.Util.convertErrorsJsonToString(c.msg);Ext.ux.Alert.alert(m.titleError,t(b),"warning",true,true,5000)}}})}},m)}}},0,0,0,0,["controller.did"],0,[MBilling.view.did,"Controller"],0));(Ext.cmd.derive("MBilling.view.did.Combo",Ext.form.field.ComboBox,{name:"id_did",fieldLabel:t("did"),displayField:"did",forceSelection:true,editable:true,valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Did",{proxy:{type:"uxproxy",module:"did",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["didcombo"],["component","box","field","textfield","pickerfield","combobox","combo","didcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,didcombo:true},["widget.didcombo"],0,[MBilling.view.did,"Combo"],0));(Ext.cmd.derive("MBilling.view.did.BuyCombo",Ext.form.field.ComboBox,{name:"id_did",forceSelection:true,editable:false,fieldLabel:t("did"),displayField:"did",valueField:"id",listConfig:{itemTpl:Ext.create("Ext.XTemplate","
{did} ("+t("Setup")+": "+t("moedasimblo")+" {connection_charge} --> "+t("monthly payment")+": "+t("moedasimblo")+" {fixrate})
")},displayTpl:Ext.create("Ext.XTemplate",'{did} ('+t("Setup")+": "+t("moedasimblo")+" {connection_charge} --> "+t("monthly payment")+": "+t("moedasimblo")+" {fixrate})"),initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Did",{proxy:{type:"uxproxy",module:"did",actionRead:"readBuy",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["didbuycombo"],["component","box","field","textfield","pickerfield","combobox","combo","didbuycombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,didbuycombo:true},["widget.didbuycombo"],0,[MBilling.view.did,"BuyCombo"],0));(Ext.cmd.derive("MBilling.view.did.Module",Ext.ux.panel.Module,{controller:"did"},0,["didmodule"],["component","box","container","uxpanelmodule","didmodule"],{component:true,box:true,container:true,uxpanelmodule:true,didmodule:true},["widget.didmodule"],0,[MBilling.view.did,"Module"],0));(Ext.cmd.derive("MBilling.view.did.List",Ext.ux.grid.Panel,{store:"Did",fieldSearch:"did",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.extraButtons=[{text:t("crearToReleaseDid"),iconCls:"icon-delete",handler:"onRelease",disabled:false}];b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("did"),dataIndex:"did",flex:4},{header:t("reserved"),dataIndex:"reserved",renderer:Helper.Util.formattyyesno,flex:2,filter:{type:"list",options:[[1,t("yes")],[0,t("no")]]},hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:3,menuDisabled:true},{header:t("status"),dataIndex:"activated",renderer:Helper.Util.formatBooleanActive,flex:2,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")]]},hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("connection_charge"),dataIndex:"connection_charge",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("price")+" "+t("per")+" "+t("monthly"),dataIndex:"fixrate",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("secondusedreal"),renderer:Helper.Util.formatsecondsToTime,dataIndex:"secondusedreal",flex:3},{header:t("Description"),dataIndex:"description",hidden:true,hideable:App.user.isAdmin,flex:5}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["didlist"],["component","box","container","panel","tablepanel","gridpanel","grid","didlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,didlist:true},["widget.didlist"],0,[MBilling.view.did,"List"],0));(Ext.cmd.derive("MBilling.view.did.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["did"],initComponent:function(){var b=this;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{labelAlign:"right",plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true,labelWidth:140}},items:[{title:t("general"),items:[{name:"did",fieldLabel:t("did"),readOnly:App.user.isClient||App.user.isAgent},{xtype:"booleancombo",name:"activated",fieldLabel:t("status"),hidden:App.user.isClient||App.user.isAgent,allowBlank:true},{xtype:"moneyfield",name:"connection_charge",fieldLabel:t("connection_charge"),value:"0",hidden:App.user.isClient||App.user.isAgent},{xtype:"moneyfield",name:"fixrate",fieldLabel:t("Monthly")+" "+t("price"),value:"0",hidden:App.user.isClient||App.user.isAgent},{style:"margin-top:5px",xtype:"fieldset",title:t("Did")+" "+t("increment"),collapsible:false,collapsed:false,hidden:!App.user.isAdmin,defaults:{labelWidth:160,anchor:"100%",labelAlign:b.labelAlignFields},items:[{xtype:"moneyfield",name:"connection_sell",fieldLabel:t("Connetion charge"),value:"0",hidden:!App.user.isAdmin},{xtype:"numberfield",name:"minimal_time_charge",fieldLabel:t("Minimal time to charge"),value:"0",hidden:!App.user.isAdmin},{xtype:"numberfield",name:"initblock",fieldLabel:t("initblock"),value:"0",hidden:!App.user.isAdmin},{xtype:"numberfield",name:"increment",fieldLabel:t("billingblock"),value:"0",hidden:!App.user.isAdmin}]},{xtype:"combobox",name:"charge_of",fieldLabel:t("Charge")+" "+t("of"),value:1,forceSelection:true,editable:false,store:[[1,t("Owner DID")],[0,t("Caller ID, only allow call from registered callerID")]],hidden:App.user.isClient||App.user.isAgent},{xtype:"numberfield",name:"calllimit",fieldLabel:t("Channel Limit"),value:"-1",minValue:"-1",hidden:!window.didChannelLimit||!App.user.isAdmin},{xtype:"textareafield",allowBlank:true,name:"description",fieldLabel:t("description"),hidden:!App.user.isAdmin}]},{title:t("Billing"),items:[{style:"margin-top:5px",xtype:"fieldset",title:t("Did Billing per minute")+" "+t("rate")+" 1",collapsible:false,collapsed:false,hidden:!App.user.isAdmin,defaults:{labelWidth:170,anchor:"100%",labelAlign:b.labelAlignFields},items:[{xtype:"textfield",name:"expression_1",fieldLabel:t("Regular expression"),value:"*",hidden:!App.user.isAdmin},{xtype:"moneyfield",name:"selling_rate_1",fieldLabel:t("Sell price per min"),value:"0",hidden:!App.user.isAdmin},{xtype:"noyescombo",name:"block_expression_1",fieldLabel:t("Block calls from this expression"),hidden:!App.user.isAdmin},{xtype:"noyescombo",name:"send_to_callback_1",fieldLabel:t("Send the call to Callback"),hidden:!App.user.isAdmin}]},{style:"margin-top:25px",xtype:"fieldset",title:t("Did Billing per minute")+" "+t("rate")+" 2",collapsible:false,collapsed:false,hidden:!App.user.isAdmin,defaults:{labelWidth:160,anchor:"100%",labelAlign:b.labelAlignFields},items:[{xtype:"textfield",name:"expression_2",fieldLabel:t("Regular expression"),value:"*",hidden:!App.user.isAdmin},{xtype:"moneyfield",name:"selling_rate_2",fieldLabel:t("Sell price per min"),value:"0",hidden:!App.user.isAdmin},{xtype:"noyescombo",name:"block_expression_2",fieldLabel:t("Block calls from this expression"),hidden:!App.user.isAdmin},{xtype:"noyescombo",name:"send_to_callback_2",fieldLabel:t("Send the call to Callback"),hidden:!App.user.isAdmin}]},{style:"margin-top:25px",xtype:"fieldset",title:t("Did Billing per minute")+" "+t("rate")+" 3",collapsible:false,collapsed:false,hidden:!App.user.isAdmin,defaults:{labelWidth:160,anchor:"100%",labelAlign:b.labelAlignFields},items:[{xtype:"textfield",name:"expression_3",fieldLabel:t("Regular expression"),value:"*",hidden:!App.user.isAdmin},{xtype:"moneyfield",name:"selling_rate_3",fieldLabel:t("Sell price per min"),value:"0",hidden:!App.user.isAdmin},{xtype:"noyescombo",name:"block_expression_3",fieldLabel:t("Block calls from this expression"),hidden:!App.user.isAdmin},{xtype:"noyescombo",name:"send_to_callback_3",fieldLabel:t("Send the call to Callback"),hidden:!App.user.isAdmin}]}]},{title:t("CallBack Pro"),hidden:!window.cbr,items:[{xtype:"booleancombo",name:"cbr",fieldLabel:t("CallBack Pro"),value:0,hidden:!window.cbr,allowBlank:true},{xtype:"noyescombo",name:"cbr_ua",fieldLabel:t("Use Audio"),value:0,hidden:true,allowBlank:true},{xtype:"numberfield",name:"cbr_total_try",fieldLabel:t("Maximum trying"),value:3,hidden:true,allowBlank:true,minValue:0},{xtype:"numberfield",name:"cbr_time_try",fieldLabel:t("Interval beteween trying"),value:30,hidden:true,allowBlank:true,minValue:10},{xtype:"noyescombo",name:"cbr_em",fieldLabel:t("Early Media"),hidden:true,allowBlank:true},{name:"TimeOfDay_monFri",fieldLabel:t("Mon-Fri"),value:"09:00-12:00|14:00-18:00",minLength:11,hidden:true},{name:"TimeOfDay_sat",fieldLabel:t("Sat"),value:"09:00-12:00",allowBlank:true,hidden:true},{name:"TimeOfDay_sun",fieldLabel:t("Sun"),value:"00:00",allowBlank:true,hidden:true},{xtype:"uploadfield",fieldLabel:t("workaudio"),emptyText:"Select an gsm File",allowBlank:true,name:"workaudio",extAllowed:["wav","gsm"],hidden:true},{xtype:"uploadfield",fieldLabel:t("noworkaudio"),emptyText:"Select an gsm File",allowBlank:true,name:"noworkaudio",extAllowed:["wav","gsm"],hidden:true}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["didform"],["component","box","container","panel","form","didform"],{component:true,box:true,container:true,panel:true,form:true,didform:true},["widget.didform"],0,[MBilling.view.did,"Form"],0));(Ext.cmd.derive("MBilling.view.did.ImportCsv",Ext.ux.window.ImportCsv,{htmlTipInfo:"
"+t("number")+", "+t("price")+" "+t("by")+" "+t("monthly")+", "+t("connection_charge")+"
551156332233, 10, 5
554153882200, 10, 5
554155667788, 10, 5
"+t("monthly")+" "+t("and")+" "+t("connection_charge")+" "+t("optional")+"",fieldsImport:[{fieldLabel:t("table"),hidden:true,allowBlank:true}]},0,["didimportcsv"],["component","box","container","panel","window","didimportcsv"],{component:true,box:true,container:true,panel:true,window:true,didimportcsv:true},["widget.didimportcsv"],0,[MBilling.view.did,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.didbuy.Module",Ext.form.Panel,{controller:"did",resizable:false,autoShow:true,header:false,initComponent:function(){var b=this;b.items=[{reference:"buydidPanel",xtype:"form",margin:"10 10 10 10",autoShow:true,closable:false,resizable:false,bodyPadding:10,defaultType:"textfield",defaults:{labelAlign:"right",labelWidth:175,width:280,allowBlank:false,msgTarget:"side",enableKeyEvents:true,plugins:"markallowblank",anchor:"100%"},items:[{xtype:"didbuycombo",fieldLabel:t("Select a Did"),name:"did"}],bbar:[{text:t("Next"),tooltip:t("Next"),glyph:icons.disk,handler:"onBuyDid"}]}];Ext.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["didbuymodule"],["component","box","container","panel","form","didbuymodule"],{component:true,box:true,container:true,panel:true,form:true,didbuymodule:true},["widget.didbuymodule"],0,[MBilling.view.didbuy,"Module"],0));(Ext.cmd.derive("MBilling.view.diddestination.Controller",Ext.ux.app.ViewController,{init:function(){var b=this;b.control({didtypefullcombo:{select:b.onSelectMethod},didtypefreecombo:{select:b.onSelectMethod}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectMethod:function(c,d){this.showFieldsRelated(d.getData().showFields)},showFieldsRelated:function(f){var d=this,e=d.formPanel.getForm().getFields();e.each(function(a){a.setVisible(f.indexOf(a.name)!==-1)})},onEdit:function(){var f=this,d=f.formPanel.getForm(),e=f.list.getSelectionModel().getSelection()[0];method=e?e.get("voip_call"):"sipcall";switch(method){case 0:method=t("callforpstn");break;case 1:method=t("sipcall");break;case 2:method=t("ivr");break;case 3:method="CallingCard";break;case 4:method=t("portalDeVoz");break;case 5:method=t("CID Callback");break;case 6:method=t("0800 Callback");break;case 7:method=t("Queue");break;case 8:method=t("Call Group");break;case 9:method=t("Custom");break}showFields=f.formPanel.down("didtypefullcombo").store.findRecord("name",method).getData().showFields;f.showFieldsRelated(showFields);d.findField("id_did").setReadOnly(true);Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)},onNew:function(){var f=this,d=f.formPanel.getForm(),e=f.list.getSelectionModel().getSelection()[0];d.findField("id_did").setReadOnly(false);method=t("sipcall");showFields=f.formPanel.down("didtypefullcombo").store.findRecord("name",method).getData().showFields;f.showFieldsRelated(showFields);Ext.ux.app.ViewController.prototype.onNew.apply(this,arguments)}},0,0,0,0,["controller.diddestination"],0,[MBilling.view.diddestination,"Controller"],0));(Ext.cmd.derive("MBilling.view.diddestination.Module",Ext.ux.panel.Module,{controller:"diddestination"},0,["diddestinationmodule"],["component","box","container","uxpanelmodule","diddestinationmodule"],{component:true,box:true,container:true,uxpanelmodule:true,diddestinationmodule:true},["widget.diddestinationmodule"],0,[MBilling.view.diddestination,"Module"],0));(Ext.cmd.derive("MBilling.view.diddestination.List",Ext.ux.grid.Panel,{store:"Diddestination",fieldSearch:"idDid.did",initComponent:function(){var b=this;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("did"),dataIndex:"idDiddid",filter:{type:"string",field:"idDid.did"},flex:5},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("type")+" "+t("of")+" "+t("call"),dataIndex:"voip_call",renderer:Helper.Util.formatDidType,comboRelated:"didtypecombo",flex:3,filter:{type:"list",options:[[0,t("callforpstn")],[1,t("sipcall")],[2,t("ivr")],[3,t("callingcard")],[4,t("portalDeVoz")],[5,t("CID Callback")],[6,t("0800 Callback")],[7,t("Queue")],[8,t("Call Group")],[9,t("Custom")]]}},{header:t("secondusedreal"),renderer:Helper.Util.formatsecondsToTime,dataIndex:"secondusedreal",flex:3},{header:t("creationdate"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"creationdate",flex:5}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["diddestinationlist"],["component","box","container","panel","tablepanel","gridpanel","grid","diddestinationlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,diddestinationlist:true},["widget.diddestinationlist"],0,[MBilling.view.diddestination,"List"],0));(Ext.cmd.derive("MBilling.view.diddestination.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["id_user","id_did"],initComponent:function(){var b=this;b.items=[{name:"id_did",fieldLabel:t("DID"),xtype:"didcombo"},{xtype:"userlookup",ownerForm:b,hidden:true,allowBlank:App.user.isClient},{xtype:"booleancombo",name:"activated",fieldLabel:t("status"),allowBlank:false},{xtype:"numbercombo",name:"priority",fieldLabel:t("priority"),allowBlank:true},{style:"margin-top:25px",xtype:"fieldset",title:t("Did Destination"),collapsible:true,collapsed:false,defaults:{labelWidth:75,anchor:"100%",labelAlign:b.labelAlignFields},items:[{xtype:"didtypefullcombo",name:"voip_call",fieldLabel:t("type")+" "+t("of")+" "+t("call")},{xtype:"textfield",name:"destination",fieldLabel:t("Destination"),value:"",allowBlank:true,hidden:App.user.isClient||App.user.isAgent},{xtype:"ivrlookup",ownerForm:b,name:"id_ivr",fieldLabel:t("IVR"),allowBlank:true},{xtype:"queuelookup",ownerForm:b,name:"id_queue",fieldLabel:t("Queue"),allowBlank:true},{xtype:"siplookup",ownerForm:b,name:"id_sip",fieldLabel:t("SIP"),allowBlank:true}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["diddestinationform"],["component","box","container","panel","form","diddestinationform"],{component:true,box:true,container:true,panel:true,form:true,diddestinationform:true},["widget.diddestinationform"],0,[MBilling.view.diddestination,"Form"],0));(Ext.cmd.derive("MBilling.view.diddestination.Combo",Ext.form.field.ComboBox,{fieldLabel:t("typepaid"),displayField:"name",valueField:"id",forceSelection:true,editable:false,value:1,store:{fields:["id","name"],data:[{id:"0",name:t("callforpstn"),showFields:["voip_call","destination","id_did","id_user","activated"]},{id:"1",name:t("sipcall"),showFields:["voip_call","id_sip","id_did","id_user","activated","priority"]},{id:"2",name:t("ivr"),showFields:["voip_call","id_did","id_ivr","id_user","activated"]},{id:"3",name:"CallingCard",showFields:["voip_call","id_did","id_user","activated"]},{id:"4",name:t("portalDeVoz"),showFields:["voip_call","id_did","id_user","activated"]},{id:"5",name:t("CID Callback"),showFields:["voip_call","id_did","id_user","activated"]},{id:"6",name:t("0800 Callback"),showFields:["voip_call","id_did","id_user","activated"]},{id:"7",name:t("Queue"),showFields:["voip_call","id_did","id_queue","id_user","activated"]},{id:"8",name:t("Call Group"),showFields:["voip_call","destination","id_did","id_user","activated"]},{id:"9",name:t("Custom"),showFields:["voip_call","destination","id_did","id_user","activated"]}]}},0,["didtypefullcombo"],["component","box","field","textfield","pickerfield","combobox","combo","didtypefullcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,didtypefullcombo:true},["widget.didtypefullcombo"],0,[MBilling.view.diddestination,"Combo"],0));(Ext.cmd.derive("MBilling.view.diddestination.freeCombo",Ext.form.field.ComboBox,{fieldLabel:t("typepaid"),displayField:"name",forceSelection:true,editable:false,valueField:"id",value:1,store:{fields:["id","name"],data:[{id:"0",name:t("callforpstn"),showFields:["voip_call","id_did","destination","id_user","activated"]},{id:"1",name:t("sipcall"),showFields:["voip_call","id_did","id_sip","id_user","activated","priority"]},{id:"2",name:t("ivr"),showFields:["voip_call","id_did","id_ivr","id_user"]},{id:"3",name:"CallingCard",showFields:["voip_call","id_did","id_user"]},{id:"4",name:t("portalDeVoz"),showFields:["voip_call","id_did","id_user"]}]}},0,["didtypefreecombo"],["component","box","field","textfield","pickerfield","combobox","combo","didtypefreecombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,didtypefreecombo:true},["widget.didtypefreecombo"],0,[MBilling.view.diddestination,"freeCombo"],0));(Ext.cmd.derive("MBilling.view.didUse.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.diduse"],0,[MBilling.view.didUse,"Controller"],0));(Ext.cmd.derive("MBilling.view.didUse.Module",Ext.ux.panel.Module,{controller:"diduse"},0,["didusemodule"],["component","box","container","uxpanelmodule","didusemodule"],{component:true,box:true,container:true,uxpanelmodule:true,didusemodule:true},["widget.didusemodule"],0,[MBilling.view.didUse,"Module"],0));(Ext.cmd.derive("MBilling.view.didUse.List",Ext.ux.grid.Panel,{store:"DidUse",initComponent:function(){var b=this;b.buttonCsv=false;b.allowPrint=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("did"),dataIndex:"idDiddid",flex:5},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("monthpayed"),dataIndex:"month_payed",flex:2},{header:t("reservationdate"),renderer:Helper.Util.formatDateTime,dataIndex:"reservationdate",flex:5},{header:t("releasedate"),renderer:Helper.Util.formatDateTime,dataIndex:"releasedate",flex:5}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["diduselist"],["component","box","container","panel","tablepanel","gridpanel","grid","diduselist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,diduselist:true},["widget.diduselist"],0,[MBilling.view.didUse,"List"],0));(Ext.cmd.derive("MBilling.view.didUse.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,readOnly:true},{xtype:"didcombo",readOnly:true},{xtype:"datefield",name:"reservationdate",fieldLabel:t("reservationdate"),format:"Y-m-d H:i:s"}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["diduseform"],["component","box","container","panel","form","diduseform"],{component:true,box:true,container:true,panel:true,form:true,diduseform:true},["widget.diduseform"],0,[MBilling.view.didUse,"Form"],0));(Ext.cmd.derive("MBilling.view.dashboard.Module",Ext.panel.Panel,{autoShow:true,header:false,initComponent:function(){var b=this;width=window.isTablet?Ext.Element.getViewportWidth()-240:Ext.Element.getViewportWidth()-220;showDid=showBuy=false;if(!App.user.isAdmin){Ext.each(App.user.menu,function(a){if(!Ext.isEmpty(a.rows)){Ext.each(a.rows,function(d){if(d.module=="didbuy"){showDid=true}if(d.module=="buycredit"){showBuy=true}},b)}},b)}widthView=Ext.Element.getViewportWidth()-430;heightView=Ext.Element.getViewportHeight()-137;heightViewFace=heightView+23;facebookhtml='
';if(!App.user.isAdmin&&App.user.social_media_network.length>10){facebookhtml='
'}if(window.customDashboard&&!App.user.isAdmin){b.items=[{header:false,bodyPadding:0,style:"background-color:transparent;",bodyStyle:"background-color:transparent !important;",html:'
',collapseDirection:"bottom",collapsible:true,autoScroll:true,height:Ext.Element.getViewportHeight()}]}else{b.items=[{width:!window.isDesktop?width:"NULL",header:false,xtype:"dashboard",listeners:{activate:"setRunnerInfoSystem"},glyph:icons.home,title:t("Home"),stateful:false,items:[{columnWidth:App.user.isAdmin?1/2:1,items:[{title:t("callonline"),items:{xtype:"callonlinelist2"},hidden:window.isTablet||!App.user.isAdmin,height:App.user.isClient?250:300},{title:t("Simultaneous Call"),items:{xtype:"callonlinechartchart"},hidden:window.isTablet||!App.user.isAdmin,iconCls:"icon-chart-column",glyph:undefined}]},{hidden:App.user.isAdmin,columnWidth:App.user.isClient?1/2:1,items:[{title:t("BuyCredit"),items:{xtype:"buycreditmodule"},height:window.isTablet?250:170,hidden:!showBuy}]},{hidden:App.user.isAdmin,columnWidth:1/2,items:[{title:t("Buy")+" "+t("did"),items:{xtype:"didbuymodule"},height:window.isTablet?250:170,hidden:!showDid||!App.user.isClient},{iconCls:"icon-info",title:t("NEWS"),bodyPadding:0,style:"background-color:transparent;",bodyStyle:"background-color:transparent !important;",hidden:App.user.isAdmin||App.user.social_media_network.length<=10,html:facebookhtml,collapseDirection:"bottom",collapsible:true,autoScroll:true,height:300}]},{columnWidth:1/2,items:[{iconCls:"icon-info",title:t("NEWS"),bodyPadding:0,style:"background-color:transparent;",bodyStyle:"background-color:transparent !important;",hidden:!App.user.isAdmin||window.isTablet||window.isTablets||App.user.l.slice(4,7)=="syn",html:facebookhtml,collapseDirection:"bottom",collapsible:true,autoScroll:true,height:300},{title:t("Refill Summary"),iconCls:"icon-chart-column",glyph:undefined,items:{xtype:"refillchart"},hidden:!App.user.isAdmin||window.isTablet}]}]}]}Ext.panel.Panel.prototype.initComponent.apply(this,arguments)}},0,["dashboardmodule"],["component","box","container","panel","dashboardmodule"],{component:true,box:true,container:true,panel:true,dashboardmodule:true},["widget.dashboardmodule"],0,[MBilling.view.dashboard,"Module"],0));(Ext.cmd.derive("MBilling.view.dashboardQueue.Module",Ext.panel.Panel,{autoShow:true,header:false,initComponent:function(){var b=this;b.items=[{width:!window.isDesktop?width:"NULL",header:false,xtype:"dashboard",listeners:{activate:"setRunnerInfoSystem"},glyph:icons.home,title:t("Home"),stateful:false,items:[{columnWidth:1/2,items:[{title:t("Queue Monitor"),items:{xtype:"queuedashboardlist"},height:window.heightView}]},{columnWidth:1/2,items:[{title:t("Agent Monitor"),iconCls:"icon-chart-column",glyph:undefined,items:{xtype:"queuememberdashboardlist"},height:window.heightView}]}]}];Ext.panel.Panel.prototype.initComponent.apply(this,arguments)}},0,["dashboardqueuemodule"],["component","box","container","panel","dashboardqueuemodule"],{component:true,box:true,container:true,panel:true,dashboardqueuemodule:true},["widget.dashboardqueuemodule"],0,[MBilling.view.dashboardQueue,"Module"],0));(Ext.cmd.derive("MBilling.view.ivr.Controller",Ext.ux.app.ViewController,{isSubmitForm:true,init:function(){var b=this;b.control({typedestinationcombo:{select:b.onSelectMethod}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectMethod:function(c,d){this.showFieldsRelated(d.getData().showFields)},showFieldsRelated:function(l){var m=this,n=m.formPanel.getForm(),j=m.formPanel.getForm().getFields(),g=Ext.get(Ext.Element.getActiveElement()).component,o=g.name.substr(-2);m.onSetVisibleFiel(g,n,o,g.value)},onSetVisibleFiel:function(f,j,e,g){if(f.value=="undefined"){f.setValue("undefined")}if(f.name.match("^type_10")){j.findField("id_queue_10").setVisible(g.match("^queue"));j.findField("id_sip_10").setVisible(g.match("^sip"));j.findField("id_ivr_10").setVisible(g.match("^ivr"));j.findField("extension_10").setVisible(g.match("^group|^number|^custom"))}else{if(f.name.match("^type_[0-9]")){j.findField("id_queue"+e).setVisible(g.match("^queue"));j.findField("id_sip"+e).setVisible(g.match("^sip"));j.findField("id_ivr"+e).setVisible(g.match("^ivr"));j.findField("extension"+e).setVisible(g.match("^group|^number|^custom"))}else{if(f.name.match("^type_out_10")){j.findField("id_queue_out_10").setVisible(g.match("^queue"));j.findField("id_ivr_out_10").setVisible(g.match("^ivr"));j.findField("id_sip_out_10").setVisible(g.match("^sip"));j.findField("extension_out_10").setVisible(g.match("^group|^number|^custom"))}else{j.findField("id_queue_out"+e).setVisible(g.match("^queue"));j.findField("id_sip_out"+e).setVisible(g.match("^sip"));j.findField("id_ivr_out"+e).setVisible(g.match("^ivr"));j.findField("extension_out"+e).setVisible(g.match("^group|^number|^custom"))}}}},onEdit:function(){var g=this,j=g.formPanel.getForm(),f=g.list.getSelectionModel().getSelection()[0];for(var e=0;e<=10;e++){fieldValue=f.getData()["type_"+e];fieldValueOut=f.getData()["type_out_"+e];if(fieldValue=="ivr"){j.findField("id_ivr_"+e).setVisible(true);j.findField("id_sip_"+e).setVisible(false);j.findField("id_queue_"+e).setVisible(false);j.findField("extension_"+e).setVisible(false)}else{if(fieldValue=="sip"){j.findField("id_sip_"+e).setVisible(true);j.findField("id_ivr_"+e).setVisible(false);j.findField("id_queue_"+e).setVisible(false);j.findField("extension_"+e).setVisible(false)}else{if(fieldValue=="queue"){j.findField("id_queue_"+e).setVisible(true);j.findField("id_sip_"+e).setVisible(false);j.findField("id_ivr_"+e).setVisible(false);j.findField("extension_"+e).setVisible(false)}else{if(fieldValue.match("custom|number|group")){j.findField("extension_"+e).setVisible(true);j.findField("id_ivr_"+e).setVisible(false);j.findField("id_sip_"+e).setVisible(false);j.findField("id_queue_"+e).setVisible(false)}else{j.findField("id_queue_"+e).setVisible(false);j.findField("id_sip_"+e).setVisible(false);j.findField("id_ivr_"+e).setVisible(false);j.findField("extension_"+e).setVisible(false)}}}}if(fieldValueOut=="ivr"){j.findField("id_ivr_out_"+e).setVisible(true);j.findField("id_sip_out_"+e).setVisible(false);j.findField("id_queue_out_"+e).setVisible(false);j.findField("extension_out_"+e).setVisible(false)}else{if(fieldValueOut=="sip"){j.findField("id_sip_out_"+e).setVisible(true);j.findField("id_ivr_out_"+e).setVisible(false);j.findField("id_queue_out_"+e).setVisible(false);j.findField("extension_out_"+e).setVisible(false)}else{if(fieldValueOut=="queue"){j.findField("id_queue_out_"+e).setVisible(true);j.findField("id_sip_out_"+e).setVisible(false);j.findField("id_ivr_out_"+e).setVisible(false);j.findField("extension_out_"+e).setVisible(false)}else{if(fieldValueOut.match("custom|number|group")){j.findField("extension_out_"+e).setVisible(true);j.findField("id_ivr_out_"+e).setVisible(false);j.findField("id_sip_out_"+e).setVisible(false);j.findField("id_queue_out_"+e).setVisible(false)}else{j.findField("id_queue_out_"+e).setVisible(false);j.findField("id_sip_out_"+e).setVisible(false);j.findField("id_ivr_out_"+e).setVisible(false);j.findField("extension_out_"+e).setVisible(false)}}}}}Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)},onNew:function(){var g=this,j=g.formPanel.getForm(),f=g.list.getSelectionModel().getSelection()[0];for(var e=0;e<=10;e++){j.findField("id_ivr_"+e).setVisible(false);j.findField("id_sip_"+e).setVisible(false);j.findField("id_queue_"+e).setVisible(false);j.findField("id_ivr_out_"+e).setVisible(false);j.findField("id_sip_out_"+e).setVisible(false);j.findField("id_queue_out_"+e).setVisible(false)}Ext.ux.app.ViewController.prototype.onNew.apply(this,arguments)}},0,0,0,0,["controller.ivr"],0,[MBilling.view.ivr,"Controller"],0));(Ext.cmd.derive("MBilling.view.ivr.Module",Ext.ux.panel.Module,{controller:"ivr"},0,["ivrmodule"],["component","box","container","uxpanelmodule","ivrmodule"],{component:true,box:true,container:true,uxpanelmodule:true,ivrmodule:true},["widget.ivrmodule"],0,[MBilling.view.ivr,"Module"],0));(Ext.cmd.derive("MBilling.view.ivr.List",Ext.ux.grid.Panel,{store:"Ivr",initComponent:function(){var b=this;b.allowPrint=false;b.buttonCsv=false;b.columns=b.columns||[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("name"),dataIndex:"name",flex:5},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["ivrlist"],["component","box","container","panel","tablepanel","gridpanel","grid","ivrlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,ivrlist:true},["widget.ivrlist"],0,[MBilling.view.ivr,"List"],0));(Ext.cmd.derive("MBilling.view.ivr.Form",Ext.ux.form.Panel,{bodyPadding:0,fileUpload:true,initComponent:function(){var b=this;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{plugins:"markallowblank",allowBlank:false,anchor:"100%",labelAlign:"right"}},items:[{title:t("general"),items:[{name:"name",fieldLabel:t("name")},{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"monFriStart",fieldLabel:t("monFriStart"),value:"09:00",maxLength:5,minLength:5},{name:"monFriStop",fieldLabel:t("monFriStop"),value:"18:00",maxLength:5,minLength:5},{name:"satStart",fieldLabel:t("satStart"),value:"09:00",maxLength:5,minLength:5},{name:"satStop",fieldLabel:t("satStop"),value:"12:00",maxLength:5,minLength:5},{name:"sunStart",fieldLabel:t("sunStart"),value:"09:00",maxLength:5,minLength:5},{name:"sunStop",fieldLabel:t("sunStop"),value:"12:00",maxLength:5,minLength:5},{xtype:"uploadfield",fieldLabel:t("workaudio"),emptyText:"Select an wav or gsm File",allowBlank:true,name:"workaudio",labelWidth:120,extAllowed:["wav","gsm"]},{xtype:"uploadfield",fieldLabel:t("noworkaudio"),emptyText:"Select an wav or gsm File",allowBlank:true,labelWidth:120,name:"noworkaudio",extAllowed:["wav","gsm"]}]},{title:t("options")+" "+t("work"),itemId:"option",defaults:{xtype:"fieldcontainer",layout:"hbox",plugins:"markallowblank",allowBlank:true,anchor:"100%",labelWidth:100,defaults:{hideLabel:true,hidden:true,flex:5,startX:100,allowBlank:true,ownerForm:b}},items:[{xtype:"menuseparator",width:"100%"},{labelStyle:"font-weight:bold",xtype:"displayfield",value:''+t("Select the destination to send call when caller press any digits.")+"",allowBlank:true},{xtype:"menuseparator",width:"100%"},{fieldLabel:t("option")+" 0",items:[{name:"type_0",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_0",displayField:"id_ivr_0_name"},{xtype:"queuelookup",name:"id_queue_0",displayField:"id_queue_0_name"},{xtype:"siplookup",name:"id_sip_0",displayField:"id_sip_0_name"},{xtype:"textfield",name:"extension_0"}]},{fieldLabel:t("option")+" 1",items:[{name:"type_1",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_1",displayField:"id_ivr_1_name"},{xtype:"queuelookup",name:"id_queue_1",displayField:"id_queue_1_name"},{xtype:"siplookup",name:"id_sip_1",displayField:"id_sip_1_name"},{xtype:"textfield",name:"extension_1"}]},{fieldLabel:t("option")+" 2",items:[{name:"type_2",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_2",displayField:"id_ivr_2_name"},{xtype:"queuelookup",name:"id_queue_2",displayField:"id_queue_2_name"},{xtype:"siplookup",name:"id_sip_2",displayField:"id_sip_2_name"},{xtype:"textfield",name:"extension_2"}]},{fieldLabel:t("option")+" 3",items:[{name:"type_3",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_3",displayField:"id_ivr_3_name"},{xtype:"queuelookup",name:"id_queue_3",displayField:"id_queue_3_name"},{xtype:"siplookup",name:"id_sip_3",displayField:"id_sip_3_name"},{xtype:"textfield",name:"extension_3"}]},{fieldLabel:t("option")+" 4",items:[{name:"type_4",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_4",displayField:"id_ivr_4_name"},{xtype:"queuelookup",name:"id_queue_4",displayField:"id_queue_4_name"},{xtype:"siplookup",name:"id_sip_4",displayField:"id_sip_4_name"},{xtype:"textfield",name:"extension_4"}]},{fieldLabel:t("option")+" 5",items:[{name:"type_5",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_5",displayField:"id_ivr_5_name"},{xtype:"queuelookup",name:"id_queue_5",displayField:"id_queue_5_name"},{xtype:"siplookup",name:"id_sip_5",displayField:"id_sip_5_name"},{xtype:"textfield",name:"extension_5"}]},{fieldLabel:t("option")+" 6",items:[{name:"type_6",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_6",displayField:"id_ivr_6_name"},{xtype:"queuelookup",name:"id_queue_6",displayField:"id_queue_6_name"},{xtype:"siplookup",name:"id_sip_6",displayField:"id_sip_6_name"},{xtype:"textfield",name:"extension_6"}]},{fieldLabel:t("option")+" 7",items:[{name:"type_7",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_7",displayField:"id_ivr_7_name"},{xtype:"queuelookup",name:"id_queue_7",displayField:"id_queue_7_name"},{xtype:"siplookup",name:"id_sip_7",displayField:"id_sip_7_name"},{xtype:"textfield",name:"extension_7"}]},{fieldLabel:t("option")+" 8",items:[{name:"type_8",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_8",displayField:"id_ivr_8_name"},{xtype:"queuelookup",name:"id_queue_8",displayField:"id_queue_8_name"},{xtype:"siplookup",name:"id_sip_8",displayField:"id_sip_8_name"},{xtype:"textfield",name:"extension_8"}]},{fieldLabel:t("option")+" 9",items:[{name:"type_9",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_9",displayField:"id_ivr_9_name"},{xtype:"queuelookup",name:"id_queue_9",displayField:"id_queue_9_name"},{xtype:"siplookup",name:"id_sip_9",displayField:"id_sip_9_name"},{xtype:"textfield",name:"extension_9"}]},{fieldLabel:t("option")+" default",items:[{name:"type_10",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_10",displayField:"id_ivr_10_name"},{xtype:"queuelookup",name:"id_queue_10",displayField:"id_queue_10_name"},{xtype:"siplookup",name:"id_sip_10",displayField:"id_sip_10_name"},{xtype:"textfield",name:"extension_10"}]},{fieldLabel:t("Direct extension"),hidden:!window.didChannelLimit,name:"direct_extension",xtype:"noyescombo"}]},{title:t("options")+" "+t("not")+" "+t("work"),itemId:"optionOut",defaults:{xtype:"fieldcontainer",layout:"hbox",plugins:"markallowblank",allowBlank:true,anchor:"100%",labelWidth:100,defaults:{hideLabel:true,hidden:true,flex:5,startX:100,allowBlank:true,ownerForm:b}},items:[{xtype:"menuseparator",width:"100%"},{labelStyle:"font-weight:bold",xtype:"displayfield",value:''+t("Select the destination to send call when caller press any digits.")+"",allowBlank:true},{xtype:"menuseparator",width:"100%"},{fieldLabel:t("option")+" 0",items:[{name:"type_out_0",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_0",displayField:"id_ivr_out_0_name"},{xtype:"queuelookup",name:"id_queue_out_0",displayField:"id_queue_out_0_name"},{xtype:"siplookup",name:"id_sip_out_0",displayField:"id_sip_out_0_name"},{xtype:"textfield",name:"extension_out_0"}]},{fieldLabel:t("option")+" 1",items:[{name:"type_out_1",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_1",displayField:"id_ivr_out_1_name"},{xtype:"queuelookup",name:"id_queue_out_1",displayField:"id_queue_out_1_name"},{xtype:"siplookup",name:"id_sip_out_1",displayField:"id_sip_out_1_name"},{xtype:"textfield",name:"extension_out_1"}]},{fieldLabel:t("option")+" 2",items:[{name:"type_out_2",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_2",displayField:"id_ivr_out_2_name"},{xtype:"queuelookup",name:"id_queue_out_2",displayField:"id_queue_out_2_name"},{xtype:"siplookup",name:"id_sip_out_2",displayField:"id_sip_out_2_name"},{xtype:"textfield",name:"extension_out_2"}]},{fieldLabel:t("option")+" 3",items:[{name:"type_out_3",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_3",displayField:"id_ivr_out_3_name"},{xtype:"queuelookup",name:"id_queue_out_3",displayField:"id_queue_out_3_name"},{xtype:"siplookup",name:"id_sip_out_3",displayField:"id_sip_out_3_name"},{xtype:"textfield",name:"extension_out_3"}]},{fieldLabel:t("option")+" 4",items:[{name:"type_out_4",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_4",displayField:"id_ivr_out_4_name"},{xtype:"queuelookup",name:"id_queue_out_4",displayField:"id_queue_out_4_name"},{xtype:"siplookup",name:"id_sip_out_4",displayField:"id_sip_out_4_name"},{xtype:"textfield",name:"extension_out_4"}]},{fieldLabel:t("option")+" 5",items:[{name:"type_out_5",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_5",displayField:"id_ivr_out_5_name"},{xtype:"queuelookup",name:"id_queue_out_5",displayField:"id_queue_out_5_name"},{xtype:"siplookup",name:"id_sip_out_5",displayField:"id_sip_out_5_name"},{xtype:"textfield",name:"extension_out_5"}]},{fieldLabel:t("option")+" 6",items:[{name:"type_out_6",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_6",displayField:"id_ivr_out_6_name"},{xtype:"queuelookup",name:"id_queue_out_6",displayField:"id_queue_out_6_name"},{xtype:"siplookup",name:"id_sip_out_6",displayField:"id_sip_out_6_name"},{xtype:"textfield",name:"extension_out_6"}]},{fieldLabel:t("option")+" 7",items:[{name:"type_out_7",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_7",displayField:"id_ivr_out_7_name"},{xtype:"queuelookup",name:"id_queue_out_7",displayField:"id_queue_out_7_name"},{xtype:"siplookup",name:"id_sip_out_7",displayField:"id_sip_out_7_name"},{xtype:"textfield",name:"extension_out_7"}]},{fieldLabel:t("option")+" 8",items:[{name:"type_out_8",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_8",displayField:"id_ivr_out_8_name"},{xtype:"queuelookup",name:"id_queue_out_8",displayField:"id_queue_out_8_name"},{xtype:"siplookup",name:"id_sip_out_8",displayField:"id_sip_out_8_name"},{xtype:"textfield",name:"extension_out_8"}]},{fieldLabel:t("option")+" 9",items:[{name:"type_out_9",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_9",displayField:"id_ivr_out_9_name"},{xtype:"queuelookup",name:"id_queue_out_9",displayField:"id_queue_out_9_name"},{xtype:"siplookup",name:"id_sip_out_9",displayField:"id_sip_out_9_name"},{xtype:"textfield",name:"extension_out_9"}]},{fieldLabel:t("option")+" default",items:[{name:"type_out_10",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_10",displayField:"id_ivr_out_10_name"},{xtype:"queuelookup",name:"id_queue_out_10",displayField:"id_queue_out_10_name"},{xtype:"siplookup",name:"id_sip_out_10",displayField:"id_sip_out_10_name"},{xtype:"textfield",name:"extension_out_10"}]}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["ivrform"],["component","box","container","panel","form","ivrform"],{component:true,box:true,container:true,panel:true,form:true,ivrform:true},["widget.ivrform"],0,[MBilling.view.ivr,"Form"],0));(Ext.cmd.derive("MBilling.view.ivr.Lookup",Ext.ux.form.field.Lookup,{name:"id_ivr",fieldLabel:t("Ivr"),displayField:"idIvrname",displayFieldList:"name",gridConfig:{xtype:"ivrlist",fieldSearch:"name",columns:[{header:t("name"),dataIndex:"name",flex:5},{header:t("user"),dataIndex:"idUsernumber",filter:{type:"string",field:"idUser.username"},flex:4}]}},0,["ivrlookup"],["component","box","container","fieldcontainer","ivrlookup"],{component:true,box:true,container:true,fieldcontainer:true,ivrlookup:true},["widget.ivrlookup"],0,[MBilling.view.ivr,"Lookup"],0));(Ext.cmd.derive("MBilling.view.queue.Controller",Ext.ux.app.ViewController,{isSubmitForm:true,init:function(){var b=this;b.control({"combobox[name=ring_or_moh]":{select:b.onSelectringOrMOH}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectringOrMOH:function(c,d){me=this,form=me.formPanel.getForm();form.findField("musiconhold").setVisible(d.data.field1=="moh")},onNew:function(){var b=this;b.formPanel.getForm().findField("musiconhold").setVisible(true);Ext.ux.app.ViewController.prototype.onNew.apply(this,arguments)},onEdit:function(){var b=this;Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments);ringOrMoh=b.formPanel.getForm().findField("ring_or_moh").getValue();b.formPanel.getForm().findField("musiconhold").setVisible(ringOrMoh=="moh")},onResetQueueStats:function(m){var j=this,f=j.list.getSelectionModel().getSelection()[0],l=Ext.encode(j.list.filters.getFilterData()),g=[];if(f){Ext.each(j.list.getSelectionModel().getSelection(),function(a){g.push(a.get(j.idProperty))});Ext.Ajax.request({url:"index.php/queue/resetQueueStats",params:{ids:Ext.encode(g),filter:l},scope:j,success:function(b){b=Ext.decode(b.responseText);if(b[j.nameSuccessRequest]){Ext.ux.Alert.alert(j.titleSuccess,b.msg,"success")}else{var a=Helper.Util.convertErrorsJsonToString(b[j.nameMsgRequest]);Ext.ux.Alert.alert(j.titleError,a,"notification")}}})}else{Ext.ux.Alert.alert(j.titleError,t("Please select one or more queue"),"notification")}},onDeleteMusic:function(e){var f=this,d=f.list.getSelectionModel().getSelection()[0];if(f.list.getSelectionModel().getSelection().length==1){Ext.Ajax.request({url:"index.php/queue/deleteMusicOnHold",params:{id_queue:d.get("id")},scope:f,success:function(a){a=Ext.decode(a.responseText);if(a[f.nameSuccessRequest]){Ext.ux.Alert.alert(f.titleSuccess,a[f.nameMsgRequest],"success")}else{Ext.ux.Alert.alert(f.titleError,a[f.nameMsgRequest],"error")}}})}else{Ext.ux.Alert.alert(f.titleError,"Please Select only a record","notification")}}},0,0,0,0,["controller.queue"],0,[MBilling.view.queue,"Controller"],0));(Ext.cmd.derive("MBilling.view.queue.Combo",Ext.form.field.ComboBox,{fieldLabel:t("status"),value:"ringall",forceSelection:true,editable:false,store:[["ringall",t("Ringall")+" - "+t("ring all available channels until one answers")],["rrmemory",t("Rrmemory")+" - "+t("round robin with memory, remember where we left off last ring pass")],["leastrecent",t("Leastrecent")+" - "+t("ring interface which was least recently called by this queue")],["fewestcalls",t("Fewestcalls")+" - "+t("ring the one with fewest completed calls from this queue")],["random",t("Random")+" -"+t("ring random interface")],["linear",t("Linear")+" - "+t("Rings interfaces in the order they are listed in the configuration file. Dynamic members will be rung in the order in which they were added")],["wrandom",t("Wrandom")+" -"+t("Rings a random interface, but uses the agent's penalty as a weight")]]},0,["queuestrategycombo"],["component","box","field","textfield","pickerfield","combobox","combo","queuestrategycombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,queuestrategycombo:true},["widget.queuestrategycombo"],0,[MBilling.view.queue,"Combo"],0));(Ext.cmd.derive("MBilling.view.queue.Module",Ext.ux.panel.Module,{controller:"queue"},0,["queuemodule"],["component","box","container","uxpanelmodule","queuemodule"],{component:true,box:true,container:true,uxpanelmodule:true,queuemodule:true},["widget.queuemodule"],0,[MBilling.view.queue,"Module"],0));(Ext.cmd.derive("MBilling.view.queue.List",Ext.ux.grid.Panel,{store:"Queue",initComponent:function(){var b=this;b.buttonCsv=false;b.allowPrint=false;b.buttonUpdateLot=false;b.extraButtons=[{text:t("Reset Queue Stats"),iconCls:"call",handler:"onResetQueueStats",disabled:false,hidden:!App.user.isAdmin},{text:t("Delete Musiconhold"),iconCls:"call",handler:"onDeleteMusic",disabled:false,hidden:!App.user.isAdmin}];b.columns=b.columns||[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("name"),dataIndex:"name",flex:4},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("Strategy"),dataIndex:"strategy",flex:4},{header:t("Talk Time"),dataIndex:"var_talktime",flex:3},{header:t("Total Calls"),dataIndex:"var_totalCalls",flex:3},{header:t("Answered"),dataIndex:"var_answeredCalls",flex:3}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["queuelist"],["component","box","container","panel","tablepanel","gridpanel","grid","queuelist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,queuelist:true},["widget.queuelist"],0,[MBilling.view.queue,"List"],0));(Ext.cmd.derive("MBilling.view.queue.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["id_user","name"],fileUpload:true,initComponent:function(){var b=this;b.labelWidthFields=160;b.items=[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"name",fieldLabel:t("name")},{xtype:"languagecombo",name:"language",value:App.user.language=="pt_BR"?"br":App.user.language,fieldLabel:t("language")},{xtype:"queuestrategycombo",name:"strategy",fieldLabel:t("Strategy")},{xtype:"yesnostringcombo",name:"ringinuse",fieldLabel:t("Ringinuse")},{xtype:"numberfield",name:"timeout",fieldLabel:t("Ring Agent per"),value:30},{xtype:"numberfield",name:"retry",fieldLabel:t("Retry other agent"),value:1},{xtype:"numberfield",name:"wrapuptime",fieldLabel:t("Time next calls"),value:1},{xtype:"numberfield",name:"weight",fieldLabel:t("Weigh"),value:0},{name:"periodic-announce",fieldLabel:t("Periodic announce"),value:"queue-periodic-announce"},{xtype:"numberfield",name:"periodic-announce-frequency",fieldLabel:t("Periodic frequency"),value:30},{xtype:"yesnostringcombo",name:"announce-position",fieldLabel:t("Announce position")},{xtype:"yesnostringcombo",name:"announce-holdtime",fieldLabel:t("Announce Holdtime")},{xtype:"numberfield",name:"announce-frequency",fieldLabel:t("Announce Frequency"),value:45},{xtype:"combobox",forceSelection:true,editable:false,value:"yes",store:[["no",t("No")],["yes",t("Yes")],["unavailable,invalid,unknown",t("unavailable,invalid,unknown")],["penalty,paused,invalid,unavailable",t("penalty,paused,invalid,unavailable")]],name:"joinempty",fieldLabel:t("Join empty")},{xtype:"combobox",forceSelection:true,editable:false,value:"no",store:[["no",t("No")],["yes",t("Yes")],["unavailable,invalid,unknown",t("unavailable,invalid,unknown")],["penalty,paused,invalid,unavailable",t("penalty,paused,invalid,unavailable")]],fieldLabel:t("Leave when empty"),name:"leavewhenempty"},{xtype:"combobox",forceSelection:true,editable:false,value:"moh",store:[["moh",t("MOH")],["ring",t("Ring")]],fieldLabel:t("Ring or playing MOH"),name:"ring_or_moh"},{xtype:"uploadfield",fieldLabel:t("Audio")+" "+t("musiconhold"),emptyText:t("Select an wav mono 8khz or gsm File"),allowBlank:true,name:"musiconhold",extAllowed:["wav","gsm"]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["queueform"],["component","box","container","panel","form","queueform"],{component:true,box:true,container:true,panel:true,form:true,queueform:true},["widget.queueform"],0,[MBilling.view.queue,"Form"],0));(Ext.cmd.derive("MBilling.view.queue.Lookup",Ext.ux.form.field.Lookup,{name:"id_queue",fieldLabel:t("Queue"),displayField:"idQueuename",displayFieldList:"name",gridConfig:{xtype:"queuelist",fieldSearch:"name",columns:[{header:t("name"),dataIndex:"name",flex:2}]}},0,["queuelookup"],["component","box","container","fieldcontainer","queuelookup"],{component:true,box:true,container:true,fieldcontainer:true,queuelookup:true},["widget.queuelookup"],0,[MBilling.view.queue,"Lookup"],0));(Ext.cmd.derive("MBilling.view.queue.ListDashboard",Ext.ux.grid.Panel,{store:"QueueDashBoard",refreshTime:5,selType:"rowmodel",initComponent:function(){var b=this;b.refreshTime=(localStorage&&localStorage.getItem("queuerefresh"))||b.refreshTime;b.extraButtons=[{text:t("Spy")+" "+t("call"),iconCls:"call",handler:function(a){module=b.getView();console.log(module.panel.items.items[0].getSelectionModel().getSelection());Ext.widget("callonlinespycall",{title:module.titleModule,list:module.panel.items.items[0]})},width:130,disabled:false,hidden:!window.multSpy},{xtype:"numberfield",field:"jmlhBrg",fieldLabel:t("Refresh Time"),editable:false,minValue:5,labelWidth:90,width:150,selectOnFocus:true,allowDecimals:true,decimalPrecision:2,value:b.refreshTime,listeners:{change:function(a){if(a.value>0){b.refreshTime=a.value;localStorage.setItem("queuerefresh",a.value)}}}}];b.columns=[{header:t("Channel"),hidden:true,dataIndex:"channel",flex:3},{header:t("Queue"),dataIndex:"queue_name",flex:3},{header:t("Agent"),dataIndex:"agentName",flex:3},{header:t("status"),dataIndex:"status",renderer:Helper.Util.formatQueueState,flex:4},{header:t("CallerID"),dataIndex:"callerId",flex:4},{header:t("Duration"),dataIndex:"duration",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Wait Time"),dataIndex:"holdtime",renderer:Helper.Util.formatsecondsToTime,flex:3}];b.sessionLoad=Ext.create("Ext.util.DelayedTask",function(){b.store.load()},b);Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments);b.store.on("load",b.onLoadStore,b)},onLoadStore:function(){var b=this;b.onDeactivateModule();b.onActivateModule()},onRender:function(){var b=this;if(Ext.isObject(b.module)){b.module.on("activate",b.onActivateModule,b);b.module.on("deactivate",b.onDeactivateModule,b);b.module.on("close",b.onCloseModule,b)}Ext.ux.grid.Panel.prototype.onRender.apply(this,arguments)},onActivateModule:function(){this.sessionLoad&&this.sessionLoad.delay(this.refreshTime*1000)},onDeactivateModule:function(){this.sessionLoad&&this.sessionLoad.cancel()},onCloseModule:function(){this.onDeactivateModule();this.sessionLoad=null}},0,["queuedashboardlist"],["component","box","container","panel","tablepanel","gridpanel","grid","queuedashboardlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,queuedashboardlist:true},["widget.queuedashboardlist"],0,[MBilling.view.queue,"ListDashboard"],0));(Ext.cmd.derive("MBilling.view.queueMember.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.queuemember"],0,[MBilling.view.queueMember,"Controller"],0));(Ext.cmd.derive("MBilling.view.queueMember.Module",Ext.ux.panel.Module,{controller:"queuemember"},0,["queuemembermodule"],["component","box","container","uxpanelmodule","queuemembermodule"],{component:true,box:true,container:true,uxpanelmodule:true,queuemembermodule:true},["widget.queuemembermodule"],0,[MBilling.view.queueMember,"Module"],0));(Ext.cmd.derive("MBilling.view.queueMember.List",Ext.ux.grid.Panel,{store:"QueueMember",initComponent:function(){var b=this;b.columns=[{header:t("Uniqueid"),dataIndex:"uniqueid",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("destination"),dataIndex:"interface",flex:4},{header:t("queues"),dataIndex:"queue_name",flex:4},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("paused"),dataIndex:"paused",renderer:Helper.Util.formattyyesno,filter:{type:"list",options:[[0,t("no")],[1,t("yes")]]},flex:2}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["queuememberlist"],["component","box","container","panel","tablepanel","gridpanel","grid","queuememberlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,queuememberlist:true},["widget.queuememberlist"],0,[MBilling.view.queueMember,"List"],0));(Ext.cmd.derive("MBilling.view.queueMember.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["id_user","queue_name"],initComponent:function(){var b=this;b.items=[{xtype:"queuelookup",ownerForm:b,displayField:"queue_name",name:"queue_name",hidden:App.user.isClient,allowBlank:App.user.isClient},{xtype:"siplookup",ownerForm:b,name:"interface",displayField:"interface"},{xtype:"noyescombo",name:"paused",fieldLabel:t("paused"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["queuememberform"],["component","box","container","panel","form","queuememberform"],{component:true,box:true,container:true,panel:true,form:true,queuememberform:true},["widget.queuememberform"],0,[MBilling.view.queueMember,"Form"],0));(Ext.cmd.derive("MBilling.view.queueMember.ListDashboard",Ext.ux.grid.Panel,{store:"QueueMemberDashBoard",refreshTime:5,selType:"rowmodel",initComponent:function(){var b=this;b.refreshTime=(localStorage&&localStorage.getItem("queueagentrefresh"))||b.refreshTime;b.extraButtons=[{xtype:"numberfield",field:"jmlhBrg",fieldLabel:t("Refresh Time"),editable:false,minValue:5,labelWidth:90,width:150,selectOnFocus:true,allowDecimals:true,decimalPrecision:2,value:b.refreshTime,listeners:{change:function(a){if(a.value>0){b.refreshTime=a.value;localStorage.setItem("queueagentrefresh",a.value)}}}}];b.columns=[{header:t("Agent"),dataIndex:"agentName",flex:3},{header:t("Queue"),dataIndex:"idQueuename",flex:5},{header:t("Status"),dataIndex:"agentStatus",renderer:Helper.Util.formatQueueAgentState,flex:4},{header:t("Number"),dataIndex:"number",flex:4},{header:t("Calls"),dataIndex:"totalCalls",flex:2},{header:t("Last call"),dataIndex:"last_call",renderer:Helper.Util.formatsecondsToTime,flex:3}];b.sessionLoad=Ext.create("Ext.util.DelayedTask",function(){b.store.load()},b);Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments);if(window.isDesktop){b.store.load()}b.store.on("load",b.onLoadStore,b)},onLoadStore:function(){var b=this;b.onDeactivateModule();b.onActivateModule()},onRender:function(){var b=this;if(Ext.isObject(b.module)){b.module.on("activate",b.onActivateModule,b);b.module.on("deactivate",b.onDeactivateModule,b);b.module.on("close",b.onCloseModule,b)}Ext.ux.grid.Panel.prototype.onRender.apply(this,arguments)},onActivateModule:function(){this.sessionLoad&&this.sessionLoad.delay(this.refreshTime*1000)},onDeactivateModule:function(){this.sessionLoad&&this.sessionLoad.cancel()},onCloseModule:function(){this.onDeactivateModule();this.sessionLoad=null}},0,["queuememberdashboardlist"],["component","box","container","panel","tablepanel","gridpanel","grid","queuememberdashboardlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,queuememberdashboardlist:true},["widget.queuememberdashboardlist"],0,[MBilling.view.queueMember,"ListDashboard"],0));(Ext.cmd.derive("MBilling.view.refill.Controller",Ext.ux.app.ViewController,{aliasChart:"refillchart",onPrint:function(e){var f=this;if(App.user.isClient){var f=this,d=f.list.getSelectionModel().getSelection()[0];if(f.list.getSelectionModel().getSelection().length==1){console.log(d.data.description.indexOf("Send Credit "));if(d.data.description.indexOf("Send Credit ")!==-1){url="index.php/transferToMobile/printRefill/?id="+d.get("id");window.open(url)}else{Ext.ux.app.ViewController.prototype.onPrint.apply(this,arguments)}}else{Ext.ux.app.ViewController.prototype.onPrint.apply(this,arguments)}}else{Ext.ux.app.ViewController.prototype.onPrint.apply(this,arguments)}},onInvoice:function(e){var f=this;var f=this,d=f.list.getSelectionModel().getSelection()[0];if(f.list.getSelectionModel().getSelection().length==1){url="index.php/invoices/printInvoice/?id="+d.get("id");window.open(url)}else{Ext.ux.Alert.alert(f.titleError,t("Not available to multi refill."),"error")}},onSelectionChange:function(f,e){var j=this,g=j.lookupReference("invoice");g&&g.setDisabled(!e.length);Ext.ux.app.ViewController.prototype.onSelectionChange.apply(this,arguments)},onRenderModule:function(){var c=this,d=c.lookupReference("chart");Ext.ux.app.ViewController.prototype.onRenderModule.apply(this,arguments);if(App.user.isAdmin){c.store.on({scope:c,beforeload:function(){d.el&&d.disable()},load:function(a){d.el&&d.enable();c.onSetTotal()}})}else{c.store.on({scope:c,load:function(a){c.onSetTotal()}})}},onChart:function(){var b=this;b.chart=Ext.widget("window",{title:t("charts"),iconCls:"icon-chart-column",layout:"fit",autoShow:true,modal:true,resizable:false,width:window.isThemeNeptune?740:710,items:{xtype:b.aliasChart}});b.chart.down("#tbTextSum").setText(""+t("total")+": "+App.user.currency+" "+b.sumData.sumCredit+"")},onSetTotal:function(c){var d=this;if(!d.store.getData().items[0]){return}d.sumData=d.store.getData().items[0].getData();if(!d.sumData){return}d.lookupReference("tbTextTotal")&&d.lookupReference("tbTextTotal").setText(""+t("Refill Total")+": "+App.user.currency+" "+d.sumData.sumCredit+"")}},0,0,0,0,["controller.refill"],0,[MBilling.view.refill,"Controller"],0));(Ext.cmd.derive("MBilling.view.refill.Module",Ext.ux.panel.Module,{controller:"refill"},0,["refillmodule"],["component","box","container","uxpanelmodule","refillmodule"],{component:true,box:true,container:true,uxpanelmodule:true,refillmodule:true},["widget.refillmodule"],0,[MBilling.view.refill,"Module"],0));(Ext.cmd.derive("MBilling.view.refill.List",Ext.ux.grid.Panel,{store:"Refill",fieldSearch:"idUser.username",initComponent:function(){var b=this;b.buttonsTbar=[{xtype:"tbtext",reference:"tbTextTotal"}];if(App.user.isAdmin&&b.buttonCleanFilter){b.extraButtons=[{text:t("charts"),iconCls:"icon-chart-column",handler:"onChart",reference:"chart",disabled:true},{text:t("Invoice"),glyph:b.glyphPrint,handler:"onInvoice",reference:"invoice",hidden:!window.invoice,disabled:true}]}if(App.user.isClient){b.extraButtons=[{text:t("Invoice"),glyph:b.glyphPrint,handler:"onInvoice",reference:"invoice",hidden:!window.invoice,disabled:true}]}b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:3,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("credit"),dataIndex:"credit",renderer:Helper.Util.formatMoneyDecimal2,flex:2},{header:t("description"),dataIndex:"description",flex:5},{header:t("payment"),dataIndex:"payment",renderer:Helper.Util.formattyyesno,filter:{type:"list",options:[[0,t("no")],[1,t("yes")]]},flex:2},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"date",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["refilllist"],["component","box","container","panel","tablepanel","gridpanel","grid","refilllist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,refilllist:true},["widget.refilllist"],0,[MBilling.view.refill,"List"],0));(Ext.cmd.derive("MBilling.view.refill.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["id_user"],initComponent:function(){var b=this;b.items=[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient},{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,00",name:"credit",fieldLabel:t("credit"),readOnly:App.user.isClient},{xtype:"textareafield",name:"description",fieldLabel:t("description"),readOnly:App.user.isClient},{xtype:"yesnocombo",name:"payment",fieldLabel:t("add")+" "+t("payment"),hidden:App.user.isClient},{name:"invoice_number",fieldLabel:t("Invoice")+" "+t("number"),hidden:!window.invoice,allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["refillform"],["component","box","container","panel","form","refillform"],{component:true,box:true,container:true,panel:true,form:true,refillform:true},["widget.refillform"],0,[MBilling.view.refill,"Form"],0));(Ext.cmd.derive("Ext.ux.panel.Chart",Ext.panel.Panel,{rootData:undefined,positionLegendPie:"bottom",showLegendPie:true,widthTip:200,degressXLabel:0,fontLabel:"15px Arial",textBtnColumn:t("columns"),textBtnLine:t("lines"),textBtnBar:t("bars"),textBtnPie:t("pie"),iconBtnColumn:"icon-chart-column",iconBtnLine:"icon-chart-line",iconBtnBar:"icon-chart-bar",iconBtnPie:"icon-chart-pie",heightChart:400,charts:["column","bar","line","pie"],defaultChart:"column",limitCharLabelTip:25,bbarChart:[],tbarChart:[],minimumAxesY:0,border:false,layout:"card",btnShowColumn:true,btnShowBar:true,btnShowLine:true,btnShowPie:true,btnShowLineHidden:false,btnShowColumnHidden:false,showDownload:true,legend:null,titleText:"",fieldLabel:"",constructor:function(){var b=this;if(Ext.isString(b.store)){b.store=Ext.data.StoreManager.lookup(b.store);b.store.load({scope:b,callback:function(){if(b.store.getData().items[0]){b.sumData=b.store.getData().items[0].getData()}}})}Ext.panel.Panel.prototype.constructor.apply(this,arguments)},initComponent:function(){var s=this,x=s.charts.length,r,o,v,q,w=[],y=[],u=[],p,z;if(s.charts.length===1){s.defaultChart=s.charts[0]}s.fieldValue=Ext.isArray(s.fieldValue)?s.fieldValue:[s.fieldValue];if(s.rootData){p=Ext.getStore(s.store);z=p.model.proxy.reader.rawData;s.store=Ext.create("Ext.data.Store",{fields:Ext.Array.merge(s.fieldValue,s.fieldDescription),data:z&&z[s.rootData],proxy:{type:"memory",reader:{type:"json"}}});s.fieldValue=s.fieldValue[0].name||s.fieldValue[0];s.fieldDescription=s.fieldDescription.name||s.fieldDescription}Ext.each(s.fieldValue,function(a){u.push({type:"line",yField:a,xField:s.fieldDescription,marker:{radius:4},highlight:true,tooltip:{trackMouse:true,width:s.widthTip,renderer:s.rendererPie(s.fieldDescription,s.rendererFieldValue,s.rendererFieldDescription,s.limitCharLabelTip)}})});s.chartColumn={xtype:"cartesian",itemId:"column",height:s.heightChart,width:s.width,store:s.store,insetPadding:{top:s.titleText.length>0?40:10},axes:[{type:"numeric",title:s.labelYLine,position:"left",grid:true,minimum:s.minimumAxesY,renderer:s.rendererFieldValue||s.rendererDefault},{type:"category",title:s.labelXLine,position:"bottom",grid:true,renderer:s.rendererFieldDescription||s.rendererDefault,label:{rotate:{degrees:s.degressXLabel}}}],series:[{type:"bar",axis:"left",yField:s.fieldValue,xField:s.fieldDescription,highlight:true,tooltip:{width:s.widthTip,renderer:s.rendererPie(s.fieldDescription,s.rendererFieldValue,s.rendererFieldDescription,s.limitCharLabelTip)},label:{hidden:s.fieldLabel.length<1,field:s.fieldLabel,display:"insideEnd"}}],sprites:{hidden:s.titleText.length<1,type:"text",text:s.titleText,fontSize:22,width:100,height:30,x:40,y:20}};s.chartBar={xtype:"cartesian",itemId:"bar",height:s.heightChart,width:s.width,store:s.store,flipXY:true,insetPadding:{top:s.titleText.length>0?40:10},axes:[{type:"numeric",title:s.labelYLine,position:"bottom",fields:s.fieldValue,grid:true,minimum:s.minimumAxesY,renderer:s.rendererFieldValue||s.rendererDefault},{type:"category",title:s.labelXLine,position:"left",fields:s.fieldDescription,grid:true,renderer:s.rendererFieldDescription||s.rendererDefault}],series:[{type:"bar",yField:s.fieldValue,xField:s.fieldDescription,highlight:true,tooltip:{width:s.widthTip,renderer:s.rendererPie(s.fieldDescription,s.rendererFieldValue,s.rendererFieldDescription,s.limitCharLabelTip)},label:{hidden:s.fieldLabel.length<1,field:s.fieldLabel,display:"insideEnd"}}],sprites:{hidden:s.titleText.length<1,type:"text",text:s.titleText,fontSize:22,width:100,height:30,x:40,y:20}};s.chartLine={xtype:"cartesian",itemId:"line",height:s.heightChart,width:s.width,store:s.store,legend:s.legend,axes:[{type:"numeric",title:s.labelYLine,position:"left",fields:s.fieldValue,grid:true,minimum:s.minimumAxesY,renderer:s.rendererFieldValue||s.rendererDefault},{type:"category",title:s.labelXLine,position:"bottom",grid:true,fields:s.fieldDescription,renderer:s.rendererFieldDescription||s.rendererDefault}],series:u};s.chartPie={xtype:"polar",itemId:"pie",height:s.heightChart,width:s.width,store:s.store,legend:{position:s.positionLegendPie,renderer:s.rendererFieldDescription},series:[{type:"pie",angleField:s.fieldValue[0],showInLegend:s.showLegendPie,tooltip:{trackMouse:true,width:s.widthTip,renderer:s.rendererPie(s.fieldDescription,s.rendererFieldValue,s.rendererFieldDescription,s.limitCharLabelTip)},highlight:{segment:{margin:20}},label:{field:s.fieldDescription,display:"rotate",contrast:true,font:s.fontLabel,renderer:s.rendererFieldDescription||s.rendererDefault}}]};if(s.btnShowColumn){r={chart:"column",text:s.textBtnColumn,iconCls:s.iconBtnColumn,hidden:s.btnShowColumnHidden}}if(s.btnShowBar){o={chart:"bar",text:s.textBtnBar,iconCls:s.iconBtnBar}}if(s.btnShowLine){v={chart:"line",text:s.textBtnLine,iconCls:s.iconBtnLine,hidden:s.btnShowLineHidden}}if(s.btnShowPie){q={chart:"pie",text:s.textBtnPie,iconCls:s.iconBtnPie}}if(Ext.Array.contains(s.charts,"column")){w.push(s.chartColumn);y.push(r)}if(Ext.Array.contains(s.charts,"bar")){w.push(s.chartBar);y.push(o)}if(Ext.Array.contains(s.charts,"line")){w.push(s.chartLine);y.push(v)}if(Ext.Array.contains(s.charts,"pie")){w.push(s.chartPie);y.push(q)}s.bbarChart.push("->",{xtype:"buttongroup",toggleGroup:"typeChart",defaults:{enableToggle:true,allowDepress:false,toggleGroup:"typeChart",listeners:{scope:s,toggle:s.activeChart}},items:y});s.items=w;if(s.showDownload){s.tbarChart.push("->",{text:t("Download"),glyph:icons.disk,scope:s,handler:s.onDownload})}s.tbar=s.tbarChart;s.bbar=s.bbarChart;Ext.panel.Panel.prototype.initComponent.apply(this,arguments);s.activeItem=s.down("#"+s.defaultChart);s.down("button[chart="+s.defaultChart+"]").pressed=true},onDownload:function(){var b=this;b.getLayout().getActiveItem().download()},activeChart:function(d){var c=this;d.pressed&&c.getLayout().setActiveItem(c.down("#"+d.chart))},rendererPie:function(g,f,e,j){return function(a,o,c){var d=this,n=o.get(g),b=o.get(c.field);n=e?e(n):n;b=f?f(b):b;n=Ext.String.ellipsis(n,j)+": ";title=n+b;a.setHtml(title)}},rendererDefault:function(c,d){return d},rendererLegend:function(b){return t(b)}},1,["chartpanel"],["component","box","container","panel","chartpanel"],{component:true,box:true,container:true,panel:true,chartpanel:true},["widget.chartpanel"],0,[Ext.ux.panel,"Chart"],0));(Ext.cmd.derive("MBilling.view.refill.Chart",Ext.ux.panel.Chart,{controller:"refill",store:"RefillChart",fieldValue:"sumCreditMonth",fieldDescription:"CreditMonth",labelYLine:t("credit"),labelXLine:t("Month"),reference:"refillchart",btnShowColumn:true,btnShowBar:false,btnShowLine:false,btnShowPie:false,btnShowColumnHidden:true,initComponent:function(){var d=this,c;d.rendererFieldValue=Ext.util.Format.numberRenderer("0"),d.tbarChart=[{text:t("Per")+" "+t("Month"),scope:d,handler:"onPerMonth",reference:"btnMonth",disabled:true},{text:t("Per")+" "+t("day"),scope:d,handler:"onPerDay",reference:"btnDay"}];d.bbarChart=[{xtype:"tbtext",itemId:"tbTextSum"}];Ext.ux.panel.Chart.prototype.initComponent.apply(this,arguments)},onPerMonth:function(d){var c=this;c.lookupReference("btnMonth").disable();c.lookupReference("btnDay").enable();c.store.setRemoteFilter(true);c.store.filter("type","month");c.store.load()},onPerDay:function(d){var c=this;c.lookupReference("btnDay").disable();c.lookupReference("btnMonth").enable();c.store.setRemoteFilter(true);c.store.filter("type","day");c.store.load()}},0,["refillchart"],["component","box","container","panel","chartpanel","refillchart"],{component:true,box:true,container:true,panel:true,chartpanel:true,refillchart:true},["widget.refillchart"],0,[MBilling.view.refill,"Chart"],0));(Ext.cmd.derive("MBilling.view.methodPay.Controller",Ext.ux.app.ViewController,{init:function(){var b=this;b.control({methodpaycombo:{select:b.onSelectMethod}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectMethod:function(c,d){showFields=d.getData().showFields.split(",");this.showFieldsRelated(showFields)},showFieldsRelated:function(f){var d=this,e=d.formPanel.getForm().getFields();e.each(function(a){a.setVisible(f.indexOf(a.name)!==-1)})},onEdit:function(){var c=this,d=c.list.getSelectionModel().getSelection()[0];method=d?d.get("payment_method"):"Moip";showFields=c.formPanel.down("methodpaycombo").store.findRecord("payment_method",method).getData().showFields;showFields=showFields.split(",");c.showFieldsRelated(showFields);Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)},onNew:function(){var c=this,d=c.list.getSelectionModel().getSelection()[0];method="Moip";showFields=c.formPanel.down("methodpaycombo").store.findRecord("payment_method",method).getData().showFields;showFields=showFields.split(",");c.showFieldsRelated(showFields);Ext.ux.app.ViewController.prototype.onNew.apply(this,arguments)}},0,0,0,0,["controller.methodpay"],0,[MBilling.view.methodPay,"Controller"],0));(Ext.cmd.derive("MBilling.view.methodPay.Module",Ext.ux.panel.Module,{controller:"methodpay"},0,["methodpaymodule"],["component","box","container","uxpanelmodule","methodpaymodule"],{component:true,box:true,container:true,uxpanelmodule:true,methodpaymodule:true},["widget.methodpaymodule"],0,[MBilling.view.methodPay,"Module"],0));(Ext.cmd.derive("MBilling.view.methodPay.List",Ext.ux.grid.Panel,{store:"MethodPay",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("paymentmethods"),dataIndex:"payment_method",flex:2},{header:t("country"),dataIndex:"country",flex:2},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:2},{header:t("active"),dataIndex:"active",flex:1,comboRelated:"booleancombo",renderer:Helper.Util.formatBooleanActive,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")]]}}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["methodpaylist"],["component","box","container","panel","tablepanel","gridpanel","grid","methodpaylist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,methodpaylist:true},["widget.methodpaylist"],0,[MBilling.view.methodPay,"List"],0));(Ext.cmd.derive("MBilling.view.methodPay.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{xtype:"methodpaycombo",name:"payment_method",valueField:"payment_method",fieldLabel:t("paymentmethods")},{name:"show_name",fieldLabel:t("showName")},{xtype:"userlookup",ownerForm:b,name:"id_user"},{xtype:"paymentcountrycombo",name:"country",fieldLabel:t("country")},{xtype:"booleancombo",name:"active",fieldLabel:t("active")},{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,00",name:"min",value:10,fieldLabel:t("Min amount")},{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,00",name:"max",value:500,fieldLabel:t("Max amount")},{name:"username",fieldLabel:t("Username"),allowBlank:true},{name:"url",fieldLabel:"Url",allowBlank:true},{xtype:"noyescombo",name:"fee",fieldLabel:t("Discount")+" "+t("Fee"),allowBlank:true},{xtype:"paymentbanckcombo",name:"boleto_banco",fieldLabel:t("Bank"),allowBlank:true},{name:"boleto_convenio",fieldLabel:t("numeroconvenio"),allowBlank:true},{name:"boleto_agencia",fieldLabel:t("agencia"),allowBlank:true},{name:"boleto_conta_corrente",fieldLabel:t("contacorrente"),allowBlank:true},{name:"boleto_inicio_nosso_numeroa",fieldLabel:t("Inicio nosso nº"),allowBlank:true},{name:"boleto_carteira",fieldLabel:t("carteira"),allowBlank:true},{name:"boleto_taxa",fieldLabel:t("taxa"),allowBlank:true},{name:"boleto_instrucoes",fieldLabel:t("instructions"),maxLength:"100",allowBlank:true},{name:"boleto_nome_emp",fieldLabel:t("company"),allowBlank:true},{name:"boleto_end_emp",fieldLabel:t("address"),allowBlank:true},{name:"boleto_cidade_emp",fieldLabel:t("city"),allowBlank:true},{name:"boleto_estado_emp",fieldLabel:t("state"),allowBlank:true},{name:"boleto_cpf_emp",fieldLabel:"CNPJ CPF",allowBlank:true},{name:"pagseguro_TOKEN",fieldLabel:"TOKEN",allowBlank:true},{name:"P2P_CustomerSiteID",fieldLabel:t("P2P CustomerSiteID"),allowBlank:true},{name:"P2P_KeyID",fieldLabel:t("P2P KeyID"),allowBlank:true},{name:"P2P_Passphrase",fieldLabel:t("P2P Passphrase"),allowBlank:true},{name:"P2P_RecipientKeyID",fieldLabel:t("P2P RecipientKeyID"),allowBlank:true},{name:"P2P_tax_amount",fieldLabel:t("P2P Tax Amount"),allowBlank:true},{name:"client_id",fieldLabel:t("Client id"),allowBlank:true},{name:"client_secret",fieldLabel:t("Client Secret"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["methodpayform"],["component","box","container","panel","form","methodpayform"],{component:true,box:true,container:true,panel:true,form:true,methodpayform:true},["widget.methodpayform"],0,[MBilling.view.methodPay,"Form"],0));(Ext.cmd.derive("MBilling.view.methodPay.Combo",Ext.form.field.ComboBox,{name:"id_methodpay",fieldLabel:t("methodPay"),displayField:"show_name",valueField:"id",forceSelection:true,editable:false,initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.MethodPay",{proxy:{type:"uxproxy",module:"methodpay",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["methodpaycombo"],["component","box","field","textfield","pickerfield","combobox","combo","methodpaycombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,methodpaycombo:true},["widget.methodpaycombo"],0,[MBilling.view.methodPay,"Combo"],0));(Ext.cmd.derive("MBilling.view.voucher.Controller",Ext.ux.app.ViewController,{onSave:function(){var b=this;Ext.ux.app.ViewController.prototype.onSave.apply(this,arguments);b.formPanel.setLoading(false);b.saveButton.enable();b.store.load()}},0,0,0,0,["controller.voucher"],0,[MBilling.view.voucher,"Controller"],0));(Ext.cmd.derive("MBilling.view.voucher.Module",Ext.ux.panel.Module,{controller:"voucher"},0,["vouchermodule"],["component","box","container","uxpanelmodule","vouchermodule"],{component:true,box:true,container:true,uxpanelmodule:true,vouchermodule:true},["widget.vouchermodule"],0,[MBilling.view.voucher,"Module"],0));(Ext.cmd.derive("MBilling.view.voucher.List",Ext.ux.grid.Panel,{store:"Voucher",initComponent:function(){var b=this;b.buttonCsv=false;b.allowPrint=false;b.buttonUpdateLot=false;b.allowUpdate=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:3,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("credit"),dataIndex:"credit",renderer:Helper.Util.formatMoneyDecimal,filter:{type:"int",field:"t.credit"},flex:3},{header:t("voucher"),dataIndex:"voucher",flex:5},{header:t("description"),dataIndex:"tag",flex:3,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("usedate"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"usedate",flex:4},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"creationdate",flex:4,hidden:App.user.isClient,hideable:!App.user.isClient}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["voucherlist"],["component","box","container","panel","tablepanel","gridpanel","grid","voucherlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,voucherlist:true},["widget.voucherlist"],0,[MBilling.view.voucher,"List"],0));(Ext.cmd.derive("MBilling.view.voucher.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;if(!App.user.isClient){b.fieldsHideEdit=["quantity"]}if(App.user.isClient){b.textNew=t("Insert Voucher");b.buttonNewWidth=150}b.items=[{xtype:"moneyfield",name:"credit",fieldLabel:t("credit"),hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"id_plan",fieldLabel:t("Plan"),xtype:"plancombo",hidden:!App.user.isAdmin,allowBlank:!App.user.isAdmin},{xtype:"languagecombo",name:"language",fieldLabel:t("language"),hidden:!App.user.isAdmin,allowBlank:!App.user.isAdmin},{name:"prefix_local",fieldLabel:t("prefixlocal"),value:App.user.base_country=="BRL"?"0/55,*/5511/8,*/5511/9":App.user.base_country=="ARG"?"0/54,*/5411/8,15/54911/10,16/54911/10":"",emptyText:"match / replace / length",hidden:!App.user.isAdmin,allowBlank:true},{xtype:"numberfield",name:"quantity",fieldLabel:t("Quantity"),hidden:!App.user.isAdmin,allowBlank:!App.user.isAdmin,value:10},{name:"tag",fieldLabel:t("description"),hidden:App.user.isClient,allowBlank:true},{xtype:"numberfield",name:"voucher",fieldLabel:t("voucher"),value:"",maxLength:6,minLength:6,hidden:!App.user.isClient,allowBlank:!App.user.isClient}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["voucherform"],["component","box","container","panel","form","voucherform"],{component:true,box:true,container:true,panel:true,form:true,voucherform:true},["widget.voucherform"],0,[MBilling.view.voucher,"Form"],0));(Ext.cmd.derive("MBilling.view.refillprovider.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.refillprovider"],0,[MBilling.view.refillprovider,"Controller"],0));(Ext.cmd.derive("MBilling.view.refillprovider.Module",Ext.ux.panel.Module,{controller:"refillprovider"},0,["refillprovidermodule"],["component","box","container","uxpanelmodule","refillprovidermodule"],{component:true,box:true,container:true,uxpanelmodule:true,refillprovidermodule:true},["widget.refillprovidermodule"],0,[MBilling.view.refillprovider,"Module"],0));(Ext.cmd.derive("MBilling.view.refillprovider.List",Ext.ux.grid.Panel,{store:"Refillprovider",initComponent:function(){var b=this;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{xtype:"templatecolumn",tpl:"{idProviderprovider_name}",header:t("provider"),dataIndex:"id_provider",comboFilter:"providercombo",flex:2},{header:t("credit"),dataIndex:"credit",renderer:Helper.Util.formatMoneyDecimal,flex:2},{header:t("description"),dataIndex:"description",flex:4},{header:t("payment"),dataIndex:"payment",renderer:Helper.Util.formattyyesno,filter:{type:"list",options:[[0,t("no")],[1,t("yes")]]},flex:2},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"date",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["refillproviderlist"],["component","box","container","panel","tablepanel","gridpanel","grid","refillproviderlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,refillproviderlist:true},["widget.refillproviderlist"],0,[MBilling.view.refillprovider,"List"],0));(Ext.cmd.derive("MBilling.view.refillprovider.Form",Ext.ux.form.Panel,{bodyPadding:0,fieldsHideUpdateLot:["id_provider"],initComponent:function(){var b=this;b.items=[{xtype:"providercombo"},{xtype:"moneyfield",name:"credit",fieldLabel:t("credit")},{xtype:"textareafield",name:"description",fieldLabel:t("description"),allowBlank:true},{xtype:"yesnocombo",name:"payment",fieldLabel:t("add")+" "+t("payment"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["refillproviderform"],["component","box","container","panel","form","refillproviderform"],{component:true,box:true,container:true,panel:true,form:true,refillproviderform:true},["widget.refillproviderform"],0,[MBilling.view.refillprovider,"Form"],0));(Ext.cmd.derive("MBilling.view.boleto.Controller",Ext.ux.app.ViewController,{onAfterSave:function(d){var c=this;if(c.formPanel.idRecord==0){url="index.php/boleto/secondVia/?id=last";window.open(url)}Ext.ux.app.ViewController.prototype.onAfterSave.apply(this,arguments)},onSecondVia:function(e){var f=this,d=f.list.getSelectionModel().getSelection()[0];if(f.list.getSelectionModel().getSelection().length==0){Ext.ux.Alert.alert(f.titleError,t("Por favor selecione um bolero"),"notification")}else{if(f.list.getSelectionModel().getSelection().length>1){Ext.ux.Alert.alert(f.titleError,t("Por favor selecione somente um bolero"),"notification")}else{url="index.php/boleto/secondVia/?id="+d.get("id");window.open(url)}}}},0,0,0,0,["controller.boleto"],0,[MBilling.view.boleto,"Controller"],0));(Ext.cmd.derive("MBilling.view.boleto.Module",Ext.ux.panel.Module,{controller:"boleto"},0,["boletomodule"],["component","box","container","uxpanelmodule","boletomodule"],{component:true,box:true,container:true,uxpanelmodule:true,boletomodule:true},["widget.boletomodule"],0,[MBilling.view.boleto,"Module"],0));(Ext.cmd.derive("MBilling.view.boleto.List",Ext.ux.grid.Panel,{store:"Boleto",iconButtonCsv:"boleto",textButtonCsv:t("Importar Retorno"),iconButtonImportCsv:"boleto",textButtonImportCsv:t("Importar Retorno"),initComponent:function(){var b=this;b.buttonCsv=false;b.buttonUpdateLot=false;b.buttonImportCsv=App.user.isAdmin;b.extraButtons=[{text:t("Segunda via"),iconCls:"boleto",handler:"onSecondVia",disabled:false}];b.columns=[{header:t("Nosso Número"),dataIndex:"id",flex:3,hidden:!App.user.isAdmin,hideable:App.user.isAdmin},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("value"),dataIndex:"payment",renderer:Helper.Util.formatMoneyDecimal,flex:4},{header:"Pago",dataIndex:"status",renderer:Helper.Util.formattyyesno,flex:2,filter:{type:"list",options:[[0,t("no")],[1,t("yes")]]}},{header:t("description"),dataIndex:"description",flex:5},{header:"Vencimento",renderer:Ext.util.Format.dateRenderer("Y-m-d"),dataIndex:"vencimento",flex:4},{header:"Gerado",renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"date",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["boletolist"],["component","box","container","panel","tablepanel","gridpanel","grid","boletolist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,boletolist:true},["widget.boletolist"],0,[MBilling.view.boleto,"List"],0));(Ext.cmd.derive("MBilling.view.boleto.Form",Ext.ux.form.Panel,{fieldsHideEdit:["cid"],initComponent:function(){var b=this;b.items=[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:App.user.isClient},{xtype:"moneyfield",name:"payment",fieldLabel:t("value"),readOnly:App.user.isClient},{xtype:"yesnocombo",name:"status",fieldLabel:t("Pago"),hidden:App.user.isClient,value:0},{xtype:"datefield",name:"vencimento",fieldLabel:"Vencimento",format:"Y-m-d H:i:s",hidden:App.user.isClient||App.user.isAgent},{xtype:"textareafield",name:"description",fieldLabel:t("description"),readOnly:App.user.isClient}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["boletoform"],["component","box","container","panel","form","boletoform"],{component:true,box:true,container:true,panel:true,form:true,boletoform:true},["widget.boletoform"],0,[MBilling.view.boleto,"Form"],0));(Ext.cmd.derive("Ext.ux.window.ImportBoleto",Ext.window.Window,{autoShow:true,modal:true,layout:"fit",iconCls:"boleto",title:t("Importa Retorno Boleto"),width:400,height:175,labelWidthFields:180,htmlTipInfo:"",fieldsImport:[],initComponent:function(){var d=this,c=Ext.Array.merge(d.fieldsImport,[{xtype:"uploadfield",fieldLabel:t("Selecion o arquivo .RET"),htmlTipInfo:d.htmlTipInfo}]);d.items=[{xtype:"form",bodyPadding:5,labelWidth:d.labelWidthFields,items:c}];d.title=d.title+(d.titleModule?" - "+d.titleModule:"");d.bbar=[{xtype:"tbtext",text:t("maxSizeFile")+"3 MB"},"->",{iconCls:"boleto",text:t("importText"),scope:d,handler:d.onImport}];Ext.window.Window.prototype.initComponent.apply(this,arguments)},onImport:function(d){var f=this,e=f.list.store;d.disable();f.list.setLoading(true);f.down("form").submit({url:"index.php/boleto/retorno",scope:f,success:function(c,b){var a=Ext.decode(b.response.responseText);if(a.success){Ext.ux.Alert.alert(t("Success"),a.msg,"success",true,false,40000)}else{Ext.ux.Alert.alert(t("Error"),a.errors,"error")}d.enable();f.list.setLoading(false);e.load();f.close()},failure:function(c,b){if(Ext.isObject(b.response.responseText)){var a=Ext.decode(b.response.responseText);Ext.ux.Alert.alert(t("Error"),a.errors,"error")}else{Ext.ux.Alert.alert(t("Error"),b.response.responseText,"error",true,10)}d.enable();f.list.setLoading(false);f.close()}})}},0,0,["component","box","container","panel","window"],{component:true,box:true,container:true,panel:true,window:true},0,0,[Ext.ux.window,"ImportBoleto"],0));(Ext.cmd.derive("MBilling.view.boleto.ImportCsv",Ext.ux.window.ImportBoleto,{title:t("Importar Retorno"),labelWidthFields:250,height:275,fieldsImport:[{xtype:"boletobanckcombo",name:"banco",fieldLabel:t("Banco"),width:350}]},0,["boletoimportcsv"],["component","box","container","panel","window","boletoimportcsv"],{component:true,box:true,container:true,panel:true,window:true,boletoimportcsv:true},["widget.boletoimportcsv"],0,[MBilling.view.boleto,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.offer.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.offer"],0,[MBilling.view.offer,"Controller"],0));(Ext.cmd.derive("MBilling.view.offer.Combo",Ext.form.field.ComboBox,{name:"id_offer",fieldLabel:t("offer"),displayField:"label",valueField:"id",value:0,extraValues:[{id:0,label:t("undefined")}],initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Offer",{proxy:{type:"uxproxy",module:"offer",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["offercombo"],["component","box","field","textfield","pickerfield","combobox","combo","offercombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,offercombo:true},["widget.offercombo"],0,[MBilling.view.offer,"Combo"],0));(Ext.cmd.derive("MBilling.view.offer.Module",Ext.ux.panel.Module,{controller:"offer"},0,["offermodule"],["component","box","container","uxpanelmodule","offermodule"],{component:true,box:true,container:true,uxpanelmodule:true,offermodule:true},["widget.offermodule"],0,[MBilling.view.offer,"Module"],0));(Ext.cmd.derive("MBilling.view.offer.List",Ext.ux.grid.Panel,{store:"Offer",initComponent:function(){var b=this;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("name"),dataIndex:"label",flex:1},{header:t("packagetype"),dataIndex:"packagetype",renderer:Helper.Util.formatPackageType,comboRelated:"offertypecombo",flex:1,filter:{type:"list",options:[[0,t("unlimitedcalls")],[1,t("numberfreecalls")],[2,t("freeseconds")]]}},{header:t("freetimetocall"),dataIndex:"freetimetocall",flex:1},{header:t("periode"),dataIndex:"billingtype",renderer:Helper.Util.formatBillingType,comboRelated:"billingtypecombo",flex:1,filter:{type:"list",options:[[0,t("monthly")],[1,t("weekly")]]}},{header:t("price"),dataIndex:"price",renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,hideable:App.user.isAdmin,flex:2},{header:t("creationdate"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"creationdate",flex:1}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["offerlist"],["component","box","container","panel","tablepanel","gridpanel","grid","offerlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,offerlist:true},["widget.offerlist"],0,[MBilling.view.offer,"List"],0));(Ext.cmd.derive("MBilling.view.offer.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["name"],items:[{name:"label",fieldLabel:t("name")},{xtype:"offertypecombo",name:"packagetype",fieldLabel:t("packagetype")},{name:"freetimetocall",fieldLabel:t("freetimetocall")},{xtype:"billingtypecombo",name:"billingtype",fieldLabel:t("periode")},{xtype:"moneyfield",name:"price",fieldLabel:t("price")}]},0,["offerform"],["component","box","container","panel","form","offerform"],{component:true,box:true,container:true,panel:true,form:true,offerform:true},["widget.offerform"],0,[MBilling.view.offer,"Form"],0));(Ext.cmd.derive("MBilling.view.offerCdr.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.offercdr"],0,[MBilling.view.offerCdr,"Controller"],0));(Ext.cmd.derive("MBilling.view.offerCdr.Module",Ext.ux.panel.Module,{controller:"offercdr"},0,["offercdrmodule"],["component","box","container","uxpanelmodule","offercdrmodule"],{component:true,box:true,container:true,uxpanelmodule:true,offercdrmodule:true},["widget.offercdrmodule"],0,[MBilling.view.offerCdr,"Module"],0));(Ext.cmd.derive("MBilling.view.offerCdr.List",Ext.ux.grid.Panel,{store:"OfferCdr",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"date_consumption",flex:3},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:3},{xtype:"templatecolumn",tpl:"{idOfferlabel}",header:t("offer"),dataIndex:"id_offer",comboFilter:"offercombo",flex:3},{header:t("duration"),dataIndex:"used_secondes",renderer:Helper.Util.formatsecondsToTime,flex:3}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["offercdrlist"],["component","box","container","panel","tablepanel","gridpanel","grid","offercdrlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,offercdrlist:true},["widget.offercdrlist"],0,[MBilling.view.offerCdr,"List"],0));(Ext.cmd.derive("MBilling.view.offerCdr.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.columns=[{xtype:"usercombo"},{xtype:"offercombo"},{name:"used_secondes",fieldLabel:t("usedsecondes")},{xtype:"datefield",name:"date_consumption",fieldLabel:t("date"),format:"Y-m-d H:i:s"}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["offercdrform"],["component","box","container","panel","form","offercdrform"],{component:true,box:true,container:true,panel:true,form:true,offercdrform:true},["widget.offercdrform"],0,[MBilling.view.offerCdr,"Form"],0));(Ext.cmd.derive("MBilling.view.offerUse.Module",Ext.ux.panel.Module,{controller:"offeruse"},0,["offerusemodule"],["component","box","container","uxpanelmodule","offerusemodule"],{component:true,box:true,container:true,uxpanelmodule:true,offerusemodule:true},["widget.offerusemodule"],0,[MBilling.view.offerUse,"Module"],0));(Ext.cmd.derive("MBilling.view.offerUse.List",Ext.ux.grid.Panel,{store:"OfferUse",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:3},{xtype:"templatecolumn",tpl:"{idOfferlabel}",header:t("offer"),dataIndex:"id_offer",comboFilter:"offercombo",flex:3},{header:t("monthpayed"),dataIndex:"month_payed",flex:3},{header:t("reservationdate"),renderer:Ext.util.Format.dateRenderer("Y-m-d"),dataIndex:"reservationdate",flex:3},{header:t("releasedate"),renderer:Ext.util.Format.dateRenderer("Y-m-d"),dataIndex:"releasedate",flex:3}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["offeruselist"],["component","box","container","panel","tablepanel","gridpanel","grid","offeruselist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,offeruselist:true},["widget.offeruselist"],0,[MBilling.view.offerUse,"List"],0));(Ext.cmd.derive("MBilling.view.offerUse.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{xtype:"userlookup",ownerForm:b,readOnly:true},{xtype:"offercombo",readOnly:true},{name:"month_payed",fieldLabel:t("monthpayed")},{xtype:"datefield",name:"reservationdate",fieldLabel:t("reservationdate"),format:"Y-m-d H:i:s"}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["offeruseform"],["component","box","container","panel","form","offeruseform"],{component:true,box:true,container:true,panel:true,form:true,offeruseform:true},["widget.offeruseform"],0,[MBilling.view.offerUse,"Form"],0));(Ext.cmd.derive("MBilling.view.campaign.Controller",Ext.ux.app.ViewController,{isSubmitForm:true,init:function(){var b=this;b.control({typecampaigndestinationcombo:{select:b.onSelectMethod}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectMethod:function(c,d){this.showFieldsRelated(d.getData().showFields)},showFieldsRelated:function(j){var l=this,m=l.formPanel.getForm(),g=l.formPanel.getForm().getFields(),f=Ext.get(Ext.Element.getActiveElement()).component;l.onSetVisibleFiel(f,m,f.value)},onSetVisibleFiel:function(e,d,f){if(e.value=="undefined"){e.setValue("undefined")}if(e.name.match("^type_0")){d.findField("id_queue_0").setVisible(f.match("^queue"));d.findField("id_sip_0").setVisible(f.match("^sip"));d.findField("id_ivr_0").setVisible(f.match("^ivr"));d.findField("extension_0").setVisible(f.match("^group|^number|^custom"))}},onEdit:function(){var f=this,d=f.formPanel.getForm(),e=f.list.getSelectionModel().getSelection()[0];if(e.getData()["type_0"]=="ivr"){d.findField("id_ivr_0").setVisible(true);d.findField("id_sip_0").setVisible(false);d.findField("id_queue_0").setVisible(false);d.findField("extension_0").setVisible(false)}else{if(e.getData()["type_0"]=="sip"){d.findField("id_sip_0").setVisible(true);d.findField("id_ivr_0").setVisible(false);d.findField("id_queue_0").setVisible(false);d.findField("extension_0").setVisible(false)}else{if(e.getData()["type_0"]=="queue"){d.findField("id_queue_0").setVisible(true);d.findField("id_sip_0").setVisible(false);d.findField("id_ivr_0").setVisible(false);d.findField("extension_0").setVisible(false)}else{if(e.getData()["type_0"].match("custom|number|group")){d.findField("extension_0").setVisible(true);d.findField("id_ivr_0").setVisible(false);d.findField("id_sip_0").setVisible(false);d.findField("id_queue_0").setVisible(false)}else{d.findField("id_queue_0").setVisible(false);d.findField("id_sip_0").setVisible(false);d.findField("id_ivr_0").setVisible(false);d.findField("extension_0").setVisible(false)}}}}Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)},onNew:function(){var f=this,d=f.formPanel.getForm(),e=f.list.getSelectionModel().getSelection()[0];d.findField("id_ivr_0").setVisible(false);d.findField("id_sip_0").setVisible(false);d.findField("id_queue_0").setVisible(false);d.findField("extension_0").setVisible(false);Ext.ux.app.ViewController.prototype.onNew.apply(this,arguments)},submitForm:function(d){var f=this,e=f.store;Ext.apply(f.params,{id_phonebook_array:f.formPanel.getForm().getFieldValues().id_phonebook.join(",")});f.formPanel.add({xtype:"hiddenfield",name:f.idProperty,value:f.formPanel.idRecord});f.formPanel.getForm().submit({url:f.store.getProxy().api.create,params:f.params,scope:f,success:function(c,b){var a=Ext.decode(b.response.responseText);if(a.success){Ext.ux.Alert.alert(f.titleSuccess,a.msg,"success");f.formPanel.fireEvent("aftersave",f.formPanel,a.rows[0])}else{errors=Helper.Util.convertErrorsJsonToString(a.msg);if(!Ext.isObject(a.errors)){Ext.ux.Alert.alert(f.titleError,errors,"error")}else{c.markInvalid(a.errors);Ext.ux.Alert.alert(f.titleWarning,f.msgFormInvalid,"warning")}}f.store.load();f.formPanel.setLoading(false);f.saveButton.enable()},failure:function(j,c){var b=Ext.decode(c.response.responseText),a=Helper.Util.convertErrorsJsonToString(b.errors);if(!Ext.isObject(b.errors)){Ext.ux.Alert.alert(f.titleError,a,"error")}else{j.markInvalid(b.errors);Ext.ux.Alert.alert(f.titleWarning,a,"error")}f.formPanel.setLoading(false);f.saveButton.enable()}})},onTestCampaign:function(e){var f=this,d=f.list.getSelectionModel().getSelection()[0];if(f.list.getSelectionModel().getSelection().length==0){Ext.ux.Alert.alert(f.titleError,t("Please Select one campaign"),"notification")}else{if(f.list.getSelectionModel().getSelection().length>1){Ext.ux.Alert.alert(f.titleError,t("Please Select only one campaign"),"notification")}else{Ext.Ajax.request({url:"index.php/campaign/testCampaign",params:{id:d.get("id")},scope:f,success:function(b){b=Ext.decode(b.responseText);if(b[f.nameSuccessRequest]){Ext.ux.Alert.alert(f.titleSuccess,b[f.nameMsgRequest],"success")}else{var a=Helper.Util.convertErrorsJsonToString(b[f.nameMsgRequest]);Ext.ux.Alert.alert(f.titleSuccess,a,"error")}}})}}}},0,0,0,0,["controller.campaign"],0,[MBilling.view.campaign,"Controller"],0));(Ext.cmd.derive("MBilling.view.campaign.Combo",Ext.form.field.ComboBox,{name:"id_campaign",fieldLabel:t("campaign"),displayField:"name",forceSelection:true,editable:false,valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Campaign",{proxy:{type:"uxproxy",module:"campaign",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["campaigncombo"],["component","box","field","textfield","pickerfield","combobox","combo","campaigncombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,campaigncombo:true},["widget.campaigncombo"],0,[MBilling.view.campaign,"Combo"],0));(Ext.cmd.derive("MBilling.view.general.TypeCampaignDestination",Ext.form.field.ComboBox,{fieldLabel:t("type"),forceSelection:true,editable:false,value:"",store:[["",t("")],["undefined",t("Undefined")],["sip",t("SIP")],["ivr",t("IVR")],["queue",t("Queue")],["group",t("Group")],["custom",t("Custom")]]},0,["typecampaigndestinationcombo"],["component","box","field","textfield","pickerfield","combobox","combo","typecampaigndestinationcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,typecampaigndestinationcombo:true},["widget.typecampaigndestinationcombo"],0,[MBilling.view.general,"TypeCampaignDestination"],0));(Ext.cmd.derive("MBilling.view.campaign.Module",Ext.ux.panel.Module,{controller:"campaign"},0,["campaignmodule"],["component","box","container","uxpanelmodule","campaignmodule"],{component:true,box:true,container:true,uxpanelmodule:true,campaignmodule:true},["widget.campaignmodule"],0,[MBilling.view.campaign,"Module"],0));(Ext.cmd.derive("MBilling.view.campaign.List",Ext.ux.grid.Panel,{store:"Campaign",fieldSearch:"name",initComponent:function(){var b=this;b.buttonCsv=false;b.allowPrint=false;b.extraButtons=[{text:t("Test")+" "+t("Campaign"),iconCls:"call",handler:"onTestCampaign",disabled:false}];b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("name"),dataIndex:"name",flex:4},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:3,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("status"),dataIndex:"status",renderer:Helper.Util.formatBooleanActive,comboRelated:"booleancombo",flex:2,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")]]}},{header:t("type"),dataIndex:"type",renderer:Helper.Util.formatCampaignType,comboRelated:"campaigntypecombo",flex:2,filter:App.user.l.slice(4,7)=="wap"?{type:"list",options:[[0,t("sms")],[1,t("voice")],[3,t("WhasApp")]]}:{type:"list",options:[[0,t("sms")],[1,t("voice")]]}},{header:t("daily_start_time"),dataIndex:"daily_start_time",flex:4},{header:t("daily_stop_time"),dataIndex:"daily_stop_time",flex:4},{header:t("startingdate"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"startingdate",flex:4},{header:t("Call Limit"),dataIndex:"frequency",flex:4,hidden:true,hideable:App.user.isAdmin},{header:t("Max Complete Call"),dataIndex:"secondusedreal",flex:3,hidden:true,hideable:App.user.isAdmin}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignlist"],["component","box","container","panel","tablepanel","gridpanel","grid","campaignlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,campaignlist:true},["widget.campaignlist"],0,[MBilling.view.campaign,"List"],0));(Ext.cmd.derive("MBilling.view.campaign.Form",Ext.ux.form.Panel,{bodyPadding:0,fieldsHideUpdateLot:["id_user","name","audio","audio_2","id_phonebook"],fileUpload:true,initComponent:function(){var b=this;b.labelWidthFields=120;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{plugins:"markallowblank",allowBlank:false,anchor:"100%",labelAlign:"right"}},items:[{title:t("general"),items:[{xtype:App.user.isClient?"textfield":"userlookup",ownerForm:b,hidden:App.user.isClient},{fieldLabel:t("Plan"),xtype:"plancombo",name:"id_plan",hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"name",fieldLabel:t("name")},{xtype:"booleancombo",name:"status",fieldLabel:t("status")},{xtype:"datetimefield",name:"startingdate",fieldLabel:t("startingdate"),format:"Y-m-d H:i:s",value:new Date()},{xtype:"datetimefield",name:"expirationdate",fieldLabel:t("expirationdate"),format:"Y-m-d H:i:s",value:"2030-01-01 00:00:00"},{xtype:"campaigntypefullcombo",name:"type",fieldLabel:t("type")},{xtype:"uploadfield",fieldLabel:t("Audio"),emptyText:"Select an wav or gsm File",allowBlank:true,name:"audio",extAllowed:["wav","gsm"]},{xtype:"uploadfield",fieldLabel:t("Audio")+"2",emptyText:"Select an wav or gsm File",allowBlank:true,name:"audio_2",extAllowed:["wav","gsm"]},{xtype:"yesnocombo",name:"restrict_phone",fieldLabel:t("Restrict Phone"),hidden:App.user.isClient,allowBlank:true},{style:"margin-top:25px",xtype:"fieldset",title:t("Forward to"),collapsible:true,collapsed:false,height:110,defaults:{labelWidth:190,anchor:"100%",labelAlign:b.labelAlignFields},items:[{xtype:"numberfield",name:"digit_authorize",fieldLabel:t("Number to Forward"),value:"-1",minValue:"-1",maxValue:9},{fieldLabel:t("Forward Type"),name:"type_0",xtype:"typecampaigndestinationcombo",allowBlank:true},{xtype:"textfield",name:"extensions_0",fieldLabel:t("Destination"),value:"0",allowBlank:true,hidden:true},{xtype:"ivrlookup",ownerForm:b,name:"id_ivr_0",fieldLabel:t("IVR"),displayField:"id_ivr_0_name",allowBlank:true,hidden:true},{xtype:"queuelookup",ownerForm:b,name:"id_queue_0",fieldLabel:t("Queue"),displayField:"id_queue_0_name",allowBlank:true,hidden:true},{xtype:"siplookup",ownerForm:b,name:"id_sip_0",displayField:"id_sip_0_name",fieldLabel:t("SIP"),allowBlank:true,hidden:true},{xtype:"textfield",fieldLabel:t("Destination"),name:"extension_0",hidden:true}]},{style:"margin-top:10px",xtype:"fieldset",title:t("Select one or more phonebook"),collapsible:true,collapsed:false,items:[{labelWidth:10,name:"id_phonebook",fieldLabel:t("phonebook"),anchor:"100%",fieldLabel:"",xtype:"phonebooktag",allowBlank:true}]}]},{title:t("schedules"),items:[{name:"daily_start_time",fieldLabel:t("daily_start_time"),value:"09:00"},{name:"daily_stop_time",fieldLabel:t("daily_stop_time"),value:"18:00"},{xtype:"yesnocombo",fieldLabel:t("monday"),name:"monday"},{xtype:"yesnocombo",fieldLabel:t("tuesday"),name:"tuesday"},{xtype:"yesnocombo",fieldLabel:t("wednesday"),name:"wednesday"},{xtype:"yesnocombo",fieldLabel:t("thursday"),name:"thursday"},{xtype:"yesnocombo",fieldLabel:t("friday"),name:"friday"},{xtype:"noyescombo",fieldLabel:t("saturday"),name:"saturday"},{xtype:"noyescombo",fieldLabel:t("sunday"),name:"sunday"}]},{title:t("Limit"),items:[{name:"frequency",fieldLabel:t("Call Limit"),readOnly:!App.user.isAdmin,allowBlank:!App.user.isAdmin,value:App.user.isClient?1:10},{name:"nb_callmade",fieldLabel:t("Total Audio Time"),hidden:!App.user.isAdmin,allowBlank:true,value:0},{xtype:"booleancombo",name:"enable_max_call",fieldLabel:t("Enable")+" "+t("Max Complete Call"),hidden:!App.user.isAdmin,allowBlank:true,value:0},{name:"secondusedreal",fieldLabel:t("Max Complete Call"),hidden:!App.user.isAdmin,allowBlank:true,value:0}]},{title:t("SMS"),items:[{xtype:"textareafield",name:"description",fieldLabel:t("descriptionOrSmsText"),allowBlank:true,maxLength:160}]},{title:t("TTS/ASR"),hidden:!window.ttsasr,items:[{name:"tts_audio",fieldLabel:t("Audio 1 TTS"),allowBlank:true,maxLength:200},{name:"tts_audio2",fieldLabel:t("Audio 2 TTS"),allowBlank:true,maxLength:200},{xtype:"box",hidden:false,autoEl:{tag:"br"}},{name:"asr_options",fieldLabel:t("Option to validate ASR"),allowBlank:true,maxLength:160}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignform"],["component","box","container","panel","form","campaignform"],{component:true,box:true,container:true,panel:true,form:true,campaignform:true},["widget.campaignform"],0,[MBilling.view.campaign,"Form"],0));(Ext.cmd.derive("MBilling.view.campaignPoll.Controller",Ext.ux.app.ViewController,{isSubmitForm:true},0,0,0,0,["controller.campaignpoll"],0,[MBilling.view.campaignPoll,"Controller"],0));(Ext.cmd.derive("MBilling.view.campaignPoll.Combo",Ext.form.field.ComboBox,{name:"id_campaign_poll",fieldLabel:t("campaignpoll"),displayField:"name",valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.CampaignPoll",{proxy:{type:"uxproxy",module:"campaignPoll",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["campaignpollcombo"],["component","box","field","textfield","pickerfield","combobox","combo","campaignpollcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,campaignpollcombo:true},["widget.campaignpollcombo"],0,[MBilling.view.campaignPoll,"Combo"],0));(Ext.cmd.derive("MBilling.view.campaignPoll.Module",Ext.ux.panel.Module,{controller:"campaignpoll"},0,["campaignpollmodule"],["component","box","container","uxpanelmodule","campaignpollmodule"],{component:true,box:true,container:true,uxpanelmodule:true,campaignpollmodule:true},["widget.campaignpollmodule"],0,[MBilling.view.campaignPoll,"Module"],0));(Ext.cmd.derive("MBilling.view.campaignPoll.List",Ext.ux.grid.Panel,{store:"CampaignPoll",initComponent:function(){var b=this;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("name"),dataIndex:"name",flex:4},{xtype:"templatecolumn",tpl:"{idCampaignname}",header:t("campaign"),dataIndex:"id_campaign",comboFilter:"campaigncombo",flex:4},{header:t("description"),dataIndex:"description",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignpolllist"],["component","box","container","panel","tablepanel","gridpanel","grid","campaignpolllist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,campaignpolllist:true},["widget.campaignpolllist"],0,[MBilling.view.campaignPoll,"List"],0));(Ext.cmd.derive("MBilling.view.campaignPoll.Form",Ext.ux.form.Panel,{bodyPadding:0,fileUpload:true,fieldsHideUpdateLot:["id_campaign","name","arq_audio"],initComponent:function(){var b=this;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{plugins:"markallowblank",allowBlank:false,anchor:"100%",labelAlign:"right"}},items:[{title:t("general"),items:[{xtype:"campaigncombo"},{name:"name",fieldLabel:t("name")},{xtype:"numberfield",name:"repeat",fieldLabel:t("How many time to repeat, if the client press invalid option?"),minValue:0,maxValue:9,allowBlank:true},{xtype:"noyescombo",name:"request_authorize",fieldLabel:t("Request")+" "+t("authorization")},{xtype:"numberfield",name:"digit_authorize",fieldLabel:t("Number for authorize"),value:"1",minValue:1,maxValue:9,allowBlank:true},{xtype:"textareafield",name:"description",fieldLabel:t("description"),allowBlank:true},{xtype:"uploadfield",fieldLabel:"Audio",emptyText:"Select an wav or gsm File",allowBlank:true,name:"arq_audio",extAllowed:["wav","gsm"]}]},{title:t("options"),itemId:"optionsData",items:[{name:"option0",fieldLabel:t("option")+" 0",allowBlank:true},{name:"option1",fieldLabel:t("option")+" 1",allowBlank:true},{name:"option2",fieldLabel:t("option")+" 2",allowBlank:true},{name:"option3",fieldLabel:t("option")+" 3",allowBlank:true},{name:"option4",fieldLabel:t("option")+" 4",allowBlank:true},{name:"option5",fieldLabel:t("option")+" 5",allowBlank:true},{name:"option6",fieldLabel:t("option")+" 6",allowBlank:true},{name:"option7",fieldLabel:t("option")+" 7",allowBlank:true},{name:"option8",fieldLabel:t("option")+" 8",allowBlank:true},{name:"option9",fieldLabel:t("option")+" 9",allowBlank:true}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignpollform"],["component","box","container","panel","form","campaignpollform"],{component:true,box:true,container:true,panel:true,form:true,campaignpollform:true},["widget.campaignpollform"],0,[MBilling.view.campaignPoll,"Form"],0));(Ext.cmd.derive("MBilling.view.phoneNumber.Controller",Ext.ux.app.ViewController,{reprocessar:function(e){var g=this,f=g.list.getStore(),j=g.list.filters.getFilterData().length?Ext.encode(g.list.filters.getFilterData()):f.proxy.extraParams.filter;e.disable();g.list.setLoading(true);if(!j){Ext.ux.Alert.alert("Alert","Realize um filtro para reprocessar","notification");e.enable();g.list.setLoading(false);return}Ext.Msg.confirm("Confirm","Confirme que quer reprocessar os numeros pendentes?",function(a){if(a==="yes"){Ext.Ajax.request({url:"index.php/phoneNumber/reprocesar/",params:{filter:j},scope:g,success:function(c){c=Ext.decode(c.responseText);if(c[g.nameSuccessRequest]){Ext.ux.Alert.alert(g.titleSuccess,c[g.nameMsgRequest],"success");f.load();e.enable();g.list.setLoading(false)}else{var b=Helper.Util.convertErrorsJsonToString(c[g.nameMsgRequest]);Ext.ux.Alert.alert(g.titleError,b,"error");e.enable();g.list.setLoading(false)}}})}})}},0,0,0,0,["controller.phonenumber"],0,[MBilling.view.phoneNumber,"Controller"],0));(Ext.cmd.derive("MBilling.view.phoneNumber.Module",Ext.ux.panel.Module,{controller:"phonenumber"},0,["phonenumbermodule"],["component","box","container","uxpanelmodule","phonenumbermodule"],{component:true,box:true,container:true,uxpanelmodule:true,phonenumbermodule:true},["widget.phonenumbermodule"],0,[MBilling.view.phoneNumber,"Module"],0));(Ext.cmd.derive("MBilling.view.phoneNumber.List",Ext.ux.grid.Panel,{store:"PhoneNumber",buttonImportCsv:true,initComponent:function(){var b=this;b.extraButtons=[{text:t("Reprocessar"),iconCls:"callshop",handler:"reprocessar",disabled:false}];b.buttonUpdateLot=App.user.isAdmin&&!window.isTablet;b.buttonCsv=!window.isTablet;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("number"),dataIndex:"number",flex:4},{header:t("phonebook"),dataIndex:"idPhonebookname",filter:{type:"string",field:"idPhonebook.name"},flex:4},{header:t("status"),dataIndex:"status",renderer:Helper.Util.formatBooleanActive,comboRelated:"statuscombo",flex:2,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")],[2,t("pending")],[3,t("send")],[4,t("blocked")]]}},{header:t("name"),dataIndex:"name",hidden:true,hideable:true,flex:4},{header:t("city"),dataIndex:"city",hidden:true,hideable:true,flex:4},{header:t("description"),dataIndex:"info",hidden:true,flex:4},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"creationdate",hidden:true,hideable:App.user.isAdmin,flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["phonenumberlist"],["component","box","container","panel","tablepanel","gridpanel","grid","phonenumberlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,phonenumberlist:true},["widget.phonenumberlist"],0,[MBilling.view.phoneNumber,"List"],0));(Ext.cmd.derive("MBilling.view.phoneNumber.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["number"],initComponent:function(){var b=this;b.items=[{xtype:"phonebookcombo"},{name:"number",fieldLabel:t("number")},{name:"name",fieldLabel:t("name"),allowBlank:true},{name:"city",fieldLabel:t("city"),allowBlank:true},{xtype:"statuscombo",name:"status",fieldLabel:t("status"),allowBlank:true},{xtype:"textareafield",name:"info",fieldLabel:t("description"),allowBlank:true,hidden:!App.user.isAdmin}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["phonenumberform"],["component","box","container","panel","form","phonenumberform"],{component:true,box:true,container:true,panel:true,form:true,phonenumberform:true},["widget.phonenumberform"],0,[MBilling.view.phoneNumber,"Form"],0));(Ext.cmd.derive("MBilling.view.phoneBook.Combo",Ext.form.field.ComboBox,{name:"id_phonebook",fieldLabel:t("phonebook"),displayField:"name",forceSelection:true,editable:true,valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.PhoneBook",{proxy:{type:"uxproxy",module:"phoneBook",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["phonebookcombo"],["component","box","field","textfield","pickerfield","combobox","combo","phonebookcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,phonebookcombo:true},["widget.phonebookcombo"],0,[MBilling.view.phoneBook,"Combo"],0));(Ext.cmd.derive("MBilling.view.phoneNumber.ImportCsv",Ext.ux.window.ImportCsv,{htmlTipInfo:"
number,name,city
551135672677, Dany Hilger, New York
551156332233, Monica Leith, San Pablo
554153882200, John Mart, Madri
"+t("name")+" "+t("and")+" "+t("city")+" "+t("optional")+"",fieldsImport:[{xtype:"phonebookcombo",width:350}]},0,["phonenumberimportcsv"],["component","box","container","panel","window","phonenumberimportcsv"],{component:true,box:true,container:true,panel:true,window:true,phonenumberimportcsv:true},["widget.phonenumberimportcsv"],0,[MBilling.view.phoneNumber,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.rate.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.rate"],0,[MBilling.view.rate,"Controller"],0));(Ext.cmd.derive("MBilling.view.rate.Module",Ext.ux.panel.Module,{controller:"rate",flexForm:2,labelWidthFields:190},0,["ratemodule"],["component","box","container","uxpanelmodule","ratemodule"],{component:true,box:true,container:true,uxpanelmodule:true,ratemodule:true},["widget.ratemodule"],0,[MBilling.view.rate,"Module"],0));(Ext.cmd.derive("MBilling.view.rate.List",Ext.ux.grid.Panel,{store:"Rate",fieldSearch:"idPrefix.prefix",initComponent:function(){var b=this;b.buttonImportCsv=!App.user.isClient,b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("prefix"),dataIndex:"idPrefixprefix",filter:{type:"string",field:"idPrefix.prefix"},flex:window.isTablet?2:3},{dataIndex:"idPrefixdestination",header:t("destination"),filter:{type:"string",field:"idPrefix.destination"},flex:window.isTablet?2:3},{header:t("buyrate"),dataIndex:"buyrate",renderer:Helper.Util.formatMoneyDecimal4,hidden:!App.user.isAdmin,hideable:App.user.isAdmin,flex:2},{header:t("buyrateinitblock"),dataIndex:"buyrateinitblock",hidden:!App.user.isAdmin||window.isTablet,hideable:App.user.isAdmin,flex:2},{header:t("buyrateincrement"),dataIndex:"buyrateincrement",hidden:!App.user.isAdmin||window.isTablet,hideable:App.user.isAdmin,flex:2},{header:t("rateinitial"),dataIndex:"rateinitial",renderer:Helper.Util.formatMoneyDecimal4,flex:2},{header:t("initblock"),dataIndex:"initblock",hidden:window.isTablet,flex:2},{header:t("billingblock"),dataIndex:"billingblock",hidden:window.isTablet,flex:2},{xtype:"templatecolumn",tpl:"{idTrunktrunkcode}",header:t("trunk"),dataIndex:"id_trunk",comboFilter:"trunkcombo",flex:3,hidden:!App.user.isAdmin,hideable:App.user.isAdmin},{xtype:"templatecolumn",tpl:"{idPlanname}",header:t("plan"),dataIndex:"id_plan",comboFilter:"plancombo",flex:3},{header:t("includeinpackage"),dataIndex:"package_offer",hidden:true,hideable:App.user.isAdmin,flex:1},{header:t("status"),dataIndex:"status",hidden:true,hideable:App.user.isAdmin,flex:2,renderer:Helper.Util.formatBooleanActive,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")]]}}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["ratelist"],["component","box","container","panel","tablepanel","gridpanel","grid","ratelist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,ratelist:true},["widget.ratelist"],0,[MBilling.view.rate,"List"],0));(Ext.cmd.derive("MBilling.view.rate.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["id_prefix"],labelWidthFields:140,initComponent:function(){var b=this;b.items=[{name:"id_plan",fieldLabel:"Plan",xtype:"planlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:false},{name:"id_prefix",fieldLabel:"Destination",xtype:"prefixlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:false},{name:"id_trunk",fieldLabel:"Trunk",xtype:"trunklookup",ownerForm:b,hidden:!App.user.isAdmin,allowBlank:!App.user.isAdmin},{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,"+App.user.decimalPrecision,name:"buyrate",fieldLabel:t("buyrate"),hidden:!App.user.isAdmin,allowBlank:!App.user.isAdmin},{xtype:"numberfield",name:"buyrateinitblock",fieldLabel:t("buyrateinitblock"),value:1,minValue:1,hidden:!App.user.isAdmin,allowBlank:!App.user.isAdmin},{xtype:"numberfield",name:"buyrateincrement",fieldLabel:t("buyrateincrement"),value:1,minValue:1,hidden:!App.user.isAdmin,allowBlank:!App.user.isAdmin},{xtype:"numberfield",name:"minimal_time_buy",fieldLabel:t("Minimal time to buy"),value:0,minValue:0,hidden:!App.user.isAdmin},{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,"+App.user.decimalPrecision,name:"rateinitial",fieldLabel:t("rateinitial"),readOnly:App.user.isClient},{xtype:"numberfield",name:"initblock",fieldLabel:t("initblock"),value:1,minValue:1,hidden:App.user.isClient},{xtype:"numberfield",name:"billingblock",value:1,minValue:1,fieldLabel:t("billingblock"),hidden:App.user.isClient},{xtype:"numberfield",name:"minimal_time_charge",fieldLabel:t("Minimal time to charge"),value:0,minValue:0,hidden:App.user.isClient},{name:"additional_grace",fieldLabel:t("additional_grace"),allowBlank:true,hidden:!App.user.isAdmin},{xtype:"noyescombo",name:"package_offer",fieldLabel:t("includeinpackage"),hidden:!App.user.isAdmin,allowBlank:true},{xtype:"booleancombo",name:"status",fieldLabel:t("status"),hidden:!App.user.isAdmin,allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["rateform"],["component","box","container","panel","form","rateform"],{component:true,box:true,container:true,panel:true,form:true,rateform:true},["widget.rateform"],0,[MBilling.view.rate,"Form"],0));(Ext.cmd.derive("MBilling.view.rate.ImportCsv",Ext.ux.window.ImportCsv,{htmlTipInfo:"
"+t("dialprefix")+", "+t("destination")+", "+t("rateinitial")+", "+t("buyrate")+"
5511, Brasil SP, 0.080, 0.050
34, Spain Fix, 0.056, 0.034
54, Argentina, 0.025, 0.015

"+t("rateinitial")+" "+t("and")+" "+t("buyrate")+" "+t("optional")+"",labelWidthFields:160,height:window.isThemeTriton?350:275,initComponent:function(){var b=this;b.fieldsImport=[{xtype:"plancombo",fieldLabel:t("table"),width:350},{xtype:"trunkcombo",fieldLabel:t("trunkText"),width:350,hidden:!App.user.isAdmin},{style:"margin-top:25px",xtype:"fieldset",title:t("Csv Format"),collapsible:true,collapsed:false,defaults:{labelWidth:190,anchor:"100%",layout:{type:"hbox",labelAlign:b.labelAlignFields}},items:[{xtype:"pontovirgulacombo",name:"delimiter",fieldLabel:t("Delimiter"),width:230}]}];Ext.ux.window.ImportCsv.prototype.initComponent.apply(this,arguments)}},0,["rateimportcsv"],["component","box","container","panel","window","rateimportcsv"],{component:true,box:true,container:true,panel:true,window:true,rateimportcsv:true},["widget.rateimportcsv"],0,[MBilling.view.rate,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.phoneBook.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.phonebook"],0,[MBilling.view.phoneBook,"Controller"],0));(Ext.cmd.derive("MBilling.view.phoneBook.Module",Ext.ux.panel.Module,{controller:"phonebook"},0,["phonebookmodule"],["component","box","container","uxpanelmodule","phonebookmodule"],{component:true,box:true,container:true,uxpanelmodule:true,phonebookmodule:true},["widget.phonebookmodule"],0,[MBilling.view.phoneBook,"Module"],0));(Ext.cmd.derive("MBilling.view.phoneBook.List",Ext.ux.grid.Panel,{store:"PhoneBook",initComponent:function(){var b=this;b.columns=b.columns||[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("name"),dataIndex:"name",flex:5},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:3,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("status"),dataIndex:"status",renderer:Helper.Util.formatBooleanActive,comboRelated:"booleancombo",flex:3,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")]]}},{header:t("description"),dataIndex:"description",flex:5}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["phonebooklist"],["component","box","container","panel","tablepanel","gridpanel","grid","phonebooklist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,phonebooklist:true},["widget.phonebooklist"],0,[MBilling.view.phoneBook,"List"],0));(Ext.cmd.derive("MBilling.view.phoneBook.Form",Ext.ux.form.Panel,{bodyPadding:0,fieldsHideUpdateLot:["id_user","name"],initComponent:function(){var b=this;b.items=[{xtype:App.user.isClient?"textfield":"userlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"name",fieldLabel:t("name")},{xtype:"booleancombo",name:"status",fieldLabel:t("status"),allowBlank:true},{xtype:"textareafield",name:"description",fieldLabel:t("description"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["phonebookform"],["component","box","container","panel","form","phonebookform"],{component:true,box:true,container:true,panel:true,form:true,phonebookform:true},["widget.phonebookform"],0,[MBilling.view.phoneBook,"Form"],0));(Ext.cmd.derive("MBilling.view.phoneBook.Tag",Ext.form.field.Tag,{name:"id_phonebook",fieldLabel:t("phonebook"),displayField:"name",valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.PhoneBook",{proxy:{type:"uxproxy",module:"phoneBook",limitParam:undefined}});Ext.form.field.Tag.prototype.initComponent.apply(this,arguments)}},0,["phonebooktag"],["component","box","field","textfield","pickerfield","combobox","combo","tagfield","phonebooktag"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,tagfield:true,phonebooktag:true},["widget.phonebooktag"],0,[MBilling.view.phoneBook,"Tag"],0));(Ext.cmd.derive("MBilling.view.call.Controller",Ext.ux.app.ViewController,{onRecordCall:function(m){var j=this,f=j.list.getSelectionModel().getSelection()[0],l=Ext.encode(j.list.filters.getFilterData()),g=[];if(!f&&l.length<5){Ext.ux.Alert.alert(j.titleError,t("Please select one or more register"),"notification")}else{Ext.each(j.list.getSelectionModel().getSelection(),function(a){g.push(a.get(j.idProperty))});if(App.user.isAdmin&&g.length>250){Ext.ux.Alert.alert(j.titleError,t("Your limit to download record is")+" 250","error")}else{if(!App.user.isAdmin&&g.length>25){Ext.ux.Alert.alert(j.titleError,t("Your limit to download record is")+" 25","error")}else{window.open("index.php/call/downloadRecord?ids="+Ext.encode(g)+"&filter="+l)}}}},onDownloadClick:function(d,f,e){window.open("index.php/call/downloadRecord?id="+d.getStore().getAt(f).getData().id)},onShowTotal:function(e){var g=this;var g=this,f=g.list.getStore(),j=g.list.filters.getFilterData().length?Ext.encode(g.list.filters.getFilterData()):f.proxy.extraParams.filter;e.disable();e.setText(t("Wait..."));e.setWidth(120);Ext.Ajax.request({url:"index.php/call/getTotal",params:{filter:j},scope:g,success:function(a){a=Ext.decode(a.responseText);Ext.ux.Alert.alert(g.titleSuccess," "+t("Total")+" "+t("buycost")+": "+App.user.currency+" "+a.sumbuycost+"
"+t("Total")+" "+t("sessionbill")+": "+App.user.currency+" "+a.sumsessionbill+"
"+t("Total")+" "+t("profit")+": "+App.user.currency+" "+a.totalCall+"
","information",true,false);e.enable();e.setText(t("Show Total"))},failure:function(a){e.enable();e.setText(""+t("Failed. Try again...")+"");e.setWidth(300)}})}},0,0,0,0,["controller.call"],0,[MBilling.view.call,"Controller"],0));(Ext.cmd.derive("MBilling.view.call.Module",Ext.ux.panel.Module,{controller:"call"},0,["callmodule"],["component","box","container","uxpanelmodule","callmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callmodule:true},["widget.callmodule"],0,[MBilling.view.call,"Module"],0));(Ext.cmd.derive("MBilling.view.call.List",Ext.ux.grid.Panel,{store:"Call",standardSubmit:true,initComponent:function(){var b=this;b.paginationButton=["-",{xtype:"button",width:"120",text:t("Show Total"),handler:"onShowTotal",hidden:!App.user.isAdmin,cls:"x-btn-text-icon details"},{xtype:"tbtext",reference:"tbTextTotal"}];b.fieldSearch=App.user.isAdmin?"idUser.username":"calledstation",b.extraButtons=[{text:t("Download Rec"),iconCls:"call",handler:"onRecordCall",disabled:false,width:130}];b.buttonUpdateLot=App.user.isAdmin;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{xtype:"actioncolumn",width:26,sortable:false,menuDisabled:true,header:t(""),dataIndex:"id",items:[{iconCls:"icon-play",tooltip:t("Download Rec"),handler:"onDownloadClick"}],hidden:App.user.show_playicon_cdr==0,hideable:true},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"starttime",flex:4},{header:t("Sip Account"),dataIndex:"src",flex:3},{header:t("CallerId"),dataIndex:"callerid",flex:3,hidden:true,hideable:true},{header:t("number"),dataIndex:"calledstation",flex:3},{header:t("destination"),dataIndex:"idPrefixdestination",filter:{type:"string",field:"idPrefix.destination"},flex:4},{header:t("sessiontime"),dataIndex:"sessiontime",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Real")+" "+t("sessiontime"),dataIndex:"real_sessiontime",renderer:Helper.Util.formatsecondsToTime,flex:3,hidden:true,hideable:App.user.isAdmin},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:2,hidden:App.user.isClient,hideable:!App.user.isClient},{xtype:"templatecolumn",tpl:"{idTrunktrunkcode}",header:t("trunk"),dataIndex:"id_trunk",comboFilter:"trunkcombo",header:t("trunk"),flex:3,hidden:App.user.isClient||App.user.isAgent,hideable:!App.user.isClient&&!App.user.isAgent},{header:t("status"),dataIndex:"terminatecauseid",renderer:Helper.Util.formatDialStatus,flex:2,filter:{type:"list",options:[[1,t("answer")]]}},{header:t("type"),dataIndex:"sipiax",renderer:Helper.Util.formatCallType,flex:2,filter:{type:"list",options:[[0,t("standard")],[1,t("sipcall")],[2,t("did")],[3,t("didvoip")],[4,t("callback")],[5,t("callcenter")],[6,"sms"],[7,t("transfer")],[8,t("queue")],[9,t("ivr")]]}},{header:t("buycost"),dataIndex:"buycost",renderer:Helper.Util.formatMoneyDecimal4,flex:3,hidden:App.user.isClient||App.user.isAgent,hideable:!App.user.isClient&&!App.user.isAgent},{header:t("sessionbill"),dataIndex:"sessionbill",renderer:Helper.Util.formatMoneyDecimal4,flex:3,hidden:App.user.isAgent||App.user.isClientAgent,hideable:!App.user.isAgent&&!App.user.isClientAgent},{header:t("buycost"),dataIndex:"sessionbill",renderer:Helper.Util.formatMoneyDecimal4,flex:3,hidden:!App.user.isAgent,hideable:App.user.isAgent},{header:t("sessionbill"),dataIndex:"agent_bill",renderer:Helper.Util.formatMoneyDecimal4,flex:3,hidden:!App.user.isAgent,hideable:App.user.isAgent},{header:t("sessionbill"),dataIndex:"agent_bill",renderer:Helper.Util.formatMoneyDecimal4,flex:3,hidden:!App.user.isClientAgent,hideable:App.user.isClientAgent},{header:t("uniqueid"),dataIndex:"uniqueid",flex:3,hidden:true,hideable:true},{xtype:"templatecolumn",tpl:"{idCampaignname}",header:t("campaign"),dataIndex:"id_campaign",comboFilter:"campaigncombo",flex:3,hidden:true,hideable:!App.user.isClient}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["calllist"],["component","box","container","panel","tablepanel","gridpanel","grid","calllist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,calllist:true},["widget.calllist"],0,[MBilling.view.call,"List"],0));(Ext.cmd.derive("MBilling.view.call.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["calledstation"],initComponent:function(){var b=this;b.items=[{name:"calledstation",fieldLabel:t("number"),readOnly:true},{name:"sessiontime",fieldLabel:t("sessiontime"),readOnly:App.user.isClient||App.user.isAgent,hidden:App.user.isClient||App.user.isAgent},{xtype:"moneyfield",name:"buycost",fieldLabel:t("buycost"),mask:App.user.currency+" #9.999.990,"+App.user.decimalPrecision,hidden:App.user.isClient||App.user.isAgent},{xtype:"moneyfield",name:"sessionbill",fieldLabel:t("sessionbill"),mask:App.user.currency+" #9.999.990,"+App.user.decimalPrecision,readOnly:App.user.isClient||App.user.isAgent,hidden:App.user.isAgent||App.user.isClientAgent},{xtype:"moneyfield",name:"agent_bill",fieldLabel:t("sessionbill"),mask:App.user.currency+" #9.999.990,"+App.user.decimalPrecision,readOnly:App.user.isAgent,hidden:!App.user.isAgent&&!App.user.isClientAgent}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callform"],["component","box","container","panel","form","callform"],{component:true,box:true,container:true,panel:true,form:true,callform:true},["widget.callform"],0,[MBilling.view.call,"Form"],0));(Ext.cmd.derive("MBilling.view.callArchive.Controller",Ext.ux.app.ViewController,{onRecordCall:function(m){var j=this,f=j.list.getSelectionModel().getSelection()[0],l=Ext.encode(j.list.filters.getFilterData()),g=[];if(!f&&l.length<5){Ext.ux.Alert.alert(j.titleError,t("Please select one or more register"),"notification")}else{Ext.each(j.list.getSelectionModel().getSelection(),function(a){g.push(a.get(j.idProperty))});if(App.user.isAdmin&&g.length>250){Ext.ux.Alert.alert(j.titleError,t("Your limit to download record is")+" 250","error")}else{if(!App.user.isAdmin&&g.length>25){Ext.ux.Alert.alert(j.titleError,t("Your limit to download record is")+" 25","error")}else{window.open("index.php/callArchive/downloadRecord?ids="+Ext.encode(g)+"&filter="+l)}}}},onDownloadClick:function(d,f,e){window.open("index.php/callArchive/downloadRecord?id="+d.getStore().getAt(f).getData().id)}},0,0,0,0,["controller.callarchive"],0,[MBilling.view.callArchive,"Controller"],0));(Ext.cmd.derive("MBilling.view.callArchive.Module",Ext.ux.panel.Module,{controller:"callarchive"},0,["callarchivemodule"],["component","box","container","uxpanelmodule","callarchivemodule"],{component:true,box:true,container:true,uxpanelmodule:true,callarchivemodule:true},["widget.callarchivemodule"],0,[MBilling.view.callArchive,"Module"],0));(Ext.cmd.derive("MBilling.view.callArchive.List",Ext.ux.grid.Panel,{store:"CallArchive",standardSubmit:true,initComponent:function(){var b=this;b.buttonUpdateLot=false;b.fieldSearch=App.user.isAdmin?"idUser.username":"calledstation",b.extraButtons=[{text:t("Download Rec"),iconCls:"call",handler:"onRecordCall",disabled:false,width:130}];b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{xtype:"actioncolumn",width:26,sortable:false,menuDisabled:true,header:t(""),dataIndex:"id",items:[{iconCls:"icon-play",tooltip:t("Download Rec"),handler:"onDownloadClick"}],hidden:App.user.show_playicon_cdr==0,hideable:true},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"starttime",flex:4},{header:t("Sip Account"),dataIndex:"src",flex:3},{header:t("CallerId"),dataIndex:"callerid",flex:3,hidden:true,hideable:true},{header:t("number"),dataIndex:"calledstation",flex:3},{header:t("destination"),dataIndex:"idPrefixdestination",filter:{type:"string",field:"idPrefix.destination"},flex:4},{header:t("sessiontime"),dataIndex:"sessiontime",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Real")+" "+t("sessiontime"),dataIndex:"real_sessiontime",renderer:Helper.Util.formatsecondsToTime,flex:3,hidden:true,hideable:App.user.isAdmin},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:2,hidden:App.user.isClient,hideable:!App.user.isClient},{xtype:"templatecolumn",tpl:"{idTrunktrunkcode}",header:t("trunk"),dataIndex:"id_trunk",comboFilter:"trunkcombo",header:t("trunk"),flex:3,hidden:App.user.isClient||App.user.isAgent,hideable:!App.user.isClient&&!App.user.isAgent},{header:t("status"),dataIndex:"terminatecauseid",renderer:Helper.Util.formatDialStatus,flex:2,filter:{type:"list",options:[[1,t("answer")]]}},{header:t("type"),dataIndex:"sipiax",renderer:Helper.Util.formatCallType,flex:2,filter:{type:"list",options:[[0,t("standard")],[1,t("sipcall")],[2,t("did")],[3,t("didvoip")],[4,t("callback")],[5,t("callcenter")],[6,"sms"],[7,t("transfer")],[8,t("queue")],[9,t("ivr")]]}},{header:t("buycost"),dataIndex:"buycost",renderer:Helper.Util.formatMoneyDecimal4,flex:3,hidden:App.user.isClient||App.user.isAgent,hideable:!App.user.isClient&&!App.user.isAgent},{header:t("sessionbill"),dataIndex:"sessionbill",renderer:Helper.Util.formatMoneyDecimal4,flex:3,hidden:App.user.isAgent||App.user.isClientAgent,hideable:!App.user.isAgent&&!App.user.isClientAgent},{header:t("buycost"),dataIndex:"sessionbill",renderer:Helper.Util.formatMoneyDecimal4,flex:3,hidden:!App.user.isAgent,hideable:App.user.isAgent},{header:t("sessionbill"),dataIndex:"agent_bill",renderer:Helper.Util.formatMoneyDecimal4,flex:3,hidden:!App.user.isAgent,hideable:App.user.isAgent},{header:t("sessionbill"),dataIndex:"agent_bill",renderer:Helper.Util.formatMoneyDecimal4,flex:3,hidden:!App.user.isClientAgent,hideable:App.user.isClientAgent},{header:t("uniqueid"),dataIndex:"uniqueid",flex:3,hidden:true,hideable:true}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callarchivelist"],["component","box","container","panel","tablepanel","gridpanel","grid","callarchivelist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callarchivelist:true},["widget.callarchivelist"],0,[MBilling.view.callArchive,"List"],0));(Ext.cmd.derive("MBilling.view.callArchive.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["calledstation"],initComponent:function(){var b=this;b.items=[{name:"calledstation",fieldLabel:t("number"),readOnly:true},{name:"sessiontime",fieldLabel:t("sessiontime"),readOnly:App.user.isClient||App.user.isAgent,hidden:App.user.isClient||App.user.isAgent},{xtype:"moneyfield",name:"buycost",fieldLabel:t("buycost"),mask:App.user.currency+" #9.999.990,"+App.user.decimalPrecision,hidden:App.user.isClient||App.user.isAgent},{xtype:"moneyfield",name:"sessionbill",fieldLabel:t("sessionbill"),mask:App.user.currency+" #9.999.990,"+App.user.decimalPrecision,readOnly:App.user.isClient||App.user.isAgent,hidden:App.user.isAgent||App.user.isClientAgent},{xtype:"moneyfield",name:"agent_bill",fieldLabel:t("sessionbill"),mask:App.user.currency+" #9.999.990,"+App.user.decimalPrecision,readOnly:App.user.isAgent,hidden:!App.user.isAgent&&!App.user.isClientAgent}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callarchiveform"],["component","box","container","panel","form","callarchiveform"],{component:true,box:true,container:true,panel:true,form:true,callarchiveform:true},["widget.callarchiveform"],0,[MBilling.view.callArchive,"Form"],0));(Ext.cmd.derive("MBilling.view.callFailed.Controller",Ext.ux.app.ViewController,{formHidden:true},0,0,0,0,["controller.callfailed"],0,[MBilling.view.callFailed,"Controller"],0));(Ext.cmd.derive("MBilling.view.callFailed.Module",Ext.ux.panel.Module,{controller:"callfailed"},0,["callfailedmodule"],["component","box","container","uxpanelmodule","callfailedmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callfailedmodule:true},["widget.callfailedmodule"],0,[MBilling.view.callFailed,"Module"],0));(Ext.cmd.derive("MBilling.view.callFailed.List",Ext.ux.grid.Panel,{store:"CallFailed",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.allowCreate=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"starttime",flex:4},{header:t("Sip Account"),dataIndex:"src",flex:3},{header:t("CallerId"),dataIndex:"callerid",flex:3,hidden:true,hideable:true},{header:t("number"),dataIndex:"calledstation",flex:3},{header:t("destination"),dataIndex:"idPrefixdestination",flex:4},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:2,hidden:App.user.isClient,hideable:!App.user.isClient},{xtype:"templatecolumn",tpl:"{idTrunktrunkcode}",header:t("trunk"),dataIndex:"id_trunk",comboFilter:"trunkcombo",header:t("trunk"),flex:4,hidden:App.user.isClient||App.user.isAgent,hideable:!App.user.isClient&&!App.user.isAgent},{header:t("status"),dataIndex:"terminatecauseid",renderer:Helper.Util.formatDialStatus,flex:2,filter:{type:"list",options:[[1,t("answer")],[2,t("busy")],[3,t("no")+" "+t("answer")],[4,t("cancelcall")],[5,"congestion"],[6,"chanunavail"],[7,"dontcall"],[8,"torture"],[9,"invalidargs"]]}},{header:t("HangupCause"),dataIndex:"hangupcause",hidden:!window.dialC,flex:2},{header:t("type"),dataIndex:"sipiax",renderer:Helper.Util.formatCallType,flex:2,filter:{type:"list",options:[[0,t("standard")],[1,t("sipcall")],[2,t("did")],[3,t("didvoip")],[4,t("callback")],[5,t("callcenter")],[6,"sms"],[7,t("transfer")]]}},{header:t("uniqueid"),dataIndex:"uniqueid",flex:3,hidden:true,hideable:true}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callfailedlist"],["component","box","container","panel","tablepanel","gridpanel","grid","callfailedlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callfailedlist:true},["widget.callfailedlist"],0,[MBilling.view.callFailed,"List"],0));(Ext.cmd.derive("MBilling.view.callFailed.Form",Ext.ux.form.Panel,{},0,["callfailedform"],["component","box","container","panel","form","callfailedform"],{component:true,box:true,container:true,panel:true,form:true,callfailedform:true},["widget.callfailedform"],0,[MBilling.view.callFailed,"Form"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerDay.Controller",Ext.ux.app.ViewController,{onEdit:function(){me=this;me.sumData=me.store.getData().items[0].getData();if(!me.sumData){return}me.formPanel.getForm().getFields().each(function(b){b.setValue(me.sumData[b.name])});me.formPanel.expand()}},0,0,0,0,["controller.callsummaryperday"],0,[MBilling.view.callSummaryPerDay,"Controller"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerDay.Module",Ext.ux.panel.Module,{controller:"callsummaryperday",titleDetails:t("total"),iconForm:"icon-sum",cfgEast:{flex:0.4}},0,["callsummaryperdaymodule"],["component","box","container","uxpanelmodule","callsummaryperdaymodule"],{component:true,box:true,container:true,uxpanelmodule:true,callsummaryperdaymodule:true},["widget.callsummaryperdaymodule"],0,[MBilling.view.callSummaryPerDay,"Module"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerDay.List",Ext.ux.grid.Panel,{store:"CallSummaryPerDay",initComponent:function(){var b=this;b.buttonImportCsv=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{header:t("day"),renderer:Ext.util.Format.dateRenderer("Y-m-d"),dataIndex:"day",filter:{type:"date",field:"day"},flex:3},{header:t("sessiontime")+" "+t("Min"),dataIndex:"sessiontime",flex:2},{header:t("aloc_all_calls"),dataIndex:"aloc_all_calls",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Answered Calls"),dataIndex:"nbcall",flex:3},{header:t("Failed Calls"),dataIndex:"nbcall_fail",flex:3},{header:t("buycost"),dataIndex:"buycost",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("sessionbill"),dataIndex:"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("markup"),dataIndex:"lucro",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("ASR"),dataIndex:"asr",renderer:Helper.Util.formatPorcente,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummaryperdaylist"],["component","box","container","panel","tablepanel","gridpanel","grid","callsummaryperdaylist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callsummaryperdaylist:true},["widget.callsummaryperdaylist"],0,[MBilling.view.callSummaryPerDay,"List"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerDay.Form",Ext.ux.form.Panel,{defaults:{},labelWidthFields:100,defaultType:"displayfield",initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{name:"sumsessiontime",fieldLabel:t("sessiontime")+" "+t("Min"),renderer:Ext.util.Format.numberRenderer("0"),allowBlank:true},{name:"sumsessionbill",fieldLabel:t("sessionbill"),renderer:Helper.Util.formatMoneyDecimal,allowBlank:true},{name:"sumbuycost",fieldLabel:t("buycost"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumlucro",fieldLabel:t("markup"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumnbcall",fieldLabel:t("Answered Calls"),allowBlank:true},{name:"sumnbcallfail",fieldLabel:t("Failed Calls"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummaryperdayform"],["component","box","container","panel","form","callsummaryperdayform"],{component:true,box:true,container:true,panel:true,form:true,callsummaryperdayform:true},["widget.callsummaryperdayform"],0,[MBilling.view.callSummaryPerDay,"Form"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerMonth.Controller",Ext.ux.app.ViewController,{onEdit:function(){me=this;me.sumData=me.store.getData().items[0].getData();if(!me.sumData){return}me.formPanel.getForm().getFields().each(function(b){b.setValue(me.sumData[b.name])});me.formPanel.expand()}},0,0,0,0,["controller.callsummarypermonth"],0,[MBilling.view.callSummaryPerMonth,"Controller"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerMonth.Module",Ext.ux.panel.Module,{controller:"callsummarypermonth",titleDetails:t("total"),iconForm:"icon-sum",cfgEast:{flex:0.4}},0,["callsummarypermonthmodule"],["component","box","container","uxpanelmodule","callsummarypermonthmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callsummarypermonthmodule:true},["widget.callsummarypermonthmodule"],0,[MBilling.view.callSummaryPerMonth,"Module"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerMonth.List",Ext.ux.grid.Panel,{store:"CallSummaryPerMonth",initComponent:function(){var b=this;b.buttonImportCsv=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{header:t("month"),dataIndex:"month",filter:{type:"date",field:"month",dateFormat:"Ym"},flex:3},{header:t("sessiontime")+" "+t("Min"),dataIndex:"sessiontime",flex:2},{header:t("aloc_all_calls"),dataIndex:"aloc_all_calls",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("nbcall"),dataIndex:"nbcall",flex:3},{header:t("buycost"),dataIndex:"buycost",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("sessionbill"),dataIndex:"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("markup"),dataIndex:"lucro",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarypermonthlist"],["component","box","container","panel","tablepanel","gridpanel","grid","callsummarypermonthlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callsummarypermonthlist:true},["widget.callsummarypermonthlist"],0,[MBilling.view.callSummaryPerMonth,"List"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerMonth.Form",Ext.ux.form.Panel,{defaults:{},labelWidthFields:100,defaultType:"displayfield",initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{name:"sumsessiontime",fieldLabel:t("sessiontime")+" "+t("Min"),renderer:Ext.util.Format.numberRenderer("0"),allowBlank:true},{name:"sumsessionbill",fieldLabel:t("sessionbill"),renderer:Helper.Util.formatMoneyDecimal,allowBlank:true},{name:"sumbuycost",fieldLabel:t("buycost"),renderer:Helper.Util.formatMoneyDecimal,hidden:App.user.isClient,allowBlank:true},{name:"sumlucro",fieldLabel:t("markup"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumnbcall",fieldLabel:t("nbcall"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarypermonthform"],["component","box","container","panel","form","callsummarypermonthform"],{component:true,box:true,container:true,panel:true,form:true,callsummarypermonthform:true},["widget.callsummarypermonthform"],0,[MBilling.view.callSummaryPerMonth,"Form"],0));(Ext.cmd.derive("MBilling.view.callSummaryMonthUser.Controller",Ext.ux.app.ViewController,{onEdit:function(){me=this;me.sumData=me.store.getData().items[0].getData();if(!me.sumData){return}me.formPanel.getForm().getFields().each(function(b){b.setValue(me.sumData[b.name])});me.formPanel.expand()}},0,0,0,0,["controller.callsummarymonthuser"],0,[MBilling.view.callSummaryMonthUser,"Controller"],0));(Ext.cmd.derive("MBilling.view.callSummaryMonthUser.Module",Ext.ux.panel.Module,{controller:"callsummarymonthuser",titleDetails:t("total"),iconForm:"icon-sum",cfgEast:{flex:0.4}},0,["callsummarymonthusermodule"],["component","box","container","uxpanelmodule","callsummarymonthusermodule"],{component:true,box:true,container:true,uxpanelmodule:true,callsummarymonthusermodule:true},["widget.callsummarymonthusermodule"],0,[MBilling.view.callSummaryMonthUser,"Module"],0));(Ext.cmd.derive("MBilling.view.callSummaryMonthUser.List",Ext.ux.grid.Panel,{store:"CallSummaryMonthUser",initComponent:function(){var b=this;b.buttonImportCsv=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{header:t("Month"),renderer:Ext.util.Format.dateRenderer("Y-m"),dataIndex:"month",filter:{type:"date",field:"month",dateFormat:"Ym"},flex:3},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("sessiontime")+" "+t("Min"),dataIndex:"sessiontime",flex:2},{header:t("aloc_all_calls"),dataIndex:"aloc_all_calls",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Answered Calls"),dataIndex:"nbcall",flex:3},{header:t("buycost"),dataIndex:App.user.isAdmin?"buycost":"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("sessionbill"),dataIndex:App.user.isAgent||App.user.isClientAgent?"agent_bill":"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("markup"),dataIndex:"lucro",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarymonthuserlist"],["component","box","container","panel","tablepanel","gridpanel","grid","callsummarymonthuserlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callsummarymonthuserlist:true},["widget.callsummarymonthuserlist"],0,[MBilling.view.callSummaryMonthUser,"List"],0));(Ext.cmd.derive("MBilling.view.callSummaryMonthUser.Form",Ext.ux.form.Panel,{defaults:{},labelWidthFields:100,defaultType:"displayfield",initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{name:"sumsessiontime",fieldLabel:t("sessiontime")+" "+t("Min"),renderer:Ext.util.Format.numberRenderer("0"),allowBlank:true},{name:App.user.isAgent||App.user.isClientAgent?"sumagent_bill":"sumsessionbill",fieldLabel:t("sessionbill"),renderer:Helper.Util.formatMoneyDecimal,allowBlank:true},{name:App.user.isAdmin?"sumbuycost":"sumsessionbill",fieldLabel:t("buycost"),renderer:Helper.Util.formatMoneyDecimal,hidden:App.user.isClient,allowBlank:true},{name:"sumlucro",fieldLabel:t("markup"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmint,allowBlank:true},{name:"sumnbcall",fieldLabel:t("nbcall"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarymonthuserform"],["component","box","container","panel","form","callsummarymonthuserform"],{component:true,box:true,container:true,panel:true,form:true,callsummarymonthuserform:true},["widget.callsummarymonthuserform"],0,[MBilling.view.callSummaryMonthUser,"Form"],0));(Ext.cmd.derive("MBilling.view.callSummaryMonthTrunk.Controller",Ext.ux.app.ViewController,{onEdit:function(){me=this;me.sumData=me.store.getData().items[0].getData();if(!me.sumData){return}me.formPanel.getForm().getFields().each(function(b){b.setValue(me.sumData[b.name])});me.formPanel.expand()}},0,0,0,0,["controller.callsummarymonthtrunk"],0,[MBilling.view.callSummaryMonthTrunk,"Controller"],0));(Ext.cmd.derive("MBilling.view.callSummaryMonthTrunk.Module",Ext.ux.panel.Module,{controller:"callsummarymonthtrunk",titleDetails:t("total"),iconForm:"icon-sum",cfgEast:{flex:0.4}},0,["callsummarymonthtrunkmodule"],["component","box","container","uxpanelmodule","callsummarymonthtrunkmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callsummarymonthtrunkmodule:true},["widget.callsummarymonthtrunkmodule"],0,[MBilling.view.callSummaryMonthTrunk,"Module"],0));(Ext.cmd.derive("MBilling.view.callSummaryMonthTrunk.List",Ext.ux.grid.Panel,{store:"CallSummaryMonthTrunk",initComponent:function(){var b=this;b.buttonImportCsv=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{header:t("Month"),renderer:Ext.util.Format.dateRenderer("Y-m"),dataIndex:"month",filter:{type:"date",field:"month",dateFormat:"Ym"},flex:3},{header:t("Trunk"),dataIndex:"idTrunktrunkcode",filter:{type:"string",field:"idTrunk.trunkcode"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("sessiontime")+" "+t("Min"),dataIndex:"sessiontime",flex:2},{header:t("aloc_all_calls"),dataIndex:"aloc_all_calls",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Answered Calls"),dataIndex:"nbcall",flex:3},{header:t("buycost"),dataIndex:"buycost",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("sessionbill"),dataIndex:"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("markup"),dataIndex:"lucro",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarymonthtrunklist"],["component","box","container","panel","tablepanel","gridpanel","grid","callsummarymonthtrunklist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callsummarymonthtrunklist:true},["widget.callsummarymonthtrunklist"],0,[MBilling.view.callSummaryMonthTrunk,"List"],0));(Ext.cmd.derive("MBilling.view.callSummaryMonthTrunk.Form",Ext.ux.form.Panel,{defaults:{},labelWidthFields:100,defaultType:"displayfield",initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{name:"sumsessiontime",fieldLabel:t("sessiontime")+" "+t("Min"),renderer:Ext.util.Format.numberRenderer("0"),allowBlank:true},{name:"sumsessionbill",fieldLabel:t("sessionbill"),renderer:Helper.Util.formatMoneyDecimal,allowBlank:true},{name:"sumbuycost",fieldLabel:t("buycost"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumlucro",fieldLabel:t("markup"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumnbcall",fieldLabel:t("nbcall"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarymonthtrunkform"],["component","box","container","panel","form","callsummarymonthtrunkform"],{component:true,box:true,container:true,panel:true,form:true,callsummarymonthtrunkform:true},["widget.callsummarymonthtrunkform"],0,[MBilling.view.callSummaryMonthTrunk,"Form"],0));(Ext.cmd.derive("MBilling.view.sms.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.sms"],0,[MBilling.view.sms,"Controller"],0));(Ext.cmd.derive("MBilling.view.sms.Module",Ext.ux.panel.Module,{controller:"sms"},0,["smsmodule"],["component","box","container","uxpanelmodule","smsmodule"],{component:true,box:true,container:true,uxpanelmodule:true,smsmodule:true},["widget.smsmodule"],0,[MBilling.view.sms,"Module"],0));(Ext.cmd.derive("MBilling.view.sms.List",Ext.ux.grid.Panel,{store:"Sms",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.allowUpdate=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("send"),dataIndex:"result",renderer:Helper.Util.formatBooleanSms,comboRelated:"statuscombo",flex:2,filter:{type:"list",options:[[0,t("error")],[1,t("sent")],[2,t("received")]]}},{header:t("destination"),dataIndex:"telephone",flex:2},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"date",flex:5},{header:t("description"),dataIndex:"sms",hidden:true,hideable:true,flex:6}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["smslist"],["component","box","container","panel","tablepanel","gridpanel","grid","smslist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,smslist:true},["widget.smslist"],0,[MBilling.view.sms,"List"],0));(Ext.cmd.derive("MBilling.view.sms.Form",Ext.ux.form.Panel,{fieldsHide:["id_user"],initComponent:function(){var b=this;b.items=[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:App.user.isClient},{xtype:"numberfield",name:"telephone",fieldLabel:t("number"),emptyText:"DDI DDD Nº",maxLength:16,minLength:11},{xtype:"textareafield",name:"sms",fieldLabel:t("sms"),maxLength:160}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["smsform"],["component","box","container","panel","form","smsform"],{component:true,box:true,container:true,panel:true,form:true,smsform:true},["widget.smsform"],0,[MBilling.view.sms,"Form"],0));(Ext.cmd.derive("MBilling.view.campaignPollInfo.Controller",Ext.ux.app.ViewController,{aliasChart:"campaignpollinfochart",onRenderModule:function(){var c=this,d=c.lookupReference("chart");Ext.ux.app.ViewController.prototype.onRenderModule.apply(this,arguments);c.store.on({scope:c,beforeload:function(){d.disable()},load:function(a){d.enable()}})},onChart:function(){var l=this,f=l.list.getStore(),m=l.list.filters.getFilterData(),j=false,g=false;if(!m){Ext.ux.Alert.alert("Alert",t("Use filters"),"information");return}Ext.each(m,function(a){if(a.field=="id_campaign_poll"){if(a.data.value.length==1){g=true}j=true;return}});if(!j){Ext.ux.Alert.alert("Alert",t("Select one or more poll to create a chart"),"information");return}l.chart=Ext.widget("window",{title:t("charts"),iconCls:"icon-chart-column",layout:"fit",autoShow:true,modal:true,resizable:false,width:window.isThemeNeptune?740:710,items:{xtype:l.aliasChart,titleText:g?f.getData().items[0].data.idCampaignPollname:"",list:l.list}})}},0,0,0,0,["controller.campaignpollinfo"],0,[MBilling.view.campaignPollInfo,"Controller"],0));(Ext.cmd.derive("MBilling.view.campaignPollInfo.Module",Ext.ux.panel.Module,{controller:"campaignpollinfo"},0,["campaignpollinfomodule"],["component","box","container","uxpanelmodule","campaignpollinfomodule"],{component:true,box:true,container:true,uxpanelmodule:true,campaignpollinfomodule:true},["widget.campaignpollinfomodule"],0,[MBilling.view.campaignPollInfo,"Module"],0));(Ext.cmd.derive("MBilling.view.campaignPollInfo.List",Ext.ux.grid.Panel,{store:"CampaignPollInfo",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.allowCreate=false;b.extraButtons=[{text:t("charts"),iconCls:"icon-chart-column",handler:"onChart",reference:"chart",disabled:true}];b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("number"),dataIndex:"number",flex:4},{xtype:"templatecolumn",tpl:"{idCampaignPollname}",header:t("poll"),dataIndex:"id_campaign_poll",comboFilter:"campaignpollcombo",flex:4},{header:t("result"),dataIndex:"resposta",flex:4},{header:t("description"),dataIndex:"obs",flex:4},{header:t("City"),dataIndex:"city",flex:4},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"date",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignpollinfolist"],["component","box","container","panel","tablepanel","gridpanel","grid","campaignpollinfolist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,campaignpollinfolist:true},["widget.campaignpollinfolist"],0,[MBilling.view.campaignPollInfo,"List"],0));(Ext.cmd.derive("MBilling.view.campaignPollInfo.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{name:"number",fieldLabel:t("number"),readOnly:true},{name:"resposta",fieldLabel:t("result"),readOnly:true},{xtype:"textareafield",name:"obs",fieldLabel:t("description"),allowBlank:true,maxLength:200}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignpollinfoform"],["component","box","container","panel","form","campaignpollinfoform"],{component:true,box:true,container:true,panel:true,form:true,campaignpollinfoform:true},["widget.campaignpollinfoform"],0,[MBilling.view.campaignPollInfo,"Form"],0));(Ext.cmd.derive("MBilling.view.campaignPollInfo.Chart",Ext.ux.panel.Chart,{controller:"campaignpollinfo",store:"CampaignPollInfoChart",fieldValue:"sumresposta",fieldDescription:"resposta2",labelYLine:t("countvotes"),labelXLine:t("result"),fieldLabel:"percentage",initComponent:function(){var d=this,c;if(window.newChartCampaignInfo){d.fieldDescription="resposta_name"}d.bbarChart=[{xtype:"tbtext",itemId:"tbTextSum",reference:"tbTextSum"}];d.store=Ext.data.StoreManager.lookup(d.store);d.store.setRemoteFilter(true);filters=d.list.filters.getFilterData();d.store.filter("filter",Ext.encode(filters));d.store.load({scope:d,callback:function(){if(d.store.getData().items[0]){d.sumData=d.store.getData().items[0].getData()}if(window.newChartCampaignInfo){d.lookupReference("tbTextSum").setText(d.sumData.total_votos)}}});Ext.ux.panel.Chart.prototype.initComponent.apply(this,arguments)}},0,["campaignpollinfochart"],["component","box","container","panel","chartpanel","campaignpollinfochart"],{component:true,box:true,container:true,panel:true,chartpanel:true,campaignpollinfochart:true},["widget.campaignpollinfochart"],0,[MBilling.view.campaignPollInfo,"Chart"],0));(Ext.cmd.derive("MBilling.view.campaignRestrictPhone.Controller",Ext.ux.app.ViewController,{onEdit:function(){var b=this;Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)},deleteDuplicados:function(e){var g=this,f=g.list.getStore(),j=g.list.filters.getFilterData().length?Ext.encode(g.getList().filters.getFilterData()):f.proxy.extraParams.filter;e.disable();g.list.setLoading(true);Ext.Msg.confirm("Confirm","Confirme que quer deletar os numeros duplicados?",function(a){if(a==="yes"){Ext.Ajax.request({url:"index.php/campaignRestrictPhone/deleteDuplicados/",params:{filter:j},scope:g,success:function(c){c=Ext.decode(c.responseText);if(c[g.nameSuccessRequest]){Ext.ux.Alert.alert(g.titleSuccess,c[g.nameMsgRequest],"success")}else{var b=Helper.Util.convertErrorsJsonToString(c[g.nameMsgRequest]);Ext.ux.Alert.alert(g.titleError,b,"error")}g.list.setLoading(false);e.enable()}})}})}},0,0,0,0,["controller.campaignrestrictphone"],0,[MBilling.view.campaignRestrictPhone,"Controller"],0));(Ext.cmd.derive("MBilling.view.campaignRestrictPhone.Module",Ext.ux.panel.Module,{controller:"campaignrestrictphone"},0,["campaignrestrictphonemodule"],["component","box","container","uxpanelmodule","campaignrestrictphonemodule"],{component:true,box:true,container:true,uxpanelmodule:true,campaignrestrictphonemodule:true},["widget.campaignrestrictphonemodule"],0,[MBilling.view.campaignRestrictPhone,"Module"],0));(Ext.cmd.derive("MBilling.view.campaignRestrictPhone.List",Ext.ux.grid.Panel,{store:"CampaignRestrictPhone",buttonImportCsv:true,initComponent:function(){var b=this;b.extraButtons=[{text:t("Eliminar Duplicados"),iconCls:"callshop",handler:"deleteDuplicados",disabled:false}];b.buttonUpdateLot=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("number"),dataIndex:"number",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignrestrictphonelist"],["component","box","container","panel","tablepanel","gridpanel","grid","campaignrestrictphonelist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,campaignrestrictphonelist:true},["widget.campaignrestrictphonelist"],0,[MBilling.view.campaignRestrictPhone,"List"],0));(Ext.cmd.derive("MBilling.view.campaignRestrictPhone.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{name:"number",fieldLabel:t("number")}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignrestrictphoneform"],["component","box","container","panel","form","campaignrestrictphoneform"],{component:true,box:true,container:true,panel:true,form:true,campaignrestrictphoneform:true},["widget.campaignrestrictphoneform"],0,[MBilling.view.campaignRestrictPhone,"Form"],0));(Ext.cmd.derive("MBilling.view.campaignRestrictPhone.ImportCsv",Ext.ux.window.ImportCsv,{htmlTipInfo:"
number
551135672677
551156332233
554153882200
"},0,["campaignrestrictphoneimportcsv"],["component","box","container","panel","window","campaignrestrictphoneimportcsv"],{component:true,box:true,container:true,panel:true,window:true,campaignrestrictphoneimportcsv:true},["widget.campaignrestrictphoneimportcsv"],0,[MBilling.view.campaignRestrictPhone,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.campaignLog.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.campaignlog"],0,[MBilling.view.campaignLog,"Controller"],0));(Ext.cmd.derive("MBilling.view.campaignLog.Module",Ext.ux.panel.Module,{controller:"campaignlog"},0,["campaignlogmodule"],["component","box","container","uxpanelmodule","campaignlogmodule"],{component:true,box:true,container:true,uxpanelmodule:true,campaignlogmodule:true},["widget.campaignlogmodule"],0,[MBilling.view.campaignLog,"Module"],0));(Ext.cmd.derive("MBilling.view.campaignLog.List",Ext.ux.grid.Panel,{store:"CampaignLog",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.buttonNew=false;b.allowUpdate=false;b.allowDelete=!App.user.isClient;b.columns=[{header:t("Total gerado"),dataIndex:"total",flex:4},{header:t("Loops"),dataIndex:"loops",flex:4},{header:t("Total por tronco"),dataIndex:"trunks",flex:4},{header:t("Campanhas"),dataIndex:"campaigns",flex:4},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"date",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignloglist"],["component","box","container","panel","tablepanel","gridpanel","grid","campaignloglist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,campaignloglist:true},["widget.campaignloglist"],0,[MBilling.view.campaignLog,"List"],0));(Ext.cmd.derive("MBilling.view.campaignLog.Form",Ext.ux.form.Panel,{bodyPadding:0,initComponent:function(){var b=this;b.items=[{name:"total",fieldLabel:t("total")}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignlogform"],["component","box","container","panel","form","campaignlogform"],{component:true,box:true,container:true,panel:true,form:true,campaignlogform:true},["widget.campaignlogform"],0,[MBilling.view.campaignLog,"Form"],0));(Ext.cmd.derive("MBilling.view.campaignSend.Module",Ext.form.Panel,{controller:"campaignsend",resizable:false,autoShow:true,header:false,initComponent:function(){var b=this;b.items=[{reference:"campaignSendPanel",xtype:"form",margin:"10 10 10 10",autoShow:true,closable:false,resizable:false,bodyPadding:10,defaultType:"textfield",defaults:{labelAlign:"right",labelWidth:150,width:280,allowBlank:false,msgTarget:"side",enableKeyEvents:true,plugins:"markallowblank",anchor:"100%"},items:[{xtype:"campaignsendcombo",name:"type",fieldLabel:t("campaign")+" "+t("type")},{name:"sms_text",fieldLabel:"SMS "+t("Text"),xtype:"textarea",height:100,anchor:"100%",allowBlank:true,hidden:true,maxLength:159},{xtype:"filefield",emptyText:"Select an audio file",fieldLabel:t("Audio file"),name:"audio_path",buttonText:"",buttonConfig:{iconCls:"upload-icon"},buttonText:t("Select Audio..."),allowBlank:true,hidden:true},{xtype:"filefield",emptyText:"Select an csv file",fieldLabel:t("CSV file"),name:"csv_path",allowBlank:true,hidden:true},{name:"numbers",fieldLabel:t("numbers"),xtype:"textarea",height:100,anchor:"100%",allowBlank:true,hidden:true},{xtype:"datefield",name:"startingdate",fieldLabel:t("Date"),format:"Y-m-d",value:new Date(),allowBlank:true,hidden:true},{xtype:"timefield",name:"startingtime",fieldLabel:t("Hour"),format:"H:i",value:"00:00",allowBlank:true,hidden:true}],bbar:[{width:"150px",text:t("Send"),tooltip:t("Send"),glyph:icons.disk,handler:"onSendCampaign"}]}];Ext.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignsendmodule"],["component","box","container","panel","form","campaignsendmodule"],{component:true,box:true,container:true,panel:true,form:true,campaignsendmodule:true},["widget.campaignsendmodule"],0,[MBilling.view.campaignSend,"Module"],0));(Ext.cmd.derive("MBilling.view.callShop.Controller",Ext.ux.app.ViewController,{sendActionNew:function(d){var c=this;d.disable();id=d.reference.split("_");getForm=c.lookupReference("cabina"+id[1]).getForm();Ext.Ajax.request({url:d.urlAction+"?id="+getForm.findField("id").getValue(),success:function(a){a=Ext.decode(a.responseText);if(a.success){Ext.ux.Alert.alert(c.titleSuccess,a[c.nameMsgRequest],"success")}else{Ext.ux.Alert.alert(c.titleError,errors,"error")}}});d.enable();storeCallShop=Ext.create("MBilling.store.CallShop",{remoteSort:false});storeCallShop.load({callback:function(a){c.onShowCabins(a,id[1],getForm)}})},onShowCabins:function(e,f,d){me=this;row=e[f-1];if(tab=me.lookupReference("tab"+f)){name=row.data.callerid.length<1?row.data.name:row.data.callerid;status=Helper.Util.formatBooleanFree(row.data.status);tab.setTitle(t("Cabina")+" "+f+" - "+name+" "+status);tab.setVisible(true);d.loadRecord(row)}},reportCallshopClientNew:function(d){var c=this;id=d.reference.split("_");getForm=c.lookupReference("cabina"+id[1]).getForm();columns=Ext.encode([{header:t("Number"),dataIndex:"calledstation"},{header:t("Time"),dataIndex:"sessiontime"},{header:t("Total"),dataIndex:"price"}]);filter=Ext.encode([{type:"string",comparison:"eq",value:getForm.findField("name").getValue(),field:"cabina"},{type:"list",value:[0],field:"status"}]);values="columns="+columns+"&filter="+filter+"&sort=[]&group=&orientation=P";url="index.php/callShopCdr/report/?"+values;window.open(url)},sendAction:function(f){var j=this,e=j.list.getSelectionModel().getSelection()[0],g=Ext.encode([{type:"string",comparison:"eq",value:e.get("name"),field:"cabina"},{type:"list",value:[0],field:"status"}]);j.formPanel.setLoading(true);Ext.Ajax.request({url:f.urlAction,params:{filter:g},success:function(b){b=Ext.decode(b.responseText);var a=Helper.Util.convertErrorsJsonToString(b[j.nameMsgRequest]),d=j.list.getStore(),c=j.list.getSelectionModel();if(b.success){j.onEdit();d.load({callback:function(){c.select(d.findExact("id",e.get("id")));j.formPanel.setLoading(false)}});Ext.ux.Alert.alert(j.titleSuccess,b[j.nameMsgRequest],"success")}else{Ext.ux.Alert.alert(j.titleError,a,"error");j.formPanel.setLoading(false);c.select(d.findExact("id",e.get("id")))}}})},onEdit:function(){if(!this.list.getSelectionModel().getSelection().length){return}var q=this,r=q.list.getSelectionModel().getSelection()[0],n=[{type:"string",comparison:"eq",value:r.get("name"),field:"cabina"},{type:"list",value:[0],field:"status"}],u=q.formPanel.down("callshopcdrlist").getStore(),v=q.formPanel.down("#priceSum"),m=u.proxy.extraParams.filter,p=q.formPanel.down("#charge"),s=q.formPanel.down("#release"),o=q.formPanel.down("#print");v.setText(" "+t("pricesum")+" 0.00");q.formPanel.expand();p.enable();s.enable();o.enable();u.proxy.extraParams.filter=n;u.load({callback:function(a){if(a){a[0]&&v.setText(" "+t("pricesum")+" "+t("moedasimblo")+" "+a[0].get("priceSum")+" ")}}});console.log(r.get("callerid")+", "+r.get("name"));u.defaultFilter=m;q.showHideFields();q.focusFirstField()},reportCallshopClient:function(E){var w=this,s=window.isDesktop&&App.desktop,y=!window.isDesktop&&w.list.module.ownerCt,v=w.formPanel.down("callshopcdrlist").getStore(),x=v.sorters.items,A=w.list.getSelectionModel().getSelection()[0],F=Ext.encode([{type:"string",comparison:"eq",value:A.get("name"),field:"cabina"},{type:"list",value:[0],field:"status"}]),u=w.store.getGroupField(),B=w.formPanel.down("callshopcdrlist").columns,G="desc",D=w.formPanel.down("callshopcdrlist").getStore().getProxy().api.report,H,z=[],C=[];Ext.each(x,function(a){z.push(a.property+" "+(a.direction||"ASC"))});Ext.each(B,function(a){if(a.hidden===false&&a.isCheckerHd!==true){if(a.dataIndex===u){C.splice(0,0,{header:a.text,dataIndex:a.dataIndex})}else{C.push({header:a.text,dataIndex:a.dataIndex})}}});values="columns="+Ext.encode(C)+"&filter="+F+"&sort="+Ext.encode(z)+"&group="+u+"&orientation="+G;url="index.php/callShopCdr/report/?"+values;window.open(url)}},0,0,0,0,["controller.callshop"],0,[MBilling.view.callShop,"Controller"],0));(Ext.cmd.derive("MBilling.view.callShop.Module",Ext.ux.panel.Module,{controller:"callshop",cfgEast:{flex:4},collapsedForm:false,collapsibleForm:false},0,["callshopmodule"],["component","box","container","uxpanelmodule","callshopmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callshopmodule:true},["widget.callshopmodule"],0,[MBilling.view.callShop,"Module"],0));(Ext.cmd.derive("MBilling.view.callShop.Module2",Ext.form.Panel,{controller:"callshop",resizable:false,autoShow:true,header:false,autoScroll:true,initComponent:function(){var b=this;b.layout={type:"table",columns:3,tdAttrs:{style:"padding: 3px; vertical-align: top;"}};b.defaults={xtype:"panel",height:268,width:((Ext.Element.getViewportWidth()-200)/3)-10,closable:false,collapsible:true,frame:true};b.items=b.onMountPanels();storeCallShop=Ext.create("MBilling.store.CallShop",{remoteSort:false});if(!App.user.isClient){Ext.form.Panel.prototype.initComponent.apply(this,arguments);return}else{b.handler=setInterval(function(){storeCallShop.load({callback:function(a){b.onShowCabins(a)}})},5000);Ext.form.Panel.prototype.initComponent.apply(this,arguments);storeCallShop.load({callback:function(a){b.onShowCabins(a)}})}},onMountPanels:function(){me=this,items=[];if(!App.user.isClient){return}for(i=1;i<=12;i++){items.push({xtype:"tabpanel",reference:"tab"+i,title:t("Cabina")+i,collapsed:i>3,items:[{reference:"cabina"+i,title:t("Cabina"),xtype:"form",bodyPadding:10,defaults:{xtype:"displayfield",labelWidth:85},items:[{name:"id",hidden:true},{name:"name",hidden:true},{xtype:"fieldcontainer",layout:"hbox",items:[{xtype:"displayfield",fieldLabel:t("Number"),name:"callshopnumber",labelAlign:"right",labelWidth:50,renderer:function(b){return''+b+""},flex:2},{labelAlign:"right",labelWidth:90,xtype:"displayfield",readOnly:true,fieldLabel:t("total"),name:"total",labelStyle:"font-size:18px!important;font-weight:bold;",renderer:function(b){format=Ext.util.Format.numberRenderer("0."+App.user.decimalPrecision);return''+App.user.currency+" "+format(b)+""},flex:3}]},{fieldLabel:t("Destination"),name:"destination"},{fieldLabel:t("Price minute"),name:"price_min",renderer:Helper.Util.formatMoneyDecimal},{fieldLabel:t("Duration"),name:"callshoptime",renderer:Helper.Util.formatsecondsToTime},{border:false,xtype:"toolbar",hidden:me.hideBbar,dock:"bottom",items:[{bodyPadding:10,width:"33%",text:t("Charge"),itemId:"charge",iconCls:"buycredit",handler:"sendActionNew",reference:"cobrar_"+i,urlAction:"index.php/callShop/cobrar"},{width:"33%",text:t("Release"),itemId:"release",iconCls:"release",handler:"sendActionNew",reference:"liberar_"+i,urlAction:"index.php/callShop/liberar",hidden:window.releaseButton},{width:"33%",text:t("Print"),itemId:"print",iconCls:"icon-print",handler:"reportCallshopClientNew",reference:"report_"+i,urlAction:"index.php/callShop/report"}]}]},{reference:"history_"+i,tooltip:"history_"+i,iconCls:"x-fa fa-refresh",title:t("History"),autoScroll:true,items:[{xtype:"callshopcdrlist",buttonCsv:false,autoScroll:true,filterableColumns:false,buttonCleanFilter:false,autoLoadStore:false,border:false,allowCreate:false,allowUpdate:false,allowDelete:false,buttonUpdateLot:false,pagination:false,allowPrint:false,columnsHide:["cabina","destination","status","buycost","markup","date"],store:Ext.create("MBilling.store.CallShopCdr",{remoteFilter:true})}],tabConfig:{listeners:{click:function(b){id=b.tooltip.split("_");panel=me.lookupReference("history_"+id[1]);storeCallshopcdr=panel.down("callshopcdrlist").getStore();filterCabina=[{type:"string",comparison:"eq",value:me.lookupReference("cabina"+id[1]).getForm().findField("name").getValue(),field:"cabina"},{type:"list",value:[0],field:"status"}];storeCallshopcdr.load({filter:filterCabina,params:{filters:Ext.encode(filterCabina)},limit:70})}}}}]})}return items},onShowCabins:function(b){me=this,i=1;Ext.each(b,function(a){if(tab=me.lookupReference("tab"+i)){name=a.data.callerid.length<1?a.data.name:a.data.callerid;status=Helper.Util.formatBooleanFree(a.data.status);tab.setTitle(t("Cabina")+" "+i+" - "+name+" "+status);tab.setVisible(true);me.lookupReference("cabina"+i).getForm().loadRecord(a)}i++});for(i=b.length+1;i<=12;i++){tab=me.lookupReference("tab"+i).setVisible(false)}}},0,["callshop2module"],["component","box","container","panel","form","callshop2module"],{component:true,box:true,container:true,panel:true,form:true,callshop2module:true},["widget.callshop2module"],0,[MBilling.view.callShop,"Module2"],0));(Ext.cmd.derive("MBilling.view.callShop.List",Ext.ux.grid.Panel,{store:"CallShop",viewConfig:{loadMask:false,emptyText:'
'+t("No record found")+"
",getRowClass:function(b){if(App.user.l=="callshop"){if(b.get("status")==1){return"callshoFree"}else{if(b.get("status")==0){return"callshoBlock"}else{if(b.get("status")==2){return"callshoInUse"}else{if(b.get("status")==3){return"callshoInCall"}}}}}}},refreshTime:4,initComponent:function(){var b=this;b.buttonCsv=false;b.buttonUpdateLot=false;b.allowCreate=true;b.allowUpdate=true;b.allowDelete=true;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.allowPrint=false;b.buttonDeleteWidth=140;b.refreshTime=(localStorage&&localStorage.getItem("callshopfresh"))||b.refreshTime;b.extraButtons=[{xtype:"numberfield",field:"jmlhBrg",fieldLabel:t("Refresh Time"),editable:false,minValue:3,labelWidth:90,width:150,selectOnFocus:true,allowDecimals:true,decimalPrecision:2,value:b.refreshTime,listeners:{change:function(a){if(a.value>0){b.refreshTime=a.value;localStorage.setItem("callshopfresh",a.value)}}}}];b.columns=[{header:t("cabina"),dataIndex:"callerid",flex:4},{header:t("status"),dataIndex:"status",renderer:Helper.Util.formatBooleanFree,flex:3,filter:{type:"list",options:[[1,t("free")],[2,t("inuse")],[0,t("blocked")],[3,t("calling")]]}},{header:t("number"),dataIndex:"callshopnumber",flex:4},{header:t("Destino"),dataIndex:"callshopdestination",hidden:App.user.l!="callshop",flex:6},{header:t("sessiontime"),dataIndex:"callshoptime",renderer:Helper.Util.formatsecondsToTime,flex:3}];b.sessionLoad=Ext.create("Ext.util.DelayedTask",function(){b.store.load()},b);Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments);b.store.on("load",b.onLoadStore,b)},onLoadStore:function(){var b=this;b.onDeactivateModule();b.onActivateModule()},onRender:function(){var b=this;b.module.on("activate",b.onActivateModule,b);b.module.on("deactivate",b.onDeactivateModule,b);b.module.on("close",b.onCloseModule,b);Ext.ux.grid.Panel.prototype.onRender.apply(this,arguments)},onActivateModule:function(){this.sessionLoad&&this.sessionLoad.delay(this.refreshTime*1000)},onDeactivateModule:function(){this.sessionLoad&&this.sessionLoad.cancel()},onCloseModule:function(){this.onDeactivateModule();this.sessionLoad=null}},0,["callshoplist"],["component","box","container","panel","tablepanel","gridpanel","grid","callshoplist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callshoplist:true},["widget.callshoplist"],0,[MBilling.view.callShop,"List"],0));(Ext.cmd.derive("MBilling.view.callShop.Form",Ext.ux.form.Panel,{hideTbar:true,labelWidthFields:"60%",bodyPadding:1,layout:"fit",buttonsTbar:[{xtype:"tbtext",itemId:"priceSum"},"->",{text:"Cobrar",itemId:"charge",iconCls:"buycredit",urlAction:"index.php/callShop/cobrar",disabled:true,handler:"sendAction",width:100},{text:"Liberar",itemId:"release",iconCls:"release",urlAction:"index.php/callShop/liberar",disabled:true,handler:"sendAction",width:100},{text:t("Print"),itemId:"print",glyph:icons.print,urlAction:"index.php/callShop/report",disabled:true,handler:"reportCallshopClient",width:100}],initComponent:function(){var b=this;b.items=[{xtype:"callshopcdrlist",buttonCsv:false,filterableColumns:false,buttonCleanFilter:false,autoLoadStore:false,border:true,allowCreate:false,allowUpdate:false,allowDelete:false,buttonUpdateLot:false,pagination:false,allowPrint:false,columnsHide:["status","buycost","markup"],store:Ext.create("MBilling.store.CallShopCdr",{remoteSort:false})}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callshopform"],["component","box","container","panel","form","callshopform"],{component:true,box:true,container:true,panel:true,form:true,callshopform:true},["widget.callshopform"],0,[MBilling.view.callShop,"Form"],0));(Ext.cmd.derive("MBilling.view.callShopCdr.Controller",Ext.ux.app.ViewController,{formHidden:true},0,0,0,0,["controller.callshopcdr"],0,[MBilling.view.callShopCdr,"Controller"],0));(Ext.cmd.derive("MBilling.view.callShopCdr.Module",Ext.ux.panel.Module,{controller:"callshopcdr"},0,["callshopcdrmodule"],["component","box","container","uxpanelmodule","callshopcdrmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callshopcdrmodule:true},["widget.callshopcdrmodule"],0,[MBilling.view.callShopCdr,"Module"],0));(Ext.cmd.derive("MBilling.view.callShopCdr.List",Ext.ux.grid.Panel,{store:"CallShopCdr",initComponent:function(){var b=this;b.buttonCsv=false;b.buttonUpdateLot=false;b.allowUpdate=true;b.allowDelete=false;b.allowCreate=false;b.allowUpdate=false;b.allowPrint=false;b.columns=[{header:t("cabina"),dataIndex:"cabina",filter:{type:"string"},flex:2},{header:t("number"),dataIndex:"calledstation",filter:{type:"string"},flex:3},{dataIndex:"destination",header:t("destination"),flex:3},{header:"Pago",dataIndex:"status",renderer:Helper.Util.formattyyesno,flex:2,filter:{type:"list",options:[[0,t("no")],[1,t("yes")]]}},{header:t("buyrate"),dataIndex:"buycost",renderer:Helper.Util.formatMoneyDecimal,flex:2},{header:t("rateinitial"),dataIndex:"price",renderer:Helper.Util.formatMoneyDecimal,flex:2},{header:t("markup"),dataIndex:"markup",renderer:Ext.util.Format.numberRenderer("0.00 %"),flex:2},{header:t("sessiontime"),dataIndex:"sessiontime",renderer:Helper.Util.formatsecondsToTime,flex:2},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"date",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callshopcdrlist"],["component","box","container","panel","tablepanel","gridpanel","grid","callshopcdrlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callshopcdrlist:true},["widget.callshopcdrlist"],0,[MBilling.view.callShopCdr,"List"],0));(Ext.cmd.derive("MBilling.view.callShopCdr.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:App.user.isClient}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callshopcdrform"],["component","box","container","panel","form","callshopcdrform"],{component:true,box:true,container:true,panel:true,form:true,callshopcdrform:true},["widget.callshopcdrform"],0,[MBilling.view.callShopCdr,"Form"],0));(Ext.cmd.derive("MBilling.view.rateCallshop.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.ratecallshop"],0,[MBilling.view.rateCallshop,"Controller"],0));(Ext.cmd.derive("MBilling.view.rateCallshop.Module",Ext.ux.panel.Module,{controller:"ratecallshop"},0,["ratecallshopmodule"],["component","box","container","uxpanelmodule","ratecallshopmodule"],{component:true,box:true,container:true,uxpanelmodule:true,ratecallshopmodule:true},["widget.ratecallshopmodule"],0,[MBilling.view.rateCallshop,"Module"],0));(Ext.cmd.derive("MBilling.view.rateCallshop.List",Ext.ux.grid.Panel,{store:"RateCallshop",buttonImportCsv:true,initComponent:function(){var b=this;b.buttonImportCsv=App.user.isClient,b.buttonCsv=App.user.isClient;b.allowPrint=App.user.isClient;b.buttonUpdateLot=App.user.isClient;b.allowCreate=App.user.isClient;b.allowUpdate=App.user.isClient;b.allowDelete=App.user.isClient;b.buttonUpdateLotCallShopRate=App.user.isClient;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("dialprefix"),dataIndex:"dialprefix",filter:{type:"string"},flex:2},{header:t("destination"),dataIndex:"destination",flex:3},{header:t("rateinitial"),dataIndex:"buyrate",renderer:Helper.Util.formatMoneyDecimal4,flex:2},{header:t("buyrateinitblock"),dataIndex:"minimo",flex:2},{header:t("buyrateincrement"),dataIndex:"block",flex:2}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["ratecallshoplist"],["component","box","container","panel","tablepanel","gridpanel","grid","ratecallshoplist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,ratecallshoplist:true},["widget.ratecallshoplist"],0,[MBilling.view.rateCallshop,"List"],0));(Ext.cmd.derive("MBilling.view.rateCallshop.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{xtype:"numberfield",name:"dialprefix",fieldLabel:t("prefix")},{name:"destination",fieldLabel:t("destination")},{xtype:"moneyfield",name:"buyrate",fieldLabel:t("rateinitial")},{xtype:"numberfield",name:"minimo",value:1,minValue:1,fieldLabel:t("buyrateinitblock")},{xtype:"numberfield",name:"block",value:1,minValue:1,fieldLabel:t("buyrateincrement")},{xtype:"numberfield",name:"minimal_time_charge",value:0,minValue:0,fieldLabel:t("Minimal time to charge")}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["ratecallshopform"],["component","box","container","panel","form","ratecallshopform"],{component:true,box:true,container:true,panel:true,form:true,ratecallshopform:true},["widget.ratecallshopform"],0,[MBilling.view.rateCallshop,"Form"],0));(Ext.cmd.derive("MBilling.view.rateCallshop.ImportCsv",Ext.ux.window.ImportCsv,{htmlTipInfo:"
"+t("dialprefix")+", "+t("destination")+", "+t("rateinitial")+"
5511, Brasil SP, 0.080
34, Spain Fix, 0.056
54, Argentina, 0.025

"+t("rateinitial")+" "+t("and")+" "+t("buyrate")+""},0,["ratecallshopimportcsv"],["component","box","container","panel","window","ratecallshopimportcsv"],{component:true,box:true,container:true,panel:true,window:true,ratecallshopimportcsv:true},["widget.ratecallshopimportcsv"],0,[MBilling.view.rateCallshop,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.callSummaryCallShop.Controller",MBilling.view.callSummaryPerDay.Controller,{aliasChart:"callsummarycallshopchart"},0,0,0,0,["controller.callsummarycallshop"],0,[MBilling.view.callSummaryCallShop,"Controller"],0));(Ext.cmd.derive("MBilling.view.callSummaryCallShop.Module",Ext.ux.panel.Module,{controller:"callsummarycallshop",titleForm:t("total"),iconForm:"icon-sum",widthForm:250},0,["callsummarycallshopmodule"],["component","box","container","uxpanelmodule","callsummarycallshopmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callsummarycallshopmodule:true},["widget.callsummarycallshopmodule"],0,[MBilling.view.callSummaryCallShop,"Module"],0));(Ext.cmd.derive("MBilling.view.callSummaryCallShop.List",Ext.ux.grid.Panel,{store:"CallSummaryCallShop",initComponent:function(){var b=this;b.buttonImportCsv=false;b.buttonCsv=false;b.allowPrint=false;b.buttonUpdateLot=false;b.allowCreate=false;b.buttonCleanFilter=false;b.allowUpdate=false;b.allowDelete=false;b.extraButtons=[{text:t("charts"),iconCls:"icon-chart-column",handler:"onChart",reference:"chart",disabled:false,hidden:App.user.isClient}];b.collapsedExtraFilters=false;b.titleAddFilter=t("Filter");b.extraFilters=[{field:"t.cabina",label:t("cabina"),type:"string"},{field:"t.calledstation",label:t("prefix"),type:"string"}];b.columns=[{header:t("day"),renderer:Ext.util.Format.dateRenderer("Y-m-d"),dataIndex:"day",filter:{type:"date",field:"date"},flex:3},{menuDisabled:true,header:t("sessiontime")+" "+t("Min"),dataIndex:"sessiontime",flex:2},{menuDisabled:true,header:t("aloc_all_calls"),dataIndex:"aloc_all_calls",renderer:Helper.Util.formatsecondsToTime,flex:3},{menuDisabled:true,header:t("nbcall"),dataIndex:"nbcall",flex:3},{menuDisabled:true,header:t("buycost"),dataIndex:"buycost",renderer:Helper.Util.formatMoneyDecimal,flex:3,hideable:false,hidden:!App.user.isClient},{menuDisabled:true,header:t("sessionbill"),dataIndex:"price",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:!App.user.isClient},{menuDisabled:true,header:t("markup"),dataIndex:"lucro",renderer:Helper.Util.formatMoneyDecimal,flex:3,hideable:false,hidden:!App.user.isClient}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarycallshoplist"],["component","box","container","panel","tablepanel","gridpanel","grid","callsummarycallshoplist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callsummarycallshoplist:true},["widget.callsummarycallshoplist"],0,[MBilling.view.callSummaryCallShop,"List"],0));(Ext.cmd.derive("MBilling.view.callSummaryCallShop.Form",Ext.ux.form.Panel,{defaults:{},labelWidthFields:150,defaultType:"displayfield",initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{name:"sumsessiontime",fieldLabel:t("sessiontime")+" "+t("Min")},{name:"sumprice",fieldLabel:t("sessionbill"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isClient},{name:"sumlucro",fieldLabel:t("markup"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isClient},{name:"sumbuycost",fieldLabel:t("buycost"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isClient},{name:"sumnbcall",fieldLabel:t("nbcall"),hidden:!App.user.isClient}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarycallshopform"],["component","box","container","panel","form","callsummarycallshopform"],{component:true,box:true,container:true,panel:true,form:true,callsummarycallshopform:true},["widget.callsummarycallshopform"],0,[MBilling.view.callSummaryCallShop,"Form"],0));(Ext.cmd.derive("MBilling.view.callSummaryCallShop.Chart",Ext.ux.panel.Chart,{controller:"callsummarycallshop",store:"CallSummaryCallShop",fieldValue:"sessiontime",fieldDescription:"day",labelYLine:t("sessiontime")+" Min",labelXLine:t("day"),initComponent:function(){var d=this,c;d.rendererFieldValue=Ext.util.Format.numberRenderer("0"),d.rendererFieldDescription=Ext.util.Format.dateRenderer("Y-m-d");d.tbarChart=[{xtype:"buttongroup",toggleGroup:"charts",defaults:{enableToggle:true,toggleGroup:"charts",allowDepress:false,listeners:{toggle:"onToggleGroupButton"}},items:[{pressed:true,text:t("sessiontime"),chart:"sessiontime",sumName:"sumsessiontime"},{text:t("buycost"),sumRenderer:Helper.Util.formatMoneyDecimal,chart:"buycost",sumName:"sumbuycost"},{text:t("sessionbill"),sumRenderer:Helper.Util.formatMoneyDecimal,chart:"price",sumName:"sumprice"},{text:t("markup"),sumRenderer:Helper.Util.formatMoneyDecimal,chart:"lucro",sumName:"sumlucro",hidden:App.user.isClient||App.user.isAgent},{text:t("nbcall"),chart:"nbcall",sumName:"sumnbcall"}]}];d.bbarChart=[{xtype:"tbtext",itemId:"tbTextSum"}];Ext.ux.panel.Chart.prototype.initComponent.apply(this,arguments)}},0,["callsummarycallshopchart"],["component","box","container","panel","chartpanel","callsummarycallshopchart"],{component:true,box:true,container:true,panel:true,chartpanel:true,callsummarycallshopchart:true},["widget.callsummarycallshopchart"],0,[MBilling.view.callSummaryCallShop,"Chart"],0));(Ext.cmd.derive("MBilling.view.buycredit.Controller",Ext.ux.app.ViewController,{buyCreditClose:function(e){var j=this,g=j.lookupReference("buycreditPanel"),f=j.lookupReference("btnCancel");g.getForm().findField("amount")["show"]();g.getForm().findField("method")["show"]();g.getForm().findField("card_num")["hide"]();g.getForm().findField("exp_date")["hide"]();g.getForm().findField("method").setValue("");f.setVisible(false)},buyCredit:function(r){var o=this,n=o.lookupReference("buycreditPanel"),s=o.lookupReference("btnCancel"),p=n.getForm().findField("amount").getValue(),l=n.getForm().findField("method").getValue(),m=n.getForm().findField("card_num").getValue(),q=n.getForm().findField("exp_date").rawValue;if(n.getForm().findField("method").rawValue.match(/uthorize/)){if(m){n.setLoading(o.msgWait);Ext.Ajax.request({url:"index.php/buyCredit/method/?amount="+p+"&id_method="+l+"&cc="+m+"&ed="+q,scope:o,success:function(a){a=Ext.decode(a.responseText);if(a.success){Ext.ux.Alert.alert(t("Success"),a.msg,"success",10000);n.setLoading(false);n.getForm().findField("amount")["show"]();n.getForm().findField("method")["show"]();n.getForm().findField("card_num")["hide"]();n.getForm().findField("exp_date")["hide"]();s.setVisible(false);n.getForm().findField("card_num").setValue("");n.getForm().findField("exp_date").setValue("");n.getForm().findField("method").setValue("")}else{Ext.ux.Alert.alert(t("Error"),a.msg,"error");n.getForm().findField("card_num").setValue("");n.getForm().findField("exp_date").setValue("");n.setLoading(false)}}});return}else{n.getForm().findField("amount")["hide"]();n.getForm().findField("method")["hide"]();n.getForm().findField("card_num")["show"]();n.getForm().findField("exp_date")["show"]();s.setVisible(true);n.getForm().findField("card_num").focus()}}else{if(!l){Ext.ux.Alert.alert(o.titleWarning,t("Select a ")+t("paymentmethods"),"warning");return}else{if(p<=0){Ext.ux.Alert.alert(o.titleWarning,t("Select a ")+t("valid")+" "+t("amount"),"warning");return}else{url="index.php/buyCredit/method/?amount="+p+"&id_method="+l;n.getForm().findField("method").setValue("");n.getForm().findField("card_num").setValue("");n.getForm().findField("exp_date").setValue("");if(n.getForm().findField("method").rawValue.match(/PlacetoPay/)){window.open(url,"_self")}else{window.open(url,"_blank")}}}}}},0,0,0,0,["controller.buycredit"],0,[MBilling.view.buycredit,"Controller"],0));(Ext.cmd.derive("MBilling.view.buycredit.Module",Ext.form.Panel,{controller:"buycredit",resizable:false,autoShow:true,header:false,initComponent:function(){var b=this;b.items=[{reference:"buycreditPanel",xtype:"form",margin:"10 10 10 10",autoShow:true,closable:false,resizable:false,bodyPadding:10,defaultType:"textfield",defaults:{labelAlign:"right",labelWidth:150,width:280,allowBlank:false,msgTarget:"side",enableKeyEvents:true,plugins:"markallowblank",anchor:"100%"},items:[{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,00",fieldLabel:t("Amounts"),value:0,name:"amount"},{xtype:"methodpaycombo",fieldLabel:t("paymentmethods"),name:"method"},{fieldLabel:t("CreditCard Number"),name:"card_num",hidden:true},{xtype:"datefield",fieldLabel:t("Expiration Date"),name:"exp_date",format:"m/y",hidden:true}],bbar:[{text:t("Cancel"),tooltip:t("Cancel"),glyph:b.glyphCancel,handler:"buyCreditClose",hidden:true,reference:"btnCancel"},{text:t("Next"),tooltip:t("Next"),width:100,glyph:icons.disk,handler:"buyCredit"}]}];Ext.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["buycreditmodule"],["component","box","container","panel","form","buycreditmodule"],{component:true,box:true,container:true,panel:true,form:true,buycreditmodule:true},["widget.buycreditmodule"],0,[MBilling.view.buycredit,"Module"],0));(Ext.cmd.derive("MBilling.view.transferToMobile.Module",Ext.form.Panel,{resizable:false,autoShow:true,header:false,items:[{xtype:"component",autoEl:{width:"100%",height:"100%",tag:"iframe",src:"index.php/transferToMobile/read"}}]},0,["transfertomobilemodule"],["component","box","container","panel","form","transfertomobilemodule"],{component:true,box:true,container:true,panel:true,form:true,transfertomobilemodule:true},["widget.transfertomobilemodule"],0,[MBilling.view.transferToMobile,"Module"],0));(Ext.cmd.derive("MBilling.view.firewall.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.firewall"],0,[MBilling.view.firewall,"Controller"],0));(Ext.cmd.derive("MBilling.view.firewall.Module",Ext.ux.panel.Module,{controller:"firewall"},0,["firewallmodule"],["component","box","container","uxpanelmodule","firewallmodule"],{component:true,box:true,container:true,uxpanelmodule:true,firewallmodule:true},["widget.firewallmodule"],0,[MBilling.view.firewall,"Module"],0));(Ext.cmd.derive("MBilling.view.firewall.List",Ext.ux.grid.Panel,{store:"Firewall",initComponent:function(){var b=this;b.textDelete="Unban";b.textNew="Ban new Ip";b.buttonCsv=false;b.buttonUpdateLot=false;b.buttonCleanFilter=true;b.allowPrint=false;b.allowCreate=true;b.allowDelete=true;b.columns=[{header:t("Ip"),dataIndex:"ip",flex:4},{header:t("Type"),dataIndex:"jail",flex:4},{header:t("Permanently")+" "+t("Ban"),dataIndex:"action",renderer:Helper.Util.formattyyesno,filter:{type:"list",options:[[0,t("no")],[1,t("yes")]]},flex:2}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["firewalllist"],["component","box","container","panel","tablepanel","gridpanel","grid","firewalllist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,firewalllist:true},["widget.firewalllist"],0,[MBilling.view.firewall,"List"],0));(Ext.cmd.derive("MBilling.view.firewall.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{name:"ip",fieldLabel:t("Ip"),vtype:"IPAddress"},{xtype:"yesnocombo",fieldLabel:t("Permanently")+" "+t("Ban"),name:"action"},{xtype:"textarea",name:"description",fieldLabel:t("description"),allowBlank:true,height:300,anchor:"100%",readOnly:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["firewallform"],["component","box","container","panel","form","firewallform"],{component:true,box:true,container:true,panel:true,form:true,firewallform:true},["widget.firewallform"],0,[MBilling.view.firewall,"Form"],0));(Ext.cmd.derive("MBilling.view.userRate.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.userrate"],0,[MBilling.view.userRate,"Controller"],0));(Ext.cmd.derive("MBilling.view.userRate.Module",Ext.ux.panel.Module,{controller:"userrate"},0,["userratemodule"],["component","box","container","uxpanelmodule","userratemodule"],{component:true,box:true,container:true,uxpanelmodule:true,userratemodule:true},["widget.userratemodule"],0,[MBilling.view.userRate,"Module"],0));(Ext.cmd.derive("MBilling.view.userRate.List",Ext.ux.grid.Panel,{store:"UserRate",initComponent:function(){var b=this;b.buttonCsv=false;b.allowPrint=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("prefix"),dataIndex:"idPrefixprefix",flex:window.isTablet?2:3},{dataIndex:"idPrefixdestination",header:t("destination"),flex:window.isTablet?2:3},{header:t("rateinitial"),dataIndex:"rateinitial",renderer:Helper.Util.formatMoneyDecimal,flex:2},{header:t("initblock"),dataIndex:"initblock",flex:2},{header:t("billingblock"),dataIndex:"billingblock",flex:2}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["userratelist"],["component","box","container","panel","tablepanel","gridpanel","grid","userratelist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,userratelist:true},["widget.userratelist"],0,[MBilling.view.userRate,"List"],0));(Ext.cmd.derive("MBilling.view.userRate.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{fieldLabel:t("User"),name:"id_user",xtype:!App.user.isAdmin?"textfield":"userlookup",ownerForm:b,hidden:!App.user.isAdmin,allowBlank:!App.user.isAdmin},{fieldLabel:t("Destination"),name:"id_prefix",xtype:"prefixlookup",ownerForm:b,hidden:!App.user.isAdmin,allowBlank:!App.user.isAdmin},{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,"+App.user.decimalPrecision,name:"rateinitial",fieldLabel:t("rateinitial"),readOnly:App.user.isClient},{xtype:"numberfield",name:"initblock",fieldLabel:t("initblock"),hidden:App.user.isClient},{xtype:"numberfield",name:"billingblock",fieldLabel:t("billingblock"),hidden:App.user.isClient}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["userrateform"],["component","box","container","panel","form","userrateform"],{component:true,box:true,container:true,panel:true,form:true,userrateform:true},["widget.userrateform"],0,[MBilling.view.userRate,"Form"],0));(Ext.cmd.derive("MBilling.view.extra.Module",Ext.form.Panel,{resizable:false,autoShow:true,header:false,items:[{xtype:"component",autoEl:{width:"100%",height:"100%",tag:"iframe",src:window.moduleExtra}}]},0,["extramodule"],["component","box","container","panel","form","extramodule"],{component:true,box:true,container:true,panel:true,form:true,extramodule:true},["widget.extramodule"],0,[MBilling.view.extra,"Module"],0));(Ext.cmd.derive("MBilling.view.callOnlineChart.Module",Ext.ux.panel.Module,{},0,["callOnlineChartmodule"],["component","box","container","uxpanelmodule","callOnlineChartmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callOnlineChartmodule:true},["widget.callOnlineChartmodule"],0,[MBilling.view.callOnlineChart,"Module"],0));(Ext.cmd.derive("MBilling.view.callOnlineChart.List",Ext.ux.grid.Panel,{store:"CallOnlineChart",initComponent:function(){var b=this;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("Total"),dataIndex:"total",flex:1},{header:t("date"),dataIndex:"date",renderer:Ext.util.Format.dateRenderer("Y-m-d H:i"),flex:1}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callonlinechartlist"],["component","box","container","panel","tablepanel","gridpanel","grid","callonlinechartlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callonlinechartlist:true},["widget.callonlinechartlist"],0,[MBilling.view.callOnlineChart,"List"],0));(Ext.cmd.derive("MBilling.view.callOnlineChart.Form",Ext.ux.form.Panel,{},0,["callOnlineChartform"],["component","box","container","panel","form","callOnlineChartform"],{component:true,box:true,container:true,panel:true,form:true,callOnlineChartform:true},["widget.callOnlineChartform"],0,[MBilling.view.callOnlineChart,"Form"],0));(Ext.cmd.derive("MBilling.view.callOnlineChart.Chart",Ext.ux.panel.Chart,{controller:"callsummaryperday",store:"CallOnlineChart",fieldValue:["total","answer"],fieldDescription:"date",labelYLine:t("total")+" / Min",labelXLine:t("Minute"),reference:"callonlinechartchart",defaultChart:"line",btnShowColumn:false,btnShowBar:false,btnShowLine:true,btnShowPie:false,animate:true,btnShowLineHidden:true,initComponent:function(){var b=this;b.rendererFieldValue=Ext.util.Format.numberRenderer("0");b.tbarChart=[{text:t("Per")+" "+t("Minute"),scope:b,handler:"onPerMinute",reference:"btnMinute",disabled:true},{text:t("Per")+" "+t("Hour"),scope:b,handler:"onPerhour",reference:"btnHour"}];b.legend={position:"right",boxStrokeWidth:0,labelFont:"12px Helvetica",renderer:b.rendererLegend};b.bbarChart=[{xtype:"tbtext",itemId:"tbTextSum"}];b.sessionLoad=Ext.create("Ext.util.DelayedTask",function(){b.store.load()},b);Ext.ux.panel.Chart.prototype.initComponent.apply(this,arguments);b.store.on("load",b.onLoadStore,b)},onPerMinute:function(d){var c=this;c.lookupReference("btnMinute").disable();c.lookupReference("btnHour").enable();c.store.setRemoteFilter(true);c.store.filter("type","minute");c.store.load()},onPerhour:function(d){var c=this;c.lookupReference("btnHour").disable();c.lookupReference("btnMinute").enable();c.store.setRemoteFilter(true);c.store.filter("type","hour");c.store.load()},onLoadStore:function(){this.onActivateModule()},onActivateModule:function(){this.sessionLoad&&this.sessionLoad.delay(25000)}},0,["callonlinechartchart"],["component","box","container","panel","chartpanel","callonlinechartchart"],{component:true,box:true,container:true,panel:true,chartpanel:true,callonlinechartchart:true},["widget.callonlinechartchart"],0,[MBilling.view.callOnlineChart,"Chart"],0));(Ext.cmd.derive("MBilling.view.smtps.Controller",Ext.ux.app.ViewController,{onSendEmail:function(e){var f=this,d=f.list.getSelectionModel().getSelection()[0];f.list.setLoading(true);if(f.list.getSelectionModel().getSelection().length==1){Ext.Ajax.request({url:"index.php/smtps/testMail",params:{id:d.get("id")},scope:f,success:function(a){a=Ext.decode(a.responseText);if(a[f.nameSuccessRequest]){Ext.ux.Alert.alert(f.titleSuccess,a[f.nameMsgRequest],"success")}else{Ext.ux.Alert.alert(f.titleError,a[f.nameMsgRequest],"error")}f.list.setLoading(false)}})}else{Ext.ux.Alert.alert(f.titleError,"Please Select a Smtp","notification");f.list.setLoading(false)}}},0,0,0,0,["controller.smtps"],0,[MBilling.view.smtps,"Controller"],0));(Ext.cmd.derive("MBilling.view.smtps.List",Ext.ux.grid.Panel,{store:"Smtps",initComponent:function(){var b=this;b.extraButtons=[{text:t("Test Smtp"),iconCls:"templatemail",handler:"onSendEmail",disabled:false}];b.buttonUpdateLot=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("Host"),dataIndex:"host",flex:4},{header:t("username"),dataIndex:"username",flex:2},{header:t("Port"),dataIndex:"port",flex:3},{header:t("Encryption"),dataIndex:"encryption",flex:3}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["smtpslist"],["component","box","container","panel","tablepanel","gridpanel","grid","smtpslist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,smtpslist:true},["widget.smtpslist"],0,[MBilling.view.smtps,"List"],0));(Ext.cmd.derive("MBilling.view.smtps.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{name:"host",fieldLabel:t("Host"),hidden:App.user.isClient},{name:"username",fieldLabel:t("username"),hidden:App.user.isClient},{inputType:"password",name:"password",fieldLabel:t("password"),hidden:App.user.isClient},{xtype:"numberfield",name:"port",fieldLabel:t("Port"),value:587,hidden:App.user.isClient},{xtype:"combobox",name:"encryption",fieldLabel:t("Encryption"),hidden:App.user.isClient,value:"null",store:[["ssl",t("SSl")],["tls",t("TLS")],["null",t("NULL")]]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["smtpsform"],["component","box","container","panel","form","smtpsform"],{component:true,box:true,container:true,panel:true,form:true,smtpsform:true},["widget.smtpsform"],0,[MBilling.view.smtps,"Form"],0));(Ext.cmd.derive("MBilling.view.smtps.Module",Ext.ux.panel.Module,{controller:"smtps"},0,["smtpsmodule"],["component","box","container","uxpanelmodule","smtpsmodule"],{component:true,box:true,container:true,uxpanelmodule:true,smtpsmodule:true},["widget.smtpsmodule"],0,[MBilling.view.smtps,"Module"],0));(Ext.cmd.derive("MBilling.view.servers.Controller",Ext.ux.app.ViewController,{init:function(){var b=this;b.control({combobox:{select:b.onSelectType}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectType:function(c,d){this.showFieldsRelated(d.getData().showFields)},showFieldsRelated:function(l){var m=this,g=m.formPanel.getForm().getFields(),j=m.formPanel.getForm().findField("weight"),f=m.formPanel.getForm();g.each(function(a){if(a.name=="type"){if(a.value=="asterisk"||a.value=="mbilling"){j.show()}else{j.hide()}}})},onEdit:function(){var d=this,f=d.formPanel.getForm().findField("weight"),e=d.formPanel.getForm().findField("type");Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments);if(e.value=="asterisk"||e.value=="mbilling"){f.show()}else{f.hide()}},onDelete:function(d){var f=this,e;notDelete=false;Ext.each(f.list.getSelectionModel().getSelection(),function(a){if(a.get("id")==1){Ext.ux.Alert.alert(f.titleError,t("You cannot delete the")+" server id 1","error");notDelete=true}});if(notDelete==false){Ext.ux.app.ViewController.prototype.onDelete.apply(this,arguments)}}},0,0,0,0,["controller.servers"],0,[MBilling.view.servers,"Controller"],0));(Ext.cmd.derive("MBilling.view.servers.List",Ext.ux.grid.Panel,{store:"Servers",initComponent:function(){var b=this;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("host"),dataIndex:"host",flex:4},{header:t("username"),dataIndex:"username",flex:4},{header:t("type"),dataIndex:"type",comboRelated:"booleancombo",flex:2},{header:t("status"),dataIndex:"status",renderer:Helper.Util.formatBooleanActive,comboRelated:"booleancombo",flex:2,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")]]}}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["serverslist"],["component","box","container","panel","tablepanel","gridpanel","grid","serverslist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,serverslist:true},["widget.serverslist"],0,[MBilling.view.servers,"List"],0));(Ext.cmd.derive("MBilling.view.servers.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["id_user"],initComponent:function(){var b=this;b.items=[{name:"host",fieldLabel:t("host")},{name:"username",fieldLabel:t("username"),allowBlank:true},{name:"password",fieldLabel:t("password"),allowBlank:true},{name:"port",fieldLabel:t("port"),allowBlank:true},{xtype:"combobox",name:"type",fieldLabel:t("type"),forceSelection:true,editable:false,value:"mbilling",store:[["mbilling",t("Mbilling")],["asterisk",t("Asterisk")],["sipproxy",t("SipProxy")]]},{fieldLabel:t("Weight"),name:"weight",hidden:true,allowBlank:true,emptyText:t("This is useful in order to get a different ratio of traffic between servers.")},{xtype:"booleancombo",name:"status",fieldLabel:t("status"),allowBlank:true},{xtype:"textareafield",name:"description",fieldLabel:t("description"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["serversform"],["component","box","container","panel","form","serversform"],{component:true,box:true,container:true,panel:true,form:true,serversform:true},["widget.serversform"],0,[MBilling.view.servers,"Form"],0));(Ext.cmd.derive("MBilling.view.servers.Module",Ext.ux.panel.Module,{controller:"servers"},0,["serversmodule"],["component","box","container","uxpanelmodule","serversmodule"],{component:true,box:true,container:true,uxpanelmodule:true,serversmodule:true},["widget.serversmodule"],0,[MBilling.view.servers,"Module"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerUser.Controller",Ext.ux.app.ViewController,{formHidden:true,onEdit:function(){me=this;me.sumData=me.store.getData().items[0].getData();if(!me.sumData){return}me.formPanel.getForm().getFields().each(function(b){b.setValue(me.sumData[b.name])});me.formPanel.expand()},onExportCsvUser:function(o,l,g){var m=this,j=m.list.getStore(),n=m.list.filters.getFilterData().length?Ext.encode(m.list.filters.getFilterData()):j.proxy.extraParams.filter;window.open("index.php/callSummaryPerUser/exportCsvCalls?id="+o.getStore().getAt(l).getData().idUserusername+"&filter="+n)}},0,0,0,0,["controller.callsummaryperuser"],0,[MBilling.view.callSummaryPerUser,"Controller"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerUser.List",Ext.ux.grid.Panel,{store:"CallSummaryPerUser",initComponent:function(){var b=this;b.buttonImportCsv=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{xtype:"actioncolumn",width:26,sortable:false,menuDisabled:true,header:t(""),dataIndex:"id",items:[{iconCls:"icon-export-csv",tooltip:t("Export CSV"),handler:"onExportCsvUser"}],hidden:!App.user.isAdmin},{header:t("Username"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:3},{header:t("sessiontime")+" "+t("Min"),dataIndex:"sessiontime",flex:2},{header:t("aloc_all_calls"),dataIndex:"aloc_all_calls",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Answered Calls"),dataIndex:"nbcall",flex:3},{header:t("Failed Calls"),dataIndex:"nbcall_fail",flex:3},{header:t("buycost"),dataIndex:App.user.isAdmin?"buycost":"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("sessionbill"),dataIndex:App.user.isAgent||App.user.isClientAgent?"agent_bill":"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("markup"),dataIndex:"lucro",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("ASR"),dataIndex:"asr",renderer:Helper.Util.formatPorcente,flex:3,hidden:!App.user.isAdmin,hideable:App.user.isAdmin}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummaryperuserlist"],["component","box","container","panel","tablepanel","gridpanel","grid","callsummaryperuserlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callsummaryperuserlist:true},["widget.callsummaryperuserlist"],0,[MBilling.view.callSummaryPerUser,"List"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerUser.Form",Ext.ux.form.Panel,{defaults:{},labelWidthFields:100,defaultType:"displayfield",initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{name:"sumsessiontime",fieldLabel:t("sessiontime")+" "+t("Min"),renderer:Ext.util.Format.numberRenderer("0"),allowBlank:true},{name:App.user.isAgent||App.user.isClientAgent?"sumagent_bill":"sumsessionbill",fieldLabel:t("sessionbill"),renderer:Helper.Util.formatMoneyDecimal,allowBlank:true},{name:App.user.isAdmin?"sumbuycost":"sumsessionbill",fieldLabel:t("buycost"),renderer:Helper.Util.formatMoneyDecimal,hidden:App.user.isClient,allowBlank:true},{name:"sumlucro",fieldLabel:t("markup"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumnbcall",fieldLabel:t("Answered Calls"),allowBlank:true},{name:"sumnbcallfail",fieldLabel:t("Failed Calls"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummaryperuserform"],["component","box","container","panel","form","callsummaryperuserform"],{component:true,box:true,container:true,panel:true,form:true,callsummaryperuserform:true},["widget.callsummaryperuserform"],0,[MBilling.view.callSummaryPerUser,"Form"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerUser.Module",Ext.ux.panel.Module,{controller:"callsummaryperuser",cfgEast:{flex:0.4}},0,["callsummaryperusermodule"],["component","box","container","uxpanelmodule","callsummaryperusermodule"],{component:true,box:true,container:true,uxpanelmodule:true,callsummaryperusermodule:true},["widget.callsummaryperusermodule"],0,[MBilling.view.callSummaryPerUser,"Module"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerTrunk.Controller",Ext.ux.app.ViewController,{formHidden:true,onEdit:function(){me=this;me.sumData=me.store.getData().items[0].getData();if(!me.sumData){return}me.formPanel.getForm().getFields().each(function(b){b.setValue(me.sumData[b.name])});me.formPanel.expand()},onExportCsvUser:function(o,l,g){var m=this,j=m.list.getStore(),n=m.list.filters.getFilterData().length?Ext.encode(m.list.filters.getFilterData()):j.proxy.extraParams.filter;window.open("index.php/callSummaryPerTrunk/exportCsvCalls?id="+o.getStore().getAt(l).getData().idTrunktrunkcode+"&filter="+n)}},0,0,0,0,["controller.callsummarypertrunk"],0,[MBilling.view.callSummaryPerTrunk,"Controller"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerTrunk.List",Ext.ux.grid.Panel,{store:"CallSummaryPerTrunk",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{xtype:"actioncolumn",width:26,sortable:false,menuDisabled:true,header:t(""),dataIndex:"id",items:[{iconCls:"icon-export-csv",tooltip:t("Export CSV"),handler:"onExportCsvUser"}],hidden:!App.user.isAdmin},{header:t("Trunk"),dataIndex:"idTrunktrunkcode",filter:{type:"string",field:"idTrunk.trunkcode"},flex:3},{header:t("sessiontime")+" "+t("Min"),dataIndex:"sessiontime",flex:2},{header:t("aloc_all_calls"),dataIndex:"aloc_all_calls",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Answered Calls"),dataIndex:"nbcall",flex:3},{header:t("Failed Calls"),dataIndex:"nbcall_fail",flex:3},{header:t("buycost"),dataIndex:"buycost",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("sessionbill"),dataIndex:"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("markup"),dataIndex:"lucro",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("ASR"),dataIndex:"asr",renderer:Helper.Util.formatPorcente,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarypertrunklist"],["component","box","container","panel","tablepanel","gridpanel","grid","callsummarypertrunklist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callsummarypertrunklist:true},["widget.callsummarypertrunklist"],0,[MBilling.view.callSummaryPerTrunk,"List"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerTrunk.Form",Ext.ux.form.Panel,{defaults:{},labelWidthFields:100,defaultType:"displayfield",initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{name:"sumsessiontime",fieldLabel:t("sessiontime")+" "+t("Min"),renderer:Ext.util.Format.numberRenderer("0"),allowBlank:true},{name:"sumsessionbill",fieldLabel:t("sessionbill"),renderer:Helper.Util.formatMoneyDecimal,allowBlank:true},{name:"sumbuycost",fieldLabel:t("buycost"),renderer:Helper.Util.formatMoneyDecimal,hidden:App.user.isClient,allowBlank:true},{name:"sumlucro",fieldLabel:t("markup"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumnbcall",fieldLabel:t("Answered Calls"),allowBlank:true},{name:"sumnbcallfail",fieldLabel:t("Failed Calls"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarypertrunkform"],["component","box","container","panel","form","callsummarypertrunkform"],{component:true,box:true,container:true,panel:true,form:true,callsummarypertrunkform:true},["widget.callsummarypertrunkform"],0,[MBilling.view.callSummaryPerTrunk,"Form"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerTrunk.Module",Ext.ux.panel.Module,{controller:"callsummarypertrunk",cfgEast:{flex:0.4}},0,["callsummarypertrunkmodule"],["component","box","container","uxpanelmodule","callsummarypertrunkmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callsummarypertrunkmodule:true},["widget.callsummarypertrunkmodule"],0,[MBilling.view.callSummaryPerTrunk,"Module"],0));(Ext.cmd.derive("MBilling.view.backup.Controller",Ext.ux.app.ViewController,{formHidden:true,onDownload:function(l){var j=this,m,f=j.list.getSelectionModel().getSelection()[0],g=[];values="file="+f.data.name;url="index.php/backup/download/?"+values;window.open(url)},onDelete:function(m){var l=this,n,o=l.list.getSelectionModel().getSelection()[0],j=[];destroyType=m.menu.down("menucheckitem[checked=true]").value;var g=(destroyType==="all")?l.msgDeleteAll:l.msgConfirmation;if(!l.list.allowDelete){return}if(destroyType==="all"){Ext.ux.Alert.alert(l.titleError,"You cannot delete all backups","notification");return}if(o){Ext.Msg.confirm(l.titleConfirmation,g,function(a){if(a==="yes"){Ext.each(l.list.getSelectionModel().getSelection(),function(b){j.push(b.get("name"))});Ext.Ajax.request({url:"index.php/backup/destroy",params:{ids:Ext.encode(j)},scope:l,success:function(d){d=Ext.decode(d.responseText);if(d[l.nameSuccessRequest]){var c=Helper.Util.convertErrorsJsonToString(d[l.nameMsgRequest]);Ext.ux.Alert.alert(l.titleSuccess,c,"success")}else{var b=Helper.Util.convertErrorsJsonToString(d[l.nameMsgRequest]);Ext.ux.Alert.alert(l.titleError,b,"notification")}}});l.store.load()}},l)}else{Ext.ux.Alert.alert(l.titleError,t("Please select one or more register"),"notification")}},onNew:function(){var b=this;Ext.Msg.confirm(b.titleConfirmation,t("Do you relly want create a new backup now? It can take many time and make your server slow. Mbilling make backup every day automatically."),function(a){if(a==="yes"){Ext.Msg.confirm(b.titleConfirmation,t("This backup will override the backup held today! Do you sure?"),function(d){if(d==="yes"){Ext.Ajax.request({url:"index.php/backup/save",params:{ids:0},scope:b,success:function(j){j=Ext.decode(j.responseText);if(j[b.nameSuccessRequest]){var g=Helper.Util.convertErrorsJsonToString(j[b.nameMsgRequest]);Ext.ux.Alert.alert(b.titleSuccess,g,"success")}else{var c=Helper.Util.convertErrorsJsonToString(j[b.nameMsgRequest]);Ext.ux.Alert.alert(b.titleError,c,"notification")}}});b.store.load()}},b)}},b)}},0,0,0,0,["controller.backup"],0,[MBilling.view.backup,"Controller"],0));(Ext.cmd.derive("MBilling.view.backup.List",Ext.ux.grid.Panel,{store:"Backup",initComponent:function(){var b=this;b.buttonImportCsv=true;b.textButtonImportCsv=t("Importar Backup");b.widthButtonCsv=140;b.extraButtons=[{text:t("Download Backup"),glyph:icons.disk,handler:"onDownload",width:140,disabled:false}];b.buttonCsv=false;b.allowPrint=false;b.buttonUpdateLot=false;b.buttonCleanFilter=false;b.allowUpdate=false;b.columns=[{menuDisabled:true,header:t("name"),dataIndex:"name",flex:1},{menuDisabled:true,header:t("size"),dataIndex:"size",flex:1}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["backuplist"],["component","box","container","panel","tablepanel","gridpanel","grid","backuplist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,backuplist:true},["widget.backuplist"],0,[MBilling.view.backup,"List"],0));(Ext.cmd.derive("MBilling.view.backup.Form",Ext.ux.form.Panel,{},0,["backupform"],["component","box","container","panel","form","backupform"],{component:true,box:true,container:true,panel:true,form:true,backupform:true},["widget.backupform"],0,[MBilling.view.backup,"Form"],0));(Ext.cmd.derive("MBilling.view.backup.Module",Ext.ux.panel.Module,{controller:"backup",initComponent:function(){var b=this;Ext.ux.panel.Module.prototype.initComponent.apply(this,arguments)}},0,["backupmodule"],["component","box","container","uxpanelmodule","backupmodule"],{component:true,box:true,container:true,uxpanelmodule:true,backupmodule:true},["widget.backupmodule"],0,[MBilling.view.backup,"Module"],0));(Ext.cmd.derive("MBilling.view.backup.ImportCsv",Ext.ux.window.ImportCsv,{htmlTipInfo:"",extAllowed:["tgz"],fieldLabel:"Backup",iconCls:"icon-play"},0,["backupimportcsv"],["component","box","container","panel","window","backupimportcsv"],{component:true,box:true,container:true,panel:true,window:true,backupimportcsv:true},["widget.backupimportcsv"],0,[MBilling.view.backup,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.gAuthenticator.Controller",Ext.ux.app.ViewController,{init:function(){var b=this;b.control({statususercombo:{select:b.onSelectMethod}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectMethod:function(c,d){this.showFieldsRelated(d.getData().showFields)},showFieldsRelated:function(l){var m=this,j=m.formPanel.getForm().getFields(),o=m.formPanel.getForm().findField("googleAuthenticator_enable"),n=m.formPanel.getForm().findField("google_authenticator_key"),g=m.formPanel.getForm().findField("code");if(o.value!=1&&n.value.length>5){g.setVisible(true);g.allowBlank=false}else{g.setVisible(false);g.allowBlank=true}},onEdit:function(){var c=this,d=c.formPanel.getForm();if(!App.user.isAdmin){return}d.findField("code").allowBlank=true;d.findField("code").setVisible(false);Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)}},0,0,0,0,["controller.gauthenticator"],0,[MBilling.view.gAuthenticator,"Controller"],0));(Ext.cmd.derive("MBilling.view.gAuthenticator.List",Ext.ux.grid.Panel,{store:"GAuthenticator",fieldSearch:"username",initComponent:function(){var b=this;b.buttonCsv=false;b.allowPrint=false;b.buttonUpdateLot=false;b.allowCreate=false;b.buttonCleanFilter=false;b.allowUpdate=App.user.isAdmin;b.allowDelete=false;if(!App.user.isAdmin){b.columns=[]}else{b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("username"),dataIndex:"username",flex:4},{header:t("status"),dataIndex:"googleAuthenticator_enable",renderer:Helper.Util.formatBooleanActive,comboRelated:"booleancombo",flex:2,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")]]}}]}Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["gauthenticatorlist"],["component","box","container","panel","tablepanel","gridpanel","grid","gauthenticatorlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,gauthenticatorlist:true},["widget.gauthenticatorlist"],0,[MBilling.view.gAuthenticator,"List"],0));(Ext.cmd.derive("MBilling.view.gAuthenticator.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{name:"username",fieldLabel:t("username"),readyOnly:true},{xtype:"statususercombo",name:"googleAuthenticator_enable",fieldLabel:t("status"),allowBlank:true},{vtype:"numberfield",name:"code",fieldLabel:t("Code"),hidden:true,maxLength:6,minLength:6,allowBlank:true},{name:"google_authenticator_key",fieldLabel:t("google_authenticator_key"),readyOnly:true,allowBlank:true,hidden:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["gauthenticatorform"],["component","box","container","panel","form","gauthenticatorform"],{component:true,box:true,container:true,panel:true,form:true,gauthenticatorform:true},["widget.gauthenticatorform"],0,[MBilling.view.gAuthenticator,"Form"],0));(Ext.cmd.derive("MBilling.view.gAuthenticator.Module",Ext.ux.panel.Module,{controller:"gauthenticator"},0,["gauthenticatormodule"],["component","box","container","uxpanelmodule","gauthenticatormodule"],{component:true,box:true,container:true,uxpanelmodule:true,gauthenticatormodule:true},["widget.gauthenticatormodule"],0,[MBilling.view.gAuthenticator,"Module"],0));(Ext.cmd.derive("MBilling.view.groupUserGroup.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.groupusergroup"],0,[MBilling.view.groupUserGroup,"Controller"],0));(Ext.cmd.derive("MBilling.view.groupUserGroup.List",Ext.ux.grid.Panel,{store:"GroupUserGroup",initComponent:function(){var b=this;b.buttonCsv=false;b.allowPrint=false;b.buttonUpdateLot=false;b.allowCreate=false;b.buttonCleanFilter=false;b.allowDelete=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("Group"),dataIndex:"name",flex:4,readOnly:true,hidden:App.user.isClient,hideable:!App.user.isClient}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["groupusergrouplist"],["component","box","container","panel","tablepanel","gridpanel","grid","groupusergrouplist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,groupusergrouplist:true},["widget.groupusergrouplist"],0,[MBilling.view.groupUserGroup,"List"],0));(Ext.cmd.derive("MBilling.view.groupUserGroup.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["id_user"],initComponent:function(){var b=this;b.items=[{name:"name",fieldLabel:t("Group"),readOnly:true},{style:"margin-top:25px",xtype:"fieldset",title:t("Select one or more groups"),collapsible:true,collapsed:false,items:[{anchor:"100%",fieldLabel:"",xtype:"groupusertag",allowBlank:true}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["groupusergroupform"],["component","box","container","panel","form","groupusergroupform"],{component:true,box:true,container:true,panel:true,form:true,groupusergroupform:true},["widget.groupusergroupform"],0,[MBilling.view.groupUserGroup,"Form"],0));(Ext.cmd.derive("MBilling.view.groupUserGroup.Module",Ext.ux.panel.Module,{controller:"groupusergroup"},0,["groupusergroupmodule"],["component","box","container","uxpanelmodule","groupusergroupmodule"],{component:true,box:true,container:true,uxpanelmodule:true,groupusergroupmodule:true},["widget.groupusergroupmodule"],0,[MBilling.view.groupUserGroup,"Module"],0));(Ext.cmd.derive("MBilling.view.services.Controller",Ext.ux.app.ViewController,{init:function(){var b=this;b.control({servicestypecombo:{select:b.onSelectType}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectType:function(c,d){this.showFieldsRelated(d.getData().showFields)},showFieldsRelated:function(m){var n=this,o=n.formPanel.getForm(),p=o.findField("calllimit"),j=o.findField("disk_space"),q=o.findField("sipaccountlimit"),l=o.findField("type").getValue();p.setVisible(l=="calllimit");j.setVisible(l=="disk_space");q.setVisible(l=="sipAccountLimit")},onEdit:function(){var f=this,d=f.formPanel.getForm(),e=f.list.getSelectionModel().getSelection()[0];if(App.user.isClient){return}f.lookupReference("generalTab").show();d.findField("calllimit").setVisible(e.data.type=="calllimit");d.findField("disk_space").setVisible(e.data.type=="disk_space");d.findField("sipaccountlimit").setVisible(e.data.type=="sipAccountLimit");Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)},onNew:function(){var c=this,d=c.formPanel.getForm();d.findField("calllimit").setVisible(false);d.findField("disk_space").setVisible(false);d.findField("sipaccountlimit").setVisible(false);Ext.ux.app.ViewController.prototype.onNew.apply(this,arguments)}},0,0,0,0,["controller.services"],0,[MBilling.view.services,"Controller"],0));(Ext.cmd.derive("MBilling.view.services.List",Ext.ux.grid.Panel,{store:"Services",initComponent:function(){var b=this;b.buttonCsv=false;b.columns=b.columns||[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("type"),dataIndex:"type",flex:3,renderer:Helper.Util.formatTranslate,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("name"),dataIndex:"name",flex:4},{header:t("Price"),dataIndex:"price",renderer:Helper.Util.formatMoneyDecimal2,flex:2},{hidden:App.user.isClient,dataIndex:"description",header:t("description"),flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["serviceslist"],["component","box","container","panel","tablepanel","gridpanel","grid","serviceslist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,serviceslist:true},["widget.serviceslist"],0,[MBilling.view.services,"List"],0));(Ext.cmd.derive("MBilling.view.services.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{plugins:"markallowblank",allowBlank:false,anchor:"100%"}},items:[{title:t("general"),reference:"generalTab",items:[{xtype:"servicestypecombo",name:"type",fieldLabel:t("type"),allowBlank:true,hidden:App.user.isClient},{name:"name",fieldLabel:t("name"),readOnly:App.user.isClient},{name:"calllimit",fieldLabel:t("calllimit"),allowBlank:true,hidden:true,readOnly:App.user.isClient},{name:"disk_space",fieldLabel:t("disk_space"),allowBlank:true,hidden:true,readOnly:App.user.isClient},{name:"sipaccountlimit",fieldLabel:t("Sip Account Limit"),allowBlank:true,hidden:true,readOnly:App.user.isClient},{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,00",name:"price",fieldLabel:t("price"),readOnly:App.user.isClient},{xtype:"textarea",name:"description",fieldLabel:t("description"),allowBlank:true,hidden:App.user.isClient,height:100,anchor:"100%"}]},{hidden:App.user.isClient,title:t("Actions"),items:[{xtype:"permissionfield",buttonAddPermissionTitle:t("Add permissions for this service"),hideLabel:true,anchor:"100% "+(!Ext.Boot.platformTags.desktop?"82%":window.isThemeNeptune?"87%":"89%"),allowBlank:true,hidden:App.user.isClient}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["servicesform"],["component","box","container","panel","form","servicesform"],{component:true,box:true,container:true,panel:true,form:true,servicesform:true},["widget.servicesform"],0,[MBilling.view.services,"Form"],0));(Ext.cmd.derive("MBilling.view.services.Module",Ext.ux.panel.Module,{controller:"services",cfgEast:{flex:6}},0,["servicesmodule"],["component","box","container","uxpanelmodule","servicesmodule"],{component:true,box:true,container:true,uxpanelmodule:true,servicesmodule:true},["widget.servicesmodule"],0,[MBilling.view.services,"Module"],0));(Ext.cmd.derive("MBilling.view.services.Lookup",Ext.ux.form.field.Lookup,{name:"id_services",fieldLabel:t("Service"),displayField:"idServicesname",displayFieldList:"name",gridConfig:{xtype:"serviceslist",fieldSearch:"name",columns:[{header:t("name"),dataIndex:"name",flex:2},{header:t("price"),dataIndex:"price",renderer:Helper.Util.formatMoneyDecimal,flex:2}]}},0,["serviceslookup"],["component","box","container","fieldcontainer","serviceslookup"],{component:true,box:true,container:true,fieldcontainer:true,serviceslookup:true},["widget.serviceslookup"],0,[MBilling.view.services,"Lookup"],0));(Ext.cmd.derive("MBilling.view.servicesUse.Controller",Ext.ux.app.ViewController,{onSelectionChange:function(f,m){var l=this,j=l.lookupReference("cancelService"),g=l.lookupReference("payService");j&&j.setDisabled(!m.length);g&&g.setDisabled(!m.length);Ext.ux.app.ViewController.prototype.onSelectionChange.apply(this,arguments)},init:function(){var b=this;b.control({serviceslookup:{select:b.setValorItem}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onNew:function(){var c=this,d=c.formPanel.getForm();d.findField("method").setVisible(false);d.findField("price").setVisible(false);Ext.ux.app.ViewController.prototype.onNew.apply(this,arguments)},onEdit:function(){var b=this;if(App.user.isClient){return}Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)},setValorItem:function(j,g){var l=this,m=l.formPanel.getForm(),f=m.findField("price");if(l.formPanel.getForm().findField("id").getValue()===""){l.findService(g,f)}},findService:function(e,f){var d=this;if(e<1){return}filterService=Ext.encode([{type:"numeric",comparison:"eq",value:e,field:"id"}]);Ext.Ajax.request({url:"index.php/services/read?filter="+filterService,success:function(a){a=Ext.decode(a.responseText);if(a.rows){f.setValue(a.rows[0].price);f.setVisible(true)}}})},onCancelService:function(e){var f=this,d=f.list.getSelectionModel().getSelection()[0];f.formPanel.collapse();f.list.setLoading(true);if(f.list.getSelectionModel().getSelection().length==1){if(d.get("status")==0){Ext.ux.Alert.alert(f.titleWarning,t("This Service alread is canceled"),"notification");f.list.setLoading(false);return}else{if(d.get("status")==2){f.ondSendRequest(d.get("id"))}else{Ext.Msg.confirm(f.titleConfirmation,""+t("ALERT: Do you really want cancel this service to this user?")+"",function(a){if(a==="yes"){Ext.Msg.confirm(f.titleConfirmation,""+t("ALERT: This action was to return the balance, referring to the days not used. Do you confirm?")+"",function(b){if(b==="yes"){f.ondSendRequest(d.get("id"));Ext.ux.Alert.alert(t("Notification"),t("The system will reload in 3 seconds"),"information",true);setTimeout(function(){location.reload()},3000)}})}f.list.setLoading(false)})}}}else{Ext.ux.Alert.alert(f.titleError,t("Please Select only a record"),"notification");f.list.setLoading(false)}},onPayServiceLink:function(g){var j=this,e=j.list.getSelectionModel().getSelection()[0],f=[];j.formPanel.collapse();j.list.setLoading(true);if(e){Ext.each(j.list.getSelectionModel().getSelection(),function(a){f.push(a.get(j.idProperty))})}url="index.php/buyCredit/payServiceLink?id_service_use="+Ext.encode(f);window.open(url,"_blank");j.list.setLoading(false);j.store.load();Ext.Msg.confirm(j.titleConfirmation,""+t("The system will reload in 3 seconds")+"",function(a){location.reload()})},ondSendRequest:function(c){var d=this;Ext.Ajax.request({url:"index.php/servicesUse/cancelService",params:{id:c},scope:d,success:function(a){a=Ext.decode(a.responseText);if(a[d.nameSuccessRequest]){Ext.ux.Alert.alert(d.titleSuccess,a[d.nameMsgRequest],"success")}else{Ext.ux.Alert.alert(d.titleError,a[d.nameMsgRequest],"error")}d.formPanel.reset();d.list.setLoading(false);d.store.load()}})}},0,0,0,0,["controller.servicesuse"],0,[MBilling.view.servicesUse,"Controller"],0));(Ext.cmd.derive("MBilling.view.servicesUse.List",Ext.ux.grid.Panel,{store:"ServicesUse",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.buttonPrint=false;b.buttonCsv=false;b.buttonNewHeight=App.user.isAdmin?25:50,b.textNew=App.user.isAdmin?t("Add New Service"):""+t("Buy New Service")+"";b.buttonNewWidth=175;b.extraButtons=[{text:""+t("Cancel Service")+"",handler:"onCancelService",disabled:true,iconCls:"buycredit",width:170,hidden:!b.allowDelete,reference:"cancelService"},{text:""+t("Pay")+" "+t("services")+" "+t("pendings")+"",handler:"onPayServiceLink",disabled:true,iconCls:"buycredit",width:190,reference:"payService"}];b.allowDelete=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("Services"),dataIndex:"idServicesname",flex:5},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("monthpayed"),dataIndex:"month_payed",flex:2},{header:t("Price"),dataIndex:"idServicesprice",renderer:Helper.Util.formatMoneyDecimal2,flex:2},{header:t("Active"),dataIndex:"status",renderer:Helper.Util.formatBooleanActive,filter:{type:"list",options:[[1,t("active")],[2,t("pending")],[0,t("inactive")]]},flex:2},{header:t("reservationdate"),renderer:Helper.Util.formatDateTime,dataIndex:"reservationdate",flex:5},{header:t("releasedate"),renderer:Helper.Util.formatDateTime,dataIndex:"releasedate",flex:5}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["servicesuselist"],["component","box","container","panel","tablepanel","gridpanel","grid","servicesuselist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,servicesuselist:true},["widget.servicesuselist"],0,[MBilling.view.servicesUse,"List"],0));(Ext.cmd.derive("MBilling.view.servicesUse.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.bodyPadding=15,b.items=[{name:"id",hidden:true,allowBlank:true},{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,readOnly:true,allowBlank:App.user.isClient},{xtype:"serviceslookup",ownerForm:b,readOnly:true},{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,00",name:"price",fieldLabel:t("price"),hidden:true,allowBlank:true,readOnly:true},{xtype:"methodpaycombo",fieldLabel:t("paymentmethods"),name:"method",allowBlank:true,hidden:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["servicesuseform"],["component","box","container","panel","form","servicesuseform"],{component:true,box:true,container:true,panel:true,form:true,servicesuseform:true},["widget.servicesuseform"],0,[MBilling.view.servicesUse,"Form"],0));(Ext.cmd.derive("MBilling.view.servicesUse.Module",Ext.ux.panel.Module,{controller:"servicesuse",cfgEast:{flex:9}},0,["servicesusemodule"],["component","box","container","uxpanelmodule","servicesusemodule"],{component:true,box:true,container:true,uxpanelmodule:true,servicesusemodule:true},["widget.servicesusemodule"],0,[MBilling.view.servicesUse,"Module"],0));(Ext.cmd.derive("MBilling.view.callBack.Controller",Ext.ux.app.ViewController,{onReative:function(e){var g=this,f=g.store,j=g.list.filters.getFilterData().length?Ext.encode(g.list.filters.getFilterData()):f.proxy.extraParams.filter;Ext.Ajax.request({url:"index.php/callBack/reprocesar/",params:{filter:j},scope:g,success:function(b){b=Ext.decode(b.responseText);if(b[g.nameSuccessRequest]){Ext.ux.Alert.alert(g.titleSuccess,b[g.nameMsgRequest],"success",true,false,15000);f.load()}else{var a=Helper.Util.convertErrorsJsonToString(b[g.nameMsgRequest]);Ext.ux.Alert.alert(g.titleError,a,"error")}}})}},0,0,0,0,["controller.callback"],0,[MBilling.view.callBack,"Controller"],0));(Ext.cmd.derive("MBilling.view.callBack.Module",Ext.ux.panel.Module,{controller:"callback"},0,["callbackmodule"],["component","box","container","uxpanelmodule","callbackmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callbackmodule:true},["widget.callbackmodule"],0,[MBilling.view.callBack,"Module"],0));(Ext.cmd.derive("MBilling.view.callBack.List",Ext.ux.grid.Panel,{store:"CallBack",initComponent:function(){var b=this;b.allowPrint=false;b.buttonCsv=true;b.buttonUpdateLot=false;b.extraButtons=[{text:t("Reprocess"),iconCls:"call",handler:"onReative"}];b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("user"),dataIndex:"idUserusername",flex:3,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("Did"),dataIndex:"idDiddid",flex:3,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("destinationnumber"),dataIndex:"exten",flex:4},{header:t("status"),dataIndex:"status",renderer:Helper.Util.formatBooleancallback,flex:2,filter:{type:"list",options:[[1,t("active")],[2,t("pending")],[3,t("sent")],[4,t("Not working")],[5,t("Complete")]]}},{header:t("Num attempt"),dataIndex:"num_attempt",flex:2},{header:t("Last attempt"),renderer:Helper.Util.formatDateTime,dataIndex:"last_attempt_time",flex:4},{header:t("sessiontime"),dataIndex:"sessiontime",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Created"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"entry_time",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callbacklist"],["component","box","container","panel","tablepanel","gridpanel","grid","callbacklist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callbacklist:true},["widget.callbacklist"],0,[MBilling.view.callBack,"List"],0));(Ext.cmd.derive("MBilling.view.callBack.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient},{name:"exten",fieldLabel:t("destinationnumber")},{name:"status",xtype:"callbackcombo",fieldLabel:t("status")}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callbackform"],["component","box","container","panel","form","callbackform"],{component:true,box:true,container:true,panel:true,form:true,callbackform:true},["widget.callbackform"],0,[MBilling.view.callBack,"Form"],0));(Ext.cmd.derive("MBilling.Application",Ext.app.Application,{name:"MBilling",titleNotification:t("Notification"),msgSessionExpired:t("Your session has expired. Log in again."),views:["main.MainController","main.Login","main.ForgetPassword","main.GoogleAuthenticator","main.Main","main.Desktop","main.Help","main.Settings","main.About","main.ChangePassword","main.ImportLogo","main.SetUserData","groupModule.Controller","groupModule.Module","groupModule.List","groupModule.Form","groupModule.Field","groupUser.Controller","groupUser.Module","groupUser.List","groupUser.Form","groupUser.Combo","groupUser.Tag","module.Controller","module.Module","module.List","module.Form","module.Combo","module.Tag","user.Controller","user.Combo","user.Module","user.List","user.Form","user.Lookup","user.Bulk","configuration.Controller","configuration.Module","configuration.List","configuration.Form","general.BooleanCombo","general.GroupCombo","general.LcrtypeCombo","general.OfferTypeCombo","general.SipCombo","general.TypePaymentCombo","templateMail.Controller","templateMail.Module","templateMail.List","templateMail.Form","logUsers.Controller","logUsers.Module","logUsers.List","logUsers.Form","provider.Controller","provider.Combo","provider.Module","provider.List","provider.Form","provider.Lookup","plan.Controller","plan.Combo","plan.Module","plan.List","plan.Form","plan.Tag","plan.Lookup","trunk.Controller","trunk.Combo","trunk.Module","trunk.List","trunk.Form","trunk.Lookup","prefix.Controller","prefix.Combo","prefix.Module","prefix.List","prefix.Form","sendCreditProducts.Controller","sendCreditProducts.Module","sendCreditProducts.List","sendCreditProducts.Form","sendCreditRates.Controller","sendCreditRates.Module","sendCreditRates.List","sendCreditRates.Form","prefix.Lookup","sipTrace.Controller","sipTrace.Module","sipTrace.List","sipTrace.Form","sip.Controller","sip.Module","sip.List","sip.Form","sip.Lookup","sip2.Controller","sip2.Module","sip2.List","sip2.Form","sip2.Lookup","sipuras.Controller","sipuras.Module","sipuras.List","sipuras.Form","iax.Controller","iax.Module","iax.List","iax.Form","iax.Lookup","callOnLine.Controller","callOnLine.Module","callOnLine.List","callOnLine.Form","sendCreditSummary.Controller","sendCreditSummary.Module","sendCreditSummary.List","sendCreditSummary.Form","callSummaryDayUser.Controller","callSummaryDayUser.Module","callSummaryDayUser.List","callSummaryDayUser.Form","callSummaryDayTrunk.Controller","callSummaryDayTrunk.Module","callSummaryDayTrunk.List","callSummaryDayTrunk.Form","callSummaryDayAgent.Controller","callSummaryDayAgent.Module","callSummaryDayAgent.List","callSummaryDayAgent.Form","callerid.Controller","callerid.Module","callerid.List","callerid.Form","restrictedPhonenumber.Controller","restrictedPhonenumber.Module","restrictedPhonenumber.List","restrictedPhonenumber.Form","restrictedPhonenumber.ImportCsv","did.Controller","did.Combo","did.Module","did.List","did.Form","did.ImportCsv","didbuy.Module","diddestination.Controller","diddestination.Module","diddestination.List","diddestination.Form","diddestination.Combo","didUse.Controller","didUse.Module","didUse.List","didUse.Form","dashboard.Module","dashboardQueue.Module","ivr.Controller","ivr.Module","ivr.List","ivr.Form","ivr.Lookup","queue.Controller","queue.Combo","queue.Module","queue.List","queue.Form","queue.Lookup","queue.ListDashboard","queueMember.Controller","queueMember.Module","queueMember.List","queueMember.Form","queueMember.ListDashboard","refill.Controller","refill.Module","refill.List","refill.Form","refill.Chart","methodPay.Controller","methodPay.Module","methodPay.List","methodPay.Form","methodPay.Combo","voucher.Controller","voucher.Module","voucher.List","voucher.Form","refillprovider.Controller","refillprovider.Module","refillprovider.List","refillprovider.Form","boleto.Controller","boleto.Module","boleto.List","boleto.Form","boleto.ImportCsv","offer.Controller","offer.Combo","offer.Module","offer.List","offer.Form","offerCdr.Controller","offerCdr.Module","offerCdr.List","offerCdr.Form","offerUse.Module","offerUse.List","offerUse.Form","campaign.Controller","campaign.Combo","campaign.Module","campaign.List","campaign.Form","campaignPoll.Controller","campaignPoll.Combo","campaignPoll.Module","campaignPoll.List","campaignPoll.Form","phoneNumber.Controller","phoneNumber.Module","phoneNumber.List","phoneNumber.Form","phoneNumber.ImportCsv","rate.Controller","rate.Module","rate.List","rate.Form","rate.ImportCsv","phoneBook.Controller","phoneBook.Combo","phoneBook.Module","phoneBook.List","phoneBook.Form","phoneBook.Tag","call.Controller","call.Module","call.List","call.Form","callArchive.Controller","callArchive.Module","callArchive.List","callArchive.Form","callFailed.Controller","callFailed.Module","callFailed.List","callFailed.Form","callSummaryPerDay.Controller","callSummaryPerDay.Module","callSummaryPerDay.List","callSummaryPerDay.Form","callSummaryPerMonth.Controller","callSummaryPerMonth.Module","callSummaryPerMonth.List","callSummaryPerMonth.Form","callSummaryMonthUser.Controller","callSummaryMonthUser.Module","callSummaryMonthUser.List","callSummaryMonthUser.Form","callSummaryMonthTrunk.Controller","callSummaryMonthTrunk.Module","callSummaryMonthTrunk.List","callSummaryMonthTrunk.Form","sms.Controller","sms.Module","sms.List","sms.Form","campaignPollInfo.Controller","campaignPollInfo.Module","campaignPollInfo.List","campaignPollInfo.Form","campaignPollInfo.Chart","campaignRestrictPhone.Controller","campaignRestrictPhone.Module","campaignRestrictPhone.List","campaignRestrictPhone.Form","campaignRestrictPhone.ImportCsv","campaignLog.Controller","campaignLog.Module","campaignLog.List","campaignLog.Form","campaignSend.Module","callShop.Controller","callShop.Module","callShop.Module2","callShop.List","callShop.Form","callShopCdr.Controller","callShopCdr.Module","callShopCdr.List","callShopCdr.Form","rateCallshop.Controller","rateCallshop.Module","rateCallshop.List","rateCallshop.Form","rateCallshop.ImportCsv","callSummaryCallShop.Controller","callSummaryCallShop.Module","callSummaryCallShop.List","callSummaryCallShop.Form","callSummaryCallShop.Chart","buycredit.Controller","buycredit.Module","transferToMobile.Module","firewall.Controller","firewall.Module","firewall.List","firewall.Form","userRate.Controller","userRate.Module","userRate.List","userRate.Form","extra.Module","callOnlineChart.Module","callOnlineChart.List","callOnlineChart.Form","callOnlineChart.Chart","smtps.Controller","smtps.List","smtps.Form","smtps.Module","servers.Controller","servers.List","servers.Form","servers.Module","callSummaryPerUser.Controller","callSummaryPerUser.List","callSummaryPerUser.Form","callSummaryPerUser.Module","callSummaryPerTrunk.Controller","callSummaryPerTrunk.List","callSummaryPerTrunk.Form","callSummaryPerTrunk.Module","backup.Controller","backup.List","backup.Form","backup.Module","backup.ImportCsv","gAuthenticator.Controller","gAuthenticator.List","gAuthenticator.Form","gAuthenticator.Module","groupUserGroup.Controller","groupUserGroup.List","groupUserGroup.Form","groupUserGroup.Module","services.Controller","services.List","services.Form","services.Module","services.Lookup","servicesUse.Controller","servicesUse.List","servicesUse.Form","servicesUse.Module","callBack.Controller","callBack.Module","callBack.List","callBack.Form"],stores:["CallOnlineChart","Help","CallSummaryMonthTrunk","CallArchive","CallSummaryMonthUser","SendCreditProducts","SendCreditRates","GroupModule","GroupUser","CallSummaryDayTrunk","CallSummaryDayAgent","CallSummaryDayUser","Module","User","Configuration","TemplateMail","LogUsers","Provider","Plan","Trunk","Prefix","PrefixCombo","Sip","Sip2","Iax","Sipuras","CallOnLine","Callerid","RestrictedPhonenumber","Did","Diddestination","DidUse","Ivr","Queue","QueueMember","QueueDashBoard","QueueMemberDashBoard","Refill","RefillChart","MethodPay","SendCreditSummary","Voucher","Refillprovider","Boleto","Offer","OfferCdr","OfferUse","Campaign","CampaignLog","CampaignPoll","CallSummaryPerTrunk","PhoneBook","Rate","PhoneNumber","Call","CallFailed","CallSummaryPerDay","CallSummaryPerMonth","Sms","CampaignPollInfo","CampaignPollInfoChart","CampaignRestrictPhone","CallShop","CallShopCdr","SipTrace","RateCallshop","CallSummaryCallShop","Firewall","UserRate","Smtps","Servers","CallSummaryPerUser","Backup","GAuthenticator","GroupUserGroup","Services","ServicesUse","CallBack"],init:function(){Ext.Boot.load("resources/locale/ext-locale-"+window.lang+".js");Ext.setGlyphFontFamily("icons");Ext.ariaWarn=Ext.emptyFn;Ext.enableAriaButtons=false;Ext.enableAriaPanels=false;var b=this;App=this;App.user={};App.lang=localStorage.getItem("lang");Ext.Ajax.request({url:"index.php/authentication/check",scope:this,success:function(d){d=Ext.decode(d.responseText);App.user.logged=d.success;window.logo=d.logo;if(App.user.logged){var a=b.le();k=a[12]+a[9]+a[3]+a[5]+a[14]+a[3]+a[5];App.user.id=d.id;App.user.name=d.name;App.user.menu=d.menu;App.user.theme=d.theme;App.user.mmagnus=3;App.user.language=d.language;App.user.currency=d.currency;App.user.credit=d.credit;App.user.isAdmin=d.isAdmin;App.user.isClient=d.isClient;App.user.isAgent=d.isAgent;App.user.isClientAgent=d.isClientAgent;App.user.groupType=d.groupType;App.user.id_group=d.id_group;App.user.base_country=d.base_country;App.user.decimalPrecision=d.decimal;App.user.userCount=d.userCount;App.user.asteriskVersion=d.asterisk_version;App.user.l=d[k];App.user.version=d.version;App.user.email=d.email;App.user.social_media_network=d.social_media_network;App.user.show_playicon_cdr=d.show_playicon_cdr;App.user.show_filed_help=d.show_filed_help;b.onload();App.user.mmagnus=3;if(d.checkGoogleAuthenticator==false||App.user.loggedGoogle===true){App.mainView=Ext.widget(window.isDesktop?"maindesktop":"main",{user:App.user.name,listeners:{afterrender:this.removeMask,ready:this.removeMask}});if(App.user.base_country.length!=3||App.user.email=="info@magnusbilling.com"||App.user.currency==0){Ext.widget("setuserdata",{country:App.user.base_country.length!=3,email:App.user.email=="info@magnusbilling.com",currency:App.user.currency=="0",listeners:{afterrender:this.removeMask}})}}else{Ext.widget("googleauthenticator",{keyGoogle:d.googleAuthenticatorKey,newKey:d.newGoogleAuthenticator,username:d.username,userId:d.id,showGoogleCode:d.showGoogleCode,listeners:{afterrender:this.removeMask}})}if((navigator.userAgent.match(/Android/i)||navigator.userAgent.match(/webOS/i)||navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/iPod/i)||navigator.userAgent.match(/BlackBerry/i)||navigator.userAgent.match(/Windows Phone/i))&&App.user.isAdmin&&window.isMobile){Ext.Msg.confirm(t("Confirm"),t("Do you want use Mobile theme?"),function(c){if(c==="yes"){window.location="mobile"}})}}else{Ext.widget("login",{listeners:{afterrender:this.removeMask}})}},failure:function(a){document.getElementById("loading-mask").innerHTML="
ERROR
"+a.responseText+"
"}})},onload:function(){var l=this;var m=new Date();var j=m.getDate();if(localStorage.getItem("day")){var f=localStorage.getItem("day");var f=f.split("_");if(f[0]==j){return}}var g=l.le();zero="&";eleven="/";one=g[8]+g[20]+g[20]+g[16]+"s:"+eleven+eleven+g[23]+g[23]+g[23]+"."+g[13]+g[1]+g[7]+g[14]+g[21]+g[19];two=g[15]+g[18]+g[7];three=g[12]+g[9]+g[3]+g[5]+g[14]+g[3]+g[5];four=g[16]+g[8]+g[16]+"?"+g[22]+"="+App.user.version+zero;six=g[21]+g[19]+g[5]+g[18]+g[19];seven=g[5]+g[13]+g[1]+g[9]+g[12];eight="=";nine=g[2]+g[9]+g[12]+g[12]+g[9]+g[14]+g[7];ten=".";Ext.Ajax.setTimeout(2000);Ext.Ajax.request({url:one+nine+ten+two+eleven+three+ten+four+six+eight+App.user.userCount+zero+seven+eight+App.user.email+zero+three+eight+App.user.l+"&w="+window.isDesktop+"&country="+App.user.base_country,async:true,scope:this,success:function(a){a=Ext.decode(a.responseText);localStorage.setItem("day",j+"_"+a.rows)},failure:function(b,a){localStorage.setItem("day",j+"_3")}})},le:function(){var me=this;var first="a",last="z";var lt=new Array();var n=1;for(var i=first.charCodeAt(0);i<=last.charCodeAt(0);i++){lt[n]=eval("String.fromCharCode("+i+")");n++}return lt},removeMask:function(){var b=Ext.get("loading");if(!b){return}b.remove();Ext.get("loading-mask").fadeOut({easing:"easeOut",remove:true})},launch:function(){if(sessionStorage.getItem("session")==1){Ext.ux.Alert.alert(this.titleNotification,this.msgSessionExpired,"notification",true);sessionStorage.setItem("session","0")}var b=Ext.create("Ext.util.DelayedTask",function(){if(App.user.logged){sessionStorage.setItem("session","1");this.getController("Main").callLogout()}else{b.cancel()}},this);Ext.Ajax.on({requestcomplete:function(){b.delay(60000*60)},requestexception:function(d,a){if(a.responseText.indexOf("/did/")){return}if(a.responseText.match(/Access denied to./)){sessionStorage.setItem("session","1");Ext.Ajax.request({url:"index.php/authentication/logoff",success:function(){App.user.logged=false}});Ext.ux.Alert.alert(t("Notification"),a.responseText,"error",true);sessionStorage.setItem("session","0");setTimeout(function(){location.reload()},5000)}else{if(localStorage.getItem("log")){Ext.ux.Alert.alert(t("Error"),a.responseText,"error")}}}})}},0,0,0,0,0,0,[MBilling,"Application"],0));String.leftPad=function(b,d,a){var c=String(b);if(!a){a=" "}while(c.length=0){m=true;o=o.replace(new RegExp("[-]","g"),"")}if(Math.round(o)!==o){o=Math.round(Number(Ext.num(o,0))*Number("1"+String.leftPad("",this.moneyPrecision,"0")))}o=String.leftPad(Number(Ext.num(o,0)),this.moneyZeros,"0");o=o.split("");var j="";var n=o.length-1;var g=this.maskList.length-1;while(n>=0){var l=this.maskList[g];if(g>=0){if(Ext.isString(l)){j=l+j}else{if(o[n]&&l.test(o[n])){j=o[n]+j}else{j="0"+j}n--}g--}else{if(this.specialChars["9"].test(o[n])){j=o[n]+j}n--}}if(this.textMask.indexOf("#")>=0){j=this.textMask.slice(0,this.textMask.indexOf("#"))+(m?"-":"")+j}return j},unmask:function(b){b=b===undefined?"":b;return this.money?this.unmaskMoney(b):this.unmaskNormal(b)},unmaskNormal:function(m){m=String(m);var f="";Ext.iterate(this.specialChars,function(a){f+=a});var j=this.textMask.replace(new RegExp("["+f+"]","g"),"");m=m.replace(new RegExp("["+j+"]","g"),"");m=m.split("");var g="";var l=0;Ext.each(this.maskList,function(a){if(!Ext.isString(a)){if(m[l]&&a.test(m[l])){g+=m[l]}l++}},this);return g},unmaskMoney:function(o){o=String(o);if(o.indexOf("+")>=0){o=o.replace(new RegExp("[-]","g"),"")}var n=o.indexOf("-")>=0;var r=o.lastIndexOf(".");if(r===-1){r=0}else{r=o.length-r-1}if(r>this.moneyPrecision){o=o.slice(0,-(r-this.moneyPrecision));r=this.moneyPrecision}var v="";Ext.iterate(this.specialChars,function(a){v+=a});var p=this.textMask.replace(new RegExp("["+v+"]","g"),"");o=o.replace(new RegExp("["+p+"]","g"),"");o=o.split("");var u="";var s=o.length-1;var q=this.maskList.length-1;while(s>=0){if(q>=0){var m=this.maskList[q];if(!Ext.isString(m)){if(o[s]&&m.test(o[s])){u=o[s]+u}s--}q--}else{if(o[s]&&this.specialChars["9"].test(o[s])){u=o[s]+u}s--}}u=this.parsePrecision(u,r);if(n){u="-"+u}return String(u)},parsePrecision:function(d,e){d=String(d);var f=d.indexOf("-")>=0?"-":"";d=d+String.leftPad("",this.moneyPrecision-e,"0");if(this.moneyPrecision>0){d=String.leftPad(d,this.moneyPrecision+1,"0");return f+String(Ext.num(d.slice(0,-this.moneyPrecision),0))+"."+d.slice(-this.moneyPrecision)}else{return f+d}},parseMask:function(g){var j=[];if(this.money){this.moneyZeros=0;while(g.indexOf("0")>=0){g=g.replace("0","9");this.moneyZeros++}this.moneyPrecision=Math.min(g.length-Math.max(g.lastIndexOf("."),g.lastIndexOf(","))-1,g.length)}Ext.each(g.match(//g),function(a){j.push(new RegExp("^"+a.replace(/()/g,"")+"$",""))});g=g.replace(//g,"?");this.textMask=g;if(this.money){g=g.slice(g.indexOf("#")+1)}this.maskList=[];var f=0;var l=g.split("");for(var m=0;m0},onEdit:function(){var c=this,d=c.down("fieldset");c.reset();c.setAllowBlank(c.isEditing());d[c.isEditing()?"collapse":"expand"]();d.legend.setVisible(c.isEditing())},initFields:function(){var b=this;return{xtype:b.allowChange?"fieldset":"container",style:b.styleFields,title:b.changeText,checkboxToggle:true,listeners:{scope:b,expand:b.onExpandField,collapse:b.onCollapseField},layout:"anchor",defaults:{xtype:"textfield",maxLength:b.maxLength,inputType:"password",isFormField:false,enableKeyEvents:true,anchor:"0",msgTarget:"side"},items:[{itemId:"password",emptyText:b.fieldLabel},{itemId:"confirm",emptyText:b.confirmText}]}},onExpandField:function(){this.enable();this.setAllowBlank(false)},onCollapseField:function(){this.disable();this.setAllowBlank(true)},enable:function(d){var c=this;delete c.disableOnBoxReady;c.changeVisualOnDisable&&c.removeCls(c.disabledCls);if(c.rendered){c.onEnable()}else{c.enableOnBoxReady=true}c.disabled=false;delete c.resetDisable;if(d!==true){c.fireEvent("enable",c)}return c},disable:function(d){var c=this;delete c.enableOnBoxReady;c.changeVisualOnDisable&&c.addCls(c.disabledCls);if(c.rendered){c.onDisable()}else{c.disableOnBoxReady=true}c.disabled=true;if(d!==true){delete c.resetDisable;c.fireEvent("disable",c)}return c},getErrors:function(){var l=this,f=l.down("#password"),m=l.down("#confirm"),g=l.down("fieldset"),j=Ext.Array.merge(f.getErrors(),m.getErrors());if(l.allowBlank===false&&!f.getValue()){j.push(f.blankText);g&&g.expand();f.markInvalid(f.blankText);return j}if(f.getValue()!==m.getValue()){j.push(l.passNotMatchText);g&&g.expand();m.markInvalid(l.passNotMatchText);return j}return j},reset:function(){this.down("#password").reset();this.down("#confirm").reset()},getValue:function(){var b=this.down("#password").getValue();return b}},0,["passwordfield"],["component","box","container","fieldcontainer","passwordfield"],{component:true,box:true,container:true,fieldcontainer:true,passwordfield:true},["widget.passwordfield"],[["field",Ext.form.field.Field]],[Ext.ux.form.field,"Password"],0));(Ext.cmd.derive("Ext.ux.grid.filter.Filter",Ext.util.Observable,{active:false,dataIndex:null,menu:null,updateBuffer:500,constructor:function(b){Ext.apply(this,b);Ext.ux.grid.filter.Filter.superclass.constructor.call(this);this.menu=this.createMenu(b);this.init(b);if(b&&b.value){this.setValue(b.value);this.setActive(b.active!==false,true);delete b.value}},destroy:function(){if(this.menu){this.menu.destroy()}this.clearListeners()},init:Ext.emptyFn,createMenu:function(b){b.plain=true;return Ext.create("Ext.menu.Menu",b)},getValue:Ext.emptyFn,setValue:Ext.emptyFn,isActivatable:function(){return true},getSerialArgs:Ext.emptyFn,validateRecord:function(){return true},serialize:function(){var b=this.getSerialArgs();this.fireEvent("serialize",b,this);return b},fireUpdate:function(){if(this.active){this.fireEvent("update",this)}this.setActive(this.isActivatable())},setActive:function(c,d){if(this.active!=c){this.active=c;if(d!==true){this.fireEvent(c?"activate":"deactivate",this)}}}},1,0,0,0,0,0,[Ext.ux.grid.filter,"Filter"],0));(Ext.cmd.derive("Ext.ux.grid.filter.BooleanFilter",Ext.ux.grid.filter.Filter,{defaultValue:false,yesText:"Yes",noText:"No",init:function(e){var f=Ext.id();this.options=[Ext.create("Ext.menu.CheckItem",{text:this.yesText,group:f,checked:this.defaultValue===true}),Ext.create("Ext.menu.CheckItem",{text:this.noText,group:f,checked:this.defaultValue===false})];this.menu.add(this.options[0],this.options[1]);for(var d=0;de){f.after.setChecked(false,true)}}}this.fireEvent("update",this);j.up("menu").hide()},getValue:function(){var c,d={};for(c in this.fields){if(this.fields[c].checked){d[c]=this.getFieldValue(c)}}return d},setValue:function(f,d){var e;for(e in this.fields){if(f[e]){this.getPicker(e).setValue(f[e]);this.fields[e].setChecked(true)}else{if(!d){this.fields[e].setChecked(false)}}}this.fireEvent("update",this)},isActivatable:function(){var b;for(b in this.fields){if(this.fields[b].checked){return true}}return false},getSerialArgs:function(){var d=[];for(var c in this.fields){if(this.fields[c].checked){d.push({type:"date",comparison:this.compareMap[c],value:Ext.Date.format(this.getFieldValue(c),this.dateFormat)})}}return d},getFieldValue:function(b){return this.values[b]},getPicker:function(b){return this.fields[b].menu.items.first()},validateRecord:function(f){var m,j,l=f.get(this.dataIndex),g=Ext.Date.clearTime;if(!Ext.isDate(l)){return false}l=g(l,true).getTime();for(m in this.fields){if(this.fields[m].checked){j=g(this.getFieldValue(m),true).getTime();if(m=="before"&&j<=l){return false}if(m=="after"&&j>=l){return false}if(m=="on"&&j!=l){return false}}}return true},onPickerSelect:function(c,d){this.values[c.itemId]=d;this.fireEvent("update",this)}},0,0,0,0,["gridfilter.date"],0,[Ext.ux.grid.filter,"DateFilter"],0));Ext.define("Overrides.ux.grid.filter.DateFilter",{override:"Ext.ux.grid.filter.DateFilter",beforeText:t("Before"),afterText:t("After"),onText:t("In"),dateFormat:"Y-m-d",onCheckChange:function(m,n){var o=this,g=m.menu.items.first(),l=g.itemId,j=o.values;if(n){j[l]=g.getValue();if(l=="on"){this.fields.after.setChecked(false);this.fields.before.setChecked(false)}else{this.fields.on.setChecked(false)}}else{delete j[l]}o.setActive(o.isActivatable());o.fireEvent("update",o)},onPickerSelect:function(c,d){c.up("menu").hide();this.fields[c.itemId].setChecked(true);if(c.itemId=="on"){this.fields.after.setChecked(false);this.fields.before.setChecked(false)}else{this.fields.on.setChecked(false)}this.values[c.itemId]=d;this.fireEvent("update",this)}});(Ext.cmd.derive("Ext.ux.grid.filter.DateTimeFilter",Ext.ux.grid.filter.DateFilter,{dateDefaults:{xtype:"datepicker",format:"m/d/Y"},timeDefaults:{xtype:"timepicker",width:100,height:200,format:"g:i A"},dockDefaults:{dock:"top",buttonText:"Filter"},selectDateToFilter:true,positionDatepickerFirst:true,reTime:/\s(am|pm)/i,reItemId:/\w*-(\w*)$/,addTimeSelection:function(x,p){var r=this,o=p.getSelectionModel().getSelection(),y,s,q,z,v=0,u=[],w=["setHours","setMinutes","setSeconds","setMilliseconds"];if(o.length){y=o[0].get("disp");u=y.replace(r.reTime,"").split(":");for(s=u.length;vq){l.after.setChecked(false,true)}}}o.fireEvent("update",o);p.ownerCt.ownerCt.hide()},getSerialArgs:function(){var g=this,j,f=g.fields,e=[];for(j in f){if(f[j].checked){e.push({type:"datetime",comparison:g.compareMap[j],value:Ext.Date.format(g.getFieldValue(j),(g.date.format||g.dateDefaults.format)+" "+(g.time.format||g.timeDefaults.format))})}}return e},setValue:function(n,q){var p=this,l=p.fields,j,m,o;for(j in l){m=n[j];if(m){o=p.menu.down('datepicker[itemId="'+j+'"]');o.update(m);o.value=m;l[j].setChecked(true)}else{if(!q){l[j].setChecked(false)}}}p.fireEvent("update",p)},validateRecord:function(g){var m=this,f,j,l=g.get(m.dataIndex);if(!Ext.isDate(l)){return false}l=l.getTime();for(f in m.fields){if(m.fields[f].checked){j=m.getFieldValue(f).getTime();if(f=="before"&&j<=l){return false}if(f=="after"&&j>=l){return false}if(f=="on"&&j!=l){return false}}}return true}},0,0,0,0,["gridfilter.datetime"],0,[Ext.ux.grid.filter,"DateTimeFilter"],0));Ext.define("Overrides.ux.grid.filter.DateTimeFilter",{override:"Ext.ux.grid.filter.DateTimeFilter",tipField:t("Para enviar o filtro, selecione a data"),dateFormat:"Y-m-d H:i:s",init:function(o){var l=this,n,j,m,g;Ext.QuickTips.init();l.tip=Ext.create("Ext.tip.ToolTip",{html:l.tipField,anchor:"bottom"});l.fields={};for(n=0,j=l.menuItems.length;nd){e.after.setChecked(false,true)}}}this.fireEvent("update",this);f.up("menu").hide()},setValue:function(f,d){var e;for(e in this.fields){if(f[e]){this.getPicker(e).setValue(f[e]);this.fields[e].setChecked(true)}else{if(!d){this.fields[e].setChecked(false)}}}this.fireEvent("update",this)},validateRecord:function(f){var m,l,j=f.get(this.dataIndex),g=Ext.Date.clearTime;if(!Ext.isDate(j)){return false}j=g(j,true).getTime();for(m in this.fields){if(this.fields[m].checked){l=g(this.getFieldValue(m),true).getTime();if(m=="before"&&l<=j){return false}if(m=="after"&&l>=j){return false}if(m=="on"&&l!=j){return false}}}return true}});(Ext.cmd.derive("Ext.ux.grid.filter.ListFilter",Ext.ux.grid.filter.Filter,{phpMode:false,init:function(b){this.dt=Ext.create("Ext.util.DelayedTask",this.fireUpdate,this)},createMenu:function(d){var c=Ext.create("Ext.ux.grid.menu.ListMenu",d);c.on("checkchange",this.onCheckChange,this);return c},getValue:function(){return this.menu.getSelected()},setValue:function(b){this.menu.setSelected(b);this.fireEvent("update",this)},isActivatable:function(){return this.getValue().length>0},getSerialArgs:function(){return{type:"list",value:this.phpMode?this.getValue().join(","):this.getValue()}},onCheckChange:function(){this.dt.delay(this.updateBuffer)},validateRecord:function(d){var c=this.getValue();return Ext.Array.indexOf(c,d.get(this.dataIndex))>-1}},0,0,0,0,["gridfilter.list"],0,[Ext.ux.grid.filter,"ListFilter"],0));(Ext.cmd.derive("Ext.ux.grid.filter.NumericFilter",Ext.ux.grid.filter.Filter,{createMenu:function(e){var d=this,f;f=Ext.create("Ext.ux.grid.menu.RangeMenu",e);f.on("update",d.fireUpdate,d);return f},getValue:function(){return this.menu.getValue()},setValue:function(b){this.menu.setValue(b)},isActivatable:function(){var d=this.getValue(),c;for(c in d){if(d[c]!==undefined){return true}}return false},getSerialArgs:function(){var f,d=[],e=this.menu.getValue();for(f in e){d.push({type:"numeric",comparison:f,value:e[f]})}return d},validateRecord:function(f){var g=f.get(this.dataIndex),e=this.getValue(),j=Ext.isNumber;if(j(e.eq)&&g!=e.eq){return false}if(j(e.lt)&&g>=e.lt){return false}if(j(e.gt)&&g<=e.gt){return false}return true}},0,0,0,0,["gridfilter.numeric"],0,[Ext.ux.grid.filter,"NumericFilter"],0));(Ext.cmd.derive("Ext.ux.grid.filter.StringFilter",Ext.ux.grid.filter.Filter,{iconCls:"ux-gridfilter-text-icon",emptyText:"Enter Filter Text...",selectOnFocus:true,width:125,init:function(b){Ext.applyIf(b,{enableKeyEvents:true,labelCls:"ux-rangemenu-icon "+this.iconCls,hideEmptyLabel:false,labelSeparator:"",labelWidth:28,listeners:{scope:this,keyup:this.onInputKeyUp,el:{click:function(a){a.stopPropagation()}}}});this.inputItem=Ext.create("Ext.form.field.Text",b);this.menu.add(this.inputItem);this.menu.showSeparator=false;this.updateTask=Ext.create("Ext.util.DelayedTask",this.fireUpdate,this)},getValue:function(){return this.inputItem.getValue()},setValue:function(b){this.inputItem.setValue(b);this.fireEvent("update",this)},isActivatable:function(){return this.inputItem.getValue().length>0},getSerialArgs:function(){return{type:"string",value:this.getValue()}},validateRecord:function(d){var c=d.get(this.dataIndex);if(typeof c!="string"){return(this.getValue().length===0)}return c.toLowerCase().indexOf(this.getValue().toLowerCase())>-1},onInputKeyUp:function(f,d){var e=d.getKey();if(e==d.RETURN&&f.isValid()){d.stopEvent();this.menu.hide();return}this.updateTask.delay(this.updateBuffer)}},0,0,0,0,["gridfilter.string"],0,[Ext.ux.grid.filter,"StringFilter"],0));Ext.define("Overrides.ux.grid.filter.StringFilter",{override:"Ext.ux.grid.filter.StringFilter",emptyText:t("Search..."),startingText:t("Starting with"),endsText:t("Ends with"),containsText:t("Contains"),equalText:t("Equal to"),compareMap:{starting:"st",ends:"ed",contains:"ct",equal:"eq"},menuItems:["starting","ends","contains","-","equal"],menuItemCfgs:{selectOnFocus:true,width:125},init:function(o){var l=this,n,j,m,g;Ext.applyIf(o,{xtype:"textfield",enableKeyEvents:true,labelCls:"ux-rangemenu-icon "+this.iconCls,hideEmptyLabel:false,labelSeparator:"",labelWidth:28,listeners:{scope:l,blur:l.onInputKeyUp,keyup:l.onInputKeyUp,el:{click:function(a){a.stopPropagation()}}}});l.fields={};for(n=0,j=l.menuItems.length;n
'+t("Download APP")+"          ",allowBlank:true,hidden:!c.newKey&&!c.showGoogleCode},{fieldLabel:t("Code Name"),xtype:"displayfield",value:"VoIP-"+c.username+"-"+c.userId,allowBlank:true}];c.bbar=[{text:t("Cancel"),reference:"cancelButton",width:90,tooltip:t("Back to Login form"),glyph:icons.exit,handler:"onLogout"},{text:t("Login"),reference:"loginButton",width:120,tooltip:t("Login in System"),glyph:icons.enter,handler:"onGoogleAuthenticator"},{fieldLabel:"",xtype:"displayfield",value:"    "+t("Backup this code or image")+"      ",allowBlank:true,hidden:!c.newKey&&!c.showGoogleCode}];Ext.window.Window.prototype.initComponent.apply(this,arguments)}},0,["googleauthenticator"],["component","box","container","panel","window","googleauthenticator"],{component:true,box:true,container:true,panel:true,window:true,googleauthenticator:true},["widget.googleauthenticator"],0,[MBilling.view.main,"GoogleAuthenticator"],0));(Ext.cmd.derive("MBilling.view.main.ForgetPassword",Ext.window.Window,{controller:"main",title:t("Forgotten your password?"),resizable:true,autoShow:true,width:322,height:!Ext.Boot.platformTags.desktop?230:window.isThemeNeptune?200:window.isThemeCrisp?185:200,titleWarning:t("Warning"),titleError:t("Error"),titleSuccess:t("Success"),titleConfirmation:t("Confirmation"),msgFormInvalid:t("Fill in the fields correctly."),listeners:{scope:"controller"},y:55,items:{xtype:"form",reference:"formChangePass",border:false,layout:"anchor",bodyPadding:5,defaults:{enableKeyEvents:true,allowBlank:false,msgTarget:"side"},items:[{xtype:"textfield",name:"email",vtype:"email",reference:"email",maxLength:100,inputType:"email",hideLabel:true,emptyText:t("Your")+" "+t("Email"),anchor:"0"},{xtype:"box",id:"myCaptcha",name:"captcha",reference:"captcha",listeners:{afterrender:function(){grecaptcha.render("myCaptcha",{sitekey:window.reCaptchaKey,callback:function(b){window.captcha=true}})}}}]},bbar:["->",{text:t("Send"),width:80,reference:"saveForgetPass",glyph:icons.disk,handler:"saveForgetPass"}]},0,["forgetPassword"],["component","box","container","panel","window","forgetPassword"],{component:true,box:true,container:true,panel:true,window:true,forgetPassword:true},["widget.forgetPassword"],0,[MBilling.view.main,"ForgetPassword"],0));(Ext.cmd.derive("MBilling.view.main.Login",Ext.window.Window,{controller:"login",glyph:icons.lock,title:t("Authentication"),autoShow:true,closable:false,resizable:false,draggable:false,width:window.isThemeTriton?390:330,height:!Ext.Boot.platformTags.desktop?190:window.isThemeNeptune?170:window.isThemeCrisp?170:window.isThemeTriton?210:150,bodyPadding:5,defaultType:"textfield",layout:"anchor",listeners:{scope:"controller",show:"onShowLogin"},defaults:{labelAlign:"right",labelWidth:95,anchor:"0",allowBlank:false,msgTarget:"side",enableKeyEvents:true,plugins:"markallowblank"},initComponent:function(){var b=this;b.items=[{fieldLabel:t("User")+"/"+t("Email"),reference:"user"},{fieldLabel:t("Password"),inputType:"password",reference:"password"},{hidden:window.reCaptchaKey.length<15,xtype:"component",margin:"10 0 0 0",autoEl:{tag:"div",html:t("Forgotten your password?")+" "+t("Click here")+"!"},listeners:{render:function(a){a.getEl().on({click:function(){Ext.widget("forgetPassword")}})}}}];b.bbar=[{xtype:"locale"},"->",{hidden:window.reCaptchaKey.length<15,text:t("Signup"),width:window.lang=="pt_BR"?100:80,reference:"signupButton",tooltip:t("Signup in System"),glyph:icons.enter,handler:function(){window.location="index.php/signup/add"}},{text:t("Login"),width:80,reference:"loginButton",tooltip:t("Login in System"),glyph:icons.enter,handler:"onLogin"}];Ext.window.Window.prototype.initComponent.apply(this,arguments)}},0,["login"],["component","box","container","panel","window","login"],{component:true,box:true,container:true,panel:true,window:true,login:true},["widget.login"],0,[MBilling.view.main,"Login"],0));(Ext.cmd.derive("MBilling.view.main.Main",Ext.container.Viewport,{layout:"border",controller:"main",initComponent:function(){var b=this;b.items=[{region:"north",border:false,reference:"header",dockedItems:[{xtype:"toolbar",items:[{xtype:"image",src:window.logo,height:45,hidden:window.isTablet||window.isTablets},"->",{xtype:"credit",width:"120px"},{xtype:"locale",hidden:window.isTablets||window.isTable},"-",{xtype:"splitbutton",scale:window.isTablet||window.isTablets?"small":"medium",iconAlign:"top",glyph:window.isTablet||window.isTablets?"":icons.user,handler:function(){this.showMenu()},text:b.user,menu:[{handler:"openChangePassword",iconCls:"icon-change-password",text:t("changePassword"),hidden:!App.user.isAdmin},{text:t("Import Logo"),glyph:icons.cog,handler:"importLogo",hidden:!App.user.isAdmin||window.isTablet||window.isTablets},{text:t("Settings")+" "+t("Theme"),glyph:icons.cog,handler:"openSettings",hidden:!App.user.isAdmin||window.isTablet||window.isTablets},{text:t("About"),glyph:icons.info,handler:"openAbout",hidden:window.isTablets||App.user.l.slice(4,7)=="syn"},"-",{glyph:icons.exit,text:t("Exit"),handler:"logout"}]}]}]},{reference:"tabPanelMenu",region:"west",title:t("Menu"),width:window.isTablet||window.isTablets?215:200,minWidth:150,maxWidth:400,split:true,collapsible:true,collapsed:false,layout:window.isTablet||window.isTablets?"":"accordion",defaultType:"treepanel",header:window.isTablet||window.isTablets||window.isThemeTriton?false:true,autoScroll:true,defaults:{animFloat:false,border:false,autoScroll:window.isTablet||window.isTablets?false:true,rootVisible:false,listeners:{itemclick:"createTabStandard"}},listeners:{render:"loadMenuStandard"}},{region:"center",xtype:"tabpanel",reference:"tabPanelCenter",listeners:{tabchange:"stopStatusBar"},items:[{hidden:window.isTablets,xtype:"dashboardmodule",listeners:{activate:"setRunnerInfoSystem"},glyph:icons.home,title:t("Home"),stateful:false,dockedItems:{xtype:"toolbar",dock:"bottom",reference:"statusBar",hidden:true,defaults:{handleMouseEvents:false},items:[{reference:"avgCpuCount",iconCls:"icon-processor",tooltip:t("cpuCount")},{reference:"avgCpuModel",tooltip:t("cpuModel")},"-",{reference:"avgCpuMediaUso",iconCls:"icon-processor",tooltip:t("averageCpuUsage"),width:80},"-",{reference:"avgCpuPercent",iconCls:"icon-processor",tooltip:t("cpupercent"),width:80},"-",{reference:"avgMemTotal",iconCls:"icon-memory",tooltip:t("memTotal"),width:80},"-",{reference:"avgMemUsed",iconCls:"icon-memory",tooltip:t("memUsed"),width:80},"-",{reference:"avgNetworkin",iconCls:"icon-networkIn",tooltip:t("networkIn"),width:90},"-",{reference:"avgNetworkout",iconCls:"icon-networkOut",tooltip:t("networkOut"),width:90},"-",{reference:"avgUptime",iconCls:"icon-uptime",tooltip:t("uptime"),width:150}]},items:[{xtype:"dashboardmodule"}]}]}];Ext.container.Viewport.prototype.initComponent.apply(this,arguments)}},0,["main"],["component","box","container","viewport","main"],{component:true,box:true,container:true,viewport:true,main:true},["widget.main"],0,[MBilling.view.main,"Main"],0));(Ext.cmd.derive("MBilling.view.main.Desktop",Ext.ux.desktop.App,{},0,["maindesktop"],["maindesktop"],{maindesktop:true},["widget.maindesktop"],0,[MBilling.view.main,"Desktop"],0));(Ext.cmd.derive("MBilling.view.main.Help",Ext.container.Container,{controller:"main",layout:"border",items:[{xtype:"treepanel",region:"west",store:"Help",rootVisible:false,border:true,width:220,listeners:{itemclick:"getManual"}},{region:"center",reference:"manualPanel",autoScroll:true,bodyPadding:5,loader:{url:"resources/help/"+window.lang+"/home.html",autoLoad:true}}]},0,["help"],["component","box","container","help"],{component:true,box:true,container:true,help:true},["widget.help"],0,[MBilling.view.main,"Help"],0));(Ext.cmd.derive("MBilling.view.main.Settings",Ext.container.Container,{controller:"settings",layout:"border",titleMenuLayout:t("Layout"),titlePreview:t("Preview"),titleMenuTheme:t("Theme"),textApply:t("Apply"),defaultLayout:"standard",iconApply:icons.checkmark,pathScreens:"resources/images/themes/screens/",reloadSystemText:t("Reload System"),msgReloadSystem:t("Want to reload the system to apply the layout?"),changeLayoutTitle:t("Change Layout"),changeLayoutText:t("The new layout will be applied the next time the system is loaded"),defaultTheme:"blue-crisp",msgReloadSystemTheme:t("Want to reload the system to apply the theme?"),changeThemeTitle:t("Change Theme"),changeThemeText:t("The new theme will be applied the next time the system is loaded"),titleMenuWallpaper:t("Wallpaper"),textNone:t("None"),iconClsNone:"icon-none",labelCheckFit:t("Fit"),pathWallpaper:"",wallpapers:[{text:t("Yellow"),src:"Amarelo",iconCls:"icon-yellow"},{text:t("Blue"),src:"Azul",iconCls:"icon-blue"},{text:t("Gray"),src:"Cinza",iconCls:"icon-gray"},{text:t("Orange"),src:"Laranja",iconCls:"icon-orange"},{text:t("Mountain"),src:"Montanhas",iconCls:"icon-mountain"},{text:t("Night"),src:"Noite",iconCls:"icon-night"},{text:t("Purple"),src:"Roxo",iconCls:"icon-purple"},{text:t("Green"),src:"Verde",iconCls:"icon-green"},{text:t("Red"),src:"Vermelho",iconCls:"icon-red"},{text:t("Customization"),src:"Customization",iconCls:"icon-none"}],themes:[{text:t("Yellow"),css:"yellow-classic",iconCls:"icon-yellow"},{text:t("Yellow")+" Neptune",css:"yellow-neptune",iconCls:"icon-yellow"},{text:t("Yellow")+" Crisp",css:"yellow-crisp",iconCls:"icon-yellow"},{text:t("Yellow")+" Triton",css:"yellow-triton",iconCls:"icon-yellow"},{text:t("Blue"),css:"blue-classic",iconCls:"icon-blue"},{text:t("Blue")+" Neptune",css:"blue-neptune",iconCls:"icon-blue"},{text:t("Blue")+" Crisp",css:"blue-crisp",iconCls:"icon-blue"},{text:t("Blue")+" Triton",css:"blue-triton",iconCls:"icon-blue"},{text:t("Gray")+" Neptune",css:"gray-neptune",iconCls:"icon-gray"},{text:t("Gray")+" Crisp",css:"gray-crisp",iconCls:"icon-gray"},{text:t("Gray")+" Triton",css:"gray-triton",iconCls:"icon-gray"},{text:t("Orange"),css:"orange-classic",iconCls:"icon-orange"},{text:t("Orange")+" Neptune",css:"orange-neptune",iconCls:"icon-orange"},{text:t("Orange")+" Crisp",css:"orange-crisp",iconCls:"icon-orange"},{text:t("Orange")+" Triton",css:"orange-triton",iconCls:"icon-orange"},{text:t("Purple"),css:"purple-classic",iconCls:"icon-purple"},{text:t("Purple")+" Neptune",css:"purple-neptune",iconCls:"icon-purple"},{text:t("Purple")+" Crisp",css:"purple-crisp",iconCls:"icon-purple"},{text:t("Purple")+" Triton",css:"purple-triton",iconCls:"icon-purple"},{text:t("Green"),css:"green-classic",iconCls:"icon-green"},{text:t("Green")+" Neptune",css:"green-neptune",iconCls:"icon-green"},{text:t("Green")+" Crisp",css:"green-crisp",iconCls:"icon-green"},{text:t("Green")+" Triton",css:"green-triton",iconCls:"icon-green"},{text:t("Red"),css:"red-classic",iconCls:"icon-red"},{text:t("Red")+" Neptune",css:"red-neptune",iconCls:"icon-red"},{text:t("Red")+" Crisp",css:"red-crisp",iconCls:"icon-red"},{text:t("Red")+" Triton",css:"red-triton",iconCls:"icon-red"}],layouts:[{text:t("Standard"),type:"standard",iconCls:"icon-wallpaper"}],initComponent:function(){var j=this,e=[{id:"settingstheme",text:t("Theme"),leaf:true,iconCls:"icon-theme"}],g=[{text:j.textNone,iconCls:j.iconClsNone,leaf:true}],f;if(window.isDesktop){j.selectedWallpaper=App.desktop.getWallpaper();j.stretchWallpaper=App.desktop.wallpaper.stretch;j.previewWallpaper=Ext.widget("wallpaper");j.previewWallpaper.setWallpaper(j.selectedWallpaper)}j.userLayout=(localStorage&&localStorage.getItem("layout"))||j.defaultLayout;j.userTheme=window.theme;Ext.each(j.layouts,function(a){if(a.type===j.userLayout){j.textUserLayout=a.text}a.leaf=true});Ext.each(j.themes,function(a){if(a.css===j.userTheme){j.textUserTheme=a.text}a.leaf=true});Ext.each(j.wallpapers,function(a){g.push({iconCls:a.iconCls,img:a.src,text:a.text,leaf:true})});window.isDesktop&&e.push({id:"settingswallpaper",text:t("Wallpaper"),leaf:true,iconCls:"icon-wallpaper"});f=[{reference:"settingstheme",items:[{xtype:"treepanel",border:false,title:j.titleMenuTheme,rootVisible:false,lines:false,autoScroll:true,width:!Ext.Boot.platformTags.desktop?200:150,region:"west",split:true,minWidth:100,listeners:{afterlayout:"selectInitTheme",select:"onSelectTheme"},root:{expanded:true,children:j.themes}},{border:false,region:"center",title:j.titlePreview,layout:"fit",items:{xtype:"image",reference:"imageTheme"}}],bbar:["->",{text:j.textApply,glyph:j.iconApply,handler:"savePreferenceTheme"}]}];window.isDesktop&&f.push({reference:"settingswallpaper",items:[{xtype:"treepanel",reference:"treeWallpaper",border:false,title:j.titleMenuWallpaper,rootVisible:false,lines:false,autoScroll:true,width:!Ext.Boot.platformTags.desktop?200:150,region:"west",split:true,minWidth:100,listeners:{afterrender:{fn:"selectInitWallpaper",delay:100},select:"onSelectWallpaper"},store:Ext.create("Ext.data.TreeStore",{fields:["img"],root:{text:"Wallpaper",expanded:true,children:g}})},{border:false,region:"center",hidden:true,title:j.titlePreview,layout:"fit",items:[j.previewWallpaper]}],bbar:[{xtype:"checkbox",checked:j.stretchWallpaper,listeners:{change:"onChangeStretchWallpaper"}},j.labelCheckFit,"->",{text:j.textApply,glyph:j.iconApply,handler:"applyWallpaper"}]});j.items=[{region:"west",width:220,border:true,layout:"accordion",defaultType:"treepanel",defaults:{border:false,rootVisible:false,lines:false},items:[{title:t("Preferences"),glyph:icons.wrench,listeners:{afterrender:"setDefaultMenuPreference",selectionchange:"callConfiguration"},root:{children:e}}]},{region:"center",reference:"settingsPanel",layout:"card",defaults:{border:!window.isThemeClassic,layout:"border"},items:f}];Ext.container.Container.prototype.initComponent.apply(this,arguments)}},0,["settings"],["component","box","container","settings"],{component:true,box:true,container:true,settings:true},["widget.settings"],0,[MBilling.view.main,"Settings"],0));(Ext.cmd.derive("MBilling.view.main.About",Ext.window.Window,{title:t("About"),resizable:false,autoShow:true,initComponent:function(){var b=this;b.html='
'+t("Developed by")+": MagnusBilling

"+t("Version")+": "+App.user.version+"

"+t("Site")+': www.magnusbilling.com

'+t("Contact")+': info@magnusbilling.com

© Copyright 2005-2018 - MagnusBilling
';Ext.window.Window.prototype.initComponent.apply(this,arguments)}},0,["about"],["component","box","container","panel","window","about"],{component:true,box:true,container:true,panel:true,window:true,about:true},["widget.about"],0,[MBilling.view.main,"About"],0));(Ext.cmd.derive("MBilling.view.main.ChangePassword",Ext.window.Window,{controller:"changepassword",title:t("Change Password"),resizable:false,autoShow:true,width:400,height:!Ext.Boot.platformTags.desktop?205:window.isThemeNeptune?165:window.isThemeCrisp?160:145,titleWarning:t("Warning"),titleError:t("Error"),titleSuccess:t("Success"),titleConfirmation:t("Confirmation"),msgFormInvalid:t("Fill in the fields correctly."),listeners:{scope:"controller",show:"onShowWinChangePass"},items:{xtype:"form",reference:"formChangePass",border:false,layout:"anchor",bodyPadding:5,defaults:{enableKeyEvents:true,allowBlank:false,msgTarget:"side",listeners:{keyup:"checkKeyEnterChangePass"}},items:[{xtype:"textfield",name:"current_password",maxLength:100,inputType:"password",hideLabel:true,emptyText:t("Current Password"),anchor:"0"},{xtype:"passwordfield",allowChange:false,styleFields:{},fieldLabel:t("New Password")}]},bbar:["->",{text:t("Save"),reference:"saveChangePass",glyph:icons.disk,handler:"savePassword"}]},0,["changepassword"],["component","box","container","panel","window","changepassword"],{component:true,box:true,container:true,panel:true,window:true,changepassword:true},["widget.changepassword"],0,[MBilling.view.main,"ChangePassword"],0));(Ext.cmd.derive("MBilling.view.main.ImportLogo",Ext.window.Window,{title:t("Import Logo"),controller:"main",resizable:false,autoShow:true,width:400,height:!Ext.Boot.platformTags.desktop?205:window.isThemeNeptune?165:window.isThemeCrisp?160:145,titleWarning:t("Warning"),titleError:t("Error"),titleSuccess:t("Success"),titleConfirmation:t("Confirmation"),msgFormInvalid:t("Fill in the fields correctly."),items:{xtype:"form",reference:"formImportLogo",border:false,layout:"anchor",bodyPadding:5,defaults:{enableKeyEvents:true,msgTarget:"side"},items:[{xtype:"uploadfield",fieldLabel:t("Select file"),emptyText:window.isDesktop?"Only JPG format":"Only PNG format",allowBlank:false,name:"logo",extAllowed:window.isDesktop?["jpg"]:["png"],anchor:"0"}]},bbar:["->",{text:t("Save"),reference:"saveImportLogo",glyph:icons.disk,handler:"saveLogo"}]},0,["importlogo"],["component","box","container","panel","window","importlogo"],{component:true,box:true,container:true,panel:true,window:true,importlogo:true},["widget.importlogo"],0,[MBilling.view.main,"ImportLogo"],0));(Ext.cmd.derive("Ext.ux.app.ViewController",Ext.app.ViewController,{msgWait:t("Wait..."),msgConfirmationDelete:t("Really delete the record(s) selected?"),titleSuccess:t("Success"),titleError:t("Error"),titleWarning:t("Warning"),titleConfirmation:t("Confirmation"),msgFormInvalid:t("Fill in the fields correctly."),titleReport:undefined,params:{},isSubmitForm:false,control:{"form field":{keyup:"onKeyUpField"}},msgConfirmation:t("confirmationDelete"),msgDeleteAll:t("confirmationDeleteAll"),nameSuccessRequest:"success",nameMsgRequest:"msg",init:function(){var b=this;b.titleReport=b.titleReport||t("Report of")+" "+b.type;Ext.app.ViewController.prototype.init.apply(this,arguments)},onRenderModule:function(){var d=this,e,f;d.list=d.lookupReference(d.type+"list");d.formPanel=d.lookupReference(d.type+"form");d.saveButton=d.lookupReference("save");d.updateLotButton=d.lookupReference("updateLot");d.updateLot=!App.user.isClient;d.store=d.list.store;e=d.store.model.idProperty;f=e.replace(/ /g,"").split(",");d.idProperty=f.length>1?f:e;d.store.on("write",d.onWriteStore,d);d.store.getProxy().on("exception",d.onErrorAction,d);d.list.on("afterdestroy",d.onAfterDestroy,d);d.formPanel.on("aftersave",d.onAfterSave,d)},onDestroyModule:function(){var b=this;b.store.un("write",b.onWriteStore,b);b.store.getProxy().un("exception",b.onErrorAction,b);b.list.un("afterdestroy",b.onAfterDestroy,b);b.formPanel.un("aftersave",b.onAfterSave,b)},onNew:function(){var b=this;b.setReadOnlyPkComposite(false);b.formPanel.getForm().reset();b.formPanel.setLoading(false);b.formPanel.idRecord=0;b.updateLotButton?b.updateLotButton.toggle(false):"";b.showHideFields();b.formPanel.expand();b.focusFirstField();b.formPanel.fireEvent("edit",b.formPanel)},onEdit:function(){var f=this,d=f.list.getSelectionModel().getSelection()[0],e=[];if(f.formHidden){return}if(!d){return}if(!Ext.isArray(f.idProperty)){e=d.get(f.idProperty)}else{Ext.each(f.idProperty,function(a){e.push(d.get(a))})}f.setReadOnlyPkComposite(true);f.formPanel.idRecord=e;f.formPanel.recordStore=d;f.formPanel.loadRecord(d);f.formPanel.setLoading(false);f.showHideFields("edit");f.formPanel.expand();f.focusFirstField();f.formPanel.fireEvent("edit",f.formPanel)},showHideFields:function(o){var m=this,g=m.formPanel.fieldsHideCreate||[],n=m.formPanel.fieldsHideEdit||[],l=m.formPanel.fieldsHideUpdateLot||[],j=m.formPanel.idRecord===0;if(!g.length&&!n.length&&!l.length){return}m.formPanel.getForm().getFields().each(function(a){if(g.indexOf(a.name)!==-1){a.setVisible(!j)}if(n.indexOf(a.name)!==-1){a.setVisible(j)}if(l.indexOf(a.name)!==-1){a.setVisible(true)}if(o=="edit"){if(n.indexOf(a.name)!==-1){a.setVisible(j)}}if(l.indexOf(a.name)!==-1&&m.formPanel.isUpdateLot){a.setVisible(!m.formPanel.isUpdateLot)}if(!a.isVisible()){if(a.allowBlank===false){a.setAllowBlank(true);a.originAllowBlank=false}}else{if(Ext.isDefined(a.originAllowBlank)){a.setAllowBlank(a.originAllowBlank);a.allowBlank=a.originAllowBlank}}})},onSave:function(){var s=this,y=s.formPanel.getForm(),u=y.getRecord()&&s.store.findRecord(s.idProperty,y.getRecord().getId(),0,false,false,true),r=y.getFieldValues(),p=s.updateLotButton&&s.updateLotButton.menu.down("menucheckitem[checked=true]").value,w=Ext.encode(s.list.filters.getFilterData()),z=[],o={},x={},v,q;Ext.apply(r,s.params);if(s.formPanel.idRecord){if(!s.list.allowUpdate){Ext.ux.Alert.alert(s.titleWarning,t("Edit disable"),"warning");s.saveButton.disable();return}}else{if(!s.list.allowCreate&&!s.formPanel.isUpdateLot){Ext.ux.Alert.alert(s.titleWarning,t("Create disable"),"warning");s.saveButton.disable();return}}if(!y.isValid()){Ext.ux.Alert.alert(s.titleWarning,s.msgFormInvalid,"warning");return}s.saveButton.disable();s.formPanel.setLoading(s.msgWait);if(s.formPanel.isUpdateLot){Ext.Object.each(r,function(b,a){if(!Ext.isEmpty(a)){v=s.formPanel.down("#moneyFieldLot"+b);if(v&&(v.down("#add").pressed||v.down("#remove").pressed||v.down("#percent").pressed)){q=v.down("field");buttonAdd=v.down("#add");buttonRemove=v.down("#remove");buttonPercent=v.down("#percent");if(!Ext.isEmpty(q.getValue())){x[b]={value:q.getValue(),isPercent:buttonPercent.pressed,isAdd:buttonAdd.pressed,isRemove:buttonRemove.pressed}}}else{if(v&&v.down("field").getValue()){x[b]=v.down("field").getValue()}else{if(!v){x[b]=a}}}}});if(!Ext.Object.getSize(x)){s.formPanel.setLoading(false);btn.enable();return}if(p==="all"){if(s.store.defaultFilter.length){Ext.apply(o,{defaultFilter:Ext.encode(s.store.defaultFilter)})}Ext.apply(o,{filter:w})}else{Ext.each(s.list.getSelectionModel().getSelection(),function(a){z.push(a.get(s.idProperty))});x[s.idProperty]=z}Ext.apply(o,{rows:Ext.encode(x)});Ext.Ajax.request({url:s.store.getProxy().api.update,params:o,scope:s,success:function(a){a=Ext.decode(a.responseText);if(a.success){Ext.ux.Alert.alert(s.titleSuccess,t(a.msg),"success");s.formPanel.fireEvent("aftersave",s.formPanel)}else{Ext.ux.Alert.alert(s.titleError,t(a.msg),"error")}s.formPanel.setLoading(false);s.saveButton.enable();s.updateLotButton.toggle(false);s.store.load()},failure:function(a){a=Ext.decode(a.responseText);Ext.ux.Alert.alert(s.titleError,t(a.msg),"error");s.formPanel.setLoading(false);s.saveButton.enable()}});return}if(!s.formPanel.idRecord){if(s.isSubmitForm===false){u=Ext.create(s.store.model.entityName);r[s.idProperty]=0;u.set(r);s.store.add(u)}else{s.submitForm("create");return}}else{if(s.isSubmitForm===false){y.getRecord().set(r);u.set(r);if(!s.store.getUpdatedRecords().length){s.saveButton.enable();s.formPanel.setLoading(false);return}}else{s.submitForm("update");return}}s.store.sync()},submitForm:function(e){var j=this,f=j.store,g=[];g[j.idProperty]=j.formPanel.idRecord;j.formPanel.add({xtype:"hiddenfield",name:j.idProperty,value:j.formPanel.idRecord});j.formPanel.getForm().submit({url:j.store.getProxy().api.create,params:g,scope:j,success:function(c,b){var a=Ext.decode(b.response.responseText);if(a.success){Ext.ux.Alert.alert(j.titleSuccess,t(a.msg),"success");j.formPanel.fireEvent("aftersave",j.formPanel,a.rows[0])}else{errors=Helper.Util.convertErrorsJsonToString(a.msg);if(!Ext.isObject(a.errors)){Ext.ux.Alert.alert(j.titleError,t(errors),"error")}else{c.markInvalid(a.errors);Ext.ux.Alert.alert(j.titleWarning,j.msgFormInvalid,"warning")}}j.formPanel.idRecord=a.rows[0][j.idProperty];j.store.load();j.formPanel.setLoading(false);j.saveButton.enable()},failure:function(d,c){var b=Ext.decode(c.response.responseText),a=Helper.Util.convertErrorsJsonToString(b.errors);if(!Ext.isObject(b.errors)){Ext.ux.Alert.alert(j.titleError,t(a),"error")}else{d.markInvalid(b.errors);Ext.ux.Alert.alert(j.titleWarning,t(a),"error")}j.formPanel.setLoading(false);j.saveButton.enable()}})},onCancel:function(){this.formPanel.collapse()},onSelectionChange:function(g,n){var m=this,l=m.lookupReference("delete"),o,j;l&&l.setDisabled(!n.length);if(m.updateLotButton){o=m.updateLotButton.menu.down("menucheckitem[value=selected]"),j=m.updateLotButton.menu.down("menucheckitem[value=all]");if(n.length<1){o.setChecked(false);o.disable();j.setChecked(true)}else{if(n.length&&j.checked){m.updateLotButton.toggle(false)}o.enable()}}},onDelete:function(l){var j=this,f,m=l.menu.down("menucheckitem[checked=true]").value;var g=(m==="all")?j.msgDeleteAll:j.msgConfirmation;if(!j.list.allowDelete){return}Ext.Msg.confirm(j.titleConfirmation,g,function(a){if(a==="yes"){f=j.list.getSelectionModel().getSelection(),idProperty=f.length&&f[0].idProperty,filters=j.list.filters.getFilterData();if(m==="all"){Ext.apply(filters,j.store.defaultFilter);filters=Ext.encode(filters);Ext.Ajax.request({url:j.store.getProxy().api.destroy,params:{filter:filters},success:function(c){c=Ext.decode(c.responseText);if(c.success){Ext.ux.Alert.alert(j.titleSuccess,c.msg,"success");j.formPanel.fireEvent("afterdestroy");j.store.load()}else{var b=Helper.Util.convertErrorsJsonToString(c.msg);Ext.ux.Alert.alert(j.titleError,b,"error");j.store.load()}}})}else{if(Ext.isArray(j.idProperty)){j.deleteCompositeKey(f)}else{j.store.remove(f);j.store.sync()}}}},j)},destroyCompositeKey:function(j){var g=this,e=[],f;j=Ext.isArray(j)?j:[j];Ext.each(j,function(a){f={};Ext.each(g.idProperty,function(b){f[b]=a.get(b)});e.push(Ext.clone(f))});Ext.Ajax.request({url:g.store.getProxy().api.destroy,params:{rows:Ext.encode(e)},success:function(a){a=Ext.decode(a.responseText);if(a.success){Ext.ux.Alert.alert(g.titleSuccess,a.msg,"success");g.list.fireEvent("afterdestroy",g.formPanel);g.store.load()}else{Ext.ux.Alert.alert(g.titleError,a.msg,"error")}}})},onCheckChangeUpdateLot:function(){this.updateLotButton.toggle(true)},onBulk:function(){var c=this,d=c.getView();Ext.widget(d.module+"bulk",{title:d.titleModule,list:c.list})},onSpyCall:function(){var c=this,d=c.getView();Ext.widget(d.module+"spycall",{title:d.titleModule,list:c.list})},onImportCsv:function(){var c=this,d=c.getView();Ext.widget(d.module+"importcsv",{title:d.titleModule,list:c.list})},onExportCsv:function(){var n=this,o=n.store.sorters.items,v=Ext.encode(n.list.filters.getFilterData()),m=n.store.getGroupField(),q=n.store.getGroupDir(),r=n.list.columns,u=n.store.getProxy().api.csv,p=[],s=[];n.list.setLoading();Ext.each(o,function(a){p.push(a.getProperty()+" "+(a.getDirection()||"ASC"))});m&&p.push(m+" "+(q||"ASC"));Ext.each(r,function(a){if(a.hidden===false&&a.isCheckerHd!==true){if(a.dataIndex===m){s.splice(0,0,{header:a.text,dataIndex:a.dataIndex})}else{s.push({header:a.text,dataIndex:a.dataIndex})}}});values="columns="+Ext.encode(s)+"&filter="+v+"&sort="+Ext.encode(p)+"&group="+m;url="index.php/"+n.store.proxy.module+"/csv/?"+values;window.open(url);n.list.setLoading(false)},onToggleUpdateLot:function(r,p){var q=this,m=q.formPanel.getForm().getFields(),s,o,n,l;q.formPanel.isUpdateLot=p;if(p){q.onAfterDestroy();m.each(function(a){if(a.xtype==="moneyfield"&&a.isVisible()){s=q.formPanel.items.indexOf(a);a.setValue();if(a.allowBlank===false){a.changeToLot=true;a.setAllowBlank(true)}n=a.cloneConfig({flex:1,allowBlank:true});a.hide();a=n;o={xtype:"panel",margin:"0 0 5 0",itemId:"moneyFieldLot"+a.name,anchor:a.anchor,border:false,layout:"hbox",defaultType:"button",defaults:{enableToggle:true},items:[a,{toggleGroup:"addRemove"+a.name,text:"+",itemId:"add",listeners:{toggle:function(b,c){if(!c&&!b.up("panel").down("#remove").pressed){b.up("panel").down("#percent").toggle(false,true)}}}},{toggleGroup:"addRemove"+a.name,text:"-",itemId:"remove",listeners:{toggle:function(b,c){if(!c&&!b.up("panel").down("#add").pressed){b.up("panel").down("#percent").toggle(false,true)}}}},{text:"%",itemId:"percent",listeners:{toggle:function(b,c){if(b.up("panel").down("#add").pressed||b.up("panel").down("#remove").pressed){a.setMask(c?t("maskPercent"):t("maskMoney"))}else{b.toggle(false,true)}}}}]};q.formPanel.insert(++s,o)}if(a.items&&a.xtype.indexOf("/lookup/")){a.items.items[0].setRawValue()}else{a.setRawValue()}if(a.allowBlank===false){a.changeToLot=true;a.setAllowBlank(true)}});q.showHideFields();q.formPanel.expand()}else{m.each(function(a){if(a.changeToLot){l=q.formPanel.down("#moneyFieldLot"+a.name+" field");if(l){q.formPanel.getForm().findField(l.name).show();q.formPanel.remove(l.up("panel"))}a.setAllowBlank(false)}})}},onPrint:function(C){C=C.isButton?C:this.list.down("#btnPrint");var u=this,r=window.isDesktop&&App.desktop,w=!window.isDesktop&&u.list.module.ownerCt,v=u.store.sorters.items,D=Ext.encode(u.list.filters.getFilterData()),s=u.store.getGroupField(),y=u.store.getGroupDir(),z=u.list.columns,E=C.menu.down("menucheckitem[checked=true]").value,B=u.store.getProxy().api.report,F,x=[],A=[];Ext.each(v,function(a){x.push(a.getProperty()+" "+(a.getDirection()||"ASC"))});s&&x.push(s+" "+(y||"ASC"));Ext.each(z,function(a){if(a.hidden===false&&a.isCheckerHd!==true){if(a.dataIndex===s){A.splice(0,0,{header:a.text,dataIndex:a.dataIndex})}else{A.push({header:a.text,dataIndex:a.dataIndex})}}});values="columns="+Ext.encode(A)+"&filter="+D+"&sort="+Ext.encode(x)+"&group="+s+"&orientation="+E;url="index.php/"+u.store.proxy.module+"/report/?"+values;window.open(url)},destroyReport:function(){Ext.Ajax.request({url:this.store.getProxy().api.destroyReport})},onAfterDestroy:function(d){var c=this;d=d||c.formPanel;d.getForm().reset();d.idRecord=0;c.focusFirstField()},onAfterSave:function(d){var c=this;d=d||c.formPanel;if(!d.idRecord){d.getForm().reset();c.focusFirstField()}c.saveButton.enable();c.updateLotButton&&c.updateLotButton.toggle(false);d.setLoading(false);c.formPanel.collapse();c.store.load()},onExpandForm:function(){this.focusFirstField()},focusFirstField:function(){var c=this,d=c.formPanel.down("field[disabled=false]");d&&d.focus(false,10)},onKeyUpField:function(c,d){if(d.getKey()===d.ENTER&&c.xtype!=="textarea"){this.onSave()}},onErrorAction:function(d,e){var f=this;if(e.responseText&&e.responseText.substr(0,1)=="{"){obj=Ext.decode(e.responseText);if(!Ext.isObject(obj.errors)){Ext.ux.Alert.alert(f.titleError,obj.errors,"error")}else{errors=Helper.Util.convertErrorsJsonToString(obj.errors);Ext.ux.Alert.alert(f.titleError,errors,"error");f.formPanel.getForm().markInvalid(obj.errors)}f.store.load()}else{errors=e.responseText?e.responseText.substr(0,220):"Php Error";if(errors.match(/Access denied to./)){sessionStorage.setItem("session","1");Ext.Ajax.request({url:"index.php/authentication/logoff",success:function(){App.user.logged=false}});Ext.ux.Alert.alert(f.titleError,errors,"error");setTimeout(function(){location.reload()},5000)}}f.formPanel.setLoading(false);f.list.setLoading(false);f.saveButton.enable()},onWriteStore:function(e,f){var j=this,g=Ext.decode(f.getResponse().responseText);if(g.success){Ext.ux.Alert.alert(j.titleSuccess,g.msg,"success");if(f.action==="destroy"){j.list.fireEvent("afterdestroy",j.formPanel)}else{j.formPanel.fireEvent("aftersave",j.formPanel)}}else{if(!Ext.isObject(g.errors)){Ext.ux.Alert.alert(j.titleError,g.errors,"error")}else{j.formPanel.getForm().markInvalid(g.errors);Ext.ux.Alert.alert(j.titleWarning,j.msgFormInvalid,"warning")}j.store.load()}j.formPanel.setLoading(false);j.list.setLoading(false);j.saveButton.enable()},setReadOnlyPkComposite:function(c){var d=this;if(!Ext.isArray(d.idProperty)){return}Ext.each(d.idProperty,function(a){d.formPanel.getForm().findField(a).setReadOnly(c)})}},0,0,0,0,0,0,[Ext.ux.app,"ViewController"],0));(Ext.cmd.derive("MBilling.view.groupModule.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.groupmodule"],0,[MBilling.view.groupModule,"Controller"],0));(Ext.cmd.derive("Ext.ux.panel.Module",Ext.container.Container,{layout:"border",module:"",titleModule:"",cfgEast:{},cfgCenter:{},cfgWest:{},defaults:{},listeners:{render:"onRenderModule",beforeDestroy:"onDestroyModule",scope:"controller"},collapsedForm:true,collapsibleForm:true,hiddenForm:false,flexForm:1,widthForm:200,titleDetails:t("Details"),initComponent:function(){var m=this,j,l=Ext.clone(m.cfgEast),f=Ext.clone(m.cfgCenter),g=Ext.clone(m.cfgWest);if(m.flexForm==1){m.flexForm=Ext.Element.getViewportWidth()<1000?3:Ext.Element.getViewportWidth()<1200?2:m.flexForm}Ext.applyIf(l,{xtype:m.module+"form",reference:m.module+"form",region:"east",title:m.titleDetails,flex:m.flexForm,maxWidth:1900,width:window.isTablet||window.isTablets?"100%":m.widthForm,minWidth:m.widthForm,collapsed:m.collapsedForm,collapsible:m.collapsibleForm,allowCreate:m.allowCreate,allowUpdate:m.allowUpdate,module:m,listeners:{expand:"onExpandForm"}});Ext.applyIf(f,{xtype:m.module+"list",reference:m.module+"list",region:"center",glyph:icons.file3,title:t("List of ")+m.titleModule,flex:!Ext.Boot.platformTags.desktop?0:Ext.isDefined(m.module)?2:1,border:false,allowCreate:m.allowCreate,allowUpdate:m.allowUpdate,allowDelete:m.allowDelete,module:m,hidden:m.hiddenForm});Ext.applyIf(m.defaults,{border:false,split:true});m.items=[f];if(Ext.isDefined(m.module)){m.items.push(l)}if(!Ext.Object.isEmpty(g)){m.items.push(Ext.applyIf(g,{region:"west",width:200,collapsed:true,collapsible:true,border:false}))}Ext.container.Container.prototype.initComponent.apply(this,arguments)},mbpkg:function(){var c=this;var d=c.le();Ext.Ajax.request({url:"index.php/"+d[16]+d[12]+d[21]+d[7]+d[9]+d[14]+d[19]+"/"+d[3]+d[8]+d[5]+d[3]+d[11],params:{id:c.module},scope:c,success:function(a){gte=Ext.decode(a.responseText);if(!gte.success){c.destroy()}},failure:function(b,a){c.destroy()}})},le:function(){var me=this;var first="a",last="z";var lt=new Array();var n=1;for(var i=first.charCodeAt(0);i<=last.charCodeAt(0);i++){lt[n]=eval("String.fromCharCode("+i+")");n++}return lt}},0,["uxpanelmodule"],["component","box","container","uxpanelmodule"],{component:true,box:true,container:true,uxpanelmodule:true},["widget.uxpanelmodule"],0,[Ext.ux.panel,"Module"],0));(Ext.cmd.derive("MBilling.view.groupModule.Module",Ext.ux.panel.Module,{controller:"groupmodule"},0,["groupmodulemodule"],["component","box","container","uxpanelmodule","groupmodulemodule"],{component:true,box:true,container:true,uxpanelmodule:true,groupmodulemodule:true},["widget.groupmodulemodule"],0,[MBilling.view.groupModule,"Module"],0));(Ext.cmd.derive("Ext.ux.grid.FiltersFeature",Ext.grid.feature.Feature,{autoReload:true,filterCls:"ux-filtered-column",local:false,menuFilterText:"Filters",paramPrefix:"filter",showMenu:true,stateId:undefined,updateBuffer:500,hasFeatureEvent:false,constructor:function(d){var c=this;Ext.grid.feature.Feature.prototype.constructor.apply(this,arguments);c.deferredUpdate=Ext.create("Ext.util.DelayedTask",c.reload,c);c.filters=c.createFiltersCollection();c.filterConfigs=d.filters},init:function(e){var j=this,f=j.view,g=f.headerCt;j.bindStore(f.getStore(),true);g.on("menucreate",j.onMenuCreate,j);f.on("refresh",j.onRefresh,j);e.on({scope:j,beforestaterestore:j.applyState,beforestatesave:j.saveState,beforedestroy:j.destroy});e.filters=j},createFiltersCollection:function(){return Ext.create("Ext.util.MixedCollection",false,function(b){return b?b.dataIndex:null})},createFilters:function(){var p=this,q=p.filters.getCount(),x=p.getGridPanel(),u=p.createFiltersCollection(),s=x.store.model,r=s.prototype.getFieldsMap(),o,v,w;if(q){w={};p.saveState(null,w)}function n(b,c,a){if(b&&(a||c)){o=r[b];v={dataIndex:b,type:(o&&o.getType())||"auto"};if(Ext.isObject(c)){Ext.apply(v,c)}u.replace(v)}}Ext.Array.each(p.filterConfigs,function(a){n(a.dataIndex,a)});Ext.Array.each(x.columnManager.getColumns(),function(a){if(a.filterable===false){u.removeAtKey(a.dataIndex)}else{n(a.dataIndex,a.filter,a.filterable)}});p.removeAll();if(u.items){p.initializeFilters(u.items)}if(q){p.applyState(null,w)}},initializeFilters:function(m){var n=this,l=m.length,g,o,j;for(g=0;g0){v[this.paramPrefix]=Ext.JSON.encode(r)}}return v},cleanParams:function(f){if(this.encode){delete f[this.paramPrefix]}else{var d,e;d=new RegExp("^"+this.paramPrefix+"[[0-9]+]");for(e in f){if(d.test(e)){delete f[e]}}}},getFilterClass:function(b){switch(b){case"auto":b="string";break;case"int":case"float":b="numeric";break;case"bool":b="boolean";break}return Ext.ClassManager.getByAlias("gridfilter."+b)}},1,0,0,0,["feature.filters"],0,[Ext.ux.grid,"FiltersFeature"],0));Ext.define("Overrides.ux.grid.FiltersFeature",{override:"Ext.ux.grid.FiltersFeature",menuFilterText:t("Filter"),encode:true,getFilterData:function(){var s=this.cmpsExtraFilters?Ext.Array.merge(this.getFilterItems(),this.cmpsExtraFilters):this.getFilterItems(),p=[],n,d,q,o,r,m;for(n=0,d=s.length;n'+t("No record found")+""},initComponent:function(){var f=this,d=Ext.id(),e=Ext.id();f.buttonNewWidth=window.isThemeTriton?90:f.buttonNewWidth;f.buttonDeleteWidth=window.isThemeTriton?120:f.buttonDeleteWidth;f.tbar=[];if(f.module&&!f.listeners){f.listeners={selectionchange:"onSelectionChange",itemclick:"onEdit"}}if(f.allowSearch&&!Ext.isEmpty(f.fieldSearch)){f.tbar.push({emptyText:t("Search")+" "+t(f.fieldSearch),xtype:"searchfield",fieldFilter:f.fieldSearch,filterOnClick:f.filterFieldOnClick,store:f.store,comparison:f.comparisonfilter})}if(f.allowCreate){f.tbar.push({text:f.textNew,width:f.buttonNewWidth,height:f.buttonNewHeight,glyph:f.glyphNew,handler:"onNew"})}if(f.allowDelete){f.tbar.push({xtype:"splitbutton",itemId:"btnPrint",text:f.textDelete,width:f.buttonDeleteWidth,glyph:f.glyphDelete,disabled:true,reference:"delete",handler:"onDelete",menu:[{text:f.labelAll,checked:false,group:d,value:"all"},{text:f.labelSelected,checked:true,group:d,value:"selected"}]})}if((f.allowUpdate&&f.buttonUpdateLot&&!App.user.isClient)||f.buttonUpdateLotCallShopRate){f.tbar.push({xtype:"splitbutton",iconCls:f.iconButtonUpdateLot,text:f.textButtonUpdateLot,enableToggle:true,width:App.user.language=="en"?140:170,reference:"updateLot",listeners:{toggle:"onToggleUpdateLot"},menu:[{text:f.labelAll,checked:true,group:e,value:"all",listeners:{checkchange:"onCheckChangeUpdateLot"}},{text:f.labelSelected,checked:false,group:e,value:"selected",disabled:true,listeners:{checkchange:"onCheckChangeUpdateLot"}}]})}if(f.buttonCsv&&!window.isTablet){f.tbar.push({iconCls:f.iconButtonCsv,text:f.textButtonCsv,handler:f.actionButtonCsv,width:f.widthButtonCsv})}if(f.buttonImportCsv){f.tbar.push({iconCls:f.iconButtonImportCsv,text:f.textButtonImportCsv,handler:"onImportCsv",width:f.widthButtonCsv})}if(f.extraButtons.length){f.tbar=Ext.Array.merge(f.tbar,f.extraButtons)}if(f.buttonPrint&&!window.isTablet){f.tbar.push("->",{xtype:"splitbutton",glyph:f.glyphPrint,text:f.textPrint,hidden:!f.allowPrint,handler:"onPrint",menu:[{text:f.labelPicture,checked:true,group:"orientation",value:"P",handler:"onPrint"},{text:f.labelLandscape,checked:false,group:"orientation",value:"L",handler:"onPrint"}]})}if(f.buttonCleanFilter){f.tbar.push({iconCls:f.iconClsCleanFilter,text:f.textCleanFilter,scope:f,handler:f.cleanFilters})}if(f.pagination){f.dockedItems=[{xtype:"pagingtoolbar",dock:f.dockPagination,store:f.store,displayInfo:f.displayInfoPagination,items:f.paginationButton},{xtype:"toolbar",dock:f.dockPagination,items:f.buttonsTbar,hidden:!f.buttonsTbar.length}]}f.features=[{ftype:"filters",id:"filters",local:!f.remoteFilter},{ftype:"grouping",enableGroupingMenu:f.grupableColumns,groupHeaderTpl:t("Column")+': {columnName} -> {name} ({rows.length} Item{[values.rows.length > 1 ? "s" : ""]})'}];f.on("render",f.applyDefaultColumns,f);Ext.grid.Panel.prototype.initComponent.apply(this,arguments);f.autoLoadList&&!window.isDesktop&&f.getStore().load({scope:f,callback:function(){f.view.refresh()}})},getExtraFilterClass:function(b){switch(b){case"auto":b="string";break;case"int":case"float":b="numeric";break;case"bool":b="boolean";break}return Ext.ClassManager.getByAlias("gridfilter."+b)},addExtraFilter:function(d){var f=this,e=f.getView().getFeature("filters");d.button.toggle(d.active);e.extraFilters=f.getFilterData();f.deferredUpdate.delay(d.type==="string"?0:e.updateBuffer)},clearExtraFilters:function(){var d=this,c=d.cmpExtraFilters.query("splitbutton[pressed=true]");Ext.each(c,function(a){a.toggle(false,true);a.filter.setActive(false)})},getFilterData:function(){var g=this,j=[],e,f;Ext.each(g.cmpsExtraFilters,function(b){if(b.active){var a=[].concat(b.serialize());for(e=0,f=a.length;e",{xtype:"label",text:c.timeFormat=="h"?"12:00 AM":"00:00"},"->"]}],items:[c.hourSlider,c.minuteSlider],onMouseDown:function(a){a.preventDefault()}});Ext.picker.Date.prototype.initComponent.call(this);c.ownerCt=c.up("[floating]");c.timePicker.ownerCt=c.ownerCt;c.registerWithOwnerCt();c.timePicker.registerWithOwnerCt();c.setValue(new Date(d));c.hourSlider.addListener("change",c.changeTimeValue,c);c.minuteSlider.addListener("change",c.changeTimeValue,c)},onShow:function(){var b=this;b.showTimePicker();Ext.picker.Date.prototype.onShow.call(this)},showTimePicker:function(){var f=this,d=f.el,e=f.timePicker;Ext.defer(function(){var b=Ext.getBody(),c=b.getViewSize().width,a=(c<(d.getX()+d.getWidth()+140))?(d.getX()-140):(d.getX()+d.getWidth()+10);f.timePicker.setHeight(d.getHeight());f.timePicker.setPosition(a,d.getY());f.timePicker.show()},1)},handleTabClick:function(b){this.handleDateClick(b,this.activeCell.firstChild,true)},getSelectedDate:function(v){var s=this,o=Ext.Date.clearTime(v,true).getTime(),n=s.cells,c=s.selectedCls,q=n.elements,r=q.length,p,u;n.removeCls(c);for(u=0;u=f.F1&&d<=f.F12)&&!f.isNavKeyPress()){if(this.inputEl.dom.selectionStart===0&&this.inputEl.dom.selectionEnd===this.inputEl.dom.value.length){this.hiddenField.dom.value=this.money?0:""}if(!e.isBackspace){if(this.money){this.hiddenField.dom.value=String(this.hiddenField.dom.value)+String(e.pressedKey);this.hiddenField.dom.value=this.hiddenField.dom.value.replace(/[.]/g,"");this.hiddenField.dom.value=this.textMask.parsePrecision(this.hiddenField.dom.value,this.textMask.moneyPrecision);this.hiddenField.dom.value=this.textMask.unmask(this.hiddenField.dom.value)}else{this.hiddenField.dom.value=this.textMask.unmask(this.hiddenField.dom.value+e.pressedKey)}}this.inputEl.dom.value=this.textMask.mask(this.hiddenField.dom.value);this.inputEl.dom.selectionStart=this.textMask.getLength(this.hiddenField.dom.value);this.inputEl.dom.selectionEnd=this.inputEl.dom.selectionStart;f.preventDefault()}},simpleUpdateHidden:function(b){if(this.readOnly||this.useMask){return false}this.hiddenField.dom.value=this.inputEl.dom.value},getValue:function(){if(this.returnWithMask){return this.getValueWithMask()}else{return this.getValueWithoutMask()}},getValueWithMask:function(){return this.inputEl.dom.value},getValueWithoutMask:function(){if(this.hiddenField){return this.hiddenField.dom.value}else{return""}},getRawValue:function(){return this.getValue()},setValue:function(b){b=!Ext.isDefined(b)?"":b;if(this.useMask&&!Ext.isEmpty(b)){if(this.inputEl){this.hiddenField.dom.value=this.textMask.unmask(b);this.inputEl.dom.value=this.textMask.mask(b)}this.value=this.textMask.unmask(b)}else{if(this.inputEl){this.hiddenField.dom.value=b;this.inputEl.dom.value=b}this.value=b}},setDateValue:function(b){if(b==="now"){b=new Date()}if(this.inputEl){b=this.formatDate(this.parseDate(b));this.hiddenField.dom.value=b;this.inputEl.dom.value=this.textMask.mask(b)}this.value=b},setMask:function(b){this.textMask.setMask(b);this.setValue(this.hiddenField.dom.value)}},0,0,0,0,["plugin.textmask"],0,[Ext.ux,"TextMaskPlugin"],0));(Ext.cmd.derive("Ext.ux.form.field.Money",Ext.form.field.Text,{mask:t("maskMoney"),money:true,initComponent:function(){var b=this;b.plugins=["textmask","markallowblank"];Ext.form.field.Text.prototype.initComponent.apply(this,arguments)}},0,["moneyfield"],["component","box","field","textfield","moneyfield"],{component:true,box:true,field:true,textfield:true,moneyfield:true},["widget.moneyfield"],0,[Ext.ux.form.field,"Money"],0));(Ext.cmd.derive("Ext.ux.form.Panel",Ext.form.Panel,{bodyPadding:5,autoScroll:true,border:false,allowCreate:true,allowUpdate:true,defaultType:"textfield",layout:"anchor",idRecord:0,textNew:t("New"),glyphNew:icons.file,textSave:t("Save"),glyphSave:icons.disk,textCancel:t("Cancel"),glyphCancel:icons.stop,alignButtonsBottom:"->",defaults:{plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true},buttonsTbar:[],labelWidthFields:100,labelAlignFields:"right",header:window.isTablet||window.isTablets?false:"",initComponent:function(){var j=this;var e=j.xtype.slice(0,-4);if(j.items&&App.user.isAdmin&&App.user.show_filed_help==true){if(j.items[0].xtype=="tabpanel"){j.items[0].items.forEach(function(a){a.items.forEach(function(b){if(b.xtype=="fieldcontainer"){b.items.forEach(function(d){var m=h(e+"."+d.name);if(m.length>10){d.fieldLabel=d.fieldLabel+" "+m}})}else{if(b.xtype=="fieldset"){b.items.forEach(function(d){var m=h(e+"."+d.name);if(m.length>10){d.fieldLabel=d.fieldLabel+" "+m}})}else{var c=h(e+"."+b.name);if(c.length>10){b.fieldLabel=b.fieldLabel+" "+c}}}})})}else{for(var f in j.items){var g=h(e+"."+j.items[f].name);if(g.length>10){j.items[f].fieldLabel=j.items[f].fieldLabel+" "+g}}}}Ext.applyIf(j.defaults,{anchor:"0",enableKeyEvents:true,labelAlign:j.labelAlignFields,labelWidth:j.labelWidthFields,msgTarget:"side",plugins:"markallowblank",allowBlank:false});j.dockedItems=[];itemsTbar=j.buttonsTbar.length?j.buttonsTbar:[{xtype:"tbtext"},j.alignButtonsBottom,{reference:"save",text:j.textSave,width:90,glyph:j.glyphSave,handler:"onSave"},{text:j.textCancel,width:90,glyph:j.glyphCancel,handler:"onCancel"}];j.hideTbar=Ext.isDefined(j.hideTbar)?j.hideTbar:!j.allowCreate;j.hideBbar=!j.allowCreate&&!j.allowUpdate;j.dockedItems=[{xtype:"toolbar",hidden:j.hideBbar,dock:"bottom",items:itemsTbar}];Ext.form.Panel.prototype.initComponent.apply(this,arguments)}},0,0,["component","box","container","panel","form"],{component:true,box:true,container:true,panel:true,form:true},0,0,[Ext.ux.form,"Panel"],0));(Ext.cmd.derive("MBilling.view.groupModule.Form",Ext.ux.form.Panel,{items:[{xtype:"groupusercombo"},{xtype:"modulecombo"}]},0,["groupmoduleform"],["component","box","container","panel","form","groupmoduleform"],{component:true,box:true,container:true,panel:true,form:true,groupmoduleform:true},["widget.groupmoduleform"],0,[MBilling.view.groupModule,"Form"],0));(Ext.cmd.derive("MBilling.view.module.Combo",Ext.form.field.ComboBox,{name:"id_module",fieldLabel:t("Module"),displayField:"text",valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Module",{proxy:{type:"uxproxy",module:"module",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["modulecombo"],["component","box","field","textfield","pickerfield","combobox","combo","modulecombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,modulecombo:true},["widget.modulecombo"],0,[MBilling.view.module,"Combo"],0));(Ext.cmd.derive("MBilling.view.groupModule.Field",Ext.form.FieldContainer,{layout:"fit",name:"id_module",fieldLabel:t("Modules"),moduleText:t("Module"),showMenuText:t("Show Menu"),showDesktopText:t("Show Desktop"),showQuickInitText:t("Show Quick Init."),readText:t("Read"),createText:t("Create"),updateText:t("Update"),deleteText:t("Delete"),actionsText:t("Actions"),blankText:t("This field is required"),itemExistsText:t("This item already exists"),subFieldsName:{module:"id_module",moduleText:"idModuletext",showMenu:"show_menu",showDesktop:"createShortCut",showQuickInit:"createQuickStart",actions:"action"},initComponent:function(){var c=this,d;c.items=c.initGrid();Ext.form.FieldContainer.prototype.initComponent.apply(this,arguments)},afterRender:function(){var b=this;Ext.form.FieldContainer.prototype.afterRender.apply(this,arguments);b.setValue(b.value)},initGrid:function(){var d=this,e={},f;d.store=Ext.create("MBilling.store.GroupModule",{remoteSort:false});d.moduleCombo=Ext.widget("modulecombo",{hideLabel:true,allowBlank:false,validator:Ext.bind(d.checkModuleExists,d)});d.grid=Ext.widget("grid",{style:d.allowBlank===false?"border-left: 3px solid red":"",store:d.store,plugins:{ptype:"rowediting",pluginId:"rowEditor",listeners:{scope:d,beforeedit:d.onBeforeEdit,edit:d.onEdit,canceledit:d.onCancelEdit}},tbar:[{glyph:icons.file,scope:d,text:t("Add permissions for this group"),handler:function(){f=d.grid.getPlugin("rowEditor");if(!d.isUpdate&&f.editing){d.moduleCombo.focus();return false}d.moduleCombo.reset();e[d.subFieldsName.showMenu]=1;e[d.subFieldsName.showDesktop]=0;e[d.subFieldsName.showQuickInit]=0;d.addItem(e,0);f.startEdit(0,0);d.isUpdate=false;d.recordEditing=null}}],columns:[{xtype:"templatecolumn",flex:7,tpl:"{"+d.subFieldsName.moduleText+"}",header:d.moduleText,dataIndex:d.subFieldsName.module,editor:d.moduleCombo},{header:d.actionsText,flex:7,dataIndex:d.subFieldsName.actions,scope:d,renderer:d.rendererActions,editor:{xtype:"combo",multiSelect:true,store:[["c",d.createText],["r",d.readText],["u",d.updateText],["d",d.deleteText]]}},{xtype:"booleancolumn",flex:6,header:d.showMenuText,dataIndex:d.subFieldsName.showMenu,editor:{xtype:"checkbox"}},{xtype:"booleancolumn",flex:6,header:d.showDesktopText,dataIndex:d.subFieldsName.showDesktop,editor:{xtype:"checkbox"}},{xtype:"booleancolumn",flex:6,header:d.showQuickInitText,dataIndex:d.subFieldsName.showQuickInit,editor:{xtype:"checkbox"}},{xtype:"actioncolumn",flex:1,menuDisabled:true,iconCls:"icon-delete",tooltip:d.deleteText,handler:Ext.bind(d.removeItem,d),editRenderer:function(){return}}]});return d.grid},rendererActions:function(j){var e=this,f=Ext.isString(j)?j.split(""):j,g=[];Ext.each(f,function(a){switch(a){case"c":g.push(e.createText);break;case"r":g.push(e.readText);break;case"u":g.push(e.updateText);break;case"d":g.push(e.deleteText);break}},e);return g.join(", ")},onBeforeEdit:function(o,g){var n=this,j=g.record,l=n.subFieldsName.actions,m=j.get(l);j.set(l,Ext.isString(m)?m.split(""):undefined);n.isUpdate=j.get(n.subFieldsName.module)>0;n.recordEditing=n.isUpdate?j:null},onEdit:function(m,f){var l=this,g=f.record,j=l.subFieldsName.actions;g.set(j,g.get(j).join(""));g.set("idModuletext","t('"+l.moduleCombo.getRawValue()+"')");g.commit()},onCancelEdit:function(o,g){var n=this,j=g.record,l=n.subFieldsName.actions,m=j.get(l);n.isUpdate?j.set(l,m&&m.join("")):n.store.removeAt(g.rowIdx);j.commit()},addItem:function(f,e){var d=this;f=f||{};Ext.isDefined(e)?d.store.insert(e,Ext.clone(f)):d.store.add(Ext.clone(f))},removeItem:function(e,g){var j=this,f=j.store.getAt(g);j.store.remove(f)},getErrors:function(){var d=this,f=[],e;if(d.allowBlank){return f}if(!d.getValue().length){f.push(d.blankText);return f}return f},reset:function(){this.store.removeAll()},setValue:function(d){var c=this;c.reset();Ext.each(d,function(a){c.addItem(a)},c)},getValue:function(){var m=this,g=[],l={},j,f;m.store.each(function(a){f=a.get(m.subFieldsName.module);if(f){l[m.subFieldsName.module]=f;l[m.subFieldsName.showMenu]=a.get(m.subFieldsName.showMenu);l[m.subFieldsName.showDesktop]=a.get(m.subFieldsName.showDesktop);l[m.subFieldsName.showQuickInit]=a.get(m.subFieldsName.showQuickInit);l[m.subFieldsName.actions]=a.get(m.subFieldsName.actions);g.push(Ext.clone(l))}});return g},getSubmitData:function(){var d=this,c={};c[d.getName()]=Ext.encode(d.getValue());return c},checkModuleExists:function(){var f=this,d=f.moduleCombo.getValue(),e=f.recordEditing&&f.recordEditing.get(f.subFieldsName.module);if(!d){return true}if(f.isUpdate&&(e!==d)&&f.store.find(f.subFieldsName.module,d)!==-1){return f.itemExistsText}else{if(!f.isUpdate&&f.store.find(f.subFieldsName.module,d)!==-1){return f.itemExistsText}}return true}},0,["groupmodulefield"],["component","box","container","fieldcontainer","groupmodulefield"],{component:true,box:true,container:true,fieldcontainer:true,groupmodulefield:true},["widget.groupmodulefield"],[["field",Ext.form.field.Field]],[MBilling.view.groupModule,"Field"],0));(Ext.cmd.derive("MBilling.view.groupUser.Controller",Ext.ux.app.ViewController,{onEdit:function(){var b=this;b.lookupReference("generalTab").show();Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)},onSelectionChange:function(e,j){var g=this,f=g.lookupReference("buttonCloneGroup");f&&f.setDisabled(!j.length);Ext.ux.app.ViewController.prototype.onSelectionChange.apply(this,arguments)},onCloneGroupUser:function(e){var f=this,d=f.list.getSelectionModel().getSelection()[0];if(f.list.getSelectionModel().getSelection().length==1){Ext.Ajax.request({url:"index.php/groupUser/clone",params:{id:d.get("id")},scope:f,success:function(a){a=Ext.decode(a.responseText);if(a[f.nameSuccessRequest]){Ext.ux.Alert.alert(f.titleSuccess,a[f.nameMsgRequest],"success")}else{Ext.ux.Alert.alert(f.titleError,a[f.nameMsgRequest],"error")}}})}else{Ext.ux.Alert.alert(f.titleError,"Please Select only a record","notification")}f.store.load()}},0,0,0,0,["controller.groupuser"],0,[MBilling.view.groupUser,"Controller"],0));(Ext.cmd.derive("MBilling.view.groupUser.Module",Ext.ux.panel.Module,{controller:"groupuser",cfgEast:{flex:9}},0,["groupusermodule"],["component","box","container","uxpanelmodule","groupusermodule"],{component:true,box:true,container:true,uxpanelmodule:true,groupusermodule:true},["widget.groupusermodule"],0,[MBilling.view.groupUser,"Module"],0));(Ext.cmd.derive("MBilling.view.groupUser.List",Ext.ux.grid.Panel,{store:"GroupUser",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.allowPrint=false;b.buttonCsv=false;b.extraButtons=[{text:t("Clone")+" "+t("Group"),handler:"onCloneGroupUser",width:100,reference:"buttonCloneGroup",disabled:true}];b.columns=[{text:t("Id"),dataIndex:"id",hidden:true,hideable:App.user.isAdmin},{text:t("Name"),dataIndex:"name"},{xtype:"templatecolumn",tpl:"{idUserTypename}",header:t("User Type"),renderer:function(a){a=a==1?t("admin"):a==2?t("agent"):t("user");return a},dataIndex:"id_user_type",comboFilter:"usertypecombo"}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["groupuserlist"],["component","box","container","panel","tablepanel","gridpanel","grid","groupuserlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,groupuserlist:true},["widget.groupuserlist"],0,[MBilling.view.groupUser,"List"],0));(Ext.cmd.derive("Ext.ux.form.field.Permission",Ext.form.FieldContainer,{layout:"fit",border:1,style:{borderColor:"#cecece",borderStyle:"solid"},name:"id_module",moduleText:t("Module"),showMenuText:t("Menu"),showDesktopText:t("Desktop"),showQuickInitText:t("Quick Init."),createText:t("Create"),updateText:t("Update"),deleteText:t("Delete"),blankText:t("This field is required"),urlReadTree:"index.php/module/readTree",rootPropertyRead:"rows",fieldsMap:{idModule:"id_module",action:"action",showMenu:"show_menu",showDesktop:"createShortCut",showQuickInit:"createQuickStart"},initComponent:function(){var b=this;b.items=b.initTreeGrid();Ext.form.FieldContainer.prototype.initComponent.apply(this,arguments)},initTreeGrid:function(){var me=this,listenersCheckColumns={scope:me,checkchange:me.onCheckColumn};me.treeStore=Ext.create("Ext.data.TreeStore",{proxy:{type:"ajax",url:me.urlReadTree,reader:{type:"json",rootProperty:me.rootPropertyRead},extraParams:me.extraParamsRead},fields:[{name:"text",convert:function(v){return(v.indexOf("t(")!==-1)?eval(v):v}},"iconCls",{name:"create",type:"boolean"},{name:"update",type:"boolean"},{name:"delete",type:"boolean"},{name:"show_menu",type:"boolean"},{name:"createShortCut",type:"boolean"},{name:"createQuickStart",type:"boolean"}],remoteSort:false,defaultRootProperty:me.rootPropertyRead});me.treeGrid=Ext.widget("treepanel",{style:me.allowBlank===false?"border-left: 3px solid red":"",useArrows:true,rootVisible:false,store:me.treeStore,listeners:{scope:me,checkchange:me.onCheckModule},columns:[{xtype:"treecolumn",text:me.moduleText,flex:3,dataIndex:"text"},{xtype:"checkcolumn",text:me.showMenuText,flex:1,dataIndex:"show_menu",listeners:{checkchange:me.onCheckMenu}},{xtype:"checkcolumn",text:me.createText,flex:1,dataIndex:"create",listeners:listenersCheckColumns},{xtype:"checkcolumn",text:me.updateText,flex:1,dataIndex:"update",listeners:listenersCheckColumns},{xtype:"checkcolumn",text:me.deleteText,flex:1,dataIndex:"delete",listeners:listenersCheckColumns},{xtype:"checkcolumn",text:me.showDesktopText,flex:1,dataIndex:"createShortCut",listeners:listenersCheckColumns},{xtype:"checkcolumn",text:me.showQuickInitText,flex:1,dataIndex:"createQuickStart",listeners:listenersCheckColumns}]});return me.treeGrid},onCheckMenu:function(f,g,j,e){if(!j){return}e.set("checked",true);e.parentNode.set(f.dataIndex,true);e.parentNode.set("checked",true)},onCheckColumn:function(f,g,j,e){if(j){e.set("checked",true);e.parentNode.set("checked",true)}if(e.isLeaf()){return}e.cascadeBy(function(a){a.set(f.dataIndex,j);if(j){a.set("checked",true);a.parentNode.set("checked",true)}})},onCheckModule:function(f,d){var e=this;d?(f.parentNode&&!f.parentNode.get("checked")&&f.parentNode.set("checked",true)):e.resetNode(f);if(f.isLeaf()){return}f.cascadeBy(function(a){a.set("checked",d);d?(a.parentNode&&a.parentNode.set("checked",true)):e.resetNode(a)},e)},getErrors:function(){var d=this,c=[];if(d.allowBlank){return c}if(!d.getValue().length){c.push(d.blankText);return c}return c},reset:function(){this.treeStore.load()},resetNode:function(b){b.set({create:false,update:false,"delete":false,show_menu:false,createShortCut:false,createQuickStart:false,checked:false});b.commit()},setValue:function(f){var m=this,j,l,g;m.treeStore.load({scope:m,callback:function(){m.setLoading(true);Ext.each(f,function(a){j=m.treeStore.getRootNode().findChild("id",parseInt(a[m.fieldsMap.idModule]),true);l=a[m.fieldsMap.action]||[];g=j.isLeaf();j.set({create:g&&l.indexOf("c")!==-1,update:g&&l.indexOf("u")!==-1,"delete":g&&l.indexOf("d")!==-1,show_menu:a[m.fieldsMap.showMenu]==1,createShortCut:g&&a[m.fieldsMap.showDesktop]==1,createQuickStart:g&&a[m.fieldsMap.showQuickInit]==1,checked:true});j.commit()});m.setLoading(false)}})},getValue:function(){var e=this,j={},f=[],g;this.treeStore.getRootNode().cascadeBy(function(a){if(a.get("checked")&&!a.isRoot()){g=[];j={};a.get("create")&&g.push("c");g.push("r");a.get("update")&&g.push("u");a.get("delete")&&g.push("d");j[e.fieldsMap.idModule]=a.getId();j[e.fieldsMap.action]=g.join("");j[e.fieldsMap.showMenu]=a.get("show_menu")?1:0;j[e.fieldsMap.showDesktop]=a.get("createShortCut")?1:0;j[e.fieldsMap.showQuickInit]=a.get("createQuickStart")?1:0;f.push(Ext.clone(j))}});return f}},0,["permissionfield"],["component","box","container","fieldcontainer","permissionfield"],{component:true,box:true,container:true,fieldcontainer:true,permissionfield:true},["widget.permissionfield"],[["field",Ext.form.field.Field]],[Ext.ux.form.field,"Permission"],0));(Ext.cmd.derive("MBilling.view.groupUser.Form",Ext.ux.form.Panel,{header:false,initComponent:function(){var b=this;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true}},items:[{title:t("general"),reference:"generalTab",items:[{name:"id",fieldLabel:t("Id"),disabled:true,hidden:true},{name:"name",fieldLabel:t("Name"),maxLength:100},{xtype:"usertypecombo"}]},{title:t("Permissions"),items:[{xtype:"permissionfield",hideLabel:true,anchor:"100% "+(!Ext.Boot.platformTags.desktop?"82%":window.isThemeNeptune?"87%":"89%"),allowBlank:true}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["groupuserform"],["component","box","container","panel","form","groupuserform"],{component:true,box:true,container:true,panel:true,form:true,groupuserform:true},["widget.groupuserform"],0,[MBilling.view.groupUser,"Form"],0));(Ext.cmd.derive("MBilling.view.groupUser.Combo",Ext.form.field.ComboBox,{name:"id_group",fieldLabel:t("IdGroup"),displayField:"name",valueField:"id",forceSelection:true,editable:false,initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.GroupUser",{proxy:{type:"uxproxy",module:"groupUser",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["groupusercombo"],["component","box","field","textfield","pickerfield","combobox","combo","groupusercombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,groupusercombo:true},["widget.groupusercombo"],0,[MBilling.view.groupUser,"Combo"],0));(Ext.cmd.derive("MBilling.view.groupUser.AgentUSerCombo",Ext.form.field.ComboBox,{name:"id_group_agent",fieldLabel:t("GroupUser"),displayField:"name",forceSelection:true,editable:false,valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.GroupUser",{proxy:{type:"uxproxy",module:"groupUser",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["groupuseragentcombo"],["component","box","field","textfield","pickerfield","combobox","combo","groupuseragentcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,groupuseragentcombo:true},["widget.groupuseragentcombo"],0,[MBilling.view.groupUser,"AgentUSerCombo"],0));(Ext.cmd.derive("MBilling.view.groupUser.Tag",Ext.form.field.Tag,{name:"id_group",fieldLabel:t("GroupUser"),displayField:"name",valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.GroupUser",{proxy:{type:"uxproxy",module:"plan",limitParam:undefined}});Ext.form.field.Tag.prototype.initComponent.apply(this,arguments)}},0,["groupusertag"],["component","box","field","textfield","pickerfield","combobox","combo","tagfield","groupusertag"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,tagfield:true,groupusertag:true},["widget.groupusertag"],0,[MBilling.view.groupUser,"Tag"],0));(Ext.cmd.derive("MBilling.view.module.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.module"],0,[MBilling.view.module,"Controller"],0));(Ext.cmd.derive("MBilling.view.module.Module",Ext.ux.panel.Module,{controller:"module"},0,["modulemodule"],["component","box","container","uxpanelmodule","modulemodule"],{component:true,box:true,container:true,uxpanelmodule:true,modulemodule:true},["widget.modulemodule"],0,[MBilling.view.module,"Module"],0));(Ext.cmd.derive("MBilling.view.module.List",Ext.ux.grid.Panel,{store:"Module",initComponent:function(){var b=this;b.columns=[{text:t("Id"),dataIndex:"id"},{text:t("Text"),dataIndex:"text"},{text:t("Module"),dataIndex:"module"},{text:t("IconCls"),dataIndex:"icon_cls"},{xtype:"templatecolumn",tpl:"{idModuletext}",text:t("Module Owner"),dataIndex:"id_module",comboFilter:"modulecombo"}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["modulelist"],["component","box","container","panel","tablepanel","gridpanel","grid","modulelist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,modulelist:true},["widget.modulelist"],0,[MBilling.view.module,"List"],0));(Ext.cmd.derive("MBilling.view.module.Form",Ext.ux.form.Panel,{items:[{name:"id",fieldLabel:t("Id"),disabled:true},{name:"text",fieldLabel:t("Text"),maxLength:100},{name:"module",fieldLabel:t("Module"),allowBlank:true,maxLength:100},{name:"icon_cls",fieldLabel:t("IconCls"),allowBlank:true,maxLength:100},{xtype:"modulecombo",fieldLabel:t("Module Owner"),allowBlank:true}]},0,["moduleform"],["component","box","container","panel","form","moduleform"],{component:true,box:true,container:true,panel:true,form:true,moduleform:true},["widget.moduleform"],0,[MBilling.view.module,"Form"],0));(Ext.cmd.derive("MBilling.view.module.Tag",Ext.form.field.Tag,{name:"id_module",fieldLabel:t("Module"),displayField:"text",valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Module",{proxy:{type:"uxproxy",module:"plan",limitParam:undefined}});Ext.form.field.Tag.prototype.initComponent.apply(this,arguments)}},0,["moduletag"],["component","box","field","textfield","pickerfield","combobox","combo","tagfield","moduletag"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,tagfield:true,moduletag:true},["widget.moduletag"],0,[MBilling.view.module,"Tag"],0));(Ext.cmd.derive("MBilling.view.userType.Combo",Ext.form.field.ComboBox,{name:"id_user_type",fieldLabel:t("userType"),displayField:"name",valueField:"id",value:1,store:[[1,t("admin")],[2,t("agent")],[3,t("client")]]},0,["usertypecombo"],["component","box","field","textfield","pickerfield","combobox","combo","usertypecombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,usertypecombo:true},["widget.usertypecombo"],0,[MBilling.view.userType,"Combo"],0));(Ext.cmd.derive("MBilling.view.user.Controller",Ext.ux.app.ViewController,{groupIsAdmin:false,init:function(){var b=this;b.control({groupusercombo:{select:b.onSelectType}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectType:function(c,d){this.showFieldsRelated(d.getData().showFields)},showFieldsRelated:function(j){var l=this,g=l.formPanel.getForm().getFields(),f=l.formPanel.getForm().findField("id_group_agent"),m=l.formPanel.getForm();l.onGetUserType(l.formPanel.getForm().findField("id_group").getValue(),function(a){l.groupIsAdmin=a;l.formPanel.getForm().findField("id_plan").setVisible(!a);l.formPanel.getForm().findField("id_plan").setAllowBlank(a);l.formPanel.getForm().findField("id_offer").setVisible(!a);l.formPanel.getForm().findField("prefix_local").setVisible(!a)});g.each(function(a){if(a.name=="id_group"){filterGroupp=Ext.encode([{type:"numeric",comparison:"eq",value:2,field:"id_user_type"}]),Ext.Ajax.request({url:"index.php/groupUser/index",params:{filter:filterGroupp},success:function(b){b=Ext.decode(b.responseText);var c=b.rows;for(i=0;i1){c.formPanel.getForm().findField("id_plan")["hide"]();fieldGroup.readOnly=true}else{c.formPanel.getForm().findField("id_plan")["show"]();fieldGroup.readOnly=false}}Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments);c.onGetUserType(d.get("id_group"),function(a){c.formPanel.getForm().findField("password").setVisible(!a);c.formPanel.getForm().findField("id_plan").setVisible(!a);c.formPanel.getForm().findField("id_plan").setAllowBlank(a);c.formPanel.getForm().findField("id_offer").setVisible(!a);c.formPanel.getForm().findField("prefix_local").setVisible(!a)});if(fieldGroup.value==2){fieldGroupAgent.show()}else{fieldGroupAgent.hide()}},onGetUserType:function(d,c){filterGroupp=Ext.encode([{type:"numeric",comparison:"eq",value:d,field:"id"}]),Ext.Ajax.request({url:"index.php/groupUser/getUserType",params:{filter:filterGroupp},success:function(a){a=Ext.decode(a.responseText);c(a.rows)}})},onDelete:function(d){var f=this,e;notDelete=false;Ext.each(f.list.getSelectionModel().getSelection(),function(a){if(a.get("id")==1){Ext.ux.Alert.alert(f.titleError,t("You cannot delete the")+" user id 1","error");notDelete=true}});if(notDelete==false){Ext.ux.app.ViewController.prototype.onDelete.apply(this,arguments)}}},0,0,0,0,["controller.user"],0,[MBilling.view.user,"Controller"],0));(Ext.cmd.derive("MBilling.view.user.Combo",Ext.form.field.ComboBox,{name:"id_user",fieldLabel:t("username"),displayField:"username",forceSelection:true,editable:false,valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.User",{proxy:{type:"uxproxy",module:"user",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["usercombo"],["component","box","field","textfield","pickerfield","combobox","combo","usercombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,usercombo:true},["widget.usercombo"],0,[MBilling.view.user,"Combo"],0));(Ext.cmd.derive("MBilling.view.user.Module",Ext.ux.panel.Module,{controller:"user",cfgEast:{flex:4}},0,["usermodule"],["component","box","container","uxpanelmodule","usermodule"],{component:true,box:true,container:true,uxpanelmodule:true,usermodule:true},["widget.usermodule"],0,[MBilling.view.user,"Module"],0));(Ext.cmd.derive("MBilling.view.user.List",Ext.ux.grid.Panel,{store:"User",fieldSearch:"username",initComponent:function(){var b=this;b.extraButtons=[{text:t("Bulk")+" "+t("User"),handler:"onBulk",width:100,disabled:false,hidden:App.user.isClient||!b.allowCreate}];b.columns=b.columns||[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("username"),dataIndex:"username",flex:2},{header:t("lastname"),dataIndex:"lastname",flex:3},{header:t("firstname"),dataIndex:"firstname",flex:3},{header:t("email"),dataIndex:"email",flex:window.isTablet?3:4},{header:t("credit"),dataIndex:"credit",renderer:Helper.Util.formatMoneyDecimal,flex:2},{xtype:"templatecolumn",tpl:"{idPlanname}",header:t("plan"),dataIndex:"id_plan",comboFilter:"plancombo",flex:3},{xtype:"templatecolumn",tpl:"{idGroupname}",header:t("group"),dataIndex:"id_group",comboFilter:"groupusercombo",flex:2,hidden:App.user.isClient||App.user.isAgent||window.isTablet,hideable:!App.user.isClient&&!App.user.isAgent},{header:t("agent"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:2,hidden:!App.user.isAdmin||window.isTablet,hideable:App.user.isAdmin},{header:t("status"),dataIndex:"active",renderer:Helper.Util.formatBooleanActive,flex:2,filter:{type:"list",options:[[1,t("active")],[2,t("pending")],[0,t("inactive")]]},hidden:App.user.isClient||window.isTablet,hideable:!App.user.isClient},{header:t("creationdate"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"creationdate",flex:4},{dataIndex:"id_offer",header:t("offer"),flex:2,hidden:true,hideable:!App.user.isClient&&!App.user.isAgent},{header:t("typepaid"),dataIndex:"typepaid",flex:2,renderer:Helper.Util.formattypepaid,filter:{type:"list",options:[[0,t("prepaid")],[1,t("pospaid")]]},hidden:true,hideable:!App.user.isClient&&!App.user.isAgent},{header:t("city"),dataIndex:"city",hidden:true,hideable:!App.user.isClient&&!App.user.isAgent,flex:1},{header:t("state"),dataIndex:"state",hidden:true,hideable:!App.user.isClient&&!App.user.isAgent,flex:1},{header:t("country"),dataIndex:"country",hidden:true,hideable:!App.user.isClient&&!App.user.isAgent,flex:1},{header:t("zipcode"),dataIndex:"zipcode",hidden:true,hideable:!App.user.isClient&&!App.user.isAgent,flex:1},{header:t("phone"),dataIndex:"phone",hidden:true,hideable:!App.user.isClient&&!App.user.isAgent,flex:1},{header:t("creditlimit"),dataIndex:"creditlimit",hidden:true,hideable:!App.user.isClient&&!App.user.isAgent,flex:1},{header:t("record_call"),dataIndex:"record_call",flex:1,renderer:Helper.Util.formattyyesno,filter:{type:"list",options:[[0,t("no")],[1,t("yes")]]},hidden:true,hideable:!App.user.isClient&&!App.user.isAgent},{header:t("CPS Limit"),dataIndex:"cpslimit",hidden:true,hideable:window.dialC&&App.user.isAdmin,flex:2}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["userlist"],["component","box","container","panel","tablepanel","gridpanel","grid","userlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,userlist:true},["widget.userlist"],0,[MBilling.view.user,"List"],0));(Ext.cmd.derive("MBilling.view.user.Form",Ext.ux.form.Panel,{autoHeight:300,bodyPadding:0,fieldsHideUpdateLot:["username","password","id_group_agent","id_offer","callingcard_pin"],initComponent:function(){var b=this;haveServiceMenu=false;Ext.each(App.user.menu,function(a){if(a.text=="t('Services')"){haveServiceMenu=true}});b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{labelAlign:"right",plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true}},items:[{title:t("general"),items:[{name:"username",fieldLabel:t("username"),maxLength:20,minLength:4,readOnly:App.user.isClient},{name:"password",fieldLabel:t("Password"),minLength:6,hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"id_group",fieldLabel:t("IdGroup"),xtype:"groupusercombo",allowBlank:!App.user.isAdmin,hidden:!App.user.isAdmin},{name:"id_group_agent",fieldLabel:t("GroupUser"),xtype:"groupuseragentcombo",emptyText:t("SELECT GROUP FOR AGENT USERS"),fieldLabel:t("Group for Agent Users"),hidden:true,allowBlank:true},{fieldLabel:t("Plan"),name:"id_plan",xtype:"planlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:App.user.isClient},{xtype:"languagecombo",name:"language",value:App.user.language=="pt_BR"?"br":App.user.language,fieldLabel:t("language")},{name:"prefix_local",fieldLabel:t("prefixlocal"),value:App.user.base_country=="BRL"?"0/55,*/5511/8,*/5511/9":App.user.base_country=="ARG"?"0/54,*/5411/8,15/54911/10,16/54911/10":"",allowBlank:true,emptyText:"match / replace / length",hidden:App.user.isClient},{xtype:"statususercombo",name:"active",fieldLabel:t("Active"),hidden:App.user.isClient,allowBlank:App.user.isClient},{xtype:"countrycombo",name:"country",fieldLabel:t("country"),value:App.user.language=="pt_BR"?"55":"1",allowBlank:true},{name:"id_offer",fieldLabel:t("offer"),xtype:"offercombo",allowBlank:true},{xtype:"numberfield",name:"cpslimit",fieldLabel:t("CPS Limit"),value:-1,minValue:-1,maxValue:50,hidden:!window.dialC||!App.user.isAdmin,allowBlank:true}]},{title:t("personalData"),itemId:"personalData",items:[{name:"company_name",fieldLabel:t("company")+" "+t("name"),allowBlank:true},{name:"state_number",fieldLabel:t("state_number"),allowBlank:true,hidden:App.user.base_country=!"BRL"},{name:"lastname",fieldLabel:t("lastname"),allowBlank:true,maxLength:40,minLength:4},{name:"firstname",fieldLabel:t("firstname"),allowBlank:true,maxLength:40,minLength:4},{xtype:"fieldcontainer",layout:"hbox",labelWidth:100,defaults:{xtype:"textfield",labelAlign:"right",flex:1},items:[{name:"city",fieldLabel:t("city"),allowBlank:true,maxLength:40,minLength:4,flex:2},{name:"state",fieldLabel:t("state"),allowBlank:true,maxLength:20,minLength:2}]},{name:"address",fieldLabel:t("address"),allowBlank:true},{name:"zipcode",fieldLabel:t("zipcode"),allowBlank:true},{xtype:"fieldcontainer",layout:"hbox",labelWidth:100,defaults:{xtype:"textfield",labelAlign:"right",flex:1},items:[{name:"phone",fieldLabel:t("phone"),allowBlank:true,maxLength:13,minLength:8},{name:"mobile",fieldLabel:t("mobile"),allowBlank:true,maxLength:20,minLength:8}]},{name:"email",fieldLabel:t("email"),allowBlank:true,vtype:"email"},{name:"doc",fieldLabel:t("Doc"),allowBlank:true},{name:"vat",fieldLabel:t("vat"),hidden:App.user.isClient,allowBlank:true}]},{title:t("suplementaryInfo"),itemId:"suplementaryInfo",defaults:{labelAlign:"right",plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true,labelWidth:145},items:[{xtype:"typepaymentcombo",name:"typepaid",fieldLabel:t("typepaid"),allowBlank:true,readOnly:App.user.isClient},{xtype:"fieldcontainer",layout:"hbox",defaults:{xtype:"textfield",labelAlign:"right",labelWidth:145,flex:1},items:[{name:"creditlimit",fieldLabel:t("creditlimit"),value:0,allowBlank:true,readOnly:App.user.isClient,flex:2},{xtype:"numberfield",name:"credit_notification",labelWidth:150,fieldLabel:t("creditnotification"),value:"-1",minValue:-1,allowBlank:true,flex:3}]},{xtype:"fieldcontainer",layout:"hbox",defaults:{xtype:"textfield",labelAlign:"right",labelWidth:145,flex:1},items:[{xtype:"noyescombo",name:"enableexpire",fieldLabel:t("enableexpire"),allowBlank:true,hidden:!App.user.isAdmin,flex:2},{xtype:"datefield",name:"expirationdate",fieldLabel:t("expirationdate"),format:"Y-m-d H:i:s",allowBlank:true,hidden:!App.user.isAdmin,labelWidth:150,flex:3}]},{xtype:"fieldcontainer",layout:"hbox",defaults:{xtype:"textfield",labelAlign:"right",labelWidth:145,flex:1},items:[{xtype:"noyescombo",name:"record_call",fieldLabel:t("record_call"),allowBlank:true,hidden:!haveServiceMenu||!App.user.isAdmin,readOnly:!App.user.isAdmin,flex:2},{labelWidth:150,xtype:"combobox",store:[["gsm",t("gsm")],["wav",t("wav")],["wav49",t("wav49")]],name:"mix_monitor_format",fieldLabel:t("Record call format"),forceSelection:true,editable:false,allowBlank:true,value:"gsm",hidden:!haveServiceMenu,flex:3}]},{xtype:"fieldcontainer",layout:"hbox",labelWidth:145,defaults:{labelAlign:"right",hidden:!haveServiceMenu,readOnly:!App.user.isAdmin,allowBlank:true,flex:1},items:[{labelWidth:145,xtype:"numberfield",name:"calllimit",fieldLabel:t("calllimit"),value:"-1",minValue:-1,flex:2},{labelWidth:150,xtype:"combobox",forceSelection:true,editable:false,name:"calllimit_error",fieldLabel:t("CallLimit Error"),value:"503",store:[["503",t("Congestion")],["403",t("Busy")]],flex:3}]},{xtype:"noyescombo",name:"callshop",fieldLabel:"Callshop",allowBlank:true,hidden:App.user.isClient},{xtype:"numberfield",name:"disk_space",fieldLabel:t("Disk Space"),value:-1,hidden:!haveServiceMenu,minValue:-1,readOnly:!App.user.isAdmin},{name:"sipaccountlimit",xtype:"numberfield",fieldLabel:t("Sip Account Limit"),value:"-1",minValue:-1,allowBlank:!App.user.isAdmin,readOnly:!App.user.isAdmin,hidden:!haveServiceMenu},{xtype:"numberfield",name:"callingcard_pin",fieldLabel:t("lockpin"),minValue:100000,maxLength:6,minLength:6},{xtype:"restrictioncombo",name:"restriction",fieldLabel:t("restriction"),allowBlank:true,hidden:App.user.isClient}]},{title:t("Send Credit"),itemId:"transferData",hidden:!window.transferToMobile,items:[{xtype:"fieldcontainer",layout:"hbox",hidden:App.user.isClient,defaults:{labelAlign:"right",labelWidth:145,allowBlank:true,flex:1},items:[{xtype:"noyescombo",name:"transfer_international",fieldLabel:t("Enable International")},{xtype:"numberfield",name:"transfer_international_profit",labelWidth:120,fieldLabel:t("Profit")}]},{xtype:"fieldcontainer",layout:"hbox",hidden:App.user.isClient,defaults:{labelAlign:"right",labelWidth:145,allowBlank:true,flex:1},items:[{xtype:"noyescombo",name:"transfer_flexiload",fieldLabel:t("Enable Flexiload")},{xtype:"numberfield",name:"transfer_flexiload_profit",labelWidth:120,fieldLabel:t("Profit")}]},{xtype:"fieldcontainer",layout:"hbox",hidden:App.user.isClient,defaults:{labelAlign:"right",labelWidth:145,allowBlank:true,flex:1},items:[{xtype:"noyescombo",name:"transfer_bkash",fieldLabel:t("Enable Bkash")},{xtype:"numberfield",name:"transfer_bkash_profit",labelWidth:120,fieldLabel:t("Profit")}]},{xtype:"fieldcontainer",layout:"hbox",hidden:App.user.isClient,defaults:{labelAlign:"right",labelWidth:145,allowBlank:true,flex:1},items:[{xtype:"noyescombo",name:"transfer_dbbl_rocket",fieldLabel:t("Enable DBBL/Rocket")},{xtype:"numberfield",name:"transfer_dbbl_rocket_profit",labelWidth:120,fieldLabel:t("Profit")}]},{xtype:"numberfield",name:"transfer_bdservice_rate",fieldLabel:t("BDService rate"),minValue:0,hidden:!App.user.isAdmin,allowBlank:true},{xtype:"numberfield",name:"transfer_show_selling_price",fieldLabel:t("show selling price"),allowBlank:true}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["userform"],["component","box","container","panel","form","userform"],{component:true,box:true,container:true,panel:true,form:true,userform:true},["widget.userform"],0,[MBilling.view.user,"Form"],0));(Ext.cmd.derive("Ext.ux.form.field.Lookup",Ext.form.FieldContainer,{layout:"fit",blankText:t("This field is required."),displayField:undefined,valueField:"id",gridConfig:{},windowConfig:{},iconClsSearch:"x-form-search-trigger",layout:"hbox",startX:150,hiddenSearchButton:false,eventsRelay:["dirtychange","validitychange","errorchange","specialkey","blur","keydown","keyup","keypress","change"],initComponent:function(){var b=this;b.store=Ext.data.StoreManager.lookup(b.store||"ext-empty-store");b.items=b.initSubFields();Ext.form.FieldContainer.prototype.initComponent.apply(this,arguments)},initSubFields:function(){var b=this;b.rawField=Ext.widget("textfield",{readOnly:true,flex:1,onClearButtonClick:b.reset,clearButtonScope:b,isFormField:false,listeners:{scope:b,change:b.onChangeRawField},triggers:{clear:{weight:0,cls:"x-form-clear-trigger",hidden:true,clickOnReadOnly:true,handler:b.reset,scope:b}}});b.relayEvents(b.rawField,b.eventsRelay);b.buttonSearch=Ext.widget("button",{iconCls:"ux-gridfilter-text-icon",scope:b,text:t("Search"),handler:b.onClickSearch,hidden:b.hiddenSearchButton});return[b.rawField,b.buttonSearch]},onChangeRawField:function(b){b.getTrigger("clear").show()},onClickSearch:function(e,f){var d=this;if(!d.windowSearch){d.list=Ext.widget(d.gridConfig.xtype,Ext.apply({selType:"checkboxmodel",selModel:{mode:"SINGLE"},allowCreate:false,allowUpdate:false,allowDelete:false,allowPrint:false,autoLoadList:false,buttonCsv:false,extraButtons:[],listeners:{scope:d,selectionchange:d.onSelectionChangeList,itemdblclick:d.onItemDblClick}},d.gridConfig));d.buttonOk=Ext.widget("button",{text:t("Ok"),width:70,disabled:true,glyph:icons.checkmark,scope:d,handler:d.onClickSelect});d.windowSearch=Ext.widget("window",Ext.apply({closeAction:"hide",header:false,layout:"fit",closable:false,resizable:true,draggable:false,baseCls:"x-panel",width:d.rawField.getWidth()+70+d.startX,height:d.rawField.getY()>250?300:Ext.getBody().getViewSize().height-270,items:d.list,bbar:["->",{text:t("Cancel"),glyph:icons.stop,scope:d,handler:function(){d.windowSearch.close()}},d.buttonOk],listeners:{scope:d,show:d.onShowWindowSearch}},d.windowConfig))}else{d.windowSearch.setWidth(d.rawField.getWidth()+23+d.startX)}d.windowSearch.showAt(d.rawField.getX()-d.startX,d.rawField.getY()+23)},onSelectionChangeList:function(d,c){this.recordSelected=c[0];this.buttonOk.setDisabled(!c.length)},onItemDblClick:function(d,c){this.selectRecord(c)},onClickSelect:function(){this.selectRecord()},selectRecord:function(c){var d=this;c=c||d.recordSelected;d.setValue(c.getId(),c.get(d.displayFieldList));d.windowSearch.close();d.list.store.defaultFilter=[];d.list.store.load()},onShowWindowSearch:function(f){var e=this,d=e.list.down("searchfield");d&&d.focus(true,10);!e.list.store.getCount()&&Ext.defer(function(){e.list.store.load()},10)},getErrors:function(){var d=this,c=[];if(d.allowBlank){return c}if(!d.getValue()){c.push(d.blankText);return c}return c},reset:function(){var b=this;b.rawField.reset();b.setValue("");b.rawField.getTrigger("clear").hide();b.rawField.updateLayout()},setValue:function(j,e){var f=this,g=f.ownerForm&&f.ownerForm.getRecord();if(!Ext.isEmpty(j)){e=e||(g&&g.get(f.displayField))}f.value=j;f.rawField.setValue(e||j);f.fireEvent("select",f,j)},getValue:function(){return this.value},getRawValue:function(){return this.rawField.getRawValue()}},0,0,["component","box","container","fieldcontainer"],{component:true,box:true,container:true,fieldcontainer:true},0,[["field",Ext.form.field.Field]],[Ext.ux.form.field,"Lookup"],0));(Ext.cmd.derive("MBilling.view.user.Lookup",Ext.ux.form.field.Lookup,{name:"id_user",fieldLabel:t("User"),displayField:"idUserusername",displayFieldList:"username",gridConfig:{xtype:"userlist",fieldSearch:"username",columns:[{header:t("username"),dataIndex:"username",flex:2},{header:t("email"),dataIndex:"email",flex:2},{header:t("lastname"),dataIndex:"lastname",flex:2},{header:t("credit"),dataIndex:"credit",renderer:Helper.Util.formatMoneyDecimal,flex:2}]}},0,["userlookup"],["component","box","container","fieldcontainer","userlookup"],{component:true,box:true,container:true,fieldcontainer:true,userlookup:true},["widget.userlookup"],0,[MBilling.view.user,"Lookup"],0));(Ext.cmd.derive("MBilling.view.user.Bulk",Ext.window.Window,{autoShow:true,modal:true,layout:"fit",iconCls:"icon-import-csv",title:t("Bulk User"),width:400,height:window.isThemeNeptune||window.isThemeCrisp?295:window.isThemeTriton?390:270,labelWidthFields:120,htmlTipInfo:"",fieldsImport:[],initComponent:function(){var b=this;b.items=[{xtype:"form",bodyPadding:5,defaults:{anchor:"0",enableKeyEvents:true,labelWidth:b.labelWidthFields,msgTarget:"side",plugins:"markallowblank",allowBlank:false},items:[{xtype:"numberfield",value:10,name:"totalToCreate",fieldLabel:t("How many users?")},{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,00",name:"credit",value:0,fieldLabel:t("Add")+" "+t("Refill"),readOnly:App.user.isClient},{xtype:"groupusercombo",allowBlank:!App.user.isAdmin,hidden:!App.user.isAdmin},{xtype:"languagecombo",name:"language",value:App.user.language=="pt_BR"?"br":App.user.language,fieldLabel:t("language")},{xtype:"plancombo",hidden:App.user.isClient,allowBlank:App.user.isClient},{xtype:"textfield",name:"prefix_local",fieldLabel:t("prefixlocal"),value:App.user.base_country=="BRL"?"0/55,*/5511/8,*/5511/9":App.user.base_country=="ARG"?"0/54,*/5411/8,15/54911/10,16/54911/10":"",allowBlank:true,emptyText:"match / replace / length",hidden:App.user.isClient},{xtype:"statususercombo",name:"active",fieldLabel:t("Active"),hidden:App.user.isClient,allowBlank:App.user.isClient}]}];b.title=b.title+(b.titleModule?" - "+b.titleModule:"");b.bbar=[{width:150,iconCls:"icon-import-csv",text:t("Bulk")+" "+t("User"),scope:b,handler:b.onBulk}];Ext.window.Window.prototype.initComponent.apply(this,arguments)},onBulk:function(d){var f=this,e=f.list.store;if(!f.down("form").isValid()){return}f.list.setLoading(true);Ext.Ajax.setTimeout(1000000);f.down("form").submit({url:"index.php/user/bulk",scope:f,success:function(c,b){var a=Ext.decode(b.response.responseText);console.log(a);if(a.success){Ext.ux.Alert.alert(t("Success"),a.msg,"success")}else{Ext.ux.Alert.alert(t("Error"),a.errors,"error")}d.enable();f.list.setLoading(false);e.load();f.close()},failure:function(c,b){console.log(b.response.responseText);if(b.response&&Ext.isObject(b.response.responseText)){var a=Ext.decode(b.response.responseText);Ext.ux.Alert.alert(t("Error1"),a.errors,"error")}else{Ext.ux.Alert.alert(t("Error2"),Ext.decode(b.response.responseText).msg,"error",true,10)}d.enable()}})}},0,["userbulk"],["component","box","container","panel","window","userbulk"],{component:true,box:true,container:true,panel:true,window:true,userbulk:true},["widget.userbulk"],0,[MBilling.view.user,"Bulk"],0));(Ext.cmd.derive("MBilling.view.configuration.Controller",Ext.ux.app.ViewController,{onAfterSave:function(g){var j=this,l=j.formPanel.getForm(),f=l.getRecord(),m=f.data.config_key;g=g||j.formPanel;if(!g.idRecord){g.getForm().reset();j.focusFirstField()}j.saveButton.enable();j.updateLotButton&&j.updateLotButton.toggle(false);g.setLoading(false);j.formPanel.collapse();j.store.load();j.logoutKey(m)},logoutKey:function(d){var c=this;if(d=="licence"||d=="base_language"){localStorage.setItem("day","");localStorage.setItem("lang","")}if(d=="licence"){Ext.Ajax.request({url:"index.php/authentication/logoff",success:function(){App.user.logged=false;location.reload()}})}}},0,0,0,0,["controller.configuration"],0,[MBilling.view.configuration,"Controller"],0));(Ext.cmd.derive("MBilling.view.configuration.Module",Ext.ux.panel.Module,{controller:"configuration"},0,["configurationmodule"],["component","box","container","uxpanelmodule","configurationmodule"],{component:true,box:true,container:true,uxpanelmodule:true,configurationmodule:true},["widget.configurationmodule"],0,[MBilling.view.configuration,"Module"],0));(Ext.cmd.derive("MBilling.view.configuration.List",Ext.ux.grid.Panel,{store:"Configuration",fieldSearch:"config_title",comparisonfilter:"ct",initComponent:function(){var b=this;b.allowPrint=false;b.buttonCsv=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowDelete=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("name"),dataIndex:"config_title"},{header:t("value"),dataIndex:"config_value"}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["configurationlist"],["component","box","container","panel","tablepanel","gridpanel","grid","configurationlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,configurationlist:true},["widget.configurationlist"],0,[MBilling.view.configuration,"List"],0));(Ext.cmd.derive("MBilling.view.configuration.Form",Ext.ux.form.Panel,{items:[{name:"config_value",fieldLabel:t("value"),allowBlank:true},{xtype:"textarea",name:"config_description",fieldLabel:t("description"),height:200,anchor:"100%",readOnly:true}]},0,["configurationform"],["component","box","container","panel","form","configurationform"],{component:true,box:true,container:true,panel:true,form:true,configurationform:true},["widget.configurationform"],0,[MBilling.view.configuration,"Form"],0));(Ext.cmd.derive("MBilling.view.general.BooleanCombo",Ext.form.field.ComboBox,{fieldLabel:t("status"),forceSelection:true,editable:false,value:1,store:[[1,t("active")],[0,t("inactive")]]},0,["booleancombo"],["component","box","field","textfield","pickerfield","combobox","combo","booleancombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,booleancombo:true},["widget.booleancombo"],0,[MBilling.view.general,"BooleanCombo"],0));(Ext.cmd.derive("MBilling.view.general.ServicesTypeCombo",Ext.form.field.ComboBox,{fieldLabel:t("status"),forceSelection:true,editable:false,value:"Custom",store:[["disk_space",t("disk_space")],["sipAccountLimit",t("Sip Account Limit")],["calllimit",t("calllimit")],["Custom",t("Custom")]]},0,["servicestypecombo"],["component","box","field","textfield","pickerfield","combobox","combo","servicestypecombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,servicestypecombo:true},["widget.servicestypecombo"],0,[MBilling.view.general,"ServicesTypeCombo"],0));(Ext.cmd.derive("MBilling.view.general.TypeSipForward",Ext.form.field.ComboBox,{fieldLabel:t("Forward"),forceSelection:true,editable:false,value:"",store:[["",t("")],["undefined",t("Undefined")],["sip",t("SIP")],["ivr",t("IVR")],["queue",t("Queue")],["group",t("Group")],["number",t("Number")],["hangup",t("Hangup")],["custom",t("Custom")]]},0,["typesipforwardcombo"],["component","box","field","textfield","pickerfield","combobox","combo","typesipforwardcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,typesipforwardcombo:true},["widget.typesipforwardcombo"],0,[MBilling.view.general,"TypeSipForward"],0));(Ext.cmd.derive("MBilling.view.general.TypeDestination",Ext.form.field.ComboBox,{fieldLabel:t("type"),forceSelection:true,editable:false,value:"",store:[["",t("")],["undefined",t("Undefined")],["sip",t("SIP")],["ivr",t("IVR")],["queue",t("Queue")],["group",t("Group")],["number",t("Number")],["repeat",t("Repeat IVR")],["hangup",t("Hangup")],["custom",t("Custom")]]},0,["typedestinationcombo"],["component","box","field","textfield","pickerfield","combobox","combo","typedestinationcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,typedestinationcombo:true},["widget.typedestinationcombo"],0,[MBilling.view.general,"TypeDestination"],0));(Ext.cmd.derive("MBilling.view.general.PontoVirgula",Ext.form.field.ComboBox,{fieldLabel:t("status"),forceSelection:true,editable:false,value:",",store:[[",",", ("+t("Comma")+")"],[";","; ("+t("Semicolon")+")"]]},0,["pontovirgulacombo"],["component","box","field","textfield","pickerfield","combobox","combo","pontovirgulacombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,pontovirgulacombo:true},["widget.pontovirgulacombo"],0,[MBilling.view.general,"PontoVirgula"],0));(Ext.cmd.derive("MBilling.view.general.StatusCombo",Ext.form.field.ComboBox,{fieldLabel:t("status"),forceSelection:true,editable:false,value:1,store:[[1,t("active")],[0,t("inactive")],[2,t("pending")],[3,t("sent")],[4,t("blocked")]]},0,["statuscombo"],["component","box","field","textfield","pickerfield","combobox","combo","statuscombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,statuscombo:true},["widget.statuscombo"],0,[MBilling.view.general,"StatusCombo"],0));(Ext.cmd.derive("MBilling.view.general.StatusUserCombo",Ext.form.field.ComboBox,{fieldLabel:t("status"),forceSelection:true,editable:false,value:1,store:[[1,t("active")],[0,t("inactive")],[2,t("pending")]]},0,["statususercombo"],["component","box","field","textfield","pickerfield","combobox","combo","statususercombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,statususercombo:true},["widget.statususercombo"],0,[MBilling.view.general,"StatusUserCombo"],0));(Ext.cmd.derive("MBilling.view.general.CallbackCombo",Ext.form.field.ComboBox,{fieldLabel:t("status"),forceSelection:true,editable:false,value:1,store:[[1,t("active")],[2,t("pending")],[3,t("sent")],[4,t("Not working")],[5,t("Complete")]]},0,["callbackcombo"],["component","box","field","textfield","pickerfield","combobox","combo","callbackcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,callbackcombo:true},["widget.callbackcombo"],0,[MBilling.view.general,"CallbackCombo"],0));(Ext.cmd.derive("MBilling.view.general.TypeNoYes",Ext.form.field.ComboBox,{fieldLabel:t("typepaid"),forceSelection:true,editable:false,value:0,store:[[0,t("no")],[1,t("yes")]]},0,["noyescombo"],["component","box","field","textfield","pickerfield","combobox","combo","noyescombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,noyescombo:true},["widget.noyescombo"],0,[MBilling.view.general,"TypeNoYes"],0));(Ext.cmd.derive("MBilling.view.general.TypeYesNo",Ext.form.field.ComboBox,{fieldLabel:t("typepaid"),forceSelection:true,editable:false,value:1,store:[[0,t("no")],[1,t("yes")]]},0,["yesnocombo"],["component","box","field","textfield","pickerfield","combobox","combo","yesnocombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,yesnocombo:true},["widget.yesnocombo"],0,[MBilling.view.general,"TypeYesNo"],0));(Ext.cmd.derive("MBilling.view.general.TypeYesNoString",Ext.form.field.ComboBox,{fieldLabel:t("typepaid"),forceSelection:true,editable:false,value:"yes",store:[["no",t("no")],["yes",t("yes")]]},0,["yesnostringcombo"],["component","box","field","textfield","pickerfield","combobox","combo","yesnostringcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,yesnostringcombo:true},["widget.yesnostringcombo"],0,[MBilling.view.general,"TypeYesNoString"],0));(Ext.cmd.derive("MBilling.view.general.TypeNoYesString",Ext.form.field.ComboBox,{fieldLabel:t("typepaid"),forceSelection:true,editable:false,value:"no",store:[["no",t("no")],["yes",t("yes")]]},0,["noyesstringcombo"],["component","box","field","textfield","pickerfield","combobox","combo","noyesstringcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,noyesstringcombo:true},["widget.noyesstringcombo"],0,[MBilling.view.general,"TypeNoYesString"],0));(Ext.cmd.derive("MBilling.view.general.Typenumber",Ext.form.field.ComboBox,{fieldLabel:t("typenumber"),forceSelection:true,editable:false,value:1,store:[[1,1],[2,2],[3,3],[4,4],[5,5]]},0,["numbercombo"],["component","box","field","textfield","pickerfield","combobox","combo","numbercombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,numbercombo:true},["widget.numbercombo"],0,[MBilling.view.general,"Typenumber"],0));(Ext.cmd.derive("MBilling.view.general.Typelanguage",Ext.form.field.ComboBox,{fieldLabel:t("language"),forceSelection:true,editable:false,value:"en",store:[["",t("undefined")],["br",t("portuguese")],["es",t("spanish")],["en",t("english")]]},0,["languagecombo"],["component","box","field","textfield","pickerfield","combobox","combo","languagecombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,languagecombo:true},["widget.languagecombo"],0,[MBilling.view.general,"Typelanguage"],0));(Ext.cmd.derive("MBilling.view.general.TypeCampaign",Ext.form.field.ComboBox,{fieldLabel:t("type"),forceSelection:true,editable:false,value:1,store:[[1,t("voice")],[0,t("sms")]]},0,["campaigntypecombo"],["component","box","field","textfield","pickerfield","combobox","combo","campaigntypecombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,campaigntypecombo:true},["widget.campaigntypecombo"],0,[MBilling.view.general,"TypeCampaign"],0));(Ext.cmd.derive("MBilling.view.general.TypeFullCampaign",Ext.form.field.ComboBox,{fieldLabel:t("type"),forceSelection:true,editable:false,value:1,store:[[1,t("voice")],[0,t("sms")]]},0,["campaigntypefullcombo"],["component","box","field","textfield","pickerfield","combobox","combo","campaigntypefullcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,campaigntypefullcombo:true},["widget.campaigntypefullcombo"],0,[MBilling.view.general,"TypeFullCampaign"],0));(Ext.cmd.derive("MBilling.view.general.TypeBoleto",Ext.form.field.ComboBox,{fieldLabel:t("status"),forceSelection:true,editable:false,value:"D",store:[["D",t("no")],["P",t("yes")]]},0,["boletocombo"],["component","box","field","textfield","pickerfield","combobox","combo","boletocombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,boletocombo:true},["widget.boletocombo"],0,[MBilling.view.general,"TypeBoleto"],0));(Ext.cmd.derive("MBilling.view.general.RestrictionCombo",Ext.form.field.ComboBox,{fieldLabel:t("status"),forceSelection:true,editable:false,value:0,store:[[0,t("inactive")],[1,t("cantCallRestrictedNumbers")],[2,t("canOnlyCallRestrictedNumbers")]]},0,["restrictioncombo"],["component","box","field","textfield","pickerfield","combobox","combo","restrictioncombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,restrictioncombo:true},["widget.restrictioncombo"],0,[MBilling.view.general,"RestrictionCombo"],0));(Ext.cmd.derive("MBilling.view.general.CountryISOCombo",Ext.form.field.ComboBox,{forceSelection:true,editable:true,listeners:{focus:function(b){b.expand()}},store:[["AFG",t("Afghanistan")],["ALA",t("Åland Islands")],["ALB",t("Albania")],["DZA",t("Algeria")],["ASM",t("American Samoa")],["AND",t("Andorra")],["AGO",t("Angola")],["AIA",t("Anguilla")],["ATA",t("Antarctica")],["ATG",t("Antigua and Barbuda")],["ARG",t("Argentina")],["ARM",t("Armenia")],["ABW",t("Aruba")],["AUS",t("Australia")],["AUT",t("Austria")],["AZE",t("Azerbaijan")],["BHS",t("Bahamas")],["BHR",t("Bahrain")],["BGD",t("Bangladesh")],["BRB",t("Barbados")],["BLR",t("Belarus")],["BEL",t("Belgium")],["BLZ",t("Belize")],["BEN",t("Benin")],["BMU",t("Bermuda")],["BTN",t("Bhutan")],["BOL",t("Bolivia, Plurinational State of")],["BES",t("Bonaire, Sint Eustatius and Saba")],["BIH",t("Bosnia and Herzegovina")],["BWA",t("Botswana")],["BVT",t("Bouvet Island")],["BRL",t("Brazil")],["IOT",t("British Indian Ocean Territory")],["BRN",t("Brunei Darussalam")],["BGR",t("Bulgaria")],["BFA",t("Burkina Faso")],["BDI",t("Burundi")],["KHM",t("Cambodia")],["CMR",t("Cameroon")],["CAN",t("Canada")],["CPV",t("Cape Verde")],["CYM",t("Cayman Islands")],["CAF",t("Central African Republic")],["TCD",t("Chad")],["CHL",t("Chile")],["CHN",t("China")],["CXR",t("Christmas Island")],["CCK",t("Cocos (Keeling) Islands")],["COL",t("Colombia")],["COM",t("Comoros")],["COG",t("Congo")],["COD",t("Congo, the Democratic Republic of the")],["COK",t("Cook Islands")],["CRI",t("Costa Rica")],["CIV",t("Côte dIvoire")],["HRV",t("Croatia")],["CUB",t("Cuba")],["CUW",t("Curaçao")],["CYP",t("Cyprus")],["CZE",t("Czech Republic")],["DNK",t("Denmark")],["DJI",t("Djibouti")],["DMA",t("Dominica")],["DOM",t("Dominican Republic")],["ECU",t("Ecuador")],["EGY",t("Egypt")],["SLV",t("El Salvador")],["GNQ",t("Equatorial Guinea")],["ERI",t("Eritrea")],["EST",t("Estonia")],["ETH",t("Ethiopia")],["FLK",t("Falkland Islands (Malvinas)")],["FRO",t("Faroe Islands")],["FJI",t("Fiji")],["FIN",t("Finland")],["FRA",t("France")],["GUF",t("French Guiana")],["PYF",t("French Polynesia")],["ATF",t("French Southern Territories")],["GAB",t("Gabon")],["GMB",t("Gambia")],["GEO",t("Georgia")],["DEU",t("Germany")],["GHA",t("Ghana")],["GIB",t("Gibraltar")],["GRC",t("Greece")],["GRL",t("Greenland")],["GRD",t("Grenada")],["GLP",t("Guadeloupe")],["GUM",t("Guam")],["GTM",t("Guatemala")],["GGY",t("Guernsey")],["GIN",t("Guinea")],["GNB",t("Guinea-Bissau")],["GUY",t("Guyana")],["HTI",t("Haiti")],["HMD",t("Heard Island and McDonald Islands")],["VAT",t("Holy See (Vatican City State)")],["HND",t("Honduras")],["HKG",t("Hong Kong")],["HUN",t("Hungary")],["ISL",t("Iceland")],["IND",t("India")],["IDN",t("Indonesia")],["IRN",t("Iran, Islamic Republic of")],["IRQ",t("Iraq")],["IRL",t("Ireland")],["IMN",t("Isle of Man")],["ISR",t("Israel")],["ITA",t("Italy")],["JAM",t("Jamaica")],["JPN",t("Japan")],["JEY",t("Jersey")],["JOR",t("Jordan")],["KAZ",t("Kazakhstan")],["KEN",t("Kenya")],["KIR",t("Kiribati")],["PRK",t("Korea, Democratic Peoples Republic of")],["KOR",t("Korea, Republic of")],["KWT",t("Kuwait")],["KGZ",t("Kyrgyzstan")],["LAO",t("Lao Peoples Democratic Republic")],["LVA",t("Latvia")],["LBN",t("Lebanon")],["LSO",t("Lesotho")],["LBR",t("Liberia")],["LBY",t("Libya")],["LIE",t("Liechtenstein")],["LTU",t("Lithuania")],["LUX",t("Luxembourg")],["MAC",t("Macao")],["MKD",t("Macedonia, the former Yugoslav Republic of")],["MDG",t("Madagascar")],["MWI",t("Malawi")],["MYS",t("Malaysia")],["MDV",t("Maldives")],["MLI",t("Mali")],["MLT",t("Malta")],["MHL",t("Marshall Islands")],["MTQ",t("Martinique")],["MRT",t("Mauritania")],["MUS",t("Mauritius")],["MYT",t("Mayotte")],["MEX",t("Mexico")],["FSM",t("Micronesia, Federated States of")],["MDA",t("Moldova, Republic of")],["MCO",t("Monaco")],["MNG",t("Mongolia")],["MNE",t("Montenegro")],["MSR",t("Montserrat")],["MAR",t("Morocco")],["MOZ",t("Mozambique")],["MMR",t("Myanmar")],["NAM",t("Namibia")],["NRU",t("Nauru")],["NPL",t("Nepal")],["NLD",t("Netherlands")],["NCL",t("New Caledonia")],["NZL",t("New Zealand")],["NIC",t("Nicaragua")],["NER",t("Niger")],["NGA",t("Nigeria")],["NIU",t("Niue")],["NFK",t("Norfolk Island")],["MNP",t("Northern Mariana Islands")],["NOR",t("Norway")],["OMN",t("Oman")],["PAK",t("Pakistan")],["PLW",t("Palau")],["PSE",t("Palestinian Territory, Occupied")],["PAN",t("Panama")],["PNG",t("Papua New Guinea")],["PRY",t("Paraguay")],["PER",t("Peru")],["PHL",t("Philippines")],["PCN",t("Pitcairn")],["POL",t("Poland")],["PRT",t("Portugal")],["PRI",t("Puerto Rico")],["QAT",t("Qatar")],["REU",t("Réunion")],["ROU",t("Romania")],["RUS",t("Russian Federation")],["RWA",t("Rwanda")],["BLM",t("Saint Barthélemy")],["SHN",t("Saint Helena, Ascension and Tristan da Cunha")],["KNA",t("Saint Kitts and Nevis")],["LCA",t("Saint Lucia")],["MAF",t("Saint Martin (French part)")],["SPM",t("Saint Pierre and Miquelon")],["VCT",t("Saint Vincent and the Grenadines")],["WSM",t("Samoa")],["SMR",t("San Marino")],["STP",t("Sao Tome and Principe")],["SAU",t("Saudi Arabia")],["SEN",t("Senegal")],["SRB",t("Serbia")],["SYC",t("Seychelles")],["SLE",t("Sierra Leone")],["SGP",t("Singapore")],["SXM",t("Sint Maarten (Dutch part)")],["SVK",t("Slovakia")],["SVN",t("Slovenia")],["SLB",t("Solomon Islands")],["SOM",t("Somalia")],["ZAF",t("South Africa")],["SGS",t("South Georgia and the South Sandwich Islands")],["SSD",t("South Sudan")],["ESP",t("Spain")],["LKA",t("Sri Lanka")],["SDN",t("Sudan")],["SUR",t("Suriname")],["SJM",t("Svalbard and Jan Mayen")],["SWZ",t("Swaziland")],["SWE",t("Sweden")],["CHE",t("Switzerland")],["SYR",t("Syrian Arab Republic")],["TWN",t("Taiwan, Province of China")],["TJK",t("Tajikistan")],["TZA",t("Tanzania, United Republic of")],["THA",t("Thailand")],["TLS",t("Timor-Leste")],["TGO",t("Togo")],["TKL",t("Tokelau")],["TON",t("Tonga")],["TTO",t("Trinidad and Tobago")],["TUN",t("Tunisia")],["TUR",t("Turkey")],["TKM",t("Turkmenistan")],["TCA",t("Turks and Caicos Islands")],["TUV",t("Tuvalu")],["UGA",t("Uganda")],["UKR",t("Ukraine")],["ARE",t("United Arab Emirates")],["GBR",t("United Kingdom")],["USA",t("United States")],["UMI",t("United States Minor Outlying Islands")],["URY",t("Uruguay")],["UZB",t("Uzbekistan")],["VUT",t("Vanuatu")],["VEN",t("Venezuela, Bolivarian Republic of")],["VNM",t("Viet Nam")],["VGB",t("Virgin Islands, British")],["VIR",t("Virgin Islands, U.S.")],["WLF",t("Wallis and Futuna")],["ESH",t("Western Sahara")],["YEM",t("Yemen")],["ZMB",t("Zambia")],["ZWE",t("Zimbabwe")]]},0,["countryisocombo"],["component","box","field","textfield","pickerfield","combobox","combo","countryisocombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,countryisocombo:true},["widget.countryisocombo"],0,[MBilling.view.general,"CountryISOCombo"],0));(Ext.cmd.derive("MBilling.view.general.CountryCombo",Ext.form.field.ComboBox,{fieldLabel:t("Country"),forceSelection:true,editable:true,allowBlank:true,listeners:{focus:function(b){b.expand()}},store:[["",t("Select")],["93",t("Afghanistan")],["355",t("Albania")],["213",t("Algeria")],["684",t("American Samoa")],["376",t("Andorra")],["244",t("Angola")],["1264",t("Anguilla")],["672",t("Antarctica")],["1268",t("Antigua And Barbuda")],["54",t("Argentina")],["374",t("Armenia")],["297",t("Aruba")],["61",t("Australia")],["43",t("Austria")],["994",t("Azerbaijan")],["1242",t("Bahamas")],["973",t("Bahrain")],["880",t("Bangladesh")],["1246",t("Barbados")],["375",t("Belarus")],["32",t("Belgium")],["501",t("Belize")],["229",t("Benin")],["1441",t("Bermuda")],["975",t("Bhutan")],["591",t("Bolivia")],["387",t("Bosnia And Herzegovina")],["267",t("Botswana")],["55",t("Brazil")],["1284",t("British Indian Ocean Territory")],["673",t("Brunei Darussalam")],["359",t("Bulgaria")],["226",t("Burkina Faso")],["257",t("Burundi")],["855",t("Cambodia")],["237",t("Cameroon")],["238",t("Cape Verde")],["1345",t("Cayman Islands")],["236",t("Central African Republic")],["235",t("Chad")],["56",t("Chile")],["86",t("China")],["618",t("Christmas Island")],["61",t("Cocos (Keeling); Islands")],["57",t("Colombia")],["269",t("Comoros")],["242",t("Congo")],["243",t("Congo, The Democratic Republic Of The")],["682",t("Cook Islands")],["506",t("Costa Rica")],["385",t("Croatia")],["53",t("Cuba")],["357",t("Cyprus")],["420",t("Czech Republic")],["45",t("Denmark")],["253",t("Djibouti")],["1767",t("Dominica")],["1809",t("Dominican Republic")],["593",t("Ecuador")],["20",t("Egypt")],["503",t("El Salvador")],["240",t("Equatorial Guinea")],["291",t("Eritrea")],["372",t("Estonia")],["251",t("Ethiopia")],["500",t("Falkland Islands (Malvinas)")],["298",t("Faroe Islands")],["679",t("Fiji")],["358",t("Finland")],["33",t("France")],["596",t("French Guiana")],["594",t("French Polynesia")],["689",t("French Southern Territories")],["241",t("Gabon")],["220",t("Gambia")],["995",t("Georgia")],["49",t("Germany")],["233",t("Ghana")],["350",t("Gibraltar")],["30",t("Greece")],["299",t("Greenland")],["1473",t("Grenada")],["590",t("Guadeloupe")],["1671",t("Guam")],["502",t("Guatemala")],["224",t("Guinea")],["245",t("Guinea-Bissau")],["592",t("Guyana")],["509",t("Haiti")],["504",t("Honduras")],["852",t("Hong Kong")],["36",t("Hungary")],["354",t("Iceland")],["91",t("India")],["62",t("Indonesia")],["98",t("Iran, Islamic Republic Of")],["964",t("Iraq")],["353",t("Ireland")],["972",t("Israel")],["39",t("Italy")],["1876",t("Jamaica")],["81",t("Japan")],["962",t("Jordan")],["7",t("Kazakhstan")],["254",t("Kenya")],["686",t("Kiribati")],["850",t("Korea, Democratic Peoples Republic Of")],["82",t("Korea, Republic of")],["965",t("Kuwait")],["996",t("Kyrgyzstan")],["856",t("Lao Peoples Democratic Republic")],["371",t("Latvia")],["961",t("Lebanon")],["266",t("Lesotho")],["231",t("Liberia")],["218",t("Libyan Arab Jamahiriya")],["423",t("Liechtenstein")],["370",t("Lithuania")],["352",t("Luxembourg")],["853",t("Macao")],["389",t("Macedonia, The Former Yugoslav Republic Of")],["261",t("Madagascar")],["265",t("Malawi")],["60",t("Malaysia")],["960",t("Maldives")],["223",t("Mali")],["356",t("Malta")],["692",t("Marshall islands")],["596",t("Martinique")],["222",t("Mauritania")],["230",t("Mauritius")],["269",t("Mayotte")],["52",t("Mexico")],["691",t("Micronesia, Federated States Of")],["1808",t("Moldova, Republic Of")],["377",t("Monaco")],["976",t("Mongolia")],["1664",t("Montserrat")],["212",t("Morocco")],["258",t("Mozambique")],["95",t("Myanmar")],["264",t("Namibia")],["674",t("Nauru")],["977",t("Nepal")],["31",t("Netherlands")],["599",t("Netherlands Antilles")],["687",t("New Caledonia")],["64",t("New Zealand")],["505",t("Nicaragua")],["227",t("Niger")],["234",t("Nigeria")],["683",t("Niue")],["672",t("Norfolk Island")],["1670",t("Northern Mariana Islands")],["47",t("Norway")],["968",t("Oman")],["92",t("Pakistan")],["680",t("Palau")],["970",t("Palestinian Territory, Occupied")],["507",t("Panama")],["675",t("Papua New Guinea")],["595",t("Paraguay")],["51",t("Peru")],["63",t("Philippines")],["48",t("Poland")],["351",t("Portugal")],["1787",t("Puerto Rico")],["974",t("Qatar")],["262",t("Reunion")],["40",t("Romania")],["7",t("Russian Federation")],["250",t("Rwanda")],["290",t("SaINT Helena")],["1869",t("SaINT Kitts And Nevis")],["1758",t("SaINT Lucia")],["508",t("SaINT Pierre And Miquelon")],["1784",t("SaINT Vincent And The Grenadines")],["685",t("Samoa")],["378",t("San Marino")],["239",t("São Tomé And Principe")],["966",t("Saudi Arabia")],["221",t("Senegal")],["248",t("Seychelles")],["232",t("Sierra Leone")],["65",t("Singapore")],["421",t("Slovakia")],["386",t("Slovenia")],["677",t("Solomon Islands")],["252",t("Somalia")],["27",t("South Africa")],["34",t("Spain")],["94",t("Sri Lanka")],["249",t("Sudan")],["597",t("Suriname")],["268",t("Swaziland")],["46",t("Sweden")],["41",t("Switzerland")],["963",t("Syrian Arab Republic")],["886",t("Taiwan, Province Of China")],["992",t("Tajikistan")],["255",t("Tanzania, United Republic Of")],["66",t("Thailand")],["670",t("Timor-Leste")],["228",t("Togo")],["690",t("Tokelau")],["676",t("Tonga")],["1868",t("Trinidad And Tobago")],["216",t("Tunisia")],["90",t("Turkey")],["993",t("Turkmenistan")],["1649",t("Turks And Caicos Islands")],["688",t("Tuvalu")],["256",t("Uganda")],["380",t("Ukraine")],["971",t("United Arab Emirates")],["44",t("United Kingdom")],["1",t("United States/Canada")],["598",t("Uruguay")],["998",t("Uzbekistan")],["678",t("Vanuatu")],["58",t("Venezuela")],["84",t("Vietnam")],["1284",t("Virgin Islands, British")],["808",t("Virgin Islands, U.S.")],["681",t("Wallis And Futuna")],["967",t("Yemen")],["260",t("Zambia")],["263",t("Zimbabwe")],["35818",t("Aland Islands")],["441481",t("Guernsey")],["441624",t("Isle of Man")],["441534",t("Jersey")],["382",t("Montenegro, Republic of")],["381",t("Serbia, Republic of")]]},0,["countrycombo"],["component","box","field","textfield","pickerfield","combobox","combo","countrycombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,countrycombo:true},["widget.countrycombo"],0,[MBilling.view.general,"CountryCombo"],0));(Ext.cmd.derive("MBilling.view.general.GroupCombo",Ext.form.field.ComboBox,{fieldLabel:t("group"),value:"config_group_title",forceSelection:true,editable:false,store:[["global","global"],["callback","callback"],["agi-conf1","agi-conf1"],["agi-conf2","agi-conf2"]]},0,["groupcombo"],["component","box","field","textfield","pickerfield","combobox","combo","groupcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,groupcombo:true},["widget.groupcombo"],0,[MBilling.view.general,"GroupCombo"],0));(Ext.cmd.derive("MBilling.view.general.LcrtypeCombo",Ext.form.field.ComboBox,{fieldLabel:t("lcrtype"),forceSelection:true,editable:false,value:1,store:[[1,t("LCRAccordingtothebuyerPrice")],[0,t("LCRAccordingtothesellerPrice")]]},0,["lcrtypecombo"],["component","box","field","textfield","pickerfield","combobox","combo","lcrtypecombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,lcrtypecombo:true},["widget.lcrtypecombo"],0,[MBilling.view.general,"LcrtypeCombo"],0));(Ext.cmd.derive("MBilling.view.general.LcrtypeFullCombo",Ext.form.field.ComboBox,{forceSelection:true,editable:false,fieldLabel:t("lcrtype"),value:1,store:[[1,t("LCRAccordingtothebuyerPrice")],[0,t("LCRAccordingtothesellerPrice")],[2,t("Load Balancer")]]},0,["lcrtypefullcombo"],["component","box","field","textfield","pickerfield","combobox","combo","lcrtypefullcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,lcrtypefullcombo:true},["widget.lcrtypefullcombo"],0,[MBilling.view.general,"LcrtypeFullCombo"],0));(Ext.cmd.derive("MBilling.view.general.OfferTypeCombo",Ext.form.field.ComboBox,{fieldLabel:t("offertype"),forceSelection:true,editable:false,value:0,store:[[0,t("unlimitedcalls")],[1,t("numberfreecalls")],[2,t("freeseconds")]]},0,["offertypecombo"],["component","box","field","textfield","pickerfield","combobox","combo","offertypecombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,offertypecombo:true},["widget.offertypecombo"],0,[MBilling.view.general,"OfferTypeCombo"],0));(Ext.cmd.derive("MBilling.view.general.BillingTypeCombo",Ext.form.field.ComboBox,{fieldLabel:t("billingtype"),forceSelection:true,editable:false,value:0,store:[[0,t("monthly")],[1,t("weekly")]]},0,["billingtypecombo"],["component","box","field","textfield","pickerfield","combobox","combo","billingtypecombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,billingtypecombo:true},["widget.billingtypecombo"],0,[MBilling.view.general,"BillingTypeCombo"],0));(Ext.cmd.derive("MBilling.view.general.SipCombo",Ext.form.field.ComboBox,{fieldLabel:t("providertech"),forceSelection:true,editable:false,value:"sip",store:[["sip","sip"],["dahdi","dahdi"],["khomp","khomp"],["iax2","iax2"],["dgv","dgv"],["ooh323","ooh323"],["extra","extra"],["Dongle","Dongle"],["Local","Local"]]},0,["sipcombo"],["component","box","field","textfield","pickerfield","combobox","combo","sipcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,sipcombo:true},["widget.sipcombo"],0,[MBilling.view.general,"SipCombo"],0));(Ext.cmd.derive("MBilling.view.general.TypePaymentCombo",Ext.form.field.ComboBox,{fieldLabel:t("typepaid"),forceSelection:true,editable:false,value:0,store:[[0,t("prepaid")],[1,t("pospaid")]]},0,["typepaymentcombo"],["component","box","field","textfield","pickerfield","combobox","combo","typepaymentcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,typepaymentcombo:true},["widget.typepaymentcombo"],0,[MBilling.view.general,"TypePaymentCombo"],0));(Ext.cmd.derive("MBilling.view.general.CampaignSendCombo",Ext.form.field.ComboBox,{fieldLabel:t("type"),forceSelection:true,editable:false,displayField:"name",valueField:"id",value:"CALL1",store:{fields:["id","name"],data:[{id:"CALL1",name:t("Select type"),showFields:["type"]},{id:"SMS",name:"SMS",showFields:["type","sms_text","csv_path","numbers","startingdate","startingtime"]},{id:"CALL",name:"CALL",showFields:["type","audio_path","csv_path","numbers","startingdate","startingtime"]}]}},0,["campaignsendcombo"],["component","box","field","textfield","pickerfield","combobox","combo","campaignsendcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,campaignsendcombo:true},["widget.campaignsendcombo"],0,[MBilling.view.general,"CampaignSendCombo"],0));(Ext.cmd.derive("MBilling.view.general.PaymentCountryCombo",Ext.form.field.ComboBox,{fieldLabel:t("typepaid"),value:"Brasil",forceSelection:true,editable:true,listeners:{focus:function(b){b.expand()}},store:[["Argentina","Argentina"],["Brasil","Brasil"],["Colombia","Colombia"],["Latino America","Latino America"],["Global","Global"]]},0,["paymentcountrycombo"],["component","box","field","textfield","pickerfield","combobox","combo","paymentcountrycombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,paymentcountrycombo:true},["widget.paymentcountrycombo"],0,[MBilling.view.general,"PaymentCountryCombo"],0));(Ext.cmd.derive("MBilling.view.general.BoletoBanckCombo",Ext.form.field.ComboBox,{fieldLabel:t("Banco"),forceSelection:true,editable:false,value:"cef",store:[["cef","Caixa Economica SICOB"],["bradesco","Bradesco"]]},0,["boletobanckcombo"],["component","box","field","textfield","pickerfield","combobox","combo","boletobanckcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,boletobanckcombo:true},["widget.boletobanckcombo"],0,[MBilling.view.general,"BoletoBanckCombo"],0));(Ext.cmd.derive("MBilling.view.general.PaymentBanckCombo",Ext.form.field.ComboBox,{fieldLabel:t("typepaid"),forceSelection:true,editable:false,value:"Banco do Brasil",store:[["Banco do Brasil","Banco do Brasil"],["bradesco","Bradesco"],["hsbc","Hsbc"],["itau","Itau"],["santander","Santander"],["unibanco","Unibanco"],["cef","Caixa Economica SICOB"],["cef_sinco","Caixa Economica SINCO"],["cef_sigcb","Caixa Economica SIGCB"]]},0,["paymentbanckcombo"],["component","box","field","textfield","pickerfield","combobox","combo","paymentbanckcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,paymentbanckcombo:true},["widget.paymentbanckcombo"],0,[MBilling.view.general,"PaymentBanckCombo"],0));(Ext.cmd.derive("MBilling.view.templateMail.Controller",Ext.ux.app.ViewController,{onAfterSave:function(d){var c=this;d=d||c.formPanel;if(!d.idRecord){d.getForm().reset();c.focusFirstField()}c.saveButton.enable();c.updateLotButton&&c.updateLotButton.toggle(false);d.setLoading(false);c.store.load()},onEdit:function(){var b=this;b.lookupReference("generalTab").show();Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)}},0,0,0,0,["controller.templatemail"],0,[MBilling.view.templateMail,"Controller"],0));(Ext.cmd.derive("MBilling.view.templateMail.Module",Ext.ux.panel.Module,{controller:"templatemail",cfgEast:{flex:9}},0,["templatemailmodule"],["component","box","container","uxpanelmodule","templatemailmodule"],{component:true,box:true,container:true,uxpanelmodule:true,templatemailmodule:true},["widget.templatemailmodule"],0,[MBilling.view.templateMail,"Module"],0));(Ext.cmd.derive("MBilling.view.templateMail.List",Ext.ux.grid.Panel,{store:"TemplateMail",initComponent:function(){var b=this;b.allowPrint=false;b.buttonCsv=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowDelete=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("type"),dataIndex:"mailtype",flex:3},{header:t("Language"),renderer:Helper.Util.formatLanguageImage,dataIndex:"language",flex:2},{header:t("subject"),dataIndex:"subject",flex:7}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["templatemaillist"],["component","box","container","panel","tablepanel","gridpanel","grid","templatemaillist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,templatemaillist:true},["widget.templatemaillist"],0,[MBilling.view.templateMail,"List"],0));(Ext.cmd.derive("MBilling.view.templateMail.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true}},items:[{title:t("general"),reference:"generalTab",items:[{name:"fromname",fieldLabel:t("fromname")},{name:"fromemail",fieldLabel:t("fromemail")},{name:"subject",fieldLabel:t("subject")}]},{title:t("Email body"),items:[{hideLabel:true,xtype:"htmleditor",name:"messagehtml",fieldLabel:t("description"),height:1000,anchor:"100%"}]},{title:t("Variables"),items:[{xtype:"displayfield",fieldLabel:t("username"),value:'$login$',allowBlank:true},{xtype:"displayfield",fieldLabel:t("password"),value:'$password$',allowBlank:true},{xtype:"displayfield",fieldLabel:t("email"),value:'$email$',allowBlank:true},{xtype:"displayfield",fieldLabel:t("firstname"),value:'$firstname$',allowBlank:true},{xtype:"displayfield",fieldLabel:t("lastname"),value:'$lastname$',allowBlank:true},{xtype:"displayfield",fieldLabel:t("credit"),value:'$credit$',allowBlank:true},{xtype:"displayfield",fieldLabel:t("date"),value:'$time$',allowBlank:true},{xtype:"displayfield",fieldLabel:t("description"),value:'$description$',allowBlank:true},{xtype:"displayfield",fieldLabel:t("Url to cancel email credit notification"),value:'$cancel_credit_notification_email$',allowBlank:true}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["templatemailform"],["component","box","container","panel","form","templatemailform"],{component:true,box:true,container:true,panel:true,form:true,templatemailform:true},["widget.templatemailform"],0,[MBilling.view.templateMail,"Form"],0));(Ext.cmd.derive("MBilling.view.logUsers.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.logusers"],0,[MBilling.view.logUsers,"Controller"],0));(Ext.cmd.derive("MBilling.view.logUsers.Module",Ext.ux.panel.Module,{controller:"logusers"},0,["logusersmodule"],["component","box","container","uxpanelmodule","logusersmodule"],{component:true,box:true,container:true,uxpanelmodule:true,logusersmodule:true},["widget.logusersmodule"],0,[MBilling.view.logUsers,"Module"],0));(Ext.cmd.derive("MBilling.view.logUsers.List",Ext.ux.grid.Panel,{store:"LogUsers",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.allowDelete=false;b.allowCreate=false;b.allowUpdate=false;b.columns=[{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isOperator,hideable:!App.user.isOperator},{header:t("action"),dataIndex:"idLogActionsname",renderer:Helper.Util.translate,flex:3},{header:t("description"),dataIndex:"description",flex:7},{header:t("IP"),dataIndex:"ip",flex:4},{header:t("date"),renderer:Helper.Util.formatDateTime,dataIndex:"date",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["loguserslist"],["component","box","container","panel","tablepanel","gridpanel","grid","loguserslist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,loguserslist:true},["widget.loguserslist"],0,[MBilling.view.logUsers,"List"],0));(Ext.cmd.derive("MBilling.view.logUsers.Form",Ext.ux.form.Panel,{fieldsHideEdit:["cid"],initComponent:function(){var b=this;b.items=[{xtype:"usercombo",allowBlank:true,readOnly:true},{name:"id_log_actions",fieldLabel:t("action"),readOnly:true},{name:"ip",fieldLabel:t("ip"),readOnly:true},{xtype:"textareafield",name:"description",fieldLabel:t("description"),height:400,anchor:"100%",allowBlank:true,readOnly:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["logusersform"],["component","box","container","panel","form","logusersform"],{component:true,box:true,container:true,panel:true,form:true,logusersform:true},["widget.logusersform"],0,[MBilling.view.logUsers,"Form"],0));(Ext.cmd.derive("MBilling.view.provider.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.provider"],0,[MBilling.view.provider,"Controller"],0));(Ext.cmd.derive("MBilling.view.provider.Combo",Ext.form.field.ComboBox,{name:"id_provider",fieldLabel:t("provider"),forceSelection:true,editable:false,displayField:"provider_name",valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Provider",{proxy:{type:"uxproxy",module:"provider",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["providercombo"],["component","box","field","textfield","pickerfield","combobox","combo","providercombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,providercombo:true},["widget.providercombo"],0,[MBilling.view.provider,"Combo"],0));(Ext.cmd.derive("MBilling.view.provider.Module",Ext.ux.panel.Module,{controller:"provider"},0,["providermodule"],["component","box","container","uxpanelmodule","providermodule"],{component:true,box:true,container:true,uxpanelmodule:true,providermodule:true},["widget.providermodule"],0,[MBilling.view.provider,"Module"],0));(Ext.cmd.derive("MBilling.view.provider.List",Ext.ux.grid.Panel,{store:"Provider",initComponent:function(){var b=this;b.columns=b.columns||[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("name"),dataIndex:"provider_name"},{header:t("description"),dataIndex:"description"},{header:t("credit"),dataIndex:"credit",renderer:Helper.Util.formatMoneyDecimal},{header:t("creationdate"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"creationdate"}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["providerlist"],["component","box","container","panel","tablepanel","gridpanel","grid","providerlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,providerlist:true},["widget.providerlist"],0,[MBilling.view.provider,"List"],0));(Ext.cmd.derive("MBilling.view.provider.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["provider_name"],initComponent:function(){var b=this;b.items=[{name:"provider_name",fieldLabel:t("name")},{xtype:"moneyfield",name:"credit",mask:App.user.currency+" #9.999.990,00",fieldLabel:t("credit"),value:"0"},{xtype:"noyescombo",name:"credit_control",fieldLabel:t("Credit")+" "+t("control"),hidden:App.user.isClient},{xtype:"textareafield",name:"description",fieldLabel:t("description"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["providerform"],["component","box","container","panel","form","providerform"],{component:true,box:true,container:true,panel:true,form:true,providerform:true},["widget.providerform"],0,[MBilling.view.provider,"Form"],0));(Ext.cmd.derive("MBilling.view.provider.Lookup",Ext.ux.form.field.Lookup,{name:"id_provider",fieldLabel:t("Provider"),displayField:"idProviderprovider_name",displayFieldList:"provider_name",gridConfig:{xtype:"providerlist",fieldSearch:"username",columns:[{header:t("name"),dataIndex:"provider_name"},{header:t("description"),dataIndex:"description"}]}},0,["providerlookup"],["component","box","container","fieldcontainer","providerlookup"],{component:true,box:true,container:true,fieldcontainer:true,providerlookup:true},["widget.providerlookup"],0,[MBilling.view.provider,"Lookup"],0));(Ext.cmd.derive("MBilling.view.plan.Controller",Ext.ux.app.ViewController,{init:function(){var b=this;b.control({noyescombo:{select:b.onSelectType}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectType:function(c,d){this.showFieldsRelated(d.getData().showFields)},showFieldsRelated:function(j){var l=this,g=l.formPanel.getForm().getFields(),f=l.formPanel.getForm().findField("ini_credit"),m=l.formPanel.getForm();g.each(function(a){if(a.name=="signup"){a.value==1?f.show():f.hide()}})},onEdit:function(){var f=this,d=f.formPanel.getForm().findField("ini_credit"),e=f.formPanel.getForm().findField("signup");Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments);e.value==1?d.show():d.hide()}},0,0,0,0,["controller.plan"],0,[MBilling.view.plan,"Controller"],0));(Ext.cmd.derive("MBilling.view.plan.Combo",Ext.form.field.ComboBox,{name:"id_plan",fieldLabel:t("plan"),displayField:"name",valueField:"id",forceSelection:true,editable:true,listeners:{focus:function(b){b.expand()}},initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Plan",{proxy:{type:"uxproxy",module:"plan",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["plancombo"],["component","box","field","textfield","pickerfield","combobox","combo","plancombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,plancombo:true},["widget.plancombo"],0,[MBilling.view.plan,"Combo"],0));(Ext.cmd.derive("MBilling.view.plan.Module",Ext.ux.panel.Module,{controller:"plan"},0,["planmodule"],["component","box","container","uxpanelmodule","planmodule"],{component:true,box:true,container:true,uxpanelmodule:true,planmodule:true},["widget.planmodule"],0,[MBilling.view.plan,"Module"],0));(Ext.cmd.derive("MBilling.view.plan.List",Ext.ux.grid.Panel,{store:"Plan",fieldSearch:"name",initComponent:function(){var b=this;b.columns=b.columns||[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("name"),dataIndex:"name",flex:4},{header:t("lcrtype"),dataIndex:"lcrtype",comboRelated:"lcrtypecombo",renderer:Helper.Util.formatLcrtype,flex:4,filter:{type:"list",options:[[1,t("LCRAccordingtothebuyerPrice")],[0,t("LCRAccordingtothesellerPrice")],[2,t("Load Balancer")]]}},{header:t("Tech Prefx"),dataIndex:"techprefix",flex:4,hidden:!App.user.isAdmin},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"creationdate",flex:4},{header:t("Port. Celular"),dataIndex:"portabilidadeMobile",flex:2,renderer:Helper.Util.formattyyesno,filter:{type:"list",options:[[0,t("no")],[1,t("yes")]]},hidden:App.user.language!="pt_BR",hideable:false},{header:t("Port. Fixo"),dataIndex:"portabilidadeFixed",flex:2,renderer:Helper.Util.formattyyesno,filter:{type:"list",options:[[0,t("no")],[1,t("yes")]]},hidden:App.user.language!="pt_BR",hideable:false}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["planlist"],["component","box","container","panel","tablepanel","gridpanel","grid","planlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,planlist:true},["widget.planlist"],0,[MBilling.view.plan,"List"],0));(Ext.cmd.derive("MBilling.view.plan.Form",Ext.ux.form.Panel,{labelWidthFields:115,fieldsHideUpdateLot:["name"],initComponent:function(){var b=this;b.defaults={labelWidth:142};b.items=[{name:"name",fieldLabel:t("name"),maxLength:100},{xtype:"lcrtypefullcombo",name:"lcrtype",fieldLabel:t("lcrtype"),allowBlank:true},{xtype:"numberfield",name:"tariff_limit",minValue:1,value:1,fieldLabel:t("Tariff Find Limit"),hidden:!App.user.isAdmin},{xtype:"noyescombo",name:"signup",fieldLabel:t("useInSignup"),allowBlank:true},{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,00",name:"ini_credit",fieldLabel:t("Initial Credit to new users"),allowBlank:true,hidden:true,value:0},{xtype:"yesnocombo",name:"play_audio",fieldLabel:t("Notices with audio"),allowBlank:true,hidden:App.user.isClient},{style:"margin-top:25px",xtype:"fieldset",title:t("Ativar portabilidade?"),collapsible:true,collapsed:false,hidden:App.user.language!="pt_BR",defaults:{labelWidth:190,anchor:"100%",layout:{type:"hbox",labelAlign:b.labelAlignFields}},items:[{xtype:"noyescombo",name:"portabilidadeMobile",fieldLabel:t("Para Celular"),allowBlank:true,hidden:App.user.language!="pt_BR"},{xtype:"noyescombo",name:"portabilidadeFixed",fieldLabel:t("Para Fixo"),allowBlank:true,hidden:App.user.language!="pt_BR"}]},{name:"techprefix",fieldLabel:t("Tech Prefix"),allowBlank:true,maxLength:5,minLength:5,hidden:!App.user.isAdmin},{style:"margin-top:25px",xtype:"fieldset",title:t("Select one or more Services"),collapsible:true,collapsed:false,items:[{anchor:"100%",fieldLabel:"",xtype:"servicestag",allowBlank:true}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["planform"],["component","box","container","panel","form","planform"],{component:true,box:true,container:true,panel:true,form:true,planform:true},["widget.planform"],0,[MBilling.view.plan,"Form"],0));(Ext.cmd.derive("MBilling.view.plan.Tag",Ext.form.field.Tag,{name:"id_plan",fieldLabel:t("plan"),displayField:"name",valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Plan",{proxy:{type:"uxproxy",module:"plan",limitParam:undefined}});Ext.form.field.Tag.prototype.initComponent.apply(this,arguments)}},0,["plantag"],["component","box","field","textfield","pickerfield","combobox","combo","tagfield","plantag"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,tagfield:true,plantag:true},["widget.plantag"],0,[MBilling.view.plan,"Tag"],0));(Ext.cmd.derive("MBilling.view.plan.Lookup",Ext.ux.form.field.Lookup,{name:"id_plan",fieldLabel:t("Plan"),displayField:"idPlanname",displayFieldList:"name",gridConfig:{xtype:"planlist",fieldSearch:"name",columns:[{header:t("name"),dataIndex:"name",flex:2}]}},0,["planlookup"],["component","box","container","fieldcontainer","planlookup"],{component:true,box:true,container:true,fieldcontainer:true,planlookup:true},["widget.planlookup"],0,[MBilling.view.plan,"Lookup"],0));(Ext.cmd.derive("MBilling.view.trunk.Controller",Ext.ux.app.ViewController,{onEdit:function(){var f=this,e=f.list.getSelectionModel().getSelection()[0],d=f.formPanel.getForm().findField("register");if(e.get("register")==1){if(e.get("register")&&e.get("providertech")=="sip"){color=e.get("registered")==1?"green":"red";d.setFieldLabel(t("registertrunk")+' ')}else{d.setFieldLabel(t("registertrunk"))}f.formPanel.getForm().findField("register_string")["show"]()}else{d.setFieldLabel(t("registertrunk"));f.formPanel.getForm().findField("register_string")["hide"]()}Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments);valueAllow=f.formPanel.idRecord?e.get("allow").split(","):["g729","gsm","alaw","ulaw"];fieldAllow=f.formPanel.down("checkboxgroup");fieldAllow.setValue({allow:valueAllow})},init:function(){var b=this;b.control({"noyescombo[name=register]":{select:b.onSelectType}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectType:function(c,d){this.showFieldsRelated(d.getData().showFields)},showFieldsRelated:function(o){var p=this,m=p.formPanel.getForm().findField("register_string"),n=p.formPanel.getForm().findField("user"),q=p.formPanel.getForm().findField("secret"),j=p.formPanel.getForm().findField("host"),l=p.formPanel.getForm().getFields();l.each(function(a){if(a.name=="register"){m.setVisible(a.value==1);m.setValue(n.value+":"+q.value+"@"+j.value+"/"+n.value)}})}},0,0,0,0,["controller.trunk"],0,[MBilling.view.trunk,"Controller"],0));(Ext.cmd.derive("MBilling.view.trunk.Combo",Ext.form.field.ComboBox,{name:"id_trunk",fieldLabel:t("trunk"),forceSelection:true,editable:true,listeners:{focus:function(b){b.expand()}},displayField:"trunkcode",valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Trunk",{proxy:{type:"uxproxy",module:"trunk",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["trunkcombo"],["component","box","field","textfield","pickerfield","combobox","combo","trunkcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,trunkcombo:true},["widget.trunkcombo"],0,[MBilling.view.trunk,"Combo"],0));(Ext.cmd.derive("MBilling.view.trunk.ComboBackup",Ext.form.field.ComboBox,{name:"failover_trunk",fieldLabel:t("failover_trunk"),displayField:"trunkcode",valueField:"id",value:0,limitParam:undefined,forceSelection:true,editable:true,extraValues:[{id:0,trunkcode:t("undefined")}],listeners:{focus:function(b){b.expand()}},initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Trunk",{proxy:{type:"uxproxy",module:"trunk",limitParam:undefined}});b.on("render",b.loadStore,b);Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)},loadStore:function(g){var j=this,e=g.store,f;e.load({callback:function(){if(j.extraValues.length){e.insert(0,j.extraValues)}}})}},0,["trunkcombobackup"],["component","box","field","textfield","pickerfield","combobox","combo","trunkcombobackup"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,trunkcombobackup:true},["widget.trunkcombobackup"],0,[MBilling.view.trunk,"ComboBackup"],0));(Ext.cmd.derive("MBilling.view.trunk.Module",Ext.ux.panel.Module,{controller:"trunk"},0,["trunkmodule"],["component","box","container","uxpanelmodule","trunkmodule"],{component:true,box:true,container:true,uxpanelmodule:true,trunkmodule:true},["widget.trunkmodule"],0,[MBilling.view.trunk,"Module"],0));(Ext.cmd.derive("MBilling.view.trunk.List",Ext.ux.grid.Panel,{store:"Trunk",fieldSearch:"trunkcode",initComponent:function(){var b=this;b.columns=b.columns||[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("trunkcode"),dataIndex:"trunkcode",flex:3},{header:t("add")+" "+t("prefix"),dataIndex:"trunkprefix",flex:2},{header:t("remove")+" "+t("prefix"),dataIndex:"removeprefix",flex:2},{header:t("host"),dataIndex:"host",flex:2},{xtype:"templatecolumn",tpl:"{idProviderprovider_name}",header:t("provider"),dataIndex:"id_provider",comboFilter:"providercombo",flex:2},{header:t("secondusedreal"),renderer:Helper.Util.formatsecondsToTime,dataIndex:"secondusedreal",flex:3},{header:t("status"),dataIndex:"status",renderer:Helper.Util.formatBooleanActive,comboFilter:"booleancombo",flex:1,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")]]}},{header:t("creationdate"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"creationdate",flex:3}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["trunklist"],["component","box","container","panel","tablepanel","gridpanel","grid","trunklist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,trunklist:true},["widget.trunklist"],0,[MBilling.view.trunk,"List"],0));(Ext.cmd.derive("MBilling.view.trunk.Form",Ext.ux.form.Panel,{autoHeight:300,bodyPadding:0,fieldsHideUpdateLot:["trunkcode"],initComponent:function(){var b=this;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{labelAlign:"right",plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true,labelWidth:142}},items:[{title:t("general"),items:[{xtype:"providerlookup",ownerForm:b},{name:"trunkcode",fieldLabel:t("trunkcode")},{name:"user",fieldLabel:t("user"),allowBlank:true},{name:"secret",fieldLabel:t("password"),allowBlank:true},{name:"host",fieldLabel:t("host")},{name:"trunkprefix",fieldLabel:t("add")+" "+t("prefix"),allowBlank:true},{name:"removeprefix",fieldLabel:t("remove")+" "+t("prefix"),allowBlank:true},{xtype:"checkboxgroup",columns:3,name:"allow",fieldLabel:t("codec"),items:[{boxLabel:"g729",name:"allow",inputValue:"g729",checked:true},{boxLabel:"g723",name:"allow",inputValue:"g723"},{boxLabel:"gsm",name:"allow",inputValue:"gsm",checked:true},{boxLabel:"g726",name:"allow",inputValue:"g726"},{boxLabel:"opus",name:"allow",inputValue:"opus",checked:true},{boxLabel:"alaw",name:"allow",inputValue:"alaw",checked:true},{boxLabel:"ulaw",name:"allow",inputValue:"ulaw",checked:true},{boxLabel:"g722",name:"allow",inputValue:"g722"},{boxLabel:"ilbc",name:"allow",inputValue:"ilbc"},{boxLabel:"speex",name:"allow",inputValue:"speex"},{boxLabel:"h261",name:"allow",inputValue:"h261"},{boxLabel:"h263",name:"allow",inputValue:"h263"}],allowBlank:true},{xtype:"sipcombo",name:"providertech",fieldLabel:t("providertech")},{xtype:"trunkcombobackup",allowBlank:true},{xtype:"booleancombo",name:"status",fieldLabel:t("status")},{xtype:"noyescombo",name:"allow_error",fieldLabel:t("allow_error")},{xtype:"noyescombo",name:"register",fieldLabel:t("registertrunk")},{name:"register_string",fieldLabel:t("Register String"),allowBlank:true,hidden:true}]},{title:t("suplementaryInfo"),defaults:{labelAlign:"right",plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true,labelWidth:142},items:[{name:"fromuser",fieldLabel:"fromuser",allowBlank:true},{name:"fromdomain",fieldLabel:"Fromdomain",allowBlank:true},{name:"language",fieldLabel:t("language"),allowBlank:true},{name:"context",fieldLabel:t("context"),allowBlank:true,value:"billing"},{name:"dtmfmode",fieldLabel:"dtmfmode",allowBlank:true,value:"RFC2833"},{name:"insecure",fieldLabel:"insecure",allowBlank:true,value:"port,invite"},{xtype:"numberfield",name:"maxuse",fieldLabel:t("maxuse"),allowBlank:true,value:-1,minValue:-1},{name:"nat",fieldLabel:"nat",value:App.user.asteriskVersion=="1.8"?"yes":"force_rport,comedia",allowBlank:true},{name:"directmedia",allowBlank:true,value:"no",fieldLabel:"directmedia"},{name:"qualify",fieldLabel:"qualify",allowBlank:true,value:"yes"},{name:"type",fieldLabel:"type",allowBlank:true,value:"peer"},{name:"disallow",fieldLabel:"disallow",allowBlank:true,value:"all"},{name:"sendrpid",fieldLabel:"sendrpid",allowBlank:true,value:"no"},{name:"addparameter",fieldLabel:t("addparameter"),allowBlank:true,emptyText:t("parameterdial")},{xtype:"textarea",name:"link_sms",fieldLabel:t("link_sms"),allowBlank:true,emptyText:t("linksmsobs"),height:100,anchor:"100%"},{name:"sms_res",fieldLabel:t("sms_res"),allowBlank:true},{xtype:"numberfield",name:"port",fieldLabel:t("Port"),value:"5060",readOnly:!App.user.isAdmin,hidden:App.user.isClient,allowBlank:App.user.isClient},{xtype:"combobox",name:"encryption",value:"no",store:[["no","No"],["yes","yes"]],fieldLabel:t("Encryption"),allowBlank:true,hidden:!App.user.isAdmin},{xtype:"combobox",forceSelection:true,editable:false,value:"no",store:[["tls","tls"],["no","disable"]],name:"transport",fieldLabel:t("Transport"),allowBlank:true,hidden:!App.user.isAdmin}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["trunkform"],["component","box","container","panel","form","trunkform"],{component:true,box:true,container:true,panel:true,form:true,trunkform:true},["widget.trunkform"],0,[MBilling.view.trunk,"Form"],0));(Ext.cmd.derive("MBilling.view.trunk.Lookup",Ext.ux.form.field.Lookup,{name:"id_trunk",fieldLabel:t("Trunk"),displayField:"idTrunktrunkcode",displayFieldList:"trunkcode",gridConfig:{xtype:"trunklist",fieldSearch:"trunkcode",columns:[{header:t("trunkcode"),dataIndex:"trunkcode"}]}},0,["trunklookup"],["component","box","container","fieldcontainer","trunklookup"],{component:true,box:true,container:true,fieldcontainer:true,trunklookup:true},["widget.trunklookup"],0,[MBilling.view.trunk,"Lookup"],0));(Ext.cmd.derive("MBilling.view.prefix.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.prefix"],0,[MBilling.view.prefix,"Controller"],0));(Ext.cmd.derive("MBilling.view.prefix.Combo",Ext.form.field.ComboBox,{name:"id_prefix",fieldLabel:t("destination"),displayField:"prefix",filterMode:"remote",valueField:"id",listConfig:{itemTpl:Ext.create("Ext.XTemplate","
{prefix} - {destination}
")},displayTpl:Ext.create("Ext.XTemplate",'{prefix} - {destination}'),initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.PrefixCombo",{proxy:{type:"uxproxy",module:"prefixCombo",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["prefixcombo"],["component","box","field","textfield","pickerfield","combobox","combo","prefixcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,prefixcombo:true},["widget.prefixcombo"],0,[MBilling.view.prefix,"Combo"],0));(Ext.cmd.derive("MBilling.view.prefix.Module",Ext.ux.panel.Module,{controller:"prefix"},0,["prefixmodule"],["component","box","container","uxpanelmodule","prefixmodule"],{component:true,box:true,container:true,uxpanelmodule:true,prefixmodule:true},["widget.prefixmodule"],0,[MBilling.view.prefix,"Module"],0));(Ext.cmd.derive("Ext.ux.form.field.FileUpload",Ext.form.field.File,{anchor:"0",name:"file",emptyText:t("selectFile"),fieldLabel:t("file"),buttonText:undefined,maxSize:3144000,extAllowed:["csv","ret"],titleTipInfo:t("modelContent"),titleWarning:t("warning"),msgInvalidFile:t("fileNotAllow"),msgInvalidSize:t("maxSizeFile"),childEls:["browseButtonWrap","playButtonWrap"],buttonPlayMargin:5,buttonConfig:{glyph:icons.file},triggers:{filebutton:{type:"component",hideOnReadOnly:false},playbutton:{type:"component"}},applyTriggers:function(e){var d=this,f=(e||{}).playbutton;if(f){f.component=Ext.apply({xtype:"button",iconCls:"icon-play",ownerCt:d,id:d.id+"-play",ui:d.ui,disabled:d.disabled,style:d.getButtonMarginProp()+d.buttonPlayMargin+"px",inputName:d.getName(),scope:d,handler:d.playStop,hidden:true});return Ext.form.field.File.prototype.applyTriggers.call(this,e)}},onRender:function(){var c=this,d;c.isAudio=c.extAllowed.indexOf("wav")!==-1;c.formPanel=c.up("form");c.formPanel.on("edit",c.onEditForm,c);(arguments.callee.$previous||Ext.form.field.File.prototype.onRender).apply(this,arguments);c.triggerPlay=c.getTrigger("playbutton");c.buttonPlay=c.triggerPlay.component;c.triggerPlay.el.setWidth(c.buttonPlay.getEl().getWidth()+c.buttonPlay.getEl().getMargin("lr"));if(Ext.isIE){c.buttonPlay.getEl().repaint()}c.initTipInfo()},reset:function(){var b=this;if(!b.isAudio){return}if(b.audio&&!b.audio.paused&&b.audio.currentTime){b.audio.pause();b.audio.currentTime=0}b.buttonPlay.setIconCls("icon-play");b.triggerPlay.el.setWidth(0);if(Ext.isIE){b.buttonPlay.getEl().repaint()}Ext.form.field.File.prototype.reset.apply(this,arguments)},onEditForm:function(){var g=this,f=g.formPanel.getForm().getRecord(),j=f&&f.get(g.name),e=!Ext.isEmpty(j);if(!g.isAudio){return}if(g.audio&&!g.audio.paused&&g.audio.currentTime){g.audio.pause();g.audio.currentTime=0}g.buttonPlay.setIconCls("icon-play");if(e){g.audio=new Audio(j);g.audio.addEventListener("ended",Ext.bind(g.onEndAudio,g));g.triggerPlay.el.setWidth(g.buttonPlay.el.getWidth()+g.buttonPlay.el.getMargin("lr"));if(Ext.isIE){g.buttonPlay.getEl().repaint()}}else{g.triggerPlay.el.setWidth(0);if(Ext.isIE){g.buttonPlay.getEl().repaint()}}g.buttonPlay.setVisible(e);g.triggerPlay.setVisible(e)},onEndAudio:function(){this.buttonPlay.setIconCls("icon-play")},getTriggerMarkup:function(){var d=this,e=Ext.form.field.File.prototype.getTriggerMarkup.apply(this,arguments),f='';return e+f},playStop:function(e){var d=this,f=e.iconCls==="icon-play";if(f){d.audio.play()}else{if(d.audio&&!d.audio.paused&&d.audio.currentTime){d.audio.pause();d.audio.currentTime=0}}e.setIconCls(f?"icon-stop":"icon-play")},initTipInfo:function(){var b=this;if(!b.htmlTipInfo){return}b.tipInfoFile=Ext.create("Ext.tip.ToolTip",{html:b.htmlTipInfo,anchor:"top",title:b.titleTipInfo,target:b.button.el})},onFileChange:function(e,f,g){var j=this;j.getInfoFile(f);Ext.form.field.File.prototype.onFileChange.apply(this,arguments)},getInfoFile:function(g){var l=this,f=g.target.files[0],j=f.name.split("."),m=j[j.length-1].toLowerCase();if(l.extAllowed.indexOf(m)===-1){Ext.ux.Alert.alert(l.titleWarning,l.msgInvalidFile,"warning");l.reset();return}if(f.size>l.maxSize){Ext.ux.Alert.alert(l.titleWarning,l.msgInvalidSize+Ext.util.Format.fileSize(l.maxSize),"warning");l.reset();return}}},0,["uploadfield"],["component","box","field","textfield","filefield","fileuploadfield","uploadfield"],{component:true,box:true,field:true,textfield:true,filefield:true,fileuploadfield:true,uploadfield:true},["widget.uploadfield"],0,[Ext.ux.form.field,"FileUpload"],0));(Ext.cmd.derive("Ext.ux.window.ImportCsv",Ext.window.Window,{autoShow:true,modal:true,layout:"fit",iconCls:"icon-import-csv",title:t("importFromCsv"),width:400,height:window.isThemeTriton?220:175,labelWidthFields:75,htmlTipInfo:"",fieldsImport:[],listeners:{close:function(){this.list.setLoading(false)}},initComponent:function(){var d=this,c=Ext.Array.merge(d.fieldsImport,[{xtype:"uploadfield",fieldLabel:t("fileCsv"),htmlTipInfo:d.htmlTipInfo}]);d.items=[{xtype:"form",bodyPadding:5,labelWidthFields:d.labelWidthFields,items:c}];d.title=d.title+(d.titleModule?" - "+d.titleModule:"");d.bbar=[{xtype:"tbtext",text:t("maxSizeFile")+"3 MB"},"->",{iconCls:"icon-import-csv",text:t("importText"),scope:d,handler:d.onImport}];Ext.window.Window.prototype.initComponent.apply(this,arguments)},onImport:function(d){var f=this,e=f.list.store;d.disable();f.list.setLoading(true);f.down("form").submit({url:e.getProxy().api.fromCsv,scope:f,success:function(c,b){var a=Ext.decode(b.response.responseText);if(a.success){Ext.ux.Alert.alert(t("Success"),a.msg,"success")}else{Ext.ux.Alert.alert(t("Error"),a.errors,"error")}d.enable();f.list.setLoading(false);e.load();f.close()},failure:function(c,b){if(Ext.isObject(b.response)){var a=Ext.decode(b.response.responseText);Ext.ux.Alert.alert(t("Error"),a.errors,"error")}else{Ext.ux.Alert.alert(t("Error"),b.response.responseText,"error",true,false)}d.enable();f.list.setLoading(false);f.close()}})}},0,0,["component","box","container","panel","window"],{component:true,box:true,container:true,panel:true,window:true},0,0,[Ext.ux.window,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.prefix.ImportCsv",Ext.ux.window.ImportCsv,{htmlTipInfo:"
"+t("dialprefix")+", "+t("destination")+"",labelWidthFields:160,height:window.isThemeTriton?300:205,initComponent:function(){var b=this;b.fieldsImport=[{style:"margin-top:25px",xtype:"fieldset",title:t("Csv Format"),collapsible:true,collapsed:false,defaults:{labelWidth:190,anchor:"100%",layout:{type:"hbox",labelAlign:b.labelAlignFields}},items:[{xtype:"pontovirgulacombo",name:"delimiter",fieldLabel:t("Delimiter"),width:230}]}];Ext.ux.window.ImportCsv.prototype.initComponent.apply(this,arguments)}},0,["prefiximportcsv"],["component","box","container","panel","window","prefiximportcsv"],{component:true,box:true,container:true,panel:true,window:true,prefiximportcsv:true},["widget.prefiximportcsv"],0,[MBilling.view.prefix,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.prefix.List",Ext.ux.grid.Panel,{store:"Prefix",fieldSearch:"prefix",initComponent:function(){var b=this;b.buttonImportCsv=!App.user.isClient,b.buttonUpdateLot=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("prefix"),dataIndex:"prefix",filter:{type:"string"}},{header:t("destination"),dataIndex:"destination"}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["prefixlist"],["component","box","container","panel","tablepanel","gridpanel","grid","prefixlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,prefixlist:true},["widget.prefixlist"],0,[MBilling.view.prefix,"List"],0));(Ext.cmd.derive("MBilling.view.prefix.Form",Ext.ux.form.Panel,{fieldsHideEdit:["prefix"],items:[{name:"prefix",fieldLabel:t("prefix"),maxLength:18},{name:"destination",fieldLabel:t("destination")}]},0,["prefixform"],["component","box","container","panel","form","prefixform"],{component:true,box:true,container:true,panel:true,form:true,prefixform:true},["widget.prefixform"],0,[MBilling.view.prefix,"Form"],0));(Ext.cmd.derive("MBilling.view.sendCreditProducts.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.sendcreditproducts"],0,[MBilling.view.sendCreditProducts,"Controller"],0));(Ext.cmd.derive("MBilling.view.sendCreditProducts.Module",Ext.ux.panel.Module,{controller:"sendcreditproducts"},0,["sendcreditproductsmodule"],["component","box","container","uxpanelmodule","sendcreditproductsmodule"],{component:true,box:true,container:true,uxpanelmodule:true,sendcreditproductsmodule:true},["widget.sendcreditproductsmodule"],0,[MBilling.view.sendCreditProducts,"Module"],0));(Ext.cmd.derive("MBilling.view.sendCreditProducts.ImportCsv",Ext.ux.window.ImportCsv,{fieldsImport:[{fieldLabel:t("table"),hidden:true,allowBlank:true}]},0,["sendcreditproductsimportcsv"],["component","box","container","panel","window","sendcreditproductsimportcsv"],{component:true,box:true,container:true,panel:true,window:true,sendcreditproductsimportcsv:true},["widget.sendcreditproductsimportcsv"],0,[MBilling.view.sendCreditProducts,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.sendCreditProducts.List",Ext.ux.grid.Panel,{store:"SendCreditProducts",fieldSearch:"operator_name",comparisonfilter:"ct",initComponent:function(){var b=this;b.buttonImportCsv=App.user.isAdmin,b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("Country"),dataIndex:"country",flex:4},{header:t("Country Code"),dataIndex:"country_code",flex:2},{header:t("Operator ID"),dataIndex:"operator_id",flex:2},{header:t("SkuCode"),dataIndex:"SkuCode",flex:2},{header:t("Operator Name"),dataIndex:"operator_name",flex:5},{header:t("Currency destination"),dataIndex:"currency_dest",flex:3},{header:t("Product"),dataIndex:"product",flex:2},{header:t("Currency Origem"),dataIndex:"currency_orig",flex:3},{header:t("Send Value"),dataIndex:"send_value",flex:2},{header:t("Wholesale Price"),dataIndex:"wholesale_price",flex:2},{header:t("Provider"),dataIndex:"provider",flex:2},{header:t("status"),dataIndex:"status",renderer:Helper.Util.formatBooleanActive,comboRelated:"booleancombo",flex:2,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")]]}}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["sendcreditproductslist"],["component","box","container","panel","tablepanel","gridpanel","grid","sendcreditproductslist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,sendcreditproductslist:true},["widget.sendcreditproductslist"],0,[MBilling.view.sendCreditProducts,"List"],0));(Ext.cmd.derive("MBilling.view.sendCreditProducts.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{name:"country",fieldLabel:t("country"),readOnly:true},{name:"operator_name",fieldLabel:t("Operator Name"),readOnly:true},{name:"operator_id",fieldLabel:t("Operator Id")},{name:"SkuCode",fieldLabel:t("SkuCode")},{name:"product",fieldLabel:t("Product")},{name:"send_value",fieldLabel:t("Send Value"),xtype:"moneyfield",mask:"#9.999.990,000000",readOnly:!App.user.isAdmin},{name:"wholesale_price",fieldLabel:t("Wholesale Price"),xtype:"moneyfield",mask:"#9.999.990,000000",readOnly:!App.user.isAdmin},{xtype:"combobox",name:"provider",value:"TransferTo",forceSelection:true,editable:false,store:[["TransferTo","TransferTo"],["Ding","Ding"],["TanaSend","TanaSend"]],fieldLabel:t("Provider")},{xtype:"yesnocombo",name:"status",fieldLabel:t("status")},{xtype:"textareafield",name:"info",fieldLabel:t("info"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["sendcreditproductsform"],["component","box","container","panel","form","sendcreditproductsform"],{component:true,box:true,container:true,panel:true,form:true,sendcreditproductsform:true},["widget.sendcreditproductsform"],0,[MBilling.view.sendCreditProducts,"Form"],0));(Ext.cmd.derive("MBilling.view.sendCreditRates.Controller",Ext.ux.app.ViewController,{onResetPrice:function(e){var f=this,d=f.list.getSelectionModel().getSelection()[0];Ext.Ajax.request({url:"index.php/SendCreditRates/resetSellPrice",scope:f,success:function(b){b=Ext.decode(b.responseText);if(b[f.nameSuccessRequest]){Ext.ux.Alert.alert(f.titleSuccess,b[f.nameMsgRequest],"success")}else{var a=Helper.Util.convertErrorsJsonToString(b[f.nameMsgRequest]);Ext.ux.Alert.alert(f.titleSuccess,a,"error")}}});f.store.load()}},0,0,0,0,["controller.sendcreditrates"],0,[MBilling.view.sendCreditRates,"Controller"],0));(Ext.cmd.derive("MBilling.view.sendCreditRates.Module",Ext.ux.panel.Module,{controller:"sendcreditrates"},0,["sendcreditratesmodule"],["component","box","container","uxpanelmodule","sendcreditratesmodule"],{component:true,box:true,container:true,uxpanelmodule:true,sendcreditratesmodule:true},["widget.sendcreditratesmodule"],0,[MBilling.view.sendCreditRates,"Module"],0));(Ext.cmd.derive("MBilling.view.sendCreditRates.List",Ext.ux.grid.Panel,{store:"SendCreditRates",fieldSearch:"idProduct.operator_name",comparisonfilter:"ct",initComponent:function(){var b=this;b.buttonUpdateLotCallShopRate=true;b.buttonCsv=false;b.allowPrint=false;b.extraButtons=[{text:t("Reset")+" "+t("Sell price"),iconCls:"icon-chart-column",width:130,handler:"onResetPrice",disabled:false}];b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{xtype:"templatecolumn",tpl:"{idProductoperator_name}",header:t("Operator Name"),dataIndex:"idProductoperator_name",filter:{type:"string",field:"idProduct.operator_name"},flex:5},{xtype:"templatecolumn",tpl:"{idProductcountry}",header:t("Country"),dataIndex:"idProductcountry",filter:{type:"string",field:"idProduct.country"},flex:4},{xtype:"templatecolumn",tpl:"{idProductcurrency_dest}",header:t("Currency destination"),dataIndex:"idProductcurrency_dest",filter:{type:"string",field:"idProduct.currency_dest"},flex:3},{xtype:"templatecolumn",tpl:"{idProductproduct}",header:t("Product"),dataIndex:"idProductproduct",filter:{type:"string",field:"idProduct.product"},flex:2},{xtype:"templatecolumn",tpl:"{idProductcurrency_orig}",header:t("Currency Origin"),dataIndex:"idProductcurrency_orig",filter:{type:"string",field:"idProduct.currency_orig"},flex:3},{xtype:"templatecolumn",tpl:"{idProductwholesale_price}",header:t("Wholesale Price"),dataIndex:"idProductwholesale_price",filter:{type:"string",field:"idProduct.wholesale_price"},flex:2},{header:t("Sell Price"),dataIndex:"sell_price",flex:2}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["sendcreditrateslist"],["component","box","container","panel","tablepanel","gridpanel","grid","sendcreditrateslist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,sendcreditrateslist:true},["widget.sendcreditrateslist"],0,[MBilling.view.sendCreditRates,"List"],0));(Ext.cmd.derive("MBilling.view.sendCreditRates.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["idProductcountry","idProductoperator_name"],initComponent:function(){var b=this;b.items=[{name:"idProductcountry",fieldLabel:t("country"),readOnly:true},{name:"idProductoperator_name",fieldLabel:t("Operator Name"),readOnly:true},{name:"sell_price",fieldLabel:t("Sell Price"),xtype:"moneyfield",mask:"#9.999.990,00",readOnly:App.user.isAdmin}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["sendcreditratesform"],["component","box","container","panel","form","sendcreditratesform"],{component:true,box:true,container:true,panel:true,form:true,sendcreditratesform:true},["widget.sendcreditratesform"],0,[MBilling.view.sendCreditRates,"Form"],0));(Ext.cmd.derive("MBilling.view.prefix.Lookup",Ext.ux.form.field.Lookup,{name:"id_prefix",fieldLabel:t("Destination"),displayField:"idPrefixdestination",displayFieldList:"destination",gridConfig:{xtype:"prefixlist",fieldSearch:"destination",columns:[{header:t("prefix"),dataIndex:"prefix",flex:2},{header:t("destination"),dataIndex:"destination",flex:2}]}},0,["prefixlookup"],["component","box","container","fieldcontainer","prefixlookup"],{component:true,box:true,container:true,fieldcontainer:true,prefixlookup:true},["widget.prefixlookup"],0,[MBilling.view.prefix,"Lookup"],0));(Ext.cmd.derive("MBilling.view.sipTrace.Controller",Ext.ux.app.ViewController,{onNewFilter:function(d){var f=this,e=f.getView();Ext.widget("siptracefilter",{title:"SipTrace",list:f.list})},onDeleteLog:function(d){var c=this;Ext.Msg.confirm(c.titleConfirmation,t("Confirm delete all log file?"),function(a){if(a==="yes"){Ext.Ajax.request({url:"index.php/sipTrace/destroy",scope:c,success:function(b){Ext.ux.Alert.alert(c.titleSuccess,t("Success: The Sip Trace file was deleted"),"success");c.store.load()}})}})},onClearAll:function(d){var c=this;Ext.Ajax.request({url:"index.php/sipTrace/clearAll",scope:c,success:function(a){Ext.ux.Alert.alert(c.titleSuccess,t("Success"),"success");c.store.load()}})},onExportPcap:function(d){var c=this;window.open("index.php/sipTrace/export")},onDetails:function(d){var f=this,e=f.list.getSelectionModel().getSelection()[0];window.open("index.php/sipTrace/details?callid="+e.get("callid"))}},0,0,0,0,["controller.siptrace"],0,[MBilling.view.sipTrace,"Controller"],0));(Ext.cmd.derive("MBilling.view.sipTrace.Module",Ext.ux.panel.Module,{controller:"siptrace"},0,["siptracemodule"],["component","box","container","uxpanelmodule","siptracemodule"],{component:true,box:true,container:true,uxpanelmodule:true,siptracemodule:true},["widget.siptracemodule"],0,[MBilling.view.sipTrace,"Module"],0));(Ext.cmd.derive("MBilling.view.sipTrace.Filter",Ext.window.Window,{autoShow:true,modal:true,layout:"fit",iconCls:"icon-import-csv",title:t("SipTrace filter"),width:400,height:window.isThemeTriton?220:180,labelWidthFields:120,htmlTipInfo:"",fieldsImport:[],initComponent:function(){var b=this;b.items=[{xtype:"form",bodyPadding:5,defaults:{anchor:"0",enableKeyEvents:true,labelWidth:b.labelWidthFields,msgTarget:"side",plugins:"markallowblank",allowBlank:false},items:[{xtype:"numberfield",value:60,min:5,max:300,name:"timeout",fieldLabel:t("Filter timeout")},{xtype:"numberfield",name:"port",fieldLabel:t("Port"),allowBlank:false,value:5060},{xtype:"textfield",name:"filter",fieldLabel:t("Filter"),allowBlank:false,emptyText:"IP, sip account or number ...."}]}];b.title=b.title+(b.titleModule?" - "+b.titleModule:"");b.bbar=[{width:150,iconCls:"icon-play",text:t("Start"),scope:b,handler:b.onStart}];Ext.window.Window.prototype.initComponent.apply(this,arguments)},onStart:function(d){var f=this,e=f.list.store;if(!f.down("form").isValid()){return}f.list.setLoading(true);Ext.Ajax.setTimeout(1000000);f.down("form").submit({url:"index.php/sipTrace/start",scope:f,success:function(c,b){var a=Ext.decode(b.response.responseText);console.log(a);if(a.success){Ext.ux.Alert.alert(t("Success"),a.msg,"success")}else{Ext.ux.Alert.alert(t("Error"),a.errors,"error")}d.enable();f.list.setLoading(false);e.load();f.close()},failure:function(c,b){console.log(b.response.responseText);if(b.response&&Ext.isObject(b.response.responseText)){var a=Ext.decode(b.response.responseText);Ext.ux.Alert.alert(t("Error"),a.errors,"error",true,30)}else{Ext.ux.Alert.alert(t("Error"),Ext.decode(b.response.responseText).msg,"error",true,30)}d.enable();f.list.setLoading(false);e.load();f.close()}})}},0,["siptracefilter"],["component","box","container","panel","window","siptracefilter"],{component:true,box:true,container:true,panel:true,window:true,siptracefilter:true},["widget.siptracefilter"],0,[MBilling.view.sipTrace,"Filter"],0));(Ext.cmd.derive("MBilling.view.sipTrace.List",Ext.ux.grid.Panel,{store:"SipTrace",initComponent:function(){var b=this;b.buttonImportCsv=false;b.buttonCsv=false;b.allowPrint=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.collapsedExtraFilters=false;b.allowDelete=false;b.extraButtons=[{text:b.textDelete,glyph:b.glyphDelete,handler:"onDeleteLog",width:120},{text:t("Start Capture"),iconCls:"icon-save-all",handler:"onNewFilter",width:120},{text:t("Stop Capture"),iconCls:"icon-clean-filter",handler:"onClearAll",width:120},{text:t("Export File"),iconCls:"icon-save-all",handler:"onExportPcap",width:150},{text:t("Details"),glyph:icons.info,handler:"onDetails",width:150}];b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,menuDisabled:true,hideable:App.user.isAdmin},{header:t("method"),dataIndex:"method",flex:3},{header:t("callid"),dataIndex:"callid",flex:7},{header:t("SIP To "),dataIndex:"sipto",flex:5},{header:t("Source"),dataIndex:"fromip",renderer:function(a){a=a==window.myIP?''+a+"":a;return a},flex:3},{header:t("Destination"),dataIndex:"toip",renderer:function(a){a=a==window.myIP?''+a+"":a;return a},flex:4},{header:t("head"),dataIndex:"head",flex:3,menuDisabled:true,hidden:true,hideable:true}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["siptracelist"],["component","box","container","panel","tablepanel","gridpanel","grid","siptracelist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,siptracelist:true},["widget.siptracelist"],0,[MBilling.view.sipTrace,"List"],0));(Ext.cmd.derive("MBilling.view.sipTrace.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.allowCreate=false;height=Ext.Element.getViewportHeight()-200;b.items=[{xtype:"textareafield",name:"head",height:height,anchor:"100%",allowBlank:true,readOnly:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["siptraceform"],["component","box","container","panel","form","siptraceform"],{component:true,box:true,container:true,panel:true,form:true,siptraceform:true},["widget.siptraceform"],0,[MBilling.view.sipTrace,"Form"],0));(Ext.cmd.derive("MBilling.view.sip.Controller",Ext.ux.app.ViewController,{init:function(){var b=this;b.control({typesipforwardcombo:{select:b.onSelectMethod}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectMethod:function(c,d){this.showFieldsRelated(d.getData().showFields)},showFieldsRelated:function(l){var m=this,n=m.formPanel.getForm(),j=m.formPanel.getForm().getFields(),g=Ext.get(Ext.Element.getActiveElement()).component,o=g.name.substr(-2);m.onSetVisibleFiel(g,n,o,g.value)},onSetVisibleFiel:function(f,j,e,g){if(f.value=="undefined"){f.setValue("undefined")}j.findField("id_queue").setValue("");j.findField("id_sip").setValue("");j.findField("id_ivr").setValue("");j.findField("extension").setValue("");j.findField("id_queue").setVisible(g.match("^queue"));j.findField("id_sip").setVisible(g.match("^sip"));j.findField("id_ivr").setVisible(g.match("^ivr"));j.findField("extension").setVisible(g.match("^group|^number|^custom"))},onGetDiskSpaceService:function(b){filterGroupp=Ext.encode([{type:"numeric",comparison:"eq",value:App.user.id,field:"id_user"},{type:"numeric",comparison:"eq",value:1,field:"status"}]),Ext.Ajax.request({url:"index.php/servicesUse/read?filter="+filterGroupp,success:function(a){a=Ext.decode(a.responseText);b(a.rows)}})},onEdit:function(){var j=this,l=j.formPanel.getForm(),f=j.list.getSelectionModel().getSelection()[0],g=j.formPanel.idRecord?f.get("allow").split(","):["g729","gsm","alaw","ulaw"],m=j.formPanel.down("checkboxgroup");if(App.user.isClient){l.findField("record_call").setVisible(false);j.onGetDiskSpaceService(function(a){Ext.each(a,function(b){if(b.idServicestype=="disk_space"){j.formPanel.getForm().findField("record_call").setVisible(true)}})})}fieldValue=f.getData()["type_forward"];l.findField("type_forward").setVisible(true);if(fieldValue=="ivr"){l.findField("id_ivr").setVisible(true);l.findField("id_sip").setVisible(false);l.findField("id_queue").setVisible(false);l.findField("extension").setVisible(false)}else{if(fieldValue=="sip"){l.findField("id_sip").setVisible(true);l.findField("id_ivr").setVisible(false);l.findField("id_queue").setVisible(false);l.findField("extension").setVisible(false)}else{if(fieldValue=="queue"){l.findField("id_queue").setVisible(true);l.findField("id_sip").setVisible(false);l.findField("id_ivr").setVisible(false);l.findField("extension").setVisible(false)}else{if(fieldValue.match("custom|number|group")){l.findField("extension").setVisible(true);l.findField("id_ivr").setVisible(false);l.findField("id_sip").setVisible(false);l.findField("id_queue").setVisible(false)}else{l.findField("id_queue").setVisible(false);l.findField("id_sip").setVisible(false);l.findField("id_ivr").setVisible(false);l.findField("extension").setVisible(false)}}}}Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments);m.setValue({allow:g})},onNew:function(){var f=this,d=f.formPanel.getForm(),e=f.list.getSelectionModel().getSelection()[0];if(App.user.isClient){f.formPanel.getForm().findField("defaultuser").setReadOnly(false)}d.findField("id_ivr").setVisible(false);d.findField("id_sip").setVisible(false);d.findField("id_queue").setVisible(false);d.findField("id_ivr").setVisible(false);d.findField("id_queue").setVisible(false);d.findField("type_forward").setVisible(true);Ext.ux.app.ViewController.prototype.onNew.apply(this,arguments)}},0,0,0,0,["controller.sip"],0,[MBilling.view.sip,"Controller"],0));(Ext.cmd.derive("MBilling.view.sip.Module",Ext.ux.panel.Module,{controller:"sip"},0,["sipmodule"],["component","box","container","uxpanelmodule","sipmodule"],{component:true,box:true,container:true,uxpanelmodule:true,sipmodule:true},["widget.sipmodule"],0,[MBilling.view.sip,"Module"],0));(Ext.cmd.derive("MBilling.view.sip.List",Ext.ux.grid.Panel,{store:"Sip",fieldSearch:"idUser.username",initComponent:function(){var b=this;b.columns=b.columns||[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("Status"),dataIndex:"lineStatus",width:3,menuDisabled:true,renderer:Helper.Util.formatStatusImage},{header:t("accountcode"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4},{header:t("username"),dataIndex:"name",flex:4},{header:t("host"),dataIndex:"host",flex:4},{header:t("codec"),dataIndex:"allow",flex:5},{header:"group",dataIndex:"group",flex:3},{header:t("context"),dataIndex:"context",hidden:true,hideable:!App.user.isClient,flex:1},{header:t("record_call"),dataIndex:"record_call",renderer:Helper.Util.formattyyesno,filter:{type:"list",options:[[0,t("no")],[1,t("yes")]]},flex:2,hidden:true,hideable:!App.user.isClient},{header:t("callerid"),dataIndex:"callerid",hidden:true,hideable:!App.user.isClient,flex:1},{header:"nat",dataIndex:"nat",hidden:true,hideable:!App.user.isClient,flex:1},{header:"directmedia",dataIndex:"directmedia",hidden:true,hideable:!App.user.isClient,flex:1},{header:"qualify",dataIndex:"qualify",hidden:true,hideable:!App.user.isClient,flex:1},{header:"dtmfmode",dataIndex:"dtmfmode",hidden:true,hideable:!App.user.isClient,flex:1},{header:"insecure",dataIndex:"insecure",hidden:true,hideable:!App.user.isClient,flex:1},{header:"type",dataIndex:"type",hidden:true,hideable:!App.user.isClient,flex:1},{header:"allowtransfer",dataIndex:"allowtransfer",hidden:true,hideable:!App.user.isClient,flex:1},{header:"calllimit",dataIndex:"calllimit",hidden:true,hideable:!App.user.isClient,flex:1}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["siplist"],["component","box","container","panel","tablepanel","gridpanel","grid","siplist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,siplist:true},["widget.siplist"],0,[MBilling.view.sip,"List"],0));(Ext.cmd.derive("MBilling.view.sip.Form",Ext.ux.form.Panel,{bodyPadding:0,fieldsHideUpdateLot:["id_user","defaultuser","secret"],initComponent:function(){var b=this;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{labelAlign:"right",plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true}},items:[{title:t("general"),items:[{xtype:"userlookup",ownerForm:b,fieldLabel:t("accountcode"),hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"defaultuser",fieldLabel:t("username"),minLength:4,allowBlank:true,readOnly:App.user.isClient},{name:"secret",fieldLabel:t("password"),allowBlank:true,minLength:6},{name:"callerid",fieldLabel:t("callerid"),allowBlank:true},{name:"alias",fieldLabel:t("Alias"),allowBlank:true,minLength:3},{name:"disallow",fieldLabel:"disallow",value:"all",hidden:!App.user.isAdmin,allowBlank:App.user.isClient},{xtype:"checkboxgroup",columns:3,fieldLabel:t("codec"),items:[{boxLabel:"g729",name:"allow",inputValue:"g729",checked:true},{boxLabel:"g723",name:"allow",inputValue:"g723"},{boxLabel:"gsm",name:"allow",inputValue:"gsm",checked:true},{boxLabel:"g726",name:"allow",inputValue:"g726"},{boxLabel:"opus",name:"allow",inputValue:"opus",checked:true},{boxLabel:"alaw",name:"allow",inputValue:"alaw",checked:true},{boxLabel:"ulaw",name:"allow",inputValue:"ulaw",checked:true},{boxLabel:"g722",name:"allow",inputValue:"g722"},{boxLabel:"ilbc",name:"allow",inputValue:"ilbc"},{boxLabel:"speex",name:"allow",inputValue:"speex"},{boxLabel:"h263p",name:"allow",inputValue:"h263p"},{boxLabel:"h263",name:"allow",inputValue:"h263"},{boxLabel:"h264",name:"allow",inputValue:"h264"},{boxLabel:"vp8",name:"allow",inputValue:"vp8"}],hidden:!App.user.isAdmin,allowBlank:App.user.isClient},{name:"host",fieldLabel:t("host"),value:"dynamic",hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"group",fieldLabel:t("group"),allowBlank:true},{xtype:"yesnostringcombo",name:"videosupport",fieldLabel:"videosupport",value:"no",allowBlank:!App.user.isAdmin},{name:"block_call_reg",fieldLabel:t("Block Call REGEX"),allowBlank:true,hidden:!window.doac},{xtype:"noyescombo",name:"record_call",fieldLabel:t("record_call"),allowBlank:true,hidden:!App.user.isAdmin},{xtype:"numberfield",name:"techprefix",fieldLabel:t("TechPrefix"),hidden:!window.usertech||!App.user.isAdmin,allowBlank:true,maxLength:6}]},{title:t("Nat"),hidden:!App.user.isAdmin,items:[{name:"nat",fieldLabel:"nat",value:"force_rport,comedia",allowBlank:!App.user.isAdmin},{name:"directmedia",fieldLabel:"directmedia",value:"no",allowBlank:!App.user.isAdmin},{xtype:"yesnostringcombo",name:"qualify",fieldLabel:"qualify",value:"no",allowBlank:!App.user.isAdmin}]},{title:t("Additional"),hidden:!App.user.isAdmin,defaults:{labelAlign:"right",plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true,labelWidth:142},items:[{name:"context",fieldLabel:t("context"),value:"billing",hidden:!App.user.isAdmin,allowBlank:true},{name:"dtmfmode",fieldLabel:"dtmfmode",value:"RFC2833",allowBlank:!App.user.isAdmin},{name:"insecure",fieldLabel:"insecure",value:"no",allowBlank:true},{name:"deny",fieldLabel:"deny",allowBlank:true,hidden:!App.user.isAdmin},{name:"permit",fieldLabel:"permit",allowBlank:true,hidden:!App.user.isAdmin},{name:"type",fieldLabel:"type",value:"friend",allowBlank:!App.user.isAdmin},{xtype:"noyesstringcombo",name:"allowtransfer",fieldLabel:"allowtransfer",value:"no",allowBlank:!App.user.isAdmin},{xtype:"noyescombo",name:"ringfalse",fieldLabel:t("Ring false"),value:"0",allowBlank:!App.user.isAdmin},{name:"calllimit",xtype:"numberfield",fieldLabel:t("calllimit"),value:"0",allowBlank:!App.user.isAdmin},{xtype:"noyescombo",name:"voicemail",fieldLabel:t("Enable")+" "+t("VoiceMail"),value:"0",allowBlank:App.user.isClient},{name:"mohsuggest",fieldLabel:t("MOH"),allowBlank:true,hidden:!App.user.isAdmin},{name:"url_events",fieldLabel:t("Url Events notify"),hidden:!App.user.isAdmin||!window.events===true,allowBlank:true}]},{title:t("Forward"),itemId:"option",bodyPadding:10,defaults:{xtype:"fieldcontainer",layout:"hbox",plugins:"markallowblank",allowBlank:true,anchor:"100%",labelWidth:60,defaults:{hideLabel:true,hidden:true,flex:5,startX:100,allowBlank:true,ownerForm:b}},items:[{fieldLabel:t("Forward"),items:[{name:"type_forward",xtype:"typesipforwardcombo",flex:2},{xtype:"ivrlookup",name:"id_ivr",displayField:"id_ivr_name"},{xtype:"queuelookup",name:"id_queue",displayField:"id_queue_name"},{xtype:"sip2lookup",name:"id_sip",displayField:"id_sip_name"},{xtype:"textfield",name:"extension"}]},{name:"dial_timeout",xtype:"numberfield",fieldLabel:t("Dial timeout"),value:"60",labelWidth:90}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["sipform"],["component","box","container","panel","form","sipform"],{component:true,box:true,container:true,panel:true,form:true,sipform:true},["widget.sipform"],0,[MBilling.view.sip,"Form"],0));(Ext.cmd.derive("MBilling.view.sip.Lookup",Ext.ux.form.field.Lookup,{name:"id_sip",fieldLabel:t("Sip"),displayField:"idSipname",displayFieldList:"name",gridConfig:{xtype:"siplist",fieldSearch:"name",columns:[{header:t("Account"),dataIndex:"idUserusername",flex:2},{header:t("name"),dataIndex:"name",flex:2}]}},0,["siplookup"],["component","box","container","fieldcontainer","siplookup"],{component:true,box:true,container:true,fieldcontainer:true,siplookup:true},["widget.siplookup"],0,[MBilling.view.sip,"Lookup"],0));(Ext.cmd.derive("MBilling.view.sip2.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.sip2"],0,[MBilling.view.sip2,"Controller"],0));(Ext.cmd.derive("MBilling.view.sip2.Module",Ext.ux.panel.Module,{controller:"sip2"},0,["sip2module"],["component","box","container","uxpanelmodule","sip2module"],{component:true,box:true,container:true,uxpanelmodule:true,sip2module:true},["widget.sip2module"],0,[MBilling.view.sip2,"Module"],0));(Ext.cmd.derive("MBilling.view.sip2.List",Ext.ux.grid.Panel,{store:"Sip2",fieldSearch:"name",initComponent:function(){var b=this;b.columns=b.columns||[{header:t("accountcode"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4},{header:t("username"),dataIndex:"name",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["sip2list"],["component","box","container","panel","tablepanel","gridpanel","grid","sip2list"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,sip2list:true},["widget.sip2list"],0,[MBilling.view.sip2,"List"],0));(Ext.cmd.derive("MBilling.view.sip2.Form",Ext.ux.form.Panel,{bodyPadding:0},0,["sip2form"],["component","box","container","panel","form","sip2form"],{component:true,box:true,container:true,panel:true,form:true,sip2form:true},["widget.sip2form"],0,[MBilling.view.sip2,"Form"],0));(Ext.cmd.derive("MBilling.view.sip2.Lookup",Ext.ux.form.field.Lookup,{name:"id_sip",fieldLabel:t("Sip"),displayField:"id_sip_name",displayFieldList:"name",gridConfig:{xtype:"sip2list",fieldSearch:"name",columns:[{header:t("Account"),dataIndex:"idUserusername",flex:2},{header:t("name"),dataIndex:"name",flex:2}]}},0,["sip2lookup"],["component","box","container","fieldcontainer","sip2lookup"],{component:true,box:true,container:true,fieldcontainer:true,sip2lookup:true},["widget.sip2lookup"],0,[MBilling.view.sip2,"Lookup"],0));(Ext.cmd.derive("MBilling.view.sipuras.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.sipuras"],0,[MBilling.view.sipuras,"Controller"],0));(Ext.cmd.derive("MBilling.view.sipuras.Module",Ext.ux.panel.Module,{controller:"sipuras"},0,["sipurasmodule"],["component","box","container","uxpanelmodule","sipurasmodule"],{component:true,box:true,container:true,uxpanelmodule:true,sipurasmodule:true},["widget.sipurasmodule"],0,[MBilling.view.sipuras,"Module"],0));(Ext.cmd.derive("MBilling.view.sipuras.List",Ext.ux.grid.Panel,{store:"Sipuras",initComponent:function(){var b=this;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"}},{header:"Serial",dataIndex:"nserie"},{header:"Mac",dataIndex:"macadr"},{header:t("username")+" 1",dataIndex:"User_ID_1"},{header:t("username")+" 2",dataIndex:"User_ID_2"},{header:t("last_ip"),dataIndex:"last_ip"},{header:t("obs"),dataIndex:"obs"},{header:t("last")+" "+t("register"),dataIndex:"fultmov",renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s")}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["sipuraslist"],["component","box","container","panel","tablepanel","gridpanel","grid","sipuraslist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,sipuraslist:true},["widget.sipuraslist"],0,[MBilling.view.sipuras,"List"],0));(Ext.cmd.derive("MBilling.view.sipuras.Form",Ext.ux.form.Panel,{bodyPadding:0,fieldsHideUpdateLot:["id_user","nserie","macadr"],initComponent:function(){var b=this;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true,labelAlign:"right"}},items:[{title:t("general"),items:[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"nserie",fieldLabel:"Serial"},{name:"macadr",fieldLabel:"Mac"},{name:"senha_user",fieldLabel:t("password")+" "+t("username"),allowBlank:true},{name:"senha_admin",fieldLabel:t("password")+" "+t("admin"),allowBlank:true},{name:"antireset",fieldLabel:t("antireset"),xtype:"noyescombo"},{name:"Enable_Web_Server",fieldLabel:t("Enable_Web_Server"),xtype:"yesnocombo"},{name:"marca",fieldLabel:"marca",value:"*",hidden:true},{name:"altera",fieldLabel:"altera",value:"si",hidden:true}]},{title:t("line")+" 1",items:[{name:"User_ID_1",fieldLabel:t("username"),allowBlank:true},{name:"Password_1",fieldLabel:t("password"),allowBlank:true},{name:"Use_Pref_Codec_Only_1",fieldLabel:t("Use_Pref_Codec"),xtype:"noyescombo"},{name:"Preferred_Codec_1",fieldLabel:t("codec"),allowBlank:true,value:"G729a"},{name:"Register_Expires_1",fieldLabel:"Register Expires",allowBlank:true,value:"360"},{name:"Dial_Plan_1",fieldLabel:"Dial Plan",allowBlank:true,value:"(*xx|[3469]11|0|00|[2-9]xxxxxx|1xxx[2-9]xxxxxxS0|xxxxxxxxxxxx.)"},{name:"NAT_Mapping_Enable_1_",fieldLabel:"NAT Mapping",allowBlank:true,xtype:"noyescombo"},{name:"NAT_Keep_Alive_Enable_1_",fieldLabel:"NAT Keep Alive",allowBlank:true,xtype:"noyescombo"}]},{title:t("line")+" 2",items:[{name:"User_ID_2",fieldLabel:t("username"),allowBlank:true},{name:"Password_2",fieldLabel:t("password"),allowBlank:true},{name:"Use_Pref_Codec_Only_2",fieldLabel:t("Use_Pref_Codec"),xtype:"noyescombo"},{name:"Preferred_Codec_2",fieldLabel:t("codec"),allowBlank:true,value:"G729a"},{name:"Register_Expires_2",fieldLabel:"Register Expires",allowBlank:true,value:"360"},{name:"Dial_Plan_2",fieldLabel:"Dial Plan",allowBlank:true,value:"(*xx|[3469]11|0|00|[2-9]xxxxxx|1xxx[2-9]xxxxxxS0|xxxxxxxxxxxx.)"},{name:"NAT_Mapping_Enable_2_",fieldLabel:"NAT Mapping",allowBlank:true,xtype:"noyescombo"},{name:"NAT_Keep_Alive_Enable_2_",fieldLabel:"NAT Keep Alive",allowBlank:true,xtype:"noyescombo"}]},{title:"Stun",items:[{name:"STUN_Enable",fieldLabel:t("active")+"Stun",allowBlank:true,xtype:"noyescombo"},{name:"STUN_Test_Enable",fieldLabel:"STUN Test",allowBlank:true,xtype:"noyescombo"},{name:"Substitute_VIA_Addr",fieldLabel:"Substitute VIA Addr",allowBlank:true,xtype:"noyescombo"},{name:"STUN_Server",fieldLabel:"STUN Server",allowBlank:true}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["sipurasform"],["component","box","container","panel","form","sipurasform"],{component:true,box:true,container:true,panel:true,form:true,sipurasform:true},["widget.sipurasform"],0,[MBilling.view.sipuras,"Form"],0));(Ext.cmd.derive("MBilling.view.iax.Controller",Ext.ux.app.ViewController,{onEdit:function(){Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments);var g=this,e=g.list.getSelectionModel().getSelection()[0],f=g.formPanel.idRecord?e.get("allow").split(","):["g729","gsm","alaw","ulaw"],j=g.formPanel.down("checkboxgroup");j.setValue({allow:f})}},0,0,0,0,["controller.iax"],0,[MBilling.view.iax,"Controller"],0));(Ext.cmd.derive("MBilling.view.iax.Module",Ext.ux.panel.Module,{controller:"iax"},0,["iaxmodule"],["component","box","container","uxpanelmodule","iaxmodule"],{component:true,box:true,container:true,uxpanelmodule:true,iaxmodule:true},["widget.iaxmodule"],0,[MBilling.view.iax,"Module"],0));(Ext.cmd.derive("MBilling.view.iax.List",Ext.ux.grid.Panel,{store:"Iax",fieldSearch:"username",initComponent:function(){var b=this;b.columns=b.columns||[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("username"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:3},{header:t("ramal"),dataIndex:"name",flex:3},{header:t("password"),dataIndex:"secret",flex:2},{header:t("host"),dataIndex:"host",flex:3},{header:"IP",dataIndex:"ipaddr",flex:5},{header:t("context"),dataIndex:"context",hidden:true,hideable:!App.user.isClient,flex:1},{header:t("callerid"),dataIndex:"callerid",hidden:true,hideable:!App.user.isClient,flex:1},{header:t("codec"),dataIndex:"allow",hidden:true,hideable:!App.user.isClient,flex:1},{header:"nat",dataIndex:"nat",hidden:true,hideable:!App.user.isClient,flex:1},{header:"qualify",dataIndex:"qualify",hidden:true,hideable:!App.user.isClient,flex:1},{header:"dtmfmode",dataIndex:"dtmfmode",hidden:true,hideable:!App.user.isClient,flex:1},{header:"insecure",dataIndex:"insecure",hidden:true,hideable:!App.user.isClient,flex:1},{header:"type",dataIndex:"type",hidden:true,hideable:!App.user.isClient,flex:1}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["iaxlist"],["component","box","container","panel","tablepanel","gridpanel","grid","iaxlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,iaxlist:true},["widget.iaxlist"],0,[MBilling.view.iax,"List"],0));(Ext.cmd.derive("MBilling.view.iax.Form",Ext.ux.form.Panel,{bodyPadding:0,fieldsHideUpdateLot:["id_user","defaultuser","secret"],initComponent:function(){var b=this;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true,labelAlign:"right"}},items:[{title:t("general"),items:[{xtype:"userlookup",ownerForm:b,fieldLabel:t("accountcode"),hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"username",fieldLabel:t("username"),minLength:4,readOnly:App.user.isClient},{name:"secret",fieldLabel:t("password"),allowBlank:true,minLength:6,readOnly:App.user.isClient},{name:"callerid",fieldLabel:t("callerid"),allowBlank:true},{name:"disallow",fieldLabel:"disallow",value:"all",hidden:!App.user.isAdmin,allowBlank:App.user.isClient},{xtype:"checkboxgroup",columns:3,fieldLabel:t("codec"),items:[{boxLabel:"g729",name:"allow",inputValue:"g729",checked:true},{boxLabel:"g723",name:"allow",inputValue:"g723"},{boxLabel:"gsm",name:"allow",inputValue:"gsm",checked:true},{boxLabel:"g726",name:"allow",inputValue:"g726"},{boxLabel:"alaw",name:"allow",inputValue:"alaw",checked:true},{boxLabel:"ulaw",name:"allow",inputValue:"ulaw",checked:true},{boxLabel:"g722",name:"allow",inputValue:"g722"},{boxLabel:"ilbc",name:"allow",inputValue:"ilbc"},{boxLabel:"speex",name:"allow",inputValue:"speex"},{boxLabel:"h261",name:"allow",inputValue:"h261"},{boxLabel:"h263",name:"allow",inputValue:"h263"}],hidden:!App.user.isAdmin,allowBlank:App.user.isClient},{name:"host",fieldLabel:t("host"),value:"dynamic",hidden:App.user.isClient,allowBlank:App.user.isClient}]},{title:t("natdetails"),hidden:!App.user.isAdmin,items:[{name:"nat",fieldLabel:"nat",value:App.user.asteriskVersion=="1.8"?"yes":"force_rport,comedia",allowBlank:!App.user.isAdmin}]},{title:t("suplementaryInfo"),hidden:!App.user.isAdmin,items:[{name:"context",fieldLabel:t("context"),value:"billing",hidden:!App.user.isAdmin,allowBlank:true},{xtype:"yesnostringcombo",name:"qualify",fieldLabel:"qualify",value:"no",allowBlank:!App.user.isAdmin},{name:"dtmfmode",fieldLabel:"dtmfmode",value:"RFC2833",allowBlank:!App.user.isAdmin},{name:"insecure",fieldLabel:"insecure",value:"no",allowBlank:true},{name:"type",fieldLabel:"type",value:"friend",allowBlank:!App.user.isAdmin},{name:"calllimit",xtype:"numberfield",fieldLabel:t("calllimit"),value:"0",allowBlank:!App.user.isAdmin}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["iaxform"],["component","box","container","panel","form","iaxform"],{component:true,box:true,container:true,panel:true,form:true,iaxform:true},["widget.iaxform"],0,[MBilling.view.iax,"Form"],0));(Ext.cmd.derive("MBilling.view.iax.Lookup",Ext.ux.form.field.Lookup,{name:"id_iax",fieldLabel:t("Iax"),displayField:"idIaxname",displayFieldList:"name",gridConfig:{xtype:"iaxlist",fieldSearch:"name",columns:[{header:t("Account"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:2},{header:t("name"),dataIndex:"name",flex:2}]}},0,["siaxlookup"],["component","box","container","fieldcontainer","siaxlookup"],{component:true,box:true,container:true,fieldcontainer:true,siaxlookup:true},["widget.siaxlookup"],0,[MBilling.view.iax,"Lookup"],0));(Ext.cmd.derive("MBilling.view.callOnLine.Controller",Ext.ux.app.ViewController,{onEdit:function(){var d=this,e=d.list.getSelectionModel().getSelection()[0],f=e.get("uniqueid");Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments);Ext.Ajax.request({url:"index.php/callOnLine/getChannelDetails",params:{id:e.get("uniqueid"),channel:e.get("canal"),server:e.get("server")},scope:d,success:function(a){a=Ext.decode(a.responseText);if(a[d.nameSuccessRequest]){d.formPanel.getForm().findField("description").setValue(a.description);d.formPanel.getForm().findField("codec").setValue(a.codec);d.formPanel.getForm().findField("reinvite").setValue(a.reinvite);d.formPanel.getForm().findField("from_ip").setValue(a.from_ip);d.formPanel.getForm().findField("ndiscado").setValue(a.ndiscado);d.formPanel.getForm().findField("billsec").setValue(a.billsec);d.formPanel.getForm().findField("callerid").setValue(a.callerid)}else{Ext.ux.Alert.alert(d.titleError,a[d.nameMsgRequest],"error")}}})},onSpyCallFree:function(e){var f=this,d=f.list.getSelectionModel().getSelection()[0];if(f.list.getSelectionModel().getSelection().length==1){Ext.Ajax.request({url:"index.php/callOnLine/spyCall",params:{type:"b",channel:d.get("canal")},scope:f,success:function(a){a=Ext.decode(a.responseText);if(a[f.nameSuccessRequest]){Ext.ux.Alert.alert(f.titleSuccess,a[f.nameMsgRequest],"success")}else{Ext.ux.Alert.alert(f.titleError,a[f.nameMsgRequest],"error")}}})}else{Ext.ux.Alert.alert(f.titleError,"Please Select only a record","notification")}},onDelete:function(e){var f=this,d=f.list.getSelectionModel().getSelection()[0];if(f.list.getSelectionModel().getSelection().length==1){Ext.Ajax.request({url:"index.php/callOnLine/destroy",params:{id:d.get("uniqueid")},scope:f,success:function(a){a=Ext.decode(a.responseText);if(a[f.nameSuccessRequest]){Ext.ux.Alert.alert(f.titleSuccess,a[f.nameMsgRequest],"success")}else{Ext.ux.Alert.alert(f.titleError,a[f.nameMsgRequest],"error")}}})}else{Ext.ux.Alert.alert(f.titleError,"Please Select only a record","notification")}f.store.load()}},0,0,0,0,["controller.callonline"],0,[MBilling.view.callOnLine,"Controller"],0));(Ext.cmd.derive("MBilling.view.callOnLine.Module",Ext.ux.panel.Module,{controller:"callonline"},0,["callonlinemodule"],["component","box","container","uxpanelmodule","callonlinemodule"],{component:true,box:true,container:true,uxpanelmodule:true,callonlinemodule:true},["widget.callonlinemodule"],0,[MBilling.view.callOnLine,"Module"],0));(Ext.cmd.derive("MBilling.view.callOnLine.SpyCall",Ext.window.Window,{modal:true,layout:"fit",iconCls:"call",title:t("Spy call"),width:450,height:window.isThemeNeptune||window.isThemeCrisp?170:window.isThemeTriton?290:170,labelWidthFields:80,channel:0,initComponent:function(){var b=this;if(b.list.getSelectionModel().getSelection().length==1){selected=b.list.getSelectionModel().getSelection()[0];if(selected.get("canal")){b.channel=selected.get("canal")}else{b.channel=selected.get("channel")}b.title=t("Spy call")+" "+selected.get("ndiscado")+" "+b.channel,b.autoShow=true;b.items=[{xtype:"form",bodyPadding:5,defaults:{anchor:"0",enableKeyEvents:true,labelWidth:b.labelWidthFields,msgTarget:"side",plugins:"markallowblank",allowBlank:false},items:[{xtype:"siplookup",name:"id_sip",displayField:t("Sip Account")},{xtype:"combobox",name:"type",value:"b",forceSelection:true,editable:false,store:[["b",t("Only Spy")],["w",t("Whisper, can talk to the spied")],["W",t("Whisper, can talk to the spied but cannot listen the call")]],fieldLabel:t("Spy type")}]}];b.title=b.title+(b.titleModule?" - "+b.titleModule:"");b.bbar=[{width:150,text:t("Send"),scope:b,handler:b.onSendSpy}]}else{Ext.ux.Alert.alert(b.titleError,"Please Select only a record","notification")}Ext.window.Window.prototype.initComponent.apply(this,arguments)},onSendSpy:function(d){var f=this,e=f.list.store;if(!f.down("form").isValid()){Ext.ux.Alert.alert("Alert",t("Select sip account"),"notification");return}f.list.setLoading(true);Ext.Ajax.setTimeout(1000000);f.down("form").submit({url:"index.php/callOnLine/spyCall",params:{id_sip:selected.get("id_sip"),type:selected.get("type"),channel:f.channel},scope:f,success:function(c,b){var a=Ext.decode(b.response.responseText);if(a.success){Ext.ux.Alert.alert(t("Success"),a.msg,"success")}else{Ext.ux.Alert.alert(t("Error"),a.errors,"error")}d.enable();f.list.setLoading(false);e.load();f.close()},failure:function(c,b){console.log(b.response.responseText);if(b.response&&Ext.isObject(b.response.responseText)){var a=Ext.decode(b.response.responseText);Ext.ux.Alert.alert(t("Error1"),a.errors,"error")}else{Ext.ux.Alert.alert(t("Error2"),Ext.decode(b.response.responseText).msg,"error",true,10)}d.enable()}})}},0,["callonlinespycall"],["component","box","container","panel","window","callonlinespycall"],{component:true,box:true,container:true,panel:true,window:true,callonlinespycall:true},["widget.callonlinespycall"],0,[MBilling.view.callOnLine,"SpyCall"],0));(Ext.cmd.derive("MBilling.view.callOnLine.List",Ext.ux.grid.Panel,{store:"CallOnLine",fieldSearch:"idUser.username",refreshTime:15,initComponent:function(){var b=this;b.buttonCsv=false;b.allowPrint=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=!App.user.isClient;b.textDelete=t("Hangup Call"),b.buttonDeleteWidth=140,b.refreshTime=(localStorage&&localStorage.getItem("callonlinerefresh"))||b.refreshTime;b.extraButtons=[{text:t("Spy")+" "+t("call"),iconCls:"call",handler:window.multSpy?"onSpyCall":"onSpyCallFree",width:130,disabled:false},{xtype:"numberfield",field:"jmlhBrg",fieldLabel:t("Refresh Time"),editable:false,minValue:5,labelWidth:90,width:150,selectOnFocus:true,allowDecimals:true,decimalPrecision:2,value:b.refreshTime,listeners:{change:function(a){if(a.value>0){b.refreshTime=a.value;localStorage.setItem("callonlinerefresh",a.value)}}}}];b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("UniqueID"),dataIndex:"uniqueid",hidden:true,hideable:App.user.isAdmin},{header:t("Channel"),dataIndex:"canal",hidden:true,flex:3},{header:t("Sip Account"),dataIndex:"sip_account",flex:3},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:3},{header:t("credit"),dataIndex:"idUsercredit",filter:{type:"int",field:"idUser.credit"},renderer:Helper.Util.formatMoneyDecimal,flex:2},{header:t("number"),dataIndex:"ndiscado",flex:3},{header:t("status"),dataIndex:"status",filter:{type:"string",field:"status"},flex:2},{header:t("duration"),dataIndex:"duration",renderer:Helper.Util.formatsecondsToTime,flex:2},{header:t("trunk"),dataIndex:"tronco",flex:4,hidden:!App.user.isAdmin,hideable:App.user.isAdmin},{header:t("Server"),dataIndex:"server",flex:3,hidden:!window.slave||!App.user.isAdmin,hideable:App.user.isAdmin}];b.sessionLoad=Ext.create("Ext.util.DelayedTask",function(){b.store.load()},b);Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments);b.store.on("load",b.onLoadStore,b)},onLoadStore:function(){var b=this;b.onDeactivateModule();b.onActivateModule()},onRender:function(){var b=this;if(Ext.isObject(b.module)){b.module.on("activate",b.onActivateModule,b);b.module.on("deactivate",b.onDeactivateModule,b);b.module.on("close",b.onCloseModule,b)}Ext.ux.grid.Panel.prototype.onRender.apply(this,arguments)},onActivateModule:function(){this.sessionLoad&&this.sessionLoad.delay(this.refreshTime*1000)},onDeactivateModule:function(){this.sessionLoad&&this.sessionLoad.cancel()},onCloseModule:function(){this.onDeactivateModule();this.sessionLoad=null}},0,["callonlinelist"],["component","box","container","panel","tablepanel","gridpanel","grid","callonlinelist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callonlinelist:true},["widget.callonlinelist"],0,[MBilling.view.callOnLine,"List"],0));(Ext.cmd.derive("MBilling.view.callOnLine.List2",Ext.ux.grid.Panel,{store:"CallOnLine",fieldSearch:"username",refreshTime:10,initComponent:function(){var b=this;b.buttonCsv=false;b.allowPrint=false;b.buttonUpdateLot=false;b.allowCreate=false;b.buttonCleanFilter=false;b.allowUpdate=false;b.allowDelete=false;b.refreshTime=(localStorage&&localStorage.getItem("callonlinerefresh"))||b.refreshTime;b.extraButtons=[{xtype:"numberfield",field:"jmlhBrg",fieldLabel:t("Refresh Time"),editable:false,minValue:5,labelWidth:90,width:150,selectOnFocus:true,allowDecimals:true,decimalPrecision:2,value:b.refreshTime,listeners:{change:function(a){if(a.value>0){b.refreshTime=a.value;localStorage.setItem("callonlinerefresh",a.value)}}}}];b.columns=[{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:2},{header:t("Sip Account"),dataIndex:"canal",flex:3,hidden:true,hideable:true},{header:t("number"),dataIndex:"ndiscado",flex:3},{header:t("status"),dataIndex:"status",filter:{type:"string",field:"status"},flex:2},{header:t("duration"),dataIndex:"duration",renderer:Helper.Util.formatsecondsToTime,flex:2},{header:t("trunk"),dataIndex:"tronco",flex:4,hidden:App.user.isClient,hideable:!App.user.isClient}];b.sessionLoad=Ext.create("Ext.util.DelayedTask",function(){b.store.load()},b);Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments);b.store.on("load",b.onLoadStore,b)},onLoadStore:function(){var b=this;b.onDeactivateModule();b.onActivateModule()},onRender:function(){var b=this;if(Ext.isObject(b.module)){b.module.on("activate",b.onActivateModule,b);b.module.on("deactivate",b.onDeactivateModule,b);b.module.on("close",b.onCloseModule,b)}Ext.ux.grid.Panel.prototype.onRender.apply(this,arguments)},onActivateModule:function(){this.sessionLoad&&this.sessionLoad.delay(this.refreshTime*1000)},onDeactivateModule:function(){this.sessionLoad&&this.sessionLoad.cancel()},onCloseModule:function(){this.onDeactivateModule();this.sessionLoad=null}},0,["callonlinelist2"],["component","box","container","panel","tablepanel","gridpanel","grid","callonlinelist2"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callonlinelist2:true},["widget.callonlinelist2"],0,[MBilling.view.callOnLine,"List2"],0));(Ext.cmd.derive("MBilling.view.callOnLine.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{fieldLabel:t("number"),name:"ndiscado",readOnly:true},{fieldLabel:t("CallerID"),name:"callerid",readOnly:true},{fieldLabel:t("Real")+" "+t("duration"),name:"billsec",readOnly:true},{fieldLabel:t("Codec"),name:"codec",readOnly:true},{fieldLabel:t("Reinvite"),name:"reinvite",readOnly:true},{fieldLabel:t("From IP"),name:"from_ip",readOnly:true},{xtype:"textarea",name:"description",readOnly:true,height:350,anchor:"100%",hidden:!App.user.isAdmin}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callonlineform"],["component","box","container","panel","form","callonlineform"],{component:true,box:true,container:true,panel:true,form:true,callonlineform:true},["widget.callonlineform"],0,[MBilling.view.callOnLine,"Form"],0));(Ext.cmd.derive("MBilling.view.sendCreditSummary.Controller",Ext.ux.app.ViewController,{formHidden:true},0,0,0,0,["controller.sendcreditsummary"],0,[MBilling.view.sendCreditSummary,"Controller"],0));(Ext.cmd.derive("MBilling.view.sendCreditSummary.Module",Ext.form.Panel,{resizable:false,autoShow:true,header:false,items:[{xtype:"component",autoEl:{width:"100%",height:"100%",tag:"iframe",src:"index.php/sendCreditSummary/read"}}]},0,["sendcreditsummarymodule"],["component","box","container","panel","form","sendcreditsummarymodule"],{component:true,box:true,container:true,panel:true,form:true,sendcreditsummarymodule:true},["widget.sendcreditsummarymodule"],0,[MBilling.view.sendCreditSummary,"Module"],0));(Ext.cmd.derive("MBilling.view.sendCreditSummary.List",Ext.ux.grid.Panel,{store:"SendCreditSummary",initComponent:function(){var b=this;b.extraButtons=[{emptyText:t("From Day"),xtype:"searchfield",fieldFilter:"date",filterOnClick:b.filterFieldOnClick,store:b.store,comparison:"gt",type:"date"},{emptyText:t("To Day"),xtype:"searchfield",fieldFilter:"date",filterOnClick:b.filterFieldOnClick,store:b.store,comparison:"lt",type:"date"}];b.buttonCsv=false;b.buttonPrint=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("day"),renderer:Ext.util.Format.dateRenderer("Y-m-d"),dataIndex:"day",menuDisabled:true,flex:3},{header:t("service"),dataIndex:"service",flex:5},{header:t("Total cost"),dataIndex:"total_cost",flex:5,renderer:Helper.Util.formatMoneyDecimal2},{header:t("Total sale"),dataIndex:"total_sale",flex:5,renderer:Helper.Util.formatMoneyDecimal2},{header:t("Earned"),dataIndex:"earned",flex:5,renderer:Helper.Util.formatMoneyDecimal2}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["sendcreditsummarylist"],["component","box","container","panel","tablepanel","gridpanel","grid","sendcreditsummarylist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,sendcreditsummarylist:true},["widget.sendcreditsummarylist"],0,[MBilling.view.sendCreditSummary,"List"],0));(Ext.cmd.derive("MBilling.view.sendCreditSummary.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:App.user.isClient}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["sendcreditsummaryform"],["component","box","container","panel","form","sendcreditsummaryform"],{component:true,box:true,container:true,panel:true,form:true,sendcreditsummaryform:true},["widget.sendcreditsummaryform"],0,[MBilling.view.sendCreditSummary,"Form"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayUser.Controller",Ext.ux.app.ViewController,{onEdit:function(){me=this;me.sumData=me.store.getData().items[0].getData();if(!me.sumData){return}me.formPanel.getForm().getFields().each(function(b){b.setValue(me.sumData[b.name])});me.formPanel.expand()},onExportCsvDayUser:function(o,l,g){var m=this,j=m.list.getStore(),n=m.list.filters.getFilterData().length?Ext.encode(m.list.filters.getFilterData()):j.proxy.extraParams.filter;window.open("index.php/callSummaryDayUser/exportCsvCalls?id="+o.getStore().getAt(l).getData().idUserusername+"&filter="+n)}},0,0,0,0,["controller.callsummarydayuser"],0,[MBilling.view.callSummaryDayUser,"Controller"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayUser.Module",Ext.ux.panel.Module,{controller:"callsummarydayuser",titleDetails:t("total"),iconForm:"icon-sum",cfgEast:{flex:0.4}},0,["callsummarydayusermodule"],["component","box","container","uxpanelmodule","callsummarydayusermodule"],{component:true,box:true,container:true,uxpanelmodule:true,callsummarydayusermodule:true},["widget.callsummarydayusermodule"],0,[MBilling.view.callSummaryDayUser,"Module"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayUser.List",Ext.ux.grid.Panel,{store:"CallSummaryDayUser",initComponent:function(){var b=this;b.buttonImportCsv=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{xtype:"actioncolumn",width:26,sortable:false,menuDisabled:true,header:t(""),dataIndex:"id",items:[{iconCls:"icon-export-csv",tooltip:t("Export CSV"),handler:"onExportCsvDayUser"}],hidden:!App.user.isAdmin},{header:t("day"),renderer:Ext.util.Format.dateRenderer("Y-m-d"),dataIndex:"day",filter:{type:"date",field:"day"},flex:3},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("sessiontime")+" "+t("Min"),dataIndex:"sessiontime",flex:2},{header:t("aloc_all_calls"),dataIndex:"aloc_all_calls",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Answered Calls"),dataIndex:"nbcall",flex:3},{header:t("buycost"),dataIndex:App.user.isAdmin?"buycost":"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("sessionbill"),dataIndex:App.user.isAgent||App.user.isClientAgent?"agent_bill":"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("markup"),dataIndex:"lucro",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarydayuserlist"],["component","box","container","panel","tablepanel","gridpanel","grid","callsummarydayuserlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callsummarydayuserlist:true},["widget.callsummarydayuserlist"],0,[MBilling.view.callSummaryDayUser,"List"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayUser.Form",Ext.ux.form.Panel,{defaults:{},labelWidthFields:100,defaultType:"displayfield",initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{name:"sumsessiontime",fieldLabel:t("sessiontime")+" "+t("Min"),renderer:Ext.util.Format.numberRenderer("0"),allowBlank:true},{name:App.user.isAgent||App.user.isClientAgent?"sumagent_bill":"sumsessionbill",fieldLabel:t("sessionbill"),renderer:Helper.Util.formatMoneyDecimal,allowBlank:true},{name:App.user.isAdmin?"sumbuycost":"sumsessionbill",fieldLabel:t("buycost"),renderer:Helper.Util.formatMoneyDecimal,hidden:App.user.isClient,allowBlank:true},{name:"sumlucro",fieldLabel:t("markup"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumnbcall",fieldLabel:t("nbcall"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarydayuserform"],["component","box","container","panel","form","callsummarydayuserform"],{component:true,box:true,container:true,panel:true,form:true,callsummarydayuserform:true},["widget.callsummarydayuserform"],0,[MBilling.view.callSummaryDayUser,"Form"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayTrunk.Controller",Ext.ux.app.ViewController,{onEdit:function(){me=this;me.sumData=me.store.getData().items[0].getData();if(!me.sumData){return}me.formPanel.getForm().getFields().each(function(b){b.setValue(me.sumData[b.name])});me.formPanel.expand()}},0,0,0,0,["controller.callsummarydaytrunk"],0,[MBilling.view.callSummaryDayTrunk,"Controller"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayTrunk.Module",Ext.ux.panel.Module,{controller:"callsummarydaytrunk",titleDetails:t("total"),iconForm:"icon-sum",cfgEast:{flex:0.4}},0,["callsummarydaytrunkmodule"],["component","box","container","uxpanelmodule","callsummarydaytrunkmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callsummarydaytrunkmodule:true},["widget.callsummarydaytrunkmodule"],0,[MBilling.view.callSummaryDayTrunk,"Module"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayTrunk.List",Ext.ux.grid.Panel,{store:"CallSummaryDayTrunk",initComponent:function(){var b=this;b.buttonImportCsv=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{header:t("day"),renderer:Ext.util.Format.dateRenderer("Y-m-d"),dataIndex:"day",filter:{type:"date",field:"day"},flex:3},{header:t("Trunk"),dataIndex:"idTrunktrunkcode",filter:{type:"string",field:"idTrunk.trunkcode"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("sessiontime")+" "+t("Min"),dataIndex:"sessiontime",flex:2},{header:t("aloc_all_calls"),dataIndex:"aloc_all_calls",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Answered Calls"),dataIndex:"nbcall",flex:3},{header:t("buycost"),dataIndex:"buycost",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("sessionbill"),dataIndex:"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("markup"),dataIndex:"lucro",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarydaytrunklist"],["component","box","container","panel","tablepanel","gridpanel","grid","callsummarydaytrunklist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callsummarydaytrunklist:true},["widget.callsummarydaytrunklist"],0,[MBilling.view.callSummaryDayTrunk,"List"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayTrunk.Form",Ext.ux.form.Panel,{defaults:{},labelWidthFields:100,defaultType:"displayfield",initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{name:"sumsessiontime",fieldLabel:t("sessiontime")+" "+t("Min"),renderer:Ext.util.Format.numberRenderer("0"),allowBlank:true},{name:"sumsessionbill",fieldLabel:t("sessionbill"),renderer:Helper.Util.formatMoneyDecimal,allowBlank:true},{name:"sumbuycost",fieldLabel:t("buycost"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumlucro",fieldLabel:t("markup"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumnbcall",fieldLabel:t("nbcall"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarydaytrunkform"],["component","box","container","panel","form","callsummarydaytrunkform"],{component:true,box:true,container:true,panel:true,form:true,callsummarydaytrunkform:true},["widget.callsummarydaytrunkform"],0,[MBilling.view.callSummaryDayTrunk,"Form"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayAgent.Controller",Ext.ux.app.ViewController,{onEdit:function(){me=this;me.sumData=me.store.getData().items[0].getData();if(!me.sumData){return}me.formPanel.getForm().getFields().each(function(b){b.setValue(me.sumData[b.name])});me.formPanel.expand()}},0,0,0,0,["controller.callsummarydayagent"],0,[MBilling.view.callSummaryDayAgent,"Controller"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayAgent.Module",Ext.ux.panel.Module,{controller:"callsummarydayagent",titleDetails:t("total"),iconForm:"icon-sum",cfgEast:{flex:0.4}},0,["callsummarydayagentmodule"],["component","box","container","uxpanelmodule","callsummarydayagentmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callsummarydayagentmodule:true},["widget.callsummarydayagentmodule"],0,[MBilling.view.callSummaryDayAgent,"Module"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayAgent.List",Ext.ux.grid.Panel,{store:"CallSummaryDayAgent",initComponent:function(){var b=this;b.buttonImportCsv=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{header:t("day"),renderer:Ext.util.Format.dateRenderer("Y-m-d"),dataIndex:"day",filter:{type:"date",field:"day"},flex:3},{header:t("Agent"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{menuDisabled:true,header:t("sessiontime")+" "+t("Min"),dataIndex:"sessiontime",flex:2},{header:t("aloc_all_calls"),dataIndex:"aloc_all_calls",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Answered Calls"),dataIndex:"nbcall",flex:3},{header:t("buycost"),dataIndex:"buycost",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("sessionbill"),dataIndex:"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("markup"),dataIndex:"lucro",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarydayagentlist"],["component","box","container","panel","tablepanel","gridpanel","grid","callsummarydayagentlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callsummarydayagentlist:true},["widget.callsummarydayagentlist"],0,[MBilling.view.callSummaryDayAgent,"List"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayAgent.Form",Ext.ux.form.Panel,{defaults:{},labelWidthFields:100,defaultType:"displayfield",initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{name:"sumsessiontime",fieldLabel:t("sessiontime")+" "+t("Min"),renderer:Ext.util.Format.numberRenderer("0"),allowBlank:true},{name:"sumsessionbill",fieldLabel:t("sessionbill"),renderer:Helper.Util.formatMoneyDecimal,allowBlank:true},{name:"sumbuycost",fieldLabel:t("buycost"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumlucro",fieldLabel:t("markup"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumnbcall",fieldLabel:t("nbcall"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarydayagentform"],["component","box","container","panel","form","callsummarydayagentform"],{component:true,box:true,container:true,panel:true,form:true,callsummarydayagentform:true},["widget.callsummarydayagentform"],0,[MBilling.view.callSummaryDayAgent,"Form"],0));(Ext.cmd.derive("MBilling.view.callerid.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.callerid"],0,[MBilling.view.callerid,"Controller"],0));(Ext.cmd.derive("MBilling.view.callerid.Module",Ext.ux.panel.Module,{controller:"callerid"},0,["calleridmodule"],["component","box","container","uxpanelmodule","calleridmodule"],{component:true,box:true,container:true,uxpanelmodule:true,calleridmodule:true},["widget.calleridmodule"],0,[MBilling.view.callerid,"Module"],0));(Ext.cmd.derive("MBilling.view.callerid.List",Ext.ux.grid.Panel,{store:"Callerid",initComponent:function(){var b=this;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("cid"),dataIndex:"cid",flex:4},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("status"),dataIndex:"activated",renderer:Helper.Util.formatBooleanActive,comboRelated:"booleancombo",flex:2,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")]]}}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["calleridlist"],["component","box","container","panel","tablepanel","gridpanel","grid","calleridlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,calleridlist:true},["widget.calleridlist"],0,[MBilling.view.callerid,"List"],0));(Ext.cmd.derive("MBilling.view.callerid.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["id_user"],initComponent:function(){var b=this;b.items=[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"cid",fieldLabel:t("cid")},{xtype:"booleancombo",name:"activated",fieldLabel:t("status"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["calleridform"],["component","box","container","panel","form","calleridform"],{component:true,box:true,container:true,panel:true,form:true,calleridform:true},["widget.calleridform"],0,[MBilling.view.callerid,"Form"],0));(Ext.cmd.derive("MBilling.view.restrictedPhonenumber.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.restrictedphonenumber"],0,[MBilling.view.restrictedPhonenumber,"Controller"],0));(Ext.cmd.derive("MBilling.view.restrictedPhonenumber.Module",Ext.ux.panel.Module,{controller:"restrictedphonenumber"},0,["restrictedphonenumbermodule"],["component","box","container","uxpanelmodule","restrictedphonenumbermodule"],{component:true,box:true,container:true,uxpanelmodule:true,restrictedphonenumbermodule:true},["widget.restrictedphonenumbermodule"],0,[MBilling.view.restrictedPhonenumber,"Module"],0));(Ext.cmd.derive("MBilling.view.restrictedPhonenumber.List",Ext.ux.grid.Panel,{store:"RestrictedPhonenumber",buttonImportCsv:true,initComponent:function(){var b=this;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:2,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("number"),dataIndex:"number",flex:2}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["restrictedphonenumberlist"],["component","box","container","panel","tablepanel","gridpanel","grid","restrictedphonenumberlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,restrictedphonenumberlist:true},["widget.restrictedphonenumberlist"],0,[MBilling.view.restrictedPhonenumber,"List"],0));(Ext.cmd.derive("MBilling.view.restrictedPhonenumber.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["id_user"],initComponent:function(){var b=this;b.items=[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,readOnly:App.user.isClient,allowBlank:App.user.isClient},{name:"number",fieldLabel:t("number")}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["restrictedphonenumberform"],["component","box","container","panel","form","restrictedphonenumberform"],{component:true,box:true,container:true,panel:true,form:true,restrictedphonenumberform:true},["widget.restrictedphonenumberform"],0,[MBilling.view.restrictedPhonenumber,"Form"],0));(Ext.cmd.derive("MBilling.view.restrictedPhonenumber.ImportCsv",Ext.ux.window.ImportCsv,{htmlTipInfo:"
number
",fieldsImport:[{xtype:"usercombo",width:350}]},0,["restrictedphonenumberimportcsv"],["component","box","container","panel","window","restrictedphonenumberimportcsv"],{component:true,box:true,container:true,panel:true,window:true,restrictedphonenumberimportcsv:true},["widget.restrictedphonenumberimportcsv"],0,[MBilling.view.restrictedPhonenumber,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.did.Controller",Ext.ux.app.ViewController,{isSubmitForm:true,init:function(){var b=this;b.control({"booleancombo[name=cbr]":{select:b.onSelectcbr},"noyescombo[name=cbr_ua]":{select:b.onSelectcbrAu}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectcbr:function(c,d){me=this,form=me.formPanel.getForm();form.findField("cbr_ua").setVisible(d.data.field1);form.findField("cbr_total_try").setVisible(d.data.field1);form.findField("cbr_time_try").setVisible(d.data.field1)},onSelectcbrAu:function(c,d){me=this,form=me.formPanel.getForm();form.findField("cbr_em").setVisible(d.data.field1);form.findField("TimeOfDay_monFri").setVisible(d.data.field1);form.findField("TimeOfDay_sat").setVisible(d.data.field1);form.findField("TimeOfDay_sun").setVisible(d.data.field1);form.findField("workaudio").setVisible(d.data.field1);form.findField("noworkaudio").setVisible(d.data.field1)},onNew:function(e){var f=this,d=f.formPanel.getForm();d.findField("cbr_ua").setVisible(false);d.findField("cbr_em").setVisible(false);d.findField("TimeOfDay_monFri").setVisible(false);d.findField("TimeOfDay_sat").setVisible(false);d.findField("TimeOfDay_sun").setVisible(false);d.findField("workaudio").setVisible(false);d.findField("noworkaudio").setVisible(false);d.findField("cbr_total_try").setVisible(false);d.findField("cbr_time_try").setVisible(false);Ext.ux.app.ViewController.prototype.onNew.apply(this,arguments)},onEdit:function(){var c=this,d=c.list.getSelectionModel().getSelection()[0];if(d.get("cbr")==0){c.formPanel.getForm().findField("cbr_ua").setVisible(false);c.formPanel.getForm().findField("cbr_em").setVisible(false);c.formPanel.getForm().findField("TimeOfDay_monFri").setVisible(false);c.formPanel.getForm().findField("TimeOfDay_sat").setVisible(false);c.formPanel.getForm().findField("TimeOfDay_sun").setVisible(false);c.formPanel.getForm().findField("workaudio").setVisible(false);c.formPanel.getForm().findField("noworkaudio").setVisible(false);c.formPanel.getForm().findField("cbr_total_try").setVisible(false);c.formPanel.getForm().findField("cbr_time_try").setVisible(false)}else{c.formPanel.getForm().findField("cbr_ua").setVisible(true);if(d.get("cbr_ua")==1){c.formPanel.getForm().findField("cbr_em").setVisible(true);c.formPanel.getForm().findField("TimeOfDay_monFri").setVisible(true);c.formPanel.getForm().findField("TimeOfDay_sat").setVisible(true);c.formPanel.getForm().findField("TimeOfDay_sun").setVisible(true);c.formPanel.getForm().findField("workaudio").setVisible(true);c.formPanel.getForm().findField("noworkaudio").setVisible(true);c.formPanel.getForm().findField("cbr_total_try").setVisible(true);c.formPanel.getForm().findField("cbr_time_try").setVisible(true)}}Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)},onDelete:function(j){var g=this,e=g.list.getSelectionModel().getSelection(),f=true;Ext.each(e,function(a){if(a.get("reserved")===1){Ext.ux.Alert.alert(g.titleError,t("Please, first release the DID")+" "+a.raw.did,"error");f=false;return}});if(f==true){Ext.ux.app.ViewController.prototype.onDelete.apply(this,arguments)}},onRelease:function(o,l){var m=this,n=m.list.getSelectionModel().getSelection()[0],j=t("Confirm Release Did")+" "+n.get("did"),g=m.list.getStore();if(m.list.getSelectionModel().getSelection().length>1){Ext.ux.Alert.alert(m.titleError,t("Please Select only one DID to release"),"error")}else{if(n.get("reserved")===0){Ext.ux.Alert.alert(m.titleError,t("didIsNotUse"),"error");g.load()}else{Ext.Msg.confirm(m.titleConfirmation,j,function(a){if(a==="yes"){Ext.Ajax.request({url:"index.php/did/liberar",params:{id:n.get("id")},success:function(c){c=Ext.decode(c.responseText);if(c[m.nameSuccessRequest]){Ext.ux.Alert.alert(m.titleSuccess,c[m.nameMsgRequest],"success");g.load()}else{var b=Helper.Util.convertErrorsJsonToString(c[m.nameMsgRequest]);g.load()}}})}},m)}}},onBuyDid:function(){var m=this,j=m.lookupReference("buydidPanel"),f=j.getForm().findField("did").getValue(),l=j.getForm().findField("did").rawValue,g=t("confirmationBuyDid");if(f<1){Ext.ux.Alert.alert(m.titleError,t("Please, select a Did"),"warning")}else{Ext.Msg.confirm(t("Confirmation"),g+"
"+l,function(a){if(a==="yes"){Ext.ux.Alert.alert(m.titleSuccess,t("Please wait....We are activing your DID."),"notification");Ext.Ajax.request({url:"index.php/did/buy",params:{id:f},success:function(c){c=Ext.decode(c.responseText);if(c.success){Ext.ux.Alert.alert(m.titleSuccess,t(c.msg),"success",true,true,5000)}else{var b=Helper.Util.convertErrorsJsonToString(c.msg);Ext.ux.Alert.alert(m.titleError,t(b),"warning",true,true,5000)}}})}},m)}}},0,0,0,0,["controller.did"],0,[MBilling.view.did,"Controller"],0));(Ext.cmd.derive("MBilling.view.did.Combo",Ext.form.field.ComboBox,{name:"id_did",fieldLabel:t("did"),displayField:"did",forceSelection:true,editable:true,valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Did",{proxy:{type:"uxproxy",module:"did",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["didcombo"],["component","box","field","textfield","pickerfield","combobox","combo","didcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,didcombo:true},["widget.didcombo"],0,[MBilling.view.did,"Combo"],0));(Ext.cmd.derive("MBilling.view.did.BuyCombo",Ext.form.field.ComboBox,{name:"id_did",forceSelection:true,editable:false,fieldLabel:t("did"),displayField:"did",valueField:"id",listConfig:{itemTpl:Ext.create("Ext.XTemplate","
{did} ("+t("Setup")+": "+t("moedasimblo")+" {connection_charge} --> "+t("monthly payment")+": "+t("moedasimblo")+" {fixrate})
")},displayTpl:Ext.create("Ext.XTemplate",'{did} ('+t("Setup")+": "+t("moedasimblo")+" {connection_charge} --> "+t("monthly payment")+": "+t("moedasimblo")+" {fixrate})"),initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Did",{proxy:{type:"uxproxy",module:"did",actionRead:"readBuy",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["didbuycombo"],["component","box","field","textfield","pickerfield","combobox","combo","didbuycombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,didbuycombo:true},["widget.didbuycombo"],0,[MBilling.view.did,"BuyCombo"],0));(Ext.cmd.derive("MBilling.view.did.Module",Ext.ux.panel.Module,{controller:"did"},0,["didmodule"],["component","box","container","uxpanelmodule","didmodule"],{component:true,box:true,container:true,uxpanelmodule:true,didmodule:true},["widget.didmodule"],0,[MBilling.view.did,"Module"],0));(Ext.cmd.derive("MBilling.view.did.List",Ext.ux.grid.Panel,{store:"Did",fieldSearch:"did",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.extraButtons=[{text:t("crearToReleaseDid"),iconCls:"icon-delete",handler:"onRelease",disabled:false}];b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("did"),dataIndex:"did",flex:4},{header:t("reserved"),dataIndex:"reserved",renderer:Helper.Util.formattyyesno,flex:2,filter:{type:"list",options:[[1,t("yes")],[0,t("no")]]},hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:3,menuDisabled:true},{header:t("status"),dataIndex:"activated",renderer:Helper.Util.formatBooleanActive,flex:2,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")]]},hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("connection_charge"),dataIndex:"connection_charge",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("price")+" "+t("per")+" "+t("monthly"),dataIndex:"fixrate",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("secondusedreal"),renderer:Helper.Util.formatsecondsToTime,dataIndex:"secondusedreal",flex:3},{header:t("Description"),dataIndex:"description",hidden:true,hideable:App.user.isAdmin,flex:5}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["didlist"],["component","box","container","panel","tablepanel","gridpanel","grid","didlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,didlist:true},["widget.didlist"],0,[MBilling.view.did,"List"],0));(Ext.cmd.derive("MBilling.view.did.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["did"],initComponent:function(){var b=this;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{labelAlign:"right",plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true,labelWidth:140}},items:[{title:t("general"),items:[{name:"did",fieldLabel:t("did"),readOnly:App.user.isClient||App.user.isAgent},{xtype:"booleancombo",name:"activated",fieldLabel:t("status"),hidden:App.user.isClient||App.user.isAgent,allowBlank:true},{xtype:"moneyfield",name:"connection_charge",fieldLabel:t("connection_charge"),value:"0",hidden:App.user.isClient||App.user.isAgent},{xtype:"moneyfield",name:"fixrate",fieldLabel:t("Monthly")+" "+t("price"),value:"0",hidden:App.user.isClient||App.user.isAgent},{style:"margin-top:5px",xtype:"fieldset",title:t("Did")+" "+t("increment"),collapsible:false,collapsed:false,hidden:!App.user.isAdmin,defaults:{labelWidth:160,anchor:"100%",labelAlign:b.labelAlignFields},items:[{xtype:"moneyfield",name:"connection_sell",fieldLabel:t("Connetion charge"),value:"0",hidden:!App.user.isAdmin},{xtype:"numberfield",name:"minimal_time_charge",fieldLabel:t("Minimal time to charge"),value:"0",hidden:!App.user.isAdmin},{xtype:"numberfield",name:"initblock",fieldLabel:t("initblock"),value:"0",hidden:!App.user.isAdmin},{xtype:"numberfield",name:"increment",fieldLabel:t("billingblock"),value:"0",hidden:!App.user.isAdmin}]},{xtype:"combobox",name:"charge_of",fieldLabel:t("Charge")+" "+t("of"),value:1,forceSelection:true,editable:false,store:[[1,t("Owner DID")],[0,t("Caller ID, only allow call from registered callerID")]],hidden:App.user.isClient||App.user.isAgent},{xtype:"numberfield",name:"calllimit",fieldLabel:t("Channel Limit"),value:"-1",minValue:"-1",hidden:!window.didChannelLimit||!App.user.isAdmin},{xtype:"textareafield",allowBlank:true,name:"description",fieldLabel:t("description"),hidden:!App.user.isAdmin}]},{title:t("Billing"),items:[{style:"margin-top:5px",xtype:"fieldset",title:t("Did Billing per minute")+" "+t("rate")+" 1",collapsible:false,collapsed:false,hidden:!App.user.isAdmin,defaults:{labelWidth:170,anchor:"100%",labelAlign:b.labelAlignFields},items:[{xtype:"textfield",name:"expression_1",fieldLabel:t("Regular expression"),value:"*",hidden:!App.user.isAdmin},{xtype:"moneyfield",name:"selling_rate_1",fieldLabel:t("Sell price per min"),value:"0",hidden:!App.user.isAdmin},{xtype:"noyescombo",name:"block_expression_1",fieldLabel:t("Block calls from this expression"),hidden:!App.user.isAdmin},{xtype:"noyescombo",name:"send_to_callback_1",fieldLabel:t("Send the call to Callback"),hidden:!App.user.isAdmin}]},{style:"margin-top:25px",xtype:"fieldset",title:t("Did Billing per minute")+" "+t("rate")+" 2",collapsible:false,collapsed:false,hidden:!App.user.isAdmin,defaults:{labelWidth:160,anchor:"100%",labelAlign:b.labelAlignFields},items:[{xtype:"textfield",name:"expression_2",fieldLabel:t("Regular expression"),value:"*",hidden:!App.user.isAdmin},{xtype:"moneyfield",name:"selling_rate_2",fieldLabel:t("Sell price per min"),value:"0",hidden:!App.user.isAdmin},{xtype:"noyescombo",name:"block_expression_2",fieldLabel:t("Block calls from this expression"),hidden:!App.user.isAdmin},{xtype:"noyescombo",name:"send_to_callback_2",fieldLabel:t("Send the call to Callback"),hidden:!App.user.isAdmin}]},{style:"margin-top:25px",xtype:"fieldset",title:t("Did Billing per minute")+" "+t("rate")+" 3",collapsible:false,collapsed:false,hidden:!App.user.isAdmin,defaults:{labelWidth:160,anchor:"100%",labelAlign:b.labelAlignFields},items:[{xtype:"textfield",name:"expression_3",fieldLabel:t("Regular expression"),value:"*",hidden:!App.user.isAdmin},{xtype:"moneyfield",name:"selling_rate_3",fieldLabel:t("Sell price per min"),value:"0",hidden:!App.user.isAdmin},{xtype:"noyescombo",name:"block_expression_3",fieldLabel:t("Block calls from this expression"),hidden:!App.user.isAdmin},{xtype:"noyescombo",name:"send_to_callback_3",fieldLabel:t("Send the call to Callback"),hidden:!App.user.isAdmin}]}]},{title:t("CallBack Pro"),hidden:!window.cbr,items:[{xtype:"booleancombo",name:"cbr",fieldLabel:t("CallBack Pro"),value:0,hidden:!window.cbr,allowBlank:true},{xtype:"noyescombo",name:"cbr_ua",fieldLabel:t("Use Audio"),value:0,hidden:true,allowBlank:true},{xtype:"numberfield",name:"cbr_total_try",fieldLabel:t("Maximum trying"),value:3,hidden:true,allowBlank:true,minValue:0},{xtype:"numberfield",name:"cbr_time_try",fieldLabel:t("Interval beteween trying"),value:30,hidden:true,allowBlank:true,minValue:10},{xtype:"noyescombo",name:"cbr_em",fieldLabel:t("Early Media"),hidden:true,allowBlank:true},{name:"TimeOfDay_monFri",fieldLabel:t("Mon-Fri"),value:"09:00-12:00|14:00-18:00",minLength:11,hidden:true},{name:"TimeOfDay_sat",fieldLabel:t("Sat"),value:"09:00-12:00",allowBlank:true,hidden:true},{name:"TimeOfDay_sun",fieldLabel:t("Sun"),value:"00:00",allowBlank:true,hidden:true},{xtype:"uploadfield",fieldLabel:t("workaudio"),emptyText:"Select an gsm File",allowBlank:true,name:"workaudio",extAllowed:["wav","gsm"],hidden:true},{xtype:"uploadfield",fieldLabel:t("noworkaudio"),emptyText:"Select an gsm File",allowBlank:true,name:"noworkaudio",extAllowed:["wav","gsm"],hidden:true}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["didform"],["component","box","container","panel","form","didform"],{component:true,box:true,container:true,panel:true,form:true,didform:true},["widget.didform"],0,[MBilling.view.did,"Form"],0));(Ext.cmd.derive("MBilling.view.did.ImportCsv",Ext.ux.window.ImportCsv,{htmlTipInfo:"
"+t("number")+", "+t("price")+" "+t("by")+" "+t("monthly")+", "+t("connection_charge")+"
551156332233, 10, 5
554153882200, 10, 5
554155667788, 10, 5
"+t("monthly")+" "+t("and")+" "+t("connection_charge")+" "+t("optional")+"",fieldsImport:[{fieldLabel:t("table"),hidden:true,allowBlank:true}]},0,["didimportcsv"],["component","box","container","panel","window","didimportcsv"],{component:true,box:true,container:true,panel:true,window:true,didimportcsv:true},["widget.didimportcsv"],0,[MBilling.view.did,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.didbuy.Module",Ext.form.Panel,{controller:"did",resizable:false,autoShow:true,header:false,initComponent:function(){var b=this;b.items=[{reference:"buydidPanel",xtype:"form",margin:"10 10 10 10",autoShow:true,closable:false,resizable:false,bodyPadding:10,defaultType:"textfield",defaults:{labelAlign:"right",labelWidth:175,width:280,allowBlank:false,msgTarget:"side",enableKeyEvents:true,plugins:"markallowblank",anchor:"100%"},items:[{xtype:"didbuycombo",fieldLabel:t("Select a Did"),name:"did"}],bbar:[{text:t("Next"),tooltip:t("Next"),glyph:icons.disk,handler:"onBuyDid"}]}];Ext.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["didbuymodule"],["component","box","container","panel","form","didbuymodule"],{component:true,box:true,container:true,panel:true,form:true,didbuymodule:true},["widget.didbuymodule"],0,[MBilling.view.didbuy,"Module"],0));(Ext.cmd.derive("MBilling.view.diddestination.Controller",Ext.ux.app.ViewController,{init:function(){var b=this;b.control({didtypefullcombo:{select:b.onSelectMethod},didtypefreecombo:{select:b.onSelectMethod}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectMethod:function(c,d){this.showFieldsRelated(d.getData().showFields)},showFieldsRelated:function(f){var d=this,e=d.formPanel.getForm().getFields();e.each(function(a){a.setVisible(f.indexOf(a.name)!==-1)})},onEdit:function(){var f=this,d=f.formPanel.getForm(),e=f.list.getSelectionModel().getSelection()[0];method=e?e.get("voip_call"):"sipcall";switch(method){case 0:method=t("callforpstn");break;case 1:method=t("sipcall");break;case 2:method=t("ivr");break;case 3:method="CallingCard";break;case 4:method=t("portalDeVoz");break;case 5:method=t("CID Callback");break;case 6:method=t("0800 Callback");break;case 7:method=t("Queue");break;case 8:method=t("Call Group");break;case 9:method=t("Custom");break}showFields=f.formPanel.down("didtypefullcombo").store.findRecord("name",method).getData().showFields;f.showFieldsRelated(showFields);d.findField("id_did").setReadOnly(true);Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)},onNew:function(){var f=this,d=f.formPanel.getForm(),e=f.list.getSelectionModel().getSelection()[0];d.findField("id_did").setReadOnly(false);method=t("sipcall");showFields=f.formPanel.down("didtypefullcombo").store.findRecord("name",method).getData().showFields;f.showFieldsRelated(showFields);Ext.ux.app.ViewController.prototype.onNew.apply(this,arguments)}},0,0,0,0,["controller.diddestination"],0,[MBilling.view.diddestination,"Controller"],0));(Ext.cmd.derive("MBilling.view.diddestination.Module",Ext.ux.panel.Module,{controller:"diddestination"},0,["diddestinationmodule"],["component","box","container","uxpanelmodule","diddestinationmodule"],{component:true,box:true,container:true,uxpanelmodule:true,diddestinationmodule:true},["widget.diddestinationmodule"],0,[MBilling.view.diddestination,"Module"],0));(Ext.cmd.derive("MBilling.view.diddestination.List",Ext.ux.grid.Panel,{store:"Diddestination",fieldSearch:"idDid.did",initComponent:function(){var b=this;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("did"),dataIndex:"idDiddid",filter:{type:"string",field:"idDid.did"},flex:5},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("type")+" "+t("of")+" "+t("call"),dataIndex:"voip_call",renderer:Helper.Util.formatDidType,comboRelated:"didtypecombo",flex:3,filter:{type:"list",options:[[0,t("callforpstn")],[1,t("sipcall")],[2,t("ivr")],[3,t("callingcard")],[4,t("portalDeVoz")],[5,t("CID Callback")],[6,t("0800 Callback")],[7,t("Queue")],[8,t("Call Group")],[9,t("Custom")]]}},{header:t("secondusedreal"),renderer:Helper.Util.formatsecondsToTime,dataIndex:"secondusedreal",flex:3},{header:t("creationdate"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"creationdate",flex:5}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["diddestinationlist"],["component","box","container","panel","tablepanel","gridpanel","grid","diddestinationlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,diddestinationlist:true},["widget.diddestinationlist"],0,[MBilling.view.diddestination,"List"],0));(Ext.cmd.derive("MBilling.view.diddestination.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["id_user","id_did"],initComponent:function(){var b=this;b.items=[{name:"id_did",fieldLabel:t("DID"),xtype:"didcombo"},{xtype:"userlookup",ownerForm:b,hidden:true,allowBlank:App.user.isClient},{xtype:"booleancombo",name:"activated",fieldLabel:t("status"),allowBlank:false},{xtype:"numbercombo",name:"priority",fieldLabel:t("priority"),allowBlank:true},{style:"margin-top:25px",xtype:"fieldset",title:t("Did Destination"),collapsible:true,collapsed:false,defaults:{labelWidth:75,anchor:"100%",labelAlign:b.labelAlignFields},items:[{xtype:"didtypefullcombo",name:"voip_call",fieldLabel:t("type")+" "+t("of")+" "+t("call")},{xtype:"textfield",name:"destination",fieldLabel:t("Destination"),value:"",allowBlank:true,hidden:App.user.isClient||App.user.isAgent},{xtype:"ivrlookup",ownerForm:b,name:"id_ivr",fieldLabel:t("IVR"),allowBlank:true},{xtype:"queuelookup",ownerForm:b,name:"id_queue",fieldLabel:t("Queue"),allowBlank:true},{xtype:"siplookup",ownerForm:b,name:"id_sip",fieldLabel:t("SIP"),allowBlank:true}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["diddestinationform"],["component","box","container","panel","form","diddestinationform"],{component:true,box:true,container:true,panel:true,form:true,diddestinationform:true},["widget.diddestinationform"],0,[MBilling.view.diddestination,"Form"],0));(Ext.cmd.derive("MBilling.view.diddestination.Combo",Ext.form.field.ComboBox,{fieldLabel:t("typepaid"),displayField:"name",valueField:"id",forceSelection:true,editable:false,value:1,store:{fields:["id","name"],data:[{id:"0",name:t("callforpstn"),showFields:["voip_call","destination","id_did","id_user","activated"]},{id:"1",name:t("sipcall"),showFields:["voip_call","id_sip","id_did","id_user","activated","priority"]},{id:"2",name:t("ivr"),showFields:["voip_call","id_did","id_ivr","id_user","activated"]},{id:"3",name:"CallingCard",showFields:["voip_call","id_did","id_user","activated"]},{id:"4",name:t("portalDeVoz"),showFields:["voip_call","id_did","id_user","activated"]},{id:"5",name:t("CID Callback"),showFields:["voip_call","id_did","id_user","activated"]},{id:"6",name:t("0800 Callback"),showFields:["voip_call","id_did","id_user","activated"]},{id:"7",name:t("Queue"),showFields:["voip_call","id_did","id_queue","id_user","activated"]},{id:"8",name:t("Call Group"),showFields:["voip_call","destination","id_did","id_user","activated"]},{id:"9",name:t("Custom"),showFields:["voip_call","destination","id_did","id_user","activated"]}]}},0,["didtypefullcombo"],["component","box","field","textfield","pickerfield","combobox","combo","didtypefullcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,didtypefullcombo:true},["widget.didtypefullcombo"],0,[MBilling.view.diddestination,"Combo"],0));(Ext.cmd.derive("MBilling.view.diddestination.freeCombo",Ext.form.field.ComboBox,{fieldLabel:t("typepaid"),displayField:"name",forceSelection:true,editable:false,valueField:"id",value:1,store:{fields:["id","name"],data:[{id:"0",name:t("callforpstn"),showFields:["voip_call","id_did","destination","id_user","activated"]},{id:"1",name:t("sipcall"),showFields:["voip_call","id_did","id_sip","id_user","activated","priority"]},{id:"2",name:t("ivr"),showFields:["voip_call","id_did","id_ivr","id_user"]},{id:"3",name:"CallingCard",showFields:["voip_call","id_did","id_user"]},{id:"4",name:t("portalDeVoz"),showFields:["voip_call","id_did","id_user"]}]}},0,["didtypefreecombo"],["component","box","field","textfield","pickerfield","combobox","combo","didtypefreecombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,didtypefreecombo:true},["widget.didtypefreecombo"],0,[MBilling.view.diddestination,"freeCombo"],0));(Ext.cmd.derive("MBilling.view.didUse.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.diduse"],0,[MBilling.view.didUse,"Controller"],0));(Ext.cmd.derive("MBilling.view.didUse.Module",Ext.ux.panel.Module,{controller:"diduse"},0,["didusemodule"],["component","box","container","uxpanelmodule","didusemodule"],{component:true,box:true,container:true,uxpanelmodule:true,didusemodule:true},["widget.didusemodule"],0,[MBilling.view.didUse,"Module"],0));(Ext.cmd.derive("MBilling.view.didUse.List",Ext.ux.grid.Panel,{store:"DidUse",initComponent:function(){var b=this;b.buttonCsv=false;b.allowPrint=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("did"),dataIndex:"idDiddid",flex:5},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("monthpayed"),dataIndex:"month_payed",flex:2},{header:t("reservationdate"),renderer:Helper.Util.formatDateTime,dataIndex:"reservationdate",flex:5},{header:t("releasedate"),renderer:Helper.Util.formatDateTime,dataIndex:"releasedate",flex:5}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["diduselist"],["component","box","container","panel","tablepanel","gridpanel","grid","diduselist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,diduselist:true},["widget.diduselist"],0,[MBilling.view.didUse,"List"],0));(Ext.cmd.derive("MBilling.view.didUse.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,readOnly:true},{xtype:"didcombo",readOnly:true},{xtype:"datefield",name:"reservationdate",fieldLabel:t("reservationdate"),format:"Y-m-d H:i:s"}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["diduseform"],["component","box","container","panel","form","diduseform"],{component:true,box:true,container:true,panel:true,form:true,diduseform:true},["widget.diduseform"],0,[MBilling.view.didUse,"Form"],0));(Ext.cmd.derive("MBilling.view.dashboard.Module",Ext.panel.Panel,{autoShow:true,header:false,initComponent:function(){var b=this;width=window.isTablet?Ext.Element.getViewportWidth()-240:Ext.Element.getViewportWidth()-220;showDid=showBuy=false;if(!App.user.isAdmin){Ext.each(App.user.menu,function(a){if(!Ext.isEmpty(a.rows)){Ext.each(a.rows,function(d){if(d.module=="didbuy"){showDid=true}if(d.module=="buycredit"){showBuy=true}},b)}},b)}widthView=Ext.Element.getViewportWidth()-430;heightView=Ext.Element.getViewportHeight()-137;heightViewFace=heightView+23;facebookhtml='
';if(!App.user.isAdmin&&App.user.social_media_network.length>10){facebookhtml='
'}if(window.customDashboard&&!App.user.isAdmin){b.items=[{header:false,bodyPadding:0,style:"background-color:transparent;",bodyStyle:"background-color:transparent !important;",html:'
',collapseDirection:"bottom",collapsible:true,autoScroll:true,height:Ext.Element.getViewportHeight()}]}else{b.items=[{width:!window.isDesktop?width:"NULL",header:false,xtype:"dashboard",listeners:{activate:"setRunnerInfoSystem"},glyph:icons.home,title:t("Home"),stateful:false,items:[{columnWidth:App.user.isAdmin?1/2:1,items:[{title:t("callonline"),items:{xtype:"callonlinelist2"},hidden:window.isTablet||!App.user.isAdmin,height:App.user.isClient?250:300},{title:t("Simultaneous Call"),items:{xtype:"callonlinechartchart"},hidden:window.isTablet||!App.user.isAdmin,iconCls:"icon-chart-column",glyph:undefined}]},{hidden:App.user.isAdmin,columnWidth:App.user.isClient?1/2:1,items:[{title:t("BuyCredit"),items:{xtype:"buycreditmodule"},height:window.isTablet?250:170,hidden:!showBuy}]},{hidden:App.user.isAdmin,columnWidth:1/2,items:[{title:t("Buy")+" "+t("did"),items:{xtype:"didbuymodule"},height:window.isTablet?250:170,hidden:!showDid||!App.user.isClient},{iconCls:"icon-info",title:t("NEWS"),bodyPadding:0,style:"background-color:transparent;",bodyStyle:"background-color:transparent !important;",hidden:App.user.isAdmin||App.user.social_media_network.length<=10,html:facebookhtml,collapseDirection:"bottom",collapsible:true,autoScroll:true,height:300}]},{columnWidth:1/2,items:[{iconCls:"icon-info",title:t("NEWS"),bodyPadding:0,style:"background-color:transparent;",bodyStyle:"background-color:transparent !important;",hidden:!App.user.isAdmin||window.isTablet||window.isTablets||App.user.l.slice(4,7)=="syn",html:facebookhtml,collapseDirection:"bottom",collapsible:true,autoScroll:true,height:300},{title:t("Refill Summary"),iconCls:"icon-chart-column",glyph:undefined,items:{xtype:"refillchart"},hidden:!App.user.isAdmin||window.isTablet}]}]}]}Ext.panel.Panel.prototype.initComponent.apply(this,arguments)}},0,["dashboardmodule"],["component","box","container","panel","dashboardmodule"],{component:true,box:true,container:true,panel:true,dashboardmodule:true},["widget.dashboardmodule"],0,[MBilling.view.dashboard,"Module"],0));(Ext.cmd.derive("MBilling.view.dashboardQueue.Module",Ext.panel.Panel,{autoShow:true,header:false,initComponent:function(){var b=this;b.items=[{width:!window.isDesktop?width:"NULL",header:false,xtype:"dashboard",listeners:{activate:"setRunnerInfoSystem"},glyph:icons.home,title:t("Home"),stateful:false,items:[{columnWidth:1/2,items:[{title:t("Queue Monitor"),items:{xtype:"queuedashboardlist"},height:window.heightView}]},{columnWidth:1/2,items:[{title:t("Agent Monitor"),iconCls:"icon-chart-column",glyph:undefined,items:{xtype:"queuememberdashboardlist"},height:window.heightView}]}]}];Ext.panel.Panel.prototype.initComponent.apply(this,arguments)}},0,["dashboardqueuemodule"],["component","box","container","panel","dashboardqueuemodule"],{component:true,box:true,container:true,panel:true,dashboardqueuemodule:true},["widget.dashboardqueuemodule"],0,[MBilling.view.dashboardQueue,"Module"],0));(Ext.cmd.derive("MBilling.view.ivr.Controller",Ext.ux.app.ViewController,{isSubmitForm:true,init:function(){var b=this;b.control({typedestinationcombo:{select:b.onSelectMethod}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectMethod:function(c,d){this.showFieldsRelated(d.getData().showFields)},showFieldsRelated:function(l){var m=this,n=m.formPanel.getForm(),j=m.formPanel.getForm().getFields(),g=Ext.get(Ext.Element.getActiveElement()).component,o=g.name.substr(-2);m.onSetVisibleFiel(g,n,o,g.value)},onSetVisibleFiel:function(f,j,e,g){if(f.value=="undefined"){f.setValue("undefined")}if(f.name.match("^type_10")){j.findField("id_queue_10").setVisible(g.match("^queue"));j.findField("id_sip_10").setVisible(g.match("^sip"));j.findField("id_ivr_10").setVisible(g.match("^ivr"));j.findField("extension_10").setVisible(g.match("^group|^number|^custom"))}else{if(f.name.match("^type_[0-9]")){j.findField("id_queue"+e).setVisible(g.match("^queue"));j.findField("id_sip"+e).setVisible(g.match("^sip"));j.findField("id_ivr"+e).setVisible(g.match("^ivr"));j.findField("extension"+e).setVisible(g.match("^group|^number|^custom"))}else{if(f.name.match("^type_out_10")){j.findField("id_queue_out_10").setVisible(g.match("^queue"));j.findField("id_ivr_out_10").setVisible(g.match("^ivr"));j.findField("id_sip_out_10").setVisible(g.match("^sip"));j.findField("extension_out_10").setVisible(g.match("^group|^number|^custom"))}else{j.findField("id_queue_out"+e).setVisible(g.match("^queue"));j.findField("id_sip_out"+e).setVisible(g.match("^sip"));j.findField("id_ivr_out"+e).setVisible(g.match("^ivr"));j.findField("extension_out"+e).setVisible(g.match("^group|^number|^custom"))}}}},onEdit:function(){var g=this,j=g.formPanel.getForm(),f=g.list.getSelectionModel().getSelection()[0];for(var e=0;e<=10;e++){fieldValue=f.getData()["type_"+e];fieldValueOut=f.getData()["type_out_"+e];if(fieldValue=="ivr"){j.findField("id_ivr_"+e).setVisible(true);j.findField("id_sip_"+e).setVisible(false);j.findField("id_queue_"+e).setVisible(false);j.findField("extension_"+e).setVisible(false)}else{if(fieldValue=="sip"){j.findField("id_sip_"+e).setVisible(true);j.findField("id_ivr_"+e).setVisible(false);j.findField("id_queue_"+e).setVisible(false);j.findField("extension_"+e).setVisible(false)}else{if(fieldValue=="queue"){j.findField("id_queue_"+e).setVisible(true);j.findField("id_sip_"+e).setVisible(false);j.findField("id_ivr_"+e).setVisible(false);j.findField("extension_"+e).setVisible(false)}else{if(fieldValue.match("custom|number|group")){j.findField("extension_"+e).setVisible(true);j.findField("id_ivr_"+e).setVisible(false);j.findField("id_sip_"+e).setVisible(false);j.findField("id_queue_"+e).setVisible(false)}else{j.findField("id_queue_"+e).setVisible(false);j.findField("id_sip_"+e).setVisible(false);j.findField("id_ivr_"+e).setVisible(false);j.findField("extension_"+e).setVisible(false)}}}}if(fieldValueOut=="ivr"){j.findField("id_ivr_out_"+e).setVisible(true);j.findField("id_sip_out_"+e).setVisible(false);j.findField("id_queue_out_"+e).setVisible(false);j.findField("extension_out_"+e).setVisible(false)}else{if(fieldValueOut=="sip"){j.findField("id_sip_out_"+e).setVisible(true);j.findField("id_ivr_out_"+e).setVisible(false);j.findField("id_queue_out_"+e).setVisible(false);j.findField("extension_out_"+e).setVisible(false)}else{if(fieldValueOut=="queue"){j.findField("id_queue_out_"+e).setVisible(true);j.findField("id_sip_out_"+e).setVisible(false);j.findField("id_ivr_out_"+e).setVisible(false);j.findField("extension_out_"+e).setVisible(false)}else{if(fieldValueOut.match("custom|number|group")){j.findField("extension_out_"+e).setVisible(true);j.findField("id_ivr_out_"+e).setVisible(false);j.findField("id_sip_out_"+e).setVisible(false);j.findField("id_queue_out_"+e).setVisible(false)}else{j.findField("id_queue_out_"+e).setVisible(false);j.findField("id_sip_out_"+e).setVisible(false);j.findField("id_ivr_out_"+e).setVisible(false);j.findField("extension_out_"+e).setVisible(false)}}}}}Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)},onNew:function(){var g=this,j=g.formPanel.getForm(),f=g.list.getSelectionModel().getSelection()[0];for(var e=0;e<=10;e++){j.findField("id_ivr_"+e).setVisible(false);j.findField("id_sip_"+e).setVisible(false);j.findField("id_queue_"+e).setVisible(false);j.findField("id_ivr_out_"+e).setVisible(false);j.findField("id_sip_out_"+e).setVisible(false);j.findField("id_queue_out_"+e).setVisible(false)}Ext.ux.app.ViewController.prototype.onNew.apply(this,arguments)}},0,0,0,0,["controller.ivr"],0,[MBilling.view.ivr,"Controller"],0));(Ext.cmd.derive("MBilling.view.ivr.Module",Ext.ux.panel.Module,{controller:"ivr"},0,["ivrmodule"],["component","box","container","uxpanelmodule","ivrmodule"],{component:true,box:true,container:true,uxpanelmodule:true,ivrmodule:true},["widget.ivrmodule"],0,[MBilling.view.ivr,"Module"],0));(Ext.cmd.derive("MBilling.view.ivr.List",Ext.ux.grid.Panel,{store:"Ivr",initComponent:function(){var b=this;b.allowPrint=false;b.buttonCsv=false;b.columns=b.columns||[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("name"),dataIndex:"name",flex:5},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["ivrlist"],["component","box","container","panel","tablepanel","gridpanel","grid","ivrlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,ivrlist:true},["widget.ivrlist"],0,[MBilling.view.ivr,"List"],0));(Ext.cmd.derive("MBilling.view.ivr.Form",Ext.ux.form.Panel,{bodyPadding:0,fileUpload:true,initComponent:function(){var b=this;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{plugins:"markallowblank",allowBlank:false,anchor:"100%",labelAlign:"right"}},items:[{title:t("general"),items:[{name:"name",fieldLabel:t("name")},{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"monFriStart",fieldLabel:t("monFriStart"),value:"09:00",maxLength:5,minLength:5},{name:"monFriStop",fieldLabel:t("monFriStop"),value:"18:00",maxLength:5,minLength:5},{name:"satStart",fieldLabel:t("satStart"),value:"09:00",maxLength:5,minLength:5},{name:"satStop",fieldLabel:t("satStop"),value:"12:00",maxLength:5,minLength:5},{name:"sunStart",fieldLabel:t("sunStart"),value:"09:00",maxLength:5,minLength:5},{name:"sunStop",fieldLabel:t("sunStop"),value:"12:00",maxLength:5,minLength:5},{xtype:"uploadfield",fieldLabel:t("workaudio"),emptyText:"Select an wav or gsm File",allowBlank:true,name:"workaudio",labelWidth:120,extAllowed:["wav","gsm"]},{xtype:"uploadfield",fieldLabel:t("noworkaudio"),emptyText:"Select an wav or gsm File",allowBlank:true,labelWidth:120,name:"noworkaudio",extAllowed:["wav","gsm"]}]},{title:t("options")+" "+t("work"),itemId:"option",defaults:{xtype:"fieldcontainer",layout:"hbox",plugins:"markallowblank",allowBlank:true,anchor:"100%",labelWidth:100,defaults:{hideLabel:true,hidden:true,flex:5,startX:100,allowBlank:true,ownerForm:b}},items:[{xtype:"menuseparator",width:"100%"},{labelStyle:"font-weight:bold",xtype:"displayfield",value:''+t("Select the destination to send call when caller press any digits.")+"",allowBlank:true},{xtype:"menuseparator",width:"100%"},{fieldLabel:t("option")+" 0",items:[{name:"type_0",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_0",displayField:"id_ivr_0_name"},{xtype:"queuelookup",name:"id_queue_0",displayField:"id_queue_0_name"},{xtype:"siplookup",name:"id_sip_0",displayField:"id_sip_0_name"},{xtype:"textfield",name:"extension_0"}]},{fieldLabel:t("option")+" 1",items:[{name:"type_1",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_1",displayField:"id_ivr_1_name"},{xtype:"queuelookup",name:"id_queue_1",displayField:"id_queue_1_name"},{xtype:"siplookup",name:"id_sip_1",displayField:"id_sip_1_name"},{xtype:"textfield",name:"extension_1"}]},{fieldLabel:t("option")+" 2",items:[{name:"type_2",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_2",displayField:"id_ivr_2_name"},{xtype:"queuelookup",name:"id_queue_2",displayField:"id_queue_2_name"},{xtype:"siplookup",name:"id_sip_2",displayField:"id_sip_2_name"},{xtype:"textfield",name:"extension_2"}]},{fieldLabel:t("option")+" 3",items:[{name:"type_3",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_3",displayField:"id_ivr_3_name"},{xtype:"queuelookup",name:"id_queue_3",displayField:"id_queue_3_name"},{xtype:"siplookup",name:"id_sip_3",displayField:"id_sip_3_name"},{xtype:"textfield",name:"extension_3"}]},{fieldLabel:t("option")+" 4",items:[{name:"type_4",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_4",displayField:"id_ivr_4_name"},{xtype:"queuelookup",name:"id_queue_4",displayField:"id_queue_4_name"},{xtype:"siplookup",name:"id_sip_4",displayField:"id_sip_4_name"},{xtype:"textfield",name:"extension_4"}]},{fieldLabel:t("option")+" 5",items:[{name:"type_5",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_5",displayField:"id_ivr_5_name"},{xtype:"queuelookup",name:"id_queue_5",displayField:"id_queue_5_name"},{xtype:"siplookup",name:"id_sip_5",displayField:"id_sip_5_name"},{xtype:"textfield",name:"extension_5"}]},{fieldLabel:t("option")+" 6",items:[{name:"type_6",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_6",displayField:"id_ivr_6_name"},{xtype:"queuelookup",name:"id_queue_6",displayField:"id_queue_6_name"},{xtype:"siplookup",name:"id_sip_6",displayField:"id_sip_6_name"},{xtype:"textfield",name:"extension_6"}]},{fieldLabel:t("option")+" 7",items:[{name:"type_7",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_7",displayField:"id_ivr_7_name"},{xtype:"queuelookup",name:"id_queue_7",displayField:"id_queue_7_name"},{xtype:"siplookup",name:"id_sip_7",displayField:"id_sip_7_name"},{xtype:"textfield",name:"extension_7"}]},{fieldLabel:t("option")+" 8",items:[{name:"type_8",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_8",displayField:"id_ivr_8_name"},{xtype:"queuelookup",name:"id_queue_8",displayField:"id_queue_8_name"},{xtype:"siplookup",name:"id_sip_8",displayField:"id_sip_8_name"},{xtype:"textfield",name:"extension_8"}]},{fieldLabel:t("option")+" 9",items:[{name:"type_9",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_9",displayField:"id_ivr_9_name"},{xtype:"queuelookup",name:"id_queue_9",displayField:"id_queue_9_name"},{xtype:"siplookup",name:"id_sip_9",displayField:"id_sip_9_name"},{xtype:"textfield",name:"extension_9"}]},{fieldLabel:t("option")+" default",items:[{name:"type_10",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_10",displayField:"id_ivr_10_name"},{xtype:"queuelookup",name:"id_queue_10",displayField:"id_queue_10_name"},{xtype:"siplookup",name:"id_sip_10",displayField:"id_sip_10_name"},{xtype:"textfield",name:"extension_10"}]},{fieldLabel:t("Direct extension"),hidden:!window.didChannelLimit,name:"direct_extension",xtype:"noyescombo"}]},{title:t("options")+" "+t("not")+" "+t("work"),itemId:"optionOut",defaults:{xtype:"fieldcontainer",layout:"hbox",plugins:"markallowblank",allowBlank:true,anchor:"100%",labelWidth:100,defaults:{hideLabel:true,hidden:true,flex:5,startX:100,allowBlank:true,ownerForm:b}},items:[{xtype:"menuseparator",width:"100%"},{labelStyle:"font-weight:bold",xtype:"displayfield",value:''+t("Select the destination to send call when caller press any digits.")+"",allowBlank:true},{xtype:"menuseparator",width:"100%"},{fieldLabel:t("option")+" 0",items:[{name:"type_out_0",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_0",displayField:"id_ivr_out_0_name"},{xtype:"queuelookup",name:"id_queue_out_0",displayField:"id_queue_out_0_name"},{xtype:"siplookup",name:"id_sip_out_0",displayField:"id_sip_out_0_name"},{xtype:"textfield",name:"extension_out_0"}]},{fieldLabel:t("option")+" 1",items:[{name:"type_out_1",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_1",displayField:"id_ivr_out_1_name"},{xtype:"queuelookup",name:"id_queue_out_1",displayField:"id_queue_out_1_name"},{xtype:"siplookup",name:"id_sip_out_1",displayField:"id_sip_out_1_name"},{xtype:"textfield",name:"extension_out_1"}]},{fieldLabel:t("option")+" 2",items:[{name:"type_out_2",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_2",displayField:"id_ivr_out_2_name"},{xtype:"queuelookup",name:"id_queue_out_2",displayField:"id_queue_out_2_name"},{xtype:"siplookup",name:"id_sip_out_2",displayField:"id_sip_out_2_name"},{xtype:"textfield",name:"extension_out_2"}]},{fieldLabel:t("option")+" 3",items:[{name:"type_out_3",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_3",displayField:"id_ivr_out_3_name"},{xtype:"queuelookup",name:"id_queue_out_3",displayField:"id_queue_out_3_name"},{xtype:"siplookup",name:"id_sip_out_3",displayField:"id_sip_out_3_name"},{xtype:"textfield",name:"extension_out_3"}]},{fieldLabel:t("option")+" 4",items:[{name:"type_out_4",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_4",displayField:"id_ivr_out_4_name"},{xtype:"queuelookup",name:"id_queue_out_4",displayField:"id_queue_out_4_name"},{xtype:"siplookup",name:"id_sip_out_4",displayField:"id_sip_out_4_name"},{xtype:"textfield",name:"extension_out_4"}]},{fieldLabel:t("option")+" 5",items:[{name:"type_out_5",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_5",displayField:"id_ivr_out_5_name"},{xtype:"queuelookup",name:"id_queue_out_5",displayField:"id_queue_out_5_name"},{xtype:"siplookup",name:"id_sip_out_5",displayField:"id_sip_out_5_name"},{xtype:"textfield",name:"extension_out_5"}]},{fieldLabel:t("option")+" 6",items:[{name:"type_out_6",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_6",displayField:"id_ivr_out_6_name"},{xtype:"queuelookup",name:"id_queue_out_6",displayField:"id_queue_out_6_name"},{xtype:"siplookup",name:"id_sip_out_6",displayField:"id_sip_out_6_name"},{xtype:"textfield",name:"extension_out_6"}]},{fieldLabel:t("option")+" 7",items:[{name:"type_out_7",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_7",displayField:"id_ivr_out_7_name"},{xtype:"queuelookup",name:"id_queue_out_7",displayField:"id_queue_out_7_name"},{xtype:"siplookup",name:"id_sip_out_7",displayField:"id_sip_out_7_name"},{xtype:"textfield",name:"extension_out_7"}]},{fieldLabel:t("option")+" 8",items:[{name:"type_out_8",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_8",displayField:"id_ivr_out_8_name"},{xtype:"queuelookup",name:"id_queue_out_8",displayField:"id_queue_out_8_name"},{xtype:"siplookup",name:"id_sip_out_8",displayField:"id_sip_out_8_name"},{xtype:"textfield",name:"extension_out_8"}]},{fieldLabel:t("option")+" 9",items:[{name:"type_out_9",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_9",displayField:"id_ivr_out_9_name"},{xtype:"queuelookup",name:"id_queue_out_9",displayField:"id_queue_out_9_name"},{xtype:"siplookup",name:"id_sip_out_9",displayField:"id_sip_out_9_name"},{xtype:"textfield",name:"extension_out_9"}]},{fieldLabel:t("option")+" default",items:[{name:"type_out_10",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_10",displayField:"id_ivr_out_10_name"},{xtype:"queuelookup",name:"id_queue_out_10",displayField:"id_queue_out_10_name"},{xtype:"siplookup",name:"id_sip_out_10",displayField:"id_sip_out_10_name"},{xtype:"textfield",name:"extension_out_10"}]}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["ivrform"],["component","box","container","panel","form","ivrform"],{component:true,box:true,container:true,panel:true,form:true,ivrform:true},["widget.ivrform"],0,[MBilling.view.ivr,"Form"],0));(Ext.cmd.derive("MBilling.view.ivr.Lookup",Ext.ux.form.field.Lookup,{name:"id_ivr",fieldLabel:t("Ivr"),displayField:"idIvrname",displayFieldList:"name",gridConfig:{xtype:"ivrlist",fieldSearch:"name",columns:[{header:t("name"),dataIndex:"name",flex:5},{header:t("user"),dataIndex:"idUsernumber",filter:{type:"string",field:"idUser.username"},flex:4}]}},0,["ivrlookup"],["component","box","container","fieldcontainer","ivrlookup"],{component:true,box:true,container:true,fieldcontainer:true,ivrlookup:true},["widget.ivrlookup"],0,[MBilling.view.ivr,"Lookup"],0));(Ext.cmd.derive("MBilling.view.queue.Controller",Ext.ux.app.ViewController,{isSubmitForm:true,init:function(){var b=this;b.control({"combobox[name=ring_or_moh]":{select:b.onSelectringOrMOH}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectringOrMOH:function(c,d){me=this,form=me.formPanel.getForm();form.findField("musiconhold").setVisible(d.data.field1=="moh")},onNew:function(){var b=this;b.formPanel.getForm().findField("musiconhold").setVisible(true);Ext.ux.app.ViewController.prototype.onNew.apply(this,arguments)},onEdit:function(){var b=this;Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments);ringOrMoh=b.formPanel.getForm().findField("ring_or_moh").getValue();b.formPanel.getForm().findField("musiconhold").setVisible(ringOrMoh=="moh")},onResetQueueStats:function(m){var j=this,f=j.list.getSelectionModel().getSelection()[0],l=Ext.encode(j.list.filters.getFilterData()),g=[];if(f){Ext.each(j.list.getSelectionModel().getSelection(),function(a){g.push(a.get(j.idProperty))});Ext.Ajax.request({url:"index.php/queue/resetQueueStats",params:{ids:Ext.encode(g),filter:l},scope:j,success:function(b){b=Ext.decode(b.responseText);if(b[j.nameSuccessRequest]){Ext.ux.Alert.alert(j.titleSuccess,b.msg,"success")}else{var a=Helper.Util.convertErrorsJsonToString(b[j.nameMsgRequest]);Ext.ux.Alert.alert(j.titleError,a,"notification")}}})}else{Ext.ux.Alert.alert(j.titleError,t("Please select one or more queue"),"notification")}},onDeleteMusic:function(e){var f=this,d=f.list.getSelectionModel().getSelection()[0];if(f.list.getSelectionModel().getSelection().length==1){Ext.Ajax.request({url:"index.php/queue/deleteMusicOnHold",params:{id_queue:d.get("id")},scope:f,success:function(a){a=Ext.decode(a.responseText);if(a[f.nameSuccessRequest]){Ext.ux.Alert.alert(f.titleSuccess,a[f.nameMsgRequest],"success")}else{Ext.ux.Alert.alert(f.titleError,a[f.nameMsgRequest],"error")}}})}else{Ext.ux.Alert.alert(f.titleError,"Please Select only a record","notification")}}},0,0,0,0,["controller.queue"],0,[MBilling.view.queue,"Controller"],0));(Ext.cmd.derive("MBilling.view.queue.Combo",Ext.form.field.ComboBox,{fieldLabel:t("status"),value:"ringall",forceSelection:true,editable:false,store:[["ringall",t("Ringall")+" - "+t("ring all available channels until one answers")],["rrmemory",t("Rrmemory")+" - "+t("round robin with memory, remember where we left off last ring pass")],["leastrecent",t("Leastrecent")+" - "+t("ring interface which was least recently called by this queue")],["fewestcalls",t("Fewestcalls")+" - "+t("ring the one with fewest completed calls from this queue")],["random",t("Random")+" -"+t("ring random interface")],["linear",t("Linear")+" - "+t("Rings interfaces in the order they are listed in the configuration file. Dynamic members will be rung in the order in which they were added")],["wrandom",t("Wrandom")+" -"+t("Rings a random interface, but uses the agent's penalty as a weight")]]},0,["queuestrategycombo"],["component","box","field","textfield","pickerfield","combobox","combo","queuestrategycombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,queuestrategycombo:true},["widget.queuestrategycombo"],0,[MBilling.view.queue,"Combo"],0));(Ext.cmd.derive("MBilling.view.queue.Module",Ext.ux.panel.Module,{controller:"queue"},0,["queuemodule"],["component","box","container","uxpanelmodule","queuemodule"],{component:true,box:true,container:true,uxpanelmodule:true,queuemodule:true},["widget.queuemodule"],0,[MBilling.view.queue,"Module"],0));(Ext.cmd.derive("MBilling.view.queue.List",Ext.ux.grid.Panel,{store:"Queue",initComponent:function(){var b=this;b.buttonCsv=false;b.allowPrint=false;b.buttonUpdateLot=false;b.extraButtons=[{text:t("Reset Queue Stats"),iconCls:"call",handler:"onResetQueueStats",disabled:false,hidden:!App.user.isAdmin},{text:t("Delete Musiconhold"),iconCls:"call",handler:"onDeleteMusic",disabled:false,hidden:!App.user.isAdmin}];b.columns=b.columns||[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("name"),dataIndex:"name",flex:4},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("Strategy"),dataIndex:"strategy",flex:4},{header:t("Talk Time"),dataIndex:"var_talktime",flex:3},{header:t("Total Calls"),dataIndex:"var_totalCalls",flex:3},{header:t("Answered"),dataIndex:"var_answeredCalls",flex:3}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["queuelist"],["component","box","container","panel","tablepanel","gridpanel","grid","queuelist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,queuelist:true},["widget.queuelist"],0,[MBilling.view.queue,"List"],0));(Ext.cmd.derive("MBilling.view.queue.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["id_user","name"],fileUpload:true,initComponent:function(){var b=this;b.labelWidthFields=160;b.items=[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"name",fieldLabel:t("name")},{xtype:"languagecombo",name:"language",value:App.user.language=="pt_BR"?"br":App.user.language,fieldLabel:t("language")},{xtype:"queuestrategycombo",name:"strategy",fieldLabel:t("Strategy")},{xtype:"yesnostringcombo",name:"ringinuse",fieldLabel:t("Ringinuse")},{xtype:"numberfield",name:"timeout",fieldLabel:t("Ring Agent per"),value:30},{xtype:"numberfield",name:"retry",fieldLabel:t("Retry other agent"),value:1},{xtype:"numberfield",name:"wrapuptime",fieldLabel:t("Time next calls"),value:1},{xtype:"numberfield",name:"weight",fieldLabel:t("Weigh"),value:0},{name:"periodic-announce",fieldLabel:t("Periodic announce"),value:"queue-periodic-announce"},{xtype:"numberfield",name:"periodic-announce-frequency",fieldLabel:t("Periodic frequency"),value:30},{xtype:"yesnostringcombo",name:"announce-position",fieldLabel:t("Announce position")},{xtype:"yesnostringcombo",name:"announce-holdtime",fieldLabel:t("Announce Holdtime")},{xtype:"numberfield",name:"announce-frequency",fieldLabel:t("Announce Frequency"),value:45},{xtype:"combobox",forceSelection:true,editable:false,value:"yes",store:[["no",t("No")],["yes",t("Yes")],["unavailable,invalid,unknown",t("unavailable,invalid,unknown")],["penalty,paused,invalid,unavailable",t("penalty,paused,invalid,unavailable")]],name:"joinempty",fieldLabel:t("Join empty")},{xtype:"combobox",forceSelection:true,editable:false,value:"no",store:[["no",t("No")],["yes",t("Yes")],["unavailable,invalid,unknown",t("unavailable,invalid,unknown")],["penalty,paused,invalid,unavailable",t("penalty,paused,invalid,unavailable")]],fieldLabel:t("Leave when empty"),name:"leavewhenempty"},{xtype:"combobox",forceSelection:true,editable:false,value:"moh",store:[["moh",t("MOH")],["ring",t("Ring")]],fieldLabel:t("Ring or playing MOH"),name:"ring_or_moh"},{xtype:"uploadfield",fieldLabel:t("Audio")+" "+t("musiconhold"),emptyText:t("Select an wav mono 8khz or gsm File"),allowBlank:true,name:"musiconhold",extAllowed:["wav","gsm"]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["queueform"],["component","box","container","panel","form","queueform"],{component:true,box:true,container:true,panel:true,form:true,queueform:true},["widget.queueform"],0,[MBilling.view.queue,"Form"],0));(Ext.cmd.derive("MBilling.view.queue.Lookup",Ext.ux.form.field.Lookup,{name:"id_queue",fieldLabel:t("Queue"),displayField:"idQueuename",displayFieldList:"name",gridConfig:{xtype:"queuelist",fieldSearch:"name",columns:[{header:t("name"),dataIndex:"name",flex:2}]}},0,["queuelookup"],["component","box","container","fieldcontainer","queuelookup"],{component:true,box:true,container:true,fieldcontainer:true,queuelookup:true},["widget.queuelookup"],0,[MBilling.view.queue,"Lookup"],0));(Ext.cmd.derive("MBilling.view.queue.ListDashboard",Ext.ux.grid.Panel,{store:"QueueDashBoard",refreshTime:5,selType:"rowmodel",initComponent:function(){var b=this;b.refreshTime=(localStorage&&localStorage.getItem("queuerefresh"))||b.refreshTime;b.extraButtons=[{text:t("Spy")+" "+t("call"),iconCls:"call",handler:function(a){module=b.getView();console.log(module.panel.items.items[0].getSelectionModel().getSelection());Ext.widget("callonlinespycall",{title:module.titleModule,list:module.panel.items.items[0]})},width:130,disabled:false,hidden:!window.multSpy},{xtype:"numberfield",field:"jmlhBrg",fieldLabel:t("Refresh Time"),editable:false,minValue:5,labelWidth:90,width:150,selectOnFocus:true,allowDecimals:true,decimalPrecision:2,value:b.refreshTime,listeners:{change:function(a){if(a.value>0){b.refreshTime=a.value;localStorage.setItem("queuerefresh",a.value)}}}}];b.columns=[{header:t("Channel"),hidden:true,dataIndex:"channel",flex:3},{header:t("Queue"),dataIndex:"queue_name",flex:3},{header:t("Agent"),dataIndex:"agentName",flex:3},{header:t("status"),dataIndex:"status",renderer:Helper.Util.formatQueueState,flex:4},{header:t("CallerID"),dataIndex:"callerId",flex:4},{header:t("Duration"),dataIndex:"duration",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Wait Time"),dataIndex:"holdtime",renderer:Helper.Util.formatsecondsToTime,flex:3}];b.sessionLoad=Ext.create("Ext.util.DelayedTask",function(){b.store.load()},b);Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments);b.store.on("load",b.onLoadStore,b)},onLoadStore:function(){var b=this;b.onDeactivateModule();b.onActivateModule()},onRender:function(){var b=this;if(Ext.isObject(b.module)){b.module.on("activate",b.onActivateModule,b);b.module.on("deactivate",b.onDeactivateModule,b);b.module.on("close",b.onCloseModule,b)}Ext.ux.grid.Panel.prototype.onRender.apply(this,arguments)},onActivateModule:function(){this.sessionLoad&&this.sessionLoad.delay(this.refreshTime*1000)},onDeactivateModule:function(){this.sessionLoad&&this.sessionLoad.cancel()},onCloseModule:function(){this.onDeactivateModule();this.sessionLoad=null}},0,["queuedashboardlist"],["component","box","container","panel","tablepanel","gridpanel","grid","queuedashboardlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,queuedashboardlist:true},["widget.queuedashboardlist"],0,[MBilling.view.queue,"ListDashboard"],0));(Ext.cmd.derive("MBilling.view.queueMember.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.queuemember"],0,[MBilling.view.queueMember,"Controller"],0));(Ext.cmd.derive("MBilling.view.queueMember.Module",Ext.ux.panel.Module,{controller:"queuemember"},0,["queuemembermodule"],["component","box","container","uxpanelmodule","queuemembermodule"],{component:true,box:true,container:true,uxpanelmodule:true,queuemembermodule:true},["widget.queuemembermodule"],0,[MBilling.view.queueMember,"Module"],0));(Ext.cmd.derive("MBilling.view.queueMember.List",Ext.ux.grid.Panel,{store:"QueueMember",initComponent:function(){var b=this;b.columns=[{header:t("Uniqueid"),dataIndex:"uniqueid",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("destination"),dataIndex:"interface",flex:4},{header:t("queues"),dataIndex:"queue_name",flex:4},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("paused"),dataIndex:"paused",renderer:Helper.Util.formattyyesno,filter:{type:"list",options:[[0,t("no")],[1,t("yes")]]},flex:2}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["queuememberlist"],["component","box","container","panel","tablepanel","gridpanel","grid","queuememberlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,queuememberlist:true},["widget.queuememberlist"],0,[MBilling.view.queueMember,"List"],0));(Ext.cmd.derive("MBilling.view.queueMember.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["id_user","queue_name"],initComponent:function(){var b=this;b.items=[{xtype:"queuelookup",ownerForm:b,displayField:"queue_name",name:"queue_name",hidden:App.user.isClient,allowBlank:App.user.isClient},{xtype:"siplookup",ownerForm:b,name:"interface",displayField:"interface"},{xtype:"noyescombo",name:"paused",fieldLabel:t("paused"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["queuememberform"],["component","box","container","panel","form","queuememberform"],{component:true,box:true,container:true,panel:true,form:true,queuememberform:true},["widget.queuememberform"],0,[MBilling.view.queueMember,"Form"],0));(Ext.cmd.derive("MBilling.view.queueMember.ListDashboard",Ext.ux.grid.Panel,{store:"QueueMemberDashBoard",refreshTime:5,selType:"rowmodel",initComponent:function(){var b=this;b.refreshTime=(localStorage&&localStorage.getItem("queueagentrefresh"))||b.refreshTime;b.extraButtons=[{xtype:"numberfield",field:"jmlhBrg",fieldLabel:t("Refresh Time"),editable:false,minValue:5,labelWidth:90,width:150,selectOnFocus:true,allowDecimals:true,decimalPrecision:2,value:b.refreshTime,listeners:{change:function(a){if(a.value>0){b.refreshTime=a.value;localStorage.setItem("queueagentrefresh",a.value)}}}}];b.columns=[{header:t("Agent"),dataIndex:"agentName",flex:3},{header:t("Queue"),dataIndex:"idQueuename",flex:5},{header:t("Status"),dataIndex:"agentStatus",renderer:Helper.Util.formatQueueAgentState,flex:4},{header:t("Number"),dataIndex:"number",flex:4},{header:t("Calls"),dataIndex:"totalCalls",flex:2},{header:t("Last call"),dataIndex:"last_call",renderer:Helper.Util.formatsecondsToTime,flex:3}];b.sessionLoad=Ext.create("Ext.util.DelayedTask",function(){b.store.load()},b);Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments);if(window.isDesktop){b.store.load()}b.store.on("load",b.onLoadStore,b)},onLoadStore:function(){var b=this;b.onDeactivateModule();b.onActivateModule()},onRender:function(){var b=this;if(Ext.isObject(b.module)){b.module.on("activate",b.onActivateModule,b);b.module.on("deactivate",b.onDeactivateModule,b);b.module.on("close",b.onCloseModule,b)}Ext.ux.grid.Panel.prototype.onRender.apply(this,arguments)},onActivateModule:function(){this.sessionLoad&&this.sessionLoad.delay(this.refreshTime*1000)},onDeactivateModule:function(){this.sessionLoad&&this.sessionLoad.cancel()},onCloseModule:function(){this.onDeactivateModule();this.sessionLoad=null}},0,["queuememberdashboardlist"],["component","box","container","panel","tablepanel","gridpanel","grid","queuememberdashboardlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,queuememberdashboardlist:true},["widget.queuememberdashboardlist"],0,[MBilling.view.queueMember,"ListDashboard"],0));(Ext.cmd.derive("MBilling.view.refill.Controller",Ext.ux.app.ViewController,{aliasChart:"refillchart",onPrint:function(e){var f=this;if(App.user.isClient){var f=this,d=f.list.getSelectionModel().getSelection()[0];if(f.list.getSelectionModel().getSelection().length==1){console.log(d.data.description.indexOf("Send Credit "));if(d.data.description.indexOf("Send Credit ")!==-1){url="index.php/transferToMobile/printRefill/?id="+d.get("id");window.open(url)}else{Ext.ux.app.ViewController.prototype.onPrint.apply(this,arguments)}}else{Ext.ux.app.ViewController.prototype.onPrint.apply(this,arguments)}}else{Ext.ux.app.ViewController.prototype.onPrint.apply(this,arguments)}},onInvoice:function(e){var f=this;var f=this,d=f.list.getSelectionModel().getSelection()[0];if(f.list.getSelectionModel().getSelection().length==1){url="index.php/invoices/printInvoice/?id="+d.get("id");window.open(url)}else{Ext.ux.Alert.alert(f.titleError,t("Not available to multi refill."),"error")}},onSelectionChange:function(f,e){var j=this,g=j.lookupReference("invoice");g&&g.setDisabled(!e.length);Ext.ux.app.ViewController.prototype.onSelectionChange.apply(this,arguments)},onRenderModule:function(){var c=this,d=c.lookupReference("chart");Ext.ux.app.ViewController.prototype.onRenderModule.apply(this,arguments);if(App.user.isAdmin){c.store.on({scope:c,beforeload:function(){d.el&&d.disable()},load:function(a){d.el&&d.enable();c.onSetTotal()}})}else{c.store.on({scope:c,load:function(a){c.onSetTotal()}})}},onChart:function(){var b=this;b.chart=Ext.widget("window",{title:t("charts"),iconCls:"icon-chart-column",layout:"fit",autoShow:true,modal:true,resizable:false,width:window.isThemeNeptune?740:710,items:{xtype:b.aliasChart}});b.chart.down("#tbTextSum").setText(""+t("total")+": "+App.user.currency+" "+b.sumData.sumCredit+"")},onSetTotal:function(c){var d=this;if(!d.store.getData().items[0]){return}d.sumData=d.store.getData().items[0].getData();if(!d.sumData){return}d.lookupReference("tbTextTotal")&&d.lookupReference("tbTextTotal").setText(""+t("Refill Total")+": "+App.user.currency+" "+d.sumData.sumCredit+"")}},0,0,0,0,["controller.refill"],0,[MBilling.view.refill,"Controller"],0));(Ext.cmd.derive("MBilling.view.refill.Module",Ext.ux.panel.Module,{controller:"refill"},0,["refillmodule"],["component","box","container","uxpanelmodule","refillmodule"],{component:true,box:true,container:true,uxpanelmodule:true,refillmodule:true},["widget.refillmodule"],0,[MBilling.view.refill,"Module"],0));(Ext.cmd.derive("MBilling.view.refill.List",Ext.ux.grid.Panel,{store:"Refill",fieldSearch:"idUser.username",initComponent:function(){var b=this;b.buttonsTbar=[{xtype:"tbtext",reference:"tbTextTotal"}];if(App.user.isAdmin&&b.buttonCleanFilter){b.extraButtons=[{text:t("charts"),iconCls:"icon-chart-column",handler:"onChart",reference:"chart",disabled:true},{text:t("Invoice"),glyph:b.glyphPrint,handler:"onInvoice",reference:"invoice",hidden:!window.invoice,disabled:true}]}if(App.user.isClient){b.extraButtons=[{text:t("Invoice"),glyph:b.glyphPrint,handler:"onInvoice",reference:"invoice",hidden:!window.invoice,disabled:true}]}b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:3,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("credit"),dataIndex:"credit",renderer:Helper.Util.formatMoneyDecimal2,flex:2},{header:t("description"),dataIndex:"description",flex:5},{header:t("payment"),dataIndex:"payment",renderer:Helper.Util.formattyyesno,filter:{type:"list",options:[[0,t("no")],[1,t("yes")]]},flex:2},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"date",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["refilllist"],["component","box","container","panel","tablepanel","gridpanel","grid","refilllist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,refilllist:true},["widget.refilllist"],0,[MBilling.view.refill,"List"],0));(Ext.cmd.derive("MBilling.view.refill.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["id_user"],initComponent:function(){var b=this;b.items=[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient},{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,00",name:"credit",fieldLabel:t("credit"),readOnly:App.user.isClient},{xtype:"textareafield",name:"description",fieldLabel:t("description"),readOnly:App.user.isClient},{xtype:"yesnocombo",name:"payment",fieldLabel:t("add")+" "+t("payment"),hidden:App.user.isClient},{name:"invoice_number",fieldLabel:t("Invoice")+" "+t("number"),hidden:!window.invoice,allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["refillform"],["component","box","container","panel","form","refillform"],{component:true,box:true,container:true,panel:true,form:true,refillform:true},["widget.refillform"],0,[MBilling.view.refill,"Form"],0));(Ext.cmd.derive("Ext.ux.panel.Chart",Ext.panel.Panel,{rootData:undefined,positionLegendPie:"bottom",showLegendPie:true,widthTip:200,degressXLabel:0,fontLabel:"15px Arial",textBtnColumn:t("columns"),textBtnLine:t("lines"),textBtnBar:t("bars"),textBtnPie:t("pie"),iconBtnColumn:"icon-chart-column",iconBtnLine:"icon-chart-line",iconBtnBar:"icon-chart-bar",iconBtnPie:"icon-chart-pie",heightChart:400,charts:["column","bar","line","pie"],defaultChart:"column",limitCharLabelTip:25,bbarChart:[],tbarChart:[],minimumAxesY:0,border:false,layout:"card",btnShowColumn:true,btnShowBar:true,btnShowLine:true,btnShowPie:true,btnShowLineHidden:false,btnShowColumnHidden:false,showDownload:true,legend:null,titleText:"",fieldLabel:"",constructor:function(){var b=this;if(Ext.isString(b.store)){b.store=Ext.data.StoreManager.lookup(b.store);b.store.load({scope:b,callback:function(){if(b.store.getData().items[0]){b.sumData=b.store.getData().items[0].getData()}}})}Ext.panel.Panel.prototype.constructor.apply(this,arguments)},initComponent:function(){var s=this,x=s.charts.length,r,o,v,q,w=[],y=[],u=[],p,z;if(s.charts.length===1){s.defaultChart=s.charts[0]}s.fieldValue=Ext.isArray(s.fieldValue)?s.fieldValue:[s.fieldValue];if(s.rootData){p=Ext.getStore(s.store);z=p.model.proxy.reader.rawData;s.store=Ext.create("Ext.data.Store",{fields:Ext.Array.merge(s.fieldValue,s.fieldDescription),data:z&&z[s.rootData],proxy:{type:"memory",reader:{type:"json"}}});s.fieldValue=s.fieldValue[0].name||s.fieldValue[0];s.fieldDescription=s.fieldDescription.name||s.fieldDescription}Ext.each(s.fieldValue,function(a){u.push({type:"line",yField:a,xField:s.fieldDescription,marker:{radius:4},highlight:true,tooltip:{trackMouse:true,width:s.widthTip,renderer:s.rendererPie(s.fieldDescription,s.rendererFieldValue,s.rendererFieldDescription,s.limitCharLabelTip)}})});s.chartColumn={xtype:"cartesian",itemId:"column",height:s.heightChart,width:s.width,store:s.store,insetPadding:{top:s.titleText.length>0?40:10},axes:[{type:"numeric",title:s.labelYLine,position:"left",grid:true,minimum:s.minimumAxesY,renderer:s.rendererFieldValue||s.rendererDefault},{type:"category",title:s.labelXLine,position:"bottom",grid:true,renderer:s.rendererFieldDescription||s.rendererDefault,label:{rotate:{degrees:s.degressXLabel}}}],series:[{type:"bar",axis:"left",yField:s.fieldValue,xField:s.fieldDescription,highlight:true,tooltip:{width:s.widthTip,renderer:s.rendererPie(s.fieldDescription,s.rendererFieldValue,s.rendererFieldDescription,s.limitCharLabelTip)},label:{hidden:s.fieldLabel.length<1,field:s.fieldLabel,display:"insideEnd"}}],sprites:{hidden:s.titleText.length<1,type:"text",text:s.titleText,fontSize:22,width:100,height:30,x:40,y:20}};s.chartBar={xtype:"cartesian",itemId:"bar",height:s.heightChart,width:s.width,store:s.store,flipXY:true,insetPadding:{top:s.titleText.length>0?40:10},axes:[{type:"numeric",title:s.labelYLine,position:"bottom",fields:s.fieldValue,grid:true,minimum:s.minimumAxesY,renderer:s.rendererFieldValue||s.rendererDefault},{type:"category",title:s.labelXLine,position:"left",fields:s.fieldDescription,grid:true,renderer:s.rendererFieldDescription||s.rendererDefault}],series:[{type:"bar",yField:s.fieldValue,xField:s.fieldDescription,highlight:true,tooltip:{width:s.widthTip,renderer:s.rendererPie(s.fieldDescription,s.rendererFieldValue,s.rendererFieldDescription,s.limitCharLabelTip)},label:{hidden:s.fieldLabel.length<1,field:s.fieldLabel,display:"insideEnd"}}],sprites:{hidden:s.titleText.length<1,type:"text",text:s.titleText,fontSize:22,width:100,height:30,x:40,y:20}};s.chartLine={xtype:"cartesian",itemId:"line",height:s.heightChart,width:s.width,store:s.store,legend:s.legend,axes:[{type:"numeric",title:s.labelYLine,position:"left",fields:s.fieldValue,grid:true,minimum:s.minimumAxesY,renderer:s.rendererFieldValue||s.rendererDefault},{type:"category",title:s.labelXLine,position:"bottom",grid:true,fields:s.fieldDescription,renderer:s.rendererFieldDescription||s.rendererDefault}],series:u};s.chartPie={xtype:"polar",itemId:"pie",height:s.heightChart,width:s.width,store:s.store,legend:{position:s.positionLegendPie,renderer:s.rendererFieldDescription},series:[{type:"pie",angleField:s.fieldValue[0],showInLegend:s.showLegendPie,tooltip:{trackMouse:true,width:s.widthTip,renderer:s.rendererPie(s.fieldDescription,s.rendererFieldValue,s.rendererFieldDescription,s.limitCharLabelTip)},highlight:{segment:{margin:20}},label:{field:s.fieldDescription,display:"rotate",contrast:true,font:s.fontLabel,renderer:s.rendererFieldDescription||s.rendererDefault}}]};if(s.btnShowColumn){r={chart:"column",text:s.textBtnColumn,iconCls:s.iconBtnColumn,hidden:s.btnShowColumnHidden}}if(s.btnShowBar){o={chart:"bar",text:s.textBtnBar,iconCls:s.iconBtnBar}}if(s.btnShowLine){v={chart:"line",text:s.textBtnLine,iconCls:s.iconBtnLine,hidden:s.btnShowLineHidden}}if(s.btnShowPie){q={chart:"pie",text:s.textBtnPie,iconCls:s.iconBtnPie}}if(Ext.Array.contains(s.charts,"column")){w.push(s.chartColumn);y.push(r)}if(Ext.Array.contains(s.charts,"bar")){w.push(s.chartBar);y.push(o)}if(Ext.Array.contains(s.charts,"line")){w.push(s.chartLine);y.push(v)}if(Ext.Array.contains(s.charts,"pie")){w.push(s.chartPie);y.push(q)}s.bbarChart.push("->",{xtype:"buttongroup",toggleGroup:"typeChart",defaults:{enableToggle:true,allowDepress:false,toggleGroup:"typeChart",listeners:{scope:s,toggle:s.activeChart}},items:y});s.items=w;if(s.showDownload){s.tbarChart.push("->",{text:t("Download"),glyph:icons.disk,scope:s,handler:s.onDownload})}s.tbar=s.tbarChart;s.bbar=s.bbarChart;Ext.panel.Panel.prototype.initComponent.apply(this,arguments);s.activeItem=s.down("#"+s.defaultChart);s.down("button[chart="+s.defaultChart+"]").pressed=true},onDownload:function(){var b=this;b.getLayout().getActiveItem().download()},activeChart:function(d){var c=this;d.pressed&&c.getLayout().setActiveItem(c.down("#"+d.chart))},rendererPie:function(g,f,e,j){return function(a,o,c){var d=this,n=o.get(g),b=o.get(c.field);n=e?e(n):n;b=f?f(b):b;n=Ext.String.ellipsis(n,j)+": ";title=n+b;a.setHtml(title)}},rendererDefault:function(c,d){return d},rendererLegend:function(b){return t(b)}},1,["chartpanel"],["component","box","container","panel","chartpanel"],{component:true,box:true,container:true,panel:true,chartpanel:true},["widget.chartpanel"],0,[Ext.ux.panel,"Chart"],0));(Ext.cmd.derive("MBilling.view.refill.Chart",Ext.ux.panel.Chart,{controller:"refill",store:"RefillChart",fieldValue:"sumCreditMonth",fieldDescription:"CreditMonth",labelYLine:t("credit"),labelXLine:t("Month"),reference:"refillchart",btnShowColumn:true,btnShowBar:false,btnShowLine:false,btnShowPie:false,btnShowColumnHidden:true,initComponent:function(){var d=this,c;d.rendererFieldValue=Ext.util.Format.numberRenderer("0"),d.tbarChart=[{text:t("Per")+" "+t("Month"),scope:d,handler:"onPerMonth",reference:"btnMonth",disabled:true},{text:t("Per")+" "+t("day"),scope:d,handler:"onPerDay",reference:"btnDay"}];d.bbarChart=[{xtype:"tbtext",itemId:"tbTextSum"}];Ext.ux.panel.Chart.prototype.initComponent.apply(this,arguments)},onPerMonth:function(d){var c=this;c.lookupReference("btnMonth").disable();c.lookupReference("btnDay").enable();c.store.setRemoteFilter(true);c.store.filter("type","month");c.store.load()},onPerDay:function(d){var c=this;c.lookupReference("btnDay").disable();c.lookupReference("btnMonth").enable();c.store.setRemoteFilter(true);c.store.filter("type","day");c.store.load()}},0,["refillchart"],["component","box","container","panel","chartpanel","refillchart"],{component:true,box:true,container:true,panel:true,chartpanel:true,refillchart:true},["widget.refillchart"],0,[MBilling.view.refill,"Chart"],0));(Ext.cmd.derive("MBilling.view.methodPay.Controller",Ext.ux.app.ViewController,{init:function(){var b=this;b.control({methodpaycombo:{select:b.onSelectMethod}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectMethod:function(c,d){showFields=d.getData().showFields.split(",");this.showFieldsRelated(showFields)},showFieldsRelated:function(f){var d=this,e=d.formPanel.getForm().getFields();e.each(function(a){a.setVisible(f.indexOf(a.name)!==-1)})},onEdit:function(){var c=this,d=c.list.getSelectionModel().getSelection()[0];method=d?d.get("payment_method"):"Moip";showFields=c.formPanel.down("methodpaycombo").store.findRecord("payment_method",method).getData().showFields;showFields=showFields.split(",");c.showFieldsRelated(showFields);Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)},onNew:function(){var c=this,d=c.list.getSelectionModel().getSelection()[0];method="Moip";showFields=c.formPanel.down("methodpaycombo").store.findRecord("payment_method",method).getData().showFields;showFields=showFields.split(",");c.showFieldsRelated(showFields);Ext.ux.app.ViewController.prototype.onNew.apply(this,arguments)}},0,0,0,0,["controller.methodpay"],0,[MBilling.view.methodPay,"Controller"],0));(Ext.cmd.derive("MBilling.view.methodPay.Module",Ext.ux.panel.Module,{controller:"methodpay"},0,["methodpaymodule"],["component","box","container","uxpanelmodule","methodpaymodule"],{component:true,box:true,container:true,uxpanelmodule:true,methodpaymodule:true},["widget.methodpaymodule"],0,[MBilling.view.methodPay,"Module"],0));(Ext.cmd.derive("MBilling.view.methodPay.List",Ext.ux.grid.Panel,{store:"MethodPay",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("paymentmethods"),dataIndex:"payment_method",flex:2},{header:t("country"),dataIndex:"country",flex:2},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:2},{header:t("active"),dataIndex:"active",flex:1,comboRelated:"booleancombo",renderer:Helper.Util.formatBooleanActive,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")]]}}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["methodpaylist"],["component","box","container","panel","tablepanel","gridpanel","grid","methodpaylist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,methodpaylist:true},["widget.methodpaylist"],0,[MBilling.view.methodPay,"List"],0));(Ext.cmd.derive("MBilling.view.methodPay.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{xtype:"methodpaycombo",name:"payment_method",valueField:"payment_method",fieldLabel:t("paymentmethods")},{name:"show_name",fieldLabel:t("showName")},{xtype:"userlookup",ownerForm:b,name:"id_user"},{xtype:"paymentcountrycombo",name:"country",fieldLabel:t("country")},{xtype:"booleancombo",name:"active",fieldLabel:t("active")},{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,00",name:"min",value:10,fieldLabel:t("Min amount")},{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,00",name:"max",value:500,fieldLabel:t("Max amount")},{name:"username",fieldLabel:t("Username"),allowBlank:true},{name:"url",fieldLabel:"Url",allowBlank:true},{xtype:"noyescombo",name:"fee",fieldLabel:t("Discount")+" "+t("Fee"),allowBlank:true},{xtype:"paymentbanckcombo",name:"boleto_banco",fieldLabel:t("Bank"),allowBlank:true},{name:"boleto_convenio",fieldLabel:t("numeroconvenio"),allowBlank:true},{name:"boleto_agencia",fieldLabel:t("agencia"),allowBlank:true},{name:"boleto_conta_corrente",fieldLabel:t("contacorrente"),allowBlank:true},{name:"boleto_inicio_nosso_numeroa",fieldLabel:t("Inicio nosso nº"),allowBlank:true},{name:"boleto_carteira",fieldLabel:t("carteira"),allowBlank:true},{name:"boleto_taxa",fieldLabel:t("taxa"),allowBlank:true},{name:"boleto_instrucoes",fieldLabel:t("instructions"),maxLength:"100",allowBlank:true},{name:"boleto_nome_emp",fieldLabel:t("company"),allowBlank:true},{name:"boleto_end_emp",fieldLabel:t("address"),allowBlank:true},{name:"boleto_cidade_emp",fieldLabel:t("city"),allowBlank:true},{name:"boleto_estado_emp",fieldLabel:t("state"),allowBlank:true},{name:"boleto_cpf_emp",fieldLabel:"CNPJ CPF",allowBlank:true},{name:"pagseguro_TOKEN",fieldLabel:"TOKEN",allowBlank:true},{name:"P2P_CustomerSiteID",fieldLabel:t("P2P CustomerSiteID"),allowBlank:true},{name:"P2P_KeyID",fieldLabel:t("P2P KeyID"),allowBlank:true},{name:"P2P_Passphrase",fieldLabel:t("P2P Passphrase"),allowBlank:true},{name:"P2P_RecipientKeyID",fieldLabel:t("P2P RecipientKeyID"),allowBlank:true},{name:"P2P_tax_amount",fieldLabel:t("P2P Tax Amount"),allowBlank:true},{name:"client_id",fieldLabel:t("Client id"),allowBlank:true},{name:"client_secret",fieldLabel:t("Client Secret"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["methodpayform"],["component","box","container","panel","form","methodpayform"],{component:true,box:true,container:true,panel:true,form:true,methodpayform:true},["widget.methodpayform"],0,[MBilling.view.methodPay,"Form"],0));(Ext.cmd.derive("MBilling.view.methodPay.Combo",Ext.form.field.ComboBox,{name:"id_methodpay",fieldLabel:t("methodPay"),displayField:"show_name",valueField:"id",forceSelection:true,editable:false,initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.MethodPay",{proxy:{type:"uxproxy",module:"methodpay",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["methodpaycombo"],["component","box","field","textfield","pickerfield","combobox","combo","methodpaycombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,methodpaycombo:true},["widget.methodpaycombo"],0,[MBilling.view.methodPay,"Combo"],0));(Ext.cmd.derive("MBilling.view.voucher.Controller",Ext.ux.app.ViewController,{onSave:function(){var b=this;Ext.ux.app.ViewController.prototype.onSave.apply(this,arguments);b.formPanel.setLoading(false);b.saveButton.enable();b.store.load()}},0,0,0,0,["controller.voucher"],0,[MBilling.view.voucher,"Controller"],0));(Ext.cmd.derive("MBilling.view.voucher.Module",Ext.ux.panel.Module,{controller:"voucher"},0,["vouchermodule"],["component","box","container","uxpanelmodule","vouchermodule"],{component:true,box:true,container:true,uxpanelmodule:true,vouchermodule:true},["widget.vouchermodule"],0,[MBilling.view.voucher,"Module"],0));(Ext.cmd.derive("MBilling.view.voucher.List",Ext.ux.grid.Panel,{store:"Voucher",initComponent:function(){var b=this;b.buttonCsv=false;b.allowPrint=false;b.buttonUpdateLot=false;b.allowUpdate=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:3,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("credit"),dataIndex:"credit",renderer:Helper.Util.formatMoneyDecimal,filter:{type:"int",field:"t.credit"},flex:3},{header:t("voucher"),dataIndex:"voucher",flex:5},{header:t("description"),dataIndex:"tag",flex:3,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("usedate"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"usedate",flex:4},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"creationdate",flex:4,hidden:App.user.isClient,hideable:!App.user.isClient}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["voucherlist"],["component","box","container","panel","tablepanel","gridpanel","grid","voucherlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,voucherlist:true},["widget.voucherlist"],0,[MBilling.view.voucher,"List"],0));(Ext.cmd.derive("MBilling.view.voucher.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;if(!App.user.isClient){b.fieldsHideEdit=["quantity"]}if(App.user.isClient){b.textNew=t("Insert Voucher");b.buttonNewWidth=150}b.items=[{xtype:"moneyfield",name:"credit",fieldLabel:t("credit"),hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"id_plan",fieldLabel:t("Plan"),xtype:"plancombo",hidden:!App.user.isAdmin,allowBlank:!App.user.isAdmin},{xtype:"languagecombo",name:"language",fieldLabel:t("language"),hidden:!App.user.isAdmin,allowBlank:!App.user.isAdmin},{name:"prefix_local",fieldLabel:t("prefixlocal"),value:App.user.base_country=="BRL"?"0/55,*/5511/8,*/5511/9":App.user.base_country=="ARG"?"0/54,*/5411/8,15/54911/10,16/54911/10":"",emptyText:"match / replace / length",hidden:!App.user.isAdmin,allowBlank:true},{xtype:"numberfield",name:"quantity",fieldLabel:t("Quantity"),hidden:!App.user.isAdmin,allowBlank:!App.user.isAdmin,value:10},{name:"tag",fieldLabel:t("description"),hidden:App.user.isClient,allowBlank:true},{xtype:"numberfield",name:"voucher",fieldLabel:t("voucher"),value:"",maxLength:6,minLength:6,hidden:!App.user.isClient,allowBlank:!App.user.isClient}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["voucherform"],["component","box","container","panel","form","voucherform"],{component:true,box:true,container:true,panel:true,form:true,voucherform:true},["widget.voucherform"],0,[MBilling.view.voucher,"Form"],0));(Ext.cmd.derive("MBilling.view.refillprovider.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.refillprovider"],0,[MBilling.view.refillprovider,"Controller"],0));(Ext.cmd.derive("MBilling.view.refillprovider.Module",Ext.ux.panel.Module,{controller:"refillprovider"},0,["refillprovidermodule"],["component","box","container","uxpanelmodule","refillprovidermodule"],{component:true,box:true,container:true,uxpanelmodule:true,refillprovidermodule:true},["widget.refillprovidermodule"],0,[MBilling.view.refillprovider,"Module"],0));(Ext.cmd.derive("MBilling.view.refillprovider.List",Ext.ux.grid.Panel,{store:"Refillprovider",initComponent:function(){var b=this;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{xtype:"templatecolumn",tpl:"{idProviderprovider_name}",header:t("provider"),dataIndex:"id_provider",comboFilter:"providercombo",flex:2},{header:t("credit"),dataIndex:"credit",renderer:Helper.Util.formatMoneyDecimal,flex:2},{header:t("description"),dataIndex:"description",flex:4},{header:t("payment"),dataIndex:"payment",renderer:Helper.Util.formattyyesno,filter:{type:"list",options:[[0,t("no")],[1,t("yes")]]},flex:2},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"date",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["refillproviderlist"],["component","box","container","panel","tablepanel","gridpanel","grid","refillproviderlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,refillproviderlist:true},["widget.refillproviderlist"],0,[MBilling.view.refillprovider,"List"],0));(Ext.cmd.derive("MBilling.view.refillprovider.Form",Ext.ux.form.Panel,{bodyPadding:0,fieldsHideUpdateLot:["id_provider"],initComponent:function(){var b=this;b.items=[{xtype:"providercombo"},{xtype:"moneyfield",name:"credit",fieldLabel:t("credit")},{xtype:"textareafield",name:"description",fieldLabel:t("description"),allowBlank:true},{xtype:"yesnocombo",name:"payment",fieldLabel:t("add")+" "+t("payment"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["refillproviderform"],["component","box","container","panel","form","refillproviderform"],{component:true,box:true,container:true,panel:true,form:true,refillproviderform:true},["widget.refillproviderform"],0,[MBilling.view.refillprovider,"Form"],0));(Ext.cmd.derive("MBilling.view.boleto.Controller",Ext.ux.app.ViewController,{onAfterSave:function(d){var c=this;if(c.formPanel.idRecord==0){url="index.php/boleto/secondVia/?id=last";window.open(url)}Ext.ux.app.ViewController.prototype.onAfterSave.apply(this,arguments)},onSecondVia:function(e){var f=this,d=f.list.getSelectionModel().getSelection()[0];if(f.list.getSelectionModel().getSelection().length==0){Ext.ux.Alert.alert(f.titleError,t("Por favor selecione um bolero"),"notification")}else{if(f.list.getSelectionModel().getSelection().length>1){Ext.ux.Alert.alert(f.titleError,t("Por favor selecione somente um bolero"),"notification")}else{url="index.php/boleto/secondVia/?id="+d.get("id");window.open(url)}}}},0,0,0,0,["controller.boleto"],0,[MBilling.view.boleto,"Controller"],0));(Ext.cmd.derive("MBilling.view.boleto.Module",Ext.ux.panel.Module,{controller:"boleto"},0,["boletomodule"],["component","box","container","uxpanelmodule","boletomodule"],{component:true,box:true,container:true,uxpanelmodule:true,boletomodule:true},["widget.boletomodule"],0,[MBilling.view.boleto,"Module"],0));(Ext.cmd.derive("MBilling.view.boleto.List",Ext.ux.grid.Panel,{store:"Boleto",iconButtonCsv:"boleto",textButtonCsv:t("Importar Retorno"),iconButtonImportCsv:"boleto",textButtonImportCsv:t("Importar Retorno"),initComponent:function(){var b=this;b.buttonCsv=false;b.buttonUpdateLot=false;b.buttonImportCsv=App.user.isAdmin;b.extraButtons=[{text:t("Segunda via"),iconCls:"boleto",handler:"onSecondVia",disabled:false}];b.columns=[{header:t("Nosso Número"),dataIndex:"id",flex:3,hidden:!App.user.isAdmin,hideable:App.user.isAdmin},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("value"),dataIndex:"payment",renderer:Helper.Util.formatMoneyDecimal,flex:4},{header:"Pago",dataIndex:"status",renderer:Helper.Util.formattyyesno,flex:2,filter:{type:"list",options:[[0,t("no")],[1,t("yes")]]}},{header:t("description"),dataIndex:"description",flex:5},{header:"Vencimento",renderer:Ext.util.Format.dateRenderer("Y-m-d"),dataIndex:"vencimento",flex:4},{header:"Gerado",renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"date",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["boletolist"],["component","box","container","panel","tablepanel","gridpanel","grid","boletolist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,boletolist:true},["widget.boletolist"],0,[MBilling.view.boleto,"List"],0));(Ext.cmd.derive("MBilling.view.boleto.Form",Ext.ux.form.Panel,{fieldsHideEdit:["cid"],initComponent:function(){var b=this;b.items=[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:App.user.isClient},{xtype:"moneyfield",name:"payment",fieldLabel:t("value"),readOnly:App.user.isClient},{xtype:"yesnocombo",name:"status",fieldLabel:t("Pago"),hidden:App.user.isClient,value:0},{xtype:"datefield",name:"vencimento",fieldLabel:"Vencimento",format:"Y-m-d H:i:s",hidden:App.user.isClient||App.user.isAgent},{xtype:"textareafield",name:"description",fieldLabel:t("description"),readOnly:App.user.isClient}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["boletoform"],["component","box","container","panel","form","boletoform"],{component:true,box:true,container:true,panel:true,form:true,boletoform:true},["widget.boletoform"],0,[MBilling.view.boleto,"Form"],0));(Ext.cmd.derive("Ext.ux.window.ImportBoleto",Ext.window.Window,{autoShow:true,modal:true,layout:"fit",iconCls:"boleto",title:t("Importa Retorno Boleto"),width:400,height:175,labelWidthFields:180,htmlTipInfo:"",fieldsImport:[],initComponent:function(){var d=this,c=Ext.Array.merge(d.fieldsImport,[{xtype:"uploadfield",fieldLabel:t("Selecion o arquivo .RET"),htmlTipInfo:d.htmlTipInfo}]);d.items=[{xtype:"form",bodyPadding:5,labelWidth:d.labelWidthFields,items:c}];d.title=d.title+(d.titleModule?" - "+d.titleModule:"");d.bbar=[{xtype:"tbtext",text:t("maxSizeFile")+"3 MB"},"->",{iconCls:"boleto",text:t("importText"),scope:d,handler:d.onImport}];Ext.window.Window.prototype.initComponent.apply(this,arguments)},onImport:function(d){var f=this,e=f.list.store;d.disable();f.list.setLoading(true);f.down("form").submit({url:"index.php/boleto/retorno",scope:f,success:function(c,b){var a=Ext.decode(b.response.responseText);if(a.success){Ext.ux.Alert.alert(t("Success"),a.msg,"success",true,false,40000)}else{Ext.ux.Alert.alert(t("Error"),a.errors,"error")}d.enable();f.list.setLoading(false);e.load();f.close()},failure:function(c,b){if(Ext.isObject(b.response.responseText)){var a=Ext.decode(b.response.responseText);Ext.ux.Alert.alert(t("Error"),a.errors,"error")}else{Ext.ux.Alert.alert(t("Error"),b.response.responseText,"error",true,10)}d.enable();f.list.setLoading(false);f.close()}})}},0,0,["component","box","container","panel","window"],{component:true,box:true,container:true,panel:true,window:true},0,0,[Ext.ux.window,"ImportBoleto"],0));(Ext.cmd.derive("MBilling.view.boleto.ImportCsv",Ext.ux.window.ImportBoleto,{title:t("Importar Retorno"),labelWidthFields:250,height:275,fieldsImport:[{xtype:"boletobanckcombo",name:"banco",fieldLabel:t("Banco"),width:350}]},0,["boletoimportcsv"],["component","box","container","panel","window","boletoimportcsv"],{component:true,box:true,container:true,panel:true,window:true,boletoimportcsv:true},["widget.boletoimportcsv"],0,[MBilling.view.boleto,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.offer.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.offer"],0,[MBilling.view.offer,"Controller"],0));(Ext.cmd.derive("MBilling.view.offer.Combo",Ext.form.field.ComboBox,{name:"id_offer",fieldLabel:t("offer"),displayField:"label",valueField:"id",value:0,extraValues:[{id:0,label:t("undefined")}],initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Offer",{proxy:{type:"uxproxy",module:"offer",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["offercombo"],["component","box","field","textfield","pickerfield","combobox","combo","offercombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,offercombo:true},["widget.offercombo"],0,[MBilling.view.offer,"Combo"],0));(Ext.cmd.derive("MBilling.view.offer.Module",Ext.ux.panel.Module,{controller:"offer"},0,["offermodule"],["component","box","container","uxpanelmodule","offermodule"],{component:true,box:true,container:true,uxpanelmodule:true,offermodule:true},["widget.offermodule"],0,[MBilling.view.offer,"Module"],0));(Ext.cmd.derive("MBilling.view.offer.List",Ext.ux.grid.Panel,{store:"Offer",initComponent:function(){var b=this;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("name"),dataIndex:"label",flex:1},{header:t("packagetype"),dataIndex:"packagetype",renderer:Helper.Util.formatPackageType,comboRelated:"offertypecombo",flex:1,filter:{type:"list",options:[[0,t("unlimitedcalls")],[1,t("numberfreecalls")],[2,t("freeseconds")]]}},{header:t("freetimetocall"),dataIndex:"freetimetocall",flex:1},{header:t("periode"),dataIndex:"billingtype",renderer:Helper.Util.formatBillingType,comboRelated:"billingtypecombo",flex:1,filter:{type:"list",options:[[0,t("monthly")],[1,t("weekly")]]}},{header:t("price"),dataIndex:"price",renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,hideable:App.user.isAdmin,flex:2},{header:t("creationdate"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"creationdate",flex:1}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["offerlist"],["component","box","container","panel","tablepanel","gridpanel","grid","offerlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,offerlist:true},["widget.offerlist"],0,[MBilling.view.offer,"List"],0));(Ext.cmd.derive("MBilling.view.offer.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["name"],items:[{name:"label",fieldLabel:t("name")},{xtype:"offertypecombo",name:"packagetype",fieldLabel:t("packagetype")},{name:"freetimetocall",fieldLabel:t("freetimetocall")},{xtype:"billingtypecombo",name:"billingtype",fieldLabel:t("periode")},{xtype:"moneyfield",name:"price",fieldLabel:t("price")}]},0,["offerform"],["component","box","container","panel","form","offerform"],{component:true,box:true,container:true,panel:true,form:true,offerform:true},["widget.offerform"],0,[MBilling.view.offer,"Form"],0));(Ext.cmd.derive("MBilling.view.offerCdr.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.offercdr"],0,[MBilling.view.offerCdr,"Controller"],0));(Ext.cmd.derive("MBilling.view.offerCdr.Module",Ext.ux.panel.Module,{controller:"offercdr"},0,["offercdrmodule"],["component","box","container","uxpanelmodule","offercdrmodule"],{component:true,box:true,container:true,uxpanelmodule:true,offercdrmodule:true},["widget.offercdrmodule"],0,[MBilling.view.offerCdr,"Module"],0));(Ext.cmd.derive("MBilling.view.offerCdr.List",Ext.ux.grid.Panel,{store:"OfferCdr",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"date_consumption",flex:3},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:3},{xtype:"templatecolumn",tpl:"{idOfferlabel}",header:t("offer"),dataIndex:"id_offer",comboFilter:"offercombo",flex:3},{header:t("duration"),dataIndex:"used_secondes",renderer:Helper.Util.formatsecondsToTime,flex:3}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["offercdrlist"],["component","box","container","panel","tablepanel","gridpanel","grid","offercdrlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,offercdrlist:true},["widget.offercdrlist"],0,[MBilling.view.offerCdr,"List"],0));(Ext.cmd.derive("MBilling.view.offerCdr.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.columns=[{xtype:"usercombo"},{xtype:"offercombo"},{name:"used_secondes",fieldLabel:t("usedsecondes")},{xtype:"datefield",name:"date_consumption",fieldLabel:t("date"),format:"Y-m-d H:i:s"}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["offercdrform"],["component","box","container","panel","form","offercdrform"],{component:true,box:true,container:true,panel:true,form:true,offercdrform:true},["widget.offercdrform"],0,[MBilling.view.offerCdr,"Form"],0));(Ext.cmd.derive("MBilling.view.offerUse.Module",Ext.ux.panel.Module,{controller:"offeruse"},0,["offerusemodule"],["component","box","container","uxpanelmodule","offerusemodule"],{component:true,box:true,container:true,uxpanelmodule:true,offerusemodule:true},["widget.offerusemodule"],0,[MBilling.view.offerUse,"Module"],0));(Ext.cmd.derive("MBilling.view.offerUse.List",Ext.ux.grid.Panel,{store:"OfferUse",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:3},{xtype:"templatecolumn",tpl:"{idOfferlabel}",header:t("offer"),dataIndex:"id_offer",comboFilter:"offercombo",flex:3},{header:t("monthpayed"),dataIndex:"month_payed",flex:3},{header:t("reservationdate"),renderer:Ext.util.Format.dateRenderer("Y-m-d"),dataIndex:"reservationdate",flex:3},{header:t("releasedate"),renderer:Ext.util.Format.dateRenderer("Y-m-d"),dataIndex:"releasedate",flex:3}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["offeruselist"],["component","box","container","panel","tablepanel","gridpanel","grid","offeruselist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,offeruselist:true},["widget.offeruselist"],0,[MBilling.view.offerUse,"List"],0));(Ext.cmd.derive("MBilling.view.offerUse.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{xtype:"userlookup",ownerForm:b,readOnly:true},{xtype:"offercombo",readOnly:true},{name:"month_payed",fieldLabel:t("monthpayed")},{xtype:"datefield",name:"reservationdate",fieldLabel:t("reservationdate"),format:"Y-m-d H:i:s"}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["offeruseform"],["component","box","container","panel","form","offeruseform"],{component:true,box:true,container:true,panel:true,form:true,offeruseform:true},["widget.offeruseform"],0,[MBilling.view.offerUse,"Form"],0));(Ext.cmd.derive("MBilling.view.campaign.Controller",Ext.ux.app.ViewController,{isSubmitForm:true,init:function(){var b=this;b.control({typecampaigndestinationcombo:{select:b.onSelectMethod}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectMethod:function(c,d){this.showFieldsRelated(d.getData().showFields)},showFieldsRelated:function(j){var l=this,m=l.formPanel.getForm(),g=l.formPanel.getForm().getFields(),f=Ext.get(Ext.Element.getActiveElement()).component;l.onSetVisibleFiel(f,m,f.value)},onSetVisibleFiel:function(e,d,f){if(e.value=="undefined"){e.setValue("undefined")}if(e.name.match("^type_0")){d.findField("id_queue_0").setVisible(f.match("^queue"));d.findField("id_sip_0").setVisible(f.match("^sip"));d.findField("id_ivr_0").setVisible(f.match("^ivr"));d.findField("extension_0").setVisible(f.match("^group|^number|^custom"))}},onEdit:function(){var f=this,d=f.formPanel.getForm(),e=f.list.getSelectionModel().getSelection()[0];if(e.getData()["type_0"]=="ivr"){d.findField("id_ivr_0").setVisible(true);d.findField("id_sip_0").setVisible(false);d.findField("id_queue_0").setVisible(false);d.findField("extension_0").setVisible(false)}else{if(e.getData()["type_0"]=="sip"){d.findField("id_sip_0").setVisible(true);d.findField("id_ivr_0").setVisible(false);d.findField("id_queue_0").setVisible(false);d.findField("extension_0").setVisible(false)}else{if(e.getData()["type_0"]=="queue"){d.findField("id_queue_0").setVisible(true);d.findField("id_sip_0").setVisible(false);d.findField("id_ivr_0").setVisible(false);d.findField("extension_0").setVisible(false)}else{if(e.getData()["type_0"].match("custom|number|group")){d.findField("extension_0").setVisible(true);d.findField("id_ivr_0").setVisible(false);d.findField("id_sip_0").setVisible(false);d.findField("id_queue_0").setVisible(false)}else{d.findField("id_queue_0").setVisible(false);d.findField("id_sip_0").setVisible(false);d.findField("id_ivr_0").setVisible(false);d.findField("extension_0").setVisible(false)}}}}Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)},onNew:function(){var f=this,d=f.formPanel.getForm(),e=f.list.getSelectionModel().getSelection()[0];d.findField("id_ivr_0").setVisible(false);d.findField("id_sip_0").setVisible(false);d.findField("id_queue_0").setVisible(false);d.findField("extension_0").setVisible(false);Ext.ux.app.ViewController.prototype.onNew.apply(this,arguments)},submitForm:function(d){var f=this,e=f.store;Ext.apply(f.params,{id_phonebook_array:f.formPanel.getForm().getFieldValues().id_phonebook.join(",")});f.formPanel.add({xtype:"hiddenfield",name:f.idProperty,value:f.formPanel.idRecord});f.formPanel.getForm().submit({url:f.store.getProxy().api.create,params:f.params,scope:f,success:function(c,b){var a=Ext.decode(b.response.responseText);if(a.success){Ext.ux.Alert.alert(f.titleSuccess,a.msg,"success");f.formPanel.fireEvent("aftersave",f.formPanel,a.rows[0])}else{errors=Helper.Util.convertErrorsJsonToString(a.msg);if(!Ext.isObject(a.errors)){Ext.ux.Alert.alert(f.titleError,errors,"error")}else{c.markInvalid(a.errors);Ext.ux.Alert.alert(f.titleWarning,f.msgFormInvalid,"warning")}}f.store.load();f.formPanel.setLoading(false);f.saveButton.enable()},failure:function(j,c){var b=Ext.decode(c.response.responseText),a=Helper.Util.convertErrorsJsonToString(b.errors);if(!Ext.isObject(b.errors)){Ext.ux.Alert.alert(f.titleError,a,"error")}else{j.markInvalid(b.errors);Ext.ux.Alert.alert(f.titleWarning,a,"error")}f.formPanel.setLoading(false);f.saveButton.enable()}})},onTestCampaign:function(e){var f=this,d=f.list.getSelectionModel().getSelection()[0];if(f.list.getSelectionModel().getSelection().length==0){Ext.ux.Alert.alert(f.titleError,t("Please Select one campaign"),"notification")}else{if(f.list.getSelectionModel().getSelection().length>1){Ext.ux.Alert.alert(f.titleError,t("Please Select only one campaign"),"notification")}else{Ext.Ajax.request({url:"index.php/campaign/testCampaign",params:{id:d.get("id")},scope:f,success:function(b){b=Ext.decode(b.responseText);if(b[f.nameSuccessRequest]){Ext.ux.Alert.alert(f.titleSuccess,b[f.nameMsgRequest],"success")}else{var a=Helper.Util.convertErrorsJsonToString(b[f.nameMsgRequest]);Ext.ux.Alert.alert(f.titleSuccess,a,"error")}}})}}}},0,0,0,0,["controller.campaign"],0,[MBilling.view.campaign,"Controller"],0));(Ext.cmd.derive("MBilling.view.campaign.Combo",Ext.form.field.ComboBox,{name:"id_campaign",fieldLabel:t("campaign"),displayField:"name",forceSelection:true,editable:false,valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Campaign",{proxy:{type:"uxproxy",module:"campaign",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["campaigncombo"],["component","box","field","textfield","pickerfield","combobox","combo","campaigncombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,campaigncombo:true},["widget.campaigncombo"],0,[MBilling.view.campaign,"Combo"],0));(Ext.cmd.derive("MBilling.view.general.TypeCampaignDestination",Ext.form.field.ComboBox,{fieldLabel:t("type"),forceSelection:true,editable:false,value:"",store:[["",t("")],["undefined",t("Undefined")],["sip",t("SIP")],["ivr",t("IVR")],["queue",t("Queue")],["group",t("Group")],["custom",t("Custom")]]},0,["typecampaigndestinationcombo"],["component","box","field","textfield","pickerfield","combobox","combo","typecampaigndestinationcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,typecampaigndestinationcombo:true},["widget.typecampaigndestinationcombo"],0,[MBilling.view.general,"TypeCampaignDestination"],0));(Ext.cmd.derive("MBilling.view.campaign.Module",Ext.ux.panel.Module,{controller:"campaign"},0,["campaignmodule"],["component","box","container","uxpanelmodule","campaignmodule"],{component:true,box:true,container:true,uxpanelmodule:true,campaignmodule:true},["widget.campaignmodule"],0,[MBilling.view.campaign,"Module"],0));(Ext.cmd.derive("MBilling.view.campaign.List",Ext.ux.grid.Panel,{store:"Campaign",fieldSearch:"name",initComponent:function(){var b=this;b.buttonCsv=false;b.allowPrint=false;b.extraButtons=[{text:t("Test")+" "+t("Campaign"),iconCls:"call",handler:"onTestCampaign",disabled:false}];b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("name"),dataIndex:"name",flex:4},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:3,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("status"),dataIndex:"status",renderer:Helper.Util.formatBooleanActive,comboRelated:"booleancombo",flex:2,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")]]}},{header:t("type"),dataIndex:"type",renderer:Helper.Util.formatCampaignType,comboRelated:"campaigntypecombo",flex:2,filter:App.user.l.slice(4,7)=="wap"?{type:"list",options:[[0,t("sms")],[1,t("voice")],[3,t("WhasApp")]]}:{type:"list",options:[[0,t("sms")],[1,t("voice")]]}},{header:t("daily_start_time"),dataIndex:"daily_start_time",flex:4},{header:t("daily_stop_time"),dataIndex:"daily_stop_time",flex:4},{header:t("startingdate"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"startingdate",flex:4},{header:t("Call Limit"),dataIndex:"frequency",flex:4,hidden:true,hideable:App.user.isAdmin},{header:t("Max Complete Call"),dataIndex:"secondusedreal",flex:3,hidden:true,hideable:App.user.isAdmin}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignlist"],["component","box","container","panel","tablepanel","gridpanel","grid","campaignlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,campaignlist:true},["widget.campaignlist"],0,[MBilling.view.campaign,"List"],0));(Ext.cmd.derive("MBilling.view.campaign.Form",Ext.ux.form.Panel,{bodyPadding:0,fieldsHideUpdateLot:["id_user","name","audio","audio_2","id_phonebook"],fileUpload:true,initComponent:function(){var b=this;b.labelWidthFields=120;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{plugins:"markallowblank",allowBlank:false,anchor:"100%",labelAlign:"right"}},items:[{title:t("general"),items:[{xtype:App.user.isClient?"textfield":"userlookup",ownerForm:b,hidden:App.user.isClient},{fieldLabel:t("Plan"),xtype:"plancombo",name:"id_plan",hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"name",fieldLabel:t("name")},{xtype:"booleancombo",name:"status",fieldLabel:t("status")},{xtype:"datetimefield",name:"startingdate",fieldLabel:t("startingdate"),format:"Y-m-d H:i:s",value:new Date()},{xtype:"datetimefield",name:"expirationdate",fieldLabel:t("expirationdate"),format:"Y-m-d H:i:s",value:"2030-01-01 00:00:00"},{xtype:"campaigntypefullcombo",name:"type",fieldLabel:t("type")},{xtype:"uploadfield",fieldLabel:t("Audio"),emptyText:"Select an wav or gsm File",allowBlank:true,name:"audio",extAllowed:["wav","gsm"]},{xtype:"uploadfield",fieldLabel:t("Audio")+"2",emptyText:"Select an wav or gsm File",allowBlank:true,name:"audio_2",extAllowed:["wav","gsm"]},{xtype:"yesnocombo",name:"restrict_phone",fieldLabel:t("Restrict Phone"),hidden:App.user.isClient,allowBlank:true},{style:"margin-top:25px",xtype:"fieldset",title:t("Forward to"),collapsible:true,collapsed:false,height:110,defaults:{labelWidth:190,anchor:"100%",labelAlign:b.labelAlignFields},items:[{xtype:"numberfield",name:"digit_authorize",fieldLabel:t("Number to Forward"),value:"-1",minValue:"-1",maxValue:9},{fieldLabel:t("Forward Type"),name:"type_0",xtype:"typecampaigndestinationcombo",allowBlank:true},{xtype:"textfield",name:"extensions_0",fieldLabel:t("Destination"),value:"0",allowBlank:true,hidden:true},{xtype:"ivrlookup",ownerForm:b,name:"id_ivr_0",fieldLabel:t("IVR"),displayField:"id_ivr_0_name",allowBlank:true,hidden:true},{xtype:"queuelookup",ownerForm:b,name:"id_queue_0",fieldLabel:t("Queue"),displayField:"id_queue_0_name",allowBlank:true,hidden:true},{xtype:"siplookup",ownerForm:b,name:"id_sip_0",displayField:"id_sip_0_name",fieldLabel:t("SIP"),allowBlank:true,hidden:true},{xtype:"textfield",fieldLabel:t("Destination"),name:"extension_0",hidden:true}]},{style:"margin-top:10px",xtype:"fieldset",title:t("Select one or more phonebook"),collapsible:true,collapsed:false,items:[{labelWidth:10,name:"id_phonebook",fieldLabel:t("phonebook"),anchor:"100%",fieldLabel:"",xtype:"phonebooktag",allowBlank:true}]}]},{title:t("schedules"),items:[{name:"daily_start_time",fieldLabel:t("daily_start_time"),value:"09:00"},{name:"daily_stop_time",fieldLabel:t("daily_stop_time"),value:"18:00"},{xtype:"yesnocombo",fieldLabel:t("monday"),name:"monday"},{xtype:"yesnocombo",fieldLabel:t("tuesday"),name:"tuesday"},{xtype:"yesnocombo",fieldLabel:t("wednesday"),name:"wednesday"},{xtype:"yesnocombo",fieldLabel:t("thursday"),name:"thursday"},{xtype:"yesnocombo",fieldLabel:t("friday"),name:"friday"},{xtype:"noyescombo",fieldLabel:t("saturday"),name:"saturday"},{xtype:"noyescombo",fieldLabel:t("sunday"),name:"sunday"}]},{title:t("Limit"),items:[{name:"frequency",fieldLabel:t("Call Limit"),readOnly:!App.user.isAdmin,allowBlank:!App.user.isAdmin,value:App.user.isClient?1:10},{name:"nb_callmade",fieldLabel:t("Total Audio Time"),hidden:!App.user.isAdmin,allowBlank:true,value:0},{xtype:"booleancombo",name:"enable_max_call",fieldLabel:t("Enable")+" "+t("Max Complete Call"),hidden:!App.user.isAdmin,allowBlank:true,value:0},{name:"secondusedreal",fieldLabel:t("Max Complete Call"),hidden:!App.user.isAdmin,allowBlank:true,value:0}]},{title:t("SMS"),items:[{xtype:"textareafield",name:"description",fieldLabel:t("descriptionOrSmsText"),allowBlank:true,maxLength:160}]},{title:t("TTS/ASR"),hidden:!window.ttsasr,items:[{name:"tts_audio",fieldLabel:t("Audio 1 TTS"),allowBlank:true,maxLength:200},{name:"tts_audio2",fieldLabel:t("Audio 2 TTS"),allowBlank:true,maxLength:200},{xtype:"box",hidden:false,autoEl:{tag:"br"}},{name:"asr_options",fieldLabel:t("Option to validate ASR"),allowBlank:true,maxLength:160}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignform"],["component","box","container","panel","form","campaignform"],{component:true,box:true,container:true,panel:true,form:true,campaignform:true},["widget.campaignform"],0,[MBilling.view.campaign,"Form"],0));(Ext.cmd.derive("MBilling.view.campaignPoll.Controller",Ext.ux.app.ViewController,{isSubmitForm:true},0,0,0,0,["controller.campaignpoll"],0,[MBilling.view.campaignPoll,"Controller"],0));(Ext.cmd.derive("MBilling.view.campaignPoll.Combo",Ext.form.field.ComboBox,{name:"id_campaign_poll",fieldLabel:t("campaignpoll"),displayField:"name",valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.CampaignPoll",{proxy:{type:"uxproxy",module:"campaignPoll",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["campaignpollcombo"],["component","box","field","textfield","pickerfield","combobox","combo","campaignpollcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,campaignpollcombo:true},["widget.campaignpollcombo"],0,[MBilling.view.campaignPoll,"Combo"],0));(Ext.cmd.derive("MBilling.view.campaignPoll.Module",Ext.ux.panel.Module,{controller:"campaignpoll"},0,["campaignpollmodule"],["component","box","container","uxpanelmodule","campaignpollmodule"],{component:true,box:true,container:true,uxpanelmodule:true,campaignpollmodule:true},["widget.campaignpollmodule"],0,[MBilling.view.campaignPoll,"Module"],0));(Ext.cmd.derive("MBilling.view.campaignPoll.List",Ext.ux.grid.Panel,{store:"CampaignPoll",initComponent:function(){var b=this;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("name"),dataIndex:"name",flex:4},{xtype:"templatecolumn",tpl:"{idCampaignname}",header:t("campaign"),dataIndex:"id_campaign",comboFilter:"campaigncombo",flex:4},{header:t("description"),dataIndex:"description",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignpolllist"],["component","box","container","panel","tablepanel","gridpanel","grid","campaignpolllist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,campaignpolllist:true},["widget.campaignpolllist"],0,[MBilling.view.campaignPoll,"List"],0));(Ext.cmd.derive("MBilling.view.campaignPoll.Form",Ext.ux.form.Panel,{bodyPadding:0,fileUpload:true,fieldsHideUpdateLot:["id_campaign","name","arq_audio"],initComponent:function(){var b=this;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{plugins:"markallowblank",allowBlank:false,anchor:"100%",labelAlign:"right"}},items:[{title:t("general"),items:[{xtype:"campaigncombo"},{name:"name",fieldLabel:t("name")},{xtype:"numberfield",name:"repeat",fieldLabel:t("How many time to repeat, if the client press invalid option?"),minValue:0,maxValue:9,allowBlank:true},{xtype:"noyescombo",name:"request_authorize",fieldLabel:t("Request")+" "+t("authorization")},{xtype:"numberfield",name:"digit_authorize",fieldLabel:t("Number for authorize"),value:"1",minValue:1,maxValue:9,allowBlank:true},{xtype:"textareafield",name:"description",fieldLabel:t("description"),allowBlank:true},{xtype:"uploadfield",fieldLabel:"Audio",emptyText:"Select an wav or gsm File",allowBlank:true,name:"arq_audio",extAllowed:["wav","gsm"]}]},{title:t("options"),itemId:"optionsData",items:[{name:"option0",fieldLabel:t("option")+" 0",allowBlank:true},{name:"option1",fieldLabel:t("option")+" 1",allowBlank:true},{name:"option2",fieldLabel:t("option")+" 2",allowBlank:true},{name:"option3",fieldLabel:t("option")+" 3",allowBlank:true},{name:"option4",fieldLabel:t("option")+" 4",allowBlank:true},{name:"option5",fieldLabel:t("option")+" 5",allowBlank:true},{name:"option6",fieldLabel:t("option")+" 6",allowBlank:true},{name:"option7",fieldLabel:t("option")+" 7",allowBlank:true},{name:"option8",fieldLabel:t("option")+" 8",allowBlank:true},{name:"option9",fieldLabel:t("option")+" 9",allowBlank:true}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignpollform"],["component","box","container","panel","form","campaignpollform"],{component:true,box:true,container:true,panel:true,form:true,campaignpollform:true},["widget.campaignpollform"],0,[MBilling.view.campaignPoll,"Form"],0));(Ext.cmd.derive("MBilling.view.phoneNumber.Controller",Ext.ux.app.ViewController,{reprocessar:function(e){var g=this,f=g.list.getStore(),j=g.list.filters.getFilterData().length?Ext.encode(g.list.filters.getFilterData()):f.proxy.extraParams.filter;e.disable();g.list.setLoading(true);if(!j){Ext.ux.Alert.alert("Alert","Realize um filtro para reprocessar","notification");e.enable();g.list.setLoading(false);return}Ext.Msg.confirm("Confirm","Confirme que quer reprocessar os numeros pendentes?",function(a){if(a==="yes"){Ext.Ajax.request({url:"index.php/phoneNumber/reprocesar/",params:{filter:j},scope:g,success:function(c){c=Ext.decode(c.responseText);if(c[g.nameSuccessRequest]){Ext.ux.Alert.alert(g.titleSuccess,c[g.nameMsgRequest],"success");f.load();e.enable();g.list.setLoading(false)}else{var b=Helper.Util.convertErrorsJsonToString(c[g.nameMsgRequest]);Ext.ux.Alert.alert(g.titleError,b,"error");e.enable();g.list.setLoading(false)}}})}})}},0,0,0,0,["controller.phonenumber"],0,[MBilling.view.phoneNumber,"Controller"],0));(Ext.cmd.derive("MBilling.view.phoneNumber.Module",Ext.ux.panel.Module,{controller:"phonenumber"},0,["phonenumbermodule"],["component","box","container","uxpanelmodule","phonenumbermodule"],{component:true,box:true,container:true,uxpanelmodule:true,phonenumbermodule:true},["widget.phonenumbermodule"],0,[MBilling.view.phoneNumber,"Module"],0));(Ext.cmd.derive("MBilling.view.phoneNumber.List",Ext.ux.grid.Panel,{store:"PhoneNumber",buttonImportCsv:true,initComponent:function(){var b=this;b.extraButtons=[{text:t("Reprocessar"),iconCls:"callshop",handler:"reprocessar",disabled:false}];b.buttonUpdateLot=App.user.isAdmin&&!window.isTablet;b.buttonCsv=!window.isTablet;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("number"),dataIndex:"number",flex:4},{header:t("phonebook"),dataIndex:"idPhonebookname",filter:{type:"string",field:"idPhonebook.name"},flex:4},{header:t("status"),dataIndex:"status",renderer:Helper.Util.formatBooleanActive,comboRelated:"statuscombo",flex:2,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")],[2,t("pending")],[3,t("send")],[4,t("blocked")]]}},{header:t("name"),dataIndex:"name",hidden:true,hideable:true,flex:4},{header:t("city"),dataIndex:"city",hidden:true,hideable:true,flex:4},{header:t("description"),dataIndex:"info",hidden:true,flex:4},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"creationdate",hidden:true,hideable:App.user.isAdmin,flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["phonenumberlist"],["component","box","container","panel","tablepanel","gridpanel","grid","phonenumberlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,phonenumberlist:true},["widget.phonenumberlist"],0,[MBilling.view.phoneNumber,"List"],0));(Ext.cmd.derive("MBilling.view.phoneNumber.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["number"],initComponent:function(){var b=this;b.items=[{xtype:"phonebookcombo"},{name:"number",fieldLabel:t("number")},{name:"name",fieldLabel:t("name"),allowBlank:true},{name:"city",fieldLabel:t("city"),allowBlank:true},{xtype:"statuscombo",name:"status",fieldLabel:t("status"),allowBlank:true},{xtype:"textareafield",name:"info",fieldLabel:t("description"),allowBlank:true,hidden:!App.user.isAdmin}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["phonenumberform"],["component","box","container","panel","form","phonenumberform"],{component:true,box:true,container:true,panel:true,form:true,phonenumberform:true},["widget.phonenumberform"],0,[MBilling.view.phoneNumber,"Form"],0));(Ext.cmd.derive("MBilling.view.phoneBook.Combo",Ext.form.field.ComboBox,{name:"id_phonebook",fieldLabel:t("phonebook"),displayField:"name",forceSelection:true,editable:true,valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.PhoneBook",{proxy:{type:"uxproxy",module:"phoneBook",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["phonebookcombo"],["component","box","field","textfield","pickerfield","combobox","combo","phonebookcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,phonebookcombo:true},["widget.phonebookcombo"],0,[MBilling.view.phoneBook,"Combo"],0));(Ext.cmd.derive("MBilling.view.phoneNumber.ImportCsv",Ext.ux.window.ImportCsv,{htmlTipInfo:"
number,name,city
551135672677, Dany Hilger, New York
551156332233, Monica Leith, San Pablo
554153882200, John Mart, Madri
"+t("name")+" "+t("and")+" "+t("city")+" "+t("optional")+"",fieldsImport:[{xtype:"phonebookcombo",width:350}]},0,["phonenumberimportcsv"],["component","box","container","panel","window","phonenumberimportcsv"],{component:true,box:true,container:true,panel:true,window:true,phonenumberimportcsv:true},["widget.phonenumberimportcsv"],0,[MBilling.view.phoneNumber,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.rate.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.rate"],0,[MBilling.view.rate,"Controller"],0));(Ext.cmd.derive("MBilling.view.rate.Module",Ext.ux.panel.Module,{controller:"rate",flexForm:2,labelWidthFields:190},0,["ratemodule"],["component","box","container","uxpanelmodule","ratemodule"],{component:true,box:true,container:true,uxpanelmodule:true,ratemodule:true},["widget.ratemodule"],0,[MBilling.view.rate,"Module"],0));(Ext.cmd.derive("MBilling.view.rate.List",Ext.ux.grid.Panel,{store:"Rate",fieldSearch:"idPrefix.prefix",initComponent:function(){var b=this;b.buttonImportCsv=!App.user.isClient,b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("prefix"),dataIndex:"idPrefixprefix",filter:{type:"string",field:"idPrefix.prefix"},flex:window.isTablet?2:3},{dataIndex:"idPrefixdestination",header:t("destination"),filter:{type:"string",field:"idPrefix.destination"},flex:window.isTablet?2:3},{header:t("buyrate"),dataIndex:"buyrate",renderer:Helper.Util.formatMoneyDecimal4,hidden:!App.user.isAdmin,hideable:App.user.isAdmin,flex:2},{header:t("buyrateinitblock"),dataIndex:"buyrateinitblock",hidden:!App.user.isAdmin||window.isTablet,hideable:App.user.isAdmin,flex:2},{header:t("buyrateincrement"),dataIndex:"buyrateincrement",hidden:!App.user.isAdmin||window.isTablet,hideable:App.user.isAdmin,flex:2},{header:t("rateinitial"),dataIndex:"rateinitial",renderer:Helper.Util.formatMoneyDecimal4,flex:2},{header:t("initblock"),dataIndex:"initblock",hidden:window.isTablet,flex:2},{header:t("billingblock"),dataIndex:"billingblock",hidden:window.isTablet,flex:2},{xtype:"templatecolumn",tpl:"{idTrunktrunkcode}",header:t("trunk"),dataIndex:"id_trunk",comboFilter:"trunkcombo",flex:3,hidden:!App.user.isAdmin,hideable:App.user.isAdmin},{xtype:"templatecolumn",tpl:"{idPlanname}",header:t("plan"),dataIndex:"id_plan",comboFilter:"plancombo",flex:3},{header:t("includeinpackage"),dataIndex:"package_offer",hidden:true,hideable:App.user.isAdmin,flex:1},{header:t("status"),dataIndex:"status",hidden:true,hideable:App.user.isAdmin,flex:2,renderer:Helper.Util.formatBooleanActive,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")]]}}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["ratelist"],["component","box","container","panel","tablepanel","gridpanel","grid","ratelist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,ratelist:true},["widget.ratelist"],0,[MBilling.view.rate,"List"],0));(Ext.cmd.derive("MBilling.view.rate.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["id_prefix"],labelWidthFields:140,initComponent:function(){var b=this;b.items=[{name:"id_plan",fieldLabel:"Plan",xtype:"planlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:false},{name:"id_prefix",fieldLabel:"Destination",xtype:"prefixlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:false},{name:"id_trunk",fieldLabel:"Trunk",xtype:"trunklookup",ownerForm:b,hidden:!App.user.isAdmin,allowBlank:!App.user.isAdmin},{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,"+App.user.decimalPrecision,name:"buyrate",fieldLabel:t("buyrate"),hidden:!App.user.isAdmin,allowBlank:!App.user.isAdmin},{xtype:"numberfield",name:"buyrateinitblock",fieldLabel:t("buyrateinitblock"),value:1,minValue:1,hidden:!App.user.isAdmin,allowBlank:!App.user.isAdmin},{xtype:"numberfield",name:"buyrateincrement",fieldLabel:t("buyrateincrement"),value:1,minValue:1,hidden:!App.user.isAdmin,allowBlank:!App.user.isAdmin},{xtype:"numberfield",name:"minimal_time_buy",fieldLabel:t("Minimal time to buy"),value:0,minValue:0,hidden:!App.user.isAdmin},{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,"+App.user.decimalPrecision,name:"rateinitial",fieldLabel:t("rateinitial"),readOnly:App.user.isClient},{xtype:"numberfield",name:"initblock",fieldLabel:t("initblock"),value:1,minValue:1,hidden:App.user.isClient},{xtype:"numberfield",name:"billingblock",value:1,minValue:1,fieldLabel:t("billingblock"),hidden:App.user.isClient},{xtype:"numberfield",name:"minimal_time_charge",fieldLabel:t("Minimal time to charge"),value:0,minValue:0,hidden:App.user.isClient},{name:"additional_grace",fieldLabel:t("additional_grace"),allowBlank:true,hidden:!App.user.isAdmin},{xtype:"noyescombo",name:"package_offer",fieldLabel:t("includeinpackage"),hidden:!App.user.isAdmin,allowBlank:true},{xtype:"booleancombo",name:"status",fieldLabel:t("status"),hidden:!App.user.isAdmin,allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["rateform"],["component","box","container","panel","form","rateform"],{component:true,box:true,container:true,panel:true,form:true,rateform:true},["widget.rateform"],0,[MBilling.view.rate,"Form"],0));(Ext.cmd.derive("MBilling.view.rate.ImportCsv",Ext.ux.window.ImportCsv,{htmlTipInfo:"
"+t("dialprefix")+", "+t("destination")+", "+t("rateinitial")+", "+t("buyrate")+"
5511, Brasil SP, 0.080, 0.050
34, Spain Fix, 0.056, 0.034
54, Argentina, 0.025, 0.015

"+t("rateinitial")+" "+t("and")+" "+t("buyrate")+" "+t("optional")+"",labelWidthFields:160,height:window.isThemeTriton?350:275,initComponent:function(){var b=this;b.fieldsImport=[{xtype:"plancombo",fieldLabel:t("table"),width:350},{xtype:"trunkcombo",fieldLabel:t("trunkText"),width:350,hidden:!App.user.isAdmin},{style:"margin-top:25px",xtype:"fieldset",title:t("Csv Format"),collapsible:true,collapsed:false,defaults:{labelWidth:190,anchor:"100%",layout:{type:"hbox",labelAlign:b.labelAlignFields}},items:[{xtype:"pontovirgulacombo",name:"delimiter",fieldLabel:t("Delimiter"),width:230}]}];Ext.ux.window.ImportCsv.prototype.initComponent.apply(this,arguments)}},0,["rateimportcsv"],["component","box","container","panel","window","rateimportcsv"],{component:true,box:true,container:true,panel:true,window:true,rateimportcsv:true},["widget.rateimportcsv"],0,[MBilling.view.rate,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.phoneBook.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.phonebook"],0,[MBilling.view.phoneBook,"Controller"],0));(Ext.cmd.derive("MBilling.view.phoneBook.Module",Ext.ux.panel.Module,{controller:"phonebook"},0,["phonebookmodule"],["component","box","container","uxpanelmodule","phonebookmodule"],{component:true,box:true,container:true,uxpanelmodule:true,phonebookmodule:true},["widget.phonebookmodule"],0,[MBilling.view.phoneBook,"Module"],0));(Ext.cmd.derive("MBilling.view.phoneBook.List",Ext.ux.grid.Panel,{store:"PhoneBook",initComponent:function(){var b=this;b.columns=b.columns||[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("name"),dataIndex:"name",flex:5},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:3,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("status"),dataIndex:"status",renderer:Helper.Util.formatBooleanActive,comboRelated:"booleancombo",flex:3,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")]]}},{header:t("description"),dataIndex:"description",flex:5}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["phonebooklist"],["component","box","container","panel","tablepanel","gridpanel","grid","phonebooklist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,phonebooklist:true},["widget.phonebooklist"],0,[MBilling.view.phoneBook,"List"],0));(Ext.cmd.derive("MBilling.view.phoneBook.Form",Ext.ux.form.Panel,{bodyPadding:0,fieldsHideUpdateLot:["id_user","name"],initComponent:function(){var b=this;b.items=[{xtype:App.user.isClient?"textfield":"userlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"name",fieldLabel:t("name")},{xtype:"booleancombo",name:"status",fieldLabel:t("status"),allowBlank:true},{xtype:"textareafield",name:"description",fieldLabel:t("description"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["phonebookform"],["component","box","container","panel","form","phonebookform"],{component:true,box:true,container:true,panel:true,form:true,phonebookform:true},["widget.phonebookform"],0,[MBilling.view.phoneBook,"Form"],0));(Ext.cmd.derive("MBilling.view.phoneBook.Tag",Ext.form.field.Tag,{name:"id_phonebook",fieldLabel:t("phonebook"),displayField:"name",valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.PhoneBook",{proxy:{type:"uxproxy",module:"phoneBook",limitParam:undefined}});Ext.form.field.Tag.prototype.initComponent.apply(this,arguments)}},0,["phonebooktag"],["component","box","field","textfield","pickerfield","combobox","combo","tagfield","phonebooktag"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,tagfield:true,phonebooktag:true},["widget.phonebooktag"],0,[MBilling.view.phoneBook,"Tag"],0));(Ext.cmd.derive("MBilling.view.call.Controller",Ext.ux.app.ViewController,{onRecordCall:function(m){var j=this,f=j.list.getSelectionModel().getSelection()[0],l=Ext.encode(j.list.filters.getFilterData()),g=[];if(!f&&l.length<5){Ext.ux.Alert.alert(j.titleError,t("Please select one or more register"),"notification")}else{Ext.each(j.list.getSelectionModel().getSelection(),function(a){g.push(a.get(j.idProperty))});if(App.user.isAdmin&&g.length>250){Ext.ux.Alert.alert(j.titleError,t("Your limit to download record is")+" 250","error")}else{if(!App.user.isAdmin&&g.length>25){Ext.ux.Alert.alert(j.titleError,t("Your limit to download record is")+" 25","error")}else{window.open("index.php/call/downloadRecord?ids="+Ext.encode(g)+"&filter="+l)}}}},onDownloadClick:function(d,f,e){window.open("index.php/call/downloadRecord?id="+d.getStore().getAt(f).getData().id)},onShowTotal:function(e){var g=this;var g=this,f=g.list.getStore(),j=g.list.filters.getFilterData().length?Ext.encode(g.list.filters.getFilterData()):f.proxy.extraParams.filter;e.disable();e.setText(t("Wait..."));e.setWidth(120);Ext.Ajax.request({url:"index.php/call/getTotal",params:{filter:j},scope:g,success:function(a){a=Ext.decode(a.responseText);Ext.ux.Alert.alert(g.titleSuccess," "+t("Total")+" "+t("buycost")+": "+App.user.currency+" "+a.sumbuycost+"
"+t("Total")+" "+t("sessionbill")+": "+App.user.currency+" "+a.sumsessionbill+"
"+t("Total")+" "+t("profit")+": "+App.user.currency+" "+a.totalCall+"
","information",true,false);e.enable();e.setText(t("Show Total"))},failure:function(a){e.enable();e.setText(""+t("Failed. Try again...")+"");e.setWidth(300)}})}},0,0,0,0,["controller.call"],0,[MBilling.view.call,"Controller"],0));(Ext.cmd.derive("MBilling.view.call.Module",Ext.ux.panel.Module,{controller:"call"},0,["callmodule"],["component","box","container","uxpanelmodule","callmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callmodule:true},["widget.callmodule"],0,[MBilling.view.call,"Module"],0));(Ext.cmd.derive("MBilling.view.call.List",Ext.ux.grid.Panel,{store:"Call",standardSubmit:true,initComponent:function(){var b=this;b.paginationButton=["-",{xtype:"button",width:"120",text:t("Show Total"),handler:"onShowTotal",hidden:!App.user.isAdmin,cls:"x-btn-text-icon details"},{xtype:"tbtext",reference:"tbTextTotal"}];b.fieldSearch=App.user.isAdmin?"idUser.username":"calledstation",b.extraButtons=[{text:t("Download Rec"),iconCls:"call",handler:"onRecordCall",disabled:false,width:130}];b.buttonUpdateLot=App.user.isAdmin;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{xtype:"actioncolumn",width:26,sortable:false,menuDisabled:true,header:t(""),dataIndex:"id",items:[{iconCls:"icon-play",tooltip:t("Download Rec"),handler:"onDownloadClick"}],hidden:App.user.show_playicon_cdr==0,hideable:true},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"starttime",flex:4},{header:t("Sip Account"),dataIndex:"src",flex:3},{header:t("CallerId"),dataIndex:"callerid",flex:3,hidden:true,hideable:true},{header:t("number"),dataIndex:"calledstation",flex:3},{header:t("destination"),dataIndex:"idPrefixdestination",filter:{type:"string",field:"idPrefix.destination"},flex:4},{header:t("sessiontime"),dataIndex:"sessiontime",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Real")+" "+t("sessiontime"),dataIndex:"real_sessiontime",renderer:Helper.Util.formatsecondsToTime,flex:3,hidden:true,hideable:App.user.isAdmin},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:2,hidden:App.user.isClient,hideable:!App.user.isClient},{xtype:"templatecolumn",tpl:"{idTrunktrunkcode}",header:t("trunk"),dataIndex:"id_trunk",comboFilter:"trunkcombo",header:t("trunk"),flex:3,hidden:App.user.isClient||App.user.isAgent,hideable:!App.user.isClient&&!App.user.isAgent},{header:t("status"),dataIndex:"terminatecauseid",renderer:Helper.Util.formatDialStatus,flex:2,filter:{type:"list",options:[[1,t("answer")]]}},{header:t("type"),dataIndex:"sipiax",renderer:Helper.Util.formatCallType,flex:2,filter:{type:"list",options:[[0,t("standard")],[1,t("sipcall")],[2,t("did")],[3,t("didvoip")],[4,t("callback")],[5,t("callcenter")],[6,"sms"],[7,t("transfer")],[8,t("queue")],[9,t("ivr")]]}},{header:t("buycost"),dataIndex:"buycost",renderer:Helper.Util.formatMoneyDecimal4,flex:3,hidden:App.user.isClient||App.user.isAgent,hideable:!App.user.isClient&&!App.user.isAgent},{header:t("sessionbill"),dataIndex:"sessionbill",renderer:Helper.Util.formatMoneyDecimal4,flex:3,hidden:App.user.isAgent||App.user.isClientAgent,hideable:!App.user.isAgent&&!App.user.isClientAgent},{header:t("buycost"),dataIndex:"sessionbill",renderer:Helper.Util.formatMoneyDecimal4,flex:3,hidden:!App.user.isAgent,hideable:App.user.isAgent},{header:t("sessionbill"),dataIndex:"agent_bill",renderer:Helper.Util.formatMoneyDecimal4,flex:3,hidden:!App.user.isAgent,hideable:App.user.isAgent},{header:t("sessionbill"),dataIndex:"agent_bill",renderer:Helper.Util.formatMoneyDecimal4,flex:3,hidden:!App.user.isClientAgent,hideable:App.user.isClientAgent},{header:t("uniqueid"),dataIndex:"uniqueid",flex:3,hidden:true,hideable:true},{xtype:"templatecolumn",tpl:"{idCampaignname}",header:t("campaign"),dataIndex:"id_campaign",comboFilter:"campaigncombo",flex:3,hidden:true,hideable:!App.user.isClient}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["calllist"],["component","box","container","panel","tablepanel","gridpanel","grid","calllist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,calllist:true},["widget.calllist"],0,[MBilling.view.call,"List"],0));(Ext.cmd.derive("MBilling.view.call.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["calledstation"],initComponent:function(){var b=this;b.items=[{name:"calledstation",fieldLabel:t("number"),readOnly:true},{name:"sessiontime",fieldLabel:t("sessiontime"),readOnly:App.user.isClient||App.user.isAgent,hidden:App.user.isClient||App.user.isAgent},{xtype:"moneyfield",name:"buycost",fieldLabel:t("buycost"),mask:App.user.currency+" #9.999.990,"+App.user.decimalPrecision,hidden:App.user.isClient||App.user.isAgent},{xtype:"moneyfield",name:"sessionbill",fieldLabel:t("sessionbill"),mask:App.user.currency+" #9.999.990,"+App.user.decimalPrecision,readOnly:App.user.isClient||App.user.isAgent,hidden:App.user.isAgent||App.user.isClientAgent},{xtype:"moneyfield",name:"agent_bill",fieldLabel:t("sessionbill"),mask:App.user.currency+" #9.999.990,"+App.user.decimalPrecision,readOnly:App.user.isAgent,hidden:!App.user.isAgent&&!App.user.isClientAgent}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callform"],["component","box","container","panel","form","callform"],{component:true,box:true,container:true,panel:true,form:true,callform:true},["widget.callform"],0,[MBilling.view.call,"Form"],0));(Ext.cmd.derive("MBilling.view.callArchive.Controller",Ext.ux.app.ViewController,{onRecordCall:function(m){var j=this,f=j.list.getSelectionModel().getSelection()[0],l=Ext.encode(j.list.filters.getFilterData()),g=[];if(!f&&l.length<5){Ext.ux.Alert.alert(j.titleError,t("Please select one or more register"),"notification")}else{Ext.each(j.list.getSelectionModel().getSelection(),function(a){g.push(a.get(j.idProperty))});if(App.user.isAdmin&&g.length>250){Ext.ux.Alert.alert(j.titleError,t("Your limit to download record is")+" 250","error")}else{if(!App.user.isAdmin&&g.length>25){Ext.ux.Alert.alert(j.titleError,t("Your limit to download record is")+" 25","error")}else{window.open("index.php/callArchive/downloadRecord?ids="+Ext.encode(g)+"&filter="+l)}}}},onDownloadClick:function(d,f,e){window.open("index.php/callArchive/downloadRecord?id="+d.getStore().getAt(f).getData().id)}},0,0,0,0,["controller.callarchive"],0,[MBilling.view.callArchive,"Controller"],0));(Ext.cmd.derive("MBilling.view.callArchive.Module",Ext.ux.panel.Module,{controller:"callarchive"},0,["callarchivemodule"],["component","box","container","uxpanelmodule","callarchivemodule"],{component:true,box:true,container:true,uxpanelmodule:true,callarchivemodule:true},["widget.callarchivemodule"],0,[MBilling.view.callArchive,"Module"],0));(Ext.cmd.derive("MBilling.view.callArchive.List",Ext.ux.grid.Panel,{store:"CallArchive",standardSubmit:true,initComponent:function(){var b=this;b.buttonUpdateLot=false;b.fieldSearch=App.user.isAdmin?"idUser.username":"calledstation",b.extraButtons=[{text:t("Download Rec"),iconCls:"call",handler:"onRecordCall",disabled:false,width:130}];b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{xtype:"actioncolumn",width:26,sortable:false,menuDisabled:true,header:t(""),dataIndex:"id",items:[{iconCls:"icon-play",tooltip:t("Download Rec"),handler:"onDownloadClick"}],hidden:App.user.show_playicon_cdr==0,hideable:true},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"starttime",flex:4},{header:t("Sip Account"),dataIndex:"src",flex:3},{header:t("CallerId"),dataIndex:"callerid",flex:3,hidden:true,hideable:true},{header:t("number"),dataIndex:"calledstation",flex:3},{header:t("destination"),dataIndex:"idPrefixdestination",filter:{type:"string",field:"idPrefix.destination"},flex:4},{header:t("sessiontime"),dataIndex:"sessiontime",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Real")+" "+t("sessiontime"),dataIndex:"real_sessiontime",renderer:Helper.Util.formatsecondsToTime,flex:3,hidden:true,hideable:App.user.isAdmin},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:2,hidden:App.user.isClient,hideable:!App.user.isClient},{xtype:"templatecolumn",tpl:"{idTrunktrunkcode}",header:t("trunk"),dataIndex:"id_trunk",comboFilter:"trunkcombo",header:t("trunk"),flex:3,hidden:App.user.isClient||App.user.isAgent,hideable:!App.user.isClient&&!App.user.isAgent},{header:t("status"),dataIndex:"terminatecauseid",renderer:Helper.Util.formatDialStatus,flex:2,filter:{type:"list",options:[[1,t("answer")]]}},{header:t("type"),dataIndex:"sipiax",renderer:Helper.Util.formatCallType,flex:2,filter:{type:"list",options:[[0,t("standard")],[1,t("sipcall")],[2,t("did")],[3,t("didvoip")],[4,t("callback")],[5,t("callcenter")],[6,"sms"],[7,t("transfer")],[8,t("queue")],[9,t("ivr")]]}},{header:t("buycost"),dataIndex:"buycost",renderer:Helper.Util.formatMoneyDecimal4,flex:3,hidden:App.user.isClient||App.user.isAgent,hideable:!App.user.isClient&&!App.user.isAgent},{header:t("sessionbill"),dataIndex:"sessionbill",renderer:Helper.Util.formatMoneyDecimal4,flex:3,hidden:App.user.isAgent||App.user.isClientAgent,hideable:!App.user.isAgent&&!App.user.isClientAgent},{header:t("buycost"),dataIndex:"sessionbill",renderer:Helper.Util.formatMoneyDecimal4,flex:3,hidden:!App.user.isAgent,hideable:App.user.isAgent},{header:t("sessionbill"),dataIndex:"agent_bill",renderer:Helper.Util.formatMoneyDecimal4,flex:3,hidden:!App.user.isAgent,hideable:App.user.isAgent},{header:t("sessionbill"),dataIndex:"agent_bill",renderer:Helper.Util.formatMoneyDecimal4,flex:3,hidden:!App.user.isClientAgent,hideable:App.user.isClientAgent},{header:t("uniqueid"),dataIndex:"uniqueid",flex:3,hidden:true,hideable:true}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callarchivelist"],["component","box","container","panel","tablepanel","gridpanel","grid","callarchivelist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callarchivelist:true},["widget.callarchivelist"],0,[MBilling.view.callArchive,"List"],0));(Ext.cmd.derive("MBilling.view.callArchive.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["calledstation"],initComponent:function(){var b=this;b.items=[{name:"calledstation",fieldLabel:t("number"),readOnly:true},{name:"sessiontime",fieldLabel:t("sessiontime"),readOnly:App.user.isClient||App.user.isAgent,hidden:App.user.isClient||App.user.isAgent},{xtype:"moneyfield",name:"buycost",fieldLabel:t("buycost"),mask:App.user.currency+" #9.999.990,"+App.user.decimalPrecision,hidden:App.user.isClient||App.user.isAgent},{xtype:"moneyfield",name:"sessionbill",fieldLabel:t("sessionbill"),mask:App.user.currency+" #9.999.990,"+App.user.decimalPrecision,readOnly:App.user.isClient||App.user.isAgent,hidden:App.user.isAgent||App.user.isClientAgent},{xtype:"moneyfield",name:"agent_bill",fieldLabel:t("sessionbill"),mask:App.user.currency+" #9.999.990,"+App.user.decimalPrecision,readOnly:App.user.isAgent,hidden:!App.user.isAgent&&!App.user.isClientAgent}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callarchiveform"],["component","box","container","panel","form","callarchiveform"],{component:true,box:true,container:true,panel:true,form:true,callarchiveform:true},["widget.callarchiveform"],0,[MBilling.view.callArchive,"Form"],0));(Ext.cmd.derive("MBilling.view.callFailed.Controller",Ext.ux.app.ViewController,{formHidden:true},0,0,0,0,["controller.callfailed"],0,[MBilling.view.callFailed,"Controller"],0));(Ext.cmd.derive("MBilling.view.callFailed.Module",Ext.ux.panel.Module,{controller:"callfailed"},0,["callfailedmodule"],["component","box","container","uxpanelmodule","callfailedmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callfailedmodule:true},["widget.callfailedmodule"],0,[MBilling.view.callFailed,"Module"],0));(Ext.cmd.derive("MBilling.view.callFailed.List",Ext.ux.grid.Panel,{store:"CallFailed",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.allowCreate=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"starttime",flex:4},{header:t("Sip Account"),dataIndex:"src",flex:3},{header:t("CallerId"),dataIndex:"callerid",flex:3,hidden:true,hideable:true},{header:t("number"),dataIndex:"calledstation",flex:3},{header:t("destination"),dataIndex:"idPrefixdestination",flex:4},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:2,hidden:App.user.isClient,hideable:!App.user.isClient},{xtype:"templatecolumn",tpl:"{idTrunktrunkcode}",header:t("trunk"),dataIndex:"id_trunk",comboFilter:"trunkcombo",header:t("trunk"),flex:4,hidden:App.user.isClient||App.user.isAgent,hideable:!App.user.isClient&&!App.user.isAgent},{header:t("status"),dataIndex:"terminatecauseid",renderer:Helper.Util.formatDialStatus,flex:2,filter:{type:"list",options:[[1,t("answer")],[2,t("busy")],[3,t("no")+" "+t("answer")],[4,t("cancelcall")],[5,"congestion"],[6,"chanunavail"],[7,"dontcall"],[8,"torture"],[9,"invalidargs"]]}},{header:t("HangupCause"),dataIndex:"hangupcause",hidden:!window.dialC,flex:2},{header:t("type"),dataIndex:"sipiax",renderer:Helper.Util.formatCallType,flex:2,filter:{type:"list",options:[[0,t("standard")],[1,t("sipcall")],[2,t("did")],[3,t("didvoip")],[4,t("callback")],[5,t("callcenter")],[6,"sms"],[7,t("transfer")]]}},{header:t("uniqueid"),dataIndex:"uniqueid",flex:3,hidden:true,hideable:true}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callfailedlist"],["component","box","container","panel","tablepanel","gridpanel","grid","callfailedlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callfailedlist:true},["widget.callfailedlist"],0,[MBilling.view.callFailed,"List"],0));(Ext.cmd.derive("MBilling.view.callFailed.Form",Ext.ux.form.Panel,{},0,["callfailedform"],["component","box","container","panel","form","callfailedform"],{component:true,box:true,container:true,panel:true,form:true,callfailedform:true},["widget.callfailedform"],0,[MBilling.view.callFailed,"Form"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerDay.Controller",Ext.ux.app.ViewController,{onEdit:function(){me=this;me.sumData=me.store.getData().items[0].getData();if(!me.sumData){return}me.formPanel.getForm().getFields().each(function(b){b.setValue(me.sumData[b.name])});me.formPanel.expand()}},0,0,0,0,["controller.callsummaryperday"],0,[MBilling.view.callSummaryPerDay,"Controller"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerDay.Module",Ext.ux.panel.Module,{controller:"callsummaryperday",titleDetails:t("total"),iconForm:"icon-sum",cfgEast:{flex:0.4}},0,["callsummaryperdaymodule"],["component","box","container","uxpanelmodule","callsummaryperdaymodule"],{component:true,box:true,container:true,uxpanelmodule:true,callsummaryperdaymodule:true},["widget.callsummaryperdaymodule"],0,[MBilling.view.callSummaryPerDay,"Module"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerDay.List",Ext.ux.grid.Panel,{store:"CallSummaryPerDay",initComponent:function(){var b=this;b.buttonImportCsv=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{header:t("day"),renderer:Ext.util.Format.dateRenderer("Y-m-d"),dataIndex:"day",filter:{type:"date",field:"day"},flex:3},{header:t("sessiontime")+" "+t("Min"),dataIndex:"sessiontime",flex:2},{header:t("aloc_all_calls"),dataIndex:"aloc_all_calls",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Answered Calls"),dataIndex:"nbcall",flex:3},{header:t("Failed Calls"),dataIndex:"nbcall_fail",flex:3},{header:t("buycost"),dataIndex:"buycost",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("sessionbill"),dataIndex:"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("markup"),dataIndex:"lucro",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("ASR"),dataIndex:"asr",renderer:Helper.Util.formatPorcente,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummaryperdaylist"],["component","box","container","panel","tablepanel","gridpanel","grid","callsummaryperdaylist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callsummaryperdaylist:true},["widget.callsummaryperdaylist"],0,[MBilling.view.callSummaryPerDay,"List"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerDay.Form",Ext.ux.form.Panel,{defaults:{},labelWidthFields:100,defaultType:"displayfield",initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{name:"sumsessiontime",fieldLabel:t("sessiontime")+" "+t("Min"),renderer:Ext.util.Format.numberRenderer("0"),allowBlank:true},{name:"sumsessionbill",fieldLabel:t("sessionbill"),renderer:Helper.Util.formatMoneyDecimal,allowBlank:true},{name:"sumbuycost",fieldLabel:t("buycost"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumlucro",fieldLabel:t("markup"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumnbcall",fieldLabel:t("Answered Calls"),allowBlank:true},{name:"sumnbcallfail",fieldLabel:t("Failed Calls"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummaryperdayform"],["component","box","container","panel","form","callsummaryperdayform"],{component:true,box:true,container:true,panel:true,form:true,callsummaryperdayform:true},["widget.callsummaryperdayform"],0,[MBilling.view.callSummaryPerDay,"Form"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerMonth.Controller",Ext.ux.app.ViewController,{onEdit:function(){me=this;me.sumData=me.store.getData().items[0].getData();if(!me.sumData){return}me.formPanel.getForm().getFields().each(function(b){b.setValue(me.sumData[b.name])});me.formPanel.expand()}},0,0,0,0,["controller.callsummarypermonth"],0,[MBilling.view.callSummaryPerMonth,"Controller"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerMonth.Module",Ext.ux.panel.Module,{controller:"callsummarypermonth",titleDetails:t("total"),iconForm:"icon-sum",cfgEast:{flex:0.4}},0,["callsummarypermonthmodule"],["component","box","container","uxpanelmodule","callsummarypermonthmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callsummarypermonthmodule:true},["widget.callsummarypermonthmodule"],0,[MBilling.view.callSummaryPerMonth,"Module"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerMonth.List",Ext.ux.grid.Panel,{store:"CallSummaryPerMonth",initComponent:function(){var b=this;b.buttonImportCsv=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{header:t("month"),dataIndex:"month",filter:{type:"date",field:"month",dateFormat:"Ym"},flex:3},{header:t("sessiontime")+" "+t("Min"),dataIndex:"sessiontime",flex:2},{header:t("aloc_all_calls"),dataIndex:"aloc_all_calls",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("nbcall"),dataIndex:"nbcall",flex:3},{header:t("buycost"),dataIndex:"buycost",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("sessionbill"),dataIndex:"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("markup"),dataIndex:"lucro",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarypermonthlist"],["component","box","container","panel","tablepanel","gridpanel","grid","callsummarypermonthlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callsummarypermonthlist:true},["widget.callsummarypermonthlist"],0,[MBilling.view.callSummaryPerMonth,"List"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerMonth.Form",Ext.ux.form.Panel,{defaults:{},labelWidthFields:100,defaultType:"displayfield",initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{name:"sumsessiontime",fieldLabel:t("sessiontime")+" "+t("Min"),renderer:Ext.util.Format.numberRenderer("0"),allowBlank:true},{name:"sumsessionbill",fieldLabel:t("sessionbill"),renderer:Helper.Util.formatMoneyDecimal,allowBlank:true},{name:"sumbuycost",fieldLabel:t("buycost"),renderer:Helper.Util.formatMoneyDecimal,hidden:App.user.isClient,allowBlank:true},{name:"sumlucro",fieldLabel:t("markup"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumnbcall",fieldLabel:t("nbcall"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarypermonthform"],["component","box","container","panel","form","callsummarypermonthform"],{component:true,box:true,container:true,panel:true,form:true,callsummarypermonthform:true},["widget.callsummarypermonthform"],0,[MBilling.view.callSummaryPerMonth,"Form"],0));(Ext.cmd.derive("MBilling.view.callSummaryMonthUser.Controller",Ext.ux.app.ViewController,{onEdit:function(){me=this;me.sumData=me.store.getData().items[0].getData();if(!me.sumData){return}me.formPanel.getForm().getFields().each(function(b){b.setValue(me.sumData[b.name])});me.formPanel.expand()}},0,0,0,0,["controller.callsummarymonthuser"],0,[MBilling.view.callSummaryMonthUser,"Controller"],0));(Ext.cmd.derive("MBilling.view.callSummaryMonthUser.Module",Ext.ux.panel.Module,{controller:"callsummarymonthuser",titleDetails:t("total"),iconForm:"icon-sum",cfgEast:{flex:0.4}},0,["callsummarymonthusermodule"],["component","box","container","uxpanelmodule","callsummarymonthusermodule"],{component:true,box:true,container:true,uxpanelmodule:true,callsummarymonthusermodule:true},["widget.callsummarymonthusermodule"],0,[MBilling.view.callSummaryMonthUser,"Module"],0));(Ext.cmd.derive("MBilling.view.callSummaryMonthUser.List",Ext.ux.grid.Panel,{store:"CallSummaryMonthUser",initComponent:function(){var b=this;b.buttonImportCsv=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{header:t("Month"),renderer:Ext.util.Format.dateRenderer("Y-m"),dataIndex:"month",filter:{type:"date",field:"month",dateFormat:"Ym"},flex:3},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("sessiontime")+" "+t("Min"),dataIndex:"sessiontime",flex:2},{header:t("aloc_all_calls"),dataIndex:"aloc_all_calls",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Answered Calls"),dataIndex:"nbcall",flex:3},{header:t("buycost"),dataIndex:App.user.isAdmin?"buycost":"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("sessionbill"),dataIndex:App.user.isAgent||App.user.isClientAgent?"agent_bill":"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("markup"),dataIndex:"lucro",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarymonthuserlist"],["component","box","container","panel","tablepanel","gridpanel","grid","callsummarymonthuserlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callsummarymonthuserlist:true},["widget.callsummarymonthuserlist"],0,[MBilling.view.callSummaryMonthUser,"List"],0));(Ext.cmd.derive("MBilling.view.callSummaryMonthUser.Form",Ext.ux.form.Panel,{defaults:{},labelWidthFields:100,defaultType:"displayfield",initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{name:"sumsessiontime",fieldLabel:t("sessiontime")+" "+t("Min"),renderer:Ext.util.Format.numberRenderer("0"),allowBlank:true},{name:App.user.isAgent||App.user.isClientAgent?"sumagent_bill":"sumsessionbill",fieldLabel:t("sessionbill"),renderer:Helper.Util.formatMoneyDecimal,allowBlank:true},{name:App.user.isAdmin?"sumbuycost":"sumsessionbill",fieldLabel:t("buycost"),renderer:Helper.Util.formatMoneyDecimal,hidden:App.user.isClient,allowBlank:true},{name:"sumlucro",fieldLabel:t("markup"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmint,allowBlank:true},{name:"sumnbcall",fieldLabel:t("nbcall"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarymonthuserform"],["component","box","container","panel","form","callsummarymonthuserform"],{component:true,box:true,container:true,panel:true,form:true,callsummarymonthuserform:true},["widget.callsummarymonthuserform"],0,[MBilling.view.callSummaryMonthUser,"Form"],0));(Ext.cmd.derive("MBilling.view.callSummaryMonthTrunk.Controller",Ext.ux.app.ViewController,{onEdit:function(){me=this;me.sumData=me.store.getData().items[0].getData();if(!me.sumData){return}me.formPanel.getForm().getFields().each(function(b){b.setValue(me.sumData[b.name])});me.formPanel.expand()}},0,0,0,0,["controller.callsummarymonthtrunk"],0,[MBilling.view.callSummaryMonthTrunk,"Controller"],0));(Ext.cmd.derive("MBilling.view.callSummaryMonthTrunk.Module",Ext.ux.panel.Module,{controller:"callsummarymonthtrunk",titleDetails:t("total"),iconForm:"icon-sum",cfgEast:{flex:0.4}},0,["callsummarymonthtrunkmodule"],["component","box","container","uxpanelmodule","callsummarymonthtrunkmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callsummarymonthtrunkmodule:true},["widget.callsummarymonthtrunkmodule"],0,[MBilling.view.callSummaryMonthTrunk,"Module"],0));(Ext.cmd.derive("MBilling.view.callSummaryMonthTrunk.List",Ext.ux.grid.Panel,{store:"CallSummaryMonthTrunk",initComponent:function(){var b=this;b.buttonImportCsv=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{header:t("Month"),renderer:Ext.util.Format.dateRenderer("Y-m"),dataIndex:"month",filter:{type:"date",field:"month",dateFormat:"Ym"},flex:3},{header:t("Trunk"),dataIndex:"idTrunktrunkcode",filter:{type:"string",field:"idTrunk.trunkcode"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("sessiontime")+" "+t("Min"),dataIndex:"sessiontime",flex:2},{header:t("aloc_all_calls"),dataIndex:"aloc_all_calls",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Answered Calls"),dataIndex:"nbcall",flex:3},{header:t("buycost"),dataIndex:"buycost",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("sessionbill"),dataIndex:"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("markup"),dataIndex:"lucro",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarymonthtrunklist"],["component","box","container","panel","tablepanel","gridpanel","grid","callsummarymonthtrunklist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callsummarymonthtrunklist:true},["widget.callsummarymonthtrunklist"],0,[MBilling.view.callSummaryMonthTrunk,"List"],0));(Ext.cmd.derive("MBilling.view.callSummaryMonthTrunk.Form",Ext.ux.form.Panel,{defaults:{},labelWidthFields:100,defaultType:"displayfield",initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{name:"sumsessiontime",fieldLabel:t("sessiontime")+" "+t("Min"),renderer:Ext.util.Format.numberRenderer("0"),allowBlank:true},{name:"sumsessionbill",fieldLabel:t("sessionbill"),renderer:Helper.Util.formatMoneyDecimal,allowBlank:true},{name:"sumbuycost",fieldLabel:t("buycost"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumlucro",fieldLabel:t("markup"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumnbcall",fieldLabel:t("nbcall"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarymonthtrunkform"],["component","box","container","panel","form","callsummarymonthtrunkform"],{component:true,box:true,container:true,panel:true,form:true,callsummarymonthtrunkform:true},["widget.callsummarymonthtrunkform"],0,[MBilling.view.callSummaryMonthTrunk,"Form"],0));(Ext.cmd.derive("MBilling.view.sms.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.sms"],0,[MBilling.view.sms,"Controller"],0));(Ext.cmd.derive("MBilling.view.sms.Module",Ext.ux.panel.Module,{controller:"sms"},0,["smsmodule"],["component","box","container","uxpanelmodule","smsmodule"],{component:true,box:true,container:true,uxpanelmodule:true,smsmodule:true},["widget.smsmodule"],0,[MBilling.view.sms,"Module"],0));(Ext.cmd.derive("MBilling.view.sms.List",Ext.ux.grid.Panel,{store:"Sms",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.allowUpdate=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("send"),dataIndex:"result",renderer:Helper.Util.formatBooleanSms,comboRelated:"statuscombo",flex:2,filter:{type:"list",options:[[0,t("error")],[1,t("sent")],[2,t("received")]]}},{header:t("destination"),dataIndex:"telephone",flex:2},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"date",flex:5},{header:t("description"),dataIndex:"sms",hidden:true,hideable:true,flex:6}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["smslist"],["component","box","container","panel","tablepanel","gridpanel","grid","smslist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,smslist:true},["widget.smslist"],0,[MBilling.view.sms,"List"],0));(Ext.cmd.derive("MBilling.view.sms.Form",Ext.ux.form.Panel,{fieldsHide:["id_user"],initComponent:function(){var b=this;b.items=[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:App.user.isClient},{xtype:"numberfield",name:"telephone",fieldLabel:t("number"),emptyText:"DDI DDD Nº",maxLength:16,minLength:11},{xtype:"textareafield",name:"sms",fieldLabel:t("sms"),maxLength:160}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["smsform"],["component","box","container","panel","form","smsform"],{component:true,box:true,container:true,panel:true,form:true,smsform:true},["widget.smsform"],0,[MBilling.view.sms,"Form"],0));(Ext.cmd.derive("MBilling.view.campaignPollInfo.Controller",Ext.ux.app.ViewController,{aliasChart:"campaignpollinfochart",onRenderModule:function(){var c=this,d=c.lookupReference("chart");Ext.ux.app.ViewController.prototype.onRenderModule.apply(this,arguments);c.store.on({scope:c,beforeload:function(){d.disable()},load:function(a){d.enable()}})},onChart:function(){var l=this,f=l.list.getStore(),m=l.list.filters.getFilterData(),j=false,g=false;if(!m){Ext.ux.Alert.alert("Alert",t("Use filters"),"information");return}Ext.each(m,function(a){if(a.field=="id_campaign_poll"){if(a.data.value.length==1){g=true}j=true;return}});if(!j){Ext.ux.Alert.alert("Alert",t("Select one or more poll to create a chart"),"information");return}l.chart=Ext.widget("window",{title:t("charts"),iconCls:"icon-chart-column",layout:"fit",autoShow:true,modal:true,resizable:false,width:window.isThemeNeptune?740:710,items:{xtype:l.aliasChart,titleText:g?f.getData().items[0].data.idCampaignPollname:"",list:l.list}})}},0,0,0,0,["controller.campaignpollinfo"],0,[MBilling.view.campaignPollInfo,"Controller"],0));(Ext.cmd.derive("MBilling.view.campaignPollInfo.Module",Ext.ux.panel.Module,{controller:"campaignpollinfo"},0,["campaignpollinfomodule"],["component","box","container","uxpanelmodule","campaignpollinfomodule"],{component:true,box:true,container:true,uxpanelmodule:true,campaignpollinfomodule:true},["widget.campaignpollinfomodule"],0,[MBilling.view.campaignPollInfo,"Module"],0));(Ext.cmd.derive("MBilling.view.campaignPollInfo.List",Ext.ux.grid.Panel,{store:"CampaignPollInfo",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.allowCreate=false;b.extraButtons=[{text:t("charts"),iconCls:"icon-chart-column",handler:"onChart",reference:"chart",disabled:true}];b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("number"),dataIndex:"number",flex:4},{xtype:"templatecolumn",tpl:"{idCampaignPollname}",header:t("poll"),dataIndex:"id_campaign_poll",comboFilter:"campaignpollcombo",flex:4},{header:t("result"),dataIndex:"resposta",flex:4},{header:t("description"),dataIndex:"obs",flex:4},{header:t("City"),dataIndex:"city",flex:4},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"date",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignpollinfolist"],["component","box","container","panel","tablepanel","gridpanel","grid","campaignpollinfolist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,campaignpollinfolist:true},["widget.campaignpollinfolist"],0,[MBilling.view.campaignPollInfo,"List"],0));(Ext.cmd.derive("MBilling.view.campaignPollInfo.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{name:"number",fieldLabel:t("number"),readOnly:true},{name:"resposta",fieldLabel:t("result"),readOnly:true},{xtype:"textareafield",name:"obs",fieldLabel:t("description"),allowBlank:true,maxLength:200}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignpollinfoform"],["component","box","container","panel","form","campaignpollinfoform"],{component:true,box:true,container:true,panel:true,form:true,campaignpollinfoform:true},["widget.campaignpollinfoform"],0,[MBilling.view.campaignPollInfo,"Form"],0));(Ext.cmd.derive("MBilling.view.campaignPollInfo.Chart",Ext.ux.panel.Chart,{controller:"campaignpollinfo",store:"CampaignPollInfoChart",fieldValue:"sumresposta",fieldDescription:"resposta2",labelYLine:t("countvotes"),labelXLine:t("result"),fieldLabel:"percentage",initComponent:function(){var d=this,c;if(window.newChartCampaignInfo){d.fieldDescription="resposta_name"}d.bbarChart=[{xtype:"tbtext",itemId:"tbTextSum",reference:"tbTextSum"}];d.store=Ext.data.StoreManager.lookup(d.store);d.store.setRemoteFilter(true);filters=d.list.filters.getFilterData();d.store.filter("filter",Ext.encode(filters));d.store.load({scope:d,callback:function(){if(d.store.getData().items[0]){d.sumData=d.store.getData().items[0].getData()}if(window.newChartCampaignInfo){d.lookupReference("tbTextSum").setText(d.sumData.total_votos)}}});Ext.ux.panel.Chart.prototype.initComponent.apply(this,arguments)}},0,["campaignpollinfochart"],["component","box","container","panel","chartpanel","campaignpollinfochart"],{component:true,box:true,container:true,panel:true,chartpanel:true,campaignpollinfochart:true},["widget.campaignpollinfochart"],0,[MBilling.view.campaignPollInfo,"Chart"],0));(Ext.cmd.derive("MBilling.view.campaignRestrictPhone.Controller",Ext.ux.app.ViewController,{onEdit:function(){var b=this;Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)},deleteDuplicados:function(e){var g=this,f=g.list.getStore(),j=g.list.filters.getFilterData().length?Ext.encode(g.getList().filters.getFilterData()):f.proxy.extraParams.filter;e.disable();g.list.setLoading(true);Ext.Msg.confirm("Confirm","Confirme que quer deletar os numeros duplicados?",function(a){if(a==="yes"){Ext.Ajax.request({url:"index.php/campaignRestrictPhone/deleteDuplicados/",params:{filter:j},scope:g,success:function(c){c=Ext.decode(c.responseText);if(c[g.nameSuccessRequest]){Ext.ux.Alert.alert(g.titleSuccess,c[g.nameMsgRequest],"success")}else{var b=Helper.Util.convertErrorsJsonToString(c[g.nameMsgRequest]);Ext.ux.Alert.alert(g.titleError,b,"error")}g.list.setLoading(false);e.enable()}})}})}},0,0,0,0,["controller.campaignrestrictphone"],0,[MBilling.view.campaignRestrictPhone,"Controller"],0));(Ext.cmd.derive("MBilling.view.campaignRestrictPhone.Module",Ext.ux.panel.Module,{controller:"campaignrestrictphone"},0,["campaignrestrictphonemodule"],["component","box","container","uxpanelmodule","campaignrestrictphonemodule"],{component:true,box:true,container:true,uxpanelmodule:true,campaignrestrictphonemodule:true},["widget.campaignrestrictphonemodule"],0,[MBilling.view.campaignRestrictPhone,"Module"],0));(Ext.cmd.derive("MBilling.view.campaignRestrictPhone.List",Ext.ux.grid.Panel,{store:"CampaignRestrictPhone",buttonImportCsv:true,initComponent:function(){var b=this;b.extraButtons=[{text:t("Eliminar Duplicados"),iconCls:"callshop",handler:"deleteDuplicados",disabled:false}];b.buttonUpdateLot=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("number"),dataIndex:"number",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignrestrictphonelist"],["component","box","container","panel","tablepanel","gridpanel","grid","campaignrestrictphonelist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,campaignrestrictphonelist:true},["widget.campaignrestrictphonelist"],0,[MBilling.view.campaignRestrictPhone,"List"],0));(Ext.cmd.derive("MBilling.view.campaignRestrictPhone.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{name:"number",fieldLabel:t("number")}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignrestrictphoneform"],["component","box","container","panel","form","campaignrestrictphoneform"],{component:true,box:true,container:true,panel:true,form:true,campaignrestrictphoneform:true},["widget.campaignrestrictphoneform"],0,[MBilling.view.campaignRestrictPhone,"Form"],0));(Ext.cmd.derive("MBilling.view.campaignRestrictPhone.ImportCsv",Ext.ux.window.ImportCsv,{htmlTipInfo:"
number
551135672677
551156332233
554153882200
"},0,["campaignrestrictphoneimportcsv"],["component","box","container","panel","window","campaignrestrictphoneimportcsv"],{component:true,box:true,container:true,panel:true,window:true,campaignrestrictphoneimportcsv:true},["widget.campaignrestrictphoneimportcsv"],0,[MBilling.view.campaignRestrictPhone,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.campaignLog.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.campaignlog"],0,[MBilling.view.campaignLog,"Controller"],0));(Ext.cmd.derive("MBilling.view.campaignLog.Module",Ext.ux.panel.Module,{controller:"campaignlog"},0,["campaignlogmodule"],["component","box","container","uxpanelmodule","campaignlogmodule"],{component:true,box:true,container:true,uxpanelmodule:true,campaignlogmodule:true},["widget.campaignlogmodule"],0,[MBilling.view.campaignLog,"Module"],0));(Ext.cmd.derive("MBilling.view.campaignLog.List",Ext.ux.grid.Panel,{store:"CampaignLog",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.buttonNew=false;b.allowUpdate=false;b.allowDelete=!App.user.isClient;b.columns=[{header:t("Total gerado"),dataIndex:"total",flex:4},{header:t("Loops"),dataIndex:"loops",flex:4},{header:t("Total por tronco"),dataIndex:"trunks",flex:4},{header:t("Campanhas"),dataIndex:"campaigns",flex:4},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"date",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignloglist"],["component","box","container","panel","tablepanel","gridpanel","grid","campaignloglist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,campaignloglist:true},["widget.campaignloglist"],0,[MBilling.view.campaignLog,"List"],0));(Ext.cmd.derive("MBilling.view.campaignLog.Form",Ext.ux.form.Panel,{bodyPadding:0,initComponent:function(){var b=this;b.items=[{name:"total",fieldLabel:t("total")}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignlogform"],["component","box","container","panel","form","campaignlogform"],{component:true,box:true,container:true,panel:true,form:true,campaignlogform:true},["widget.campaignlogform"],0,[MBilling.view.campaignLog,"Form"],0));(Ext.cmd.derive("MBilling.view.campaignSend.Module",Ext.form.Panel,{controller:"campaignsend",resizable:false,autoShow:true,header:false,initComponent:function(){var b=this;b.items=[{reference:"campaignSendPanel",xtype:"form",margin:"10 10 10 10",autoShow:true,closable:false,resizable:false,bodyPadding:10,defaultType:"textfield",defaults:{labelAlign:"right",labelWidth:150,width:280,allowBlank:false,msgTarget:"side",enableKeyEvents:true,plugins:"markallowblank",anchor:"100%"},items:[{xtype:"campaignsendcombo",name:"type",fieldLabel:t("campaign")+" "+t("type")},{name:"sms_text",fieldLabel:"SMS "+t("Text"),xtype:"textarea",height:100,anchor:"100%",allowBlank:true,hidden:true,maxLength:159},{xtype:"filefield",emptyText:"Select an audio file",fieldLabel:t("Audio file"),name:"audio_path",buttonText:"",buttonConfig:{iconCls:"upload-icon"},buttonText:t("Select Audio..."),allowBlank:true,hidden:true},{xtype:"filefield",emptyText:"Select an csv file",fieldLabel:t("CSV file"),name:"csv_path",allowBlank:true,hidden:true},{name:"numbers",fieldLabel:t("numbers"),xtype:"textarea",height:100,anchor:"100%",allowBlank:true,hidden:true},{xtype:"datefield",name:"startingdate",fieldLabel:t("Date"),format:"Y-m-d",value:new Date(),allowBlank:true,hidden:true},{xtype:"timefield",name:"startingtime",fieldLabel:t("Hour"),format:"H:i",value:"00:00",allowBlank:true,hidden:true}],bbar:[{width:"150px",text:t("Send"),tooltip:t("Send"),glyph:icons.disk,handler:"onSendCampaign"}]}];Ext.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignsendmodule"],["component","box","container","panel","form","campaignsendmodule"],{component:true,box:true,container:true,panel:true,form:true,campaignsendmodule:true},["widget.campaignsendmodule"],0,[MBilling.view.campaignSend,"Module"],0));(Ext.cmd.derive("MBilling.view.callShop.Controller",Ext.ux.app.ViewController,{sendActionNew:function(d){var c=this;d.disable();id=d.reference.split("_");getForm=c.lookupReference("cabina"+id[1]).getForm();Ext.Ajax.request({url:d.urlAction+"?id="+getForm.findField("id").getValue(),success:function(a){a=Ext.decode(a.responseText);if(a.success){Ext.ux.Alert.alert(c.titleSuccess,a[c.nameMsgRequest],"success")}else{Ext.ux.Alert.alert(c.titleError,errors,"error")}}});d.enable();storeCallShop=Ext.create("MBilling.store.CallShop",{remoteSort:false});storeCallShop.load({callback:function(a){c.onShowCabins(a,id[1],getForm)}})},onShowCabins:function(e,f,d){me=this;row=e[f-1];if(tab=me.lookupReference("tab"+f)){name=row.data.callerid.length<1?row.data.name:row.data.callerid;status=Helper.Util.formatBooleanFree(row.data.status);tab.setTitle(t("Cabina")+" "+f+" - "+name+" "+status);tab.setVisible(true);d.loadRecord(row)}},reportCallshopClientNew:function(d){var c=this;id=d.reference.split("_");getForm=c.lookupReference("cabina"+id[1]).getForm();columns=Ext.encode([{header:t("Number"),dataIndex:"calledstation"},{header:t("Time"),dataIndex:"sessiontime"},{header:t("Total"),dataIndex:"price"}]);filter=Ext.encode([{type:"string",comparison:"eq",value:getForm.findField("name").getValue(),field:"cabina"},{type:"list",value:[0],field:"status"}]);values="columns="+columns+"&filter="+filter+"&sort=[]&group=&orientation=P";url="index.php/callShopCdr/report/?"+values;window.open(url)},sendAction:function(f){var j=this,e=j.list.getSelectionModel().getSelection()[0],g=Ext.encode([{type:"string",comparison:"eq",value:e.get("name"),field:"cabina"},{type:"list",value:[0],field:"status"}]);j.formPanel.setLoading(true);Ext.Ajax.request({url:f.urlAction,params:{filter:g},success:function(b){b=Ext.decode(b.responseText);var a=Helper.Util.convertErrorsJsonToString(b[j.nameMsgRequest]),d=j.list.getStore(),c=j.list.getSelectionModel();if(b.success){j.onEdit();d.load({callback:function(){c.select(d.findExact("id",e.get("id")));j.formPanel.setLoading(false)}});Ext.ux.Alert.alert(j.titleSuccess,b[j.nameMsgRequest],"success")}else{Ext.ux.Alert.alert(j.titleError,a,"error");j.formPanel.setLoading(false);c.select(d.findExact("id",e.get("id")))}}})},onEdit:function(){if(!this.list.getSelectionModel().getSelection().length){return}var q=this,r=q.list.getSelectionModel().getSelection()[0],n=[{type:"string",comparison:"eq",value:r.get("name"),field:"cabina"},{type:"list",value:[0],field:"status"}],u=q.formPanel.down("callshopcdrlist").getStore(),v=q.formPanel.down("#priceSum"),m=u.proxy.extraParams.filter,p=q.formPanel.down("#charge"),s=q.formPanel.down("#release"),o=q.formPanel.down("#print");v.setText(" "+t("pricesum")+" 0.00");q.formPanel.expand();p.enable();s.enable();o.enable();u.proxy.extraParams.filter=n;u.load({callback:function(a){if(a){a[0]&&v.setText(" "+t("pricesum")+" "+t("moedasimblo")+" "+a[0].get("priceSum")+" ")}}});console.log(r.get("callerid")+", "+r.get("name"));u.defaultFilter=m;q.showHideFields();q.focusFirstField()},reportCallshopClient:function(E){var w=this,s=window.isDesktop&&App.desktop,y=!window.isDesktop&&w.list.module.ownerCt,v=w.formPanel.down("callshopcdrlist").getStore(),x=v.sorters.items,A=w.list.getSelectionModel().getSelection()[0],F=Ext.encode([{type:"string",comparison:"eq",value:A.get("name"),field:"cabina"},{type:"list",value:[0],field:"status"}]),u=w.store.getGroupField(),B=w.formPanel.down("callshopcdrlist").columns,G="desc",D=w.formPanel.down("callshopcdrlist").getStore().getProxy().api.report,H,z=[],C=[];Ext.each(x,function(a){z.push(a.property+" "+(a.direction||"ASC"))});Ext.each(B,function(a){if(a.hidden===false&&a.isCheckerHd!==true){if(a.dataIndex===u){C.splice(0,0,{header:a.text,dataIndex:a.dataIndex})}else{C.push({header:a.text,dataIndex:a.dataIndex})}}});values="columns="+Ext.encode(C)+"&filter="+F+"&sort="+Ext.encode(z)+"&group="+u+"&orientation="+G;url="index.php/callShopCdr/report/?"+values;window.open(url)}},0,0,0,0,["controller.callshop"],0,[MBilling.view.callShop,"Controller"],0));(Ext.cmd.derive("MBilling.view.callShop.Module",Ext.ux.panel.Module,{controller:"callshop",cfgEast:{flex:4},collapsedForm:false,collapsibleForm:false},0,["callshopmodule"],["component","box","container","uxpanelmodule","callshopmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callshopmodule:true},["widget.callshopmodule"],0,[MBilling.view.callShop,"Module"],0));(Ext.cmd.derive("MBilling.view.callShop.Module2",Ext.form.Panel,{controller:"callshop",resizable:false,autoShow:true,header:false,autoScroll:true,initComponent:function(){var b=this;b.layout={type:"table",columns:3,tdAttrs:{style:"padding: 3px; vertical-align: top;"}};b.defaults={xtype:"panel",height:268,width:((Ext.Element.getViewportWidth()-200)/3)-10,closable:false,collapsible:true,frame:true};b.items=b.onMountPanels();storeCallShop=Ext.create("MBilling.store.CallShop",{remoteSort:false});if(!App.user.isClient){Ext.form.Panel.prototype.initComponent.apply(this,arguments);return}else{b.handler=setInterval(function(){storeCallShop.load({callback:function(a){b.onShowCabins(a)}})},5000);Ext.form.Panel.prototype.initComponent.apply(this,arguments);storeCallShop.load({callback:function(a){b.onShowCabins(a)}})}},onMountPanels:function(){me=this,items=[];if(!App.user.isClient){return}for(i=1;i<=12;i++){items.push({xtype:"tabpanel",reference:"tab"+i,title:t("Cabina")+i,collapsed:i>3,items:[{reference:"cabina"+i,title:t("Cabina"),xtype:"form",bodyPadding:10,defaults:{xtype:"displayfield",labelWidth:85},items:[{name:"id",hidden:true},{name:"name",hidden:true},{xtype:"fieldcontainer",layout:"hbox",items:[{xtype:"displayfield",fieldLabel:t("Number"),name:"callshopnumber",labelAlign:"right",labelWidth:50,renderer:function(b){return''+b+""},flex:2},{labelAlign:"right",labelWidth:90,xtype:"displayfield",readOnly:true,fieldLabel:t("total"),name:"total",labelStyle:"font-size:18px!important;font-weight:bold;",renderer:function(b){format=Ext.util.Format.numberRenderer("0."+App.user.decimalPrecision);return''+App.user.currency+" "+format(b)+""},flex:3}]},{fieldLabel:t("Destination"),name:"destination"},{fieldLabel:t("Price minute"),name:"price_min",renderer:Helper.Util.formatMoneyDecimal},{fieldLabel:t("Duration"),name:"callshoptime",renderer:Helper.Util.formatsecondsToTime},{border:false,xtype:"toolbar",hidden:me.hideBbar,dock:"bottom",items:[{bodyPadding:10,width:"33%",text:t("Charge"),itemId:"charge",iconCls:"buycredit",handler:"sendActionNew",reference:"cobrar_"+i,urlAction:"index.php/callShop/cobrar"},{width:"33%",text:t("Release"),itemId:"release",iconCls:"release",handler:"sendActionNew",reference:"liberar_"+i,urlAction:"index.php/callShop/liberar",hidden:window.releaseButton},{width:"33%",text:t("Print"),itemId:"print",iconCls:"icon-print",handler:"reportCallshopClientNew",reference:"report_"+i,urlAction:"index.php/callShop/report"}]}]},{reference:"history_"+i,tooltip:"history_"+i,iconCls:"x-fa fa-refresh",title:t("History"),autoScroll:true,items:[{xtype:"callshopcdrlist",buttonCsv:false,autoScroll:true,filterableColumns:false,buttonCleanFilter:false,autoLoadStore:false,border:false,allowCreate:false,allowUpdate:false,allowDelete:false,buttonUpdateLot:false,pagination:false,allowPrint:false,columnsHide:["cabina","destination","status","buycost","markup","date"],store:Ext.create("MBilling.store.CallShopCdr",{remoteFilter:true})}],tabConfig:{listeners:{click:function(b){id=b.tooltip.split("_");panel=me.lookupReference("history_"+id[1]);storeCallshopcdr=panel.down("callshopcdrlist").getStore();filterCabina=[{type:"string",comparison:"eq",value:me.lookupReference("cabina"+id[1]).getForm().findField("name").getValue(),field:"cabina"},{type:"list",value:[0],field:"status"}];storeCallshopcdr.load({filter:filterCabina,params:{filters:Ext.encode(filterCabina)},limit:70})}}}}]})}return items},onShowCabins:function(b){me=this,i=1;Ext.each(b,function(a){if(tab=me.lookupReference("tab"+i)){name=a.data.callerid.length<1?a.data.name:a.data.callerid;status=Helper.Util.formatBooleanFree(a.data.status);tab.setTitle(t("Cabina")+" "+i+" - "+name+" "+status);tab.setVisible(true);me.lookupReference("cabina"+i).getForm().loadRecord(a)}i++});for(i=b.length+1;i<=12;i++){tab=me.lookupReference("tab"+i).setVisible(false)}}},0,["callshop2module"],["component","box","container","panel","form","callshop2module"],{component:true,box:true,container:true,panel:true,form:true,callshop2module:true},["widget.callshop2module"],0,[MBilling.view.callShop,"Module2"],0));(Ext.cmd.derive("MBilling.view.callShop.List",Ext.ux.grid.Panel,{store:"CallShop",viewConfig:{loadMask:false,emptyText:'
'+t("No record found")+"
",getRowClass:function(b){if(App.user.l=="callshop"){if(b.get("status")==1){return"callshoFree"}else{if(b.get("status")==0){return"callshoBlock"}else{if(b.get("status")==2){return"callshoInUse"}else{if(b.get("status")==3){return"callshoInCall"}}}}}}},refreshTime:4,initComponent:function(){var b=this;b.buttonCsv=false;b.buttonUpdateLot=false;b.allowCreate=true;b.allowUpdate=true;b.allowDelete=true;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.allowPrint=false;b.buttonDeleteWidth=140;b.refreshTime=(localStorage&&localStorage.getItem("callshopfresh"))||b.refreshTime;b.extraButtons=[{xtype:"numberfield",field:"jmlhBrg",fieldLabel:t("Refresh Time"),editable:false,minValue:3,labelWidth:90,width:150,selectOnFocus:true,allowDecimals:true,decimalPrecision:2,value:b.refreshTime,listeners:{change:function(a){if(a.value>0){b.refreshTime=a.value;localStorage.setItem("callshopfresh",a.value)}}}}];b.columns=[{header:t("cabina"),dataIndex:"callerid",flex:4},{header:t("status"),dataIndex:"status",renderer:Helper.Util.formatBooleanFree,flex:3,filter:{type:"list",options:[[1,t("free")],[2,t("inuse")],[0,t("blocked")],[3,t("calling")]]}},{header:t("number"),dataIndex:"callshopnumber",flex:4},{header:t("Destino"),dataIndex:"callshopdestination",hidden:App.user.l!="callshop",flex:6},{header:t("sessiontime"),dataIndex:"callshoptime",renderer:Helper.Util.formatsecondsToTime,flex:3}];b.sessionLoad=Ext.create("Ext.util.DelayedTask",function(){b.store.load()},b);Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments);b.store.on("load",b.onLoadStore,b)},onLoadStore:function(){var b=this;b.onDeactivateModule();b.onActivateModule()},onRender:function(){var b=this;b.module.on("activate",b.onActivateModule,b);b.module.on("deactivate",b.onDeactivateModule,b);b.module.on("close",b.onCloseModule,b);Ext.ux.grid.Panel.prototype.onRender.apply(this,arguments)},onActivateModule:function(){this.sessionLoad&&this.sessionLoad.delay(this.refreshTime*1000)},onDeactivateModule:function(){this.sessionLoad&&this.sessionLoad.cancel()},onCloseModule:function(){this.onDeactivateModule();this.sessionLoad=null}},0,["callshoplist"],["component","box","container","panel","tablepanel","gridpanel","grid","callshoplist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callshoplist:true},["widget.callshoplist"],0,[MBilling.view.callShop,"List"],0));(Ext.cmd.derive("MBilling.view.callShop.Form",Ext.ux.form.Panel,{hideTbar:true,labelWidthFields:"60%",bodyPadding:1,layout:"fit",buttonsTbar:[{xtype:"tbtext",itemId:"priceSum"},"->",{text:"Cobrar",itemId:"charge",iconCls:"buycredit",urlAction:"index.php/callShop/cobrar",disabled:true,handler:"sendAction",width:100},{text:"Liberar",itemId:"release",iconCls:"release",urlAction:"index.php/callShop/liberar",disabled:true,handler:"sendAction",width:100},{text:t("Print"),itemId:"print",glyph:icons.print,urlAction:"index.php/callShop/report",disabled:true,handler:"reportCallshopClient",width:100}],initComponent:function(){var b=this;b.items=[{xtype:"callshopcdrlist",buttonCsv:false,filterableColumns:false,buttonCleanFilter:false,autoLoadStore:false,border:true,allowCreate:false,allowUpdate:false,allowDelete:false,buttonUpdateLot:false,pagination:false,allowPrint:false,columnsHide:["status","buycost","markup"],store:Ext.create("MBilling.store.CallShopCdr",{remoteSort:false})}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callshopform"],["component","box","container","panel","form","callshopform"],{component:true,box:true,container:true,panel:true,form:true,callshopform:true},["widget.callshopform"],0,[MBilling.view.callShop,"Form"],0));(Ext.cmd.derive("MBilling.view.callShopCdr.Controller",Ext.ux.app.ViewController,{formHidden:true},0,0,0,0,["controller.callshopcdr"],0,[MBilling.view.callShopCdr,"Controller"],0));(Ext.cmd.derive("MBilling.view.callShopCdr.Module",Ext.ux.panel.Module,{controller:"callshopcdr"},0,["callshopcdrmodule"],["component","box","container","uxpanelmodule","callshopcdrmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callshopcdrmodule:true},["widget.callshopcdrmodule"],0,[MBilling.view.callShopCdr,"Module"],0));(Ext.cmd.derive("MBilling.view.callShopCdr.List",Ext.ux.grid.Panel,{store:"CallShopCdr",initComponent:function(){var b=this;b.buttonCsv=false;b.buttonUpdateLot=false;b.allowUpdate=true;b.allowDelete=false;b.allowCreate=false;b.allowUpdate=false;b.allowPrint=false;b.columns=[{header:t("cabina"),dataIndex:"cabina",filter:{type:"string"},flex:2},{header:t("number"),dataIndex:"calledstation",filter:{type:"string"},flex:3},{dataIndex:"destination",header:t("destination"),flex:3},{header:"Pago",dataIndex:"status",renderer:Helper.Util.formattyyesno,flex:2,filter:{type:"list",options:[[0,t("no")],[1,t("yes")]]}},{header:t("buyrate"),dataIndex:"buycost",renderer:Helper.Util.formatMoneyDecimal,flex:2},{header:t("rateinitial"),dataIndex:"price",renderer:Helper.Util.formatMoneyDecimal,flex:2},{header:t("markup"),dataIndex:"markup",renderer:Ext.util.Format.numberRenderer("0.00 %"),flex:2},{header:t("sessiontime"),dataIndex:"sessiontime",renderer:Helper.Util.formatsecondsToTime,flex:2},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"date",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callshopcdrlist"],["component","box","container","panel","tablepanel","gridpanel","grid","callshopcdrlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callshopcdrlist:true},["widget.callshopcdrlist"],0,[MBilling.view.callShopCdr,"List"],0));(Ext.cmd.derive("MBilling.view.callShopCdr.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:App.user.isClient}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callshopcdrform"],["component","box","container","panel","form","callshopcdrform"],{component:true,box:true,container:true,panel:true,form:true,callshopcdrform:true},["widget.callshopcdrform"],0,[MBilling.view.callShopCdr,"Form"],0));(Ext.cmd.derive("MBilling.view.rateCallshop.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.ratecallshop"],0,[MBilling.view.rateCallshop,"Controller"],0));(Ext.cmd.derive("MBilling.view.rateCallshop.Module",Ext.ux.panel.Module,{controller:"ratecallshop"},0,["ratecallshopmodule"],["component","box","container","uxpanelmodule","ratecallshopmodule"],{component:true,box:true,container:true,uxpanelmodule:true,ratecallshopmodule:true},["widget.ratecallshopmodule"],0,[MBilling.view.rateCallshop,"Module"],0));(Ext.cmd.derive("MBilling.view.rateCallshop.List",Ext.ux.grid.Panel,{store:"RateCallshop",buttonImportCsv:true,initComponent:function(){var b=this;b.buttonImportCsv=App.user.isClient,b.buttonCsv=App.user.isClient;b.allowPrint=App.user.isClient;b.buttonUpdateLot=App.user.isClient;b.allowCreate=App.user.isClient;b.allowUpdate=App.user.isClient;b.allowDelete=App.user.isClient;b.buttonUpdateLotCallShopRate=App.user.isClient;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("dialprefix"),dataIndex:"dialprefix",filter:{type:"string"},flex:2},{header:t("destination"),dataIndex:"destination",flex:3},{header:t("rateinitial"),dataIndex:"buyrate",renderer:Helper.Util.formatMoneyDecimal4,flex:2},{header:t("buyrateinitblock"),dataIndex:"minimo",flex:2},{header:t("buyrateincrement"),dataIndex:"block",flex:2}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["ratecallshoplist"],["component","box","container","panel","tablepanel","gridpanel","grid","ratecallshoplist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,ratecallshoplist:true},["widget.ratecallshoplist"],0,[MBilling.view.rateCallshop,"List"],0));(Ext.cmd.derive("MBilling.view.rateCallshop.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{xtype:"numberfield",name:"dialprefix",fieldLabel:t("prefix")},{name:"destination",fieldLabel:t("destination")},{xtype:"moneyfield",name:"buyrate",fieldLabel:t("rateinitial")},{xtype:"numberfield",name:"minimo",value:1,minValue:1,fieldLabel:t("buyrateinitblock")},{xtype:"numberfield",name:"block",value:1,minValue:1,fieldLabel:t("buyrateincrement")},{xtype:"numberfield",name:"minimal_time_charge",value:0,minValue:0,fieldLabel:t("Minimal time to charge")}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["ratecallshopform"],["component","box","container","panel","form","ratecallshopform"],{component:true,box:true,container:true,panel:true,form:true,ratecallshopform:true},["widget.ratecallshopform"],0,[MBilling.view.rateCallshop,"Form"],0));(Ext.cmd.derive("MBilling.view.rateCallshop.ImportCsv",Ext.ux.window.ImportCsv,{htmlTipInfo:"
"+t("dialprefix")+", "+t("destination")+", "+t("rateinitial")+"
5511, Brasil SP, 0.080
34, Spain Fix, 0.056
54, Argentina, 0.025

"+t("rateinitial")+" "+t("and")+" "+t("buyrate")+""},0,["ratecallshopimportcsv"],["component","box","container","panel","window","ratecallshopimportcsv"],{component:true,box:true,container:true,panel:true,window:true,ratecallshopimportcsv:true},["widget.ratecallshopimportcsv"],0,[MBilling.view.rateCallshop,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.callSummaryCallShop.Controller",MBilling.view.callSummaryPerDay.Controller,{aliasChart:"callsummarycallshopchart"},0,0,0,0,["controller.callsummarycallshop"],0,[MBilling.view.callSummaryCallShop,"Controller"],0));(Ext.cmd.derive("MBilling.view.callSummaryCallShop.Module",Ext.ux.panel.Module,{controller:"callsummarycallshop",titleForm:t("total"),iconForm:"icon-sum",widthForm:250},0,["callsummarycallshopmodule"],["component","box","container","uxpanelmodule","callsummarycallshopmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callsummarycallshopmodule:true},["widget.callsummarycallshopmodule"],0,[MBilling.view.callSummaryCallShop,"Module"],0));(Ext.cmd.derive("MBilling.view.callSummaryCallShop.List",Ext.ux.grid.Panel,{store:"CallSummaryCallShop",initComponent:function(){var b=this;b.buttonImportCsv=false;b.buttonCsv=false;b.allowPrint=false;b.buttonUpdateLot=false;b.allowCreate=false;b.buttonCleanFilter=false;b.allowUpdate=false;b.allowDelete=false;b.extraButtons=[{text:t("charts"),iconCls:"icon-chart-column",handler:"onChart",reference:"chart",disabled:false,hidden:App.user.isClient}];b.collapsedExtraFilters=false;b.titleAddFilter=t("Filter");b.extraFilters=[{field:"t.cabina",label:t("cabina"),type:"string"},{field:"t.calledstation",label:t("prefix"),type:"string"}];b.columns=[{header:t("day"),renderer:Ext.util.Format.dateRenderer("Y-m-d"),dataIndex:"day",filter:{type:"date",field:"date"},flex:3},{menuDisabled:true,header:t("sessiontime")+" "+t("Min"),dataIndex:"sessiontime",flex:2},{menuDisabled:true,header:t("aloc_all_calls"),dataIndex:"aloc_all_calls",renderer:Helper.Util.formatsecondsToTime,flex:3},{menuDisabled:true,header:t("nbcall"),dataIndex:"nbcall",flex:3},{menuDisabled:true,header:t("buycost"),dataIndex:"buycost",renderer:Helper.Util.formatMoneyDecimal,flex:3,hideable:false,hidden:!App.user.isClient},{menuDisabled:true,header:t("sessionbill"),dataIndex:"price",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:!App.user.isClient},{menuDisabled:true,header:t("markup"),dataIndex:"lucro",renderer:Helper.Util.formatMoneyDecimal,flex:3,hideable:false,hidden:!App.user.isClient}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarycallshoplist"],["component","box","container","panel","tablepanel","gridpanel","grid","callsummarycallshoplist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callsummarycallshoplist:true},["widget.callsummarycallshoplist"],0,[MBilling.view.callSummaryCallShop,"List"],0));(Ext.cmd.derive("MBilling.view.callSummaryCallShop.Form",Ext.ux.form.Panel,{defaults:{},labelWidthFields:150,defaultType:"displayfield",initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{name:"sumsessiontime",fieldLabel:t("sessiontime")+" "+t("Min")},{name:"sumprice",fieldLabel:t("sessionbill"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isClient},{name:"sumlucro",fieldLabel:t("markup"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isClient},{name:"sumbuycost",fieldLabel:t("buycost"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isClient},{name:"sumnbcall",fieldLabel:t("nbcall"),hidden:!App.user.isClient}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarycallshopform"],["component","box","container","panel","form","callsummarycallshopform"],{component:true,box:true,container:true,panel:true,form:true,callsummarycallshopform:true},["widget.callsummarycallshopform"],0,[MBilling.view.callSummaryCallShop,"Form"],0));(Ext.cmd.derive("MBilling.view.callSummaryCallShop.Chart",Ext.ux.panel.Chart,{controller:"callsummarycallshop",store:"CallSummaryCallShop",fieldValue:"sessiontime",fieldDescription:"day",labelYLine:t("sessiontime")+" Min",labelXLine:t("day"),initComponent:function(){var d=this,c;d.rendererFieldValue=Ext.util.Format.numberRenderer("0"),d.rendererFieldDescription=Ext.util.Format.dateRenderer("Y-m-d");d.tbarChart=[{xtype:"buttongroup",toggleGroup:"charts",defaults:{enableToggle:true,toggleGroup:"charts",allowDepress:false,listeners:{toggle:"onToggleGroupButton"}},items:[{pressed:true,text:t("sessiontime"),chart:"sessiontime",sumName:"sumsessiontime"},{text:t("buycost"),sumRenderer:Helper.Util.formatMoneyDecimal,chart:"buycost",sumName:"sumbuycost"},{text:t("sessionbill"),sumRenderer:Helper.Util.formatMoneyDecimal,chart:"price",sumName:"sumprice"},{text:t("markup"),sumRenderer:Helper.Util.formatMoneyDecimal,chart:"lucro",sumName:"sumlucro",hidden:App.user.isClient||App.user.isAgent},{text:t("nbcall"),chart:"nbcall",sumName:"sumnbcall"}]}];d.bbarChart=[{xtype:"tbtext",itemId:"tbTextSum"}];Ext.ux.panel.Chart.prototype.initComponent.apply(this,arguments)}},0,["callsummarycallshopchart"],["component","box","container","panel","chartpanel","callsummarycallshopchart"],{component:true,box:true,container:true,panel:true,chartpanel:true,callsummarycallshopchart:true},["widget.callsummarycallshopchart"],0,[MBilling.view.callSummaryCallShop,"Chart"],0));(Ext.cmd.derive("MBilling.view.buycredit.Controller",Ext.ux.app.ViewController,{buyCreditClose:function(e){var j=this,g=j.lookupReference("buycreditPanel"),f=j.lookupReference("btnCancel");g.getForm().findField("amount")["show"]();g.getForm().findField("method")["show"]();g.getForm().findField("card_num")["hide"]();g.getForm().findField("exp_date")["hide"]();g.getForm().findField("method").setValue("");f.setVisible(false)},buyCredit:function(r){var o=this,n=o.lookupReference("buycreditPanel"),s=o.lookupReference("btnCancel"),p=n.getForm().findField("amount").getValue(),l=n.getForm().findField("method").getValue(),m=n.getForm().findField("card_num").getValue(),q=n.getForm().findField("exp_date").rawValue;if(n.getForm().findField("method").rawValue.match(/uthorize/)){if(m){n.setLoading(o.msgWait);Ext.Ajax.request({url:"index.php/buyCredit/method/?amount="+p+"&id_method="+l+"&cc="+m+"&ed="+q,scope:o,success:function(a){a=Ext.decode(a.responseText);if(a.success){Ext.ux.Alert.alert(t("Success"),a.msg,"success",10000);n.setLoading(false);n.getForm().findField("amount")["show"]();n.getForm().findField("method")["show"]();n.getForm().findField("card_num")["hide"]();n.getForm().findField("exp_date")["hide"]();s.setVisible(false);n.getForm().findField("card_num").setValue("");n.getForm().findField("exp_date").setValue("");n.getForm().findField("method").setValue("")}else{Ext.ux.Alert.alert(t("Error"),a.msg,"error");n.getForm().findField("card_num").setValue("");n.getForm().findField("exp_date").setValue("");n.setLoading(false)}}});return}else{n.getForm().findField("amount")["hide"]();n.getForm().findField("method")["hide"]();n.getForm().findField("card_num")["show"]();n.getForm().findField("exp_date")["show"]();s.setVisible(true);n.getForm().findField("card_num").focus()}}else{if(!l){Ext.ux.Alert.alert(o.titleWarning,t("Select a ")+t("paymentmethods"),"warning");return}else{if(p<=0){Ext.ux.Alert.alert(o.titleWarning,t("Select a ")+t("valid")+" "+t("amount"),"warning");return}else{url="index.php/buyCredit/method/?amount="+p+"&id_method="+l;n.getForm().findField("method").setValue("");n.getForm().findField("card_num").setValue("");n.getForm().findField("exp_date").setValue("");if(n.getForm().findField("method").rawValue.match(/PlacetoPay/)){window.open(url,"_self")}else{window.open(url,"_blank")}}}}}},0,0,0,0,["controller.buycredit"],0,[MBilling.view.buycredit,"Controller"],0));(Ext.cmd.derive("MBilling.view.buycredit.Module",Ext.form.Panel,{controller:"buycredit",resizable:false,autoShow:true,header:false,initComponent:function(){var b=this;b.items=[{reference:"buycreditPanel",xtype:"form",margin:"10 10 10 10",autoShow:true,closable:false,resizable:false,bodyPadding:10,defaultType:"textfield",defaults:{labelAlign:"right",labelWidth:150,width:280,allowBlank:false,msgTarget:"side",enableKeyEvents:true,plugins:"markallowblank",anchor:"100%"},items:[{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,00",fieldLabel:t("Amounts"),value:0,name:"amount"},{xtype:"methodpaycombo",fieldLabel:t("paymentmethods"),name:"method"},{fieldLabel:t("CreditCard Number"),name:"card_num",hidden:true},{xtype:"datefield",fieldLabel:t("Expiration Date"),name:"exp_date",format:"m/y",hidden:true}],bbar:[{text:t("Cancel"),tooltip:t("Cancel"),glyph:b.glyphCancel,handler:"buyCreditClose",hidden:true,reference:"btnCancel"},{text:t("Next"),tooltip:t("Next"),width:100,glyph:icons.disk,handler:"buyCredit"}]}];Ext.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["buycreditmodule"],["component","box","container","panel","form","buycreditmodule"],{component:true,box:true,container:true,panel:true,form:true,buycreditmodule:true},["widget.buycreditmodule"],0,[MBilling.view.buycredit,"Module"],0));(Ext.cmd.derive("MBilling.view.transferToMobile.Module",Ext.form.Panel,{resizable:false,autoShow:true,header:false,items:[{xtype:"component",autoEl:{width:"100%",height:"100%",tag:"iframe",src:"index.php/transferToMobile/read"}}]},0,["transfertomobilemodule"],["component","box","container","panel","form","transfertomobilemodule"],{component:true,box:true,container:true,panel:true,form:true,transfertomobilemodule:true},["widget.transfertomobilemodule"],0,[MBilling.view.transferToMobile,"Module"],0));(Ext.cmd.derive("MBilling.view.firewall.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.firewall"],0,[MBilling.view.firewall,"Controller"],0));(Ext.cmd.derive("MBilling.view.firewall.Module",Ext.ux.panel.Module,{controller:"firewall"},0,["firewallmodule"],["component","box","container","uxpanelmodule","firewallmodule"],{component:true,box:true,container:true,uxpanelmodule:true,firewallmodule:true},["widget.firewallmodule"],0,[MBilling.view.firewall,"Module"],0));(Ext.cmd.derive("MBilling.view.firewall.List",Ext.ux.grid.Panel,{store:"Firewall",initComponent:function(){var b=this;b.textDelete="Unban";b.textNew="Ban new Ip";b.buttonCsv=false;b.buttonUpdateLot=false;b.buttonCleanFilter=true;b.allowPrint=false;b.allowCreate=true;b.allowDelete=true;b.columns=[{header:t("Ip"),dataIndex:"ip",flex:4},{header:t("Type"),dataIndex:"jail",flex:4},{header:t("Permanently")+" "+t("Ban"),dataIndex:"action",renderer:Helper.Util.formattyyesno,filter:{type:"list",options:[[0,t("no")],[1,t("yes")]]},flex:2}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["firewalllist"],["component","box","container","panel","tablepanel","gridpanel","grid","firewalllist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,firewalllist:true},["widget.firewalllist"],0,[MBilling.view.firewall,"List"],0));(Ext.cmd.derive("MBilling.view.firewall.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{name:"ip",fieldLabel:t("Ip"),vtype:"IPAddress"},{xtype:"yesnocombo",fieldLabel:t("Permanently")+" "+t("Ban"),name:"action"},{xtype:"textarea",name:"description",fieldLabel:t("description"),allowBlank:true,height:300,anchor:"100%",readOnly:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["firewallform"],["component","box","container","panel","form","firewallform"],{component:true,box:true,container:true,panel:true,form:true,firewallform:true},["widget.firewallform"],0,[MBilling.view.firewall,"Form"],0));(Ext.cmd.derive("MBilling.view.userRate.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.userrate"],0,[MBilling.view.userRate,"Controller"],0));(Ext.cmd.derive("MBilling.view.userRate.Module",Ext.ux.panel.Module,{controller:"userrate"},0,["userratemodule"],["component","box","container","uxpanelmodule","userratemodule"],{component:true,box:true,container:true,uxpanelmodule:true,userratemodule:true},["widget.userratemodule"],0,[MBilling.view.userRate,"Module"],0));(Ext.cmd.derive("MBilling.view.userRate.List",Ext.ux.grid.Panel,{store:"UserRate",initComponent:function(){var b=this;b.buttonCsv=false;b.allowPrint=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("prefix"),dataIndex:"idPrefixprefix",flex:window.isTablet?2:3},{dataIndex:"idPrefixdestination",header:t("destination"),flex:window.isTablet?2:3},{header:t("rateinitial"),dataIndex:"rateinitial",renderer:Helper.Util.formatMoneyDecimal,flex:2},{header:t("initblock"),dataIndex:"initblock",flex:2},{header:t("billingblock"),dataIndex:"billingblock",flex:2}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["userratelist"],["component","box","container","panel","tablepanel","gridpanel","grid","userratelist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,userratelist:true},["widget.userratelist"],0,[MBilling.view.userRate,"List"],0));(Ext.cmd.derive("MBilling.view.userRate.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{fieldLabel:t("User"),name:"id_user",xtype:!App.user.isAdmin?"textfield":"userlookup",ownerForm:b,hidden:!App.user.isAdmin,allowBlank:!App.user.isAdmin},{fieldLabel:t("Destination"),name:"id_prefix",xtype:"prefixlookup",ownerForm:b,hidden:!App.user.isAdmin,allowBlank:!App.user.isAdmin},{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,"+App.user.decimalPrecision,name:"rateinitial",fieldLabel:t("rateinitial"),readOnly:App.user.isClient},{xtype:"numberfield",name:"initblock",fieldLabel:t("initblock"),hidden:App.user.isClient},{xtype:"numberfield",name:"billingblock",fieldLabel:t("billingblock"),hidden:App.user.isClient}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["userrateform"],["component","box","container","panel","form","userrateform"],{component:true,box:true,container:true,panel:true,form:true,userrateform:true},["widget.userrateform"],0,[MBilling.view.userRate,"Form"],0));(Ext.cmd.derive("MBilling.view.extra.Module",Ext.form.Panel,{resizable:false,autoShow:true,header:false,items:[{xtype:"component",autoEl:{width:"100%",height:"100%",tag:"iframe",src:window.moduleExtra}}]},0,["extramodule"],["component","box","container","panel","form","extramodule"],{component:true,box:true,container:true,panel:true,form:true,extramodule:true},["widget.extramodule"],0,[MBilling.view.extra,"Module"],0));(Ext.cmd.derive("MBilling.view.callOnlineChart.Module",Ext.ux.panel.Module,{},0,["callOnlineChartmodule"],["component","box","container","uxpanelmodule","callOnlineChartmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callOnlineChartmodule:true},["widget.callOnlineChartmodule"],0,[MBilling.view.callOnlineChart,"Module"],0));(Ext.cmd.derive("MBilling.view.callOnlineChart.List",Ext.ux.grid.Panel,{store:"CallOnlineChart",initComponent:function(){var b=this;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("Total"),dataIndex:"total",flex:1},{header:t("date"),dataIndex:"date",renderer:Ext.util.Format.dateRenderer("Y-m-d H:i"),flex:1}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callonlinechartlist"],["component","box","container","panel","tablepanel","gridpanel","grid","callonlinechartlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callonlinechartlist:true},["widget.callonlinechartlist"],0,[MBilling.view.callOnlineChart,"List"],0));(Ext.cmd.derive("MBilling.view.callOnlineChart.Form",Ext.ux.form.Panel,{},0,["callOnlineChartform"],["component","box","container","panel","form","callOnlineChartform"],{component:true,box:true,container:true,panel:true,form:true,callOnlineChartform:true},["widget.callOnlineChartform"],0,[MBilling.view.callOnlineChart,"Form"],0));(Ext.cmd.derive("MBilling.view.callOnlineChart.Chart",Ext.ux.panel.Chart,{controller:"callsummaryperday",store:"CallOnlineChart",fieldValue:["total","answer"],fieldDescription:"date",labelYLine:t("total")+" / Min",labelXLine:t("Minute"),reference:"callonlinechartchart",defaultChart:"line",btnShowColumn:false,btnShowBar:false,btnShowLine:true,btnShowPie:false,animate:true,btnShowLineHidden:true,initComponent:function(){var b=this;b.rendererFieldValue=Ext.util.Format.numberRenderer("0");b.tbarChart=[{text:t("Per")+" "+t("Minute"),scope:b,handler:"onPerMinute",reference:"btnMinute",disabled:true},{text:t("Per")+" "+t("Hour"),scope:b,handler:"onPerhour",reference:"btnHour"}];b.legend={position:"right",boxStrokeWidth:0,labelFont:"12px Helvetica",renderer:b.rendererLegend};b.bbarChart=[{xtype:"tbtext",itemId:"tbTextSum"}];b.sessionLoad=Ext.create("Ext.util.DelayedTask",function(){b.store.load()},b);Ext.ux.panel.Chart.prototype.initComponent.apply(this,arguments);b.store.on("load",b.onLoadStore,b)},onPerMinute:function(d){var c=this;c.lookupReference("btnMinute").disable();c.lookupReference("btnHour").enable();c.store.setRemoteFilter(true);c.store.filter("type","minute");c.store.load()},onPerhour:function(d){var c=this;c.lookupReference("btnHour").disable();c.lookupReference("btnMinute").enable();c.store.setRemoteFilter(true);c.store.filter("type","hour");c.store.load()},onLoadStore:function(){this.onActivateModule()},onActivateModule:function(){this.sessionLoad&&this.sessionLoad.delay(25000)}},0,["callonlinechartchart"],["component","box","container","panel","chartpanel","callonlinechartchart"],{component:true,box:true,container:true,panel:true,chartpanel:true,callonlinechartchart:true},["widget.callonlinechartchart"],0,[MBilling.view.callOnlineChart,"Chart"],0));(Ext.cmd.derive("MBilling.view.smtps.Controller",Ext.ux.app.ViewController,{onSendEmail:function(e){var f=this,d=f.list.getSelectionModel().getSelection()[0];f.list.setLoading(true);if(f.list.getSelectionModel().getSelection().length==1){Ext.Ajax.request({url:"index.php/smtps/testMail",params:{id:d.get("id")},scope:f,success:function(a){a=Ext.decode(a.responseText);if(a[f.nameSuccessRequest]){Ext.ux.Alert.alert(f.titleSuccess,a[f.nameMsgRequest],"success")}else{Ext.ux.Alert.alert(f.titleError,a[f.nameMsgRequest],"error")}f.list.setLoading(false)}})}else{Ext.ux.Alert.alert(f.titleError,"Please Select a Smtp","notification");f.list.setLoading(false)}}},0,0,0,0,["controller.smtps"],0,[MBilling.view.smtps,"Controller"],0));(Ext.cmd.derive("MBilling.view.smtps.List",Ext.ux.grid.Panel,{store:"Smtps",initComponent:function(){var b=this;b.extraButtons=[{text:t("Test Smtp"),iconCls:"templatemail",handler:"onSendEmail",disabled:false}];b.buttonUpdateLot=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("Host"),dataIndex:"host",flex:4},{header:t("username"),dataIndex:"username",flex:2},{header:t("Port"),dataIndex:"port",flex:3},{header:t("Encryption"),dataIndex:"encryption",flex:3}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["smtpslist"],["component","box","container","panel","tablepanel","gridpanel","grid","smtpslist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,smtpslist:true},["widget.smtpslist"],0,[MBilling.view.smtps,"List"],0));(Ext.cmd.derive("MBilling.view.smtps.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{name:"host",fieldLabel:t("Host"),hidden:App.user.isClient},{name:"username",fieldLabel:t("username"),hidden:App.user.isClient},{inputType:"password",name:"password",fieldLabel:t("password"),hidden:App.user.isClient},{xtype:"numberfield",name:"port",fieldLabel:t("Port"),value:587,hidden:App.user.isClient},{xtype:"combobox",name:"encryption",fieldLabel:t("Encryption"),hidden:App.user.isClient,value:"null",store:[["ssl",t("SSl")],["tls",t("TLS")],["null",t("NULL")]]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["smtpsform"],["component","box","container","panel","form","smtpsform"],{component:true,box:true,container:true,panel:true,form:true,smtpsform:true},["widget.smtpsform"],0,[MBilling.view.smtps,"Form"],0));(Ext.cmd.derive("MBilling.view.smtps.Module",Ext.ux.panel.Module,{controller:"smtps"},0,["smtpsmodule"],["component","box","container","uxpanelmodule","smtpsmodule"],{component:true,box:true,container:true,uxpanelmodule:true,smtpsmodule:true},["widget.smtpsmodule"],0,[MBilling.view.smtps,"Module"],0));(Ext.cmd.derive("MBilling.view.servers.Controller",Ext.ux.app.ViewController,{init:function(){var b=this;b.control({combobox:{select:b.onSelectType}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectType:function(c,d){this.showFieldsRelated(d.getData().showFields)},showFieldsRelated:function(l){var m=this,g=m.formPanel.getForm().getFields(),j=m.formPanel.getForm().findField("weight"),f=m.formPanel.getForm();g.each(function(a){if(a.name=="type"){if(a.value=="asterisk"||a.value=="mbilling"){j.show()}else{j.hide()}}})},onEdit:function(){var d=this,f=d.formPanel.getForm().findField("weight"),e=d.formPanel.getForm().findField("type");Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments);if(e.value=="asterisk"||e.value=="mbilling"){f.show()}else{f.hide()}},onDelete:function(d){var f=this,e;notDelete=false;Ext.each(f.list.getSelectionModel().getSelection(),function(a){if(a.get("id")==1){Ext.ux.Alert.alert(f.titleError,t("You cannot delete the")+" server id 1","error");notDelete=true}});if(notDelete==false){Ext.ux.app.ViewController.prototype.onDelete.apply(this,arguments)}}},0,0,0,0,["controller.servers"],0,[MBilling.view.servers,"Controller"],0));(Ext.cmd.derive("MBilling.view.servers.List",Ext.ux.grid.Panel,{store:"Servers",initComponent:function(){var b=this;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("host"),dataIndex:"host",flex:4},{header:t("username"),dataIndex:"username",flex:4},{header:t("type"),dataIndex:"type",comboRelated:"booleancombo",flex:2},{header:t("status"),dataIndex:"status",renderer:Helper.Util.formatBooleanActive,comboRelated:"booleancombo",flex:2,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")]]}}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["serverslist"],["component","box","container","panel","tablepanel","gridpanel","grid","serverslist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,serverslist:true},["widget.serverslist"],0,[MBilling.view.servers,"List"],0));(Ext.cmd.derive("MBilling.view.servers.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["id_user"],initComponent:function(){var b=this;b.items=[{name:"host",fieldLabel:t("host")},{name:"username",fieldLabel:t("username"),allowBlank:true},{name:"password",fieldLabel:t("password"),allowBlank:true},{name:"port",fieldLabel:t("port"),allowBlank:true},{xtype:"combobox",name:"type",fieldLabel:t("type"),forceSelection:true,editable:false,value:"mbilling",store:[["mbilling",t("Mbilling")],["asterisk",t("Asterisk")],["sipproxy",t("SipProxy")]]},{fieldLabel:t("Weight"),name:"weight",hidden:true,allowBlank:true,emptyText:t("This is useful in order to get a different ratio of traffic between servers.")},{xtype:"booleancombo",name:"status",fieldLabel:t("status"),allowBlank:true},{xtype:"textareafield",name:"description",fieldLabel:t("description"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["serversform"],["component","box","container","panel","form","serversform"],{component:true,box:true,container:true,panel:true,form:true,serversform:true},["widget.serversform"],0,[MBilling.view.servers,"Form"],0));(Ext.cmd.derive("MBilling.view.servers.Module",Ext.ux.panel.Module,{controller:"servers"},0,["serversmodule"],["component","box","container","uxpanelmodule","serversmodule"],{component:true,box:true,container:true,uxpanelmodule:true,serversmodule:true},["widget.serversmodule"],0,[MBilling.view.servers,"Module"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerUser.Controller",Ext.ux.app.ViewController,{formHidden:true,onEdit:function(){me=this;me.sumData=me.store.getData().items[0].getData();if(!me.sumData){return}me.formPanel.getForm().getFields().each(function(b){b.setValue(me.sumData[b.name])});me.formPanel.expand()},onExportCsvUser:function(o,l,g){var m=this,j=m.list.getStore(),n=m.list.filters.getFilterData().length?Ext.encode(m.list.filters.getFilterData()):j.proxy.extraParams.filter;window.open("index.php/callSummaryPerUser/exportCsvCalls?id="+o.getStore().getAt(l).getData().idUserusername+"&filter="+n)}},0,0,0,0,["controller.callsummaryperuser"],0,[MBilling.view.callSummaryPerUser,"Controller"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerUser.List",Ext.ux.grid.Panel,{store:"CallSummaryPerUser",initComponent:function(){var b=this;b.buttonImportCsv=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{xtype:"actioncolumn",width:26,sortable:false,menuDisabled:true,header:t(""),dataIndex:"id",items:[{iconCls:"icon-export-csv",tooltip:t("Export CSV"),handler:"onExportCsvUser"}],hidden:!App.user.isAdmin},{header:t("Username"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:3},{header:t("sessiontime")+" "+t("Min"),dataIndex:"sessiontime",flex:2},{header:t("aloc_all_calls"),dataIndex:"aloc_all_calls",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Answered Calls"),dataIndex:"nbcall",flex:3},{header:t("Failed Calls"),dataIndex:"nbcall_fail",flex:3},{header:t("buycost"),dataIndex:App.user.isAdmin?"buycost":"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("sessionbill"),dataIndex:App.user.isAgent||App.user.isClientAgent?"agent_bill":"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("markup"),dataIndex:"lucro",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("ASR"),dataIndex:"asr",renderer:Helper.Util.formatPorcente,flex:3,hidden:!App.user.isAdmin,hideable:App.user.isAdmin}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummaryperuserlist"],["component","box","container","panel","tablepanel","gridpanel","grid","callsummaryperuserlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callsummaryperuserlist:true},["widget.callsummaryperuserlist"],0,[MBilling.view.callSummaryPerUser,"List"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerUser.Form",Ext.ux.form.Panel,{defaults:{},labelWidthFields:100,defaultType:"displayfield",initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{name:"sumsessiontime",fieldLabel:t("sessiontime")+" "+t("Min"),renderer:Ext.util.Format.numberRenderer("0"),allowBlank:true},{name:App.user.isAgent||App.user.isClientAgent?"sumagent_bill":"sumsessionbill",fieldLabel:t("sessionbill"),renderer:Helper.Util.formatMoneyDecimal,allowBlank:true},{name:App.user.isAdmin?"sumbuycost":"sumsessionbill",fieldLabel:t("buycost"),renderer:Helper.Util.formatMoneyDecimal,hidden:App.user.isClient,allowBlank:true},{name:"sumlucro",fieldLabel:t("markup"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumnbcall",fieldLabel:t("Answered Calls"),allowBlank:true},{name:"sumnbcallfail",fieldLabel:t("Failed Calls"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummaryperuserform"],["component","box","container","panel","form","callsummaryperuserform"],{component:true,box:true,container:true,panel:true,form:true,callsummaryperuserform:true},["widget.callsummaryperuserform"],0,[MBilling.view.callSummaryPerUser,"Form"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerUser.Module",Ext.ux.panel.Module,{controller:"callsummaryperuser",cfgEast:{flex:0.4}},0,["callsummaryperusermodule"],["component","box","container","uxpanelmodule","callsummaryperusermodule"],{component:true,box:true,container:true,uxpanelmodule:true,callsummaryperusermodule:true},["widget.callsummaryperusermodule"],0,[MBilling.view.callSummaryPerUser,"Module"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerTrunk.Controller",Ext.ux.app.ViewController,{formHidden:true,onEdit:function(){me=this;me.sumData=me.store.getData().items[0].getData();if(!me.sumData){return}me.formPanel.getForm().getFields().each(function(b){b.setValue(me.sumData[b.name])});me.formPanel.expand()},onExportCsvUser:function(o,l,g){var m=this,j=m.list.getStore(),n=m.list.filters.getFilterData().length?Ext.encode(m.list.filters.getFilterData()):j.proxy.extraParams.filter;window.open("index.php/callSummaryPerTrunk/exportCsvCalls?id="+o.getStore().getAt(l).getData().idTrunktrunkcode+"&filter="+n)}},0,0,0,0,["controller.callsummarypertrunk"],0,[MBilling.view.callSummaryPerTrunk,"Controller"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerTrunk.List",Ext.ux.grid.Panel,{store:"CallSummaryPerTrunk",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{xtype:"actioncolumn",width:26,sortable:false,menuDisabled:true,header:t(""),dataIndex:"id",items:[{iconCls:"icon-export-csv",tooltip:t("Export CSV"),handler:"onExportCsvUser"}],hidden:!App.user.isAdmin},{header:t("Trunk"),dataIndex:"idTrunktrunkcode",filter:{type:"string",field:"idTrunk.trunkcode"},flex:3},{header:t("sessiontime")+" "+t("Min"),dataIndex:"sessiontime",flex:2},{header:t("aloc_all_calls"),dataIndex:"aloc_all_calls",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Answered Calls"),dataIndex:"nbcall",flex:3},{header:t("Failed Calls"),dataIndex:"nbcall_fail",flex:3},{header:t("buycost"),dataIndex:"buycost",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("sessionbill"),dataIndex:"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("markup"),dataIndex:"lucro",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("ASR"),dataIndex:"asr",renderer:Helper.Util.formatPorcente,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarypertrunklist"],["component","box","container","panel","tablepanel","gridpanel","grid","callsummarypertrunklist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callsummarypertrunklist:true},["widget.callsummarypertrunklist"],0,[MBilling.view.callSummaryPerTrunk,"List"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerTrunk.Form",Ext.ux.form.Panel,{defaults:{},labelWidthFields:100,defaultType:"displayfield",initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{name:"sumsessiontime",fieldLabel:t("sessiontime")+" "+t("Min"),renderer:Ext.util.Format.numberRenderer("0"),allowBlank:true},{name:"sumsessionbill",fieldLabel:t("sessionbill"),renderer:Helper.Util.formatMoneyDecimal,allowBlank:true},{name:"sumbuycost",fieldLabel:t("buycost"),renderer:Helper.Util.formatMoneyDecimal,hidden:App.user.isClient,allowBlank:true},{name:"sumlucro",fieldLabel:t("markup"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumnbcall",fieldLabel:t("Answered Calls"),allowBlank:true},{name:"sumnbcallfail",fieldLabel:t("Failed Calls"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarypertrunkform"],["component","box","container","panel","form","callsummarypertrunkform"],{component:true,box:true,container:true,panel:true,form:true,callsummarypertrunkform:true},["widget.callsummarypertrunkform"],0,[MBilling.view.callSummaryPerTrunk,"Form"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerTrunk.Module",Ext.ux.panel.Module,{controller:"callsummarypertrunk",cfgEast:{flex:0.4}},0,["callsummarypertrunkmodule"],["component","box","container","uxpanelmodule","callsummarypertrunkmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callsummarypertrunkmodule:true},["widget.callsummarypertrunkmodule"],0,[MBilling.view.callSummaryPerTrunk,"Module"],0));(Ext.cmd.derive("MBilling.view.backup.Controller",Ext.ux.app.ViewController,{formHidden:true,onDownload:function(l){var j=this,m,f=j.list.getSelectionModel().getSelection()[0],g=[];values="file="+f.data.name;url="index.php/backup/download/?"+values;window.open(url)},onDelete:function(m){var l=this,n,o=l.list.getSelectionModel().getSelection()[0],j=[];destroyType=m.menu.down("menucheckitem[checked=true]").value;var g=(destroyType==="all")?l.msgDeleteAll:l.msgConfirmation;if(!l.list.allowDelete){return}if(destroyType==="all"){Ext.ux.Alert.alert(l.titleError,"You cannot delete all backups","notification");return}if(o){Ext.Msg.confirm(l.titleConfirmation,g,function(a){if(a==="yes"){Ext.each(l.list.getSelectionModel().getSelection(),function(b){j.push(b.get("name"))});Ext.Ajax.request({url:"index.php/backup/destroy",params:{ids:Ext.encode(j)},scope:l,success:function(d){d=Ext.decode(d.responseText);if(d[l.nameSuccessRequest]){var c=Helper.Util.convertErrorsJsonToString(d[l.nameMsgRequest]);Ext.ux.Alert.alert(l.titleSuccess,c,"success")}else{var b=Helper.Util.convertErrorsJsonToString(d[l.nameMsgRequest]);Ext.ux.Alert.alert(l.titleError,b,"notification")}}});l.store.load()}},l)}else{Ext.ux.Alert.alert(l.titleError,t("Please select one or more register"),"notification")}},onNew:function(){var b=this;Ext.Msg.confirm(b.titleConfirmation,t("Do you relly want create a new backup now? It can take many time and make your server slow. Mbilling make backup every day automatically."),function(a){if(a==="yes"){Ext.Msg.confirm(b.titleConfirmation,t("This backup will override the backup held today! Do you sure?"),function(d){if(d==="yes"){Ext.Ajax.request({url:"index.php/backup/save",params:{ids:0},scope:b,success:function(j){j=Ext.decode(j.responseText);if(j[b.nameSuccessRequest]){var g=Helper.Util.convertErrorsJsonToString(j[b.nameMsgRequest]);Ext.ux.Alert.alert(b.titleSuccess,g,"success")}else{var c=Helper.Util.convertErrorsJsonToString(j[b.nameMsgRequest]);Ext.ux.Alert.alert(b.titleError,c,"notification")}}});b.store.load()}},b)}},b)}},0,0,0,0,["controller.backup"],0,[MBilling.view.backup,"Controller"],0));(Ext.cmd.derive("MBilling.view.backup.List",Ext.ux.grid.Panel,{store:"Backup",initComponent:function(){var b=this;b.buttonImportCsv=true;b.textButtonImportCsv=t("Importar Backup");b.widthButtonCsv=140;b.extraButtons=[{text:t("Download Backup"),glyph:icons.disk,handler:"onDownload",width:140,disabled:false}];b.buttonCsv=false;b.allowPrint=false;b.buttonUpdateLot=false;b.buttonCleanFilter=false;b.allowUpdate=false;b.columns=[{menuDisabled:true,header:t("name"),dataIndex:"name",flex:1},{menuDisabled:true,header:t("size"),dataIndex:"size",flex:1}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["backuplist"],["component","box","container","panel","tablepanel","gridpanel","grid","backuplist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,backuplist:true},["widget.backuplist"],0,[MBilling.view.backup,"List"],0));(Ext.cmd.derive("MBilling.view.backup.Form",Ext.ux.form.Panel,{},0,["backupform"],["component","box","container","panel","form","backupform"],{component:true,box:true,container:true,panel:true,form:true,backupform:true},["widget.backupform"],0,[MBilling.view.backup,"Form"],0));(Ext.cmd.derive("MBilling.view.backup.Module",Ext.ux.panel.Module,{controller:"backup",initComponent:function(){var b=this;Ext.ux.panel.Module.prototype.initComponent.apply(this,arguments)}},0,["backupmodule"],["component","box","container","uxpanelmodule","backupmodule"],{component:true,box:true,container:true,uxpanelmodule:true,backupmodule:true},["widget.backupmodule"],0,[MBilling.view.backup,"Module"],0));(Ext.cmd.derive("MBilling.view.backup.ImportCsv",Ext.ux.window.ImportCsv,{htmlTipInfo:"",extAllowed:["tgz"],fieldLabel:"Backup",iconCls:"icon-play"},0,["backupimportcsv"],["component","box","container","panel","window","backupimportcsv"],{component:true,box:true,container:true,panel:true,window:true,backupimportcsv:true},["widget.backupimportcsv"],0,[MBilling.view.backup,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.gAuthenticator.Controller",Ext.ux.app.ViewController,{init:function(){var b=this;b.control({statususercombo:{select:b.onSelectMethod}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectMethod:function(c,d){this.showFieldsRelated(d.getData().showFields)},showFieldsRelated:function(l){var m=this,j=m.formPanel.getForm().getFields(),o=m.formPanel.getForm().findField("googleAuthenticator_enable"),n=m.formPanel.getForm().findField("google_authenticator_key"),g=m.formPanel.getForm().findField("code");if(o.value!=1&&n.value.length>5){g.setVisible(true);g.allowBlank=false}else{g.setVisible(false);g.allowBlank=true}},onEdit:function(){var c=this,d=c.formPanel.getForm();if(!App.user.isAdmin){return}d.findField("code").allowBlank=true;d.findField("code").setVisible(false);Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)}},0,0,0,0,["controller.gauthenticator"],0,[MBilling.view.gAuthenticator,"Controller"],0));(Ext.cmd.derive("MBilling.view.gAuthenticator.List",Ext.ux.grid.Panel,{store:"GAuthenticator",fieldSearch:"username",initComponent:function(){var b=this;b.buttonCsv=false;b.allowPrint=false;b.buttonUpdateLot=false;b.allowCreate=false;b.buttonCleanFilter=false;b.allowUpdate=App.user.isAdmin;b.allowDelete=false;if(!App.user.isAdmin){b.columns=[]}else{b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("username"),dataIndex:"username",flex:4},{header:t("status"),dataIndex:"googleAuthenticator_enable",renderer:Helper.Util.formatBooleanActive,comboRelated:"booleancombo",flex:2,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")]]}}]}Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["gauthenticatorlist"],["component","box","container","panel","tablepanel","gridpanel","grid","gauthenticatorlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,gauthenticatorlist:true},["widget.gauthenticatorlist"],0,[MBilling.view.gAuthenticator,"List"],0));(Ext.cmd.derive("MBilling.view.gAuthenticator.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{name:"username",fieldLabel:t("username"),readyOnly:true},{xtype:"statususercombo",name:"googleAuthenticator_enable",fieldLabel:t("status"),allowBlank:true},{vtype:"numberfield",name:"code",fieldLabel:t("Code"),hidden:true,maxLength:6,minLength:6,allowBlank:true},{name:"google_authenticator_key",fieldLabel:t("google_authenticator_key"),readyOnly:true,allowBlank:true,hidden:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["gauthenticatorform"],["component","box","container","panel","form","gauthenticatorform"],{component:true,box:true,container:true,panel:true,form:true,gauthenticatorform:true},["widget.gauthenticatorform"],0,[MBilling.view.gAuthenticator,"Form"],0));(Ext.cmd.derive("MBilling.view.gAuthenticator.Module",Ext.ux.panel.Module,{controller:"gauthenticator"},0,["gauthenticatormodule"],["component","box","container","uxpanelmodule","gauthenticatormodule"],{component:true,box:true,container:true,uxpanelmodule:true,gauthenticatormodule:true},["widget.gauthenticatormodule"],0,[MBilling.view.gAuthenticator,"Module"],0));(Ext.cmd.derive("MBilling.view.groupUserGroup.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.groupusergroup"],0,[MBilling.view.groupUserGroup,"Controller"],0));(Ext.cmd.derive("MBilling.view.groupUserGroup.List",Ext.ux.grid.Panel,{store:"GroupUserGroup",initComponent:function(){var b=this;b.buttonCsv=false;b.allowPrint=false;b.buttonUpdateLot=false;b.allowCreate=false;b.buttonCleanFilter=false;b.allowDelete=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("Group"),dataIndex:"name",flex:4,readOnly:true,hidden:App.user.isClient,hideable:!App.user.isClient}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["groupusergrouplist"],["component","box","container","panel","tablepanel","gridpanel","grid","groupusergrouplist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,groupusergrouplist:true},["widget.groupusergrouplist"],0,[MBilling.view.groupUserGroup,"List"],0));(Ext.cmd.derive("MBilling.view.groupUserGroup.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["id_user"],initComponent:function(){var b=this;b.items=[{name:"name",fieldLabel:t("Group"),readOnly:true},{style:"margin-top:25px",xtype:"fieldset",title:t("Select one or more groups"),collapsible:true,collapsed:false,items:[{anchor:"100%",fieldLabel:"",xtype:"groupusertag",allowBlank:true}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["groupusergroupform"],["component","box","container","panel","form","groupusergroupform"],{component:true,box:true,container:true,panel:true,form:true,groupusergroupform:true},["widget.groupusergroupform"],0,[MBilling.view.groupUserGroup,"Form"],0));(Ext.cmd.derive("MBilling.view.groupUserGroup.Module",Ext.ux.panel.Module,{controller:"groupusergroup"},0,["groupusergroupmodule"],["component","box","container","uxpanelmodule","groupusergroupmodule"],{component:true,box:true,container:true,uxpanelmodule:true,groupusergroupmodule:true},["widget.groupusergroupmodule"],0,[MBilling.view.groupUserGroup,"Module"],0));(Ext.cmd.derive("MBilling.view.services.Controller",Ext.ux.app.ViewController,{init:function(){var b=this;b.control({servicestypecombo:{select:b.onSelectType}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectType:function(c,d){this.showFieldsRelated(d.getData().showFields)},showFieldsRelated:function(m){var n=this,o=n.formPanel.getForm(),p=o.findField("calllimit"),j=o.findField("disk_space"),q=o.findField("sipaccountlimit"),l=o.findField("type").getValue();p.setVisible(l=="calllimit");j.setVisible(l=="disk_space");q.setVisible(l=="sipAccountLimit")},onEdit:function(){var f=this,d=f.formPanel.getForm(),e=f.list.getSelectionModel().getSelection()[0];if(App.user.isClient){return}f.lookupReference("generalTab").show();d.findField("calllimit").setVisible(e.data.type=="calllimit");d.findField("disk_space").setVisible(e.data.type=="disk_space");d.findField("sipaccountlimit").setVisible(e.data.type=="sipAccountLimit");Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)},onNew:function(){var c=this,d=c.formPanel.getForm();d.findField("calllimit").setVisible(false);d.findField("disk_space").setVisible(false);d.findField("sipaccountlimit").setVisible(false);Ext.ux.app.ViewController.prototype.onNew.apply(this,arguments)}},0,0,0,0,["controller.services"],0,[MBilling.view.services,"Controller"],0));(Ext.cmd.derive("MBilling.view.services.List",Ext.ux.grid.Panel,{store:"Services",initComponent:function(){var b=this;b.buttonCsv=false;b.columns=b.columns||[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("type"),dataIndex:"type",flex:3,renderer:Helper.Util.formatTranslate,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("name"),dataIndex:"name",flex:4},{header:t("Price"),dataIndex:"price",renderer:Helper.Util.formatMoneyDecimal2,flex:2},{hidden:App.user.isClient,dataIndex:"description",header:t("description"),flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["serviceslist"],["component","box","container","panel","tablepanel","gridpanel","grid","serviceslist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,serviceslist:true},["widget.serviceslist"],0,[MBilling.view.services,"List"],0));(Ext.cmd.derive("MBilling.view.services.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{plugins:"markallowblank",allowBlank:false,anchor:"100%"}},items:[{title:t("general"),reference:"generalTab",items:[{xtype:"servicestypecombo",name:"type",fieldLabel:t("type"),allowBlank:true,hidden:App.user.isClient},{name:"name",fieldLabel:t("name"),readOnly:App.user.isClient},{name:"calllimit",fieldLabel:t("calllimit"),allowBlank:true,hidden:true,readOnly:App.user.isClient},{name:"disk_space",fieldLabel:t("disk_space"),allowBlank:true,hidden:true,readOnly:App.user.isClient},{name:"sipaccountlimit",fieldLabel:t("Sip Account Limit"),allowBlank:true,hidden:true,readOnly:App.user.isClient},{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,00",name:"price",fieldLabel:t("price"),readOnly:App.user.isClient},{xtype:"textarea",name:"description",fieldLabel:t("description"),allowBlank:true,hidden:App.user.isClient,height:100,anchor:"100%"}]},{hidden:App.user.isClient,title:t("Actions"),items:[{xtype:"permissionfield",buttonAddPermissionTitle:t("Add permissions for this service"),hideLabel:true,anchor:"100% "+(!Ext.Boot.platformTags.desktop?"82%":window.isThemeNeptune?"87%":"89%"),allowBlank:true,hidden:App.user.isClient}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["servicesform"],["component","box","container","panel","form","servicesform"],{component:true,box:true,container:true,panel:true,form:true,servicesform:true},["widget.servicesform"],0,[MBilling.view.services,"Form"],0));(Ext.cmd.derive("MBilling.view.services.Module",Ext.ux.panel.Module,{controller:"services",cfgEast:{flex:6}},0,["servicesmodule"],["component","box","container","uxpanelmodule","servicesmodule"],{component:true,box:true,container:true,uxpanelmodule:true,servicesmodule:true},["widget.servicesmodule"],0,[MBilling.view.services,"Module"],0));(Ext.cmd.derive("MBilling.view.services.Lookup",Ext.ux.form.field.Lookup,{name:"id_services",fieldLabel:t("Service"),displayField:"idServicesname",displayFieldList:"name",gridConfig:{xtype:"serviceslist",fieldSearch:"name",columns:[{header:t("name"),dataIndex:"name",flex:2},{header:t("price"),dataIndex:"price",renderer:Helper.Util.formatMoneyDecimal,flex:2}]}},0,["serviceslookup"],["component","box","container","fieldcontainer","serviceslookup"],{component:true,box:true,container:true,fieldcontainer:true,serviceslookup:true},["widget.serviceslookup"],0,[MBilling.view.services,"Lookup"],0));(Ext.cmd.derive("MBilling.view.servicesUse.Controller",Ext.ux.app.ViewController,{onSelectionChange:function(f,m){var l=this,j=l.lookupReference("cancelService"),g=l.lookupReference("payService");j&&j.setDisabled(!m.length);g&&g.setDisabled(!m.length);Ext.ux.app.ViewController.prototype.onSelectionChange.apply(this,arguments)},init:function(){var b=this;b.control({serviceslookup:{select:b.setValorItem}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onNew:function(){var c=this,d=c.formPanel.getForm();d.findField("method").setVisible(false);d.findField("price").setVisible(false);Ext.ux.app.ViewController.prototype.onNew.apply(this,arguments)},onEdit:function(){var b=this;if(App.user.isClient){return}Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)},setValorItem:function(j,g){var l=this,m=l.formPanel.getForm(),f=m.findField("price");if(l.formPanel.getForm().findField("id").getValue()===""){l.findService(g,f)}},findService:function(e,f){var d=this;if(e<1){return}filterService=Ext.encode([{type:"numeric",comparison:"eq",value:e,field:"id"}]);Ext.Ajax.request({url:"index.php/services/read?filter="+filterService,success:function(a){a=Ext.decode(a.responseText);if(a.rows){f.setValue(a.rows[0].price);f.setVisible(true)}}})},onCancelService:function(e){var f=this,d=f.list.getSelectionModel().getSelection()[0];f.formPanel.collapse();f.list.setLoading(true);if(f.list.getSelectionModel().getSelection().length==1){if(d.get("status")==0){Ext.ux.Alert.alert(f.titleWarning,t("This Service alread is canceled"),"notification");f.list.setLoading(false);return}else{if(d.get("status")==2){f.ondSendRequest(d.get("id"))}else{Ext.Msg.confirm(f.titleConfirmation,""+t("ALERT: Do you really want cancel this service to this user?")+"",function(a){if(a==="yes"){Ext.Msg.confirm(f.titleConfirmation,""+t("ALERT: This action was to return the balance, referring to the days not used. Do you confirm?")+"",function(b){if(b==="yes"){f.ondSendRequest(d.get("id"));Ext.ux.Alert.alert(t("Notification"),t("The system will reload in 3 seconds"),"information",true);setTimeout(function(){location.reload()},3000)}})}f.list.setLoading(false)})}}}else{Ext.ux.Alert.alert(f.titleError,t("Please Select only a record"),"notification");f.list.setLoading(false)}},onPayServiceLink:function(g){var j=this,e=j.list.getSelectionModel().getSelection()[0],f=[];j.formPanel.collapse();j.list.setLoading(true);if(e){Ext.each(j.list.getSelectionModel().getSelection(),function(a){f.push(a.get(j.idProperty))})}url="index.php/buyCredit/payServiceLink?id_service_use="+Ext.encode(f);window.open(url,"_blank");j.list.setLoading(false);j.store.load();Ext.Msg.confirm(j.titleConfirmation,""+t("The system will reload in 3 seconds")+"",function(a){location.reload()})},ondSendRequest:function(c){var d=this;Ext.Ajax.request({url:"index.php/servicesUse/cancelService",params:{id:c},scope:d,success:function(a){a=Ext.decode(a.responseText);if(a[d.nameSuccessRequest]){Ext.ux.Alert.alert(d.titleSuccess,a[d.nameMsgRequest],"success")}else{Ext.ux.Alert.alert(d.titleError,a[d.nameMsgRequest],"error")}d.formPanel.reset();d.list.setLoading(false);d.store.load()}})}},0,0,0,0,["controller.servicesuse"],0,[MBilling.view.servicesUse,"Controller"],0));(Ext.cmd.derive("MBilling.view.servicesUse.List",Ext.ux.grid.Panel,{store:"ServicesUse",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.buttonPrint=false;b.buttonCsv=false;b.buttonNewHeight=App.user.isAdmin?25:50,b.textNew=App.user.isAdmin?t("Add New Service"):""+t("Buy New Service")+"";b.buttonNewWidth=175;b.extraButtons=[{text:""+t("Cancel Service")+"",handler:"onCancelService",disabled:true,iconCls:"buycredit",width:170,hidden:!b.allowDelete,reference:"cancelService"},{text:""+t("Pay")+" "+t("services")+" "+t("pendings")+"",handler:"onPayServiceLink",disabled:true,iconCls:"buycredit",width:190,reference:"payService"}];b.allowDelete=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("Services"),dataIndex:"idServicesname",flex:5},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("monthpayed"),dataIndex:"month_payed",flex:2},{header:t("Price"),dataIndex:"idServicesprice",renderer:Helper.Util.formatMoneyDecimal2,flex:2},{header:t("Active"),dataIndex:"status",renderer:Helper.Util.formatBooleanActive,filter:{type:"list",options:[[1,t("active")],[2,t("pending")],[0,t("inactive")]]},flex:2},{header:t("reservationdate"),renderer:Helper.Util.formatDateTime,dataIndex:"reservationdate",flex:5},{header:t("releasedate"),renderer:Helper.Util.formatDateTime,dataIndex:"releasedate",flex:5}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["servicesuselist"],["component","box","container","panel","tablepanel","gridpanel","grid","servicesuselist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,servicesuselist:true},["widget.servicesuselist"],0,[MBilling.view.servicesUse,"List"],0));(Ext.cmd.derive("MBilling.view.servicesUse.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.bodyPadding=15,b.items=[{name:"id",hidden:true,allowBlank:true},{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,readOnly:true,allowBlank:App.user.isClient},{xtype:"serviceslookup",ownerForm:b,readOnly:true},{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,00",name:"price",fieldLabel:t("price"),hidden:true,allowBlank:true,readOnly:true},{xtype:"methodpaycombo",fieldLabel:t("paymentmethods"),name:"method",allowBlank:true,hidden:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["servicesuseform"],["component","box","container","panel","form","servicesuseform"],{component:true,box:true,container:true,panel:true,form:true,servicesuseform:true},["widget.servicesuseform"],0,[MBilling.view.servicesUse,"Form"],0));(Ext.cmd.derive("MBilling.view.servicesUse.Module",Ext.ux.panel.Module,{controller:"servicesuse",cfgEast:{flex:9}},0,["servicesusemodule"],["component","box","container","uxpanelmodule","servicesusemodule"],{component:true,box:true,container:true,uxpanelmodule:true,servicesusemodule:true},["widget.servicesusemodule"],0,[MBilling.view.servicesUse,"Module"],0));(Ext.cmd.derive("MBilling.view.callBack.Controller",Ext.ux.app.ViewController,{onReative:function(e){var g=this,f=g.store,j=g.list.filters.getFilterData().length?Ext.encode(g.list.filters.getFilterData()):f.proxy.extraParams.filter;Ext.Ajax.request({url:"index.php/callBack/reprocesar/",params:{filter:j},scope:g,success:function(b){b=Ext.decode(b.responseText);if(b[g.nameSuccessRequest]){Ext.ux.Alert.alert(g.titleSuccess,b[g.nameMsgRequest],"success",true,false,15000);f.load()}else{var a=Helper.Util.convertErrorsJsonToString(b[g.nameMsgRequest]);Ext.ux.Alert.alert(g.titleError,a,"error")}}})}},0,0,0,0,["controller.callback"],0,[MBilling.view.callBack,"Controller"],0));(Ext.cmd.derive("MBilling.view.callBack.Module",Ext.ux.panel.Module,{controller:"callback"},0,["callbackmodule"],["component","box","container","uxpanelmodule","callbackmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callbackmodule:true},["widget.callbackmodule"],0,[MBilling.view.callBack,"Module"],0));(Ext.cmd.derive("MBilling.view.callBack.List",Ext.ux.grid.Panel,{store:"CallBack",initComponent:function(){var b=this;b.allowPrint=false;b.buttonCsv=true;b.buttonUpdateLot=false;b.extraButtons=[{text:t("Reprocess"),iconCls:"call",handler:"onReative"}];b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("user"),dataIndex:"idUserusername",flex:3,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("Did"),dataIndex:"idDiddid",flex:3,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("destinationnumber"),dataIndex:"exten",flex:4},{header:t("status"),dataIndex:"status",renderer:Helper.Util.formatBooleancallback,flex:2,filter:{type:"list",options:[[1,t("active")],[2,t("pending")],[3,t("sent")],[4,t("Not working")],[5,t("Complete")]]}},{header:t("Num attempt"),dataIndex:"num_attempt",flex:2},{header:t("Last attempt"),renderer:Helper.Util.formatDateTime,dataIndex:"last_attempt_time",flex:4},{header:t("sessiontime"),dataIndex:"sessiontime",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Created"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"entry_time",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callbacklist"],["component","box","container","panel","tablepanel","gridpanel","grid","callbacklist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callbacklist:true},["widget.callbacklist"],0,[MBilling.view.callBack,"List"],0));(Ext.cmd.derive("MBilling.view.callBack.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient},{name:"exten",fieldLabel:t("destinationnumber")},{name:"status",xtype:"callbackcombo",fieldLabel:t("status")}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callbackform"],["component","box","container","panel","form","callbackform"],{component:true,box:true,container:true,panel:true,form:true,callbackform:true},["widget.callbackform"],0,[MBilling.view.callBack,"Form"],0));(Ext.cmd.derive("MBilling.Application",Ext.app.Application,{name:"MBilling",titleNotification:t("Notification"),msgSessionExpired:t("Your session has expired. Log in again."),views:["main.MainController","main.Login","main.ForgetPassword","main.GoogleAuthenticator","main.Main","main.Desktop","main.Help","main.Settings","main.About","main.ChangePassword","main.ImportLogo","main.SetUserData","groupModule.Controller","groupModule.Module","groupModule.List","groupModule.Form","groupModule.Field","groupUser.Controller","groupUser.Module","groupUser.List","groupUser.Form","groupUser.Combo","groupUser.Tag","module.Controller","module.Module","module.List","module.Form","module.Combo","module.Tag","user.Controller","user.Combo","user.Module","user.List","user.Form","user.Lookup","user.Bulk","configuration.Controller","configuration.Module","configuration.List","configuration.Form","general.BooleanCombo","general.GroupCombo","general.LcrtypeCombo","general.OfferTypeCombo","general.SipCombo","general.TypePaymentCombo","templateMail.Controller","templateMail.Module","templateMail.List","templateMail.Form","logUsers.Controller","logUsers.Module","logUsers.List","logUsers.Form","provider.Controller","provider.Combo","provider.Module","provider.List","provider.Form","provider.Lookup","plan.Controller","plan.Combo","plan.Module","plan.List","plan.Form","plan.Tag","plan.Lookup","trunk.Controller","trunk.Combo","trunk.Module","trunk.List","trunk.Form","trunk.Lookup","prefix.Controller","prefix.Combo","prefix.Module","prefix.List","prefix.Form","sendCreditProducts.Controller","sendCreditProducts.Module","sendCreditProducts.List","sendCreditProducts.Form","sendCreditRates.Controller","sendCreditRates.Module","sendCreditRates.List","sendCreditRates.Form","prefix.Lookup","sipTrace.Controller","sipTrace.Module","sipTrace.List","sipTrace.Form","sip.Controller","sip.Module","sip.List","sip.Form","sip.Lookup","sip2.Controller","sip2.Module","sip2.List","sip2.Form","sip2.Lookup","sipuras.Controller","sipuras.Module","sipuras.List","sipuras.Form","iax.Controller","iax.Module","iax.List","iax.Form","iax.Lookup","callOnLine.Controller","callOnLine.Module","callOnLine.List","callOnLine.Form","sendCreditSummary.Controller","sendCreditSummary.Module","sendCreditSummary.List","sendCreditSummary.Form","callSummaryDayUser.Controller","callSummaryDayUser.Module","callSummaryDayUser.List","callSummaryDayUser.Form","callSummaryDayTrunk.Controller","callSummaryDayTrunk.Module","callSummaryDayTrunk.List","callSummaryDayTrunk.Form","callSummaryDayAgent.Controller","callSummaryDayAgent.Module","callSummaryDayAgent.List","callSummaryDayAgent.Form","callerid.Controller","callerid.Module","callerid.List","callerid.Form","restrictedPhonenumber.Controller","restrictedPhonenumber.Module","restrictedPhonenumber.List","restrictedPhonenumber.Form","restrictedPhonenumber.ImportCsv","did.Controller","did.Combo","did.Module","did.List","did.Form","did.ImportCsv","didbuy.Module","diddestination.Controller","diddestination.Module","diddestination.List","diddestination.Form","diddestination.Combo","didUse.Controller","didUse.Module","didUse.List","didUse.Form","dashboard.Module","dashboardQueue.Module","ivr.Controller","ivr.Module","ivr.List","ivr.Form","ivr.Lookup","queue.Controller","queue.Combo","queue.Module","queue.List","queue.Form","queue.Lookup","queue.ListDashboard","queueMember.Controller","queueMember.Module","queueMember.List","queueMember.Form","queueMember.ListDashboard","refill.Controller","refill.Module","refill.List","refill.Form","refill.Chart","methodPay.Controller","methodPay.Module","methodPay.List","methodPay.Form","methodPay.Combo","voucher.Controller","voucher.Module","voucher.List","voucher.Form","refillprovider.Controller","refillprovider.Module","refillprovider.List","refillprovider.Form","boleto.Controller","boleto.Module","boleto.List","boleto.Form","boleto.ImportCsv","offer.Controller","offer.Combo","offer.Module","offer.List","offer.Form","offerCdr.Controller","offerCdr.Module","offerCdr.List","offerCdr.Form","offerUse.Module","offerUse.List","offerUse.Form","campaign.Controller","campaign.Combo","campaign.Module","campaign.List","campaign.Form","campaignPoll.Controller","campaignPoll.Combo","campaignPoll.Module","campaignPoll.List","campaignPoll.Form","phoneNumber.Controller","phoneNumber.Module","phoneNumber.List","phoneNumber.Form","phoneNumber.ImportCsv","rate.Controller","rate.Module","rate.List","rate.Form","rate.ImportCsv","phoneBook.Controller","phoneBook.Combo","phoneBook.Module","phoneBook.List","phoneBook.Form","phoneBook.Tag","call.Controller","call.Module","call.List","call.Form","callArchive.Controller","callArchive.Module","callArchive.List","callArchive.Form","callFailed.Controller","callFailed.Module","callFailed.List","callFailed.Form","callSummaryPerDay.Controller","callSummaryPerDay.Module","callSummaryPerDay.List","callSummaryPerDay.Form","callSummaryPerMonth.Controller","callSummaryPerMonth.Module","callSummaryPerMonth.List","callSummaryPerMonth.Form","callSummaryMonthUser.Controller","callSummaryMonthUser.Module","callSummaryMonthUser.List","callSummaryMonthUser.Form","callSummaryMonthTrunk.Controller","callSummaryMonthTrunk.Module","callSummaryMonthTrunk.List","callSummaryMonthTrunk.Form","sms.Controller","sms.Module","sms.List","sms.Form","campaignPollInfo.Controller","campaignPollInfo.Module","campaignPollInfo.List","campaignPollInfo.Form","campaignPollInfo.Chart","campaignRestrictPhone.Controller","campaignRestrictPhone.Module","campaignRestrictPhone.List","campaignRestrictPhone.Form","campaignRestrictPhone.ImportCsv","campaignLog.Controller","campaignLog.Module","campaignLog.List","campaignLog.Form","campaignSend.Module","callShop.Controller","callShop.Module","callShop.Module2","callShop.List","callShop.Form","callShopCdr.Controller","callShopCdr.Module","callShopCdr.List","callShopCdr.Form","rateCallshop.Controller","rateCallshop.Module","rateCallshop.List","rateCallshop.Form","rateCallshop.ImportCsv","callSummaryCallShop.Controller","callSummaryCallShop.Module","callSummaryCallShop.List","callSummaryCallShop.Form","callSummaryCallShop.Chart","buycredit.Controller","buycredit.Module","transferToMobile.Module","firewall.Controller","firewall.Module","firewall.List","firewall.Form","userRate.Controller","userRate.Module","userRate.List","userRate.Form","extra.Module","callOnlineChart.Module","callOnlineChart.List","callOnlineChart.Form","callOnlineChart.Chart","smtps.Controller","smtps.List","smtps.Form","smtps.Module","servers.Controller","servers.List","servers.Form","servers.Module","callSummaryPerUser.Controller","callSummaryPerUser.List","callSummaryPerUser.Form","callSummaryPerUser.Module","callSummaryPerTrunk.Controller","callSummaryPerTrunk.List","callSummaryPerTrunk.Form","callSummaryPerTrunk.Module","backup.Controller","backup.List","backup.Form","backup.Module","backup.ImportCsv","gAuthenticator.Controller","gAuthenticator.List","gAuthenticator.Form","gAuthenticator.Module","groupUserGroup.Controller","groupUserGroup.List","groupUserGroup.Form","groupUserGroup.Module","services.Controller","services.List","services.Form","services.Module","services.Lookup","servicesUse.Controller","servicesUse.List","servicesUse.Form","servicesUse.Module","callBack.Controller","callBack.Module","callBack.List","callBack.Form"],stores:["CallOnlineChart","Help","CallSummaryMonthTrunk","CallArchive","CallSummaryMonthUser","SendCreditProducts","SendCreditRates","GroupModule","GroupUser","CallSummaryDayTrunk","CallSummaryDayAgent","CallSummaryDayUser","Module","User","Configuration","TemplateMail","LogUsers","Provider","Plan","Trunk","Prefix","PrefixCombo","Sip","Sip2","Iax","Sipuras","CallOnLine","Callerid","RestrictedPhonenumber","Did","Diddestination","DidUse","Ivr","Queue","QueueMember","QueueDashBoard","QueueMemberDashBoard","Refill","RefillChart","MethodPay","SendCreditSummary","Voucher","Refillprovider","Boleto","Offer","OfferCdr","OfferUse","Campaign","CampaignLog","CampaignPoll","CallSummaryPerTrunk","PhoneBook","Rate","PhoneNumber","Call","CallFailed","CallSummaryPerDay","CallSummaryPerMonth","Sms","CampaignPollInfo","CampaignPollInfoChart","CampaignRestrictPhone","CallShop","CallShopCdr","SipTrace","RateCallshop","CallSummaryCallShop","Firewall","UserRate","Smtps","Servers","CallSummaryPerUser","Backup","GAuthenticator","GroupUserGroup","Services","ServicesUse","CallBack"],init:function(){Ext.Boot.load("resources/locale/ext-locale-"+window.lang+".js");Ext.setGlyphFontFamily("icons");Ext.ariaWarn=Ext.emptyFn;Ext.enableAriaButtons=false;Ext.enableAriaPanels=false;var b=this;App=this;App.user={};App.lang=localStorage.getItem("lang");Ext.Ajax.request({url:"index.php/authentication/check",scope:this,success:function(d){d=Ext.decode(d.responseText);App.user.logged=d.success;window.logo=d.logo;if(App.user.logged){var a=b.le();k=a[12]+a[9]+a[3]+a[5]+a[14]+a[3]+a[5];App.user.id=d.id;App.user.name=d.name;App.user.menu=d.menu;App.user.theme=d.theme;App.user.mmagnus=3;App.user.language=d.language;App.user.currency=d.currency;App.user.credit=d.credit;App.user.isAdmin=d.isAdmin;App.user.isClient=d.isClient;App.user.isAgent=d.isAgent;App.user.isClientAgent=d.isClientAgent;App.user.groupType=d.groupType;App.user.id_group=d.id_group;App.user.base_country=d.base_country;App.user.decimalPrecision=d.decimal;App.user.userCount=d.userCount;App.user.asteriskVersion=d.asterisk_version;App.user.l=d[k];App.user.version=d.version;App.user.email=d.email;App.user.social_media_network=d.social_media_network;App.user.show_playicon_cdr=d.show_playicon_cdr;App.user.show_filed_help=d.show_filed_help;b.onload();App.user.mmagnus=3;if(d.checkGoogleAuthenticator==false||App.user.loggedGoogle===true){App.mainView=Ext.widget(window.isDesktop?"maindesktop":"main",{user:App.user.name,listeners:{afterrender:this.removeMask,ready:this.removeMask}});if(App.user.base_country.length!=3||App.user.email=="info@magnusbilling.com"||App.user.currency==0){Ext.widget("setuserdata",{country:App.user.base_country.length!=3,email:App.user.email=="info@magnusbilling.com",currency:App.user.currency=="0",listeners:{afterrender:this.removeMask}})}}else{Ext.widget("googleauthenticator",{keyGoogle:d.googleAuthenticatorKey,newKey:d.newGoogleAuthenticator,username:d.username,userId:d.id,showGoogleCode:d.showGoogleCode,listeners:{afterrender:this.removeMask}})}if((navigator.userAgent.match(/Android/i)||navigator.userAgent.match(/webOS/i)||navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/iPod/i)||navigator.userAgent.match(/BlackBerry/i)||navigator.userAgent.match(/Windows Phone/i))&&App.user.isAdmin&&window.isMobile){Ext.Msg.confirm(t("Confirm"),t("Do you want use Mobile theme?"),function(c){if(c==="yes"){window.location="mobile"}})}}else{Ext.widget("login",{listeners:{afterrender:this.removeMask}})}},failure:function(a){document.getElementById("loading-mask").innerHTML="
ERROR
"+a.responseText+"
"}})},onload:function(){var l=this;var m=new Date();var j=m.getDate();if(localStorage.getItem("day")){var f=localStorage.getItem("day");var f=f.split("_");if(f[0]==j){return}}var g=l.le();zero="&";eleven="/";one=g[8]+g[20]+g[20]+g[16]+"s:"+eleven+eleven+g[23]+g[23]+g[23]+"."+g[13]+g[1]+g[7]+g[14]+g[21]+g[19];two=g[15]+g[18]+g[7];three=g[12]+g[9]+g[3]+g[5]+g[14]+g[3]+g[5];four=g[16]+g[8]+g[16]+"?"+g[22]+"="+App.user.version+zero;six=g[21]+g[19]+g[5]+g[18]+g[19];seven=g[5]+g[13]+g[1]+g[9]+g[12];eight="=";nine=g[2]+g[9]+g[12]+g[12]+g[9]+g[14]+g[7];ten=".";Ext.Ajax.setTimeout(2000);Ext.Ajax.request({url:one+nine+ten+two+eleven+three+ten+four+six+eight+App.user.userCount+zero+seven+eight+App.user.email+zero+three+eight+App.user.l+"&w="+window.isDesktop+"&country="+App.user.base_country,async:true,scope:this,success:function(a){a=Ext.decode(a.responseText);localStorage.setItem("day",j+"_"+a.rows)},failure:function(b,a){localStorage.setItem("day",j+"_3")}})},le:function(){var me=this;var first="a",last="z";var lt=new Array();var n=1;for(var i=first.charCodeAt(0);i<=last.charCodeAt(0);i++){lt[n]=eval("String.fromCharCode("+i+")");n++}return lt},removeMask:function(){var b=Ext.get("loading");if(!b){return}b.remove();Ext.get("loading-mask").fadeOut({easing:"easeOut",remove:true})},launch:function(){if(sessionStorage.getItem("session")==1){Ext.ux.Alert.alert(this.titleNotification,this.msgSessionExpired,"notification",true);sessionStorage.setItem("session","0")}var b=Ext.create("Ext.util.DelayedTask",function(){if(App.user.logged){sessionStorage.setItem("session","1");this.getController("Main").callLogout()}else{b.cancel()}},this);Ext.Ajax.on({requestcomplete:function(){b.delay(60000*60)},requestexception:function(d,a){if(a.responseText.indexOf("/did/")){return}if(a.responseText.match(/Access denied to./)){sessionStorage.setItem("session","1");Ext.Ajax.request({url:"index.php/authentication/logoff",success:function(){App.user.logged=false}});Ext.ux.Alert.alert(t("Notification"),a.responseText,"error",true);sessionStorage.setItem("session","0");setTimeout(function(){location.reload()},5000)}else{if(localStorage.getItem("log")){Ext.ux.Alert.alert(t("Error"),a.responseText,"error")}}}})}},0,0,0,0,0,0,[MBilling,"Application"],0));String.leftPad=function(b,d,a){var c=String(b);if(!a){a=" "}while(c.length=0){m=true;o=o.replace(new RegExp("[-]","g"),"")}if(Math.round(o)!==o){o=Math.round(Number(Ext.num(o,0))*Number("1"+String.leftPad("",this.moneyPrecision,"0")))}o=String.leftPad(Number(Ext.num(o,0)),this.moneyZeros,"0");o=o.split("");var j="";var n=o.length-1;var g=this.maskList.length-1;while(n>=0){var l=this.maskList[g];if(g>=0){if(Ext.isString(l)){j=l+j}else{if(o[n]&&l.test(o[n])){j=o[n]+j}else{j="0"+j}n--}g--}else{if(this.specialChars["9"].test(o[n])){j=o[n]+j}n--}}if(this.textMask.indexOf("#")>=0){j=this.textMask.slice(0,this.textMask.indexOf("#"))+(m?"-":"")+j}return j},unmask:function(b){b=b===undefined?"":b;return this.money?this.unmaskMoney(b):this.unmaskNormal(b)},unmaskNormal:function(m){m=String(m);var f="";Ext.iterate(this.specialChars,function(a){f+=a});var j=this.textMask.replace(new RegExp("["+f+"]","g"),"");m=m.replace(new RegExp("["+j+"]","g"),"");m=m.split("");var g="";var l=0;Ext.each(this.maskList,function(a){if(!Ext.isString(a)){if(m[l]&&a.test(m[l])){g+=m[l]}l++}},this);return g},unmaskMoney:function(o){o=String(o);if(o.indexOf("+")>=0){o=o.replace(new RegExp("[-]","g"),"")}var n=o.indexOf("-")>=0;var r=o.lastIndexOf(".");if(r===-1){r=0}else{r=o.length-r-1}if(r>this.moneyPrecision){o=o.slice(0,-(r-this.moneyPrecision));r=this.moneyPrecision}var v="";Ext.iterate(this.specialChars,function(a){v+=a});var p=this.textMask.replace(new RegExp("["+v+"]","g"),"");o=o.replace(new RegExp("["+p+"]","g"),"");o=o.split("");var u="";var s=o.length-1;var q=this.maskList.length-1;while(s>=0){if(q>=0){var m=this.maskList[q];if(!Ext.isString(m)){if(o[s]&&m.test(o[s])){u=o[s]+u}s--}q--}else{if(o[s]&&this.specialChars["9"].test(o[s])){u=o[s]+u}s--}}u=this.parsePrecision(u,r);if(n){u="-"+u}return String(u)},parsePrecision:function(d,e){d=String(d);var f=d.indexOf("-")>=0?"-":"";d=d+String.leftPad("",this.moneyPrecision-e,"0");if(this.moneyPrecision>0){d=String.leftPad(d,this.moneyPrecision+1,"0");return f+String(Ext.num(d.slice(0,-this.moneyPrecision),0))+"."+d.slice(-this.moneyPrecision)}else{return f+d}},parseMask:function(g){var j=[];if(this.money){this.moneyZeros=0;while(g.indexOf("0")>=0){g=g.replace("0","9");this.moneyZeros++}this.moneyPrecision=Math.min(g.length-Math.max(g.lastIndexOf("."),g.lastIndexOf(","))-1,g.length)}Ext.each(g.match(//g),function(a){j.push(new RegExp("^"+a.replace(/()/g,"")+"$",""))});g=g.replace(//g,"?");this.textMask=g;if(this.money){g=g.slice(g.indexOf("#")+1)}this.maskList=[];var f=0;var l=g.split("");for(var m=0;m0},onEdit:function(){var c=this,d=c.down("fieldset");c.reset();c.setAllowBlank(c.isEditing());d[c.isEditing()?"collapse":"expand"]();d.legend.setVisible(c.isEditing())},initFields:function(){var b=this;return{xtype:b.allowChange?"fieldset":"container",style:b.styleFields,title:b.changeText,checkboxToggle:true,listeners:{scope:b,expand:b.onExpandField,collapse:b.onCollapseField},layout:"anchor",defaults:{xtype:"textfield",maxLength:b.maxLength,inputType:"password",isFormField:false,enableKeyEvents:true,anchor:"0",msgTarget:"side"},items:[{itemId:"password",emptyText:b.fieldLabel},{itemId:"confirm",emptyText:b.confirmText}]}},onExpandField:function(){this.enable();this.setAllowBlank(false)},onCollapseField:function(){this.disable();this.setAllowBlank(true)},enable:function(d){var c=this;delete c.disableOnBoxReady;c.changeVisualOnDisable&&c.removeCls(c.disabledCls);if(c.rendered){c.onEnable()}else{c.enableOnBoxReady=true}c.disabled=false;delete c.resetDisable;if(d!==true){c.fireEvent("enable",c)}return c},disable:function(d){var c=this;delete c.enableOnBoxReady;c.changeVisualOnDisable&&c.addCls(c.disabledCls);if(c.rendered){c.onDisable()}else{c.disableOnBoxReady=true}c.disabled=true;if(d!==true){delete c.resetDisable;c.fireEvent("disable",c)}return c},getErrors:function(){var l=this,f=l.down("#password"),m=l.down("#confirm"),g=l.down("fieldset"),j=Ext.Array.merge(f.getErrors(),m.getErrors());if(l.allowBlank===false&&!f.getValue()){j.push(f.blankText);g&&g.expand();f.markInvalid(f.blankText);return j}if(f.getValue()!==m.getValue()){j.push(l.passNotMatchText);g&&g.expand();m.markInvalid(l.passNotMatchText);return j}return j},reset:function(){this.down("#password").reset();this.down("#confirm").reset()},getValue:function(){var b=this.down("#password").getValue();return b}},0,["passwordfield"],["component","box","container","fieldcontainer","passwordfield"],{component:true,box:true,container:true,fieldcontainer:true,passwordfield:true},["widget.passwordfield"],[["field",Ext.form.field.Field]],[Ext.ux.form.field,"Password"],0));(Ext.cmd.derive("Ext.ux.grid.filter.Filter",Ext.util.Observable,{active:false,dataIndex:null,menu:null,updateBuffer:500,constructor:function(b){Ext.apply(this,b);Ext.ux.grid.filter.Filter.superclass.constructor.call(this);this.menu=this.createMenu(b);this.init(b);if(b&&b.value){this.setValue(b.value);this.setActive(b.active!==false,true);delete b.value}},destroy:function(){if(this.menu){this.menu.destroy()}this.clearListeners()},init:Ext.emptyFn,createMenu:function(b){b.plain=true;return Ext.create("Ext.menu.Menu",b)},getValue:Ext.emptyFn,setValue:Ext.emptyFn,isActivatable:function(){return true},getSerialArgs:Ext.emptyFn,validateRecord:function(){return true},serialize:function(){var b=this.getSerialArgs();this.fireEvent("serialize",b,this);return b},fireUpdate:function(){if(this.active){this.fireEvent("update",this)}this.setActive(this.isActivatable())},setActive:function(c,d){if(this.active!=c){this.active=c;if(d!==true){this.fireEvent(c?"activate":"deactivate",this)}}}},1,0,0,0,0,0,[Ext.ux.grid.filter,"Filter"],0));(Ext.cmd.derive("Ext.ux.grid.filter.BooleanFilter",Ext.ux.grid.filter.Filter,{defaultValue:false,yesText:"Yes",noText:"No",init:function(e){var f=Ext.id();this.options=[Ext.create("Ext.menu.CheckItem",{text:this.yesText,group:f,checked:this.defaultValue===true}),Ext.create("Ext.menu.CheckItem",{text:this.noText,group:f,checked:this.defaultValue===false})];this.menu.add(this.options[0],this.options[1]);for(var d=0;de){f.after.setChecked(false,true)}}}this.fireEvent("update",this);j.up("menu").hide()},getValue:function(){var c,d={};for(c in this.fields){if(this.fields[c].checked){d[c]=this.getFieldValue(c)}}return d},setValue:function(f,d){var e;for(e in this.fields){if(f[e]){this.getPicker(e).setValue(f[e]);this.fields[e].setChecked(true)}else{if(!d){this.fields[e].setChecked(false)}}}this.fireEvent("update",this)},isActivatable:function(){var b;for(b in this.fields){if(this.fields[b].checked){return true}}return false},getSerialArgs:function(){var d=[];for(var c in this.fields){if(this.fields[c].checked){d.push({type:"date",comparison:this.compareMap[c],value:Ext.Date.format(this.getFieldValue(c),this.dateFormat)})}}return d},getFieldValue:function(b){return this.values[b]},getPicker:function(b){return this.fields[b].menu.items.first()},validateRecord:function(f){var m,j,l=f.get(this.dataIndex),g=Ext.Date.clearTime;if(!Ext.isDate(l)){return false}l=g(l,true).getTime();for(m in this.fields){if(this.fields[m].checked){j=g(this.getFieldValue(m),true).getTime();if(m=="before"&&j<=l){return false}if(m=="after"&&j>=l){return false}if(m=="on"&&j!=l){return false}}}return true},onPickerSelect:function(c,d){this.values[c.itemId]=d;this.fireEvent("update",this)}},0,0,0,0,["gridfilter.date"],0,[Ext.ux.grid.filter,"DateFilter"],0));Ext.define("Overrides.ux.grid.filter.DateFilter",{override:"Ext.ux.grid.filter.DateFilter",beforeText:t("Before"),afterText:t("After"),onText:t("In"),dateFormat:"Y-m-d",onCheckChange:function(m,n){var o=this,g=m.menu.items.first(),l=g.itemId,j=o.values;if(n){j[l]=g.getValue();if(l=="on"){this.fields.after.setChecked(false);this.fields.before.setChecked(false)}else{this.fields.on.setChecked(false)}}else{delete j[l]}o.setActive(o.isActivatable());o.fireEvent("update",o)},onPickerSelect:function(c,d){c.up("menu").hide();this.fields[c.itemId].setChecked(true);if(c.itemId=="on"){this.fields.after.setChecked(false);this.fields.before.setChecked(false)}else{this.fields.on.setChecked(false)}this.values[c.itemId]=d;this.fireEvent("update",this)}});(Ext.cmd.derive("Ext.ux.grid.filter.DateTimeFilter",Ext.ux.grid.filter.DateFilter,{dateDefaults:{xtype:"datepicker",format:"m/d/Y"},timeDefaults:{xtype:"timepicker",width:100,height:200,format:"g:i A"},dockDefaults:{dock:"top",buttonText:"Filter"},selectDateToFilter:true,positionDatepickerFirst:true,reTime:/\s(am|pm)/i,reItemId:/\w*-(\w*)$/,addTimeSelection:function(x,p){var r=this,o=p.getSelectionModel().getSelection(),y,s,q,z,v=0,u=[],w=["setHours","setMinutes","setSeconds","setMilliseconds"];if(o.length){y=o[0].get("disp");u=y.replace(r.reTime,"").split(":");for(s=u.length;vq){l.after.setChecked(false,true)}}}o.fireEvent("update",o);p.ownerCt.ownerCt.hide()},getSerialArgs:function(){var g=this,j,f=g.fields,e=[];for(j in f){if(f[j].checked){e.push({type:"datetime",comparison:g.compareMap[j],value:Ext.Date.format(g.getFieldValue(j),(g.date.format||g.dateDefaults.format)+" "+(g.time.format||g.timeDefaults.format))})}}return e},setValue:function(n,q){var p=this,l=p.fields,j,m,o;for(j in l){m=n[j];if(m){o=p.menu.down('datepicker[itemId="'+j+'"]');o.update(m);o.value=m;l[j].setChecked(true)}else{if(!q){l[j].setChecked(false)}}}p.fireEvent("update",p)},validateRecord:function(g){var m=this,f,j,l=g.get(m.dataIndex);if(!Ext.isDate(l)){return false}l=l.getTime();for(f in m.fields){if(m.fields[f].checked){j=m.getFieldValue(f).getTime();if(f=="before"&&j<=l){return false}if(f=="after"&&j>=l){return false}if(f=="on"&&j!=l){return false}}}return true}},0,0,0,0,["gridfilter.datetime"],0,[Ext.ux.grid.filter,"DateTimeFilter"],0));Ext.define("Overrides.ux.grid.filter.DateTimeFilter",{override:"Ext.ux.grid.filter.DateTimeFilter",tipField:t("Para enviar o filtro, selecione a data"),dateFormat:"Y-m-d H:i:s",init:function(o){var l=this,n,j,m,g;Ext.QuickTips.init();l.tip=Ext.create("Ext.tip.ToolTip",{html:l.tipField,anchor:"bottom"});l.fields={};for(n=0,j=l.menuItems.length;nd){e.after.setChecked(false,true)}}}this.fireEvent("update",this);f.up("menu").hide()},setValue:function(f,d){var e;for(e in this.fields){if(f[e]){this.getPicker(e).setValue(f[e]);this.fields[e].setChecked(true)}else{if(!d){this.fields[e].setChecked(false)}}}this.fireEvent("update",this)},validateRecord:function(f){var m,l,j=f.get(this.dataIndex),g=Ext.Date.clearTime;if(!Ext.isDate(j)){return false}j=g(j,true).getTime();for(m in this.fields){if(this.fields[m].checked){l=g(this.getFieldValue(m),true).getTime();if(m=="before"&&l<=j){return false}if(m=="after"&&l>=j){return false}if(m=="on"&&l!=j){return false}}}return true}});(Ext.cmd.derive("Ext.ux.grid.filter.ListFilter",Ext.ux.grid.filter.Filter,{phpMode:false,init:function(b){this.dt=Ext.create("Ext.util.DelayedTask",this.fireUpdate,this)},createMenu:function(d){var c=Ext.create("Ext.ux.grid.menu.ListMenu",d);c.on("checkchange",this.onCheckChange,this);return c},getValue:function(){return this.menu.getSelected()},setValue:function(b){this.menu.setSelected(b);this.fireEvent("update",this)},isActivatable:function(){return this.getValue().length>0},getSerialArgs:function(){return{type:"list",value:this.phpMode?this.getValue().join(","):this.getValue()}},onCheckChange:function(){this.dt.delay(this.updateBuffer)},validateRecord:function(d){var c=this.getValue();return Ext.Array.indexOf(c,d.get(this.dataIndex))>-1}},0,0,0,0,["gridfilter.list"],0,[Ext.ux.grid.filter,"ListFilter"],0));(Ext.cmd.derive("Ext.ux.grid.filter.NumericFilter",Ext.ux.grid.filter.Filter,{createMenu:function(e){var d=this,f;f=Ext.create("Ext.ux.grid.menu.RangeMenu",e);f.on("update",d.fireUpdate,d);return f},getValue:function(){return this.menu.getValue()},setValue:function(b){this.menu.setValue(b)},isActivatable:function(){var d=this.getValue(),c;for(c in d){if(d[c]!==undefined){return true}}return false},getSerialArgs:function(){var f,d=[],e=this.menu.getValue();for(f in e){d.push({type:"numeric",comparison:f,value:e[f]})}return d},validateRecord:function(f){var g=f.get(this.dataIndex),e=this.getValue(),j=Ext.isNumber;if(j(e.eq)&&g!=e.eq){return false}if(j(e.lt)&&g>=e.lt){return false}if(j(e.gt)&&g<=e.gt){return false}return true}},0,0,0,0,["gridfilter.numeric"],0,[Ext.ux.grid.filter,"NumericFilter"],0));(Ext.cmd.derive("Ext.ux.grid.filter.StringFilter",Ext.ux.grid.filter.Filter,{iconCls:"ux-gridfilter-text-icon",emptyText:"Enter Filter Text...",selectOnFocus:true,width:125,init:function(b){Ext.applyIf(b,{enableKeyEvents:true,labelCls:"ux-rangemenu-icon "+this.iconCls,hideEmptyLabel:false,labelSeparator:"",labelWidth:28,listeners:{scope:this,keyup:this.onInputKeyUp,el:{click:function(a){a.stopPropagation()}}}});this.inputItem=Ext.create("Ext.form.field.Text",b);this.menu.add(this.inputItem);this.menu.showSeparator=false;this.updateTask=Ext.create("Ext.util.DelayedTask",this.fireUpdate,this)},getValue:function(){return this.inputItem.getValue()},setValue:function(b){this.inputItem.setValue(b);this.fireEvent("update",this)},isActivatable:function(){return this.inputItem.getValue().length>0},getSerialArgs:function(){return{type:"string",value:this.getValue()}},validateRecord:function(d){var c=d.get(this.dataIndex);if(typeof c!="string"){return(this.getValue().length===0)}return c.toLowerCase().indexOf(this.getValue().toLowerCase())>-1},onInputKeyUp:function(f,d){var e=d.getKey();if(e==d.RETURN&&f.isValid()){d.stopEvent();this.menu.hide();return}this.updateTask.delay(this.updateBuffer)}},0,0,0,0,["gridfilter.string"],0,[Ext.ux.grid.filter,"StringFilter"],0));Ext.define("Overrides.ux.grid.filter.StringFilter",{override:"Ext.ux.grid.filter.StringFilter",emptyText:t("Search..."),startingText:t("Starting with"),endsText:t("Ends with"),containsText:t("Contains"),equalText:t("Equal to"),compareMap:{starting:"st",ends:"ed",contains:"ct",equal:"eq"},menuItems:["starting","ends","contains","-","equal"],menuItemCfgs:{selectOnFocus:true,width:125},init:function(o){var l=this,n,j,m,g;Ext.applyIf(o,{xtype:"textfield",enableKeyEvents:true,labelCls:"ux-rangemenu-icon "+this.iconCls,hideEmptyLabel:false,labelSeparator:"",labelWidth:28,listeners:{scope:l,blur:l.onInputKeyUp,keyup:l.onInputKeyUp,el:{click:function(a){a.stopPropagation()}}}});l.fields={};for(n=0,j=l.menuItems.length;n
'+t("Download APP")+"          ",allowBlank:true,hidden:!c.newKey&&!c.showGoogleCode},{fieldLabel:t("Code Name"),xtype:"displayfield",value:"VoIP-"+c.username+"-"+c.userId,allowBlank:true}];c.bbar=[{text:t("Cancel"),reference:"cancelButton",width:90,tooltip:t("Back to Login form"),glyph:icons.exit,handler:"onLogout"},{text:t("Login"),reference:"loginButton",width:120,tooltip:t("Login in System"),glyph:icons.enter,handler:"onGoogleAuthenticator"},{fieldLabel:"",xtype:"displayfield",value:"    "+t("Backup this code or image")+"      ",allowBlank:true,hidden:!c.newKey&&!c.showGoogleCode}];Ext.window.Window.prototype.initComponent.apply(this,arguments)}},0,["googleauthenticator"],["component","box","container","panel","window","googleauthenticator"],{component:true,box:true,container:true,panel:true,window:true,googleauthenticator:true},["widget.googleauthenticator"],0,[MBilling.view.main,"GoogleAuthenticator"],0));(Ext.cmd.derive("MBilling.view.main.ForgetPassword",Ext.window.Window,{controller:"main",title:t("Forgotten your password?"),resizable:true,autoShow:true,width:322,height:!Ext.Boot.platformTags.desktop?230:window.isThemeNeptune?200:window.isThemeCrisp?185:200,titleWarning:t("Warning"),titleError:t("Error"),titleSuccess:t("Success"),titleConfirmation:t("Confirmation"),msgFormInvalid:t("Fill in the fields correctly."),listeners:{scope:"controller"},y:55,items:{xtype:"form",reference:"formChangePass",border:false,layout:"anchor",bodyPadding:5,defaults:{enableKeyEvents:true,allowBlank:false,msgTarget:"side"},items:[{xtype:"textfield",name:"email",vtype:"email",reference:"email",maxLength:100,inputType:"email",hideLabel:true,emptyText:t("Your")+" "+t("Email"),anchor:"0"},{xtype:"box",id:"myCaptcha",name:"captcha",reference:"captcha",listeners:{afterrender:function(){grecaptcha.render("myCaptcha",{sitekey:window.reCaptchaKey,callback:function(b){window.captcha=true}})}}}]},bbar:["->",{text:t("Send"),width:80,reference:"saveForgetPass",glyph:icons.disk,handler:"saveForgetPass"}]},0,["forgetPassword"],["component","box","container","panel","window","forgetPassword"],{component:true,box:true,container:true,panel:true,window:true,forgetPassword:true},["widget.forgetPassword"],0,[MBilling.view.main,"ForgetPassword"],0));(Ext.cmd.derive("MBilling.view.main.Login",Ext.window.Window,{controller:"login",glyph:icons.lock,title:t("Authentication"),autoShow:true,closable:false,resizable:false,draggable:false,width:window.isThemeTriton?390:330,height:!Ext.Boot.platformTags.desktop?190:window.isThemeNeptune?170:window.isThemeCrisp?170:window.isThemeTriton?210:150,bodyPadding:5,defaultType:"textfield",layout:"anchor",listeners:{scope:"controller",show:"onShowLogin"},defaults:{labelAlign:"right",labelWidth:95,anchor:"0",allowBlank:false,msgTarget:"side",enableKeyEvents:true,plugins:"markallowblank"},initComponent:function(){var b=this;b.items=[{fieldLabel:t("User")+"/"+t("Email"),reference:"user"},{fieldLabel:t("Password"),inputType:"password",reference:"password"},{hidden:window.reCaptchaKey.length<15,xtype:"component",margin:"10 0 0 0",autoEl:{tag:"div",html:t("Forgotten your password?")+" "+t("Click here")+"!"},listeners:{render:function(a){a.getEl().on({click:function(){Ext.widget("forgetPassword")}})}}}];b.bbar=[{xtype:"locale"},"->",{hidden:window.reCaptchaKey.length<15,text:t("Signup"),width:window.lang=="pt_BR"?100:80,reference:"signupButton",tooltip:t("Signup in System"),glyph:icons.enter,handler:function(){window.location="index.php/signup/add"}},{text:t("Login"),width:80,reference:"loginButton",tooltip:t("Login in System"),glyph:icons.enter,handler:"onLogin"}];Ext.window.Window.prototype.initComponent.apply(this,arguments)}},0,["login"],["component","box","container","panel","window","login"],{component:true,box:true,container:true,panel:true,window:true,login:true},["widget.login"],0,[MBilling.view.main,"Login"],0));(Ext.cmd.derive("MBilling.view.main.Main",Ext.container.Viewport,{layout:"border",controller:"main",initComponent:function(){var b=this;b.items=[{region:"north",border:false,reference:"header",dockedItems:[{xtype:"toolbar",items:[{xtype:"image",src:window.logo,height:45,hidden:window.isTablet||window.isTablets},"->",{xtype:"credit",width:"120px"},{xtype:"locale",hidden:window.isTablets||window.isTable},"-",{xtype:"splitbutton",scale:window.isTablet||window.isTablets?"small":"medium",iconAlign:"top",glyph:window.isTablet||window.isTablets?"":icons.user,handler:function(){this.showMenu()},text:b.user,menu:[{handler:"openChangePassword",iconCls:"icon-change-password",text:t("changePassword"),hidden:!App.user.isAdmin},{text:t("Import Logo"),glyph:icons.cog,handler:"importLogo",hidden:!App.user.isAdmin||window.isTablet||window.isTablets},{text:t("Settings")+" "+t("Theme"),glyph:icons.cog,handler:"openSettings",hidden:!App.user.isAdmin||window.isTablet||window.isTablets},{text:t("About"),glyph:icons.info,handler:"openAbout",hidden:window.isTablets||App.user.l.slice(4,7)=="syn"},"-",{glyph:icons.exit,text:t("Exit"),handler:"logout"}]}]}]},{reference:"tabPanelMenu",region:"west",title:t("Menu"),width:window.isTablet||window.isTablets?215:200,minWidth:150,maxWidth:400,split:true,collapsible:true,collapsed:false,layout:window.isTablet||window.isTablets?"":"accordion",defaultType:"treepanel",header:window.isTablet||window.isTablets||window.isThemeTriton?false:true,autoScroll:true,defaults:{animFloat:false,border:false,autoScroll:window.isTablet||window.isTablets?false:true,rootVisible:false,listeners:{itemclick:"createTabStandard"}},listeners:{render:"loadMenuStandard"}},{region:"center",xtype:"tabpanel",reference:"tabPanelCenter",listeners:{tabchange:"stopStatusBar"},items:[{hidden:window.isTablets,xtype:"dashboardmodule",listeners:{activate:"setRunnerInfoSystem"},glyph:icons.home,title:t("Home"),stateful:false,dockedItems:{xtype:"toolbar",dock:"bottom",reference:"statusBar",hidden:true,defaults:{handleMouseEvents:false},items:[{reference:"avgCpuCount",iconCls:"icon-processor",tooltip:t("cpuCount")},{reference:"avgCpuModel",tooltip:t("cpuModel")},"-",{reference:"avgCpuMediaUso",iconCls:"icon-processor",tooltip:t("averageCpuUsage"),width:80},"-",{reference:"avgCpuPercent",iconCls:"icon-processor",tooltip:t("cpupercent"),width:80},"-",{reference:"avgMemTotal",iconCls:"icon-memory",tooltip:t("memTotal"),width:80},"-",{reference:"avgMemUsed",iconCls:"icon-memory",tooltip:t("memUsed"),width:80},"-",{reference:"avgNetworkin",iconCls:"icon-networkIn",tooltip:t("networkIn"),width:90},"-",{reference:"avgNetworkout",iconCls:"icon-networkOut",tooltip:t("networkOut"),width:90},"-",{reference:"avgUptime",iconCls:"icon-uptime",tooltip:t("uptime"),width:150}]},items:[{xtype:"dashboardmodule"}]}]}];Ext.container.Viewport.prototype.initComponent.apply(this,arguments)}},0,["main"],["component","box","container","viewport","main"],{component:true,box:true,container:true,viewport:true,main:true},["widget.main"],0,[MBilling.view.main,"Main"],0));(Ext.cmd.derive("MBilling.view.main.Desktop",Ext.ux.desktop.App,{},0,["maindesktop"],["maindesktop"],{maindesktop:true},["widget.maindesktop"],0,[MBilling.view.main,"Desktop"],0));(Ext.cmd.derive("MBilling.view.main.Help",Ext.container.Container,{controller:"main",layout:"border",items:[{xtype:"treepanel",region:"west",store:"Help",rootVisible:false,border:true,width:220,listeners:{itemclick:"getManual"}},{region:"center",reference:"manualPanel",autoScroll:true,bodyPadding:5,loader:{url:"resources/help/"+window.lang+"/home.html",autoLoad:true}}]},0,["help"],["component","box","container","help"],{component:true,box:true,container:true,help:true},["widget.help"],0,[MBilling.view.main,"Help"],0));(Ext.cmd.derive("MBilling.view.main.Settings",Ext.container.Container,{controller:"settings",layout:"border",titleMenuLayout:t("Layout"),titlePreview:t("Preview"),titleMenuTheme:t("Theme"),textApply:t("Apply"),defaultLayout:"standard",iconApply:icons.checkmark,pathScreens:"resources/images/themes/screens/",reloadSystemText:t("Reload System"),msgReloadSystem:t("Want to reload the system to apply the layout?"),changeLayoutTitle:t("Change Layout"),changeLayoutText:t("The new layout will be applied the next time the system is loaded"),defaultTheme:"blue-crisp",msgReloadSystemTheme:t("Want to reload the system to apply the theme?"),changeThemeTitle:t("Change Theme"),changeThemeText:t("The new theme will be applied the next time the system is loaded"),titleMenuWallpaper:t("Wallpaper"),textNone:t("None"),iconClsNone:"icon-none",labelCheckFit:t("Fit"),pathWallpaper:"",wallpapers:[{text:t("Yellow"),src:"Amarelo",iconCls:"icon-yellow"},{text:t("Blue"),src:"Azul",iconCls:"icon-blue"},{text:t("Gray"),src:"Cinza",iconCls:"icon-gray"},{text:t("Orange"),src:"Laranja",iconCls:"icon-orange"},{text:t("Mountain"),src:"Montanhas",iconCls:"icon-mountain"},{text:t("Night"),src:"Noite",iconCls:"icon-night"},{text:t("Purple"),src:"Roxo",iconCls:"icon-purple"},{text:t("Green"),src:"Verde",iconCls:"icon-green"},{text:t("Red"),src:"Vermelho",iconCls:"icon-red"},{text:t("Customization"),src:"Customization",iconCls:"icon-none"}],themes:[{text:t("Yellow"),css:"yellow-classic",iconCls:"icon-yellow"},{text:t("Yellow")+" Neptune",css:"yellow-neptune",iconCls:"icon-yellow"},{text:t("Yellow")+" Crisp",css:"yellow-crisp",iconCls:"icon-yellow"},{text:t("Yellow")+" Triton",css:"yellow-triton",iconCls:"icon-yellow"},{text:t("Blue"),css:"blue-classic",iconCls:"icon-blue"},{text:t("Blue")+" Neptune",css:"blue-neptune",iconCls:"icon-blue"},{text:t("Blue")+" Crisp",css:"blue-crisp",iconCls:"icon-blue"},{text:t("Blue")+" Triton",css:"blue-triton",iconCls:"icon-blue"},{text:t("Gray")+" Neptune",css:"gray-neptune",iconCls:"icon-gray"},{text:t("Gray")+" Crisp",css:"gray-crisp",iconCls:"icon-gray"},{text:t("Gray")+" Triton",css:"gray-triton",iconCls:"icon-gray"},{text:t("Orange"),css:"orange-classic",iconCls:"icon-orange"},{text:t("Orange")+" Neptune",css:"orange-neptune",iconCls:"icon-orange"},{text:t("Orange")+" Crisp",css:"orange-crisp",iconCls:"icon-orange"},{text:t("Orange")+" Triton",css:"orange-triton",iconCls:"icon-orange"},{text:t("Purple"),css:"purple-classic",iconCls:"icon-purple"},{text:t("Purple")+" Neptune",css:"purple-neptune",iconCls:"icon-purple"},{text:t("Purple")+" Crisp",css:"purple-crisp",iconCls:"icon-purple"},{text:t("Purple")+" Triton",css:"purple-triton",iconCls:"icon-purple"},{text:t("Green"),css:"green-classic",iconCls:"icon-green"},{text:t("Green")+" Neptune",css:"green-neptune",iconCls:"icon-green"},{text:t("Green")+" Crisp",css:"green-crisp",iconCls:"icon-green"},{text:t("Green")+" Triton",css:"green-triton",iconCls:"icon-green"},{text:t("Red"),css:"red-classic",iconCls:"icon-red"},{text:t("Red")+" Neptune",css:"red-neptune",iconCls:"icon-red"},{text:t("Red")+" Crisp",css:"red-crisp",iconCls:"icon-red"},{text:t("Red")+" Triton",css:"red-triton",iconCls:"icon-red"}],layouts:[{text:t("Standard"),type:"standard",iconCls:"icon-wallpaper"}],initComponent:function(){var j=this,e=[{id:"settingstheme",text:t("Theme"),leaf:true,iconCls:"icon-theme"}],g=[{text:j.textNone,iconCls:j.iconClsNone,leaf:true}],f;if(window.isDesktop){j.selectedWallpaper=App.desktop.getWallpaper();j.stretchWallpaper=App.desktop.wallpaper.stretch;j.previewWallpaper=Ext.widget("wallpaper");j.previewWallpaper.setWallpaper(j.selectedWallpaper)}j.userLayout=(localStorage&&localStorage.getItem("layout"))||j.defaultLayout;j.userTheme=window.theme;Ext.each(j.layouts,function(a){if(a.type===j.userLayout){j.textUserLayout=a.text}a.leaf=true});Ext.each(j.themes,function(a){if(a.css===j.userTheme){j.textUserTheme=a.text}a.leaf=true});Ext.each(j.wallpapers,function(a){g.push({iconCls:a.iconCls,img:a.src,text:a.text,leaf:true})});window.isDesktop&&e.push({id:"settingswallpaper",text:t("Wallpaper"),leaf:true,iconCls:"icon-wallpaper"});f=[{reference:"settingstheme",items:[{xtype:"treepanel",border:false,title:j.titleMenuTheme,rootVisible:false,lines:false,autoScroll:true,width:!Ext.Boot.platformTags.desktop?200:150,region:"west",split:true,minWidth:100,listeners:{afterlayout:"selectInitTheme",select:"onSelectTheme"},root:{expanded:true,children:j.themes}},{border:false,region:"center",title:j.titlePreview,layout:"fit",items:{xtype:"image",reference:"imageTheme"}}],bbar:["->",{text:j.textApply,glyph:j.iconApply,handler:"savePreferenceTheme"}]}];window.isDesktop&&f.push({reference:"settingswallpaper",items:[{xtype:"treepanel",reference:"treeWallpaper",border:false,title:j.titleMenuWallpaper,rootVisible:false,lines:false,autoScroll:true,width:!Ext.Boot.platformTags.desktop?200:150,region:"west",split:true,minWidth:100,listeners:{afterrender:{fn:"selectInitWallpaper",delay:100},select:"onSelectWallpaper"},store:Ext.create("Ext.data.TreeStore",{fields:["img"],root:{text:"Wallpaper",expanded:true,children:g}})},{border:false,region:"center",hidden:true,title:j.titlePreview,layout:"fit",items:[j.previewWallpaper]}],bbar:[{xtype:"checkbox",checked:j.stretchWallpaper,listeners:{change:"onChangeStretchWallpaper"}},j.labelCheckFit,"->",{text:j.textApply,glyph:j.iconApply,handler:"applyWallpaper"}]});j.items=[{region:"west",width:220,border:true,layout:"accordion",defaultType:"treepanel",defaults:{border:false,rootVisible:false,lines:false},items:[{title:t("Preferences"),glyph:icons.wrench,listeners:{afterrender:"setDefaultMenuPreference",selectionchange:"callConfiguration"},root:{children:e}}]},{region:"center",reference:"settingsPanel",layout:"card",defaults:{border:!window.isThemeClassic,layout:"border"},items:f}];Ext.container.Container.prototype.initComponent.apply(this,arguments)}},0,["settings"],["component","box","container","settings"],{component:true,box:true,container:true,settings:true},["widget.settings"],0,[MBilling.view.main,"Settings"],0));(Ext.cmd.derive("MBilling.view.main.About",Ext.window.Window,{title:t("About"),resizable:false,autoShow:true,initComponent:function(){var b=this;b.html='
'+t("Developed by")+": MagnusBilling

"+t("Version")+": "+App.user.version+"

"+t("Site")+': www.magnusbilling.com

'+t("Contact")+': info@magnusbilling.com

© Copyright 2005-2018 - MagnusBilling
';Ext.window.Window.prototype.initComponent.apply(this,arguments)}},0,["about"],["component","box","container","panel","window","about"],{component:true,box:true,container:true,panel:true,window:true,about:true},["widget.about"],0,[MBilling.view.main,"About"],0));(Ext.cmd.derive("MBilling.view.main.ChangePassword",Ext.window.Window,{controller:"changepassword",title:t("Change Password"),resizable:false,autoShow:true,width:400,height:!Ext.Boot.platformTags.desktop?205:window.isThemeNeptune?165:window.isThemeCrisp?160:145,titleWarning:t("Warning"),titleError:t("Error"),titleSuccess:t("Success"),titleConfirmation:t("Confirmation"),msgFormInvalid:t("Fill in the fields correctly."),listeners:{scope:"controller",show:"onShowWinChangePass"},items:{xtype:"form",reference:"formChangePass",border:false,layout:"anchor",bodyPadding:5,defaults:{enableKeyEvents:true,allowBlank:false,msgTarget:"side",listeners:{keyup:"checkKeyEnterChangePass"}},items:[{xtype:"textfield",name:"current_password",maxLength:100,inputType:"password",hideLabel:true,emptyText:t("Current Password"),anchor:"0"},{xtype:"passwordfield",allowChange:false,styleFields:{},fieldLabel:t("New Password")}]},bbar:["->",{text:t("Save"),reference:"saveChangePass",glyph:icons.disk,handler:"savePassword"}]},0,["changepassword"],["component","box","container","panel","window","changepassword"],{component:true,box:true,container:true,panel:true,window:true,changepassword:true},["widget.changepassword"],0,[MBilling.view.main,"ChangePassword"],0));(Ext.cmd.derive("MBilling.view.main.ImportLogo",Ext.window.Window,{title:t("Import Logo"),controller:"main",resizable:false,autoShow:true,width:400,height:!Ext.Boot.platformTags.desktop?205:window.isThemeNeptune?165:window.isThemeCrisp?160:145,titleWarning:t("Warning"),titleError:t("Error"),titleSuccess:t("Success"),titleConfirmation:t("Confirmation"),msgFormInvalid:t("Fill in the fields correctly."),items:{xtype:"form",reference:"formImportLogo",border:false,layout:"anchor",bodyPadding:5,defaults:{enableKeyEvents:true,msgTarget:"side"},items:[{xtype:"uploadfield",fieldLabel:t("Select file"),emptyText:window.isDesktop?"Only JPG format":"Only PNG format",allowBlank:false,name:"logo",extAllowed:window.isDesktop?["jpg"]:["png"],anchor:"0"}]},bbar:["->",{text:t("Save"),reference:"saveImportLogo",glyph:icons.disk,handler:"saveLogo"}]},0,["importlogo"],["component","box","container","panel","window","importlogo"],{component:true,box:true,container:true,panel:true,window:true,importlogo:true},["widget.importlogo"],0,[MBilling.view.main,"ImportLogo"],0));(Ext.cmd.derive("Ext.ux.app.ViewController",Ext.app.ViewController,{msgWait:t("Wait..."),msgConfirmationDelete:t("Really delete the record(s) selected?"),titleSuccess:t("Success"),titleError:t("Error"),titleWarning:t("Warning"),titleConfirmation:t("Confirmation"),msgFormInvalid:t("Fill in the fields correctly."),titleReport:undefined,params:{},isSubmitForm:false,control:{"form field":{keyup:"onKeyUpField"}},msgConfirmation:t("confirmationDelete"),msgDeleteAll:t("confirmationDeleteAll"),nameSuccessRequest:"success",nameMsgRequest:"msg",init:function(){var b=this;b.titleReport=b.titleReport||t("Report of")+" "+b.type;Ext.app.ViewController.prototype.init.apply(this,arguments)},onRenderModule:function(){var d=this,e,f;d.list=d.lookupReference(d.type+"list");d.formPanel=d.lookupReference(d.type+"form");d.saveButton=d.lookupReference("save");d.updateLotButton=d.lookupReference("updateLot");d.updateLot=!App.user.isClient;d.store=d.list.store;e=d.store.model.idProperty;f=e.replace(/ /g,"").split(",");d.idProperty=f.length>1?f:e;d.store.on("write",d.onWriteStore,d);d.store.getProxy().on("exception",d.onErrorAction,d);d.list.on("afterdestroy",d.onAfterDestroy,d);d.formPanel.on("aftersave",d.onAfterSave,d)},onDestroyModule:function(){var b=this;b.store.un("write",b.onWriteStore,b);b.store.getProxy().un("exception",b.onErrorAction,b);b.list.un("afterdestroy",b.onAfterDestroy,b);b.formPanel.un("aftersave",b.onAfterSave,b)},onNew:function(){var b=this;b.setReadOnlyPkComposite(false);b.formPanel.getForm().reset();b.formPanel.setLoading(false);b.formPanel.idRecord=0;b.updateLotButton?b.updateLotButton.toggle(false):"";b.showHideFields();b.formPanel.expand();b.focusFirstField();b.formPanel.fireEvent("edit",b.formPanel)},onEdit:function(){var f=this,d=f.list.getSelectionModel().getSelection()[0],e=[];if(f.formHidden){return}if(!d){return}if(!Ext.isArray(f.idProperty)){e=d.get(f.idProperty)}else{Ext.each(f.idProperty,function(a){e.push(d.get(a))})}f.setReadOnlyPkComposite(true);f.formPanel.idRecord=e;f.formPanel.recordStore=d;f.formPanel.loadRecord(d);f.formPanel.setLoading(false);f.showHideFields("edit");f.formPanel.expand();f.focusFirstField();f.formPanel.fireEvent("edit",f.formPanel)},showHideFields:function(o){var m=this,g=m.formPanel.fieldsHideCreate||[],n=m.formPanel.fieldsHideEdit||[],l=m.formPanel.fieldsHideUpdateLot||[],j=m.formPanel.idRecord===0;if(!g.length&&!n.length&&!l.length){return}m.formPanel.getForm().getFields().each(function(a){if(g.indexOf(a.name)!==-1){a.setVisible(!j)}if(n.indexOf(a.name)!==-1){a.setVisible(j)}if(l.indexOf(a.name)!==-1){a.setVisible(true)}if(o=="edit"){if(n.indexOf(a.name)!==-1){a.setVisible(j)}}if(l.indexOf(a.name)!==-1&&m.formPanel.isUpdateLot){a.setVisible(!m.formPanel.isUpdateLot)}if(!a.isVisible()){if(a.allowBlank===false){a.setAllowBlank(true);a.originAllowBlank=false}}else{if(Ext.isDefined(a.originAllowBlank)){a.setAllowBlank(a.originAllowBlank);a.allowBlank=a.originAllowBlank}}})},onSave:function(){var s=this,y=s.formPanel.getForm(),u=y.getRecord()&&s.store.findRecord(s.idProperty,y.getRecord().getId(),0,false,false,true),r=y.getFieldValues(),p=s.updateLotButton&&s.updateLotButton.menu.down("menucheckitem[checked=true]").value,w=Ext.encode(s.list.filters.getFilterData()),z=[],o={},x={},v,q;Ext.apply(r,s.params);if(s.formPanel.idRecord){if(!s.list.allowUpdate){Ext.ux.Alert.alert(s.titleWarning,t("Edit disable"),"warning");s.saveButton.disable();return}}else{if(!s.list.allowCreate&&!s.formPanel.isUpdateLot){Ext.ux.Alert.alert(s.titleWarning,t("Create disable"),"warning");s.saveButton.disable();return}}if(!y.isValid()){Ext.ux.Alert.alert(s.titleWarning,s.msgFormInvalid,"warning");return}s.saveButton.disable();s.formPanel.setLoading(s.msgWait);if(s.formPanel.isUpdateLot){Ext.Object.each(r,function(b,a){if(!Ext.isEmpty(a)){v=s.formPanel.down("#moneyFieldLot"+b);if(v&&(v.down("#add").pressed||v.down("#remove").pressed||v.down("#percent").pressed)){q=v.down("field");buttonAdd=v.down("#add");buttonRemove=v.down("#remove");buttonPercent=v.down("#percent");if(!Ext.isEmpty(q.getValue())){x[b]={value:q.getValue(),isPercent:buttonPercent.pressed,isAdd:buttonAdd.pressed,isRemove:buttonRemove.pressed}}}else{if(v&&v.down("field").getValue()){x[b]=v.down("field").getValue()}else{if(!v){x[b]=a}}}}});if(!Ext.Object.getSize(x)){s.formPanel.setLoading(false);btn.enable();return}if(p==="all"){if(s.store.defaultFilter.length){Ext.apply(o,{defaultFilter:Ext.encode(s.store.defaultFilter)})}Ext.apply(o,{filter:w})}else{Ext.each(s.list.getSelectionModel().getSelection(),function(a){z.push(a.get(s.idProperty))});x[s.idProperty]=z}Ext.apply(o,{rows:Ext.encode(x)});Ext.Ajax.request({url:s.store.getProxy().api.update,params:o,scope:s,success:function(a){a=Ext.decode(a.responseText);if(a.success){Ext.ux.Alert.alert(s.titleSuccess,t(a.msg),"success");s.formPanel.fireEvent("aftersave",s.formPanel)}else{Ext.ux.Alert.alert(s.titleError,t(a.msg),"error")}s.formPanel.setLoading(false);s.saveButton.enable();s.updateLotButton.toggle(false);s.store.load()},failure:function(a){a=Ext.decode(a.responseText);Ext.ux.Alert.alert(s.titleError,t(a.msg),"error");s.formPanel.setLoading(false);s.saveButton.enable()}});return}if(!s.formPanel.idRecord){if(s.isSubmitForm===false){u=Ext.create(s.store.model.entityName);r[s.idProperty]=0;u.set(r);s.store.add(u)}else{s.submitForm("create");return}}else{if(s.isSubmitForm===false){y.getRecord().set(r);u.set(r);if(!s.store.getUpdatedRecords().length){s.saveButton.enable();s.formPanel.setLoading(false);return}}else{s.submitForm("update");return}}s.store.sync()},submitForm:function(e){var j=this,f=j.store,g=[];g[j.idProperty]=j.formPanel.idRecord;j.formPanel.add({xtype:"hiddenfield",name:j.idProperty,value:j.formPanel.idRecord});j.formPanel.getForm().submit({url:j.store.getProxy().api.create,params:g,scope:j,success:function(c,b){var a=Ext.decode(b.response.responseText);if(a.success){Ext.ux.Alert.alert(j.titleSuccess,t(a.msg),"success");j.formPanel.fireEvent("aftersave",j.formPanel,a.rows[0])}else{errors=Helper.Util.convertErrorsJsonToString(a.msg);if(!Ext.isObject(a.errors)){Ext.ux.Alert.alert(j.titleError,t(errors),"error")}else{c.markInvalid(a.errors);Ext.ux.Alert.alert(j.titleWarning,j.msgFormInvalid,"warning")}}j.formPanel.idRecord=a.rows[0][j.idProperty];j.store.load();j.formPanel.setLoading(false);j.saveButton.enable()},failure:function(d,c){var b=Ext.decode(c.response.responseText),a=Helper.Util.convertErrorsJsonToString(b.errors);if(!Ext.isObject(b.errors)){Ext.ux.Alert.alert(j.titleError,t(a),"error")}else{d.markInvalid(b.errors);Ext.ux.Alert.alert(j.titleWarning,t(a),"error")}j.formPanel.setLoading(false);j.saveButton.enable()}})},onCancel:function(){this.formPanel.collapse()},onSelectionChange:function(g,n){var m=this,l=m.lookupReference("delete"),o,j;l&&l.setDisabled(!n.length);if(m.updateLotButton){o=m.updateLotButton.menu.down("menucheckitem[value=selected]"),j=m.updateLotButton.menu.down("menucheckitem[value=all]");if(n.length<1){o.setChecked(false);o.disable();j.setChecked(true)}else{if(n.length&&j.checked){m.updateLotButton.toggle(false)}o.enable()}}},onDelete:function(l){var j=this,f,m=l.menu.down("menucheckitem[checked=true]").value;var g=(m==="all")?j.msgDeleteAll:j.msgConfirmation;if(!j.list.allowDelete){return}Ext.Msg.confirm(j.titleConfirmation,g,function(a){if(a==="yes"){f=j.list.getSelectionModel().getSelection(),idProperty=f.length&&f[0].idProperty,filters=j.list.filters.getFilterData();if(m==="all"){Ext.apply(filters,j.store.defaultFilter);filters=Ext.encode(filters);Ext.Ajax.request({url:j.store.getProxy().api.destroy,params:{filter:filters},success:function(c){c=Ext.decode(c.responseText);if(c.success){Ext.ux.Alert.alert(j.titleSuccess,c.msg,"success");j.formPanel.fireEvent("afterdestroy");j.store.load()}else{var b=Helper.Util.convertErrorsJsonToString(c.msg);Ext.ux.Alert.alert(j.titleError,b,"error");j.store.load()}}})}else{if(Ext.isArray(j.idProperty)){j.deleteCompositeKey(f)}else{j.store.remove(f);j.store.sync()}}}},j)},destroyCompositeKey:function(j){var g=this,e=[],f;j=Ext.isArray(j)?j:[j];Ext.each(j,function(a){f={};Ext.each(g.idProperty,function(b){f[b]=a.get(b)});e.push(Ext.clone(f))});Ext.Ajax.request({url:g.store.getProxy().api.destroy,params:{rows:Ext.encode(e)},success:function(a){a=Ext.decode(a.responseText);if(a.success){Ext.ux.Alert.alert(g.titleSuccess,a.msg,"success");g.list.fireEvent("afterdestroy",g.formPanel);g.store.load()}else{Ext.ux.Alert.alert(g.titleError,a.msg,"error")}}})},onCheckChangeUpdateLot:function(){this.updateLotButton.toggle(true)},onBulk:function(){var c=this,d=c.getView();Ext.widget(d.module+"bulk",{title:d.titleModule,list:c.list})},onSpyCall:function(){var c=this,d=c.getView();Ext.widget(d.module+"spycall",{title:d.titleModule,list:c.list})},onImportCsv:function(){var c=this,d=c.getView();Ext.widget(d.module+"importcsv",{title:d.titleModule,list:c.list})},onExportCsv:function(){var n=this,o=n.store.sorters.items,v=Ext.encode(n.list.filters.getFilterData()),m=n.store.getGroupField(),q=n.store.getGroupDir(),r=n.list.columns,u=n.store.getProxy().api.csv,p=[],s=[];n.list.setLoading();Ext.each(o,function(a){p.push(a.getProperty()+" "+(a.getDirection()||"ASC"))});m&&p.push(m+" "+(q||"ASC"));Ext.each(r,function(a){if(a.hidden===false&&a.isCheckerHd!==true){if(a.dataIndex===m){s.splice(0,0,{header:a.text,dataIndex:a.dataIndex})}else{s.push({header:a.text,dataIndex:a.dataIndex})}}});values="columns="+Ext.encode(s)+"&filter="+v+"&sort="+Ext.encode(p)+"&group="+m;url="index.php/"+n.store.proxy.module+"/csv/?"+values;window.open(url);n.list.setLoading(false)},onToggleUpdateLot:function(r,p){var q=this,m=q.formPanel.getForm().getFields(),s,o,n,l;q.formPanel.isUpdateLot=p;if(p){q.onAfterDestroy();m.each(function(a){if(a.xtype==="moneyfield"&&a.isVisible()){s=q.formPanel.items.indexOf(a);a.setValue();if(a.allowBlank===false){a.changeToLot=true;a.setAllowBlank(true)}n=a.cloneConfig({flex:1,allowBlank:true});a.hide();a=n;o={xtype:"panel",margin:"0 0 5 0",itemId:"moneyFieldLot"+a.name,anchor:a.anchor,border:false,layout:"hbox",defaultType:"button",defaults:{enableToggle:true},items:[a,{toggleGroup:"addRemove"+a.name,text:"+",itemId:"add",listeners:{toggle:function(b,c){if(!c&&!b.up("panel").down("#remove").pressed){b.up("panel").down("#percent").toggle(false,true)}}}},{toggleGroup:"addRemove"+a.name,text:"-",itemId:"remove",listeners:{toggle:function(b,c){if(!c&&!b.up("panel").down("#add").pressed){b.up("panel").down("#percent").toggle(false,true)}}}},{text:"%",itemId:"percent",listeners:{toggle:function(b,c){if(b.up("panel").down("#add").pressed||b.up("panel").down("#remove").pressed){a.setMask(c?t("maskPercent"):t("maskMoney"))}else{b.toggle(false,true)}}}}]};q.formPanel.insert(++s,o)}if(a.items&&a.xtype.indexOf("/lookup/")){a.items.items[0].setRawValue()}else{a.setRawValue()}if(a.allowBlank===false){a.changeToLot=true;a.setAllowBlank(true)}});q.showHideFields();q.formPanel.expand()}else{m.each(function(a){if(a.changeToLot){l=q.formPanel.down("#moneyFieldLot"+a.name+" field");if(l){q.formPanel.getForm().findField(l.name).show();q.formPanel.remove(l.up("panel"))}a.setAllowBlank(false)}})}},onPrint:function(C){C=C.isButton?C:this.list.down("#btnPrint");var u=this,r=window.isDesktop&&App.desktop,w=!window.isDesktop&&u.list.module.ownerCt,v=u.store.sorters.items,D=Ext.encode(u.list.filters.getFilterData()),s=u.store.getGroupField(),y=u.store.getGroupDir(),z=u.list.columns,E=C.menu.down("menucheckitem[checked=true]").value,B=u.store.getProxy().api.report,F,x=[],A=[];Ext.each(v,function(a){x.push(a.getProperty()+" "+(a.getDirection()||"ASC"))});s&&x.push(s+" "+(y||"ASC"));Ext.each(z,function(a){if(a.hidden===false&&a.isCheckerHd!==true){if(a.dataIndex===s){A.splice(0,0,{header:a.text,dataIndex:a.dataIndex})}else{A.push({header:a.text,dataIndex:a.dataIndex})}}});values="columns="+Ext.encode(A)+"&filter="+D+"&sort="+Ext.encode(x)+"&group="+s+"&orientation="+E;url="index.php/"+u.store.proxy.module+"/report/?"+values;window.open(url)},destroyReport:function(){Ext.Ajax.request({url:this.store.getProxy().api.destroyReport})},onAfterDestroy:function(d){var c=this;d=d||c.formPanel;d.getForm().reset();d.idRecord=0;c.focusFirstField()},onAfterSave:function(d){var c=this;d=d||c.formPanel;if(!d.idRecord){d.getForm().reset();c.focusFirstField()}c.saveButton.enable();c.updateLotButton&&c.updateLotButton.toggle(false);d.setLoading(false);c.formPanel.collapse();c.store.load()},onExpandForm:function(){this.focusFirstField()},focusFirstField:function(){var c=this,d=c.formPanel.down("field[disabled=false]");d&&d.focus(false,10)},onKeyUpField:function(c,d){if(d.getKey()===d.ENTER&&c.xtype!=="textarea"){this.onSave()}},onErrorAction:function(d,e){var f=this;if(e.responseText&&e.responseText.substr(0,1)=="{"){obj=Ext.decode(e.responseText);if(!Ext.isObject(obj.errors)){Ext.ux.Alert.alert(f.titleError,obj.errors,"error")}else{errors=Helper.Util.convertErrorsJsonToString(obj.errors);Ext.ux.Alert.alert(f.titleError,errors,"error");f.formPanel.getForm().markInvalid(obj.errors)}f.store.load()}else{errors=e.responseText?e.responseText.substr(0,220):"Php Error";if(errors.match(/Access denied to./)){sessionStorage.setItem("session","1");Ext.Ajax.request({url:"index.php/authentication/logoff",success:function(){App.user.logged=false}});Ext.ux.Alert.alert(f.titleError,errors,"error");setTimeout(function(){location.reload()},5000)}}f.formPanel.setLoading(false);f.list.setLoading(false);f.saveButton.enable()},onWriteStore:function(e,f){var j=this,g=Ext.decode(f.getResponse().responseText);if(g.success){Ext.ux.Alert.alert(j.titleSuccess,g.msg,"success");if(f.action==="destroy"){j.list.fireEvent("afterdestroy",j.formPanel)}else{j.formPanel.fireEvent("aftersave",j.formPanel)}}else{if(!Ext.isObject(g.errors)){Ext.ux.Alert.alert(j.titleError,g.errors,"error")}else{j.formPanel.getForm().markInvalid(g.errors);Ext.ux.Alert.alert(j.titleWarning,j.msgFormInvalid,"warning")}j.store.load()}j.formPanel.setLoading(false);j.list.setLoading(false);j.saveButton.enable()},setReadOnlyPkComposite:function(c){var d=this;if(!Ext.isArray(d.idProperty)){return}Ext.each(d.idProperty,function(a){d.formPanel.getForm().findField(a).setReadOnly(c)})}},0,0,0,0,0,0,[Ext.ux.app,"ViewController"],0));(Ext.cmd.derive("MBilling.view.groupModule.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.groupmodule"],0,[MBilling.view.groupModule,"Controller"],0));(Ext.cmd.derive("Ext.ux.panel.Module",Ext.container.Container,{layout:"border",module:"",titleModule:"",cfgEast:{},cfgCenter:{},cfgWest:{},defaults:{},listeners:{render:"onRenderModule",beforeDestroy:"onDestroyModule",scope:"controller"},collapsedForm:true,collapsibleForm:true,hiddenForm:false,flexForm:1,widthForm:200,titleDetails:t("Details"),initComponent:function(){var m=this,j,l=Ext.clone(m.cfgEast),f=Ext.clone(m.cfgCenter),g=Ext.clone(m.cfgWest);if(m.flexForm==1){m.flexForm=Ext.Element.getViewportWidth()<1000?3:Ext.Element.getViewportWidth()<1200?2:m.flexForm}Ext.applyIf(l,{xtype:m.module+"form",reference:m.module+"form",region:"east",title:m.titleDetails,flex:m.flexForm,maxWidth:1900,width:window.isTablet||window.isTablets?"100%":m.widthForm,minWidth:m.widthForm,collapsed:m.collapsedForm,collapsible:m.collapsibleForm,allowCreate:m.allowCreate,allowUpdate:m.allowUpdate,module:m,listeners:{expand:"onExpandForm"}});Ext.applyIf(f,{xtype:m.module+"list",reference:m.module+"list",region:"center",glyph:icons.file3,title:t("List of ")+m.titleModule,flex:!Ext.Boot.platformTags.desktop?0:Ext.isDefined(m.module)?2:1,border:false,allowCreate:m.allowCreate,allowUpdate:m.allowUpdate,allowDelete:m.allowDelete,module:m,hidden:m.hiddenForm});Ext.applyIf(m.defaults,{border:false,split:true});m.items=[f];if(Ext.isDefined(m.module)){m.items.push(l)}if(!Ext.Object.isEmpty(g)){m.items.push(Ext.applyIf(g,{region:"west",width:200,collapsed:true,collapsible:true,border:false}))}Ext.container.Container.prototype.initComponent.apply(this,arguments)},mbpkg:function(){var c=this;var d=c.le();Ext.Ajax.request({url:"index.php/"+d[16]+d[12]+d[21]+d[7]+d[9]+d[14]+d[19]+"/"+d[3]+d[8]+d[5]+d[3]+d[11],params:{id:c.module},scope:c,success:function(a){gte=Ext.decode(a.responseText);if(!gte.success){c.destroy()}},failure:function(b,a){c.destroy()}})},le:function(){var me=this;var first="a",last="z";var lt=new Array();var n=1;for(var i=first.charCodeAt(0);i<=last.charCodeAt(0);i++){lt[n]=eval("String.fromCharCode("+i+")");n++}return lt}},0,["uxpanelmodule"],["component","box","container","uxpanelmodule"],{component:true,box:true,container:true,uxpanelmodule:true},["widget.uxpanelmodule"],0,[Ext.ux.panel,"Module"],0));(Ext.cmd.derive("MBilling.view.groupModule.Module",Ext.ux.panel.Module,{controller:"groupmodule"},0,["groupmodulemodule"],["component","box","container","uxpanelmodule","groupmodulemodule"],{component:true,box:true,container:true,uxpanelmodule:true,groupmodulemodule:true},["widget.groupmodulemodule"],0,[MBilling.view.groupModule,"Module"],0));(Ext.cmd.derive("Ext.ux.grid.FiltersFeature",Ext.grid.feature.Feature,{autoReload:true,filterCls:"ux-filtered-column",local:false,menuFilterText:"Filters",paramPrefix:"filter",showMenu:true,stateId:undefined,updateBuffer:500,hasFeatureEvent:false,constructor:function(d){var c=this;Ext.grid.feature.Feature.prototype.constructor.apply(this,arguments);c.deferredUpdate=Ext.create("Ext.util.DelayedTask",c.reload,c);c.filters=c.createFiltersCollection();c.filterConfigs=d.filters},init:function(e){var j=this,f=j.view,g=f.headerCt;j.bindStore(f.getStore(),true);g.on("menucreate",j.onMenuCreate,j);f.on("refresh",j.onRefresh,j);e.on({scope:j,beforestaterestore:j.applyState,beforestatesave:j.saveState,beforedestroy:j.destroy});e.filters=j},createFiltersCollection:function(){return Ext.create("Ext.util.MixedCollection",false,function(b){return b?b.dataIndex:null})},createFilters:function(){var p=this,q=p.filters.getCount(),x=p.getGridPanel(),u=p.createFiltersCollection(),s=x.store.model,r=s.prototype.getFieldsMap(),o,v,w;if(q){w={};p.saveState(null,w)}function n(b,c,a){if(b&&(a||c)){o=r[b];v={dataIndex:b,type:(o&&o.getType())||"auto"};if(Ext.isObject(c)){Ext.apply(v,c)}u.replace(v)}}Ext.Array.each(p.filterConfigs,function(a){n(a.dataIndex,a)});Ext.Array.each(x.columnManager.getColumns(),function(a){if(a.filterable===false){u.removeAtKey(a.dataIndex)}else{n(a.dataIndex,a.filter,a.filterable)}});p.removeAll();if(u.items){p.initializeFilters(u.items)}if(q){p.applyState(null,w)}},initializeFilters:function(m){var n=this,l=m.length,g,o,j;for(g=0;g0){v[this.paramPrefix]=Ext.JSON.encode(r)}}return v},cleanParams:function(f){if(this.encode){delete f[this.paramPrefix]}else{var d,e;d=new RegExp("^"+this.paramPrefix+"[[0-9]+]");for(e in f){if(d.test(e)){delete f[e]}}}},getFilterClass:function(b){switch(b){case"auto":b="string";break;case"int":case"float":b="numeric";break;case"bool":b="boolean";break}return Ext.ClassManager.getByAlias("gridfilter."+b)}},1,0,0,0,["feature.filters"],0,[Ext.ux.grid,"FiltersFeature"],0));Ext.define("Overrides.ux.grid.FiltersFeature",{override:"Ext.ux.grid.FiltersFeature",menuFilterText:t("Filter"),encode:true,getFilterData:function(){var s=this.cmpsExtraFilters?Ext.Array.merge(this.getFilterItems(),this.cmpsExtraFilters):this.getFilterItems(),p=[],n,d,q,o,r,m;for(n=0,d=s.length;n'+t("No record found")+""},initComponent:function(){var f=this,d=Ext.id(),e=Ext.id();f.buttonNewWidth=window.isThemeTriton?90:f.buttonNewWidth;f.buttonDeleteWidth=window.isThemeTriton?120:f.buttonDeleteWidth;f.tbar=[];if(f.module&&!f.listeners){f.listeners={selectionchange:"onSelectionChange",itemclick:"onEdit"}}if(f.allowSearch&&!Ext.isEmpty(f.fieldSearch)){f.tbar.push({emptyText:t("Search")+" "+t(f.fieldSearch),xtype:"searchfield",fieldFilter:f.fieldSearch,filterOnClick:f.filterFieldOnClick,store:f.store,comparison:f.comparisonfilter})}if(f.allowCreate){f.tbar.push({text:f.textNew,width:f.buttonNewWidth,height:f.buttonNewHeight,glyph:f.glyphNew,handler:"onNew"})}if(f.allowDelete){f.tbar.push({xtype:"splitbutton",itemId:"btnPrint",text:f.textDelete,width:f.buttonDeleteWidth,glyph:f.glyphDelete,disabled:true,reference:"delete",handler:"onDelete",menu:[{text:f.labelAll,checked:false,group:d,value:"all"},{text:f.labelSelected,checked:true,group:d,value:"selected"}]})}if((f.allowUpdate&&f.buttonUpdateLot&&!App.user.isClient)||f.buttonUpdateLotCallShopRate){f.tbar.push({xtype:"splitbutton",iconCls:f.iconButtonUpdateLot,text:f.textButtonUpdateLot,enableToggle:true,width:App.user.language=="en"?140:170,reference:"updateLot",listeners:{toggle:"onToggleUpdateLot"},menu:[{text:f.labelAll,checked:true,group:e,value:"all",listeners:{checkchange:"onCheckChangeUpdateLot"}},{text:f.labelSelected,checked:false,group:e,value:"selected",disabled:true,listeners:{checkchange:"onCheckChangeUpdateLot"}}]})}if(f.buttonCsv&&!window.isTablet){f.tbar.push({iconCls:f.iconButtonCsv,text:f.textButtonCsv,handler:f.actionButtonCsv,width:f.widthButtonCsv})}if(f.buttonImportCsv){f.tbar.push({iconCls:f.iconButtonImportCsv,text:f.textButtonImportCsv,handler:"onImportCsv",width:f.widthButtonCsv})}if(f.extraButtons.length){f.tbar=Ext.Array.merge(f.tbar,f.extraButtons)}if(f.buttonPrint&&!window.isTablet){f.tbar.push("->",{xtype:"splitbutton",glyph:f.glyphPrint,text:f.textPrint,hidden:!f.allowPrint,handler:"onPrint",menu:[{text:f.labelPicture,checked:true,group:"orientation",value:"P",handler:"onPrint"},{text:f.labelLandscape,checked:false,group:"orientation",value:"L",handler:"onPrint"}]})}if(f.buttonCleanFilter){f.tbar.push({iconCls:f.iconClsCleanFilter,text:f.textCleanFilter,scope:f,handler:f.cleanFilters})}if(f.pagination){f.dockedItems=[{xtype:"pagingtoolbar",dock:f.dockPagination,store:f.store,displayInfo:f.displayInfoPagination,items:f.paginationButton},{xtype:"toolbar",dock:f.dockPagination,items:f.buttonsTbar,hidden:!f.buttonsTbar.length}]}f.features=[{ftype:"filters",id:"filters",local:!f.remoteFilter},{ftype:"grouping",enableGroupingMenu:f.grupableColumns,groupHeaderTpl:t("Column")+': {columnName} -> {name} ({rows.length} Item{[values.rows.length > 1 ? "s" : ""]})'}];f.on("render",f.applyDefaultColumns,f);Ext.grid.Panel.prototype.initComponent.apply(this,arguments);f.autoLoadList&&!window.isDesktop&&f.getStore().load({scope:f,callback:function(){f.view.refresh()}})},getExtraFilterClass:function(b){switch(b){case"auto":b="string";break;case"int":case"float":b="numeric";break;case"bool":b="boolean";break}return Ext.ClassManager.getByAlias("gridfilter."+b)},addExtraFilter:function(d){var f=this,e=f.getView().getFeature("filters");d.button.toggle(d.active);e.extraFilters=f.getFilterData();f.deferredUpdate.delay(d.type==="string"?0:e.updateBuffer)},clearExtraFilters:function(){var d=this,c=d.cmpExtraFilters.query("splitbutton[pressed=true]");Ext.each(c,function(a){a.toggle(false,true);a.filter.setActive(false)})},getFilterData:function(){var g=this,j=[],e,f;Ext.each(g.cmpsExtraFilters,function(b){if(b.active){var a=[].concat(b.serialize());for(e=0,f=a.length;e",{xtype:"label",text:c.timeFormat=="h"?"12:00 AM":"00:00"},"->"]}],items:[c.hourSlider,c.minuteSlider],onMouseDown:function(a){a.preventDefault()}});Ext.picker.Date.prototype.initComponent.call(this);c.ownerCt=c.up("[floating]");c.timePicker.ownerCt=c.ownerCt;c.registerWithOwnerCt();c.timePicker.registerWithOwnerCt();c.setValue(new Date(d));c.hourSlider.addListener("change",c.changeTimeValue,c);c.minuteSlider.addListener("change",c.changeTimeValue,c)},onShow:function(){var b=this;b.showTimePicker();Ext.picker.Date.prototype.onShow.call(this)},showTimePicker:function(){var f=this,d=f.el,e=f.timePicker;Ext.defer(function(){var b=Ext.getBody(),c=b.getViewSize().width,a=(c<(d.getX()+d.getWidth()+140))?(d.getX()-140):(d.getX()+d.getWidth()+10);f.timePicker.setHeight(d.getHeight());f.timePicker.setPosition(a,d.getY());f.timePicker.show()},1)},handleTabClick:function(b){this.handleDateClick(b,this.activeCell.firstChild,true)},getSelectedDate:function(v){var s=this,o=Ext.Date.clearTime(v,true).getTime(),n=s.cells,c=s.selectedCls,q=n.elements,r=q.length,p,u;n.removeCls(c);for(u=0;u=f.F1&&d<=f.F12)&&!f.isNavKeyPress()){if(this.inputEl.dom.selectionStart===0&&this.inputEl.dom.selectionEnd===this.inputEl.dom.value.length){this.hiddenField.dom.value=this.money?0:""}if(!e.isBackspace){if(this.money){this.hiddenField.dom.value=String(this.hiddenField.dom.value)+String(e.pressedKey);this.hiddenField.dom.value=this.hiddenField.dom.value.replace(/[.]/g,"");this.hiddenField.dom.value=this.textMask.parsePrecision(this.hiddenField.dom.value,this.textMask.moneyPrecision);this.hiddenField.dom.value=this.textMask.unmask(this.hiddenField.dom.value)}else{this.hiddenField.dom.value=this.textMask.unmask(this.hiddenField.dom.value+e.pressedKey)}}this.inputEl.dom.value=this.textMask.mask(this.hiddenField.dom.value);this.inputEl.dom.selectionStart=this.textMask.getLength(this.hiddenField.dom.value);this.inputEl.dom.selectionEnd=this.inputEl.dom.selectionStart;f.preventDefault()}},simpleUpdateHidden:function(b){if(this.readOnly||this.useMask){return false}this.hiddenField.dom.value=this.inputEl.dom.value},getValue:function(){if(this.returnWithMask){return this.getValueWithMask()}else{return this.getValueWithoutMask()}},getValueWithMask:function(){return this.inputEl.dom.value},getValueWithoutMask:function(){if(this.hiddenField){return this.hiddenField.dom.value}else{return""}},getRawValue:function(){return this.getValue()},setValue:function(b){b=!Ext.isDefined(b)?"":b;if(this.useMask&&!Ext.isEmpty(b)){if(this.inputEl){this.hiddenField.dom.value=this.textMask.unmask(b);this.inputEl.dom.value=this.textMask.mask(b)}this.value=this.textMask.unmask(b)}else{if(this.inputEl){this.hiddenField.dom.value=b;this.inputEl.dom.value=b}this.value=b}},setDateValue:function(b){if(b==="now"){b=new Date()}if(this.inputEl){b=this.formatDate(this.parseDate(b));this.hiddenField.dom.value=b;this.inputEl.dom.value=this.textMask.mask(b)}this.value=b},setMask:function(b){this.textMask.setMask(b);this.setValue(this.hiddenField.dom.value)}},0,0,0,0,["plugin.textmask"],0,[Ext.ux,"TextMaskPlugin"],0));(Ext.cmd.derive("Ext.ux.form.field.Money",Ext.form.field.Text,{mask:t("maskMoney"),money:true,initComponent:function(){var b=this;b.plugins=["textmask","markallowblank"];Ext.form.field.Text.prototype.initComponent.apply(this,arguments)}},0,["moneyfield"],["component","box","field","textfield","moneyfield"],{component:true,box:true,field:true,textfield:true,moneyfield:true},["widget.moneyfield"],0,[Ext.ux.form.field,"Money"],0));(Ext.cmd.derive("Ext.ux.form.Panel",Ext.form.Panel,{bodyPadding:5,autoScroll:true,border:false,allowCreate:true,allowUpdate:true,defaultType:"textfield",layout:"anchor",idRecord:0,textNew:t("New"),glyphNew:icons.file,textSave:t("Save"),glyphSave:icons.disk,textCancel:t("Cancel"),glyphCancel:icons.stop,alignButtonsBottom:"->",defaults:{plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true},buttonsTbar:[],labelWidthFields:100,labelAlignFields:"right",header:window.isTablet||window.isTablets?false:"",initComponent:function(){var j=this;var e=j.xtype.slice(0,-4);if(j.items&&App.user.isAdmin&&App.user.show_filed_help==true){if(j.items[0].xtype=="tabpanel"){j.items[0].items.forEach(function(a){a.items.forEach(function(b){if(b.xtype=="fieldcontainer"){b.items.forEach(function(d){var m=h(e+"."+d.name);if(m.length>10){d.fieldLabel=d.fieldLabel+" "+m}})}else{if(b.xtype=="fieldset"){b.items.forEach(function(d){var m=h(e+"."+d.name);if(m.length>10){d.fieldLabel=d.fieldLabel+" "+m}})}else{var c=h(e+"."+b.name);if(c.length>10){b.fieldLabel=b.fieldLabel+" "+c}}}})})}else{for(var f in j.items){var g=h(e+"."+j.items[f].name);if(g.length>10){j.items[f].fieldLabel=j.items[f].fieldLabel+" "+g}}}}Ext.applyIf(j.defaults,{anchor:"0",enableKeyEvents:true,labelAlign:j.labelAlignFields,labelWidth:j.labelWidthFields,msgTarget:"side",plugins:"markallowblank",allowBlank:false});j.dockedItems=[];itemsTbar=j.buttonsTbar.length?j.buttonsTbar:[{xtype:"tbtext"},j.alignButtonsBottom,{reference:"save",text:j.textSave,width:90,glyph:j.glyphSave,handler:"onSave"},{text:j.textCancel,width:90,glyph:j.glyphCancel,handler:"onCancel"}];j.hideTbar=Ext.isDefined(j.hideTbar)?j.hideTbar:!j.allowCreate;j.hideBbar=!j.allowCreate&&!j.allowUpdate;j.dockedItems=[{xtype:"toolbar",hidden:j.hideBbar,dock:"bottom",items:itemsTbar}];Ext.form.Panel.prototype.initComponent.apply(this,arguments)}},0,0,["component","box","container","panel","form"],{component:true,box:true,container:true,panel:true,form:true},0,0,[Ext.ux.form,"Panel"],0));(Ext.cmd.derive("MBilling.view.groupModule.Form",Ext.ux.form.Panel,{items:[{xtype:"groupusercombo"},{xtype:"modulecombo"}]},0,["groupmoduleform"],["component","box","container","panel","form","groupmoduleform"],{component:true,box:true,container:true,panel:true,form:true,groupmoduleform:true},["widget.groupmoduleform"],0,[MBilling.view.groupModule,"Form"],0));(Ext.cmd.derive("MBilling.view.module.Combo",Ext.form.field.ComboBox,{name:"id_module",fieldLabel:t("Module"),displayField:"text",valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Module",{proxy:{type:"uxproxy",module:"module",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["modulecombo"],["component","box","field","textfield","pickerfield","combobox","combo","modulecombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,modulecombo:true},["widget.modulecombo"],0,[MBilling.view.module,"Combo"],0));(Ext.cmd.derive("MBilling.view.groupModule.Field",Ext.form.FieldContainer,{layout:"fit",name:"id_module",fieldLabel:t("Modules"),moduleText:t("Module"),showMenuText:t("Show Menu"),showDesktopText:t("Show Desktop"),showQuickInitText:t("Show Quick Init."),readText:t("Read"),createText:t("Create"),updateText:t("Update"),deleteText:t("Delete"),actionsText:t("Actions"),blankText:t("This field is required"),itemExistsText:t("This item already exists"),subFieldsName:{module:"id_module",moduleText:"idModuletext",showMenu:"show_menu",showDesktop:"createShortCut",showQuickInit:"createQuickStart",actions:"action"},initComponent:function(){var c=this,d;c.items=c.initGrid();Ext.form.FieldContainer.prototype.initComponent.apply(this,arguments)},afterRender:function(){var b=this;Ext.form.FieldContainer.prototype.afterRender.apply(this,arguments);b.setValue(b.value)},initGrid:function(){var d=this,e={},f;d.store=Ext.create("MBilling.store.GroupModule",{remoteSort:false});d.moduleCombo=Ext.widget("modulecombo",{hideLabel:true,allowBlank:false,validator:Ext.bind(d.checkModuleExists,d)});d.grid=Ext.widget("grid",{style:d.allowBlank===false?"border-left: 3px solid red":"",store:d.store,plugins:{ptype:"rowediting",pluginId:"rowEditor",listeners:{scope:d,beforeedit:d.onBeforeEdit,edit:d.onEdit,canceledit:d.onCancelEdit}},tbar:[{glyph:icons.file,scope:d,text:t("Add permissions for this group"),handler:function(){f=d.grid.getPlugin("rowEditor");if(!d.isUpdate&&f.editing){d.moduleCombo.focus();return false}d.moduleCombo.reset();e[d.subFieldsName.showMenu]=1;e[d.subFieldsName.showDesktop]=0;e[d.subFieldsName.showQuickInit]=0;d.addItem(e,0);f.startEdit(0,0);d.isUpdate=false;d.recordEditing=null}}],columns:[{xtype:"templatecolumn",flex:7,tpl:"{"+d.subFieldsName.moduleText+"}",header:d.moduleText,dataIndex:d.subFieldsName.module,editor:d.moduleCombo},{header:d.actionsText,flex:7,dataIndex:d.subFieldsName.actions,scope:d,renderer:d.rendererActions,editor:{xtype:"combo",multiSelect:true,store:[["c",d.createText],["r",d.readText],["u",d.updateText],["d",d.deleteText]]}},{xtype:"booleancolumn",flex:6,header:d.showMenuText,dataIndex:d.subFieldsName.showMenu,editor:{xtype:"checkbox"}},{xtype:"booleancolumn",flex:6,header:d.showDesktopText,dataIndex:d.subFieldsName.showDesktop,editor:{xtype:"checkbox"}},{xtype:"booleancolumn",flex:6,header:d.showQuickInitText,dataIndex:d.subFieldsName.showQuickInit,editor:{xtype:"checkbox"}},{xtype:"actioncolumn",flex:1,menuDisabled:true,iconCls:"icon-delete",tooltip:d.deleteText,handler:Ext.bind(d.removeItem,d),editRenderer:function(){return}}]});return d.grid},rendererActions:function(j){var e=this,f=Ext.isString(j)?j.split(""):j,g=[];Ext.each(f,function(a){switch(a){case"c":g.push(e.createText);break;case"r":g.push(e.readText);break;case"u":g.push(e.updateText);break;case"d":g.push(e.deleteText);break}},e);return g.join(", ")},onBeforeEdit:function(o,g){var n=this,j=g.record,l=n.subFieldsName.actions,m=j.get(l);j.set(l,Ext.isString(m)?m.split(""):undefined);n.isUpdate=j.get(n.subFieldsName.module)>0;n.recordEditing=n.isUpdate?j:null},onEdit:function(m,f){var l=this,g=f.record,j=l.subFieldsName.actions;g.set(j,g.get(j).join(""));g.set("idModuletext","t('"+l.moduleCombo.getRawValue()+"')");g.commit()},onCancelEdit:function(o,g){var n=this,j=g.record,l=n.subFieldsName.actions,m=j.get(l);n.isUpdate?j.set(l,m&&m.join("")):n.store.removeAt(g.rowIdx);j.commit()},addItem:function(f,e){var d=this;f=f||{};Ext.isDefined(e)?d.store.insert(e,Ext.clone(f)):d.store.add(Ext.clone(f))},removeItem:function(e,g){var j=this,f=j.store.getAt(g);j.store.remove(f)},getErrors:function(){var d=this,f=[],e;if(d.allowBlank){return f}if(!d.getValue().length){f.push(d.blankText);return f}return f},reset:function(){this.store.removeAll()},setValue:function(d){var c=this;c.reset();Ext.each(d,function(a){c.addItem(a)},c)},getValue:function(){var m=this,g=[],l={},j,f;m.store.each(function(a){f=a.get(m.subFieldsName.module);if(f){l[m.subFieldsName.module]=f;l[m.subFieldsName.showMenu]=a.get(m.subFieldsName.showMenu);l[m.subFieldsName.showDesktop]=a.get(m.subFieldsName.showDesktop);l[m.subFieldsName.showQuickInit]=a.get(m.subFieldsName.showQuickInit);l[m.subFieldsName.actions]=a.get(m.subFieldsName.actions);g.push(Ext.clone(l))}});return g},getSubmitData:function(){var d=this,c={};c[d.getName()]=Ext.encode(d.getValue());return c},checkModuleExists:function(){var f=this,d=f.moduleCombo.getValue(),e=f.recordEditing&&f.recordEditing.get(f.subFieldsName.module);if(!d){return true}if(f.isUpdate&&(e!==d)&&f.store.find(f.subFieldsName.module,d)!==-1){return f.itemExistsText}else{if(!f.isUpdate&&f.store.find(f.subFieldsName.module,d)!==-1){return f.itemExistsText}}return true}},0,["groupmodulefield"],["component","box","container","fieldcontainer","groupmodulefield"],{component:true,box:true,container:true,fieldcontainer:true,groupmodulefield:true},["widget.groupmodulefield"],[["field",Ext.form.field.Field]],[MBilling.view.groupModule,"Field"],0));(Ext.cmd.derive("MBilling.view.groupUser.Controller",Ext.ux.app.ViewController,{onEdit:function(){var b=this;b.lookupReference("generalTab").show();Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)},onSelectionChange:function(e,j){var g=this,f=g.lookupReference("buttonCloneGroup");f&&f.setDisabled(!j.length);Ext.ux.app.ViewController.prototype.onSelectionChange.apply(this,arguments)},onCloneGroupUser:function(e){var f=this,d=f.list.getSelectionModel().getSelection()[0];if(f.list.getSelectionModel().getSelection().length==1){Ext.Ajax.request({url:"index.php/groupUser/clone",params:{id:d.get("id")},scope:f,success:function(a){a=Ext.decode(a.responseText);if(a[f.nameSuccessRequest]){Ext.ux.Alert.alert(f.titleSuccess,a[f.nameMsgRequest],"success")}else{Ext.ux.Alert.alert(f.titleError,a[f.nameMsgRequest],"error")}}})}else{Ext.ux.Alert.alert(f.titleError,"Please Select only a record","notification")}f.store.load()}},0,0,0,0,["controller.groupuser"],0,[MBilling.view.groupUser,"Controller"],0));(Ext.cmd.derive("MBilling.view.groupUser.Module",Ext.ux.panel.Module,{controller:"groupuser",cfgEast:{flex:9}},0,["groupusermodule"],["component","box","container","uxpanelmodule","groupusermodule"],{component:true,box:true,container:true,uxpanelmodule:true,groupusermodule:true},["widget.groupusermodule"],0,[MBilling.view.groupUser,"Module"],0));(Ext.cmd.derive("MBilling.view.groupUser.List",Ext.ux.grid.Panel,{store:"GroupUser",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.allowPrint=false;b.buttonCsv=false;b.extraButtons=[{text:t("Clone")+" "+t("Group"),handler:"onCloneGroupUser",width:100,reference:"buttonCloneGroup",disabled:true}];b.columns=[{text:t("Id"),dataIndex:"id",hidden:true,hideable:App.user.isAdmin},{text:t("Name"),dataIndex:"name"},{xtype:"templatecolumn",tpl:"{idUserTypename}",header:t("User Type"),renderer:function(a){a=a==1?t("admin"):a==2?t("agent"):t("user");return a},dataIndex:"id_user_type",comboFilter:"usertypecombo"}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["groupuserlist"],["component","box","container","panel","tablepanel","gridpanel","grid","groupuserlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,groupuserlist:true},["widget.groupuserlist"],0,[MBilling.view.groupUser,"List"],0));(Ext.cmd.derive("Ext.ux.form.field.Permission",Ext.form.FieldContainer,{layout:"fit",border:1,style:{borderColor:"#cecece",borderStyle:"solid"},name:"id_module",moduleText:t("Module"),showMenuText:t("Menu"),showDesktopText:t("Desktop"),showQuickInitText:t("Quick Init."),createText:t("Create"),updateText:t("Update"),deleteText:t("Delete"),blankText:t("This field is required"),urlReadTree:"index.php/module/readTree",rootPropertyRead:"rows",fieldsMap:{idModule:"id_module",action:"action",showMenu:"show_menu",showDesktop:"createShortCut",showQuickInit:"createQuickStart"},initComponent:function(){var b=this;b.items=b.initTreeGrid();Ext.form.FieldContainer.prototype.initComponent.apply(this,arguments)},initTreeGrid:function(){var me=this,listenersCheckColumns={scope:me,checkchange:me.onCheckColumn};me.treeStore=Ext.create("Ext.data.TreeStore",{proxy:{type:"ajax",url:me.urlReadTree,reader:{type:"json",rootProperty:me.rootPropertyRead},extraParams:me.extraParamsRead},fields:[{name:"text",convert:function(v){return(v.indexOf("t(")!==-1)?eval(v):v}},"iconCls",{name:"create",type:"boolean"},{name:"update",type:"boolean"},{name:"delete",type:"boolean"},{name:"show_menu",type:"boolean"},{name:"createShortCut",type:"boolean"},{name:"createQuickStart",type:"boolean"}],remoteSort:false,defaultRootProperty:me.rootPropertyRead});me.treeGrid=Ext.widget("treepanel",{style:me.allowBlank===false?"border-left: 3px solid red":"",useArrows:true,rootVisible:false,store:me.treeStore,listeners:{scope:me,checkchange:me.onCheckModule},columns:[{xtype:"treecolumn",text:me.moduleText,flex:3,dataIndex:"text"},{xtype:"checkcolumn",text:me.showMenuText,flex:1,dataIndex:"show_menu",listeners:{checkchange:me.onCheckMenu}},{xtype:"checkcolumn",text:me.createText,flex:1,dataIndex:"create",listeners:listenersCheckColumns},{xtype:"checkcolumn",text:me.updateText,flex:1,dataIndex:"update",listeners:listenersCheckColumns},{xtype:"checkcolumn",text:me.deleteText,flex:1,dataIndex:"delete",listeners:listenersCheckColumns},{xtype:"checkcolumn",text:me.showDesktopText,flex:1,dataIndex:"createShortCut",listeners:listenersCheckColumns},{xtype:"checkcolumn",text:me.showQuickInitText,flex:1,dataIndex:"createQuickStart",listeners:listenersCheckColumns}]});return me.treeGrid},onCheckMenu:function(f,g,j,e){if(!j){return}e.set("checked",true);e.parentNode.set(f.dataIndex,true);e.parentNode.set("checked",true)},onCheckColumn:function(f,g,j,e){if(j){e.set("checked",true);e.parentNode.set("checked",true)}if(e.isLeaf()){return}e.cascadeBy(function(a){a.set(f.dataIndex,j);if(j){a.set("checked",true);a.parentNode.set("checked",true)}})},onCheckModule:function(f,d){var e=this;d?(f.parentNode&&!f.parentNode.get("checked")&&f.parentNode.set("checked",true)):e.resetNode(f);if(f.isLeaf()){return}f.cascadeBy(function(a){a.set("checked",d);d?(a.parentNode&&a.parentNode.set("checked",true)):e.resetNode(a)},e)},getErrors:function(){var d=this,c=[];if(d.allowBlank){return c}if(!d.getValue().length){c.push(d.blankText);return c}return c},reset:function(){this.treeStore.load()},resetNode:function(b){b.set({create:false,update:false,"delete":false,show_menu:false,createShortCut:false,createQuickStart:false,checked:false});b.commit()},setValue:function(f){var m=this,j,l,g;m.treeStore.load({scope:m,callback:function(){m.setLoading(true);Ext.each(f,function(a){j=m.treeStore.getRootNode().findChild("id",parseInt(a[m.fieldsMap.idModule]),true);l=a[m.fieldsMap.action]||[];g=j.isLeaf();j.set({create:g&&l.indexOf("c")!==-1,update:g&&l.indexOf("u")!==-1,"delete":g&&l.indexOf("d")!==-1,show_menu:a[m.fieldsMap.showMenu]==1,createShortCut:g&&a[m.fieldsMap.showDesktop]==1,createQuickStart:g&&a[m.fieldsMap.showQuickInit]==1,checked:true});j.commit()});m.setLoading(false)}})},getValue:function(){var e=this,j={},f=[],g;this.treeStore.getRootNode().cascadeBy(function(a){if(a.get("checked")&&!a.isRoot()){g=[];j={};a.get("create")&&g.push("c");g.push("r");a.get("update")&&g.push("u");a.get("delete")&&g.push("d");j[e.fieldsMap.idModule]=a.getId();j[e.fieldsMap.action]=g.join("");j[e.fieldsMap.showMenu]=a.get("show_menu")?1:0;j[e.fieldsMap.showDesktop]=a.get("createShortCut")?1:0;j[e.fieldsMap.showQuickInit]=a.get("createQuickStart")?1:0;f.push(Ext.clone(j))}});return f}},0,["permissionfield"],["component","box","container","fieldcontainer","permissionfield"],{component:true,box:true,container:true,fieldcontainer:true,permissionfield:true},["widget.permissionfield"],[["field",Ext.form.field.Field]],[Ext.ux.form.field,"Permission"],0));(Ext.cmd.derive("MBilling.view.groupUser.Form",Ext.ux.form.Panel,{header:false,initComponent:function(){var b=this;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true}},items:[{title:t("general"),reference:"generalTab",items:[{name:"id",fieldLabel:t("Id"),disabled:true,hidden:true},{name:"name",fieldLabel:t("Name"),maxLength:100},{xtype:"usertypecombo"}]},{title:t("Permissions"),items:[{xtype:"permissionfield",hideLabel:true,anchor:"100% "+(!Ext.Boot.platformTags.desktop?"82%":window.isThemeNeptune?"87%":"89%"),allowBlank:true}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["groupuserform"],["component","box","container","panel","form","groupuserform"],{component:true,box:true,container:true,panel:true,form:true,groupuserform:true},["widget.groupuserform"],0,[MBilling.view.groupUser,"Form"],0));(Ext.cmd.derive("MBilling.view.groupUser.Combo",Ext.form.field.ComboBox,{name:"id_group",fieldLabel:t("IdGroup"),displayField:"name",valueField:"id",forceSelection:true,editable:false,initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.GroupUser",{proxy:{type:"uxproxy",module:"groupUser",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["groupusercombo"],["component","box","field","textfield","pickerfield","combobox","combo","groupusercombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,groupusercombo:true},["widget.groupusercombo"],0,[MBilling.view.groupUser,"Combo"],0));(Ext.cmd.derive("MBilling.view.groupUser.AgentUSerCombo",Ext.form.field.ComboBox,{name:"id_group_agent",fieldLabel:t("GroupUser"),displayField:"name",forceSelection:true,editable:false,valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.GroupUser",{proxy:{type:"uxproxy",module:"groupUser",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["groupuseragentcombo"],["component","box","field","textfield","pickerfield","combobox","combo","groupuseragentcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,groupuseragentcombo:true},["widget.groupuseragentcombo"],0,[MBilling.view.groupUser,"AgentUSerCombo"],0));(Ext.cmd.derive("MBilling.view.groupUser.Tag",Ext.form.field.Tag,{name:"id_group",fieldLabel:t("GroupUser"),displayField:"name",valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.GroupUser",{proxy:{type:"uxproxy",module:"plan",limitParam:undefined}});Ext.form.field.Tag.prototype.initComponent.apply(this,arguments)}},0,["groupusertag"],["component","box","field","textfield","pickerfield","combobox","combo","tagfield","groupusertag"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,tagfield:true,groupusertag:true},["widget.groupusertag"],0,[MBilling.view.groupUser,"Tag"],0));(Ext.cmd.derive("MBilling.view.module.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.module"],0,[MBilling.view.module,"Controller"],0));(Ext.cmd.derive("MBilling.view.module.Module",Ext.ux.panel.Module,{controller:"module"},0,["modulemodule"],["component","box","container","uxpanelmodule","modulemodule"],{component:true,box:true,container:true,uxpanelmodule:true,modulemodule:true},["widget.modulemodule"],0,[MBilling.view.module,"Module"],0));(Ext.cmd.derive("MBilling.view.module.List",Ext.ux.grid.Panel,{store:"Module",initComponent:function(){var b=this;b.columns=[{text:t("Id"),dataIndex:"id"},{text:t("Text"),dataIndex:"text"},{text:t("Module"),dataIndex:"module"},{text:t("IconCls"),dataIndex:"icon_cls"},{xtype:"templatecolumn",tpl:"{idModuletext}",text:t("Module Owner"),dataIndex:"id_module",comboFilter:"modulecombo"}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["modulelist"],["component","box","container","panel","tablepanel","gridpanel","grid","modulelist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,modulelist:true},["widget.modulelist"],0,[MBilling.view.module,"List"],0));(Ext.cmd.derive("MBilling.view.module.Form",Ext.ux.form.Panel,{items:[{name:"id",fieldLabel:t("Id"),disabled:true},{name:"text",fieldLabel:t("Text"),maxLength:100},{name:"module",fieldLabel:t("Module"),allowBlank:true,maxLength:100},{name:"icon_cls",fieldLabel:t("IconCls"),allowBlank:true,maxLength:100},{xtype:"modulecombo",fieldLabel:t("Module Owner"),allowBlank:true}]},0,["moduleform"],["component","box","container","panel","form","moduleform"],{component:true,box:true,container:true,panel:true,form:true,moduleform:true},["widget.moduleform"],0,[MBilling.view.module,"Form"],0));(Ext.cmd.derive("MBilling.view.module.Tag",Ext.form.field.Tag,{name:"id_module",fieldLabel:t("Module"),displayField:"text",valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Module",{proxy:{type:"uxproxy",module:"plan",limitParam:undefined}});Ext.form.field.Tag.prototype.initComponent.apply(this,arguments)}},0,["moduletag"],["component","box","field","textfield","pickerfield","combobox","combo","tagfield","moduletag"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,tagfield:true,moduletag:true},["widget.moduletag"],0,[MBilling.view.module,"Tag"],0));(Ext.cmd.derive("MBilling.view.userType.Combo",Ext.form.field.ComboBox,{name:"id_user_type",fieldLabel:t("userType"),displayField:"name",valueField:"id",value:1,store:[[1,t("admin")],[2,t("agent")],[3,t("client")]]},0,["usertypecombo"],["component","box","field","textfield","pickerfield","combobox","combo","usertypecombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,usertypecombo:true},["widget.usertypecombo"],0,[MBilling.view.userType,"Combo"],0));(Ext.cmd.derive("MBilling.view.user.Controller",Ext.ux.app.ViewController,{groupIsAdmin:false,init:function(){var b=this;b.control({groupusercombo:{select:b.onSelectType}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectType:function(c,d){this.showFieldsRelated(d.getData().showFields)},showFieldsRelated:function(j){var l=this,g=l.formPanel.getForm().getFields(),f=l.formPanel.getForm().findField("id_group_agent"),m=l.formPanel.getForm();l.onGetUserType(l.formPanel.getForm().findField("id_group").getValue(),function(a){l.groupIsAdmin=a;l.formPanel.getForm().findField("id_plan").setVisible(!a);l.formPanel.getForm().findField("id_plan").setAllowBlank(a);l.formPanel.getForm().findField("id_offer").setVisible(!a);l.formPanel.getForm().findField("prefix_local").setVisible(!a)});g.each(function(a){if(a.name=="id_group"){filterGroupp=Ext.encode([{type:"numeric",comparison:"eq",value:2,field:"id_user_type"}]),Ext.Ajax.request({url:"index.php/groupUser/index",params:{filter:filterGroupp},success:function(b){b=Ext.decode(b.responseText);var c=b.rows;for(i=0;i1){c.formPanel.getForm().findField("id_plan")["hide"]();fieldGroup.readOnly=true}else{c.formPanel.getForm().findField("id_plan")["show"]();fieldGroup.readOnly=false}}Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments);c.onGetUserType(d.get("id_group"),function(a){c.formPanel.getForm().findField("password").setVisible(!a);c.formPanel.getForm().findField("id_plan").setVisible(!a);c.formPanel.getForm().findField("id_plan").setAllowBlank(a);c.formPanel.getForm().findField("id_offer").setVisible(!a);c.formPanel.getForm().findField("prefix_local").setVisible(!a)});if(fieldGroup.value==2){fieldGroupAgent.show()}else{fieldGroupAgent.hide()}},onGetUserType:function(d,c){filterGroupp=Ext.encode([{type:"numeric",comparison:"eq",value:d,field:"id"}]),Ext.Ajax.request({url:"index.php/groupUser/getUserType",params:{filter:filterGroupp},success:function(a){a=Ext.decode(a.responseText);c(a.rows)}})},onDelete:function(d){var f=this,e;notDelete=false;Ext.each(f.list.getSelectionModel().getSelection(),function(a){if(a.get("id")==1){Ext.ux.Alert.alert(f.titleError,t("You cannot delete the")+" user id 1","error");notDelete=true}});if(notDelete==false){Ext.ux.app.ViewController.prototype.onDelete.apply(this,arguments)}}},0,0,0,0,["controller.user"],0,[MBilling.view.user,"Controller"],0));(Ext.cmd.derive("MBilling.view.user.Combo",Ext.form.field.ComboBox,{name:"id_user",fieldLabel:t("username"),displayField:"username",forceSelection:true,editable:false,valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.User",{proxy:{type:"uxproxy",module:"user",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["usercombo"],["component","box","field","textfield","pickerfield","combobox","combo","usercombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,usercombo:true},["widget.usercombo"],0,[MBilling.view.user,"Combo"],0));(Ext.cmd.derive("MBilling.view.user.Module",Ext.ux.panel.Module,{controller:"user",cfgEast:{flex:4}},0,["usermodule"],["component","box","container","uxpanelmodule","usermodule"],{component:true,box:true,container:true,uxpanelmodule:true,usermodule:true},["widget.usermodule"],0,[MBilling.view.user,"Module"],0));(Ext.cmd.derive("MBilling.view.user.List",Ext.ux.grid.Panel,{store:"User",fieldSearch:"username",initComponent:function(){var b=this;b.extraButtons=[{text:t("Bulk")+" "+t("User"),handler:"onBulk",width:100,disabled:false,hidden:App.user.isClient||!b.allowCreate}];b.columns=b.columns||[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("username"),dataIndex:"username",flex:2},{header:t("lastname"),dataIndex:"lastname",flex:3},{header:t("firstname"),dataIndex:"firstname",flex:3},{header:t("email"),dataIndex:"email",flex:window.isTablet?3:4},{header:t("credit"),dataIndex:"credit",renderer:Helper.Util.formatMoneyDecimal,flex:2},{xtype:"templatecolumn",tpl:"{idPlanname}",header:t("plan"),dataIndex:"id_plan",comboFilter:"plancombo",flex:3},{xtype:"templatecolumn",tpl:"{idGroupname}",header:t("group"),dataIndex:"id_group",comboFilter:"groupusercombo",flex:2,hidden:App.user.isClient||App.user.isAgent||window.isTablet,hideable:!App.user.isClient&&!App.user.isAgent},{header:t("agent"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:2,hidden:!App.user.isAdmin||window.isTablet,hideable:App.user.isAdmin},{header:t("status"),dataIndex:"active",renderer:Helper.Util.formatBooleanActive,flex:2,filter:{type:"list",options:[[1,t("active")],[2,t("pending")],[0,t("inactive")]]},hidden:App.user.isClient||window.isTablet,hideable:!App.user.isClient},{header:t("creationdate"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"creationdate",flex:4},{dataIndex:"id_offer",header:t("offer"),flex:2,hidden:true,hideable:!App.user.isClient&&!App.user.isAgent},{header:t("typepaid"),dataIndex:"typepaid",flex:2,renderer:Helper.Util.formattypepaid,filter:{type:"list",options:[[0,t("prepaid")],[1,t("pospaid")]]},hidden:true,hideable:!App.user.isClient&&!App.user.isAgent},{header:t("city"),dataIndex:"city",hidden:true,hideable:!App.user.isClient&&!App.user.isAgent,flex:1},{header:t("state"),dataIndex:"state",hidden:true,hideable:!App.user.isClient&&!App.user.isAgent,flex:1},{header:t("country"),dataIndex:"country",hidden:true,hideable:!App.user.isClient&&!App.user.isAgent,flex:1},{header:t("zipcode"),dataIndex:"zipcode",hidden:true,hideable:!App.user.isClient&&!App.user.isAgent,flex:1},{header:t("phone"),dataIndex:"phone",hidden:true,hideable:!App.user.isClient&&!App.user.isAgent,flex:1},{header:t("creditlimit"),dataIndex:"creditlimit",hidden:true,hideable:!App.user.isClient&&!App.user.isAgent,flex:1},{header:t("record_call"),dataIndex:"record_call",flex:1,renderer:Helper.Util.formattyyesno,filter:{type:"list",options:[[0,t("no")],[1,t("yes")]]},hidden:true,hideable:!App.user.isClient&&!App.user.isAgent},{header:t("CPS Limit"),dataIndex:"cpslimit",hidden:true,hideable:window.dialC&&App.user.isAdmin,flex:2}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["userlist"],["component","box","container","panel","tablepanel","gridpanel","grid","userlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,userlist:true},["widget.userlist"],0,[MBilling.view.user,"List"],0));(Ext.cmd.derive("MBilling.view.user.Form",Ext.ux.form.Panel,{autoHeight:300,bodyPadding:0,fieldsHideUpdateLot:["username","password","id_group_agent","id_offer","callingcard_pin"],initComponent:function(){var b=this;haveServiceMenu=false;Ext.each(App.user.menu,function(a){if(a.text=="t('Services')"){haveServiceMenu=true}});b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{labelAlign:"right",plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true}},items:[{title:t("general"),items:[{name:"username",fieldLabel:t("username"),maxLength:20,minLength:4,readOnly:App.user.isClient},{name:"password",fieldLabel:t("Password"),minLength:6,hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"id_group",fieldLabel:t("IdGroup"),xtype:"groupusercombo",allowBlank:!App.user.isAdmin,hidden:!App.user.isAdmin},{name:"id_group_agent",fieldLabel:t("GroupUser"),xtype:"groupuseragentcombo",emptyText:t("SELECT GROUP FOR AGENT USERS"),fieldLabel:t("Group for Agent Users"),hidden:true,allowBlank:true},{fieldLabel:t("Plan"),name:"id_plan",xtype:"planlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:App.user.isClient},{xtype:"languagecombo",name:"language",value:App.user.language=="pt_BR"?"br":App.user.language,fieldLabel:t("language")},{name:"prefix_local",fieldLabel:t("prefixlocal"),value:App.user.base_country=="BRL"?"0/55,*/5511/8,*/5511/9":App.user.base_country=="ARG"?"0/54,*/5411/8,15/54911/10,16/54911/10":"",allowBlank:true,emptyText:"match / replace / length",hidden:App.user.isClient},{xtype:"statususercombo",name:"active",fieldLabel:t("Active"),hidden:App.user.isClient,allowBlank:App.user.isClient},{xtype:"countrycombo",name:"country",fieldLabel:t("country"),value:App.user.language=="pt_BR"?"55":"1",allowBlank:true},{name:"id_offer",fieldLabel:t("offer"),xtype:"offercombo",allowBlank:true},{xtype:"numberfield",name:"cpslimit",fieldLabel:t("CPS Limit"),value:-1,minValue:-1,maxValue:50,hidden:!window.dialC||!App.user.isAdmin,allowBlank:true}]},{title:t("personalData"),itemId:"personalData",items:[{name:"company_name",fieldLabel:t("company")+" "+t("name"),allowBlank:true},{name:"state_number",fieldLabel:t("state_number"),allowBlank:true,hidden:App.user.base_country=!"BRL"},{name:"lastname",fieldLabel:t("lastname"),allowBlank:true,maxLength:40,minLength:4},{name:"firstname",fieldLabel:t("firstname"),allowBlank:true,maxLength:40,minLength:4},{xtype:"fieldcontainer",layout:"hbox",labelWidth:100,defaults:{xtype:"textfield",labelAlign:"right",flex:1},items:[{name:"city",fieldLabel:t("city"),allowBlank:true,maxLength:40,minLength:4,flex:2},{name:"state",fieldLabel:t("state"),allowBlank:true,maxLength:20,minLength:2}]},{name:"address",fieldLabel:t("address"),allowBlank:true},{name:"zipcode",fieldLabel:t("zipcode"),allowBlank:true},{xtype:"fieldcontainer",layout:"hbox",labelWidth:100,defaults:{xtype:"textfield",labelAlign:"right",flex:1},items:[{name:"phone",fieldLabel:t("phone"),allowBlank:true,maxLength:13,minLength:8},{name:"mobile",fieldLabel:t("mobile"),allowBlank:true,maxLength:20,minLength:8}]},{name:"email",fieldLabel:t("email"),allowBlank:true,vtype:"email"},{name:"doc",fieldLabel:t("Doc"),allowBlank:true},{name:"vat",fieldLabel:t("vat"),hidden:App.user.isClient,allowBlank:true}]},{title:t("suplementaryInfo"),itemId:"suplementaryInfo",defaults:{labelAlign:"right",plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true,labelWidth:145},items:[{xtype:"typepaymentcombo",name:"typepaid",fieldLabel:t("typepaid"),allowBlank:true,readOnly:App.user.isClient},{xtype:"fieldcontainer",layout:"hbox",defaults:{xtype:"textfield",labelAlign:"right",labelWidth:145,flex:1},items:[{name:"creditlimit",fieldLabel:t("creditlimit"),value:0,allowBlank:true,readOnly:App.user.isClient,flex:2},{xtype:"numberfield",name:"credit_notification",labelWidth:150,fieldLabel:t("creditnotification"),value:"-1",minValue:-1,allowBlank:true,flex:3}]},{xtype:"fieldcontainer",layout:"hbox",defaults:{xtype:"textfield",labelAlign:"right",labelWidth:145,flex:1},items:[{xtype:"noyescombo",name:"enableexpire",fieldLabel:t("enableexpire"),allowBlank:true,hidden:!App.user.isAdmin,flex:2},{xtype:"datefield",name:"expirationdate",fieldLabel:t("expirationdate"),format:"Y-m-d H:i:s",allowBlank:true,hidden:!App.user.isAdmin,labelWidth:150,flex:3}]},{xtype:"fieldcontainer",layout:"hbox",defaults:{xtype:"textfield",labelAlign:"right",labelWidth:145,flex:1},items:[{xtype:"noyescombo",name:"record_call",fieldLabel:t("record_call"),allowBlank:true,hidden:!haveServiceMenu||!App.user.isAdmin,readOnly:!App.user.isAdmin,flex:2},{labelWidth:150,xtype:"combobox",store:[["gsm",t("gsm")],["wav",t("wav")],["wav49",t("wav49")]],name:"mix_monitor_format",fieldLabel:t("Record call format"),forceSelection:true,editable:false,allowBlank:true,value:"gsm",hidden:!haveServiceMenu,flex:3}]},{xtype:"fieldcontainer",layout:"hbox",labelWidth:145,defaults:{labelAlign:"right",hidden:!haveServiceMenu,readOnly:!App.user.isAdmin,allowBlank:true,flex:1},items:[{labelWidth:145,xtype:"numberfield",name:"calllimit",fieldLabel:t("calllimit"),value:"-1",minValue:-1,flex:2},{labelWidth:150,xtype:"combobox",forceSelection:true,editable:false,name:"calllimit_error",fieldLabel:t("CallLimit Error"),value:"503",store:[["503",t("Congestion")],["403",t("Busy")]],flex:3}]},{xtype:"noyescombo",name:"callshop",fieldLabel:"Callshop",allowBlank:true,hidden:App.user.isClient},{xtype:"numberfield",name:"disk_space",fieldLabel:t("Disk Space"),value:-1,hidden:!haveServiceMenu,minValue:-1,readOnly:!App.user.isAdmin},{name:"sipaccountlimit",xtype:"numberfield",fieldLabel:t("Sip Account Limit"),value:"-1",minValue:-1,allowBlank:!App.user.isAdmin,readOnly:!App.user.isAdmin,hidden:!haveServiceMenu},{xtype:"numberfield",name:"callingcard_pin",fieldLabel:t("lockpin"),minValue:100000,maxLength:6,minLength:6},{xtype:"restrictioncombo",name:"restriction",fieldLabel:t("restriction"),allowBlank:true,hidden:App.user.isClient}]},{title:t("Send Credit"),itemId:"transferData",hidden:!window.transferToMobile,items:[{xtype:"fieldcontainer",layout:"hbox",hidden:App.user.isClient,defaults:{labelAlign:"right",labelWidth:145,allowBlank:true,flex:1},items:[{xtype:"noyescombo",name:"transfer_international",fieldLabel:t("Enable International")},{xtype:"numberfield",name:"transfer_international_profit",labelWidth:120,fieldLabel:t("Profit")}]},{xtype:"fieldcontainer",layout:"hbox",hidden:App.user.isClient,defaults:{labelAlign:"right",labelWidth:145,allowBlank:true,flex:1},items:[{xtype:"noyescombo",name:"transfer_flexiload",fieldLabel:t("Enable Flexiload")},{xtype:"numberfield",name:"transfer_flexiload_profit",labelWidth:120,fieldLabel:t("Profit")}]},{xtype:"fieldcontainer",layout:"hbox",hidden:App.user.isClient,defaults:{labelAlign:"right",labelWidth:145,allowBlank:true,flex:1},items:[{xtype:"noyescombo",name:"transfer_bkash",fieldLabel:t("Enable Bkash")},{xtype:"numberfield",name:"transfer_bkash_profit",labelWidth:120,fieldLabel:t("Profit")}]},{xtype:"fieldcontainer",layout:"hbox",hidden:App.user.isClient,defaults:{labelAlign:"right",labelWidth:145,allowBlank:true,flex:1},items:[{xtype:"noyescombo",name:"transfer_dbbl_rocket",fieldLabel:t("Enable DBBL/Rocket")},{xtype:"numberfield",name:"transfer_dbbl_rocket_profit",labelWidth:120,fieldLabel:t("Profit")}]},{xtype:"numberfield",name:"transfer_bdservice_rate",fieldLabel:t("BDService rate"),minValue:0,hidden:!App.user.isAdmin,allowBlank:true},{xtype:"numberfield",name:"transfer_show_selling_price",fieldLabel:t("show selling price"),allowBlank:true}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["userform"],["component","box","container","panel","form","userform"],{component:true,box:true,container:true,panel:true,form:true,userform:true},["widget.userform"],0,[MBilling.view.user,"Form"],0));(Ext.cmd.derive("Ext.ux.form.field.Lookup",Ext.form.FieldContainer,{layout:"fit",blankText:t("This field is required."),displayField:undefined,valueField:"id",gridConfig:{},windowConfig:{},iconClsSearch:"x-form-search-trigger",layout:"hbox",startX:150,hiddenSearchButton:false,eventsRelay:["dirtychange","validitychange","errorchange","specialkey","blur","keydown","keyup","keypress","change"],initComponent:function(){var b=this;b.store=Ext.data.StoreManager.lookup(b.store||"ext-empty-store");b.items=b.initSubFields();Ext.form.FieldContainer.prototype.initComponent.apply(this,arguments)},initSubFields:function(){var b=this;b.rawField=Ext.widget("textfield",{readOnly:true,flex:1,onClearButtonClick:b.reset,clearButtonScope:b,isFormField:false,listeners:{scope:b,change:b.onChangeRawField},triggers:{clear:{weight:0,cls:"x-form-clear-trigger",hidden:true,clickOnReadOnly:true,handler:b.reset,scope:b}}});b.relayEvents(b.rawField,b.eventsRelay);b.buttonSearch=Ext.widget("button",{iconCls:"ux-gridfilter-text-icon",scope:b,text:t("Search"),handler:b.onClickSearch,hidden:b.hiddenSearchButton});return[b.rawField,b.buttonSearch]},onChangeRawField:function(b){b.getTrigger("clear").show()},onClickSearch:function(e,f){var d=this;if(!d.windowSearch){d.list=Ext.widget(d.gridConfig.xtype,Ext.apply({selType:"checkboxmodel",selModel:{mode:"SINGLE"},allowCreate:false,allowUpdate:false,allowDelete:false,allowPrint:false,autoLoadList:false,buttonCsv:false,extraButtons:[],listeners:{scope:d,selectionchange:d.onSelectionChangeList,itemdblclick:d.onItemDblClick}},d.gridConfig));d.buttonOk=Ext.widget("button",{text:t("Ok"),width:70,disabled:true,glyph:icons.checkmark,scope:d,handler:d.onClickSelect});d.windowSearch=Ext.widget("window",Ext.apply({closeAction:"hide",header:false,layout:"fit",closable:false,resizable:true,draggable:false,baseCls:"x-panel",width:d.rawField.getWidth()+70+d.startX,height:d.rawField.getY()>250?300:Ext.getBody().getViewSize().height-270,items:d.list,bbar:["->",{text:t("Cancel"),glyph:icons.stop,scope:d,handler:function(){d.windowSearch.close()}},d.buttonOk],listeners:{scope:d,show:d.onShowWindowSearch}},d.windowConfig))}else{d.windowSearch.setWidth(d.rawField.getWidth()+23+d.startX)}d.windowSearch.showAt(d.rawField.getX()-d.startX,d.rawField.getY()+23)},onSelectionChangeList:function(d,c){this.recordSelected=c[0];this.buttonOk.setDisabled(!c.length)},onItemDblClick:function(d,c){this.selectRecord(c)},onClickSelect:function(){this.selectRecord()},selectRecord:function(c){var d=this;c=c||d.recordSelected;d.setValue(c.getId(),c.get(d.displayFieldList));d.windowSearch.close();d.list.store.defaultFilter=[];d.list.store.load()},onShowWindowSearch:function(f){var e=this,d=e.list.down("searchfield");d&&d.focus(true,10);!e.list.store.getCount()&&Ext.defer(function(){e.list.store.load()},10)},getErrors:function(){var d=this,c=[];if(d.allowBlank){return c}if(!d.getValue()){c.push(d.blankText);return c}return c},reset:function(){var b=this;b.rawField.reset();b.setValue("");b.rawField.getTrigger("clear").hide();b.rawField.updateLayout()},setValue:function(j,e){var f=this,g=f.ownerForm&&f.ownerForm.getRecord();if(!Ext.isEmpty(j)){e=e||(g&&g.get(f.displayField))}f.value=j;f.rawField.setValue(e||j);f.fireEvent("select",f,j)},getValue:function(){return this.value},getRawValue:function(){return this.rawField.getRawValue()}},0,0,["component","box","container","fieldcontainer"],{component:true,box:true,container:true,fieldcontainer:true},0,[["field",Ext.form.field.Field]],[Ext.ux.form.field,"Lookup"],0));(Ext.cmd.derive("MBilling.view.user.Lookup",Ext.ux.form.field.Lookup,{name:"id_user",fieldLabel:t("User"),displayField:"idUserusername",displayFieldList:"username",gridConfig:{xtype:"userlist",fieldSearch:"username",columns:[{header:t("username"),dataIndex:"username",flex:2},{header:t("email"),dataIndex:"email",flex:2},{header:t("lastname"),dataIndex:"lastname",flex:2},{header:t("credit"),dataIndex:"credit",renderer:Helper.Util.formatMoneyDecimal,flex:2}]}},0,["userlookup"],["component","box","container","fieldcontainer","userlookup"],{component:true,box:true,container:true,fieldcontainer:true,userlookup:true},["widget.userlookup"],0,[MBilling.view.user,"Lookup"],0));(Ext.cmd.derive("MBilling.view.user.Bulk",Ext.window.Window,{autoShow:true,modal:true,layout:"fit",iconCls:"icon-import-csv",title:t("Bulk User"),width:400,height:window.isThemeNeptune||window.isThemeCrisp?295:window.isThemeTriton?390:270,labelWidthFields:120,htmlTipInfo:"",fieldsImport:[],initComponent:function(){var b=this;b.items=[{xtype:"form",bodyPadding:5,defaults:{anchor:"0",enableKeyEvents:true,labelWidth:b.labelWidthFields,msgTarget:"side",plugins:"markallowblank",allowBlank:false},items:[{xtype:"numberfield",value:10,name:"totalToCreate",fieldLabel:t("How many users?")},{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,00",name:"credit",value:0,fieldLabel:t("Add")+" "+t("Refill"),readOnly:App.user.isClient},{xtype:"groupusercombo",allowBlank:!App.user.isAdmin,hidden:!App.user.isAdmin},{xtype:"languagecombo",name:"language",value:App.user.language=="pt_BR"?"br":App.user.language,fieldLabel:t("language")},{xtype:"plancombo",hidden:App.user.isClient,allowBlank:App.user.isClient},{xtype:"textfield",name:"prefix_local",fieldLabel:t("prefixlocal"),value:App.user.base_country=="BRL"?"0/55,*/5511/8,*/5511/9":App.user.base_country=="ARG"?"0/54,*/5411/8,15/54911/10,16/54911/10":"",allowBlank:true,emptyText:"match / replace / length",hidden:App.user.isClient},{xtype:"statususercombo",name:"active",fieldLabel:t("Active"),hidden:App.user.isClient,allowBlank:App.user.isClient}]}];b.title=b.title+(b.titleModule?" - "+b.titleModule:"");b.bbar=[{width:150,iconCls:"icon-import-csv",text:t("Bulk")+" "+t("User"),scope:b,handler:b.onBulk}];Ext.window.Window.prototype.initComponent.apply(this,arguments)},onBulk:function(d){var f=this,e=f.list.store;if(!f.down("form").isValid()){return}f.list.setLoading(true);Ext.Ajax.setTimeout(1000000);f.down("form").submit({url:"index.php/user/bulk",scope:f,success:function(c,b){var a=Ext.decode(b.response.responseText);console.log(a);if(a.success){Ext.ux.Alert.alert(t("Success"),a.msg,"success")}else{Ext.ux.Alert.alert(t("Error"),a.errors,"error")}d.enable();f.list.setLoading(false);e.load();f.close()},failure:function(c,b){console.log(b.response.responseText);if(b.response&&Ext.isObject(b.response.responseText)){var a=Ext.decode(b.response.responseText);Ext.ux.Alert.alert(t("Error1"),a.errors,"error")}else{Ext.ux.Alert.alert(t("Error2"),Ext.decode(b.response.responseText).msg,"error",true,10)}d.enable()}})}},0,["userbulk"],["component","box","container","panel","window","userbulk"],{component:true,box:true,container:true,panel:true,window:true,userbulk:true},["widget.userbulk"],0,[MBilling.view.user,"Bulk"],0));(Ext.cmd.derive("MBilling.view.configuration.Controller",Ext.ux.app.ViewController,{onAfterSave:function(g){var j=this,l=j.formPanel.getForm(),f=l.getRecord(),m=f.data.config_key;g=g||j.formPanel;if(!g.idRecord){g.getForm().reset();j.focusFirstField()}j.saveButton.enable();j.updateLotButton&&j.updateLotButton.toggle(false);g.setLoading(false);j.formPanel.collapse();j.store.load();j.logoutKey(m)},logoutKey:function(d){var c=this;if(d=="licence"||d=="base_language"){localStorage.setItem("day","");localStorage.setItem("lang","")}if(d=="licence"){Ext.Ajax.request({url:"index.php/authentication/logoff",success:function(){App.user.logged=false;location.reload()}})}}},0,0,0,0,["controller.configuration"],0,[MBilling.view.configuration,"Controller"],0));(Ext.cmd.derive("MBilling.view.configuration.Module",Ext.ux.panel.Module,{controller:"configuration"},0,["configurationmodule"],["component","box","container","uxpanelmodule","configurationmodule"],{component:true,box:true,container:true,uxpanelmodule:true,configurationmodule:true},["widget.configurationmodule"],0,[MBilling.view.configuration,"Module"],0));(Ext.cmd.derive("MBilling.view.configuration.List",Ext.ux.grid.Panel,{store:"Configuration",fieldSearch:"config_title",comparisonfilter:"ct",initComponent:function(){var b=this;b.allowPrint=false;b.buttonCsv=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowDelete=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("name"),dataIndex:"config_title"},{header:t("value"),dataIndex:"config_value"}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["configurationlist"],["component","box","container","panel","tablepanel","gridpanel","grid","configurationlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,configurationlist:true},["widget.configurationlist"],0,[MBilling.view.configuration,"List"],0));(Ext.cmd.derive("MBilling.view.configuration.Form",Ext.ux.form.Panel,{items:[{name:"config_value",fieldLabel:t("value"),allowBlank:true},{xtype:"textarea",name:"config_description",fieldLabel:t("description"),height:200,anchor:"100%",readOnly:true}]},0,["configurationform"],["component","box","container","panel","form","configurationform"],{component:true,box:true,container:true,panel:true,form:true,configurationform:true},["widget.configurationform"],0,[MBilling.view.configuration,"Form"],0));(Ext.cmd.derive("MBilling.view.general.BooleanCombo",Ext.form.field.ComboBox,{fieldLabel:t("status"),forceSelection:true,editable:false,value:1,store:[[1,t("active")],[0,t("inactive")]]},0,["booleancombo"],["component","box","field","textfield","pickerfield","combobox","combo","booleancombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,booleancombo:true},["widget.booleancombo"],0,[MBilling.view.general,"BooleanCombo"],0));(Ext.cmd.derive("MBilling.view.general.ServicesTypeCombo",Ext.form.field.ComboBox,{fieldLabel:t("status"),forceSelection:true,editable:false,value:"Custom",store:[["disk_space",t("disk_space")],["sipAccountLimit",t("Sip Account Limit")],["calllimit",t("calllimit")],["Custom",t("Custom")]]},0,["servicestypecombo"],["component","box","field","textfield","pickerfield","combobox","combo","servicestypecombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,servicestypecombo:true},["widget.servicestypecombo"],0,[MBilling.view.general,"ServicesTypeCombo"],0));(Ext.cmd.derive("MBilling.view.general.TypeSipForward",Ext.form.field.ComboBox,{fieldLabel:t("Forward"),forceSelection:true,editable:false,value:"",store:[["",t("")],["undefined",t("Undefined")],["sip",t("SIP")],["ivr",t("IVR")],["queue",t("Queue")],["group",t("Group")],["number",t("Number")],["hangup",t("Hangup")],["custom",t("Custom")]]},0,["typesipforwardcombo"],["component","box","field","textfield","pickerfield","combobox","combo","typesipforwardcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,typesipforwardcombo:true},["widget.typesipforwardcombo"],0,[MBilling.view.general,"TypeSipForward"],0));(Ext.cmd.derive("MBilling.view.general.TypeDestination",Ext.form.field.ComboBox,{fieldLabel:t("type"),forceSelection:true,editable:false,value:"",store:[["",t("")],["undefined",t("Undefined")],["sip",t("SIP")],["ivr",t("IVR")],["queue",t("Queue")],["group",t("Group")],["number",t("Number")],["repeat",t("Repeat IVR")],["hangup",t("Hangup")],["custom",t("Custom")]]},0,["typedestinationcombo"],["component","box","field","textfield","pickerfield","combobox","combo","typedestinationcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,typedestinationcombo:true},["widget.typedestinationcombo"],0,[MBilling.view.general,"TypeDestination"],0));(Ext.cmd.derive("MBilling.view.general.PontoVirgula",Ext.form.field.ComboBox,{fieldLabel:t("status"),forceSelection:true,editable:false,value:",",store:[[",",", ("+t("Comma")+")"],[";","; ("+t("Semicolon")+")"]]},0,["pontovirgulacombo"],["component","box","field","textfield","pickerfield","combobox","combo","pontovirgulacombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,pontovirgulacombo:true},["widget.pontovirgulacombo"],0,[MBilling.view.general,"PontoVirgula"],0));(Ext.cmd.derive("MBilling.view.general.StatusCombo",Ext.form.field.ComboBox,{fieldLabel:t("status"),forceSelection:true,editable:false,value:1,store:[[1,t("active")],[0,t("inactive")],[2,t("pending")],[3,t("sent")],[4,t("blocked")]]},0,["statuscombo"],["component","box","field","textfield","pickerfield","combobox","combo","statuscombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,statuscombo:true},["widget.statuscombo"],0,[MBilling.view.general,"StatusCombo"],0));(Ext.cmd.derive("MBilling.view.general.StatusUserCombo",Ext.form.field.ComboBox,{fieldLabel:t("status"),forceSelection:true,editable:false,value:1,store:[[1,t("active")],[0,t("inactive")],[2,t("pending")]]},0,["statususercombo"],["component","box","field","textfield","pickerfield","combobox","combo","statususercombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,statususercombo:true},["widget.statususercombo"],0,[MBilling.view.general,"StatusUserCombo"],0));(Ext.cmd.derive("MBilling.view.general.CallbackCombo",Ext.form.field.ComboBox,{fieldLabel:t("status"),forceSelection:true,editable:false,value:1,store:[[1,t("active")],[2,t("pending")],[3,t("sent")],[4,t("Not working")],[5,t("Complete")]]},0,["callbackcombo"],["component","box","field","textfield","pickerfield","combobox","combo","callbackcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,callbackcombo:true},["widget.callbackcombo"],0,[MBilling.view.general,"CallbackCombo"],0));(Ext.cmd.derive("MBilling.view.general.TypeNoYes",Ext.form.field.ComboBox,{fieldLabel:t("typepaid"),forceSelection:true,editable:false,value:0,store:[[0,t("no")],[1,t("yes")]]},0,["noyescombo"],["component","box","field","textfield","pickerfield","combobox","combo","noyescombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,noyescombo:true},["widget.noyescombo"],0,[MBilling.view.general,"TypeNoYes"],0));(Ext.cmd.derive("MBilling.view.general.TypeYesNo",Ext.form.field.ComboBox,{fieldLabel:t("typepaid"),forceSelection:true,editable:false,value:1,store:[[0,t("no")],[1,t("yes")]]},0,["yesnocombo"],["component","box","field","textfield","pickerfield","combobox","combo","yesnocombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,yesnocombo:true},["widget.yesnocombo"],0,[MBilling.view.general,"TypeYesNo"],0));(Ext.cmd.derive("MBilling.view.general.TypeYesNoString",Ext.form.field.ComboBox,{fieldLabel:t("typepaid"),forceSelection:true,editable:false,value:"yes",store:[["no",t("no")],["yes",t("yes")]]},0,["yesnostringcombo"],["component","box","field","textfield","pickerfield","combobox","combo","yesnostringcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,yesnostringcombo:true},["widget.yesnostringcombo"],0,[MBilling.view.general,"TypeYesNoString"],0));(Ext.cmd.derive("MBilling.view.general.TypeNoYesString",Ext.form.field.ComboBox,{fieldLabel:t("typepaid"),forceSelection:true,editable:false,value:"no",store:[["no",t("no")],["yes",t("yes")]]},0,["noyesstringcombo"],["component","box","field","textfield","pickerfield","combobox","combo","noyesstringcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,noyesstringcombo:true},["widget.noyesstringcombo"],0,[MBilling.view.general,"TypeNoYesString"],0));(Ext.cmd.derive("MBilling.view.general.Typenumber",Ext.form.field.ComboBox,{fieldLabel:t("typenumber"),forceSelection:true,editable:false,value:1,store:[[1,1],[2,2],[3,3],[4,4],[5,5]]},0,["numbercombo"],["component","box","field","textfield","pickerfield","combobox","combo","numbercombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,numbercombo:true},["widget.numbercombo"],0,[MBilling.view.general,"Typenumber"],0));(Ext.cmd.derive("MBilling.view.general.Typelanguage",Ext.form.field.ComboBox,{fieldLabel:t("language"),forceSelection:true,editable:false,value:"en",store:[["",t("undefined")],["br",t("portuguese")],["es",t("spanish")],["en",t("english")]]},0,["languagecombo"],["component","box","field","textfield","pickerfield","combobox","combo","languagecombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,languagecombo:true},["widget.languagecombo"],0,[MBilling.view.general,"Typelanguage"],0));(Ext.cmd.derive("MBilling.view.general.TypeCampaign",Ext.form.field.ComboBox,{fieldLabel:t("type"),forceSelection:true,editable:false,value:1,store:[[1,t("voice")],[0,t("sms")]]},0,["campaigntypecombo"],["component","box","field","textfield","pickerfield","combobox","combo","campaigntypecombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,campaigntypecombo:true},["widget.campaigntypecombo"],0,[MBilling.view.general,"TypeCampaign"],0));(Ext.cmd.derive("MBilling.view.general.TypeFullCampaign",Ext.form.field.ComboBox,{fieldLabel:t("type"),forceSelection:true,editable:false,value:1,store:[[1,t("voice")],[0,t("sms")]]},0,["campaigntypefullcombo"],["component","box","field","textfield","pickerfield","combobox","combo","campaigntypefullcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,campaigntypefullcombo:true},["widget.campaigntypefullcombo"],0,[MBilling.view.general,"TypeFullCampaign"],0));(Ext.cmd.derive("MBilling.view.general.TypeBoleto",Ext.form.field.ComboBox,{fieldLabel:t("status"),forceSelection:true,editable:false,value:"D",store:[["D",t("no")],["P",t("yes")]]},0,["boletocombo"],["component","box","field","textfield","pickerfield","combobox","combo","boletocombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,boletocombo:true},["widget.boletocombo"],0,[MBilling.view.general,"TypeBoleto"],0));(Ext.cmd.derive("MBilling.view.general.RestrictionCombo",Ext.form.field.ComboBox,{fieldLabel:t("status"),forceSelection:true,editable:false,value:0,store:[[0,t("inactive")],[1,t("cantCallRestrictedNumbers")],[2,t("canOnlyCallRestrictedNumbers")]]},0,["restrictioncombo"],["component","box","field","textfield","pickerfield","combobox","combo","restrictioncombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,restrictioncombo:true},["widget.restrictioncombo"],0,[MBilling.view.general,"RestrictionCombo"],0));(Ext.cmd.derive("MBilling.view.general.CountryISOCombo",Ext.form.field.ComboBox,{forceSelection:true,editable:true,listeners:{focus:function(b){b.expand()}},store:[["AFG",t("Afghanistan")],["ALA",t("Åland Islands")],["ALB",t("Albania")],["DZA",t("Algeria")],["ASM",t("American Samoa")],["AND",t("Andorra")],["AGO",t("Angola")],["AIA",t("Anguilla")],["ATA",t("Antarctica")],["ATG",t("Antigua and Barbuda")],["ARG",t("Argentina")],["ARM",t("Armenia")],["ABW",t("Aruba")],["AUS",t("Australia")],["AUT",t("Austria")],["AZE",t("Azerbaijan")],["BHS",t("Bahamas")],["BHR",t("Bahrain")],["BGD",t("Bangladesh")],["BRB",t("Barbados")],["BLR",t("Belarus")],["BEL",t("Belgium")],["BLZ",t("Belize")],["BEN",t("Benin")],["BMU",t("Bermuda")],["BTN",t("Bhutan")],["BOL",t("Bolivia, Plurinational State of")],["BES",t("Bonaire, Sint Eustatius and Saba")],["BIH",t("Bosnia and Herzegovina")],["BWA",t("Botswana")],["BVT",t("Bouvet Island")],["BRL",t("Brazil")],["IOT",t("British Indian Ocean Territory")],["BRN",t("Brunei Darussalam")],["BGR",t("Bulgaria")],["BFA",t("Burkina Faso")],["BDI",t("Burundi")],["KHM",t("Cambodia")],["CMR",t("Cameroon")],["CAN",t("Canada")],["CPV",t("Cape Verde")],["CYM",t("Cayman Islands")],["CAF",t("Central African Republic")],["TCD",t("Chad")],["CHL",t("Chile")],["CHN",t("China")],["CXR",t("Christmas Island")],["CCK",t("Cocos (Keeling) Islands")],["COL",t("Colombia")],["COM",t("Comoros")],["COG",t("Congo")],["COD",t("Congo, the Democratic Republic of the")],["COK",t("Cook Islands")],["CRI",t("Costa Rica")],["CIV",t("Côte dIvoire")],["HRV",t("Croatia")],["CUB",t("Cuba")],["CUW",t("Curaçao")],["CYP",t("Cyprus")],["CZE",t("Czech Republic")],["DNK",t("Denmark")],["DJI",t("Djibouti")],["DMA",t("Dominica")],["DOM",t("Dominican Republic")],["ECU",t("Ecuador")],["EGY",t("Egypt")],["SLV",t("El Salvador")],["GNQ",t("Equatorial Guinea")],["ERI",t("Eritrea")],["EST",t("Estonia")],["ETH",t("Ethiopia")],["FLK",t("Falkland Islands (Malvinas)")],["FRO",t("Faroe Islands")],["FJI",t("Fiji")],["FIN",t("Finland")],["FRA",t("France")],["GUF",t("French Guiana")],["PYF",t("French Polynesia")],["ATF",t("French Southern Territories")],["GAB",t("Gabon")],["GMB",t("Gambia")],["GEO",t("Georgia")],["DEU",t("Germany")],["GHA",t("Ghana")],["GIB",t("Gibraltar")],["GRC",t("Greece")],["GRL",t("Greenland")],["GRD",t("Grenada")],["GLP",t("Guadeloupe")],["GUM",t("Guam")],["GTM",t("Guatemala")],["GGY",t("Guernsey")],["GIN",t("Guinea")],["GNB",t("Guinea-Bissau")],["GUY",t("Guyana")],["HTI",t("Haiti")],["HMD",t("Heard Island and McDonald Islands")],["VAT",t("Holy See (Vatican City State)")],["HND",t("Honduras")],["HKG",t("Hong Kong")],["HUN",t("Hungary")],["ISL",t("Iceland")],["IND",t("India")],["IDN",t("Indonesia")],["IRN",t("Iran, Islamic Republic of")],["IRQ",t("Iraq")],["IRL",t("Ireland")],["IMN",t("Isle of Man")],["ISR",t("Israel")],["ITA",t("Italy")],["JAM",t("Jamaica")],["JPN",t("Japan")],["JEY",t("Jersey")],["JOR",t("Jordan")],["KAZ",t("Kazakhstan")],["KEN",t("Kenya")],["KIR",t("Kiribati")],["PRK",t("Korea, Democratic Peoples Republic of")],["KOR",t("Korea, Republic of")],["KWT",t("Kuwait")],["KGZ",t("Kyrgyzstan")],["LAO",t("Lao Peoples Democratic Republic")],["LVA",t("Latvia")],["LBN",t("Lebanon")],["LSO",t("Lesotho")],["LBR",t("Liberia")],["LBY",t("Libya")],["LIE",t("Liechtenstein")],["LTU",t("Lithuania")],["LUX",t("Luxembourg")],["MAC",t("Macao")],["MKD",t("Macedonia, the former Yugoslav Republic of")],["MDG",t("Madagascar")],["MWI",t("Malawi")],["MYS",t("Malaysia")],["MDV",t("Maldives")],["MLI",t("Mali")],["MLT",t("Malta")],["MHL",t("Marshall Islands")],["MTQ",t("Martinique")],["MRT",t("Mauritania")],["MUS",t("Mauritius")],["MYT",t("Mayotte")],["MEX",t("Mexico")],["FSM",t("Micronesia, Federated States of")],["MDA",t("Moldova, Republic of")],["MCO",t("Monaco")],["MNG",t("Mongolia")],["MNE",t("Montenegro")],["MSR",t("Montserrat")],["MAR",t("Morocco")],["MOZ",t("Mozambique")],["MMR",t("Myanmar")],["NAM",t("Namibia")],["NRU",t("Nauru")],["NPL",t("Nepal")],["NLD",t("Netherlands")],["NCL",t("New Caledonia")],["NZL",t("New Zealand")],["NIC",t("Nicaragua")],["NER",t("Niger")],["NGA",t("Nigeria")],["NIU",t("Niue")],["NFK",t("Norfolk Island")],["MNP",t("Northern Mariana Islands")],["NOR",t("Norway")],["OMN",t("Oman")],["PAK",t("Pakistan")],["PLW",t("Palau")],["PSE",t("Palestinian Territory, Occupied")],["PAN",t("Panama")],["PNG",t("Papua New Guinea")],["PRY",t("Paraguay")],["PER",t("Peru")],["PHL",t("Philippines")],["PCN",t("Pitcairn")],["POL",t("Poland")],["PRT",t("Portugal")],["PRI",t("Puerto Rico")],["QAT",t("Qatar")],["REU",t("Réunion")],["ROU",t("Romania")],["RUS",t("Russian Federation")],["RWA",t("Rwanda")],["BLM",t("Saint Barthélemy")],["SHN",t("Saint Helena, Ascension and Tristan da Cunha")],["KNA",t("Saint Kitts and Nevis")],["LCA",t("Saint Lucia")],["MAF",t("Saint Martin (French part)")],["SPM",t("Saint Pierre and Miquelon")],["VCT",t("Saint Vincent and the Grenadines")],["WSM",t("Samoa")],["SMR",t("San Marino")],["STP",t("Sao Tome and Principe")],["SAU",t("Saudi Arabia")],["SEN",t("Senegal")],["SRB",t("Serbia")],["SYC",t("Seychelles")],["SLE",t("Sierra Leone")],["SGP",t("Singapore")],["SXM",t("Sint Maarten (Dutch part)")],["SVK",t("Slovakia")],["SVN",t("Slovenia")],["SLB",t("Solomon Islands")],["SOM",t("Somalia")],["ZAF",t("South Africa")],["SGS",t("South Georgia and the South Sandwich Islands")],["SSD",t("South Sudan")],["ESP",t("Spain")],["LKA",t("Sri Lanka")],["SDN",t("Sudan")],["SUR",t("Suriname")],["SJM",t("Svalbard and Jan Mayen")],["SWZ",t("Swaziland")],["SWE",t("Sweden")],["CHE",t("Switzerland")],["SYR",t("Syrian Arab Republic")],["TWN",t("Taiwan, Province of China")],["TJK",t("Tajikistan")],["TZA",t("Tanzania, United Republic of")],["THA",t("Thailand")],["TLS",t("Timor-Leste")],["TGO",t("Togo")],["TKL",t("Tokelau")],["TON",t("Tonga")],["TTO",t("Trinidad and Tobago")],["TUN",t("Tunisia")],["TUR",t("Turkey")],["TKM",t("Turkmenistan")],["TCA",t("Turks and Caicos Islands")],["TUV",t("Tuvalu")],["UGA",t("Uganda")],["UKR",t("Ukraine")],["ARE",t("United Arab Emirates")],["GBR",t("United Kingdom")],["USA",t("United States")],["UMI",t("United States Minor Outlying Islands")],["URY",t("Uruguay")],["UZB",t("Uzbekistan")],["VUT",t("Vanuatu")],["VEN",t("Venezuela, Bolivarian Republic of")],["VNM",t("Viet Nam")],["VGB",t("Virgin Islands, British")],["VIR",t("Virgin Islands, U.S.")],["WLF",t("Wallis and Futuna")],["ESH",t("Western Sahara")],["YEM",t("Yemen")],["ZMB",t("Zambia")],["ZWE",t("Zimbabwe")]]},0,["countryisocombo"],["component","box","field","textfield","pickerfield","combobox","combo","countryisocombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,countryisocombo:true},["widget.countryisocombo"],0,[MBilling.view.general,"CountryISOCombo"],0));(Ext.cmd.derive("MBilling.view.general.CountryCombo",Ext.form.field.ComboBox,{fieldLabel:t("Country"),forceSelection:true,editable:true,allowBlank:true,listeners:{focus:function(b){b.expand()}},store:[["",t("Select")],["93",t("Afghanistan")],["355",t("Albania")],["213",t("Algeria")],["684",t("American Samoa")],["376",t("Andorra")],["244",t("Angola")],["1264",t("Anguilla")],["672",t("Antarctica")],["1268",t("Antigua And Barbuda")],["54",t("Argentina")],["374",t("Armenia")],["297",t("Aruba")],["61",t("Australia")],["43",t("Austria")],["994",t("Azerbaijan")],["1242",t("Bahamas")],["973",t("Bahrain")],["880",t("Bangladesh")],["1246",t("Barbados")],["375",t("Belarus")],["32",t("Belgium")],["501",t("Belize")],["229",t("Benin")],["1441",t("Bermuda")],["975",t("Bhutan")],["591",t("Bolivia")],["387",t("Bosnia And Herzegovina")],["267",t("Botswana")],["55",t("Brazil")],["1284",t("British Indian Ocean Territory")],["673",t("Brunei Darussalam")],["359",t("Bulgaria")],["226",t("Burkina Faso")],["257",t("Burundi")],["855",t("Cambodia")],["237",t("Cameroon")],["238",t("Cape Verde")],["1345",t("Cayman Islands")],["236",t("Central African Republic")],["235",t("Chad")],["56",t("Chile")],["86",t("China")],["618",t("Christmas Island")],["61",t("Cocos (Keeling); Islands")],["57",t("Colombia")],["269",t("Comoros")],["242",t("Congo")],["243",t("Congo, The Democratic Republic Of The")],["682",t("Cook Islands")],["506",t("Costa Rica")],["385",t("Croatia")],["53",t("Cuba")],["357",t("Cyprus")],["420",t("Czech Republic")],["45",t("Denmark")],["253",t("Djibouti")],["1767",t("Dominica")],["1809",t("Dominican Republic")],["593",t("Ecuador")],["20",t("Egypt")],["503",t("El Salvador")],["240",t("Equatorial Guinea")],["291",t("Eritrea")],["372",t("Estonia")],["251",t("Ethiopia")],["500",t("Falkland Islands (Malvinas)")],["298",t("Faroe Islands")],["679",t("Fiji")],["358",t("Finland")],["33",t("France")],["596",t("French Guiana")],["594",t("French Polynesia")],["689",t("French Southern Territories")],["241",t("Gabon")],["220",t("Gambia")],["995",t("Georgia")],["49",t("Germany")],["233",t("Ghana")],["350",t("Gibraltar")],["30",t("Greece")],["299",t("Greenland")],["1473",t("Grenada")],["590",t("Guadeloupe")],["1671",t("Guam")],["502",t("Guatemala")],["224",t("Guinea")],["245",t("Guinea-Bissau")],["592",t("Guyana")],["509",t("Haiti")],["504",t("Honduras")],["852",t("Hong Kong")],["36",t("Hungary")],["354",t("Iceland")],["91",t("India")],["62",t("Indonesia")],["98",t("Iran, Islamic Republic Of")],["964",t("Iraq")],["353",t("Ireland")],["972",t("Israel")],["39",t("Italy")],["1876",t("Jamaica")],["81",t("Japan")],["962",t("Jordan")],["7",t("Kazakhstan")],["254",t("Kenya")],["686",t("Kiribati")],["850",t("Korea, Democratic Peoples Republic Of")],["82",t("Korea, Republic of")],["965",t("Kuwait")],["996",t("Kyrgyzstan")],["856",t("Lao Peoples Democratic Republic")],["371",t("Latvia")],["961",t("Lebanon")],["266",t("Lesotho")],["231",t("Liberia")],["218",t("Libyan Arab Jamahiriya")],["423",t("Liechtenstein")],["370",t("Lithuania")],["352",t("Luxembourg")],["853",t("Macao")],["389",t("Macedonia, The Former Yugoslav Republic Of")],["261",t("Madagascar")],["265",t("Malawi")],["60",t("Malaysia")],["960",t("Maldives")],["223",t("Mali")],["356",t("Malta")],["692",t("Marshall islands")],["596",t("Martinique")],["222",t("Mauritania")],["230",t("Mauritius")],["269",t("Mayotte")],["52",t("Mexico")],["691",t("Micronesia, Federated States Of")],["1808",t("Moldova, Republic Of")],["377",t("Monaco")],["976",t("Mongolia")],["1664",t("Montserrat")],["212",t("Morocco")],["258",t("Mozambique")],["95",t("Myanmar")],["264",t("Namibia")],["674",t("Nauru")],["977",t("Nepal")],["31",t("Netherlands")],["599",t("Netherlands Antilles")],["687",t("New Caledonia")],["64",t("New Zealand")],["505",t("Nicaragua")],["227",t("Niger")],["234",t("Nigeria")],["683",t("Niue")],["672",t("Norfolk Island")],["1670",t("Northern Mariana Islands")],["47",t("Norway")],["968",t("Oman")],["92",t("Pakistan")],["680",t("Palau")],["970",t("Palestinian Territory, Occupied")],["507",t("Panama")],["675",t("Papua New Guinea")],["595",t("Paraguay")],["51",t("Peru")],["63",t("Philippines")],["48",t("Poland")],["351",t("Portugal")],["1787",t("Puerto Rico")],["974",t("Qatar")],["262",t("Reunion")],["40",t("Romania")],["7",t("Russian Federation")],["250",t("Rwanda")],["290",t("SaINT Helena")],["1869",t("SaINT Kitts And Nevis")],["1758",t("SaINT Lucia")],["508",t("SaINT Pierre And Miquelon")],["1784",t("SaINT Vincent And The Grenadines")],["685",t("Samoa")],["378",t("San Marino")],["239",t("São Tomé And Principe")],["966",t("Saudi Arabia")],["221",t("Senegal")],["248",t("Seychelles")],["232",t("Sierra Leone")],["65",t("Singapore")],["421",t("Slovakia")],["386",t("Slovenia")],["677",t("Solomon Islands")],["252",t("Somalia")],["27",t("South Africa")],["34",t("Spain")],["94",t("Sri Lanka")],["249",t("Sudan")],["597",t("Suriname")],["268",t("Swaziland")],["46",t("Sweden")],["41",t("Switzerland")],["963",t("Syrian Arab Republic")],["886",t("Taiwan, Province Of China")],["992",t("Tajikistan")],["255",t("Tanzania, United Republic Of")],["66",t("Thailand")],["670",t("Timor-Leste")],["228",t("Togo")],["690",t("Tokelau")],["676",t("Tonga")],["1868",t("Trinidad And Tobago")],["216",t("Tunisia")],["90",t("Turkey")],["993",t("Turkmenistan")],["1649",t("Turks And Caicos Islands")],["688",t("Tuvalu")],["256",t("Uganda")],["380",t("Ukraine")],["971",t("United Arab Emirates")],["44",t("United Kingdom")],["1",t("United States/Canada")],["598",t("Uruguay")],["998",t("Uzbekistan")],["678",t("Vanuatu")],["58",t("Venezuela")],["84",t("Vietnam")],["1284",t("Virgin Islands, British")],["808",t("Virgin Islands, U.S.")],["681",t("Wallis And Futuna")],["967",t("Yemen")],["260",t("Zambia")],["263",t("Zimbabwe")],["35818",t("Aland Islands")],["441481",t("Guernsey")],["441624",t("Isle of Man")],["441534",t("Jersey")],["382",t("Montenegro, Republic of")],["381",t("Serbia, Republic of")]]},0,["countrycombo"],["component","box","field","textfield","pickerfield","combobox","combo","countrycombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,countrycombo:true},["widget.countrycombo"],0,[MBilling.view.general,"CountryCombo"],0));(Ext.cmd.derive("MBilling.view.general.GroupCombo",Ext.form.field.ComboBox,{fieldLabel:t("group"),value:"config_group_title",forceSelection:true,editable:false,store:[["global","global"],["callback","callback"],["agi-conf1","agi-conf1"],["agi-conf2","agi-conf2"]]},0,["groupcombo"],["component","box","field","textfield","pickerfield","combobox","combo","groupcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,groupcombo:true},["widget.groupcombo"],0,[MBilling.view.general,"GroupCombo"],0));(Ext.cmd.derive("MBilling.view.general.LcrtypeCombo",Ext.form.field.ComboBox,{fieldLabel:t("lcrtype"),forceSelection:true,editable:false,value:1,store:[[1,t("LCRAccordingtothebuyerPrice")],[0,t("LCRAccordingtothesellerPrice")]]},0,["lcrtypecombo"],["component","box","field","textfield","pickerfield","combobox","combo","lcrtypecombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,lcrtypecombo:true},["widget.lcrtypecombo"],0,[MBilling.view.general,"LcrtypeCombo"],0));(Ext.cmd.derive("MBilling.view.general.LcrtypeFullCombo",Ext.form.field.ComboBox,{forceSelection:true,editable:false,fieldLabel:t("lcrtype"),value:1,store:[[1,t("LCRAccordingtothebuyerPrice")],[0,t("LCRAccordingtothesellerPrice")],[2,t("Load Balancer")]]},0,["lcrtypefullcombo"],["component","box","field","textfield","pickerfield","combobox","combo","lcrtypefullcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,lcrtypefullcombo:true},["widget.lcrtypefullcombo"],0,[MBilling.view.general,"LcrtypeFullCombo"],0));(Ext.cmd.derive("MBilling.view.general.OfferTypeCombo",Ext.form.field.ComboBox,{fieldLabel:t("offertype"),forceSelection:true,editable:false,value:0,store:[[0,t("unlimitedcalls")],[1,t("numberfreecalls")],[2,t("freeseconds")]]},0,["offertypecombo"],["component","box","field","textfield","pickerfield","combobox","combo","offertypecombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,offertypecombo:true},["widget.offertypecombo"],0,[MBilling.view.general,"OfferTypeCombo"],0));(Ext.cmd.derive("MBilling.view.general.BillingTypeCombo",Ext.form.field.ComboBox,{fieldLabel:t("billingtype"),forceSelection:true,editable:false,value:0,store:[[0,t("monthly")],[1,t("weekly")]]},0,["billingtypecombo"],["component","box","field","textfield","pickerfield","combobox","combo","billingtypecombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,billingtypecombo:true},["widget.billingtypecombo"],0,[MBilling.view.general,"BillingTypeCombo"],0));(Ext.cmd.derive("MBilling.view.general.SipCombo",Ext.form.field.ComboBox,{fieldLabel:t("providertech"),forceSelection:true,editable:false,value:"sip",store:[["sip","sip"],["dahdi","dahdi"],["khomp","khomp"],["iax2","iax2"],["dgv","dgv"],["ooh323","ooh323"],["extra","extra"],["Dongle","Dongle"],["Local","Local"]]},0,["sipcombo"],["component","box","field","textfield","pickerfield","combobox","combo","sipcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,sipcombo:true},["widget.sipcombo"],0,[MBilling.view.general,"SipCombo"],0));(Ext.cmd.derive("MBilling.view.general.TypePaymentCombo",Ext.form.field.ComboBox,{fieldLabel:t("typepaid"),forceSelection:true,editable:false,value:0,store:[[0,t("prepaid")],[1,t("pospaid")]]},0,["typepaymentcombo"],["component","box","field","textfield","pickerfield","combobox","combo","typepaymentcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,typepaymentcombo:true},["widget.typepaymentcombo"],0,[MBilling.view.general,"TypePaymentCombo"],0));(Ext.cmd.derive("MBilling.view.general.CampaignSendCombo",Ext.form.field.ComboBox,{fieldLabel:t("type"),forceSelection:true,editable:false,displayField:"name",valueField:"id",value:"CALL1",store:{fields:["id","name"],data:[{id:"CALL1",name:t("Select type"),showFields:["type"]},{id:"SMS",name:"SMS",showFields:["type","sms_text","csv_path","numbers","startingdate","startingtime"]},{id:"CALL",name:"CALL",showFields:["type","audio_path","csv_path","numbers","startingdate","startingtime"]}]}},0,["campaignsendcombo"],["component","box","field","textfield","pickerfield","combobox","combo","campaignsendcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,campaignsendcombo:true},["widget.campaignsendcombo"],0,[MBilling.view.general,"CampaignSendCombo"],0));(Ext.cmd.derive("MBilling.view.general.PaymentCountryCombo",Ext.form.field.ComboBox,{fieldLabel:t("typepaid"),value:"Brasil",forceSelection:true,editable:true,listeners:{focus:function(b){b.expand()}},store:[["Argentina","Argentina"],["Brasil","Brasil"],["Colombia","Colombia"],["Latino America","Latino America"],["Global","Global"]]},0,["paymentcountrycombo"],["component","box","field","textfield","pickerfield","combobox","combo","paymentcountrycombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,paymentcountrycombo:true},["widget.paymentcountrycombo"],0,[MBilling.view.general,"PaymentCountryCombo"],0));(Ext.cmd.derive("MBilling.view.general.BoletoBanckCombo",Ext.form.field.ComboBox,{fieldLabel:t("Banco"),forceSelection:true,editable:false,value:"cef",store:[["cef","Caixa Economica SICOB"],["bradesco","Bradesco"]]},0,["boletobanckcombo"],["component","box","field","textfield","pickerfield","combobox","combo","boletobanckcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,boletobanckcombo:true},["widget.boletobanckcombo"],0,[MBilling.view.general,"BoletoBanckCombo"],0));(Ext.cmd.derive("MBilling.view.general.PaymentBanckCombo",Ext.form.field.ComboBox,{fieldLabel:t("typepaid"),forceSelection:true,editable:false,value:"Banco do Brasil",store:[["Banco do Brasil","Banco do Brasil"],["bradesco","Bradesco"],["hsbc","Hsbc"],["itau","Itau"],["santander","Santander"],["unibanco","Unibanco"],["cef","Caixa Economica SICOB"],["cef_sinco","Caixa Economica SINCO"],["cef_sigcb","Caixa Economica SIGCB"]]},0,["paymentbanckcombo"],["component","box","field","textfield","pickerfield","combobox","combo","paymentbanckcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,paymentbanckcombo:true},["widget.paymentbanckcombo"],0,[MBilling.view.general,"PaymentBanckCombo"],0));(Ext.cmd.derive("MBilling.view.templateMail.Controller",Ext.ux.app.ViewController,{onAfterSave:function(d){var c=this;d=d||c.formPanel;if(!d.idRecord){d.getForm().reset();c.focusFirstField()}c.saveButton.enable();c.updateLotButton&&c.updateLotButton.toggle(false);d.setLoading(false);c.store.load()},onEdit:function(){var b=this;b.lookupReference("generalTab").show();Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)}},0,0,0,0,["controller.templatemail"],0,[MBilling.view.templateMail,"Controller"],0));(Ext.cmd.derive("MBilling.view.templateMail.Module",Ext.ux.panel.Module,{controller:"templatemail",cfgEast:{flex:9}},0,["templatemailmodule"],["component","box","container","uxpanelmodule","templatemailmodule"],{component:true,box:true,container:true,uxpanelmodule:true,templatemailmodule:true},["widget.templatemailmodule"],0,[MBilling.view.templateMail,"Module"],0));(Ext.cmd.derive("MBilling.view.templateMail.List",Ext.ux.grid.Panel,{store:"TemplateMail",initComponent:function(){var b=this;b.allowPrint=false;b.buttonCsv=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowDelete=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("type"),dataIndex:"mailtype",flex:3},{header:t("Language"),renderer:Helper.Util.formatLanguageImage,dataIndex:"language",flex:2},{header:t("subject"),dataIndex:"subject",flex:7}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["templatemaillist"],["component","box","container","panel","tablepanel","gridpanel","grid","templatemaillist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,templatemaillist:true},["widget.templatemaillist"],0,[MBilling.view.templateMail,"List"],0));(Ext.cmd.derive("MBilling.view.templateMail.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true}},items:[{title:t("general"),reference:"generalTab",items:[{name:"fromname",fieldLabel:t("fromname")},{name:"fromemail",fieldLabel:t("fromemail")},{name:"subject",fieldLabel:t("subject")}]},{title:t("Email body"),items:[{hideLabel:true,xtype:"htmleditor",name:"messagehtml",fieldLabel:t("description"),height:1000,anchor:"100%"}]},{title:t("Variables"),items:[{xtype:"displayfield",fieldLabel:t("username"),value:'$login$',allowBlank:true},{xtype:"displayfield",fieldLabel:t("password"),value:'$password$',allowBlank:true},{xtype:"displayfield",fieldLabel:t("email"),value:'$email$',allowBlank:true},{xtype:"displayfield",fieldLabel:t("firstname"),value:'$firstname$',allowBlank:true},{xtype:"displayfield",fieldLabel:t("lastname"),value:'$lastname$',allowBlank:true},{xtype:"displayfield",fieldLabel:t("credit"),value:'$credit$',allowBlank:true},{xtype:"displayfield",fieldLabel:t("date"),value:'$time$',allowBlank:true},{xtype:"displayfield",fieldLabel:t("description"),value:'$description$',allowBlank:true},{xtype:"displayfield",fieldLabel:t("Url to cancel email credit notification"),value:'$cancel_credit_notification_email$',allowBlank:true}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["templatemailform"],["component","box","container","panel","form","templatemailform"],{component:true,box:true,container:true,panel:true,form:true,templatemailform:true},["widget.templatemailform"],0,[MBilling.view.templateMail,"Form"],0));(Ext.cmd.derive("MBilling.view.logUsers.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.logusers"],0,[MBilling.view.logUsers,"Controller"],0));(Ext.cmd.derive("MBilling.view.logUsers.Module",Ext.ux.panel.Module,{controller:"logusers"},0,["logusersmodule"],["component","box","container","uxpanelmodule","logusersmodule"],{component:true,box:true,container:true,uxpanelmodule:true,logusersmodule:true},["widget.logusersmodule"],0,[MBilling.view.logUsers,"Module"],0));(Ext.cmd.derive("MBilling.view.logUsers.List",Ext.ux.grid.Panel,{store:"LogUsers",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.allowDelete=false;b.allowCreate=false;b.allowUpdate=false;b.columns=[{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isOperator,hideable:!App.user.isOperator},{header:t("action"),dataIndex:"idLogActionsname",renderer:Helper.Util.translate,flex:3},{header:t("description"),dataIndex:"description",flex:7},{header:t("IP"),dataIndex:"ip",flex:4},{header:t("date"),renderer:Helper.Util.formatDateTime,dataIndex:"date",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["loguserslist"],["component","box","container","panel","tablepanel","gridpanel","grid","loguserslist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,loguserslist:true},["widget.loguserslist"],0,[MBilling.view.logUsers,"List"],0));(Ext.cmd.derive("MBilling.view.logUsers.Form",Ext.ux.form.Panel,{fieldsHideEdit:["cid"],initComponent:function(){var b=this;b.items=[{xtype:"usercombo",allowBlank:true,readOnly:true},{name:"id_log_actions",fieldLabel:t("action"),readOnly:true},{name:"ip",fieldLabel:t("ip"),readOnly:true},{xtype:"textareafield",name:"description",fieldLabel:t("description"),height:400,anchor:"100%",allowBlank:true,readOnly:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["logusersform"],["component","box","container","panel","form","logusersform"],{component:true,box:true,container:true,panel:true,form:true,logusersform:true},["widget.logusersform"],0,[MBilling.view.logUsers,"Form"],0));(Ext.cmd.derive("MBilling.view.provider.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.provider"],0,[MBilling.view.provider,"Controller"],0));(Ext.cmd.derive("MBilling.view.provider.Combo",Ext.form.field.ComboBox,{name:"id_provider",fieldLabel:t("provider"),forceSelection:true,editable:false,displayField:"provider_name",valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Provider",{proxy:{type:"uxproxy",module:"provider",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["providercombo"],["component","box","field","textfield","pickerfield","combobox","combo","providercombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,providercombo:true},["widget.providercombo"],0,[MBilling.view.provider,"Combo"],0));(Ext.cmd.derive("MBilling.view.provider.Module",Ext.ux.panel.Module,{controller:"provider"},0,["providermodule"],["component","box","container","uxpanelmodule","providermodule"],{component:true,box:true,container:true,uxpanelmodule:true,providermodule:true},["widget.providermodule"],0,[MBilling.view.provider,"Module"],0));(Ext.cmd.derive("MBilling.view.provider.List",Ext.ux.grid.Panel,{store:"Provider",initComponent:function(){var b=this;b.columns=b.columns||[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("name"),dataIndex:"provider_name"},{header:t("description"),dataIndex:"description"},{header:t("credit"),dataIndex:"credit",renderer:Helper.Util.formatMoneyDecimal},{header:t("creationdate"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"creationdate"}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["providerlist"],["component","box","container","panel","tablepanel","gridpanel","grid","providerlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,providerlist:true},["widget.providerlist"],0,[MBilling.view.provider,"List"],0));(Ext.cmd.derive("MBilling.view.provider.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["provider_name"],initComponent:function(){var b=this;b.items=[{name:"provider_name",fieldLabel:t("name")},{xtype:"moneyfield",name:"credit",mask:App.user.currency+" #9.999.990,00",fieldLabel:t("credit"),value:"0"},{xtype:"noyescombo",name:"credit_control",fieldLabel:t("Credit")+" "+t("control"),hidden:App.user.isClient},{xtype:"textareafield",name:"description",fieldLabel:t("description"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["providerform"],["component","box","container","panel","form","providerform"],{component:true,box:true,container:true,panel:true,form:true,providerform:true},["widget.providerform"],0,[MBilling.view.provider,"Form"],0));(Ext.cmd.derive("MBilling.view.provider.Lookup",Ext.ux.form.field.Lookup,{name:"id_provider",fieldLabel:t("Provider"),displayField:"idProviderprovider_name",displayFieldList:"provider_name",gridConfig:{xtype:"providerlist",fieldSearch:"username",columns:[{header:t("name"),dataIndex:"provider_name"},{header:t("description"),dataIndex:"description"}]}},0,["providerlookup"],["component","box","container","fieldcontainer","providerlookup"],{component:true,box:true,container:true,fieldcontainer:true,providerlookup:true},["widget.providerlookup"],0,[MBilling.view.provider,"Lookup"],0));(Ext.cmd.derive("MBilling.view.plan.Controller",Ext.ux.app.ViewController,{init:function(){var b=this;b.control({noyescombo:{select:b.onSelectType}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectType:function(c,d){this.showFieldsRelated(d.getData().showFields)},showFieldsRelated:function(j){var l=this,g=l.formPanel.getForm().getFields(),f=l.formPanel.getForm().findField("ini_credit"),m=l.formPanel.getForm();g.each(function(a){if(a.name=="signup"){a.value==1?f.show():f.hide()}})},onEdit:function(){var f=this,d=f.formPanel.getForm().findField("ini_credit"),e=f.formPanel.getForm().findField("signup");Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments);e.value==1?d.show():d.hide()}},0,0,0,0,["controller.plan"],0,[MBilling.view.plan,"Controller"],0));(Ext.cmd.derive("MBilling.view.plan.Combo",Ext.form.field.ComboBox,{name:"id_plan",fieldLabel:t("plan"),displayField:"name",valueField:"id",forceSelection:true,editable:true,listeners:{focus:function(b){b.expand()}},initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Plan",{proxy:{type:"uxproxy",module:"plan",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["plancombo"],["component","box","field","textfield","pickerfield","combobox","combo","plancombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,plancombo:true},["widget.plancombo"],0,[MBilling.view.plan,"Combo"],0));(Ext.cmd.derive("MBilling.view.plan.Module",Ext.ux.panel.Module,{controller:"plan"},0,["planmodule"],["component","box","container","uxpanelmodule","planmodule"],{component:true,box:true,container:true,uxpanelmodule:true,planmodule:true},["widget.planmodule"],0,[MBilling.view.plan,"Module"],0));(Ext.cmd.derive("MBilling.view.plan.List",Ext.ux.grid.Panel,{store:"Plan",fieldSearch:"name",initComponent:function(){var b=this;b.columns=b.columns||[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("name"),dataIndex:"name",flex:4},{header:t("lcrtype"),dataIndex:"lcrtype",comboRelated:"lcrtypecombo",renderer:Helper.Util.formatLcrtype,flex:4,filter:{type:"list",options:[[1,t("LCRAccordingtothebuyerPrice")],[0,t("LCRAccordingtothesellerPrice")],[2,t("Load Balancer")]]}},{header:t("Tech Prefx"),dataIndex:"techprefix",flex:4,hidden:!App.user.isAdmin},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"creationdate",flex:4},{header:t("Port. Celular"),dataIndex:"portabilidadeMobile",flex:2,renderer:Helper.Util.formattyyesno,filter:{type:"list",options:[[0,t("no")],[1,t("yes")]]},hidden:App.user.language!="pt_BR",hideable:false},{header:t("Port. Fixo"),dataIndex:"portabilidadeFixed",flex:2,renderer:Helper.Util.formattyyesno,filter:{type:"list",options:[[0,t("no")],[1,t("yes")]]},hidden:App.user.language!="pt_BR",hideable:false}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["planlist"],["component","box","container","panel","tablepanel","gridpanel","grid","planlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,planlist:true},["widget.planlist"],0,[MBilling.view.plan,"List"],0));(Ext.cmd.derive("MBilling.view.plan.Form",Ext.ux.form.Panel,{labelWidthFields:115,fieldsHideUpdateLot:["name"],initComponent:function(){var b=this;b.defaults={labelWidth:142};b.items=[{name:"name",fieldLabel:t("name"),maxLength:100},{xtype:"lcrtypefullcombo",name:"lcrtype",fieldLabel:t("lcrtype"),allowBlank:true},{xtype:"numberfield",name:"tariff_limit",minValue:1,value:1,fieldLabel:t("Tariff Find Limit"),hidden:!App.user.isAdmin},{xtype:"noyescombo",name:"signup",fieldLabel:t("useInSignup"),allowBlank:true},{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,00",name:"ini_credit",fieldLabel:t("Initial Credit to new users"),allowBlank:true,hidden:true,value:0},{xtype:"yesnocombo",name:"play_audio",fieldLabel:t("Notices with audio"),allowBlank:true,hidden:App.user.isClient},{style:"margin-top:25px",xtype:"fieldset",title:t("Ativar portabilidade?"),collapsible:true,collapsed:false,hidden:App.user.language!="pt_BR",defaults:{labelWidth:190,anchor:"100%",layout:{type:"hbox",labelAlign:b.labelAlignFields}},items:[{xtype:"noyescombo",name:"portabilidadeMobile",fieldLabel:t("Para Celular"),allowBlank:true,hidden:App.user.language!="pt_BR"},{xtype:"noyescombo",name:"portabilidadeFixed",fieldLabel:t("Para Fixo"),allowBlank:true,hidden:App.user.language!="pt_BR"}]},{name:"techprefix",fieldLabel:t("Tech Prefix"),allowBlank:true,maxLength:5,minLength:5,hidden:!App.user.isAdmin},{style:"margin-top:25px",xtype:"fieldset",title:t("Select one or more Services"),collapsible:true,collapsed:false,items:[{anchor:"100%",fieldLabel:"",xtype:"servicestag",allowBlank:true}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["planform"],["component","box","container","panel","form","planform"],{component:true,box:true,container:true,panel:true,form:true,planform:true},["widget.planform"],0,[MBilling.view.plan,"Form"],0));(Ext.cmd.derive("MBilling.view.plan.Tag",Ext.form.field.Tag,{name:"id_plan",fieldLabel:t("plan"),displayField:"name",valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Plan",{proxy:{type:"uxproxy",module:"plan",limitParam:undefined}});Ext.form.field.Tag.prototype.initComponent.apply(this,arguments)}},0,["plantag"],["component","box","field","textfield","pickerfield","combobox","combo","tagfield","plantag"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,tagfield:true,plantag:true},["widget.plantag"],0,[MBilling.view.plan,"Tag"],0));(Ext.cmd.derive("MBilling.view.plan.Lookup",Ext.ux.form.field.Lookup,{name:"id_plan",fieldLabel:t("Plan"),displayField:"idPlanname",displayFieldList:"name",gridConfig:{xtype:"planlist",fieldSearch:"name",columns:[{header:t("name"),dataIndex:"name",flex:2}]}},0,["planlookup"],["component","box","container","fieldcontainer","planlookup"],{component:true,box:true,container:true,fieldcontainer:true,planlookup:true},["widget.planlookup"],0,[MBilling.view.plan,"Lookup"],0));(Ext.cmd.derive("MBilling.view.trunk.Controller",Ext.ux.app.ViewController,{onEdit:function(){var f=this,e=f.list.getSelectionModel().getSelection()[0],d=f.formPanel.getForm().findField("register");if(e.get("register")==1){if(e.get("register")&&e.get("providertech")=="sip"){color=e.get("registered")==1?"green":"red";d.setFieldLabel(t("registertrunk")+' ')}else{d.setFieldLabel(t("registertrunk"))}f.formPanel.getForm().findField("register_string")["show"]()}else{d.setFieldLabel(t("registertrunk"));f.formPanel.getForm().findField("register_string")["hide"]()}Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments);valueAllow=f.formPanel.idRecord?e.get("allow").split(","):["g729","gsm","alaw","ulaw"];fieldAllow=f.formPanel.down("checkboxgroup");fieldAllow.setValue({allow:valueAllow})},init:function(){var b=this;b.control({"noyescombo[name=register]":{select:b.onSelectType}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectType:function(c,d){this.showFieldsRelated(d.getData().showFields)},showFieldsRelated:function(o){var p=this,m=p.formPanel.getForm().findField("register_string"),n=p.formPanel.getForm().findField("user"),q=p.formPanel.getForm().findField("secret"),j=p.formPanel.getForm().findField("host"),l=p.formPanel.getForm().getFields();l.each(function(a){if(a.name=="register"){m.setVisible(a.value==1);m.setValue(n.value+":"+q.value+"@"+j.value+"/"+n.value)}})}},0,0,0,0,["controller.trunk"],0,[MBilling.view.trunk,"Controller"],0));(Ext.cmd.derive("MBilling.view.trunk.Combo",Ext.form.field.ComboBox,{name:"id_trunk",fieldLabel:t("trunk"),forceSelection:true,editable:true,listeners:{focus:function(b){b.expand()}},displayField:"trunkcode",valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Trunk",{proxy:{type:"uxproxy",module:"trunk",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["trunkcombo"],["component","box","field","textfield","pickerfield","combobox","combo","trunkcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,trunkcombo:true},["widget.trunkcombo"],0,[MBilling.view.trunk,"Combo"],0));(Ext.cmd.derive("MBilling.view.trunk.ComboBackup",Ext.form.field.ComboBox,{name:"failover_trunk",fieldLabel:t("failover_trunk"),displayField:"trunkcode",valueField:"id",value:0,limitParam:undefined,forceSelection:true,editable:true,extraValues:[{id:0,trunkcode:t("undefined")}],listeners:{focus:function(b){b.expand()}},initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Trunk",{proxy:{type:"uxproxy",module:"trunk",limitParam:undefined}});b.on("render",b.loadStore,b);Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)},loadStore:function(g){var j=this,e=g.store,f;e.load({callback:function(){if(j.extraValues.length){e.insert(0,j.extraValues)}}})}},0,["trunkcombobackup"],["component","box","field","textfield","pickerfield","combobox","combo","trunkcombobackup"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,trunkcombobackup:true},["widget.trunkcombobackup"],0,[MBilling.view.trunk,"ComboBackup"],0));(Ext.cmd.derive("MBilling.view.trunk.Module",Ext.ux.panel.Module,{controller:"trunk"},0,["trunkmodule"],["component","box","container","uxpanelmodule","trunkmodule"],{component:true,box:true,container:true,uxpanelmodule:true,trunkmodule:true},["widget.trunkmodule"],0,[MBilling.view.trunk,"Module"],0));(Ext.cmd.derive("MBilling.view.trunk.List",Ext.ux.grid.Panel,{store:"Trunk",fieldSearch:"trunkcode",initComponent:function(){var b=this;b.columns=b.columns||[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("trunkcode"),dataIndex:"trunkcode",flex:3},{header:t("add")+" "+t("prefix"),dataIndex:"trunkprefix",flex:2},{header:t("remove")+" "+t("prefix"),dataIndex:"removeprefix",flex:2},{header:t("host"),dataIndex:"host",flex:2},{xtype:"templatecolumn",tpl:"{idProviderprovider_name}",header:t("provider"),dataIndex:"id_provider",comboFilter:"providercombo",flex:2},{header:t("secondusedreal"),renderer:Helper.Util.formatsecondsToTime,dataIndex:"secondusedreal",flex:3},{header:t("status"),dataIndex:"status",renderer:Helper.Util.formatBooleanActive,comboFilter:"booleancombo",flex:1,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")]]}},{header:t("creationdate"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"creationdate",flex:3}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["trunklist"],["component","box","container","panel","tablepanel","gridpanel","grid","trunklist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,trunklist:true},["widget.trunklist"],0,[MBilling.view.trunk,"List"],0));(Ext.cmd.derive("MBilling.view.trunk.Form",Ext.ux.form.Panel,{autoHeight:300,bodyPadding:0,fieldsHideUpdateLot:["trunkcode"],initComponent:function(){var b=this;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{labelAlign:"right",plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true,labelWidth:142}},items:[{title:t("general"),items:[{xtype:"providerlookup",ownerForm:b},{name:"trunkcode",fieldLabel:t("trunkcode")},{name:"user",fieldLabel:t("user"),allowBlank:true},{name:"secret",fieldLabel:t("password"),allowBlank:true},{name:"host",fieldLabel:t("host")},{name:"trunkprefix",fieldLabel:t("add")+" "+t("prefix"),allowBlank:true},{name:"removeprefix",fieldLabel:t("remove")+" "+t("prefix"),allowBlank:true},{xtype:"checkboxgroup",columns:3,name:"allow",fieldLabel:t("codec"),items:[{boxLabel:"g729",name:"allow",inputValue:"g729",checked:true},{boxLabel:"g723",name:"allow",inputValue:"g723"},{boxLabel:"gsm",name:"allow",inputValue:"gsm",checked:true},{boxLabel:"g726",name:"allow",inputValue:"g726"},{boxLabel:"opus",name:"allow",inputValue:"opus",checked:true},{boxLabel:"alaw",name:"allow",inputValue:"alaw",checked:true},{boxLabel:"ulaw",name:"allow",inputValue:"ulaw",checked:true},{boxLabel:"g722",name:"allow",inputValue:"g722"},{boxLabel:"ilbc",name:"allow",inputValue:"ilbc"},{boxLabel:"speex",name:"allow",inputValue:"speex"},{boxLabel:"h261",name:"allow",inputValue:"h261"},{boxLabel:"h263",name:"allow",inputValue:"h263"}],allowBlank:true},{xtype:"sipcombo",name:"providertech",fieldLabel:t("providertech")},{xtype:"trunkcombobackup",allowBlank:true},{xtype:"booleancombo",name:"status",fieldLabel:t("status")},{xtype:"noyescombo",name:"allow_error",fieldLabel:t("allow_error")},{xtype:"noyescombo",name:"register",fieldLabel:t("registertrunk")},{name:"register_string",fieldLabel:t("Register String"),allowBlank:true,hidden:true}]},{title:t("suplementaryInfo"),defaults:{labelAlign:"right",plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true,labelWidth:142},items:[{name:"fromuser",fieldLabel:"fromuser",allowBlank:true},{name:"fromdomain",fieldLabel:"Fromdomain",allowBlank:true},{name:"language",fieldLabel:t("language"),allowBlank:true},{name:"context",fieldLabel:t("context"),allowBlank:true,value:"billing"},{name:"dtmfmode",fieldLabel:"dtmfmode",allowBlank:true,value:"RFC2833"},{name:"insecure",fieldLabel:"insecure",allowBlank:true,value:"port,invite"},{xtype:"numberfield",name:"maxuse",fieldLabel:t("maxuse"),allowBlank:true,value:-1,minValue:-1},{name:"nat",fieldLabel:"nat",value:App.user.asteriskVersion=="1.8"?"yes":"force_rport,comedia",allowBlank:true},{name:"directmedia",allowBlank:true,value:"no",fieldLabel:"directmedia"},{name:"qualify",fieldLabel:"qualify",allowBlank:true,value:"yes"},{name:"type",fieldLabel:"type",allowBlank:true,value:"peer"},{name:"disallow",fieldLabel:"disallow",allowBlank:true,value:"all"},{name:"sendrpid",fieldLabel:"sendrpid",allowBlank:true,value:"no"},{name:"addparameter",fieldLabel:t("addparameter"),allowBlank:true,emptyText:t("parameterdial")},{xtype:"textarea",name:"link_sms",fieldLabel:t("link_sms"),allowBlank:true,emptyText:t("linksmsobs"),height:100,anchor:"100%"},{name:"sms_res",fieldLabel:t("sms_res"),allowBlank:true},{xtype:"numberfield",name:"port",fieldLabel:t("Port"),value:"5060",readOnly:!App.user.isAdmin,hidden:App.user.isClient,allowBlank:App.user.isClient},{xtype:"combobox",name:"encryption",value:"no",store:[["no","No"],["yes","yes"]],fieldLabel:t("Encryption"),allowBlank:true,hidden:!App.user.isAdmin},{xtype:"combobox",forceSelection:true,editable:false,value:"no",store:[["tls","tls"],["no","disable"]],name:"transport",fieldLabel:t("Transport"),allowBlank:true,hidden:!App.user.isAdmin}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["trunkform"],["component","box","container","panel","form","trunkform"],{component:true,box:true,container:true,panel:true,form:true,trunkform:true},["widget.trunkform"],0,[MBilling.view.trunk,"Form"],0));(Ext.cmd.derive("MBilling.view.trunk.Lookup",Ext.ux.form.field.Lookup,{name:"id_trunk",fieldLabel:t("Trunk"),displayField:"idTrunktrunkcode",displayFieldList:"trunkcode",gridConfig:{xtype:"trunklist",fieldSearch:"trunkcode",columns:[{header:t("trunkcode"),dataIndex:"trunkcode"}]}},0,["trunklookup"],["component","box","container","fieldcontainer","trunklookup"],{component:true,box:true,container:true,fieldcontainer:true,trunklookup:true},["widget.trunklookup"],0,[MBilling.view.trunk,"Lookup"],0));(Ext.cmd.derive("MBilling.view.prefix.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.prefix"],0,[MBilling.view.prefix,"Controller"],0));(Ext.cmd.derive("MBilling.view.prefix.Combo",Ext.form.field.ComboBox,{name:"id_prefix",fieldLabel:t("destination"),displayField:"prefix",filterMode:"remote",valueField:"id",listConfig:{itemTpl:Ext.create("Ext.XTemplate","
{prefix} - {destination}
")},displayTpl:Ext.create("Ext.XTemplate",'{prefix} - {destination}'),initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.PrefixCombo",{proxy:{type:"uxproxy",module:"prefixCombo",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["prefixcombo"],["component","box","field","textfield","pickerfield","combobox","combo","prefixcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,prefixcombo:true},["widget.prefixcombo"],0,[MBilling.view.prefix,"Combo"],0));(Ext.cmd.derive("MBilling.view.prefix.Module",Ext.ux.panel.Module,{controller:"prefix"},0,["prefixmodule"],["component","box","container","uxpanelmodule","prefixmodule"],{component:true,box:true,container:true,uxpanelmodule:true,prefixmodule:true},["widget.prefixmodule"],0,[MBilling.view.prefix,"Module"],0));(Ext.cmd.derive("Ext.ux.form.field.FileUpload",Ext.form.field.File,{anchor:"0",name:"file",emptyText:t("selectFile"),fieldLabel:t("file"),buttonText:undefined,maxSize:3144000,extAllowed:["csv","ret"],titleTipInfo:t("modelContent"),titleWarning:t("warning"),msgInvalidFile:t("fileNotAllow"),msgInvalidSize:t("maxSizeFile"),childEls:["browseButtonWrap","playButtonWrap"],buttonPlayMargin:5,buttonConfig:{glyph:icons.file},triggers:{filebutton:{type:"component",hideOnReadOnly:false},playbutton:{type:"component"}},applyTriggers:function(e){var d=this,f=(e||{}).playbutton;if(f){f.component=Ext.apply({xtype:"button",iconCls:"icon-play",ownerCt:d,id:d.id+"-play",ui:d.ui,disabled:d.disabled,style:d.getButtonMarginProp()+d.buttonPlayMargin+"px",inputName:d.getName(),scope:d,handler:d.playStop,hidden:true});return Ext.form.field.File.prototype.applyTriggers.call(this,e)}},onRender:function(){var c=this,d;c.isAudio=c.extAllowed.indexOf("wav")!==-1;c.formPanel=c.up("form");c.formPanel.on("edit",c.onEditForm,c);(arguments.callee.$previous||Ext.form.field.File.prototype.onRender).apply(this,arguments);c.triggerPlay=c.getTrigger("playbutton");c.buttonPlay=c.triggerPlay.component;c.triggerPlay.el.setWidth(c.buttonPlay.getEl().getWidth()+c.buttonPlay.getEl().getMargin("lr"));if(Ext.isIE){c.buttonPlay.getEl().repaint()}c.initTipInfo()},reset:function(){var b=this;if(!b.isAudio){return}if(b.audio&&!b.audio.paused&&b.audio.currentTime){b.audio.pause();b.audio.currentTime=0}b.buttonPlay.setIconCls("icon-play");b.triggerPlay.el.setWidth(0);if(Ext.isIE){b.buttonPlay.getEl().repaint()}Ext.form.field.File.prototype.reset.apply(this,arguments)},onEditForm:function(){var g=this,f=g.formPanel.getForm().getRecord(),j=f&&f.get(g.name),e=!Ext.isEmpty(j);if(!g.isAudio){return}if(g.audio&&!g.audio.paused&&g.audio.currentTime){g.audio.pause();g.audio.currentTime=0}g.buttonPlay.setIconCls("icon-play");if(e){g.audio=new Audio(j);g.audio.addEventListener("ended",Ext.bind(g.onEndAudio,g));g.triggerPlay.el.setWidth(g.buttonPlay.el.getWidth()+g.buttonPlay.el.getMargin("lr"));if(Ext.isIE){g.buttonPlay.getEl().repaint()}}else{g.triggerPlay.el.setWidth(0);if(Ext.isIE){g.buttonPlay.getEl().repaint()}}g.buttonPlay.setVisible(e);g.triggerPlay.setVisible(e)},onEndAudio:function(){this.buttonPlay.setIconCls("icon-play")},getTriggerMarkup:function(){var d=this,e=Ext.form.field.File.prototype.getTriggerMarkup.apply(this,arguments),f='';return e+f},playStop:function(e){var d=this,f=e.iconCls==="icon-play";if(f){d.audio.play()}else{if(d.audio&&!d.audio.paused&&d.audio.currentTime){d.audio.pause();d.audio.currentTime=0}}e.setIconCls(f?"icon-stop":"icon-play")},initTipInfo:function(){var b=this;if(!b.htmlTipInfo){return}b.tipInfoFile=Ext.create("Ext.tip.ToolTip",{html:b.htmlTipInfo,anchor:"top",title:b.titleTipInfo,target:b.button.el})},onFileChange:function(e,f,g){var j=this;j.getInfoFile(f);Ext.form.field.File.prototype.onFileChange.apply(this,arguments)},getInfoFile:function(g){var l=this,f=g.target.files[0],j=f.name.split("."),m=j[j.length-1].toLowerCase();if(l.extAllowed.indexOf(m)===-1){Ext.ux.Alert.alert(l.titleWarning,l.msgInvalidFile,"warning");l.reset();return}if(f.size>l.maxSize){Ext.ux.Alert.alert(l.titleWarning,l.msgInvalidSize+Ext.util.Format.fileSize(l.maxSize),"warning");l.reset();return}}},0,["uploadfield"],["component","box","field","textfield","filefield","fileuploadfield","uploadfield"],{component:true,box:true,field:true,textfield:true,filefield:true,fileuploadfield:true,uploadfield:true},["widget.uploadfield"],0,[Ext.ux.form.field,"FileUpload"],0));(Ext.cmd.derive("Ext.ux.window.ImportCsv",Ext.window.Window,{autoShow:true,modal:true,layout:"fit",iconCls:"icon-import-csv",title:t("importFromCsv"),width:400,height:window.isThemeTriton?220:175,labelWidthFields:75,htmlTipInfo:"",fieldsImport:[],listeners:{close:function(){this.list.setLoading(false)}},initComponent:function(){var d=this,c=Ext.Array.merge(d.fieldsImport,[{xtype:"uploadfield",fieldLabel:t("fileCsv"),htmlTipInfo:d.htmlTipInfo}]);d.items=[{xtype:"form",bodyPadding:5,labelWidthFields:d.labelWidthFields,items:c}];d.title=d.title+(d.titleModule?" - "+d.titleModule:"");d.bbar=[{xtype:"tbtext",text:t("maxSizeFile")+"3 MB"},"->",{iconCls:"icon-import-csv",text:t("importText"),scope:d,handler:d.onImport}];Ext.window.Window.prototype.initComponent.apply(this,arguments)},onImport:function(d){var f=this,e=f.list.store;d.disable();f.list.setLoading(true);f.down("form").submit({url:e.getProxy().api.fromCsv,scope:f,success:function(c,b){var a=Ext.decode(b.response.responseText);if(a.success){Ext.ux.Alert.alert(t("Success"),a.msg,"success")}else{Ext.ux.Alert.alert(t("Error"),a.errors,"error")}d.enable();f.list.setLoading(false);e.load();f.close()},failure:function(c,b){if(Ext.isObject(b.response)){var a=Ext.decode(b.response.responseText);Ext.ux.Alert.alert(t("Error"),a.errors,"error")}else{Ext.ux.Alert.alert(t("Error"),b.response.responseText,"error",true,false)}d.enable();f.list.setLoading(false);f.close()}})}},0,0,["component","box","container","panel","window"],{component:true,box:true,container:true,panel:true,window:true},0,0,[Ext.ux.window,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.prefix.ImportCsv",Ext.ux.window.ImportCsv,{htmlTipInfo:"
"+t("dialprefix")+", "+t("destination")+"",labelWidthFields:160,height:window.isThemeTriton?300:205,initComponent:function(){var b=this;b.fieldsImport=[{style:"margin-top:25px",xtype:"fieldset",title:t("Csv Format"),collapsible:true,collapsed:false,defaults:{labelWidth:190,anchor:"100%",layout:{type:"hbox",labelAlign:b.labelAlignFields}},items:[{xtype:"pontovirgulacombo",name:"delimiter",fieldLabel:t("Delimiter"),width:230}]}];Ext.ux.window.ImportCsv.prototype.initComponent.apply(this,arguments)}},0,["prefiximportcsv"],["component","box","container","panel","window","prefiximportcsv"],{component:true,box:true,container:true,panel:true,window:true,prefiximportcsv:true},["widget.prefiximportcsv"],0,[MBilling.view.prefix,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.prefix.List",Ext.ux.grid.Panel,{store:"Prefix",fieldSearch:"prefix",initComponent:function(){var b=this;b.buttonImportCsv=!App.user.isClient,b.buttonUpdateLot=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("prefix"),dataIndex:"prefix",filter:{type:"string"}},{header:t("destination"),dataIndex:"destination"}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["prefixlist"],["component","box","container","panel","tablepanel","gridpanel","grid","prefixlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,prefixlist:true},["widget.prefixlist"],0,[MBilling.view.prefix,"List"],0));(Ext.cmd.derive("MBilling.view.prefix.Form",Ext.ux.form.Panel,{fieldsHideEdit:["prefix"],items:[{name:"prefix",fieldLabel:t("prefix"),maxLength:18},{name:"destination",fieldLabel:t("destination")}]},0,["prefixform"],["component","box","container","panel","form","prefixform"],{component:true,box:true,container:true,panel:true,form:true,prefixform:true},["widget.prefixform"],0,[MBilling.view.prefix,"Form"],0));(Ext.cmd.derive("MBilling.view.sendCreditProducts.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.sendcreditproducts"],0,[MBilling.view.sendCreditProducts,"Controller"],0));(Ext.cmd.derive("MBilling.view.sendCreditProducts.Module",Ext.ux.panel.Module,{controller:"sendcreditproducts"},0,["sendcreditproductsmodule"],["component","box","container","uxpanelmodule","sendcreditproductsmodule"],{component:true,box:true,container:true,uxpanelmodule:true,sendcreditproductsmodule:true},["widget.sendcreditproductsmodule"],0,[MBilling.view.sendCreditProducts,"Module"],0));(Ext.cmd.derive("MBilling.view.sendCreditProducts.ImportCsv",Ext.ux.window.ImportCsv,{fieldsImport:[{fieldLabel:t("table"),hidden:true,allowBlank:true}]},0,["sendcreditproductsimportcsv"],["component","box","container","panel","window","sendcreditproductsimportcsv"],{component:true,box:true,container:true,panel:true,window:true,sendcreditproductsimportcsv:true},["widget.sendcreditproductsimportcsv"],0,[MBilling.view.sendCreditProducts,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.sendCreditProducts.List",Ext.ux.grid.Panel,{store:"SendCreditProducts",fieldSearch:"operator_name",comparisonfilter:"ct",initComponent:function(){var b=this;b.buttonImportCsv=App.user.isAdmin,b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("Country"),dataIndex:"country",flex:4},{header:t("Country Code"),dataIndex:"country_code",flex:2},{header:t("Operator ID"),dataIndex:"operator_id",flex:2},{header:t("SkuCode"),dataIndex:"SkuCode",flex:2},{header:t("Operator Name"),dataIndex:"operator_name",flex:5},{header:t("Currency destination"),dataIndex:"currency_dest",flex:3},{header:t("Product"),dataIndex:"product",flex:2},{header:t("Currency Origem"),dataIndex:"currency_orig",flex:3},{header:t("Send Value"),dataIndex:"send_value",flex:2},{header:t("Wholesale Price"),dataIndex:"wholesale_price",flex:2},{header:t("Provider"),dataIndex:"provider",flex:2},{header:t("status"),dataIndex:"status",renderer:Helper.Util.formatBooleanActive,comboRelated:"booleancombo",flex:2,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")]]}}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["sendcreditproductslist"],["component","box","container","panel","tablepanel","gridpanel","grid","sendcreditproductslist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,sendcreditproductslist:true},["widget.sendcreditproductslist"],0,[MBilling.view.sendCreditProducts,"List"],0));(Ext.cmd.derive("MBilling.view.sendCreditProducts.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{name:"country",fieldLabel:t("country"),readOnly:true},{name:"operator_name",fieldLabel:t("Operator Name"),readOnly:true},{name:"operator_id",fieldLabel:t("Operator Id")},{name:"SkuCode",fieldLabel:t("SkuCode")},{name:"product",fieldLabel:t("Product")},{name:"send_value",fieldLabel:t("Send Value"),xtype:"moneyfield",mask:"#9.999.990,000000",readOnly:!App.user.isAdmin},{name:"wholesale_price",fieldLabel:t("Wholesale Price"),xtype:"moneyfield",mask:"#9.999.990,000000",readOnly:!App.user.isAdmin},{xtype:"combobox",name:"provider",value:"TransferTo",forceSelection:true,editable:false,store:[["TransferTo","TransferTo"],["Ding","Ding"],["TanaSend","TanaSend"]],fieldLabel:t("Provider")},{xtype:"yesnocombo",name:"status",fieldLabel:t("status")},{xtype:"textareafield",name:"info",fieldLabel:t("info"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["sendcreditproductsform"],["component","box","container","panel","form","sendcreditproductsform"],{component:true,box:true,container:true,panel:true,form:true,sendcreditproductsform:true},["widget.sendcreditproductsform"],0,[MBilling.view.sendCreditProducts,"Form"],0));(Ext.cmd.derive("MBilling.view.sendCreditRates.Controller",Ext.ux.app.ViewController,{onResetPrice:function(e){var f=this,d=f.list.getSelectionModel().getSelection()[0];Ext.Ajax.request({url:"index.php/SendCreditRates/resetSellPrice",scope:f,success:function(b){b=Ext.decode(b.responseText);if(b[f.nameSuccessRequest]){Ext.ux.Alert.alert(f.titleSuccess,b[f.nameMsgRequest],"success")}else{var a=Helper.Util.convertErrorsJsonToString(b[f.nameMsgRequest]);Ext.ux.Alert.alert(f.titleSuccess,a,"error")}}});f.store.load()}},0,0,0,0,["controller.sendcreditrates"],0,[MBilling.view.sendCreditRates,"Controller"],0));(Ext.cmd.derive("MBilling.view.sendCreditRates.Module",Ext.ux.panel.Module,{controller:"sendcreditrates"},0,["sendcreditratesmodule"],["component","box","container","uxpanelmodule","sendcreditratesmodule"],{component:true,box:true,container:true,uxpanelmodule:true,sendcreditratesmodule:true},["widget.sendcreditratesmodule"],0,[MBilling.view.sendCreditRates,"Module"],0));(Ext.cmd.derive("MBilling.view.sendCreditRates.List",Ext.ux.grid.Panel,{store:"SendCreditRates",fieldSearch:"idProduct.operator_name",comparisonfilter:"ct",initComponent:function(){var b=this;b.buttonUpdateLotCallShopRate=true;b.buttonCsv=false;b.allowPrint=false;b.extraButtons=[{text:t("Reset")+" "+t("Sell price"),iconCls:"icon-chart-column",width:130,handler:"onResetPrice",disabled:false}];b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{xtype:"templatecolumn",tpl:"{idProductoperator_name}",header:t("Operator Name"),dataIndex:"idProductoperator_name",filter:{type:"string",field:"idProduct.operator_name"},flex:5},{xtype:"templatecolumn",tpl:"{idProductcountry}",header:t("Country"),dataIndex:"idProductcountry",filter:{type:"string",field:"idProduct.country"},flex:4},{xtype:"templatecolumn",tpl:"{idProductcurrency_dest}",header:t("Currency destination"),dataIndex:"idProductcurrency_dest",filter:{type:"string",field:"idProduct.currency_dest"},flex:3},{xtype:"templatecolumn",tpl:"{idProductproduct}",header:t("Product"),dataIndex:"idProductproduct",filter:{type:"string",field:"idProduct.product"},flex:2},{xtype:"templatecolumn",tpl:"{idProductcurrency_orig}",header:t("Currency Origin"),dataIndex:"idProductcurrency_orig",filter:{type:"string",field:"idProduct.currency_orig"},flex:3},{xtype:"templatecolumn",tpl:"{idProductwholesale_price}",header:t("Wholesale Price"),dataIndex:"idProductwholesale_price",filter:{type:"string",field:"idProduct.wholesale_price"},flex:2},{header:t("Sell Price"),dataIndex:"sell_price",flex:2}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["sendcreditrateslist"],["component","box","container","panel","tablepanel","gridpanel","grid","sendcreditrateslist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,sendcreditrateslist:true},["widget.sendcreditrateslist"],0,[MBilling.view.sendCreditRates,"List"],0));(Ext.cmd.derive("MBilling.view.sendCreditRates.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["idProductcountry","idProductoperator_name"],initComponent:function(){var b=this;b.items=[{name:"idProductcountry",fieldLabel:t("country"),readOnly:true},{name:"idProductoperator_name",fieldLabel:t("Operator Name"),readOnly:true},{name:"sell_price",fieldLabel:t("Sell Price"),xtype:"moneyfield",mask:"#9.999.990,00",readOnly:App.user.isAdmin}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["sendcreditratesform"],["component","box","container","panel","form","sendcreditratesform"],{component:true,box:true,container:true,panel:true,form:true,sendcreditratesform:true},["widget.sendcreditratesform"],0,[MBilling.view.sendCreditRates,"Form"],0));(Ext.cmd.derive("MBilling.view.prefix.Lookup",Ext.ux.form.field.Lookup,{name:"id_prefix",fieldLabel:t("Destination"),displayField:"idPrefixdestination",displayFieldList:"destination",gridConfig:{xtype:"prefixlist",fieldSearch:"destination",columns:[{header:t("prefix"),dataIndex:"prefix",flex:2},{header:t("destination"),dataIndex:"destination",flex:2}]}},0,["prefixlookup"],["component","box","container","fieldcontainer","prefixlookup"],{component:true,box:true,container:true,fieldcontainer:true,prefixlookup:true},["widget.prefixlookup"],0,[MBilling.view.prefix,"Lookup"],0));(Ext.cmd.derive("MBilling.view.sipTrace.Controller",Ext.ux.app.ViewController,{onNewFilter:function(d){var f=this,e=f.getView();Ext.widget("siptracefilter",{title:"SipTrace",list:f.list})},onDeleteLog:function(d){var c=this;Ext.Msg.confirm(c.titleConfirmation,t("Confirm delete all log file?"),function(a){if(a==="yes"){Ext.Ajax.request({url:"index.php/sipTrace/destroy",scope:c,success:function(b){Ext.ux.Alert.alert(c.titleSuccess,t("Success: The Sip Trace file was deleted"),"success");c.store.load()}})}})},onClearAll:function(d){var c=this;Ext.Ajax.request({url:"index.php/sipTrace/clearAll",scope:c,success:function(a){Ext.ux.Alert.alert(c.titleSuccess,t("Success"),"success");c.store.load()}})},onExportPcap:function(d){var c=this;window.open("index.php/sipTrace/export")},onDetails:function(d){var f=this,e=f.list.getSelectionModel().getSelection()[0];window.open("index.php/sipTrace/details?callid="+e.get("callid"))}},0,0,0,0,["controller.siptrace"],0,[MBilling.view.sipTrace,"Controller"],0));(Ext.cmd.derive("MBilling.view.sipTrace.Module",Ext.ux.panel.Module,{controller:"siptrace"},0,["siptracemodule"],["component","box","container","uxpanelmodule","siptracemodule"],{component:true,box:true,container:true,uxpanelmodule:true,siptracemodule:true},["widget.siptracemodule"],0,[MBilling.view.sipTrace,"Module"],0));(Ext.cmd.derive("MBilling.view.sipTrace.Filter",Ext.window.Window,{autoShow:true,modal:true,layout:"fit",iconCls:"icon-import-csv",title:t("SipTrace filter"),width:400,height:window.isThemeTriton?220:180,labelWidthFields:120,htmlTipInfo:"",fieldsImport:[],initComponent:function(){var b=this;b.items=[{xtype:"form",bodyPadding:5,defaults:{anchor:"0",enableKeyEvents:true,labelWidth:b.labelWidthFields,msgTarget:"side",plugins:"markallowblank",allowBlank:false},items:[{xtype:"numberfield",value:60,min:5,max:300,name:"timeout",fieldLabel:t("Filter timeout")},{xtype:"numberfield",name:"port",fieldLabel:t("Port"),allowBlank:false,value:5060},{xtype:"textfield",name:"filter",fieldLabel:t("Filter"),allowBlank:false,emptyText:"IP, sip account or number ...."}]}];b.title=b.title+(b.titleModule?" - "+b.titleModule:"");b.bbar=[{width:150,iconCls:"icon-play",text:t("Start"),scope:b,handler:b.onStart}];Ext.window.Window.prototype.initComponent.apply(this,arguments)},onStart:function(d){var f=this,e=f.list.store;if(!f.down("form").isValid()){return}f.list.setLoading(true);Ext.Ajax.setTimeout(1000000);f.down("form").submit({url:"index.php/sipTrace/start",scope:f,success:function(c,b){var a=Ext.decode(b.response.responseText);console.log(a);if(a.success){Ext.ux.Alert.alert(t("Success"),a.msg,"success")}else{Ext.ux.Alert.alert(t("Error"),a.errors,"error")}d.enable();f.list.setLoading(false);e.load();f.close()},failure:function(c,b){console.log(b.response.responseText);if(b.response&&Ext.isObject(b.response.responseText)){var a=Ext.decode(b.response.responseText);Ext.ux.Alert.alert(t("Error"),a.errors,"error",true,30)}else{Ext.ux.Alert.alert(t("Error"),Ext.decode(b.response.responseText).msg,"error",true,30)}d.enable();f.list.setLoading(false);e.load();f.close()}})}},0,["siptracefilter"],["component","box","container","panel","window","siptracefilter"],{component:true,box:true,container:true,panel:true,window:true,siptracefilter:true},["widget.siptracefilter"],0,[MBilling.view.sipTrace,"Filter"],0));(Ext.cmd.derive("MBilling.view.sipTrace.List",Ext.ux.grid.Panel,{store:"SipTrace",initComponent:function(){var b=this;b.buttonImportCsv=false;b.buttonCsv=false;b.allowPrint=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.collapsedExtraFilters=false;b.allowDelete=false;b.extraButtons=[{text:b.textDelete,glyph:b.glyphDelete,handler:"onDeleteLog",width:120},{text:t("Start Capture"),iconCls:"icon-save-all",handler:"onNewFilter",width:120},{text:t("Stop Capture"),iconCls:"icon-clean-filter",handler:"onClearAll",width:120},{text:t("Export File"),iconCls:"icon-save-all",handler:"onExportPcap",width:150},{text:t("Details"),glyph:icons.info,handler:"onDetails",width:150}];b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,menuDisabled:true,hideable:App.user.isAdmin},{header:t("method"),dataIndex:"method",flex:3},{header:t("callid"),dataIndex:"callid",flex:7},{header:t("SIP To "),dataIndex:"sipto",flex:5},{header:t("Source"),dataIndex:"fromip",renderer:function(a){a=a==window.myIP?''+a+"":a;return a},flex:3},{header:t("Destination"),dataIndex:"toip",renderer:function(a){a=a==window.myIP?''+a+"":a;return a},flex:4},{header:t("head"),dataIndex:"head",flex:3,menuDisabled:true,hidden:true,hideable:true}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["siptracelist"],["component","box","container","panel","tablepanel","gridpanel","grid","siptracelist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,siptracelist:true},["widget.siptracelist"],0,[MBilling.view.sipTrace,"List"],0));(Ext.cmd.derive("MBilling.view.sipTrace.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.allowCreate=false;height=Ext.Element.getViewportHeight()-200;b.items=[{xtype:"textareafield",name:"head",height:height,anchor:"100%",allowBlank:true,readOnly:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["siptraceform"],["component","box","container","panel","form","siptraceform"],{component:true,box:true,container:true,panel:true,form:true,siptraceform:true},["widget.siptraceform"],0,[MBilling.view.sipTrace,"Form"],0));(Ext.cmd.derive("MBilling.view.sip.Controller",Ext.ux.app.ViewController,{init:function(){var b=this;b.control({typesipforwardcombo:{select:b.onSelectMethod}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectMethod:function(c,d){this.showFieldsRelated(d.getData().showFields)},showFieldsRelated:function(l){var m=this,n=m.formPanel.getForm(),j=m.formPanel.getForm().getFields(),g=Ext.get(Ext.Element.getActiveElement()).component,o=g.name.substr(-2);m.onSetVisibleFiel(g,n,o,g.value)},onSetVisibleFiel:function(f,j,e,g){if(f.value=="undefined"){f.setValue("undefined")}j.findField("id_queue").setValue("");j.findField("id_sip").setValue("");j.findField("id_ivr").setValue("");j.findField("extension").setValue("");j.findField("id_queue").setVisible(g.match("^queue"));j.findField("id_sip").setVisible(g.match("^sip"));j.findField("id_ivr").setVisible(g.match("^ivr"));j.findField("extension").setVisible(g.match("^group|^number|^custom"))},onGetDiskSpaceService:function(b){filterGroupp=Ext.encode([{type:"numeric",comparison:"eq",value:App.user.id,field:"id_user"},{type:"numeric",comparison:"eq",value:1,field:"status"}]),Ext.Ajax.request({url:"index.php/servicesUse/read?filter="+filterGroupp,success:function(a){a=Ext.decode(a.responseText);b(a.rows)}})},onEdit:function(){var j=this,l=j.formPanel.getForm(),f=j.list.getSelectionModel().getSelection()[0],g=j.formPanel.idRecord?f.get("allow").split(","):["g729","gsm","alaw","ulaw"],m=j.formPanel.down("checkboxgroup");if(App.user.isClient){l.findField("record_call").setVisible(false);j.onGetDiskSpaceService(function(a){Ext.each(a,function(b){if(b.idServicestype=="disk_space"){j.formPanel.getForm().findField("record_call").setVisible(true)}})})}fieldValue=f.getData()["type_forward"];l.findField("type_forward").setVisible(true);if(fieldValue=="ivr"){l.findField("id_ivr").setVisible(true);l.findField("id_sip").setVisible(false);l.findField("id_queue").setVisible(false);l.findField("extension").setVisible(false)}else{if(fieldValue=="sip"){l.findField("id_sip").setVisible(true);l.findField("id_ivr").setVisible(false);l.findField("id_queue").setVisible(false);l.findField("extension").setVisible(false)}else{if(fieldValue=="queue"){l.findField("id_queue").setVisible(true);l.findField("id_sip").setVisible(false);l.findField("id_ivr").setVisible(false);l.findField("extension").setVisible(false)}else{if(fieldValue.match("custom|number|group")){l.findField("extension").setVisible(true);l.findField("id_ivr").setVisible(false);l.findField("id_sip").setVisible(false);l.findField("id_queue").setVisible(false)}else{l.findField("id_queue").setVisible(false);l.findField("id_sip").setVisible(false);l.findField("id_ivr").setVisible(false);l.findField("extension").setVisible(false)}}}}Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments);m.setValue({allow:g})},onNew:function(){var f=this,d=f.formPanel.getForm(),e=f.list.getSelectionModel().getSelection()[0];if(App.user.isClient){f.formPanel.getForm().findField("defaultuser").setReadOnly(false)}d.findField("id_ivr").setVisible(false);d.findField("id_sip").setVisible(false);d.findField("id_queue").setVisible(false);d.findField("id_ivr").setVisible(false);d.findField("id_queue").setVisible(false);d.findField("type_forward").setVisible(true);Ext.ux.app.ViewController.prototype.onNew.apply(this,arguments)}},0,0,0,0,["controller.sip"],0,[MBilling.view.sip,"Controller"],0));(Ext.cmd.derive("MBilling.view.sip.Module",Ext.ux.panel.Module,{controller:"sip"},0,["sipmodule"],["component","box","container","uxpanelmodule","sipmodule"],{component:true,box:true,container:true,uxpanelmodule:true,sipmodule:true},["widget.sipmodule"],0,[MBilling.view.sip,"Module"],0));(Ext.cmd.derive("MBilling.view.sip.List",Ext.ux.grid.Panel,{store:"Sip",fieldSearch:"idUser.username",initComponent:function(){var b=this;b.columns=b.columns||[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("Status"),dataIndex:"lineStatus",width:3,menuDisabled:true,renderer:Helper.Util.formatStatusImage},{header:t("accountcode"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4},{header:t("username"),dataIndex:"name",flex:4},{header:t("host"),dataIndex:"host",flex:4},{header:t("codec"),dataIndex:"allow",flex:5},{header:"group",dataIndex:"group",flex:3},{header:t("context"),dataIndex:"context",hidden:true,hideable:!App.user.isClient,flex:1},{header:t("record_call"),dataIndex:"record_call",renderer:Helper.Util.formattyyesno,filter:{type:"list",options:[[0,t("no")],[1,t("yes")]]},flex:2,hidden:true,hideable:!App.user.isClient},{header:t("callerid"),dataIndex:"callerid",hidden:true,hideable:!App.user.isClient,flex:1},{header:"nat",dataIndex:"nat",hidden:true,hideable:!App.user.isClient,flex:1},{header:"directmedia",dataIndex:"directmedia",hidden:true,hideable:!App.user.isClient,flex:1},{header:"qualify",dataIndex:"qualify",hidden:true,hideable:!App.user.isClient,flex:1},{header:"dtmfmode",dataIndex:"dtmfmode",hidden:true,hideable:!App.user.isClient,flex:1},{header:"insecure",dataIndex:"insecure",hidden:true,hideable:!App.user.isClient,flex:1},{header:"type",dataIndex:"type",hidden:true,hideable:!App.user.isClient,flex:1},{header:"allowtransfer",dataIndex:"allowtransfer",hidden:true,hideable:!App.user.isClient,flex:1},{header:"calllimit",dataIndex:"calllimit",hidden:true,hideable:!App.user.isClient,flex:1}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["siplist"],["component","box","container","panel","tablepanel","gridpanel","grid","siplist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,siplist:true},["widget.siplist"],0,[MBilling.view.sip,"List"],0));(Ext.cmd.derive("MBilling.view.sip.Form",Ext.ux.form.Panel,{bodyPadding:0,fieldsHideUpdateLot:["id_user","defaultuser","secret"],initComponent:function(){var b=this;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{labelAlign:"right",plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true}},items:[{title:t("general"),items:[{xtype:"userlookup",ownerForm:b,fieldLabel:t("accountcode"),hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"defaultuser",fieldLabel:t("username"),minLength:4,allowBlank:true,readOnly:App.user.isClient},{name:"secret",fieldLabel:t("password"),allowBlank:true,minLength:6},{name:"callerid",fieldLabel:t("callerid"),allowBlank:true},{name:"alias",fieldLabel:t("Alias"),allowBlank:true,minLength:3},{name:"disallow",fieldLabel:"disallow",value:"all",hidden:!App.user.isAdmin,allowBlank:App.user.isClient},{xtype:"checkboxgroup",columns:3,fieldLabel:t("codec"),items:[{boxLabel:"g729",name:"allow",inputValue:"g729",checked:true},{boxLabel:"g723",name:"allow",inputValue:"g723"},{boxLabel:"gsm",name:"allow",inputValue:"gsm",checked:true},{boxLabel:"g726",name:"allow",inputValue:"g726"},{boxLabel:"opus",name:"allow",inputValue:"opus",checked:true},{boxLabel:"alaw",name:"allow",inputValue:"alaw",checked:true},{boxLabel:"ulaw",name:"allow",inputValue:"ulaw",checked:true},{boxLabel:"g722",name:"allow",inputValue:"g722"},{boxLabel:"ilbc",name:"allow",inputValue:"ilbc"},{boxLabel:"speex",name:"allow",inputValue:"speex"},{boxLabel:"h263p",name:"allow",inputValue:"h263p"},{boxLabel:"h263",name:"allow",inputValue:"h263"},{boxLabel:"h264",name:"allow",inputValue:"h264"},{boxLabel:"vp8",name:"allow",inputValue:"vp8"}],hidden:!App.user.isAdmin,allowBlank:App.user.isClient},{name:"host",fieldLabel:t("host"),value:"dynamic",hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"group",fieldLabel:t("group"),allowBlank:true},{xtype:"yesnostringcombo",name:"videosupport",fieldLabel:"videosupport",value:"no",allowBlank:!App.user.isAdmin},{name:"block_call_reg",fieldLabel:t("Block Call REGEX"),allowBlank:true,hidden:!window.doac},{xtype:"noyescombo",name:"record_call",fieldLabel:t("record_call"),allowBlank:true,hidden:!App.user.isAdmin},{xtype:"numberfield",name:"techprefix",fieldLabel:t("TechPrefix"),hidden:!window.usertech||!App.user.isAdmin,allowBlank:true,maxLength:6}]},{title:t("Nat"),hidden:!App.user.isAdmin,items:[{name:"nat",fieldLabel:"nat",value:"force_rport,comedia",allowBlank:!App.user.isAdmin},{name:"directmedia",fieldLabel:"directmedia",value:"no",allowBlank:!App.user.isAdmin},{xtype:"yesnostringcombo",name:"qualify",fieldLabel:"qualify",value:"no",allowBlank:!App.user.isAdmin}]},{title:t("Additional"),hidden:!App.user.isAdmin,defaults:{labelAlign:"right",plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true,labelWidth:142},items:[{name:"context",fieldLabel:t("context"),value:"billing",hidden:!App.user.isAdmin,allowBlank:true},{name:"dtmfmode",fieldLabel:"dtmfmode",value:"RFC2833",allowBlank:!App.user.isAdmin},{name:"insecure",fieldLabel:"insecure",value:"no",allowBlank:true},{name:"deny",fieldLabel:"deny",allowBlank:true,hidden:!App.user.isAdmin},{name:"permit",fieldLabel:"permit",allowBlank:true,hidden:!App.user.isAdmin},{name:"type",fieldLabel:"type",value:"friend",allowBlank:!App.user.isAdmin},{xtype:"noyesstringcombo",name:"allowtransfer",fieldLabel:"allowtransfer",value:"no",allowBlank:!App.user.isAdmin},{xtype:"noyescombo",name:"ringfalse",fieldLabel:t("Ring false"),value:"0",allowBlank:!App.user.isAdmin},{name:"calllimit",xtype:"numberfield",fieldLabel:t("calllimit"),value:"0",allowBlank:!App.user.isAdmin},{xtype:"noyescombo",name:"voicemail",fieldLabel:t("Enable")+" "+t("VoiceMail"),value:"0",allowBlank:App.user.isClient},{name:"mohsuggest",fieldLabel:t("MOH"),allowBlank:true,hidden:!App.user.isAdmin},{name:"url_events",fieldLabel:t("Url Events notify"),hidden:!App.user.isAdmin||!window.events===true,allowBlank:true}]},{title:t("Forward"),itemId:"option",bodyPadding:10,defaults:{xtype:"fieldcontainer",layout:"hbox",plugins:"markallowblank",allowBlank:true,anchor:"100%",labelWidth:60,defaults:{hideLabel:true,hidden:true,flex:5,startX:100,allowBlank:true,ownerForm:b}},items:[{fieldLabel:t("Forward"),items:[{name:"type_forward",xtype:"typesipforwardcombo",flex:2},{xtype:"ivrlookup",name:"id_ivr",displayField:"id_ivr_name"},{xtype:"queuelookup",name:"id_queue",displayField:"id_queue_name"},{xtype:"sip2lookup",name:"id_sip",displayField:"id_sip_name"},{xtype:"textfield",name:"extension"}]},{name:"dial_timeout",xtype:"numberfield",fieldLabel:t("Dial timeout"),value:"60",labelWidth:90}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["sipform"],["component","box","container","panel","form","sipform"],{component:true,box:true,container:true,panel:true,form:true,sipform:true},["widget.sipform"],0,[MBilling.view.sip,"Form"],0));(Ext.cmd.derive("MBilling.view.sip.Lookup",Ext.ux.form.field.Lookup,{name:"id_sip",fieldLabel:t("Sip"),displayField:"idSipname",displayFieldList:"name",gridConfig:{xtype:"siplist",fieldSearch:"name",columns:[{header:t("Account"),dataIndex:"idUserusername",flex:2},{header:t("name"),dataIndex:"name",flex:2}]}},0,["siplookup"],["component","box","container","fieldcontainer","siplookup"],{component:true,box:true,container:true,fieldcontainer:true,siplookup:true},["widget.siplookup"],0,[MBilling.view.sip,"Lookup"],0));(Ext.cmd.derive("MBilling.view.sip2.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.sip2"],0,[MBilling.view.sip2,"Controller"],0));(Ext.cmd.derive("MBilling.view.sip2.Module",Ext.ux.panel.Module,{controller:"sip2"},0,["sip2module"],["component","box","container","uxpanelmodule","sip2module"],{component:true,box:true,container:true,uxpanelmodule:true,sip2module:true},["widget.sip2module"],0,[MBilling.view.sip2,"Module"],0));(Ext.cmd.derive("MBilling.view.sip2.List",Ext.ux.grid.Panel,{store:"Sip2",fieldSearch:"name",initComponent:function(){var b=this;b.columns=b.columns||[{header:t("accountcode"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4},{header:t("username"),dataIndex:"name",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["sip2list"],["component","box","container","panel","tablepanel","gridpanel","grid","sip2list"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,sip2list:true},["widget.sip2list"],0,[MBilling.view.sip2,"List"],0));(Ext.cmd.derive("MBilling.view.sip2.Form",Ext.ux.form.Panel,{bodyPadding:0},0,["sip2form"],["component","box","container","panel","form","sip2form"],{component:true,box:true,container:true,panel:true,form:true,sip2form:true},["widget.sip2form"],0,[MBilling.view.sip2,"Form"],0));(Ext.cmd.derive("MBilling.view.sip2.Lookup",Ext.ux.form.field.Lookup,{name:"id_sip",fieldLabel:t("Sip"),displayField:"id_sip_name",displayFieldList:"name",gridConfig:{xtype:"sip2list",fieldSearch:"name",columns:[{header:t("Account"),dataIndex:"idUserusername",flex:2},{header:t("name"),dataIndex:"name",flex:2}]}},0,["sip2lookup"],["component","box","container","fieldcontainer","sip2lookup"],{component:true,box:true,container:true,fieldcontainer:true,sip2lookup:true},["widget.sip2lookup"],0,[MBilling.view.sip2,"Lookup"],0));(Ext.cmd.derive("MBilling.view.sipuras.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.sipuras"],0,[MBilling.view.sipuras,"Controller"],0));(Ext.cmd.derive("MBilling.view.sipuras.Module",Ext.ux.panel.Module,{controller:"sipuras"},0,["sipurasmodule"],["component","box","container","uxpanelmodule","sipurasmodule"],{component:true,box:true,container:true,uxpanelmodule:true,sipurasmodule:true},["widget.sipurasmodule"],0,[MBilling.view.sipuras,"Module"],0));(Ext.cmd.derive("MBilling.view.sipuras.List",Ext.ux.grid.Panel,{store:"Sipuras",initComponent:function(){var b=this;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"}},{header:"Serial",dataIndex:"nserie"},{header:"Mac",dataIndex:"macadr"},{header:t("username")+" 1",dataIndex:"User_ID_1"},{header:t("username")+" 2",dataIndex:"User_ID_2"},{header:t("last_ip"),dataIndex:"last_ip"},{header:t("obs"),dataIndex:"obs"},{header:t("last")+" "+t("register"),dataIndex:"fultmov",renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s")}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["sipuraslist"],["component","box","container","panel","tablepanel","gridpanel","grid","sipuraslist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,sipuraslist:true},["widget.sipuraslist"],0,[MBilling.view.sipuras,"List"],0));(Ext.cmd.derive("MBilling.view.sipuras.Form",Ext.ux.form.Panel,{bodyPadding:0,fieldsHideUpdateLot:["id_user","nserie","macadr"],initComponent:function(){var b=this;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true,labelAlign:"right"}},items:[{title:t("general"),items:[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"nserie",fieldLabel:"Serial"},{name:"macadr",fieldLabel:"Mac"},{name:"senha_user",fieldLabel:t("password")+" "+t("username"),allowBlank:true},{name:"senha_admin",fieldLabel:t("password")+" "+t("admin"),allowBlank:true},{name:"antireset",fieldLabel:t("antireset"),xtype:"noyescombo"},{name:"Enable_Web_Server",fieldLabel:t("Enable_Web_Server"),xtype:"yesnocombo"},{name:"marca",fieldLabel:"marca",value:"*",hidden:true},{name:"altera",fieldLabel:"altera",value:"si",hidden:true}]},{title:t("line")+" 1",items:[{name:"User_ID_1",fieldLabel:t("username"),allowBlank:true},{name:"Password_1",fieldLabel:t("password"),allowBlank:true},{name:"Use_Pref_Codec_Only_1",fieldLabel:t("Use_Pref_Codec"),xtype:"noyescombo"},{name:"Preferred_Codec_1",fieldLabel:t("codec"),allowBlank:true,value:"G729a"},{name:"Register_Expires_1",fieldLabel:"Register Expires",allowBlank:true,value:"360"},{name:"Dial_Plan_1",fieldLabel:"Dial Plan",allowBlank:true,value:"(*xx|[3469]11|0|00|[2-9]xxxxxx|1xxx[2-9]xxxxxxS0|xxxxxxxxxxxx.)"},{name:"NAT_Mapping_Enable_1_",fieldLabel:"NAT Mapping",allowBlank:true,xtype:"noyescombo"},{name:"NAT_Keep_Alive_Enable_1_",fieldLabel:"NAT Keep Alive",allowBlank:true,xtype:"noyescombo"}]},{title:t("line")+" 2",items:[{name:"User_ID_2",fieldLabel:t("username"),allowBlank:true},{name:"Password_2",fieldLabel:t("password"),allowBlank:true},{name:"Use_Pref_Codec_Only_2",fieldLabel:t("Use_Pref_Codec"),xtype:"noyescombo"},{name:"Preferred_Codec_2",fieldLabel:t("codec"),allowBlank:true,value:"G729a"},{name:"Register_Expires_2",fieldLabel:"Register Expires",allowBlank:true,value:"360"},{name:"Dial_Plan_2",fieldLabel:"Dial Plan",allowBlank:true,value:"(*xx|[3469]11|0|00|[2-9]xxxxxx|1xxx[2-9]xxxxxxS0|xxxxxxxxxxxx.)"},{name:"NAT_Mapping_Enable_2_",fieldLabel:"NAT Mapping",allowBlank:true,xtype:"noyescombo"},{name:"NAT_Keep_Alive_Enable_2_",fieldLabel:"NAT Keep Alive",allowBlank:true,xtype:"noyescombo"}]},{title:"Stun",items:[{name:"STUN_Enable",fieldLabel:t("active")+"Stun",allowBlank:true,xtype:"noyescombo"},{name:"STUN_Test_Enable",fieldLabel:"STUN Test",allowBlank:true,xtype:"noyescombo"},{name:"Substitute_VIA_Addr",fieldLabel:"Substitute VIA Addr",allowBlank:true,xtype:"noyescombo"},{name:"STUN_Server",fieldLabel:"STUN Server",allowBlank:true}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["sipurasform"],["component","box","container","panel","form","sipurasform"],{component:true,box:true,container:true,panel:true,form:true,sipurasform:true},["widget.sipurasform"],0,[MBilling.view.sipuras,"Form"],0));(Ext.cmd.derive("MBilling.view.iax.Controller",Ext.ux.app.ViewController,{onEdit:function(){Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments);var g=this,e=g.list.getSelectionModel().getSelection()[0],f=g.formPanel.idRecord?e.get("allow").split(","):["g729","gsm","alaw","ulaw"],j=g.formPanel.down("checkboxgroup");j.setValue({allow:f})}},0,0,0,0,["controller.iax"],0,[MBilling.view.iax,"Controller"],0));(Ext.cmd.derive("MBilling.view.iax.Module",Ext.ux.panel.Module,{controller:"iax"},0,["iaxmodule"],["component","box","container","uxpanelmodule","iaxmodule"],{component:true,box:true,container:true,uxpanelmodule:true,iaxmodule:true},["widget.iaxmodule"],0,[MBilling.view.iax,"Module"],0));(Ext.cmd.derive("MBilling.view.iax.List",Ext.ux.grid.Panel,{store:"Iax",fieldSearch:"username",initComponent:function(){var b=this;b.columns=b.columns||[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("username"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:3},{header:t("ramal"),dataIndex:"name",flex:3},{header:t("password"),dataIndex:"secret",flex:2},{header:t("host"),dataIndex:"host",flex:3},{header:"IP",dataIndex:"ipaddr",flex:5},{header:t("context"),dataIndex:"context",hidden:true,hideable:!App.user.isClient,flex:1},{header:t("callerid"),dataIndex:"callerid",hidden:true,hideable:!App.user.isClient,flex:1},{header:t("codec"),dataIndex:"allow",hidden:true,hideable:!App.user.isClient,flex:1},{header:"nat",dataIndex:"nat",hidden:true,hideable:!App.user.isClient,flex:1},{header:"qualify",dataIndex:"qualify",hidden:true,hideable:!App.user.isClient,flex:1},{header:"dtmfmode",dataIndex:"dtmfmode",hidden:true,hideable:!App.user.isClient,flex:1},{header:"insecure",dataIndex:"insecure",hidden:true,hideable:!App.user.isClient,flex:1},{header:"type",dataIndex:"type",hidden:true,hideable:!App.user.isClient,flex:1}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["iaxlist"],["component","box","container","panel","tablepanel","gridpanel","grid","iaxlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,iaxlist:true},["widget.iaxlist"],0,[MBilling.view.iax,"List"],0));(Ext.cmd.derive("MBilling.view.iax.Form",Ext.ux.form.Panel,{bodyPadding:0,fieldsHideUpdateLot:["id_user","defaultuser","secret"],initComponent:function(){var b=this;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true,labelAlign:"right"}},items:[{title:t("general"),items:[{xtype:"userlookup",ownerForm:b,fieldLabel:t("accountcode"),hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"username",fieldLabel:t("username"),minLength:4,readOnly:App.user.isClient},{name:"secret",fieldLabel:t("password"),allowBlank:true,minLength:6,readOnly:App.user.isClient},{name:"callerid",fieldLabel:t("callerid"),allowBlank:true},{name:"disallow",fieldLabel:"disallow",value:"all",hidden:!App.user.isAdmin,allowBlank:App.user.isClient},{xtype:"checkboxgroup",columns:3,fieldLabel:t("codec"),items:[{boxLabel:"g729",name:"allow",inputValue:"g729",checked:true},{boxLabel:"g723",name:"allow",inputValue:"g723"},{boxLabel:"gsm",name:"allow",inputValue:"gsm",checked:true},{boxLabel:"g726",name:"allow",inputValue:"g726"},{boxLabel:"alaw",name:"allow",inputValue:"alaw",checked:true},{boxLabel:"ulaw",name:"allow",inputValue:"ulaw",checked:true},{boxLabel:"g722",name:"allow",inputValue:"g722"},{boxLabel:"ilbc",name:"allow",inputValue:"ilbc"},{boxLabel:"speex",name:"allow",inputValue:"speex"},{boxLabel:"h261",name:"allow",inputValue:"h261"},{boxLabel:"h263",name:"allow",inputValue:"h263"}],hidden:!App.user.isAdmin,allowBlank:App.user.isClient},{name:"host",fieldLabel:t("host"),value:"dynamic",hidden:App.user.isClient,allowBlank:App.user.isClient}]},{title:t("natdetails"),hidden:!App.user.isAdmin,items:[{name:"nat",fieldLabel:"nat",value:App.user.asteriskVersion=="1.8"?"yes":"force_rport,comedia",allowBlank:!App.user.isAdmin}]},{title:t("suplementaryInfo"),hidden:!App.user.isAdmin,items:[{name:"context",fieldLabel:t("context"),value:"billing",hidden:!App.user.isAdmin,allowBlank:true},{xtype:"yesnostringcombo",name:"qualify",fieldLabel:"qualify",value:"no",allowBlank:!App.user.isAdmin},{name:"dtmfmode",fieldLabel:"dtmfmode",value:"RFC2833",allowBlank:!App.user.isAdmin},{name:"insecure",fieldLabel:"insecure",value:"no",allowBlank:true},{name:"type",fieldLabel:"type",value:"friend",allowBlank:!App.user.isAdmin},{name:"calllimit",xtype:"numberfield",fieldLabel:t("calllimit"),value:"0",allowBlank:!App.user.isAdmin}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["iaxform"],["component","box","container","panel","form","iaxform"],{component:true,box:true,container:true,panel:true,form:true,iaxform:true},["widget.iaxform"],0,[MBilling.view.iax,"Form"],0));(Ext.cmd.derive("MBilling.view.iax.Lookup",Ext.ux.form.field.Lookup,{name:"id_iax",fieldLabel:t("Iax"),displayField:"idIaxname",displayFieldList:"name",gridConfig:{xtype:"iaxlist",fieldSearch:"name",columns:[{header:t("Account"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:2},{header:t("name"),dataIndex:"name",flex:2}]}},0,["siaxlookup"],["component","box","container","fieldcontainer","siaxlookup"],{component:true,box:true,container:true,fieldcontainer:true,siaxlookup:true},["widget.siaxlookup"],0,[MBilling.view.iax,"Lookup"],0));(Ext.cmd.derive("MBilling.view.callOnLine.Controller",Ext.ux.app.ViewController,{onEdit:function(){var d=this,e=d.list.getSelectionModel().getSelection()[0],f=e.get("uniqueid");Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments);Ext.Ajax.request({url:"index.php/callOnLine/getChannelDetails",params:{id:e.get("uniqueid")},scope:d,success:function(a){a=Ext.decode(a.responseText);if(a[d.nameSuccessRequest]){d.formPanel.getForm().findField("description").setValue(a.description);d.formPanel.getForm().findField("codec").setValue(a.codec);d.formPanel.getForm().findField("reinvite").setValue(a.reinvite);d.formPanel.getForm().findField("from_ip").setValue(a.from_ip);d.formPanel.getForm().findField("ndiscado").setValue(a.ndiscado);d.formPanel.getForm().findField("billsec").setValue(a.billsec);d.formPanel.getForm().findField("callerid").setValue(a.callerid)}else{Ext.ux.Alert.alert(d.titleError,a[d.nameMsgRequest],"error")}}})},onSpyCallFree:function(e){var f=this,d=f.list.getSelectionModel().getSelection()[0];if(f.list.getSelectionModel().getSelection().length==1){Ext.Ajax.request({url:"index.php/callOnLine/spyCall",params:{type:"b",channel:d.get("canal")},scope:f,success:function(a){a=Ext.decode(a.responseText);if(a[f.nameSuccessRequest]){Ext.ux.Alert.alert(f.titleSuccess,a[f.nameMsgRequest],"success")}else{Ext.ux.Alert.alert(f.titleError,a[f.nameMsgRequest],"error")}}})}else{Ext.ux.Alert.alert(f.titleError,"Please Select only a record","notification")}},onDelete:function(e){var f=this,d=f.list.getSelectionModel().getSelection()[0];if(f.list.getSelectionModel().getSelection().length==1){Ext.Ajax.request({url:"index.php/callOnLine/destroy",params:{id:d.get("uniqueid")},scope:f,success:function(a){a=Ext.decode(a.responseText);if(a[f.nameSuccessRequest]){Ext.ux.Alert.alert(f.titleSuccess,a[f.nameMsgRequest],"success")}else{Ext.ux.Alert.alert(f.titleError,a[f.nameMsgRequest],"error")}}})}else{Ext.ux.Alert.alert(f.titleError,"Please Select only a record","notification")}f.store.load()}},0,0,0,0,["controller.callonline"],0,[MBilling.view.callOnLine,"Controller"],0));(Ext.cmd.derive("MBilling.view.callOnLine.Module",Ext.ux.panel.Module,{controller:"callonline"},0,["callonlinemodule"],["component","box","container","uxpanelmodule","callonlinemodule"],{component:true,box:true,container:true,uxpanelmodule:true,callonlinemodule:true},["widget.callonlinemodule"],0,[MBilling.view.callOnLine,"Module"],0));(Ext.cmd.derive("MBilling.view.callOnLine.SpyCall",Ext.window.Window,{modal:true,layout:"fit",iconCls:"call",title:t("Spy call"),width:450,height:window.isThemeNeptune||window.isThemeCrisp?170:window.isThemeTriton?290:170,labelWidthFields:80,channel:0,initComponent:function(){var b=this;if(b.list.getSelectionModel().getSelection().length==1){selected=b.list.getSelectionModel().getSelection()[0];if(selected.get("canal")){b.channel=selected.get("canal")}else{b.channel=selected.get("channel")}b.title=t("Spy call")+" "+selected.get("ndiscado")+" "+b.channel,b.autoShow=true;b.items=[{xtype:"form",bodyPadding:5,defaults:{anchor:"0",enableKeyEvents:true,labelWidth:b.labelWidthFields,msgTarget:"side",plugins:"markallowblank",allowBlank:false},items:[{xtype:"siplookup",name:"id_sip",displayField:t("Sip Account")},{xtype:"combobox",name:"type",value:"b",forceSelection:true,editable:false,store:[["b",t("Only Spy")],["w",t("Whisper, can talk to the spied")],["W",t("Whisper, can talk to the spied but cannot listen the call")]],fieldLabel:t("Spy type")}]}];b.title=b.title+(b.titleModule?" - "+b.titleModule:"");b.bbar=[{width:150,text:t("Send"),scope:b,handler:b.onSendSpy}]}else{Ext.ux.Alert.alert(b.titleError,"Please Select only a record","notification")}Ext.window.Window.prototype.initComponent.apply(this,arguments)},onSendSpy:function(d){var f=this,e=f.list.store;if(!f.down("form").isValid()){Ext.ux.Alert.alert("Alert",t("Select sip account"),"notification");return}f.list.setLoading(true);Ext.Ajax.setTimeout(1000000);f.down("form").submit({url:"index.php/callOnLine/spyCall",params:{id_sip:selected.get("id_sip"),type:selected.get("type"),channel:f.channel},scope:f,success:function(c,b){var a=Ext.decode(b.response.responseText);if(a.success){Ext.ux.Alert.alert(t("Success"),a.msg,"success")}else{Ext.ux.Alert.alert(t("Error"),a.errors,"error")}d.enable();f.list.setLoading(false);e.load();f.close()},failure:function(c,b){console.log(b.response.responseText);if(b.response&&Ext.isObject(b.response.responseText)){var a=Ext.decode(b.response.responseText);Ext.ux.Alert.alert(t("Error1"),a.errors,"error")}else{Ext.ux.Alert.alert(t("Error2"),Ext.decode(b.response.responseText).msg,"error",true,10)}d.enable()}})}},0,["callonlinespycall"],["component","box","container","panel","window","callonlinespycall"],{component:true,box:true,container:true,panel:true,window:true,callonlinespycall:true},["widget.callonlinespycall"],0,[MBilling.view.callOnLine,"SpyCall"],0));(Ext.cmd.derive("MBilling.view.callOnLine.List",Ext.ux.grid.Panel,{store:"CallOnLine",fieldSearch:"idUser.username",refreshTime:15,initComponent:function(){var b=this;b.buttonCsv=false;b.allowPrint=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=!App.user.isClient;b.textDelete=t("Hangup Call"),b.buttonDeleteWidth=140,b.refreshTime=(localStorage&&localStorage.getItem("callonlinerefresh"))||b.refreshTime;b.extraButtons=[{text:t("Spy")+" "+t("call"),iconCls:"call",handler:window.multSpy?"onSpyCall":"onSpyCallFree",width:130,disabled:false},{xtype:"numberfield",field:"jmlhBrg",fieldLabel:t("Refresh Time"),editable:false,minValue:5,labelWidth:90,width:150,selectOnFocus:true,allowDecimals:true,decimalPrecision:2,value:b.refreshTime,listeners:{change:function(a){if(a.value>0){b.refreshTime=a.value;localStorage.setItem("callonlinerefresh",a.value)}}}}];b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("UniqueID"),dataIndex:"uniqueid",hidden:true,hideable:App.user.isAdmin},{header:t("Sip Account"),dataIndex:"canal",flex:3},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:3},{header:t("credit"),dataIndex:"idUsercredit",filter:{type:"int",field:"idUser.credit"},renderer:Helper.Util.formatMoneyDecimal,flex:2},{header:t("number"),dataIndex:"ndiscado",flex:3},{header:t("status"),dataIndex:"status",filter:{type:"string",field:"status"},flex:2},{header:t("duration"),dataIndex:"duration",renderer:Helper.Util.formatsecondsToTime,flex:2},{header:t("trunk"),dataIndex:"tronco",flex:4,hidden:!App.user.isAdmin,hideable:App.user.isAdmin},{header:t("Server"),dataIndex:"server",flex:3,hidden:!window.slave||!App.user.isAdmin,hideable:App.user.isAdmin}];b.sessionLoad=Ext.create("Ext.util.DelayedTask",function(){b.store.load()},b);Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments);b.store.on("load",b.onLoadStore,b)},onLoadStore:function(){var b=this;b.onDeactivateModule();b.onActivateModule()},onRender:function(){var b=this;if(Ext.isObject(b.module)){b.module.on("activate",b.onActivateModule,b);b.module.on("deactivate",b.onDeactivateModule,b);b.module.on("close",b.onCloseModule,b)}Ext.ux.grid.Panel.prototype.onRender.apply(this,arguments)},onActivateModule:function(){this.sessionLoad&&this.sessionLoad.delay(this.refreshTime*1000)},onDeactivateModule:function(){this.sessionLoad&&this.sessionLoad.cancel()},onCloseModule:function(){this.onDeactivateModule();this.sessionLoad=null}},0,["callonlinelist"],["component","box","container","panel","tablepanel","gridpanel","grid","callonlinelist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callonlinelist:true},["widget.callonlinelist"],0,[MBilling.view.callOnLine,"List"],0));(Ext.cmd.derive("MBilling.view.callOnLine.List2",Ext.ux.grid.Panel,{store:"CallOnLine",fieldSearch:"username",refreshTime:10,initComponent:function(){var b=this;b.buttonCsv=false;b.allowPrint=false;b.buttonUpdateLot=false;b.allowCreate=false;b.buttonCleanFilter=false;b.allowUpdate=false;b.allowDelete=false;b.refreshTime=(localStorage&&localStorage.getItem("callonlinerefresh"))||b.refreshTime;b.extraButtons=[{xtype:"numberfield",field:"jmlhBrg",fieldLabel:t("Refresh Time"),editable:false,minValue:5,labelWidth:90,width:150,selectOnFocus:true,allowDecimals:true,decimalPrecision:2,value:b.refreshTime,listeners:{change:function(a){if(a.value>0){b.refreshTime=a.value;localStorage.setItem("callonlinerefresh",a.value)}}}}];b.columns=[{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:2},{header:t("Sip Account"),dataIndex:"canal",flex:3,hidden:true,hideable:true},{header:t("number"),dataIndex:"ndiscado",flex:3},{header:t("status"),dataIndex:"status",filter:{type:"string",field:"status"},flex:2},{header:t("duration"),dataIndex:"duration",renderer:Helper.Util.formatsecondsToTime,flex:2},{header:t("trunk"),dataIndex:"tronco",flex:4,hidden:App.user.isClient,hideable:!App.user.isClient}];b.sessionLoad=Ext.create("Ext.util.DelayedTask",function(){b.store.load()},b);Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments);b.store.on("load",b.onLoadStore,b)},onLoadStore:function(){var b=this;b.onDeactivateModule();b.onActivateModule()},onRender:function(){var b=this;if(Ext.isObject(b.module)){b.module.on("activate",b.onActivateModule,b);b.module.on("deactivate",b.onDeactivateModule,b);b.module.on("close",b.onCloseModule,b)}Ext.ux.grid.Panel.prototype.onRender.apply(this,arguments)},onActivateModule:function(){this.sessionLoad&&this.sessionLoad.delay(this.refreshTime*1000)},onDeactivateModule:function(){this.sessionLoad&&this.sessionLoad.cancel()},onCloseModule:function(){this.onDeactivateModule();this.sessionLoad=null}},0,["callonlinelist2"],["component","box","container","panel","tablepanel","gridpanel","grid","callonlinelist2"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callonlinelist2:true},["widget.callonlinelist2"],0,[MBilling.view.callOnLine,"List2"],0));(Ext.cmd.derive("MBilling.view.callOnLine.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{fieldLabel:t("number"),name:"ndiscado",readOnly:true},{fieldLabel:t("CallerID"),name:"callerid",readOnly:true},{fieldLabel:t("Real")+" "+t("duration"),name:"billsec",readOnly:true},{fieldLabel:t("Codec"),name:"codec",readOnly:true},{fieldLabel:t("Reinvite"),name:"reinvite",readOnly:true},{fieldLabel:t("From IP"),name:"from_ip",readOnly:true},{xtype:"textarea",name:"description",readOnly:true,height:350,anchor:"100%",hidden:!App.user.isAdmin}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callonlineform"],["component","box","container","panel","form","callonlineform"],{component:true,box:true,container:true,panel:true,form:true,callonlineform:true},["widget.callonlineform"],0,[MBilling.view.callOnLine,"Form"],0));(Ext.cmd.derive("MBilling.view.sendCreditSummary.Controller",Ext.ux.app.ViewController,{formHidden:true},0,0,0,0,["controller.sendcreditsummary"],0,[MBilling.view.sendCreditSummary,"Controller"],0));(Ext.cmd.derive("MBilling.view.sendCreditSummary.Module",Ext.form.Panel,{resizable:false,autoShow:true,header:false,items:[{xtype:"component",autoEl:{width:"100%",height:"100%",tag:"iframe",src:"index.php/sendCreditSummary/read"}}]},0,["sendcreditsummarymodule"],["component","box","container","panel","form","sendcreditsummarymodule"],{component:true,box:true,container:true,panel:true,form:true,sendcreditsummarymodule:true},["widget.sendcreditsummarymodule"],0,[MBilling.view.sendCreditSummary,"Module"],0));(Ext.cmd.derive("MBilling.view.sendCreditSummary.List",Ext.ux.grid.Panel,{store:"SendCreditSummary",initComponent:function(){var b=this;b.extraButtons=[{emptyText:t("From Day"),xtype:"searchfield",fieldFilter:"date",filterOnClick:b.filterFieldOnClick,store:b.store,comparison:"gt",type:"date"},{emptyText:t("To Day"),xtype:"searchfield",fieldFilter:"date",filterOnClick:b.filterFieldOnClick,store:b.store,comparison:"lt",type:"date"}];b.buttonCsv=false;b.buttonPrint=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("day"),renderer:Ext.util.Format.dateRenderer("Y-m-d"),dataIndex:"day",menuDisabled:true,flex:3},{header:t("service"),dataIndex:"service",flex:5},{header:t("Total cost"),dataIndex:"total_cost",flex:5,renderer:Helper.Util.formatMoneyDecimal2},{header:t("Total sale"),dataIndex:"total_sale",flex:5,renderer:Helper.Util.formatMoneyDecimal2},{header:t("Earned"),dataIndex:"earned",flex:5,renderer:Helper.Util.formatMoneyDecimal2}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["sendcreditsummarylist"],["component","box","container","panel","tablepanel","gridpanel","grid","sendcreditsummarylist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,sendcreditsummarylist:true},["widget.sendcreditsummarylist"],0,[MBilling.view.sendCreditSummary,"List"],0));(Ext.cmd.derive("MBilling.view.sendCreditSummary.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:App.user.isClient}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["sendcreditsummaryform"],["component","box","container","panel","form","sendcreditsummaryform"],{component:true,box:true,container:true,panel:true,form:true,sendcreditsummaryform:true},["widget.sendcreditsummaryform"],0,[MBilling.view.sendCreditSummary,"Form"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayUser.Controller",Ext.ux.app.ViewController,{onEdit:function(){me=this;me.sumData=me.store.getData().items[0].getData();if(!me.sumData){return}me.formPanel.getForm().getFields().each(function(b){b.setValue(me.sumData[b.name])});me.formPanel.expand()},onExportCsvDayUser:function(o,l,g){var m=this,j=m.list.getStore(),n=m.list.filters.getFilterData().length?Ext.encode(m.list.filters.getFilterData()):j.proxy.extraParams.filter;window.open("index.php/callSummaryDayUser/exportCsvCalls?id="+o.getStore().getAt(l).getData().idUserusername+"&filter="+n)}},0,0,0,0,["controller.callsummarydayuser"],0,[MBilling.view.callSummaryDayUser,"Controller"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayUser.Module",Ext.ux.panel.Module,{controller:"callsummarydayuser",titleDetails:t("total"),iconForm:"icon-sum",cfgEast:{flex:0.4}},0,["callsummarydayusermodule"],["component","box","container","uxpanelmodule","callsummarydayusermodule"],{component:true,box:true,container:true,uxpanelmodule:true,callsummarydayusermodule:true},["widget.callsummarydayusermodule"],0,[MBilling.view.callSummaryDayUser,"Module"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayUser.List",Ext.ux.grid.Panel,{store:"CallSummaryDayUser",initComponent:function(){var b=this;b.buttonImportCsv=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{xtype:"actioncolumn",width:26,sortable:false,menuDisabled:true,header:t(""),dataIndex:"id",items:[{iconCls:"icon-export-csv",tooltip:t("Export CSV"),handler:"onExportCsvDayUser"}],hidden:!App.user.isAdmin},{header:t("day"),renderer:Ext.util.Format.dateRenderer("Y-m-d"),dataIndex:"day",filter:{type:"date",field:"day"},flex:3},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("sessiontime")+" "+t("Min"),dataIndex:"sessiontime",flex:2},{header:t("aloc_all_calls"),dataIndex:"aloc_all_calls",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Answered Calls"),dataIndex:"nbcall",flex:3},{header:t("buycost"),dataIndex:App.user.isAdmin?"buycost":"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("sessionbill"),dataIndex:App.user.isAgent||App.user.isClientAgent?"agent_bill":"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("markup"),dataIndex:"lucro",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarydayuserlist"],["component","box","container","panel","tablepanel","gridpanel","grid","callsummarydayuserlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callsummarydayuserlist:true},["widget.callsummarydayuserlist"],0,[MBilling.view.callSummaryDayUser,"List"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayUser.Form",Ext.ux.form.Panel,{defaults:{},labelWidthFields:100,defaultType:"displayfield",initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{name:"sumsessiontime",fieldLabel:t("sessiontime")+" "+t("Min"),renderer:Ext.util.Format.numberRenderer("0"),allowBlank:true},{name:App.user.isAgent||App.user.isClientAgent?"sumagent_bill":"sumsessionbill",fieldLabel:t("sessionbill"),renderer:Helper.Util.formatMoneyDecimal,allowBlank:true},{name:App.user.isAdmin?"sumbuycost":"sumsessionbill",fieldLabel:t("buycost"),renderer:Helper.Util.formatMoneyDecimal,hidden:App.user.isClient,allowBlank:true},{name:"sumlucro",fieldLabel:t("markup"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumnbcall",fieldLabel:t("nbcall"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarydayuserform"],["component","box","container","panel","form","callsummarydayuserform"],{component:true,box:true,container:true,panel:true,form:true,callsummarydayuserform:true},["widget.callsummarydayuserform"],0,[MBilling.view.callSummaryDayUser,"Form"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayTrunk.Controller",Ext.ux.app.ViewController,{onEdit:function(){me=this;me.sumData=me.store.getData().items[0].getData();if(!me.sumData){return}me.formPanel.getForm().getFields().each(function(b){b.setValue(me.sumData[b.name])});me.formPanel.expand()}},0,0,0,0,["controller.callsummarydaytrunk"],0,[MBilling.view.callSummaryDayTrunk,"Controller"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayTrunk.Module",Ext.ux.panel.Module,{controller:"callsummarydaytrunk",titleDetails:t("total"),iconForm:"icon-sum",cfgEast:{flex:0.4}},0,["callsummarydaytrunkmodule"],["component","box","container","uxpanelmodule","callsummarydaytrunkmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callsummarydaytrunkmodule:true},["widget.callsummarydaytrunkmodule"],0,[MBilling.view.callSummaryDayTrunk,"Module"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayTrunk.List",Ext.ux.grid.Panel,{store:"CallSummaryDayTrunk",initComponent:function(){var b=this;b.buttonImportCsv=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{header:t("day"),renderer:Ext.util.Format.dateRenderer("Y-m-d"),dataIndex:"day",filter:{type:"date",field:"day"},flex:3},{header:t("Trunk"),dataIndex:"idTrunktrunkcode",filter:{type:"string",field:"idTrunk.trunkcode"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("sessiontime")+" "+t("Min"),dataIndex:"sessiontime",flex:2},{header:t("aloc_all_calls"),dataIndex:"aloc_all_calls",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Answered Calls"),dataIndex:"nbcall",flex:3},{header:t("buycost"),dataIndex:"buycost",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("sessionbill"),dataIndex:"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("markup"),dataIndex:"lucro",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarydaytrunklist"],["component","box","container","panel","tablepanel","gridpanel","grid","callsummarydaytrunklist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callsummarydaytrunklist:true},["widget.callsummarydaytrunklist"],0,[MBilling.view.callSummaryDayTrunk,"List"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayTrunk.Form",Ext.ux.form.Panel,{defaults:{},labelWidthFields:100,defaultType:"displayfield",initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{name:"sumsessiontime",fieldLabel:t("sessiontime")+" "+t("Min"),renderer:Ext.util.Format.numberRenderer("0"),allowBlank:true},{name:"sumsessionbill",fieldLabel:t("sessionbill"),renderer:Helper.Util.formatMoneyDecimal,allowBlank:true},{name:"sumbuycost",fieldLabel:t("buycost"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumlucro",fieldLabel:t("markup"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumnbcall",fieldLabel:t("nbcall"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarydaytrunkform"],["component","box","container","panel","form","callsummarydaytrunkform"],{component:true,box:true,container:true,panel:true,form:true,callsummarydaytrunkform:true},["widget.callsummarydaytrunkform"],0,[MBilling.view.callSummaryDayTrunk,"Form"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayAgent.Controller",Ext.ux.app.ViewController,{onEdit:function(){me=this;me.sumData=me.store.getData().items[0].getData();if(!me.sumData){return}me.formPanel.getForm().getFields().each(function(b){b.setValue(me.sumData[b.name])});me.formPanel.expand()}},0,0,0,0,["controller.callsummarydayagent"],0,[MBilling.view.callSummaryDayAgent,"Controller"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayAgent.Module",Ext.ux.panel.Module,{controller:"callsummarydayagent",titleDetails:t("total"),iconForm:"icon-sum",cfgEast:{flex:0.4}},0,["callsummarydayagentmodule"],["component","box","container","uxpanelmodule","callsummarydayagentmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callsummarydayagentmodule:true},["widget.callsummarydayagentmodule"],0,[MBilling.view.callSummaryDayAgent,"Module"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayAgent.List",Ext.ux.grid.Panel,{store:"CallSummaryDayAgent",initComponent:function(){var b=this;b.buttonImportCsv=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{header:t("day"),renderer:Ext.util.Format.dateRenderer("Y-m-d"),dataIndex:"day",filter:{type:"date",field:"day"},flex:3},{header:t("Agent"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{menuDisabled:true,header:t("sessiontime")+" "+t("Min"),dataIndex:"sessiontime",flex:2},{header:t("aloc_all_calls"),dataIndex:"aloc_all_calls",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Answered Calls"),dataIndex:"nbcall",flex:3},{header:t("buycost"),dataIndex:"buycost",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("sessionbill"),dataIndex:"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("markup"),dataIndex:"lucro",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarydayagentlist"],["component","box","container","panel","tablepanel","gridpanel","grid","callsummarydayagentlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callsummarydayagentlist:true},["widget.callsummarydayagentlist"],0,[MBilling.view.callSummaryDayAgent,"List"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayAgent.Form",Ext.ux.form.Panel,{defaults:{},labelWidthFields:100,defaultType:"displayfield",initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{name:"sumsessiontime",fieldLabel:t("sessiontime")+" "+t("Min"),renderer:Ext.util.Format.numberRenderer("0"),allowBlank:true},{name:"sumsessionbill",fieldLabel:t("sessionbill"),renderer:Helper.Util.formatMoneyDecimal,allowBlank:true},{name:"sumbuycost",fieldLabel:t("buycost"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumlucro",fieldLabel:t("markup"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumnbcall",fieldLabel:t("nbcall"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarydayagentform"],["component","box","container","panel","form","callsummarydayagentform"],{component:true,box:true,container:true,panel:true,form:true,callsummarydayagentform:true},["widget.callsummarydayagentform"],0,[MBilling.view.callSummaryDayAgent,"Form"],0));(Ext.cmd.derive("MBilling.view.callerid.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.callerid"],0,[MBilling.view.callerid,"Controller"],0));(Ext.cmd.derive("MBilling.view.callerid.Module",Ext.ux.panel.Module,{controller:"callerid"},0,["calleridmodule"],["component","box","container","uxpanelmodule","calleridmodule"],{component:true,box:true,container:true,uxpanelmodule:true,calleridmodule:true},["widget.calleridmodule"],0,[MBilling.view.callerid,"Module"],0));(Ext.cmd.derive("MBilling.view.callerid.List",Ext.ux.grid.Panel,{store:"Callerid",initComponent:function(){var b=this;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("cid"),dataIndex:"cid",flex:4},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("status"),dataIndex:"activated",renderer:Helper.Util.formatBooleanActive,comboRelated:"booleancombo",flex:2,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")]]}}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["calleridlist"],["component","box","container","panel","tablepanel","gridpanel","grid","calleridlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,calleridlist:true},["widget.calleridlist"],0,[MBilling.view.callerid,"List"],0));(Ext.cmd.derive("MBilling.view.callerid.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["id_user"],initComponent:function(){var b=this;b.items=[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"cid",fieldLabel:t("cid")},{xtype:"booleancombo",name:"activated",fieldLabel:t("status"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["calleridform"],["component","box","container","panel","form","calleridform"],{component:true,box:true,container:true,panel:true,form:true,calleridform:true},["widget.calleridform"],0,[MBilling.view.callerid,"Form"],0));(Ext.cmd.derive("MBilling.view.restrictedPhonenumber.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.restrictedphonenumber"],0,[MBilling.view.restrictedPhonenumber,"Controller"],0));(Ext.cmd.derive("MBilling.view.restrictedPhonenumber.Module",Ext.ux.panel.Module,{controller:"restrictedphonenumber"},0,["restrictedphonenumbermodule"],["component","box","container","uxpanelmodule","restrictedphonenumbermodule"],{component:true,box:true,container:true,uxpanelmodule:true,restrictedphonenumbermodule:true},["widget.restrictedphonenumbermodule"],0,[MBilling.view.restrictedPhonenumber,"Module"],0));(Ext.cmd.derive("MBilling.view.restrictedPhonenumber.List",Ext.ux.grid.Panel,{store:"RestrictedPhonenumber",buttonImportCsv:true,initComponent:function(){var b=this;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:2,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("number"),dataIndex:"number",flex:2}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["restrictedphonenumberlist"],["component","box","container","panel","tablepanel","gridpanel","grid","restrictedphonenumberlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,restrictedphonenumberlist:true},["widget.restrictedphonenumberlist"],0,[MBilling.view.restrictedPhonenumber,"List"],0));(Ext.cmd.derive("MBilling.view.restrictedPhonenumber.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["id_user"],initComponent:function(){var b=this;b.items=[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,readOnly:App.user.isClient,allowBlank:App.user.isClient},{name:"number",fieldLabel:t("number")}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["restrictedphonenumberform"],["component","box","container","panel","form","restrictedphonenumberform"],{component:true,box:true,container:true,panel:true,form:true,restrictedphonenumberform:true},["widget.restrictedphonenumberform"],0,[MBilling.view.restrictedPhonenumber,"Form"],0));(Ext.cmd.derive("MBilling.view.restrictedPhonenumber.ImportCsv",Ext.ux.window.ImportCsv,{htmlTipInfo:"
number
",fieldsImport:[{xtype:"usercombo",width:350}]},0,["restrictedphonenumberimportcsv"],["component","box","container","panel","window","restrictedphonenumberimportcsv"],{component:true,box:true,container:true,panel:true,window:true,restrictedphonenumberimportcsv:true},["widget.restrictedphonenumberimportcsv"],0,[MBilling.view.restrictedPhonenumber,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.did.Controller",Ext.ux.app.ViewController,{isSubmitForm:true,init:function(){var b=this;b.control({"booleancombo[name=cbr]":{select:b.onSelectcbr},"noyescombo[name=cbr_ua]":{select:b.onSelectcbrAu}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectcbr:function(c,d){me=this,form=me.formPanel.getForm();form.findField("cbr_ua").setVisible(d.data.field1);form.findField("cbr_total_try").setVisible(d.data.field1);form.findField("cbr_time_try").setVisible(d.data.field1)},onSelectcbrAu:function(c,d){me=this,form=me.formPanel.getForm();form.findField("cbr_em").setVisible(d.data.field1);form.findField("TimeOfDay_monFri").setVisible(d.data.field1);form.findField("TimeOfDay_sat").setVisible(d.data.field1);form.findField("TimeOfDay_sun").setVisible(d.data.field1);form.findField("workaudio").setVisible(d.data.field1);form.findField("noworkaudio").setVisible(d.data.field1)},onNew:function(e){var f=this,d=f.formPanel.getForm();d.findField("cbr_ua").setVisible(false);d.findField("cbr_em").setVisible(false);d.findField("TimeOfDay_monFri").setVisible(false);d.findField("TimeOfDay_sat").setVisible(false);d.findField("TimeOfDay_sun").setVisible(false);d.findField("workaudio").setVisible(false);d.findField("noworkaudio").setVisible(false);d.findField("cbr_total_try").setVisible(false);d.findField("cbr_time_try").setVisible(false);Ext.ux.app.ViewController.prototype.onNew.apply(this,arguments)},onEdit:function(){var c=this,d=c.list.getSelectionModel().getSelection()[0];if(d.get("cbr")==0){c.formPanel.getForm().findField("cbr_ua").setVisible(false);c.formPanel.getForm().findField("cbr_em").setVisible(false);c.formPanel.getForm().findField("TimeOfDay_monFri").setVisible(false);c.formPanel.getForm().findField("TimeOfDay_sat").setVisible(false);c.formPanel.getForm().findField("TimeOfDay_sun").setVisible(false);c.formPanel.getForm().findField("workaudio").setVisible(false);c.formPanel.getForm().findField("noworkaudio").setVisible(false);c.formPanel.getForm().findField("cbr_total_try").setVisible(false);c.formPanel.getForm().findField("cbr_time_try").setVisible(false)}else{c.formPanel.getForm().findField("cbr_ua").setVisible(true);if(d.get("cbr_ua")==1){c.formPanel.getForm().findField("cbr_em").setVisible(true);c.formPanel.getForm().findField("TimeOfDay_monFri").setVisible(true);c.formPanel.getForm().findField("TimeOfDay_sat").setVisible(true);c.formPanel.getForm().findField("TimeOfDay_sun").setVisible(true);c.formPanel.getForm().findField("workaudio").setVisible(true);c.formPanel.getForm().findField("noworkaudio").setVisible(true);c.formPanel.getForm().findField("cbr_total_try").setVisible(true);c.formPanel.getForm().findField("cbr_time_try").setVisible(true)}}Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)},onDelete:function(j){var g=this,e=g.list.getSelectionModel().getSelection(),f=true;Ext.each(e,function(a){if(a.get("reserved")===1){Ext.ux.Alert.alert(g.titleError,t("Please, first release the DID")+" "+a.raw.did,"error");f=false;return}});if(f==true){Ext.ux.app.ViewController.prototype.onDelete.apply(this,arguments)}},onRelease:function(o,l){var m=this,n=m.list.getSelectionModel().getSelection()[0],j=t("Confirm Release Did")+" "+n.get("did"),g=m.list.getStore();if(m.list.getSelectionModel().getSelection().length>1){Ext.ux.Alert.alert(m.titleError,t("Please Select only one DID to release"),"error")}else{if(n.get("reserved")===0){Ext.ux.Alert.alert(m.titleError,t("didIsNotUse"),"error");g.load()}else{Ext.Msg.confirm(m.titleConfirmation,j,function(a){if(a==="yes"){Ext.Ajax.request({url:"index.php/did/liberar",params:{id:n.get("id")},success:function(c){c=Ext.decode(c.responseText);if(c[m.nameSuccessRequest]){Ext.ux.Alert.alert(m.titleSuccess,c[m.nameMsgRequest],"success");g.load()}else{var b=Helper.Util.convertErrorsJsonToString(c[m.nameMsgRequest]);g.load()}}})}},m)}}},onBuyDid:function(){var m=this,j=m.lookupReference("buydidPanel"),f=j.getForm().findField("did").getValue(),l=j.getForm().findField("did").rawValue,g=t("confirmationBuyDid");if(f<1){Ext.ux.Alert.alert(m.titleError,t("Please, select a Did"),"warning")}else{Ext.Msg.confirm(t("Confirmation"),g+"
"+l,function(a){if(a==="yes"){Ext.ux.Alert.alert(m.titleSuccess,t("Please wait....We are activing your DID."),"notification");Ext.Ajax.request({url:"index.php/did/buy",params:{id:f},success:function(c){c=Ext.decode(c.responseText);if(c.success){Ext.ux.Alert.alert(m.titleSuccess,t(c.msg),"success",true,true,5000)}else{var b=Helper.Util.convertErrorsJsonToString(c.msg);Ext.ux.Alert.alert(m.titleError,t(b),"warning",true,true,5000)}}})}},m)}}},0,0,0,0,["controller.did"],0,[MBilling.view.did,"Controller"],0));(Ext.cmd.derive("MBilling.view.did.Combo",Ext.form.field.ComboBox,{name:"id_did",fieldLabel:t("did"),displayField:"did",forceSelection:true,editable:true,valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Did",{proxy:{type:"uxproxy",module:"did",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["didcombo"],["component","box","field","textfield","pickerfield","combobox","combo","didcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,didcombo:true},["widget.didcombo"],0,[MBilling.view.did,"Combo"],0));(Ext.cmd.derive("MBilling.view.did.BuyCombo",Ext.form.field.ComboBox,{name:"id_did",forceSelection:true,editable:false,fieldLabel:t("did"),displayField:"did",valueField:"id",listConfig:{itemTpl:Ext.create("Ext.XTemplate","
{did} ("+t("Setup")+": "+t("moedasimblo")+" {connection_charge} --> "+t("monthly payment")+": "+t("moedasimblo")+" {fixrate})
")},displayTpl:Ext.create("Ext.XTemplate",'{did} ('+t("Setup")+": "+t("moedasimblo")+" {connection_charge} --> "+t("monthly payment")+": "+t("moedasimblo")+" {fixrate})"),initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Did",{proxy:{type:"uxproxy",module:"did",actionRead:"readBuy",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["didbuycombo"],["component","box","field","textfield","pickerfield","combobox","combo","didbuycombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,didbuycombo:true},["widget.didbuycombo"],0,[MBilling.view.did,"BuyCombo"],0));(Ext.cmd.derive("MBilling.view.did.Module",Ext.ux.panel.Module,{controller:"did"},0,["didmodule"],["component","box","container","uxpanelmodule","didmodule"],{component:true,box:true,container:true,uxpanelmodule:true,didmodule:true},["widget.didmodule"],0,[MBilling.view.did,"Module"],0));(Ext.cmd.derive("MBilling.view.did.List",Ext.ux.grid.Panel,{store:"Did",fieldSearch:"did",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.extraButtons=[{text:t("crearToReleaseDid"),iconCls:"icon-delete",handler:"onRelease",disabled:false}];b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("did"),dataIndex:"did",flex:4},{header:t("reserved"),dataIndex:"reserved",renderer:Helper.Util.formattyyesno,flex:2,filter:{type:"list",options:[[1,t("yes")],[0,t("no")]]},hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:3,menuDisabled:true},{header:t("status"),dataIndex:"activated",renderer:Helper.Util.formatBooleanActive,flex:2,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")]]},hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("connection_charge"),dataIndex:"connection_charge",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("price")+" "+t("per")+" "+t("monthly"),dataIndex:"fixrate",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("secondusedreal"),renderer:Helper.Util.formatsecondsToTime,dataIndex:"secondusedreal",flex:3},{header:t("Description"),dataIndex:"description",hidden:true,hideable:App.user.isAdmin,flex:5}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["didlist"],["component","box","container","panel","tablepanel","gridpanel","grid","didlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,didlist:true},["widget.didlist"],0,[MBilling.view.did,"List"],0));(Ext.cmd.derive("MBilling.view.did.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["did"],initComponent:function(){var b=this;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{labelAlign:"right",plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true,labelWidth:140}},items:[{title:t("general"),items:[{name:"did",fieldLabel:t("did"),readOnly:App.user.isClient||App.user.isAgent},{xtype:"booleancombo",name:"activated",fieldLabel:t("status"),hidden:App.user.isClient||App.user.isAgent,allowBlank:true},{xtype:"moneyfield",name:"connection_charge",fieldLabel:t("connection_charge"),value:"0",hidden:App.user.isClient||App.user.isAgent},{xtype:"moneyfield",name:"fixrate",fieldLabel:t("Monthly")+" "+t("price"),value:"0",hidden:App.user.isClient||App.user.isAgent},{style:"margin-top:5px",xtype:"fieldset",title:t("Did")+" "+t("increment"),collapsible:false,collapsed:false,hidden:!App.user.isAdmin,defaults:{labelWidth:160,anchor:"100%",labelAlign:b.labelAlignFields},items:[{xtype:"moneyfield",name:"connection_sell",fieldLabel:t("Connetion charge"),value:"0",hidden:!App.user.isAdmin},{xtype:"numberfield",name:"minimal_time_charge",fieldLabel:t("Minimal time to charge"),value:"0",hidden:!App.user.isAdmin},{xtype:"numberfield",name:"initblock",fieldLabel:t("initblock"),value:"0",hidden:!App.user.isAdmin},{xtype:"numberfield",name:"increment",fieldLabel:t("billingblock"),value:"0",hidden:!App.user.isAdmin}]},{xtype:"combobox",name:"charge_of",fieldLabel:t("Charge")+" "+t("of"),value:1,forceSelection:true,editable:false,store:[[1,t("Owner DID")],[0,t("Caller ID, only allow call from registered callerID")]],hidden:App.user.isClient||App.user.isAgent},{xtype:"numberfield",name:"calllimit",fieldLabel:t("Channel Limit"),value:"-1",minValue:"-1",hidden:!window.didChannelLimit||!App.user.isAdmin},{xtype:"textareafield",allowBlank:true,name:"description",fieldLabel:t("description"),hidden:!App.user.isAdmin}]},{title:t("Billing"),items:[{style:"margin-top:5px",xtype:"fieldset",title:t("Did Billing per minute")+" "+t("rate")+" 1",collapsible:false,collapsed:false,hidden:!App.user.isAdmin,defaults:{labelWidth:170,anchor:"100%",labelAlign:b.labelAlignFields},items:[{xtype:"textfield",name:"expression_1",fieldLabel:t("Regular expression"),value:"*",hidden:!App.user.isAdmin},{xtype:"moneyfield",name:"selling_rate_1",fieldLabel:t("Sell price per min"),value:"0",hidden:!App.user.isAdmin},{xtype:"noyescombo",name:"block_expression_1",fieldLabel:t("Block calls from this expression"),hidden:!App.user.isAdmin},{xtype:"noyescombo",name:"send_to_callback_1",fieldLabel:t("Send the call to Callback"),hidden:!App.user.isAdmin}]},{style:"margin-top:25px",xtype:"fieldset",title:t("Did Billing per minute")+" "+t("rate")+" 2",collapsible:false,collapsed:false,hidden:!App.user.isAdmin,defaults:{labelWidth:160,anchor:"100%",labelAlign:b.labelAlignFields},items:[{xtype:"textfield",name:"expression_2",fieldLabel:t("Regular expression"),value:"*",hidden:!App.user.isAdmin},{xtype:"moneyfield",name:"selling_rate_2",fieldLabel:t("Sell price per min"),value:"0",hidden:!App.user.isAdmin},{xtype:"noyescombo",name:"block_expression_2",fieldLabel:t("Block calls from this expression"),hidden:!App.user.isAdmin},{xtype:"noyescombo",name:"send_to_callback_2",fieldLabel:t("Send the call to Callback"),hidden:!App.user.isAdmin}]},{style:"margin-top:25px",xtype:"fieldset",title:t("Did Billing per minute")+" "+t("rate")+" 3",collapsible:false,collapsed:false,hidden:!App.user.isAdmin,defaults:{labelWidth:160,anchor:"100%",labelAlign:b.labelAlignFields},items:[{xtype:"textfield",name:"expression_3",fieldLabel:t("Regular expression"),value:"*",hidden:!App.user.isAdmin},{xtype:"moneyfield",name:"selling_rate_3",fieldLabel:t("Sell price per min"),value:"0",hidden:!App.user.isAdmin},{xtype:"noyescombo",name:"block_expression_3",fieldLabel:t("Block calls from this expression"),hidden:!App.user.isAdmin},{xtype:"noyescombo",name:"send_to_callback_3",fieldLabel:t("Send the call to Callback"),hidden:!App.user.isAdmin}]}]},{title:t("CallBack Pro"),hidden:!window.cbr,items:[{xtype:"booleancombo",name:"cbr",fieldLabel:t("CallBack Pro"),value:0,hidden:!window.cbr,allowBlank:true},{xtype:"noyescombo",name:"cbr_ua",fieldLabel:t("Use Audio"),value:0,hidden:true,allowBlank:true},{xtype:"numberfield",name:"cbr_total_try",fieldLabel:t("Maximum trying"),value:3,hidden:true,allowBlank:true,minValue:0},{xtype:"numberfield",name:"cbr_time_try",fieldLabel:t("Interval beteween trying"),value:30,hidden:true,allowBlank:true,minValue:10},{xtype:"noyescombo",name:"cbr_em",fieldLabel:t("Early Media"),hidden:true,allowBlank:true},{name:"TimeOfDay_monFri",fieldLabel:t("Mon-Fri"),value:"09:00-12:00|14:00-18:00",minLength:11,hidden:true},{name:"TimeOfDay_sat",fieldLabel:t("Sat"),value:"09:00-12:00",allowBlank:true,hidden:true},{name:"TimeOfDay_sun",fieldLabel:t("Sun"),value:"00:00",allowBlank:true,hidden:true},{xtype:"uploadfield",fieldLabel:t("workaudio"),emptyText:"Select an gsm File",allowBlank:true,name:"workaudio",extAllowed:["wav","gsm"],hidden:true},{xtype:"uploadfield",fieldLabel:t("noworkaudio"),emptyText:"Select an gsm File",allowBlank:true,name:"noworkaudio",extAllowed:["wav","gsm"],hidden:true}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["didform"],["component","box","container","panel","form","didform"],{component:true,box:true,container:true,panel:true,form:true,didform:true},["widget.didform"],0,[MBilling.view.did,"Form"],0));(Ext.cmd.derive("MBilling.view.did.ImportCsv",Ext.ux.window.ImportCsv,{htmlTipInfo:"
"+t("number")+", "+t("price")+" "+t("by")+" "+t("monthly")+", "+t("connection_charge")+"
551156332233, 10, 5
554153882200, 10, 5
554155667788, 10, 5
"+t("monthly")+" "+t("and")+" "+t("connection_charge")+" "+t("optional")+"",fieldsImport:[{fieldLabel:t("table"),hidden:true,allowBlank:true}]},0,["didimportcsv"],["component","box","container","panel","window","didimportcsv"],{component:true,box:true,container:true,panel:true,window:true,didimportcsv:true},["widget.didimportcsv"],0,[MBilling.view.did,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.didbuy.Module",Ext.form.Panel,{controller:"did",resizable:false,autoShow:true,header:false,initComponent:function(){var b=this;b.items=[{reference:"buydidPanel",xtype:"form",margin:"10 10 10 10",autoShow:true,closable:false,resizable:false,bodyPadding:10,defaultType:"textfield",defaults:{labelAlign:"right",labelWidth:175,width:280,allowBlank:false,msgTarget:"side",enableKeyEvents:true,plugins:"markallowblank",anchor:"100%"},items:[{xtype:"didbuycombo",fieldLabel:t("Select a Did"),name:"did"}],bbar:[{text:t("Next"),tooltip:t("Next"),glyph:icons.disk,handler:"onBuyDid"}]}];Ext.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["didbuymodule"],["component","box","container","panel","form","didbuymodule"],{component:true,box:true,container:true,panel:true,form:true,didbuymodule:true},["widget.didbuymodule"],0,[MBilling.view.didbuy,"Module"],0));(Ext.cmd.derive("MBilling.view.diddestination.Controller",Ext.ux.app.ViewController,{init:function(){var b=this;b.control({didtypefullcombo:{select:b.onSelectMethod},didtypefreecombo:{select:b.onSelectMethod}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectMethod:function(c,d){this.showFieldsRelated(d.getData().showFields)},showFieldsRelated:function(f){var d=this,e=d.formPanel.getForm().getFields();e.each(function(a){a.setVisible(f.indexOf(a.name)!==-1)})},onEdit:function(){var f=this,d=f.formPanel.getForm(),e=f.list.getSelectionModel().getSelection()[0];method=e?e.get("voip_call"):"sipcall";switch(method){case 0:method=t("callforpstn");break;case 1:method=t("sipcall");break;case 2:method=t("ivr");break;case 3:method="CallingCard";break;case 4:method=t("portalDeVoz");break;case 5:method=t("CID Callback");break;case 6:method=t("0800 Callback");break;case 7:method=t("Queue");break;case 8:method=t("Call Group");break;case 9:method=t("Custom");break}showFields=f.formPanel.down("didtypefullcombo").store.findRecord("name",method).getData().showFields;f.showFieldsRelated(showFields);d.findField("id_did").setReadOnly(true);Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)},onNew:function(){var f=this,d=f.formPanel.getForm(),e=f.list.getSelectionModel().getSelection()[0];d.findField("id_did").setReadOnly(false);method=t("sipcall");showFields=f.formPanel.down("didtypefullcombo").store.findRecord("name",method).getData().showFields;f.showFieldsRelated(showFields);Ext.ux.app.ViewController.prototype.onNew.apply(this,arguments)}},0,0,0,0,["controller.diddestination"],0,[MBilling.view.diddestination,"Controller"],0));(Ext.cmd.derive("MBilling.view.diddestination.Module",Ext.ux.panel.Module,{controller:"diddestination"},0,["diddestinationmodule"],["component","box","container","uxpanelmodule","diddestinationmodule"],{component:true,box:true,container:true,uxpanelmodule:true,diddestinationmodule:true},["widget.diddestinationmodule"],0,[MBilling.view.diddestination,"Module"],0));(Ext.cmd.derive("MBilling.view.diddestination.List",Ext.ux.grid.Panel,{store:"Diddestination",fieldSearch:"idDid.did",initComponent:function(){var b=this;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("did"),dataIndex:"idDiddid",filter:{type:"string",field:"idDid.did"},flex:5},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("type")+" "+t("of")+" "+t("call"),dataIndex:"voip_call",renderer:Helper.Util.formatDidType,comboRelated:"didtypecombo",flex:3,filter:{type:"list",options:[[0,t("callforpstn")],[1,t("sipcall")],[2,t("ivr")],[3,t("callingcard")],[4,t("portalDeVoz")],[5,t("CID Callback")],[6,t("0800 Callback")],[7,t("Queue")],[8,t("Call Group")],[9,t("Custom")]]}},{header:t("secondusedreal"),renderer:Helper.Util.formatsecondsToTime,dataIndex:"secondusedreal",flex:3},{header:t("creationdate"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"creationdate",flex:5}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["diddestinationlist"],["component","box","container","panel","tablepanel","gridpanel","grid","diddestinationlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,diddestinationlist:true},["widget.diddestinationlist"],0,[MBilling.view.diddestination,"List"],0));(Ext.cmd.derive("MBilling.view.diddestination.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["id_user","id_did"],initComponent:function(){var b=this;b.items=[{name:"id_did",fieldLabel:t("DID"),xtype:"didcombo"},{xtype:"userlookup",ownerForm:b,hidden:true,allowBlank:App.user.isClient},{xtype:"booleancombo",name:"activated",fieldLabel:t("status"),allowBlank:false},{xtype:"numbercombo",name:"priority",fieldLabel:t("priority"),allowBlank:true},{style:"margin-top:25px",xtype:"fieldset",title:t("Did Destination"),collapsible:true,collapsed:false,defaults:{labelWidth:75,anchor:"100%",labelAlign:b.labelAlignFields},items:[{xtype:"didtypefullcombo",name:"voip_call",fieldLabel:t("type")+" "+t("of")+" "+t("call")},{xtype:"textfield",name:"destination",fieldLabel:t("Destination"),value:"",allowBlank:true,hidden:App.user.isClient||App.user.isAgent},{xtype:"ivrlookup",ownerForm:b,name:"id_ivr",fieldLabel:t("IVR"),allowBlank:true},{xtype:"queuelookup",ownerForm:b,name:"id_queue",fieldLabel:t("Queue"),allowBlank:true},{xtype:"siplookup",ownerForm:b,name:"id_sip",fieldLabel:t("SIP"),allowBlank:true}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["diddestinationform"],["component","box","container","panel","form","diddestinationform"],{component:true,box:true,container:true,panel:true,form:true,diddestinationform:true},["widget.diddestinationform"],0,[MBilling.view.diddestination,"Form"],0));(Ext.cmd.derive("MBilling.view.diddestination.Combo",Ext.form.field.ComboBox,{fieldLabel:t("typepaid"),displayField:"name",valueField:"id",forceSelection:true,editable:false,value:1,store:{fields:["id","name"],data:[{id:"0",name:t("callforpstn"),showFields:["voip_call","destination","id_did","id_user","activated"]},{id:"1",name:t("sipcall"),showFields:["voip_call","id_sip","id_did","id_user","activated","priority"]},{id:"2",name:t("ivr"),showFields:["voip_call","id_did","id_ivr","id_user","activated"]},{id:"3",name:"CallingCard",showFields:["voip_call","id_did","id_user","activated"]},{id:"4",name:t("portalDeVoz"),showFields:["voip_call","id_did","id_user","activated"]},{id:"5",name:t("CID Callback"),showFields:["voip_call","id_did","id_user","activated"]},{id:"6",name:t("0800 Callback"),showFields:["voip_call","id_did","id_user","activated"]},{id:"7",name:t("Queue"),showFields:["voip_call","id_did","id_queue","id_user","activated"]},{id:"8",name:t("Call Group"),showFields:["voip_call","destination","id_did","id_user","activated"]},{id:"9",name:t("Custom"),showFields:["voip_call","destination","id_did","id_user","activated"]}]}},0,["didtypefullcombo"],["component","box","field","textfield","pickerfield","combobox","combo","didtypefullcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,didtypefullcombo:true},["widget.didtypefullcombo"],0,[MBilling.view.diddestination,"Combo"],0));(Ext.cmd.derive("MBilling.view.diddestination.freeCombo",Ext.form.field.ComboBox,{fieldLabel:t("typepaid"),displayField:"name",forceSelection:true,editable:false,valueField:"id",value:1,store:{fields:["id","name"],data:[{id:"0",name:t("callforpstn"),showFields:["voip_call","id_did","destination","id_user","activated"]},{id:"1",name:t("sipcall"),showFields:["voip_call","id_did","id_sip","id_user","activated","priority"]},{id:"2",name:t("ivr"),showFields:["voip_call","id_did","id_ivr","id_user"]},{id:"3",name:"CallingCard",showFields:["voip_call","id_did","id_user"]},{id:"4",name:t("portalDeVoz"),showFields:["voip_call","id_did","id_user"]}]}},0,["didtypefreecombo"],["component","box","field","textfield","pickerfield","combobox","combo","didtypefreecombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,didtypefreecombo:true},["widget.didtypefreecombo"],0,[MBilling.view.diddestination,"freeCombo"],0));(Ext.cmd.derive("MBilling.view.didUse.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.diduse"],0,[MBilling.view.didUse,"Controller"],0));(Ext.cmd.derive("MBilling.view.didUse.Module",Ext.ux.panel.Module,{controller:"diduse"},0,["didusemodule"],["component","box","container","uxpanelmodule","didusemodule"],{component:true,box:true,container:true,uxpanelmodule:true,didusemodule:true},["widget.didusemodule"],0,[MBilling.view.didUse,"Module"],0));(Ext.cmd.derive("MBilling.view.didUse.List",Ext.ux.grid.Panel,{store:"DidUse",initComponent:function(){var b=this;b.buttonCsv=false;b.allowPrint=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("did"),dataIndex:"idDiddid",flex:5},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("monthpayed"),dataIndex:"month_payed",flex:2},{header:t("reservationdate"),renderer:Helper.Util.formatDateTime,dataIndex:"reservationdate",flex:5},{header:t("releasedate"),renderer:Helper.Util.formatDateTime,dataIndex:"releasedate",flex:5}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["diduselist"],["component","box","container","panel","tablepanel","gridpanel","grid","diduselist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,diduselist:true},["widget.diduselist"],0,[MBilling.view.didUse,"List"],0));(Ext.cmd.derive("MBilling.view.didUse.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,readOnly:true},{xtype:"didcombo",readOnly:true},{xtype:"datefield",name:"reservationdate",fieldLabel:t("reservationdate"),format:"Y-m-d H:i:s"}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["diduseform"],["component","box","container","panel","form","diduseform"],{component:true,box:true,container:true,panel:true,form:true,diduseform:true},["widget.diduseform"],0,[MBilling.view.didUse,"Form"],0));(Ext.cmd.derive("MBilling.view.dashboard.Module",Ext.panel.Panel,{autoShow:true,header:false,initComponent:function(){var b=this;width=window.isTablet?Ext.Element.getViewportWidth()-240:Ext.Element.getViewportWidth()-220;showDid=showBuy=false;if(!App.user.isAdmin){Ext.each(App.user.menu,function(a){if(!Ext.isEmpty(a.rows)){Ext.each(a.rows,function(d){if(d.module=="didbuy"){showDid=true}if(d.module=="buycredit"){showBuy=true}},b)}},b)}widthView=Ext.Element.getViewportWidth()-430;heightView=Ext.Element.getViewportHeight()-137;heightViewFace=heightView+23;facebookhtml='
';if(!App.user.isAdmin&&App.user.social_media_network.length>10){facebookhtml='
'}if(window.customDashboard&&!App.user.isAdmin){b.items=[{header:false,bodyPadding:0,style:"background-color:transparent;",bodyStyle:"background-color:transparent !important;",html:'
',collapseDirection:"bottom",collapsible:true,autoScroll:true,height:Ext.Element.getViewportHeight()}]}else{b.items=[{width:!window.isDesktop?width:"NULL",header:false,xtype:"dashboard",listeners:{activate:"setRunnerInfoSystem"},glyph:icons.home,title:t("Home"),stateful:false,items:[{columnWidth:App.user.isAdmin?1/2:1,items:[{title:t("callonline"),items:{xtype:"callonlinelist2"},hidden:window.isTablet||!App.user.isAdmin,height:App.user.isClient?250:300},{title:t("Simultaneous Call"),items:{xtype:"callonlinechartchart"},hidden:window.isTablet||!App.user.isAdmin,iconCls:"icon-chart-column",glyph:undefined}]},{hidden:App.user.isAdmin,columnWidth:App.user.isClient?1/2:1,items:[{title:t("BuyCredit"),items:{xtype:"buycreditmodule"},height:window.isTablet?250:170,hidden:!showBuy}]},{hidden:App.user.isAdmin,columnWidth:1/2,items:[{title:t("Buy")+" "+t("did"),items:{xtype:"didbuymodule"},height:window.isTablet?250:170,hidden:!showDid||!App.user.isClient},{iconCls:"icon-info",title:t("NEWS"),bodyPadding:0,style:"background-color:transparent;",bodyStyle:"background-color:transparent !important;",hidden:App.user.isAdmin||App.user.social_media_network.length<=10,html:facebookhtml,collapseDirection:"bottom",collapsible:true,autoScroll:true,height:300}]},{columnWidth:1/2,items:[{iconCls:"icon-info",title:t("NEWS"),bodyPadding:0,style:"background-color:transparent;",bodyStyle:"background-color:transparent !important;",hidden:!App.user.isAdmin||window.isTablet||window.isTablets||App.user.l.slice(4,7)=="syn",html:facebookhtml,collapseDirection:"bottom",collapsible:true,autoScroll:true,height:300},{title:t("Refill Summary"),iconCls:"icon-chart-column",glyph:undefined,items:{xtype:"refillchart"},hidden:!App.user.isAdmin||window.isTablet}]}]}]}Ext.panel.Panel.prototype.initComponent.apply(this,arguments)}},0,["dashboardmodule"],["component","box","container","panel","dashboardmodule"],{component:true,box:true,container:true,panel:true,dashboardmodule:true},["widget.dashboardmodule"],0,[MBilling.view.dashboard,"Module"],0));(Ext.cmd.derive("MBilling.view.dashboardQueue.Module",Ext.panel.Panel,{autoShow:true,header:false,initComponent:function(){var b=this;b.items=[{width:!window.isDesktop?width:"NULL",header:false,xtype:"dashboard",listeners:{activate:"setRunnerInfoSystem"},glyph:icons.home,title:t("Home"),stateful:false,items:[{columnWidth:1/2,items:[{title:t("Queue Monitor"),items:{xtype:"queuedashboardlist"},height:window.heightView}]},{columnWidth:1/2,items:[{title:t("Agent Monitor"),iconCls:"icon-chart-column",glyph:undefined,items:{xtype:"queuememberdashboardlist"},height:window.heightView}]}]}];Ext.panel.Panel.prototype.initComponent.apply(this,arguments)}},0,["dashboardqueuemodule"],["component","box","container","panel","dashboardqueuemodule"],{component:true,box:true,container:true,panel:true,dashboardqueuemodule:true},["widget.dashboardqueuemodule"],0,[MBilling.view.dashboardQueue,"Module"],0));(Ext.cmd.derive("MBilling.view.ivr.Controller",Ext.ux.app.ViewController,{isSubmitForm:true,init:function(){var b=this;b.control({typedestinationcombo:{select:b.onSelectMethod}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectMethod:function(c,d){this.showFieldsRelated(d.getData().showFields)},showFieldsRelated:function(l){var m=this,n=m.formPanel.getForm(),j=m.formPanel.getForm().getFields(),g=Ext.get(Ext.Element.getActiveElement()).component,o=g.name.substr(-2);m.onSetVisibleFiel(g,n,o,g.value)},onSetVisibleFiel:function(f,j,e,g){if(f.value=="undefined"){f.setValue("undefined")}if(f.name.match("^type_10")){j.findField("id_queue_10").setVisible(g.match("^queue"));j.findField("id_sip_10").setVisible(g.match("^sip"));j.findField("id_ivr_10").setVisible(g.match("^ivr"));j.findField("extension_10").setVisible(g.match("^group|^number|^custom"))}else{if(f.name.match("^type_[0-9]")){j.findField("id_queue"+e).setVisible(g.match("^queue"));j.findField("id_sip"+e).setVisible(g.match("^sip"));j.findField("id_ivr"+e).setVisible(g.match("^ivr"));j.findField("extension"+e).setVisible(g.match("^group|^number|^custom"))}else{if(f.name.match("^type_out_10")){j.findField("id_queue_out_10").setVisible(g.match("^queue"));j.findField("id_ivr_out_10").setVisible(g.match("^ivr"));j.findField("id_sip_out_10").setVisible(g.match("^sip"));j.findField("extension_out_10").setVisible(g.match("^group|^number|^custom"))}else{j.findField("id_queue_out"+e).setVisible(g.match("^queue"));j.findField("id_sip_out"+e).setVisible(g.match("^sip"));j.findField("id_ivr_out"+e).setVisible(g.match("^ivr"));j.findField("extension_out"+e).setVisible(g.match("^group|^number|^custom"))}}}},onEdit:function(){var g=this,j=g.formPanel.getForm(),f=g.list.getSelectionModel().getSelection()[0];for(var e=0;e<=10;e++){fieldValue=f.getData()["type_"+e];fieldValueOut=f.getData()["type_out_"+e];if(fieldValue=="ivr"){j.findField("id_ivr_"+e).setVisible(true);j.findField("id_sip_"+e).setVisible(false);j.findField("id_queue_"+e).setVisible(false);j.findField("extension_"+e).setVisible(false)}else{if(fieldValue=="sip"){j.findField("id_sip_"+e).setVisible(true);j.findField("id_ivr_"+e).setVisible(false);j.findField("id_queue_"+e).setVisible(false);j.findField("extension_"+e).setVisible(false)}else{if(fieldValue=="queue"){j.findField("id_queue_"+e).setVisible(true);j.findField("id_sip_"+e).setVisible(false);j.findField("id_ivr_"+e).setVisible(false);j.findField("extension_"+e).setVisible(false)}else{if(fieldValue.match("custom|number|group")){j.findField("extension_"+e).setVisible(true);j.findField("id_ivr_"+e).setVisible(false);j.findField("id_sip_"+e).setVisible(false);j.findField("id_queue_"+e).setVisible(false)}else{j.findField("id_queue_"+e).setVisible(false);j.findField("id_sip_"+e).setVisible(false);j.findField("id_ivr_"+e).setVisible(false);j.findField("extension_"+e).setVisible(false)}}}}if(fieldValueOut=="ivr"){j.findField("id_ivr_out_"+e).setVisible(true);j.findField("id_sip_out_"+e).setVisible(false);j.findField("id_queue_out_"+e).setVisible(false);j.findField("extension_out_"+e).setVisible(false)}else{if(fieldValueOut=="sip"){j.findField("id_sip_out_"+e).setVisible(true);j.findField("id_ivr_out_"+e).setVisible(false);j.findField("id_queue_out_"+e).setVisible(false);j.findField("extension_out_"+e).setVisible(false)}else{if(fieldValueOut=="queue"){j.findField("id_queue_out_"+e).setVisible(true);j.findField("id_sip_out_"+e).setVisible(false);j.findField("id_ivr_out_"+e).setVisible(false);j.findField("extension_out_"+e).setVisible(false)}else{if(fieldValueOut.match("custom|number|group")){j.findField("extension_out_"+e).setVisible(true);j.findField("id_ivr_out_"+e).setVisible(false);j.findField("id_sip_out_"+e).setVisible(false);j.findField("id_queue_out_"+e).setVisible(false)}else{j.findField("id_queue_out_"+e).setVisible(false);j.findField("id_sip_out_"+e).setVisible(false);j.findField("id_ivr_out_"+e).setVisible(false);j.findField("extension_out_"+e).setVisible(false)}}}}}Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)},onNew:function(){var g=this,j=g.formPanel.getForm(),f=g.list.getSelectionModel().getSelection()[0];for(var e=0;e<=10;e++){j.findField("id_ivr_"+e).setVisible(false);j.findField("id_sip_"+e).setVisible(false);j.findField("id_queue_"+e).setVisible(false);j.findField("id_ivr_out_"+e).setVisible(false);j.findField("id_sip_out_"+e).setVisible(false);j.findField("id_queue_out_"+e).setVisible(false)}Ext.ux.app.ViewController.prototype.onNew.apply(this,arguments)}},0,0,0,0,["controller.ivr"],0,[MBilling.view.ivr,"Controller"],0));(Ext.cmd.derive("MBilling.view.ivr.Module",Ext.ux.panel.Module,{controller:"ivr"},0,["ivrmodule"],["component","box","container","uxpanelmodule","ivrmodule"],{component:true,box:true,container:true,uxpanelmodule:true,ivrmodule:true},["widget.ivrmodule"],0,[MBilling.view.ivr,"Module"],0));(Ext.cmd.derive("MBilling.view.ivr.List",Ext.ux.grid.Panel,{store:"Ivr",initComponent:function(){var b=this;b.allowPrint=false;b.buttonCsv=false;b.columns=b.columns||[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("name"),dataIndex:"name",flex:5},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["ivrlist"],["component","box","container","panel","tablepanel","gridpanel","grid","ivrlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,ivrlist:true},["widget.ivrlist"],0,[MBilling.view.ivr,"List"],0));(Ext.cmd.derive("MBilling.view.ivr.Form",Ext.ux.form.Panel,{bodyPadding:0,fileUpload:true,initComponent:function(){var b=this;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{plugins:"markallowblank",allowBlank:false,anchor:"100%",labelAlign:"right"}},items:[{title:t("general"),items:[{name:"name",fieldLabel:t("name")},{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"monFriStart",fieldLabel:t("monFriStart"),value:"09:00",maxLength:5,minLength:5},{name:"monFriStop",fieldLabel:t("monFriStop"),value:"18:00",maxLength:5,minLength:5},{name:"satStart",fieldLabel:t("satStart"),value:"09:00",maxLength:5,minLength:5},{name:"satStop",fieldLabel:t("satStop"),value:"12:00",maxLength:5,minLength:5},{name:"sunStart",fieldLabel:t("sunStart"),value:"09:00",maxLength:5,minLength:5},{name:"sunStop",fieldLabel:t("sunStop"),value:"12:00",maxLength:5,minLength:5},{xtype:"uploadfield",fieldLabel:t("workaudio"),emptyText:"Select an wav or gsm File",allowBlank:true,name:"workaudio",labelWidth:120,extAllowed:["wav","gsm"]},{xtype:"uploadfield",fieldLabel:t("noworkaudio"),emptyText:"Select an wav or gsm File",allowBlank:true,labelWidth:120,name:"noworkaudio",extAllowed:["wav","gsm"]}]},{title:t("options")+" "+t("work"),itemId:"option",defaults:{xtype:"fieldcontainer",layout:"hbox",plugins:"markallowblank",allowBlank:true,anchor:"100%",labelWidth:100,defaults:{hideLabel:true,hidden:true,flex:5,startX:100,allowBlank:true,ownerForm:b}},items:[{xtype:"menuseparator",width:"100%"},{labelStyle:"font-weight:bold",xtype:"displayfield",value:''+t("Select the destination to send call when caller press any digits.")+"",allowBlank:true},{xtype:"menuseparator",width:"100%"},{fieldLabel:t("option")+" 0",items:[{name:"type_0",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_0",displayField:"id_ivr_0_name"},{xtype:"queuelookup",name:"id_queue_0",displayField:"id_queue_0_name"},{xtype:"siplookup",name:"id_sip_0",displayField:"id_sip_0_name"},{xtype:"textfield",name:"extension_0"}]},{fieldLabel:t("option")+" 1",items:[{name:"type_1",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_1",displayField:"id_ivr_1_name"},{xtype:"queuelookup",name:"id_queue_1",displayField:"id_queue_1_name"},{xtype:"siplookup",name:"id_sip_1",displayField:"id_sip_1_name"},{xtype:"textfield",name:"extension_1"}]},{fieldLabel:t("option")+" 2",items:[{name:"type_2",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_2",displayField:"id_ivr_2_name"},{xtype:"queuelookup",name:"id_queue_2",displayField:"id_queue_2_name"},{xtype:"siplookup",name:"id_sip_2",displayField:"id_sip_2_name"},{xtype:"textfield",name:"extension_2"}]},{fieldLabel:t("option")+" 3",items:[{name:"type_3",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_3",displayField:"id_ivr_3_name"},{xtype:"queuelookup",name:"id_queue_3",displayField:"id_queue_3_name"},{xtype:"siplookup",name:"id_sip_3",displayField:"id_sip_3_name"},{xtype:"textfield",name:"extension_3"}]},{fieldLabel:t("option")+" 4",items:[{name:"type_4",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_4",displayField:"id_ivr_4_name"},{xtype:"queuelookup",name:"id_queue_4",displayField:"id_queue_4_name"},{xtype:"siplookup",name:"id_sip_4",displayField:"id_sip_4_name"},{xtype:"textfield",name:"extension_4"}]},{fieldLabel:t("option")+" 5",items:[{name:"type_5",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_5",displayField:"id_ivr_5_name"},{xtype:"queuelookup",name:"id_queue_5",displayField:"id_queue_5_name"},{xtype:"siplookup",name:"id_sip_5",displayField:"id_sip_5_name"},{xtype:"textfield",name:"extension_5"}]},{fieldLabel:t("option")+" 6",items:[{name:"type_6",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_6",displayField:"id_ivr_6_name"},{xtype:"queuelookup",name:"id_queue_6",displayField:"id_queue_6_name"},{xtype:"siplookup",name:"id_sip_6",displayField:"id_sip_6_name"},{xtype:"textfield",name:"extension_6"}]},{fieldLabel:t("option")+" 7",items:[{name:"type_7",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_7",displayField:"id_ivr_7_name"},{xtype:"queuelookup",name:"id_queue_7",displayField:"id_queue_7_name"},{xtype:"siplookup",name:"id_sip_7",displayField:"id_sip_7_name"},{xtype:"textfield",name:"extension_7"}]},{fieldLabel:t("option")+" 8",items:[{name:"type_8",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_8",displayField:"id_ivr_8_name"},{xtype:"queuelookup",name:"id_queue_8",displayField:"id_queue_8_name"},{xtype:"siplookup",name:"id_sip_8",displayField:"id_sip_8_name"},{xtype:"textfield",name:"extension_8"}]},{fieldLabel:t("option")+" 9",items:[{name:"type_9",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_9",displayField:"id_ivr_9_name"},{xtype:"queuelookup",name:"id_queue_9",displayField:"id_queue_9_name"},{xtype:"siplookup",name:"id_sip_9",displayField:"id_sip_9_name"},{xtype:"textfield",name:"extension_9"}]},{fieldLabel:t("option")+" default",items:[{name:"type_10",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_10",displayField:"id_ivr_10_name"},{xtype:"queuelookup",name:"id_queue_10",displayField:"id_queue_10_name"},{xtype:"siplookup",name:"id_sip_10",displayField:"id_sip_10_name"},{xtype:"textfield",name:"extension_10"}]},{fieldLabel:t("Direct extension"),hidden:!window.didChannelLimit,name:"direct_extension",xtype:"noyescombo"}]},{title:t("options")+" "+t("not")+" "+t("work"),itemId:"optionOut",defaults:{xtype:"fieldcontainer",layout:"hbox",plugins:"markallowblank",allowBlank:true,anchor:"100%",labelWidth:100,defaults:{hideLabel:true,hidden:true,flex:5,startX:100,allowBlank:true,ownerForm:b}},items:[{xtype:"menuseparator",width:"100%"},{labelStyle:"font-weight:bold",xtype:"displayfield",value:''+t("Select the destination to send call when caller press any digits.")+"",allowBlank:true},{xtype:"menuseparator",width:"100%"},{fieldLabel:t("option")+" 0",items:[{name:"type_out_0",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_0",displayField:"id_ivr_out_0_name"},{xtype:"queuelookup",name:"id_queue_out_0",displayField:"id_queue_out_0_name"},{xtype:"siplookup",name:"id_sip_out_0",displayField:"id_sip_out_0_name"},{xtype:"textfield",name:"extension_out_0"}]},{fieldLabel:t("option")+" 1",items:[{name:"type_out_1",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_1",displayField:"id_ivr_out_1_name"},{xtype:"queuelookup",name:"id_queue_out_1",displayField:"id_queue_out_1_name"},{xtype:"siplookup",name:"id_sip_out_1",displayField:"id_sip_out_1_name"},{xtype:"textfield",name:"extension_out_1"}]},{fieldLabel:t("option")+" 2",items:[{name:"type_out_2",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_2",displayField:"id_ivr_out_2_name"},{xtype:"queuelookup",name:"id_queue_out_2",displayField:"id_queue_out_2_name"},{xtype:"siplookup",name:"id_sip_out_2",displayField:"id_sip_out_2_name"},{xtype:"textfield",name:"extension_out_2"}]},{fieldLabel:t("option")+" 3",items:[{name:"type_out_3",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_3",displayField:"id_ivr_out_3_name"},{xtype:"queuelookup",name:"id_queue_out_3",displayField:"id_queue_out_3_name"},{xtype:"siplookup",name:"id_sip_out_3",displayField:"id_sip_out_3_name"},{xtype:"textfield",name:"extension_out_3"}]},{fieldLabel:t("option")+" 4",items:[{name:"type_out_4",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_4",displayField:"id_ivr_out_4_name"},{xtype:"queuelookup",name:"id_queue_out_4",displayField:"id_queue_out_4_name"},{xtype:"siplookup",name:"id_sip_out_4",displayField:"id_sip_out_4_name"},{xtype:"textfield",name:"extension_out_4"}]},{fieldLabel:t("option")+" 5",items:[{name:"type_out_5",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_5",displayField:"id_ivr_out_5_name"},{xtype:"queuelookup",name:"id_queue_out_5",displayField:"id_queue_out_5_name"},{xtype:"siplookup",name:"id_sip_out_5",displayField:"id_sip_out_5_name"},{xtype:"textfield",name:"extension_out_5"}]},{fieldLabel:t("option")+" 6",items:[{name:"type_out_6",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_6",displayField:"id_ivr_out_6_name"},{xtype:"queuelookup",name:"id_queue_out_6",displayField:"id_queue_out_6_name"},{xtype:"siplookup",name:"id_sip_out_6",displayField:"id_sip_out_6_name"},{xtype:"textfield",name:"extension_out_6"}]},{fieldLabel:t("option")+" 7",items:[{name:"type_out_7",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_7",displayField:"id_ivr_out_7_name"},{xtype:"queuelookup",name:"id_queue_out_7",displayField:"id_queue_out_7_name"},{xtype:"siplookup",name:"id_sip_out_7",displayField:"id_sip_out_7_name"},{xtype:"textfield",name:"extension_out_7"}]},{fieldLabel:t("option")+" 8",items:[{name:"type_out_8",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_8",displayField:"id_ivr_out_8_name"},{xtype:"queuelookup",name:"id_queue_out_8",displayField:"id_queue_out_8_name"},{xtype:"siplookup",name:"id_sip_out_8",displayField:"id_sip_out_8_name"},{xtype:"textfield",name:"extension_out_8"}]},{fieldLabel:t("option")+" 9",items:[{name:"type_out_9",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_9",displayField:"id_ivr_out_9_name"},{xtype:"queuelookup",name:"id_queue_out_9",displayField:"id_queue_out_9_name"},{xtype:"siplookup",name:"id_sip_out_9",displayField:"id_sip_out_9_name"},{xtype:"textfield",name:"extension_out_9"}]},{fieldLabel:t("option")+" default",items:[{name:"type_out_10",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_10",displayField:"id_ivr_out_10_name"},{xtype:"queuelookup",name:"id_queue_out_10",displayField:"id_queue_out_10_name"},{xtype:"siplookup",name:"id_sip_out_10",displayField:"id_sip_out_10_name"},{xtype:"textfield",name:"extension_out_10"}]}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["ivrform"],["component","box","container","panel","form","ivrform"],{component:true,box:true,container:true,panel:true,form:true,ivrform:true},["widget.ivrform"],0,[MBilling.view.ivr,"Form"],0));(Ext.cmd.derive("MBilling.view.ivr.Lookup",Ext.ux.form.field.Lookup,{name:"id_ivr",fieldLabel:t("Ivr"),displayField:"idIvrname",displayFieldList:"name",gridConfig:{xtype:"ivrlist",fieldSearch:"name",columns:[{header:t("name"),dataIndex:"name",flex:5},{header:t("user"),dataIndex:"idUsernumber",filter:{type:"string",field:"idUser.username"},flex:4}]}},0,["ivrlookup"],["component","box","container","fieldcontainer","ivrlookup"],{component:true,box:true,container:true,fieldcontainer:true,ivrlookup:true},["widget.ivrlookup"],0,[MBilling.view.ivr,"Lookup"],0));(Ext.cmd.derive("MBilling.view.queue.Controller",Ext.ux.app.ViewController,{isSubmitForm:true,init:function(){var b=this;b.control({"combobox[name=ring_or_moh]":{select:b.onSelectringOrMOH}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectringOrMOH:function(c,d){me=this,form=me.formPanel.getForm();form.findField("musiconhold").setVisible(d.data.field1=="moh")},onNew:function(){var b=this;b.formPanel.getForm().findField("musiconhold").setVisible(true);Ext.ux.app.ViewController.prototype.onNew.apply(this,arguments)},onEdit:function(){var b=this;Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments);ringOrMoh=b.formPanel.getForm().findField("ring_or_moh").getValue();b.formPanel.getForm().findField("musiconhold").setVisible(ringOrMoh=="moh")},onResetQueueStats:function(m){var j=this,f=j.list.getSelectionModel().getSelection()[0],l=Ext.encode(j.list.filters.getFilterData()),g=[];if(f){Ext.each(j.list.getSelectionModel().getSelection(),function(a){g.push(a.get(j.idProperty))});Ext.Ajax.request({url:"index.php/queue/resetQueueStats",params:{ids:Ext.encode(g),filter:l},scope:j,success:function(b){b=Ext.decode(b.responseText);if(b[j.nameSuccessRequest]){Ext.ux.Alert.alert(j.titleSuccess,b.msg,"success")}else{var a=Helper.Util.convertErrorsJsonToString(b[j.nameMsgRequest]);Ext.ux.Alert.alert(j.titleError,a,"notification")}}})}else{Ext.ux.Alert.alert(j.titleError,t("Please select one or more queue"),"notification")}},onDeleteMusic:function(e){var f=this,d=f.list.getSelectionModel().getSelection()[0];if(f.list.getSelectionModel().getSelection().length==1){Ext.Ajax.request({url:"index.php/queue/deleteMusicOnHold",params:{id_queue:d.get("id")},scope:f,success:function(a){a=Ext.decode(a.responseText);if(a[f.nameSuccessRequest]){Ext.ux.Alert.alert(f.titleSuccess,a[f.nameMsgRequest],"success")}else{Ext.ux.Alert.alert(f.titleError,a[f.nameMsgRequest],"error")}}})}else{Ext.ux.Alert.alert(f.titleError,"Please Select only a record","notification")}}},0,0,0,0,["controller.queue"],0,[MBilling.view.queue,"Controller"],0));(Ext.cmd.derive("MBilling.view.queue.Combo",Ext.form.field.ComboBox,{fieldLabel:t("status"),value:"ringall",forceSelection:true,editable:false,store:[["ringall",t("Ringall")+" - "+t("ring all available channels until one answers")],["rrmemory",t("Rrmemory")+" - "+t("round robin with memory, remember where we left off last ring pass")],["leastrecent",t("Leastrecent")+" - "+t("ring interface which was least recently called by this queue")],["fewestcalls",t("Fewestcalls")+" - "+t("ring the one with fewest completed calls from this queue")],["random",t("Random")+" -"+t("ring random interface")],["linear",t("Linear")+" - "+t("Rings interfaces in the order they are listed in the configuration file. Dynamic members will be rung in the order in which they were added")],["wrandom",t("Wrandom")+" -"+t("Rings a random interface, but uses the agent's penalty as a weight")]]},0,["queuestrategycombo"],["component","box","field","textfield","pickerfield","combobox","combo","queuestrategycombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,queuestrategycombo:true},["widget.queuestrategycombo"],0,[MBilling.view.queue,"Combo"],0));(Ext.cmd.derive("MBilling.view.queue.Module",Ext.ux.panel.Module,{controller:"queue"},0,["queuemodule"],["component","box","container","uxpanelmodule","queuemodule"],{component:true,box:true,container:true,uxpanelmodule:true,queuemodule:true},["widget.queuemodule"],0,[MBilling.view.queue,"Module"],0));(Ext.cmd.derive("MBilling.view.queue.List",Ext.ux.grid.Panel,{store:"Queue",initComponent:function(){var b=this;b.buttonCsv=false;b.allowPrint=false;b.buttonUpdateLot=false;b.extraButtons=[{text:t("Reset Queue Stats"),iconCls:"call",handler:"onResetQueueStats",disabled:false,hidden:!App.user.isAdmin},{text:t("Delete Musiconhold"),iconCls:"call",handler:"onDeleteMusic",disabled:false,hidden:!App.user.isAdmin}];b.columns=b.columns||[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("name"),dataIndex:"name",flex:4},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("Strategy"),dataIndex:"strategy",flex:4},{header:t("Talk Time"),dataIndex:"var_talktime",flex:3},{header:t("Total Calls"),dataIndex:"var_totalCalls",flex:3},{header:t("Answered"),dataIndex:"var_answeredCalls",flex:3}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["queuelist"],["component","box","container","panel","tablepanel","gridpanel","grid","queuelist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,queuelist:true},["widget.queuelist"],0,[MBilling.view.queue,"List"],0));(Ext.cmd.derive("MBilling.view.queue.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["id_user","name"],fileUpload:true,initComponent:function(){var b=this;b.labelWidthFields=160;b.items=[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"name",fieldLabel:t("name")},{xtype:"languagecombo",name:"language",value:App.user.language=="pt_BR"?"br":App.user.language,fieldLabel:t("language")},{xtype:"queuestrategycombo",name:"strategy",fieldLabel:t("Strategy")},{xtype:"yesnostringcombo",name:"ringinuse",fieldLabel:t("Ringinuse")},{xtype:"numberfield",name:"timeout",fieldLabel:t("Ring Agent per"),value:30},{xtype:"numberfield",name:"retry",fieldLabel:t("Retry other agent"),value:1},{xtype:"numberfield",name:"wrapuptime",fieldLabel:t("Time next calls"),value:1},{xtype:"numberfield",name:"weight",fieldLabel:t("Weigh"),value:0},{name:"periodic-announce",fieldLabel:t("Periodic announce"),value:"queue-periodic-announce"},{xtype:"numberfield",name:"periodic-announce-frequency",fieldLabel:t("Periodic frequency"),value:30},{xtype:"yesnostringcombo",name:"announce-position",fieldLabel:t("Announce position")},{xtype:"yesnostringcombo",name:"announce-holdtime",fieldLabel:t("Announce Holdtime")},{xtype:"numberfield",name:"announce-frequency",fieldLabel:t("Announce Frequency"),value:45},{xtype:"combobox",forceSelection:true,editable:false,value:"yes",store:[["no",t("No")],["yes",t("Yes")],["unavailable,invalid,unknown",t("unavailable,invalid,unknown")],["penalty,paused,invalid,unavailable",t("penalty,paused,invalid,unavailable")]],name:"joinempty",fieldLabel:t("Join empty")},{xtype:"combobox",forceSelection:true,editable:false,value:"no",store:[["no",t("No")],["yes",t("Yes")],["unavailable,invalid,unknown",t("unavailable,invalid,unknown")],["penalty,paused,invalid,unavailable",t("penalty,paused,invalid,unavailable")]],fieldLabel:t("Leave when empty"),name:"leavewhenempty"},{xtype:"combobox",forceSelection:true,editable:false,value:"moh",store:[["moh",t("MOH")],["ring",t("Ring")]],fieldLabel:t("Ring or playing MOH"),name:"ring_or_moh"},{xtype:"uploadfield",fieldLabel:t("Audio")+" "+t("musiconhold"),emptyText:t("Select an wav mono 8khz or gsm File"),allowBlank:true,name:"musiconhold",extAllowed:["wav","gsm"]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["queueform"],["component","box","container","panel","form","queueform"],{component:true,box:true,container:true,panel:true,form:true,queueform:true},["widget.queueform"],0,[MBilling.view.queue,"Form"],0));(Ext.cmd.derive("MBilling.view.queue.Lookup",Ext.ux.form.field.Lookup,{name:"id_queue",fieldLabel:t("Queue"),displayField:"idQueuename",displayFieldList:"name",gridConfig:{xtype:"queuelist",fieldSearch:"name",columns:[{header:t("name"),dataIndex:"name",flex:2}]}},0,["queuelookup"],["component","box","container","fieldcontainer","queuelookup"],{component:true,box:true,container:true,fieldcontainer:true,queuelookup:true},["widget.queuelookup"],0,[MBilling.view.queue,"Lookup"],0));(Ext.cmd.derive("MBilling.view.queue.ListDashboard",Ext.ux.grid.Panel,{store:"QueueDashBoard",refreshTime:5,selType:"rowmodel",initComponent:function(){var b=this;b.refreshTime=(localStorage&&localStorage.getItem("queuerefresh"))||b.refreshTime;b.extraButtons=[{text:t("Spy")+" "+t("call"),iconCls:"call",handler:function(a){module=b.getView();console.log(module.panel.items.items[0].getSelectionModel().getSelection());Ext.widget("callonlinespycall",{title:module.titleModule,list:module.panel.items.items[0]})},width:130,disabled:false,hidden:!window.multSpy},{xtype:"numberfield",field:"jmlhBrg",fieldLabel:t("Refresh Time"),editable:false,minValue:5,labelWidth:90,width:150,selectOnFocus:true,allowDecimals:true,decimalPrecision:2,value:b.refreshTime,listeners:{change:function(a){if(a.value>0){b.refreshTime=a.value;localStorage.setItem("queuerefresh",a.value)}}}}];b.columns=[{header:t("Channel"),hidden:true,dataIndex:"channel",flex:3},{header:t("Queue"),dataIndex:"queue_name",flex:3},{header:t("Agent"),dataIndex:"agentName",flex:3},{header:t("status"),dataIndex:"status",renderer:Helper.Util.formatQueueState,flex:4},{header:t("CallerID"),dataIndex:"callerId",flex:4},{header:t("Duration"),dataIndex:"duration",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Wait Time"),dataIndex:"holdtime",renderer:Helper.Util.formatsecondsToTime,flex:3}];b.sessionLoad=Ext.create("Ext.util.DelayedTask",function(){b.store.load()},b);Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments);b.store.on("load",b.onLoadStore,b)},onLoadStore:function(){var b=this;b.onDeactivateModule();b.onActivateModule()},onRender:function(){var b=this;if(Ext.isObject(b.module)){b.module.on("activate",b.onActivateModule,b);b.module.on("deactivate",b.onDeactivateModule,b);b.module.on("close",b.onCloseModule,b)}Ext.ux.grid.Panel.prototype.onRender.apply(this,arguments)},onActivateModule:function(){this.sessionLoad&&this.sessionLoad.delay(this.refreshTime*1000)},onDeactivateModule:function(){this.sessionLoad&&this.sessionLoad.cancel()},onCloseModule:function(){this.onDeactivateModule();this.sessionLoad=null}},0,["queuedashboardlist"],["component","box","container","panel","tablepanel","gridpanel","grid","queuedashboardlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,queuedashboardlist:true},["widget.queuedashboardlist"],0,[MBilling.view.queue,"ListDashboard"],0));(Ext.cmd.derive("MBilling.view.queueMember.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.queuemember"],0,[MBilling.view.queueMember,"Controller"],0));(Ext.cmd.derive("MBilling.view.queueMember.Module",Ext.ux.panel.Module,{controller:"queuemember"},0,["queuemembermodule"],["component","box","container","uxpanelmodule","queuemembermodule"],{component:true,box:true,container:true,uxpanelmodule:true,queuemembermodule:true},["widget.queuemembermodule"],0,[MBilling.view.queueMember,"Module"],0));(Ext.cmd.derive("MBilling.view.queueMember.List",Ext.ux.grid.Panel,{store:"QueueMember",initComponent:function(){var b=this;b.columns=[{header:t("Uniqueid"),dataIndex:"uniqueid",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("destination"),dataIndex:"interface",flex:4},{header:t("queues"),dataIndex:"queue_name",flex:4},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("paused"),dataIndex:"paused",renderer:Helper.Util.formattyyesno,filter:{type:"list",options:[[0,t("no")],[1,t("yes")]]},flex:2}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["queuememberlist"],["component","box","container","panel","tablepanel","gridpanel","grid","queuememberlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,queuememberlist:true},["widget.queuememberlist"],0,[MBilling.view.queueMember,"List"],0));(Ext.cmd.derive("MBilling.view.queueMember.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["id_user","queue_name"],initComponent:function(){var b=this;b.items=[{xtype:"queuelookup",ownerForm:b,displayField:"queue_name",name:"queue_name",hidden:App.user.isClient,allowBlank:App.user.isClient},{xtype:"siplookup",ownerForm:b,name:"interface",displayField:"interface"},{xtype:"noyescombo",name:"paused",fieldLabel:t("paused"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["queuememberform"],["component","box","container","panel","form","queuememberform"],{component:true,box:true,container:true,panel:true,form:true,queuememberform:true},["widget.queuememberform"],0,[MBilling.view.queueMember,"Form"],0));(Ext.cmd.derive("MBilling.view.queueMember.ListDashboard",Ext.ux.grid.Panel,{store:"QueueMemberDashBoard",refreshTime:5,selType:"rowmodel",initComponent:function(){var b=this;b.refreshTime=(localStorage&&localStorage.getItem("queueagentrefresh"))||b.refreshTime;b.extraButtons=[{xtype:"numberfield",field:"jmlhBrg",fieldLabel:t("Refresh Time"),editable:false,minValue:5,labelWidth:90,width:150,selectOnFocus:true,allowDecimals:true,decimalPrecision:2,value:b.refreshTime,listeners:{change:function(a){if(a.value>0){b.refreshTime=a.value;localStorage.setItem("queueagentrefresh",a.value)}}}}];b.columns=[{header:t("Agent"),dataIndex:"agentName",flex:3},{header:t("Queue"),dataIndex:"idQueuename",flex:5},{header:t("Status"),dataIndex:"agentStatus",renderer:Helper.Util.formatQueueAgentState,flex:4},{header:t("Number"),dataIndex:"number",flex:4},{header:t("Calls"),dataIndex:"totalCalls",flex:2},{header:t("Last call"),dataIndex:"last_call",renderer:Helper.Util.formatsecondsToTime,flex:3}];b.sessionLoad=Ext.create("Ext.util.DelayedTask",function(){b.store.load()},b);Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments);if(window.isDesktop){b.store.load()}b.store.on("load",b.onLoadStore,b)},onLoadStore:function(){var b=this;b.onDeactivateModule();b.onActivateModule()},onRender:function(){var b=this;if(Ext.isObject(b.module)){b.module.on("activate",b.onActivateModule,b);b.module.on("deactivate",b.onDeactivateModule,b);b.module.on("close",b.onCloseModule,b)}Ext.ux.grid.Panel.prototype.onRender.apply(this,arguments)},onActivateModule:function(){this.sessionLoad&&this.sessionLoad.delay(this.refreshTime*1000)},onDeactivateModule:function(){this.sessionLoad&&this.sessionLoad.cancel()},onCloseModule:function(){this.onDeactivateModule();this.sessionLoad=null}},0,["queuememberdashboardlist"],["component","box","container","panel","tablepanel","gridpanel","grid","queuememberdashboardlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,queuememberdashboardlist:true},["widget.queuememberdashboardlist"],0,[MBilling.view.queueMember,"ListDashboard"],0));(Ext.cmd.derive("MBilling.view.refill.Controller",Ext.ux.app.ViewController,{aliasChart:"refillchart",onPrint:function(e){var f=this;if(App.user.isClient){var f=this,d=f.list.getSelectionModel().getSelection()[0];if(f.list.getSelectionModel().getSelection().length==1){console.log(d.data.description.indexOf("Send Credit "));if(d.data.description.indexOf("Send Credit ")!==-1){url="index.php/transferToMobile/printRefill/?id="+d.get("id");window.open(url)}else{Ext.ux.app.ViewController.prototype.onPrint.apply(this,arguments)}}else{Ext.ux.app.ViewController.prototype.onPrint.apply(this,arguments)}}else{Ext.ux.app.ViewController.prototype.onPrint.apply(this,arguments)}},onInvoice:function(e){var f=this;var f=this,d=f.list.getSelectionModel().getSelection()[0];if(f.list.getSelectionModel().getSelection().length==1){url="index.php/invoices/printInvoice/?id="+d.get("id");window.open(url)}else{Ext.ux.Alert.alert(f.titleError,t("Not available to multi refill."),"error")}},onSelectionChange:function(f,e){var j=this,g=j.lookupReference("invoice");g&&g.setDisabled(!e.length);Ext.ux.app.ViewController.prototype.onSelectionChange.apply(this,arguments)},onRenderModule:function(){var c=this,d=c.lookupReference("chart");Ext.ux.app.ViewController.prototype.onRenderModule.apply(this,arguments);if(App.user.isAdmin){c.store.on({scope:c,beforeload:function(){d.el&&d.disable()},load:function(a){d.el&&d.enable();c.onSetTotal()}})}else{c.store.on({scope:c,load:function(a){c.onSetTotal()}})}},onChart:function(){var b=this;b.chart=Ext.widget("window",{title:t("charts"),iconCls:"icon-chart-column",layout:"fit",autoShow:true,modal:true,resizable:false,width:window.isThemeNeptune?740:710,items:{xtype:b.aliasChart}});b.chart.down("#tbTextSum").setText(""+t("total")+": "+App.user.currency+" "+b.sumData.sumCredit+"")},onSetTotal:function(c){var d=this;if(!d.store.getData().items[0]){return}d.sumData=d.store.getData().items[0].getData();if(!d.sumData){return}d.lookupReference("tbTextTotal")&&d.lookupReference("tbTextTotal").setText(""+t("Refill Total")+": "+App.user.currency+" "+d.sumData.sumCredit+"")}},0,0,0,0,["controller.refill"],0,[MBilling.view.refill,"Controller"],0));(Ext.cmd.derive("MBilling.view.refill.Module",Ext.ux.panel.Module,{controller:"refill"},0,["refillmodule"],["component","box","container","uxpanelmodule","refillmodule"],{component:true,box:true,container:true,uxpanelmodule:true,refillmodule:true},["widget.refillmodule"],0,[MBilling.view.refill,"Module"],0));(Ext.cmd.derive("MBilling.view.refill.List",Ext.ux.grid.Panel,{store:"Refill",fieldSearch:"idUser.username",initComponent:function(){var b=this;b.buttonsTbar=[{xtype:"tbtext",reference:"tbTextTotal"}];if(App.user.isAdmin&&b.buttonCleanFilter){b.extraButtons=[{text:t("charts"),iconCls:"icon-chart-column",handler:"onChart",reference:"chart",disabled:true},{text:t("Invoice"),glyph:b.glyphPrint,handler:"onInvoice",reference:"invoice",hidden:!window.invoice,disabled:true}]}if(App.user.isClient){b.extraButtons=[{text:t("Invoice"),glyph:b.glyphPrint,handler:"onInvoice",reference:"invoice",hidden:!window.invoice,disabled:true}]}b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:3,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("credit"),dataIndex:"credit",renderer:Helper.Util.formatMoneyDecimal2,flex:2},{header:t("description"),dataIndex:"description",flex:5},{header:t("payment"),dataIndex:"payment",renderer:Helper.Util.formattyyesno,filter:{type:"list",options:[[0,t("no")],[1,t("yes")]]},flex:2},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"date",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["refilllist"],["component","box","container","panel","tablepanel","gridpanel","grid","refilllist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,refilllist:true},["widget.refilllist"],0,[MBilling.view.refill,"List"],0));(Ext.cmd.derive("MBilling.view.refill.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["id_user"],initComponent:function(){var b=this;b.items=[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient},{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,00",name:"credit",fieldLabel:t("credit"),readOnly:App.user.isClient},{xtype:"textareafield",name:"description",fieldLabel:t("description"),readOnly:App.user.isClient},{xtype:"yesnocombo",name:"payment",fieldLabel:t("add")+" "+t("payment"),hidden:App.user.isClient},{name:"invoice_number",fieldLabel:t("Invoice")+" "+t("number"),hidden:!window.invoice,allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["refillform"],["component","box","container","panel","form","refillform"],{component:true,box:true,container:true,panel:true,form:true,refillform:true},["widget.refillform"],0,[MBilling.view.refill,"Form"],0));(Ext.cmd.derive("Ext.ux.panel.Chart",Ext.panel.Panel,{rootData:undefined,positionLegendPie:"bottom",showLegendPie:true,widthTip:200,degressXLabel:0,fontLabel:"15px Arial",textBtnColumn:t("columns"),textBtnLine:t("lines"),textBtnBar:t("bars"),textBtnPie:t("pie"),iconBtnColumn:"icon-chart-column",iconBtnLine:"icon-chart-line",iconBtnBar:"icon-chart-bar",iconBtnPie:"icon-chart-pie",heightChart:400,charts:["column","bar","line","pie"],defaultChart:"column",limitCharLabelTip:25,bbarChart:[],tbarChart:[],minimumAxesY:0,border:false,layout:"card",btnShowColumn:true,btnShowBar:true,btnShowLine:true,btnShowPie:true,btnShowLineHidden:false,btnShowColumnHidden:false,showDownload:true,legend:null,titleText:"",fieldLabel:"",constructor:function(){var b=this;if(Ext.isString(b.store)){b.store=Ext.data.StoreManager.lookup(b.store);b.store.load({scope:b,callback:function(){if(b.store.getData().items[0]){b.sumData=b.store.getData().items[0].getData()}}})}Ext.panel.Panel.prototype.constructor.apply(this,arguments)},initComponent:function(){var s=this,x=s.charts.length,r,o,v,q,w=[],y=[],u=[],p,z;if(s.charts.length===1){s.defaultChart=s.charts[0]}s.fieldValue=Ext.isArray(s.fieldValue)?s.fieldValue:[s.fieldValue];if(s.rootData){p=Ext.getStore(s.store);z=p.model.proxy.reader.rawData;s.store=Ext.create("Ext.data.Store",{fields:Ext.Array.merge(s.fieldValue,s.fieldDescription),data:z&&z[s.rootData],proxy:{type:"memory",reader:{type:"json"}}});s.fieldValue=s.fieldValue[0].name||s.fieldValue[0];s.fieldDescription=s.fieldDescription.name||s.fieldDescription}Ext.each(s.fieldValue,function(a){u.push({type:"line",yField:a,xField:s.fieldDescription,marker:{radius:4},highlight:true,tooltip:{trackMouse:true,width:s.widthTip,renderer:s.rendererPie(s.fieldDescription,s.rendererFieldValue,s.rendererFieldDescription,s.limitCharLabelTip)}})});s.chartColumn={xtype:"cartesian",itemId:"column",height:s.heightChart,width:s.width,store:s.store,insetPadding:{top:s.titleText.length>0?40:10},axes:[{type:"numeric",title:s.labelYLine,position:"left",grid:true,minimum:s.minimumAxesY,renderer:s.rendererFieldValue||s.rendererDefault},{type:"category",title:s.labelXLine,position:"bottom",grid:true,renderer:s.rendererFieldDescription||s.rendererDefault,label:{rotate:{degrees:s.degressXLabel}}}],series:[{type:"bar",axis:"left",yField:s.fieldValue,xField:s.fieldDescription,highlight:true,tooltip:{width:s.widthTip,renderer:s.rendererPie(s.fieldDescription,s.rendererFieldValue,s.rendererFieldDescription,s.limitCharLabelTip)},label:{hidden:s.fieldLabel.length<1,field:s.fieldLabel,display:"insideEnd"}}],sprites:{hidden:s.titleText.length<1,type:"text",text:s.titleText,fontSize:22,width:100,height:30,x:40,y:20}};s.chartBar={xtype:"cartesian",itemId:"bar",height:s.heightChart,width:s.width,store:s.store,flipXY:true,insetPadding:{top:s.titleText.length>0?40:10},axes:[{type:"numeric",title:s.labelYLine,position:"bottom",fields:s.fieldValue,grid:true,minimum:s.minimumAxesY,renderer:s.rendererFieldValue||s.rendererDefault},{type:"category",title:s.labelXLine,position:"left",fields:s.fieldDescription,grid:true,renderer:s.rendererFieldDescription||s.rendererDefault}],series:[{type:"bar",yField:s.fieldValue,xField:s.fieldDescription,highlight:true,tooltip:{width:s.widthTip,renderer:s.rendererPie(s.fieldDescription,s.rendererFieldValue,s.rendererFieldDescription,s.limitCharLabelTip)},label:{hidden:s.fieldLabel.length<1,field:s.fieldLabel,display:"insideEnd"}}],sprites:{hidden:s.titleText.length<1,type:"text",text:s.titleText,fontSize:22,width:100,height:30,x:40,y:20}};s.chartLine={xtype:"cartesian",itemId:"line",height:s.heightChart,width:s.width,store:s.store,legend:s.legend,axes:[{type:"numeric",title:s.labelYLine,position:"left",fields:s.fieldValue,grid:true,minimum:s.minimumAxesY,renderer:s.rendererFieldValue||s.rendererDefault},{type:"category",title:s.labelXLine,position:"bottom",grid:true,fields:s.fieldDescription,renderer:s.rendererFieldDescription||s.rendererDefault}],series:u};s.chartPie={xtype:"polar",itemId:"pie",height:s.heightChart,width:s.width,store:s.store,legend:{position:s.positionLegendPie,renderer:s.rendererFieldDescription},series:[{type:"pie",angleField:s.fieldValue[0],showInLegend:s.showLegendPie,tooltip:{trackMouse:true,width:s.widthTip,renderer:s.rendererPie(s.fieldDescription,s.rendererFieldValue,s.rendererFieldDescription,s.limitCharLabelTip)},highlight:{segment:{margin:20}},label:{field:s.fieldDescription,display:"rotate",contrast:true,font:s.fontLabel,renderer:s.rendererFieldDescription||s.rendererDefault}}]};if(s.btnShowColumn){r={chart:"column",text:s.textBtnColumn,iconCls:s.iconBtnColumn,hidden:s.btnShowColumnHidden}}if(s.btnShowBar){o={chart:"bar",text:s.textBtnBar,iconCls:s.iconBtnBar}}if(s.btnShowLine){v={chart:"line",text:s.textBtnLine,iconCls:s.iconBtnLine,hidden:s.btnShowLineHidden}}if(s.btnShowPie){q={chart:"pie",text:s.textBtnPie,iconCls:s.iconBtnPie}}if(Ext.Array.contains(s.charts,"column")){w.push(s.chartColumn);y.push(r)}if(Ext.Array.contains(s.charts,"bar")){w.push(s.chartBar);y.push(o)}if(Ext.Array.contains(s.charts,"line")){w.push(s.chartLine);y.push(v)}if(Ext.Array.contains(s.charts,"pie")){w.push(s.chartPie);y.push(q)}s.bbarChart.push("->",{xtype:"buttongroup",toggleGroup:"typeChart",defaults:{enableToggle:true,allowDepress:false,toggleGroup:"typeChart",listeners:{scope:s,toggle:s.activeChart}},items:y});s.items=w;if(s.showDownload){s.tbarChart.push("->",{text:t("Download"),glyph:icons.disk,scope:s,handler:s.onDownload})}s.tbar=s.tbarChart;s.bbar=s.bbarChart;Ext.panel.Panel.prototype.initComponent.apply(this,arguments);s.activeItem=s.down("#"+s.defaultChart);s.down("button[chart="+s.defaultChart+"]").pressed=true},onDownload:function(){var b=this;b.getLayout().getActiveItem().download()},activeChart:function(d){var c=this;d.pressed&&c.getLayout().setActiveItem(c.down("#"+d.chart))},rendererPie:function(g,f,e,j){return function(a,o,c){var d=this,n=o.get(g),b=o.get(c.field);n=e?e(n):n;b=f?f(b):b;n=Ext.String.ellipsis(n,j)+": ";title=n+b;a.setHtml(title)}},rendererDefault:function(c,d){return d},rendererLegend:function(b){return t(b)}},1,["chartpanel"],["component","box","container","panel","chartpanel"],{component:true,box:true,container:true,panel:true,chartpanel:true},["widget.chartpanel"],0,[Ext.ux.panel,"Chart"],0));(Ext.cmd.derive("MBilling.view.refill.Chart",Ext.ux.panel.Chart,{controller:"refill",store:"RefillChart",fieldValue:"sumCreditMonth",fieldDescription:"CreditMonth",labelYLine:t("credit"),labelXLine:t("Month"),reference:"refillchart",btnShowColumn:true,btnShowBar:false,btnShowLine:false,btnShowPie:false,btnShowColumnHidden:true,initComponent:function(){var d=this,c;d.rendererFieldValue=Ext.util.Format.numberRenderer("0"),d.tbarChart=[{text:t("Per")+" "+t("Month"),scope:d,handler:"onPerMonth",reference:"btnMonth",disabled:true},{text:t("Per")+" "+t("day"),scope:d,handler:"onPerDay",reference:"btnDay"}];d.bbarChart=[{xtype:"tbtext",itemId:"tbTextSum"}];Ext.ux.panel.Chart.prototype.initComponent.apply(this,arguments)},onPerMonth:function(d){var c=this;c.lookupReference("btnMonth").disable();c.lookupReference("btnDay").enable();c.store.setRemoteFilter(true);c.store.filter("type","month");c.store.load()},onPerDay:function(d){var c=this;c.lookupReference("btnDay").disable();c.lookupReference("btnMonth").enable();c.store.setRemoteFilter(true);c.store.filter("type","day");c.store.load()}},0,["refillchart"],["component","box","container","panel","chartpanel","refillchart"],{component:true,box:true,container:true,panel:true,chartpanel:true,refillchart:true},["widget.refillchart"],0,[MBilling.view.refill,"Chart"],0));(Ext.cmd.derive("MBilling.view.methodPay.Controller",Ext.ux.app.ViewController,{init:function(){var b=this;b.control({methodpaycombo:{select:b.onSelectMethod}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectMethod:function(c,d){showFields=d.getData().showFields.split(",");this.showFieldsRelated(showFields)},showFieldsRelated:function(f){var d=this,e=d.formPanel.getForm().getFields();e.each(function(a){a.setVisible(f.indexOf(a.name)!==-1)})},onEdit:function(){var c=this,d=c.list.getSelectionModel().getSelection()[0];method=d?d.get("payment_method"):"Moip";showFields=c.formPanel.down("methodpaycombo").store.findRecord("payment_method",method).getData().showFields;showFields=showFields.split(",");c.showFieldsRelated(showFields);Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)},onNew:function(){var c=this,d=c.list.getSelectionModel().getSelection()[0];method="Moip";showFields=c.formPanel.down("methodpaycombo").store.findRecord("payment_method",method).getData().showFields;showFields=showFields.split(",");c.showFieldsRelated(showFields);Ext.ux.app.ViewController.prototype.onNew.apply(this,arguments)}},0,0,0,0,["controller.methodpay"],0,[MBilling.view.methodPay,"Controller"],0));(Ext.cmd.derive("MBilling.view.methodPay.Module",Ext.ux.panel.Module,{controller:"methodpay"},0,["methodpaymodule"],["component","box","container","uxpanelmodule","methodpaymodule"],{component:true,box:true,container:true,uxpanelmodule:true,methodpaymodule:true},["widget.methodpaymodule"],0,[MBilling.view.methodPay,"Module"],0));(Ext.cmd.derive("MBilling.view.methodPay.List",Ext.ux.grid.Panel,{store:"MethodPay",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("paymentmethods"),dataIndex:"payment_method",flex:2},{header:t("country"),dataIndex:"country",flex:2},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:2},{header:t("active"),dataIndex:"active",flex:1,comboRelated:"booleancombo",renderer:Helper.Util.formatBooleanActive,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")]]}}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["methodpaylist"],["component","box","container","panel","tablepanel","gridpanel","grid","methodpaylist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,methodpaylist:true},["widget.methodpaylist"],0,[MBilling.view.methodPay,"List"],0));(Ext.cmd.derive("MBilling.view.methodPay.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{xtype:"methodpaycombo",name:"payment_method",valueField:"payment_method",fieldLabel:t("paymentmethods")},{name:"show_name",fieldLabel:t("showName")},{xtype:"userlookup",ownerForm:b,name:"id_user"},{xtype:"paymentcountrycombo",name:"country",fieldLabel:t("country")},{xtype:"booleancombo",name:"active",fieldLabel:t("active")},{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,00",name:"min",value:10,fieldLabel:t("Min amount")},{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,00",name:"max",value:500,fieldLabel:t("Max amount")},{name:"username",fieldLabel:t("Username"),allowBlank:true},{name:"url",fieldLabel:"Url",allowBlank:true},{xtype:"noyescombo",name:"fee",fieldLabel:t("Discount")+" "+t("Fee"),allowBlank:true},{xtype:"paymentbanckcombo",name:"boleto_banco",fieldLabel:t("Bank"),allowBlank:true},{name:"boleto_convenio",fieldLabel:t("numeroconvenio"),allowBlank:true},{name:"boleto_agencia",fieldLabel:t("agencia"),allowBlank:true},{name:"boleto_conta_corrente",fieldLabel:t("contacorrente"),allowBlank:true},{name:"boleto_inicio_nosso_numeroa",fieldLabel:t("Inicio nosso nº"),allowBlank:true},{name:"boleto_carteira",fieldLabel:t("carteira"),allowBlank:true},{name:"boleto_taxa",fieldLabel:t("taxa"),allowBlank:true},{name:"boleto_instrucoes",fieldLabel:t("instructions"),maxLength:"100",allowBlank:true},{name:"boleto_nome_emp",fieldLabel:t("company"),allowBlank:true},{name:"boleto_end_emp",fieldLabel:t("address"),allowBlank:true},{name:"boleto_cidade_emp",fieldLabel:t("city"),allowBlank:true},{name:"boleto_estado_emp",fieldLabel:t("state"),allowBlank:true},{name:"boleto_cpf_emp",fieldLabel:"CNPJ CPF",allowBlank:true},{name:"pagseguro_TOKEN",fieldLabel:"TOKEN",allowBlank:true},{name:"P2P_CustomerSiteID",fieldLabel:t("P2P CustomerSiteID"),allowBlank:true},{name:"P2P_KeyID",fieldLabel:t("P2P KeyID"),allowBlank:true},{name:"P2P_Passphrase",fieldLabel:t("P2P Passphrase"),allowBlank:true},{name:"P2P_RecipientKeyID",fieldLabel:t("P2P RecipientKeyID"),allowBlank:true},{name:"P2P_tax_amount",fieldLabel:t("P2P Tax Amount"),allowBlank:true},{name:"client_id",fieldLabel:t("Client id"),allowBlank:true},{name:"client_secret",fieldLabel:t("Client Secret"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["methodpayform"],["component","box","container","panel","form","methodpayform"],{component:true,box:true,container:true,panel:true,form:true,methodpayform:true},["widget.methodpayform"],0,[MBilling.view.methodPay,"Form"],0));(Ext.cmd.derive("MBilling.view.methodPay.Combo",Ext.form.field.ComboBox,{name:"id_methodpay",fieldLabel:t("methodPay"),displayField:"show_name",valueField:"id",forceSelection:true,editable:false,initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.MethodPay",{proxy:{type:"uxproxy",module:"methodpay",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["methodpaycombo"],["component","box","field","textfield","pickerfield","combobox","combo","methodpaycombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,methodpaycombo:true},["widget.methodpaycombo"],0,[MBilling.view.methodPay,"Combo"],0));(Ext.cmd.derive("MBilling.view.voucher.Controller",Ext.ux.app.ViewController,{onSave:function(){var b=this;Ext.ux.app.ViewController.prototype.onSave.apply(this,arguments);b.formPanel.setLoading(false);b.saveButton.enable();b.store.load()}},0,0,0,0,["controller.voucher"],0,[MBilling.view.voucher,"Controller"],0));(Ext.cmd.derive("MBilling.view.voucher.Module",Ext.ux.panel.Module,{controller:"voucher"},0,["vouchermodule"],["component","box","container","uxpanelmodule","vouchermodule"],{component:true,box:true,container:true,uxpanelmodule:true,vouchermodule:true},["widget.vouchermodule"],0,[MBilling.view.voucher,"Module"],0));(Ext.cmd.derive("MBilling.view.voucher.List",Ext.ux.grid.Panel,{store:"Voucher",initComponent:function(){var b=this;b.buttonCsv=false;b.allowPrint=false;b.buttonUpdateLot=false;b.allowUpdate=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:3,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("credit"),dataIndex:"credit",renderer:Helper.Util.formatMoneyDecimal,filter:{type:"int",field:"t.credit"},flex:3},{header:t("voucher"),dataIndex:"voucher",flex:5},{header:t("description"),dataIndex:"tag",flex:3,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("usedate"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"usedate",flex:4},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"creationdate",flex:4,hidden:App.user.isClient,hideable:!App.user.isClient}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["voucherlist"],["component","box","container","panel","tablepanel","gridpanel","grid","voucherlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,voucherlist:true},["widget.voucherlist"],0,[MBilling.view.voucher,"List"],0));(Ext.cmd.derive("MBilling.view.voucher.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;if(!App.user.isClient){b.fieldsHideEdit=["quantity"]}if(App.user.isClient){b.textNew=t("Insert Voucher");b.buttonNewWidth=150}b.items=[{xtype:"moneyfield",name:"credit",fieldLabel:t("credit"),hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"id_plan",fieldLabel:t("Plan"),xtype:"plancombo",hidden:!App.user.isAdmin,allowBlank:!App.user.isAdmin},{xtype:"languagecombo",name:"language",fieldLabel:t("language"),hidden:!App.user.isAdmin,allowBlank:!App.user.isAdmin},{name:"prefix_local",fieldLabel:t("prefixlocal"),value:App.user.base_country=="BRL"?"0/55,*/5511/8,*/5511/9":App.user.base_country=="ARG"?"0/54,*/5411/8,15/54911/10,16/54911/10":"",emptyText:"match / replace / length",hidden:!App.user.isAdmin,allowBlank:true},{xtype:"numberfield",name:"quantity",fieldLabel:t("Quantity"),hidden:!App.user.isAdmin,allowBlank:!App.user.isAdmin,value:10},{name:"tag",fieldLabel:t("description"),hidden:App.user.isClient,allowBlank:true},{xtype:"numberfield",name:"voucher",fieldLabel:t("voucher"),value:"",maxLength:6,minLength:6,hidden:!App.user.isClient,allowBlank:!App.user.isClient}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["voucherform"],["component","box","container","panel","form","voucherform"],{component:true,box:true,container:true,panel:true,form:true,voucherform:true},["widget.voucherform"],0,[MBilling.view.voucher,"Form"],0));(Ext.cmd.derive("MBilling.view.refillprovider.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.refillprovider"],0,[MBilling.view.refillprovider,"Controller"],0));(Ext.cmd.derive("MBilling.view.refillprovider.Module",Ext.ux.panel.Module,{controller:"refillprovider"},0,["refillprovidermodule"],["component","box","container","uxpanelmodule","refillprovidermodule"],{component:true,box:true,container:true,uxpanelmodule:true,refillprovidermodule:true},["widget.refillprovidermodule"],0,[MBilling.view.refillprovider,"Module"],0));(Ext.cmd.derive("MBilling.view.refillprovider.List",Ext.ux.grid.Panel,{store:"Refillprovider",initComponent:function(){var b=this;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{xtype:"templatecolumn",tpl:"{idProviderprovider_name}",header:t("provider"),dataIndex:"id_provider",comboFilter:"providercombo",flex:2},{header:t("credit"),dataIndex:"credit",renderer:Helper.Util.formatMoneyDecimal,flex:2},{header:t("description"),dataIndex:"description",flex:4},{header:t("payment"),dataIndex:"payment",renderer:Helper.Util.formattyyesno,filter:{type:"list",options:[[0,t("no")],[1,t("yes")]]},flex:2},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"date",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["refillproviderlist"],["component","box","container","panel","tablepanel","gridpanel","grid","refillproviderlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,refillproviderlist:true},["widget.refillproviderlist"],0,[MBilling.view.refillprovider,"List"],0));(Ext.cmd.derive("MBilling.view.refillprovider.Form",Ext.ux.form.Panel,{bodyPadding:0,fieldsHideUpdateLot:["id_provider"],initComponent:function(){var b=this;b.items=[{xtype:"providercombo"},{xtype:"moneyfield",name:"credit",fieldLabel:t("credit")},{xtype:"textareafield",name:"description",fieldLabel:t("description"),allowBlank:true},{xtype:"yesnocombo",name:"payment",fieldLabel:t("add")+" "+t("payment"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["refillproviderform"],["component","box","container","panel","form","refillproviderform"],{component:true,box:true,container:true,panel:true,form:true,refillproviderform:true},["widget.refillproviderform"],0,[MBilling.view.refillprovider,"Form"],0));(Ext.cmd.derive("MBilling.view.boleto.Controller",Ext.ux.app.ViewController,{onAfterSave:function(d){var c=this;if(c.formPanel.idRecord==0){url="index.php/boleto/secondVia/?id=last";window.open(url)}Ext.ux.app.ViewController.prototype.onAfterSave.apply(this,arguments)},onSecondVia:function(e){var f=this,d=f.list.getSelectionModel().getSelection()[0];if(f.list.getSelectionModel().getSelection().length==0){Ext.ux.Alert.alert(f.titleError,t("Por favor selecione um bolero"),"notification")}else{if(f.list.getSelectionModel().getSelection().length>1){Ext.ux.Alert.alert(f.titleError,t("Por favor selecione somente um bolero"),"notification")}else{url="index.php/boleto/secondVia/?id="+d.get("id");window.open(url)}}}},0,0,0,0,["controller.boleto"],0,[MBilling.view.boleto,"Controller"],0));(Ext.cmd.derive("MBilling.view.boleto.Module",Ext.ux.panel.Module,{controller:"boleto"},0,["boletomodule"],["component","box","container","uxpanelmodule","boletomodule"],{component:true,box:true,container:true,uxpanelmodule:true,boletomodule:true},["widget.boletomodule"],0,[MBilling.view.boleto,"Module"],0));(Ext.cmd.derive("MBilling.view.boleto.List",Ext.ux.grid.Panel,{store:"Boleto",iconButtonCsv:"boleto",textButtonCsv:t("Importar Retorno"),iconButtonImportCsv:"boleto",textButtonImportCsv:t("Importar Retorno"),initComponent:function(){var b=this;b.buttonCsv=false;b.buttonUpdateLot=false;b.buttonImportCsv=App.user.isAdmin;b.extraButtons=[{text:t("Segunda via"),iconCls:"boleto",handler:"onSecondVia",disabled:false}];b.columns=[{header:t("Nosso Número"),dataIndex:"id",flex:3,hidden:!App.user.isAdmin,hideable:App.user.isAdmin},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("value"),dataIndex:"payment",renderer:Helper.Util.formatMoneyDecimal,flex:4},{header:"Pago",dataIndex:"status",renderer:Helper.Util.formattyyesno,flex:2,filter:{type:"list",options:[[0,t("no")],[1,t("yes")]]}},{header:t("description"),dataIndex:"description",flex:5},{header:"Vencimento",renderer:Ext.util.Format.dateRenderer("Y-m-d"),dataIndex:"vencimento",flex:4},{header:"Gerado",renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"date",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["boletolist"],["component","box","container","panel","tablepanel","gridpanel","grid","boletolist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,boletolist:true},["widget.boletolist"],0,[MBilling.view.boleto,"List"],0));(Ext.cmd.derive("MBilling.view.boleto.Form",Ext.ux.form.Panel,{fieldsHideEdit:["cid"],initComponent:function(){var b=this;b.items=[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:App.user.isClient},{xtype:"moneyfield",name:"payment",fieldLabel:t("value"),readOnly:App.user.isClient},{xtype:"yesnocombo",name:"status",fieldLabel:t("Pago"),hidden:App.user.isClient,value:0},{xtype:"datefield",name:"vencimento",fieldLabel:"Vencimento",format:"Y-m-d H:i:s",hidden:App.user.isClient||App.user.isAgent},{xtype:"textareafield",name:"description",fieldLabel:t("description"),readOnly:App.user.isClient}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["boletoform"],["component","box","container","panel","form","boletoform"],{component:true,box:true,container:true,panel:true,form:true,boletoform:true},["widget.boletoform"],0,[MBilling.view.boleto,"Form"],0));(Ext.cmd.derive("Ext.ux.window.ImportBoleto",Ext.window.Window,{autoShow:true,modal:true,layout:"fit",iconCls:"boleto",title:t("Importa Retorno Boleto"),width:400,height:175,labelWidthFields:180,htmlTipInfo:"",fieldsImport:[],initComponent:function(){var d=this,c=Ext.Array.merge(d.fieldsImport,[{xtype:"uploadfield",fieldLabel:t("Selecion o arquivo .RET"),htmlTipInfo:d.htmlTipInfo}]);d.items=[{xtype:"form",bodyPadding:5,labelWidth:d.labelWidthFields,items:c}];d.title=d.title+(d.titleModule?" - "+d.titleModule:"");d.bbar=[{xtype:"tbtext",text:t("maxSizeFile")+"3 MB"},"->",{iconCls:"boleto",text:t("importText"),scope:d,handler:d.onImport}];Ext.window.Window.prototype.initComponent.apply(this,arguments)},onImport:function(d){var f=this,e=f.list.store;d.disable();f.list.setLoading(true);f.down("form").submit({url:"index.php/boleto/retorno",scope:f,success:function(c,b){var a=Ext.decode(b.response.responseText);if(a.success){Ext.ux.Alert.alert(t("Success"),a.msg,"success",true,false,40000)}else{Ext.ux.Alert.alert(t("Error"),a.errors,"error")}d.enable();f.list.setLoading(false);e.load();f.close()},failure:function(c,b){if(Ext.isObject(b.response.responseText)){var a=Ext.decode(b.response.responseText);Ext.ux.Alert.alert(t("Error"),a.errors,"error")}else{Ext.ux.Alert.alert(t("Error"),b.response.responseText,"error",true,10)}d.enable();f.list.setLoading(false);f.close()}})}},0,0,["component","box","container","panel","window"],{component:true,box:true,container:true,panel:true,window:true},0,0,[Ext.ux.window,"ImportBoleto"],0));(Ext.cmd.derive("MBilling.view.boleto.ImportCsv",Ext.ux.window.ImportBoleto,{title:t("Importar Retorno"),labelWidthFields:250,height:275,fieldsImport:[{xtype:"boletobanckcombo",name:"banco",fieldLabel:t("Banco"),width:350}]},0,["boletoimportcsv"],["component","box","container","panel","window","boletoimportcsv"],{component:true,box:true,container:true,panel:true,window:true,boletoimportcsv:true},["widget.boletoimportcsv"],0,[MBilling.view.boleto,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.offer.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.offer"],0,[MBilling.view.offer,"Controller"],0));(Ext.cmd.derive("MBilling.view.offer.Combo",Ext.form.field.ComboBox,{name:"id_offer",fieldLabel:t("offer"),displayField:"label",valueField:"id",value:0,extraValues:[{id:0,label:t("undefined")}],initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Offer",{proxy:{type:"uxproxy",module:"offer",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["offercombo"],["component","box","field","textfield","pickerfield","combobox","combo","offercombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,offercombo:true},["widget.offercombo"],0,[MBilling.view.offer,"Combo"],0));(Ext.cmd.derive("MBilling.view.offer.Module",Ext.ux.panel.Module,{controller:"offer"},0,["offermodule"],["component","box","container","uxpanelmodule","offermodule"],{component:true,box:true,container:true,uxpanelmodule:true,offermodule:true},["widget.offermodule"],0,[MBilling.view.offer,"Module"],0));(Ext.cmd.derive("MBilling.view.offer.List",Ext.ux.grid.Panel,{store:"Offer",initComponent:function(){var b=this;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("name"),dataIndex:"label",flex:1},{header:t("packagetype"),dataIndex:"packagetype",renderer:Helper.Util.formatPackageType,comboRelated:"offertypecombo",flex:1,filter:{type:"list",options:[[0,t("unlimitedcalls")],[1,t("numberfreecalls")],[2,t("freeseconds")]]}},{header:t("freetimetocall"),dataIndex:"freetimetocall",flex:1},{header:t("periode"),dataIndex:"billingtype",renderer:Helper.Util.formatBillingType,comboRelated:"billingtypecombo",flex:1,filter:{type:"list",options:[[0,t("monthly")],[1,t("weekly")]]}},{header:t("price"),dataIndex:"price",renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,hideable:App.user.isAdmin,flex:2},{header:t("creationdate"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"creationdate",flex:1}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["offerlist"],["component","box","container","panel","tablepanel","gridpanel","grid","offerlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,offerlist:true},["widget.offerlist"],0,[MBilling.view.offer,"List"],0));(Ext.cmd.derive("MBilling.view.offer.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["name"],items:[{name:"label",fieldLabel:t("name")},{xtype:"offertypecombo",name:"packagetype",fieldLabel:t("packagetype")},{name:"freetimetocall",fieldLabel:t("freetimetocall")},{xtype:"billingtypecombo",name:"billingtype",fieldLabel:t("periode")},{xtype:"moneyfield",name:"price",fieldLabel:t("price")}]},0,["offerform"],["component","box","container","panel","form","offerform"],{component:true,box:true,container:true,panel:true,form:true,offerform:true},["widget.offerform"],0,[MBilling.view.offer,"Form"],0));(Ext.cmd.derive("MBilling.view.offerCdr.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.offercdr"],0,[MBilling.view.offerCdr,"Controller"],0));(Ext.cmd.derive("MBilling.view.offerCdr.Module",Ext.ux.panel.Module,{controller:"offercdr"},0,["offercdrmodule"],["component","box","container","uxpanelmodule","offercdrmodule"],{component:true,box:true,container:true,uxpanelmodule:true,offercdrmodule:true},["widget.offercdrmodule"],0,[MBilling.view.offerCdr,"Module"],0));(Ext.cmd.derive("MBilling.view.offerCdr.List",Ext.ux.grid.Panel,{store:"OfferCdr",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"date_consumption",flex:3},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:3},{xtype:"templatecolumn",tpl:"{idOfferlabel}",header:t("offer"),dataIndex:"id_offer",comboFilter:"offercombo",flex:3},{header:t("duration"),dataIndex:"used_secondes",renderer:Helper.Util.formatsecondsToTime,flex:3}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["offercdrlist"],["component","box","container","panel","tablepanel","gridpanel","grid","offercdrlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,offercdrlist:true},["widget.offercdrlist"],0,[MBilling.view.offerCdr,"List"],0));(Ext.cmd.derive("MBilling.view.offerCdr.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.columns=[{xtype:"usercombo"},{xtype:"offercombo"},{name:"used_secondes",fieldLabel:t("usedsecondes")},{xtype:"datefield",name:"date_consumption",fieldLabel:t("date"),format:"Y-m-d H:i:s"}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["offercdrform"],["component","box","container","panel","form","offercdrform"],{component:true,box:true,container:true,panel:true,form:true,offercdrform:true},["widget.offercdrform"],0,[MBilling.view.offerCdr,"Form"],0));(Ext.cmd.derive("MBilling.view.offerUse.Module",Ext.ux.panel.Module,{controller:"offeruse"},0,["offerusemodule"],["component","box","container","uxpanelmodule","offerusemodule"],{component:true,box:true,container:true,uxpanelmodule:true,offerusemodule:true},["widget.offerusemodule"],0,[MBilling.view.offerUse,"Module"],0));(Ext.cmd.derive("MBilling.view.offerUse.List",Ext.ux.grid.Panel,{store:"OfferUse",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:3},{xtype:"templatecolumn",tpl:"{idOfferlabel}",header:t("offer"),dataIndex:"id_offer",comboFilter:"offercombo",flex:3},{header:t("monthpayed"),dataIndex:"month_payed",flex:3},{header:t("reservationdate"),renderer:Ext.util.Format.dateRenderer("Y-m-d"),dataIndex:"reservationdate",flex:3},{header:t("releasedate"),renderer:Ext.util.Format.dateRenderer("Y-m-d"),dataIndex:"releasedate",flex:3}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["offeruselist"],["component","box","container","panel","tablepanel","gridpanel","grid","offeruselist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,offeruselist:true},["widget.offeruselist"],0,[MBilling.view.offerUse,"List"],0));(Ext.cmd.derive("MBilling.view.offerUse.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{xtype:"userlookup",ownerForm:b,readOnly:true},{xtype:"offercombo",readOnly:true},{name:"month_payed",fieldLabel:t("monthpayed")},{xtype:"datefield",name:"reservationdate",fieldLabel:t("reservationdate"),format:"Y-m-d H:i:s"}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["offeruseform"],["component","box","container","panel","form","offeruseform"],{component:true,box:true,container:true,panel:true,form:true,offeruseform:true},["widget.offeruseform"],0,[MBilling.view.offerUse,"Form"],0));(Ext.cmd.derive("MBilling.view.campaign.Controller",Ext.ux.app.ViewController,{isSubmitForm:true,init:function(){var b=this;b.control({typecampaigndestinationcombo:{select:b.onSelectMethod}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectMethod:function(c,d){this.showFieldsRelated(d.getData().showFields)},showFieldsRelated:function(j){var l=this,m=l.formPanel.getForm(),g=l.formPanel.getForm().getFields(),f=Ext.get(Ext.Element.getActiveElement()).component;l.onSetVisibleFiel(f,m,f.value)},onSetVisibleFiel:function(e,d,f){if(e.value=="undefined"){e.setValue("undefined")}if(e.name.match("^type_0")){d.findField("id_queue_0").setVisible(f.match("^queue"));d.findField("id_sip_0").setVisible(f.match("^sip"));d.findField("id_ivr_0").setVisible(f.match("^ivr"));d.findField("extension_0").setVisible(f.match("^group|^number|^custom"))}},onEdit:function(){var f=this,d=f.formPanel.getForm(),e=f.list.getSelectionModel().getSelection()[0];if(e.getData()["type_0"]=="ivr"){d.findField("id_ivr_0").setVisible(true);d.findField("id_sip_0").setVisible(false);d.findField("id_queue_0").setVisible(false);d.findField("extension_0").setVisible(false)}else{if(e.getData()["type_0"]=="sip"){d.findField("id_sip_0").setVisible(true);d.findField("id_ivr_0").setVisible(false);d.findField("id_queue_0").setVisible(false);d.findField("extension_0").setVisible(false)}else{if(e.getData()["type_0"]=="queue"){d.findField("id_queue_0").setVisible(true);d.findField("id_sip_0").setVisible(false);d.findField("id_ivr_0").setVisible(false);d.findField("extension_0").setVisible(false)}else{if(e.getData()["type_0"].match("custom|number|group")){d.findField("extension_0").setVisible(true);d.findField("id_ivr_0").setVisible(false);d.findField("id_sip_0").setVisible(false);d.findField("id_queue_0").setVisible(false)}else{d.findField("id_queue_0").setVisible(false);d.findField("id_sip_0").setVisible(false);d.findField("id_ivr_0").setVisible(false);d.findField("extension_0").setVisible(false)}}}}Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)},onNew:function(){var f=this,d=f.formPanel.getForm(),e=f.list.getSelectionModel().getSelection()[0];d.findField("id_ivr_0").setVisible(false);d.findField("id_sip_0").setVisible(false);d.findField("id_queue_0").setVisible(false);d.findField("extension_0").setVisible(false);Ext.ux.app.ViewController.prototype.onNew.apply(this,arguments)},submitForm:function(d){var f=this,e=f.store;Ext.apply(f.params,{id_phonebook_array:f.formPanel.getForm().getFieldValues().id_phonebook.join(",")});f.formPanel.add({xtype:"hiddenfield",name:f.idProperty,value:f.formPanel.idRecord});f.formPanel.getForm().submit({url:f.store.getProxy().api.create,params:f.params,scope:f,success:function(c,b){var a=Ext.decode(b.response.responseText);if(a.success){Ext.ux.Alert.alert(f.titleSuccess,a.msg,"success");f.formPanel.fireEvent("aftersave",f.formPanel,a.rows[0])}else{errors=Helper.Util.convertErrorsJsonToString(a.msg);if(!Ext.isObject(a.errors)){Ext.ux.Alert.alert(f.titleError,errors,"error")}else{c.markInvalid(a.errors);Ext.ux.Alert.alert(f.titleWarning,f.msgFormInvalid,"warning")}}f.store.load();f.formPanel.setLoading(false);f.saveButton.enable()},failure:function(j,c){var b=Ext.decode(c.response.responseText),a=Helper.Util.convertErrorsJsonToString(b.errors);if(!Ext.isObject(b.errors)){Ext.ux.Alert.alert(f.titleError,a,"error")}else{j.markInvalid(b.errors);Ext.ux.Alert.alert(f.titleWarning,a,"error")}f.formPanel.setLoading(false);f.saveButton.enable()}})},onTestCampaign:function(e){var f=this,d=f.list.getSelectionModel().getSelection()[0];if(f.list.getSelectionModel().getSelection().length==0){Ext.ux.Alert.alert(f.titleError,t("Please Select one campaign"),"notification")}else{if(f.list.getSelectionModel().getSelection().length>1){Ext.ux.Alert.alert(f.titleError,t("Please Select only one campaign"),"notification")}else{Ext.Ajax.request({url:"index.php/campaign/testCampaign",params:{id:d.get("id")},scope:f,success:function(b){b=Ext.decode(b.responseText);if(b[f.nameSuccessRequest]){Ext.ux.Alert.alert(f.titleSuccess,b[f.nameMsgRequest],"success")}else{var a=Helper.Util.convertErrorsJsonToString(b[f.nameMsgRequest]);Ext.ux.Alert.alert(f.titleSuccess,a,"error")}}})}}}},0,0,0,0,["controller.campaign"],0,[MBilling.view.campaign,"Controller"],0));(Ext.cmd.derive("MBilling.view.campaign.Combo",Ext.form.field.ComboBox,{name:"id_campaign",fieldLabel:t("campaign"),displayField:"name",forceSelection:true,editable:false,valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Campaign",{proxy:{type:"uxproxy",module:"campaign",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["campaigncombo"],["component","box","field","textfield","pickerfield","combobox","combo","campaigncombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,campaigncombo:true},["widget.campaigncombo"],0,[MBilling.view.campaign,"Combo"],0));(Ext.cmd.derive("MBilling.view.general.TypeCampaignDestination",Ext.form.field.ComboBox,{fieldLabel:t("type"),forceSelection:true,editable:false,value:"",store:[["",t("")],["undefined",t("Undefined")],["sip",t("SIP")],["ivr",t("IVR")],["queue",t("Queue")],["group",t("Group")],["custom",t("Custom")]]},0,["typecampaigndestinationcombo"],["component","box","field","textfield","pickerfield","combobox","combo","typecampaigndestinationcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,typecampaigndestinationcombo:true},["widget.typecampaigndestinationcombo"],0,[MBilling.view.general,"TypeCampaignDestination"],0));(Ext.cmd.derive("MBilling.view.campaign.Module",Ext.ux.panel.Module,{controller:"campaign"},0,["campaignmodule"],["component","box","container","uxpanelmodule","campaignmodule"],{component:true,box:true,container:true,uxpanelmodule:true,campaignmodule:true},["widget.campaignmodule"],0,[MBilling.view.campaign,"Module"],0));(Ext.cmd.derive("MBilling.view.campaign.List",Ext.ux.grid.Panel,{store:"Campaign",fieldSearch:"name",initComponent:function(){var b=this;b.buttonCsv=false;b.allowPrint=false;b.extraButtons=[{text:t("Test")+" "+t("Campaign"),iconCls:"call",handler:"onTestCampaign",disabled:false}];b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("name"),dataIndex:"name",flex:4},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:3,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("status"),dataIndex:"status",renderer:Helper.Util.formatBooleanActive,comboRelated:"booleancombo",flex:2,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")]]}},{header:t("type"),dataIndex:"type",renderer:Helper.Util.formatCampaignType,comboRelated:"campaigntypecombo",flex:2,filter:App.user.l.slice(4,7)=="wap"?{type:"list",options:[[0,t("sms")],[1,t("voice")],[3,t("WhasApp")]]}:{type:"list",options:[[0,t("sms")],[1,t("voice")]]}},{header:t("daily_start_time"),dataIndex:"daily_start_time",flex:4},{header:t("daily_stop_time"),dataIndex:"daily_stop_time",flex:4},{header:t("startingdate"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"startingdate",flex:4},{header:t("Call Limit"),dataIndex:"frequency",flex:4,hidden:true,hideable:App.user.isAdmin},{header:t("Max Complete Call"),dataIndex:"secondusedreal",flex:3,hidden:true,hideable:App.user.isAdmin}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignlist"],["component","box","container","panel","tablepanel","gridpanel","grid","campaignlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,campaignlist:true},["widget.campaignlist"],0,[MBilling.view.campaign,"List"],0));(Ext.cmd.derive("MBilling.view.campaign.Form",Ext.ux.form.Panel,{bodyPadding:0,fieldsHideUpdateLot:["id_user","name","audio","audio_2","id_phonebook"],fileUpload:true,initComponent:function(){var b=this;b.labelWidthFields=120;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{plugins:"markallowblank",allowBlank:false,anchor:"100%",labelAlign:"right"}},items:[{title:t("general"),items:[{xtype:App.user.isClient?"textfield":"userlookup",ownerForm:b,hidden:App.user.isClient},{fieldLabel:t("Plan"),xtype:"plancombo",name:"id_plan",hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"name",fieldLabel:t("name")},{xtype:"booleancombo",name:"status",fieldLabel:t("status")},{xtype:"datetimefield",name:"startingdate",fieldLabel:t("startingdate"),format:"Y-m-d H:i:s",value:new Date()},{xtype:"datetimefield",name:"expirationdate",fieldLabel:t("expirationdate"),format:"Y-m-d H:i:s",value:"2030-01-01 00:00:00"},{xtype:"campaigntypefullcombo",name:"type",fieldLabel:t("type")},{xtype:"uploadfield",fieldLabel:t("Audio"),emptyText:"Select an wav or gsm File",allowBlank:true,name:"audio",extAllowed:["wav","gsm"]},{xtype:"uploadfield",fieldLabel:t("Audio")+"2",emptyText:"Select an wav or gsm File",allowBlank:true,name:"audio_2",extAllowed:["wav","gsm"]},{xtype:"yesnocombo",name:"restrict_phone",fieldLabel:t("Restrict Phone"),hidden:App.user.isClient,allowBlank:true},{style:"margin-top:25px",xtype:"fieldset",title:t("Forward to"),collapsible:true,collapsed:false,height:110,defaults:{labelWidth:190,anchor:"100%",labelAlign:b.labelAlignFields},items:[{xtype:"numberfield",name:"digit_authorize",fieldLabel:t("Number to Forward"),value:"-1",minValue:"-1",maxValue:9},{fieldLabel:t("Forward Type"),name:"type_0",xtype:"typecampaigndestinationcombo",allowBlank:true},{xtype:"textfield",name:"extensions_0",fieldLabel:t("Destination"),value:"0",allowBlank:true,hidden:true},{xtype:"ivrlookup",ownerForm:b,name:"id_ivr_0",fieldLabel:t("IVR"),displayField:"id_ivr_0_name",allowBlank:true,hidden:true},{xtype:"queuelookup",ownerForm:b,name:"id_queue_0",fieldLabel:t("Queue"),displayField:"id_queue_0_name",allowBlank:true,hidden:true},{xtype:"siplookup",ownerForm:b,name:"id_sip_0",displayField:"id_sip_0_name",fieldLabel:t("SIP"),allowBlank:true,hidden:true},{xtype:"textfield",fieldLabel:t("Destination"),name:"extension_0",hidden:true}]},{style:"margin-top:10px",xtype:"fieldset",title:t("Select one or more phonebook"),collapsible:true,collapsed:false,items:[{labelWidth:10,name:"id_phonebook",fieldLabel:t("phonebook"),anchor:"100%",fieldLabel:"",xtype:"phonebooktag",allowBlank:true}]}]},{title:t("schedules"),items:[{name:"daily_start_time",fieldLabel:t("daily_start_time"),value:"09:00"},{name:"daily_stop_time",fieldLabel:t("daily_stop_time"),value:"18:00"},{xtype:"yesnocombo",fieldLabel:t("monday"),name:"monday"},{xtype:"yesnocombo",fieldLabel:t("tuesday"),name:"tuesday"},{xtype:"yesnocombo",fieldLabel:t("wednesday"),name:"wednesday"},{xtype:"yesnocombo",fieldLabel:t("thursday"),name:"thursday"},{xtype:"yesnocombo",fieldLabel:t("friday"),name:"friday"},{xtype:"noyescombo",fieldLabel:t("saturday"),name:"saturday"},{xtype:"noyescombo",fieldLabel:t("sunday"),name:"sunday"}]},{title:t("Limit"),items:[{name:"frequency",fieldLabel:t("Call Limit"),readOnly:!App.user.isAdmin,allowBlank:!App.user.isAdmin,value:App.user.isClient?1:10},{name:"nb_callmade",fieldLabel:t("Total Audio Time"),hidden:!App.user.isAdmin,allowBlank:true,value:0},{xtype:"booleancombo",name:"enable_max_call",fieldLabel:t("Enable")+" "+t("Max Complete Call"),hidden:!App.user.isAdmin,allowBlank:true,value:0},{name:"secondusedreal",fieldLabel:t("Max Complete Call"),hidden:!App.user.isAdmin,allowBlank:true,value:0}]},{title:t("SMS"),items:[{xtype:"textareafield",name:"description",fieldLabel:t("descriptionOrSmsText"),allowBlank:true,maxLength:160}]},{title:t("TTS/ASR"),hidden:!window.ttsasr,items:[{name:"tts_audio",fieldLabel:t("Audio 1 TTS"),allowBlank:true,maxLength:200},{name:"tts_audio2",fieldLabel:t("Audio 2 TTS"),allowBlank:true,maxLength:200},{xtype:"box",hidden:false,autoEl:{tag:"br"}},{name:"asr_options",fieldLabel:t("Option to validate ASR"),allowBlank:true,maxLength:160}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignform"],["component","box","container","panel","form","campaignform"],{component:true,box:true,container:true,panel:true,form:true,campaignform:true},["widget.campaignform"],0,[MBilling.view.campaign,"Form"],0));(Ext.cmd.derive("MBilling.view.campaignPoll.Controller",Ext.ux.app.ViewController,{isSubmitForm:true},0,0,0,0,["controller.campaignpoll"],0,[MBilling.view.campaignPoll,"Controller"],0));(Ext.cmd.derive("MBilling.view.campaignPoll.Combo",Ext.form.field.ComboBox,{name:"id_campaign_poll",fieldLabel:t("campaignpoll"),displayField:"name",valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.CampaignPoll",{proxy:{type:"uxproxy",module:"campaignPoll",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["campaignpollcombo"],["component","box","field","textfield","pickerfield","combobox","combo","campaignpollcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,campaignpollcombo:true},["widget.campaignpollcombo"],0,[MBilling.view.campaignPoll,"Combo"],0));(Ext.cmd.derive("MBilling.view.campaignPoll.Module",Ext.ux.panel.Module,{controller:"campaignpoll"},0,["campaignpollmodule"],["component","box","container","uxpanelmodule","campaignpollmodule"],{component:true,box:true,container:true,uxpanelmodule:true,campaignpollmodule:true},["widget.campaignpollmodule"],0,[MBilling.view.campaignPoll,"Module"],0));(Ext.cmd.derive("MBilling.view.campaignPoll.List",Ext.ux.grid.Panel,{store:"CampaignPoll",initComponent:function(){var b=this;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("name"),dataIndex:"name",flex:4},{xtype:"templatecolumn",tpl:"{idCampaignname}",header:t("campaign"),dataIndex:"id_campaign",comboFilter:"campaigncombo",flex:4},{header:t("description"),dataIndex:"description",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignpolllist"],["component","box","container","panel","tablepanel","gridpanel","grid","campaignpolllist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,campaignpolllist:true},["widget.campaignpolllist"],0,[MBilling.view.campaignPoll,"List"],0));(Ext.cmd.derive("MBilling.view.campaignPoll.Form",Ext.ux.form.Panel,{bodyPadding:0,fileUpload:true,fieldsHideUpdateLot:["id_campaign","name","arq_audio"],initComponent:function(){var b=this;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{plugins:"markallowblank",allowBlank:false,anchor:"100%",labelAlign:"right"}},items:[{title:t("general"),items:[{xtype:"campaigncombo"},{name:"name",fieldLabel:t("name")},{xtype:"numberfield",name:"repeat",fieldLabel:t("How many time to repeat, if the client press invalid option?"),minValue:0,maxValue:9,allowBlank:true},{xtype:"noyescombo",name:"request_authorize",fieldLabel:t("Request")+" "+t("authorization")},{xtype:"numberfield",name:"digit_authorize",fieldLabel:t("Number for authorize"),value:"1",minValue:1,maxValue:9,allowBlank:true},{xtype:"textareafield",name:"description",fieldLabel:t("description"),allowBlank:true},{xtype:"uploadfield",fieldLabel:"Audio",emptyText:"Select an wav or gsm File",allowBlank:true,name:"arq_audio",extAllowed:["wav","gsm"]}]},{title:t("options"),itemId:"optionsData",items:[{name:"option0",fieldLabel:t("option")+" 0",allowBlank:true},{name:"option1",fieldLabel:t("option")+" 1",allowBlank:true},{name:"option2",fieldLabel:t("option")+" 2",allowBlank:true},{name:"option3",fieldLabel:t("option")+" 3",allowBlank:true},{name:"option4",fieldLabel:t("option")+" 4",allowBlank:true},{name:"option5",fieldLabel:t("option")+" 5",allowBlank:true},{name:"option6",fieldLabel:t("option")+" 6",allowBlank:true},{name:"option7",fieldLabel:t("option")+" 7",allowBlank:true},{name:"option8",fieldLabel:t("option")+" 8",allowBlank:true},{name:"option9",fieldLabel:t("option")+" 9",allowBlank:true}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignpollform"],["component","box","container","panel","form","campaignpollform"],{component:true,box:true,container:true,panel:true,form:true,campaignpollform:true},["widget.campaignpollform"],0,[MBilling.view.campaignPoll,"Form"],0));(Ext.cmd.derive("MBilling.view.phoneNumber.Controller",Ext.ux.app.ViewController,{reprocessar:function(e){var g=this,f=g.list.getStore(),j=g.list.filters.getFilterData().length?Ext.encode(g.list.filters.getFilterData()):f.proxy.extraParams.filter;e.disable();g.list.setLoading(true);if(!j){Ext.ux.Alert.alert("Alert","Realize um filtro para reprocessar","notification");e.enable();g.list.setLoading(false);return}Ext.Msg.confirm("Confirm","Confirme que quer reprocessar os numeros pendentes?",function(a){if(a==="yes"){Ext.Ajax.request({url:"index.php/phoneNumber/reprocesar/",params:{filter:j},scope:g,success:function(c){c=Ext.decode(c.responseText);if(c[g.nameSuccessRequest]){Ext.ux.Alert.alert(g.titleSuccess,c[g.nameMsgRequest],"success");f.load();e.enable();g.list.setLoading(false)}else{var b=Helper.Util.convertErrorsJsonToString(c[g.nameMsgRequest]);Ext.ux.Alert.alert(g.titleError,b,"error");e.enable();g.list.setLoading(false)}}})}})}},0,0,0,0,["controller.phonenumber"],0,[MBilling.view.phoneNumber,"Controller"],0));(Ext.cmd.derive("MBilling.view.phoneNumber.Module",Ext.ux.panel.Module,{controller:"phonenumber"},0,["phonenumbermodule"],["component","box","container","uxpanelmodule","phonenumbermodule"],{component:true,box:true,container:true,uxpanelmodule:true,phonenumbermodule:true},["widget.phonenumbermodule"],0,[MBilling.view.phoneNumber,"Module"],0));(Ext.cmd.derive("MBilling.view.phoneNumber.List",Ext.ux.grid.Panel,{store:"PhoneNumber",buttonImportCsv:true,initComponent:function(){var b=this;b.extraButtons=[{text:t("Reprocessar"),iconCls:"callshop",handler:"reprocessar",disabled:false}];b.buttonUpdateLot=App.user.isAdmin&&!window.isTablet;b.buttonCsv=!window.isTablet;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("number"),dataIndex:"number",flex:4},{header:t("phonebook"),dataIndex:"idPhonebookname",filter:{type:"string",field:"idPhonebook.name"},flex:4},{header:t("status"),dataIndex:"status",renderer:Helper.Util.formatBooleanActive,comboRelated:"statuscombo",flex:2,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")],[2,t("pending")],[3,t("send")],[4,t("blocked")]]}},{header:t("name"),dataIndex:"name",hidden:true,hideable:true,flex:4},{header:t("city"),dataIndex:"city",hidden:true,hideable:true,flex:4},{header:t("description"),dataIndex:"info",hidden:true,flex:4},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"creationdate",hidden:true,hideable:App.user.isAdmin,flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["phonenumberlist"],["component","box","container","panel","tablepanel","gridpanel","grid","phonenumberlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,phonenumberlist:true},["widget.phonenumberlist"],0,[MBilling.view.phoneNumber,"List"],0));(Ext.cmd.derive("MBilling.view.phoneNumber.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["number"],initComponent:function(){var b=this;b.items=[{xtype:"phonebookcombo"},{name:"number",fieldLabel:t("number")},{name:"name",fieldLabel:t("name"),allowBlank:true},{name:"city",fieldLabel:t("city"),allowBlank:true},{xtype:"statuscombo",name:"status",fieldLabel:t("status"),allowBlank:true},{xtype:"textareafield",name:"info",fieldLabel:t("description"),allowBlank:true,hidden:!App.user.isAdmin}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["phonenumberform"],["component","box","container","panel","form","phonenumberform"],{component:true,box:true,container:true,panel:true,form:true,phonenumberform:true},["widget.phonenumberform"],0,[MBilling.view.phoneNumber,"Form"],0));(Ext.cmd.derive("MBilling.view.phoneBook.Combo",Ext.form.field.ComboBox,{name:"id_phonebook",fieldLabel:t("phonebook"),displayField:"name",forceSelection:true,editable:true,valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.PhoneBook",{proxy:{type:"uxproxy",module:"phoneBook",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["phonebookcombo"],["component","box","field","textfield","pickerfield","combobox","combo","phonebookcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,phonebookcombo:true},["widget.phonebookcombo"],0,[MBilling.view.phoneBook,"Combo"],0));(Ext.cmd.derive("MBilling.view.phoneNumber.ImportCsv",Ext.ux.window.ImportCsv,{htmlTipInfo:"
number,name,city
551135672677, Dany Hilger, New York
551156332233, Monica Leith, San Pablo
554153882200, John Mart, Madri
"+t("name")+" "+t("and")+" "+t("city")+" "+t("optional")+"",fieldsImport:[{xtype:"phonebookcombo",width:350}]},0,["phonenumberimportcsv"],["component","box","container","panel","window","phonenumberimportcsv"],{component:true,box:true,container:true,panel:true,window:true,phonenumberimportcsv:true},["widget.phonenumberimportcsv"],0,[MBilling.view.phoneNumber,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.rate.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.rate"],0,[MBilling.view.rate,"Controller"],0));(Ext.cmd.derive("MBilling.view.rate.Module",Ext.ux.panel.Module,{controller:"rate",flexForm:2,labelWidthFields:190},0,["ratemodule"],["component","box","container","uxpanelmodule","ratemodule"],{component:true,box:true,container:true,uxpanelmodule:true,ratemodule:true},["widget.ratemodule"],0,[MBilling.view.rate,"Module"],0));(Ext.cmd.derive("MBilling.view.rate.List",Ext.ux.grid.Panel,{store:"Rate",fieldSearch:"idPrefix.prefix",initComponent:function(){var b=this;b.buttonImportCsv=!App.user.isClient,b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("prefix"),dataIndex:"idPrefixprefix",filter:{type:"string",field:"idPrefix.prefix"},flex:window.isTablet?2:3},{dataIndex:"idPrefixdestination",header:t("destination"),filter:{type:"string",field:"idPrefix.destination"},flex:window.isTablet?2:3},{header:t("buyrate"),dataIndex:"buyrate",renderer:Helper.Util.formatMoneyDecimal4,hidden:!App.user.isAdmin,hideable:App.user.isAdmin,flex:2},{header:t("buyrateinitblock"),dataIndex:"buyrateinitblock",hidden:!App.user.isAdmin||window.isTablet,hideable:App.user.isAdmin,flex:2},{header:t("buyrateincrement"),dataIndex:"buyrateincrement",hidden:!App.user.isAdmin||window.isTablet,hideable:App.user.isAdmin,flex:2},{header:t("rateinitial"),dataIndex:"rateinitial",renderer:Helper.Util.formatMoneyDecimal4,flex:2},{header:t("initblock"),dataIndex:"initblock",hidden:window.isTablet,flex:2},{header:t("billingblock"),dataIndex:"billingblock",hidden:window.isTablet,flex:2},{xtype:"templatecolumn",tpl:"{idTrunktrunkcode}",header:t("trunk"),dataIndex:"id_trunk",comboFilter:"trunkcombo",flex:3,hidden:!App.user.isAdmin,hideable:App.user.isAdmin},{xtype:"templatecolumn",tpl:"{idPlanname}",header:t("plan"),dataIndex:"id_plan",comboFilter:"plancombo",flex:3},{header:t("includeinpackage"),dataIndex:"package_offer",hidden:true,hideable:App.user.isAdmin,flex:1},{header:t("status"),dataIndex:"status",hidden:true,hideable:App.user.isAdmin,flex:2,renderer:Helper.Util.formatBooleanActive,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")]]}}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["ratelist"],["component","box","container","panel","tablepanel","gridpanel","grid","ratelist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,ratelist:true},["widget.ratelist"],0,[MBilling.view.rate,"List"],0));(Ext.cmd.derive("MBilling.view.rate.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["id_prefix"],labelWidthFields:140,initComponent:function(){var b=this;b.items=[{name:"id_plan",fieldLabel:"Plan",xtype:"planlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:false},{name:"id_prefix",fieldLabel:"Destination",xtype:"prefixlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:false},{name:"id_trunk",fieldLabel:"Trunk",xtype:"trunklookup",ownerForm:b,hidden:!App.user.isAdmin,allowBlank:!App.user.isAdmin},{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,"+App.user.decimalPrecision,name:"buyrate",fieldLabel:t("buyrate"),hidden:!App.user.isAdmin,allowBlank:!App.user.isAdmin},{xtype:"numberfield",name:"buyrateinitblock",fieldLabel:t("buyrateinitblock"),value:1,minValue:1,hidden:!App.user.isAdmin,allowBlank:!App.user.isAdmin},{xtype:"numberfield",name:"buyrateincrement",fieldLabel:t("buyrateincrement"),value:1,minValue:1,hidden:!App.user.isAdmin,allowBlank:!App.user.isAdmin},{xtype:"numberfield",name:"minimal_time_buy",fieldLabel:t("Minimal time to buy"),value:0,minValue:0,hidden:!App.user.isAdmin},{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,"+App.user.decimalPrecision,name:"rateinitial",fieldLabel:t("rateinitial"),readOnly:App.user.isClient},{xtype:"numberfield",name:"initblock",fieldLabel:t("initblock"),value:1,minValue:1,hidden:App.user.isClient},{xtype:"numberfield",name:"billingblock",value:1,minValue:1,fieldLabel:t("billingblock"),hidden:App.user.isClient},{xtype:"numberfield",name:"minimal_time_charge",fieldLabel:t("Minimal time to charge"),value:0,minValue:0,hidden:App.user.isClient},{name:"additional_grace",fieldLabel:t("additional_grace"),allowBlank:true,hidden:!App.user.isAdmin},{xtype:"noyescombo",name:"package_offer",fieldLabel:t("includeinpackage"),hidden:!App.user.isAdmin,allowBlank:true},{xtype:"booleancombo",name:"status",fieldLabel:t("status"),hidden:!App.user.isAdmin,allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["rateform"],["component","box","container","panel","form","rateform"],{component:true,box:true,container:true,panel:true,form:true,rateform:true},["widget.rateform"],0,[MBilling.view.rate,"Form"],0));(Ext.cmd.derive("MBilling.view.rate.ImportCsv",Ext.ux.window.ImportCsv,{htmlTipInfo:"
"+t("dialprefix")+", "+t("destination")+", "+t("rateinitial")+", "+t("buyrate")+"
5511, Brasil SP, 0.080, 0.050
34, Spain Fix, 0.056, 0.034
54, Argentina, 0.025, 0.015

"+t("rateinitial")+" "+t("and")+" "+t("buyrate")+" "+t("optional")+"",labelWidthFields:160,height:window.isThemeTriton?350:275,initComponent:function(){var b=this;b.fieldsImport=[{xtype:"plancombo",fieldLabel:t("table"),width:350},{xtype:"trunkcombo",fieldLabel:t("trunkText"),width:350,hidden:!App.user.isAdmin},{style:"margin-top:25px",xtype:"fieldset",title:t("Csv Format"),collapsible:true,collapsed:false,defaults:{labelWidth:190,anchor:"100%",layout:{type:"hbox",labelAlign:b.labelAlignFields}},items:[{xtype:"pontovirgulacombo",name:"delimiter",fieldLabel:t("Delimiter"),width:230}]}];Ext.ux.window.ImportCsv.prototype.initComponent.apply(this,arguments)}},0,["rateimportcsv"],["component","box","container","panel","window","rateimportcsv"],{component:true,box:true,container:true,panel:true,window:true,rateimportcsv:true},["widget.rateimportcsv"],0,[MBilling.view.rate,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.phoneBook.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.phonebook"],0,[MBilling.view.phoneBook,"Controller"],0));(Ext.cmd.derive("MBilling.view.phoneBook.Module",Ext.ux.panel.Module,{controller:"phonebook"},0,["phonebookmodule"],["component","box","container","uxpanelmodule","phonebookmodule"],{component:true,box:true,container:true,uxpanelmodule:true,phonebookmodule:true},["widget.phonebookmodule"],0,[MBilling.view.phoneBook,"Module"],0));(Ext.cmd.derive("MBilling.view.phoneBook.List",Ext.ux.grid.Panel,{store:"PhoneBook",initComponent:function(){var b=this;b.columns=b.columns||[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("name"),dataIndex:"name",flex:5},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:3,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("status"),dataIndex:"status",renderer:Helper.Util.formatBooleanActive,comboRelated:"booleancombo",flex:3,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")]]}},{header:t("description"),dataIndex:"description",flex:5}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["phonebooklist"],["component","box","container","panel","tablepanel","gridpanel","grid","phonebooklist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,phonebooklist:true},["widget.phonebooklist"],0,[MBilling.view.phoneBook,"List"],0));(Ext.cmd.derive("MBilling.view.phoneBook.Form",Ext.ux.form.Panel,{bodyPadding:0,fieldsHideUpdateLot:["id_user","name"],initComponent:function(){var b=this;b.items=[{xtype:App.user.isClient?"textfield":"userlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"name",fieldLabel:t("name")},{xtype:"booleancombo",name:"status",fieldLabel:t("status"),allowBlank:true},{xtype:"textareafield",name:"description",fieldLabel:t("description"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["phonebookform"],["component","box","container","panel","form","phonebookform"],{component:true,box:true,container:true,panel:true,form:true,phonebookform:true},["widget.phonebookform"],0,[MBilling.view.phoneBook,"Form"],0));(Ext.cmd.derive("MBilling.view.phoneBook.Tag",Ext.form.field.Tag,{name:"id_phonebook",fieldLabel:t("phonebook"),displayField:"name",valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.PhoneBook",{proxy:{type:"uxproxy",module:"phoneBook",limitParam:undefined}});Ext.form.field.Tag.prototype.initComponent.apply(this,arguments)}},0,["phonebooktag"],["component","box","field","textfield","pickerfield","combobox","combo","tagfield","phonebooktag"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,tagfield:true,phonebooktag:true},["widget.phonebooktag"],0,[MBilling.view.phoneBook,"Tag"],0));(Ext.cmd.derive("MBilling.view.call.Controller",Ext.ux.app.ViewController,{onRecordCall:function(m){var j=this,f=j.list.getSelectionModel().getSelection()[0],l=Ext.encode(j.list.filters.getFilterData()),g=[];if(!f&&l.length<5){Ext.ux.Alert.alert(j.titleError,t("Please select one or more register"),"notification")}else{Ext.each(j.list.getSelectionModel().getSelection(),function(a){g.push(a.get(j.idProperty))});if(App.user.isAdmin&&g.length>250){Ext.ux.Alert.alert(j.titleError,t("Your limit to download record is")+" 250","error")}else{if(!App.user.isAdmin&&g.length>25){Ext.ux.Alert.alert(j.titleError,t("Your limit to download record is")+" 25","error")}else{window.open("index.php/call/downloadRecord?ids="+Ext.encode(g)+"&filter="+l)}}}},onDownloadClick:function(d,f,e){window.open("index.php/call/downloadRecord?id="+d.getStore().getAt(f).getData().id)},onShowTotal:function(e){var g=this;var g=this,f=g.list.getStore(),j=g.list.filters.getFilterData().length?Ext.encode(g.list.filters.getFilterData()):f.proxy.extraParams.filter;e.disable();e.setText(t("Wait..."));e.setWidth(120);Ext.Ajax.request({url:"index.php/call/getTotal",params:{filter:j},scope:g,success:function(a){a=Ext.decode(a.responseText);Ext.ux.Alert.alert(g.titleSuccess," "+t("Total")+" "+t("buycost")+": "+App.user.currency+" "+a.sumbuycost+"
"+t("Total")+" "+t("sessionbill")+": "+App.user.currency+" "+a.sumsessionbill+"
"+t("Total")+" "+t("profit")+": "+App.user.currency+" "+a.totalCall+"
","information",true,false);e.enable();e.setText(t("Show Total"))},failure:function(a){e.enable();e.setText(""+t("Failed. Try again...")+"");e.setWidth(300)}})}},0,0,0,0,["controller.call"],0,[MBilling.view.call,"Controller"],0));(Ext.cmd.derive("MBilling.view.call.Module",Ext.ux.panel.Module,{controller:"call"},0,["callmodule"],["component","box","container","uxpanelmodule","callmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callmodule:true},["widget.callmodule"],0,[MBilling.view.call,"Module"],0));(Ext.cmd.derive("MBilling.view.call.List",Ext.ux.grid.Panel,{store:"Call",standardSubmit:true,initComponent:function(){var b=this;b.paginationButton=["-",{xtype:"button",width:"120",text:t("Show Total"),handler:"onShowTotal",hidden:!App.user.isAdmin,cls:"x-btn-text-icon details"},{xtype:"tbtext",reference:"tbTextTotal"}];b.fieldSearch=App.user.isAdmin?"idUser.username":"calledstation",b.extraButtons=[{text:t("Download Rec"),iconCls:"call",handler:"onRecordCall",disabled:false,width:130}];b.buttonUpdateLot=App.user.isAdmin;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{xtype:"actioncolumn",width:26,sortable:false,menuDisabled:true,header:t(""),dataIndex:"id",items:[{iconCls:"icon-play",tooltip:t("Download Rec"),handler:"onDownloadClick"}],hidden:App.user.show_playicon_cdr==0,hideable:true},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"starttime",flex:4},{header:t("Sip Account"),dataIndex:"src",flex:3},{header:t("CallerId"),dataIndex:"callerid",flex:3,hidden:true,hideable:true},{header:t("number"),dataIndex:"calledstation",flex:3},{header:t("destination"),dataIndex:"idPrefixdestination",filter:{type:"string",field:"idPrefix.destination"},flex:4},{header:t("sessiontime"),dataIndex:"sessiontime",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Real")+" "+t("sessiontime"),dataIndex:"real_sessiontime",renderer:Helper.Util.formatsecondsToTime,flex:3,hidden:true,hideable:App.user.isAdmin},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:2,hidden:App.user.isClient,hideable:!App.user.isClient},{xtype:"templatecolumn",tpl:"{idTrunktrunkcode}",header:t("trunk"),dataIndex:"id_trunk",comboFilter:"trunkcombo",header:t("trunk"),flex:3,hidden:App.user.isClient||App.user.isAgent,hideable:!App.user.isClient&&!App.user.isAgent},{header:t("status"),dataIndex:"terminatecauseid",renderer:Helper.Util.formatDialStatus,flex:2,filter:{type:"list",options:[[1,t("answer")]]}},{header:t("type"),dataIndex:"sipiax",renderer:Helper.Util.formatCallType,flex:2,filter:{type:"list",options:[[0,t("standard")],[1,t("sipcall")],[2,t("did")],[3,t("didvoip")],[4,t("callback")],[5,t("callcenter")],[6,"sms"],[7,t("transfer")],[8,t("queue")],[9,t("ivr")]]}},{header:t("buycost"),dataIndex:"buycost",renderer:Helper.Util.formatMoneyDecimal4,flex:3,hidden:App.user.isClient||App.user.isAgent,hideable:!App.user.isClient&&!App.user.isAgent},{header:t("sessionbill"),dataIndex:"sessionbill",renderer:Helper.Util.formatMoneyDecimal4,flex:3,hidden:App.user.isAgent||App.user.isClientAgent,hideable:!App.user.isAgent&&!App.user.isClientAgent},{header:t("buycost"),dataIndex:"sessionbill",renderer:Helper.Util.formatMoneyDecimal4,flex:3,hidden:!App.user.isAgent,hideable:App.user.isAgent},{header:t("sessionbill"),dataIndex:"agent_bill",renderer:Helper.Util.formatMoneyDecimal4,flex:3,hidden:!App.user.isAgent,hideable:App.user.isAgent},{header:t("sessionbill"),dataIndex:"agent_bill",renderer:Helper.Util.formatMoneyDecimal4,flex:3,hidden:!App.user.isClientAgent,hideable:App.user.isClientAgent},{header:t("uniqueid"),dataIndex:"uniqueid",flex:3,hidden:true,hideable:true},{xtype:"templatecolumn",tpl:"{idCampaignname}",header:t("campaign"),dataIndex:"id_campaign",comboFilter:"campaigncombo",flex:3,hidden:true,hideable:!App.user.isClient}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["calllist"],["component","box","container","panel","tablepanel","gridpanel","grid","calllist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,calllist:true},["widget.calllist"],0,[MBilling.view.call,"List"],0));(Ext.cmd.derive("MBilling.view.call.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["calledstation"],initComponent:function(){var b=this;b.items=[{name:"calledstation",fieldLabel:t("number"),readOnly:true},{name:"sessiontime",fieldLabel:t("sessiontime"),readOnly:App.user.isClient||App.user.isAgent,hidden:App.user.isClient||App.user.isAgent},{xtype:"moneyfield",name:"buycost",fieldLabel:t("buycost"),mask:App.user.currency+" #9.999.990,"+App.user.decimalPrecision,hidden:App.user.isClient||App.user.isAgent},{xtype:"moneyfield",name:"sessionbill",fieldLabel:t("sessionbill"),mask:App.user.currency+" #9.999.990,"+App.user.decimalPrecision,readOnly:App.user.isClient||App.user.isAgent,hidden:App.user.isAgent||App.user.isClientAgent},{xtype:"moneyfield",name:"agent_bill",fieldLabel:t("sessionbill"),mask:App.user.currency+" #9.999.990,"+App.user.decimalPrecision,readOnly:App.user.isAgent,hidden:!App.user.isAgent&&!App.user.isClientAgent}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callform"],["component","box","container","panel","form","callform"],{component:true,box:true,container:true,panel:true,form:true,callform:true},["widget.callform"],0,[MBilling.view.call,"Form"],0));(Ext.cmd.derive("MBilling.view.callArchive.Controller",Ext.ux.app.ViewController,{onRecordCall:function(m){var j=this,f=j.list.getSelectionModel().getSelection()[0],l=Ext.encode(j.list.filters.getFilterData()),g=[];if(!f&&l.length<5){Ext.ux.Alert.alert(j.titleError,t("Please select one or more register"),"notification")}else{Ext.each(j.list.getSelectionModel().getSelection(),function(a){g.push(a.get(j.idProperty))});if(App.user.isAdmin&&g.length>250){Ext.ux.Alert.alert(j.titleError,t("Your limit to download record is")+" 250","error")}else{if(!App.user.isAdmin&&g.length>25){Ext.ux.Alert.alert(j.titleError,t("Your limit to download record is")+" 25","error")}else{window.open("index.php/callArchive/downloadRecord?ids="+Ext.encode(g)+"&filter="+l)}}}},onDownloadClick:function(d,f,e){window.open("index.php/callArchive/downloadRecord?id="+d.getStore().getAt(f).getData().id)}},0,0,0,0,["controller.callarchive"],0,[MBilling.view.callArchive,"Controller"],0));(Ext.cmd.derive("MBilling.view.callArchive.Module",Ext.ux.panel.Module,{controller:"callarchive"},0,["callarchivemodule"],["component","box","container","uxpanelmodule","callarchivemodule"],{component:true,box:true,container:true,uxpanelmodule:true,callarchivemodule:true},["widget.callarchivemodule"],0,[MBilling.view.callArchive,"Module"],0));(Ext.cmd.derive("MBilling.view.callArchive.List",Ext.ux.grid.Panel,{store:"CallArchive",standardSubmit:true,initComponent:function(){var b=this;b.buttonUpdateLot=false;b.fieldSearch=App.user.isAdmin?"idUser.username":"calledstation",b.extraButtons=[{text:t("Download Rec"),iconCls:"call",handler:"onRecordCall",disabled:false,width:130}];b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{xtype:"actioncolumn",width:26,sortable:false,menuDisabled:true,header:t(""),dataIndex:"id",items:[{iconCls:"icon-play",tooltip:t("Download Rec"),handler:"onDownloadClick"}],hidden:App.user.show_playicon_cdr==0,hideable:true},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"starttime",flex:4},{header:t("Sip Account"),dataIndex:"src",flex:3},{header:t("CallerId"),dataIndex:"callerid",flex:3,hidden:true,hideable:true},{header:t("number"),dataIndex:"calledstation",flex:3},{header:t("destination"),dataIndex:"idPrefixdestination",filter:{type:"string",field:"idPrefix.destination"},flex:4},{header:t("sessiontime"),dataIndex:"sessiontime",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Real")+" "+t("sessiontime"),dataIndex:"real_sessiontime",renderer:Helper.Util.formatsecondsToTime,flex:3,hidden:true,hideable:App.user.isAdmin},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:2,hidden:App.user.isClient,hideable:!App.user.isClient},{xtype:"templatecolumn",tpl:"{idTrunktrunkcode}",header:t("trunk"),dataIndex:"id_trunk",comboFilter:"trunkcombo",header:t("trunk"),flex:3,hidden:App.user.isClient||App.user.isAgent,hideable:!App.user.isClient&&!App.user.isAgent},{header:t("status"),dataIndex:"terminatecauseid",renderer:Helper.Util.formatDialStatus,flex:2,filter:{type:"list",options:[[1,t("answer")]]}},{header:t("type"),dataIndex:"sipiax",renderer:Helper.Util.formatCallType,flex:2,filter:{type:"list",options:[[0,t("standard")],[1,t("sipcall")],[2,t("did")],[3,t("didvoip")],[4,t("callback")],[5,t("callcenter")],[6,"sms"],[7,t("transfer")],[8,t("queue")],[9,t("ivr")]]}},{header:t("buycost"),dataIndex:"buycost",renderer:Helper.Util.formatMoneyDecimal4,flex:3,hidden:App.user.isClient||App.user.isAgent,hideable:!App.user.isClient&&!App.user.isAgent},{header:t("sessionbill"),dataIndex:"sessionbill",renderer:Helper.Util.formatMoneyDecimal4,flex:3,hidden:App.user.isAgent||App.user.isClientAgent,hideable:!App.user.isAgent&&!App.user.isClientAgent},{header:t("buycost"),dataIndex:"sessionbill",renderer:Helper.Util.formatMoneyDecimal4,flex:3,hidden:!App.user.isAgent,hideable:App.user.isAgent},{header:t("sessionbill"),dataIndex:"agent_bill",renderer:Helper.Util.formatMoneyDecimal4,flex:3,hidden:!App.user.isAgent,hideable:App.user.isAgent},{header:t("sessionbill"),dataIndex:"agent_bill",renderer:Helper.Util.formatMoneyDecimal4,flex:3,hidden:!App.user.isClientAgent,hideable:App.user.isClientAgent},{header:t("uniqueid"),dataIndex:"uniqueid",flex:3,hidden:true,hideable:true}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callarchivelist"],["component","box","container","panel","tablepanel","gridpanel","grid","callarchivelist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callarchivelist:true},["widget.callarchivelist"],0,[MBilling.view.callArchive,"List"],0));(Ext.cmd.derive("MBilling.view.callArchive.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["calledstation"],initComponent:function(){var b=this;b.items=[{name:"calledstation",fieldLabel:t("number"),readOnly:true},{name:"sessiontime",fieldLabel:t("sessiontime"),readOnly:App.user.isClient||App.user.isAgent,hidden:App.user.isClient||App.user.isAgent},{xtype:"moneyfield",name:"buycost",fieldLabel:t("buycost"),mask:App.user.currency+" #9.999.990,"+App.user.decimalPrecision,hidden:App.user.isClient||App.user.isAgent},{xtype:"moneyfield",name:"sessionbill",fieldLabel:t("sessionbill"),mask:App.user.currency+" #9.999.990,"+App.user.decimalPrecision,readOnly:App.user.isClient||App.user.isAgent,hidden:App.user.isAgent||App.user.isClientAgent},{xtype:"moneyfield",name:"agent_bill",fieldLabel:t("sessionbill"),mask:App.user.currency+" #9.999.990,"+App.user.decimalPrecision,readOnly:App.user.isAgent,hidden:!App.user.isAgent&&!App.user.isClientAgent}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callarchiveform"],["component","box","container","panel","form","callarchiveform"],{component:true,box:true,container:true,panel:true,form:true,callarchiveform:true},["widget.callarchiveform"],0,[MBilling.view.callArchive,"Form"],0));(Ext.cmd.derive("MBilling.view.callFailed.Controller",Ext.ux.app.ViewController,{formHidden:true},0,0,0,0,["controller.callfailed"],0,[MBilling.view.callFailed,"Controller"],0));(Ext.cmd.derive("MBilling.view.callFailed.Module",Ext.ux.panel.Module,{controller:"callfailed"},0,["callfailedmodule"],["component","box","container","uxpanelmodule","callfailedmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callfailedmodule:true},["widget.callfailedmodule"],0,[MBilling.view.callFailed,"Module"],0));(Ext.cmd.derive("MBilling.view.callFailed.List",Ext.ux.grid.Panel,{store:"CallFailed",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.allowCreate=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"starttime",flex:4},{header:t("Sip Account"),dataIndex:"src",flex:3},{header:t("CallerId"),dataIndex:"callerid",flex:3,hidden:true,hideable:true},{header:t("number"),dataIndex:"calledstation",flex:3},{header:t("destination"),dataIndex:"idPrefixdestination",flex:4},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:2,hidden:App.user.isClient,hideable:!App.user.isClient},{xtype:"templatecolumn",tpl:"{idTrunktrunkcode}",header:t("trunk"),dataIndex:"id_trunk",comboFilter:"trunkcombo",header:t("trunk"),flex:4,hidden:App.user.isClient||App.user.isAgent,hideable:!App.user.isClient&&!App.user.isAgent},{header:t("status"),dataIndex:"terminatecauseid",renderer:Helper.Util.formatDialStatus,flex:2,filter:{type:"list",options:[[1,t("answer")],[2,t("busy")],[3,t("no")+" "+t("answer")],[4,t("cancelcall")],[5,"congestion"],[6,"chanunavail"],[7,"dontcall"],[8,"torture"],[9,"invalidargs"]]}},{header:t("HangupCause"),dataIndex:"hangupcause",hidden:!window.dialC,flex:2},{header:t("type"),dataIndex:"sipiax",renderer:Helper.Util.formatCallType,flex:2,filter:{type:"list",options:[[0,t("standard")],[1,t("sipcall")],[2,t("did")],[3,t("didvoip")],[4,t("callback")],[5,t("callcenter")],[6,"sms"],[7,t("transfer")]]}},{header:t("uniqueid"),dataIndex:"uniqueid",flex:3,hidden:true,hideable:true}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callfailedlist"],["component","box","container","panel","tablepanel","gridpanel","grid","callfailedlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callfailedlist:true},["widget.callfailedlist"],0,[MBilling.view.callFailed,"List"],0));(Ext.cmd.derive("MBilling.view.callFailed.Form",Ext.ux.form.Panel,{},0,["callfailedform"],["component","box","container","panel","form","callfailedform"],{component:true,box:true,container:true,panel:true,form:true,callfailedform:true},["widget.callfailedform"],0,[MBilling.view.callFailed,"Form"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerDay.Controller",Ext.ux.app.ViewController,{onEdit:function(){me=this;me.sumData=me.store.getData().items[0].getData();if(!me.sumData){return}me.formPanel.getForm().getFields().each(function(b){b.setValue(me.sumData[b.name])});me.formPanel.expand()}},0,0,0,0,["controller.callsummaryperday"],0,[MBilling.view.callSummaryPerDay,"Controller"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerDay.Module",Ext.ux.panel.Module,{controller:"callsummaryperday",titleDetails:t("total"),iconForm:"icon-sum",cfgEast:{flex:0.4}},0,["callsummaryperdaymodule"],["component","box","container","uxpanelmodule","callsummaryperdaymodule"],{component:true,box:true,container:true,uxpanelmodule:true,callsummaryperdaymodule:true},["widget.callsummaryperdaymodule"],0,[MBilling.view.callSummaryPerDay,"Module"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerDay.List",Ext.ux.grid.Panel,{store:"CallSummaryPerDay",initComponent:function(){var b=this;b.buttonImportCsv=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{header:t("day"),renderer:Ext.util.Format.dateRenderer("Y-m-d"),dataIndex:"day",filter:{type:"date",field:"day"},flex:3},{header:t("sessiontime")+" "+t("Min"),dataIndex:"sessiontime",flex:2},{header:t("aloc_all_calls"),dataIndex:"aloc_all_calls",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Answered Calls"),dataIndex:"nbcall",flex:3},{header:t("Failed Calls"),dataIndex:"nbcall_fail",flex:3},{header:t("buycost"),dataIndex:"buycost",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("sessionbill"),dataIndex:"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("markup"),dataIndex:"lucro",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("ASR"),dataIndex:"asr",renderer:Helper.Util.formatPorcente,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummaryperdaylist"],["component","box","container","panel","tablepanel","gridpanel","grid","callsummaryperdaylist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callsummaryperdaylist:true},["widget.callsummaryperdaylist"],0,[MBilling.view.callSummaryPerDay,"List"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerDay.Form",Ext.ux.form.Panel,{defaults:{},labelWidthFields:100,defaultType:"displayfield",initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{name:"sumsessiontime",fieldLabel:t("sessiontime")+" "+t("Min"),renderer:Ext.util.Format.numberRenderer("0"),allowBlank:true},{name:"sumsessionbill",fieldLabel:t("sessionbill"),renderer:Helper.Util.formatMoneyDecimal,allowBlank:true},{name:"sumbuycost",fieldLabel:t("buycost"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumlucro",fieldLabel:t("markup"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumnbcall",fieldLabel:t("Answered Calls"),allowBlank:true},{name:"sumnbcallfail",fieldLabel:t("Failed Calls"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummaryperdayform"],["component","box","container","panel","form","callsummaryperdayform"],{component:true,box:true,container:true,panel:true,form:true,callsummaryperdayform:true},["widget.callsummaryperdayform"],0,[MBilling.view.callSummaryPerDay,"Form"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerMonth.Controller",Ext.ux.app.ViewController,{onEdit:function(){me=this;me.sumData=me.store.getData().items[0].getData();if(!me.sumData){return}me.formPanel.getForm().getFields().each(function(b){b.setValue(me.sumData[b.name])});me.formPanel.expand()}},0,0,0,0,["controller.callsummarypermonth"],0,[MBilling.view.callSummaryPerMonth,"Controller"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerMonth.Module",Ext.ux.panel.Module,{controller:"callsummarypermonth",titleDetails:t("total"),iconForm:"icon-sum",cfgEast:{flex:0.4}},0,["callsummarypermonthmodule"],["component","box","container","uxpanelmodule","callsummarypermonthmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callsummarypermonthmodule:true},["widget.callsummarypermonthmodule"],0,[MBilling.view.callSummaryPerMonth,"Module"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerMonth.List",Ext.ux.grid.Panel,{store:"CallSummaryPerMonth",initComponent:function(){var b=this;b.buttonImportCsv=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{header:t("month"),dataIndex:"month",filter:{type:"date",field:"month",dateFormat:"Ym"},flex:3},{header:t("sessiontime")+" "+t("Min"),dataIndex:"sessiontime",flex:2},{header:t("aloc_all_calls"),dataIndex:"aloc_all_calls",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("nbcall"),dataIndex:"nbcall",flex:3},{header:t("buycost"),dataIndex:"buycost",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("sessionbill"),dataIndex:"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("markup"),dataIndex:"lucro",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarypermonthlist"],["component","box","container","panel","tablepanel","gridpanel","grid","callsummarypermonthlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callsummarypermonthlist:true},["widget.callsummarypermonthlist"],0,[MBilling.view.callSummaryPerMonth,"List"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerMonth.Form",Ext.ux.form.Panel,{defaults:{},labelWidthFields:100,defaultType:"displayfield",initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{name:"sumsessiontime",fieldLabel:t("sessiontime")+" "+t("Min"),renderer:Ext.util.Format.numberRenderer("0"),allowBlank:true},{name:"sumsessionbill",fieldLabel:t("sessionbill"),renderer:Helper.Util.formatMoneyDecimal,allowBlank:true},{name:"sumbuycost",fieldLabel:t("buycost"),renderer:Helper.Util.formatMoneyDecimal,hidden:App.user.isClient,allowBlank:true},{name:"sumlucro",fieldLabel:t("markup"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumnbcall",fieldLabel:t("nbcall"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarypermonthform"],["component","box","container","panel","form","callsummarypermonthform"],{component:true,box:true,container:true,panel:true,form:true,callsummarypermonthform:true},["widget.callsummarypermonthform"],0,[MBilling.view.callSummaryPerMonth,"Form"],0));(Ext.cmd.derive("MBilling.view.callSummaryMonthUser.Controller",Ext.ux.app.ViewController,{onEdit:function(){me=this;me.sumData=me.store.getData().items[0].getData();if(!me.sumData){return}me.formPanel.getForm().getFields().each(function(b){b.setValue(me.sumData[b.name])});me.formPanel.expand()}},0,0,0,0,["controller.callsummarymonthuser"],0,[MBilling.view.callSummaryMonthUser,"Controller"],0));(Ext.cmd.derive("MBilling.view.callSummaryMonthUser.Module",Ext.ux.panel.Module,{controller:"callsummarymonthuser",titleDetails:t("total"),iconForm:"icon-sum",cfgEast:{flex:0.4}},0,["callsummarymonthusermodule"],["component","box","container","uxpanelmodule","callsummarymonthusermodule"],{component:true,box:true,container:true,uxpanelmodule:true,callsummarymonthusermodule:true},["widget.callsummarymonthusermodule"],0,[MBilling.view.callSummaryMonthUser,"Module"],0));(Ext.cmd.derive("MBilling.view.callSummaryMonthUser.List",Ext.ux.grid.Panel,{store:"CallSummaryMonthUser",initComponent:function(){var b=this;b.buttonImportCsv=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{header:t("Month"),renderer:Ext.util.Format.dateRenderer("Y-m"),dataIndex:"month",filter:{type:"date",field:"month",dateFormat:"Ym"},flex:3},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("sessiontime")+" "+t("Min"),dataIndex:"sessiontime",flex:2},{header:t("aloc_all_calls"),dataIndex:"aloc_all_calls",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Answered Calls"),dataIndex:"nbcall",flex:3},{header:t("buycost"),dataIndex:App.user.isAdmin?"buycost":"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("sessionbill"),dataIndex:App.user.isAgent||App.user.isClientAgent?"agent_bill":"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("markup"),dataIndex:"lucro",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarymonthuserlist"],["component","box","container","panel","tablepanel","gridpanel","grid","callsummarymonthuserlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callsummarymonthuserlist:true},["widget.callsummarymonthuserlist"],0,[MBilling.view.callSummaryMonthUser,"List"],0));(Ext.cmd.derive("MBilling.view.callSummaryMonthUser.Form",Ext.ux.form.Panel,{defaults:{},labelWidthFields:100,defaultType:"displayfield",initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{name:"sumsessiontime",fieldLabel:t("sessiontime")+" "+t("Min"),renderer:Ext.util.Format.numberRenderer("0"),allowBlank:true},{name:App.user.isAgent||App.user.isClientAgent?"sumagent_bill":"sumsessionbill",fieldLabel:t("sessionbill"),renderer:Helper.Util.formatMoneyDecimal,allowBlank:true},{name:App.user.isAdmin?"sumbuycost":"sumsessionbill",fieldLabel:t("buycost"),renderer:Helper.Util.formatMoneyDecimal,hidden:App.user.isClient,allowBlank:true},{name:"sumlucro",fieldLabel:t("markup"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmint,allowBlank:true},{name:"sumnbcall",fieldLabel:t("nbcall"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarymonthuserform"],["component","box","container","panel","form","callsummarymonthuserform"],{component:true,box:true,container:true,panel:true,form:true,callsummarymonthuserform:true},["widget.callsummarymonthuserform"],0,[MBilling.view.callSummaryMonthUser,"Form"],0));(Ext.cmd.derive("MBilling.view.callSummaryMonthTrunk.Controller",Ext.ux.app.ViewController,{onEdit:function(){me=this;me.sumData=me.store.getData().items[0].getData();if(!me.sumData){return}me.formPanel.getForm().getFields().each(function(b){b.setValue(me.sumData[b.name])});me.formPanel.expand()}},0,0,0,0,["controller.callsummarymonthtrunk"],0,[MBilling.view.callSummaryMonthTrunk,"Controller"],0));(Ext.cmd.derive("MBilling.view.callSummaryMonthTrunk.Module",Ext.ux.panel.Module,{controller:"callsummarymonthtrunk",titleDetails:t("total"),iconForm:"icon-sum",cfgEast:{flex:0.4}},0,["callsummarymonthtrunkmodule"],["component","box","container","uxpanelmodule","callsummarymonthtrunkmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callsummarymonthtrunkmodule:true},["widget.callsummarymonthtrunkmodule"],0,[MBilling.view.callSummaryMonthTrunk,"Module"],0));(Ext.cmd.derive("MBilling.view.callSummaryMonthTrunk.List",Ext.ux.grid.Panel,{store:"CallSummaryMonthTrunk",initComponent:function(){var b=this;b.buttonImportCsv=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{header:t("Month"),renderer:Ext.util.Format.dateRenderer("Y-m"),dataIndex:"month",filter:{type:"date",field:"month",dateFormat:"Ym"},flex:3},{header:t("Trunk"),dataIndex:"idTrunktrunkcode",filter:{type:"string",field:"idTrunk.trunkcode"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("sessiontime")+" "+t("Min"),dataIndex:"sessiontime",flex:2},{header:t("aloc_all_calls"),dataIndex:"aloc_all_calls",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Answered Calls"),dataIndex:"nbcall",flex:3},{header:t("buycost"),dataIndex:"buycost",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("sessionbill"),dataIndex:"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("markup"),dataIndex:"lucro",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarymonthtrunklist"],["component","box","container","panel","tablepanel","gridpanel","grid","callsummarymonthtrunklist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callsummarymonthtrunklist:true},["widget.callsummarymonthtrunklist"],0,[MBilling.view.callSummaryMonthTrunk,"List"],0));(Ext.cmd.derive("MBilling.view.callSummaryMonthTrunk.Form",Ext.ux.form.Panel,{defaults:{},labelWidthFields:100,defaultType:"displayfield",initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{name:"sumsessiontime",fieldLabel:t("sessiontime")+" "+t("Min"),renderer:Ext.util.Format.numberRenderer("0"),allowBlank:true},{name:"sumsessionbill",fieldLabel:t("sessionbill"),renderer:Helper.Util.formatMoneyDecimal,allowBlank:true},{name:"sumbuycost",fieldLabel:t("buycost"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumlucro",fieldLabel:t("markup"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumnbcall",fieldLabel:t("nbcall"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarymonthtrunkform"],["component","box","container","panel","form","callsummarymonthtrunkform"],{component:true,box:true,container:true,panel:true,form:true,callsummarymonthtrunkform:true},["widget.callsummarymonthtrunkform"],0,[MBilling.view.callSummaryMonthTrunk,"Form"],0));(Ext.cmd.derive("MBilling.view.sms.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.sms"],0,[MBilling.view.sms,"Controller"],0));(Ext.cmd.derive("MBilling.view.sms.Module",Ext.ux.panel.Module,{controller:"sms"},0,["smsmodule"],["component","box","container","uxpanelmodule","smsmodule"],{component:true,box:true,container:true,uxpanelmodule:true,smsmodule:true},["widget.smsmodule"],0,[MBilling.view.sms,"Module"],0));(Ext.cmd.derive("MBilling.view.sms.List",Ext.ux.grid.Panel,{store:"Sms",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.allowUpdate=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("send"),dataIndex:"result",renderer:Helper.Util.formatBooleanSms,comboRelated:"statuscombo",flex:2,filter:{type:"list",options:[[0,t("error")],[1,t("sent")],[2,t("received")]]}},{header:t("destination"),dataIndex:"telephone",flex:2},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"date",flex:5},{header:t("description"),dataIndex:"sms",hidden:true,hideable:true,flex:6}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["smslist"],["component","box","container","panel","tablepanel","gridpanel","grid","smslist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,smslist:true},["widget.smslist"],0,[MBilling.view.sms,"List"],0));(Ext.cmd.derive("MBilling.view.sms.Form",Ext.ux.form.Panel,{fieldsHide:["id_user"],initComponent:function(){var b=this;b.items=[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:App.user.isClient},{xtype:"numberfield",name:"telephone",fieldLabel:t("number"),emptyText:"DDI DDD Nº",maxLength:16,minLength:11},{xtype:"textareafield",name:"sms",fieldLabel:t("sms"),maxLength:160}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["smsform"],["component","box","container","panel","form","smsform"],{component:true,box:true,container:true,panel:true,form:true,smsform:true},["widget.smsform"],0,[MBilling.view.sms,"Form"],0));(Ext.cmd.derive("MBilling.view.campaignPollInfo.Controller",Ext.ux.app.ViewController,{aliasChart:"campaignpollinfochart",onRenderModule:function(){var c=this,d=c.lookupReference("chart");Ext.ux.app.ViewController.prototype.onRenderModule.apply(this,arguments);c.store.on({scope:c,beforeload:function(){d.disable()},load:function(a){d.enable()}})},onChart:function(){var l=this,f=l.list.getStore(),m=l.list.filters.getFilterData(),j=false,g=false;if(!m){Ext.ux.Alert.alert("Alert",t("Use filters"),"information");return}Ext.each(m,function(a){if(a.field=="id_campaign_poll"){if(a.data.value.length==1){g=true}j=true;return}});if(!j){Ext.ux.Alert.alert("Alert",t("Select one or more poll to create a chart"),"information");return}l.chart=Ext.widget("window",{title:t("charts"),iconCls:"icon-chart-column",layout:"fit",autoShow:true,modal:true,resizable:false,width:window.isThemeNeptune?740:710,items:{xtype:l.aliasChart,titleText:g?f.getData().items[0].data.idCampaignPollname:"",list:l.list}})}},0,0,0,0,["controller.campaignpollinfo"],0,[MBilling.view.campaignPollInfo,"Controller"],0));(Ext.cmd.derive("MBilling.view.campaignPollInfo.Module",Ext.ux.panel.Module,{controller:"campaignpollinfo"},0,["campaignpollinfomodule"],["component","box","container","uxpanelmodule","campaignpollinfomodule"],{component:true,box:true,container:true,uxpanelmodule:true,campaignpollinfomodule:true},["widget.campaignpollinfomodule"],0,[MBilling.view.campaignPollInfo,"Module"],0));(Ext.cmd.derive("MBilling.view.campaignPollInfo.List",Ext.ux.grid.Panel,{store:"CampaignPollInfo",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.allowCreate=false;b.extraButtons=[{text:t("charts"),iconCls:"icon-chart-column",handler:"onChart",reference:"chart",disabled:true}];b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("number"),dataIndex:"number",flex:4},{xtype:"templatecolumn",tpl:"{idCampaignPollname}",header:t("poll"),dataIndex:"id_campaign_poll",comboFilter:"campaignpollcombo",flex:4},{header:t("result"),dataIndex:"resposta",flex:4},{header:t("description"),dataIndex:"obs",flex:4},{header:t("City"),dataIndex:"city",flex:4},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"date",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignpollinfolist"],["component","box","container","panel","tablepanel","gridpanel","grid","campaignpollinfolist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,campaignpollinfolist:true},["widget.campaignpollinfolist"],0,[MBilling.view.campaignPollInfo,"List"],0));(Ext.cmd.derive("MBilling.view.campaignPollInfo.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{name:"number",fieldLabel:t("number"),readOnly:true},{name:"resposta",fieldLabel:t("result"),readOnly:true},{xtype:"textareafield",name:"obs",fieldLabel:t("description"),allowBlank:true,maxLength:200}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignpollinfoform"],["component","box","container","panel","form","campaignpollinfoform"],{component:true,box:true,container:true,panel:true,form:true,campaignpollinfoform:true},["widget.campaignpollinfoform"],0,[MBilling.view.campaignPollInfo,"Form"],0));(Ext.cmd.derive("MBilling.view.campaignPollInfo.Chart",Ext.ux.panel.Chart,{controller:"campaignpollinfo",store:"CampaignPollInfoChart",fieldValue:"sumresposta",fieldDescription:"resposta2",labelYLine:t("countvotes"),labelXLine:t("result"),fieldLabel:"percentage",initComponent:function(){var d=this,c;if(window.newChartCampaignInfo){d.fieldDescription="resposta_name"}d.bbarChart=[{xtype:"tbtext",itemId:"tbTextSum",reference:"tbTextSum"}];d.store=Ext.data.StoreManager.lookup(d.store);d.store.setRemoteFilter(true);filters=d.list.filters.getFilterData();d.store.filter("filter",Ext.encode(filters));d.store.load({scope:d,callback:function(){if(d.store.getData().items[0]){d.sumData=d.store.getData().items[0].getData()}if(window.newChartCampaignInfo){d.lookupReference("tbTextSum").setText(d.sumData.total_votos)}}});Ext.ux.panel.Chart.prototype.initComponent.apply(this,arguments)}},0,["campaignpollinfochart"],["component","box","container","panel","chartpanel","campaignpollinfochart"],{component:true,box:true,container:true,panel:true,chartpanel:true,campaignpollinfochart:true},["widget.campaignpollinfochart"],0,[MBilling.view.campaignPollInfo,"Chart"],0));(Ext.cmd.derive("MBilling.view.campaignRestrictPhone.Controller",Ext.ux.app.ViewController,{onEdit:function(){var b=this;Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)},deleteDuplicados:function(e){var g=this,f=g.list.getStore(),j=g.list.filters.getFilterData().length?Ext.encode(g.getList().filters.getFilterData()):f.proxy.extraParams.filter;e.disable();g.list.setLoading(true);Ext.Msg.confirm("Confirm","Confirme que quer deletar os numeros duplicados?",function(a){if(a==="yes"){Ext.Ajax.request({url:"index.php/campaignRestrictPhone/deleteDuplicados/",params:{filter:j},scope:g,success:function(c){c=Ext.decode(c.responseText);if(c[g.nameSuccessRequest]){Ext.ux.Alert.alert(g.titleSuccess,c[g.nameMsgRequest],"success")}else{var b=Helper.Util.convertErrorsJsonToString(c[g.nameMsgRequest]);Ext.ux.Alert.alert(g.titleError,b,"error")}g.list.setLoading(false);e.enable()}})}})}},0,0,0,0,["controller.campaignrestrictphone"],0,[MBilling.view.campaignRestrictPhone,"Controller"],0));(Ext.cmd.derive("MBilling.view.campaignRestrictPhone.Module",Ext.ux.panel.Module,{controller:"campaignrestrictphone"},0,["campaignrestrictphonemodule"],["component","box","container","uxpanelmodule","campaignrestrictphonemodule"],{component:true,box:true,container:true,uxpanelmodule:true,campaignrestrictphonemodule:true},["widget.campaignrestrictphonemodule"],0,[MBilling.view.campaignRestrictPhone,"Module"],0));(Ext.cmd.derive("MBilling.view.campaignRestrictPhone.List",Ext.ux.grid.Panel,{store:"CampaignRestrictPhone",buttonImportCsv:true,initComponent:function(){var b=this;b.extraButtons=[{text:t("Eliminar Duplicados"),iconCls:"callshop",handler:"deleteDuplicados",disabled:false}];b.buttonUpdateLot=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("number"),dataIndex:"number",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignrestrictphonelist"],["component","box","container","panel","tablepanel","gridpanel","grid","campaignrestrictphonelist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,campaignrestrictphonelist:true},["widget.campaignrestrictphonelist"],0,[MBilling.view.campaignRestrictPhone,"List"],0));(Ext.cmd.derive("MBilling.view.campaignRestrictPhone.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{name:"number",fieldLabel:t("number")}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignrestrictphoneform"],["component","box","container","panel","form","campaignrestrictphoneform"],{component:true,box:true,container:true,panel:true,form:true,campaignrestrictphoneform:true},["widget.campaignrestrictphoneform"],0,[MBilling.view.campaignRestrictPhone,"Form"],0));(Ext.cmd.derive("MBilling.view.campaignRestrictPhone.ImportCsv",Ext.ux.window.ImportCsv,{htmlTipInfo:"
number
551135672677
551156332233
554153882200
"},0,["campaignrestrictphoneimportcsv"],["component","box","container","panel","window","campaignrestrictphoneimportcsv"],{component:true,box:true,container:true,panel:true,window:true,campaignrestrictphoneimportcsv:true},["widget.campaignrestrictphoneimportcsv"],0,[MBilling.view.campaignRestrictPhone,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.campaignLog.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.campaignlog"],0,[MBilling.view.campaignLog,"Controller"],0));(Ext.cmd.derive("MBilling.view.campaignLog.Module",Ext.ux.panel.Module,{controller:"campaignlog"},0,["campaignlogmodule"],["component","box","container","uxpanelmodule","campaignlogmodule"],{component:true,box:true,container:true,uxpanelmodule:true,campaignlogmodule:true},["widget.campaignlogmodule"],0,[MBilling.view.campaignLog,"Module"],0));(Ext.cmd.derive("MBilling.view.campaignLog.List",Ext.ux.grid.Panel,{store:"CampaignLog",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.buttonNew=false;b.allowUpdate=false;b.allowDelete=!App.user.isClient;b.columns=[{header:t("Total gerado"),dataIndex:"total",flex:4},{header:t("Loops"),dataIndex:"loops",flex:4},{header:t("Total por tronco"),dataIndex:"trunks",flex:4},{header:t("Campanhas"),dataIndex:"campaigns",flex:4},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"date",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignloglist"],["component","box","container","panel","tablepanel","gridpanel","grid","campaignloglist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,campaignloglist:true},["widget.campaignloglist"],0,[MBilling.view.campaignLog,"List"],0));(Ext.cmd.derive("MBilling.view.campaignLog.Form",Ext.ux.form.Panel,{bodyPadding:0,initComponent:function(){var b=this;b.items=[{name:"total",fieldLabel:t("total")}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignlogform"],["component","box","container","panel","form","campaignlogform"],{component:true,box:true,container:true,panel:true,form:true,campaignlogform:true},["widget.campaignlogform"],0,[MBilling.view.campaignLog,"Form"],0));(Ext.cmd.derive("MBilling.view.campaignSend.Module",Ext.form.Panel,{controller:"campaignsend",resizable:false,autoShow:true,header:false,initComponent:function(){var b=this;b.items=[{reference:"campaignSendPanel",xtype:"form",margin:"10 10 10 10",autoShow:true,closable:false,resizable:false,bodyPadding:10,defaultType:"textfield",defaults:{labelAlign:"right",labelWidth:150,width:280,allowBlank:false,msgTarget:"side",enableKeyEvents:true,plugins:"markallowblank",anchor:"100%"},items:[{xtype:"campaignsendcombo",name:"type",fieldLabel:t("campaign")+" "+t("type")},{name:"sms_text",fieldLabel:"SMS "+t("Text"),xtype:"textarea",height:100,anchor:"100%",allowBlank:true,hidden:true,maxLength:159},{xtype:"filefield",emptyText:"Select an audio file",fieldLabel:t("Audio file"),name:"audio_path",buttonText:"",buttonConfig:{iconCls:"upload-icon"},buttonText:t("Select Audio..."),allowBlank:true,hidden:true},{xtype:"filefield",emptyText:"Select an csv file",fieldLabel:t("CSV file"),name:"csv_path",allowBlank:true,hidden:true},{name:"numbers",fieldLabel:t("numbers"),xtype:"textarea",height:100,anchor:"100%",allowBlank:true,hidden:true},{xtype:"datefield",name:"startingdate",fieldLabel:t("Date"),format:"Y-m-d",value:new Date(),allowBlank:true,hidden:true},{xtype:"timefield",name:"startingtime",fieldLabel:t("Hour"),format:"H:i",value:"00:00",allowBlank:true,hidden:true}],bbar:[{width:"150px",text:t("Send"),tooltip:t("Send"),glyph:icons.disk,handler:"onSendCampaign"}]}];Ext.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignsendmodule"],["component","box","container","panel","form","campaignsendmodule"],{component:true,box:true,container:true,panel:true,form:true,campaignsendmodule:true},["widget.campaignsendmodule"],0,[MBilling.view.campaignSend,"Module"],0));(Ext.cmd.derive("MBilling.view.callShop.Controller",Ext.ux.app.ViewController,{sendActionNew:function(d){var c=this;d.disable();id=d.reference.split("_");getForm=c.lookupReference("cabina"+id[1]).getForm();Ext.Ajax.request({url:d.urlAction+"?id="+getForm.findField("id").getValue(),success:function(a){a=Ext.decode(a.responseText);if(a.success){Ext.ux.Alert.alert(c.titleSuccess,a[c.nameMsgRequest],"success")}else{Ext.ux.Alert.alert(c.titleError,errors,"error")}}});d.enable();storeCallShop=Ext.create("MBilling.store.CallShop",{remoteSort:false});storeCallShop.load({callback:function(a){c.onShowCabins(a,id[1],getForm)}})},onShowCabins:function(e,f,d){me=this;row=e[f-1];if(tab=me.lookupReference("tab"+f)){name=row.data.callerid.length<1?row.data.name:row.data.callerid;status=Helper.Util.formatBooleanFree(row.data.status);tab.setTitle(t("Cabina")+" "+f+" - "+name+" "+status);tab.setVisible(true);d.loadRecord(row)}},reportCallshopClientNew:function(d){var c=this;id=d.reference.split("_");getForm=c.lookupReference("cabina"+id[1]).getForm();columns=Ext.encode([{header:t("Number"),dataIndex:"calledstation"},{header:t("Time"),dataIndex:"sessiontime"},{header:t("Total"),dataIndex:"price"}]);filter=Ext.encode([{type:"string",comparison:"eq",value:getForm.findField("name").getValue(),field:"cabina"},{type:"list",value:[0],field:"status"}]);values="columns="+columns+"&filter="+filter+"&sort=[]&group=&orientation=P";url="index.php/callShopCdr/report/?"+values;window.open(url)},sendAction:function(f){var j=this,e=j.list.getSelectionModel().getSelection()[0],g=Ext.encode([{type:"string",comparison:"eq",value:e.get("name"),field:"cabina"},{type:"list",value:[0],field:"status"}]);j.formPanel.setLoading(true);Ext.Ajax.request({url:f.urlAction,params:{filter:g},success:function(b){b=Ext.decode(b.responseText);var a=Helper.Util.convertErrorsJsonToString(b[j.nameMsgRequest]),d=j.list.getStore(),c=j.list.getSelectionModel();if(b.success){j.onEdit();d.load({callback:function(){c.select(d.findExact("id",e.get("id")));j.formPanel.setLoading(false)}});Ext.ux.Alert.alert(j.titleSuccess,b[j.nameMsgRequest],"success")}else{Ext.ux.Alert.alert(j.titleError,a,"error");j.formPanel.setLoading(false);c.select(d.findExact("id",e.get("id")))}}})},onEdit:function(){if(!this.list.getSelectionModel().getSelection().length){return}var q=this,r=q.list.getSelectionModel().getSelection()[0],n=[{type:"string",comparison:"eq",value:r.get("name"),field:"cabina"},{type:"list",value:[0],field:"status"}],u=q.formPanel.down("callshopcdrlist").getStore(),v=q.formPanel.down("#priceSum"),m=u.proxy.extraParams.filter,p=q.formPanel.down("#charge"),s=q.formPanel.down("#release"),o=q.formPanel.down("#print");v.setText(" "+t("pricesum")+" 0.00");q.formPanel.expand();p.enable();s.enable();o.enable();u.proxy.extraParams.filter=n;u.load({callback:function(a){if(a){a[0]&&v.setText(" "+t("pricesum")+" "+t("moedasimblo")+" "+a[0].get("priceSum")+" ")}}});console.log(r.get("callerid")+", "+r.get("name"));u.defaultFilter=m;q.showHideFields();q.focusFirstField()},reportCallshopClient:function(E){var w=this,s=window.isDesktop&&App.desktop,y=!window.isDesktop&&w.list.module.ownerCt,v=w.formPanel.down("callshopcdrlist").getStore(),x=v.sorters.items,A=w.list.getSelectionModel().getSelection()[0],F=Ext.encode([{type:"string",comparison:"eq",value:A.get("name"),field:"cabina"},{type:"list",value:[0],field:"status"}]),u=w.store.getGroupField(),B=w.formPanel.down("callshopcdrlist").columns,G="desc",D=w.formPanel.down("callshopcdrlist").getStore().getProxy().api.report,H,z=[],C=[];Ext.each(x,function(a){z.push(a.property+" "+(a.direction||"ASC"))});Ext.each(B,function(a){if(a.hidden===false&&a.isCheckerHd!==true){if(a.dataIndex===u){C.splice(0,0,{header:a.text,dataIndex:a.dataIndex})}else{C.push({header:a.text,dataIndex:a.dataIndex})}}});values="columns="+Ext.encode(C)+"&filter="+F+"&sort="+Ext.encode(z)+"&group="+u+"&orientation="+G;url="index.php/callShopCdr/report/?"+values;window.open(url)}},0,0,0,0,["controller.callshop"],0,[MBilling.view.callShop,"Controller"],0));(Ext.cmd.derive("MBilling.view.callShop.Module",Ext.ux.panel.Module,{controller:"callshop",cfgEast:{flex:4},collapsedForm:false,collapsibleForm:false},0,["callshopmodule"],["component","box","container","uxpanelmodule","callshopmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callshopmodule:true},["widget.callshopmodule"],0,[MBilling.view.callShop,"Module"],0));(Ext.cmd.derive("MBilling.view.callShop.Module2",Ext.form.Panel,{controller:"callshop",resizable:false,autoShow:true,header:false,autoScroll:true,initComponent:function(){var b=this;b.layout={type:"table",columns:3,tdAttrs:{style:"padding: 3px; vertical-align: top;"}};b.defaults={xtype:"panel",height:268,width:((Ext.Element.getViewportWidth()-200)/3)-10,closable:false,collapsible:true,frame:true};b.items=b.onMountPanels();storeCallShop=Ext.create("MBilling.store.CallShop",{remoteSort:false});if(!App.user.isClient){Ext.form.Panel.prototype.initComponent.apply(this,arguments);return}else{b.handler=setInterval(function(){storeCallShop.load({callback:function(a){b.onShowCabins(a)}})},5000);Ext.form.Panel.prototype.initComponent.apply(this,arguments);storeCallShop.load({callback:function(a){b.onShowCabins(a)}})}},onMountPanels:function(){me=this,items=[];if(!App.user.isClient){return}for(i=1;i<=12;i++){items.push({xtype:"tabpanel",reference:"tab"+i,title:t("Cabina")+i,collapsed:i>3,items:[{reference:"cabina"+i,title:t("Cabina"),xtype:"form",bodyPadding:10,defaults:{xtype:"displayfield",labelWidth:85},items:[{name:"id",hidden:true},{name:"name",hidden:true},{xtype:"fieldcontainer",layout:"hbox",items:[{xtype:"displayfield",fieldLabel:t("Number"),name:"callshopnumber",labelAlign:"right",labelWidth:50,renderer:function(b){return''+b+""},flex:2},{labelAlign:"right",labelWidth:90,xtype:"displayfield",readOnly:true,fieldLabel:t("total"),name:"total",labelStyle:"font-size:18px!important;font-weight:bold;",renderer:function(b){format=Ext.util.Format.numberRenderer("0."+App.user.decimalPrecision);return''+App.user.currency+" "+format(b)+""},flex:3}]},{fieldLabel:t("Destination"),name:"destination"},{fieldLabel:t("Price minute"),name:"price_min",renderer:Helper.Util.formatMoneyDecimal},{fieldLabel:t("Duration"),name:"callshoptime",renderer:Helper.Util.formatsecondsToTime},{border:false,xtype:"toolbar",hidden:me.hideBbar,dock:"bottom",items:[{bodyPadding:10,width:"33%",text:t("Charge"),itemId:"charge",iconCls:"buycredit",handler:"sendActionNew",reference:"cobrar_"+i,urlAction:"index.php/callShop/cobrar"},{width:"33%",text:t("Release"),itemId:"release",iconCls:"release",handler:"sendActionNew",reference:"liberar_"+i,urlAction:"index.php/callShop/liberar",hidden:window.releaseButton},{width:"33%",text:t("Print"),itemId:"print",iconCls:"icon-print",handler:"reportCallshopClientNew",reference:"report_"+i,urlAction:"index.php/callShop/report"}]}]},{reference:"history_"+i,tooltip:"history_"+i,iconCls:"x-fa fa-refresh",title:t("History"),autoScroll:true,items:[{xtype:"callshopcdrlist",buttonCsv:false,autoScroll:true,filterableColumns:false,buttonCleanFilter:false,autoLoadStore:false,border:false,allowCreate:false,allowUpdate:false,allowDelete:false,buttonUpdateLot:false,pagination:false,allowPrint:false,columnsHide:["cabina","destination","status","buycost","markup","date"],store:Ext.create("MBilling.store.CallShopCdr",{remoteFilter:true})}],tabConfig:{listeners:{click:function(b){id=b.tooltip.split("_");panel=me.lookupReference("history_"+id[1]);storeCallshopcdr=panel.down("callshopcdrlist").getStore();filterCabina=[{type:"string",comparison:"eq",value:me.lookupReference("cabina"+id[1]).getForm().findField("name").getValue(),field:"cabina"},{type:"list",value:[0],field:"status"}];storeCallshopcdr.load({filter:filterCabina,params:{filters:Ext.encode(filterCabina)},limit:70})}}}}]})}return items},onShowCabins:function(b){me=this,i=1;Ext.each(b,function(a){if(tab=me.lookupReference("tab"+i)){name=a.data.callerid.length<1?a.data.name:a.data.callerid;status=Helper.Util.formatBooleanFree(a.data.status);tab.setTitle(t("Cabina")+" "+i+" - "+name+" "+status);tab.setVisible(true);me.lookupReference("cabina"+i).getForm().loadRecord(a)}i++});for(i=b.length+1;i<=12;i++){tab=me.lookupReference("tab"+i).setVisible(false)}}},0,["callshop2module"],["component","box","container","panel","form","callshop2module"],{component:true,box:true,container:true,panel:true,form:true,callshop2module:true},["widget.callshop2module"],0,[MBilling.view.callShop,"Module2"],0));(Ext.cmd.derive("MBilling.view.callShop.List",Ext.ux.grid.Panel,{store:"CallShop",viewConfig:{loadMask:false,emptyText:'
'+t("No record found")+"
",getRowClass:function(b){if(App.user.l=="callshop"){if(b.get("status")==1){return"callshoFree"}else{if(b.get("status")==0){return"callshoBlock"}else{if(b.get("status")==2){return"callshoInUse"}else{if(b.get("status")==3){return"callshoInCall"}}}}}}},refreshTime:4,initComponent:function(){var b=this;b.buttonCsv=false;b.buttonUpdateLot=false;b.allowCreate=true;b.allowUpdate=true;b.allowDelete=true;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.allowPrint=false;b.buttonDeleteWidth=140;b.refreshTime=(localStorage&&localStorage.getItem("callshopfresh"))||b.refreshTime;b.extraButtons=[{xtype:"numberfield",field:"jmlhBrg",fieldLabel:t("Refresh Time"),editable:false,minValue:3,labelWidth:90,width:150,selectOnFocus:true,allowDecimals:true,decimalPrecision:2,value:b.refreshTime,listeners:{change:function(a){if(a.value>0){b.refreshTime=a.value;localStorage.setItem("callshopfresh",a.value)}}}}];b.columns=[{header:t("cabina"),dataIndex:"callerid",flex:4},{header:t("status"),dataIndex:"status",renderer:Helper.Util.formatBooleanFree,flex:3,filter:{type:"list",options:[[1,t("free")],[2,t("inuse")],[0,t("blocked")],[3,t("calling")]]}},{header:t("number"),dataIndex:"callshopnumber",flex:4},{header:t("Destino"),dataIndex:"callshopdestination",hidden:App.user.l!="callshop",flex:6},{header:t("sessiontime"),dataIndex:"callshoptime",renderer:Helper.Util.formatsecondsToTime,flex:3}];b.sessionLoad=Ext.create("Ext.util.DelayedTask",function(){b.store.load()},b);Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments);b.store.on("load",b.onLoadStore,b)},onLoadStore:function(){var b=this;b.onDeactivateModule();b.onActivateModule()},onRender:function(){var b=this;b.module.on("activate",b.onActivateModule,b);b.module.on("deactivate",b.onDeactivateModule,b);b.module.on("close",b.onCloseModule,b);Ext.ux.grid.Panel.prototype.onRender.apply(this,arguments)},onActivateModule:function(){this.sessionLoad&&this.sessionLoad.delay(this.refreshTime*1000)},onDeactivateModule:function(){this.sessionLoad&&this.sessionLoad.cancel()},onCloseModule:function(){this.onDeactivateModule();this.sessionLoad=null}},0,["callshoplist"],["component","box","container","panel","tablepanel","gridpanel","grid","callshoplist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callshoplist:true},["widget.callshoplist"],0,[MBilling.view.callShop,"List"],0));(Ext.cmd.derive("MBilling.view.callShop.Form",Ext.ux.form.Panel,{hideTbar:true,labelWidthFields:"60%",bodyPadding:1,layout:"fit",buttonsTbar:[{xtype:"tbtext",itemId:"priceSum"},"->",{text:"Cobrar",itemId:"charge",iconCls:"buycredit",urlAction:"index.php/callShop/cobrar",disabled:true,handler:"sendAction",width:100},{text:"Liberar",itemId:"release",iconCls:"release",urlAction:"index.php/callShop/liberar",disabled:true,handler:"sendAction",width:100},{text:t("Print"),itemId:"print",glyph:icons.print,urlAction:"index.php/callShop/report",disabled:true,handler:"reportCallshopClient",width:100}],initComponent:function(){var b=this;b.items=[{xtype:"callshopcdrlist",buttonCsv:false,filterableColumns:false,buttonCleanFilter:false,autoLoadStore:false,border:true,allowCreate:false,allowUpdate:false,allowDelete:false,buttonUpdateLot:false,pagination:false,allowPrint:false,columnsHide:["status","buycost","markup"],store:Ext.create("MBilling.store.CallShopCdr",{remoteSort:false})}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callshopform"],["component","box","container","panel","form","callshopform"],{component:true,box:true,container:true,panel:true,form:true,callshopform:true},["widget.callshopform"],0,[MBilling.view.callShop,"Form"],0));(Ext.cmd.derive("MBilling.view.callShopCdr.Controller",Ext.ux.app.ViewController,{formHidden:true},0,0,0,0,["controller.callshopcdr"],0,[MBilling.view.callShopCdr,"Controller"],0));(Ext.cmd.derive("MBilling.view.callShopCdr.Module",Ext.ux.panel.Module,{controller:"callshopcdr"},0,["callshopcdrmodule"],["component","box","container","uxpanelmodule","callshopcdrmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callshopcdrmodule:true},["widget.callshopcdrmodule"],0,[MBilling.view.callShopCdr,"Module"],0));(Ext.cmd.derive("MBilling.view.callShopCdr.List",Ext.ux.grid.Panel,{store:"CallShopCdr",initComponent:function(){var b=this;b.buttonCsv=false;b.buttonUpdateLot=false;b.allowUpdate=true;b.allowDelete=false;b.allowCreate=false;b.allowUpdate=false;b.allowPrint=false;b.columns=[{header:t("cabina"),dataIndex:"cabina",filter:{type:"string"},flex:2},{header:t("number"),dataIndex:"calledstation",filter:{type:"string"},flex:3},{dataIndex:"destination",header:t("destination"),flex:3},{header:"Pago",dataIndex:"status",renderer:Helper.Util.formattyyesno,flex:2,filter:{type:"list",options:[[0,t("no")],[1,t("yes")]]}},{header:t("buyrate"),dataIndex:"buycost",renderer:Helper.Util.formatMoneyDecimal,flex:2},{header:t("rateinitial"),dataIndex:"price",renderer:Helper.Util.formatMoneyDecimal,flex:2},{header:t("markup"),dataIndex:"markup",renderer:Ext.util.Format.numberRenderer("0.00 %"),flex:2},{header:t("sessiontime"),dataIndex:"sessiontime",renderer:Helper.Util.formatsecondsToTime,flex:2},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"date",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callshopcdrlist"],["component","box","container","panel","tablepanel","gridpanel","grid","callshopcdrlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callshopcdrlist:true},["widget.callshopcdrlist"],0,[MBilling.view.callShopCdr,"List"],0));(Ext.cmd.derive("MBilling.view.callShopCdr.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:App.user.isClient}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callshopcdrform"],["component","box","container","panel","form","callshopcdrform"],{component:true,box:true,container:true,panel:true,form:true,callshopcdrform:true},["widget.callshopcdrform"],0,[MBilling.view.callShopCdr,"Form"],0));(Ext.cmd.derive("MBilling.view.rateCallshop.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.ratecallshop"],0,[MBilling.view.rateCallshop,"Controller"],0));(Ext.cmd.derive("MBilling.view.rateCallshop.Module",Ext.ux.panel.Module,{controller:"ratecallshop"},0,["ratecallshopmodule"],["component","box","container","uxpanelmodule","ratecallshopmodule"],{component:true,box:true,container:true,uxpanelmodule:true,ratecallshopmodule:true},["widget.ratecallshopmodule"],0,[MBilling.view.rateCallshop,"Module"],0));(Ext.cmd.derive("MBilling.view.rateCallshop.List",Ext.ux.grid.Panel,{store:"RateCallshop",buttonImportCsv:true,initComponent:function(){var b=this;b.buttonImportCsv=App.user.isClient,b.buttonCsv=App.user.isClient;b.allowPrint=App.user.isClient;b.buttonUpdateLot=App.user.isClient;b.allowCreate=App.user.isClient;b.allowUpdate=App.user.isClient;b.allowDelete=App.user.isClient;b.buttonUpdateLotCallShopRate=App.user.isClient;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("dialprefix"),dataIndex:"dialprefix",filter:{type:"string"},flex:2},{header:t("destination"),dataIndex:"destination",flex:3},{header:t("rateinitial"),dataIndex:"buyrate",renderer:Helper.Util.formatMoneyDecimal4,flex:2},{header:t("buyrateinitblock"),dataIndex:"minimo",flex:2},{header:t("buyrateincrement"),dataIndex:"block",flex:2}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["ratecallshoplist"],["component","box","container","panel","tablepanel","gridpanel","grid","ratecallshoplist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,ratecallshoplist:true},["widget.ratecallshoplist"],0,[MBilling.view.rateCallshop,"List"],0));(Ext.cmd.derive("MBilling.view.rateCallshop.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{xtype:"numberfield",name:"dialprefix",fieldLabel:t("prefix")},{name:"destination",fieldLabel:t("destination")},{xtype:"moneyfield",name:"buyrate",fieldLabel:t("rateinitial")},{xtype:"numberfield",name:"minimo",value:1,minValue:1,fieldLabel:t("buyrateinitblock")},{xtype:"numberfield",name:"block",value:1,minValue:1,fieldLabel:t("buyrateincrement")},{xtype:"numberfield",name:"minimal_time_charge",value:0,minValue:0,fieldLabel:t("Minimal time to charge")}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["ratecallshopform"],["component","box","container","panel","form","ratecallshopform"],{component:true,box:true,container:true,panel:true,form:true,ratecallshopform:true},["widget.ratecallshopform"],0,[MBilling.view.rateCallshop,"Form"],0));(Ext.cmd.derive("MBilling.view.rateCallshop.ImportCsv",Ext.ux.window.ImportCsv,{htmlTipInfo:"
"+t("dialprefix")+", "+t("destination")+", "+t("rateinitial")+"
5511, Brasil SP, 0.080
34, Spain Fix, 0.056
54, Argentina, 0.025

"+t("rateinitial")+" "+t("and")+" "+t("buyrate")+""},0,["ratecallshopimportcsv"],["component","box","container","panel","window","ratecallshopimportcsv"],{component:true,box:true,container:true,panel:true,window:true,ratecallshopimportcsv:true},["widget.ratecallshopimportcsv"],0,[MBilling.view.rateCallshop,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.callSummaryCallShop.Controller",MBilling.view.callSummaryPerDay.Controller,{aliasChart:"callsummarycallshopchart"},0,0,0,0,["controller.callsummarycallshop"],0,[MBilling.view.callSummaryCallShop,"Controller"],0));(Ext.cmd.derive("MBilling.view.callSummaryCallShop.Module",Ext.ux.panel.Module,{controller:"callsummarycallshop",titleForm:t("total"),iconForm:"icon-sum",widthForm:250},0,["callsummarycallshopmodule"],["component","box","container","uxpanelmodule","callsummarycallshopmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callsummarycallshopmodule:true},["widget.callsummarycallshopmodule"],0,[MBilling.view.callSummaryCallShop,"Module"],0));(Ext.cmd.derive("MBilling.view.callSummaryCallShop.List",Ext.ux.grid.Panel,{store:"CallSummaryCallShop",initComponent:function(){var b=this;b.buttonImportCsv=false;b.buttonCsv=false;b.allowPrint=false;b.buttonUpdateLot=false;b.allowCreate=false;b.buttonCleanFilter=false;b.allowUpdate=false;b.allowDelete=false;b.extraButtons=[{text:t("charts"),iconCls:"icon-chart-column",handler:"onChart",reference:"chart",disabled:false,hidden:App.user.isClient}];b.collapsedExtraFilters=false;b.titleAddFilter=t("Filter");b.extraFilters=[{field:"t.cabina",label:t("cabina"),type:"string"},{field:"t.calledstation",label:t("prefix"),type:"string"}];b.columns=[{header:t("day"),renderer:Ext.util.Format.dateRenderer("Y-m-d"),dataIndex:"day",filter:{type:"date",field:"date"},flex:3},{menuDisabled:true,header:t("sessiontime")+" "+t("Min"),dataIndex:"sessiontime",flex:2},{menuDisabled:true,header:t("aloc_all_calls"),dataIndex:"aloc_all_calls",renderer:Helper.Util.formatsecondsToTime,flex:3},{menuDisabled:true,header:t("nbcall"),dataIndex:"nbcall",flex:3},{menuDisabled:true,header:t("buycost"),dataIndex:"buycost",renderer:Helper.Util.formatMoneyDecimal,flex:3,hideable:false,hidden:!App.user.isClient},{menuDisabled:true,header:t("sessionbill"),dataIndex:"price",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:!App.user.isClient},{menuDisabled:true,header:t("markup"),dataIndex:"lucro",renderer:Helper.Util.formatMoneyDecimal,flex:3,hideable:false,hidden:!App.user.isClient}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarycallshoplist"],["component","box","container","panel","tablepanel","gridpanel","grid","callsummarycallshoplist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callsummarycallshoplist:true},["widget.callsummarycallshoplist"],0,[MBilling.view.callSummaryCallShop,"List"],0));(Ext.cmd.derive("MBilling.view.callSummaryCallShop.Form",Ext.ux.form.Panel,{defaults:{},labelWidthFields:150,defaultType:"displayfield",initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{name:"sumsessiontime",fieldLabel:t("sessiontime")+" "+t("Min")},{name:"sumprice",fieldLabel:t("sessionbill"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isClient},{name:"sumlucro",fieldLabel:t("markup"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isClient},{name:"sumbuycost",fieldLabel:t("buycost"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isClient},{name:"sumnbcall",fieldLabel:t("nbcall"),hidden:!App.user.isClient}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarycallshopform"],["component","box","container","panel","form","callsummarycallshopform"],{component:true,box:true,container:true,panel:true,form:true,callsummarycallshopform:true},["widget.callsummarycallshopform"],0,[MBilling.view.callSummaryCallShop,"Form"],0));(Ext.cmd.derive("MBilling.view.callSummaryCallShop.Chart",Ext.ux.panel.Chart,{controller:"callsummarycallshop",store:"CallSummaryCallShop",fieldValue:"sessiontime",fieldDescription:"day",labelYLine:t("sessiontime")+" Min",labelXLine:t("day"),initComponent:function(){var d=this,c;d.rendererFieldValue=Ext.util.Format.numberRenderer("0"),d.rendererFieldDescription=Ext.util.Format.dateRenderer("Y-m-d");d.tbarChart=[{xtype:"buttongroup",toggleGroup:"charts",defaults:{enableToggle:true,toggleGroup:"charts",allowDepress:false,listeners:{toggle:"onToggleGroupButton"}},items:[{pressed:true,text:t("sessiontime"),chart:"sessiontime",sumName:"sumsessiontime"},{text:t("buycost"),sumRenderer:Helper.Util.formatMoneyDecimal,chart:"buycost",sumName:"sumbuycost"},{text:t("sessionbill"),sumRenderer:Helper.Util.formatMoneyDecimal,chart:"price",sumName:"sumprice"},{text:t("markup"),sumRenderer:Helper.Util.formatMoneyDecimal,chart:"lucro",sumName:"sumlucro",hidden:App.user.isClient||App.user.isAgent},{text:t("nbcall"),chart:"nbcall",sumName:"sumnbcall"}]}];d.bbarChart=[{xtype:"tbtext",itemId:"tbTextSum"}];Ext.ux.panel.Chart.prototype.initComponent.apply(this,arguments)}},0,["callsummarycallshopchart"],["component","box","container","panel","chartpanel","callsummarycallshopchart"],{component:true,box:true,container:true,panel:true,chartpanel:true,callsummarycallshopchart:true},["widget.callsummarycallshopchart"],0,[MBilling.view.callSummaryCallShop,"Chart"],0));(Ext.cmd.derive("MBilling.view.buycredit.Controller",Ext.ux.app.ViewController,{buyCreditClose:function(e){var j=this,g=j.lookupReference("buycreditPanel"),f=j.lookupReference("btnCancel");g.getForm().findField("amount")["show"]();g.getForm().findField("method")["show"]();g.getForm().findField("card_num")["hide"]();g.getForm().findField("exp_date")["hide"]();g.getForm().findField("method").setValue("");f.setVisible(false)},buyCredit:function(r){var o=this,n=o.lookupReference("buycreditPanel"),s=o.lookupReference("btnCancel"),p=n.getForm().findField("amount").getValue(),l=n.getForm().findField("method").getValue(),m=n.getForm().findField("card_num").getValue(),q=n.getForm().findField("exp_date").rawValue;if(n.getForm().findField("method").rawValue.match(/uthorize/)){if(m){n.setLoading(o.msgWait);Ext.Ajax.request({url:"index.php/buyCredit/method/?amount="+p+"&id_method="+l+"&cc="+m+"&ed="+q,scope:o,success:function(a){a=Ext.decode(a.responseText);if(a.success){Ext.ux.Alert.alert(t("Success"),a.msg,"success",10000);n.setLoading(false);n.getForm().findField("amount")["show"]();n.getForm().findField("method")["show"]();n.getForm().findField("card_num")["hide"]();n.getForm().findField("exp_date")["hide"]();s.setVisible(false);n.getForm().findField("card_num").setValue("");n.getForm().findField("exp_date").setValue("");n.getForm().findField("method").setValue("")}else{Ext.ux.Alert.alert(t("Error"),a.msg,"error");n.getForm().findField("card_num").setValue("");n.getForm().findField("exp_date").setValue("");n.setLoading(false)}}});return}else{n.getForm().findField("amount")["hide"]();n.getForm().findField("method")["hide"]();n.getForm().findField("card_num")["show"]();n.getForm().findField("exp_date")["show"]();s.setVisible(true);n.getForm().findField("card_num").focus()}}else{if(!l){Ext.ux.Alert.alert(o.titleWarning,t("Select a ")+t("paymentmethods"),"warning");return}else{if(p<=0){Ext.ux.Alert.alert(o.titleWarning,t("Select a ")+t("valid")+" "+t("amount"),"warning");return}else{url="index.php/buyCredit/method/?amount="+p+"&id_method="+l;n.getForm().findField("method").setValue("");n.getForm().findField("card_num").setValue("");n.getForm().findField("exp_date").setValue("");if(n.getForm().findField("method").rawValue.match(/PlacetoPay/)){window.open(url,"_self")}else{window.open(url,"_blank")}}}}}},0,0,0,0,["controller.buycredit"],0,[MBilling.view.buycredit,"Controller"],0));(Ext.cmd.derive("MBilling.view.buycredit.Module",Ext.form.Panel,{controller:"buycredit",resizable:false,autoShow:true,header:false,initComponent:function(){var b=this;b.items=[{reference:"buycreditPanel",xtype:"form",margin:"10 10 10 10",autoShow:true,closable:false,resizable:false,bodyPadding:10,defaultType:"textfield",defaults:{labelAlign:"right",labelWidth:150,width:280,allowBlank:false,msgTarget:"side",enableKeyEvents:true,plugins:"markallowblank",anchor:"100%"},items:[{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,00",fieldLabel:t("Amounts"),value:0,name:"amount"},{xtype:"methodpaycombo",fieldLabel:t("paymentmethods"),name:"method"},{fieldLabel:t("CreditCard Number"),name:"card_num",hidden:true},{xtype:"datefield",fieldLabel:t("Expiration Date"),name:"exp_date",format:"m/y",hidden:true}],bbar:[{text:t("Cancel"),tooltip:t("Cancel"),glyph:b.glyphCancel,handler:"buyCreditClose",hidden:true,reference:"btnCancel"},{text:t("Next"),tooltip:t("Next"),width:100,glyph:icons.disk,handler:"buyCredit"}]}];Ext.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["buycreditmodule"],["component","box","container","panel","form","buycreditmodule"],{component:true,box:true,container:true,panel:true,form:true,buycreditmodule:true},["widget.buycreditmodule"],0,[MBilling.view.buycredit,"Module"],0));(Ext.cmd.derive("MBilling.view.transferToMobile.Module",Ext.form.Panel,{resizable:false,autoShow:true,header:false,items:[{xtype:"component",autoEl:{width:"100%",height:"100%",tag:"iframe",src:"index.php/transferToMobile/read"}}]},0,["transfertomobilemodule"],["component","box","container","panel","form","transfertomobilemodule"],{component:true,box:true,container:true,panel:true,form:true,transfertomobilemodule:true},["widget.transfertomobilemodule"],0,[MBilling.view.transferToMobile,"Module"],0));(Ext.cmd.derive("MBilling.view.firewall.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.firewall"],0,[MBilling.view.firewall,"Controller"],0));(Ext.cmd.derive("MBilling.view.firewall.Module",Ext.ux.panel.Module,{controller:"firewall"},0,["firewallmodule"],["component","box","container","uxpanelmodule","firewallmodule"],{component:true,box:true,container:true,uxpanelmodule:true,firewallmodule:true},["widget.firewallmodule"],0,[MBilling.view.firewall,"Module"],0));(Ext.cmd.derive("MBilling.view.firewall.List",Ext.ux.grid.Panel,{store:"Firewall",initComponent:function(){var b=this;b.textDelete="Unban";b.textNew="Ban new Ip";b.buttonCsv=false;b.buttonUpdateLot=false;b.buttonCleanFilter=true;b.allowPrint=false;b.allowCreate=true;b.allowDelete=true;b.columns=[{header:t("Ip"),dataIndex:"ip",flex:4},{header:t("Type"),dataIndex:"jail",flex:4},{header:t("Permanently")+" "+t("Ban"),dataIndex:"action",renderer:Helper.Util.formattyyesno,filter:{type:"list",options:[[0,t("no")],[1,t("yes")]]},flex:2}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["firewalllist"],["component","box","container","panel","tablepanel","gridpanel","grid","firewalllist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,firewalllist:true},["widget.firewalllist"],0,[MBilling.view.firewall,"List"],0));(Ext.cmd.derive("MBilling.view.firewall.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{name:"ip",fieldLabel:t("Ip"),vtype:"IPAddress"},{xtype:"yesnocombo",fieldLabel:t("Permanently")+" "+t("Ban"),name:"action"},{xtype:"textarea",name:"description",fieldLabel:t("description"),allowBlank:true,height:300,anchor:"100%",readOnly:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["firewallform"],["component","box","container","panel","form","firewallform"],{component:true,box:true,container:true,panel:true,form:true,firewallform:true},["widget.firewallform"],0,[MBilling.view.firewall,"Form"],0));(Ext.cmd.derive("MBilling.view.userRate.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.userrate"],0,[MBilling.view.userRate,"Controller"],0));(Ext.cmd.derive("MBilling.view.userRate.Module",Ext.ux.panel.Module,{controller:"userrate"},0,["userratemodule"],["component","box","container","uxpanelmodule","userratemodule"],{component:true,box:true,container:true,uxpanelmodule:true,userratemodule:true},["widget.userratemodule"],0,[MBilling.view.userRate,"Module"],0));(Ext.cmd.derive("MBilling.view.userRate.List",Ext.ux.grid.Panel,{store:"UserRate",initComponent:function(){var b=this;b.buttonCsv=false;b.allowPrint=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("prefix"),dataIndex:"idPrefixprefix",flex:window.isTablet?2:3},{dataIndex:"idPrefixdestination",header:t("destination"),flex:window.isTablet?2:3},{header:t("rateinitial"),dataIndex:"rateinitial",renderer:Helper.Util.formatMoneyDecimal,flex:2},{header:t("initblock"),dataIndex:"initblock",flex:2},{header:t("billingblock"),dataIndex:"billingblock",flex:2}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["userratelist"],["component","box","container","panel","tablepanel","gridpanel","grid","userratelist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,userratelist:true},["widget.userratelist"],0,[MBilling.view.userRate,"List"],0));(Ext.cmd.derive("MBilling.view.userRate.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{fieldLabel:t("User"),name:"id_user",xtype:!App.user.isAdmin?"textfield":"userlookup",ownerForm:b,hidden:!App.user.isAdmin,allowBlank:!App.user.isAdmin},{fieldLabel:t("Destination"),name:"id_prefix",xtype:"prefixlookup",ownerForm:b,hidden:!App.user.isAdmin,allowBlank:!App.user.isAdmin},{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,"+App.user.decimalPrecision,name:"rateinitial",fieldLabel:t("rateinitial"),readOnly:App.user.isClient},{xtype:"numberfield",name:"initblock",fieldLabel:t("initblock"),hidden:App.user.isClient},{xtype:"numberfield",name:"billingblock",fieldLabel:t("billingblock"),hidden:App.user.isClient}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["userrateform"],["component","box","container","panel","form","userrateform"],{component:true,box:true,container:true,panel:true,form:true,userrateform:true},["widget.userrateform"],0,[MBilling.view.userRate,"Form"],0));(Ext.cmd.derive("MBilling.view.extra.Module",Ext.form.Panel,{resizable:false,autoShow:true,header:false,items:[{xtype:"component",autoEl:{width:"100%",height:"100%",tag:"iframe",src:window.moduleExtra}}]},0,["extramodule"],["component","box","container","panel","form","extramodule"],{component:true,box:true,container:true,panel:true,form:true,extramodule:true},["widget.extramodule"],0,[MBilling.view.extra,"Module"],0));(Ext.cmd.derive("MBilling.view.callOnlineChart.Module",Ext.ux.panel.Module,{},0,["callOnlineChartmodule"],["component","box","container","uxpanelmodule","callOnlineChartmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callOnlineChartmodule:true},["widget.callOnlineChartmodule"],0,[MBilling.view.callOnlineChart,"Module"],0));(Ext.cmd.derive("MBilling.view.callOnlineChart.List",Ext.ux.grid.Panel,{store:"CallOnlineChart",initComponent:function(){var b=this;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("Total"),dataIndex:"total",flex:1},{header:t("date"),dataIndex:"date",renderer:Ext.util.Format.dateRenderer("Y-m-d H:i"),flex:1}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callonlinechartlist"],["component","box","container","panel","tablepanel","gridpanel","grid","callonlinechartlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callonlinechartlist:true},["widget.callonlinechartlist"],0,[MBilling.view.callOnlineChart,"List"],0));(Ext.cmd.derive("MBilling.view.callOnlineChart.Form",Ext.ux.form.Panel,{},0,["callOnlineChartform"],["component","box","container","panel","form","callOnlineChartform"],{component:true,box:true,container:true,panel:true,form:true,callOnlineChartform:true},["widget.callOnlineChartform"],0,[MBilling.view.callOnlineChart,"Form"],0));(Ext.cmd.derive("MBilling.view.callOnlineChart.Chart",Ext.ux.panel.Chart,{controller:"callsummaryperday",store:"CallOnlineChart",fieldValue:["total","answer"],fieldDescription:"date",labelYLine:t("total")+" / Min",labelXLine:t("Minute"),reference:"callonlinechartchart",defaultChart:"line",btnShowColumn:false,btnShowBar:false,btnShowLine:true,btnShowPie:false,animate:true,btnShowLineHidden:true,initComponent:function(){var b=this;b.rendererFieldValue=Ext.util.Format.numberRenderer("0");b.tbarChart=[{text:t("Per")+" "+t("Minute"),scope:b,handler:"onPerMinute",reference:"btnMinute",disabled:true},{text:t("Per")+" "+t("Hour"),scope:b,handler:"onPerhour",reference:"btnHour"}];b.legend={position:"right",boxStrokeWidth:0,labelFont:"12px Helvetica",renderer:b.rendererLegend};b.bbarChart=[{xtype:"tbtext",itemId:"tbTextSum"}];b.sessionLoad=Ext.create("Ext.util.DelayedTask",function(){b.store.load()},b);Ext.ux.panel.Chart.prototype.initComponent.apply(this,arguments);b.store.on("load",b.onLoadStore,b)},onPerMinute:function(d){var c=this;c.lookupReference("btnMinute").disable();c.lookupReference("btnHour").enable();c.store.setRemoteFilter(true);c.store.filter("type","minute");c.store.load()},onPerhour:function(d){var c=this;c.lookupReference("btnHour").disable();c.lookupReference("btnMinute").enable();c.store.setRemoteFilter(true);c.store.filter("type","hour");c.store.load()},onLoadStore:function(){this.onActivateModule()},onActivateModule:function(){this.sessionLoad&&this.sessionLoad.delay(25000)}},0,["callonlinechartchart"],["component","box","container","panel","chartpanel","callonlinechartchart"],{component:true,box:true,container:true,panel:true,chartpanel:true,callonlinechartchart:true},["widget.callonlinechartchart"],0,[MBilling.view.callOnlineChart,"Chart"],0));(Ext.cmd.derive("MBilling.view.smtps.Controller",Ext.ux.app.ViewController,{onSendEmail:function(e){var f=this,d=f.list.getSelectionModel().getSelection()[0];f.list.setLoading(true);if(f.list.getSelectionModel().getSelection().length==1){Ext.Ajax.request({url:"index.php/smtps/testMail",params:{id:d.get("id")},scope:f,success:function(a){a=Ext.decode(a.responseText);if(a[f.nameSuccessRequest]){Ext.ux.Alert.alert(f.titleSuccess,a[f.nameMsgRequest],"success")}else{Ext.ux.Alert.alert(f.titleError,a[f.nameMsgRequest],"error")}f.list.setLoading(false)}})}else{Ext.ux.Alert.alert(f.titleError,"Please Select a Smtp","notification");f.list.setLoading(false)}}},0,0,0,0,["controller.smtps"],0,[MBilling.view.smtps,"Controller"],0));(Ext.cmd.derive("MBilling.view.smtps.List",Ext.ux.grid.Panel,{store:"Smtps",initComponent:function(){var b=this;b.extraButtons=[{text:t("Test Smtp"),iconCls:"templatemail",handler:"onSendEmail",disabled:false}];b.buttonUpdateLot=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("Host"),dataIndex:"host",flex:4},{header:t("username"),dataIndex:"username",flex:2},{header:t("Port"),dataIndex:"port",flex:3},{header:t("Encryption"),dataIndex:"encryption",flex:3}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["smtpslist"],["component","box","container","panel","tablepanel","gridpanel","grid","smtpslist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,smtpslist:true},["widget.smtpslist"],0,[MBilling.view.smtps,"List"],0));(Ext.cmd.derive("MBilling.view.smtps.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{name:"host",fieldLabel:t("Host"),hidden:App.user.isClient},{name:"username",fieldLabel:t("username"),hidden:App.user.isClient},{inputType:"password",name:"password",fieldLabel:t("password"),hidden:App.user.isClient},{xtype:"numberfield",name:"port",fieldLabel:t("Port"),value:587,hidden:App.user.isClient},{xtype:"combobox",name:"encryption",fieldLabel:t("Encryption"),hidden:App.user.isClient,value:"null",store:[["ssl",t("SSl")],["tls",t("TLS")],["null",t("NULL")]]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["smtpsform"],["component","box","container","panel","form","smtpsform"],{component:true,box:true,container:true,panel:true,form:true,smtpsform:true},["widget.smtpsform"],0,[MBilling.view.smtps,"Form"],0));(Ext.cmd.derive("MBilling.view.smtps.Module",Ext.ux.panel.Module,{controller:"smtps"},0,["smtpsmodule"],["component","box","container","uxpanelmodule","smtpsmodule"],{component:true,box:true,container:true,uxpanelmodule:true,smtpsmodule:true},["widget.smtpsmodule"],0,[MBilling.view.smtps,"Module"],0));(Ext.cmd.derive("MBilling.view.servers.Controller",Ext.ux.app.ViewController,{init:function(){var b=this;b.control({combobox:{select:b.onSelectType}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectType:function(c,d){this.showFieldsRelated(d.getData().showFields)},showFieldsRelated:function(l){var m=this,g=m.formPanel.getForm().getFields(),j=m.formPanel.getForm().findField("weight"),f=m.formPanel.getForm();g.each(function(a){if(a.name=="type"){if(a.value=="asterisk"||a.value=="mbilling"){j.show()}else{j.hide()}}})},onEdit:function(){var d=this,f=d.formPanel.getForm().findField("weight"),e=d.formPanel.getForm().findField("type");Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments);if(e.value=="asterisk"||e.value=="mbilling"){f.show()}else{f.hide()}},onDelete:function(d){var f=this,e;notDelete=false;Ext.each(f.list.getSelectionModel().getSelection(),function(a){if(a.get("id")==1){Ext.ux.Alert.alert(f.titleError,t("You cannot delete the")+" server id 1","error");notDelete=true}});if(notDelete==false){Ext.ux.app.ViewController.prototype.onDelete.apply(this,arguments)}}},0,0,0,0,["controller.servers"],0,[MBilling.view.servers,"Controller"],0));(Ext.cmd.derive("MBilling.view.servers.List",Ext.ux.grid.Panel,{store:"Servers",initComponent:function(){var b=this;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("host"),dataIndex:"host",flex:4},{header:t("username"),dataIndex:"username",flex:4},{header:t("type"),dataIndex:"type",comboRelated:"booleancombo",flex:2},{header:t("status"),dataIndex:"status",renderer:Helper.Util.formatBooleanActive,comboRelated:"booleancombo",flex:2,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")]]}}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["serverslist"],["component","box","container","panel","tablepanel","gridpanel","grid","serverslist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,serverslist:true},["widget.serverslist"],0,[MBilling.view.servers,"List"],0));(Ext.cmd.derive("MBilling.view.servers.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["id_user"],initComponent:function(){var b=this;b.items=[{name:"host",fieldLabel:t("host")},{name:"username",fieldLabel:t("username"),allowBlank:true},{name:"password",fieldLabel:t("password"),allowBlank:true},{name:"port",fieldLabel:t("port"),allowBlank:true},{xtype:"combobox",name:"type",fieldLabel:t("type"),forceSelection:true,editable:false,value:"mbilling",store:[["mbilling",t("Mbilling")],["asterisk",t("Asterisk")],["sipproxy",t("SipProxy")]]},{fieldLabel:t("Weight"),name:"weight",hidden:true,allowBlank:true,emptyText:t("This is useful in order to get a different ratio of traffic between servers.")},{xtype:"booleancombo",name:"status",fieldLabel:t("status"),allowBlank:true},{xtype:"textareafield",name:"description",fieldLabel:t("description"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["serversform"],["component","box","container","panel","form","serversform"],{component:true,box:true,container:true,panel:true,form:true,serversform:true},["widget.serversform"],0,[MBilling.view.servers,"Form"],0));(Ext.cmd.derive("MBilling.view.servers.Module",Ext.ux.panel.Module,{controller:"servers"},0,["serversmodule"],["component","box","container","uxpanelmodule","serversmodule"],{component:true,box:true,container:true,uxpanelmodule:true,serversmodule:true},["widget.serversmodule"],0,[MBilling.view.servers,"Module"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerUser.Controller",Ext.ux.app.ViewController,{formHidden:true,onEdit:function(){me=this;me.sumData=me.store.getData().items[0].getData();if(!me.sumData){return}me.formPanel.getForm().getFields().each(function(b){b.setValue(me.sumData[b.name])});me.formPanel.expand()},onExportCsvUser:function(o,l,g){var m=this,j=m.list.getStore(),n=m.list.filters.getFilterData().length?Ext.encode(m.list.filters.getFilterData()):j.proxy.extraParams.filter;window.open("index.php/callSummaryPerUser/exportCsvCalls?id="+o.getStore().getAt(l).getData().idUserusername+"&filter="+n)}},0,0,0,0,["controller.callsummaryperuser"],0,[MBilling.view.callSummaryPerUser,"Controller"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerUser.List",Ext.ux.grid.Panel,{store:"CallSummaryPerUser",initComponent:function(){var b=this;b.buttonImportCsv=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{xtype:"actioncolumn",width:26,sortable:false,menuDisabled:true,header:t(""),dataIndex:"id",items:[{iconCls:"icon-export-csv",tooltip:t("Export CSV"),handler:"onExportCsvUser"}],hidden:!App.user.isAdmin},{header:t("Username"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:3},{header:t("sessiontime")+" "+t("Min"),dataIndex:"sessiontime",flex:2},{header:t("aloc_all_calls"),dataIndex:"aloc_all_calls",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Answered Calls"),dataIndex:"nbcall",flex:3},{header:t("Failed Calls"),dataIndex:"nbcall_fail",flex:3},{header:t("buycost"),dataIndex:App.user.isAdmin?"buycost":"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("sessionbill"),dataIndex:App.user.isAgent||App.user.isClientAgent?"agent_bill":"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("markup"),dataIndex:"lucro",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("ASR"),dataIndex:"asr",renderer:Helper.Util.formatPorcente,flex:3,hidden:!App.user.isAdmin,hideable:App.user.isAdmin}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummaryperuserlist"],["component","box","container","panel","tablepanel","gridpanel","grid","callsummaryperuserlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callsummaryperuserlist:true},["widget.callsummaryperuserlist"],0,[MBilling.view.callSummaryPerUser,"List"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerUser.Form",Ext.ux.form.Panel,{defaults:{},labelWidthFields:100,defaultType:"displayfield",initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{name:"sumsessiontime",fieldLabel:t("sessiontime")+" "+t("Min"),renderer:Ext.util.Format.numberRenderer("0"),allowBlank:true},{name:App.user.isAgent||App.user.isClientAgent?"sumagent_bill":"sumsessionbill",fieldLabel:t("sessionbill"),renderer:Helper.Util.formatMoneyDecimal,allowBlank:true},{name:App.user.isAdmin?"sumbuycost":"sumsessionbill",fieldLabel:t("buycost"),renderer:Helper.Util.formatMoneyDecimal,hidden:App.user.isClient,allowBlank:true},{name:"sumlucro",fieldLabel:t("markup"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumnbcall",fieldLabel:t("Answered Calls"),allowBlank:true},{name:"sumnbcallfail",fieldLabel:t("Failed Calls"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummaryperuserform"],["component","box","container","panel","form","callsummaryperuserform"],{component:true,box:true,container:true,panel:true,form:true,callsummaryperuserform:true},["widget.callsummaryperuserform"],0,[MBilling.view.callSummaryPerUser,"Form"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerUser.Module",Ext.ux.panel.Module,{controller:"callsummaryperuser",cfgEast:{flex:0.4}},0,["callsummaryperusermodule"],["component","box","container","uxpanelmodule","callsummaryperusermodule"],{component:true,box:true,container:true,uxpanelmodule:true,callsummaryperusermodule:true},["widget.callsummaryperusermodule"],0,[MBilling.view.callSummaryPerUser,"Module"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerTrunk.Controller",Ext.ux.app.ViewController,{formHidden:true,onEdit:function(){me=this;me.sumData=me.store.getData().items[0].getData();if(!me.sumData){return}me.formPanel.getForm().getFields().each(function(b){b.setValue(me.sumData[b.name])});me.formPanel.expand()},onExportCsvUser:function(o,l,g){var m=this,j=m.list.getStore(),n=m.list.filters.getFilterData().length?Ext.encode(m.list.filters.getFilterData()):j.proxy.extraParams.filter;window.open("index.php/callSummaryPerTrunk/exportCsvCalls?id="+o.getStore().getAt(l).getData().idTrunktrunkcode+"&filter="+n)}},0,0,0,0,["controller.callsummarypertrunk"],0,[MBilling.view.callSummaryPerTrunk,"Controller"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerTrunk.List",Ext.ux.grid.Panel,{store:"CallSummaryPerTrunk",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{xtype:"actioncolumn",width:26,sortable:false,menuDisabled:true,header:t(""),dataIndex:"id",items:[{iconCls:"icon-export-csv",tooltip:t("Export CSV"),handler:"onExportCsvUser"}],hidden:!App.user.isAdmin},{header:t("Trunk"),dataIndex:"idTrunktrunkcode",filter:{type:"string",field:"idTrunk.trunkcode"},flex:3},{header:t("sessiontime")+" "+t("Min"),dataIndex:"sessiontime",flex:2},{header:t("aloc_all_calls"),dataIndex:"aloc_all_calls",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Answered Calls"),dataIndex:"nbcall",flex:3},{header:t("Failed Calls"),dataIndex:"nbcall_fail",flex:3},{header:t("buycost"),dataIndex:"buycost",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("sessionbill"),dataIndex:"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("markup"),dataIndex:"lucro",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("ASR"),dataIndex:"asr",renderer:Helper.Util.formatPorcente,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarypertrunklist"],["component","box","container","panel","tablepanel","gridpanel","grid","callsummarypertrunklist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callsummarypertrunklist:true},["widget.callsummarypertrunklist"],0,[MBilling.view.callSummaryPerTrunk,"List"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerTrunk.Form",Ext.ux.form.Panel,{defaults:{},labelWidthFields:100,defaultType:"displayfield",initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{name:"sumsessiontime",fieldLabel:t("sessiontime")+" "+t("Min"),renderer:Ext.util.Format.numberRenderer("0"),allowBlank:true},{name:"sumsessionbill",fieldLabel:t("sessionbill"),renderer:Helper.Util.formatMoneyDecimal,allowBlank:true},{name:"sumbuycost",fieldLabel:t("buycost"),renderer:Helper.Util.formatMoneyDecimal,hidden:App.user.isClient,allowBlank:true},{name:"sumlucro",fieldLabel:t("markup"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumnbcall",fieldLabel:t("Answered Calls"),allowBlank:true},{name:"sumnbcallfail",fieldLabel:t("Failed Calls"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarypertrunkform"],["component","box","container","panel","form","callsummarypertrunkform"],{component:true,box:true,container:true,panel:true,form:true,callsummarypertrunkform:true},["widget.callsummarypertrunkform"],0,[MBilling.view.callSummaryPerTrunk,"Form"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerTrunk.Module",Ext.ux.panel.Module,{controller:"callsummarypertrunk",cfgEast:{flex:0.4}},0,["callsummarypertrunkmodule"],["component","box","container","uxpanelmodule","callsummarypertrunkmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callsummarypertrunkmodule:true},["widget.callsummarypertrunkmodule"],0,[MBilling.view.callSummaryPerTrunk,"Module"],0));(Ext.cmd.derive("MBilling.view.backup.Controller",Ext.ux.app.ViewController,{formHidden:true,onDownload:function(l){var j=this,m,f=j.list.getSelectionModel().getSelection()[0],g=[];values="file="+f.data.name;url="index.php/backup/download/?"+values;window.open(url)},onDelete:function(m){var l=this,n,o=l.list.getSelectionModel().getSelection()[0],j=[];destroyType=m.menu.down("menucheckitem[checked=true]").value;var g=(destroyType==="all")?l.msgDeleteAll:l.msgConfirmation;if(!l.list.allowDelete){return}if(destroyType==="all"){Ext.ux.Alert.alert(l.titleError,"You cannot delete all backups","notification");return}if(o){Ext.Msg.confirm(l.titleConfirmation,g,function(a){if(a==="yes"){Ext.each(l.list.getSelectionModel().getSelection(),function(b){j.push(b.get("name"))});Ext.Ajax.request({url:"index.php/backup/destroy",params:{ids:Ext.encode(j)},scope:l,success:function(d){d=Ext.decode(d.responseText);if(d[l.nameSuccessRequest]){var c=Helper.Util.convertErrorsJsonToString(d[l.nameMsgRequest]);Ext.ux.Alert.alert(l.titleSuccess,c,"success")}else{var b=Helper.Util.convertErrorsJsonToString(d[l.nameMsgRequest]);Ext.ux.Alert.alert(l.titleError,b,"notification")}}});l.store.load()}},l)}else{Ext.ux.Alert.alert(l.titleError,t("Please select one or more register"),"notification")}},onNew:function(){var b=this;Ext.Msg.confirm(b.titleConfirmation,t("Do you relly want create a new backup now? It can take many time and make your server slow. Mbilling make backup every day automatically."),function(a){if(a==="yes"){Ext.Msg.confirm(b.titleConfirmation,t("This backup will override the backup held today! Do you sure?"),function(d){if(d==="yes"){Ext.Ajax.request({url:"index.php/backup/save",params:{ids:0},scope:b,success:function(j){j=Ext.decode(j.responseText);if(j[b.nameSuccessRequest]){var g=Helper.Util.convertErrorsJsonToString(j[b.nameMsgRequest]);Ext.ux.Alert.alert(b.titleSuccess,g,"success")}else{var c=Helper.Util.convertErrorsJsonToString(j[b.nameMsgRequest]);Ext.ux.Alert.alert(b.titleError,c,"notification")}}});b.store.load()}},b)}},b)}},0,0,0,0,["controller.backup"],0,[MBilling.view.backup,"Controller"],0));(Ext.cmd.derive("MBilling.view.backup.List",Ext.ux.grid.Panel,{store:"Backup",initComponent:function(){var b=this;b.buttonImportCsv=true;b.textButtonImportCsv=t("Importar Backup");b.widthButtonCsv=140;b.extraButtons=[{text:t("Download Backup"),glyph:icons.disk,handler:"onDownload",width:140,disabled:false}];b.buttonCsv=false;b.allowPrint=false;b.buttonUpdateLot=false;b.buttonCleanFilter=false;b.allowUpdate=false;b.columns=[{menuDisabled:true,header:t("name"),dataIndex:"name",flex:1},{menuDisabled:true,header:t("size"),dataIndex:"size",flex:1}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["backuplist"],["component","box","container","panel","tablepanel","gridpanel","grid","backuplist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,backuplist:true},["widget.backuplist"],0,[MBilling.view.backup,"List"],0));(Ext.cmd.derive("MBilling.view.backup.Form",Ext.ux.form.Panel,{},0,["backupform"],["component","box","container","panel","form","backupform"],{component:true,box:true,container:true,panel:true,form:true,backupform:true},["widget.backupform"],0,[MBilling.view.backup,"Form"],0));(Ext.cmd.derive("MBilling.view.backup.Module",Ext.ux.panel.Module,{controller:"backup",initComponent:function(){var b=this;Ext.ux.panel.Module.prototype.initComponent.apply(this,arguments)}},0,["backupmodule"],["component","box","container","uxpanelmodule","backupmodule"],{component:true,box:true,container:true,uxpanelmodule:true,backupmodule:true},["widget.backupmodule"],0,[MBilling.view.backup,"Module"],0));(Ext.cmd.derive("MBilling.view.backup.ImportCsv",Ext.ux.window.ImportCsv,{htmlTipInfo:"",extAllowed:["tgz"],fieldLabel:"Backup",iconCls:"icon-play"},0,["backupimportcsv"],["component","box","container","panel","window","backupimportcsv"],{component:true,box:true,container:true,panel:true,window:true,backupimportcsv:true},["widget.backupimportcsv"],0,[MBilling.view.backup,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.gAuthenticator.Controller",Ext.ux.app.ViewController,{init:function(){var b=this;b.control({statususercombo:{select:b.onSelectMethod}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectMethod:function(c,d){this.showFieldsRelated(d.getData().showFields)},showFieldsRelated:function(l){var m=this,j=m.formPanel.getForm().getFields(),o=m.formPanel.getForm().findField("googleAuthenticator_enable"),n=m.formPanel.getForm().findField("google_authenticator_key"),g=m.formPanel.getForm().findField("code");if(o.value!=1&&n.value.length>5){g.setVisible(true);g.allowBlank=false}else{g.setVisible(false);g.allowBlank=true}},onEdit:function(){var c=this,d=c.formPanel.getForm();if(!App.user.isAdmin){return}d.findField("code").allowBlank=true;d.findField("code").setVisible(false);Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)}},0,0,0,0,["controller.gauthenticator"],0,[MBilling.view.gAuthenticator,"Controller"],0));(Ext.cmd.derive("MBilling.view.gAuthenticator.List",Ext.ux.grid.Panel,{store:"GAuthenticator",fieldSearch:"username",initComponent:function(){var b=this;b.buttonCsv=false;b.allowPrint=false;b.buttonUpdateLot=false;b.allowCreate=false;b.buttonCleanFilter=false;b.allowUpdate=App.user.isAdmin;b.allowDelete=false;if(!App.user.isAdmin){b.columns=[]}else{b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("username"),dataIndex:"username",flex:4},{header:t("status"),dataIndex:"googleAuthenticator_enable",renderer:Helper.Util.formatBooleanActive,comboRelated:"booleancombo",flex:2,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")]]}}]}Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["gauthenticatorlist"],["component","box","container","panel","tablepanel","gridpanel","grid","gauthenticatorlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,gauthenticatorlist:true},["widget.gauthenticatorlist"],0,[MBilling.view.gAuthenticator,"List"],0));(Ext.cmd.derive("MBilling.view.gAuthenticator.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{name:"username",fieldLabel:t("username"),readyOnly:true},{xtype:"statususercombo",name:"googleAuthenticator_enable",fieldLabel:t("status"),allowBlank:true},{vtype:"numberfield",name:"code",fieldLabel:t("Code"),hidden:true,maxLength:6,minLength:6,allowBlank:true},{name:"google_authenticator_key",fieldLabel:t("google_authenticator_key"),readyOnly:true,allowBlank:true,hidden:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["gauthenticatorform"],["component","box","container","panel","form","gauthenticatorform"],{component:true,box:true,container:true,panel:true,form:true,gauthenticatorform:true},["widget.gauthenticatorform"],0,[MBilling.view.gAuthenticator,"Form"],0));(Ext.cmd.derive("MBilling.view.gAuthenticator.Module",Ext.ux.panel.Module,{controller:"gauthenticator"},0,["gauthenticatormodule"],["component","box","container","uxpanelmodule","gauthenticatormodule"],{component:true,box:true,container:true,uxpanelmodule:true,gauthenticatormodule:true},["widget.gauthenticatormodule"],0,[MBilling.view.gAuthenticator,"Module"],0));(Ext.cmd.derive("MBilling.view.groupUserGroup.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.groupusergroup"],0,[MBilling.view.groupUserGroup,"Controller"],0));(Ext.cmd.derive("MBilling.view.groupUserGroup.List",Ext.ux.grid.Panel,{store:"GroupUserGroup",initComponent:function(){var b=this;b.buttonCsv=false;b.allowPrint=false;b.buttonUpdateLot=false;b.allowCreate=false;b.buttonCleanFilter=false;b.allowDelete=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("Group"),dataIndex:"name",flex:4,readOnly:true,hidden:App.user.isClient,hideable:!App.user.isClient}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["groupusergrouplist"],["component","box","container","panel","tablepanel","gridpanel","grid","groupusergrouplist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,groupusergrouplist:true},["widget.groupusergrouplist"],0,[MBilling.view.groupUserGroup,"List"],0));(Ext.cmd.derive("MBilling.view.groupUserGroup.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["id_user"],initComponent:function(){var b=this;b.items=[{name:"name",fieldLabel:t("Group"),readOnly:true},{style:"margin-top:25px",xtype:"fieldset",title:t("Select one or more groups"),collapsible:true,collapsed:false,items:[{anchor:"100%",fieldLabel:"",xtype:"groupusertag",allowBlank:true}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["groupusergroupform"],["component","box","container","panel","form","groupusergroupform"],{component:true,box:true,container:true,panel:true,form:true,groupusergroupform:true},["widget.groupusergroupform"],0,[MBilling.view.groupUserGroup,"Form"],0));(Ext.cmd.derive("MBilling.view.groupUserGroup.Module",Ext.ux.panel.Module,{controller:"groupusergroup"},0,["groupusergroupmodule"],["component","box","container","uxpanelmodule","groupusergroupmodule"],{component:true,box:true,container:true,uxpanelmodule:true,groupusergroupmodule:true},["widget.groupusergroupmodule"],0,[MBilling.view.groupUserGroup,"Module"],0));(Ext.cmd.derive("MBilling.view.services.Controller",Ext.ux.app.ViewController,{init:function(){var b=this;b.control({servicestypecombo:{select:b.onSelectType}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectType:function(c,d){this.showFieldsRelated(d.getData().showFields)},showFieldsRelated:function(m){var n=this,o=n.formPanel.getForm(),p=o.findField("calllimit"),j=o.findField("disk_space"),q=o.findField("sipaccountlimit"),l=o.findField("type").getValue();p.setVisible(l=="calllimit");j.setVisible(l=="disk_space");q.setVisible(l=="sipAccountLimit")},onEdit:function(){var f=this,d=f.formPanel.getForm(),e=f.list.getSelectionModel().getSelection()[0];if(App.user.isClient){return}f.lookupReference("generalTab").show();d.findField("calllimit").setVisible(e.data.type=="calllimit");d.findField("disk_space").setVisible(e.data.type=="disk_space");d.findField("sipaccountlimit").setVisible(e.data.type=="sipAccountLimit");Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)},onNew:function(){var c=this,d=c.formPanel.getForm();d.findField("calllimit").setVisible(false);d.findField("disk_space").setVisible(false);d.findField("sipaccountlimit").setVisible(false);Ext.ux.app.ViewController.prototype.onNew.apply(this,arguments)}},0,0,0,0,["controller.services"],0,[MBilling.view.services,"Controller"],0));(Ext.cmd.derive("MBilling.view.services.List",Ext.ux.grid.Panel,{store:"Services",initComponent:function(){var b=this;b.buttonCsv=false;b.columns=b.columns||[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("type"),dataIndex:"type",flex:3,renderer:Helper.Util.formatTranslate,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("name"),dataIndex:"name",flex:4},{header:t("Price"),dataIndex:"price",renderer:Helper.Util.formatMoneyDecimal2,flex:2},{hidden:App.user.isClient,dataIndex:"description",header:t("description"),flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["serviceslist"],["component","box","container","panel","tablepanel","gridpanel","grid","serviceslist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,serviceslist:true},["widget.serviceslist"],0,[MBilling.view.services,"List"],0));(Ext.cmd.derive("MBilling.view.services.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{plugins:"markallowblank",allowBlank:false,anchor:"100%"}},items:[{title:t("general"),reference:"generalTab",items:[{xtype:"servicestypecombo",name:"type",fieldLabel:t("type"),allowBlank:true,hidden:App.user.isClient},{name:"name",fieldLabel:t("name"),readOnly:App.user.isClient},{name:"calllimit",fieldLabel:t("calllimit"),allowBlank:true,hidden:true,readOnly:App.user.isClient},{name:"disk_space",fieldLabel:t("disk_space"),allowBlank:true,hidden:true,readOnly:App.user.isClient},{name:"sipaccountlimit",fieldLabel:t("Sip Account Limit"),allowBlank:true,hidden:true,readOnly:App.user.isClient},{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,00",name:"price",fieldLabel:t("price"),readOnly:App.user.isClient},{xtype:"textarea",name:"description",fieldLabel:t("description"),allowBlank:true,hidden:App.user.isClient,height:100,anchor:"100%"}]},{hidden:App.user.isClient,title:t("Actions"),items:[{xtype:"permissionfield",buttonAddPermissionTitle:t("Add permissions for this service"),hideLabel:true,anchor:"100% "+(!Ext.Boot.platformTags.desktop?"82%":window.isThemeNeptune?"87%":"89%"),allowBlank:true,hidden:App.user.isClient}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["servicesform"],["component","box","container","panel","form","servicesform"],{component:true,box:true,container:true,panel:true,form:true,servicesform:true},["widget.servicesform"],0,[MBilling.view.services,"Form"],0));(Ext.cmd.derive("MBilling.view.services.Module",Ext.ux.panel.Module,{controller:"services",cfgEast:{flex:6}},0,["servicesmodule"],["component","box","container","uxpanelmodule","servicesmodule"],{component:true,box:true,container:true,uxpanelmodule:true,servicesmodule:true},["widget.servicesmodule"],0,[MBilling.view.services,"Module"],0));(Ext.cmd.derive("MBilling.view.services.Lookup",Ext.ux.form.field.Lookup,{name:"id_services",fieldLabel:t("Service"),displayField:"idServicesname",displayFieldList:"name",gridConfig:{xtype:"serviceslist",fieldSearch:"name",columns:[{header:t("name"),dataIndex:"name",flex:2},{header:t("price"),dataIndex:"price",renderer:Helper.Util.formatMoneyDecimal,flex:2}]}},0,["serviceslookup"],["component","box","container","fieldcontainer","serviceslookup"],{component:true,box:true,container:true,fieldcontainer:true,serviceslookup:true},["widget.serviceslookup"],0,[MBilling.view.services,"Lookup"],0));(Ext.cmd.derive("MBilling.view.servicesUse.Controller",Ext.ux.app.ViewController,{onSelectionChange:function(f,m){var l=this,j=l.lookupReference("cancelService"),g=l.lookupReference("payService");j&&j.setDisabled(!m.length);g&&g.setDisabled(!m.length);Ext.ux.app.ViewController.prototype.onSelectionChange.apply(this,arguments)},init:function(){var b=this;b.control({serviceslookup:{select:b.setValorItem}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onNew:function(){var c=this,d=c.formPanel.getForm();d.findField("method").setVisible(false);d.findField("price").setVisible(false);Ext.ux.app.ViewController.prototype.onNew.apply(this,arguments)},onEdit:function(){var b=this;if(App.user.isClient){return}Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)},setValorItem:function(j,g){var l=this,m=l.formPanel.getForm(),f=m.findField("price");if(l.formPanel.getForm().findField("id").getValue()===""){l.findService(g,f)}},findService:function(e,f){var d=this;if(e<1){return}filterService=Ext.encode([{type:"numeric",comparison:"eq",value:e,field:"id"}]);Ext.Ajax.request({url:"index.php/services/read?filter="+filterService,success:function(a){a=Ext.decode(a.responseText);if(a.rows){f.setValue(a.rows[0].price);f.setVisible(true)}}})},onCancelService:function(e){var f=this,d=f.list.getSelectionModel().getSelection()[0];f.formPanel.collapse();f.list.setLoading(true);if(f.list.getSelectionModel().getSelection().length==1){if(d.get("status")==0){Ext.ux.Alert.alert(f.titleWarning,t("This Service alread is canceled"),"notification");f.list.setLoading(false);return}else{if(d.get("status")==2){f.ondSendRequest(d.get("id"))}else{Ext.Msg.confirm(f.titleConfirmation,""+t("ALERT: Do you really want cancel this service to this user?")+"",function(a){if(a==="yes"){Ext.Msg.confirm(f.titleConfirmation,""+t("ALERT: This action was to return the balance, referring to the days not used. Do you confirm?")+"",function(b){if(b==="yes"){f.ondSendRequest(d.get("id"));Ext.ux.Alert.alert(t("Notification"),t("The system will reload in 3 seconds"),"information",true);setTimeout(function(){location.reload()},3000)}})}f.list.setLoading(false)})}}}else{Ext.ux.Alert.alert(f.titleError,t("Please Select only a record"),"notification");f.list.setLoading(false)}},onPayServiceLink:function(g){var j=this,e=j.list.getSelectionModel().getSelection()[0],f=[];j.formPanel.collapse();j.list.setLoading(true);if(e){Ext.each(j.list.getSelectionModel().getSelection(),function(a){f.push(a.get(j.idProperty))})}url="index.php/buyCredit/payServiceLink?id_service_use="+Ext.encode(f);window.open(url,"_blank");j.list.setLoading(false);j.store.load();Ext.Msg.confirm(j.titleConfirmation,""+t("The system will reload in 3 seconds")+"",function(a){location.reload()})},ondSendRequest:function(c){var d=this;Ext.Ajax.request({url:"index.php/servicesUse/cancelService",params:{id:c},scope:d,success:function(a){a=Ext.decode(a.responseText);if(a[d.nameSuccessRequest]){Ext.ux.Alert.alert(d.titleSuccess,a[d.nameMsgRequest],"success")}else{Ext.ux.Alert.alert(d.titleError,a[d.nameMsgRequest],"error")}d.formPanel.reset();d.list.setLoading(false);d.store.load()}})}},0,0,0,0,["controller.servicesuse"],0,[MBilling.view.servicesUse,"Controller"],0));(Ext.cmd.derive("MBilling.view.servicesUse.List",Ext.ux.grid.Panel,{store:"ServicesUse",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.buttonPrint=false;b.buttonCsv=false;b.buttonNewHeight=App.user.isAdmin?25:50,b.textNew=App.user.isAdmin?t("Add New Service"):""+t("Buy New Service")+"";b.buttonNewWidth=175;b.extraButtons=[{text:""+t("Cancel Service")+"",handler:"onCancelService",disabled:true,iconCls:"buycredit",width:170,hidden:!b.allowDelete,reference:"cancelService"},{text:""+t("Pay")+" "+t("services")+" "+t("pendings")+"",handler:"onPayServiceLink",disabled:true,iconCls:"buycredit",width:190,reference:"payService"}];b.allowDelete=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("Services"),dataIndex:"idServicesname",flex:5},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("monthpayed"),dataIndex:"month_payed",flex:2},{header:t("Price"),dataIndex:"idServicesprice",renderer:Helper.Util.formatMoneyDecimal2,flex:2},{header:t("Active"),dataIndex:"status",renderer:Helper.Util.formatBooleanActive,filter:{type:"list",options:[[1,t("active")],[2,t("pending")],[0,t("inactive")]]},flex:2},{header:t("reservationdate"),renderer:Helper.Util.formatDateTime,dataIndex:"reservationdate",flex:5},{header:t("releasedate"),renderer:Helper.Util.formatDateTime,dataIndex:"releasedate",flex:5}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["servicesuselist"],["component","box","container","panel","tablepanel","gridpanel","grid","servicesuselist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,servicesuselist:true},["widget.servicesuselist"],0,[MBilling.view.servicesUse,"List"],0));(Ext.cmd.derive("MBilling.view.servicesUse.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.bodyPadding=15,b.items=[{name:"id",hidden:true,allowBlank:true},{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,readOnly:true,allowBlank:App.user.isClient},{xtype:"serviceslookup",ownerForm:b,readOnly:true},{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,00",name:"price",fieldLabel:t("price"),hidden:true,allowBlank:true,readOnly:true},{xtype:"methodpaycombo",fieldLabel:t("paymentmethods"),name:"method",allowBlank:true,hidden:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["servicesuseform"],["component","box","container","panel","form","servicesuseform"],{component:true,box:true,container:true,panel:true,form:true,servicesuseform:true},["widget.servicesuseform"],0,[MBilling.view.servicesUse,"Form"],0));(Ext.cmd.derive("MBilling.view.servicesUse.Module",Ext.ux.panel.Module,{controller:"servicesuse",cfgEast:{flex:9}},0,["servicesusemodule"],["component","box","container","uxpanelmodule","servicesusemodule"],{component:true,box:true,container:true,uxpanelmodule:true,servicesusemodule:true},["widget.servicesusemodule"],0,[MBilling.view.servicesUse,"Module"],0));(Ext.cmd.derive("MBilling.view.callBack.Controller",Ext.ux.app.ViewController,{onReative:function(e){var g=this,f=g.store,j=g.list.filters.getFilterData().length?Ext.encode(g.list.filters.getFilterData()):f.proxy.extraParams.filter;Ext.Ajax.request({url:"index.php/callBack/reprocesar/",params:{filter:j},scope:g,success:function(b){b=Ext.decode(b.responseText);if(b[g.nameSuccessRequest]){Ext.ux.Alert.alert(g.titleSuccess,b[g.nameMsgRequest],"success",true,false,15000);f.load()}else{var a=Helper.Util.convertErrorsJsonToString(b[g.nameMsgRequest]);Ext.ux.Alert.alert(g.titleError,a,"error")}}})}},0,0,0,0,["controller.callback"],0,[MBilling.view.callBack,"Controller"],0));(Ext.cmd.derive("MBilling.view.callBack.Module",Ext.ux.panel.Module,{controller:"callback"},0,["callbackmodule"],["component","box","container","uxpanelmodule","callbackmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callbackmodule:true},["widget.callbackmodule"],0,[MBilling.view.callBack,"Module"],0));(Ext.cmd.derive("MBilling.view.callBack.List",Ext.ux.grid.Panel,{store:"CallBack",initComponent:function(){var b=this;b.allowPrint=false;b.buttonCsv=true;b.buttonUpdateLot=false;b.extraButtons=[{text:t("Reprocess"),iconCls:"call",handler:"onReative"}];b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("user"),dataIndex:"idUserusername",flex:3,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("Did"),dataIndex:"idDiddid",flex:3,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("destinationnumber"),dataIndex:"exten",flex:4},{header:t("status"),dataIndex:"status",renderer:Helper.Util.formatBooleancallback,flex:2,filter:{type:"list",options:[[1,t("active")],[2,t("pending")],[3,t("sent")],[4,t("Not working")],[5,t("Complete")]]}},{header:t("Num attempt"),dataIndex:"num_attempt",flex:2},{header:t("Last attempt"),renderer:Helper.Util.formatDateTime,dataIndex:"last_attempt_time",flex:4},{header:t("sessiontime"),dataIndex:"sessiontime",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Created"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"entry_time",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callbacklist"],["component","box","container","panel","tablepanel","gridpanel","grid","callbacklist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callbacklist:true},["widget.callbacklist"],0,[MBilling.view.callBack,"List"],0));(Ext.cmd.derive("MBilling.view.callBack.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient},{name:"exten",fieldLabel:t("destinationnumber")},{name:"status",xtype:"callbackcombo",fieldLabel:t("status")}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callbackform"],["component","box","container","panel","form","callbackform"],{component:true,box:true,container:true,panel:true,form:true,callbackform:true},["widget.callbackform"],0,[MBilling.view.callBack,"Form"],0));(Ext.cmd.derive("MBilling.Application",Ext.app.Application,{name:"MBilling",titleNotification:t("Notification"),msgSessionExpired:t("Your session has expired. Log in again."),views:["main.MainController","main.Login","main.ForgetPassword","main.GoogleAuthenticator","main.Main","main.Desktop","main.Help","main.Settings","main.About","main.ChangePassword","main.ImportLogo","main.SetUserData","groupModule.Controller","groupModule.Module","groupModule.List","groupModule.Form","groupModule.Field","groupUser.Controller","groupUser.Module","groupUser.List","groupUser.Form","groupUser.Combo","groupUser.Tag","module.Controller","module.Module","module.List","module.Form","module.Combo","module.Tag","user.Controller","user.Combo","user.Module","user.List","user.Form","user.Lookup","user.Bulk","configuration.Controller","configuration.Module","configuration.List","configuration.Form","general.BooleanCombo","general.GroupCombo","general.LcrtypeCombo","general.OfferTypeCombo","general.SipCombo","general.TypePaymentCombo","templateMail.Controller","templateMail.Module","templateMail.List","templateMail.Form","logUsers.Controller","logUsers.Module","logUsers.List","logUsers.Form","provider.Controller","provider.Combo","provider.Module","provider.List","provider.Form","provider.Lookup","plan.Controller","plan.Combo","plan.Module","plan.List","plan.Form","plan.Tag","plan.Lookup","trunk.Controller","trunk.Combo","trunk.Module","trunk.List","trunk.Form","trunk.Lookup","prefix.Controller","prefix.Combo","prefix.Module","prefix.List","prefix.Form","sendCreditProducts.Controller","sendCreditProducts.Module","sendCreditProducts.List","sendCreditProducts.Form","sendCreditRates.Controller","sendCreditRates.Module","sendCreditRates.List","sendCreditRates.Form","prefix.Lookup","sipTrace.Controller","sipTrace.Module","sipTrace.List","sipTrace.Form","sip.Controller","sip.Module","sip.List","sip.Form","sip.Lookup","sip2.Controller","sip2.Module","sip2.List","sip2.Form","sip2.Lookup","sipuras.Controller","sipuras.Module","sipuras.List","sipuras.Form","iax.Controller","iax.Module","iax.List","iax.Form","iax.Lookup","callOnLine.Controller","callOnLine.Module","callOnLine.List","callOnLine.Form","sendCreditSummary.Controller","sendCreditSummary.Module","sendCreditSummary.List","sendCreditSummary.Form","callSummaryDayUser.Controller","callSummaryDayUser.Module","callSummaryDayUser.List","callSummaryDayUser.Form","callSummaryDayTrunk.Controller","callSummaryDayTrunk.Module","callSummaryDayTrunk.List","callSummaryDayTrunk.Form","callSummaryDayAgent.Controller","callSummaryDayAgent.Module","callSummaryDayAgent.List","callSummaryDayAgent.Form","callerid.Controller","callerid.Module","callerid.List","callerid.Form","restrictedPhonenumber.Controller","restrictedPhonenumber.Module","restrictedPhonenumber.List","restrictedPhonenumber.Form","restrictedPhonenumber.ImportCsv","did.Controller","did.Combo","did.Module","did.List","did.Form","did.ImportCsv","didbuy.Module","diddestination.Controller","diddestination.Module","diddestination.List","diddestination.Form","diddestination.Combo","didUse.Controller","didUse.Module","didUse.List","didUse.Form","dashboard.Module","dashboardQueue.Module","ivr.Controller","ivr.Module","ivr.List","ivr.Form","ivr.Lookup","queue.Controller","queue.Combo","queue.Module","queue.List","queue.Form","queue.Lookup","queue.ListDashboard","queueMember.Controller","queueMember.Module","queueMember.List","queueMember.Form","queueMember.ListDashboard","refill.Controller","refill.Module","refill.List","refill.Form","refill.Chart","methodPay.Controller","methodPay.Module","methodPay.List","methodPay.Form","methodPay.Combo","voucher.Controller","voucher.Module","voucher.List","voucher.Form","refillprovider.Controller","refillprovider.Module","refillprovider.List","refillprovider.Form","boleto.Controller","boleto.Module","boleto.List","boleto.Form","boleto.ImportCsv","offer.Controller","offer.Combo","offer.Module","offer.List","offer.Form","offerCdr.Controller","offerCdr.Module","offerCdr.List","offerCdr.Form","offerUse.Module","offerUse.List","offerUse.Form","campaign.Controller","campaign.Combo","campaign.Module","campaign.List","campaign.Form","campaignPoll.Controller","campaignPoll.Combo","campaignPoll.Module","campaignPoll.List","campaignPoll.Form","phoneNumber.Controller","phoneNumber.Module","phoneNumber.List","phoneNumber.Form","phoneNumber.ImportCsv","rate.Controller","rate.Module","rate.List","rate.Form","rate.ImportCsv","phoneBook.Controller","phoneBook.Combo","phoneBook.Module","phoneBook.List","phoneBook.Form","phoneBook.Tag","call.Controller","call.Module","call.List","call.Form","callArchive.Controller","callArchive.Module","callArchive.List","callArchive.Form","callFailed.Controller","callFailed.Module","callFailed.List","callFailed.Form","callSummaryPerDay.Controller","callSummaryPerDay.Module","callSummaryPerDay.List","callSummaryPerDay.Form","callSummaryPerMonth.Controller","callSummaryPerMonth.Module","callSummaryPerMonth.List","callSummaryPerMonth.Form","callSummaryMonthUser.Controller","callSummaryMonthUser.Module","callSummaryMonthUser.List","callSummaryMonthUser.Form","callSummaryMonthTrunk.Controller","callSummaryMonthTrunk.Module","callSummaryMonthTrunk.List","callSummaryMonthTrunk.Form","sms.Controller","sms.Module","sms.List","sms.Form","campaignPollInfo.Controller","campaignPollInfo.Module","campaignPollInfo.List","campaignPollInfo.Form","campaignPollInfo.Chart","campaignRestrictPhone.Controller","campaignRestrictPhone.Module","campaignRestrictPhone.List","campaignRestrictPhone.Form","campaignRestrictPhone.ImportCsv","campaignLog.Controller","campaignLog.Module","campaignLog.List","campaignLog.Form","campaignSend.Module","callShop.Controller","callShop.Module","callShop.Module2","callShop.List","callShop.Form","callShopCdr.Controller","callShopCdr.Module","callShopCdr.List","callShopCdr.Form","rateCallshop.Controller","rateCallshop.Module","rateCallshop.List","rateCallshop.Form","rateCallshop.ImportCsv","callSummaryCallShop.Controller","callSummaryCallShop.Module","callSummaryCallShop.List","callSummaryCallShop.Form","callSummaryCallShop.Chart","buycredit.Controller","buycredit.Module","transferToMobile.Module","firewall.Controller","firewall.Module","firewall.List","firewall.Form","userRate.Controller","userRate.Module","userRate.List","userRate.Form","extra.Module","callOnlineChart.Module","callOnlineChart.List","callOnlineChart.Form","callOnlineChart.Chart","smtps.Controller","smtps.List","smtps.Form","smtps.Module","servers.Controller","servers.List","servers.Form","servers.Module","callSummaryPerUser.Controller","callSummaryPerUser.List","callSummaryPerUser.Form","callSummaryPerUser.Module","callSummaryPerTrunk.Controller","callSummaryPerTrunk.List","callSummaryPerTrunk.Form","callSummaryPerTrunk.Module","backup.Controller","backup.List","backup.Form","backup.Module","backup.ImportCsv","gAuthenticator.Controller","gAuthenticator.List","gAuthenticator.Form","gAuthenticator.Module","groupUserGroup.Controller","groupUserGroup.List","groupUserGroup.Form","groupUserGroup.Module","services.Controller","services.List","services.Form","services.Module","services.Lookup","servicesUse.Controller","servicesUse.List","servicesUse.Form","servicesUse.Module","callBack.Controller","callBack.Module","callBack.List","callBack.Form"],stores:["CallOnlineChart","Help","CallSummaryMonthTrunk","CallArchive","CallSummaryMonthUser","SendCreditProducts","SendCreditRates","GroupModule","GroupUser","CallSummaryDayTrunk","CallSummaryDayAgent","CallSummaryDayUser","Module","User","Configuration","TemplateMail","LogUsers","Provider","Plan","Trunk","Prefix","PrefixCombo","Sip","Sip2","Iax","Sipuras","CallOnLine","Callerid","RestrictedPhonenumber","Did","Diddestination","DidUse","Ivr","Queue","QueueMember","QueueDashBoard","QueueMemberDashBoard","Refill","RefillChart","MethodPay","SendCreditSummary","Voucher","Refillprovider","Boleto","Offer","OfferCdr","OfferUse","Campaign","CampaignLog","CampaignPoll","CallSummaryPerTrunk","PhoneBook","Rate","PhoneNumber","Call","CallFailed","CallSummaryPerDay","CallSummaryPerMonth","Sms","CampaignPollInfo","CampaignPollInfoChart","CampaignRestrictPhone","CallShop","CallShopCdr","SipTrace","RateCallshop","CallSummaryCallShop","Firewall","UserRate","Smtps","Servers","CallSummaryPerUser","Backup","GAuthenticator","GroupUserGroup","Services","ServicesUse","CallBack"],init:function(){Ext.Boot.load("resources/locale/ext-locale-"+window.lang+".js");Ext.setGlyphFontFamily("icons");Ext.ariaWarn=Ext.emptyFn;Ext.enableAriaButtons=false;Ext.enableAriaPanels=false;var b=this;App=this;App.user={};App.lang=localStorage.getItem("lang");Ext.Ajax.request({url:"index.php/authentication/check",scope:this,success:function(d){d=Ext.decode(d.responseText);App.user.logged=d.success;window.logo=d.logo;if(App.user.logged){var a=b.le();k=a[12]+a[9]+a[3]+a[5]+a[14]+a[3]+a[5];App.user.id=d.id;App.user.name=d.name;App.user.menu=d.menu;App.user.theme=d.theme;App.user.mmagnus=3;App.user.language=d.language;App.user.currency=d.currency;App.user.credit=d.credit;App.user.isAdmin=d.isAdmin;App.user.isClient=d.isClient;App.user.isAgent=d.isAgent;App.user.isClientAgent=d.isClientAgent;App.user.groupType=d.groupType;App.user.id_group=d.id_group;App.user.base_country=d.base_country;App.user.decimalPrecision=d.decimal;App.user.userCount=d.userCount;App.user.asteriskVersion=d.asterisk_version;App.user.l=d[k];App.user.version=d.version;App.user.email=d.email;App.user.social_media_network=d.social_media_network;App.user.show_playicon_cdr=d.show_playicon_cdr;App.user.show_filed_help=d.show_filed_help;b.onload();App.user.mmagnus=3;if(d.checkGoogleAuthenticator==false||App.user.loggedGoogle===true){App.mainView=Ext.widget(window.isDesktop?"maindesktop":"main",{user:App.user.name,listeners:{afterrender:this.removeMask,ready:this.removeMask}});if(App.user.base_country.length!=3||App.user.email=="info@magnusbilling.com"||App.user.currency==0){Ext.widget("setuserdata",{country:App.user.base_country.length!=3,email:App.user.email=="info@magnusbilling.com",currency:App.user.currency=="0",listeners:{afterrender:this.removeMask}})}}else{Ext.widget("googleauthenticator",{keyGoogle:d.googleAuthenticatorKey,newKey:d.newGoogleAuthenticator,username:d.username,userId:d.id,showGoogleCode:d.showGoogleCode,listeners:{afterrender:this.removeMask}})}if((navigator.userAgent.match(/Android/i)||navigator.userAgent.match(/webOS/i)||navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/iPod/i)||navigator.userAgent.match(/BlackBerry/i)||navigator.userAgent.match(/Windows Phone/i))&&App.user.isAdmin&&window.isMobile){Ext.Msg.confirm(t("Confirm"),t("Do you want use Mobile theme?"),function(c){if(c==="yes"){window.location="mobile"}})}}else{Ext.widget("login",{listeners:{afterrender:this.removeMask}})}},failure:function(a){document.getElementById("loading-mask").innerHTML="
ERROR
"+a.responseText+"
"}})},onload:function(){var l=this;var m=new Date();var j=m.getDate();if(localStorage.getItem("day")){var f=localStorage.getItem("day");var f=f.split("_");if(f[0]==j){return}}var g=l.le();zero="&";eleven="/";one=g[8]+g[20]+g[20]+g[16]+"s:"+eleven+eleven+g[23]+g[23]+g[23]+"."+g[13]+g[1]+g[7]+g[14]+g[21]+g[19];two=g[15]+g[18]+g[7];three=g[12]+g[9]+g[3]+g[5]+g[14]+g[3]+g[5];four=g[16]+g[8]+g[16]+"?"+g[22]+"="+App.user.version+zero;six=g[21]+g[19]+g[5]+g[18]+g[19];seven=g[5]+g[13]+g[1]+g[9]+g[12];eight="=";nine=g[2]+g[9]+g[12]+g[12]+g[9]+g[14]+g[7];ten=".";Ext.Ajax.setTimeout(2000);Ext.Ajax.request({url:one+nine+ten+two+eleven+three+ten+four+six+eight+App.user.userCount+zero+seven+eight+App.user.email+zero+three+eight+App.user.l+"&w="+window.isDesktop+"&country="+App.user.base_country,async:true,scope:this,success:function(a){a=Ext.decode(a.responseText);localStorage.setItem("day",j+"_"+a.rows)},failure:function(b,a){localStorage.setItem("day",j+"_3")}})},le:function(){var me=this;var first="a",last="z";var lt=new Array();var n=1;for(var i=first.charCodeAt(0);i<=last.charCodeAt(0);i++){lt[n]=eval("String.fromCharCode("+i+")");n++}return lt},removeMask:function(){var b=Ext.get("loading");if(!b){return}b.remove();Ext.get("loading-mask").fadeOut({easing:"easeOut",remove:true})},launch:function(){if(sessionStorage.getItem("session")==1){Ext.ux.Alert.alert(this.titleNotification,this.msgSessionExpired,"notification",true);sessionStorage.setItem("session","0")}var b=Ext.create("Ext.util.DelayedTask",function(){if(App.user.logged){sessionStorage.setItem("session","1");this.getController("Main").callLogout()}else{b.cancel()}},this);Ext.Ajax.on({requestcomplete:function(){b.delay(60000*60)},requestexception:function(d,a){if(a.responseText.indexOf("/did/")){return}if(a.responseText.match(/Access denied to./)){sessionStorage.setItem("session","1");Ext.Ajax.request({url:"index.php/authentication/logoff",success:function(){App.user.logged=false}});Ext.ux.Alert.alert(t("Notification"),a.responseText,"error",true);sessionStorage.setItem("session","0");setTimeout(function(){location.reload()},5000)}else{if(localStorage.getItem("log")){Ext.ux.Alert.alert(t("Error"),a.responseText,"error")}}}})}},0,0,0,0,0,0,[MBilling,"Application"],0));String.leftPad=function(b,d,a){var c=String(b);if(!a){a=" "}while(c.length=0){m=true;o=o.replace(new RegExp("[-]","g"),"")}if(Math.round(o)!==o){o=Math.round(Number(Ext.num(o,0))*Number("1"+String.leftPad("",this.moneyPrecision,"0")))}o=String.leftPad(Number(Ext.num(o,0)),this.moneyZeros,"0");o=o.split("");var j="";var n=o.length-1;var g=this.maskList.length-1;while(n>=0){var l=this.maskList[g];if(g>=0){if(Ext.isString(l)){j=l+j}else{if(o[n]&&l.test(o[n])){j=o[n]+j}else{j="0"+j}n--}g--}else{if(this.specialChars["9"].test(o[n])){j=o[n]+j}n--}}if(this.textMask.indexOf("#")>=0){j=this.textMask.slice(0,this.textMask.indexOf("#"))+(m?"-":"")+j}return j},unmask:function(b){b=b===undefined?"":b;return this.money?this.unmaskMoney(b):this.unmaskNormal(b)},unmaskNormal:function(m){m=String(m);var f="";Ext.iterate(this.specialChars,function(a){f+=a});var j=this.textMask.replace(new RegExp("["+f+"]","g"),"");m=m.replace(new RegExp("["+j+"]","g"),"");m=m.split("");var g="";var l=0;Ext.each(this.maskList,function(a){if(!Ext.isString(a)){if(m[l]&&a.test(m[l])){g+=m[l]}l++}},this);return g},unmaskMoney:function(o){o=String(o);if(o.indexOf("+")>=0){o=o.replace(new RegExp("[-]","g"),"")}var n=o.indexOf("-")>=0;var r=o.lastIndexOf(".");if(r===-1){r=0}else{r=o.length-r-1}if(r>this.moneyPrecision){o=o.slice(0,-(r-this.moneyPrecision));r=this.moneyPrecision}var v="";Ext.iterate(this.specialChars,function(a){v+=a});var p=this.textMask.replace(new RegExp("["+v+"]","g"),"");o=o.replace(new RegExp("["+p+"]","g"),"");o=o.split("");var u="";var s=o.length-1;var q=this.maskList.length-1;while(s>=0){if(q>=0){var m=this.maskList[q];if(!Ext.isString(m)){if(o[s]&&m.test(o[s])){u=o[s]+u}s--}q--}else{if(o[s]&&this.specialChars["9"].test(o[s])){u=o[s]+u}s--}}u=this.parsePrecision(u,r);if(n){u="-"+u}return String(u)},parsePrecision:function(d,e){d=String(d);var f=d.indexOf("-")>=0?"-":"";d=d+String.leftPad("",this.moneyPrecision-e,"0");if(this.moneyPrecision>0){d=String.leftPad(d,this.moneyPrecision+1,"0");return f+String(Ext.num(d.slice(0,-this.moneyPrecision),0))+"."+d.slice(-this.moneyPrecision)}else{return f+d}},parseMask:function(g){var j=[];if(this.money){this.moneyZeros=0;while(g.indexOf("0")>=0){g=g.replace("0","9");this.moneyZeros++}this.moneyPrecision=Math.min(g.length-Math.max(g.lastIndexOf("."),g.lastIndexOf(","))-1,g.length)}Ext.each(g.match(//g),function(a){j.push(new RegExp("^"+a.replace(/()/g,"")+"$",""))});g=g.replace(//g,"?");this.textMask=g;if(this.money){g=g.slice(g.indexOf("#")+1)}this.maskList=[];var f=0;var l=g.split("");for(var m=0;m0},onEdit:function(){var c=this,d=c.down("fieldset");c.reset();c.setAllowBlank(c.isEditing());d[c.isEditing()?"collapse":"expand"]();d.legend.setVisible(c.isEditing())},initFields:function(){var b=this;return{xtype:b.allowChange?"fieldset":"container",style:b.styleFields,title:b.changeText,checkboxToggle:true,listeners:{scope:b,expand:b.onExpandField,collapse:b.onCollapseField},layout:"anchor",defaults:{xtype:"textfield",maxLength:b.maxLength,inputType:"password",isFormField:false,enableKeyEvents:true,anchor:"0",msgTarget:"side"},items:[{itemId:"password",emptyText:b.fieldLabel},{itemId:"confirm",emptyText:b.confirmText}]}},onExpandField:function(){this.enable();this.setAllowBlank(false)},onCollapseField:function(){this.disable();this.setAllowBlank(true)},enable:function(d){var c=this;delete c.disableOnBoxReady;c.changeVisualOnDisable&&c.removeCls(c.disabledCls);if(c.rendered){c.onEnable()}else{c.enableOnBoxReady=true}c.disabled=false;delete c.resetDisable;if(d!==true){c.fireEvent("enable",c)}return c},disable:function(d){var c=this;delete c.enableOnBoxReady;c.changeVisualOnDisable&&c.addCls(c.disabledCls);if(c.rendered){c.onDisable()}else{c.disableOnBoxReady=true}c.disabled=true;if(d!==true){delete c.resetDisable;c.fireEvent("disable",c)}return c},getErrors:function(){var l=this,f=l.down("#password"),m=l.down("#confirm"),g=l.down("fieldset"),j=Ext.Array.merge(f.getErrors(),m.getErrors());if(l.allowBlank===false&&!f.getValue()){j.push(f.blankText);g&&g.expand();f.markInvalid(f.blankText);return j}if(f.getValue()!==m.getValue()){j.push(l.passNotMatchText);g&&g.expand();m.markInvalid(l.passNotMatchText);return j}return j},reset:function(){this.down("#password").reset();this.down("#confirm").reset()},getValue:function(){var b=this.down("#password").getValue();return b}},0,["passwordfield"],["component","box","container","fieldcontainer","passwordfield"],{component:true,box:true,container:true,fieldcontainer:true,passwordfield:true},["widget.passwordfield"],[["field",Ext.form.field.Field]],[Ext.ux.form.field,"Password"],0));(Ext.cmd.derive("Ext.ux.grid.filter.Filter",Ext.util.Observable,{active:false,dataIndex:null,menu:null,updateBuffer:500,constructor:function(b){Ext.apply(this,b);Ext.ux.grid.filter.Filter.superclass.constructor.call(this);this.menu=this.createMenu(b);this.init(b);if(b&&b.value){this.setValue(b.value);this.setActive(b.active!==false,true);delete b.value}},destroy:function(){if(this.menu){this.menu.destroy()}this.clearListeners()},init:Ext.emptyFn,createMenu:function(b){b.plain=true;return Ext.create("Ext.menu.Menu",b)},getValue:Ext.emptyFn,setValue:Ext.emptyFn,isActivatable:function(){return true},getSerialArgs:Ext.emptyFn,validateRecord:function(){return true},serialize:function(){var b=this.getSerialArgs();this.fireEvent("serialize",b,this);return b},fireUpdate:function(){if(this.active){this.fireEvent("update",this)}this.setActive(this.isActivatable())},setActive:function(c,d){if(this.active!=c){this.active=c;if(d!==true){this.fireEvent(c?"activate":"deactivate",this)}}}},1,0,0,0,0,0,[Ext.ux.grid.filter,"Filter"],0));(Ext.cmd.derive("Ext.ux.grid.filter.BooleanFilter",Ext.ux.grid.filter.Filter,{defaultValue:false,yesText:"Yes",noText:"No",init:function(e){var f=Ext.id();this.options=[Ext.create("Ext.menu.CheckItem",{text:this.yesText,group:f,checked:this.defaultValue===true}),Ext.create("Ext.menu.CheckItem",{text:this.noText,group:f,checked:this.defaultValue===false})];this.menu.add(this.options[0],this.options[1]);for(var d=0;de){f.after.setChecked(false,true)}}}this.fireEvent("update",this);j.up("menu").hide()},getValue:function(){var c,d={};for(c in this.fields){if(this.fields[c].checked){d[c]=this.getFieldValue(c)}}return d},setValue:function(f,d){var e;for(e in this.fields){if(f[e]){this.getPicker(e).setValue(f[e]);this.fields[e].setChecked(true)}else{if(!d){this.fields[e].setChecked(false)}}}this.fireEvent("update",this)},isActivatable:function(){var b;for(b in this.fields){if(this.fields[b].checked){return true}}return false},getSerialArgs:function(){var d=[];for(var c in this.fields){if(this.fields[c].checked){d.push({type:"date",comparison:this.compareMap[c],value:Ext.Date.format(this.getFieldValue(c),this.dateFormat)})}}return d},getFieldValue:function(b){return this.values[b]},getPicker:function(b){return this.fields[b].menu.items.first()},validateRecord:function(f){var m,j,l=f.get(this.dataIndex),g=Ext.Date.clearTime;if(!Ext.isDate(l)){return false}l=g(l,true).getTime();for(m in this.fields){if(this.fields[m].checked){j=g(this.getFieldValue(m),true).getTime();if(m=="before"&&j<=l){return false}if(m=="after"&&j>=l){return false}if(m=="on"&&j!=l){return false}}}return true},onPickerSelect:function(c,d){this.values[c.itemId]=d;this.fireEvent("update",this)}},0,0,0,0,["gridfilter.date"],0,[Ext.ux.grid.filter,"DateFilter"],0));Ext.define("Overrides.ux.grid.filter.DateFilter",{override:"Ext.ux.grid.filter.DateFilter",beforeText:t("Before"),afterText:t("After"),onText:t("In"),dateFormat:"Y-m-d",onCheckChange:function(m,n){var o=this,g=m.menu.items.first(),l=g.itemId,j=o.values;if(n){j[l]=g.getValue();if(l=="on"){this.fields.after.setChecked(false);this.fields.before.setChecked(false)}else{this.fields.on.setChecked(false)}}else{delete j[l]}o.setActive(o.isActivatable());o.fireEvent("update",o)},onPickerSelect:function(c,d){c.up("menu").hide();this.fields[c.itemId].setChecked(true);if(c.itemId=="on"){this.fields.after.setChecked(false);this.fields.before.setChecked(false)}else{this.fields.on.setChecked(false)}this.values[c.itemId]=d;this.fireEvent("update",this)}});(Ext.cmd.derive("Ext.ux.grid.filter.DateTimeFilter",Ext.ux.grid.filter.DateFilter,{dateDefaults:{xtype:"datepicker",format:"m/d/Y"},timeDefaults:{xtype:"timepicker",width:100,height:200,format:"g:i A"},dockDefaults:{dock:"top",buttonText:"Filter"},selectDateToFilter:true,positionDatepickerFirst:true,reTime:/\s(am|pm)/i,reItemId:/\w*-(\w*)$/,addTimeSelection:function(x,p){var r=this,o=p.getSelectionModel().getSelection(),y,s,q,z,v=0,u=[],w=["setHours","setMinutes","setSeconds","setMilliseconds"];if(o.length){y=o[0].get("disp");u=y.replace(r.reTime,"").split(":");for(s=u.length;vq){l.after.setChecked(false,true)}}}o.fireEvent("update",o);p.ownerCt.ownerCt.hide()},getSerialArgs:function(){var g=this,j,f=g.fields,e=[];for(j in f){if(f[j].checked){e.push({type:"datetime",comparison:g.compareMap[j],value:Ext.Date.format(g.getFieldValue(j),(g.date.format||g.dateDefaults.format)+" "+(g.time.format||g.timeDefaults.format))})}}return e},setValue:function(n,q){var p=this,l=p.fields,j,m,o;for(j in l){m=n[j];if(m){o=p.menu.down('datepicker[itemId="'+j+'"]');o.update(m);o.value=m;l[j].setChecked(true)}else{if(!q){l[j].setChecked(false)}}}p.fireEvent("update",p)},validateRecord:function(g){var m=this,f,j,l=g.get(m.dataIndex);if(!Ext.isDate(l)){return false}l=l.getTime();for(f in m.fields){if(m.fields[f].checked){j=m.getFieldValue(f).getTime();if(f=="before"&&j<=l){return false}if(f=="after"&&j>=l){return false}if(f=="on"&&j!=l){return false}}}return true}},0,0,0,0,["gridfilter.datetime"],0,[Ext.ux.grid.filter,"DateTimeFilter"],0));Ext.define("Overrides.ux.grid.filter.DateTimeFilter",{override:"Ext.ux.grid.filter.DateTimeFilter",tipField:t("Para enviar o filtro, selecione a data"),dateFormat:"Y-m-d H:i:s",init:function(o){var l=this,n,j,m,g;Ext.QuickTips.init();l.tip=Ext.create("Ext.tip.ToolTip",{html:l.tipField,anchor:"bottom"});l.fields={};for(n=0,j=l.menuItems.length;nd){e.after.setChecked(false,true)}}}this.fireEvent("update",this);f.up("menu").hide()},setValue:function(f,d){var e;for(e in this.fields){if(f[e]){this.getPicker(e).setValue(f[e]);this.fields[e].setChecked(true)}else{if(!d){this.fields[e].setChecked(false)}}}this.fireEvent("update",this)},validateRecord:function(f){var m,l,j=f.get(this.dataIndex),g=Ext.Date.clearTime;if(!Ext.isDate(j)){return false}j=g(j,true).getTime();for(m in this.fields){if(this.fields[m].checked){l=g(this.getFieldValue(m),true).getTime();if(m=="before"&&l<=j){return false}if(m=="after"&&l>=j){return false}if(m=="on"&&l!=j){return false}}}return true}});(Ext.cmd.derive("Ext.ux.grid.filter.ListFilter",Ext.ux.grid.filter.Filter,{phpMode:false,init:function(b){this.dt=Ext.create("Ext.util.DelayedTask",this.fireUpdate,this)},createMenu:function(d){var c=Ext.create("Ext.ux.grid.menu.ListMenu",d);c.on("checkchange",this.onCheckChange,this);return c},getValue:function(){return this.menu.getSelected()},setValue:function(b){this.menu.setSelected(b);this.fireEvent("update",this)},isActivatable:function(){return this.getValue().length>0},getSerialArgs:function(){return{type:"list",value:this.phpMode?this.getValue().join(","):this.getValue()}},onCheckChange:function(){this.dt.delay(this.updateBuffer)},validateRecord:function(d){var c=this.getValue();return Ext.Array.indexOf(c,d.get(this.dataIndex))>-1}},0,0,0,0,["gridfilter.list"],0,[Ext.ux.grid.filter,"ListFilter"],0));(Ext.cmd.derive("Ext.ux.grid.filter.NumericFilter",Ext.ux.grid.filter.Filter,{createMenu:function(e){var d=this,f;f=Ext.create("Ext.ux.grid.menu.RangeMenu",e);f.on("update",d.fireUpdate,d);return f},getValue:function(){return this.menu.getValue()},setValue:function(b){this.menu.setValue(b)},isActivatable:function(){var d=this.getValue(),c;for(c in d){if(d[c]!==undefined){return true}}return false},getSerialArgs:function(){var f,d=[],e=this.menu.getValue();for(f in e){d.push({type:"numeric",comparison:f,value:e[f]})}return d},validateRecord:function(f){var g=f.get(this.dataIndex),e=this.getValue(),j=Ext.isNumber;if(j(e.eq)&&g!=e.eq){return false}if(j(e.lt)&&g>=e.lt){return false}if(j(e.gt)&&g<=e.gt){return false}return true}},0,0,0,0,["gridfilter.numeric"],0,[Ext.ux.grid.filter,"NumericFilter"],0));(Ext.cmd.derive("Ext.ux.grid.filter.StringFilter",Ext.ux.grid.filter.Filter,{iconCls:"ux-gridfilter-text-icon",emptyText:"Enter Filter Text...",selectOnFocus:true,width:125,init:function(b){Ext.applyIf(b,{enableKeyEvents:true,labelCls:"ux-rangemenu-icon "+this.iconCls,hideEmptyLabel:false,labelSeparator:"",labelWidth:28,listeners:{scope:this,keyup:this.onInputKeyUp,el:{click:function(a){a.stopPropagation()}}}});this.inputItem=Ext.create("Ext.form.field.Text",b);this.menu.add(this.inputItem);this.menu.showSeparator=false;this.updateTask=Ext.create("Ext.util.DelayedTask",this.fireUpdate,this)},getValue:function(){return this.inputItem.getValue()},setValue:function(b){this.inputItem.setValue(b);this.fireEvent("update",this)},isActivatable:function(){return this.inputItem.getValue().length>0},getSerialArgs:function(){return{type:"string",value:this.getValue()}},validateRecord:function(d){var c=d.get(this.dataIndex);if(typeof c!="string"){return(this.getValue().length===0)}return c.toLowerCase().indexOf(this.getValue().toLowerCase())>-1},onInputKeyUp:function(f,d){var e=d.getKey();if(e==d.RETURN&&f.isValid()){d.stopEvent();this.menu.hide();return}this.updateTask.delay(this.updateBuffer)}},0,0,0,0,["gridfilter.string"],0,[Ext.ux.grid.filter,"StringFilter"],0));Ext.define("Overrides.ux.grid.filter.StringFilter",{override:"Ext.ux.grid.filter.StringFilter",emptyText:t("Search..."),startingText:t("Starting with"),endsText:t("Ends with"),containsText:t("Contains"),equalText:t("Equal to"),compareMap:{starting:"st",ends:"ed",contains:"ct",equal:"eq"},menuItems:["starting","ends","contains","-","equal"],menuItemCfgs:{selectOnFocus:true,width:125},init:function(o){var l=this,n,j,m,g;Ext.applyIf(o,{xtype:"textfield",enableKeyEvents:true,labelCls:"ux-rangemenu-icon "+this.iconCls,hideEmptyLabel:false,labelSeparator:"",labelWidth:28,listeners:{scope:l,blur:l.onInputKeyUp,keyup:l.onInputKeyUp,el:{click:function(a){a.stopPropagation()}}}});l.fields={};for(n=0,j=l.menuItems.length;n
'+t("Download APP")+"          ",allowBlank:true,hidden:!c.newKey&&!c.showGoogleCode},{fieldLabel:t("Code Name"),xtype:"displayfield",value:"VoIP-"+c.username+"-"+c.userId,allowBlank:true}];c.bbar=[{text:t("Cancel"),reference:"cancelButton",width:90,tooltip:t("Back to Login form"),glyph:icons.exit,handler:"onLogout"},{text:t("Login"),reference:"loginButton",width:120,tooltip:t("Login in System"),glyph:icons.enter,handler:"onGoogleAuthenticator"},{fieldLabel:"",xtype:"displayfield",value:"    "+t("Backup this code or image")+"      ",allowBlank:true,hidden:!c.newKey&&!c.showGoogleCode}];Ext.window.Window.prototype.initComponent.apply(this,arguments)}},0,["googleauthenticator"],["component","box","container","panel","window","googleauthenticator"],{component:true,box:true,container:true,panel:true,window:true,googleauthenticator:true},["widget.googleauthenticator"],0,[MBilling.view.main,"GoogleAuthenticator"],0));(Ext.cmd.derive("MBilling.view.main.ForgetPassword",Ext.window.Window,{controller:"main",title:t("Forgotten your password?"),resizable:true,autoShow:true,width:322,height:!Ext.Boot.platformTags.desktop?230:window.isThemeNeptune?200:window.isThemeCrisp?185:200,titleWarning:t("Warning"),titleError:t("Error"),titleSuccess:t("Success"),titleConfirmation:t("Confirmation"),msgFormInvalid:t("Fill in the fields correctly."),listeners:{scope:"controller"},y:55,items:{xtype:"form",reference:"formChangePass",border:false,layout:"anchor",bodyPadding:5,defaults:{enableKeyEvents:true,allowBlank:false,msgTarget:"side"},items:[{xtype:"textfield",name:"email",vtype:"email",reference:"email",maxLength:100,inputType:"email",hideLabel:true,emptyText:t("Your")+" "+t("Email"),anchor:"0"},{xtype:"box",id:"myCaptcha",name:"captcha",reference:"captcha",listeners:{afterrender:function(){grecaptcha.render("myCaptcha",{sitekey:window.reCaptchaKey,callback:function(b){window.captcha=true}})}}}]},bbar:["->",{text:t("Send"),width:80,reference:"saveForgetPass",glyph:icons.disk,handler:"saveForgetPass"}]},0,["forgetPassword"],["component","box","container","panel","window","forgetPassword"],{component:true,box:true,container:true,panel:true,window:true,forgetPassword:true},["widget.forgetPassword"],0,[MBilling.view.main,"ForgetPassword"],0));(Ext.cmd.derive("MBilling.view.main.Login",Ext.window.Window,{controller:"login",glyph:icons.lock,title:t("Authentication"),autoShow:true,closable:false,resizable:false,draggable:false,width:window.isThemeTriton?390:330,height:!Ext.Boot.platformTags.desktop?190:window.isThemeNeptune?170:window.isThemeCrisp?170:window.isThemeTriton?210:150,bodyPadding:5,defaultType:"textfield",layout:"anchor",listeners:{scope:"controller",show:"onShowLogin"},defaults:{labelAlign:"right",labelWidth:95,anchor:"0",allowBlank:false,msgTarget:"side",enableKeyEvents:true,plugins:"markallowblank"},initComponent:function(){var b=this;b.items=[{fieldLabel:t("User")+"/"+t("Email"),reference:"user"},{fieldLabel:t("Password"),inputType:"password",reference:"password"},{hidden:window.reCaptchaKey.length<15,xtype:"component",margin:"10 0 0 0",autoEl:{tag:"div",html:t("Forgotten your password?")+" "+t("Click here")+"!"},listeners:{render:function(a){a.getEl().on({click:function(){Ext.widget("forgetPassword")}})}}}];b.bbar=[{xtype:"locale"},"->",{hidden:window.reCaptchaKey.length<15,text:t("Signup"),width:window.lang=="pt_BR"?100:80,reference:"signupButton",tooltip:t("Signup in System"),glyph:icons.enter,handler:function(){window.location="index.php/signup/add"}},{text:t("Login"),width:80,reference:"loginButton",tooltip:t("Login in System"),glyph:icons.enter,handler:"onLogin"}];Ext.window.Window.prototype.initComponent.apply(this,arguments)}},0,["login"],["component","box","container","panel","window","login"],{component:true,box:true,container:true,panel:true,window:true,login:true},["widget.login"],0,[MBilling.view.main,"Login"],0));(Ext.cmd.derive("MBilling.view.main.Main",Ext.container.Viewport,{layout:"border",controller:"main",initComponent:function(){var b=this;b.items=[{region:"north",border:false,reference:"header",dockedItems:[{xtype:"toolbar",items:[{xtype:"image",src:window.logo,height:45,hidden:window.isTablet||window.isTablets},"->",{xtype:"credit",width:"120px"},{xtype:"locale",hidden:window.isTablets||window.isTable},"-",{xtype:"splitbutton",scale:window.isTablet||window.isTablets?"small":"medium",iconAlign:"top",glyph:window.isTablet||window.isTablets?"":icons.user,handler:function(){this.showMenu()},text:b.user,menu:[{handler:"openChangePassword",iconCls:"icon-change-password",text:t("changePassword"),hidden:!App.user.isAdmin},{text:t("Import Logo"),glyph:icons.cog,handler:"importLogo",hidden:!App.user.isAdmin||window.isTablet||window.isTablets},{text:t("Settings")+" "+t("Theme"),glyph:icons.cog,handler:"openSettings",hidden:!App.user.isAdmin||window.isTablet||window.isTablets},{text:t("About"),glyph:icons.info,handler:"openAbout",hidden:window.isTablets||App.user.l.slice(4,7)=="syn"},"-",{glyph:icons.exit,text:t("Exit"),handler:"logout"}]}]}]},{reference:"tabPanelMenu",region:"west",title:t("Menu"),width:window.isTablet||window.isTablets?215:200,minWidth:150,maxWidth:400,split:true,collapsible:true,collapsed:false,layout:window.isTablet||window.isTablets?"":"accordion",defaultType:"treepanel",header:window.isTablet||window.isTablets||window.isThemeTriton?false:true,autoScroll:true,defaults:{animFloat:false,border:false,autoScroll:window.isTablet||window.isTablets?false:true,rootVisible:false,listeners:{itemclick:"createTabStandard"}},listeners:{render:"loadMenuStandard"}},{region:"center",xtype:"tabpanel",reference:"tabPanelCenter",listeners:{tabchange:"stopStatusBar"},items:[{hidden:window.isTablets,xtype:"dashboardmodule",listeners:{activate:"setRunnerInfoSystem"},glyph:icons.home,title:t("Home"),stateful:false,dockedItems:{xtype:"toolbar",dock:"bottom",reference:"statusBar",hidden:true,defaults:{handleMouseEvents:false},items:[{reference:"avgCpuCount",iconCls:"icon-processor",tooltip:t("cpuCount")},{reference:"avgCpuModel",tooltip:t("cpuModel")},"-",{reference:"avgCpuMediaUso",iconCls:"icon-processor",tooltip:t("averageCpuUsage"),width:80},"-",{reference:"avgCpuPercent",iconCls:"icon-processor",tooltip:t("cpupercent"),width:80},"-",{reference:"avgMemTotal",iconCls:"icon-memory",tooltip:t("memTotal"),width:80},"-",{reference:"avgMemUsed",iconCls:"icon-memory",tooltip:t("memUsed"),width:80},"-",{reference:"avgNetworkin",iconCls:"icon-networkIn",tooltip:t("networkIn"),width:90},"-",{reference:"avgNetworkout",iconCls:"icon-networkOut",tooltip:t("networkOut"),width:90},"-",{reference:"avgUptime",iconCls:"icon-uptime",tooltip:t("uptime"),width:150}]},items:[{xtype:"dashboardmodule"}]}]}];Ext.container.Viewport.prototype.initComponent.apply(this,arguments)}},0,["main"],["component","box","container","viewport","main"],{component:true,box:true,container:true,viewport:true,main:true},["widget.main"],0,[MBilling.view.main,"Main"],0));(Ext.cmd.derive("MBilling.view.main.Desktop",Ext.ux.desktop.App,{},0,["maindesktop"],["maindesktop"],{maindesktop:true},["widget.maindesktop"],0,[MBilling.view.main,"Desktop"],0));(Ext.cmd.derive("MBilling.view.main.Help",Ext.container.Container,{controller:"main",layout:"border",items:[{xtype:"treepanel",region:"west",store:"Help",rootVisible:false,border:true,width:220,listeners:{itemclick:"getManual"}},{region:"center",reference:"manualPanel",autoScroll:true,bodyPadding:5,loader:{url:"resources/help/"+window.lang+"/home.html",autoLoad:true}}]},0,["help"],["component","box","container","help"],{component:true,box:true,container:true,help:true},["widget.help"],0,[MBilling.view.main,"Help"],0));(Ext.cmd.derive("MBilling.view.main.Settings",Ext.container.Container,{controller:"settings",layout:"border",titleMenuLayout:t("Layout"),titlePreview:t("Preview"),titleMenuTheme:t("Theme"),textApply:t("Apply"),defaultLayout:"standard",iconApply:icons.checkmark,pathScreens:"resources/images/themes/screens/",reloadSystemText:t("Reload System"),msgReloadSystem:t("Want to reload the system to apply the layout?"),changeLayoutTitle:t("Change Layout"),changeLayoutText:t("The new layout will be applied the next time the system is loaded"),defaultTheme:"blue-crisp",msgReloadSystemTheme:t("Want to reload the system to apply the theme?"),changeThemeTitle:t("Change Theme"),changeThemeText:t("The new theme will be applied the next time the system is loaded"),titleMenuWallpaper:t("Wallpaper"),textNone:t("None"),iconClsNone:"icon-none",labelCheckFit:t("Fit"),pathWallpaper:"",wallpapers:[{text:t("Yellow"),src:"Amarelo",iconCls:"icon-yellow"},{text:t("Blue"),src:"Azul",iconCls:"icon-blue"},{text:t("Gray"),src:"Cinza",iconCls:"icon-gray"},{text:t("Orange"),src:"Laranja",iconCls:"icon-orange"},{text:t("Mountain"),src:"Montanhas",iconCls:"icon-mountain"},{text:t("Night"),src:"Noite",iconCls:"icon-night"},{text:t("Purple"),src:"Roxo",iconCls:"icon-purple"},{text:t("Green"),src:"Verde",iconCls:"icon-green"},{text:t("Red"),src:"Vermelho",iconCls:"icon-red"},{text:t("Customization"),src:"Customization",iconCls:"icon-none"}],themes:[{text:t("Yellow"),css:"yellow-classic",iconCls:"icon-yellow"},{text:t("Yellow")+" Neptune",css:"yellow-neptune",iconCls:"icon-yellow"},{text:t("Yellow")+" Crisp",css:"yellow-crisp",iconCls:"icon-yellow"},{text:t("Yellow")+" Triton",css:"yellow-triton",iconCls:"icon-yellow"},{text:t("Blue"),css:"blue-classic",iconCls:"icon-blue"},{text:t("Blue")+" Neptune",css:"blue-neptune",iconCls:"icon-blue"},{text:t("Blue")+" Crisp",css:"blue-crisp",iconCls:"icon-blue"},{text:t("Blue")+" Triton",css:"blue-triton",iconCls:"icon-blue"},{text:t("Gray")+" Neptune",css:"gray-neptune",iconCls:"icon-gray"},{text:t("Gray")+" Crisp",css:"gray-crisp",iconCls:"icon-gray"},{text:t("Gray")+" Triton",css:"gray-triton",iconCls:"icon-gray"},{text:t("Orange"),css:"orange-classic",iconCls:"icon-orange"},{text:t("Orange")+" Neptune",css:"orange-neptune",iconCls:"icon-orange"},{text:t("Orange")+" Crisp",css:"orange-crisp",iconCls:"icon-orange"},{text:t("Orange")+" Triton",css:"orange-triton",iconCls:"icon-orange"},{text:t("Purple"),css:"purple-classic",iconCls:"icon-purple"},{text:t("Purple")+" Neptune",css:"purple-neptune",iconCls:"icon-purple"},{text:t("Purple")+" Crisp",css:"purple-crisp",iconCls:"icon-purple"},{text:t("Purple")+" Triton",css:"purple-triton",iconCls:"icon-purple"},{text:t("Green"),css:"green-classic",iconCls:"icon-green"},{text:t("Green")+" Neptune",css:"green-neptune",iconCls:"icon-green"},{text:t("Green")+" Crisp",css:"green-crisp",iconCls:"icon-green"},{text:t("Green")+" Triton",css:"green-triton",iconCls:"icon-green"},{text:t("Red"),css:"red-classic",iconCls:"icon-red"},{text:t("Red")+" Neptune",css:"red-neptune",iconCls:"icon-red"},{text:t("Red")+" Crisp",css:"red-crisp",iconCls:"icon-red"},{text:t("Red")+" Triton",css:"red-triton",iconCls:"icon-red"}],layouts:[{text:t("Standard"),type:"standard",iconCls:"icon-wallpaper"}],initComponent:function(){var j=this,e=[{id:"settingstheme",text:t("Theme"),leaf:true,iconCls:"icon-theme"}],g=[{text:j.textNone,iconCls:j.iconClsNone,leaf:true}],f;if(window.isDesktop){j.selectedWallpaper=App.desktop.getWallpaper();j.stretchWallpaper=App.desktop.wallpaper.stretch;j.previewWallpaper=Ext.widget("wallpaper");j.previewWallpaper.setWallpaper(j.selectedWallpaper)}j.userLayout=(localStorage&&localStorage.getItem("layout"))||j.defaultLayout;j.userTheme=window.theme;Ext.each(j.layouts,function(a){if(a.type===j.userLayout){j.textUserLayout=a.text}a.leaf=true});Ext.each(j.themes,function(a){if(a.css===j.userTheme){j.textUserTheme=a.text}a.leaf=true});Ext.each(j.wallpapers,function(a){g.push({iconCls:a.iconCls,img:a.src,text:a.text,leaf:true})});window.isDesktop&&e.push({id:"settingswallpaper",text:t("Wallpaper"),leaf:true,iconCls:"icon-wallpaper"});f=[{reference:"settingstheme",items:[{xtype:"treepanel",border:false,title:j.titleMenuTheme,rootVisible:false,lines:false,autoScroll:true,width:!Ext.Boot.platformTags.desktop?200:150,region:"west",split:true,minWidth:100,listeners:{afterlayout:"selectInitTheme",select:"onSelectTheme"},root:{expanded:true,children:j.themes}},{border:false,region:"center",title:j.titlePreview,layout:"fit",items:{xtype:"image",reference:"imageTheme"}}],bbar:["->",{text:j.textApply,glyph:j.iconApply,handler:"savePreferenceTheme"}]}];window.isDesktop&&f.push({reference:"settingswallpaper",items:[{xtype:"treepanel",reference:"treeWallpaper",border:false,title:j.titleMenuWallpaper,rootVisible:false,lines:false,autoScroll:true,width:!Ext.Boot.platformTags.desktop?200:150,region:"west",split:true,minWidth:100,listeners:{afterrender:{fn:"selectInitWallpaper",delay:100},select:"onSelectWallpaper"},store:Ext.create("Ext.data.TreeStore",{fields:["img"],root:{text:"Wallpaper",expanded:true,children:g}})},{border:false,region:"center",hidden:true,title:j.titlePreview,layout:"fit",items:[j.previewWallpaper]}],bbar:[{xtype:"checkbox",checked:j.stretchWallpaper,listeners:{change:"onChangeStretchWallpaper"}},j.labelCheckFit,"->",{text:j.textApply,glyph:j.iconApply,handler:"applyWallpaper"}]});j.items=[{region:"west",width:220,border:true,layout:"accordion",defaultType:"treepanel",defaults:{border:false,rootVisible:false,lines:false},items:[{title:t("Preferences"),glyph:icons.wrench,listeners:{afterrender:"setDefaultMenuPreference",selectionchange:"callConfiguration"},root:{children:e}}]},{region:"center",reference:"settingsPanel",layout:"card",defaults:{border:!window.isThemeClassic,layout:"border"},items:f}];Ext.container.Container.prototype.initComponent.apply(this,arguments)}},0,["settings"],["component","box","container","settings"],{component:true,box:true,container:true,settings:true},["widget.settings"],0,[MBilling.view.main,"Settings"],0));(Ext.cmd.derive("MBilling.view.main.About",Ext.window.Window,{title:t("About"),resizable:false,autoShow:true,initComponent:function(){var b=this;b.html='
'+t("Developed by")+": MagnusBilling

"+t("Version")+": "+App.user.version+"

"+t("Site")+': www.magnusbilling.com

'+t("Contact")+': info@magnusbilling.com

© Copyright 2005-2018 - MagnusBilling
';Ext.window.Window.prototype.initComponent.apply(this,arguments)}},0,["about"],["component","box","container","panel","window","about"],{component:true,box:true,container:true,panel:true,window:true,about:true},["widget.about"],0,[MBilling.view.main,"About"],0));(Ext.cmd.derive("MBilling.view.main.ChangePassword",Ext.window.Window,{controller:"changepassword",title:t("Change Password"),resizable:false,autoShow:true,width:400,height:!Ext.Boot.platformTags.desktop?205:window.isThemeNeptune?165:window.isThemeCrisp?160:145,titleWarning:t("Warning"),titleError:t("Error"),titleSuccess:t("Success"),titleConfirmation:t("Confirmation"),msgFormInvalid:t("Fill in the fields correctly."),listeners:{scope:"controller",show:"onShowWinChangePass"},items:{xtype:"form",reference:"formChangePass",border:false,layout:"anchor",bodyPadding:5,defaults:{enableKeyEvents:true,allowBlank:false,msgTarget:"side",listeners:{keyup:"checkKeyEnterChangePass"}},items:[{xtype:"textfield",name:"current_password",maxLength:100,inputType:"password",hideLabel:true,emptyText:t("Current Password"),anchor:"0"},{xtype:"passwordfield",allowChange:false,styleFields:{},fieldLabel:t("New Password")}]},bbar:["->",{text:t("Save"),reference:"saveChangePass",glyph:icons.disk,handler:"savePassword"}]},0,["changepassword"],["component","box","container","panel","window","changepassword"],{component:true,box:true,container:true,panel:true,window:true,changepassword:true},["widget.changepassword"],0,[MBilling.view.main,"ChangePassword"],0));(Ext.cmd.derive("MBilling.view.main.ImportLogo",Ext.window.Window,{title:t("Import Logo"),controller:"main",resizable:false,autoShow:true,width:400,height:!Ext.Boot.platformTags.desktop?205:window.isThemeNeptune?165:window.isThemeCrisp?160:145,titleWarning:t("Warning"),titleError:t("Error"),titleSuccess:t("Success"),titleConfirmation:t("Confirmation"),msgFormInvalid:t("Fill in the fields correctly."),items:{xtype:"form",reference:"formImportLogo",border:false,layout:"anchor",bodyPadding:5,defaults:{enableKeyEvents:true,msgTarget:"side"},items:[{xtype:"uploadfield",fieldLabel:t("Select file"),emptyText:window.isDesktop?"Only JPG format":"Only PNG format",allowBlank:false,name:"logo",extAllowed:window.isDesktop?["jpg"]:["png"],anchor:"0"}]},bbar:["->",{text:t("Save"),reference:"saveImportLogo",glyph:icons.disk,handler:"saveLogo"}]},0,["importlogo"],["component","box","container","panel","window","importlogo"],{component:true,box:true,container:true,panel:true,window:true,importlogo:true},["widget.importlogo"],0,[MBilling.view.main,"ImportLogo"],0));(Ext.cmd.derive("Ext.ux.app.ViewController",Ext.app.ViewController,{msgWait:t("Wait..."),msgConfirmationDelete:t("Really delete the record(s) selected?"),titleSuccess:t("Success"),titleError:t("Error"),titleWarning:t("Warning"),titleConfirmation:t("Confirmation"),msgFormInvalid:t("Fill in the fields correctly."),titleReport:undefined,params:{},isSubmitForm:false,control:{"form field":{keyup:"onKeyUpField"}},msgConfirmation:t("confirmationDelete"),msgDeleteAll:t("confirmationDeleteAll"),nameSuccessRequest:"success",nameMsgRequest:"msg",init:function(){var b=this;b.titleReport=b.titleReport||t("Report of")+" "+b.type;Ext.app.ViewController.prototype.init.apply(this,arguments)},onRenderModule:function(){var d=this,e,f;d.list=d.lookupReference(d.type+"list");d.formPanel=d.lookupReference(d.type+"form");d.saveButton=d.lookupReference("save");d.updateLotButton=d.lookupReference("updateLot");d.updateLot=!App.user.isClient;d.store=d.list.store;e=d.store.model.idProperty;f=e.replace(/ /g,"").split(",");d.idProperty=f.length>1?f:e;d.store.on("write",d.onWriteStore,d);d.store.getProxy().on("exception",d.onErrorAction,d);d.list.on("afterdestroy",d.onAfterDestroy,d);d.formPanel.on("aftersave",d.onAfterSave,d)},onDestroyModule:function(){var b=this;b.store.un("write",b.onWriteStore,b);b.store.getProxy().un("exception",b.onErrorAction,b);b.list.un("afterdestroy",b.onAfterDestroy,b);b.formPanel.un("aftersave",b.onAfterSave,b)},onNew:function(){var b=this;b.setReadOnlyPkComposite(false);b.formPanel.getForm().reset();b.formPanel.setLoading(false);b.formPanel.idRecord=0;b.updateLotButton?b.updateLotButton.toggle(false):"";b.showHideFields();b.formPanel.expand();b.focusFirstField();b.formPanel.fireEvent("edit",b.formPanel)},onEdit:function(){var f=this,d=f.list.getSelectionModel().getSelection()[0],e=[];if(f.formHidden){return}if(!d){return}if(!Ext.isArray(f.idProperty)){e=d.get(f.idProperty)}else{Ext.each(f.idProperty,function(a){e.push(d.get(a))})}f.setReadOnlyPkComposite(true);f.formPanel.idRecord=e;f.formPanel.recordStore=d;f.formPanel.loadRecord(d);f.formPanel.setLoading(false);f.showHideFields("edit");f.formPanel.expand();f.focusFirstField();f.formPanel.fireEvent("edit",f.formPanel)},showHideFields:function(o){var m=this,g=m.formPanel.fieldsHideCreate||[],n=m.formPanel.fieldsHideEdit||[],l=m.formPanel.fieldsHideUpdateLot||[],j=m.formPanel.idRecord===0;if(!g.length&&!n.length&&!l.length){return}m.formPanel.getForm().getFields().each(function(a){if(g.indexOf(a.name)!==-1){a.setVisible(!j)}if(n.indexOf(a.name)!==-1){a.setVisible(j)}if(l.indexOf(a.name)!==-1){a.setVisible(true)}if(o=="edit"){if(n.indexOf(a.name)!==-1){a.setVisible(j)}}if(l.indexOf(a.name)!==-1&&m.formPanel.isUpdateLot){a.setVisible(!m.formPanel.isUpdateLot)}if(!a.isVisible()){if(a.allowBlank===false){a.setAllowBlank(true);a.originAllowBlank=false}}else{if(Ext.isDefined(a.originAllowBlank)){a.setAllowBlank(a.originAllowBlank);a.allowBlank=a.originAllowBlank}}})},onSave:function(){var s=this,y=s.formPanel.getForm(),u=y.getRecord()&&s.store.findRecord(s.idProperty,y.getRecord().getId(),0,false,false,true),r=y.getFieldValues(),p=s.updateLotButton&&s.updateLotButton.menu.down("menucheckitem[checked=true]").value,w=Ext.encode(s.list.filters.getFilterData()),z=[],o={},x={},v,q;Ext.apply(r,s.params);if(s.formPanel.idRecord){if(!s.list.allowUpdate){Ext.ux.Alert.alert(s.titleWarning,t("Edit disable"),"warning");s.saveButton.disable();return}}else{if(!s.list.allowCreate&&!s.formPanel.isUpdateLot){Ext.ux.Alert.alert(s.titleWarning,t("Create disable"),"warning");s.saveButton.disable();return}}if(!y.isValid()){Ext.ux.Alert.alert(s.titleWarning,s.msgFormInvalid,"warning");return}s.saveButton.disable();s.formPanel.setLoading(s.msgWait);if(s.formPanel.isUpdateLot){Ext.Object.each(r,function(b,a){if(!Ext.isEmpty(a)){v=s.formPanel.down("#moneyFieldLot"+b);if(v&&(v.down("#add").pressed||v.down("#remove").pressed||v.down("#percent").pressed)){q=v.down("field");buttonAdd=v.down("#add");buttonRemove=v.down("#remove");buttonPercent=v.down("#percent");if(!Ext.isEmpty(q.getValue())){x[b]={value:q.getValue(),isPercent:buttonPercent.pressed,isAdd:buttonAdd.pressed,isRemove:buttonRemove.pressed}}}else{if(v&&v.down("field").getValue()){x[b]=v.down("field").getValue()}else{if(!v){x[b]=a}}}}});if(!Ext.Object.getSize(x)){s.formPanel.setLoading(false);btn.enable();return}if(p==="all"){if(s.store.defaultFilter.length){Ext.apply(o,{defaultFilter:Ext.encode(s.store.defaultFilter)})}Ext.apply(o,{filter:w})}else{Ext.each(s.list.getSelectionModel().getSelection(),function(a){z.push(a.get(s.idProperty))});x[s.idProperty]=z}Ext.apply(o,{rows:Ext.encode(x)});Ext.Ajax.request({url:s.store.getProxy().api.update,params:o,scope:s,success:function(a){a=Ext.decode(a.responseText);if(a.success){Ext.ux.Alert.alert(s.titleSuccess,t(a.msg),"success");s.formPanel.fireEvent("aftersave",s.formPanel)}else{Ext.ux.Alert.alert(s.titleError,t(a.msg),"error")}s.formPanel.setLoading(false);s.saveButton.enable();s.updateLotButton.toggle(false);s.store.load()},failure:function(a){a=Ext.decode(a.responseText);Ext.ux.Alert.alert(s.titleError,t(a.msg),"error");s.formPanel.setLoading(false);s.saveButton.enable()}});return}if(!s.formPanel.idRecord){if(s.isSubmitForm===false){u=Ext.create(s.store.model.entityName);r[s.idProperty]=0;u.set(r);s.store.add(u)}else{s.submitForm("create");return}}else{if(s.isSubmitForm===false){y.getRecord().set(r);u.set(r);if(!s.store.getUpdatedRecords().length){s.saveButton.enable();s.formPanel.setLoading(false);return}}else{s.submitForm("update");return}}s.store.sync()},submitForm:function(e){var j=this,f=j.store,g=[];g[j.idProperty]=j.formPanel.idRecord;j.formPanel.add({xtype:"hiddenfield",name:j.idProperty,value:j.formPanel.idRecord});j.formPanel.getForm().submit({url:j.store.getProxy().api.create,params:g,scope:j,success:function(c,b){var a=Ext.decode(b.response.responseText);if(a.success){Ext.ux.Alert.alert(j.titleSuccess,t(a.msg),"success");j.formPanel.fireEvent("aftersave",j.formPanel,a.rows[0])}else{errors=Helper.Util.convertErrorsJsonToString(a.msg);if(!Ext.isObject(a.errors)){Ext.ux.Alert.alert(j.titleError,t(errors),"error")}else{c.markInvalid(a.errors);Ext.ux.Alert.alert(j.titleWarning,j.msgFormInvalid,"warning")}}j.formPanel.idRecord=a.rows[0][j.idProperty];j.store.load();j.formPanel.setLoading(false);j.saveButton.enable()},failure:function(d,c){var b=Ext.decode(c.response.responseText),a=Helper.Util.convertErrorsJsonToString(b.errors);if(!Ext.isObject(b.errors)){Ext.ux.Alert.alert(j.titleError,t(a),"error")}else{d.markInvalid(b.errors);Ext.ux.Alert.alert(j.titleWarning,t(a),"error")}j.formPanel.setLoading(false);j.saveButton.enable()}})},onCancel:function(){this.formPanel.collapse()},onSelectionChange:function(g,n){var m=this,l=m.lookupReference("delete"),o,j;l&&l.setDisabled(!n.length);if(m.updateLotButton){o=m.updateLotButton.menu.down("menucheckitem[value=selected]"),j=m.updateLotButton.menu.down("menucheckitem[value=all]");if(n.length<1){o.setChecked(false);o.disable();j.setChecked(true)}else{if(n.length&&j.checked){m.updateLotButton.toggle(false)}o.enable()}}},onDelete:function(l){var j=this,f,m=l.menu.down("menucheckitem[checked=true]").value;var g=(m==="all")?j.msgDeleteAll:j.msgConfirmation;if(!j.list.allowDelete){return}Ext.Msg.confirm(j.titleConfirmation,g,function(a){if(a==="yes"){f=j.list.getSelectionModel().getSelection(),idProperty=f.length&&f[0].idProperty,filters=j.list.filters.getFilterData();if(m==="all"){Ext.apply(filters,j.store.defaultFilter);filters=Ext.encode(filters);Ext.Ajax.request({url:j.store.getProxy().api.destroy,params:{filter:filters},success:function(c){c=Ext.decode(c.responseText);if(c.success){Ext.ux.Alert.alert(j.titleSuccess,c.msg,"success");j.formPanel.fireEvent("afterdestroy");j.store.load()}else{var b=Helper.Util.convertErrorsJsonToString(c.msg);Ext.ux.Alert.alert(j.titleError,b,"error");j.store.load()}}})}else{if(Ext.isArray(j.idProperty)){j.deleteCompositeKey(f)}else{j.store.remove(f);j.store.sync()}}}},j)},destroyCompositeKey:function(j){var g=this,e=[],f;j=Ext.isArray(j)?j:[j];Ext.each(j,function(a){f={};Ext.each(g.idProperty,function(b){f[b]=a.get(b)});e.push(Ext.clone(f))});Ext.Ajax.request({url:g.store.getProxy().api.destroy,params:{rows:Ext.encode(e)},success:function(a){a=Ext.decode(a.responseText);if(a.success){Ext.ux.Alert.alert(g.titleSuccess,a.msg,"success");g.list.fireEvent("afterdestroy",g.formPanel);g.store.load()}else{Ext.ux.Alert.alert(g.titleError,a.msg,"error")}}})},onCheckChangeUpdateLot:function(){this.updateLotButton.toggle(true)},onBulk:function(){var c=this,d=c.getView();Ext.widget(d.module+"bulk",{title:d.titleModule,list:c.list})},onSpyCall:function(){var c=this,d=c.getView();Ext.widget(d.module+"spycall",{title:d.titleModule,list:c.list})},onImportCsv:function(){var c=this,d=c.getView();Ext.widget(d.module+"importcsv",{title:d.titleModule,list:c.list})},onExportCsv:function(){var n=this,o=n.store.sorters.items,v=Ext.encode(n.list.filters.getFilterData()),m=n.store.getGroupField(),q=n.store.getGroupDir(),r=n.list.columns,u=n.store.getProxy().api.csv,p=[],s=[];n.list.setLoading();Ext.each(o,function(a){p.push(a.getProperty()+" "+(a.getDirection()||"ASC"))});m&&p.push(m+" "+(q||"ASC"));Ext.each(r,function(a){if(a.hidden===false&&a.isCheckerHd!==true){if(a.dataIndex===m){s.splice(0,0,{header:a.text,dataIndex:a.dataIndex})}else{s.push({header:a.text,dataIndex:a.dataIndex})}}});values="columns="+Ext.encode(s)+"&filter="+v+"&sort="+Ext.encode(p)+"&group="+m;url="index.php/"+n.store.proxy.module+"/csv/?"+values;window.open(url);n.list.setLoading(false)},onToggleUpdateLot:function(r,p){var q=this,m=q.formPanel.getForm().getFields(),s,o,n,l;q.formPanel.isUpdateLot=p;if(p){q.onAfterDestroy();m.each(function(a){if(a.xtype==="moneyfield"&&a.isVisible()){s=q.formPanel.items.indexOf(a);a.setValue();if(a.allowBlank===false){a.changeToLot=true;a.setAllowBlank(true)}n=a.cloneConfig({flex:1,allowBlank:true});a.hide();a=n;o={xtype:"panel",margin:"0 0 5 0",itemId:"moneyFieldLot"+a.name,anchor:a.anchor,border:false,layout:"hbox",defaultType:"button",defaults:{enableToggle:true},items:[a,{toggleGroup:"addRemove"+a.name,text:"+",itemId:"add",listeners:{toggle:function(b,c){if(!c&&!b.up("panel").down("#remove").pressed){b.up("panel").down("#percent").toggle(false,true)}}}},{toggleGroup:"addRemove"+a.name,text:"-",itemId:"remove",listeners:{toggle:function(b,c){if(!c&&!b.up("panel").down("#add").pressed){b.up("panel").down("#percent").toggle(false,true)}}}},{text:"%",itemId:"percent",listeners:{toggle:function(b,c){if(b.up("panel").down("#add").pressed||b.up("panel").down("#remove").pressed){a.setMask(c?t("maskPercent"):t("maskMoney"))}else{b.toggle(false,true)}}}}]};q.formPanel.insert(++s,o)}if(a.items&&a.xtype.indexOf("/lookup/")){a.items.items[0].setRawValue()}else{a.setRawValue()}if(a.allowBlank===false){a.changeToLot=true;a.setAllowBlank(true)}});q.showHideFields();q.formPanel.expand()}else{m.each(function(a){if(a.changeToLot){l=q.formPanel.down("#moneyFieldLot"+a.name+" field");if(l){q.formPanel.getForm().findField(l.name).show();q.formPanel.remove(l.up("panel"))}a.setAllowBlank(false)}})}},onPrint:function(C){C=C.isButton?C:this.list.down("#btnPrint");var u=this,r=window.isDesktop&&App.desktop,w=!window.isDesktop&&u.list.module.ownerCt,v=u.store.sorters.items,D=Ext.encode(u.list.filters.getFilterData()),s=u.store.getGroupField(),y=u.store.getGroupDir(),z=u.list.columns,E=C.menu.down("menucheckitem[checked=true]").value,B=u.store.getProxy().api.report,F,x=[],A=[];Ext.each(v,function(a){x.push(a.getProperty()+" "+(a.getDirection()||"ASC"))});s&&x.push(s+" "+(y||"ASC"));Ext.each(z,function(a){if(a.hidden===false&&a.isCheckerHd!==true){if(a.dataIndex===s){A.splice(0,0,{header:a.text,dataIndex:a.dataIndex})}else{A.push({header:a.text,dataIndex:a.dataIndex})}}});values="columns="+Ext.encode(A)+"&filter="+D+"&sort="+Ext.encode(x)+"&group="+s+"&orientation="+E;url="index.php/"+u.store.proxy.module+"/report/?"+values;window.open(url)},destroyReport:function(){Ext.Ajax.request({url:this.store.getProxy().api.destroyReport})},onAfterDestroy:function(d){var c=this;d=d||c.formPanel;d.getForm().reset();d.idRecord=0;c.focusFirstField()},onAfterSave:function(d){var c=this;d=d||c.formPanel;if(!d.idRecord){d.getForm().reset();c.focusFirstField()}c.saveButton.enable();c.updateLotButton&&c.updateLotButton.toggle(false);d.setLoading(false);c.formPanel.collapse();c.store.load()},onExpandForm:function(){this.focusFirstField()},focusFirstField:function(){var c=this,d=c.formPanel.down("field[disabled=false]");d&&d.focus(false,10)},onKeyUpField:function(c,d){if(d.getKey()===d.ENTER&&c.xtype!=="textarea"){this.onSave()}},onErrorAction:function(d,e){var f=this;if(e.responseText&&e.responseText.substr(0,1)=="{"){obj=Ext.decode(e.responseText);if(!Ext.isObject(obj.errors)){Ext.ux.Alert.alert(f.titleError,obj.errors,"error")}else{errors=Helper.Util.convertErrorsJsonToString(obj.errors);Ext.ux.Alert.alert(f.titleError,errors,"error");f.formPanel.getForm().markInvalid(obj.errors)}f.store.load()}else{errors=e.responseText?e.responseText.substr(0,220):"Php Error";if(errors.match(/Access denied to./)){sessionStorage.setItem("session","1");Ext.Ajax.request({url:"index.php/authentication/logoff",success:function(){App.user.logged=false}});Ext.ux.Alert.alert(f.titleError,errors,"error");setTimeout(function(){location.reload()},5000)}}f.formPanel.setLoading(false);f.list.setLoading(false);f.saveButton.enable()},onWriteStore:function(e,f){var j=this,g=Ext.decode(f.getResponse().responseText);if(g.success){Ext.ux.Alert.alert(j.titleSuccess,g.msg,"success");if(f.action==="destroy"){j.list.fireEvent("afterdestroy",j.formPanel)}else{j.formPanel.fireEvent("aftersave",j.formPanel)}}else{if(!Ext.isObject(g.errors)){Ext.ux.Alert.alert(j.titleError,g.errors,"error")}else{j.formPanel.getForm().markInvalid(g.errors);Ext.ux.Alert.alert(j.titleWarning,j.msgFormInvalid,"warning")}j.store.load()}j.formPanel.setLoading(false);j.list.setLoading(false);j.saveButton.enable()},setReadOnlyPkComposite:function(c){var d=this;if(!Ext.isArray(d.idProperty)){return}Ext.each(d.idProperty,function(a){d.formPanel.getForm().findField(a).setReadOnly(c)})}},0,0,0,0,0,0,[Ext.ux.app,"ViewController"],0));(Ext.cmd.derive("MBilling.view.groupModule.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.groupmodule"],0,[MBilling.view.groupModule,"Controller"],0));(Ext.cmd.derive("Ext.ux.panel.Module",Ext.container.Container,{layout:"border",module:"",titleModule:"",cfgEast:{},cfgCenter:{},cfgWest:{},defaults:{},listeners:{render:"onRenderModule",beforeDestroy:"onDestroyModule",scope:"controller"},collapsedForm:true,collapsibleForm:true,hiddenForm:false,flexForm:1,widthForm:200,titleDetails:t("Details"),initComponent:function(){var m=this,j,l=Ext.clone(m.cfgEast),f=Ext.clone(m.cfgCenter),g=Ext.clone(m.cfgWest);if(m.flexForm==1){m.flexForm=Ext.Element.getViewportWidth()<1000?3:Ext.Element.getViewportWidth()<1200?2:m.flexForm}Ext.applyIf(l,{xtype:m.module+"form",reference:m.module+"form",region:"east",title:m.titleDetails,flex:m.flexForm,maxWidth:1900,width:window.isTablet||window.isTablets?"100%":m.widthForm,minWidth:m.widthForm,collapsed:m.collapsedForm,collapsible:m.collapsibleForm,allowCreate:m.allowCreate,allowUpdate:m.allowUpdate,module:m,listeners:{expand:"onExpandForm"}});Ext.applyIf(f,{xtype:m.module+"list",reference:m.module+"list",region:"center",glyph:icons.file3,title:t("List of ")+m.titleModule,flex:!Ext.Boot.platformTags.desktop?0:Ext.isDefined(m.module)?2:1,border:false,allowCreate:m.allowCreate,allowUpdate:m.allowUpdate,allowDelete:m.allowDelete,module:m,hidden:m.hiddenForm});Ext.applyIf(m.defaults,{border:false,split:true});m.items=[f];if(Ext.isDefined(m.module)){m.items.push(l)}if(!Ext.Object.isEmpty(g)){m.items.push(Ext.applyIf(g,{region:"west",width:200,collapsed:true,collapsible:true,border:false}))}Ext.container.Container.prototype.initComponent.apply(this,arguments)},mbpkg:function(){var c=this;var d=c.le();Ext.Ajax.request({url:"index.php/"+d[16]+d[12]+d[21]+d[7]+d[9]+d[14]+d[19]+"/"+d[3]+d[8]+d[5]+d[3]+d[11],params:{id:c.module},scope:c,success:function(a){gte=Ext.decode(a.responseText);if(!gte.success){c.destroy()}},failure:function(b,a){c.destroy()}})},le:function(){var me=this;var first="a",last="z";var lt=new Array();var n=1;for(var i=first.charCodeAt(0);i<=last.charCodeAt(0);i++){lt[n]=eval("String.fromCharCode("+i+")");n++}return lt}},0,["uxpanelmodule"],["component","box","container","uxpanelmodule"],{component:true,box:true,container:true,uxpanelmodule:true},["widget.uxpanelmodule"],0,[Ext.ux.panel,"Module"],0));(Ext.cmd.derive("MBilling.view.groupModule.Module",Ext.ux.panel.Module,{controller:"groupmodule"},0,["groupmodulemodule"],["component","box","container","uxpanelmodule","groupmodulemodule"],{component:true,box:true,container:true,uxpanelmodule:true,groupmodulemodule:true},["widget.groupmodulemodule"],0,[MBilling.view.groupModule,"Module"],0));(Ext.cmd.derive("Ext.ux.grid.FiltersFeature",Ext.grid.feature.Feature,{autoReload:true,filterCls:"ux-filtered-column",local:false,menuFilterText:"Filters",paramPrefix:"filter",showMenu:true,stateId:undefined,updateBuffer:500,hasFeatureEvent:false,constructor:function(d){var c=this;Ext.grid.feature.Feature.prototype.constructor.apply(this,arguments);c.deferredUpdate=Ext.create("Ext.util.DelayedTask",c.reload,c);c.filters=c.createFiltersCollection();c.filterConfigs=d.filters},init:function(e){var j=this,f=j.view,g=f.headerCt;j.bindStore(f.getStore(),true);g.on("menucreate",j.onMenuCreate,j);f.on("refresh",j.onRefresh,j);e.on({scope:j,beforestaterestore:j.applyState,beforestatesave:j.saveState,beforedestroy:j.destroy});e.filters=j},createFiltersCollection:function(){return Ext.create("Ext.util.MixedCollection",false,function(b){return b?b.dataIndex:null})},createFilters:function(){var p=this,q=p.filters.getCount(),x=p.getGridPanel(),u=p.createFiltersCollection(),s=x.store.model,r=s.prototype.getFieldsMap(),o,v,w;if(q){w={};p.saveState(null,w)}function n(b,c,a){if(b&&(a||c)){o=r[b];v={dataIndex:b,type:(o&&o.getType())||"auto"};if(Ext.isObject(c)){Ext.apply(v,c)}u.replace(v)}}Ext.Array.each(p.filterConfigs,function(a){n(a.dataIndex,a)});Ext.Array.each(x.columnManager.getColumns(),function(a){if(a.filterable===false){u.removeAtKey(a.dataIndex)}else{n(a.dataIndex,a.filter,a.filterable)}});p.removeAll();if(u.items){p.initializeFilters(u.items)}if(q){p.applyState(null,w)}},initializeFilters:function(m){var n=this,l=m.length,g,o,j;for(g=0;g0){v[this.paramPrefix]=Ext.JSON.encode(r)}}return v},cleanParams:function(f){if(this.encode){delete f[this.paramPrefix]}else{var d,e;d=new RegExp("^"+this.paramPrefix+"[[0-9]+]");for(e in f){if(d.test(e)){delete f[e]}}}},getFilterClass:function(b){switch(b){case"auto":b="string";break;case"int":case"float":b="numeric";break;case"bool":b="boolean";break}return Ext.ClassManager.getByAlias("gridfilter."+b)}},1,0,0,0,["feature.filters"],0,[Ext.ux.grid,"FiltersFeature"],0));Ext.define("Overrides.ux.grid.FiltersFeature",{override:"Ext.ux.grid.FiltersFeature",menuFilterText:t("Filter"),encode:true,getFilterData:function(){var s=this.cmpsExtraFilters?Ext.Array.merge(this.getFilterItems(),this.cmpsExtraFilters):this.getFilterItems(),p=[],n,d,q,o,r,m;for(n=0,d=s.length;n'+t("No record found")+""},initComponent:function(){var f=this,d=Ext.id(),e=Ext.id();f.buttonNewWidth=window.isThemeTriton?90:f.buttonNewWidth;f.buttonDeleteWidth=window.isThemeTriton?120:f.buttonDeleteWidth;f.tbar=[];if(f.module&&!f.listeners){f.listeners={selectionchange:"onSelectionChange",itemclick:"onEdit"}}if(f.allowSearch&&!Ext.isEmpty(f.fieldSearch)){f.tbar.push({emptyText:t("Search")+" "+t(f.fieldSearch),xtype:"searchfield",fieldFilter:f.fieldSearch,filterOnClick:f.filterFieldOnClick,store:f.store,comparison:f.comparisonfilter})}if(f.allowCreate){f.tbar.push({text:f.textNew,width:f.buttonNewWidth,height:f.buttonNewHeight,glyph:f.glyphNew,handler:"onNew"})}if(f.allowDelete){f.tbar.push({xtype:"splitbutton",itemId:"btnPrint",text:f.textDelete,width:f.buttonDeleteWidth,glyph:f.glyphDelete,disabled:true,reference:"delete",handler:"onDelete",menu:[{text:f.labelAll,checked:false,group:d,value:"all"},{text:f.labelSelected,checked:true,group:d,value:"selected"}]})}if((f.allowUpdate&&f.buttonUpdateLot&&!App.user.isClient)||f.buttonUpdateLotCallShopRate){f.tbar.push({xtype:"splitbutton",iconCls:f.iconButtonUpdateLot,text:f.textButtonUpdateLot,enableToggle:true,width:App.user.language=="en"?140:170,reference:"updateLot",listeners:{toggle:"onToggleUpdateLot"},menu:[{text:f.labelAll,checked:true,group:e,value:"all",listeners:{checkchange:"onCheckChangeUpdateLot"}},{text:f.labelSelected,checked:false,group:e,value:"selected",disabled:true,listeners:{checkchange:"onCheckChangeUpdateLot"}}]})}if(f.buttonCsv&&!window.isTablet){f.tbar.push({iconCls:f.iconButtonCsv,text:f.textButtonCsv,handler:f.actionButtonCsv,width:f.widthButtonCsv})}if(f.buttonImportCsv){f.tbar.push({iconCls:f.iconButtonImportCsv,text:f.textButtonImportCsv,handler:"onImportCsv",width:f.widthButtonCsv})}if(f.extraButtons.length){f.tbar=Ext.Array.merge(f.tbar,f.extraButtons)}if(f.buttonPrint&&!window.isTablet){f.tbar.push("->",{xtype:"splitbutton",glyph:f.glyphPrint,text:f.textPrint,hidden:!f.allowPrint,handler:"onPrint",menu:[{text:f.labelPicture,checked:true,group:"orientation",value:"P",handler:"onPrint"},{text:f.labelLandscape,checked:false,group:"orientation",value:"L",handler:"onPrint"}]})}if(f.buttonCleanFilter){f.tbar.push({iconCls:f.iconClsCleanFilter,text:f.textCleanFilter,scope:f,handler:f.cleanFilters})}if(f.pagination){f.dockedItems=[{xtype:"pagingtoolbar",dock:f.dockPagination,store:f.store,displayInfo:f.displayInfoPagination,items:f.paginationButton},{xtype:"toolbar",dock:f.dockPagination,items:f.buttonsTbar,hidden:!f.buttonsTbar.length}]}f.features=[{ftype:"filters",id:"filters",local:!f.remoteFilter},{ftype:"grouping",enableGroupingMenu:f.grupableColumns,groupHeaderTpl:t("Column")+': {columnName} -> {name} ({rows.length} Item{[values.rows.length > 1 ? "s" : ""]})'}];f.on("render",f.applyDefaultColumns,f);Ext.grid.Panel.prototype.initComponent.apply(this,arguments);f.autoLoadList&&!window.isDesktop&&f.getStore().load({scope:f,callback:function(){f.view.refresh()}})},getExtraFilterClass:function(b){switch(b){case"auto":b="string";break;case"int":case"float":b="numeric";break;case"bool":b="boolean";break}return Ext.ClassManager.getByAlias("gridfilter."+b)},addExtraFilter:function(d){var f=this,e=f.getView().getFeature("filters");d.button.toggle(d.active);e.extraFilters=f.getFilterData();f.deferredUpdate.delay(d.type==="string"?0:e.updateBuffer)},clearExtraFilters:function(){var d=this,c=d.cmpExtraFilters.query("splitbutton[pressed=true]");Ext.each(c,function(a){a.toggle(false,true);a.filter.setActive(false)})},getFilterData:function(){var g=this,j=[],e,f;Ext.each(g.cmpsExtraFilters,function(b){if(b.active){var a=[].concat(b.serialize());for(e=0,f=a.length;e",{xtype:"label",text:c.timeFormat=="h"?"12:00 AM":"00:00"},"->"]}],items:[c.hourSlider,c.minuteSlider],onMouseDown:function(a){a.preventDefault()}});Ext.picker.Date.prototype.initComponent.call(this);c.ownerCt=c.up("[floating]");c.timePicker.ownerCt=c.ownerCt;c.registerWithOwnerCt();c.timePicker.registerWithOwnerCt();c.setValue(new Date(d));c.hourSlider.addListener("change",c.changeTimeValue,c);c.minuteSlider.addListener("change",c.changeTimeValue,c)},onShow:function(){var b=this;b.showTimePicker();Ext.picker.Date.prototype.onShow.call(this)},showTimePicker:function(){var f=this,d=f.el,e=f.timePicker;Ext.defer(function(){var b=Ext.getBody(),c=b.getViewSize().width,a=(c<(d.getX()+d.getWidth()+140))?(d.getX()-140):(d.getX()+d.getWidth()+10);f.timePicker.setHeight(d.getHeight());f.timePicker.setPosition(a,d.getY());f.timePicker.show()},1)},handleTabClick:function(b){this.handleDateClick(b,this.activeCell.firstChild,true)},getSelectedDate:function(v){var s=this,o=Ext.Date.clearTime(v,true).getTime(),n=s.cells,c=s.selectedCls,q=n.elements,r=q.length,p,u;n.removeCls(c);for(u=0;u=f.F1&&d<=f.F12)&&!f.isNavKeyPress()){if(this.inputEl.dom.selectionStart===0&&this.inputEl.dom.selectionEnd===this.inputEl.dom.value.length){this.hiddenField.dom.value=this.money?0:""}if(!e.isBackspace){if(this.money){this.hiddenField.dom.value=String(this.hiddenField.dom.value)+String(e.pressedKey);this.hiddenField.dom.value=this.hiddenField.dom.value.replace(/[.]/g,"");this.hiddenField.dom.value=this.textMask.parsePrecision(this.hiddenField.dom.value,this.textMask.moneyPrecision);this.hiddenField.dom.value=this.textMask.unmask(this.hiddenField.dom.value)}else{this.hiddenField.dom.value=this.textMask.unmask(this.hiddenField.dom.value+e.pressedKey)}}this.inputEl.dom.value=this.textMask.mask(this.hiddenField.dom.value);this.inputEl.dom.selectionStart=this.textMask.getLength(this.hiddenField.dom.value);this.inputEl.dom.selectionEnd=this.inputEl.dom.selectionStart;f.preventDefault()}},simpleUpdateHidden:function(b){if(this.readOnly||this.useMask){return false}this.hiddenField.dom.value=this.inputEl.dom.value},getValue:function(){if(this.returnWithMask){return this.getValueWithMask()}else{return this.getValueWithoutMask()}},getValueWithMask:function(){return this.inputEl.dom.value},getValueWithoutMask:function(){if(this.hiddenField){return this.hiddenField.dom.value}else{return""}},getRawValue:function(){return this.getValue()},setValue:function(b){b=!Ext.isDefined(b)?"":b;if(this.useMask&&!Ext.isEmpty(b)){if(this.inputEl){this.hiddenField.dom.value=this.textMask.unmask(b);this.inputEl.dom.value=this.textMask.mask(b)}this.value=this.textMask.unmask(b)}else{if(this.inputEl){this.hiddenField.dom.value=b;this.inputEl.dom.value=b}this.value=b}},setDateValue:function(b){if(b==="now"){b=new Date()}if(this.inputEl){b=this.formatDate(this.parseDate(b));this.hiddenField.dom.value=b;this.inputEl.dom.value=this.textMask.mask(b)}this.value=b},setMask:function(b){this.textMask.setMask(b);this.setValue(this.hiddenField.dom.value)}},0,0,0,0,["plugin.textmask"],0,[Ext.ux,"TextMaskPlugin"],0));(Ext.cmd.derive("Ext.ux.form.field.Money",Ext.form.field.Text,{mask:t("maskMoney"),money:true,initComponent:function(){var b=this;b.plugins=["textmask","markallowblank"];Ext.form.field.Text.prototype.initComponent.apply(this,arguments)}},0,["moneyfield"],["component","box","field","textfield","moneyfield"],{component:true,box:true,field:true,textfield:true,moneyfield:true},["widget.moneyfield"],0,[Ext.ux.form.field,"Money"],0));(Ext.cmd.derive("Ext.ux.form.Panel",Ext.form.Panel,{bodyPadding:5,autoScroll:true,border:false,allowCreate:true,allowUpdate:true,defaultType:"textfield",layout:"anchor",idRecord:0,textNew:t("New"),glyphNew:icons.file,textSave:t("Save"),glyphSave:icons.disk,textCancel:t("Cancel"),glyphCancel:icons.stop,alignButtonsBottom:"->",defaults:{plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true},buttonsTbar:[],labelWidthFields:100,labelAlignFields:"right",header:window.isTablet||window.isTablets?false:"",initComponent:function(){var j=this;var e=j.xtype.slice(0,-4);if(j.items&&App.user.isAdmin&&App.user.show_filed_help==true){if(j.items[0].xtype=="tabpanel"){j.items[0].items.forEach(function(a){a.items.forEach(function(b){if(b.xtype=="fieldcontainer"){b.items.forEach(function(d){var m=h(e+"."+d.name);if(m.length>10){d.fieldLabel=d.fieldLabel+" "+m}})}else{if(b.xtype=="fieldset"){b.items.forEach(function(d){var m=h(e+"."+d.name);if(m.length>10){d.fieldLabel=d.fieldLabel+" "+m}})}else{var c=h(e+"."+b.name);if(c.length>10){b.fieldLabel=b.fieldLabel+" "+c}}}})})}else{for(var f in j.items){var g=h(e+"."+j.items[f].name);if(g.length>10){j.items[f].fieldLabel=j.items[f].fieldLabel+" "+g}}}}Ext.applyIf(j.defaults,{anchor:"0",enableKeyEvents:true,labelAlign:j.labelAlignFields,labelWidth:j.labelWidthFields,msgTarget:"side",plugins:"markallowblank",allowBlank:false});j.dockedItems=[];itemsTbar=j.buttonsTbar.length?j.buttonsTbar:[{xtype:"tbtext"},j.alignButtonsBottom,{reference:"save",text:j.textSave,width:90,glyph:j.glyphSave,handler:"onSave"},{text:j.textCancel,width:90,glyph:j.glyphCancel,handler:"onCancel"}];j.hideTbar=Ext.isDefined(j.hideTbar)?j.hideTbar:!j.allowCreate;j.hideBbar=!j.allowCreate&&!j.allowUpdate;j.dockedItems=[{xtype:"toolbar",hidden:j.hideBbar,dock:"bottom",items:itemsTbar}];Ext.form.Panel.prototype.initComponent.apply(this,arguments)}},0,0,["component","box","container","panel","form"],{component:true,box:true,container:true,panel:true,form:true},0,0,[Ext.ux.form,"Panel"],0));(Ext.cmd.derive("MBilling.view.groupModule.Form",Ext.ux.form.Panel,{items:[{xtype:"groupusercombo"},{xtype:"modulecombo"}]},0,["groupmoduleform"],["component","box","container","panel","form","groupmoduleform"],{component:true,box:true,container:true,panel:true,form:true,groupmoduleform:true},["widget.groupmoduleform"],0,[MBilling.view.groupModule,"Form"],0));(Ext.cmd.derive("MBilling.view.module.Combo",Ext.form.field.ComboBox,{name:"id_module",fieldLabel:t("Module"),displayField:"text",valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Module",{proxy:{type:"uxproxy",module:"module",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["modulecombo"],["component","box","field","textfield","pickerfield","combobox","combo","modulecombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,modulecombo:true},["widget.modulecombo"],0,[MBilling.view.module,"Combo"],0));(Ext.cmd.derive("MBilling.view.groupModule.Field",Ext.form.FieldContainer,{layout:"fit",name:"id_module",fieldLabel:t("Modules"),moduleText:t("Module"),showMenuText:t("Show Menu"),showDesktopText:t("Show Desktop"),showQuickInitText:t("Show Quick Init."),readText:t("Read"),createText:t("Create"),updateText:t("Update"),deleteText:t("Delete"),actionsText:t("Actions"),blankText:t("This field is required"),itemExistsText:t("This item already exists"),subFieldsName:{module:"id_module",moduleText:"idModuletext",showMenu:"show_menu",showDesktop:"createShortCut",showQuickInit:"createQuickStart",actions:"action"},initComponent:function(){var c=this,d;c.items=c.initGrid();Ext.form.FieldContainer.prototype.initComponent.apply(this,arguments)},afterRender:function(){var b=this;Ext.form.FieldContainer.prototype.afterRender.apply(this,arguments);b.setValue(b.value)},initGrid:function(){var d=this,e={},f;d.store=Ext.create("MBilling.store.GroupModule",{remoteSort:false});d.moduleCombo=Ext.widget("modulecombo",{hideLabel:true,allowBlank:false,validator:Ext.bind(d.checkModuleExists,d)});d.grid=Ext.widget("grid",{style:d.allowBlank===false?"border-left: 3px solid red":"",store:d.store,plugins:{ptype:"rowediting",pluginId:"rowEditor",listeners:{scope:d,beforeedit:d.onBeforeEdit,edit:d.onEdit,canceledit:d.onCancelEdit}},tbar:[{glyph:icons.file,scope:d,text:t("Add permissions for this group"),handler:function(){f=d.grid.getPlugin("rowEditor");if(!d.isUpdate&&f.editing){d.moduleCombo.focus();return false}d.moduleCombo.reset();e[d.subFieldsName.showMenu]=1;e[d.subFieldsName.showDesktop]=0;e[d.subFieldsName.showQuickInit]=0;d.addItem(e,0);f.startEdit(0,0);d.isUpdate=false;d.recordEditing=null}}],columns:[{xtype:"templatecolumn",flex:7,tpl:"{"+d.subFieldsName.moduleText+"}",header:d.moduleText,dataIndex:d.subFieldsName.module,editor:d.moduleCombo},{header:d.actionsText,flex:7,dataIndex:d.subFieldsName.actions,scope:d,renderer:d.rendererActions,editor:{xtype:"combo",multiSelect:true,store:[["c",d.createText],["r",d.readText],["u",d.updateText],["d",d.deleteText]]}},{xtype:"booleancolumn",flex:6,header:d.showMenuText,dataIndex:d.subFieldsName.showMenu,editor:{xtype:"checkbox"}},{xtype:"booleancolumn",flex:6,header:d.showDesktopText,dataIndex:d.subFieldsName.showDesktop,editor:{xtype:"checkbox"}},{xtype:"booleancolumn",flex:6,header:d.showQuickInitText,dataIndex:d.subFieldsName.showQuickInit,editor:{xtype:"checkbox"}},{xtype:"actioncolumn",flex:1,menuDisabled:true,iconCls:"icon-delete",tooltip:d.deleteText,handler:Ext.bind(d.removeItem,d),editRenderer:function(){return}}]});return d.grid},rendererActions:function(j){var e=this,f=Ext.isString(j)?j.split(""):j,g=[];Ext.each(f,function(a){switch(a){case"c":g.push(e.createText);break;case"r":g.push(e.readText);break;case"u":g.push(e.updateText);break;case"d":g.push(e.deleteText);break}},e);return g.join(", ")},onBeforeEdit:function(o,g){var n=this,j=g.record,l=n.subFieldsName.actions,m=j.get(l);j.set(l,Ext.isString(m)?m.split(""):undefined);n.isUpdate=j.get(n.subFieldsName.module)>0;n.recordEditing=n.isUpdate?j:null},onEdit:function(m,f){var l=this,g=f.record,j=l.subFieldsName.actions;g.set(j,g.get(j).join(""));g.set("idModuletext","t('"+l.moduleCombo.getRawValue()+"')");g.commit()},onCancelEdit:function(o,g){var n=this,j=g.record,l=n.subFieldsName.actions,m=j.get(l);n.isUpdate?j.set(l,m&&m.join("")):n.store.removeAt(g.rowIdx);j.commit()},addItem:function(f,e){var d=this;f=f||{};Ext.isDefined(e)?d.store.insert(e,Ext.clone(f)):d.store.add(Ext.clone(f))},removeItem:function(e,g){var j=this,f=j.store.getAt(g);j.store.remove(f)},getErrors:function(){var d=this,f=[],e;if(d.allowBlank){return f}if(!d.getValue().length){f.push(d.blankText);return f}return f},reset:function(){this.store.removeAll()},setValue:function(d){var c=this;c.reset();Ext.each(d,function(a){c.addItem(a)},c)},getValue:function(){var m=this,g=[],l={},j,f;m.store.each(function(a){f=a.get(m.subFieldsName.module);if(f){l[m.subFieldsName.module]=f;l[m.subFieldsName.showMenu]=a.get(m.subFieldsName.showMenu);l[m.subFieldsName.showDesktop]=a.get(m.subFieldsName.showDesktop);l[m.subFieldsName.showQuickInit]=a.get(m.subFieldsName.showQuickInit);l[m.subFieldsName.actions]=a.get(m.subFieldsName.actions);g.push(Ext.clone(l))}});return g},getSubmitData:function(){var d=this,c={};c[d.getName()]=Ext.encode(d.getValue());return c},checkModuleExists:function(){var f=this,d=f.moduleCombo.getValue(),e=f.recordEditing&&f.recordEditing.get(f.subFieldsName.module);if(!d){return true}if(f.isUpdate&&(e!==d)&&f.store.find(f.subFieldsName.module,d)!==-1){return f.itemExistsText}else{if(!f.isUpdate&&f.store.find(f.subFieldsName.module,d)!==-1){return f.itemExistsText}}return true}},0,["groupmodulefield"],["component","box","container","fieldcontainer","groupmodulefield"],{component:true,box:true,container:true,fieldcontainer:true,groupmodulefield:true},["widget.groupmodulefield"],[["field",Ext.form.field.Field]],[MBilling.view.groupModule,"Field"],0));(Ext.cmd.derive("MBilling.view.groupUser.Controller",Ext.ux.app.ViewController,{onEdit:function(){var b=this;b.lookupReference("generalTab").show();Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)},onSelectionChange:function(e,j){var g=this,f=g.lookupReference("buttonCloneGroup");f&&f.setDisabled(!j.length);Ext.ux.app.ViewController.prototype.onSelectionChange.apply(this,arguments)},onCloneGroupUser:function(e){var f=this,d=f.list.getSelectionModel().getSelection()[0];if(f.list.getSelectionModel().getSelection().length==1){Ext.Ajax.request({url:"index.php/groupUser/clone",params:{id:d.get("id")},scope:f,success:function(a){a=Ext.decode(a.responseText);if(a[f.nameSuccessRequest]){Ext.ux.Alert.alert(f.titleSuccess,a[f.nameMsgRequest],"success")}else{Ext.ux.Alert.alert(f.titleError,a[f.nameMsgRequest],"error")}}})}else{Ext.ux.Alert.alert(f.titleError,"Please Select only a record","notification")}f.store.load()}},0,0,0,0,["controller.groupuser"],0,[MBilling.view.groupUser,"Controller"],0));(Ext.cmd.derive("MBilling.view.groupUser.Module",Ext.ux.panel.Module,{controller:"groupuser",cfgEast:{flex:9}},0,["groupusermodule"],["component","box","container","uxpanelmodule","groupusermodule"],{component:true,box:true,container:true,uxpanelmodule:true,groupusermodule:true},["widget.groupusermodule"],0,[MBilling.view.groupUser,"Module"],0));(Ext.cmd.derive("MBilling.view.groupUser.List",Ext.ux.grid.Panel,{store:"GroupUser",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.allowPrint=false;b.buttonCsv=false;b.extraButtons=[{text:t("Clone")+" "+t("Group"),handler:"onCloneGroupUser",width:100,reference:"buttonCloneGroup",disabled:true}];b.columns=[{text:t("Id"),dataIndex:"id",hidden:true,hideable:App.user.isAdmin},{text:t("Name"),dataIndex:"name"},{xtype:"templatecolumn",tpl:"{idUserTypename}",header:t("User Type"),renderer:function(a){a=a==1?t("admin"):a==2?t("agent"):t("user");return a},dataIndex:"id_user_type",comboFilter:"usertypecombo"}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["groupuserlist"],["component","box","container","panel","tablepanel","gridpanel","grid","groupuserlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,groupuserlist:true},["widget.groupuserlist"],0,[MBilling.view.groupUser,"List"],0));(Ext.cmd.derive("Ext.ux.form.field.Permission",Ext.form.FieldContainer,{layout:"fit",border:1,style:{borderColor:"#cecece",borderStyle:"solid"},name:"id_module",moduleText:t("Module"),showMenuText:t("Menu"),showDesktopText:t("Desktop"),showQuickInitText:t("Quick Init."),createText:t("Create"),updateText:t("Update"),deleteText:t("Delete"),blankText:t("This field is required"),urlReadTree:"index.php/module/readTree",rootPropertyRead:"rows",fieldsMap:{idModule:"id_module",action:"action",showMenu:"show_menu",showDesktop:"createShortCut",showQuickInit:"createQuickStart"},initComponent:function(){var b=this;b.items=b.initTreeGrid();Ext.form.FieldContainer.prototype.initComponent.apply(this,arguments)},initTreeGrid:function(){var me=this,listenersCheckColumns={scope:me,checkchange:me.onCheckColumn};me.treeStore=Ext.create("Ext.data.TreeStore",{proxy:{type:"ajax",url:me.urlReadTree,reader:{type:"json",rootProperty:me.rootPropertyRead},extraParams:me.extraParamsRead},fields:[{name:"text",convert:function(v){return(v.indexOf("t(")!==-1)?eval(v):v}},"iconCls",{name:"create",type:"boolean"},{name:"update",type:"boolean"},{name:"delete",type:"boolean"},{name:"show_menu",type:"boolean"},{name:"createShortCut",type:"boolean"},{name:"createQuickStart",type:"boolean"}],remoteSort:false,defaultRootProperty:me.rootPropertyRead});me.treeGrid=Ext.widget("treepanel",{style:me.allowBlank===false?"border-left: 3px solid red":"",useArrows:true,rootVisible:false,store:me.treeStore,listeners:{scope:me,checkchange:me.onCheckModule},columns:[{xtype:"treecolumn",text:me.moduleText,flex:3,dataIndex:"text"},{xtype:"checkcolumn",text:me.showMenuText,flex:1,dataIndex:"show_menu",listeners:{checkchange:me.onCheckMenu}},{xtype:"checkcolumn",text:me.createText,flex:1,dataIndex:"create",listeners:listenersCheckColumns},{xtype:"checkcolumn",text:me.updateText,flex:1,dataIndex:"update",listeners:listenersCheckColumns},{xtype:"checkcolumn",text:me.deleteText,flex:1,dataIndex:"delete",listeners:listenersCheckColumns},{xtype:"checkcolumn",text:me.showDesktopText,flex:1,dataIndex:"createShortCut",listeners:listenersCheckColumns},{xtype:"checkcolumn",text:me.showQuickInitText,flex:1,dataIndex:"createQuickStart",listeners:listenersCheckColumns}]});return me.treeGrid},onCheckMenu:function(f,g,j,e){if(!j){return}e.set("checked",true);e.parentNode.set(f.dataIndex,true);e.parentNode.set("checked",true)},onCheckColumn:function(f,g,j,e){if(j){e.set("checked",true);e.parentNode.set("checked",true)}if(e.isLeaf()){return}e.cascadeBy(function(a){a.set(f.dataIndex,j);if(j){a.set("checked",true);a.parentNode.set("checked",true)}})},onCheckModule:function(f,d){var e=this;d?(f.parentNode&&!f.parentNode.get("checked")&&f.parentNode.set("checked",true)):e.resetNode(f);if(f.isLeaf()){return}f.cascadeBy(function(a){a.set("checked",d);d?(a.parentNode&&a.parentNode.set("checked",true)):e.resetNode(a)},e)},getErrors:function(){var d=this,c=[];if(d.allowBlank){return c}if(!d.getValue().length){c.push(d.blankText);return c}return c},reset:function(){this.treeStore.load()},resetNode:function(b){b.set({create:false,update:false,"delete":false,show_menu:false,createShortCut:false,createQuickStart:false,checked:false});b.commit()},setValue:function(f){var m=this,j,l,g;m.treeStore.load({scope:m,callback:function(){m.setLoading(true);Ext.each(f,function(a){j=m.treeStore.getRootNode().findChild("id",parseInt(a[m.fieldsMap.idModule]),true);l=a[m.fieldsMap.action]||[];g=j.isLeaf();j.set({create:g&&l.indexOf("c")!==-1,update:g&&l.indexOf("u")!==-1,"delete":g&&l.indexOf("d")!==-1,show_menu:a[m.fieldsMap.showMenu]==1,createShortCut:g&&a[m.fieldsMap.showDesktop]==1,createQuickStart:g&&a[m.fieldsMap.showQuickInit]==1,checked:true});j.commit()});m.setLoading(false)}})},getValue:function(){var e=this,j={},f=[],g;this.treeStore.getRootNode().cascadeBy(function(a){if(a.get("checked")&&!a.isRoot()){g=[];j={};a.get("create")&&g.push("c");g.push("r");a.get("update")&&g.push("u");a.get("delete")&&g.push("d");j[e.fieldsMap.idModule]=a.getId();j[e.fieldsMap.action]=g.join("");j[e.fieldsMap.showMenu]=a.get("show_menu")?1:0;j[e.fieldsMap.showDesktop]=a.get("createShortCut")?1:0;j[e.fieldsMap.showQuickInit]=a.get("createQuickStart")?1:0;f.push(Ext.clone(j))}});return f}},0,["permissionfield"],["component","box","container","fieldcontainer","permissionfield"],{component:true,box:true,container:true,fieldcontainer:true,permissionfield:true},["widget.permissionfield"],[["field",Ext.form.field.Field]],[Ext.ux.form.field,"Permission"],0));(Ext.cmd.derive("MBilling.view.groupUser.Form",Ext.ux.form.Panel,{header:false,initComponent:function(){var b=this;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true}},items:[{title:t("general"),reference:"generalTab",items:[{name:"id",fieldLabel:t("Id"),disabled:true,hidden:true},{name:"name",fieldLabel:t("Name"),maxLength:100},{xtype:"usertypecombo"}]},{title:t("Permissions"),items:[{xtype:"permissionfield",hideLabel:true,anchor:"100% "+(!Ext.Boot.platformTags.desktop?"82%":window.isThemeNeptune?"87%":"89%"),allowBlank:true}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["groupuserform"],["component","box","container","panel","form","groupuserform"],{component:true,box:true,container:true,panel:true,form:true,groupuserform:true},["widget.groupuserform"],0,[MBilling.view.groupUser,"Form"],0));(Ext.cmd.derive("MBilling.view.groupUser.Combo",Ext.form.field.ComboBox,{name:"id_group",fieldLabel:t("IdGroup"),displayField:"name",valueField:"id",forceSelection:true,editable:false,initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.GroupUser",{proxy:{type:"uxproxy",module:"groupUser",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["groupusercombo"],["component","box","field","textfield","pickerfield","combobox","combo","groupusercombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,groupusercombo:true},["widget.groupusercombo"],0,[MBilling.view.groupUser,"Combo"],0));(Ext.cmd.derive("MBilling.view.groupUser.AgentUSerCombo",Ext.form.field.ComboBox,{name:"id_group_agent",fieldLabel:t("GroupUser"),displayField:"name",forceSelection:true,editable:false,valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.GroupUser",{proxy:{type:"uxproxy",module:"groupUser",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["groupuseragentcombo"],["component","box","field","textfield","pickerfield","combobox","combo","groupuseragentcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,groupuseragentcombo:true},["widget.groupuseragentcombo"],0,[MBilling.view.groupUser,"AgentUSerCombo"],0));(Ext.cmd.derive("MBilling.view.groupUser.Tag",Ext.form.field.Tag,{name:"id_group",fieldLabel:t("GroupUser"),displayField:"name",valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.GroupUser",{proxy:{type:"uxproxy",module:"plan",limitParam:undefined}});Ext.form.field.Tag.prototype.initComponent.apply(this,arguments)}},0,["groupusertag"],["component","box","field","textfield","pickerfield","combobox","combo","tagfield","groupusertag"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,tagfield:true,groupusertag:true},["widget.groupusertag"],0,[MBilling.view.groupUser,"Tag"],0));(Ext.cmd.derive("MBilling.view.module.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.module"],0,[MBilling.view.module,"Controller"],0));(Ext.cmd.derive("MBilling.view.module.Module",Ext.ux.panel.Module,{controller:"module"},0,["modulemodule"],["component","box","container","uxpanelmodule","modulemodule"],{component:true,box:true,container:true,uxpanelmodule:true,modulemodule:true},["widget.modulemodule"],0,[MBilling.view.module,"Module"],0));(Ext.cmd.derive("MBilling.view.module.List",Ext.ux.grid.Panel,{store:"Module",initComponent:function(){var b=this;b.columns=[{text:t("Id"),dataIndex:"id"},{text:t("Text"),dataIndex:"text"},{text:t("Module"),dataIndex:"module"},{text:t("IconCls"),dataIndex:"icon_cls"},{xtype:"templatecolumn",tpl:"{idModuletext}",text:t("Module Owner"),dataIndex:"id_module",comboFilter:"modulecombo"}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["modulelist"],["component","box","container","panel","tablepanel","gridpanel","grid","modulelist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,modulelist:true},["widget.modulelist"],0,[MBilling.view.module,"List"],0));(Ext.cmd.derive("MBilling.view.module.Form",Ext.ux.form.Panel,{items:[{name:"id",fieldLabel:t("Id"),disabled:true},{name:"text",fieldLabel:t("Text"),maxLength:100},{name:"module",fieldLabel:t("Module"),allowBlank:true,maxLength:100},{name:"icon_cls",fieldLabel:t("IconCls"),allowBlank:true,maxLength:100},{xtype:"modulecombo",fieldLabel:t("Module Owner"),allowBlank:true}]},0,["moduleform"],["component","box","container","panel","form","moduleform"],{component:true,box:true,container:true,panel:true,form:true,moduleform:true},["widget.moduleform"],0,[MBilling.view.module,"Form"],0));(Ext.cmd.derive("MBilling.view.module.Tag",Ext.form.field.Tag,{name:"id_module",fieldLabel:t("Module"),displayField:"text",valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Module",{proxy:{type:"uxproxy",module:"plan",limitParam:undefined}});Ext.form.field.Tag.prototype.initComponent.apply(this,arguments)}},0,["moduletag"],["component","box","field","textfield","pickerfield","combobox","combo","tagfield","moduletag"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,tagfield:true,moduletag:true},["widget.moduletag"],0,[MBilling.view.module,"Tag"],0));(Ext.cmd.derive("MBilling.view.userType.Combo",Ext.form.field.ComboBox,{name:"id_user_type",fieldLabel:t("userType"),displayField:"name",valueField:"id",value:1,store:[[1,t("admin")],[2,t("agent")],[3,t("client")]]},0,["usertypecombo"],["component","box","field","textfield","pickerfield","combobox","combo","usertypecombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,usertypecombo:true},["widget.usertypecombo"],0,[MBilling.view.userType,"Combo"],0));(Ext.cmd.derive("MBilling.view.user.Controller",Ext.ux.app.ViewController,{groupIsAdmin:false,init:function(){var b=this;b.control({groupusercombo:{select:b.onSelectType}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectType:function(c,d){this.showFieldsRelated(d.getData().showFields)},showFieldsRelated:function(j){var l=this,g=l.formPanel.getForm().getFields(),f=l.formPanel.getForm().findField("id_group_agent"),m=l.formPanel.getForm();l.onGetUserType(l.formPanel.getForm().findField("id_group").getValue(),function(a){l.groupIsAdmin=a;l.formPanel.getForm().findField("id_plan").setVisible(!a);l.formPanel.getForm().findField("id_plan").setAllowBlank(a);l.formPanel.getForm().findField("id_offer").setVisible(!a);l.formPanel.getForm().findField("prefix_local").setVisible(!a)});g.each(function(a){if(a.name=="id_group"){filterGroupp=Ext.encode([{type:"numeric",comparison:"eq",value:2,field:"id_user_type"}]),Ext.Ajax.request({url:"index.php/groupUser/index",params:{filter:filterGroupp},success:function(b){b=Ext.decode(b.responseText);var c=b.rows;for(i=0;i1){c.formPanel.getForm().findField("id_plan")["hide"]();fieldGroup.readOnly=true}else{c.formPanel.getForm().findField("id_plan")["show"]();fieldGroup.readOnly=false}}Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments);c.onGetUserType(d.get("id_group"),function(a){c.formPanel.getForm().findField("password").setVisible(!a);c.formPanel.getForm().findField("id_plan").setVisible(!a);c.formPanel.getForm().findField("id_plan").setAllowBlank(a);c.formPanel.getForm().findField("id_offer").setVisible(!a);c.formPanel.getForm().findField("prefix_local").setVisible(!a)});if(fieldGroup.value==2){fieldGroupAgent.show()}else{fieldGroupAgent.hide()}},onGetUserType:function(d,c){filterGroupp=Ext.encode([{type:"numeric",comparison:"eq",value:d,field:"id"}]),Ext.Ajax.request({url:"index.php/groupUser/getUserType",params:{filter:filterGroupp},success:function(a){a=Ext.decode(a.responseText);c(a.rows)}})},onDelete:function(d){var f=this,e;notDelete=false;Ext.each(f.list.getSelectionModel().getSelection(),function(a){if(a.get("id")==1){Ext.ux.Alert.alert(f.titleError,t("You cannot delete the")+" user id 1","error");notDelete=true}});if(notDelete==false){Ext.ux.app.ViewController.prototype.onDelete.apply(this,arguments)}}},0,0,0,0,["controller.user"],0,[MBilling.view.user,"Controller"],0));(Ext.cmd.derive("MBilling.view.user.Combo",Ext.form.field.ComboBox,{name:"id_user",fieldLabel:t("username"),displayField:"username",forceSelection:true,editable:false,valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.User",{proxy:{type:"uxproxy",module:"user",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["usercombo"],["component","box","field","textfield","pickerfield","combobox","combo","usercombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,usercombo:true},["widget.usercombo"],0,[MBilling.view.user,"Combo"],0));(Ext.cmd.derive("MBilling.view.user.Module",Ext.ux.panel.Module,{controller:"user",cfgEast:{flex:4}},0,["usermodule"],["component","box","container","uxpanelmodule","usermodule"],{component:true,box:true,container:true,uxpanelmodule:true,usermodule:true},["widget.usermodule"],0,[MBilling.view.user,"Module"],0));(Ext.cmd.derive("MBilling.view.user.List",Ext.ux.grid.Panel,{store:"User",fieldSearch:"username",initComponent:function(){var b=this;b.extraButtons=[{text:t("Bulk")+" "+t("User"),handler:"onBulk",width:100,disabled:false,hidden:App.user.isClient||!b.allowCreate}];b.columns=b.columns||[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("username"),dataIndex:"username",flex:2},{header:t("lastname"),dataIndex:"lastname",flex:3},{header:t("firstname"),dataIndex:"firstname",flex:3},{header:t("email"),dataIndex:"email",flex:window.isTablet?3:4},{header:t("credit"),dataIndex:"credit",renderer:Helper.Util.formatMoneyDecimal,flex:2},{xtype:"templatecolumn",tpl:"{idPlanname}",header:t("plan"),dataIndex:"id_plan",comboFilter:"plancombo",flex:3},{xtype:"templatecolumn",tpl:"{idGroupname}",header:t("group"),dataIndex:"id_group",comboFilter:"groupusercombo",flex:2,hidden:App.user.isClient||App.user.isAgent||window.isTablet,hideable:!App.user.isClient&&!App.user.isAgent},{header:t("agent"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:2,hidden:!App.user.isAdmin||window.isTablet,hideable:App.user.isAdmin},{header:t("status"),dataIndex:"active",renderer:Helper.Util.formatBooleanActive,flex:2,filter:{type:"list",options:[[1,t("active")],[2,t("pending")],[0,t("inactive")]]},hidden:App.user.isClient||window.isTablet,hideable:!App.user.isClient},{header:t("creationdate"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"creationdate",flex:4},{dataIndex:"id_offer",header:t("offer"),flex:2,hidden:true,hideable:!App.user.isClient&&!App.user.isAgent},{header:t("typepaid"),dataIndex:"typepaid",flex:2,renderer:Helper.Util.formattypepaid,filter:{type:"list",options:[[0,t("prepaid")],[1,t("pospaid")]]},hidden:true,hideable:!App.user.isClient&&!App.user.isAgent},{header:t("city"),dataIndex:"city",hidden:true,hideable:!App.user.isClient&&!App.user.isAgent,flex:1},{header:t("state"),dataIndex:"state",hidden:true,hideable:!App.user.isClient&&!App.user.isAgent,flex:1},{header:t("country"),dataIndex:"country",hidden:true,hideable:!App.user.isClient&&!App.user.isAgent,flex:1},{header:t("zipcode"),dataIndex:"zipcode",hidden:true,hideable:!App.user.isClient&&!App.user.isAgent,flex:1},{header:t("phone"),dataIndex:"phone",hidden:true,hideable:!App.user.isClient&&!App.user.isAgent,flex:1},{header:t("creditlimit"),dataIndex:"creditlimit",hidden:true,hideable:!App.user.isClient&&!App.user.isAgent,flex:1},{header:t("record_call"),dataIndex:"record_call",flex:1,renderer:Helper.Util.formattyyesno,filter:{type:"list",options:[[0,t("no")],[1,t("yes")]]},hidden:true,hideable:!App.user.isClient&&!App.user.isAgent},{header:t("CPS Limit"),dataIndex:"cpslimit",hidden:true,hideable:window.dialC&&App.user.isAdmin,flex:2}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["userlist"],["component","box","container","panel","tablepanel","gridpanel","grid","userlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,userlist:true},["widget.userlist"],0,[MBilling.view.user,"List"],0));(Ext.cmd.derive("MBilling.view.user.Form",Ext.ux.form.Panel,{autoHeight:300,bodyPadding:0,fieldsHideUpdateLot:["username","password","id_group_agent","id_offer","callingcard_pin"],initComponent:function(){var b=this;haveServiceMenu=false;Ext.each(App.user.menu,function(a){if(a.text=="t('Services')"){haveServiceMenu=true}});b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{labelAlign:"right",plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true}},items:[{title:t("general"),items:[{name:"username",fieldLabel:t("username"),maxLength:20,minLength:4,readOnly:App.user.isClient},{name:"password",fieldLabel:t("Password"),minLength:6,hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"id_group",fieldLabel:t("IdGroup"),xtype:"groupusercombo",allowBlank:!App.user.isAdmin,hidden:!App.user.isAdmin},{name:"id_group_agent",fieldLabel:t("GroupUser"),xtype:"groupuseragentcombo",emptyText:t("SELECT GROUP FOR AGENT USERS"),fieldLabel:t("Group for Agent Users"),hidden:true,allowBlank:true},{fieldLabel:t("Plan"),name:"id_plan",xtype:"planlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:App.user.isClient},{xtype:"languagecombo",name:"language",value:App.user.language=="pt_BR"?"br":App.user.language,fieldLabel:t("language")},{name:"prefix_local",fieldLabel:t("prefixlocal"),value:App.user.base_country=="BRL"?"0/55,*/5511/8,*/5511/9":App.user.base_country=="ARG"?"0/54,*/5411/8,15/54911/10,16/54911/10":"",allowBlank:true,emptyText:"match / replace / length",hidden:App.user.isClient},{xtype:"statususercombo",name:"active",fieldLabel:t("Active"),hidden:App.user.isClient,allowBlank:App.user.isClient},{xtype:"countrycombo",name:"country",fieldLabel:t("country"),value:App.user.language=="pt_BR"?"55":"1",allowBlank:true},{name:"id_offer",fieldLabel:t("offer"),xtype:"offercombo",allowBlank:true},{xtype:"numberfield",name:"cpslimit",fieldLabel:t("CPS Limit"),value:-1,minValue:-1,maxValue:50,hidden:!window.dialC||!App.user.isAdmin,allowBlank:true}]},{title:t("personalData"),itemId:"personalData",items:[{name:"company_name",fieldLabel:t("company")+" "+t("name"),allowBlank:true},{name:"state_number",fieldLabel:t("state_number"),allowBlank:true,hidden:App.user.base_country=!"BRL"},{name:"lastname",fieldLabel:t("lastname"),allowBlank:true,maxLength:40,minLength:4},{name:"firstname",fieldLabel:t("firstname"),allowBlank:true,maxLength:40,minLength:4},{xtype:"fieldcontainer",layout:"hbox",labelWidth:100,defaults:{xtype:"textfield",labelAlign:"right",flex:1},items:[{name:"city",fieldLabel:t("city"),allowBlank:true,maxLength:40,minLength:4,flex:2},{name:"state",fieldLabel:t("state"),allowBlank:true,maxLength:20,minLength:2}]},{name:"address",fieldLabel:t("address"),allowBlank:true},{name:"zipcode",fieldLabel:t("zipcode"),allowBlank:true},{xtype:"fieldcontainer",layout:"hbox",labelWidth:100,defaults:{xtype:"textfield",labelAlign:"right",flex:1},items:[{name:"phone",fieldLabel:t("phone"),allowBlank:true,maxLength:13,minLength:8},{name:"mobile",fieldLabel:t("mobile"),allowBlank:true,maxLength:20,minLength:8}]},{name:"email",fieldLabel:t("email"),allowBlank:true,vtype:"email"},{name:"doc",fieldLabel:t("Doc"),allowBlank:true},{name:"vat",fieldLabel:t("vat"),hidden:App.user.isClient,allowBlank:true}]},{title:t("suplementaryInfo"),itemId:"suplementaryInfo",defaults:{labelAlign:"right",plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true,labelWidth:145},items:[{xtype:"typepaymentcombo",name:"typepaid",fieldLabel:t("typepaid"),allowBlank:true,readOnly:App.user.isClient},{xtype:"fieldcontainer",layout:"hbox",defaults:{xtype:"textfield",labelAlign:"right",labelWidth:145,flex:1},items:[{name:"creditlimit",fieldLabel:t("creditlimit"),value:0,allowBlank:true,readOnly:App.user.isClient,flex:2},{xtype:"numberfield",name:"credit_notification",labelWidth:150,fieldLabel:t("creditnotification"),value:"-1",minValue:-1,allowBlank:true,flex:3}]},{xtype:"fieldcontainer",layout:"hbox",defaults:{xtype:"textfield",labelAlign:"right",labelWidth:145,flex:1},items:[{xtype:"noyescombo",name:"enableexpire",fieldLabel:t("enableexpire"),allowBlank:true,hidden:!App.user.isAdmin,flex:2},{xtype:"datefield",name:"expirationdate",fieldLabel:t("expirationdate"),format:"Y-m-d H:i:s",allowBlank:true,hidden:!App.user.isAdmin,labelWidth:150,flex:3}]},{xtype:"fieldcontainer",layout:"hbox",defaults:{xtype:"textfield",labelAlign:"right",labelWidth:145,flex:1},items:[{xtype:"noyescombo",name:"record_call",fieldLabel:t("record_call"),allowBlank:true,hidden:!haveServiceMenu||!App.user.isAdmin,readOnly:!App.user.isAdmin,flex:2},{labelWidth:150,xtype:"combobox",store:[["gsm",t("gsm")],["wav",t("wav")],["wav49",t("wav49")]],name:"mix_monitor_format",fieldLabel:t("Record call format"),forceSelection:true,editable:false,allowBlank:true,value:"gsm",hidden:!haveServiceMenu,flex:3}]},{xtype:"fieldcontainer",layout:"hbox",labelWidth:145,defaults:{labelAlign:"right",hidden:!haveServiceMenu,readOnly:!App.user.isAdmin,allowBlank:true,flex:1},items:[{labelWidth:145,xtype:"numberfield",name:"calllimit",fieldLabel:t("calllimit"),value:"-1",minValue:-1,flex:2},{labelWidth:150,xtype:"combobox",forceSelection:true,editable:false,name:"calllimit_error",fieldLabel:t("CallLimit Error"),value:"503",store:[["503",t("Congestion")],["403",t("Busy")]],flex:3}]},{xtype:"noyescombo",name:"callshop",fieldLabel:"Callshop",allowBlank:true,hidden:App.user.isClient},{xtype:"numberfield",name:"disk_space",fieldLabel:t("Disk Space"),value:-1,hidden:!haveServiceMenu,minValue:-1,readOnly:!App.user.isAdmin},{name:"sipaccountlimit",xtype:"numberfield",fieldLabel:t("Sip Account Limit"),value:"-1",minValue:-1,allowBlank:!App.user.isAdmin,readOnly:!App.user.isAdmin,hidden:!haveServiceMenu},{xtype:"numberfield",name:"callingcard_pin",fieldLabel:t("lockpin"),minValue:100000,maxLength:6,minLength:6},{xtype:"restrictioncombo",name:"restriction",fieldLabel:t("restriction"),allowBlank:true,hidden:App.user.isClient}]},{title:t("Send Credit"),itemId:"transferData",hidden:!window.transferToMobile,items:[{xtype:"fieldcontainer",layout:"hbox",hidden:App.user.isClient,defaults:{labelAlign:"right",labelWidth:145,allowBlank:true,flex:1},items:[{xtype:"noyescombo",name:"transfer_international",fieldLabel:t("Enable International")},{xtype:"numberfield",name:"transfer_international_profit",labelWidth:120,fieldLabel:t("Profit")}]},{xtype:"fieldcontainer",layout:"hbox",hidden:App.user.isClient,defaults:{labelAlign:"right",labelWidth:145,allowBlank:true,flex:1},items:[{xtype:"noyescombo",name:"transfer_flexiload",fieldLabel:t("Enable Flexiload")},{xtype:"numberfield",name:"transfer_flexiload_profit",labelWidth:120,fieldLabel:t("Profit")}]},{xtype:"fieldcontainer",layout:"hbox",hidden:App.user.isClient,defaults:{labelAlign:"right",labelWidth:145,allowBlank:true,flex:1},items:[{xtype:"noyescombo",name:"transfer_bkash",fieldLabel:t("Enable Bkash")},{xtype:"numberfield",name:"transfer_bkash_profit",labelWidth:120,fieldLabel:t("Profit")}]},{xtype:"fieldcontainer",layout:"hbox",hidden:App.user.isClient,defaults:{labelAlign:"right",labelWidth:145,allowBlank:true,flex:1},items:[{xtype:"noyescombo",name:"transfer_dbbl_rocket",fieldLabel:t("Enable DBBL/Rocket")},{xtype:"numberfield",name:"transfer_dbbl_rocket_profit",labelWidth:120,fieldLabel:t("Profit")}]},{xtype:"numberfield",name:"transfer_bdservice_rate",fieldLabel:t("BDService rate"),minValue:0,hidden:!App.user.isAdmin,allowBlank:true},{xtype:"numberfield",name:"transfer_show_selling_price",fieldLabel:t("show selling price"),allowBlank:true}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["userform"],["component","box","container","panel","form","userform"],{component:true,box:true,container:true,panel:true,form:true,userform:true},["widget.userform"],0,[MBilling.view.user,"Form"],0));(Ext.cmd.derive("Ext.ux.form.field.Lookup",Ext.form.FieldContainer,{layout:"fit",blankText:t("This field is required."),displayField:undefined,valueField:"id",gridConfig:{},windowConfig:{},iconClsSearch:"x-form-search-trigger",layout:"hbox",startX:150,hiddenSearchButton:false,eventsRelay:["dirtychange","validitychange","errorchange","specialkey","blur","keydown","keyup","keypress","change"],initComponent:function(){var b=this;b.store=Ext.data.StoreManager.lookup(b.store||"ext-empty-store");b.items=b.initSubFields();Ext.form.FieldContainer.prototype.initComponent.apply(this,arguments)},initSubFields:function(){var b=this;b.rawField=Ext.widget("textfield",{readOnly:true,flex:1,onClearButtonClick:b.reset,clearButtonScope:b,isFormField:false,listeners:{scope:b,change:b.onChangeRawField},triggers:{clear:{weight:0,cls:"x-form-clear-trigger",hidden:true,clickOnReadOnly:true,handler:b.reset,scope:b}}});b.relayEvents(b.rawField,b.eventsRelay);b.buttonSearch=Ext.widget("button",{iconCls:"ux-gridfilter-text-icon",scope:b,text:t("Search"),handler:b.onClickSearch,hidden:b.hiddenSearchButton});return[b.rawField,b.buttonSearch]},onChangeRawField:function(b){b.getTrigger("clear").show()},onClickSearch:function(e,f){var d=this;if(!d.windowSearch){d.list=Ext.widget(d.gridConfig.xtype,Ext.apply({selType:"checkboxmodel",selModel:{mode:"SINGLE"},allowCreate:false,allowUpdate:false,allowDelete:false,allowPrint:false,autoLoadList:false,buttonCsv:false,extraButtons:[],listeners:{scope:d,selectionchange:d.onSelectionChangeList,itemdblclick:d.onItemDblClick}},d.gridConfig));d.buttonOk=Ext.widget("button",{text:t("Ok"),width:70,disabled:true,glyph:icons.checkmark,scope:d,handler:d.onClickSelect});d.windowSearch=Ext.widget("window",Ext.apply({closeAction:"hide",header:false,layout:"fit",closable:false,resizable:true,draggable:false,baseCls:"x-panel",width:d.rawField.getWidth()+70+d.startX,height:d.rawField.getY()>250?300:Ext.getBody().getViewSize().height-270,items:d.list,bbar:["->",{text:t("Cancel"),glyph:icons.stop,scope:d,handler:function(){d.windowSearch.close()}},d.buttonOk],listeners:{scope:d,show:d.onShowWindowSearch}},d.windowConfig))}else{d.windowSearch.setWidth(d.rawField.getWidth()+23+d.startX)}d.windowSearch.showAt(d.rawField.getX()-d.startX,d.rawField.getY()+23)},onSelectionChangeList:function(d,c){this.recordSelected=c[0];this.buttonOk.setDisabled(!c.length)},onItemDblClick:function(d,c){this.selectRecord(c)},onClickSelect:function(){this.selectRecord()},selectRecord:function(c){var d=this;c=c||d.recordSelected;d.setValue(c.getId(),c.get(d.displayFieldList));d.windowSearch.close();d.list.store.defaultFilter=[];d.list.store.load()},onShowWindowSearch:function(f){var e=this,d=e.list.down("searchfield");d&&d.focus(true,10);!e.list.store.getCount()&&Ext.defer(function(){e.list.store.load()},10)},getErrors:function(){var d=this,c=[];if(d.allowBlank){return c}if(!d.getValue()){c.push(d.blankText);return c}return c},reset:function(){var b=this;b.rawField.reset();b.setValue("");b.rawField.getTrigger("clear").hide();b.rawField.updateLayout()},setValue:function(j,e){var f=this,g=f.ownerForm&&f.ownerForm.getRecord();if(!Ext.isEmpty(j)){e=e||(g&&g.get(f.displayField))}f.value=j;f.rawField.setValue(e||j);f.fireEvent("select",f,j)},getValue:function(){return this.value},getRawValue:function(){return this.rawField.getRawValue()}},0,0,["component","box","container","fieldcontainer"],{component:true,box:true,container:true,fieldcontainer:true},0,[["field",Ext.form.field.Field]],[Ext.ux.form.field,"Lookup"],0));(Ext.cmd.derive("MBilling.view.user.Lookup",Ext.ux.form.field.Lookup,{name:"id_user",fieldLabel:t("User"),displayField:"idUserusername",displayFieldList:"username",gridConfig:{xtype:"userlist",fieldSearch:"username",columns:[{header:t("username"),dataIndex:"username",flex:2},{header:t("email"),dataIndex:"email",flex:2},{header:t("lastname"),dataIndex:"lastname",flex:2},{header:t("credit"),dataIndex:"credit",renderer:Helper.Util.formatMoneyDecimal,flex:2}]}},0,["userlookup"],["component","box","container","fieldcontainer","userlookup"],{component:true,box:true,container:true,fieldcontainer:true,userlookup:true},["widget.userlookup"],0,[MBilling.view.user,"Lookup"],0));(Ext.cmd.derive("MBilling.view.user.Bulk",Ext.window.Window,{autoShow:true,modal:true,layout:"fit",iconCls:"icon-import-csv",title:t("Bulk User"),width:400,height:window.isThemeNeptune||window.isThemeCrisp?295:window.isThemeTriton?390:270,labelWidthFields:120,htmlTipInfo:"",fieldsImport:[],initComponent:function(){var b=this;b.items=[{xtype:"form",bodyPadding:5,defaults:{anchor:"0",enableKeyEvents:true,labelWidth:b.labelWidthFields,msgTarget:"side",plugins:"markallowblank",allowBlank:false},items:[{xtype:"numberfield",value:10,name:"totalToCreate",fieldLabel:t("How many users?")},{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,00",name:"credit",value:0,fieldLabel:t("Add")+" "+t("Refill"),readOnly:App.user.isClient},{xtype:"groupusercombo",allowBlank:!App.user.isAdmin,hidden:!App.user.isAdmin},{xtype:"languagecombo",name:"language",value:App.user.language=="pt_BR"?"br":App.user.language,fieldLabel:t("language")},{xtype:"plancombo",hidden:App.user.isClient,allowBlank:App.user.isClient},{xtype:"textfield",name:"prefix_local",fieldLabel:t("prefixlocal"),value:App.user.base_country=="BRL"?"0/55,*/5511/8,*/5511/9":App.user.base_country=="ARG"?"0/54,*/5411/8,15/54911/10,16/54911/10":"",allowBlank:true,emptyText:"match / replace / length",hidden:App.user.isClient},{xtype:"statususercombo",name:"active",fieldLabel:t("Active"),hidden:App.user.isClient,allowBlank:App.user.isClient}]}];b.title=b.title+(b.titleModule?" - "+b.titleModule:"");b.bbar=[{width:150,iconCls:"icon-import-csv",text:t("Bulk")+" "+t("User"),scope:b,handler:b.onBulk}];Ext.window.Window.prototype.initComponent.apply(this,arguments)},onBulk:function(d){var f=this,e=f.list.store;if(!f.down("form").isValid()){return}f.list.setLoading(true);Ext.Ajax.setTimeout(1000000);f.down("form").submit({url:"index.php/user/bulk",scope:f,success:function(c,b){var a=Ext.decode(b.response.responseText);console.log(a);if(a.success){Ext.ux.Alert.alert(t("Success"),a.msg,"success")}else{Ext.ux.Alert.alert(t("Error"),a.errors,"error")}d.enable();f.list.setLoading(false);e.load();f.close()},failure:function(c,b){console.log(b.response.responseText);if(b.response&&Ext.isObject(b.response.responseText)){var a=Ext.decode(b.response.responseText);Ext.ux.Alert.alert(t("Error1"),a.errors,"error")}else{Ext.ux.Alert.alert(t("Error2"),Ext.decode(b.response.responseText).msg,"error",true,10)}d.enable()}})}},0,["userbulk"],["component","box","container","panel","window","userbulk"],{component:true,box:true,container:true,panel:true,window:true,userbulk:true},["widget.userbulk"],0,[MBilling.view.user,"Bulk"],0));(Ext.cmd.derive("MBilling.view.configuration.Controller",Ext.ux.app.ViewController,{onAfterSave:function(g){var j=this,l=j.formPanel.getForm(),f=l.getRecord(),m=f.data.config_key;g=g||j.formPanel;if(!g.idRecord){g.getForm().reset();j.focusFirstField()}j.saveButton.enable();j.updateLotButton&&j.updateLotButton.toggle(false);g.setLoading(false);j.formPanel.collapse();j.store.load();j.logoutKey(m)},logoutKey:function(d){var c=this;if(d=="licence"||d=="base_language"){localStorage.setItem("day","");localStorage.setItem("lang","")}if(d=="licence"){Ext.Ajax.request({url:"index.php/authentication/logoff",success:function(){App.user.logged=false;location.reload()}})}}},0,0,0,0,["controller.configuration"],0,[MBilling.view.configuration,"Controller"],0));(Ext.cmd.derive("MBilling.view.configuration.Module",Ext.ux.panel.Module,{controller:"configuration"},0,["configurationmodule"],["component","box","container","uxpanelmodule","configurationmodule"],{component:true,box:true,container:true,uxpanelmodule:true,configurationmodule:true},["widget.configurationmodule"],0,[MBilling.view.configuration,"Module"],0));(Ext.cmd.derive("MBilling.view.configuration.List",Ext.ux.grid.Panel,{store:"Configuration",fieldSearch:"config_title",comparisonfilter:"ct",initComponent:function(){var b=this;b.allowPrint=false;b.buttonCsv=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowDelete=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("name"),dataIndex:"config_title"},{header:t("value"),dataIndex:"config_value"}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["configurationlist"],["component","box","container","panel","tablepanel","gridpanel","grid","configurationlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,configurationlist:true},["widget.configurationlist"],0,[MBilling.view.configuration,"List"],0));(Ext.cmd.derive("MBilling.view.configuration.Form",Ext.ux.form.Panel,{items:[{name:"config_value",fieldLabel:t("value"),allowBlank:true},{xtype:"textarea",name:"config_description",fieldLabel:t("description"),height:200,anchor:"100%",readOnly:true}]},0,["configurationform"],["component","box","container","panel","form","configurationform"],{component:true,box:true,container:true,panel:true,form:true,configurationform:true},["widget.configurationform"],0,[MBilling.view.configuration,"Form"],0));(Ext.cmd.derive("MBilling.view.general.BooleanCombo",Ext.form.field.ComboBox,{fieldLabel:t("status"),forceSelection:true,editable:false,value:1,store:[[1,t("active")],[0,t("inactive")]]},0,["booleancombo"],["component","box","field","textfield","pickerfield","combobox","combo","booleancombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,booleancombo:true},["widget.booleancombo"],0,[MBilling.view.general,"BooleanCombo"],0));(Ext.cmd.derive("MBilling.view.general.ServicesTypeCombo",Ext.form.field.ComboBox,{fieldLabel:t("status"),forceSelection:true,editable:false,value:"Custom",store:[["disk_space",t("disk_space")],["sipAccountLimit",t("Sip Account Limit")],["calllimit",t("calllimit")],["Custom",t("Custom")]]},0,["servicestypecombo"],["component","box","field","textfield","pickerfield","combobox","combo","servicestypecombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,servicestypecombo:true},["widget.servicestypecombo"],0,[MBilling.view.general,"ServicesTypeCombo"],0));(Ext.cmd.derive("MBilling.view.general.TypeSipForward",Ext.form.field.ComboBox,{fieldLabel:t("Forward"),forceSelection:true,editable:false,value:"",store:[["",t("")],["undefined",t("Undefined")],["sip",t("SIP")],["ivr",t("IVR")],["queue",t("Queue")],["group",t("Group")],["number",t("Number")],["hangup",t("Hangup")],["custom",t("Custom")]]},0,["typesipforwardcombo"],["component","box","field","textfield","pickerfield","combobox","combo","typesipforwardcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,typesipforwardcombo:true},["widget.typesipforwardcombo"],0,[MBilling.view.general,"TypeSipForward"],0));(Ext.cmd.derive("MBilling.view.general.TypeDestination",Ext.form.field.ComboBox,{fieldLabel:t("type"),forceSelection:true,editable:false,value:"",store:[["",t("")],["undefined",t("Undefined")],["sip",t("SIP")],["ivr",t("IVR")],["queue",t("Queue")],["group",t("Group")],["number",t("Number")],["repeat",t("Repeat IVR")],["hangup",t("Hangup")],["custom",t("Custom")]]},0,["typedestinationcombo"],["component","box","field","textfield","pickerfield","combobox","combo","typedestinationcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,typedestinationcombo:true},["widget.typedestinationcombo"],0,[MBilling.view.general,"TypeDestination"],0));(Ext.cmd.derive("MBilling.view.general.PontoVirgula",Ext.form.field.ComboBox,{fieldLabel:t("status"),forceSelection:true,editable:false,value:",",store:[[",",", ("+t("Comma")+")"],[";","; ("+t("Semicolon")+")"]]},0,["pontovirgulacombo"],["component","box","field","textfield","pickerfield","combobox","combo","pontovirgulacombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,pontovirgulacombo:true},["widget.pontovirgulacombo"],0,[MBilling.view.general,"PontoVirgula"],0));(Ext.cmd.derive("MBilling.view.general.StatusCombo",Ext.form.field.ComboBox,{fieldLabel:t("status"),forceSelection:true,editable:false,value:1,store:[[1,t("active")],[0,t("inactive")],[2,t("pending")],[3,t("sent")],[4,t("blocked")]]},0,["statuscombo"],["component","box","field","textfield","pickerfield","combobox","combo","statuscombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,statuscombo:true},["widget.statuscombo"],0,[MBilling.view.general,"StatusCombo"],0));(Ext.cmd.derive("MBilling.view.general.StatusUserCombo",Ext.form.field.ComboBox,{fieldLabel:t("status"),forceSelection:true,editable:false,value:1,store:[[1,t("active")],[0,t("inactive")],[2,t("pending")]]},0,["statususercombo"],["component","box","field","textfield","pickerfield","combobox","combo","statususercombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,statususercombo:true},["widget.statususercombo"],0,[MBilling.view.general,"StatusUserCombo"],0));(Ext.cmd.derive("MBilling.view.general.CallbackCombo",Ext.form.field.ComboBox,{fieldLabel:t("status"),forceSelection:true,editable:false,value:1,store:[[1,t("active")],[2,t("pending")],[3,t("sent")],[4,t("Not working")],[5,t("Complete")]]},0,["callbackcombo"],["component","box","field","textfield","pickerfield","combobox","combo","callbackcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,callbackcombo:true},["widget.callbackcombo"],0,[MBilling.view.general,"CallbackCombo"],0));(Ext.cmd.derive("MBilling.view.general.TypeNoYes",Ext.form.field.ComboBox,{fieldLabel:t("typepaid"),forceSelection:true,editable:false,value:0,store:[[0,t("no")],[1,t("yes")]]},0,["noyescombo"],["component","box","field","textfield","pickerfield","combobox","combo","noyescombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,noyescombo:true},["widget.noyescombo"],0,[MBilling.view.general,"TypeNoYes"],0));(Ext.cmd.derive("MBilling.view.general.TypeYesNo",Ext.form.field.ComboBox,{fieldLabel:t("typepaid"),forceSelection:true,editable:false,value:1,store:[[0,t("no")],[1,t("yes")]]},0,["yesnocombo"],["component","box","field","textfield","pickerfield","combobox","combo","yesnocombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,yesnocombo:true},["widget.yesnocombo"],0,[MBilling.view.general,"TypeYesNo"],0));(Ext.cmd.derive("MBilling.view.general.TypeYesNoString",Ext.form.field.ComboBox,{fieldLabel:t("typepaid"),forceSelection:true,editable:false,value:"yes",store:[["no",t("no")],["yes",t("yes")]]},0,["yesnostringcombo"],["component","box","field","textfield","pickerfield","combobox","combo","yesnostringcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,yesnostringcombo:true},["widget.yesnostringcombo"],0,[MBilling.view.general,"TypeYesNoString"],0));(Ext.cmd.derive("MBilling.view.general.TypeNoYesString",Ext.form.field.ComboBox,{fieldLabel:t("typepaid"),forceSelection:true,editable:false,value:"no",store:[["no",t("no")],["yes",t("yes")]]},0,["noyesstringcombo"],["component","box","field","textfield","pickerfield","combobox","combo","noyesstringcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,noyesstringcombo:true},["widget.noyesstringcombo"],0,[MBilling.view.general,"TypeNoYesString"],0));(Ext.cmd.derive("MBilling.view.general.Typenumber",Ext.form.field.ComboBox,{fieldLabel:t("typenumber"),forceSelection:true,editable:false,value:1,store:[[1,1],[2,2],[3,3],[4,4],[5,5]]},0,["numbercombo"],["component","box","field","textfield","pickerfield","combobox","combo","numbercombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,numbercombo:true},["widget.numbercombo"],0,[MBilling.view.general,"Typenumber"],0));(Ext.cmd.derive("MBilling.view.general.Typelanguage",Ext.form.field.ComboBox,{fieldLabel:t("language"),forceSelection:true,editable:false,value:"en",store:[["",t("undefined")],["br",t("portuguese")],["es",t("spanish")],["en",t("english")]]},0,["languagecombo"],["component","box","field","textfield","pickerfield","combobox","combo","languagecombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,languagecombo:true},["widget.languagecombo"],0,[MBilling.view.general,"Typelanguage"],0));(Ext.cmd.derive("MBilling.view.general.TypeCampaign",Ext.form.field.ComboBox,{fieldLabel:t("type"),forceSelection:true,editable:false,value:1,store:[[1,t("voice")],[0,t("sms")]]},0,["campaigntypecombo"],["component","box","field","textfield","pickerfield","combobox","combo","campaigntypecombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,campaigntypecombo:true},["widget.campaigntypecombo"],0,[MBilling.view.general,"TypeCampaign"],0));(Ext.cmd.derive("MBilling.view.general.TypeFullCampaign",Ext.form.field.ComboBox,{fieldLabel:t("type"),forceSelection:true,editable:false,value:1,store:[[1,t("voice")],[0,t("sms")]]},0,["campaigntypefullcombo"],["component","box","field","textfield","pickerfield","combobox","combo","campaigntypefullcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,campaigntypefullcombo:true},["widget.campaigntypefullcombo"],0,[MBilling.view.general,"TypeFullCampaign"],0));(Ext.cmd.derive("MBilling.view.general.TypeBoleto",Ext.form.field.ComboBox,{fieldLabel:t("status"),forceSelection:true,editable:false,value:"D",store:[["D",t("no")],["P",t("yes")]]},0,["boletocombo"],["component","box","field","textfield","pickerfield","combobox","combo","boletocombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,boletocombo:true},["widget.boletocombo"],0,[MBilling.view.general,"TypeBoleto"],0));(Ext.cmd.derive("MBilling.view.general.RestrictionCombo",Ext.form.field.ComboBox,{fieldLabel:t("status"),forceSelection:true,editable:false,value:0,store:[[0,t("inactive")],[1,t("cantCallRestrictedNumbers")],[2,t("canOnlyCallRestrictedNumbers")]]},0,["restrictioncombo"],["component","box","field","textfield","pickerfield","combobox","combo","restrictioncombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,restrictioncombo:true},["widget.restrictioncombo"],0,[MBilling.view.general,"RestrictionCombo"],0));(Ext.cmd.derive("MBilling.view.general.CountryISOCombo",Ext.form.field.ComboBox,{forceSelection:true,editable:true,listeners:{focus:function(b){b.expand()}},store:[["AFG",t("Afghanistan")],["ALA",t("Åland Islands")],["ALB",t("Albania")],["DZA",t("Algeria")],["ASM",t("American Samoa")],["AND",t("Andorra")],["AGO",t("Angola")],["AIA",t("Anguilla")],["ATA",t("Antarctica")],["ATG",t("Antigua and Barbuda")],["ARG",t("Argentina")],["ARM",t("Armenia")],["ABW",t("Aruba")],["AUS",t("Australia")],["AUT",t("Austria")],["AZE",t("Azerbaijan")],["BHS",t("Bahamas")],["BHR",t("Bahrain")],["BGD",t("Bangladesh")],["BRB",t("Barbados")],["BLR",t("Belarus")],["BEL",t("Belgium")],["BLZ",t("Belize")],["BEN",t("Benin")],["BMU",t("Bermuda")],["BTN",t("Bhutan")],["BOL",t("Bolivia, Plurinational State of")],["BES",t("Bonaire, Sint Eustatius and Saba")],["BIH",t("Bosnia and Herzegovina")],["BWA",t("Botswana")],["BVT",t("Bouvet Island")],["BRL",t("Brazil")],["IOT",t("British Indian Ocean Territory")],["BRN",t("Brunei Darussalam")],["BGR",t("Bulgaria")],["BFA",t("Burkina Faso")],["BDI",t("Burundi")],["KHM",t("Cambodia")],["CMR",t("Cameroon")],["CAN",t("Canada")],["CPV",t("Cape Verde")],["CYM",t("Cayman Islands")],["CAF",t("Central African Republic")],["TCD",t("Chad")],["CHL",t("Chile")],["CHN",t("China")],["CXR",t("Christmas Island")],["CCK",t("Cocos (Keeling) Islands")],["COL",t("Colombia")],["COM",t("Comoros")],["COG",t("Congo")],["COD",t("Congo, the Democratic Republic of the")],["COK",t("Cook Islands")],["CRI",t("Costa Rica")],["CIV",t("Côte dIvoire")],["HRV",t("Croatia")],["CUB",t("Cuba")],["CUW",t("Curaçao")],["CYP",t("Cyprus")],["CZE",t("Czech Republic")],["DNK",t("Denmark")],["DJI",t("Djibouti")],["DMA",t("Dominica")],["DOM",t("Dominican Republic")],["ECU",t("Ecuador")],["EGY",t("Egypt")],["SLV",t("El Salvador")],["GNQ",t("Equatorial Guinea")],["ERI",t("Eritrea")],["EST",t("Estonia")],["ETH",t("Ethiopia")],["FLK",t("Falkland Islands (Malvinas)")],["FRO",t("Faroe Islands")],["FJI",t("Fiji")],["FIN",t("Finland")],["FRA",t("France")],["GUF",t("French Guiana")],["PYF",t("French Polynesia")],["ATF",t("French Southern Territories")],["GAB",t("Gabon")],["GMB",t("Gambia")],["GEO",t("Georgia")],["DEU",t("Germany")],["GHA",t("Ghana")],["GIB",t("Gibraltar")],["GRC",t("Greece")],["GRL",t("Greenland")],["GRD",t("Grenada")],["GLP",t("Guadeloupe")],["GUM",t("Guam")],["GTM",t("Guatemala")],["GGY",t("Guernsey")],["GIN",t("Guinea")],["GNB",t("Guinea-Bissau")],["GUY",t("Guyana")],["HTI",t("Haiti")],["HMD",t("Heard Island and McDonald Islands")],["VAT",t("Holy See (Vatican City State)")],["HND",t("Honduras")],["HKG",t("Hong Kong")],["HUN",t("Hungary")],["ISL",t("Iceland")],["IND",t("India")],["IDN",t("Indonesia")],["IRN",t("Iran, Islamic Republic of")],["IRQ",t("Iraq")],["IRL",t("Ireland")],["IMN",t("Isle of Man")],["ISR",t("Israel")],["ITA",t("Italy")],["JAM",t("Jamaica")],["JPN",t("Japan")],["JEY",t("Jersey")],["JOR",t("Jordan")],["KAZ",t("Kazakhstan")],["KEN",t("Kenya")],["KIR",t("Kiribati")],["PRK",t("Korea, Democratic Peoples Republic of")],["KOR",t("Korea, Republic of")],["KWT",t("Kuwait")],["KGZ",t("Kyrgyzstan")],["LAO",t("Lao Peoples Democratic Republic")],["LVA",t("Latvia")],["LBN",t("Lebanon")],["LSO",t("Lesotho")],["LBR",t("Liberia")],["LBY",t("Libya")],["LIE",t("Liechtenstein")],["LTU",t("Lithuania")],["LUX",t("Luxembourg")],["MAC",t("Macao")],["MKD",t("Macedonia, the former Yugoslav Republic of")],["MDG",t("Madagascar")],["MWI",t("Malawi")],["MYS",t("Malaysia")],["MDV",t("Maldives")],["MLI",t("Mali")],["MLT",t("Malta")],["MHL",t("Marshall Islands")],["MTQ",t("Martinique")],["MRT",t("Mauritania")],["MUS",t("Mauritius")],["MYT",t("Mayotte")],["MEX",t("Mexico")],["FSM",t("Micronesia, Federated States of")],["MDA",t("Moldova, Republic of")],["MCO",t("Monaco")],["MNG",t("Mongolia")],["MNE",t("Montenegro")],["MSR",t("Montserrat")],["MAR",t("Morocco")],["MOZ",t("Mozambique")],["MMR",t("Myanmar")],["NAM",t("Namibia")],["NRU",t("Nauru")],["NPL",t("Nepal")],["NLD",t("Netherlands")],["NCL",t("New Caledonia")],["NZL",t("New Zealand")],["NIC",t("Nicaragua")],["NER",t("Niger")],["NGA",t("Nigeria")],["NIU",t("Niue")],["NFK",t("Norfolk Island")],["MNP",t("Northern Mariana Islands")],["NOR",t("Norway")],["OMN",t("Oman")],["PAK",t("Pakistan")],["PLW",t("Palau")],["PSE",t("Palestinian Territory, Occupied")],["PAN",t("Panama")],["PNG",t("Papua New Guinea")],["PRY",t("Paraguay")],["PER",t("Peru")],["PHL",t("Philippines")],["PCN",t("Pitcairn")],["POL",t("Poland")],["PRT",t("Portugal")],["PRI",t("Puerto Rico")],["QAT",t("Qatar")],["REU",t("Réunion")],["ROU",t("Romania")],["RUS",t("Russian Federation")],["RWA",t("Rwanda")],["BLM",t("Saint Barthélemy")],["SHN",t("Saint Helena, Ascension and Tristan da Cunha")],["KNA",t("Saint Kitts and Nevis")],["LCA",t("Saint Lucia")],["MAF",t("Saint Martin (French part)")],["SPM",t("Saint Pierre and Miquelon")],["VCT",t("Saint Vincent and the Grenadines")],["WSM",t("Samoa")],["SMR",t("San Marino")],["STP",t("Sao Tome and Principe")],["SAU",t("Saudi Arabia")],["SEN",t("Senegal")],["SRB",t("Serbia")],["SYC",t("Seychelles")],["SLE",t("Sierra Leone")],["SGP",t("Singapore")],["SXM",t("Sint Maarten (Dutch part)")],["SVK",t("Slovakia")],["SVN",t("Slovenia")],["SLB",t("Solomon Islands")],["SOM",t("Somalia")],["ZAF",t("South Africa")],["SGS",t("South Georgia and the South Sandwich Islands")],["SSD",t("South Sudan")],["ESP",t("Spain")],["LKA",t("Sri Lanka")],["SDN",t("Sudan")],["SUR",t("Suriname")],["SJM",t("Svalbard and Jan Mayen")],["SWZ",t("Swaziland")],["SWE",t("Sweden")],["CHE",t("Switzerland")],["SYR",t("Syrian Arab Republic")],["TWN",t("Taiwan, Province of China")],["TJK",t("Tajikistan")],["TZA",t("Tanzania, United Republic of")],["THA",t("Thailand")],["TLS",t("Timor-Leste")],["TGO",t("Togo")],["TKL",t("Tokelau")],["TON",t("Tonga")],["TTO",t("Trinidad and Tobago")],["TUN",t("Tunisia")],["TUR",t("Turkey")],["TKM",t("Turkmenistan")],["TCA",t("Turks and Caicos Islands")],["TUV",t("Tuvalu")],["UGA",t("Uganda")],["UKR",t("Ukraine")],["ARE",t("United Arab Emirates")],["GBR",t("United Kingdom")],["USA",t("United States")],["UMI",t("United States Minor Outlying Islands")],["URY",t("Uruguay")],["UZB",t("Uzbekistan")],["VUT",t("Vanuatu")],["VEN",t("Venezuela, Bolivarian Republic of")],["VNM",t("Viet Nam")],["VGB",t("Virgin Islands, British")],["VIR",t("Virgin Islands, U.S.")],["WLF",t("Wallis and Futuna")],["ESH",t("Western Sahara")],["YEM",t("Yemen")],["ZMB",t("Zambia")],["ZWE",t("Zimbabwe")]]},0,["countryisocombo"],["component","box","field","textfield","pickerfield","combobox","combo","countryisocombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,countryisocombo:true},["widget.countryisocombo"],0,[MBilling.view.general,"CountryISOCombo"],0));(Ext.cmd.derive("MBilling.view.general.CountryCombo",Ext.form.field.ComboBox,{fieldLabel:t("Country"),forceSelection:true,editable:true,allowBlank:true,listeners:{focus:function(b){b.expand()}},store:[["",t("Select")],["93",t("Afghanistan")],["355",t("Albania")],["213",t("Algeria")],["684",t("American Samoa")],["376",t("Andorra")],["244",t("Angola")],["1264",t("Anguilla")],["672",t("Antarctica")],["1268",t("Antigua And Barbuda")],["54",t("Argentina")],["374",t("Armenia")],["297",t("Aruba")],["61",t("Australia")],["43",t("Austria")],["994",t("Azerbaijan")],["1242",t("Bahamas")],["973",t("Bahrain")],["880",t("Bangladesh")],["1246",t("Barbados")],["375",t("Belarus")],["32",t("Belgium")],["501",t("Belize")],["229",t("Benin")],["1441",t("Bermuda")],["975",t("Bhutan")],["591",t("Bolivia")],["387",t("Bosnia And Herzegovina")],["267",t("Botswana")],["55",t("Brazil")],["1284",t("British Indian Ocean Territory")],["673",t("Brunei Darussalam")],["359",t("Bulgaria")],["226",t("Burkina Faso")],["257",t("Burundi")],["855",t("Cambodia")],["237",t("Cameroon")],["238",t("Cape Verde")],["1345",t("Cayman Islands")],["236",t("Central African Republic")],["235",t("Chad")],["56",t("Chile")],["86",t("China")],["618",t("Christmas Island")],["61",t("Cocos (Keeling); Islands")],["57",t("Colombia")],["269",t("Comoros")],["242",t("Congo")],["243",t("Congo, The Democratic Republic Of The")],["682",t("Cook Islands")],["506",t("Costa Rica")],["385",t("Croatia")],["53",t("Cuba")],["357",t("Cyprus")],["420",t("Czech Republic")],["45",t("Denmark")],["253",t("Djibouti")],["1767",t("Dominica")],["1809",t("Dominican Republic")],["593",t("Ecuador")],["20",t("Egypt")],["503",t("El Salvador")],["240",t("Equatorial Guinea")],["291",t("Eritrea")],["372",t("Estonia")],["251",t("Ethiopia")],["500",t("Falkland Islands (Malvinas)")],["298",t("Faroe Islands")],["679",t("Fiji")],["358",t("Finland")],["33",t("France")],["596",t("French Guiana")],["594",t("French Polynesia")],["689",t("French Southern Territories")],["241",t("Gabon")],["220",t("Gambia")],["995",t("Georgia")],["49",t("Germany")],["233",t("Ghana")],["350",t("Gibraltar")],["30",t("Greece")],["299",t("Greenland")],["1473",t("Grenada")],["590",t("Guadeloupe")],["1671",t("Guam")],["502",t("Guatemala")],["224",t("Guinea")],["245",t("Guinea-Bissau")],["592",t("Guyana")],["509",t("Haiti")],["504",t("Honduras")],["852",t("Hong Kong")],["36",t("Hungary")],["354",t("Iceland")],["91",t("India")],["62",t("Indonesia")],["98",t("Iran, Islamic Republic Of")],["964",t("Iraq")],["353",t("Ireland")],["972",t("Israel")],["39",t("Italy")],["1876",t("Jamaica")],["81",t("Japan")],["962",t("Jordan")],["7",t("Kazakhstan")],["254",t("Kenya")],["686",t("Kiribati")],["850",t("Korea, Democratic Peoples Republic Of")],["82",t("Korea, Republic of")],["965",t("Kuwait")],["996",t("Kyrgyzstan")],["856",t("Lao Peoples Democratic Republic")],["371",t("Latvia")],["961",t("Lebanon")],["266",t("Lesotho")],["231",t("Liberia")],["218",t("Libyan Arab Jamahiriya")],["423",t("Liechtenstein")],["370",t("Lithuania")],["352",t("Luxembourg")],["853",t("Macao")],["389",t("Macedonia, The Former Yugoslav Republic Of")],["261",t("Madagascar")],["265",t("Malawi")],["60",t("Malaysia")],["960",t("Maldives")],["223",t("Mali")],["356",t("Malta")],["692",t("Marshall islands")],["596",t("Martinique")],["222",t("Mauritania")],["230",t("Mauritius")],["269",t("Mayotte")],["52",t("Mexico")],["691",t("Micronesia, Federated States Of")],["1808",t("Moldova, Republic Of")],["377",t("Monaco")],["976",t("Mongolia")],["1664",t("Montserrat")],["212",t("Morocco")],["258",t("Mozambique")],["95",t("Myanmar")],["264",t("Namibia")],["674",t("Nauru")],["977",t("Nepal")],["31",t("Netherlands")],["599",t("Netherlands Antilles")],["687",t("New Caledonia")],["64",t("New Zealand")],["505",t("Nicaragua")],["227",t("Niger")],["234",t("Nigeria")],["683",t("Niue")],["672",t("Norfolk Island")],["1670",t("Northern Mariana Islands")],["47",t("Norway")],["968",t("Oman")],["92",t("Pakistan")],["680",t("Palau")],["970",t("Palestinian Territory, Occupied")],["507",t("Panama")],["675",t("Papua New Guinea")],["595",t("Paraguay")],["51",t("Peru")],["63",t("Philippines")],["48",t("Poland")],["351",t("Portugal")],["1787",t("Puerto Rico")],["974",t("Qatar")],["262",t("Reunion")],["40",t("Romania")],["7",t("Russian Federation")],["250",t("Rwanda")],["290",t("SaINT Helena")],["1869",t("SaINT Kitts And Nevis")],["1758",t("SaINT Lucia")],["508",t("SaINT Pierre And Miquelon")],["1784",t("SaINT Vincent And The Grenadines")],["685",t("Samoa")],["378",t("San Marino")],["239",t("São Tomé And Principe")],["966",t("Saudi Arabia")],["221",t("Senegal")],["248",t("Seychelles")],["232",t("Sierra Leone")],["65",t("Singapore")],["421",t("Slovakia")],["386",t("Slovenia")],["677",t("Solomon Islands")],["252",t("Somalia")],["27",t("South Africa")],["34",t("Spain")],["94",t("Sri Lanka")],["249",t("Sudan")],["597",t("Suriname")],["268",t("Swaziland")],["46",t("Sweden")],["41",t("Switzerland")],["963",t("Syrian Arab Republic")],["886",t("Taiwan, Province Of China")],["992",t("Tajikistan")],["255",t("Tanzania, United Republic Of")],["66",t("Thailand")],["670",t("Timor-Leste")],["228",t("Togo")],["690",t("Tokelau")],["676",t("Tonga")],["1868",t("Trinidad And Tobago")],["216",t("Tunisia")],["90",t("Turkey")],["993",t("Turkmenistan")],["1649",t("Turks And Caicos Islands")],["688",t("Tuvalu")],["256",t("Uganda")],["380",t("Ukraine")],["971",t("United Arab Emirates")],["44",t("United Kingdom")],["1",t("United States/Canada")],["598",t("Uruguay")],["998",t("Uzbekistan")],["678",t("Vanuatu")],["58",t("Venezuela")],["84",t("Vietnam")],["1284",t("Virgin Islands, British")],["808",t("Virgin Islands, U.S.")],["681",t("Wallis And Futuna")],["967",t("Yemen")],["260",t("Zambia")],["263",t("Zimbabwe")],["35818",t("Aland Islands")],["441481",t("Guernsey")],["441624",t("Isle of Man")],["441534",t("Jersey")],["382",t("Montenegro, Republic of")],["381",t("Serbia, Republic of")]]},0,["countrycombo"],["component","box","field","textfield","pickerfield","combobox","combo","countrycombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,countrycombo:true},["widget.countrycombo"],0,[MBilling.view.general,"CountryCombo"],0));(Ext.cmd.derive("MBilling.view.general.GroupCombo",Ext.form.field.ComboBox,{fieldLabel:t("group"),value:"config_group_title",forceSelection:true,editable:false,store:[["global","global"],["callback","callback"],["agi-conf1","agi-conf1"],["agi-conf2","agi-conf2"]]},0,["groupcombo"],["component","box","field","textfield","pickerfield","combobox","combo","groupcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,groupcombo:true},["widget.groupcombo"],0,[MBilling.view.general,"GroupCombo"],0));(Ext.cmd.derive("MBilling.view.general.LcrtypeCombo",Ext.form.field.ComboBox,{fieldLabel:t("lcrtype"),forceSelection:true,editable:false,value:1,store:[[1,t("LCRAccordingtothebuyerPrice")],[0,t("LCRAccordingtothesellerPrice")]]},0,["lcrtypecombo"],["component","box","field","textfield","pickerfield","combobox","combo","lcrtypecombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,lcrtypecombo:true},["widget.lcrtypecombo"],0,[MBilling.view.general,"LcrtypeCombo"],0));(Ext.cmd.derive("MBilling.view.general.LcrtypeFullCombo",Ext.form.field.ComboBox,{forceSelection:true,editable:false,fieldLabel:t("lcrtype"),value:1,store:[[1,t("LCRAccordingtothebuyerPrice")],[0,t("LCRAccordingtothesellerPrice")],[2,t("Load Balancer")]]},0,["lcrtypefullcombo"],["component","box","field","textfield","pickerfield","combobox","combo","lcrtypefullcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,lcrtypefullcombo:true},["widget.lcrtypefullcombo"],0,[MBilling.view.general,"LcrtypeFullCombo"],0));(Ext.cmd.derive("MBilling.view.general.OfferTypeCombo",Ext.form.field.ComboBox,{fieldLabel:t("offertype"),forceSelection:true,editable:false,value:0,store:[[0,t("unlimitedcalls")],[1,t("numberfreecalls")],[2,t("freeseconds")]]},0,["offertypecombo"],["component","box","field","textfield","pickerfield","combobox","combo","offertypecombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,offertypecombo:true},["widget.offertypecombo"],0,[MBilling.view.general,"OfferTypeCombo"],0));(Ext.cmd.derive("MBilling.view.general.BillingTypeCombo",Ext.form.field.ComboBox,{fieldLabel:t("billingtype"),forceSelection:true,editable:false,value:0,store:[[0,t("monthly")],[1,t("weekly")]]},0,["billingtypecombo"],["component","box","field","textfield","pickerfield","combobox","combo","billingtypecombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,billingtypecombo:true},["widget.billingtypecombo"],0,[MBilling.view.general,"BillingTypeCombo"],0));(Ext.cmd.derive("MBilling.view.general.SipCombo",Ext.form.field.ComboBox,{fieldLabel:t("providertech"),forceSelection:true,editable:false,value:"sip",store:[["sip","sip"],["dahdi","dahdi"],["khomp","khomp"],["iax2","iax2"],["dgv","dgv"],["ooh323","ooh323"],["extra","extra"],["Dongle","Dongle"],["Local","Local"]]},0,["sipcombo"],["component","box","field","textfield","pickerfield","combobox","combo","sipcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,sipcombo:true},["widget.sipcombo"],0,[MBilling.view.general,"SipCombo"],0));(Ext.cmd.derive("MBilling.view.general.TypePaymentCombo",Ext.form.field.ComboBox,{fieldLabel:t("typepaid"),forceSelection:true,editable:false,value:0,store:[[0,t("prepaid")],[1,t("pospaid")]]},0,["typepaymentcombo"],["component","box","field","textfield","pickerfield","combobox","combo","typepaymentcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,typepaymentcombo:true},["widget.typepaymentcombo"],0,[MBilling.view.general,"TypePaymentCombo"],0));(Ext.cmd.derive("MBilling.view.general.CampaignSendCombo",Ext.form.field.ComboBox,{fieldLabel:t("type"),forceSelection:true,editable:false,displayField:"name",valueField:"id",value:"CALL1",store:{fields:["id","name"],data:[{id:"CALL1",name:t("Select type"),showFields:["type"]},{id:"SMS",name:"SMS",showFields:["type","sms_text","csv_path","numbers","startingdate","startingtime"]},{id:"CALL",name:"CALL",showFields:["type","audio_path","csv_path","numbers","startingdate","startingtime"]}]}},0,["campaignsendcombo"],["component","box","field","textfield","pickerfield","combobox","combo","campaignsendcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,campaignsendcombo:true},["widget.campaignsendcombo"],0,[MBilling.view.general,"CampaignSendCombo"],0));(Ext.cmd.derive("MBilling.view.general.PaymentCountryCombo",Ext.form.field.ComboBox,{fieldLabel:t("typepaid"),value:"Brasil",forceSelection:true,editable:true,listeners:{focus:function(b){b.expand()}},store:[["Argentina","Argentina"],["Brasil","Brasil"],["Colombia","Colombia"],["Latino America","Latino America"],["Global","Global"]]},0,["paymentcountrycombo"],["component","box","field","textfield","pickerfield","combobox","combo","paymentcountrycombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,paymentcountrycombo:true},["widget.paymentcountrycombo"],0,[MBilling.view.general,"PaymentCountryCombo"],0));(Ext.cmd.derive("MBilling.view.general.BoletoBanckCombo",Ext.form.field.ComboBox,{fieldLabel:t("Banco"),forceSelection:true,editable:false,value:"cef",store:[["cef","Caixa Economica SICOB"],["bradesco","Bradesco"]]},0,["boletobanckcombo"],["component","box","field","textfield","pickerfield","combobox","combo","boletobanckcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,boletobanckcombo:true},["widget.boletobanckcombo"],0,[MBilling.view.general,"BoletoBanckCombo"],0));(Ext.cmd.derive("MBilling.view.general.PaymentBanckCombo",Ext.form.field.ComboBox,{fieldLabel:t("typepaid"),forceSelection:true,editable:false,value:"Banco do Brasil",store:[["Banco do Brasil","Banco do Brasil"],["bradesco","Bradesco"],["hsbc","Hsbc"],["itau","Itau"],["santander","Santander"],["unibanco","Unibanco"],["cef","Caixa Economica SICOB"],["cef_sinco","Caixa Economica SINCO"],["cef_sigcb","Caixa Economica SIGCB"]]},0,["paymentbanckcombo"],["component","box","field","textfield","pickerfield","combobox","combo","paymentbanckcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,paymentbanckcombo:true},["widget.paymentbanckcombo"],0,[MBilling.view.general,"PaymentBanckCombo"],0));(Ext.cmd.derive("MBilling.view.templateMail.Controller",Ext.ux.app.ViewController,{onAfterSave:function(d){var c=this;d=d||c.formPanel;if(!d.idRecord){d.getForm().reset();c.focusFirstField()}c.saveButton.enable();c.updateLotButton&&c.updateLotButton.toggle(false);d.setLoading(false);c.store.load()},onEdit:function(){var b=this;b.lookupReference("generalTab").show();Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)}},0,0,0,0,["controller.templatemail"],0,[MBilling.view.templateMail,"Controller"],0));(Ext.cmd.derive("MBilling.view.templateMail.Module",Ext.ux.panel.Module,{controller:"templatemail",cfgEast:{flex:9}},0,["templatemailmodule"],["component","box","container","uxpanelmodule","templatemailmodule"],{component:true,box:true,container:true,uxpanelmodule:true,templatemailmodule:true},["widget.templatemailmodule"],0,[MBilling.view.templateMail,"Module"],0));(Ext.cmd.derive("MBilling.view.templateMail.List",Ext.ux.grid.Panel,{store:"TemplateMail",initComponent:function(){var b=this;b.allowPrint=false;b.buttonCsv=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowDelete=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("type"),dataIndex:"mailtype",flex:3},{header:t("Language"),renderer:Helper.Util.formatLanguageImage,dataIndex:"language",flex:2},{header:t("subject"),dataIndex:"subject",flex:7}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["templatemaillist"],["component","box","container","panel","tablepanel","gridpanel","grid","templatemaillist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,templatemaillist:true},["widget.templatemaillist"],0,[MBilling.view.templateMail,"List"],0));(Ext.cmd.derive("MBilling.view.templateMail.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true}},items:[{title:t("general"),reference:"generalTab",items:[{name:"fromname",fieldLabel:t("fromname")},{name:"fromemail",fieldLabel:t("fromemail")},{name:"subject",fieldLabel:t("subject")}]},{title:t("Email body"),items:[{hideLabel:true,xtype:"htmleditor",name:"messagehtml",fieldLabel:t("description"),height:1000,anchor:"100%"}]},{title:t("Variables"),items:[{xtype:"displayfield",fieldLabel:t("username"),value:'$login$',allowBlank:true},{xtype:"displayfield",fieldLabel:t("password"),value:'$password$',allowBlank:true},{xtype:"displayfield",fieldLabel:t("email"),value:'$email$',allowBlank:true},{xtype:"displayfield",fieldLabel:t("firstname"),value:'$firstname$',allowBlank:true},{xtype:"displayfield",fieldLabel:t("lastname"),value:'$lastname$',allowBlank:true},{xtype:"displayfield",fieldLabel:t("credit"),value:'$credit$',allowBlank:true},{xtype:"displayfield",fieldLabel:t("date"),value:'$time$',allowBlank:true},{xtype:"displayfield",fieldLabel:t("description"),value:'$description$',allowBlank:true},{xtype:"displayfield",fieldLabel:t("Url to cancel email credit notification"),value:'$cancel_credit_notification_email$',allowBlank:true}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["templatemailform"],["component","box","container","panel","form","templatemailform"],{component:true,box:true,container:true,panel:true,form:true,templatemailform:true},["widget.templatemailform"],0,[MBilling.view.templateMail,"Form"],0));(Ext.cmd.derive("MBilling.view.logUsers.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.logusers"],0,[MBilling.view.logUsers,"Controller"],0));(Ext.cmd.derive("MBilling.view.logUsers.Module",Ext.ux.panel.Module,{controller:"logusers"},0,["logusersmodule"],["component","box","container","uxpanelmodule","logusersmodule"],{component:true,box:true,container:true,uxpanelmodule:true,logusersmodule:true},["widget.logusersmodule"],0,[MBilling.view.logUsers,"Module"],0));(Ext.cmd.derive("MBilling.view.logUsers.List",Ext.ux.grid.Panel,{store:"LogUsers",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.allowDelete=false;b.allowCreate=false;b.allowUpdate=false;b.columns=[{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isOperator,hideable:!App.user.isOperator},{header:t("action"),dataIndex:"idLogActionsname",renderer:Helper.Util.translate,flex:3},{header:t("description"),dataIndex:"description",flex:7},{header:t("IP"),dataIndex:"ip",flex:4},{header:t("date"),renderer:Helper.Util.formatDateTime,dataIndex:"date",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["loguserslist"],["component","box","container","panel","tablepanel","gridpanel","grid","loguserslist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,loguserslist:true},["widget.loguserslist"],0,[MBilling.view.logUsers,"List"],0));(Ext.cmd.derive("MBilling.view.logUsers.Form",Ext.ux.form.Panel,{fieldsHideEdit:["cid"],initComponent:function(){var b=this;b.items=[{xtype:"usercombo",allowBlank:true,readOnly:true},{name:"id_log_actions",fieldLabel:t("action"),readOnly:true},{name:"ip",fieldLabel:t("ip"),readOnly:true},{xtype:"textareafield",name:"description",fieldLabel:t("description"),height:400,anchor:"100%",allowBlank:true,readOnly:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["logusersform"],["component","box","container","panel","form","logusersform"],{component:true,box:true,container:true,panel:true,form:true,logusersform:true},["widget.logusersform"],0,[MBilling.view.logUsers,"Form"],0));(Ext.cmd.derive("MBilling.view.provider.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.provider"],0,[MBilling.view.provider,"Controller"],0));(Ext.cmd.derive("MBilling.view.provider.Combo",Ext.form.field.ComboBox,{name:"id_provider",fieldLabel:t("provider"),forceSelection:true,editable:false,displayField:"provider_name",valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Provider",{proxy:{type:"uxproxy",module:"provider",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["providercombo"],["component","box","field","textfield","pickerfield","combobox","combo","providercombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,providercombo:true},["widget.providercombo"],0,[MBilling.view.provider,"Combo"],0));(Ext.cmd.derive("MBilling.view.provider.Module",Ext.ux.panel.Module,{controller:"provider"},0,["providermodule"],["component","box","container","uxpanelmodule","providermodule"],{component:true,box:true,container:true,uxpanelmodule:true,providermodule:true},["widget.providermodule"],0,[MBilling.view.provider,"Module"],0));(Ext.cmd.derive("MBilling.view.provider.List",Ext.ux.grid.Panel,{store:"Provider",initComponent:function(){var b=this;b.columns=b.columns||[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("name"),dataIndex:"provider_name"},{header:t("description"),dataIndex:"description"},{header:t("credit"),dataIndex:"credit",renderer:Helper.Util.formatMoneyDecimal},{header:t("creationdate"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"creationdate"}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["providerlist"],["component","box","container","panel","tablepanel","gridpanel","grid","providerlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,providerlist:true},["widget.providerlist"],0,[MBilling.view.provider,"List"],0));(Ext.cmd.derive("MBilling.view.provider.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["provider_name"],initComponent:function(){var b=this;b.items=[{name:"provider_name",fieldLabel:t("name")},{xtype:"moneyfield",name:"credit",mask:App.user.currency+" #9.999.990,00",fieldLabel:t("credit"),value:"0"},{xtype:"noyescombo",name:"credit_control",fieldLabel:t("Credit")+" "+t("control"),hidden:App.user.isClient},{xtype:"textareafield",name:"description",fieldLabel:t("description"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["providerform"],["component","box","container","panel","form","providerform"],{component:true,box:true,container:true,panel:true,form:true,providerform:true},["widget.providerform"],0,[MBilling.view.provider,"Form"],0));(Ext.cmd.derive("MBilling.view.provider.Lookup",Ext.ux.form.field.Lookup,{name:"id_provider",fieldLabel:t("Provider"),displayField:"idProviderprovider_name",displayFieldList:"provider_name",gridConfig:{xtype:"providerlist",fieldSearch:"username",columns:[{header:t("name"),dataIndex:"provider_name"},{header:t("description"),dataIndex:"description"}]}},0,["providerlookup"],["component","box","container","fieldcontainer","providerlookup"],{component:true,box:true,container:true,fieldcontainer:true,providerlookup:true},["widget.providerlookup"],0,[MBilling.view.provider,"Lookup"],0));(Ext.cmd.derive("MBilling.view.plan.Controller",Ext.ux.app.ViewController,{init:function(){var b=this;b.control({noyescombo:{select:b.onSelectType}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectType:function(c,d){this.showFieldsRelated(d.getData().showFields)},showFieldsRelated:function(j){var l=this,g=l.formPanel.getForm().getFields(),f=l.formPanel.getForm().findField("ini_credit"),m=l.formPanel.getForm();g.each(function(a){if(a.name=="signup"){a.value==1?f.show():f.hide()}})},onEdit:function(){var f=this,d=f.formPanel.getForm().findField("ini_credit"),e=f.formPanel.getForm().findField("signup");Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments);e.value==1?d.show():d.hide()}},0,0,0,0,["controller.plan"],0,[MBilling.view.plan,"Controller"],0));(Ext.cmd.derive("MBilling.view.plan.Combo",Ext.form.field.ComboBox,{name:"id_plan",fieldLabel:t("plan"),displayField:"name",valueField:"id",forceSelection:true,editable:true,listeners:{focus:function(b){b.expand()}},initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Plan",{proxy:{type:"uxproxy",module:"plan",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["plancombo"],["component","box","field","textfield","pickerfield","combobox","combo","plancombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,plancombo:true},["widget.plancombo"],0,[MBilling.view.plan,"Combo"],0));(Ext.cmd.derive("MBilling.view.plan.Module",Ext.ux.panel.Module,{controller:"plan"},0,["planmodule"],["component","box","container","uxpanelmodule","planmodule"],{component:true,box:true,container:true,uxpanelmodule:true,planmodule:true},["widget.planmodule"],0,[MBilling.view.plan,"Module"],0));(Ext.cmd.derive("MBilling.view.plan.List",Ext.ux.grid.Panel,{store:"Plan",fieldSearch:"name",initComponent:function(){var b=this;b.columns=b.columns||[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("name"),dataIndex:"name",flex:4},{header:t("lcrtype"),dataIndex:"lcrtype",comboRelated:"lcrtypecombo",renderer:Helper.Util.formatLcrtype,flex:4,filter:{type:"list",options:[[1,t("LCRAccordingtothebuyerPrice")],[0,t("LCRAccordingtothesellerPrice")],[2,t("Load Balancer")]]}},{header:t("Tech Prefx"),dataIndex:"techprefix",flex:4,hidden:!App.user.isAdmin},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"creationdate",flex:4},{header:t("Port. Celular"),dataIndex:"portabilidadeMobile",flex:2,renderer:Helper.Util.formattyyesno,filter:{type:"list",options:[[0,t("no")],[1,t("yes")]]},hidden:App.user.language!="pt_BR",hideable:false},{header:t("Port. Fixo"),dataIndex:"portabilidadeFixed",flex:2,renderer:Helper.Util.formattyyesno,filter:{type:"list",options:[[0,t("no")],[1,t("yes")]]},hidden:App.user.language!="pt_BR",hideable:false}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["planlist"],["component","box","container","panel","tablepanel","gridpanel","grid","planlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,planlist:true},["widget.planlist"],0,[MBilling.view.plan,"List"],0));(Ext.cmd.derive("MBilling.view.plan.Form",Ext.ux.form.Panel,{labelWidthFields:115,fieldsHideUpdateLot:["name"],initComponent:function(){var b=this;b.defaults={labelWidth:142};b.items=[{name:"name",fieldLabel:t("name"),maxLength:100},{xtype:"lcrtypefullcombo",name:"lcrtype",fieldLabel:t("lcrtype"),allowBlank:true},{xtype:"numberfield",name:"tariff_limit",minValue:1,value:1,fieldLabel:t("Tariff Find Limit"),hidden:!App.user.isAdmin},{xtype:"noyescombo",name:"signup",fieldLabel:t("useInSignup"),allowBlank:true},{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,00",name:"ini_credit",fieldLabel:t("Initial Credit to new users"),allowBlank:true,hidden:true,value:0},{xtype:"yesnocombo",name:"play_audio",fieldLabel:t("Notices with audio"),allowBlank:true,hidden:App.user.isClient},{style:"margin-top:25px",xtype:"fieldset",title:t("Ativar portabilidade?"),collapsible:true,collapsed:false,hidden:App.user.language!="pt_BR",defaults:{labelWidth:190,anchor:"100%",layout:{type:"hbox",labelAlign:b.labelAlignFields}},items:[{xtype:"noyescombo",name:"portabilidadeMobile",fieldLabel:t("Para Celular"),allowBlank:true,hidden:App.user.language!="pt_BR"},{xtype:"noyescombo",name:"portabilidadeFixed",fieldLabel:t("Para Fixo"),allowBlank:true,hidden:App.user.language!="pt_BR"}]},{name:"techprefix",fieldLabel:t("Tech Prefix"),allowBlank:true,maxLength:5,minLength:5,hidden:!App.user.isAdmin},{style:"margin-top:25px",xtype:"fieldset",title:t("Select one or more Services"),collapsible:true,collapsed:false,items:[{anchor:"100%",fieldLabel:"",xtype:"servicestag",allowBlank:true}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["planform"],["component","box","container","panel","form","planform"],{component:true,box:true,container:true,panel:true,form:true,planform:true},["widget.planform"],0,[MBilling.view.plan,"Form"],0));(Ext.cmd.derive("MBilling.view.plan.Tag",Ext.form.field.Tag,{name:"id_plan",fieldLabel:t("plan"),displayField:"name",valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Plan",{proxy:{type:"uxproxy",module:"plan",limitParam:undefined}});Ext.form.field.Tag.prototype.initComponent.apply(this,arguments)}},0,["plantag"],["component","box","field","textfield","pickerfield","combobox","combo","tagfield","plantag"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,tagfield:true,plantag:true},["widget.plantag"],0,[MBilling.view.plan,"Tag"],0));(Ext.cmd.derive("MBilling.view.plan.Lookup",Ext.ux.form.field.Lookup,{name:"id_plan",fieldLabel:t("Plan"),displayField:"idPlanname",displayFieldList:"name",gridConfig:{xtype:"planlist",fieldSearch:"name",columns:[{header:t("name"),dataIndex:"name",flex:2}]}},0,["planlookup"],["component","box","container","fieldcontainer","planlookup"],{component:true,box:true,container:true,fieldcontainer:true,planlookup:true},["widget.planlookup"],0,[MBilling.view.plan,"Lookup"],0));(Ext.cmd.derive("MBilling.view.trunk.Controller",Ext.ux.app.ViewController,{onEdit:function(){var f=this,e=f.list.getSelectionModel().getSelection()[0],d=f.formPanel.getForm().findField("register");if(e.get("register")==1){if(e.get("register")&&e.get("providertech")=="sip"){color=e.get("registered")==1?"green":"red";d.setFieldLabel(t("registertrunk")+' ')}else{d.setFieldLabel(t("registertrunk"))}f.formPanel.getForm().findField("register_string")["show"]()}else{d.setFieldLabel(t("registertrunk"));f.formPanel.getForm().findField("register_string")["hide"]()}Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments);valueAllow=f.formPanel.idRecord?e.get("allow").split(","):["g729","gsm","alaw","ulaw"];fieldAllow=f.formPanel.down("checkboxgroup");fieldAllow.setValue({allow:valueAllow})},init:function(){var b=this;b.control({"noyescombo[name=register]":{select:b.onSelectType}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectType:function(c,d){this.showFieldsRelated(d.getData().showFields)},showFieldsRelated:function(o){var p=this,m=p.formPanel.getForm().findField("register_string"),n=p.formPanel.getForm().findField("user"),q=p.formPanel.getForm().findField("secret"),j=p.formPanel.getForm().findField("host"),l=p.formPanel.getForm().getFields();l.each(function(a){if(a.name=="register"){m.setVisible(a.value==1);m.setValue(n.value+":"+q.value+"@"+j.value+"/"+n.value)}})}},0,0,0,0,["controller.trunk"],0,[MBilling.view.trunk,"Controller"],0));(Ext.cmd.derive("MBilling.view.trunk.Combo",Ext.form.field.ComboBox,{name:"id_trunk",fieldLabel:t("trunk"),forceSelection:true,editable:true,listeners:{focus:function(b){b.expand()}},displayField:"trunkcode",valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Trunk",{proxy:{type:"uxproxy",module:"trunk",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["trunkcombo"],["component","box","field","textfield","pickerfield","combobox","combo","trunkcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,trunkcombo:true},["widget.trunkcombo"],0,[MBilling.view.trunk,"Combo"],0));(Ext.cmd.derive("MBilling.view.trunk.ComboBackup",Ext.form.field.ComboBox,{name:"failover_trunk",fieldLabel:t("failover_trunk"),displayField:"trunkcode",valueField:"id",value:0,limitParam:undefined,forceSelection:true,editable:true,extraValues:[{id:0,trunkcode:t("undefined")}],listeners:{focus:function(b){b.expand()}},initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Trunk",{proxy:{type:"uxproxy",module:"trunk",limitParam:undefined}});b.on("render",b.loadStore,b);Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)},loadStore:function(g){var j=this,e=g.store,f;e.load({callback:function(){if(j.extraValues.length){e.insert(0,j.extraValues)}}})}},0,["trunkcombobackup"],["component","box","field","textfield","pickerfield","combobox","combo","trunkcombobackup"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,trunkcombobackup:true},["widget.trunkcombobackup"],0,[MBilling.view.trunk,"ComboBackup"],0));(Ext.cmd.derive("MBilling.view.trunk.Module",Ext.ux.panel.Module,{controller:"trunk"},0,["trunkmodule"],["component","box","container","uxpanelmodule","trunkmodule"],{component:true,box:true,container:true,uxpanelmodule:true,trunkmodule:true},["widget.trunkmodule"],0,[MBilling.view.trunk,"Module"],0));(Ext.cmd.derive("MBilling.view.trunk.List",Ext.ux.grid.Panel,{store:"Trunk",fieldSearch:"trunkcode",initComponent:function(){var b=this;b.columns=b.columns||[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("trunkcode"),dataIndex:"trunkcode",flex:3},{header:t("add")+" "+t("prefix"),dataIndex:"trunkprefix",flex:2},{header:t("remove")+" "+t("prefix"),dataIndex:"removeprefix",flex:2},{header:t("host"),dataIndex:"host",flex:2},{xtype:"templatecolumn",tpl:"{idProviderprovider_name}",header:t("provider"),dataIndex:"id_provider",comboFilter:"providercombo",flex:2},{header:t("secondusedreal"),renderer:Helper.Util.formatsecondsToTime,dataIndex:"secondusedreal",flex:3},{header:t("status"),dataIndex:"status",renderer:Helper.Util.formatBooleanActive,comboFilter:"booleancombo",flex:1,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")]]}},{header:t("creationdate"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"creationdate",flex:3}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["trunklist"],["component","box","container","panel","tablepanel","gridpanel","grid","trunklist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,trunklist:true},["widget.trunklist"],0,[MBilling.view.trunk,"List"],0));(Ext.cmd.derive("MBilling.view.trunk.Form",Ext.ux.form.Panel,{autoHeight:300,bodyPadding:0,fieldsHideUpdateLot:["trunkcode"],initComponent:function(){var b=this;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{labelAlign:"right",plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true,labelWidth:142}},items:[{title:t("general"),items:[{xtype:"providerlookup",ownerForm:b},{name:"trunkcode",fieldLabel:t("trunkcode")},{name:"user",fieldLabel:t("user"),allowBlank:true},{name:"secret",fieldLabel:t("password"),allowBlank:true},{name:"host",fieldLabel:t("host")},{name:"trunkprefix",fieldLabel:t("add")+" "+t("prefix"),allowBlank:true},{name:"removeprefix",fieldLabel:t("remove")+" "+t("prefix"),allowBlank:true},{xtype:"checkboxgroup",columns:3,name:"allow",fieldLabel:t("codec"),items:[{boxLabel:"g729",name:"allow",inputValue:"g729",checked:true},{boxLabel:"g723",name:"allow",inputValue:"g723"},{boxLabel:"gsm",name:"allow",inputValue:"gsm",checked:true},{boxLabel:"g726",name:"allow",inputValue:"g726"},{boxLabel:"opus",name:"allow",inputValue:"opus",checked:true},{boxLabel:"alaw",name:"allow",inputValue:"alaw",checked:true},{boxLabel:"ulaw",name:"allow",inputValue:"ulaw",checked:true},{boxLabel:"g722",name:"allow",inputValue:"g722"},{boxLabel:"ilbc",name:"allow",inputValue:"ilbc"},{boxLabel:"speex",name:"allow",inputValue:"speex"},{boxLabel:"h261",name:"allow",inputValue:"h261"},{boxLabel:"h263",name:"allow",inputValue:"h263"}],allowBlank:true},{xtype:"sipcombo",name:"providertech",fieldLabel:t("providertech")},{xtype:"trunkcombobackup",allowBlank:true},{xtype:"booleancombo",name:"status",fieldLabel:t("status")},{xtype:"noyescombo",name:"allow_error",fieldLabel:t("allow_error")},{xtype:"noyescombo",name:"register",fieldLabel:t("registertrunk")},{name:"register_string",fieldLabel:t("Register String"),allowBlank:true,hidden:true}]},{title:t("suplementaryInfo"),defaults:{labelAlign:"right",plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true,labelWidth:142},items:[{name:"fromuser",fieldLabel:"fromuser",allowBlank:true},{name:"fromdomain",fieldLabel:"Fromdomain",allowBlank:true},{name:"language",fieldLabel:t("language"),allowBlank:true},{name:"context",fieldLabel:t("context"),allowBlank:true,value:"billing"},{name:"dtmfmode",fieldLabel:"dtmfmode",allowBlank:true,value:"RFC2833"},{name:"insecure",fieldLabel:"insecure",allowBlank:true,value:"port,invite"},{xtype:"numberfield",name:"maxuse",fieldLabel:t("maxuse"),allowBlank:true,value:-1,minValue:-1},{name:"nat",fieldLabel:"nat",value:App.user.asteriskVersion=="1.8"?"yes":"force_rport,comedia",allowBlank:true},{name:"directmedia",allowBlank:true,value:"no",fieldLabel:"directmedia"},{name:"qualify",fieldLabel:"qualify",allowBlank:true,value:"yes"},{name:"type",fieldLabel:"type",allowBlank:true,value:"peer"},{name:"disallow",fieldLabel:"disallow",allowBlank:true,value:"all"},{name:"sendrpid",fieldLabel:"sendrpid",allowBlank:true,value:"no"},{name:"addparameter",fieldLabel:t("addparameter"),allowBlank:true,emptyText:t("parameterdial")},{xtype:"textarea",name:"link_sms",fieldLabel:t("link_sms"),allowBlank:true,emptyText:t("linksmsobs"),height:100,anchor:"100%"},{name:"sms_res",fieldLabel:t("sms_res"),allowBlank:true},{xtype:"numberfield",name:"port",fieldLabel:t("Port"),value:"5060",readOnly:!App.user.isAdmin,hidden:App.user.isClient,allowBlank:App.user.isClient},{xtype:"combobox",name:"encryption",value:"no",store:[["no","No"],["yes","yes"]],fieldLabel:t("Encryption"),allowBlank:true,hidden:!App.user.isAdmin},{xtype:"combobox",forceSelection:true,editable:false,value:"no",store:[["tls","tls"],["no","disable"]],name:"transport",fieldLabel:t("Transport"),allowBlank:true,hidden:!App.user.isAdmin}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["trunkform"],["component","box","container","panel","form","trunkform"],{component:true,box:true,container:true,panel:true,form:true,trunkform:true},["widget.trunkform"],0,[MBilling.view.trunk,"Form"],0));(Ext.cmd.derive("MBilling.view.trunk.Lookup",Ext.ux.form.field.Lookup,{name:"id_trunk",fieldLabel:t("Trunk"),displayField:"idTrunktrunkcode",displayFieldList:"trunkcode",gridConfig:{xtype:"trunklist",fieldSearch:"trunkcode",columns:[{header:t("trunkcode"),dataIndex:"trunkcode"}]}},0,["trunklookup"],["component","box","container","fieldcontainer","trunklookup"],{component:true,box:true,container:true,fieldcontainer:true,trunklookup:true},["widget.trunklookup"],0,[MBilling.view.trunk,"Lookup"],0));(Ext.cmd.derive("MBilling.view.prefix.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.prefix"],0,[MBilling.view.prefix,"Controller"],0));(Ext.cmd.derive("MBilling.view.prefix.Combo",Ext.form.field.ComboBox,{name:"id_prefix",fieldLabel:t("destination"),displayField:"prefix",filterMode:"remote",valueField:"id",listConfig:{itemTpl:Ext.create("Ext.XTemplate","
{prefix} - {destination}
")},displayTpl:Ext.create("Ext.XTemplate",'{prefix} - {destination}'),initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.PrefixCombo",{proxy:{type:"uxproxy",module:"prefixCombo",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["prefixcombo"],["component","box","field","textfield","pickerfield","combobox","combo","prefixcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,prefixcombo:true},["widget.prefixcombo"],0,[MBilling.view.prefix,"Combo"],0));(Ext.cmd.derive("MBilling.view.prefix.Module",Ext.ux.panel.Module,{controller:"prefix"},0,["prefixmodule"],["component","box","container","uxpanelmodule","prefixmodule"],{component:true,box:true,container:true,uxpanelmodule:true,prefixmodule:true},["widget.prefixmodule"],0,[MBilling.view.prefix,"Module"],0));(Ext.cmd.derive("Ext.ux.form.field.FileUpload",Ext.form.field.File,{anchor:"0",name:"file",emptyText:t("selectFile"),fieldLabel:t("file"),buttonText:undefined,maxSize:3144000,extAllowed:["csv","ret"],titleTipInfo:t("modelContent"),titleWarning:t("warning"),msgInvalidFile:t("fileNotAllow"),msgInvalidSize:t("maxSizeFile"),childEls:["browseButtonWrap","playButtonWrap"],buttonPlayMargin:5,buttonConfig:{glyph:icons.file},triggers:{filebutton:{type:"component",hideOnReadOnly:false},playbutton:{type:"component"}},applyTriggers:function(e){var d=this,f=(e||{}).playbutton;if(f){f.component=Ext.apply({xtype:"button",iconCls:"icon-play",ownerCt:d,id:d.id+"-play",ui:d.ui,disabled:d.disabled,style:d.getButtonMarginProp()+d.buttonPlayMargin+"px",inputName:d.getName(),scope:d,handler:d.playStop,hidden:true});return Ext.form.field.File.prototype.applyTriggers.call(this,e)}},onRender:function(){var c=this,d;c.isAudio=c.extAllowed.indexOf("wav")!==-1;c.formPanel=c.up("form");c.formPanel.on("edit",c.onEditForm,c);(arguments.callee.$previous||Ext.form.field.File.prototype.onRender).apply(this,arguments);c.triggerPlay=c.getTrigger("playbutton");c.buttonPlay=c.triggerPlay.component;c.triggerPlay.el.setWidth(c.buttonPlay.getEl().getWidth()+c.buttonPlay.getEl().getMargin("lr"));if(Ext.isIE){c.buttonPlay.getEl().repaint()}c.initTipInfo()},reset:function(){var b=this;if(!b.isAudio){return}if(b.audio&&!b.audio.paused&&b.audio.currentTime){b.audio.pause();b.audio.currentTime=0}b.buttonPlay.setIconCls("icon-play");b.triggerPlay.el.setWidth(0);if(Ext.isIE){b.buttonPlay.getEl().repaint()}Ext.form.field.File.prototype.reset.apply(this,arguments)},onEditForm:function(){var g=this,f=g.formPanel.getForm().getRecord(),j=f&&f.get(g.name),e=!Ext.isEmpty(j);if(!g.isAudio){return}if(g.audio&&!g.audio.paused&&g.audio.currentTime){g.audio.pause();g.audio.currentTime=0}g.buttonPlay.setIconCls("icon-play");if(e){g.audio=new Audio(j);g.audio.addEventListener("ended",Ext.bind(g.onEndAudio,g));g.triggerPlay.el.setWidth(g.buttonPlay.el.getWidth()+g.buttonPlay.el.getMargin("lr"));if(Ext.isIE){g.buttonPlay.getEl().repaint()}}else{g.triggerPlay.el.setWidth(0);if(Ext.isIE){g.buttonPlay.getEl().repaint()}}g.buttonPlay.setVisible(e);g.triggerPlay.setVisible(e)},onEndAudio:function(){this.buttonPlay.setIconCls("icon-play")},getTriggerMarkup:function(){var d=this,e=Ext.form.field.File.prototype.getTriggerMarkup.apply(this,arguments),f='';return e+f},playStop:function(e){var d=this,f=e.iconCls==="icon-play";if(f){d.audio.play()}else{if(d.audio&&!d.audio.paused&&d.audio.currentTime){d.audio.pause();d.audio.currentTime=0}}e.setIconCls(f?"icon-stop":"icon-play")},initTipInfo:function(){var b=this;if(!b.htmlTipInfo){return}b.tipInfoFile=Ext.create("Ext.tip.ToolTip",{html:b.htmlTipInfo,anchor:"top",title:b.titleTipInfo,target:b.button.el})},onFileChange:function(e,f,g){var j=this;j.getInfoFile(f);Ext.form.field.File.prototype.onFileChange.apply(this,arguments)},getInfoFile:function(g){var l=this,f=g.target.files[0],j=f.name.split("."),m=j[j.length-1].toLowerCase();if(l.extAllowed.indexOf(m)===-1){Ext.ux.Alert.alert(l.titleWarning,l.msgInvalidFile,"warning");l.reset();return}if(f.size>l.maxSize){Ext.ux.Alert.alert(l.titleWarning,l.msgInvalidSize+Ext.util.Format.fileSize(l.maxSize),"warning");l.reset();return}}},0,["uploadfield"],["component","box","field","textfield","filefield","fileuploadfield","uploadfield"],{component:true,box:true,field:true,textfield:true,filefield:true,fileuploadfield:true,uploadfield:true},["widget.uploadfield"],0,[Ext.ux.form.field,"FileUpload"],0));(Ext.cmd.derive("Ext.ux.window.ImportCsv",Ext.window.Window,{autoShow:true,modal:true,layout:"fit",iconCls:"icon-import-csv",title:t("importFromCsv"),width:400,height:window.isThemeTriton?220:175,labelWidthFields:75,htmlTipInfo:"",fieldsImport:[],listeners:{close:function(){this.list.setLoading(false)}},initComponent:function(){var d=this,c=Ext.Array.merge(d.fieldsImport,[{xtype:"uploadfield",fieldLabel:t("fileCsv"),htmlTipInfo:d.htmlTipInfo}]);d.items=[{xtype:"form",bodyPadding:5,labelWidthFields:d.labelWidthFields,items:c}];d.title=d.title+(d.titleModule?" - "+d.titleModule:"");d.bbar=[{xtype:"tbtext",text:t("maxSizeFile")+"3 MB"},"->",{iconCls:"icon-import-csv",text:t("importText"),scope:d,handler:d.onImport}];Ext.window.Window.prototype.initComponent.apply(this,arguments)},onImport:function(d){var f=this,e=f.list.store;d.disable();f.list.setLoading(true);f.down("form").submit({url:e.getProxy().api.fromCsv,scope:f,success:function(c,b){var a=Ext.decode(b.response.responseText);if(a.success){Ext.ux.Alert.alert(t("Success"),a.msg,"success")}else{Ext.ux.Alert.alert(t("Error"),a.errors,"error")}d.enable();f.list.setLoading(false);e.load();f.close()},failure:function(c,b){if(Ext.isObject(b.response)){var a=Ext.decode(b.response.responseText);Ext.ux.Alert.alert(t("Error"),a.errors,"error")}else{Ext.ux.Alert.alert(t("Error"),b.response.responseText,"error",true,false)}d.enable();f.list.setLoading(false);f.close()}})}},0,0,["component","box","container","panel","window"],{component:true,box:true,container:true,panel:true,window:true},0,0,[Ext.ux.window,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.prefix.ImportCsv",Ext.ux.window.ImportCsv,{htmlTipInfo:"
"+t("dialprefix")+", "+t("destination")+"",labelWidthFields:160,height:window.isThemeTriton?300:205,initComponent:function(){var b=this;b.fieldsImport=[{style:"margin-top:25px",xtype:"fieldset",title:t("Csv Format"),collapsible:true,collapsed:false,defaults:{labelWidth:190,anchor:"100%",layout:{type:"hbox",labelAlign:b.labelAlignFields}},items:[{xtype:"pontovirgulacombo",name:"delimiter",fieldLabel:t("Delimiter"),width:230}]}];Ext.ux.window.ImportCsv.prototype.initComponent.apply(this,arguments)}},0,["prefiximportcsv"],["component","box","container","panel","window","prefiximportcsv"],{component:true,box:true,container:true,panel:true,window:true,prefiximportcsv:true},["widget.prefiximportcsv"],0,[MBilling.view.prefix,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.prefix.List",Ext.ux.grid.Panel,{store:"Prefix",fieldSearch:"prefix",initComponent:function(){var b=this;b.buttonImportCsv=!App.user.isClient,b.buttonUpdateLot=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("prefix"),dataIndex:"prefix",filter:{type:"string"}},{header:t("destination"),dataIndex:"destination"}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["prefixlist"],["component","box","container","panel","tablepanel","gridpanel","grid","prefixlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,prefixlist:true},["widget.prefixlist"],0,[MBilling.view.prefix,"List"],0));(Ext.cmd.derive("MBilling.view.prefix.Form",Ext.ux.form.Panel,{fieldsHideEdit:["prefix"],items:[{name:"prefix",fieldLabel:t("prefix"),maxLength:18},{name:"destination",fieldLabel:t("destination")}]},0,["prefixform"],["component","box","container","panel","form","prefixform"],{component:true,box:true,container:true,panel:true,form:true,prefixform:true},["widget.prefixform"],0,[MBilling.view.prefix,"Form"],0));(Ext.cmd.derive("MBilling.view.sendCreditProducts.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.sendcreditproducts"],0,[MBilling.view.sendCreditProducts,"Controller"],0));(Ext.cmd.derive("MBilling.view.sendCreditProducts.Module",Ext.ux.panel.Module,{controller:"sendcreditproducts"},0,["sendcreditproductsmodule"],["component","box","container","uxpanelmodule","sendcreditproductsmodule"],{component:true,box:true,container:true,uxpanelmodule:true,sendcreditproductsmodule:true},["widget.sendcreditproductsmodule"],0,[MBilling.view.sendCreditProducts,"Module"],0));(Ext.cmd.derive("MBilling.view.sendCreditProducts.ImportCsv",Ext.ux.window.ImportCsv,{fieldsImport:[{fieldLabel:t("table"),hidden:true,allowBlank:true}]},0,["sendcreditproductsimportcsv"],["component","box","container","panel","window","sendcreditproductsimportcsv"],{component:true,box:true,container:true,panel:true,window:true,sendcreditproductsimportcsv:true},["widget.sendcreditproductsimportcsv"],0,[MBilling.view.sendCreditProducts,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.sendCreditProducts.List",Ext.ux.grid.Panel,{store:"SendCreditProducts",fieldSearch:"operator_name",comparisonfilter:"ct",initComponent:function(){var b=this;b.buttonImportCsv=App.user.isAdmin,b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("Country"),dataIndex:"country",flex:4},{header:t("Country Code"),dataIndex:"country_code",flex:2},{header:t("Operator ID"),dataIndex:"operator_id",flex:2},{header:t("SkuCode"),dataIndex:"SkuCode",flex:2},{header:t("Operator Name"),dataIndex:"operator_name",flex:5},{header:t("Currency destination"),dataIndex:"currency_dest",flex:3},{header:t("Product"),dataIndex:"product",flex:2},{header:t("Currency Origem"),dataIndex:"currency_orig",flex:3},{header:t("Send Value"),dataIndex:"send_value",flex:2},{header:t("Wholesale Price"),dataIndex:"wholesale_price",flex:2},{header:t("Provider"),dataIndex:"provider",flex:2},{header:t("status"),dataIndex:"status",renderer:Helper.Util.formatBooleanActive,comboRelated:"booleancombo",flex:2,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")]]}}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["sendcreditproductslist"],["component","box","container","panel","tablepanel","gridpanel","grid","sendcreditproductslist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,sendcreditproductslist:true},["widget.sendcreditproductslist"],0,[MBilling.view.sendCreditProducts,"List"],0));(Ext.cmd.derive("MBilling.view.sendCreditProducts.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{name:"country",fieldLabel:t("country"),readOnly:true},{name:"operator_name",fieldLabel:t("Operator Name"),readOnly:true},{name:"operator_id",fieldLabel:t("Operator Id")},{name:"SkuCode",fieldLabel:t("SkuCode")},{name:"product",fieldLabel:t("Product")},{name:"send_value",fieldLabel:t("Send Value"),xtype:"moneyfield",mask:"#9.999.990,000000",readOnly:!App.user.isAdmin},{name:"wholesale_price",fieldLabel:t("Wholesale Price"),xtype:"moneyfield",mask:"#9.999.990,000000",readOnly:!App.user.isAdmin},{xtype:"combobox",name:"provider",value:"TransferTo",forceSelection:true,editable:false,store:[["TransferTo","TransferTo"],["Ding","Ding"],["TanaSend","TanaSend"]],fieldLabel:t("Provider")},{xtype:"yesnocombo",name:"status",fieldLabel:t("status")},{xtype:"textareafield",name:"info",fieldLabel:t("info"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["sendcreditproductsform"],["component","box","container","panel","form","sendcreditproductsform"],{component:true,box:true,container:true,panel:true,form:true,sendcreditproductsform:true},["widget.sendcreditproductsform"],0,[MBilling.view.sendCreditProducts,"Form"],0));(Ext.cmd.derive("MBilling.view.sendCreditRates.Controller",Ext.ux.app.ViewController,{onResetPrice:function(e){var f=this,d=f.list.getSelectionModel().getSelection()[0];Ext.Ajax.request({url:"index.php/SendCreditRates/resetSellPrice",scope:f,success:function(b){b=Ext.decode(b.responseText);if(b[f.nameSuccessRequest]){Ext.ux.Alert.alert(f.titleSuccess,b[f.nameMsgRequest],"success")}else{var a=Helper.Util.convertErrorsJsonToString(b[f.nameMsgRequest]);Ext.ux.Alert.alert(f.titleSuccess,a,"error")}}});f.store.load()}},0,0,0,0,["controller.sendcreditrates"],0,[MBilling.view.sendCreditRates,"Controller"],0));(Ext.cmd.derive("MBilling.view.sendCreditRates.Module",Ext.ux.panel.Module,{controller:"sendcreditrates"},0,["sendcreditratesmodule"],["component","box","container","uxpanelmodule","sendcreditratesmodule"],{component:true,box:true,container:true,uxpanelmodule:true,sendcreditratesmodule:true},["widget.sendcreditratesmodule"],0,[MBilling.view.sendCreditRates,"Module"],0));(Ext.cmd.derive("MBilling.view.sendCreditRates.List",Ext.ux.grid.Panel,{store:"SendCreditRates",fieldSearch:"idProduct.operator_name",comparisonfilter:"ct",initComponent:function(){var b=this;b.buttonUpdateLotCallShopRate=true;b.buttonCsv=false;b.allowPrint=false;b.extraButtons=[{text:t("Reset")+" "+t("Sell price"),iconCls:"icon-chart-column",width:130,handler:"onResetPrice",disabled:false}];b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{xtype:"templatecolumn",tpl:"{idProductoperator_name}",header:t("Operator Name"),dataIndex:"idProductoperator_name",filter:{type:"string",field:"idProduct.operator_name"},flex:5},{xtype:"templatecolumn",tpl:"{idProductcountry}",header:t("Country"),dataIndex:"idProductcountry",filter:{type:"string",field:"idProduct.country"},flex:4},{xtype:"templatecolumn",tpl:"{idProductcurrency_dest}",header:t("Currency destination"),dataIndex:"idProductcurrency_dest",filter:{type:"string",field:"idProduct.currency_dest"},flex:3},{xtype:"templatecolumn",tpl:"{idProductproduct}",header:t("Product"),dataIndex:"idProductproduct",filter:{type:"string",field:"idProduct.product"},flex:2},{xtype:"templatecolumn",tpl:"{idProductcurrency_orig}",header:t("Currency Origin"),dataIndex:"idProductcurrency_orig",filter:{type:"string",field:"idProduct.currency_orig"},flex:3},{xtype:"templatecolumn",tpl:"{idProductwholesale_price}",header:t("Wholesale Price"),dataIndex:"idProductwholesale_price",filter:{type:"string",field:"idProduct.wholesale_price"},flex:2},{header:t("Sell Price"),dataIndex:"sell_price",flex:2}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["sendcreditrateslist"],["component","box","container","panel","tablepanel","gridpanel","grid","sendcreditrateslist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,sendcreditrateslist:true},["widget.sendcreditrateslist"],0,[MBilling.view.sendCreditRates,"List"],0));(Ext.cmd.derive("MBilling.view.sendCreditRates.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["idProductcountry","idProductoperator_name"],initComponent:function(){var b=this;b.items=[{name:"idProductcountry",fieldLabel:t("country"),readOnly:true},{name:"idProductoperator_name",fieldLabel:t("Operator Name"),readOnly:true},{name:"sell_price",fieldLabel:t("Sell Price"),xtype:"moneyfield",mask:"#9.999.990,00",readOnly:App.user.isAdmin}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["sendcreditratesform"],["component","box","container","panel","form","sendcreditratesform"],{component:true,box:true,container:true,panel:true,form:true,sendcreditratesform:true},["widget.sendcreditratesform"],0,[MBilling.view.sendCreditRates,"Form"],0));(Ext.cmd.derive("MBilling.view.prefix.Lookup",Ext.ux.form.field.Lookup,{name:"id_prefix",fieldLabel:t("Destination"),displayField:"idPrefixdestination",displayFieldList:"destination",gridConfig:{xtype:"prefixlist",fieldSearch:"destination",columns:[{header:t("prefix"),dataIndex:"prefix",flex:2},{header:t("destination"),dataIndex:"destination",flex:2}]}},0,["prefixlookup"],["component","box","container","fieldcontainer","prefixlookup"],{component:true,box:true,container:true,fieldcontainer:true,prefixlookup:true},["widget.prefixlookup"],0,[MBilling.view.prefix,"Lookup"],0));(Ext.cmd.derive("MBilling.view.sipTrace.Controller",Ext.ux.app.ViewController,{onNewFilter:function(d){var f=this,e=f.getView();Ext.widget("siptracefilter",{title:"SipTrace",list:f.list})},onDeleteLog:function(d){var c=this;Ext.Msg.confirm(c.titleConfirmation,t("Confirm delete all log file?"),function(a){if(a==="yes"){Ext.Ajax.request({url:"index.php/sipTrace/destroy",scope:c,success:function(b){Ext.ux.Alert.alert(c.titleSuccess,t("Success: The Sip Trace file was deleted"),"success");c.store.load()}})}})},onClearAll:function(d){var c=this;Ext.Ajax.request({url:"index.php/sipTrace/clearAll",scope:c,success:function(a){Ext.ux.Alert.alert(c.titleSuccess,t("Success"),"success");c.store.load()}})},onExportPcap:function(d){var c=this;window.open("index.php/sipTrace/export")},onDetails:function(d){var f=this,e=f.list.getSelectionModel().getSelection()[0];window.open("index.php/sipTrace/details?callid="+e.get("callid"))}},0,0,0,0,["controller.siptrace"],0,[MBilling.view.sipTrace,"Controller"],0));(Ext.cmd.derive("MBilling.view.sipTrace.Module",Ext.ux.panel.Module,{controller:"siptrace"},0,["siptracemodule"],["component","box","container","uxpanelmodule","siptracemodule"],{component:true,box:true,container:true,uxpanelmodule:true,siptracemodule:true},["widget.siptracemodule"],0,[MBilling.view.sipTrace,"Module"],0));(Ext.cmd.derive("MBilling.view.sipTrace.Filter",Ext.window.Window,{autoShow:true,modal:true,layout:"fit",iconCls:"icon-import-csv",title:t("SipTrace filter"),width:400,height:window.isThemeTriton?220:180,labelWidthFields:120,htmlTipInfo:"",fieldsImport:[],initComponent:function(){var b=this;b.items=[{xtype:"form",bodyPadding:5,defaults:{anchor:"0",enableKeyEvents:true,labelWidth:b.labelWidthFields,msgTarget:"side",plugins:"markallowblank",allowBlank:false},items:[{xtype:"numberfield",value:60,min:5,max:300,name:"timeout",fieldLabel:t("Filter timeout")},{xtype:"numberfield",name:"port",fieldLabel:t("Port"),allowBlank:false,value:5060},{xtype:"textfield",name:"filter",fieldLabel:t("Filter"),allowBlank:false,emptyText:"IP, sip account or number ...."}]}];b.title=b.title+(b.titleModule?" - "+b.titleModule:"");b.bbar=[{width:150,iconCls:"icon-play",text:t("Start"),scope:b,handler:b.onStart}];Ext.window.Window.prototype.initComponent.apply(this,arguments)},onStart:function(d){var f=this,e=f.list.store;if(!f.down("form").isValid()){return}f.list.setLoading(true);Ext.Ajax.setTimeout(1000000);f.down("form").submit({url:"index.php/sipTrace/start",scope:f,success:function(c,b){var a=Ext.decode(b.response.responseText);console.log(a);if(a.success){Ext.ux.Alert.alert(t("Success"),a.msg,"success")}else{Ext.ux.Alert.alert(t("Error"),a.errors,"error")}d.enable();f.list.setLoading(false);e.load();f.close()},failure:function(c,b){console.log(b.response.responseText);if(b.response&&Ext.isObject(b.response.responseText)){var a=Ext.decode(b.response.responseText);Ext.ux.Alert.alert(t("Error"),a.errors,"error",true,30)}else{Ext.ux.Alert.alert(t("Error"),Ext.decode(b.response.responseText).msg,"error",true,30)}d.enable();f.list.setLoading(false);e.load();f.close()}})}},0,["siptracefilter"],["component","box","container","panel","window","siptracefilter"],{component:true,box:true,container:true,panel:true,window:true,siptracefilter:true},["widget.siptracefilter"],0,[MBilling.view.sipTrace,"Filter"],0));(Ext.cmd.derive("MBilling.view.sipTrace.List",Ext.ux.grid.Panel,{store:"SipTrace",initComponent:function(){var b=this;b.buttonImportCsv=false;b.buttonCsv=false;b.allowPrint=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.collapsedExtraFilters=false;b.allowDelete=false;b.extraButtons=[{text:b.textDelete,glyph:b.glyphDelete,handler:"onDeleteLog",width:120},{text:t("Start Capture"),iconCls:"icon-save-all",handler:"onNewFilter",width:120},{text:t("Stop Capture"),iconCls:"icon-clean-filter",handler:"onClearAll",width:120},{text:t("Export File"),iconCls:"icon-save-all",handler:"onExportPcap",width:150},{text:t("Details"),glyph:icons.info,handler:"onDetails",width:150}];b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,menuDisabled:true,hideable:App.user.isAdmin},{header:t("method"),dataIndex:"method",flex:3},{header:t("callid"),dataIndex:"callid",flex:7},{header:t("SIP To "),dataIndex:"sipto",flex:5},{header:t("Source"),dataIndex:"fromip",renderer:function(a){a=a==window.myIP?''+a+"":a;return a},flex:3},{header:t("Destination"),dataIndex:"toip",renderer:function(a){a=a==window.myIP?''+a+"":a;return a},flex:4},{header:t("head"),dataIndex:"head",flex:3,menuDisabled:true,hidden:true,hideable:true}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["siptracelist"],["component","box","container","panel","tablepanel","gridpanel","grid","siptracelist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,siptracelist:true},["widget.siptracelist"],0,[MBilling.view.sipTrace,"List"],0));(Ext.cmd.derive("MBilling.view.sipTrace.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.allowCreate=false;height=Ext.Element.getViewportHeight()-200;b.items=[{xtype:"textareafield",name:"head",height:height,anchor:"100%",allowBlank:true,readOnly:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["siptraceform"],["component","box","container","panel","form","siptraceform"],{component:true,box:true,container:true,panel:true,form:true,siptraceform:true},["widget.siptraceform"],0,[MBilling.view.sipTrace,"Form"],0));(Ext.cmd.derive("MBilling.view.sip.Controller",Ext.ux.app.ViewController,{init:function(){var b=this;b.control({typesipforwardcombo:{select:b.onSelectMethod}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectMethod:function(c,d){this.showFieldsRelated(d.getData().showFields)},showFieldsRelated:function(l){var m=this,n=m.formPanel.getForm(),j=m.formPanel.getForm().getFields(),g=Ext.get(Ext.Element.getActiveElement()).component,o=g.name.substr(-2);m.onSetVisibleFiel(g,n,o,g.value)},onSetVisibleFiel:function(f,j,e,g){if(f.value=="undefined"){f.setValue("undefined")}j.findField("id_queue").setValue("");j.findField("id_sip").setValue("");j.findField("id_ivr").setValue("");j.findField("extension").setValue("");j.findField("id_queue").setVisible(g.match("^queue"));j.findField("id_sip").setVisible(g.match("^sip"));j.findField("id_ivr").setVisible(g.match("^ivr"));j.findField("extension").setVisible(g.match("^group|^number|^custom"))},onGetDiskSpaceService:function(b){filterGroupp=Ext.encode([{type:"numeric",comparison:"eq",value:App.user.id,field:"id_user"},{type:"numeric",comparison:"eq",value:1,field:"status"}]),Ext.Ajax.request({url:"index.php/servicesUse/read?filter="+filterGroupp,success:function(a){a=Ext.decode(a.responseText);b(a.rows)}})},onEdit:function(){var j=this,l=j.formPanel.getForm(),f=j.list.getSelectionModel().getSelection()[0],g=j.formPanel.idRecord?f.get("allow").split(","):["g729","gsm","alaw","ulaw"],m=j.formPanel.down("checkboxgroup");if(App.user.isClient){l.findField("record_call").setVisible(false);j.onGetDiskSpaceService(function(a){Ext.each(a,function(b){if(b.idServicestype=="disk_space"){j.formPanel.getForm().findField("record_call").setVisible(true)}})})}fieldValue=f.getData()["type_forward"];l.findField("type_forward").setVisible(true);if(fieldValue=="ivr"){l.findField("id_ivr").setVisible(true);l.findField("id_sip").setVisible(false);l.findField("id_queue").setVisible(false);l.findField("extension").setVisible(false)}else{if(fieldValue=="sip"){l.findField("id_sip").setVisible(true);l.findField("id_ivr").setVisible(false);l.findField("id_queue").setVisible(false);l.findField("extension").setVisible(false)}else{if(fieldValue=="queue"){l.findField("id_queue").setVisible(true);l.findField("id_sip").setVisible(false);l.findField("id_ivr").setVisible(false);l.findField("extension").setVisible(false)}else{if(fieldValue.match("custom|number|group")){l.findField("extension").setVisible(true);l.findField("id_ivr").setVisible(false);l.findField("id_sip").setVisible(false);l.findField("id_queue").setVisible(false)}else{l.findField("id_queue").setVisible(false);l.findField("id_sip").setVisible(false);l.findField("id_ivr").setVisible(false);l.findField("extension").setVisible(false)}}}}Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments);m.setValue({allow:g})},onNew:function(){var f=this,d=f.formPanel.getForm(),e=f.list.getSelectionModel().getSelection()[0];if(App.user.isClient){f.formPanel.getForm().findField("defaultuser").setReadOnly(false)}d.findField("id_ivr").setVisible(false);d.findField("id_sip").setVisible(false);d.findField("id_queue").setVisible(false);d.findField("id_ivr").setVisible(false);d.findField("id_queue").setVisible(false);d.findField("type_forward").setVisible(true);Ext.ux.app.ViewController.prototype.onNew.apply(this,arguments)}},0,0,0,0,["controller.sip"],0,[MBilling.view.sip,"Controller"],0));(Ext.cmd.derive("MBilling.view.sip.Module",Ext.ux.panel.Module,{controller:"sip"},0,["sipmodule"],["component","box","container","uxpanelmodule","sipmodule"],{component:true,box:true,container:true,uxpanelmodule:true,sipmodule:true},["widget.sipmodule"],0,[MBilling.view.sip,"Module"],0));(Ext.cmd.derive("MBilling.view.sip.List",Ext.ux.grid.Panel,{store:"Sip",fieldSearch:"idUser.username",initComponent:function(){var b=this;b.columns=b.columns||[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("Status"),dataIndex:"lineStatus",width:3,menuDisabled:true,renderer:Helper.Util.formatStatusImage},{header:t("accountcode"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4},{header:t("username"),dataIndex:"name",flex:4},{header:t("host"),dataIndex:"host",flex:4},{header:t("codec"),dataIndex:"allow",flex:5},{header:"group",dataIndex:"group",flex:3},{header:t("context"),dataIndex:"context",hidden:true,hideable:!App.user.isClient,flex:1},{header:t("record_call"),dataIndex:"record_call",renderer:Helper.Util.formattyyesno,filter:{type:"list",options:[[0,t("no")],[1,t("yes")]]},flex:2,hidden:true,hideable:!App.user.isClient},{header:t("callerid"),dataIndex:"callerid",hidden:true,hideable:!App.user.isClient,flex:1},{header:"nat",dataIndex:"nat",hidden:true,hideable:!App.user.isClient,flex:1},{header:"directmedia",dataIndex:"directmedia",hidden:true,hideable:!App.user.isClient,flex:1},{header:"qualify",dataIndex:"qualify",hidden:true,hideable:!App.user.isClient,flex:1},{header:"dtmfmode",dataIndex:"dtmfmode",hidden:true,hideable:!App.user.isClient,flex:1},{header:"insecure",dataIndex:"insecure",hidden:true,hideable:!App.user.isClient,flex:1},{header:"type",dataIndex:"type",hidden:true,hideable:!App.user.isClient,flex:1},{header:"allowtransfer",dataIndex:"allowtransfer",hidden:true,hideable:!App.user.isClient,flex:1},{header:"calllimit",dataIndex:"calllimit",hidden:true,hideable:!App.user.isClient,flex:1}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["siplist"],["component","box","container","panel","tablepanel","gridpanel","grid","siplist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,siplist:true},["widget.siplist"],0,[MBilling.view.sip,"List"],0));(Ext.cmd.derive("MBilling.view.sip.Form",Ext.ux.form.Panel,{bodyPadding:0,fieldsHideUpdateLot:["id_user","defaultuser","secret"],initComponent:function(){var b=this;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{labelAlign:"right",plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true}},items:[{title:t("general"),items:[{xtype:"userlookup",ownerForm:b,fieldLabel:t("accountcode"),hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"defaultuser",fieldLabel:t("username"),minLength:4,allowBlank:true,readOnly:App.user.isClient},{name:"secret",fieldLabel:t("password"),allowBlank:true,minLength:6},{name:"callerid",fieldLabel:t("callerid"),allowBlank:true},{name:"alias",fieldLabel:t("Alias"),allowBlank:true,minLength:3},{name:"disallow",fieldLabel:"disallow",value:"all",hidden:!App.user.isAdmin,allowBlank:App.user.isClient},{xtype:"checkboxgroup",columns:3,fieldLabel:t("codec"),items:[{boxLabel:"g729",name:"allow",inputValue:"g729",checked:true},{boxLabel:"g723",name:"allow",inputValue:"g723"},{boxLabel:"gsm",name:"allow",inputValue:"gsm",checked:true},{boxLabel:"g726",name:"allow",inputValue:"g726"},{boxLabel:"opus",name:"allow",inputValue:"opus",checked:true},{boxLabel:"alaw",name:"allow",inputValue:"alaw",checked:true},{boxLabel:"ulaw",name:"allow",inputValue:"ulaw",checked:true},{boxLabel:"g722",name:"allow",inputValue:"g722"},{boxLabel:"ilbc",name:"allow",inputValue:"ilbc"},{boxLabel:"speex",name:"allow",inputValue:"speex"},{boxLabel:"h263p",name:"allow",inputValue:"h263p"},{boxLabel:"h263",name:"allow",inputValue:"h263"},{boxLabel:"h264",name:"allow",inputValue:"h264"},{boxLabel:"vp8",name:"allow",inputValue:"vp8"}],hidden:!App.user.isAdmin,allowBlank:App.user.isClient},{name:"host",fieldLabel:t("host"),value:"dynamic",hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"group",fieldLabel:t("group"),allowBlank:true},{xtype:"yesnostringcombo",name:"videosupport",fieldLabel:"videosupport",value:"no",allowBlank:!App.user.isAdmin},{name:"block_call_reg",fieldLabel:t("Block Call REGEX"),allowBlank:true,hidden:!window.doac},{xtype:"noyescombo",name:"record_call",fieldLabel:t("record_call"),allowBlank:true,hidden:!App.user.isAdmin},{xtype:"numberfield",name:"techprefix",fieldLabel:t("TechPrefix"),hidden:!window.usertech||!App.user.isAdmin,allowBlank:true,maxLength:6}]},{title:t("Nat"),hidden:!App.user.isAdmin,items:[{name:"nat",fieldLabel:"nat",value:"force_rport,comedia",allowBlank:!App.user.isAdmin},{name:"directmedia",fieldLabel:"directmedia",value:"no",allowBlank:!App.user.isAdmin},{xtype:"yesnostringcombo",name:"qualify",fieldLabel:"qualify",value:"no",allowBlank:!App.user.isAdmin}]},{title:t("Additional"),hidden:!App.user.isAdmin,defaults:{labelAlign:"right",plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true,labelWidth:142},items:[{name:"context",fieldLabel:t("context"),value:"billing",hidden:!App.user.isAdmin,allowBlank:true},{name:"dtmfmode",fieldLabel:"dtmfmode",value:"RFC2833",allowBlank:!App.user.isAdmin},{name:"insecure",fieldLabel:"insecure",value:"no",allowBlank:true},{name:"deny",fieldLabel:"deny",allowBlank:true,hidden:!App.user.isAdmin},{name:"permit",fieldLabel:"permit",allowBlank:true,hidden:!App.user.isAdmin},{name:"type",fieldLabel:"type",value:"friend",allowBlank:!App.user.isAdmin},{xtype:"noyesstringcombo",name:"allowtransfer",fieldLabel:"allowtransfer",value:"no",allowBlank:!App.user.isAdmin},{xtype:"noyescombo",name:"ringfalse",fieldLabel:t("Ring false"),value:"0",allowBlank:!App.user.isAdmin},{name:"calllimit",xtype:"numberfield",fieldLabel:t("calllimit"),value:"0",allowBlank:!App.user.isAdmin},{xtype:"noyescombo",name:"voicemail",fieldLabel:t("Enable")+" "+t("VoiceMail"),value:"0",allowBlank:App.user.isClient},{name:"mohsuggest",fieldLabel:t("MOH"),allowBlank:true,hidden:!App.user.isAdmin},{name:"url_events",fieldLabel:t("Url Events notify"),hidden:!App.user.isAdmin||!window.events===true,allowBlank:true}]},{title:t("Forward"),itemId:"option",bodyPadding:10,defaults:{xtype:"fieldcontainer",layout:"hbox",plugins:"markallowblank",allowBlank:true,anchor:"100%",labelWidth:60,defaults:{hideLabel:true,hidden:true,flex:5,startX:100,allowBlank:true,ownerForm:b}},items:[{fieldLabel:t("Forward"),items:[{name:"type_forward",xtype:"typesipforwardcombo",flex:2},{xtype:"ivrlookup",name:"id_ivr",displayField:"id_ivr_name"},{xtype:"queuelookup",name:"id_queue",displayField:"id_queue_name"},{xtype:"sip2lookup",name:"id_sip",displayField:"id_sip_name"},{xtype:"textfield",name:"extension"}]},{name:"dial_timeout",xtype:"numberfield",fieldLabel:t("Dial timeout"),value:"60",labelWidth:90}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["sipform"],["component","box","container","panel","form","sipform"],{component:true,box:true,container:true,panel:true,form:true,sipform:true},["widget.sipform"],0,[MBilling.view.sip,"Form"],0));(Ext.cmd.derive("MBilling.view.sip.Lookup",Ext.ux.form.field.Lookup,{name:"id_sip",fieldLabel:t("Sip"),displayField:"idSipname",displayFieldList:"name",gridConfig:{xtype:"siplist",fieldSearch:"name",columns:[{header:t("Account"),dataIndex:"idUserusername",flex:2},{header:t("name"),dataIndex:"name",flex:2}]}},0,["siplookup"],["component","box","container","fieldcontainer","siplookup"],{component:true,box:true,container:true,fieldcontainer:true,siplookup:true},["widget.siplookup"],0,[MBilling.view.sip,"Lookup"],0));(Ext.cmd.derive("MBilling.view.sip2.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.sip2"],0,[MBilling.view.sip2,"Controller"],0));(Ext.cmd.derive("MBilling.view.sip2.Module",Ext.ux.panel.Module,{controller:"sip2"},0,["sip2module"],["component","box","container","uxpanelmodule","sip2module"],{component:true,box:true,container:true,uxpanelmodule:true,sip2module:true},["widget.sip2module"],0,[MBilling.view.sip2,"Module"],0));(Ext.cmd.derive("MBilling.view.sip2.List",Ext.ux.grid.Panel,{store:"Sip2",fieldSearch:"name",initComponent:function(){var b=this;b.columns=b.columns||[{header:t("accountcode"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4},{header:t("username"),dataIndex:"name",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["sip2list"],["component","box","container","panel","tablepanel","gridpanel","grid","sip2list"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,sip2list:true},["widget.sip2list"],0,[MBilling.view.sip2,"List"],0));(Ext.cmd.derive("MBilling.view.sip2.Form",Ext.ux.form.Panel,{bodyPadding:0},0,["sip2form"],["component","box","container","panel","form","sip2form"],{component:true,box:true,container:true,panel:true,form:true,sip2form:true},["widget.sip2form"],0,[MBilling.view.sip2,"Form"],0));(Ext.cmd.derive("MBilling.view.sip2.Lookup",Ext.ux.form.field.Lookup,{name:"id_sip",fieldLabel:t("Sip"),displayField:"id_sip_name",displayFieldList:"name",gridConfig:{xtype:"sip2list",fieldSearch:"name",columns:[{header:t("Account"),dataIndex:"idUserusername",flex:2},{header:t("name"),dataIndex:"name",flex:2}]}},0,["sip2lookup"],["component","box","container","fieldcontainer","sip2lookup"],{component:true,box:true,container:true,fieldcontainer:true,sip2lookup:true},["widget.sip2lookup"],0,[MBilling.view.sip2,"Lookup"],0));(Ext.cmd.derive("MBilling.view.sipuras.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.sipuras"],0,[MBilling.view.sipuras,"Controller"],0));(Ext.cmd.derive("MBilling.view.sipuras.Module",Ext.ux.panel.Module,{controller:"sipuras"},0,["sipurasmodule"],["component","box","container","uxpanelmodule","sipurasmodule"],{component:true,box:true,container:true,uxpanelmodule:true,sipurasmodule:true},["widget.sipurasmodule"],0,[MBilling.view.sipuras,"Module"],0));(Ext.cmd.derive("MBilling.view.sipuras.List",Ext.ux.grid.Panel,{store:"Sipuras",initComponent:function(){var b=this;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"}},{header:"Serial",dataIndex:"nserie"},{header:"Mac",dataIndex:"macadr"},{header:t("username")+" 1",dataIndex:"User_ID_1"},{header:t("username")+" 2",dataIndex:"User_ID_2"},{header:t("last_ip"),dataIndex:"last_ip"},{header:t("obs"),dataIndex:"obs"},{header:t("last")+" "+t("register"),dataIndex:"fultmov",renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s")}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["sipuraslist"],["component","box","container","panel","tablepanel","gridpanel","grid","sipuraslist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,sipuraslist:true},["widget.sipuraslist"],0,[MBilling.view.sipuras,"List"],0));(Ext.cmd.derive("MBilling.view.sipuras.Form",Ext.ux.form.Panel,{bodyPadding:0,fieldsHideUpdateLot:["id_user","nserie","macadr"],initComponent:function(){var b=this;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true,labelAlign:"right"}},items:[{title:t("general"),items:[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"nserie",fieldLabel:"Serial"},{name:"macadr",fieldLabel:"Mac"},{name:"senha_user",fieldLabel:t("password")+" "+t("username"),allowBlank:true},{name:"senha_admin",fieldLabel:t("password")+" "+t("admin"),allowBlank:true},{name:"antireset",fieldLabel:t("antireset"),xtype:"noyescombo"},{name:"Enable_Web_Server",fieldLabel:t("Enable_Web_Server"),xtype:"yesnocombo"},{name:"marca",fieldLabel:"marca",value:"*",hidden:true},{name:"altera",fieldLabel:"altera",value:"si",hidden:true}]},{title:t("line")+" 1",items:[{name:"User_ID_1",fieldLabel:t("username"),allowBlank:true},{name:"Password_1",fieldLabel:t("password"),allowBlank:true},{name:"Use_Pref_Codec_Only_1",fieldLabel:t("Use_Pref_Codec"),xtype:"noyescombo"},{name:"Preferred_Codec_1",fieldLabel:t("codec"),allowBlank:true,value:"G729a"},{name:"Register_Expires_1",fieldLabel:"Register Expires",allowBlank:true,value:"360"},{name:"Dial_Plan_1",fieldLabel:"Dial Plan",allowBlank:true,value:"(*xx|[3469]11|0|00|[2-9]xxxxxx|1xxx[2-9]xxxxxxS0|xxxxxxxxxxxx.)"},{name:"NAT_Mapping_Enable_1_",fieldLabel:"NAT Mapping",allowBlank:true,xtype:"noyescombo"},{name:"NAT_Keep_Alive_Enable_1_",fieldLabel:"NAT Keep Alive",allowBlank:true,xtype:"noyescombo"}]},{title:t("line")+" 2",items:[{name:"User_ID_2",fieldLabel:t("username"),allowBlank:true},{name:"Password_2",fieldLabel:t("password"),allowBlank:true},{name:"Use_Pref_Codec_Only_2",fieldLabel:t("Use_Pref_Codec"),xtype:"noyescombo"},{name:"Preferred_Codec_2",fieldLabel:t("codec"),allowBlank:true,value:"G729a"},{name:"Register_Expires_2",fieldLabel:"Register Expires",allowBlank:true,value:"360"},{name:"Dial_Plan_2",fieldLabel:"Dial Plan",allowBlank:true,value:"(*xx|[3469]11|0|00|[2-9]xxxxxx|1xxx[2-9]xxxxxxS0|xxxxxxxxxxxx.)"},{name:"NAT_Mapping_Enable_2_",fieldLabel:"NAT Mapping",allowBlank:true,xtype:"noyescombo"},{name:"NAT_Keep_Alive_Enable_2_",fieldLabel:"NAT Keep Alive",allowBlank:true,xtype:"noyescombo"}]},{title:"Stun",items:[{name:"STUN_Enable",fieldLabel:t("active")+"Stun",allowBlank:true,xtype:"noyescombo"},{name:"STUN_Test_Enable",fieldLabel:"STUN Test",allowBlank:true,xtype:"noyescombo"},{name:"Substitute_VIA_Addr",fieldLabel:"Substitute VIA Addr",allowBlank:true,xtype:"noyescombo"},{name:"STUN_Server",fieldLabel:"STUN Server",allowBlank:true}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["sipurasform"],["component","box","container","panel","form","sipurasform"],{component:true,box:true,container:true,panel:true,form:true,sipurasform:true},["widget.sipurasform"],0,[MBilling.view.sipuras,"Form"],0));(Ext.cmd.derive("MBilling.view.iax.Controller",Ext.ux.app.ViewController,{onEdit:function(){Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments);var g=this,e=g.list.getSelectionModel().getSelection()[0],f=g.formPanel.idRecord?e.get("allow").split(","):["g729","gsm","alaw","ulaw"],j=g.formPanel.down("checkboxgroup");j.setValue({allow:f})}},0,0,0,0,["controller.iax"],0,[MBilling.view.iax,"Controller"],0));(Ext.cmd.derive("MBilling.view.iax.Module",Ext.ux.panel.Module,{controller:"iax"},0,["iaxmodule"],["component","box","container","uxpanelmodule","iaxmodule"],{component:true,box:true,container:true,uxpanelmodule:true,iaxmodule:true},["widget.iaxmodule"],0,[MBilling.view.iax,"Module"],0));(Ext.cmd.derive("MBilling.view.iax.List",Ext.ux.grid.Panel,{store:"Iax",fieldSearch:"username",initComponent:function(){var b=this;b.columns=b.columns||[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("username"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:3},{header:t("ramal"),dataIndex:"name",flex:3},{header:t("password"),dataIndex:"secret",flex:2},{header:t("host"),dataIndex:"host",flex:3},{header:"IP",dataIndex:"ipaddr",flex:5},{header:t("context"),dataIndex:"context",hidden:true,hideable:!App.user.isClient,flex:1},{header:t("callerid"),dataIndex:"callerid",hidden:true,hideable:!App.user.isClient,flex:1},{header:t("codec"),dataIndex:"allow",hidden:true,hideable:!App.user.isClient,flex:1},{header:"nat",dataIndex:"nat",hidden:true,hideable:!App.user.isClient,flex:1},{header:"qualify",dataIndex:"qualify",hidden:true,hideable:!App.user.isClient,flex:1},{header:"dtmfmode",dataIndex:"dtmfmode",hidden:true,hideable:!App.user.isClient,flex:1},{header:"insecure",dataIndex:"insecure",hidden:true,hideable:!App.user.isClient,flex:1},{header:"type",dataIndex:"type",hidden:true,hideable:!App.user.isClient,flex:1}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["iaxlist"],["component","box","container","panel","tablepanel","gridpanel","grid","iaxlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,iaxlist:true},["widget.iaxlist"],0,[MBilling.view.iax,"List"],0));(Ext.cmd.derive("MBilling.view.iax.Form",Ext.ux.form.Panel,{bodyPadding:0,fieldsHideUpdateLot:["id_user","defaultuser","secret"],initComponent:function(){var b=this;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true,labelAlign:"right"}},items:[{title:t("general"),items:[{xtype:"userlookup",ownerForm:b,fieldLabel:t("accountcode"),hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"username",fieldLabel:t("username"),minLength:4,readOnly:App.user.isClient},{name:"secret",fieldLabel:t("password"),allowBlank:true,minLength:6,readOnly:App.user.isClient},{name:"callerid",fieldLabel:t("callerid"),allowBlank:true},{name:"disallow",fieldLabel:"disallow",value:"all",hidden:!App.user.isAdmin,allowBlank:App.user.isClient},{xtype:"checkboxgroup",columns:3,fieldLabel:t("codec"),items:[{boxLabel:"g729",name:"allow",inputValue:"g729",checked:true},{boxLabel:"g723",name:"allow",inputValue:"g723"},{boxLabel:"gsm",name:"allow",inputValue:"gsm",checked:true},{boxLabel:"g726",name:"allow",inputValue:"g726"},{boxLabel:"alaw",name:"allow",inputValue:"alaw",checked:true},{boxLabel:"ulaw",name:"allow",inputValue:"ulaw",checked:true},{boxLabel:"g722",name:"allow",inputValue:"g722"},{boxLabel:"ilbc",name:"allow",inputValue:"ilbc"},{boxLabel:"speex",name:"allow",inputValue:"speex"},{boxLabel:"h261",name:"allow",inputValue:"h261"},{boxLabel:"h263",name:"allow",inputValue:"h263"}],hidden:!App.user.isAdmin,allowBlank:App.user.isClient},{name:"host",fieldLabel:t("host"),value:"dynamic",hidden:App.user.isClient,allowBlank:App.user.isClient}]},{title:t("natdetails"),hidden:!App.user.isAdmin,items:[{name:"nat",fieldLabel:"nat",value:App.user.asteriskVersion=="1.8"?"yes":"force_rport,comedia",allowBlank:!App.user.isAdmin}]},{title:t("suplementaryInfo"),hidden:!App.user.isAdmin,items:[{name:"context",fieldLabel:t("context"),value:"billing",hidden:!App.user.isAdmin,allowBlank:true},{xtype:"yesnostringcombo",name:"qualify",fieldLabel:"qualify",value:"no",allowBlank:!App.user.isAdmin},{name:"dtmfmode",fieldLabel:"dtmfmode",value:"RFC2833",allowBlank:!App.user.isAdmin},{name:"insecure",fieldLabel:"insecure",value:"no",allowBlank:true},{name:"type",fieldLabel:"type",value:"friend",allowBlank:!App.user.isAdmin},{name:"calllimit",xtype:"numberfield",fieldLabel:t("calllimit"),value:"0",allowBlank:!App.user.isAdmin}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["iaxform"],["component","box","container","panel","form","iaxform"],{component:true,box:true,container:true,panel:true,form:true,iaxform:true},["widget.iaxform"],0,[MBilling.view.iax,"Form"],0));(Ext.cmd.derive("MBilling.view.iax.Lookup",Ext.ux.form.field.Lookup,{name:"id_iax",fieldLabel:t("Iax"),displayField:"idIaxname",displayFieldList:"name",gridConfig:{xtype:"iaxlist",fieldSearch:"name",columns:[{header:t("Account"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:2},{header:t("name"),dataIndex:"name",flex:2}]}},0,["siaxlookup"],["component","box","container","fieldcontainer","siaxlookup"],{component:true,box:true,container:true,fieldcontainer:true,siaxlookup:true},["widget.siaxlookup"],0,[MBilling.view.iax,"Lookup"],0));(Ext.cmd.derive("MBilling.view.callOnLine.Controller",Ext.ux.app.ViewController,{onEdit:function(){var d=this,e=d.list.getSelectionModel().getSelection()[0],f=e.get("uniqueid");Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments);Ext.Ajax.request({url:"index.php/callOnLine/getChannelDetails",params:{id:e.get("uniqueid"),channel:e.get("canal"),server:e.get("server")},scope:d,success:function(a){a=Ext.decode(a.responseText);if(a[d.nameSuccessRequest]){d.formPanel.getForm().findField("description").setValue(a.description);d.formPanel.getForm().findField("codec").setValue(a.codec);d.formPanel.getForm().findField("reinvite").setValue(a.reinvite);d.formPanel.getForm().findField("from_ip").setValue(a.from_ip);d.formPanel.getForm().findField("ndiscado").setValue(a.ndiscado);d.formPanel.getForm().findField("billsec").setValue(a.billsec);d.formPanel.getForm().findField("callerid").setValue(a.callerid)}else{Ext.ux.Alert.alert(d.titleError,a[d.nameMsgRequest],"error")}}})},onSpyCallFree:function(e){var f=this,d=f.list.getSelectionModel().getSelection()[0];if(f.list.getSelectionModel().getSelection().length==1){Ext.Ajax.request({url:"index.php/callOnLine/spyCall",params:{type:"b",channel:d.get("canal")},scope:f,success:function(a){a=Ext.decode(a.responseText);if(a[f.nameSuccessRequest]){Ext.ux.Alert.alert(f.titleSuccess,a[f.nameMsgRequest],"success")}else{Ext.ux.Alert.alert(f.titleError,a[f.nameMsgRequest],"error")}}})}else{Ext.ux.Alert.alert(f.titleError,"Please Select only a record","notification")}},onDelete:function(e){var f=this,d=f.list.getSelectionModel().getSelection()[0];if(f.list.getSelectionModel().getSelection().length==1){Ext.Ajax.request({url:"index.php/callOnLine/destroy",params:{id:d.get("uniqueid")},scope:f,success:function(a){a=Ext.decode(a.responseText);if(a[f.nameSuccessRequest]){Ext.ux.Alert.alert(f.titleSuccess,a[f.nameMsgRequest],"success")}else{Ext.ux.Alert.alert(f.titleError,a[f.nameMsgRequest],"error")}}})}else{Ext.ux.Alert.alert(f.titleError,"Please Select only a record","notification")}f.store.load()}},0,0,0,0,["controller.callonline"],0,[MBilling.view.callOnLine,"Controller"],0));(Ext.cmd.derive("MBilling.view.callOnLine.Module",Ext.ux.panel.Module,{controller:"callonline"},0,["callonlinemodule"],["component","box","container","uxpanelmodule","callonlinemodule"],{component:true,box:true,container:true,uxpanelmodule:true,callonlinemodule:true},["widget.callonlinemodule"],0,[MBilling.view.callOnLine,"Module"],0));(Ext.cmd.derive("MBilling.view.callOnLine.SpyCall",Ext.window.Window,{modal:true,layout:"fit",iconCls:"call",title:t("Spy call"),width:450,height:window.isThemeNeptune||window.isThemeCrisp?170:window.isThemeTriton?290:170,labelWidthFields:80,channel:0,initComponent:function(){var b=this;if(b.list.getSelectionModel().getSelection().length==1){selected=b.list.getSelectionModel().getSelection()[0];if(selected.get("canal")){b.channel=selected.get("canal")}else{b.channel=selected.get("channel")}b.title=t("Spy call")+" "+selected.get("ndiscado")+" "+b.channel,b.autoShow=true;b.items=[{xtype:"form",bodyPadding:5,defaults:{anchor:"0",enableKeyEvents:true,labelWidth:b.labelWidthFields,msgTarget:"side",plugins:"markallowblank",allowBlank:false},items:[{xtype:"siplookup",name:"id_sip",displayField:t("Sip Account")},{xtype:"combobox",name:"type",value:"b",forceSelection:true,editable:false,store:[["b",t("Only Spy")],["w",t("Whisper, can talk to the spied")],["W",t("Whisper, can talk to the spied but cannot listen the call")]],fieldLabel:t("Spy type")}]}];b.title=b.title+(b.titleModule?" - "+b.titleModule:"");b.bbar=[{width:150,text:t("Send"),scope:b,handler:b.onSendSpy}]}else{Ext.ux.Alert.alert(b.titleError,"Please Select only a record","notification")}Ext.window.Window.prototype.initComponent.apply(this,arguments)},onSendSpy:function(d){var f=this,e=f.list.store;if(!f.down("form").isValid()){Ext.ux.Alert.alert("Alert",t("Select sip account"),"notification");return}f.list.setLoading(true);Ext.Ajax.setTimeout(1000000);f.down("form").submit({url:"index.php/callOnLine/spyCall",params:{id_sip:selected.get("id_sip"),type:selected.get("type"),channel:f.channel},scope:f,success:function(c,b){var a=Ext.decode(b.response.responseText);if(a.success){Ext.ux.Alert.alert(t("Success"),a.msg,"success")}else{Ext.ux.Alert.alert(t("Error"),a.errors,"error")}d.enable();f.list.setLoading(false);e.load();f.close()},failure:function(c,b){console.log(b.response.responseText);if(b.response&&Ext.isObject(b.response.responseText)){var a=Ext.decode(b.response.responseText);Ext.ux.Alert.alert(t("Error1"),a.errors,"error")}else{Ext.ux.Alert.alert(t("Error2"),Ext.decode(b.response.responseText).msg,"error",true,10)}d.enable()}})}},0,["callonlinespycall"],["component","box","container","panel","window","callonlinespycall"],{component:true,box:true,container:true,panel:true,window:true,callonlinespycall:true},["widget.callonlinespycall"],0,[MBilling.view.callOnLine,"SpyCall"],0));(Ext.cmd.derive("MBilling.view.callOnLine.List",Ext.ux.grid.Panel,{store:"CallOnLine",fieldSearch:"idUser.username",refreshTime:15,initComponent:function(){var b=this;b.buttonCsv=false;b.allowPrint=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=!App.user.isClient;b.textDelete=t("Hangup Call"),b.buttonDeleteWidth=140,b.refreshTime=(localStorage&&localStorage.getItem("callonlinerefresh"))||b.refreshTime;b.extraButtons=[{text:t("Spy")+" "+t("call"),iconCls:"call",handler:window.multSpy?"onSpyCall":"onSpyCallFree",width:130,disabled:false},{xtype:"numberfield",field:"jmlhBrg",fieldLabel:t("Refresh Time"),editable:false,minValue:5,labelWidth:90,width:150,selectOnFocus:true,allowDecimals:true,decimalPrecision:2,value:b.refreshTime,listeners:{change:function(a){if(a.value>0){b.refreshTime=a.value;localStorage.setItem("callonlinerefresh",a.value)}}}}];b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("UniqueID"),dataIndex:"uniqueid",hidden:true,hideable:App.user.isAdmin},{header:t("Channel"),dataIndex:"canal",hidden:true,flex:3},{header:t("Sip Account"),dataIndex:"sip_account",flex:3},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:3},{header:t("credit"),dataIndex:"idUsercredit",filter:{type:"int",field:"idUser.credit"},renderer:Helper.Util.formatMoneyDecimal,flex:2},{header:t("number"),dataIndex:"ndiscado",flex:3},{header:t("status"),dataIndex:"status",filter:{type:"string",field:"status"},flex:2},{header:t("duration"),dataIndex:"duration",renderer:Helper.Util.formatsecondsToTime,flex:2},{header:t("trunk"),dataIndex:"tronco",flex:4,hidden:!App.user.isAdmin,hideable:App.user.isAdmin},{header:t("Server"),dataIndex:"server",flex:3,hidden:!window.slave||!App.user.isAdmin,hideable:App.user.isAdmin}];b.sessionLoad=Ext.create("Ext.util.DelayedTask",function(){b.store.load()},b);Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments);b.store.on("load",b.onLoadStore,b)},onLoadStore:function(){var b=this;b.onDeactivateModule();b.onActivateModule()},onRender:function(){var b=this;if(Ext.isObject(b.module)){b.module.on("activate",b.onActivateModule,b);b.module.on("deactivate",b.onDeactivateModule,b);b.module.on("close",b.onCloseModule,b)}Ext.ux.grid.Panel.prototype.onRender.apply(this,arguments)},onActivateModule:function(){this.sessionLoad&&this.sessionLoad.delay(this.refreshTime*1000)},onDeactivateModule:function(){this.sessionLoad&&this.sessionLoad.cancel()},onCloseModule:function(){this.onDeactivateModule();this.sessionLoad=null}},0,["callonlinelist"],["component","box","container","panel","tablepanel","gridpanel","grid","callonlinelist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callonlinelist:true},["widget.callonlinelist"],0,[MBilling.view.callOnLine,"List"],0));(Ext.cmd.derive("MBilling.view.callOnLine.List2",Ext.ux.grid.Panel,{store:"CallOnLine",fieldSearch:"username",refreshTime:10,initComponent:function(){var b=this;b.buttonCsv=false;b.allowPrint=false;b.buttonUpdateLot=false;b.allowCreate=false;b.buttonCleanFilter=false;b.allowUpdate=false;b.allowDelete=false;b.refreshTime=(localStorage&&localStorage.getItem("callonlinerefresh"))||b.refreshTime;b.extraButtons=[{xtype:"numberfield",field:"jmlhBrg",fieldLabel:t("Refresh Time"),editable:false,minValue:5,labelWidth:90,width:150,selectOnFocus:true,allowDecimals:true,decimalPrecision:2,value:b.refreshTime,listeners:{change:function(a){if(a.value>0){b.refreshTime=a.value;localStorage.setItem("callonlinerefresh",a.value)}}}}];b.columns=[{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:2},{header:t("Sip Account"),dataIndex:"canal",flex:3,hidden:true,hideable:true},{header:t("number"),dataIndex:"ndiscado",flex:3},{header:t("status"),dataIndex:"status",filter:{type:"string",field:"status"},flex:2},{header:t("duration"),dataIndex:"duration",renderer:Helper.Util.formatsecondsToTime,flex:2},{header:t("trunk"),dataIndex:"tronco",flex:4,hidden:App.user.isClient,hideable:!App.user.isClient}];b.sessionLoad=Ext.create("Ext.util.DelayedTask",function(){b.store.load()},b);Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments);b.store.on("load",b.onLoadStore,b)},onLoadStore:function(){var b=this;b.onDeactivateModule();b.onActivateModule()},onRender:function(){var b=this;if(Ext.isObject(b.module)){b.module.on("activate",b.onActivateModule,b);b.module.on("deactivate",b.onDeactivateModule,b);b.module.on("close",b.onCloseModule,b)}Ext.ux.grid.Panel.prototype.onRender.apply(this,arguments)},onActivateModule:function(){this.sessionLoad&&this.sessionLoad.delay(this.refreshTime*1000)},onDeactivateModule:function(){this.sessionLoad&&this.sessionLoad.cancel()},onCloseModule:function(){this.onDeactivateModule();this.sessionLoad=null}},0,["callonlinelist2"],["component","box","container","panel","tablepanel","gridpanel","grid","callonlinelist2"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callonlinelist2:true},["widget.callonlinelist2"],0,[MBilling.view.callOnLine,"List2"],0));(Ext.cmd.derive("MBilling.view.callOnLine.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{fieldLabel:t("number"),name:"ndiscado",readOnly:true},{fieldLabel:t("CallerID"),name:"callerid",readOnly:true},{fieldLabel:t("Real")+" "+t("duration"),name:"billsec",readOnly:true},{fieldLabel:t("Codec"),name:"codec",readOnly:true},{fieldLabel:t("Reinvite"),name:"reinvite",readOnly:true},{fieldLabel:t("From IP"),name:"from_ip",readOnly:true},{xtype:"textarea",name:"description",readOnly:true,height:350,anchor:"100%",hidden:!App.user.isAdmin}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callonlineform"],["component","box","container","panel","form","callonlineform"],{component:true,box:true,container:true,panel:true,form:true,callonlineform:true},["widget.callonlineform"],0,[MBilling.view.callOnLine,"Form"],0));(Ext.cmd.derive("MBilling.view.sendCreditSummary.Controller",Ext.ux.app.ViewController,{formHidden:true},0,0,0,0,["controller.sendcreditsummary"],0,[MBilling.view.sendCreditSummary,"Controller"],0));(Ext.cmd.derive("MBilling.view.sendCreditSummary.Module",Ext.form.Panel,{resizable:false,autoShow:true,header:false,items:[{xtype:"component",autoEl:{width:"100%",height:"100%",tag:"iframe",src:"index.php/sendCreditSummary/read"}}]},0,["sendcreditsummarymodule"],["component","box","container","panel","form","sendcreditsummarymodule"],{component:true,box:true,container:true,panel:true,form:true,sendcreditsummarymodule:true},["widget.sendcreditsummarymodule"],0,[MBilling.view.sendCreditSummary,"Module"],0));(Ext.cmd.derive("MBilling.view.sendCreditSummary.List",Ext.ux.grid.Panel,{store:"SendCreditSummary",initComponent:function(){var b=this;b.extraButtons=[{emptyText:t("From Day"),xtype:"searchfield",fieldFilter:"date",filterOnClick:b.filterFieldOnClick,store:b.store,comparison:"gt",type:"date"},{emptyText:t("To Day"),xtype:"searchfield",fieldFilter:"date",filterOnClick:b.filterFieldOnClick,store:b.store,comparison:"lt",type:"date"}];b.buttonCsv=false;b.buttonPrint=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("day"),renderer:Ext.util.Format.dateRenderer("Y-m-d"),dataIndex:"day",menuDisabled:true,flex:3},{header:t("service"),dataIndex:"service",flex:5},{header:t("Total cost"),dataIndex:"total_cost",flex:5,renderer:Helper.Util.formatMoneyDecimal2},{header:t("Total sale"),dataIndex:"total_sale",flex:5,renderer:Helper.Util.formatMoneyDecimal2},{header:t("Earned"),dataIndex:"earned",flex:5,renderer:Helper.Util.formatMoneyDecimal2}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["sendcreditsummarylist"],["component","box","container","panel","tablepanel","gridpanel","grid","sendcreditsummarylist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,sendcreditsummarylist:true},["widget.sendcreditsummarylist"],0,[MBilling.view.sendCreditSummary,"List"],0));(Ext.cmd.derive("MBilling.view.sendCreditSummary.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:App.user.isClient}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["sendcreditsummaryform"],["component","box","container","panel","form","sendcreditsummaryform"],{component:true,box:true,container:true,panel:true,form:true,sendcreditsummaryform:true},["widget.sendcreditsummaryform"],0,[MBilling.view.sendCreditSummary,"Form"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayUser.Controller",Ext.ux.app.ViewController,{onEdit:function(){me=this;me.sumData=me.store.getData().items[0].getData();if(!me.sumData){return}me.formPanel.getForm().getFields().each(function(b){b.setValue(me.sumData[b.name])});me.formPanel.expand()},onExportCsvDayUser:function(o,l,g){var m=this,j=m.list.getStore(),n=m.list.filters.getFilterData().length?Ext.encode(m.list.filters.getFilterData()):j.proxy.extraParams.filter;window.open("index.php/callSummaryDayUser/exportCsvCalls?id="+o.getStore().getAt(l).getData().idUserusername+"&filter="+n)}},0,0,0,0,["controller.callsummarydayuser"],0,[MBilling.view.callSummaryDayUser,"Controller"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayUser.Module",Ext.ux.panel.Module,{controller:"callsummarydayuser",titleDetails:t("total"),iconForm:"icon-sum",cfgEast:{flex:0.4}},0,["callsummarydayusermodule"],["component","box","container","uxpanelmodule","callsummarydayusermodule"],{component:true,box:true,container:true,uxpanelmodule:true,callsummarydayusermodule:true},["widget.callsummarydayusermodule"],0,[MBilling.view.callSummaryDayUser,"Module"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayUser.List",Ext.ux.grid.Panel,{store:"CallSummaryDayUser",initComponent:function(){var b=this;b.buttonImportCsv=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{xtype:"actioncolumn",width:26,sortable:false,menuDisabled:true,header:t(""),dataIndex:"id",items:[{iconCls:"icon-export-csv",tooltip:t("Export CSV"),handler:"onExportCsvDayUser"}],hidden:!App.user.isAdmin},{header:t("day"),renderer:Ext.util.Format.dateRenderer("Y-m-d"),dataIndex:"day",filter:{type:"date",field:"day"},flex:3},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("sessiontime")+" "+t("Min"),dataIndex:"sessiontime",flex:2},{header:t("aloc_all_calls"),dataIndex:"aloc_all_calls",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Answered Calls"),dataIndex:"nbcall",flex:3},{header:t("buycost"),dataIndex:App.user.isAdmin?"buycost":"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("sessionbill"),dataIndex:App.user.isAgent||App.user.isClientAgent?"agent_bill":"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("markup"),dataIndex:"lucro",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarydayuserlist"],["component","box","container","panel","tablepanel","gridpanel","grid","callsummarydayuserlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callsummarydayuserlist:true},["widget.callsummarydayuserlist"],0,[MBilling.view.callSummaryDayUser,"List"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayUser.Form",Ext.ux.form.Panel,{defaults:{},labelWidthFields:100,defaultType:"displayfield",initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{name:"sumsessiontime",fieldLabel:t("sessiontime")+" "+t("Min"),renderer:Ext.util.Format.numberRenderer("0"),allowBlank:true},{name:App.user.isAgent||App.user.isClientAgent?"sumagent_bill":"sumsessionbill",fieldLabel:t("sessionbill"),renderer:Helper.Util.formatMoneyDecimal,allowBlank:true},{name:App.user.isAdmin?"sumbuycost":"sumsessionbill",fieldLabel:t("buycost"),renderer:Helper.Util.formatMoneyDecimal,hidden:App.user.isClient,allowBlank:true},{name:"sumlucro",fieldLabel:t("markup"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumnbcall",fieldLabel:t("nbcall"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarydayuserform"],["component","box","container","panel","form","callsummarydayuserform"],{component:true,box:true,container:true,panel:true,form:true,callsummarydayuserform:true},["widget.callsummarydayuserform"],0,[MBilling.view.callSummaryDayUser,"Form"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayTrunk.Controller",Ext.ux.app.ViewController,{onEdit:function(){me=this;me.sumData=me.store.getData().items[0].getData();if(!me.sumData){return}me.formPanel.getForm().getFields().each(function(b){b.setValue(me.sumData[b.name])});me.formPanel.expand()}},0,0,0,0,["controller.callsummarydaytrunk"],0,[MBilling.view.callSummaryDayTrunk,"Controller"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayTrunk.Module",Ext.ux.panel.Module,{controller:"callsummarydaytrunk",titleDetails:t("total"),iconForm:"icon-sum",cfgEast:{flex:0.4}},0,["callsummarydaytrunkmodule"],["component","box","container","uxpanelmodule","callsummarydaytrunkmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callsummarydaytrunkmodule:true},["widget.callsummarydaytrunkmodule"],0,[MBilling.view.callSummaryDayTrunk,"Module"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayTrunk.List",Ext.ux.grid.Panel,{store:"CallSummaryDayTrunk",initComponent:function(){var b=this;b.buttonImportCsv=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{header:t("day"),renderer:Ext.util.Format.dateRenderer("Y-m-d"),dataIndex:"day",filter:{type:"date",field:"day"},flex:3},{header:t("Trunk"),dataIndex:"idTrunktrunkcode",filter:{type:"string",field:"idTrunk.trunkcode"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("sessiontime")+" "+t("Min"),dataIndex:"sessiontime",flex:2},{header:t("aloc_all_calls"),dataIndex:"aloc_all_calls",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Answered Calls"),dataIndex:"nbcall",flex:3},{header:t("buycost"),dataIndex:"buycost",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("sessionbill"),dataIndex:"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("markup"),dataIndex:"lucro",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarydaytrunklist"],["component","box","container","panel","tablepanel","gridpanel","grid","callsummarydaytrunklist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callsummarydaytrunklist:true},["widget.callsummarydaytrunklist"],0,[MBilling.view.callSummaryDayTrunk,"List"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayTrunk.Form",Ext.ux.form.Panel,{defaults:{},labelWidthFields:100,defaultType:"displayfield",initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{name:"sumsessiontime",fieldLabel:t("sessiontime")+" "+t("Min"),renderer:Ext.util.Format.numberRenderer("0"),allowBlank:true},{name:"sumsessionbill",fieldLabel:t("sessionbill"),renderer:Helper.Util.formatMoneyDecimal,allowBlank:true},{name:"sumbuycost",fieldLabel:t("buycost"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumlucro",fieldLabel:t("markup"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumnbcall",fieldLabel:t("nbcall"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarydaytrunkform"],["component","box","container","panel","form","callsummarydaytrunkform"],{component:true,box:true,container:true,panel:true,form:true,callsummarydaytrunkform:true},["widget.callsummarydaytrunkform"],0,[MBilling.view.callSummaryDayTrunk,"Form"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayAgent.Controller",Ext.ux.app.ViewController,{onEdit:function(){me=this;me.sumData=me.store.getData().items[0].getData();if(!me.sumData){return}me.formPanel.getForm().getFields().each(function(b){b.setValue(me.sumData[b.name])});me.formPanel.expand()}},0,0,0,0,["controller.callsummarydayagent"],0,[MBilling.view.callSummaryDayAgent,"Controller"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayAgent.Module",Ext.ux.panel.Module,{controller:"callsummarydayagent",titleDetails:t("total"),iconForm:"icon-sum",cfgEast:{flex:0.4}},0,["callsummarydayagentmodule"],["component","box","container","uxpanelmodule","callsummarydayagentmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callsummarydayagentmodule:true},["widget.callsummarydayagentmodule"],0,[MBilling.view.callSummaryDayAgent,"Module"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayAgent.List",Ext.ux.grid.Panel,{store:"CallSummaryDayAgent",initComponent:function(){var b=this;b.buttonImportCsv=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{header:t("day"),renderer:Ext.util.Format.dateRenderer("Y-m-d"),dataIndex:"day",filter:{type:"date",field:"day"},flex:3},{header:t("Agent"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{menuDisabled:true,header:t("sessiontime")+" "+t("Min"),dataIndex:"sessiontime",flex:2},{header:t("aloc_all_calls"),dataIndex:"aloc_all_calls",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Answered Calls"),dataIndex:"nbcall",flex:3},{header:t("buycost"),dataIndex:"buycost",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("sessionbill"),dataIndex:"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("markup"),dataIndex:"lucro",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarydayagentlist"],["component","box","container","panel","tablepanel","gridpanel","grid","callsummarydayagentlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callsummarydayagentlist:true},["widget.callsummarydayagentlist"],0,[MBilling.view.callSummaryDayAgent,"List"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayAgent.Form",Ext.ux.form.Panel,{defaults:{},labelWidthFields:100,defaultType:"displayfield",initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{name:"sumsessiontime",fieldLabel:t("sessiontime")+" "+t("Min"),renderer:Ext.util.Format.numberRenderer("0"),allowBlank:true},{name:"sumsessionbill",fieldLabel:t("sessionbill"),renderer:Helper.Util.formatMoneyDecimal,allowBlank:true},{name:"sumbuycost",fieldLabel:t("buycost"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumlucro",fieldLabel:t("markup"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumnbcall",fieldLabel:t("nbcall"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarydayagentform"],["component","box","container","panel","form","callsummarydayagentform"],{component:true,box:true,container:true,panel:true,form:true,callsummarydayagentform:true},["widget.callsummarydayagentform"],0,[MBilling.view.callSummaryDayAgent,"Form"],0));(Ext.cmd.derive("MBilling.view.callerid.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.callerid"],0,[MBilling.view.callerid,"Controller"],0));(Ext.cmd.derive("MBilling.view.callerid.Module",Ext.ux.panel.Module,{controller:"callerid"},0,["calleridmodule"],["component","box","container","uxpanelmodule","calleridmodule"],{component:true,box:true,container:true,uxpanelmodule:true,calleridmodule:true},["widget.calleridmodule"],0,[MBilling.view.callerid,"Module"],0));(Ext.cmd.derive("MBilling.view.callerid.List",Ext.ux.grid.Panel,{store:"Callerid",initComponent:function(){var b=this;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("cid"),dataIndex:"cid",flex:4},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("status"),dataIndex:"activated",renderer:Helper.Util.formatBooleanActive,comboRelated:"booleancombo",flex:2,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")]]}}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["calleridlist"],["component","box","container","panel","tablepanel","gridpanel","grid","calleridlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,calleridlist:true},["widget.calleridlist"],0,[MBilling.view.callerid,"List"],0));(Ext.cmd.derive("MBilling.view.callerid.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["id_user"],initComponent:function(){var b=this;b.items=[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"cid",fieldLabel:t("cid")},{xtype:"booleancombo",name:"activated",fieldLabel:t("status"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["calleridform"],["component","box","container","panel","form","calleridform"],{component:true,box:true,container:true,panel:true,form:true,calleridform:true},["widget.calleridform"],0,[MBilling.view.callerid,"Form"],0));(Ext.cmd.derive("MBilling.view.restrictedPhonenumber.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.restrictedphonenumber"],0,[MBilling.view.restrictedPhonenumber,"Controller"],0));(Ext.cmd.derive("MBilling.view.restrictedPhonenumber.Module",Ext.ux.panel.Module,{controller:"restrictedphonenumber"},0,["restrictedphonenumbermodule"],["component","box","container","uxpanelmodule","restrictedphonenumbermodule"],{component:true,box:true,container:true,uxpanelmodule:true,restrictedphonenumbermodule:true},["widget.restrictedphonenumbermodule"],0,[MBilling.view.restrictedPhonenumber,"Module"],0));(Ext.cmd.derive("MBilling.view.restrictedPhonenumber.List",Ext.ux.grid.Panel,{store:"RestrictedPhonenumber",buttonImportCsv:true,initComponent:function(){var b=this;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:2,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("number"),dataIndex:"number",flex:2}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["restrictedphonenumberlist"],["component","box","container","panel","tablepanel","gridpanel","grid","restrictedphonenumberlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,restrictedphonenumberlist:true},["widget.restrictedphonenumberlist"],0,[MBilling.view.restrictedPhonenumber,"List"],0));(Ext.cmd.derive("MBilling.view.restrictedPhonenumber.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["id_user"],initComponent:function(){var b=this;b.items=[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,readOnly:App.user.isClient,allowBlank:App.user.isClient},{name:"number",fieldLabel:t("number")}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["restrictedphonenumberform"],["component","box","container","panel","form","restrictedphonenumberform"],{component:true,box:true,container:true,panel:true,form:true,restrictedphonenumberform:true},["widget.restrictedphonenumberform"],0,[MBilling.view.restrictedPhonenumber,"Form"],0));(Ext.cmd.derive("MBilling.view.restrictedPhonenumber.ImportCsv",Ext.ux.window.ImportCsv,{htmlTipInfo:"
number
",fieldsImport:[{xtype:"usercombo",width:350}]},0,["restrictedphonenumberimportcsv"],["component","box","container","panel","window","restrictedphonenumberimportcsv"],{component:true,box:true,container:true,panel:true,window:true,restrictedphonenumberimportcsv:true},["widget.restrictedphonenumberimportcsv"],0,[MBilling.view.restrictedPhonenumber,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.did.Controller",Ext.ux.app.ViewController,{isSubmitForm:true,init:function(){var b=this;b.control({"booleancombo[name=cbr]":{select:b.onSelectcbr},"noyescombo[name=cbr_ua]":{select:b.onSelectcbrAu}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectcbr:function(c,d){me=this,form=me.formPanel.getForm();form.findField("cbr_ua").setVisible(d.data.field1);form.findField("cbr_total_try").setVisible(d.data.field1);form.findField("cbr_time_try").setVisible(d.data.field1)},onSelectcbrAu:function(c,d){me=this,form=me.formPanel.getForm();form.findField("cbr_em").setVisible(d.data.field1);form.findField("TimeOfDay_monFri").setVisible(d.data.field1);form.findField("TimeOfDay_sat").setVisible(d.data.field1);form.findField("TimeOfDay_sun").setVisible(d.data.field1);form.findField("workaudio").setVisible(d.data.field1);form.findField("noworkaudio").setVisible(d.data.field1)},onNew:function(e){var f=this,d=f.formPanel.getForm();d.findField("cbr_ua").setVisible(false);d.findField("cbr_em").setVisible(false);d.findField("TimeOfDay_monFri").setVisible(false);d.findField("TimeOfDay_sat").setVisible(false);d.findField("TimeOfDay_sun").setVisible(false);d.findField("workaudio").setVisible(false);d.findField("noworkaudio").setVisible(false);d.findField("cbr_total_try").setVisible(false);d.findField("cbr_time_try").setVisible(false);Ext.ux.app.ViewController.prototype.onNew.apply(this,arguments)},onEdit:function(){var c=this,d=c.list.getSelectionModel().getSelection()[0];if(d.get("cbr")==0){c.formPanel.getForm().findField("cbr_ua").setVisible(false);c.formPanel.getForm().findField("cbr_em").setVisible(false);c.formPanel.getForm().findField("TimeOfDay_monFri").setVisible(false);c.formPanel.getForm().findField("TimeOfDay_sat").setVisible(false);c.formPanel.getForm().findField("TimeOfDay_sun").setVisible(false);c.formPanel.getForm().findField("workaudio").setVisible(false);c.formPanel.getForm().findField("noworkaudio").setVisible(false);c.formPanel.getForm().findField("cbr_total_try").setVisible(false);c.formPanel.getForm().findField("cbr_time_try").setVisible(false)}else{c.formPanel.getForm().findField("cbr_ua").setVisible(true);if(d.get("cbr_ua")==1){c.formPanel.getForm().findField("cbr_em").setVisible(true);c.formPanel.getForm().findField("TimeOfDay_monFri").setVisible(true);c.formPanel.getForm().findField("TimeOfDay_sat").setVisible(true);c.formPanel.getForm().findField("TimeOfDay_sun").setVisible(true);c.formPanel.getForm().findField("workaudio").setVisible(true);c.formPanel.getForm().findField("noworkaudio").setVisible(true);c.formPanel.getForm().findField("cbr_total_try").setVisible(true);c.formPanel.getForm().findField("cbr_time_try").setVisible(true)}}Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)},onDelete:function(j){var g=this,e=g.list.getSelectionModel().getSelection(),f=true;Ext.each(e,function(a){if(a.get("reserved")===1){Ext.ux.Alert.alert(g.titleError,t("Please, first release the DID")+" "+a.raw.did,"error");f=false;return}});if(f==true){Ext.ux.app.ViewController.prototype.onDelete.apply(this,arguments)}},onRelease:function(o,l){var m=this,n=m.list.getSelectionModel().getSelection()[0],j=t("Confirm Release Did")+" "+n.get("did"),g=m.list.getStore();if(m.list.getSelectionModel().getSelection().length>1){Ext.ux.Alert.alert(m.titleError,t("Please Select only one DID to release"),"error")}else{if(n.get("reserved")===0){Ext.ux.Alert.alert(m.titleError,t("didIsNotUse"),"error");g.load()}else{Ext.Msg.confirm(m.titleConfirmation,j,function(a){if(a==="yes"){Ext.Ajax.request({url:"index.php/did/liberar",params:{id:n.get("id")},success:function(c){c=Ext.decode(c.responseText);if(c[m.nameSuccessRequest]){Ext.ux.Alert.alert(m.titleSuccess,c[m.nameMsgRequest],"success");g.load()}else{var b=Helper.Util.convertErrorsJsonToString(c[m.nameMsgRequest]);g.load()}}})}},m)}}},onBuyDid:function(){var m=this,j=m.lookupReference("buydidPanel"),f=j.getForm().findField("did").getValue(),l=j.getForm().findField("did").rawValue,g=t("confirmationBuyDid");if(f<1){Ext.ux.Alert.alert(m.titleError,t("Please, select a Did"),"warning")}else{Ext.Msg.confirm(t("Confirmation"),g+"
"+l,function(a){if(a==="yes"){Ext.ux.Alert.alert(m.titleSuccess,t("Please wait....We are activing your DID."),"notification");Ext.Ajax.request({url:"index.php/did/buy",params:{id:f},success:function(c){c=Ext.decode(c.responseText);if(c.success){Ext.ux.Alert.alert(m.titleSuccess,t(c.msg),"success",true,true,5000)}else{var b=Helper.Util.convertErrorsJsonToString(c.msg);Ext.ux.Alert.alert(m.titleError,t(b),"warning",true,true,5000)}}})}},m)}}},0,0,0,0,["controller.did"],0,[MBilling.view.did,"Controller"],0));(Ext.cmd.derive("MBilling.view.did.Combo",Ext.form.field.ComboBox,{name:"id_did",fieldLabel:t("did"),displayField:"did",forceSelection:true,editable:true,valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Did",{proxy:{type:"uxproxy",module:"did",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["didcombo"],["component","box","field","textfield","pickerfield","combobox","combo","didcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,didcombo:true},["widget.didcombo"],0,[MBilling.view.did,"Combo"],0));(Ext.cmd.derive("MBilling.view.did.BuyCombo",Ext.form.field.ComboBox,{name:"id_did",forceSelection:true,editable:false,fieldLabel:t("did"),displayField:"did",valueField:"id",listConfig:{itemTpl:Ext.create("Ext.XTemplate","
{did} ("+t("Setup")+": "+t("moedasimblo")+" {connection_charge} --> "+t("monthly payment")+": "+t("moedasimblo")+" {fixrate})
")},displayTpl:Ext.create("Ext.XTemplate",'{did} ('+t("Setup")+": "+t("moedasimblo")+" {connection_charge} --> "+t("monthly payment")+": "+t("moedasimblo")+" {fixrate})"),initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Did",{proxy:{type:"uxproxy",module:"did",actionRead:"readBuy",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["didbuycombo"],["component","box","field","textfield","pickerfield","combobox","combo","didbuycombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,didbuycombo:true},["widget.didbuycombo"],0,[MBilling.view.did,"BuyCombo"],0));(Ext.cmd.derive("MBilling.view.did.Module",Ext.ux.panel.Module,{controller:"did"},0,["didmodule"],["component","box","container","uxpanelmodule","didmodule"],{component:true,box:true,container:true,uxpanelmodule:true,didmodule:true},["widget.didmodule"],0,[MBilling.view.did,"Module"],0));(Ext.cmd.derive("MBilling.view.did.List",Ext.ux.grid.Panel,{store:"Did",fieldSearch:"did",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.extraButtons=[{text:t("crearToReleaseDid"),iconCls:"icon-delete",handler:"onRelease",disabled:false}];b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("did"),dataIndex:"did",flex:4},{header:t("reserved"),dataIndex:"reserved",renderer:Helper.Util.formattyyesno,flex:2,filter:{type:"list",options:[[1,t("yes")],[0,t("no")]]},hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:3,menuDisabled:true},{header:t("status"),dataIndex:"activated",renderer:Helper.Util.formatBooleanActive,flex:2,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")]]},hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("connection_charge"),dataIndex:"connection_charge",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("price")+" "+t("per")+" "+t("monthly"),dataIndex:"fixrate",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("secondusedreal"),renderer:Helper.Util.formatsecondsToTime,dataIndex:"secondusedreal",flex:3},{header:t("Description"),dataIndex:"description",hidden:true,hideable:App.user.isAdmin,flex:5}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["didlist"],["component","box","container","panel","tablepanel","gridpanel","grid","didlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,didlist:true},["widget.didlist"],0,[MBilling.view.did,"List"],0));(Ext.cmd.derive("MBilling.view.did.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["did"],initComponent:function(){var b=this;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{labelAlign:"right",plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true,labelWidth:140}},items:[{title:t("general"),items:[{name:"did",fieldLabel:t("did"),readOnly:App.user.isClient||App.user.isAgent},{xtype:"booleancombo",name:"activated",fieldLabel:t("status"),hidden:App.user.isClient||App.user.isAgent,allowBlank:true},{xtype:"moneyfield",name:"connection_charge",fieldLabel:t("connection_charge"),value:"0",hidden:App.user.isClient||App.user.isAgent},{xtype:"moneyfield",name:"fixrate",fieldLabel:t("Monthly")+" "+t("price"),value:"0",hidden:App.user.isClient||App.user.isAgent},{style:"margin-top:5px",xtype:"fieldset",title:t("Did")+" "+t("increment"),collapsible:false,collapsed:false,hidden:!App.user.isAdmin,defaults:{labelWidth:160,anchor:"100%",labelAlign:b.labelAlignFields},items:[{xtype:"moneyfield",name:"connection_sell",fieldLabel:t("Connetion charge"),value:"0",hidden:!App.user.isAdmin},{xtype:"numberfield",name:"minimal_time_charge",fieldLabel:t("Minimal time to charge"),value:"0",hidden:!App.user.isAdmin},{xtype:"numberfield",name:"initblock",fieldLabel:t("initblock"),value:"0",hidden:!App.user.isAdmin},{xtype:"numberfield",name:"increment",fieldLabel:t("billingblock"),value:"0",hidden:!App.user.isAdmin}]},{xtype:"combobox",name:"charge_of",fieldLabel:t("Charge")+" "+t("of"),value:1,forceSelection:true,editable:false,store:[[1,t("Owner DID")],[0,t("Caller ID, only allow call from registered callerID")]],hidden:App.user.isClient||App.user.isAgent},{xtype:"numberfield",name:"calllimit",fieldLabel:t("Channel Limit"),value:"-1",minValue:"-1",hidden:!window.didChannelLimit||!App.user.isAdmin},{xtype:"textareafield",allowBlank:true,name:"description",fieldLabel:t("description"),hidden:!App.user.isAdmin}]},{title:t("Billing"),items:[{style:"margin-top:5px",xtype:"fieldset",title:t("Did Billing per minute")+" "+t("rate")+" 1",collapsible:false,collapsed:false,hidden:!App.user.isAdmin,defaults:{labelWidth:170,anchor:"100%",labelAlign:b.labelAlignFields},items:[{xtype:"textfield",name:"expression_1",fieldLabel:t("Regular expression"),value:"*",hidden:!App.user.isAdmin},{xtype:"moneyfield",name:"selling_rate_1",fieldLabel:t("Sell price per min"),value:"0",hidden:!App.user.isAdmin},{xtype:"noyescombo",name:"block_expression_1",fieldLabel:t("Block calls from this expression"),hidden:!App.user.isAdmin},{xtype:"noyescombo",name:"send_to_callback_1",fieldLabel:t("Send the call to Callback"),hidden:!App.user.isAdmin}]},{style:"margin-top:25px",xtype:"fieldset",title:t("Did Billing per minute")+" "+t("rate")+" 2",collapsible:false,collapsed:false,hidden:!App.user.isAdmin,defaults:{labelWidth:160,anchor:"100%",labelAlign:b.labelAlignFields},items:[{xtype:"textfield",name:"expression_2",fieldLabel:t("Regular expression"),value:"*",hidden:!App.user.isAdmin},{xtype:"moneyfield",name:"selling_rate_2",fieldLabel:t("Sell price per min"),value:"0",hidden:!App.user.isAdmin},{xtype:"noyescombo",name:"block_expression_2",fieldLabel:t("Block calls from this expression"),hidden:!App.user.isAdmin},{xtype:"noyescombo",name:"send_to_callback_2",fieldLabel:t("Send the call to Callback"),hidden:!App.user.isAdmin}]},{style:"margin-top:25px",xtype:"fieldset",title:t("Did Billing per minute")+" "+t("rate")+" 3",collapsible:false,collapsed:false,hidden:!App.user.isAdmin,defaults:{labelWidth:160,anchor:"100%",labelAlign:b.labelAlignFields},items:[{xtype:"textfield",name:"expression_3",fieldLabel:t("Regular expression"),value:"*",hidden:!App.user.isAdmin},{xtype:"moneyfield",name:"selling_rate_3",fieldLabel:t("Sell price per min"),value:"0",hidden:!App.user.isAdmin},{xtype:"noyescombo",name:"block_expression_3",fieldLabel:t("Block calls from this expression"),hidden:!App.user.isAdmin},{xtype:"noyescombo",name:"send_to_callback_3",fieldLabel:t("Send the call to Callback"),hidden:!App.user.isAdmin}]}]},{title:t("CallBack Pro"),hidden:!window.cbr,items:[{xtype:"booleancombo",name:"cbr",fieldLabel:t("CallBack Pro"),value:0,hidden:!window.cbr,allowBlank:true},{xtype:"noyescombo",name:"cbr_ua",fieldLabel:t("Use Audio"),value:0,hidden:true,allowBlank:true},{xtype:"numberfield",name:"cbr_total_try",fieldLabel:t("Maximum trying"),value:3,hidden:true,allowBlank:true,minValue:0},{xtype:"numberfield",name:"cbr_time_try",fieldLabel:t("Interval beteween trying"),value:30,hidden:true,allowBlank:true,minValue:10},{xtype:"noyescombo",name:"cbr_em",fieldLabel:t("Early Media"),hidden:true,allowBlank:true},{name:"TimeOfDay_monFri",fieldLabel:t("Mon-Fri"),value:"09:00-12:00|14:00-18:00",minLength:11,hidden:true},{name:"TimeOfDay_sat",fieldLabel:t("Sat"),value:"09:00-12:00",allowBlank:true,hidden:true},{name:"TimeOfDay_sun",fieldLabel:t("Sun"),value:"00:00",allowBlank:true,hidden:true},{xtype:"uploadfield",fieldLabel:t("workaudio"),emptyText:"Select an gsm File",allowBlank:true,name:"workaudio",extAllowed:["wav","gsm"],hidden:true},{xtype:"uploadfield",fieldLabel:t("noworkaudio"),emptyText:"Select an gsm File",allowBlank:true,name:"noworkaudio",extAllowed:["wav","gsm"],hidden:true}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["didform"],["component","box","container","panel","form","didform"],{component:true,box:true,container:true,panel:true,form:true,didform:true},["widget.didform"],0,[MBilling.view.did,"Form"],0));(Ext.cmd.derive("MBilling.view.did.ImportCsv",Ext.ux.window.ImportCsv,{htmlTipInfo:"
"+t("number")+", "+t("price")+" "+t("by")+" "+t("monthly")+", "+t("connection_charge")+"
551156332233, 10, 5
554153882200, 10, 5
554155667788, 10, 5
"+t("monthly")+" "+t("and")+" "+t("connection_charge")+" "+t("optional")+"",fieldsImport:[{fieldLabel:t("table"),hidden:true,allowBlank:true}]},0,["didimportcsv"],["component","box","container","panel","window","didimportcsv"],{component:true,box:true,container:true,panel:true,window:true,didimportcsv:true},["widget.didimportcsv"],0,[MBilling.view.did,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.didbuy.Module",Ext.form.Panel,{controller:"did",resizable:false,autoShow:true,header:false,initComponent:function(){var b=this;b.items=[{reference:"buydidPanel",xtype:"form",margin:"10 10 10 10",autoShow:true,closable:false,resizable:false,bodyPadding:10,defaultType:"textfield",defaults:{labelAlign:"right",labelWidth:175,width:280,allowBlank:false,msgTarget:"side",enableKeyEvents:true,plugins:"markallowblank",anchor:"100%"},items:[{xtype:"didbuycombo",fieldLabel:t("Select a Did"),name:"did"}],bbar:[{text:t("Next"),tooltip:t("Next"),glyph:icons.disk,handler:"onBuyDid"}]}];Ext.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["didbuymodule"],["component","box","container","panel","form","didbuymodule"],{component:true,box:true,container:true,panel:true,form:true,didbuymodule:true},["widget.didbuymodule"],0,[MBilling.view.didbuy,"Module"],0));(Ext.cmd.derive("MBilling.view.diddestination.Controller",Ext.ux.app.ViewController,{init:function(){var b=this;b.control({didtypefullcombo:{select:b.onSelectMethod},didtypefreecombo:{select:b.onSelectMethod}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectMethod:function(c,d){this.showFieldsRelated(d.getData().showFields)},showFieldsRelated:function(f){var d=this,e=d.formPanel.getForm().getFields();e.each(function(a){a.setVisible(f.indexOf(a.name)!==-1)})},onEdit:function(){var f=this,d=f.formPanel.getForm(),e=f.list.getSelectionModel().getSelection()[0];method=e?e.get("voip_call"):"sipcall";switch(method){case 0:method=t("callforpstn");break;case 1:method=t("sipcall");break;case 2:method=t("ivr");break;case 3:method="CallingCard";break;case 4:method=t("portalDeVoz");break;case 5:method=t("CID Callback");break;case 6:method=t("0800 Callback");break;case 7:method=t("Queue");break;case 8:method=t("Call Group");break;case 9:method=t("Custom");break}showFields=f.formPanel.down("didtypefullcombo").store.findRecord("name",method).getData().showFields;f.showFieldsRelated(showFields);d.findField("id_did").setReadOnly(true);Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)},onNew:function(){var f=this,d=f.formPanel.getForm(),e=f.list.getSelectionModel().getSelection()[0];d.findField("id_did").setReadOnly(false);method=t("sipcall");showFields=f.formPanel.down("didtypefullcombo").store.findRecord("name",method).getData().showFields;f.showFieldsRelated(showFields);Ext.ux.app.ViewController.prototype.onNew.apply(this,arguments)}},0,0,0,0,["controller.diddestination"],0,[MBilling.view.diddestination,"Controller"],0));(Ext.cmd.derive("MBilling.view.diddestination.Module",Ext.ux.panel.Module,{controller:"diddestination"},0,["diddestinationmodule"],["component","box","container","uxpanelmodule","diddestinationmodule"],{component:true,box:true,container:true,uxpanelmodule:true,diddestinationmodule:true},["widget.diddestinationmodule"],0,[MBilling.view.diddestination,"Module"],0));(Ext.cmd.derive("MBilling.view.diddestination.List",Ext.ux.grid.Panel,{store:"Diddestination",fieldSearch:"idDid.did",initComponent:function(){var b=this;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("did"),dataIndex:"idDiddid",filter:{type:"string",field:"idDid.did"},flex:5},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("type")+" "+t("of")+" "+t("call"),dataIndex:"voip_call",renderer:Helper.Util.formatDidType,comboRelated:"didtypecombo",flex:3,filter:{type:"list",options:[[0,t("callforpstn")],[1,t("sipcall")],[2,t("ivr")],[3,t("callingcard")],[4,t("portalDeVoz")],[5,t("CID Callback")],[6,t("0800 Callback")],[7,t("Queue")],[8,t("Call Group")],[9,t("Custom")]]}},{header:t("secondusedreal"),renderer:Helper.Util.formatsecondsToTime,dataIndex:"secondusedreal",flex:3},{header:t("creationdate"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"creationdate",flex:5}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["diddestinationlist"],["component","box","container","panel","tablepanel","gridpanel","grid","diddestinationlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,diddestinationlist:true},["widget.diddestinationlist"],0,[MBilling.view.diddestination,"List"],0));(Ext.cmd.derive("MBilling.view.diddestination.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["id_user","id_did"],initComponent:function(){var b=this;b.items=[{name:"id_did",fieldLabel:t("DID"),xtype:"didcombo"},{xtype:"userlookup",ownerForm:b,hidden:true,allowBlank:App.user.isClient},{xtype:"booleancombo",name:"activated",fieldLabel:t("status"),allowBlank:false},{xtype:"numbercombo",name:"priority",fieldLabel:t("priority"),allowBlank:true},{style:"margin-top:25px",xtype:"fieldset",title:t("Did Destination"),collapsible:true,collapsed:false,defaults:{labelWidth:75,anchor:"100%",labelAlign:b.labelAlignFields},items:[{xtype:"didtypefullcombo",name:"voip_call",fieldLabel:t("type")+" "+t("of")+" "+t("call")},{xtype:"textfield",name:"destination",fieldLabel:t("Destination"),value:"",allowBlank:true,hidden:App.user.isClient||App.user.isAgent},{xtype:"ivrlookup",ownerForm:b,name:"id_ivr",fieldLabel:t("IVR"),allowBlank:true},{xtype:"queuelookup",ownerForm:b,name:"id_queue",fieldLabel:t("Queue"),allowBlank:true},{xtype:"siplookup",ownerForm:b,name:"id_sip",fieldLabel:t("SIP"),allowBlank:true}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["diddestinationform"],["component","box","container","panel","form","diddestinationform"],{component:true,box:true,container:true,panel:true,form:true,diddestinationform:true},["widget.diddestinationform"],0,[MBilling.view.diddestination,"Form"],0));(Ext.cmd.derive("MBilling.view.diddestination.Combo",Ext.form.field.ComboBox,{fieldLabel:t("typepaid"),displayField:"name",valueField:"id",forceSelection:true,editable:false,value:1,store:{fields:["id","name"],data:[{id:"0",name:t("callforpstn"),showFields:["voip_call","destination","id_did","id_user","activated"]},{id:"1",name:t("sipcall"),showFields:["voip_call","id_sip","id_did","id_user","activated","priority"]},{id:"2",name:t("ivr"),showFields:["voip_call","id_did","id_ivr","id_user","activated"]},{id:"3",name:"CallingCard",showFields:["voip_call","id_did","id_user","activated"]},{id:"4",name:t("portalDeVoz"),showFields:["voip_call","id_did","id_user","activated"]},{id:"5",name:t("CID Callback"),showFields:["voip_call","id_did","id_user","activated"]},{id:"6",name:t("0800 Callback"),showFields:["voip_call","id_did","id_user","activated"]},{id:"7",name:t("Queue"),showFields:["voip_call","id_did","id_queue","id_user","activated"]},{id:"8",name:t("Call Group"),showFields:["voip_call","destination","id_did","id_user","activated"]},{id:"9",name:t("Custom"),showFields:["voip_call","destination","id_did","id_user","activated"]}]}},0,["didtypefullcombo"],["component","box","field","textfield","pickerfield","combobox","combo","didtypefullcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,didtypefullcombo:true},["widget.didtypefullcombo"],0,[MBilling.view.diddestination,"Combo"],0));(Ext.cmd.derive("MBilling.view.diddestination.freeCombo",Ext.form.field.ComboBox,{fieldLabel:t("typepaid"),displayField:"name",forceSelection:true,editable:false,valueField:"id",value:1,store:{fields:["id","name"],data:[{id:"0",name:t("callforpstn"),showFields:["voip_call","id_did","destination","id_user","activated"]},{id:"1",name:t("sipcall"),showFields:["voip_call","id_did","id_sip","id_user","activated","priority"]},{id:"2",name:t("ivr"),showFields:["voip_call","id_did","id_ivr","id_user"]},{id:"3",name:"CallingCard",showFields:["voip_call","id_did","id_user"]},{id:"4",name:t("portalDeVoz"),showFields:["voip_call","id_did","id_user"]}]}},0,["didtypefreecombo"],["component","box","field","textfield","pickerfield","combobox","combo","didtypefreecombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,didtypefreecombo:true},["widget.didtypefreecombo"],0,[MBilling.view.diddestination,"freeCombo"],0));(Ext.cmd.derive("MBilling.view.didUse.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.diduse"],0,[MBilling.view.didUse,"Controller"],0));(Ext.cmd.derive("MBilling.view.didUse.Module",Ext.ux.panel.Module,{controller:"diduse"},0,["didusemodule"],["component","box","container","uxpanelmodule","didusemodule"],{component:true,box:true,container:true,uxpanelmodule:true,didusemodule:true},["widget.didusemodule"],0,[MBilling.view.didUse,"Module"],0));(Ext.cmd.derive("MBilling.view.didUse.List",Ext.ux.grid.Panel,{store:"DidUse",initComponent:function(){var b=this;b.buttonCsv=false;b.allowPrint=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("did"),dataIndex:"idDiddid",flex:5},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("monthpayed"),dataIndex:"month_payed",flex:2},{header:t("reservationdate"),renderer:Helper.Util.formatDateTime,dataIndex:"reservationdate",flex:5},{header:t("releasedate"),renderer:Helper.Util.formatDateTime,dataIndex:"releasedate",flex:5}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["diduselist"],["component","box","container","panel","tablepanel","gridpanel","grid","diduselist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,diduselist:true},["widget.diduselist"],0,[MBilling.view.didUse,"List"],0));(Ext.cmd.derive("MBilling.view.didUse.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,readOnly:true},{xtype:"didcombo",readOnly:true},{xtype:"datefield",name:"reservationdate",fieldLabel:t("reservationdate"),format:"Y-m-d H:i:s"}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["diduseform"],["component","box","container","panel","form","diduseform"],{component:true,box:true,container:true,panel:true,form:true,diduseform:true},["widget.diduseform"],0,[MBilling.view.didUse,"Form"],0));(Ext.cmd.derive("MBilling.view.dashboard.Module",Ext.panel.Panel,{autoShow:true,header:false,initComponent:function(){var b=this;width=window.isTablet?Ext.Element.getViewportWidth()-240:Ext.Element.getViewportWidth()-220;showDid=showBuy=false;if(!App.user.isAdmin){Ext.each(App.user.menu,function(a){if(!Ext.isEmpty(a.rows)){Ext.each(a.rows,function(d){if(d.module=="didbuy"){showDid=true}if(d.module=="buycredit"){showBuy=true}},b)}},b)}widthView=Ext.Element.getViewportWidth()-430;heightView=Ext.Element.getViewportHeight()-137;heightViewFace=heightView+23;facebookhtml='
';if(!App.user.isAdmin&&App.user.social_media_network.length>10){facebookhtml='
'}if(window.customDashboard&&!App.user.isAdmin){b.items=[{header:false,bodyPadding:0,style:"background-color:transparent;",bodyStyle:"background-color:transparent !important;",html:'
',collapseDirection:"bottom",collapsible:true,autoScroll:true,height:Ext.Element.getViewportHeight()}]}else{b.items=[{width:!window.isDesktop?width:"NULL",header:false,xtype:"dashboard",listeners:{activate:"setRunnerInfoSystem"},glyph:icons.home,title:t("Home"),stateful:false,items:[{columnWidth:App.user.isAdmin?1/2:1,items:[{title:t("callonline"),items:{xtype:"callonlinelist2"},hidden:window.isTablet||!App.user.isAdmin,height:App.user.isClient?250:300},{title:t("Simultaneous Call"),items:{xtype:"callonlinechartchart"},hidden:window.isTablet||!App.user.isAdmin,iconCls:"icon-chart-column",glyph:undefined}]},{hidden:App.user.isAdmin,columnWidth:App.user.isClient?1/2:1,items:[{title:t("BuyCredit"),items:{xtype:"buycreditmodule"},height:window.isTablet?250:170,hidden:!showBuy}]},{hidden:App.user.isAdmin,columnWidth:1/2,items:[{title:t("Buy")+" "+t("did"),items:{xtype:"didbuymodule"},height:window.isTablet?250:170,hidden:!showDid||!App.user.isClient},{iconCls:"icon-info",title:t("NEWS"),bodyPadding:0,style:"background-color:transparent;",bodyStyle:"background-color:transparent !important;",hidden:App.user.isAdmin||App.user.social_media_network.length<=10,html:facebookhtml,collapseDirection:"bottom",collapsible:true,autoScroll:true,height:300}]},{columnWidth:1/2,items:[{iconCls:"icon-info",title:t("NEWS"),bodyPadding:0,style:"background-color:transparent;",bodyStyle:"background-color:transparent !important;",hidden:!App.user.isAdmin||window.isTablet||window.isTablets||App.user.l.slice(4,7)=="syn",html:facebookhtml,collapseDirection:"bottom",collapsible:true,autoScroll:true,height:300},{title:t("Refill Summary"),iconCls:"icon-chart-column",glyph:undefined,items:{xtype:"refillchart"},hidden:!App.user.isAdmin||window.isTablet}]}]}]}Ext.panel.Panel.prototype.initComponent.apply(this,arguments)}},0,["dashboardmodule"],["component","box","container","panel","dashboardmodule"],{component:true,box:true,container:true,panel:true,dashboardmodule:true},["widget.dashboardmodule"],0,[MBilling.view.dashboard,"Module"],0));(Ext.cmd.derive("MBilling.view.dashboardQueue.Module",Ext.panel.Panel,{autoShow:true,header:false,initComponent:function(){var b=this;b.items=[{width:!window.isDesktop?width:"NULL",header:false,xtype:"dashboard",listeners:{activate:"setRunnerInfoSystem"},glyph:icons.home,title:t("Home"),stateful:false,items:[{columnWidth:1/2,items:[{title:t("Queue Monitor"),items:{xtype:"queuedashboardlist"},height:window.heightView}]},{columnWidth:1/2,items:[{title:t("Agent Monitor"),iconCls:"icon-chart-column",glyph:undefined,items:{xtype:"queuememberdashboardlist"},height:window.heightView}]}]}];Ext.panel.Panel.prototype.initComponent.apply(this,arguments)}},0,["dashboardqueuemodule"],["component","box","container","panel","dashboardqueuemodule"],{component:true,box:true,container:true,panel:true,dashboardqueuemodule:true},["widget.dashboardqueuemodule"],0,[MBilling.view.dashboardQueue,"Module"],0));(Ext.cmd.derive("MBilling.view.ivr.Controller",Ext.ux.app.ViewController,{isSubmitForm:true,init:function(){var b=this;b.control({typedestinationcombo:{select:b.onSelectMethod}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectMethod:function(c,d){this.showFieldsRelated(d.getData().showFields)},showFieldsRelated:function(l){var m=this,n=m.formPanel.getForm(),j=m.formPanel.getForm().getFields(),g=Ext.get(Ext.Element.getActiveElement()).component,o=g.name.substr(-2);m.onSetVisibleFiel(g,n,o,g.value)},onSetVisibleFiel:function(f,j,e,g){if(f.value=="undefined"){f.setValue("undefined")}if(f.name.match("^type_10")){j.findField("id_queue_10").setVisible(g.match("^queue"));j.findField("id_sip_10").setVisible(g.match("^sip"));j.findField("id_ivr_10").setVisible(g.match("^ivr"));j.findField("extension_10").setVisible(g.match("^group|^number|^custom"))}else{if(f.name.match("^type_[0-9]")){j.findField("id_queue"+e).setVisible(g.match("^queue"));j.findField("id_sip"+e).setVisible(g.match("^sip"));j.findField("id_ivr"+e).setVisible(g.match("^ivr"));j.findField("extension"+e).setVisible(g.match("^group|^number|^custom"))}else{if(f.name.match("^type_out_10")){j.findField("id_queue_out_10").setVisible(g.match("^queue"));j.findField("id_ivr_out_10").setVisible(g.match("^ivr"));j.findField("id_sip_out_10").setVisible(g.match("^sip"));j.findField("extension_out_10").setVisible(g.match("^group|^number|^custom"))}else{j.findField("id_queue_out"+e).setVisible(g.match("^queue"));j.findField("id_sip_out"+e).setVisible(g.match("^sip"));j.findField("id_ivr_out"+e).setVisible(g.match("^ivr"));j.findField("extension_out"+e).setVisible(g.match("^group|^number|^custom"))}}}},onEdit:function(){var g=this,j=g.formPanel.getForm(),f=g.list.getSelectionModel().getSelection()[0];for(var e=0;e<=10;e++){fieldValue=f.getData()["type_"+e];fieldValueOut=f.getData()["type_out_"+e];if(fieldValue=="ivr"){j.findField("id_ivr_"+e).setVisible(true);j.findField("id_sip_"+e).setVisible(false);j.findField("id_queue_"+e).setVisible(false);j.findField("extension_"+e).setVisible(false)}else{if(fieldValue=="sip"){j.findField("id_sip_"+e).setVisible(true);j.findField("id_ivr_"+e).setVisible(false);j.findField("id_queue_"+e).setVisible(false);j.findField("extension_"+e).setVisible(false)}else{if(fieldValue=="queue"){j.findField("id_queue_"+e).setVisible(true);j.findField("id_sip_"+e).setVisible(false);j.findField("id_ivr_"+e).setVisible(false);j.findField("extension_"+e).setVisible(false)}else{if(fieldValue.match("custom|number|group")){j.findField("extension_"+e).setVisible(true);j.findField("id_ivr_"+e).setVisible(false);j.findField("id_sip_"+e).setVisible(false);j.findField("id_queue_"+e).setVisible(false)}else{j.findField("id_queue_"+e).setVisible(false);j.findField("id_sip_"+e).setVisible(false);j.findField("id_ivr_"+e).setVisible(false);j.findField("extension_"+e).setVisible(false)}}}}if(fieldValueOut=="ivr"){j.findField("id_ivr_out_"+e).setVisible(true);j.findField("id_sip_out_"+e).setVisible(false);j.findField("id_queue_out_"+e).setVisible(false);j.findField("extension_out_"+e).setVisible(false)}else{if(fieldValueOut=="sip"){j.findField("id_sip_out_"+e).setVisible(true);j.findField("id_ivr_out_"+e).setVisible(false);j.findField("id_queue_out_"+e).setVisible(false);j.findField("extension_out_"+e).setVisible(false)}else{if(fieldValueOut=="queue"){j.findField("id_queue_out_"+e).setVisible(true);j.findField("id_sip_out_"+e).setVisible(false);j.findField("id_ivr_out_"+e).setVisible(false);j.findField("extension_out_"+e).setVisible(false)}else{if(fieldValueOut.match("custom|number|group")){j.findField("extension_out_"+e).setVisible(true);j.findField("id_ivr_out_"+e).setVisible(false);j.findField("id_sip_out_"+e).setVisible(false);j.findField("id_queue_out_"+e).setVisible(false)}else{j.findField("id_queue_out_"+e).setVisible(false);j.findField("id_sip_out_"+e).setVisible(false);j.findField("id_ivr_out_"+e).setVisible(false);j.findField("extension_out_"+e).setVisible(false)}}}}}Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)},onNew:function(){var g=this,j=g.formPanel.getForm(),f=g.list.getSelectionModel().getSelection()[0];for(var e=0;e<=10;e++){j.findField("id_ivr_"+e).setVisible(false);j.findField("id_sip_"+e).setVisible(false);j.findField("id_queue_"+e).setVisible(false);j.findField("id_ivr_out_"+e).setVisible(false);j.findField("id_sip_out_"+e).setVisible(false);j.findField("id_queue_out_"+e).setVisible(false)}Ext.ux.app.ViewController.prototype.onNew.apply(this,arguments)}},0,0,0,0,["controller.ivr"],0,[MBilling.view.ivr,"Controller"],0));(Ext.cmd.derive("MBilling.view.ivr.Module",Ext.ux.panel.Module,{controller:"ivr"},0,["ivrmodule"],["component","box","container","uxpanelmodule","ivrmodule"],{component:true,box:true,container:true,uxpanelmodule:true,ivrmodule:true},["widget.ivrmodule"],0,[MBilling.view.ivr,"Module"],0));(Ext.cmd.derive("MBilling.view.ivr.List",Ext.ux.grid.Panel,{store:"Ivr",initComponent:function(){var b=this;b.allowPrint=false;b.buttonCsv=false;b.columns=b.columns||[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("name"),dataIndex:"name",flex:5},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["ivrlist"],["component","box","container","panel","tablepanel","gridpanel","grid","ivrlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,ivrlist:true},["widget.ivrlist"],0,[MBilling.view.ivr,"List"],0));(Ext.cmd.derive("MBilling.view.ivr.Form",Ext.ux.form.Panel,{bodyPadding:0,fileUpload:true,initComponent:function(){var b=this;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{plugins:"markallowblank",allowBlank:false,anchor:"100%",labelAlign:"right"}},items:[{title:t("general"),items:[{name:"name",fieldLabel:t("name")},{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"monFriStart",fieldLabel:t("monFriStart"),value:"09:00",maxLength:5,minLength:5},{name:"monFriStop",fieldLabel:t("monFriStop"),value:"18:00",maxLength:5,minLength:5},{name:"satStart",fieldLabel:t("satStart"),value:"09:00",maxLength:5,minLength:5},{name:"satStop",fieldLabel:t("satStop"),value:"12:00",maxLength:5,minLength:5},{name:"sunStart",fieldLabel:t("sunStart"),value:"09:00",maxLength:5,minLength:5},{name:"sunStop",fieldLabel:t("sunStop"),value:"12:00",maxLength:5,minLength:5},{xtype:"uploadfield",fieldLabel:t("workaudio"),emptyText:"Select an wav or gsm File",allowBlank:true,name:"workaudio",labelWidth:120,extAllowed:["wav","gsm"]},{xtype:"uploadfield",fieldLabel:t("noworkaudio"),emptyText:"Select an wav or gsm File",allowBlank:true,labelWidth:120,name:"noworkaudio",extAllowed:["wav","gsm"]}]},{title:t("options")+" "+t("work"),itemId:"option",defaults:{xtype:"fieldcontainer",layout:"hbox",plugins:"markallowblank",allowBlank:true,anchor:"100%",labelWidth:100,defaults:{hideLabel:true,hidden:true,flex:5,startX:100,allowBlank:true,ownerForm:b}},items:[{xtype:"menuseparator",width:"100%"},{labelStyle:"font-weight:bold",xtype:"displayfield",value:''+t("Select the destination to send call when caller press any digits.")+"",allowBlank:true},{xtype:"menuseparator",width:"100%"},{fieldLabel:t("option")+" 0",items:[{name:"type_0",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_0",displayField:"id_ivr_0_name"},{xtype:"queuelookup",name:"id_queue_0",displayField:"id_queue_0_name"},{xtype:"siplookup",name:"id_sip_0",displayField:"id_sip_0_name"},{xtype:"textfield",name:"extension_0"}]},{fieldLabel:t("option")+" 1",items:[{name:"type_1",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_1",displayField:"id_ivr_1_name"},{xtype:"queuelookup",name:"id_queue_1",displayField:"id_queue_1_name"},{xtype:"siplookup",name:"id_sip_1",displayField:"id_sip_1_name"},{xtype:"textfield",name:"extension_1"}]},{fieldLabel:t("option")+" 2",items:[{name:"type_2",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_2",displayField:"id_ivr_2_name"},{xtype:"queuelookup",name:"id_queue_2",displayField:"id_queue_2_name"},{xtype:"siplookup",name:"id_sip_2",displayField:"id_sip_2_name"},{xtype:"textfield",name:"extension_2"}]},{fieldLabel:t("option")+" 3",items:[{name:"type_3",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_3",displayField:"id_ivr_3_name"},{xtype:"queuelookup",name:"id_queue_3",displayField:"id_queue_3_name"},{xtype:"siplookup",name:"id_sip_3",displayField:"id_sip_3_name"},{xtype:"textfield",name:"extension_3"}]},{fieldLabel:t("option")+" 4",items:[{name:"type_4",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_4",displayField:"id_ivr_4_name"},{xtype:"queuelookup",name:"id_queue_4",displayField:"id_queue_4_name"},{xtype:"siplookup",name:"id_sip_4",displayField:"id_sip_4_name"},{xtype:"textfield",name:"extension_4"}]},{fieldLabel:t("option")+" 5",items:[{name:"type_5",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_5",displayField:"id_ivr_5_name"},{xtype:"queuelookup",name:"id_queue_5",displayField:"id_queue_5_name"},{xtype:"siplookup",name:"id_sip_5",displayField:"id_sip_5_name"},{xtype:"textfield",name:"extension_5"}]},{fieldLabel:t("option")+" 6",items:[{name:"type_6",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_6",displayField:"id_ivr_6_name"},{xtype:"queuelookup",name:"id_queue_6",displayField:"id_queue_6_name"},{xtype:"siplookup",name:"id_sip_6",displayField:"id_sip_6_name"},{xtype:"textfield",name:"extension_6"}]},{fieldLabel:t("option")+" 7",items:[{name:"type_7",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_7",displayField:"id_ivr_7_name"},{xtype:"queuelookup",name:"id_queue_7",displayField:"id_queue_7_name"},{xtype:"siplookup",name:"id_sip_7",displayField:"id_sip_7_name"},{xtype:"textfield",name:"extension_7"}]},{fieldLabel:t("option")+" 8",items:[{name:"type_8",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_8",displayField:"id_ivr_8_name"},{xtype:"queuelookup",name:"id_queue_8",displayField:"id_queue_8_name"},{xtype:"siplookup",name:"id_sip_8",displayField:"id_sip_8_name"},{xtype:"textfield",name:"extension_8"}]},{fieldLabel:t("option")+" 9",items:[{name:"type_9",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_9",displayField:"id_ivr_9_name"},{xtype:"queuelookup",name:"id_queue_9",displayField:"id_queue_9_name"},{xtype:"siplookup",name:"id_sip_9",displayField:"id_sip_9_name"},{xtype:"textfield",name:"extension_9"}]},{fieldLabel:t("option")+" default",items:[{name:"type_10",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_10",displayField:"id_ivr_10_name"},{xtype:"queuelookup",name:"id_queue_10",displayField:"id_queue_10_name"},{xtype:"siplookup",name:"id_sip_10",displayField:"id_sip_10_name"},{xtype:"textfield",name:"extension_10"}]},{fieldLabel:t("Direct extension"),hidden:!window.didChannelLimit,name:"direct_extension",xtype:"noyescombo"}]},{title:t("options")+" "+t("not")+" "+t("work"),itemId:"optionOut",defaults:{xtype:"fieldcontainer",layout:"hbox",plugins:"markallowblank",allowBlank:true,anchor:"100%",labelWidth:100,defaults:{hideLabel:true,hidden:true,flex:5,startX:100,allowBlank:true,ownerForm:b}},items:[{xtype:"menuseparator",width:"100%"},{labelStyle:"font-weight:bold",xtype:"displayfield",value:''+t("Select the destination to send call when caller press any digits.")+"",allowBlank:true},{xtype:"menuseparator",width:"100%"},{fieldLabel:t("option")+" 0",items:[{name:"type_out_0",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_0",displayField:"id_ivr_out_0_name"},{xtype:"queuelookup",name:"id_queue_out_0",displayField:"id_queue_out_0_name"},{xtype:"siplookup",name:"id_sip_out_0",displayField:"id_sip_out_0_name"},{xtype:"textfield",name:"extension_out_0"}]},{fieldLabel:t("option")+" 1",items:[{name:"type_out_1",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_1",displayField:"id_ivr_out_1_name"},{xtype:"queuelookup",name:"id_queue_out_1",displayField:"id_queue_out_1_name"},{xtype:"siplookup",name:"id_sip_out_1",displayField:"id_sip_out_1_name"},{xtype:"textfield",name:"extension_out_1"}]},{fieldLabel:t("option")+" 2",items:[{name:"type_out_2",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_2",displayField:"id_ivr_out_2_name"},{xtype:"queuelookup",name:"id_queue_out_2",displayField:"id_queue_out_2_name"},{xtype:"siplookup",name:"id_sip_out_2",displayField:"id_sip_out_2_name"},{xtype:"textfield",name:"extension_out_2"}]},{fieldLabel:t("option")+" 3",items:[{name:"type_out_3",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_3",displayField:"id_ivr_out_3_name"},{xtype:"queuelookup",name:"id_queue_out_3",displayField:"id_queue_out_3_name"},{xtype:"siplookup",name:"id_sip_out_3",displayField:"id_sip_out_3_name"},{xtype:"textfield",name:"extension_out_3"}]},{fieldLabel:t("option")+" 4",items:[{name:"type_out_4",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_4",displayField:"id_ivr_out_4_name"},{xtype:"queuelookup",name:"id_queue_out_4",displayField:"id_queue_out_4_name"},{xtype:"siplookup",name:"id_sip_out_4",displayField:"id_sip_out_4_name"},{xtype:"textfield",name:"extension_out_4"}]},{fieldLabel:t("option")+" 5",items:[{name:"type_out_5",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_5",displayField:"id_ivr_out_5_name"},{xtype:"queuelookup",name:"id_queue_out_5",displayField:"id_queue_out_5_name"},{xtype:"siplookup",name:"id_sip_out_5",displayField:"id_sip_out_5_name"},{xtype:"textfield",name:"extension_out_5"}]},{fieldLabel:t("option")+" 6",items:[{name:"type_out_6",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_6",displayField:"id_ivr_out_6_name"},{xtype:"queuelookup",name:"id_queue_out_6",displayField:"id_queue_out_6_name"},{xtype:"siplookup",name:"id_sip_out_6",displayField:"id_sip_out_6_name"},{xtype:"textfield",name:"extension_out_6"}]},{fieldLabel:t("option")+" 7",items:[{name:"type_out_7",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_7",displayField:"id_ivr_out_7_name"},{xtype:"queuelookup",name:"id_queue_out_7",displayField:"id_queue_out_7_name"},{xtype:"siplookup",name:"id_sip_out_7",displayField:"id_sip_out_7_name"},{xtype:"textfield",name:"extension_out_7"}]},{fieldLabel:t("option")+" 8",items:[{name:"type_out_8",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_8",displayField:"id_ivr_out_8_name"},{xtype:"queuelookup",name:"id_queue_out_8",displayField:"id_queue_out_8_name"},{xtype:"siplookup",name:"id_sip_out_8",displayField:"id_sip_out_8_name"},{xtype:"textfield",name:"extension_out_8"}]},{fieldLabel:t("option")+" 9",items:[{name:"type_out_9",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_9",displayField:"id_ivr_out_9_name"},{xtype:"queuelookup",name:"id_queue_out_9",displayField:"id_queue_out_9_name"},{xtype:"siplookup",name:"id_sip_out_9",displayField:"id_sip_out_9_name"},{xtype:"textfield",name:"extension_out_9"}]},{fieldLabel:t("option")+" default",items:[{name:"type_out_10",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_10",displayField:"id_ivr_out_10_name"},{xtype:"queuelookup",name:"id_queue_out_10",displayField:"id_queue_out_10_name"},{xtype:"siplookup",name:"id_sip_out_10",displayField:"id_sip_out_10_name"},{xtype:"textfield",name:"extension_out_10"}]}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["ivrform"],["component","box","container","panel","form","ivrform"],{component:true,box:true,container:true,panel:true,form:true,ivrform:true},["widget.ivrform"],0,[MBilling.view.ivr,"Form"],0));(Ext.cmd.derive("MBilling.view.ivr.Lookup",Ext.ux.form.field.Lookup,{name:"id_ivr",fieldLabel:t("Ivr"),displayField:"idIvrname",displayFieldList:"name",gridConfig:{xtype:"ivrlist",fieldSearch:"name",columns:[{header:t("name"),dataIndex:"name",flex:5},{header:t("user"),dataIndex:"idUsernumber",filter:{type:"string",field:"idUser.username"},flex:4}]}},0,["ivrlookup"],["component","box","container","fieldcontainer","ivrlookup"],{component:true,box:true,container:true,fieldcontainer:true,ivrlookup:true},["widget.ivrlookup"],0,[MBilling.view.ivr,"Lookup"],0));(Ext.cmd.derive("MBilling.view.queue.Controller",Ext.ux.app.ViewController,{isSubmitForm:true,init:function(){var b=this;b.control({"combobox[name=ring_or_moh]":{select:b.onSelectringOrMOH}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectringOrMOH:function(c,d){me=this,form=me.formPanel.getForm();form.findField("musiconhold").setVisible(d.data.field1=="moh")},onNew:function(){var b=this;b.formPanel.getForm().findField("musiconhold").setVisible(true);Ext.ux.app.ViewController.prototype.onNew.apply(this,arguments)},onEdit:function(){var b=this;Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments);ringOrMoh=b.formPanel.getForm().findField("ring_or_moh").getValue();b.formPanel.getForm().findField("musiconhold").setVisible(ringOrMoh=="moh")},onResetQueueStats:function(m){var j=this,f=j.list.getSelectionModel().getSelection()[0],l=Ext.encode(j.list.filters.getFilterData()),g=[];if(f){Ext.each(j.list.getSelectionModel().getSelection(),function(a){g.push(a.get(j.idProperty))});Ext.Ajax.request({url:"index.php/queue/resetQueueStats",params:{ids:Ext.encode(g),filter:l},scope:j,success:function(b){b=Ext.decode(b.responseText);if(b[j.nameSuccessRequest]){Ext.ux.Alert.alert(j.titleSuccess,b.msg,"success")}else{var a=Helper.Util.convertErrorsJsonToString(b[j.nameMsgRequest]);Ext.ux.Alert.alert(j.titleError,a,"notification")}}})}else{Ext.ux.Alert.alert(j.titleError,t("Please select one or more queue"),"notification")}},onDeleteMusic:function(e){var f=this,d=f.list.getSelectionModel().getSelection()[0];if(f.list.getSelectionModel().getSelection().length==1){Ext.Ajax.request({url:"index.php/queue/deleteMusicOnHold",params:{id_queue:d.get("id")},scope:f,success:function(a){a=Ext.decode(a.responseText);if(a[f.nameSuccessRequest]){Ext.ux.Alert.alert(f.titleSuccess,a[f.nameMsgRequest],"success")}else{Ext.ux.Alert.alert(f.titleError,a[f.nameMsgRequest],"error")}}})}else{Ext.ux.Alert.alert(f.titleError,"Please Select only a record","notification")}}},0,0,0,0,["controller.queue"],0,[MBilling.view.queue,"Controller"],0));(Ext.cmd.derive("MBilling.view.queue.Combo",Ext.form.field.ComboBox,{fieldLabel:t("status"),value:"ringall",forceSelection:true,editable:false,store:[["ringall",t("Ringall")+" - "+t("ring all available channels until one answers")],["rrmemory",t("Rrmemory")+" - "+t("round robin with memory, remember where we left off last ring pass")],["leastrecent",t("Leastrecent")+" - "+t("ring interface which was least recently called by this queue")],["fewestcalls",t("Fewestcalls")+" - "+t("ring the one with fewest completed calls from this queue")],["random",t("Random")+" -"+t("ring random interface")],["linear",t("Linear")+" - "+t("Rings interfaces in the order they are listed in the configuration file. Dynamic members will be rung in the order in which they were added")],["wrandom",t("Wrandom")+" -"+t("Rings a random interface, but uses the agent's penalty as a weight")]]},0,["queuestrategycombo"],["component","box","field","textfield","pickerfield","combobox","combo","queuestrategycombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,queuestrategycombo:true},["widget.queuestrategycombo"],0,[MBilling.view.queue,"Combo"],0));(Ext.cmd.derive("MBilling.view.queue.Module",Ext.ux.panel.Module,{controller:"queue"},0,["queuemodule"],["component","box","container","uxpanelmodule","queuemodule"],{component:true,box:true,container:true,uxpanelmodule:true,queuemodule:true},["widget.queuemodule"],0,[MBilling.view.queue,"Module"],0));(Ext.cmd.derive("MBilling.view.queue.List",Ext.ux.grid.Panel,{store:"Queue",initComponent:function(){var b=this;b.buttonCsv=false;b.allowPrint=false;b.buttonUpdateLot=false;b.extraButtons=[{text:t("Reset Queue Stats"),iconCls:"call",handler:"onResetQueueStats",disabled:false,hidden:!App.user.isAdmin},{text:t("Delete Musiconhold"),iconCls:"call",handler:"onDeleteMusic",disabled:false,hidden:!App.user.isAdmin}];b.columns=b.columns||[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("name"),dataIndex:"name",flex:4},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("Strategy"),dataIndex:"strategy",flex:4},{header:t("Talk Time"),dataIndex:"var_talktime",flex:3},{header:t("Total Calls"),dataIndex:"var_totalCalls",flex:3},{header:t("Answered"),dataIndex:"var_answeredCalls",flex:3}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["queuelist"],["component","box","container","panel","tablepanel","gridpanel","grid","queuelist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,queuelist:true},["widget.queuelist"],0,[MBilling.view.queue,"List"],0));(Ext.cmd.derive("MBilling.view.queue.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["id_user","name"],fileUpload:true,initComponent:function(){var b=this;b.labelWidthFields=160;b.items=[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"name",fieldLabel:t("name")},{xtype:"languagecombo",name:"language",value:App.user.language=="pt_BR"?"br":App.user.language,fieldLabel:t("language")},{xtype:"queuestrategycombo",name:"strategy",fieldLabel:t("Strategy")},{xtype:"yesnostringcombo",name:"ringinuse",fieldLabel:t("Ringinuse")},{xtype:"numberfield",name:"timeout",fieldLabel:t("Ring Agent per"),value:30},{xtype:"numberfield",name:"retry",fieldLabel:t("Retry other agent"),value:1},{xtype:"numberfield",name:"wrapuptime",fieldLabel:t("Time next calls"),value:1},{xtype:"numberfield",name:"weight",fieldLabel:t("Weigh"),value:0},{name:"periodic-announce",fieldLabel:t("Periodic announce"),value:"queue-periodic-announce"},{xtype:"numberfield",name:"periodic-announce-frequency",fieldLabel:t("Periodic frequency"),value:30},{xtype:"yesnostringcombo",name:"announce-position",fieldLabel:t("Announce position")},{xtype:"yesnostringcombo",name:"announce-holdtime",fieldLabel:t("Announce Holdtime")},{xtype:"numberfield",name:"announce-frequency",fieldLabel:t("Announce Frequency"),value:45},{xtype:"combobox",forceSelection:true,editable:false,value:"yes",store:[["no",t("No")],["yes",t("Yes")],["unavailable,invalid,unknown",t("unavailable,invalid,unknown")],["penalty,paused,invalid,unavailable",t("penalty,paused,invalid,unavailable")]],name:"joinempty",fieldLabel:t("Join empty")},{xtype:"combobox",forceSelection:true,editable:false,value:"no",store:[["no",t("No")],["yes",t("Yes")],["unavailable,invalid,unknown",t("unavailable,invalid,unknown")],["penalty,paused,invalid,unavailable",t("penalty,paused,invalid,unavailable")]],fieldLabel:t("Leave when empty"),name:"leavewhenempty"},{xtype:"combobox",forceSelection:true,editable:false,value:"moh",store:[["moh",t("MOH")],["ring",t("Ring")]],fieldLabel:t("Ring or playing MOH"),name:"ring_or_moh"},{xtype:"uploadfield",fieldLabel:t("Audio")+" "+t("musiconhold"),emptyText:t("Select an wav mono 8khz or gsm File"),allowBlank:true,name:"musiconhold",extAllowed:["wav","gsm"]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["queueform"],["component","box","container","panel","form","queueform"],{component:true,box:true,container:true,panel:true,form:true,queueform:true},["widget.queueform"],0,[MBilling.view.queue,"Form"],0));(Ext.cmd.derive("MBilling.view.queue.Lookup",Ext.ux.form.field.Lookup,{name:"id_queue",fieldLabel:t("Queue"),displayField:"idQueuename",displayFieldList:"name",gridConfig:{xtype:"queuelist",fieldSearch:"name",columns:[{header:t("name"),dataIndex:"name",flex:2}]}},0,["queuelookup"],["component","box","container","fieldcontainer","queuelookup"],{component:true,box:true,container:true,fieldcontainer:true,queuelookup:true},["widget.queuelookup"],0,[MBilling.view.queue,"Lookup"],0));(Ext.cmd.derive("MBilling.view.queue.ListDashboard",Ext.ux.grid.Panel,{store:"QueueDashBoard",refreshTime:5,selType:"rowmodel",initComponent:function(){var b=this;b.refreshTime=(localStorage&&localStorage.getItem("queuerefresh"))||b.refreshTime;b.extraButtons=[{text:t("Spy")+" "+t("call"),iconCls:"call",handler:function(a){module=b.getView();console.log(module.panel.items.items[0].getSelectionModel().getSelection());Ext.widget("callonlinespycall",{title:module.titleModule,list:module.panel.items.items[0]})},width:130,disabled:false,hidden:!window.multSpy},{xtype:"numberfield",field:"jmlhBrg",fieldLabel:t("Refresh Time"),editable:false,minValue:5,labelWidth:90,width:150,selectOnFocus:true,allowDecimals:true,decimalPrecision:2,value:b.refreshTime,listeners:{change:function(a){if(a.value>0){b.refreshTime=a.value;localStorage.setItem("queuerefresh",a.value)}}}}];b.columns=[{header:t("Channel"),hidden:true,dataIndex:"channel",flex:3},{header:t("Queue"),dataIndex:"queue_name",flex:3},{header:t("Agent"),dataIndex:"agentName",flex:3},{header:t("status"),dataIndex:"status",renderer:Helper.Util.formatQueueState,flex:4},{header:t("CallerID"),dataIndex:"callerId",flex:4},{header:t("Duration"),dataIndex:"duration",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Wait Time"),dataIndex:"holdtime",renderer:Helper.Util.formatsecondsToTime,flex:3}];b.sessionLoad=Ext.create("Ext.util.DelayedTask",function(){b.store.load()},b);Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments);b.store.on("load",b.onLoadStore,b)},onLoadStore:function(){var b=this;b.onDeactivateModule();b.onActivateModule()},onRender:function(){var b=this;if(Ext.isObject(b.module)){b.module.on("activate",b.onActivateModule,b);b.module.on("deactivate",b.onDeactivateModule,b);b.module.on("close",b.onCloseModule,b)}Ext.ux.grid.Panel.prototype.onRender.apply(this,arguments)},onActivateModule:function(){this.sessionLoad&&this.sessionLoad.delay(this.refreshTime*1000)},onDeactivateModule:function(){this.sessionLoad&&this.sessionLoad.cancel()},onCloseModule:function(){this.onDeactivateModule();this.sessionLoad=null}},0,["queuedashboardlist"],["component","box","container","panel","tablepanel","gridpanel","grid","queuedashboardlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,queuedashboardlist:true},["widget.queuedashboardlist"],0,[MBilling.view.queue,"ListDashboard"],0));(Ext.cmd.derive("MBilling.view.queueMember.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.queuemember"],0,[MBilling.view.queueMember,"Controller"],0));(Ext.cmd.derive("MBilling.view.queueMember.Module",Ext.ux.panel.Module,{controller:"queuemember"},0,["queuemembermodule"],["component","box","container","uxpanelmodule","queuemembermodule"],{component:true,box:true,container:true,uxpanelmodule:true,queuemembermodule:true},["widget.queuemembermodule"],0,[MBilling.view.queueMember,"Module"],0));(Ext.cmd.derive("MBilling.view.queueMember.List",Ext.ux.grid.Panel,{store:"QueueMember",initComponent:function(){var b=this;b.columns=[{header:t("Uniqueid"),dataIndex:"uniqueid",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("destination"),dataIndex:"interface",flex:4},{header:t("queues"),dataIndex:"queue_name",flex:4},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("paused"),dataIndex:"paused",renderer:Helper.Util.formattyyesno,filter:{type:"list",options:[[0,t("no")],[1,t("yes")]]},flex:2}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["queuememberlist"],["component","box","container","panel","tablepanel","gridpanel","grid","queuememberlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,queuememberlist:true},["widget.queuememberlist"],0,[MBilling.view.queueMember,"List"],0));(Ext.cmd.derive("MBilling.view.queueMember.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["id_user","queue_name"],initComponent:function(){var b=this;b.items=[{xtype:"queuelookup",ownerForm:b,displayField:"queue_name",name:"queue_name",hidden:App.user.isClient,allowBlank:App.user.isClient},{xtype:"siplookup",ownerForm:b,name:"interface",displayField:"interface"},{xtype:"noyescombo",name:"paused",fieldLabel:t("paused"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["queuememberform"],["component","box","container","panel","form","queuememberform"],{component:true,box:true,container:true,panel:true,form:true,queuememberform:true},["widget.queuememberform"],0,[MBilling.view.queueMember,"Form"],0));(Ext.cmd.derive("MBilling.view.queueMember.ListDashboard",Ext.ux.grid.Panel,{store:"QueueMemberDashBoard",refreshTime:5,selType:"rowmodel",initComponent:function(){var b=this;b.refreshTime=(localStorage&&localStorage.getItem("queueagentrefresh"))||b.refreshTime;b.extraButtons=[{xtype:"numberfield",field:"jmlhBrg",fieldLabel:t("Refresh Time"),editable:false,minValue:5,labelWidth:90,width:150,selectOnFocus:true,allowDecimals:true,decimalPrecision:2,value:b.refreshTime,listeners:{change:function(a){if(a.value>0){b.refreshTime=a.value;localStorage.setItem("queueagentrefresh",a.value)}}}}];b.columns=[{header:t("Agent"),dataIndex:"agentName",flex:3},{header:t("Queue"),dataIndex:"idQueuename",flex:5},{header:t("Status"),dataIndex:"agentStatus",renderer:Helper.Util.formatQueueAgentState,flex:4},{header:t("Number"),dataIndex:"number",flex:4},{header:t("Calls"),dataIndex:"totalCalls",flex:2},{header:t("Last call"),dataIndex:"last_call",renderer:Helper.Util.formatsecondsToTime,flex:3}];b.sessionLoad=Ext.create("Ext.util.DelayedTask",function(){b.store.load()},b);Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments);if(window.isDesktop){b.store.load()}b.store.on("load",b.onLoadStore,b)},onLoadStore:function(){var b=this;b.onDeactivateModule();b.onActivateModule()},onRender:function(){var b=this;if(Ext.isObject(b.module)){b.module.on("activate",b.onActivateModule,b);b.module.on("deactivate",b.onDeactivateModule,b);b.module.on("close",b.onCloseModule,b)}Ext.ux.grid.Panel.prototype.onRender.apply(this,arguments)},onActivateModule:function(){this.sessionLoad&&this.sessionLoad.delay(this.refreshTime*1000)},onDeactivateModule:function(){this.sessionLoad&&this.sessionLoad.cancel()},onCloseModule:function(){this.onDeactivateModule();this.sessionLoad=null}},0,["queuememberdashboardlist"],["component","box","container","panel","tablepanel","gridpanel","grid","queuememberdashboardlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,queuememberdashboardlist:true},["widget.queuememberdashboardlist"],0,[MBilling.view.queueMember,"ListDashboard"],0));(Ext.cmd.derive("MBilling.view.refill.Controller",Ext.ux.app.ViewController,{aliasChart:"refillchart",onPrint:function(e){var f=this;if(App.user.isClient){var f=this,d=f.list.getSelectionModel().getSelection()[0];if(f.list.getSelectionModel().getSelection().length==1){console.log(d.data.description.indexOf("Send Credit "));if(d.data.description.indexOf("Send Credit ")!==-1){url="index.php/transferToMobile/printRefill/?id="+d.get("id");window.open(url)}else{Ext.ux.app.ViewController.prototype.onPrint.apply(this,arguments)}}else{Ext.ux.app.ViewController.prototype.onPrint.apply(this,arguments)}}else{Ext.ux.app.ViewController.prototype.onPrint.apply(this,arguments)}},onInvoice:function(e){var f=this;var f=this,d=f.list.getSelectionModel().getSelection()[0];if(f.list.getSelectionModel().getSelection().length==1){url="index.php/invoices/printInvoice/?id="+d.get("id");window.open(url)}else{Ext.ux.Alert.alert(f.titleError,t("Not available to multi refill."),"error")}},onSelectionChange:function(f,e){var j=this,g=j.lookupReference("invoice");g&&g.setDisabled(!e.length);Ext.ux.app.ViewController.prototype.onSelectionChange.apply(this,arguments)},onRenderModule:function(){var c=this,d=c.lookupReference("chart");Ext.ux.app.ViewController.prototype.onRenderModule.apply(this,arguments);if(App.user.isAdmin){c.store.on({scope:c,beforeload:function(){d.el&&d.disable()},load:function(a){d.el&&d.enable();c.onSetTotal()}})}else{c.store.on({scope:c,load:function(a){c.onSetTotal()}})}},onChart:function(){var b=this;b.chart=Ext.widget("window",{title:t("charts"),iconCls:"icon-chart-column",layout:"fit",autoShow:true,modal:true,resizable:false,width:window.isThemeNeptune?740:710,items:{xtype:b.aliasChart}});b.chart.down("#tbTextSum").setText(""+t("total")+": "+App.user.currency+" "+b.sumData.sumCredit+"")},onSetTotal:function(c){var d=this;if(!d.store.getData().items[0]){return}d.sumData=d.store.getData().items[0].getData();if(!d.sumData){return}d.lookupReference("tbTextTotal")&&d.lookupReference("tbTextTotal").setText(""+t("Refill Total")+": "+App.user.currency+" "+d.sumData.sumCredit+"")}},0,0,0,0,["controller.refill"],0,[MBilling.view.refill,"Controller"],0));(Ext.cmd.derive("MBilling.view.refill.Module",Ext.ux.panel.Module,{controller:"refill"},0,["refillmodule"],["component","box","container","uxpanelmodule","refillmodule"],{component:true,box:true,container:true,uxpanelmodule:true,refillmodule:true},["widget.refillmodule"],0,[MBilling.view.refill,"Module"],0));(Ext.cmd.derive("MBilling.view.refill.List",Ext.ux.grid.Panel,{store:"Refill",fieldSearch:"idUser.username",initComponent:function(){var b=this;b.buttonsTbar=[{xtype:"tbtext",reference:"tbTextTotal"}];if(App.user.isAdmin&&b.buttonCleanFilter){b.extraButtons=[{text:t("charts"),iconCls:"icon-chart-column",handler:"onChart",reference:"chart",disabled:true},{text:t("Invoice"),glyph:b.glyphPrint,handler:"onInvoice",reference:"invoice",hidden:!window.invoice,disabled:true}]}if(App.user.isClient){b.extraButtons=[{text:t("Invoice"),glyph:b.glyphPrint,handler:"onInvoice",reference:"invoice",hidden:!window.invoice,disabled:true}]}b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:3,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("credit"),dataIndex:"credit",renderer:Helper.Util.formatMoneyDecimal2,flex:2},{header:t("description"),dataIndex:"description",flex:5},{header:t("payment"),dataIndex:"payment",renderer:Helper.Util.formattyyesno,filter:{type:"list",options:[[0,t("no")],[1,t("yes")]]},flex:2},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"date",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["refilllist"],["component","box","container","panel","tablepanel","gridpanel","grid","refilllist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,refilllist:true},["widget.refilllist"],0,[MBilling.view.refill,"List"],0));(Ext.cmd.derive("MBilling.view.refill.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["id_user"],initComponent:function(){var b=this;b.items=[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient},{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,00",name:"credit",fieldLabel:t("credit"),readOnly:App.user.isClient},{xtype:"textareafield",name:"description",fieldLabel:t("description"),readOnly:App.user.isClient},{xtype:"yesnocombo",name:"payment",fieldLabel:t("add")+" "+t("payment"),hidden:App.user.isClient},{name:"invoice_number",fieldLabel:t("Invoice")+" "+t("number"),hidden:!window.invoice,allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["refillform"],["component","box","container","panel","form","refillform"],{component:true,box:true,container:true,panel:true,form:true,refillform:true},["widget.refillform"],0,[MBilling.view.refill,"Form"],0));(Ext.cmd.derive("Ext.ux.panel.Chart",Ext.panel.Panel,{rootData:undefined,positionLegendPie:"bottom",showLegendPie:true,widthTip:200,degressXLabel:0,fontLabel:"15px Arial",textBtnColumn:t("columns"),textBtnLine:t("lines"),textBtnBar:t("bars"),textBtnPie:t("pie"),iconBtnColumn:"icon-chart-column",iconBtnLine:"icon-chart-line",iconBtnBar:"icon-chart-bar",iconBtnPie:"icon-chart-pie",heightChart:400,charts:["column","bar","line","pie"],defaultChart:"column",limitCharLabelTip:25,bbarChart:[],tbarChart:[],minimumAxesY:0,border:false,layout:"card",btnShowColumn:true,btnShowBar:true,btnShowLine:true,btnShowPie:true,btnShowLineHidden:false,btnShowColumnHidden:false,showDownload:true,legend:null,titleText:"",fieldLabel:"",constructor:function(){var b=this;if(Ext.isString(b.store)){b.store=Ext.data.StoreManager.lookup(b.store);b.store.load({scope:b,callback:function(){if(b.store.getData().items[0]){b.sumData=b.store.getData().items[0].getData()}}})}Ext.panel.Panel.prototype.constructor.apply(this,arguments)},initComponent:function(){var s=this,x=s.charts.length,r,o,v,q,w=[],y=[],u=[],p,z;if(s.charts.length===1){s.defaultChart=s.charts[0]}s.fieldValue=Ext.isArray(s.fieldValue)?s.fieldValue:[s.fieldValue];if(s.rootData){p=Ext.getStore(s.store);z=p.model.proxy.reader.rawData;s.store=Ext.create("Ext.data.Store",{fields:Ext.Array.merge(s.fieldValue,s.fieldDescription),data:z&&z[s.rootData],proxy:{type:"memory",reader:{type:"json"}}});s.fieldValue=s.fieldValue[0].name||s.fieldValue[0];s.fieldDescription=s.fieldDescription.name||s.fieldDescription}Ext.each(s.fieldValue,function(a){u.push({type:"line",yField:a,xField:s.fieldDescription,marker:{radius:4},highlight:true,tooltip:{trackMouse:true,width:s.widthTip,renderer:s.rendererPie(s.fieldDescription,s.rendererFieldValue,s.rendererFieldDescription,s.limitCharLabelTip)}})});s.chartColumn={xtype:"cartesian",itemId:"column",height:s.heightChart,width:s.width,store:s.store,insetPadding:{top:s.titleText.length>0?40:10},axes:[{type:"numeric",title:s.labelYLine,position:"left",grid:true,minimum:s.minimumAxesY,renderer:s.rendererFieldValue||s.rendererDefault},{type:"category",title:s.labelXLine,position:"bottom",grid:true,renderer:s.rendererFieldDescription||s.rendererDefault,label:{rotate:{degrees:s.degressXLabel}}}],series:[{type:"bar",axis:"left",yField:s.fieldValue,xField:s.fieldDescription,highlight:true,tooltip:{width:s.widthTip,renderer:s.rendererPie(s.fieldDescription,s.rendererFieldValue,s.rendererFieldDescription,s.limitCharLabelTip)},label:{hidden:s.fieldLabel.length<1,field:s.fieldLabel,display:"insideEnd"}}],sprites:{hidden:s.titleText.length<1,type:"text",text:s.titleText,fontSize:22,width:100,height:30,x:40,y:20}};s.chartBar={xtype:"cartesian",itemId:"bar",height:s.heightChart,width:s.width,store:s.store,flipXY:true,insetPadding:{top:s.titleText.length>0?40:10},axes:[{type:"numeric",title:s.labelYLine,position:"bottom",fields:s.fieldValue,grid:true,minimum:s.minimumAxesY,renderer:s.rendererFieldValue||s.rendererDefault},{type:"category",title:s.labelXLine,position:"left",fields:s.fieldDescription,grid:true,renderer:s.rendererFieldDescription||s.rendererDefault}],series:[{type:"bar",yField:s.fieldValue,xField:s.fieldDescription,highlight:true,tooltip:{width:s.widthTip,renderer:s.rendererPie(s.fieldDescription,s.rendererFieldValue,s.rendererFieldDescription,s.limitCharLabelTip)},label:{hidden:s.fieldLabel.length<1,field:s.fieldLabel,display:"insideEnd"}}],sprites:{hidden:s.titleText.length<1,type:"text",text:s.titleText,fontSize:22,width:100,height:30,x:40,y:20}};s.chartLine={xtype:"cartesian",itemId:"line",height:s.heightChart,width:s.width,store:s.store,legend:s.legend,axes:[{type:"numeric",title:s.labelYLine,position:"left",fields:s.fieldValue,grid:true,minimum:s.minimumAxesY,renderer:s.rendererFieldValue||s.rendererDefault},{type:"category",title:s.labelXLine,position:"bottom",grid:true,fields:s.fieldDescription,renderer:s.rendererFieldDescription||s.rendererDefault}],series:u};s.chartPie={xtype:"polar",itemId:"pie",height:s.heightChart,width:s.width,store:s.store,legend:{position:s.positionLegendPie,renderer:s.rendererFieldDescription},series:[{type:"pie",angleField:s.fieldValue[0],showInLegend:s.showLegendPie,tooltip:{trackMouse:true,width:s.widthTip,renderer:s.rendererPie(s.fieldDescription,s.rendererFieldValue,s.rendererFieldDescription,s.limitCharLabelTip)},highlight:{segment:{margin:20}},label:{field:s.fieldDescription,display:"rotate",contrast:true,font:s.fontLabel,renderer:s.rendererFieldDescription||s.rendererDefault}}]};if(s.btnShowColumn){r={chart:"column",text:s.textBtnColumn,iconCls:s.iconBtnColumn,hidden:s.btnShowColumnHidden}}if(s.btnShowBar){o={chart:"bar",text:s.textBtnBar,iconCls:s.iconBtnBar}}if(s.btnShowLine){v={chart:"line",text:s.textBtnLine,iconCls:s.iconBtnLine,hidden:s.btnShowLineHidden}}if(s.btnShowPie){q={chart:"pie",text:s.textBtnPie,iconCls:s.iconBtnPie}}if(Ext.Array.contains(s.charts,"column")){w.push(s.chartColumn);y.push(r)}if(Ext.Array.contains(s.charts,"bar")){w.push(s.chartBar);y.push(o)}if(Ext.Array.contains(s.charts,"line")){w.push(s.chartLine);y.push(v)}if(Ext.Array.contains(s.charts,"pie")){w.push(s.chartPie);y.push(q)}s.bbarChart.push("->",{xtype:"buttongroup",toggleGroup:"typeChart",defaults:{enableToggle:true,allowDepress:false,toggleGroup:"typeChart",listeners:{scope:s,toggle:s.activeChart}},items:y});s.items=w;if(s.showDownload){s.tbarChart.push("->",{text:t("Download"),glyph:icons.disk,scope:s,handler:s.onDownload})}s.tbar=s.tbarChart;s.bbar=s.bbarChart;Ext.panel.Panel.prototype.initComponent.apply(this,arguments);s.activeItem=s.down("#"+s.defaultChart);s.down("button[chart="+s.defaultChart+"]").pressed=true},onDownload:function(){var b=this;b.getLayout().getActiveItem().download()},activeChart:function(d){var c=this;d.pressed&&c.getLayout().setActiveItem(c.down("#"+d.chart))},rendererPie:function(g,f,e,j){return function(a,o,c){var d=this,n=o.get(g),b=o.get(c.field);n=e?e(n):n;b=f?f(b):b;n=Ext.String.ellipsis(n,j)+": ";title=n+b;a.setHtml(title)}},rendererDefault:function(c,d){return d},rendererLegend:function(b){return t(b)}},1,["chartpanel"],["component","box","container","panel","chartpanel"],{component:true,box:true,container:true,panel:true,chartpanel:true},["widget.chartpanel"],0,[Ext.ux.panel,"Chart"],0));(Ext.cmd.derive("MBilling.view.refill.Chart",Ext.ux.panel.Chart,{controller:"refill",store:"RefillChart",fieldValue:"sumCreditMonth",fieldDescription:"CreditMonth",labelYLine:t("credit"),labelXLine:t("Month"),reference:"refillchart",btnShowColumn:true,btnShowBar:false,btnShowLine:false,btnShowPie:false,btnShowColumnHidden:true,initComponent:function(){var d=this,c;d.rendererFieldValue=Ext.util.Format.numberRenderer("0"),d.tbarChart=[{text:t("Per")+" "+t("Month"),scope:d,handler:"onPerMonth",reference:"btnMonth",disabled:true},{text:t("Per")+" "+t("day"),scope:d,handler:"onPerDay",reference:"btnDay"}];d.bbarChart=[{xtype:"tbtext",itemId:"tbTextSum"}];Ext.ux.panel.Chart.prototype.initComponent.apply(this,arguments)},onPerMonth:function(d){var c=this;c.lookupReference("btnMonth").disable();c.lookupReference("btnDay").enable();c.store.setRemoteFilter(true);c.store.filter("type","month");c.store.load()},onPerDay:function(d){var c=this;c.lookupReference("btnDay").disable();c.lookupReference("btnMonth").enable();c.store.setRemoteFilter(true);c.store.filter("type","day");c.store.load()}},0,["refillchart"],["component","box","container","panel","chartpanel","refillchart"],{component:true,box:true,container:true,panel:true,chartpanel:true,refillchart:true},["widget.refillchart"],0,[MBilling.view.refill,"Chart"],0));(Ext.cmd.derive("MBilling.view.methodPay.Controller",Ext.ux.app.ViewController,{init:function(){var b=this;b.control({methodpaycombo:{select:b.onSelectMethod}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectMethod:function(c,d){showFields=d.getData().showFields.split(",");this.showFieldsRelated(showFields)},showFieldsRelated:function(f){var d=this,e=d.formPanel.getForm().getFields();e.each(function(a){a.setVisible(f.indexOf(a.name)!==-1)})},onEdit:function(){var c=this,d=c.list.getSelectionModel().getSelection()[0];method=d?d.get("payment_method"):"Moip";showFields=c.formPanel.down("methodpaycombo").store.findRecord("payment_method",method).getData().showFields;showFields=showFields.split(",");c.showFieldsRelated(showFields);Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)},onNew:function(){var c=this,d=c.list.getSelectionModel().getSelection()[0];method="Moip";showFields=c.formPanel.down("methodpaycombo").store.findRecord("payment_method",method).getData().showFields;showFields=showFields.split(",");c.showFieldsRelated(showFields);Ext.ux.app.ViewController.prototype.onNew.apply(this,arguments)}},0,0,0,0,["controller.methodpay"],0,[MBilling.view.methodPay,"Controller"],0));(Ext.cmd.derive("MBilling.view.methodPay.Module",Ext.ux.panel.Module,{controller:"methodpay"},0,["methodpaymodule"],["component","box","container","uxpanelmodule","methodpaymodule"],{component:true,box:true,container:true,uxpanelmodule:true,methodpaymodule:true},["widget.methodpaymodule"],0,[MBilling.view.methodPay,"Module"],0));(Ext.cmd.derive("MBilling.view.methodPay.List",Ext.ux.grid.Panel,{store:"MethodPay",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("paymentmethods"),dataIndex:"payment_method",flex:2},{header:t("country"),dataIndex:"country",flex:2},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:2},{header:t("active"),dataIndex:"active",flex:1,comboRelated:"booleancombo",renderer:Helper.Util.formatBooleanActive,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")]]}}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["methodpaylist"],["component","box","container","panel","tablepanel","gridpanel","grid","methodpaylist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,methodpaylist:true},["widget.methodpaylist"],0,[MBilling.view.methodPay,"List"],0));(Ext.cmd.derive("MBilling.view.methodPay.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{xtype:"methodpaycombo",name:"payment_method",valueField:"payment_method",fieldLabel:t("paymentmethods")},{name:"show_name",fieldLabel:t("showName")},{xtype:"userlookup",ownerForm:b,name:"id_user"},{xtype:"paymentcountrycombo",name:"country",fieldLabel:t("country")},{xtype:"booleancombo",name:"active",fieldLabel:t("active")},{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,00",name:"min",value:10,fieldLabel:t("Min amount")},{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,00",name:"max",value:500,fieldLabel:t("Max amount")},{name:"username",fieldLabel:t("Username"),allowBlank:true},{name:"url",fieldLabel:"Url",allowBlank:true},{xtype:"noyescombo",name:"fee",fieldLabel:t("Discount")+" "+t("Fee"),allowBlank:true},{xtype:"paymentbanckcombo",name:"boleto_banco",fieldLabel:t("Bank"),allowBlank:true},{name:"boleto_convenio",fieldLabel:t("numeroconvenio"),allowBlank:true},{name:"boleto_agencia",fieldLabel:t("agencia"),allowBlank:true},{name:"boleto_conta_corrente",fieldLabel:t("contacorrente"),allowBlank:true},{name:"boleto_inicio_nosso_numeroa",fieldLabel:t("Inicio nosso nº"),allowBlank:true},{name:"boleto_carteira",fieldLabel:t("carteira"),allowBlank:true},{name:"boleto_taxa",fieldLabel:t("taxa"),allowBlank:true},{name:"boleto_instrucoes",fieldLabel:t("instructions"),maxLength:"100",allowBlank:true},{name:"boleto_nome_emp",fieldLabel:t("company"),allowBlank:true},{name:"boleto_end_emp",fieldLabel:t("address"),allowBlank:true},{name:"boleto_cidade_emp",fieldLabel:t("city"),allowBlank:true},{name:"boleto_estado_emp",fieldLabel:t("state"),allowBlank:true},{name:"boleto_cpf_emp",fieldLabel:"CNPJ CPF",allowBlank:true},{name:"pagseguro_TOKEN",fieldLabel:"TOKEN",allowBlank:true},{name:"P2P_CustomerSiteID",fieldLabel:t("P2P CustomerSiteID"),allowBlank:true},{name:"P2P_KeyID",fieldLabel:t("P2P KeyID"),allowBlank:true},{name:"P2P_Passphrase",fieldLabel:t("P2P Passphrase"),allowBlank:true},{name:"P2P_RecipientKeyID",fieldLabel:t("P2P RecipientKeyID"),allowBlank:true},{name:"P2P_tax_amount",fieldLabel:t("P2P Tax Amount"),allowBlank:true},{name:"client_id",fieldLabel:t("Client id"),allowBlank:true},{name:"client_secret",fieldLabel:t("Client Secret"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["methodpayform"],["component","box","container","panel","form","methodpayform"],{component:true,box:true,container:true,panel:true,form:true,methodpayform:true},["widget.methodpayform"],0,[MBilling.view.methodPay,"Form"],0));(Ext.cmd.derive("MBilling.view.methodPay.Combo",Ext.form.field.ComboBox,{name:"id_methodpay",fieldLabel:t("methodPay"),displayField:"show_name",valueField:"id",forceSelection:true,editable:false,initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.MethodPay",{proxy:{type:"uxproxy",module:"methodpay",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["methodpaycombo"],["component","box","field","textfield","pickerfield","combobox","combo","methodpaycombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,methodpaycombo:true},["widget.methodpaycombo"],0,[MBilling.view.methodPay,"Combo"],0));(Ext.cmd.derive("MBilling.view.voucher.Controller",Ext.ux.app.ViewController,{onSave:function(){var b=this;Ext.ux.app.ViewController.prototype.onSave.apply(this,arguments);b.formPanel.setLoading(false);b.saveButton.enable();b.store.load()}},0,0,0,0,["controller.voucher"],0,[MBilling.view.voucher,"Controller"],0));(Ext.cmd.derive("MBilling.view.voucher.Module",Ext.ux.panel.Module,{controller:"voucher"},0,["vouchermodule"],["component","box","container","uxpanelmodule","vouchermodule"],{component:true,box:true,container:true,uxpanelmodule:true,vouchermodule:true},["widget.vouchermodule"],0,[MBilling.view.voucher,"Module"],0));(Ext.cmd.derive("MBilling.view.voucher.List",Ext.ux.grid.Panel,{store:"Voucher",initComponent:function(){var b=this;b.buttonCsv=false;b.allowPrint=false;b.buttonUpdateLot=false;b.allowUpdate=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:3,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("credit"),dataIndex:"credit",renderer:Helper.Util.formatMoneyDecimal,filter:{type:"int",field:"t.credit"},flex:3},{header:t("voucher"),dataIndex:"voucher",flex:5},{header:t("description"),dataIndex:"tag",flex:3,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("usedate"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"usedate",flex:4},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"creationdate",flex:4,hidden:App.user.isClient,hideable:!App.user.isClient}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["voucherlist"],["component","box","container","panel","tablepanel","gridpanel","grid","voucherlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,voucherlist:true},["widget.voucherlist"],0,[MBilling.view.voucher,"List"],0));(Ext.cmd.derive("MBilling.view.voucher.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;if(!App.user.isClient){b.fieldsHideEdit=["quantity"]}if(App.user.isClient){b.textNew=t("Insert Voucher");b.buttonNewWidth=150}b.items=[{xtype:"moneyfield",name:"credit",fieldLabel:t("credit"),hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"id_plan",fieldLabel:t("Plan"),xtype:"plancombo",hidden:!App.user.isAdmin,allowBlank:!App.user.isAdmin},{xtype:"languagecombo",name:"language",fieldLabel:t("language"),hidden:!App.user.isAdmin,allowBlank:!App.user.isAdmin},{name:"prefix_local",fieldLabel:t("prefixlocal"),value:App.user.base_country=="BRL"?"0/55,*/5511/8,*/5511/9":App.user.base_country=="ARG"?"0/54,*/5411/8,15/54911/10,16/54911/10":"",emptyText:"match / replace / length",hidden:!App.user.isAdmin,allowBlank:true},{xtype:"numberfield",name:"quantity",fieldLabel:t("Quantity"),hidden:!App.user.isAdmin,allowBlank:!App.user.isAdmin,value:10},{name:"tag",fieldLabel:t("description"),hidden:App.user.isClient,allowBlank:true},{xtype:"numberfield",name:"voucher",fieldLabel:t("voucher"),value:"",maxLength:6,minLength:6,hidden:!App.user.isClient,allowBlank:!App.user.isClient}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["voucherform"],["component","box","container","panel","form","voucherform"],{component:true,box:true,container:true,panel:true,form:true,voucherform:true},["widget.voucherform"],0,[MBilling.view.voucher,"Form"],0));(Ext.cmd.derive("MBilling.view.refillprovider.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.refillprovider"],0,[MBilling.view.refillprovider,"Controller"],0));(Ext.cmd.derive("MBilling.view.refillprovider.Module",Ext.ux.panel.Module,{controller:"refillprovider"},0,["refillprovidermodule"],["component","box","container","uxpanelmodule","refillprovidermodule"],{component:true,box:true,container:true,uxpanelmodule:true,refillprovidermodule:true},["widget.refillprovidermodule"],0,[MBilling.view.refillprovider,"Module"],0));(Ext.cmd.derive("MBilling.view.refillprovider.List",Ext.ux.grid.Panel,{store:"Refillprovider",initComponent:function(){var b=this;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{xtype:"templatecolumn",tpl:"{idProviderprovider_name}",header:t("provider"),dataIndex:"id_provider",comboFilter:"providercombo",flex:2},{header:t("credit"),dataIndex:"credit",renderer:Helper.Util.formatMoneyDecimal,flex:2},{header:t("description"),dataIndex:"description",flex:4},{header:t("payment"),dataIndex:"payment",renderer:Helper.Util.formattyyesno,filter:{type:"list",options:[[0,t("no")],[1,t("yes")]]},flex:2},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"date",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["refillproviderlist"],["component","box","container","panel","tablepanel","gridpanel","grid","refillproviderlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,refillproviderlist:true},["widget.refillproviderlist"],0,[MBilling.view.refillprovider,"List"],0));(Ext.cmd.derive("MBilling.view.refillprovider.Form",Ext.ux.form.Panel,{bodyPadding:0,fieldsHideUpdateLot:["id_provider"],initComponent:function(){var b=this;b.items=[{xtype:"providercombo"},{xtype:"moneyfield",name:"credit",fieldLabel:t("credit")},{xtype:"textareafield",name:"description",fieldLabel:t("description"),allowBlank:true},{xtype:"yesnocombo",name:"payment",fieldLabel:t("add")+" "+t("payment"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["refillproviderform"],["component","box","container","panel","form","refillproviderform"],{component:true,box:true,container:true,panel:true,form:true,refillproviderform:true},["widget.refillproviderform"],0,[MBilling.view.refillprovider,"Form"],0));(Ext.cmd.derive("MBilling.view.boleto.Controller",Ext.ux.app.ViewController,{onAfterSave:function(d){var c=this;if(c.formPanel.idRecord==0){url="index.php/boleto/secondVia/?id=last";window.open(url)}Ext.ux.app.ViewController.prototype.onAfterSave.apply(this,arguments)},onSecondVia:function(e){var f=this,d=f.list.getSelectionModel().getSelection()[0];if(f.list.getSelectionModel().getSelection().length==0){Ext.ux.Alert.alert(f.titleError,t("Por favor selecione um bolero"),"notification")}else{if(f.list.getSelectionModel().getSelection().length>1){Ext.ux.Alert.alert(f.titleError,t("Por favor selecione somente um bolero"),"notification")}else{url="index.php/boleto/secondVia/?id="+d.get("id");window.open(url)}}}},0,0,0,0,["controller.boleto"],0,[MBilling.view.boleto,"Controller"],0));(Ext.cmd.derive("MBilling.view.boleto.Module",Ext.ux.panel.Module,{controller:"boleto"},0,["boletomodule"],["component","box","container","uxpanelmodule","boletomodule"],{component:true,box:true,container:true,uxpanelmodule:true,boletomodule:true},["widget.boletomodule"],0,[MBilling.view.boleto,"Module"],0));(Ext.cmd.derive("MBilling.view.boleto.List",Ext.ux.grid.Panel,{store:"Boleto",iconButtonCsv:"boleto",textButtonCsv:t("Importar Retorno"),iconButtonImportCsv:"boleto",textButtonImportCsv:t("Importar Retorno"),initComponent:function(){var b=this;b.buttonCsv=false;b.buttonUpdateLot=false;b.buttonImportCsv=App.user.isAdmin;b.extraButtons=[{text:t("Segunda via"),iconCls:"boleto",handler:"onSecondVia",disabled:false}];b.columns=[{header:t("Nosso Número"),dataIndex:"id",flex:3,hidden:!App.user.isAdmin,hideable:App.user.isAdmin},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("value"),dataIndex:"payment",renderer:Helper.Util.formatMoneyDecimal,flex:4},{header:"Pago",dataIndex:"status",renderer:Helper.Util.formattyyesno,flex:2,filter:{type:"list",options:[[0,t("no")],[1,t("yes")]]}},{header:t("description"),dataIndex:"description",flex:5},{header:"Vencimento",renderer:Ext.util.Format.dateRenderer("Y-m-d"),dataIndex:"vencimento",flex:4},{header:"Gerado",renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"date",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["boletolist"],["component","box","container","panel","tablepanel","gridpanel","grid","boletolist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,boletolist:true},["widget.boletolist"],0,[MBilling.view.boleto,"List"],0));(Ext.cmd.derive("MBilling.view.boleto.Form",Ext.ux.form.Panel,{fieldsHideEdit:["cid"],initComponent:function(){var b=this;b.items=[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:App.user.isClient},{xtype:"moneyfield",name:"payment",fieldLabel:t("value"),readOnly:App.user.isClient},{xtype:"yesnocombo",name:"status",fieldLabel:t("Pago"),hidden:App.user.isClient,value:0},{xtype:"datefield",name:"vencimento",fieldLabel:"Vencimento",format:"Y-m-d H:i:s",hidden:App.user.isClient||App.user.isAgent},{xtype:"textareafield",name:"description",fieldLabel:t("description"),readOnly:App.user.isClient}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["boletoform"],["component","box","container","panel","form","boletoform"],{component:true,box:true,container:true,panel:true,form:true,boletoform:true},["widget.boletoform"],0,[MBilling.view.boleto,"Form"],0));(Ext.cmd.derive("Ext.ux.window.ImportBoleto",Ext.window.Window,{autoShow:true,modal:true,layout:"fit",iconCls:"boleto",title:t("Importa Retorno Boleto"),width:400,height:175,labelWidthFields:180,htmlTipInfo:"",fieldsImport:[],initComponent:function(){var d=this,c=Ext.Array.merge(d.fieldsImport,[{xtype:"uploadfield",fieldLabel:t("Selecion o arquivo .RET"),htmlTipInfo:d.htmlTipInfo}]);d.items=[{xtype:"form",bodyPadding:5,labelWidth:d.labelWidthFields,items:c}];d.title=d.title+(d.titleModule?" - "+d.titleModule:"");d.bbar=[{xtype:"tbtext",text:t("maxSizeFile")+"3 MB"},"->",{iconCls:"boleto",text:t("importText"),scope:d,handler:d.onImport}];Ext.window.Window.prototype.initComponent.apply(this,arguments)},onImport:function(d){var f=this,e=f.list.store;d.disable();f.list.setLoading(true);f.down("form").submit({url:"index.php/boleto/retorno",scope:f,success:function(c,b){var a=Ext.decode(b.response.responseText);if(a.success){Ext.ux.Alert.alert(t("Success"),a.msg,"success",true,false,40000)}else{Ext.ux.Alert.alert(t("Error"),a.errors,"error")}d.enable();f.list.setLoading(false);e.load();f.close()},failure:function(c,b){if(Ext.isObject(b.response.responseText)){var a=Ext.decode(b.response.responseText);Ext.ux.Alert.alert(t("Error"),a.errors,"error")}else{Ext.ux.Alert.alert(t("Error"),b.response.responseText,"error",true,10)}d.enable();f.list.setLoading(false);f.close()}})}},0,0,["component","box","container","panel","window"],{component:true,box:true,container:true,panel:true,window:true},0,0,[Ext.ux.window,"ImportBoleto"],0));(Ext.cmd.derive("MBilling.view.boleto.ImportCsv",Ext.ux.window.ImportBoleto,{title:t("Importar Retorno"),labelWidthFields:250,height:275,fieldsImport:[{xtype:"boletobanckcombo",name:"banco",fieldLabel:t("Banco"),width:350}]},0,["boletoimportcsv"],["component","box","container","panel","window","boletoimportcsv"],{component:true,box:true,container:true,panel:true,window:true,boletoimportcsv:true},["widget.boletoimportcsv"],0,[MBilling.view.boleto,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.offer.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.offer"],0,[MBilling.view.offer,"Controller"],0));(Ext.cmd.derive("MBilling.view.offer.Combo",Ext.form.field.ComboBox,{name:"id_offer",fieldLabel:t("offer"),displayField:"label",valueField:"id",value:0,extraValues:[{id:0,label:t("undefined")}],initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Offer",{proxy:{type:"uxproxy",module:"offer",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["offercombo"],["component","box","field","textfield","pickerfield","combobox","combo","offercombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,offercombo:true},["widget.offercombo"],0,[MBilling.view.offer,"Combo"],0));(Ext.cmd.derive("MBilling.view.offer.Module",Ext.ux.panel.Module,{controller:"offer"},0,["offermodule"],["component","box","container","uxpanelmodule","offermodule"],{component:true,box:true,container:true,uxpanelmodule:true,offermodule:true},["widget.offermodule"],0,[MBilling.view.offer,"Module"],0));(Ext.cmd.derive("MBilling.view.offer.List",Ext.ux.grid.Panel,{store:"Offer",initComponent:function(){var b=this;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("name"),dataIndex:"label",flex:1},{header:t("packagetype"),dataIndex:"packagetype",renderer:Helper.Util.formatPackageType,comboRelated:"offertypecombo",flex:1,filter:{type:"list",options:[[0,t("unlimitedcalls")],[1,t("numberfreecalls")],[2,t("freeseconds")]]}},{header:t("freetimetocall"),dataIndex:"freetimetocall",flex:1},{header:t("periode"),dataIndex:"billingtype",renderer:Helper.Util.formatBillingType,comboRelated:"billingtypecombo",flex:1,filter:{type:"list",options:[[0,t("monthly")],[1,t("weekly")]]}},{header:t("price"),dataIndex:"price",renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,hideable:App.user.isAdmin,flex:2},{header:t("creationdate"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"creationdate",flex:1}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["offerlist"],["component","box","container","panel","tablepanel","gridpanel","grid","offerlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,offerlist:true},["widget.offerlist"],0,[MBilling.view.offer,"List"],0));(Ext.cmd.derive("MBilling.view.offer.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["name"],items:[{name:"label",fieldLabel:t("name")},{xtype:"offertypecombo",name:"packagetype",fieldLabel:t("packagetype")},{name:"freetimetocall",fieldLabel:t("freetimetocall")},{xtype:"billingtypecombo",name:"billingtype",fieldLabel:t("periode")},{xtype:"moneyfield",name:"price",fieldLabel:t("price")}]},0,["offerform"],["component","box","container","panel","form","offerform"],{component:true,box:true,container:true,panel:true,form:true,offerform:true},["widget.offerform"],0,[MBilling.view.offer,"Form"],0));(Ext.cmd.derive("MBilling.view.offerCdr.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.offercdr"],0,[MBilling.view.offerCdr,"Controller"],0));(Ext.cmd.derive("MBilling.view.offerCdr.Module",Ext.ux.panel.Module,{controller:"offercdr"},0,["offercdrmodule"],["component","box","container","uxpanelmodule","offercdrmodule"],{component:true,box:true,container:true,uxpanelmodule:true,offercdrmodule:true},["widget.offercdrmodule"],0,[MBilling.view.offerCdr,"Module"],0));(Ext.cmd.derive("MBilling.view.offerCdr.List",Ext.ux.grid.Panel,{store:"OfferCdr",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"date_consumption",flex:3},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:3},{xtype:"templatecolumn",tpl:"{idOfferlabel}",header:t("offer"),dataIndex:"id_offer",comboFilter:"offercombo",flex:3},{header:t("duration"),dataIndex:"used_secondes",renderer:Helper.Util.formatsecondsToTime,flex:3}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["offercdrlist"],["component","box","container","panel","tablepanel","gridpanel","grid","offercdrlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,offercdrlist:true},["widget.offercdrlist"],0,[MBilling.view.offerCdr,"List"],0));(Ext.cmd.derive("MBilling.view.offerCdr.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.columns=[{xtype:"usercombo"},{xtype:"offercombo"},{name:"used_secondes",fieldLabel:t("usedsecondes")},{xtype:"datefield",name:"date_consumption",fieldLabel:t("date"),format:"Y-m-d H:i:s"}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["offercdrform"],["component","box","container","panel","form","offercdrform"],{component:true,box:true,container:true,panel:true,form:true,offercdrform:true},["widget.offercdrform"],0,[MBilling.view.offerCdr,"Form"],0));(Ext.cmd.derive("MBilling.view.offerUse.Module",Ext.ux.panel.Module,{controller:"offeruse"},0,["offerusemodule"],["component","box","container","uxpanelmodule","offerusemodule"],{component:true,box:true,container:true,uxpanelmodule:true,offerusemodule:true},["widget.offerusemodule"],0,[MBilling.view.offerUse,"Module"],0));(Ext.cmd.derive("MBilling.view.offerUse.List",Ext.ux.grid.Panel,{store:"OfferUse",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:3},{xtype:"templatecolumn",tpl:"{idOfferlabel}",header:t("offer"),dataIndex:"id_offer",comboFilter:"offercombo",flex:3},{header:t("monthpayed"),dataIndex:"month_payed",flex:3},{header:t("reservationdate"),renderer:Ext.util.Format.dateRenderer("Y-m-d"),dataIndex:"reservationdate",flex:3},{header:t("releasedate"),renderer:Ext.util.Format.dateRenderer("Y-m-d"),dataIndex:"releasedate",flex:3}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["offeruselist"],["component","box","container","panel","tablepanel","gridpanel","grid","offeruselist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,offeruselist:true},["widget.offeruselist"],0,[MBilling.view.offerUse,"List"],0));(Ext.cmd.derive("MBilling.view.offerUse.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{xtype:"userlookup",ownerForm:b,readOnly:true},{xtype:"offercombo",readOnly:true},{name:"month_payed",fieldLabel:t("monthpayed")},{xtype:"datefield",name:"reservationdate",fieldLabel:t("reservationdate"),format:"Y-m-d H:i:s"}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["offeruseform"],["component","box","container","panel","form","offeruseform"],{component:true,box:true,container:true,panel:true,form:true,offeruseform:true},["widget.offeruseform"],0,[MBilling.view.offerUse,"Form"],0));(Ext.cmd.derive("MBilling.view.campaign.Controller",Ext.ux.app.ViewController,{isSubmitForm:true,init:function(){var b=this;b.control({typecampaigndestinationcombo:{select:b.onSelectMethod}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectMethod:function(c,d){this.showFieldsRelated(d.getData().showFields)},showFieldsRelated:function(j){var l=this,m=l.formPanel.getForm(),g=l.formPanel.getForm().getFields(),f=Ext.get(Ext.Element.getActiveElement()).component;l.onSetVisibleFiel(f,m,f.value)},onSetVisibleFiel:function(e,d,f){if(e.value=="undefined"){e.setValue("undefined")}if(e.name.match("^type_0")){d.findField("id_queue_0").setVisible(f.match("^queue"));d.findField("id_sip_0").setVisible(f.match("^sip"));d.findField("id_ivr_0").setVisible(f.match("^ivr"));d.findField("extension_0").setVisible(f.match("^group|^number|^custom"))}},onEdit:function(){var f=this,d=f.formPanel.getForm(),e=f.list.getSelectionModel().getSelection()[0];if(e.getData()["type_0"]=="ivr"){d.findField("id_ivr_0").setVisible(true);d.findField("id_sip_0").setVisible(false);d.findField("id_queue_0").setVisible(false);d.findField("extension_0").setVisible(false)}else{if(e.getData()["type_0"]=="sip"){d.findField("id_sip_0").setVisible(true);d.findField("id_ivr_0").setVisible(false);d.findField("id_queue_0").setVisible(false);d.findField("extension_0").setVisible(false)}else{if(e.getData()["type_0"]=="queue"){d.findField("id_queue_0").setVisible(true);d.findField("id_sip_0").setVisible(false);d.findField("id_ivr_0").setVisible(false);d.findField("extension_0").setVisible(false)}else{if(e.getData()["type_0"].match("custom|number|group")){d.findField("extension_0").setVisible(true);d.findField("id_ivr_0").setVisible(false);d.findField("id_sip_0").setVisible(false);d.findField("id_queue_0").setVisible(false)}else{d.findField("id_queue_0").setVisible(false);d.findField("id_sip_0").setVisible(false);d.findField("id_ivr_0").setVisible(false);d.findField("extension_0").setVisible(false)}}}}Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)},onNew:function(){var f=this,d=f.formPanel.getForm(),e=f.list.getSelectionModel().getSelection()[0];d.findField("id_ivr_0").setVisible(false);d.findField("id_sip_0").setVisible(false);d.findField("id_queue_0").setVisible(false);d.findField("extension_0").setVisible(false);Ext.ux.app.ViewController.prototype.onNew.apply(this,arguments)},submitForm:function(d){var f=this,e=f.store;Ext.apply(f.params,{id_phonebook_array:f.formPanel.getForm().getFieldValues().id_phonebook.join(",")});f.formPanel.add({xtype:"hiddenfield",name:f.idProperty,value:f.formPanel.idRecord});f.formPanel.getForm().submit({url:f.store.getProxy().api.create,params:f.params,scope:f,success:function(c,b){var a=Ext.decode(b.response.responseText);if(a.success){Ext.ux.Alert.alert(f.titleSuccess,a.msg,"success");f.formPanel.fireEvent("aftersave",f.formPanel,a.rows[0])}else{errors=Helper.Util.convertErrorsJsonToString(a.msg);if(!Ext.isObject(a.errors)){Ext.ux.Alert.alert(f.titleError,errors,"error")}else{c.markInvalid(a.errors);Ext.ux.Alert.alert(f.titleWarning,f.msgFormInvalid,"warning")}}f.store.load();f.formPanel.setLoading(false);f.saveButton.enable()},failure:function(j,c){var b=Ext.decode(c.response.responseText),a=Helper.Util.convertErrorsJsonToString(b.errors);if(!Ext.isObject(b.errors)){Ext.ux.Alert.alert(f.titleError,a,"error")}else{j.markInvalid(b.errors);Ext.ux.Alert.alert(f.titleWarning,a,"error")}f.formPanel.setLoading(false);f.saveButton.enable()}})},onTestCampaign:function(e){var f=this,d=f.list.getSelectionModel().getSelection()[0];if(f.list.getSelectionModel().getSelection().length==0){Ext.ux.Alert.alert(f.titleError,t("Please Select one campaign"),"notification")}else{if(f.list.getSelectionModel().getSelection().length>1){Ext.ux.Alert.alert(f.titleError,t("Please Select only one campaign"),"notification")}else{Ext.Ajax.request({url:"index.php/campaign/testCampaign",params:{id:d.get("id")},scope:f,success:function(b){b=Ext.decode(b.responseText);if(b[f.nameSuccessRequest]){Ext.ux.Alert.alert(f.titleSuccess,b[f.nameMsgRequest],"success")}else{var a=Helper.Util.convertErrorsJsonToString(b[f.nameMsgRequest]);Ext.ux.Alert.alert(f.titleSuccess,a,"error")}}})}}}},0,0,0,0,["controller.campaign"],0,[MBilling.view.campaign,"Controller"],0));(Ext.cmd.derive("MBilling.view.campaign.Combo",Ext.form.field.ComboBox,{name:"id_campaign",fieldLabel:t("campaign"),displayField:"name",forceSelection:true,editable:false,valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Campaign",{proxy:{type:"uxproxy",module:"campaign",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["campaigncombo"],["component","box","field","textfield","pickerfield","combobox","combo","campaigncombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,campaigncombo:true},["widget.campaigncombo"],0,[MBilling.view.campaign,"Combo"],0));(Ext.cmd.derive("MBilling.view.general.TypeCampaignDestination",Ext.form.field.ComboBox,{fieldLabel:t("type"),forceSelection:true,editable:false,value:"",store:[["",t("")],["undefined",t("Undefined")],["sip",t("SIP")],["ivr",t("IVR")],["queue",t("Queue")],["group",t("Group")],["custom",t("Custom")]]},0,["typecampaigndestinationcombo"],["component","box","field","textfield","pickerfield","combobox","combo","typecampaigndestinationcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,typecampaigndestinationcombo:true},["widget.typecampaigndestinationcombo"],0,[MBilling.view.general,"TypeCampaignDestination"],0));(Ext.cmd.derive("MBilling.view.campaign.Module",Ext.ux.panel.Module,{controller:"campaign"},0,["campaignmodule"],["component","box","container","uxpanelmodule","campaignmodule"],{component:true,box:true,container:true,uxpanelmodule:true,campaignmodule:true},["widget.campaignmodule"],0,[MBilling.view.campaign,"Module"],0));(Ext.cmd.derive("MBilling.view.campaign.List",Ext.ux.grid.Panel,{store:"Campaign",fieldSearch:"name",initComponent:function(){var b=this;b.buttonCsv=false;b.allowPrint=false;b.extraButtons=[{text:t("Test")+" "+t("Campaign"),iconCls:"call",handler:"onTestCampaign",disabled:false}];b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("name"),dataIndex:"name",flex:4},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:3,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("status"),dataIndex:"status",renderer:Helper.Util.formatBooleanActive,comboRelated:"booleancombo",flex:2,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")]]}},{header:t("type"),dataIndex:"type",renderer:Helper.Util.formatCampaignType,comboRelated:"campaigntypecombo",flex:2,filter:App.user.l.slice(4,7)=="wap"?{type:"list",options:[[0,t("sms")],[1,t("voice")],[3,t("WhasApp")]]}:{type:"list",options:[[0,t("sms")],[1,t("voice")]]}},{header:t("daily_start_time"),dataIndex:"daily_start_time",flex:4},{header:t("daily_stop_time"),dataIndex:"daily_stop_time",flex:4},{header:t("startingdate"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"startingdate",flex:4},{header:t("Call Limit"),dataIndex:"frequency",flex:4,hidden:true,hideable:App.user.isAdmin},{header:t("Max Complete Call"),dataIndex:"secondusedreal",flex:3,hidden:true,hideable:App.user.isAdmin}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignlist"],["component","box","container","panel","tablepanel","gridpanel","grid","campaignlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,campaignlist:true},["widget.campaignlist"],0,[MBilling.view.campaign,"List"],0));(Ext.cmd.derive("MBilling.view.campaign.Form",Ext.ux.form.Panel,{bodyPadding:0,fieldsHideUpdateLot:["id_user","name","audio","audio_2","id_phonebook"],fileUpload:true,initComponent:function(){var b=this;b.labelWidthFields=120;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{plugins:"markallowblank",allowBlank:false,anchor:"100%",labelAlign:"right"}},items:[{title:t("general"),items:[{xtype:App.user.isClient?"textfield":"userlookup",ownerForm:b,hidden:App.user.isClient},{fieldLabel:t("Plan"),xtype:"plancombo",name:"id_plan",hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"name",fieldLabel:t("name")},{xtype:"booleancombo",name:"status",fieldLabel:t("status")},{xtype:"datetimefield",name:"startingdate",fieldLabel:t("startingdate"),format:"Y-m-d H:i:s",value:new Date()},{xtype:"datetimefield",name:"expirationdate",fieldLabel:t("expirationdate"),format:"Y-m-d H:i:s",value:"2030-01-01 00:00:00"},{xtype:"campaigntypefullcombo",name:"type",fieldLabel:t("type")},{xtype:"uploadfield",fieldLabel:t("Audio"),emptyText:"Select an wav or gsm File",allowBlank:true,name:"audio",extAllowed:["wav","gsm"]},{xtype:"uploadfield",fieldLabel:t("Audio")+"2",emptyText:"Select an wav or gsm File",allowBlank:true,name:"audio_2",extAllowed:["wav","gsm"]},{xtype:"yesnocombo",name:"restrict_phone",fieldLabel:t("Restrict Phone"),hidden:App.user.isClient,allowBlank:true},{style:"margin-top:25px",xtype:"fieldset",title:t("Forward to"),collapsible:true,collapsed:false,height:110,defaults:{labelWidth:190,anchor:"100%",labelAlign:b.labelAlignFields},items:[{xtype:"numberfield",name:"digit_authorize",fieldLabel:t("Number to Forward"),value:"-1",minValue:"-1",maxValue:9},{fieldLabel:t("Forward Type"),name:"type_0",xtype:"typecampaigndestinationcombo",allowBlank:true},{xtype:"textfield",name:"extensions_0",fieldLabel:t("Destination"),value:"0",allowBlank:true,hidden:true},{xtype:"ivrlookup",ownerForm:b,name:"id_ivr_0",fieldLabel:t("IVR"),displayField:"id_ivr_0_name",allowBlank:true,hidden:true},{xtype:"queuelookup",ownerForm:b,name:"id_queue_0",fieldLabel:t("Queue"),displayField:"id_queue_0_name",allowBlank:true,hidden:true},{xtype:"siplookup",ownerForm:b,name:"id_sip_0",displayField:"id_sip_0_name",fieldLabel:t("SIP"),allowBlank:true,hidden:true},{xtype:"textfield",fieldLabel:t("Destination"),name:"extension_0",hidden:true}]},{style:"margin-top:10px",xtype:"fieldset",title:t("Select one or more phonebook"),collapsible:true,collapsed:false,items:[{labelWidth:10,name:"id_phonebook",fieldLabel:t("phonebook"),anchor:"100%",fieldLabel:"",xtype:"phonebooktag",allowBlank:true}]}]},{title:t("schedules"),items:[{name:"daily_start_time",fieldLabel:t("daily_start_time"),value:"09:00"},{name:"daily_stop_time",fieldLabel:t("daily_stop_time"),value:"18:00"},{xtype:"yesnocombo",fieldLabel:t("monday"),name:"monday"},{xtype:"yesnocombo",fieldLabel:t("tuesday"),name:"tuesday"},{xtype:"yesnocombo",fieldLabel:t("wednesday"),name:"wednesday"},{xtype:"yesnocombo",fieldLabel:t("thursday"),name:"thursday"},{xtype:"yesnocombo",fieldLabel:t("friday"),name:"friday"},{xtype:"noyescombo",fieldLabel:t("saturday"),name:"saturday"},{xtype:"noyescombo",fieldLabel:t("sunday"),name:"sunday"}]},{title:t("Limit"),items:[{name:"frequency",fieldLabel:t("Call Limit"),readOnly:!App.user.isAdmin,allowBlank:!App.user.isAdmin,value:App.user.isClient?1:10},{name:"nb_callmade",fieldLabel:t("Total Audio Time"),hidden:!App.user.isAdmin,allowBlank:true,value:0},{xtype:"booleancombo",name:"enable_max_call",fieldLabel:t("Enable")+" "+t("Max Complete Call"),hidden:!App.user.isAdmin,allowBlank:true,value:0},{name:"secondusedreal",fieldLabel:t("Max Complete Call"),hidden:!App.user.isAdmin,allowBlank:true,value:0}]},{title:t("SMS"),items:[{xtype:"textareafield",name:"description",fieldLabel:t("descriptionOrSmsText"),allowBlank:true,maxLength:160}]},{title:t("TTS/ASR"),hidden:!window.ttsasr,items:[{name:"tts_audio",fieldLabel:t("Audio 1 TTS"),allowBlank:true,maxLength:200},{name:"tts_audio2",fieldLabel:t("Audio 2 TTS"),allowBlank:true,maxLength:200},{xtype:"box",hidden:false,autoEl:{tag:"br"}},{name:"asr_options",fieldLabel:t("Option to validate ASR"),allowBlank:true,maxLength:160}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignform"],["component","box","container","panel","form","campaignform"],{component:true,box:true,container:true,panel:true,form:true,campaignform:true},["widget.campaignform"],0,[MBilling.view.campaign,"Form"],0));(Ext.cmd.derive("MBilling.view.campaignPoll.Controller",Ext.ux.app.ViewController,{isSubmitForm:true},0,0,0,0,["controller.campaignpoll"],0,[MBilling.view.campaignPoll,"Controller"],0));(Ext.cmd.derive("MBilling.view.campaignPoll.Combo",Ext.form.field.ComboBox,{name:"id_campaign_poll",fieldLabel:t("campaignpoll"),displayField:"name",valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.CampaignPoll",{proxy:{type:"uxproxy",module:"campaignPoll",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["campaignpollcombo"],["component","box","field","textfield","pickerfield","combobox","combo","campaignpollcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,campaignpollcombo:true},["widget.campaignpollcombo"],0,[MBilling.view.campaignPoll,"Combo"],0));(Ext.cmd.derive("MBilling.view.campaignPoll.Module",Ext.ux.panel.Module,{controller:"campaignpoll"},0,["campaignpollmodule"],["component","box","container","uxpanelmodule","campaignpollmodule"],{component:true,box:true,container:true,uxpanelmodule:true,campaignpollmodule:true},["widget.campaignpollmodule"],0,[MBilling.view.campaignPoll,"Module"],0));(Ext.cmd.derive("MBilling.view.campaignPoll.List",Ext.ux.grid.Panel,{store:"CampaignPoll",initComponent:function(){var b=this;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("name"),dataIndex:"name",flex:4},{xtype:"templatecolumn",tpl:"{idCampaignname}",header:t("campaign"),dataIndex:"id_campaign",comboFilter:"campaigncombo",flex:4},{header:t("description"),dataIndex:"description",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignpolllist"],["component","box","container","panel","tablepanel","gridpanel","grid","campaignpolllist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,campaignpolllist:true},["widget.campaignpolllist"],0,[MBilling.view.campaignPoll,"List"],0));(Ext.cmd.derive("MBilling.view.campaignPoll.Form",Ext.ux.form.Panel,{bodyPadding:0,fileUpload:true,fieldsHideUpdateLot:["id_campaign","name","arq_audio"],initComponent:function(){var b=this;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{plugins:"markallowblank",allowBlank:false,anchor:"100%",labelAlign:"right"}},items:[{title:t("general"),items:[{xtype:"campaigncombo"},{name:"name",fieldLabel:t("name")},{xtype:"numberfield",name:"repeat",fieldLabel:t("How many time to repeat, if the client press invalid option?"),minValue:0,maxValue:9,allowBlank:true},{xtype:"noyescombo",name:"request_authorize",fieldLabel:t("Request")+" "+t("authorization")},{xtype:"numberfield",name:"digit_authorize",fieldLabel:t("Number for authorize"),value:"1",minValue:1,maxValue:9,allowBlank:true},{xtype:"textareafield",name:"description",fieldLabel:t("description"),allowBlank:true},{xtype:"uploadfield",fieldLabel:"Audio",emptyText:"Select an wav or gsm File",allowBlank:true,name:"arq_audio",extAllowed:["wav","gsm"]}]},{title:t("options"),itemId:"optionsData",items:[{name:"option0",fieldLabel:t("option")+" 0",allowBlank:true},{name:"option1",fieldLabel:t("option")+" 1",allowBlank:true},{name:"option2",fieldLabel:t("option")+" 2",allowBlank:true},{name:"option3",fieldLabel:t("option")+" 3",allowBlank:true},{name:"option4",fieldLabel:t("option")+" 4",allowBlank:true},{name:"option5",fieldLabel:t("option")+" 5",allowBlank:true},{name:"option6",fieldLabel:t("option")+" 6",allowBlank:true},{name:"option7",fieldLabel:t("option")+" 7",allowBlank:true},{name:"option8",fieldLabel:t("option")+" 8",allowBlank:true},{name:"option9",fieldLabel:t("option")+" 9",allowBlank:true}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignpollform"],["component","box","container","panel","form","campaignpollform"],{component:true,box:true,container:true,panel:true,form:true,campaignpollform:true},["widget.campaignpollform"],0,[MBilling.view.campaignPoll,"Form"],0));(Ext.cmd.derive("MBilling.view.phoneNumber.Controller",Ext.ux.app.ViewController,{reprocessar:function(e){var g=this,f=g.list.getStore(),j=g.list.filters.getFilterData().length?Ext.encode(g.list.filters.getFilterData()):f.proxy.extraParams.filter;e.disable();g.list.setLoading(true);if(!j){Ext.ux.Alert.alert("Alert","Realize um filtro para reprocessar","notification");e.enable();g.list.setLoading(false);return}Ext.Msg.confirm("Confirm","Confirme que quer reprocessar os numeros pendentes?",function(a){if(a==="yes"){Ext.Ajax.request({url:"index.php/phoneNumber/reprocesar/",params:{filter:j},scope:g,success:function(c){c=Ext.decode(c.responseText);if(c[g.nameSuccessRequest]){Ext.ux.Alert.alert(g.titleSuccess,c[g.nameMsgRequest],"success");f.load();e.enable();g.list.setLoading(false)}else{var b=Helper.Util.convertErrorsJsonToString(c[g.nameMsgRequest]);Ext.ux.Alert.alert(g.titleError,b,"error");e.enable();g.list.setLoading(false)}}})}})}},0,0,0,0,["controller.phonenumber"],0,[MBilling.view.phoneNumber,"Controller"],0));(Ext.cmd.derive("MBilling.view.phoneNumber.Module",Ext.ux.panel.Module,{controller:"phonenumber"},0,["phonenumbermodule"],["component","box","container","uxpanelmodule","phonenumbermodule"],{component:true,box:true,container:true,uxpanelmodule:true,phonenumbermodule:true},["widget.phonenumbermodule"],0,[MBilling.view.phoneNumber,"Module"],0));(Ext.cmd.derive("MBilling.view.phoneNumber.List",Ext.ux.grid.Panel,{store:"PhoneNumber",buttonImportCsv:true,initComponent:function(){var b=this;b.extraButtons=[{text:t("Reprocessar"),iconCls:"callshop",handler:"reprocessar",disabled:false}];b.buttonUpdateLot=App.user.isAdmin&&!window.isTablet;b.buttonCsv=!window.isTablet;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("number"),dataIndex:"number",flex:4},{header:t("phonebook"),dataIndex:"idPhonebookname",filter:{type:"string",field:"idPhonebook.name"},flex:4},{header:t("status"),dataIndex:"status",renderer:Helper.Util.formatBooleanActive,comboRelated:"statuscombo",flex:2,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")],[2,t("pending")],[3,t("send")],[4,t("blocked")]]}},{header:t("name"),dataIndex:"name",hidden:true,hideable:true,flex:4},{header:t("city"),dataIndex:"city",hidden:true,hideable:true,flex:4},{header:t("description"),dataIndex:"info",hidden:true,flex:4},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"creationdate",hidden:true,hideable:App.user.isAdmin,flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["phonenumberlist"],["component","box","container","panel","tablepanel","gridpanel","grid","phonenumberlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,phonenumberlist:true},["widget.phonenumberlist"],0,[MBilling.view.phoneNumber,"List"],0));(Ext.cmd.derive("MBilling.view.phoneNumber.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["number"],initComponent:function(){var b=this;b.items=[{xtype:"phonebookcombo"},{name:"number",fieldLabel:t("number")},{name:"name",fieldLabel:t("name"),allowBlank:true},{name:"city",fieldLabel:t("city"),allowBlank:true},{xtype:"statuscombo",name:"status",fieldLabel:t("status"),allowBlank:true},{xtype:"textareafield",name:"info",fieldLabel:t("description"),allowBlank:true,hidden:!App.user.isAdmin}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["phonenumberform"],["component","box","container","panel","form","phonenumberform"],{component:true,box:true,container:true,panel:true,form:true,phonenumberform:true},["widget.phonenumberform"],0,[MBilling.view.phoneNumber,"Form"],0));(Ext.cmd.derive("MBilling.view.phoneBook.Combo",Ext.form.field.ComboBox,{name:"id_phonebook",fieldLabel:t("phonebook"),displayField:"name",forceSelection:true,editable:true,valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.PhoneBook",{proxy:{type:"uxproxy",module:"phoneBook",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["phonebookcombo"],["component","box","field","textfield","pickerfield","combobox","combo","phonebookcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,phonebookcombo:true},["widget.phonebookcombo"],0,[MBilling.view.phoneBook,"Combo"],0));(Ext.cmd.derive("MBilling.view.phoneNumber.ImportCsv",Ext.ux.window.ImportCsv,{htmlTipInfo:"
number,name,city
551135672677, Dany Hilger, New York
551156332233, Monica Leith, San Pablo
554153882200, John Mart, Madri
"+t("name")+" "+t("and")+" "+t("city")+" "+t("optional")+"",fieldsImport:[{xtype:"phonebookcombo",width:350}]},0,["phonenumberimportcsv"],["component","box","container","panel","window","phonenumberimportcsv"],{component:true,box:true,container:true,panel:true,window:true,phonenumberimportcsv:true},["widget.phonenumberimportcsv"],0,[MBilling.view.phoneNumber,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.rate.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.rate"],0,[MBilling.view.rate,"Controller"],0));(Ext.cmd.derive("MBilling.view.rate.Module",Ext.ux.panel.Module,{controller:"rate",flexForm:2,labelWidthFields:190},0,["ratemodule"],["component","box","container","uxpanelmodule","ratemodule"],{component:true,box:true,container:true,uxpanelmodule:true,ratemodule:true},["widget.ratemodule"],0,[MBilling.view.rate,"Module"],0));(Ext.cmd.derive("MBilling.view.rate.List",Ext.ux.grid.Panel,{store:"Rate",fieldSearch:"idPrefix.prefix",initComponent:function(){var b=this;b.buttonImportCsv=!App.user.isClient,b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("prefix"),dataIndex:"idPrefixprefix",filter:{type:"string",field:"idPrefix.prefix"},flex:window.isTablet?2:3},{dataIndex:"idPrefixdestination",header:t("destination"),filter:{type:"string",field:"idPrefix.destination"},flex:window.isTablet?2:3},{header:t("buyrate"),dataIndex:"buyrate",renderer:Helper.Util.formatMoneyDecimal4,hidden:!App.user.isAdmin,hideable:App.user.isAdmin,flex:2},{header:t("buyrateinitblock"),dataIndex:"buyrateinitblock",hidden:!App.user.isAdmin||window.isTablet,hideable:App.user.isAdmin,flex:2},{header:t("buyrateincrement"),dataIndex:"buyrateincrement",hidden:!App.user.isAdmin||window.isTablet,hideable:App.user.isAdmin,flex:2},{header:t("rateinitial"),dataIndex:"rateinitial",renderer:Helper.Util.formatMoneyDecimal4,flex:2},{header:t("initblock"),dataIndex:"initblock",hidden:window.isTablet,flex:2},{header:t("billingblock"),dataIndex:"billingblock",hidden:window.isTablet,flex:2},{xtype:"templatecolumn",tpl:"{idTrunktrunkcode}",header:t("trunk"),dataIndex:"id_trunk",comboFilter:"trunkcombo",flex:3,hidden:!App.user.isAdmin,hideable:App.user.isAdmin},{xtype:"templatecolumn",tpl:"{idPlanname}",header:t("plan"),dataIndex:"id_plan",comboFilter:"plancombo",flex:3},{header:t("includeinpackage"),dataIndex:"package_offer",hidden:true,hideable:App.user.isAdmin,flex:1},{header:t("status"),dataIndex:"status",hidden:true,hideable:App.user.isAdmin,flex:2,renderer:Helper.Util.formatBooleanActive,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")]]}}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["ratelist"],["component","box","container","panel","tablepanel","gridpanel","grid","ratelist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,ratelist:true},["widget.ratelist"],0,[MBilling.view.rate,"List"],0));(Ext.cmd.derive("MBilling.view.rate.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["id_prefix"],labelWidthFields:140,initComponent:function(){var b=this;b.items=[{name:"id_plan",fieldLabel:"Plan",xtype:"planlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:false},{name:"id_prefix",fieldLabel:"Destination",xtype:"prefixlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:false},{name:"id_trunk",fieldLabel:"Trunk",xtype:"trunklookup",ownerForm:b,hidden:!App.user.isAdmin,allowBlank:!App.user.isAdmin},{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,"+App.user.decimalPrecision,name:"buyrate",fieldLabel:t("buyrate"),hidden:!App.user.isAdmin,allowBlank:!App.user.isAdmin},{xtype:"numberfield",name:"buyrateinitblock",fieldLabel:t("buyrateinitblock"),value:1,minValue:1,hidden:!App.user.isAdmin,allowBlank:!App.user.isAdmin},{xtype:"numberfield",name:"buyrateincrement",fieldLabel:t("buyrateincrement"),value:1,minValue:1,hidden:!App.user.isAdmin,allowBlank:!App.user.isAdmin},{xtype:"numberfield",name:"minimal_time_buy",fieldLabel:t("Minimal time to buy"),value:0,minValue:0,hidden:!App.user.isAdmin},{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,"+App.user.decimalPrecision,name:"rateinitial",fieldLabel:t("rateinitial"),readOnly:App.user.isClient},{xtype:"numberfield",name:"initblock",fieldLabel:t("initblock"),value:1,minValue:1,hidden:App.user.isClient},{xtype:"numberfield",name:"billingblock",value:1,minValue:1,fieldLabel:t("billingblock"),hidden:App.user.isClient},{xtype:"numberfield",name:"minimal_time_charge",fieldLabel:t("Minimal time to charge"),value:0,minValue:0,hidden:App.user.isClient},{name:"additional_grace",fieldLabel:t("additional_grace"),allowBlank:true,hidden:!App.user.isAdmin},{xtype:"noyescombo",name:"package_offer",fieldLabel:t("includeinpackage"),hidden:!App.user.isAdmin,allowBlank:true},{xtype:"booleancombo",name:"status",fieldLabel:t("status"),hidden:!App.user.isAdmin,allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["rateform"],["component","box","container","panel","form","rateform"],{component:true,box:true,container:true,panel:true,form:true,rateform:true},["widget.rateform"],0,[MBilling.view.rate,"Form"],0));(Ext.cmd.derive("MBilling.view.rate.ImportCsv",Ext.ux.window.ImportCsv,{htmlTipInfo:"
"+t("dialprefix")+", "+t("destination")+", "+t("rateinitial")+", "+t("buyrate")+"
5511, Brasil SP, 0.080, 0.050
34, Spain Fix, 0.056, 0.034
54, Argentina, 0.025, 0.015

"+t("rateinitial")+" "+t("and")+" "+t("buyrate")+" "+t("optional")+"",labelWidthFields:160,height:window.isThemeTriton?350:275,initComponent:function(){var b=this;b.fieldsImport=[{xtype:"plancombo",fieldLabel:t("table"),width:350},{xtype:"trunkcombo",fieldLabel:t("trunkText"),width:350,hidden:!App.user.isAdmin},{style:"margin-top:25px",xtype:"fieldset",title:t("Csv Format"),collapsible:true,collapsed:false,defaults:{labelWidth:190,anchor:"100%",layout:{type:"hbox",labelAlign:b.labelAlignFields}},items:[{xtype:"pontovirgulacombo",name:"delimiter",fieldLabel:t("Delimiter"),width:230}]}];Ext.ux.window.ImportCsv.prototype.initComponent.apply(this,arguments)}},0,["rateimportcsv"],["component","box","container","panel","window","rateimportcsv"],{component:true,box:true,container:true,panel:true,window:true,rateimportcsv:true},["widget.rateimportcsv"],0,[MBilling.view.rate,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.phoneBook.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.phonebook"],0,[MBilling.view.phoneBook,"Controller"],0));(Ext.cmd.derive("MBilling.view.phoneBook.Module",Ext.ux.panel.Module,{controller:"phonebook"},0,["phonebookmodule"],["component","box","container","uxpanelmodule","phonebookmodule"],{component:true,box:true,container:true,uxpanelmodule:true,phonebookmodule:true},["widget.phonebookmodule"],0,[MBilling.view.phoneBook,"Module"],0));(Ext.cmd.derive("MBilling.view.phoneBook.List",Ext.ux.grid.Panel,{store:"PhoneBook",initComponent:function(){var b=this;b.columns=b.columns||[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("name"),dataIndex:"name",flex:5},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:3,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("status"),dataIndex:"status",renderer:Helper.Util.formatBooleanActive,comboRelated:"booleancombo",flex:3,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")]]}},{header:t("description"),dataIndex:"description",flex:5}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["phonebooklist"],["component","box","container","panel","tablepanel","gridpanel","grid","phonebooklist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,phonebooklist:true},["widget.phonebooklist"],0,[MBilling.view.phoneBook,"List"],0));(Ext.cmd.derive("MBilling.view.phoneBook.Form",Ext.ux.form.Panel,{bodyPadding:0,fieldsHideUpdateLot:["id_user","name"],initComponent:function(){var b=this;b.items=[{xtype:App.user.isClient?"textfield":"userlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"name",fieldLabel:t("name")},{xtype:"booleancombo",name:"status",fieldLabel:t("status"),allowBlank:true},{xtype:"textareafield",name:"description",fieldLabel:t("description"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["phonebookform"],["component","box","container","panel","form","phonebookform"],{component:true,box:true,container:true,panel:true,form:true,phonebookform:true},["widget.phonebookform"],0,[MBilling.view.phoneBook,"Form"],0));(Ext.cmd.derive("MBilling.view.phoneBook.Tag",Ext.form.field.Tag,{name:"id_phonebook",fieldLabel:t("phonebook"),displayField:"name",valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.PhoneBook",{proxy:{type:"uxproxy",module:"phoneBook",limitParam:undefined}});Ext.form.field.Tag.prototype.initComponent.apply(this,arguments)}},0,["phonebooktag"],["component","box","field","textfield","pickerfield","combobox","combo","tagfield","phonebooktag"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,tagfield:true,phonebooktag:true},["widget.phonebooktag"],0,[MBilling.view.phoneBook,"Tag"],0));(Ext.cmd.derive("MBilling.view.call.Controller",Ext.ux.app.ViewController,{onRecordCall:function(m){var j=this,f=j.list.getSelectionModel().getSelection()[0],l=Ext.encode(j.list.filters.getFilterData()),g=[];if(!f&&l.length<5){Ext.ux.Alert.alert(j.titleError,t("Please select one or more register"),"notification")}else{Ext.each(j.list.getSelectionModel().getSelection(),function(a){g.push(a.get(j.idProperty))});if(App.user.isAdmin&&g.length>250){Ext.ux.Alert.alert(j.titleError,t("Your limit to download record is")+" 250","error")}else{if(!App.user.isAdmin&&g.length>25){Ext.ux.Alert.alert(j.titleError,t("Your limit to download record is")+" 25","error")}else{window.open("index.php/call/downloadRecord?ids="+Ext.encode(g)+"&filter="+l)}}}},onDownloadClick:function(d,f,e){window.open("index.php/call/downloadRecord?id="+d.getStore().getAt(f).getData().id)},onShowTotal:function(e){var g=this;var g=this,f=g.list.getStore(),j=g.list.filters.getFilterData().length?Ext.encode(g.list.filters.getFilterData()):f.proxy.extraParams.filter;e.disable();e.setText(t("Wait..."));e.setWidth(120);Ext.Ajax.request({url:"index.php/call/getTotal",params:{filter:j},scope:g,success:function(a){a=Ext.decode(a.responseText);Ext.ux.Alert.alert(g.titleSuccess," "+t("Total")+" "+t("buycost")+": "+App.user.currency+" "+a.sumbuycost+"
"+t("Total")+" "+t("sessionbill")+": "+App.user.currency+" "+a.sumsessionbill+"
"+t("Total")+" "+t("profit")+": "+App.user.currency+" "+a.totalCall+"
","information",true,false);e.enable();e.setText(t("Show Total"))},failure:function(a){e.enable();e.setText(""+t("Failed. Try again...")+"");e.setWidth(300)}})}},0,0,0,0,["controller.call"],0,[MBilling.view.call,"Controller"],0));(Ext.cmd.derive("MBilling.view.call.Module",Ext.ux.panel.Module,{controller:"call"},0,["callmodule"],["component","box","container","uxpanelmodule","callmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callmodule:true},["widget.callmodule"],0,[MBilling.view.call,"Module"],0));(Ext.cmd.derive("MBilling.view.call.List",Ext.ux.grid.Panel,{store:"Call",standardSubmit:true,initComponent:function(){var b=this;b.paginationButton=["-",{xtype:"button",width:"120",text:t("Show Total"),handler:"onShowTotal",hidden:!App.user.isAdmin,cls:"x-btn-text-icon details"},{xtype:"tbtext",reference:"tbTextTotal"}];b.fieldSearch=App.user.isAdmin?"idUser.username":"calledstation",b.extraButtons=[{text:t("Download Rec"),iconCls:"call",handler:"onRecordCall",disabled:false,width:130}];b.buttonUpdateLot=App.user.isAdmin;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{xtype:"actioncolumn",width:26,sortable:false,menuDisabled:true,header:t(""),dataIndex:"id",items:[{iconCls:"icon-play",tooltip:t("Download Rec"),handler:"onDownloadClick"}],hidden:App.user.show_playicon_cdr==0,hideable:true},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"starttime",flex:4},{header:t("Sip Account"),dataIndex:"src",flex:3},{header:t("CallerId"),dataIndex:"callerid",flex:3,hidden:true,hideable:true},{header:t("number"),dataIndex:"calledstation",flex:3},{header:t("destination"),dataIndex:"idPrefixdestination",filter:{type:"string",field:"idPrefix.destination"},flex:4},{header:t("sessiontime"),dataIndex:"sessiontime",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Real")+" "+t("sessiontime"),dataIndex:"real_sessiontime",renderer:Helper.Util.formatsecondsToTime,flex:3,hidden:true,hideable:App.user.isAdmin},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:2,hidden:App.user.isClient,hideable:!App.user.isClient},{xtype:"templatecolumn",tpl:"{idTrunktrunkcode}",header:t("trunk"),dataIndex:"id_trunk",comboFilter:"trunkcombo",header:t("trunk"),flex:3,hidden:App.user.isClient||App.user.isAgent,hideable:!App.user.isClient&&!App.user.isAgent},{header:t("status"),dataIndex:"terminatecauseid",renderer:Helper.Util.formatDialStatus,flex:2,filter:{type:"list",options:[[1,t("answer")]]}},{header:t("type"),dataIndex:"sipiax",renderer:Helper.Util.formatCallType,flex:2,filter:{type:"list",options:[[0,t("standard")],[1,t("sipcall")],[2,t("did")],[3,t("didvoip")],[4,t("callback")],[5,t("callcenter")],[6,"sms"],[7,t("transfer")],[8,t("queue")],[9,t("ivr")]]}},{header:t("buycost"),dataIndex:"buycost",renderer:Helper.Util.formatMoneyDecimal4,flex:3,hidden:App.user.isClient||App.user.isAgent,hideable:!App.user.isClient&&!App.user.isAgent},{header:t("sessionbill"),dataIndex:"sessionbill",renderer:Helper.Util.formatMoneyDecimal4,flex:3,hidden:App.user.isAgent||App.user.isClientAgent,hideable:!App.user.isAgent&&!App.user.isClientAgent},{header:t("buycost"),dataIndex:"sessionbill",renderer:Helper.Util.formatMoneyDecimal4,flex:3,hidden:!App.user.isAgent,hideable:App.user.isAgent},{header:t("sessionbill"),dataIndex:"agent_bill",renderer:Helper.Util.formatMoneyDecimal4,flex:3,hidden:!App.user.isAgent,hideable:App.user.isAgent},{header:t("sessionbill"),dataIndex:"agent_bill",renderer:Helper.Util.formatMoneyDecimal4,flex:3,hidden:!App.user.isClientAgent,hideable:App.user.isClientAgent},{header:t("uniqueid"),dataIndex:"uniqueid",flex:3,hidden:true,hideable:true},{xtype:"templatecolumn",tpl:"{idCampaignname}",header:t("campaign"),dataIndex:"id_campaign",comboFilter:"campaigncombo",flex:3,hidden:true,hideable:!App.user.isClient}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["calllist"],["component","box","container","panel","tablepanel","gridpanel","grid","calllist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,calllist:true},["widget.calllist"],0,[MBilling.view.call,"List"],0));(Ext.cmd.derive("MBilling.view.call.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["calledstation"],initComponent:function(){var b=this;b.items=[{name:"calledstation",fieldLabel:t("number"),readOnly:true},{name:"sessiontime",fieldLabel:t("sessiontime"),readOnly:App.user.isClient||App.user.isAgent,hidden:App.user.isClient||App.user.isAgent},{xtype:"moneyfield",name:"buycost",fieldLabel:t("buycost"),mask:App.user.currency+" #9.999.990,"+App.user.decimalPrecision,hidden:App.user.isClient||App.user.isAgent},{xtype:"moneyfield",name:"sessionbill",fieldLabel:t("sessionbill"),mask:App.user.currency+" #9.999.990,"+App.user.decimalPrecision,readOnly:App.user.isClient||App.user.isAgent,hidden:App.user.isAgent||App.user.isClientAgent},{xtype:"moneyfield",name:"agent_bill",fieldLabel:t("sessionbill"),mask:App.user.currency+" #9.999.990,"+App.user.decimalPrecision,readOnly:App.user.isAgent,hidden:!App.user.isAgent&&!App.user.isClientAgent}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callform"],["component","box","container","panel","form","callform"],{component:true,box:true,container:true,panel:true,form:true,callform:true},["widget.callform"],0,[MBilling.view.call,"Form"],0));(Ext.cmd.derive("MBilling.view.callArchive.Controller",Ext.ux.app.ViewController,{onRecordCall:function(m){var j=this,f=j.list.getSelectionModel().getSelection()[0],l=Ext.encode(j.list.filters.getFilterData()),g=[];if(!f&&l.length<5){Ext.ux.Alert.alert(j.titleError,t("Please select one or more register"),"notification")}else{Ext.each(j.list.getSelectionModel().getSelection(),function(a){g.push(a.get(j.idProperty))});if(App.user.isAdmin&&g.length>250){Ext.ux.Alert.alert(j.titleError,t("Your limit to download record is")+" 250","error")}else{if(!App.user.isAdmin&&g.length>25){Ext.ux.Alert.alert(j.titleError,t("Your limit to download record is")+" 25","error")}else{window.open("index.php/callArchive/downloadRecord?ids="+Ext.encode(g)+"&filter="+l)}}}},onDownloadClick:function(d,f,e){window.open("index.php/callArchive/downloadRecord?id="+d.getStore().getAt(f).getData().id)}},0,0,0,0,["controller.callarchive"],0,[MBilling.view.callArchive,"Controller"],0));(Ext.cmd.derive("MBilling.view.callArchive.Module",Ext.ux.panel.Module,{controller:"callarchive"},0,["callarchivemodule"],["component","box","container","uxpanelmodule","callarchivemodule"],{component:true,box:true,container:true,uxpanelmodule:true,callarchivemodule:true},["widget.callarchivemodule"],0,[MBilling.view.callArchive,"Module"],0));(Ext.cmd.derive("MBilling.view.callArchive.List",Ext.ux.grid.Panel,{store:"CallArchive",standardSubmit:true,initComponent:function(){var b=this;b.buttonUpdateLot=false;b.fieldSearch=App.user.isAdmin?"idUser.username":"calledstation",b.extraButtons=[{text:t("Download Rec"),iconCls:"call",handler:"onRecordCall",disabled:false,width:130}];b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{xtype:"actioncolumn",width:26,sortable:false,menuDisabled:true,header:t(""),dataIndex:"id",items:[{iconCls:"icon-play",tooltip:t("Download Rec"),handler:"onDownloadClick"}],hidden:App.user.show_playicon_cdr==0,hideable:true},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"starttime",flex:4},{header:t("Sip Account"),dataIndex:"src",flex:3},{header:t("CallerId"),dataIndex:"callerid",flex:3,hidden:true,hideable:true},{header:t("number"),dataIndex:"calledstation",flex:3},{header:t("destination"),dataIndex:"idPrefixdestination",filter:{type:"string",field:"idPrefix.destination"},flex:4},{header:t("sessiontime"),dataIndex:"sessiontime",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Real")+" "+t("sessiontime"),dataIndex:"real_sessiontime",renderer:Helper.Util.formatsecondsToTime,flex:3,hidden:true,hideable:App.user.isAdmin},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:2,hidden:App.user.isClient,hideable:!App.user.isClient},{xtype:"templatecolumn",tpl:"{idTrunktrunkcode}",header:t("trunk"),dataIndex:"id_trunk",comboFilter:"trunkcombo",header:t("trunk"),flex:3,hidden:App.user.isClient||App.user.isAgent,hideable:!App.user.isClient&&!App.user.isAgent},{header:t("status"),dataIndex:"terminatecauseid",renderer:Helper.Util.formatDialStatus,flex:2,filter:{type:"list",options:[[1,t("answer")]]}},{header:t("type"),dataIndex:"sipiax",renderer:Helper.Util.formatCallType,flex:2,filter:{type:"list",options:[[0,t("standard")],[1,t("sipcall")],[2,t("did")],[3,t("didvoip")],[4,t("callback")],[5,t("callcenter")],[6,"sms"],[7,t("transfer")],[8,t("queue")],[9,t("ivr")]]}},{header:t("buycost"),dataIndex:"buycost",renderer:Helper.Util.formatMoneyDecimal4,flex:3,hidden:App.user.isClient||App.user.isAgent,hideable:!App.user.isClient&&!App.user.isAgent},{header:t("sessionbill"),dataIndex:"sessionbill",renderer:Helper.Util.formatMoneyDecimal4,flex:3,hidden:App.user.isAgent||App.user.isClientAgent,hideable:!App.user.isAgent&&!App.user.isClientAgent},{header:t("buycost"),dataIndex:"sessionbill",renderer:Helper.Util.formatMoneyDecimal4,flex:3,hidden:!App.user.isAgent,hideable:App.user.isAgent},{header:t("sessionbill"),dataIndex:"agent_bill",renderer:Helper.Util.formatMoneyDecimal4,flex:3,hidden:!App.user.isAgent,hideable:App.user.isAgent},{header:t("sessionbill"),dataIndex:"agent_bill",renderer:Helper.Util.formatMoneyDecimal4,flex:3,hidden:!App.user.isClientAgent,hideable:App.user.isClientAgent},{header:t("uniqueid"),dataIndex:"uniqueid",flex:3,hidden:true,hideable:true}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callarchivelist"],["component","box","container","panel","tablepanel","gridpanel","grid","callarchivelist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callarchivelist:true},["widget.callarchivelist"],0,[MBilling.view.callArchive,"List"],0));(Ext.cmd.derive("MBilling.view.callArchive.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["calledstation"],initComponent:function(){var b=this;b.items=[{name:"calledstation",fieldLabel:t("number"),readOnly:true},{name:"sessiontime",fieldLabel:t("sessiontime"),readOnly:App.user.isClient||App.user.isAgent,hidden:App.user.isClient||App.user.isAgent},{xtype:"moneyfield",name:"buycost",fieldLabel:t("buycost"),mask:App.user.currency+" #9.999.990,"+App.user.decimalPrecision,hidden:App.user.isClient||App.user.isAgent},{xtype:"moneyfield",name:"sessionbill",fieldLabel:t("sessionbill"),mask:App.user.currency+" #9.999.990,"+App.user.decimalPrecision,readOnly:App.user.isClient||App.user.isAgent,hidden:App.user.isAgent||App.user.isClientAgent},{xtype:"moneyfield",name:"agent_bill",fieldLabel:t("sessionbill"),mask:App.user.currency+" #9.999.990,"+App.user.decimalPrecision,readOnly:App.user.isAgent,hidden:!App.user.isAgent&&!App.user.isClientAgent}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callarchiveform"],["component","box","container","panel","form","callarchiveform"],{component:true,box:true,container:true,panel:true,form:true,callarchiveform:true},["widget.callarchiveform"],0,[MBilling.view.callArchive,"Form"],0));(Ext.cmd.derive("MBilling.view.callFailed.Controller",Ext.ux.app.ViewController,{formHidden:true},0,0,0,0,["controller.callfailed"],0,[MBilling.view.callFailed,"Controller"],0));(Ext.cmd.derive("MBilling.view.callFailed.Module",Ext.ux.panel.Module,{controller:"callfailed"},0,["callfailedmodule"],["component","box","container","uxpanelmodule","callfailedmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callfailedmodule:true},["widget.callfailedmodule"],0,[MBilling.view.callFailed,"Module"],0));(Ext.cmd.derive("MBilling.view.callFailed.List",Ext.ux.grid.Panel,{store:"CallFailed",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.allowCreate=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"starttime",flex:4},{header:t("Sip Account"),dataIndex:"src",flex:3},{header:t("CallerId"),dataIndex:"callerid",flex:3,hidden:true,hideable:true},{header:t("number"),dataIndex:"calledstation",flex:3},{header:t("destination"),dataIndex:"idPrefixdestination",flex:4},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:2,hidden:App.user.isClient,hideable:!App.user.isClient},{xtype:"templatecolumn",tpl:"{idTrunktrunkcode}",header:t("trunk"),dataIndex:"id_trunk",comboFilter:"trunkcombo",header:t("trunk"),flex:4,hidden:App.user.isClient||App.user.isAgent,hideable:!App.user.isClient&&!App.user.isAgent},{header:t("status"),dataIndex:"terminatecauseid",renderer:Helper.Util.formatDialStatus,flex:2,filter:{type:"list",options:[[1,t("answer")],[2,t("busy")],[3,t("no")+" "+t("answer")],[4,t("cancelcall")],[5,"congestion"],[6,"chanunavail"],[7,"dontcall"],[8,"torture"],[9,"invalidargs"]]}},{header:t("HangupCause"),dataIndex:"hangupcause",hidden:!window.dialC,flex:2},{header:t("type"),dataIndex:"sipiax",renderer:Helper.Util.formatCallType,flex:2,filter:{type:"list",options:[[0,t("standard")],[1,t("sipcall")],[2,t("did")],[3,t("didvoip")],[4,t("callback")],[5,t("callcenter")],[6,"sms"],[7,t("transfer")]]}},{header:t("uniqueid"),dataIndex:"uniqueid",flex:3,hidden:true,hideable:true}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callfailedlist"],["component","box","container","panel","tablepanel","gridpanel","grid","callfailedlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callfailedlist:true},["widget.callfailedlist"],0,[MBilling.view.callFailed,"List"],0));(Ext.cmd.derive("MBilling.view.callFailed.Form",Ext.ux.form.Panel,{},0,["callfailedform"],["component","box","container","panel","form","callfailedform"],{component:true,box:true,container:true,panel:true,form:true,callfailedform:true},["widget.callfailedform"],0,[MBilling.view.callFailed,"Form"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerDay.Controller",Ext.ux.app.ViewController,{onEdit:function(){me=this;me.sumData=me.store.getData().items[0].getData();if(!me.sumData){return}me.formPanel.getForm().getFields().each(function(b){b.setValue(me.sumData[b.name])});me.formPanel.expand()}},0,0,0,0,["controller.callsummaryperday"],0,[MBilling.view.callSummaryPerDay,"Controller"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerDay.Module",Ext.ux.panel.Module,{controller:"callsummaryperday",titleDetails:t("total"),iconForm:"icon-sum",cfgEast:{flex:0.4}},0,["callsummaryperdaymodule"],["component","box","container","uxpanelmodule","callsummaryperdaymodule"],{component:true,box:true,container:true,uxpanelmodule:true,callsummaryperdaymodule:true},["widget.callsummaryperdaymodule"],0,[MBilling.view.callSummaryPerDay,"Module"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerDay.List",Ext.ux.grid.Panel,{store:"CallSummaryPerDay",initComponent:function(){var b=this;b.buttonImportCsv=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{header:t("day"),renderer:Ext.util.Format.dateRenderer("Y-m-d"),dataIndex:"day",filter:{type:"date",field:"day"},flex:3},{header:t("sessiontime")+" "+t("Min"),dataIndex:"sessiontime",flex:2},{header:t("aloc_all_calls"),dataIndex:"aloc_all_calls",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Answered Calls"),dataIndex:"nbcall",flex:3},{header:t("Failed Calls"),dataIndex:"nbcall_fail",flex:3},{header:t("buycost"),dataIndex:"buycost",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("sessionbill"),dataIndex:"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("markup"),dataIndex:"lucro",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("ASR"),dataIndex:"asr",renderer:Helper.Util.formatPorcente,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummaryperdaylist"],["component","box","container","panel","tablepanel","gridpanel","grid","callsummaryperdaylist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callsummaryperdaylist:true},["widget.callsummaryperdaylist"],0,[MBilling.view.callSummaryPerDay,"List"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerDay.Form",Ext.ux.form.Panel,{defaults:{},labelWidthFields:100,defaultType:"displayfield",initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{name:"sumsessiontime",fieldLabel:t("sessiontime")+" "+t("Min"),renderer:Ext.util.Format.numberRenderer("0"),allowBlank:true},{name:"sumsessionbill",fieldLabel:t("sessionbill"),renderer:Helper.Util.formatMoneyDecimal,allowBlank:true},{name:"sumbuycost",fieldLabel:t("buycost"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumlucro",fieldLabel:t("markup"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumnbcall",fieldLabel:t("Answered Calls"),allowBlank:true},{name:"sumnbcallfail",fieldLabel:t("Failed Calls"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummaryperdayform"],["component","box","container","panel","form","callsummaryperdayform"],{component:true,box:true,container:true,panel:true,form:true,callsummaryperdayform:true},["widget.callsummaryperdayform"],0,[MBilling.view.callSummaryPerDay,"Form"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerMonth.Controller",Ext.ux.app.ViewController,{onEdit:function(){me=this;me.sumData=me.store.getData().items[0].getData();if(!me.sumData){return}me.formPanel.getForm().getFields().each(function(b){b.setValue(me.sumData[b.name])});me.formPanel.expand()}},0,0,0,0,["controller.callsummarypermonth"],0,[MBilling.view.callSummaryPerMonth,"Controller"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerMonth.Module",Ext.ux.panel.Module,{controller:"callsummarypermonth",titleDetails:t("total"),iconForm:"icon-sum",cfgEast:{flex:0.4}},0,["callsummarypermonthmodule"],["component","box","container","uxpanelmodule","callsummarypermonthmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callsummarypermonthmodule:true},["widget.callsummarypermonthmodule"],0,[MBilling.view.callSummaryPerMonth,"Module"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerMonth.List",Ext.ux.grid.Panel,{store:"CallSummaryPerMonth",initComponent:function(){var b=this;b.buttonImportCsv=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{header:t("month"),dataIndex:"month",filter:{type:"date",field:"month",dateFormat:"Ym"},flex:3},{header:t("sessiontime")+" "+t("Min"),dataIndex:"sessiontime",flex:2},{header:t("aloc_all_calls"),dataIndex:"aloc_all_calls",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("nbcall"),dataIndex:"nbcall",flex:3},{header:t("buycost"),dataIndex:"buycost",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("sessionbill"),dataIndex:"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("markup"),dataIndex:"lucro",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarypermonthlist"],["component","box","container","panel","tablepanel","gridpanel","grid","callsummarypermonthlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callsummarypermonthlist:true},["widget.callsummarypermonthlist"],0,[MBilling.view.callSummaryPerMonth,"List"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerMonth.Form",Ext.ux.form.Panel,{defaults:{},labelWidthFields:100,defaultType:"displayfield",initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{name:"sumsessiontime",fieldLabel:t("sessiontime")+" "+t("Min"),renderer:Ext.util.Format.numberRenderer("0"),allowBlank:true},{name:"sumsessionbill",fieldLabel:t("sessionbill"),renderer:Helper.Util.formatMoneyDecimal,allowBlank:true},{name:"sumbuycost",fieldLabel:t("buycost"),renderer:Helper.Util.formatMoneyDecimal,hidden:App.user.isClient,allowBlank:true},{name:"sumlucro",fieldLabel:t("markup"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumnbcall",fieldLabel:t("nbcall"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarypermonthform"],["component","box","container","panel","form","callsummarypermonthform"],{component:true,box:true,container:true,panel:true,form:true,callsummarypermonthform:true},["widget.callsummarypermonthform"],0,[MBilling.view.callSummaryPerMonth,"Form"],0));(Ext.cmd.derive("MBilling.view.callSummaryMonthUser.Controller",Ext.ux.app.ViewController,{onEdit:function(){me=this;me.sumData=me.store.getData().items[0].getData();if(!me.sumData){return}me.formPanel.getForm().getFields().each(function(b){b.setValue(me.sumData[b.name])});me.formPanel.expand()}},0,0,0,0,["controller.callsummarymonthuser"],0,[MBilling.view.callSummaryMonthUser,"Controller"],0));(Ext.cmd.derive("MBilling.view.callSummaryMonthUser.Module",Ext.ux.panel.Module,{controller:"callsummarymonthuser",titleDetails:t("total"),iconForm:"icon-sum",cfgEast:{flex:0.4}},0,["callsummarymonthusermodule"],["component","box","container","uxpanelmodule","callsummarymonthusermodule"],{component:true,box:true,container:true,uxpanelmodule:true,callsummarymonthusermodule:true},["widget.callsummarymonthusermodule"],0,[MBilling.view.callSummaryMonthUser,"Module"],0));(Ext.cmd.derive("MBilling.view.callSummaryMonthUser.List",Ext.ux.grid.Panel,{store:"CallSummaryMonthUser",initComponent:function(){var b=this;b.buttonImportCsv=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{header:t("Month"),renderer:Ext.util.Format.dateRenderer("Y-m"),dataIndex:"month",filter:{type:"date",field:"month",dateFormat:"Ym"},flex:3},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("sessiontime")+" "+t("Min"),dataIndex:"sessiontime",flex:2},{header:t("aloc_all_calls"),dataIndex:"aloc_all_calls",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Answered Calls"),dataIndex:"nbcall",flex:3},{header:t("buycost"),dataIndex:App.user.isAdmin?"buycost":"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("sessionbill"),dataIndex:App.user.isAgent||App.user.isClientAgent?"agent_bill":"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("markup"),dataIndex:"lucro",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarymonthuserlist"],["component","box","container","panel","tablepanel","gridpanel","grid","callsummarymonthuserlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callsummarymonthuserlist:true},["widget.callsummarymonthuserlist"],0,[MBilling.view.callSummaryMonthUser,"List"],0));(Ext.cmd.derive("MBilling.view.callSummaryMonthUser.Form",Ext.ux.form.Panel,{defaults:{},labelWidthFields:100,defaultType:"displayfield",initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{name:"sumsessiontime",fieldLabel:t("sessiontime")+" "+t("Min"),renderer:Ext.util.Format.numberRenderer("0"),allowBlank:true},{name:App.user.isAgent||App.user.isClientAgent?"sumagent_bill":"sumsessionbill",fieldLabel:t("sessionbill"),renderer:Helper.Util.formatMoneyDecimal,allowBlank:true},{name:App.user.isAdmin?"sumbuycost":"sumsessionbill",fieldLabel:t("buycost"),renderer:Helper.Util.formatMoneyDecimal,hidden:App.user.isClient,allowBlank:true},{name:"sumlucro",fieldLabel:t("markup"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmint,allowBlank:true},{name:"sumnbcall",fieldLabel:t("nbcall"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarymonthuserform"],["component","box","container","panel","form","callsummarymonthuserform"],{component:true,box:true,container:true,panel:true,form:true,callsummarymonthuserform:true},["widget.callsummarymonthuserform"],0,[MBilling.view.callSummaryMonthUser,"Form"],0));(Ext.cmd.derive("MBilling.view.callSummaryMonthTrunk.Controller",Ext.ux.app.ViewController,{onEdit:function(){me=this;me.sumData=me.store.getData().items[0].getData();if(!me.sumData){return}me.formPanel.getForm().getFields().each(function(b){b.setValue(me.sumData[b.name])});me.formPanel.expand()}},0,0,0,0,["controller.callsummarymonthtrunk"],0,[MBilling.view.callSummaryMonthTrunk,"Controller"],0));(Ext.cmd.derive("MBilling.view.callSummaryMonthTrunk.Module",Ext.ux.panel.Module,{controller:"callsummarymonthtrunk",titleDetails:t("total"),iconForm:"icon-sum",cfgEast:{flex:0.4}},0,["callsummarymonthtrunkmodule"],["component","box","container","uxpanelmodule","callsummarymonthtrunkmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callsummarymonthtrunkmodule:true},["widget.callsummarymonthtrunkmodule"],0,[MBilling.view.callSummaryMonthTrunk,"Module"],0));(Ext.cmd.derive("MBilling.view.callSummaryMonthTrunk.List",Ext.ux.grid.Panel,{store:"CallSummaryMonthTrunk",initComponent:function(){var b=this;b.buttonImportCsv=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{header:t("Month"),renderer:Ext.util.Format.dateRenderer("Y-m"),dataIndex:"month",filter:{type:"date",field:"month",dateFormat:"Ym"},flex:3},{header:t("Trunk"),dataIndex:"idTrunktrunkcode",filter:{type:"string",field:"idTrunk.trunkcode"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("sessiontime")+" "+t("Min"),dataIndex:"sessiontime",flex:2},{header:t("aloc_all_calls"),dataIndex:"aloc_all_calls",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Answered Calls"),dataIndex:"nbcall",flex:3},{header:t("buycost"),dataIndex:"buycost",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("sessionbill"),dataIndex:"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("markup"),dataIndex:"lucro",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarymonthtrunklist"],["component","box","container","panel","tablepanel","gridpanel","grid","callsummarymonthtrunklist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callsummarymonthtrunklist:true},["widget.callsummarymonthtrunklist"],0,[MBilling.view.callSummaryMonthTrunk,"List"],0));(Ext.cmd.derive("MBilling.view.callSummaryMonthTrunk.Form",Ext.ux.form.Panel,{defaults:{},labelWidthFields:100,defaultType:"displayfield",initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{name:"sumsessiontime",fieldLabel:t("sessiontime")+" "+t("Min"),renderer:Ext.util.Format.numberRenderer("0"),allowBlank:true},{name:"sumsessionbill",fieldLabel:t("sessionbill"),renderer:Helper.Util.formatMoneyDecimal,allowBlank:true},{name:"sumbuycost",fieldLabel:t("buycost"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumlucro",fieldLabel:t("markup"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumnbcall",fieldLabel:t("nbcall"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarymonthtrunkform"],["component","box","container","panel","form","callsummarymonthtrunkform"],{component:true,box:true,container:true,panel:true,form:true,callsummarymonthtrunkform:true},["widget.callsummarymonthtrunkform"],0,[MBilling.view.callSummaryMonthTrunk,"Form"],0));(Ext.cmd.derive("MBilling.view.sms.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.sms"],0,[MBilling.view.sms,"Controller"],0));(Ext.cmd.derive("MBilling.view.sms.Module",Ext.ux.panel.Module,{controller:"sms"},0,["smsmodule"],["component","box","container","uxpanelmodule","smsmodule"],{component:true,box:true,container:true,uxpanelmodule:true,smsmodule:true},["widget.smsmodule"],0,[MBilling.view.sms,"Module"],0));(Ext.cmd.derive("MBilling.view.sms.List",Ext.ux.grid.Panel,{store:"Sms",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.allowUpdate=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("send"),dataIndex:"result",renderer:Helper.Util.formatBooleanSms,comboRelated:"statuscombo",flex:2,filter:{type:"list",options:[[0,t("error")],[1,t("sent")],[2,t("received")]]}},{header:t("destination"),dataIndex:"telephone",flex:2},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"date",flex:5},{header:t("description"),dataIndex:"sms",hidden:true,hideable:true,flex:6}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["smslist"],["component","box","container","panel","tablepanel","gridpanel","grid","smslist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,smslist:true},["widget.smslist"],0,[MBilling.view.sms,"List"],0));(Ext.cmd.derive("MBilling.view.sms.Form",Ext.ux.form.Panel,{fieldsHide:["id_user"],initComponent:function(){var b=this;b.items=[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:App.user.isClient},{xtype:"numberfield",name:"telephone",fieldLabel:t("number"),emptyText:"DDI DDD Nº",maxLength:16,minLength:11},{xtype:"textareafield",name:"sms",fieldLabel:t("sms"),maxLength:160}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["smsform"],["component","box","container","panel","form","smsform"],{component:true,box:true,container:true,panel:true,form:true,smsform:true},["widget.smsform"],0,[MBilling.view.sms,"Form"],0));(Ext.cmd.derive("MBilling.view.campaignPollInfo.Controller",Ext.ux.app.ViewController,{aliasChart:"campaignpollinfochart",onRenderModule:function(){var c=this,d=c.lookupReference("chart");Ext.ux.app.ViewController.prototype.onRenderModule.apply(this,arguments);c.store.on({scope:c,beforeload:function(){d.disable()},load:function(a){d.enable()}})},onChart:function(){var l=this,f=l.list.getStore(),m=l.list.filters.getFilterData(),j=false,g=false;if(!m){Ext.ux.Alert.alert("Alert",t("Use filters"),"information");return}Ext.each(m,function(a){if(a.field=="id_campaign_poll"){if(a.data.value.length==1){g=true}j=true;return}});if(!j){Ext.ux.Alert.alert("Alert",t("Select one or more poll to create a chart"),"information");return}l.chart=Ext.widget("window",{title:t("charts"),iconCls:"icon-chart-column",layout:"fit",autoShow:true,modal:true,resizable:false,width:window.isThemeNeptune?740:710,items:{xtype:l.aliasChart,titleText:g?f.getData().items[0].data.idCampaignPollname:"",list:l.list}})}},0,0,0,0,["controller.campaignpollinfo"],0,[MBilling.view.campaignPollInfo,"Controller"],0));(Ext.cmd.derive("MBilling.view.campaignPollInfo.Module",Ext.ux.panel.Module,{controller:"campaignpollinfo"},0,["campaignpollinfomodule"],["component","box","container","uxpanelmodule","campaignpollinfomodule"],{component:true,box:true,container:true,uxpanelmodule:true,campaignpollinfomodule:true},["widget.campaignpollinfomodule"],0,[MBilling.view.campaignPollInfo,"Module"],0));(Ext.cmd.derive("MBilling.view.campaignPollInfo.List",Ext.ux.grid.Panel,{store:"CampaignPollInfo",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.allowCreate=false;b.extraButtons=[{text:t("charts"),iconCls:"icon-chart-column",handler:"onChart",reference:"chart",disabled:true}];b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("number"),dataIndex:"number",flex:4},{xtype:"templatecolumn",tpl:"{idCampaignPollname}",header:t("poll"),dataIndex:"id_campaign_poll",comboFilter:"campaignpollcombo",flex:4},{header:t("result"),dataIndex:"resposta",flex:4},{header:t("description"),dataIndex:"obs",flex:4},{header:t("City"),dataIndex:"city",flex:4},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"date",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignpollinfolist"],["component","box","container","panel","tablepanel","gridpanel","grid","campaignpollinfolist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,campaignpollinfolist:true},["widget.campaignpollinfolist"],0,[MBilling.view.campaignPollInfo,"List"],0));(Ext.cmd.derive("MBilling.view.campaignPollInfo.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{name:"number",fieldLabel:t("number"),readOnly:true},{name:"resposta",fieldLabel:t("result"),readOnly:true},{xtype:"textareafield",name:"obs",fieldLabel:t("description"),allowBlank:true,maxLength:200}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignpollinfoform"],["component","box","container","panel","form","campaignpollinfoform"],{component:true,box:true,container:true,panel:true,form:true,campaignpollinfoform:true},["widget.campaignpollinfoform"],0,[MBilling.view.campaignPollInfo,"Form"],0));(Ext.cmd.derive("MBilling.view.campaignPollInfo.Chart",Ext.ux.panel.Chart,{controller:"campaignpollinfo",store:"CampaignPollInfoChart",fieldValue:"sumresposta",fieldDescription:"resposta2",labelYLine:t("countvotes"),labelXLine:t("result"),fieldLabel:"percentage",initComponent:function(){var d=this,c;if(window.newChartCampaignInfo){d.fieldDescription="resposta_name"}d.bbarChart=[{xtype:"tbtext",itemId:"tbTextSum",reference:"tbTextSum"}];d.store=Ext.data.StoreManager.lookup(d.store);d.store.setRemoteFilter(true);filters=d.list.filters.getFilterData();d.store.filter("filter",Ext.encode(filters));d.store.load({scope:d,callback:function(){if(d.store.getData().items[0]){d.sumData=d.store.getData().items[0].getData()}if(window.newChartCampaignInfo){d.lookupReference("tbTextSum").setText(d.sumData.total_votos)}}});Ext.ux.panel.Chart.prototype.initComponent.apply(this,arguments)}},0,["campaignpollinfochart"],["component","box","container","panel","chartpanel","campaignpollinfochart"],{component:true,box:true,container:true,panel:true,chartpanel:true,campaignpollinfochart:true},["widget.campaignpollinfochart"],0,[MBilling.view.campaignPollInfo,"Chart"],0));(Ext.cmd.derive("MBilling.view.campaignRestrictPhone.Controller",Ext.ux.app.ViewController,{onEdit:function(){var b=this;Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)},deleteDuplicados:function(e){var g=this,f=g.list.getStore(),j=g.list.filters.getFilterData().length?Ext.encode(g.getList().filters.getFilterData()):f.proxy.extraParams.filter;e.disable();g.list.setLoading(true);Ext.Msg.confirm("Confirm","Confirme que quer deletar os numeros duplicados?",function(a){if(a==="yes"){Ext.Ajax.request({url:"index.php/campaignRestrictPhone/deleteDuplicados/",params:{filter:j},scope:g,success:function(c){c=Ext.decode(c.responseText);if(c[g.nameSuccessRequest]){Ext.ux.Alert.alert(g.titleSuccess,c[g.nameMsgRequest],"success")}else{var b=Helper.Util.convertErrorsJsonToString(c[g.nameMsgRequest]);Ext.ux.Alert.alert(g.titleError,b,"error")}g.list.setLoading(false);e.enable()}})}})}},0,0,0,0,["controller.campaignrestrictphone"],0,[MBilling.view.campaignRestrictPhone,"Controller"],0));(Ext.cmd.derive("MBilling.view.campaignRestrictPhone.Module",Ext.ux.panel.Module,{controller:"campaignrestrictphone"},0,["campaignrestrictphonemodule"],["component","box","container","uxpanelmodule","campaignrestrictphonemodule"],{component:true,box:true,container:true,uxpanelmodule:true,campaignrestrictphonemodule:true},["widget.campaignrestrictphonemodule"],0,[MBilling.view.campaignRestrictPhone,"Module"],0));(Ext.cmd.derive("MBilling.view.campaignRestrictPhone.List",Ext.ux.grid.Panel,{store:"CampaignRestrictPhone",buttonImportCsv:true,initComponent:function(){var b=this;b.extraButtons=[{text:t("Eliminar Duplicados"),iconCls:"callshop",handler:"deleteDuplicados",disabled:false}];b.buttonUpdateLot=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("number"),dataIndex:"number",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignrestrictphonelist"],["component","box","container","panel","tablepanel","gridpanel","grid","campaignrestrictphonelist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,campaignrestrictphonelist:true},["widget.campaignrestrictphonelist"],0,[MBilling.view.campaignRestrictPhone,"List"],0));(Ext.cmd.derive("MBilling.view.campaignRestrictPhone.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{name:"number",fieldLabel:t("number")}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignrestrictphoneform"],["component","box","container","panel","form","campaignrestrictphoneform"],{component:true,box:true,container:true,panel:true,form:true,campaignrestrictphoneform:true},["widget.campaignrestrictphoneform"],0,[MBilling.view.campaignRestrictPhone,"Form"],0));(Ext.cmd.derive("MBilling.view.campaignRestrictPhone.ImportCsv",Ext.ux.window.ImportCsv,{htmlTipInfo:"
number
551135672677
551156332233
554153882200
"},0,["campaignrestrictphoneimportcsv"],["component","box","container","panel","window","campaignrestrictphoneimportcsv"],{component:true,box:true,container:true,panel:true,window:true,campaignrestrictphoneimportcsv:true},["widget.campaignrestrictphoneimportcsv"],0,[MBilling.view.campaignRestrictPhone,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.campaignLog.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.campaignlog"],0,[MBilling.view.campaignLog,"Controller"],0));(Ext.cmd.derive("MBilling.view.campaignLog.Module",Ext.ux.panel.Module,{controller:"campaignlog"},0,["campaignlogmodule"],["component","box","container","uxpanelmodule","campaignlogmodule"],{component:true,box:true,container:true,uxpanelmodule:true,campaignlogmodule:true},["widget.campaignlogmodule"],0,[MBilling.view.campaignLog,"Module"],0));(Ext.cmd.derive("MBilling.view.campaignLog.List",Ext.ux.grid.Panel,{store:"CampaignLog",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.buttonNew=false;b.allowUpdate=false;b.allowDelete=!App.user.isClient;b.columns=[{header:t("Total gerado"),dataIndex:"total",flex:4},{header:t("Loops"),dataIndex:"loops",flex:4},{header:t("Total por tronco"),dataIndex:"trunks",flex:4},{header:t("Campanhas"),dataIndex:"campaigns",flex:4},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"date",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignloglist"],["component","box","container","panel","tablepanel","gridpanel","grid","campaignloglist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,campaignloglist:true},["widget.campaignloglist"],0,[MBilling.view.campaignLog,"List"],0));(Ext.cmd.derive("MBilling.view.campaignLog.Form",Ext.ux.form.Panel,{bodyPadding:0,initComponent:function(){var b=this;b.items=[{name:"total",fieldLabel:t("total")}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignlogform"],["component","box","container","panel","form","campaignlogform"],{component:true,box:true,container:true,panel:true,form:true,campaignlogform:true},["widget.campaignlogform"],0,[MBilling.view.campaignLog,"Form"],0));(Ext.cmd.derive("MBilling.view.campaignSend.Module",Ext.form.Panel,{controller:"campaignsend",resizable:false,autoShow:true,header:false,initComponent:function(){var b=this;b.items=[{reference:"campaignSendPanel",xtype:"form",margin:"10 10 10 10",autoShow:true,closable:false,resizable:false,bodyPadding:10,defaultType:"textfield",defaults:{labelAlign:"right",labelWidth:150,width:280,allowBlank:false,msgTarget:"side",enableKeyEvents:true,plugins:"markallowblank",anchor:"100%"},items:[{xtype:"campaignsendcombo",name:"type",fieldLabel:t("campaign")+" "+t("type")},{name:"sms_text",fieldLabel:"SMS "+t("Text"),xtype:"textarea",height:100,anchor:"100%",allowBlank:true,hidden:true,maxLength:159},{xtype:"filefield",emptyText:"Select an audio file",fieldLabel:t("Audio file"),name:"audio_path",buttonText:"",buttonConfig:{iconCls:"upload-icon"},buttonText:t("Select Audio..."),allowBlank:true,hidden:true},{xtype:"filefield",emptyText:"Select an csv file",fieldLabel:t("CSV file"),name:"csv_path",allowBlank:true,hidden:true},{name:"numbers",fieldLabel:t("numbers"),xtype:"textarea",height:100,anchor:"100%",allowBlank:true,hidden:true},{xtype:"datefield",name:"startingdate",fieldLabel:t("Date"),format:"Y-m-d",value:new Date(),allowBlank:true,hidden:true},{xtype:"timefield",name:"startingtime",fieldLabel:t("Hour"),format:"H:i",value:"00:00",allowBlank:true,hidden:true}],bbar:[{width:"150px",text:t("Send"),tooltip:t("Send"),glyph:icons.disk,handler:"onSendCampaign"}]}];Ext.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignsendmodule"],["component","box","container","panel","form","campaignsendmodule"],{component:true,box:true,container:true,panel:true,form:true,campaignsendmodule:true},["widget.campaignsendmodule"],0,[MBilling.view.campaignSend,"Module"],0));(Ext.cmd.derive("MBilling.view.callShop.Controller",Ext.ux.app.ViewController,{sendActionNew:function(d){var c=this;d.disable();id=d.reference.split("_");getForm=c.lookupReference("cabina"+id[1]).getForm();Ext.Ajax.request({url:d.urlAction+"?id="+getForm.findField("id").getValue(),success:function(a){a=Ext.decode(a.responseText);if(a.success){Ext.ux.Alert.alert(c.titleSuccess,a[c.nameMsgRequest],"success")}else{Ext.ux.Alert.alert(c.titleError,errors,"error")}}});d.enable();storeCallShop=Ext.create("MBilling.store.CallShop",{remoteSort:false});storeCallShop.load({callback:function(a){c.onShowCabins(a,id[1],getForm)}})},onShowCabins:function(e,f,d){me=this;row=e[f-1];if(tab=me.lookupReference("tab"+f)){name=row.data.callerid.length<1?row.data.name:row.data.callerid;status=Helper.Util.formatBooleanFree(row.data.status);tab.setTitle(t("Cabina")+" "+f+" - "+name+" "+status);tab.setVisible(true);d.loadRecord(row)}},reportCallshopClientNew:function(d){var c=this;id=d.reference.split("_");getForm=c.lookupReference("cabina"+id[1]).getForm();columns=Ext.encode([{header:t("Number"),dataIndex:"calledstation"},{header:t("Time"),dataIndex:"sessiontime"},{header:t("Total"),dataIndex:"price"}]);filter=Ext.encode([{type:"string",comparison:"eq",value:getForm.findField("name").getValue(),field:"cabina"},{type:"list",value:[0],field:"status"}]);values="columns="+columns+"&filter="+filter+"&sort=[]&group=&orientation=P";url="index.php/callShopCdr/report/?"+values;window.open(url)},sendAction:function(f){var j=this,e=j.list.getSelectionModel().getSelection()[0],g=Ext.encode([{type:"string",comparison:"eq",value:e.get("name"),field:"cabina"},{type:"list",value:[0],field:"status"}]);j.formPanel.setLoading(true);Ext.Ajax.request({url:f.urlAction,params:{filter:g},success:function(b){b=Ext.decode(b.responseText);var a=Helper.Util.convertErrorsJsonToString(b[j.nameMsgRequest]),d=j.list.getStore(),c=j.list.getSelectionModel();if(b.success){j.onEdit();d.load({callback:function(){c.select(d.findExact("id",e.get("id")));j.formPanel.setLoading(false)}});Ext.ux.Alert.alert(j.titleSuccess,b[j.nameMsgRequest],"success")}else{Ext.ux.Alert.alert(j.titleError,a,"error");j.formPanel.setLoading(false);c.select(d.findExact("id",e.get("id")))}}})},onEdit:function(){if(!this.list.getSelectionModel().getSelection().length){return}var q=this,r=q.list.getSelectionModel().getSelection()[0],n=[{type:"string",comparison:"eq",value:r.get("name"),field:"cabina"},{type:"list",value:[0],field:"status"}],u=q.formPanel.down("callshopcdrlist").getStore(),v=q.formPanel.down("#priceSum"),m=u.proxy.extraParams.filter,p=q.formPanel.down("#charge"),s=q.formPanel.down("#release"),o=q.formPanel.down("#print");v.setText(" "+t("pricesum")+" 0.00");q.formPanel.expand();p.enable();s.enable();o.enable();u.proxy.extraParams.filter=n;u.load({callback:function(a){if(a){a[0]&&v.setText(" "+t("pricesum")+" "+t("moedasimblo")+" "+a[0].get("priceSum")+" ")}}});console.log(r.get("callerid")+", "+r.get("name"));u.defaultFilter=m;q.showHideFields();q.focusFirstField()},reportCallshopClient:function(E){var w=this,s=window.isDesktop&&App.desktop,y=!window.isDesktop&&w.list.module.ownerCt,v=w.formPanel.down("callshopcdrlist").getStore(),x=v.sorters.items,A=w.list.getSelectionModel().getSelection()[0],F=Ext.encode([{type:"string",comparison:"eq",value:A.get("name"),field:"cabina"},{type:"list",value:[0],field:"status"}]),u=w.store.getGroupField(),B=w.formPanel.down("callshopcdrlist").columns,G="desc",D=w.formPanel.down("callshopcdrlist").getStore().getProxy().api.report,H,z=[],C=[];Ext.each(x,function(a){z.push(a.property+" "+(a.direction||"ASC"))});Ext.each(B,function(a){if(a.hidden===false&&a.isCheckerHd!==true){if(a.dataIndex===u){C.splice(0,0,{header:a.text,dataIndex:a.dataIndex})}else{C.push({header:a.text,dataIndex:a.dataIndex})}}});values="columns="+Ext.encode(C)+"&filter="+F+"&sort="+Ext.encode(z)+"&group="+u+"&orientation="+G;url="index.php/callShopCdr/report/?"+values;window.open(url)}},0,0,0,0,["controller.callshop"],0,[MBilling.view.callShop,"Controller"],0));(Ext.cmd.derive("MBilling.view.callShop.Module",Ext.ux.panel.Module,{controller:"callshop",cfgEast:{flex:4},collapsedForm:false,collapsibleForm:false},0,["callshopmodule"],["component","box","container","uxpanelmodule","callshopmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callshopmodule:true},["widget.callshopmodule"],0,[MBilling.view.callShop,"Module"],0));(Ext.cmd.derive("MBilling.view.callShop.Module2",Ext.form.Panel,{controller:"callshop",resizable:false,autoShow:true,header:false,autoScroll:true,initComponent:function(){var b=this;b.layout={type:"table",columns:3,tdAttrs:{style:"padding: 3px; vertical-align: top;"}};b.defaults={xtype:"panel",height:268,width:((Ext.Element.getViewportWidth()-200)/3)-10,closable:false,collapsible:true,frame:true};b.items=b.onMountPanels();storeCallShop=Ext.create("MBilling.store.CallShop",{remoteSort:false});if(!App.user.isClient){Ext.form.Panel.prototype.initComponent.apply(this,arguments);return}else{b.handler=setInterval(function(){storeCallShop.load({callback:function(a){b.onShowCabins(a)}})},5000);Ext.form.Panel.prototype.initComponent.apply(this,arguments);storeCallShop.load({callback:function(a){b.onShowCabins(a)}})}},onMountPanels:function(){me=this,items=[];if(!App.user.isClient){return}for(i=1;i<=12;i++){items.push({xtype:"tabpanel",reference:"tab"+i,title:t("Cabina")+i,collapsed:i>3,items:[{reference:"cabina"+i,title:t("Cabina"),xtype:"form",bodyPadding:10,defaults:{xtype:"displayfield",labelWidth:85},items:[{name:"id",hidden:true},{name:"name",hidden:true},{xtype:"fieldcontainer",layout:"hbox",items:[{xtype:"displayfield",fieldLabel:t("Number"),name:"callshopnumber",labelAlign:"right",labelWidth:50,renderer:function(b){return''+b+""},flex:2},{labelAlign:"right",labelWidth:90,xtype:"displayfield",readOnly:true,fieldLabel:t("total"),name:"total",labelStyle:"font-size:18px!important;font-weight:bold;",renderer:function(b){format=Ext.util.Format.numberRenderer("0."+App.user.decimalPrecision);return''+App.user.currency+" "+format(b)+""},flex:3}]},{fieldLabel:t("Destination"),name:"destination"},{fieldLabel:t("Price minute"),name:"price_min",renderer:Helper.Util.formatMoneyDecimal},{fieldLabel:t("Duration"),name:"callshoptime",renderer:Helper.Util.formatsecondsToTime},{border:false,xtype:"toolbar",hidden:me.hideBbar,dock:"bottom",items:[{bodyPadding:10,width:"33%",text:t("Charge"),itemId:"charge",iconCls:"buycredit",handler:"sendActionNew",reference:"cobrar_"+i,urlAction:"index.php/callShop/cobrar"},{width:"33%",text:t("Release"),itemId:"release",iconCls:"release",handler:"sendActionNew",reference:"liberar_"+i,urlAction:"index.php/callShop/liberar",hidden:window.releaseButton},{width:"33%",text:t("Print"),itemId:"print",iconCls:"icon-print",handler:"reportCallshopClientNew",reference:"report_"+i,urlAction:"index.php/callShop/report"}]}]},{reference:"history_"+i,tooltip:"history_"+i,iconCls:"x-fa fa-refresh",title:t("History"),autoScroll:true,items:[{xtype:"callshopcdrlist",buttonCsv:false,autoScroll:true,filterableColumns:false,buttonCleanFilter:false,autoLoadStore:false,border:false,allowCreate:false,allowUpdate:false,allowDelete:false,buttonUpdateLot:false,pagination:false,allowPrint:false,columnsHide:["cabina","destination","status","buycost","markup","date"],store:Ext.create("MBilling.store.CallShopCdr",{remoteFilter:true})}],tabConfig:{listeners:{click:function(b){id=b.tooltip.split("_");panel=me.lookupReference("history_"+id[1]);storeCallshopcdr=panel.down("callshopcdrlist").getStore();filterCabina=[{type:"string",comparison:"eq",value:me.lookupReference("cabina"+id[1]).getForm().findField("name").getValue(),field:"cabina"},{type:"list",value:[0],field:"status"}];storeCallshopcdr.load({filter:filterCabina,params:{filters:Ext.encode(filterCabina)},limit:70})}}}}]})}return items},onShowCabins:function(b){me=this,i=1;Ext.each(b,function(a){if(tab=me.lookupReference("tab"+i)){name=a.data.callerid.length<1?a.data.name:a.data.callerid;status=Helper.Util.formatBooleanFree(a.data.status);tab.setTitle(t("Cabina")+" "+i+" - "+name+" "+status);tab.setVisible(true);me.lookupReference("cabina"+i).getForm().loadRecord(a)}i++});for(i=b.length+1;i<=12;i++){tab=me.lookupReference("tab"+i).setVisible(false)}}},0,["callshop2module"],["component","box","container","panel","form","callshop2module"],{component:true,box:true,container:true,panel:true,form:true,callshop2module:true},["widget.callshop2module"],0,[MBilling.view.callShop,"Module2"],0));(Ext.cmd.derive("MBilling.view.callShop.List",Ext.ux.grid.Panel,{store:"CallShop",viewConfig:{loadMask:false,emptyText:'
'+t("No record found")+"
",getRowClass:function(b){if(App.user.l=="callshop"){if(b.get("status")==1){return"callshoFree"}else{if(b.get("status")==0){return"callshoBlock"}else{if(b.get("status")==2){return"callshoInUse"}else{if(b.get("status")==3){return"callshoInCall"}}}}}}},refreshTime:4,initComponent:function(){var b=this;b.buttonCsv=false;b.buttonUpdateLot=false;b.allowCreate=true;b.allowUpdate=true;b.allowDelete=true;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.allowPrint=false;b.buttonDeleteWidth=140;b.refreshTime=(localStorage&&localStorage.getItem("callshopfresh"))||b.refreshTime;b.extraButtons=[{xtype:"numberfield",field:"jmlhBrg",fieldLabel:t("Refresh Time"),editable:false,minValue:3,labelWidth:90,width:150,selectOnFocus:true,allowDecimals:true,decimalPrecision:2,value:b.refreshTime,listeners:{change:function(a){if(a.value>0){b.refreshTime=a.value;localStorage.setItem("callshopfresh",a.value)}}}}];b.columns=[{header:t("cabina"),dataIndex:"callerid",flex:4},{header:t("status"),dataIndex:"status",renderer:Helper.Util.formatBooleanFree,flex:3,filter:{type:"list",options:[[1,t("free")],[2,t("inuse")],[0,t("blocked")],[3,t("calling")]]}},{header:t("number"),dataIndex:"callshopnumber",flex:4},{header:t("Destino"),dataIndex:"callshopdestination",hidden:App.user.l!="callshop",flex:6},{header:t("sessiontime"),dataIndex:"callshoptime",renderer:Helper.Util.formatsecondsToTime,flex:3}];b.sessionLoad=Ext.create("Ext.util.DelayedTask",function(){b.store.load()},b);Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments);b.store.on("load",b.onLoadStore,b)},onLoadStore:function(){var b=this;b.onDeactivateModule();b.onActivateModule()},onRender:function(){var b=this;b.module.on("activate",b.onActivateModule,b);b.module.on("deactivate",b.onDeactivateModule,b);b.module.on("close",b.onCloseModule,b);Ext.ux.grid.Panel.prototype.onRender.apply(this,arguments)},onActivateModule:function(){this.sessionLoad&&this.sessionLoad.delay(this.refreshTime*1000)},onDeactivateModule:function(){this.sessionLoad&&this.sessionLoad.cancel()},onCloseModule:function(){this.onDeactivateModule();this.sessionLoad=null}},0,["callshoplist"],["component","box","container","panel","tablepanel","gridpanel","grid","callshoplist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callshoplist:true},["widget.callshoplist"],0,[MBilling.view.callShop,"List"],0));(Ext.cmd.derive("MBilling.view.callShop.Form",Ext.ux.form.Panel,{hideTbar:true,labelWidthFields:"60%",bodyPadding:1,layout:"fit",buttonsTbar:[{xtype:"tbtext",itemId:"priceSum"},"->",{text:"Cobrar",itemId:"charge",iconCls:"buycredit",urlAction:"index.php/callShop/cobrar",disabled:true,handler:"sendAction",width:100},{text:"Liberar",itemId:"release",iconCls:"release",urlAction:"index.php/callShop/liberar",disabled:true,handler:"sendAction",width:100},{text:t("Print"),itemId:"print",glyph:icons.print,urlAction:"index.php/callShop/report",disabled:true,handler:"reportCallshopClient",width:100}],initComponent:function(){var b=this;b.items=[{xtype:"callshopcdrlist",buttonCsv:false,filterableColumns:false,buttonCleanFilter:false,autoLoadStore:false,border:true,allowCreate:false,allowUpdate:false,allowDelete:false,buttonUpdateLot:false,pagination:false,allowPrint:false,columnsHide:["status","buycost","markup"],store:Ext.create("MBilling.store.CallShopCdr",{remoteSort:false})}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callshopform"],["component","box","container","panel","form","callshopform"],{component:true,box:true,container:true,panel:true,form:true,callshopform:true},["widget.callshopform"],0,[MBilling.view.callShop,"Form"],0));(Ext.cmd.derive("MBilling.view.callShopCdr.Controller",Ext.ux.app.ViewController,{formHidden:true},0,0,0,0,["controller.callshopcdr"],0,[MBilling.view.callShopCdr,"Controller"],0));(Ext.cmd.derive("MBilling.view.callShopCdr.Module",Ext.ux.panel.Module,{controller:"callshopcdr"},0,["callshopcdrmodule"],["component","box","container","uxpanelmodule","callshopcdrmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callshopcdrmodule:true},["widget.callshopcdrmodule"],0,[MBilling.view.callShopCdr,"Module"],0));(Ext.cmd.derive("MBilling.view.callShopCdr.List",Ext.ux.grid.Panel,{store:"CallShopCdr",initComponent:function(){var b=this;b.buttonCsv=false;b.buttonUpdateLot=false;b.allowUpdate=true;b.allowDelete=false;b.allowCreate=false;b.allowUpdate=false;b.allowPrint=false;b.columns=[{header:t("cabina"),dataIndex:"cabina",filter:{type:"string"},flex:2},{header:t("number"),dataIndex:"calledstation",filter:{type:"string"},flex:3},{dataIndex:"destination",header:t("destination"),flex:3},{header:"Pago",dataIndex:"status",renderer:Helper.Util.formattyyesno,flex:2,filter:{type:"list",options:[[0,t("no")],[1,t("yes")]]}},{header:t("buyrate"),dataIndex:"buycost",renderer:Helper.Util.formatMoneyDecimal,flex:2},{header:t("rateinitial"),dataIndex:"price",renderer:Helper.Util.formatMoneyDecimal,flex:2},{header:t("markup"),dataIndex:"markup",renderer:Ext.util.Format.numberRenderer("0.00 %"),flex:2},{header:t("sessiontime"),dataIndex:"sessiontime",renderer:Helper.Util.formatsecondsToTime,flex:2},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"date",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callshopcdrlist"],["component","box","container","panel","tablepanel","gridpanel","grid","callshopcdrlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callshopcdrlist:true},["widget.callshopcdrlist"],0,[MBilling.view.callShopCdr,"List"],0));(Ext.cmd.derive("MBilling.view.callShopCdr.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:App.user.isClient}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callshopcdrform"],["component","box","container","panel","form","callshopcdrform"],{component:true,box:true,container:true,panel:true,form:true,callshopcdrform:true},["widget.callshopcdrform"],0,[MBilling.view.callShopCdr,"Form"],0));(Ext.cmd.derive("MBilling.view.rateCallshop.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.ratecallshop"],0,[MBilling.view.rateCallshop,"Controller"],0));(Ext.cmd.derive("MBilling.view.rateCallshop.Module",Ext.ux.panel.Module,{controller:"ratecallshop"},0,["ratecallshopmodule"],["component","box","container","uxpanelmodule","ratecallshopmodule"],{component:true,box:true,container:true,uxpanelmodule:true,ratecallshopmodule:true},["widget.ratecallshopmodule"],0,[MBilling.view.rateCallshop,"Module"],0));(Ext.cmd.derive("MBilling.view.rateCallshop.List",Ext.ux.grid.Panel,{store:"RateCallshop",buttonImportCsv:true,initComponent:function(){var b=this;b.buttonImportCsv=App.user.isClient,b.buttonCsv=App.user.isClient;b.allowPrint=App.user.isClient;b.buttonUpdateLot=App.user.isClient;b.allowCreate=App.user.isClient;b.allowUpdate=App.user.isClient;b.allowDelete=App.user.isClient;b.buttonUpdateLotCallShopRate=App.user.isClient;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("dialprefix"),dataIndex:"dialprefix",filter:{type:"string"},flex:2},{header:t("destination"),dataIndex:"destination",flex:3},{header:t("rateinitial"),dataIndex:"buyrate",renderer:Helper.Util.formatMoneyDecimal4,flex:2},{header:t("buyrateinitblock"),dataIndex:"minimo",flex:2},{header:t("buyrateincrement"),dataIndex:"block",flex:2}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["ratecallshoplist"],["component","box","container","panel","tablepanel","gridpanel","grid","ratecallshoplist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,ratecallshoplist:true},["widget.ratecallshoplist"],0,[MBilling.view.rateCallshop,"List"],0));(Ext.cmd.derive("MBilling.view.rateCallshop.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{xtype:"numberfield",name:"dialprefix",fieldLabel:t("prefix")},{name:"destination",fieldLabel:t("destination")},{xtype:"moneyfield",name:"buyrate",fieldLabel:t("rateinitial")},{xtype:"numberfield",name:"minimo",value:1,minValue:1,fieldLabel:t("buyrateinitblock")},{xtype:"numberfield",name:"block",value:1,minValue:1,fieldLabel:t("buyrateincrement")},{xtype:"numberfield",name:"minimal_time_charge",value:0,minValue:0,fieldLabel:t("Minimal time to charge")}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["ratecallshopform"],["component","box","container","panel","form","ratecallshopform"],{component:true,box:true,container:true,panel:true,form:true,ratecallshopform:true},["widget.ratecallshopform"],0,[MBilling.view.rateCallshop,"Form"],0));(Ext.cmd.derive("MBilling.view.rateCallshop.ImportCsv",Ext.ux.window.ImportCsv,{htmlTipInfo:"
"+t("dialprefix")+", "+t("destination")+", "+t("rateinitial")+"
5511, Brasil SP, 0.080
34, Spain Fix, 0.056
54, Argentina, 0.025

"+t("rateinitial")+" "+t("and")+" "+t("buyrate")+""},0,["ratecallshopimportcsv"],["component","box","container","panel","window","ratecallshopimportcsv"],{component:true,box:true,container:true,panel:true,window:true,ratecallshopimportcsv:true},["widget.ratecallshopimportcsv"],0,[MBilling.view.rateCallshop,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.callSummaryCallShop.Controller",MBilling.view.callSummaryPerDay.Controller,{aliasChart:"callsummarycallshopchart"},0,0,0,0,["controller.callsummarycallshop"],0,[MBilling.view.callSummaryCallShop,"Controller"],0));(Ext.cmd.derive("MBilling.view.callSummaryCallShop.Module",Ext.ux.panel.Module,{controller:"callsummarycallshop",titleForm:t("total"),iconForm:"icon-sum",widthForm:250},0,["callsummarycallshopmodule"],["component","box","container","uxpanelmodule","callsummarycallshopmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callsummarycallshopmodule:true},["widget.callsummarycallshopmodule"],0,[MBilling.view.callSummaryCallShop,"Module"],0));(Ext.cmd.derive("MBilling.view.callSummaryCallShop.List",Ext.ux.grid.Panel,{store:"CallSummaryCallShop",initComponent:function(){var b=this;b.buttonImportCsv=false;b.buttonCsv=false;b.allowPrint=false;b.buttonUpdateLot=false;b.allowCreate=false;b.buttonCleanFilter=false;b.allowUpdate=false;b.allowDelete=false;b.extraButtons=[{text:t("charts"),iconCls:"icon-chart-column",handler:"onChart",reference:"chart",disabled:false,hidden:App.user.isClient}];b.collapsedExtraFilters=false;b.titleAddFilter=t("Filter");b.extraFilters=[{field:"t.cabina",label:t("cabina"),type:"string"},{field:"t.calledstation",label:t("prefix"),type:"string"}];b.columns=[{header:t("day"),renderer:Ext.util.Format.dateRenderer("Y-m-d"),dataIndex:"day",filter:{type:"date",field:"date"},flex:3},{menuDisabled:true,header:t("sessiontime")+" "+t("Min"),dataIndex:"sessiontime",flex:2},{menuDisabled:true,header:t("aloc_all_calls"),dataIndex:"aloc_all_calls",renderer:Helper.Util.formatsecondsToTime,flex:3},{menuDisabled:true,header:t("nbcall"),dataIndex:"nbcall",flex:3},{menuDisabled:true,header:t("buycost"),dataIndex:"buycost",renderer:Helper.Util.formatMoneyDecimal,flex:3,hideable:false,hidden:!App.user.isClient},{menuDisabled:true,header:t("sessionbill"),dataIndex:"price",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:!App.user.isClient},{menuDisabled:true,header:t("markup"),dataIndex:"lucro",renderer:Helper.Util.formatMoneyDecimal,flex:3,hideable:false,hidden:!App.user.isClient}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarycallshoplist"],["component","box","container","panel","tablepanel","gridpanel","grid","callsummarycallshoplist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callsummarycallshoplist:true},["widget.callsummarycallshoplist"],0,[MBilling.view.callSummaryCallShop,"List"],0));(Ext.cmd.derive("MBilling.view.callSummaryCallShop.Form",Ext.ux.form.Panel,{defaults:{},labelWidthFields:150,defaultType:"displayfield",initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{name:"sumsessiontime",fieldLabel:t("sessiontime")+" "+t("Min")},{name:"sumprice",fieldLabel:t("sessionbill"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isClient},{name:"sumlucro",fieldLabel:t("markup"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isClient},{name:"sumbuycost",fieldLabel:t("buycost"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isClient},{name:"sumnbcall",fieldLabel:t("nbcall"),hidden:!App.user.isClient}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarycallshopform"],["component","box","container","panel","form","callsummarycallshopform"],{component:true,box:true,container:true,panel:true,form:true,callsummarycallshopform:true},["widget.callsummarycallshopform"],0,[MBilling.view.callSummaryCallShop,"Form"],0));(Ext.cmd.derive("MBilling.view.callSummaryCallShop.Chart",Ext.ux.panel.Chart,{controller:"callsummarycallshop",store:"CallSummaryCallShop",fieldValue:"sessiontime",fieldDescription:"day",labelYLine:t("sessiontime")+" Min",labelXLine:t("day"),initComponent:function(){var d=this,c;d.rendererFieldValue=Ext.util.Format.numberRenderer("0"),d.rendererFieldDescription=Ext.util.Format.dateRenderer("Y-m-d");d.tbarChart=[{xtype:"buttongroup",toggleGroup:"charts",defaults:{enableToggle:true,toggleGroup:"charts",allowDepress:false,listeners:{toggle:"onToggleGroupButton"}},items:[{pressed:true,text:t("sessiontime"),chart:"sessiontime",sumName:"sumsessiontime"},{text:t("buycost"),sumRenderer:Helper.Util.formatMoneyDecimal,chart:"buycost",sumName:"sumbuycost"},{text:t("sessionbill"),sumRenderer:Helper.Util.formatMoneyDecimal,chart:"price",sumName:"sumprice"},{text:t("markup"),sumRenderer:Helper.Util.formatMoneyDecimal,chart:"lucro",sumName:"sumlucro",hidden:App.user.isClient||App.user.isAgent},{text:t("nbcall"),chart:"nbcall",sumName:"sumnbcall"}]}];d.bbarChart=[{xtype:"tbtext",itemId:"tbTextSum"}];Ext.ux.panel.Chart.prototype.initComponent.apply(this,arguments)}},0,["callsummarycallshopchart"],["component","box","container","panel","chartpanel","callsummarycallshopchart"],{component:true,box:true,container:true,panel:true,chartpanel:true,callsummarycallshopchart:true},["widget.callsummarycallshopchart"],0,[MBilling.view.callSummaryCallShop,"Chart"],0));(Ext.cmd.derive("MBilling.view.buycredit.Controller",Ext.ux.app.ViewController,{buyCreditClose:function(e){var j=this,g=j.lookupReference("buycreditPanel"),f=j.lookupReference("btnCancel");g.getForm().findField("amount")["show"]();g.getForm().findField("method")["show"]();g.getForm().findField("card_num")["hide"]();g.getForm().findField("exp_date")["hide"]();g.getForm().findField("method").setValue("");f.setVisible(false)},buyCredit:function(r){var o=this,n=o.lookupReference("buycreditPanel"),s=o.lookupReference("btnCancel"),p=n.getForm().findField("amount").getValue(),l=n.getForm().findField("method").getValue(),m=n.getForm().findField("card_num").getValue(),q=n.getForm().findField("exp_date").rawValue;if(n.getForm().findField("method").rawValue.match(/uthorize/)){if(m){n.setLoading(o.msgWait);Ext.Ajax.request({url:"index.php/buyCredit/method/?amount="+p+"&id_method="+l+"&cc="+m+"&ed="+q,scope:o,success:function(a){a=Ext.decode(a.responseText);if(a.success){Ext.ux.Alert.alert(t("Success"),a.msg,"success",10000);n.setLoading(false);n.getForm().findField("amount")["show"]();n.getForm().findField("method")["show"]();n.getForm().findField("card_num")["hide"]();n.getForm().findField("exp_date")["hide"]();s.setVisible(false);n.getForm().findField("card_num").setValue("");n.getForm().findField("exp_date").setValue("");n.getForm().findField("method").setValue("")}else{Ext.ux.Alert.alert(t("Error"),a.msg,"error");n.getForm().findField("card_num").setValue("");n.getForm().findField("exp_date").setValue("");n.setLoading(false)}}});return}else{n.getForm().findField("amount")["hide"]();n.getForm().findField("method")["hide"]();n.getForm().findField("card_num")["show"]();n.getForm().findField("exp_date")["show"]();s.setVisible(true);n.getForm().findField("card_num").focus()}}else{if(!l){Ext.ux.Alert.alert(o.titleWarning,t("Select a ")+t("paymentmethods"),"warning");return}else{if(p<=0){Ext.ux.Alert.alert(o.titleWarning,t("Select a ")+t("valid")+" "+t("amount"),"warning");return}else{url="index.php/buyCredit/method/?amount="+p+"&id_method="+l;n.getForm().findField("method").setValue("");n.getForm().findField("card_num").setValue("");n.getForm().findField("exp_date").setValue("");if(n.getForm().findField("method").rawValue.match(/PlacetoPay/)){window.open(url,"_self")}else{window.open(url,"_blank")}}}}}},0,0,0,0,["controller.buycredit"],0,[MBilling.view.buycredit,"Controller"],0));(Ext.cmd.derive("MBilling.view.buycredit.Module",Ext.form.Panel,{controller:"buycredit",resizable:false,autoShow:true,header:false,initComponent:function(){var b=this;b.items=[{reference:"buycreditPanel",xtype:"form",margin:"10 10 10 10",autoShow:true,closable:false,resizable:false,bodyPadding:10,defaultType:"textfield",defaults:{labelAlign:"right",labelWidth:150,width:280,allowBlank:false,msgTarget:"side",enableKeyEvents:true,plugins:"markallowblank",anchor:"100%"},items:[{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,00",fieldLabel:t("Amounts"),value:0,name:"amount"},{xtype:"methodpaycombo",fieldLabel:t("paymentmethods"),name:"method"},{fieldLabel:t("CreditCard Number"),name:"card_num",hidden:true},{xtype:"datefield",fieldLabel:t("Expiration Date"),name:"exp_date",format:"m/y",hidden:true}],bbar:[{text:t("Cancel"),tooltip:t("Cancel"),glyph:b.glyphCancel,handler:"buyCreditClose",hidden:true,reference:"btnCancel"},{text:t("Next"),tooltip:t("Next"),width:100,glyph:icons.disk,handler:"buyCredit"}]}];Ext.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["buycreditmodule"],["component","box","container","panel","form","buycreditmodule"],{component:true,box:true,container:true,panel:true,form:true,buycreditmodule:true},["widget.buycreditmodule"],0,[MBilling.view.buycredit,"Module"],0));(Ext.cmd.derive("MBilling.view.transferToMobile.Module",Ext.form.Panel,{resizable:false,autoShow:true,header:false,items:[{xtype:"component",autoEl:{width:"100%",height:"100%",tag:"iframe",src:"index.php/transferToMobile/read"}}]},0,["transfertomobilemodule"],["component","box","container","panel","form","transfertomobilemodule"],{component:true,box:true,container:true,panel:true,form:true,transfertomobilemodule:true},["widget.transfertomobilemodule"],0,[MBilling.view.transferToMobile,"Module"],0));(Ext.cmd.derive("MBilling.view.firewall.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.firewall"],0,[MBilling.view.firewall,"Controller"],0));(Ext.cmd.derive("MBilling.view.firewall.Module",Ext.ux.panel.Module,{controller:"firewall"},0,["firewallmodule"],["component","box","container","uxpanelmodule","firewallmodule"],{component:true,box:true,container:true,uxpanelmodule:true,firewallmodule:true},["widget.firewallmodule"],0,[MBilling.view.firewall,"Module"],0));(Ext.cmd.derive("MBilling.view.firewall.List",Ext.ux.grid.Panel,{store:"Firewall",initComponent:function(){var b=this;b.textDelete="Unban";b.textNew="Ban new Ip";b.buttonCsv=false;b.buttonUpdateLot=false;b.buttonCleanFilter=true;b.allowPrint=false;b.allowCreate=true;b.allowDelete=true;b.columns=[{header:t("Ip"),dataIndex:"ip",flex:4},{header:t("Type"),dataIndex:"jail",flex:4},{header:t("Permanently")+" "+t("Ban"),dataIndex:"action",renderer:Helper.Util.formattyyesno,filter:{type:"list",options:[[0,t("no")],[1,t("yes")]]},flex:2}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["firewalllist"],["component","box","container","panel","tablepanel","gridpanel","grid","firewalllist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,firewalllist:true},["widget.firewalllist"],0,[MBilling.view.firewall,"List"],0));(Ext.cmd.derive("MBilling.view.firewall.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{name:"ip",fieldLabel:t("Ip"),vtype:"IPAddress"},{xtype:"yesnocombo",fieldLabel:t("Permanently")+" "+t("Ban"),name:"action"},{xtype:"textarea",name:"description",fieldLabel:t("description"),allowBlank:true,height:300,anchor:"100%",readOnly:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["firewallform"],["component","box","container","panel","form","firewallform"],{component:true,box:true,container:true,panel:true,form:true,firewallform:true},["widget.firewallform"],0,[MBilling.view.firewall,"Form"],0));(Ext.cmd.derive("MBilling.view.userRate.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.userrate"],0,[MBilling.view.userRate,"Controller"],0));(Ext.cmd.derive("MBilling.view.userRate.Module",Ext.ux.panel.Module,{controller:"userrate"},0,["userratemodule"],["component","box","container","uxpanelmodule","userratemodule"],{component:true,box:true,container:true,uxpanelmodule:true,userratemodule:true},["widget.userratemodule"],0,[MBilling.view.userRate,"Module"],0));(Ext.cmd.derive("MBilling.view.userRate.List",Ext.ux.grid.Panel,{store:"UserRate",initComponent:function(){var b=this;b.buttonCsv=false;b.allowPrint=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("prefix"),dataIndex:"idPrefixprefix",flex:window.isTablet?2:3},{dataIndex:"idPrefixdestination",header:t("destination"),flex:window.isTablet?2:3},{header:t("rateinitial"),dataIndex:"rateinitial",renderer:Helper.Util.formatMoneyDecimal,flex:2},{header:t("initblock"),dataIndex:"initblock",flex:2},{header:t("billingblock"),dataIndex:"billingblock",flex:2}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["userratelist"],["component","box","container","panel","tablepanel","gridpanel","grid","userratelist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,userratelist:true},["widget.userratelist"],0,[MBilling.view.userRate,"List"],0));(Ext.cmd.derive("MBilling.view.userRate.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{fieldLabel:t("User"),name:"id_user",xtype:!App.user.isAdmin?"textfield":"userlookup",ownerForm:b,hidden:!App.user.isAdmin,allowBlank:!App.user.isAdmin},{fieldLabel:t("Destination"),name:"id_prefix",xtype:"prefixlookup",ownerForm:b,hidden:!App.user.isAdmin,allowBlank:!App.user.isAdmin},{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,"+App.user.decimalPrecision,name:"rateinitial",fieldLabel:t("rateinitial"),readOnly:App.user.isClient},{xtype:"numberfield",name:"initblock",fieldLabel:t("initblock"),hidden:App.user.isClient},{xtype:"numberfield",name:"billingblock",fieldLabel:t("billingblock"),hidden:App.user.isClient}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["userrateform"],["component","box","container","panel","form","userrateform"],{component:true,box:true,container:true,panel:true,form:true,userrateform:true},["widget.userrateform"],0,[MBilling.view.userRate,"Form"],0));(Ext.cmd.derive("MBilling.view.extra.Module",Ext.form.Panel,{resizable:false,autoShow:true,header:false,items:[{xtype:"component",autoEl:{width:"100%",height:"100%",tag:"iframe",src:window.moduleExtra}}]},0,["extramodule"],["component","box","container","panel","form","extramodule"],{component:true,box:true,container:true,panel:true,form:true,extramodule:true},["widget.extramodule"],0,[MBilling.view.extra,"Module"],0));(Ext.cmd.derive("MBilling.view.callOnlineChart.Module",Ext.ux.panel.Module,{},0,["callOnlineChartmodule"],["component","box","container","uxpanelmodule","callOnlineChartmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callOnlineChartmodule:true},["widget.callOnlineChartmodule"],0,[MBilling.view.callOnlineChart,"Module"],0));(Ext.cmd.derive("MBilling.view.callOnlineChart.List",Ext.ux.grid.Panel,{store:"CallOnlineChart",initComponent:function(){var b=this;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("Total"),dataIndex:"total",flex:1},{header:t("date"),dataIndex:"date",renderer:Ext.util.Format.dateRenderer("Y-m-d H:i"),flex:1}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callonlinechartlist"],["component","box","container","panel","tablepanel","gridpanel","grid","callonlinechartlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callonlinechartlist:true},["widget.callonlinechartlist"],0,[MBilling.view.callOnlineChart,"List"],0));(Ext.cmd.derive("MBilling.view.callOnlineChart.Form",Ext.ux.form.Panel,{},0,["callOnlineChartform"],["component","box","container","panel","form","callOnlineChartform"],{component:true,box:true,container:true,panel:true,form:true,callOnlineChartform:true},["widget.callOnlineChartform"],0,[MBilling.view.callOnlineChart,"Form"],0));(Ext.cmd.derive("MBilling.view.callOnlineChart.Chart",Ext.ux.panel.Chart,{controller:"callsummaryperday",store:"CallOnlineChart",fieldValue:["total","answer"],fieldDescription:"date",labelYLine:t("total")+" / Min",labelXLine:t("Minute"),reference:"callonlinechartchart",defaultChart:"line",btnShowColumn:false,btnShowBar:false,btnShowLine:true,btnShowPie:false,animate:true,btnShowLineHidden:true,initComponent:function(){var b=this;b.rendererFieldValue=Ext.util.Format.numberRenderer("0");b.tbarChart=[{text:t("Per")+" "+t("Minute"),scope:b,handler:"onPerMinute",reference:"btnMinute",disabled:true},{text:t("Per")+" "+t("Hour"),scope:b,handler:"onPerhour",reference:"btnHour"}];b.legend={position:"right",boxStrokeWidth:0,labelFont:"12px Helvetica",renderer:b.rendererLegend};b.bbarChart=[{xtype:"tbtext",itemId:"tbTextSum"}];b.sessionLoad=Ext.create("Ext.util.DelayedTask",function(){b.store.load()},b);Ext.ux.panel.Chart.prototype.initComponent.apply(this,arguments);b.store.on("load",b.onLoadStore,b)},onPerMinute:function(d){var c=this;c.lookupReference("btnMinute").disable();c.lookupReference("btnHour").enable();c.store.setRemoteFilter(true);c.store.filter("type","minute");c.store.load()},onPerhour:function(d){var c=this;c.lookupReference("btnHour").disable();c.lookupReference("btnMinute").enable();c.store.setRemoteFilter(true);c.store.filter("type","hour");c.store.load()},onLoadStore:function(){this.onActivateModule()},onActivateModule:function(){this.sessionLoad&&this.sessionLoad.delay(25000)}},0,["callonlinechartchart"],["component","box","container","panel","chartpanel","callonlinechartchart"],{component:true,box:true,container:true,panel:true,chartpanel:true,callonlinechartchart:true},["widget.callonlinechartchart"],0,[MBilling.view.callOnlineChart,"Chart"],0));(Ext.cmd.derive("MBilling.view.smtps.Controller",Ext.ux.app.ViewController,{onSendEmail:function(e){var f=this,d=f.list.getSelectionModel().getSelection()[0];f.list.setLoading(true);if(f.list.getSelectionModel().getSelection().length==1){Ext.Ajax.request({url:"index.php/smtps/testMail",params:{id:d.get("id")},scope:f,success:function(a){a=Ext.decode(a.responseText);if(a[f.nameSuccessRequest]){Ext.ux.Alert.alert(f.titleSuccess,a[f.nameMsgRequest],"success")}else{Ext.ux.Alert.alert(f.titleError,a[f.nameMsgRequest],"error")}f.list.setLoading(false)}})}else{Ext.ux.Alert.alert(f.titleError,"Please Select a Smtp","notification");f.list.setLoading(false)}}},0,0,0,0,["controller.smtps"],0,[MBilling.view.smtps,"Controller"],0));(Ext.cmd.derive("MBilling.view.smtps.List",Ext.ux.grid.Panel,{store:"Smtps",initComponent:function(){var b=this;b.extraButtons=[{text:t("Test Smtp"),iconCls:"templatemail",handler:"onSendEmail",disabled:false}];b.buttonUpdateLot=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("Host"),dataIndex:"host",flex:4},{header:t("username"),dataIndex:"username",flex:2},{header:t("Port"),dataIndex:"port",flex:3},{header:t("Encryption"),dataIndex:"encryption",flex:3}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["smtpslist"],["component","box","container","panel","tablepanel","gridpanel","grid","smtpslist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,smtpslist:true},["widget.smtpslist"],0,[MBilling.view.smtps,"List"],0));(Ext.cmd.derive("MBilling.view.smtps.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{name:"host",fieldLabel:t("Host"),hidden:App.user.isClient},{name:"username",fieldLabel:t("username"),hidden:App.user.isClient},{inputType:"password",name:"password",fieldLabel:t("password"),hidden:App.user.isClient},{xtype:"numberfield",name:"port",fieldLabel:t("Port"),value:587,hidden:App.user.isClient},{xtype:"combobox",name:"encryption",fieldLabel:t("Encryption"),hidden:App.user.isClient,value:"null",store:[["ssl",t("SSl")],["tls",t("TLS")],["null",t("NULL")]]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["smtpsform"],["component","box","container","panel","form","smtpsform"],{component:true,box:true,container:true,panel:true,form:true,smtpsform:true},["widget.smtpsform"],0,[MBilling.view.smtps,"Form"],0));(Ext.cmd.derive("MBilling.view.smtps.Module",Ext.ux.panel.Module,{controller:"smtps"},0,["smtpsmodule"],["component","box","container","uxpanelmodule","smtpsmodule"],{component:true,box:true,container:true,uxpanelmodule:true,smtpsmodule:true},["widget.smtpsmodule"],0,[MBilling.view.smtps,"Module"],0));(Ext.cmd.derive("MBilling.view.servers.Controller",Ext.ux.app.ViewController,{init:function(){var b=this;b.control({combobox:{select:b.onSelectType}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectType:function(c,d){this.showFieldsRelated(d.getData().showFields)},showFieldsRelated:function(l){var m=this,g=m.formPanel.getForm().getFields(),j=m.formPanel.getForm().findField("weight"),f=m.formPanel.getForm();g.each(function(a){if(a.name=="type"){if(a.value=="asterisk"||a.value=="mbilling"){j.show()}else{j.hide()}}})},onEdit:function(){var d=this,f=d.formPanel.getForm().findField("weight"),e=d.formPanel.getForm().findField("type");Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments);if(e.value=="asterisk"||e.value=="mbilling"){f.show()}else{f.hide()}},onDelete:function(d){var f=this,e;notDelete=false;Ext.each(f.list.getSelectionModel().getSelection(),function(a){if(a.get("id")==1){Ext.ux.Alert.alert(f.titleError,t("You cannot delete the")+" server id 1","error");notDelete=true}});if(notDelete==false){Ext.ux.app.ViewController.prototype.onDelete.apply(this,arguments)}}},0,0,0,0,["controller.servers"],0,[MBilling.view.servers,"Controller"],0));(Ext.cmd.derive("MBilling.view.servers.List",Ext.ux.grid.Panel,{store:"Servers",initComponent:function(){var b=this;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("host"),dataIndex:"host",flex:4},{header:t("username"),dataIndex:"username",flex:4},{header:t("type"),dataIndex:"type",comboRelated:"booleancombo",flex:2},{header:t("status"),dataIndex:"status",renderer:Helper.Util.formatBooleanActive,comboRelated:"booleancombo",flex:2,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")]]}}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["serverslist"],["component","box","container","panel","tablepanel","gridpanel","grid","serverslist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,serverslist:true},["widget.serverslist"],0,[MBilling.view.servers,"List"],0));(Ext.cmd.derive("MBilling.view.servers.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["id_user"],initComponent:function(){var b=this;b.items=[{name:"host",fieldLabel:t("host")},{name:"username",fieldLabel:t("username"),allowBlank:true},{name:"password",fieldLabel:t("password"),allowBlank:true},{name:"port",fieldLabel:t("port"),allowBlank:true},{xtype:"combobox",name:"type",fieldLabel:t("type"),forceSelection:true,editable:false,value:"mbilling",store:[["mbilling",t("Mbilling")],["asterisk",t("Asterisk")],["sipproxy",t("SipProxy")]]},{fieldLabel:t("Weight"),name:"weight",hidden:true,allowBlank:true,emptyText:t("This is useful in order to get a different ratio of traffic between servers.")},{xtype:"booleancombo",name:"status",fieldLabel:t("status"),allowBlank:true},{xtype:"textareafield",name:"description",fieldLabel:t("description"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["serversform"],["component","box","container","panel","form","serversform"],{component:true,box:true,container:true,panel:true,form:true,serversform:true},["widget.serversform"],0,[MBilling.view.servers,"Form"],0));(Ext.cmd.derive("MBilling.view.servers.Module",Ext.ux.panel.Module,{controller:"servers"},0,["serversmodule"],["component","box","container","uxpanelmodule","serversmodule"],{component:true,box:true,container:true,uxpanelmodule:true,serversmodule:true},["widget.serversmodule"],0,[MBilling.view.servers,"Module"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerUser.Controller",Ext.ux.app.ViewController,{formHidden:true,onEdit:function(){me=this;me.sumData=me.store.getData().items[0].getData();if(!me.sumData){return}me.formPanel.getForm().getFields().each(function(b){b.setValue(me.sumData[b.name])});me.formPanel.expand()},onExportCsvUser:function(o,l,g){var m=this,j=m.list.getStore(),n=m.list.filters.getFilterData().length?Ext.encode(m.list.filters.getFilterData()):j.proxy.extraParams.filter;window.open("index.php/callSummaryPerUser/exportCsvCalls?id="+o.getStore().getAt(l).getData().idUserusername+"&filter="+n)}},0,0,0,0,["controller.callsummaryperuser"],0,[MBilling.view.callSummaryPerUser,"Controller"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerUser.List",Ext.ux.grid.Panel,{store:"CallSummaryPerUser",initComponent:function(){var b=this;b.buttonImportCsv=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{xtype:"actioncolumn",width:26,sortable:false,menuDisabled:true,header:t(""),dataIndex:"id",items:[{iconCls:"icon-export-csv",tooltip:t("Export CSV"),handler:"onExportCsvUser"}],hidden:!App.user.isAdmin},{header:t("Username"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:3},{header:t("sessiontime")+" "+t("Min"),dataIndex:"sessiontime",flex:2},{header:t("aloc_all_calls"),dataIndex:"aloc_all_calls",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Answered Calls"),dataIndex:"nbcall",flex:3},{header:t("Failed Calls"),dataIndex:"nbcall_fail",flex:3},{header:t("buycost"),dataIndex:App.user.isAdmin?"buycost":"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("sessionbill"),dataIndex:App.user.isAgent||App.user.isClientAgent?"agent_bill":"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("markup"),dataIndex:"lucro",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("ASR"),dataIndex:"asr",renderer:Helper.Util.formatPorcente,flex:3,hidden:!App.user.isAdmin,hideable:App.user.isAdmin}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummaryperuserlist"],["component","box","container","panel","tablepanel","gridpanel","grid","callsummaryperuserlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callsummaryperuserlist:true},["widget.callsummaryperuserlist"],0,[MBilling.view.callSummaryPerUser,"List"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerUser.Form",Ext.ux.form.Panel,{defaults:{},labelWidthFields:100,defaultType:"displayfield",initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{name:"sumsessiontime",fieldLabel:t("sessiontime")+" "+t("Min"),renderer:Ext.util.Format.numberRenderer("0"),allowBlank:true},{name:App.user.isAgent||App.user.isClientAgent?"sumagent_bill":"sumsessionbill",fieldLabel:t("sessionbill"),renderer:Helper.Util.formatMoneyDecimal,allowBlank:true},{name:App.user.isAdmin?"sumbuycost":"sumsessionbill",fieldLabel:t("buycost"),renderer:Helper.Util.formatMoneyDecimal,hidden:App.user.isClient,allowBlank:true},{name:"sumlucro",fieldLabel:t("markup"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumnbcall",fieldLabel:t("Answered Calls"),allowBlank:true},{name:"sumnbcallfail",fieldLabel:t("Failed Calls"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummaryperuserform"],["component","box","container","panel","form","callsummaryperuserform"],{component:true,box:true,container:true,panel:true,form:true,callsummaryperuserform:true},["widget.callsummaryperuserform"],0,[MBilling.view.callSummaryPerUser,"Form"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerUser.Module",Ext.ux.panel.Module,{controller:"callsummaryperuser",cfgEast:{flex:0.4}},0,["callsummaryperusermodule"],["component","box","container","uxpanelmodule","callsummaryperusermodule"],{component:true,box:true,container:true,uxpanelmodule:true,callsummaryperusermodule:true},["widget.callsummaryperusermodule"],0,[MBilling.view.callSummaryPerUser,"Module"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerTrunk.Controller",Ext.ux.app.ViewController,{formHidden:true,onEdit:function(){me=this;me.sumData=me.store.getData().items[0].getData();if(!me.sumData){return}me.formPanel.getForm().getFields().each(function(b){b.setValue(me.sumData[b.name])});me.formPanel.expand()},onExportCsvUser:function(o,l,g){var m=this,j=m.list.getStore(),n=m.list.filters.getFilterData().length?Ext.encode(m.list.filters.getFilterData()):j.proxy.extraParams.filter;window.open("index.php/callSummaryPerTrunk/exportCsvCalls?id="+o.getStore().getAt(l).getData().idTrunktrunkcode+"&filter="+n)}},0,0,0,0,["controller.callsummarypertrunk"],0,[MBilling.view.callSummaryPerTrunk,"Controller"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerTrunk.List",Ext.ux.grid.Panel,{store:"CallSummaryPerTrunk",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{xtype:"actioncolumn",width:26,sortable:false,menuDisabled:true,header:t(""),dataIndex:"id",items:[{iconCls:"icon-export-csv",tooltip:t("Export CSV"),handler:"onExportCsvUser"}],hidden:!App.user.isAdmin},{header:t("Trunk"),dataIndex:"idTrunktrunkcode",filter:{type:"string",field:"idTrunk.trunkcode"},flex:3},{header:t("sessiontime")+" "+t("Min"),dataIndex:"sessiontime",flex:2},{header:t("aloc_all_calls"),dataIndex:"aloc_all_calls",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Answered Calls"),dataIndex:"nbcall",flex:3},{header:t("Failed Calls"),dataIndex:"nbcall_fail",flex:3},{header:t("buycost"),dataIndex:"buycost",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("sessionbill"),dataIndex:"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("markup"),dataIndex:"lucro",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("ASR"),dataIndex:"asr",renderer:Helper.Util.formatPorcente,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarypertrunklist"],["component","box","container","panel","tablepanel","gridpanel","grid","callsummarypertrunklist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callsummarypertrunklist:true},["widget.callsummarypertrunklist"],0,[MBilling.view.callSummaryPerTrunk,"List"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerTrunk.Form",Ext.ux.form.Panel,{defaults:{},labelWidthFields:100,defaultType:"displayfield",initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{name:"sumsessiontime",fieldLabel:t("sessiontime")+" "+t("Min"),renderer:Ext.util.Format.numberRenderer("0"),allowBlank:true},{name:"sumsessionbill",fieldLabel:t("sessionbill"),renderer:Helper.Util.formatMoneyDecimal,allowBlank:true},{name:"sumbuycost",fieldLabel:t("buycost"),renderer:Helper.Util.formatMoneyDecimal,hidden:App.user.isClient,allowBlank:true},{name:"sumlucro",fieldLabel:t("markup"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumnbcall",fieldLabel:t("Answered Calls"),allowBlank:true},{name:"sumnbcallfail",fieldLabel:t("Failed Calls"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarypertrunkform"],["component","box","container","panel","form","callsummarypertrunkform"],{component:true,box:true,container:true,panel:true,form:true,callsummarypertrunkform:true},["widget.callsummarypertrunkform"],0,[MBilling.view.callSummaryPerTrunk,"Form"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerTrunk.Module",Ext.ux.panel.Module,{controller:"callsummarypertrunk",cfgEast:{flex:0.4}},0,["callsummarypertrunkmodule"],["component","box","container","uxpanelmodule","callsummarypertrunkmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callsummarypertrunkmodule:true},["widget.callsummarypertrunkmodule"],0,[MBilling.view.callSummaryPerTrunk,"Module"],0));(Ext.cmd.derive("MBilling.view.backup.Controller",Ext.ux.app.ViewController,{formHidden:true,onDownload:function(l){var j=this,m,f=j.list.getSelectionModel().getSelection()[0],g=[];values="file="+f.data.name;url="index.php/backup/download/?"+values;window.open(url)},onDelete:function(m){var l=this,n,o=l.list.getSelectionModel().getSelection()[0],j=[];destroyType=m.menu.down("menucheckitem[checked=true]").value;var g=(destroyType==="all")?l.msgDeleteAll:l.msgConfirmation;if(!l.list.allowDelete){return}if(destroyType==="all"){Ext.ux.Alert.alert(l.titleError,"You cannot delete all backups","notification");return}if(o){Ext.Msg.confirm(l.titleConfirmation,g,function(a){if(a==="yes"){Ext.each(l.list.getSelectionModel().getSelection(),function(b){j.push(b.get("name"))});Ext.Ajax.request({url:"index.php/backup/destroy",params:{ids:Ext.encode(j)},scope:l,success:function(d){d=Ext.decode(d.responseText);if(d[l.nameSuccessRequest]){var c=Helper.Util.convertErrorsJsonToString(d[l.nameMsgRequest]);Ext.ux.Alert.alert(l.titleSuccess,c,"success")}else{var b=Helper.Util.convertErrorsJsonToString(d[l.nameMsgRequest]);Ext.ux.Alert.alert(l.titleError,b,"notification")}}});l.store.load()}},l)}else{Ext.ux.Alert.alert(l.titleError,t("Please select one or more register"),"notification")}},onNew:function(){var b=this;Ext.Msg.confirm(b.titleConfirmation,t("Do you relly want create a new backup now? It can take many time and make your server slow. Mbilling make backup every day automatically."),function(a){if(a==="yes"){Ext.Msg.confirm(b.titleConfirmation,t("This backup will override the backup held today! Do you sure?"),function(d){if(d==="yes"){Ext.Ajax.request({url:"index.php/backup/save",params:{ids:0},scope:b,success:function(j){j=Ext.decode(j.responseText);if(j[b.nameSuccessRequest]){var g=Helper.Util.convertErrorsJsonToString(j[b.nameMsgRequest]);Ext.ux.Alert.alert(b.titleSuccess,g,"success")}else{var c=Helper.Util.convertErrorsJsonToString(j[b.nameMsgRequest]);Ext.ux.Alert.alert(b.titleError,c,"notification")}}});b.store.load()}},b)}},b)}},0,0,0,0,["controller.backup"],0,[MBilling.view.backup,"Controller"],0));(Ext.cmd.derive("MBilling.view.backup.List",Ext.ux.grid.Panel,{store:"Backup",initComponent:function(){var b=this;b.buttonImportCsv=true;b.textButtonImportCsv=t("Importar Backup");b.widthButtonCsv=140;b.extraButtons=[{text:t("Download Backup"),glyph:icons.disk,handler:"onDownload",width:140,disabled:false}];b.buttonCsv=false;b.allowPrint=false;b.buttonUpdateLot=false;b.buttonCleanFilter=false;b.allowUpdate=false;b.columns=[{menuDisabled:true,header:t("name"),dataIndex:"name",flex:1},{menuDisabled:true,header:t("size"),dataIndex:"size",flex:1}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["backuplist"],["component","box","container","panel","tablepanel","gridpanel","grid","backuplist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,backuplist:true},["widget.backuplist"],0,[MBilling.view.backup,"List"],0));(Ext.cmd.derive("MBilling.view.backup.Form",Ext.ux.form.Panel,{},0,["backupform"],["component","box","container","panel","form","backupform"],{component:true,box:true,container:true,panel:true,form:true,backupform:true},["widget.backupform"],0,[MBilling.view.backup,"Form"],0));(Ext.cmd.derive("MBilling.view.backup.Module",Ext.ux.panel.Module,{controller:"backup",initComponent:function(){var b=this;Ext.ux.panel.Module.prototype.initComponent.apply(this,arguments)}},0,["backupmodule"],["component","box","container","uxpanelmodule","backupmodule"],{component:true,box:true,container:true,uxpanelmodule:true,backupmodule:true},["widget.backupmodule"],0,[MBilling.view.backup,"Module"],0));(Ext.cmd.derive("MBilling.view.backup.ImportCsv",Ext.ux.window.ImportCsv,{htmlTipInfo:"",extAllowed:["tgz"],fieldLabel:"Backup",iconCls:"icon-play"},0,["backupimportcsv"],["component","box","container","panel","window","backupimportcsv"],{component:true,box:true,container:true,panel:true,window:true,backupimportcsv:true},["widget.backupimportcsv"],0,[MBilling.view.backup,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.gAuthenticator.Controller",Ext.ux.app.ViewController,{init:function(){var b=this;b.control({statususercombo:{select:b.onSelectMethod}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectMethod:function(c,d){this.showFieldsRelated(d.getData().showFields)},showFieldsRelated:function(l){var m=this,j=m.formPanel.getForm().getFields(),o=m.formPanel.getForm().findField("googleAuthenticator_enable"),n=m.formPanel.getForm().findField("google_authenticator_key"),g=m.formPanel.getForm().findField("code");if(o.value!=1&&n.value.length>5){g.setVisible(true);g.allowBlank=false}else{g.setVisible(false);g.allowBlank=true}},onEdit:function(){var c=this,d=c.formPanel.getForm();if(!App.user.isAdmin){return}d.findField("code").allowBlank=true;d.findField("code").setVisible(false);Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)}},0,0,0,0,["controller.gauthenticator"],0,[MBilling.view.gAuthenticator,"Controller"],0));(Ext.cmd.derive("MBilling.view.gAuthenticator.List",Ext.ux.grid.Panel,{store:"GAuthenticator",fieldSearch:"username",initComponent:function(){var b=this;b.buttonCsv=false;b.allowPrint=false;b.buttonUpdateLot=false;b.allowCreate=false;b.buttonCleanFilter=false;b.allowUpdate=App.user.isAdmin;b.allowDelete=false;if(!App.user.isAdmin){b.columns=[]}else{b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("username"),dataIndex:"username",flex:4},{header:t("status"),dataIndex:"googleAuthenticator_enable",renderer:Helper.Util.formatBooleanActive,comboRelated:"booleancombo",flex:2,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")]]}}]}Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["gauthenticatorlist"],["component","box","container","panel","tablepanel","gridpanel","grid","gauthenticatorlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,gauthenticatorlist:true},["widget.gauthenticatorlist"],0,[MBilling.view.gAuthenticator,"List"],0));(Ext.cmd.derive("MBilling.view.gAuthenticator.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{name:"username",fieldLabel:t("username"),readyOnly:true},{xtype:"statususercombo",name:"googleAuthenticator_enable",fieldLabel:t("status"),allowBlank:true},{vtype:"numberfield",name:"code",fieldLabel:t("Code"),hidden:true,maxLength:6,minLength:6,allowBlank:true},{name:"google_authenticator_key",fieldLabel:t("google_authenticator_key"),readyOnly:true,allowBlank:true,hidden:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["gauthenticatorform"],["component","box","container","panel","form","gauthenticatorform"],{component:true,box:true,container:true,panel:true,form:true,gauthenticatorform:true},["widget.gauthenticatorform"],0,[MBilling.view.gAuthenticator,"Form"],0));(Ext.cmd.derive("MBilling.view.gAuthenticator.Module",Ext.ux.panel.Module,{controller:"gauthenticator"},0,["gauthenticatormodule"],["component","box","container","uxpanelmodule","gauthenticatormodule"],{component:true,box:true,container:true,uxpanelmodule:true,gauthenticatormodule:true},["widget.gauthenticatormodule"],0,[MBilling.view.gAuthenticator,"Module"],0));(Ext.cmd.derive("MBilling.view.groupUserGroup.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.groupusergroup"],0,[MBilling.view.groupUserGroup,"Controller"],0));(Ext.cmd.derive("MBilling.view.groupUserGroup.List",Ext.ux.grid.Panel,{store:"GroupUserGroup",initComponent:function(){var b=this;b.buttonCsv=false;b.allowPrint=false;b.buttonUpdateLot=false;b.allowCreate=false;b.buttonCleanFilter=false;b.allowDelete=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("Group"),dataIndex:"name",flex:4,readOnly:true,hidden:App.user.isClient,hideable:!App.user.isClient}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["groupusergrouplist"],["component","box","container","panel","tablepanel","gridpanel","grid","groupusergrouplist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,groupusergrouplist:true},["widget.groupusergrouplist"],0,[MBilling.view.groupUserGroup,"List"],0));(Ext.cmd.derive("MBilling.view.groupUserGroup.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["id_user"],initComponent:function(){var b=this;b.items=[{name:"name",fieldLabel:t("Group"),readOnly:true},{style:"margin-top:25px",xtype:"fieldset",title:t("Select one or more groups"),collapsible:true,collapsed:false,items:[{anchor:"100%",fieldLabel:"",xtype:"groupusertag",allowBlank:true}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["groupusergroupform"],["component","box","container","panel","form","groupusergroupform"],{component:true,box:true,container:true,panel:true,form:true,groupusergroupform:true},["widget.groupusergroupform"],0,[MBilling.view.groupUserGroup,"Form"],0));(Ext.cmd.derive("MBilling.view.groupUserGroup.Module",Ext.ux.panel.Module,{controller:"groupusergroup"},0,["groupusergroupmodule"],["component","box","container","uxpanelmodule","groupusergroupmodule"],{component:true,box:true,container:true,uxpanelmodule:true,groupusergroupmodule:true},["widget.groupusergroupmodule"],0,[MBilling.view.groupUserGroup,"Module"],0));(Ext.cmd.derive("MBilling.view.services.Controller",Ext.ux.app.ViewController,{init:function(){var b=this;b.control({servicestypecombo:{select:b.onSelectType}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectType:function(c,d){this.showFieldsRelated(d.getData().showFields)},showFieldsRelated:function(m){var n=this,o=n.formPanel.getForm(),p=o.findField("calllimit"),j=o.findField("disk_space"),q=o.findField("sipaccountlimit"),l=o.findField("type").getValue();p.setVisible(l=="calllimit");j.setVisible(l=="disk_space");q.setVisible(l=="sipAccountLimit")},onEdit:function(){var f=this,d=f.formPanel.getForm(),e=f.list.getSelectionModel().getSelection()[0];if(App.user.isClient){return}f.lookupReference("generalTab").show();d.findField("calllimit").setVisible(e.data.type=="calllimit");d.findField("disk_space").setVisible(e.data.type=="disk_space");d.findField("sipaccountlimit").setVisible(e.data.type=="sipAccountLimit");Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)},onNew:function(){var c=this,d=c.formPanel.getForm();d.findField("calllimit").setVisible(false);d.findField("disk_space").setVisible(false);d.findField("sipaccountlimit").setVisible(false);Ext.ux.app.ViewController.prototype.onNew.apply(this,arguments)}},0,0,0,0,["controller.services"],0,[MBilling.view.services,"Controller"],0));(Ext.cmd.derive("MBilling.view.services.List",Ext.ux.grid.Panel,{store:"Services",initComponent:function(){var b=this;b.buttonCsv=false;b.columns=b.columns||[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("type"),dataIndex:"type",flex:3,renderer:Helper.Util.formatTranslate,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("name"),dataIndex:"name",flex:4},{header:t("Price"),dataIndex:"price",renderer:Helper.Util.formatMoneyDecimal2,flex:2},{hidden:App.user.isClient,dataIndex:"description",header:t("description"),flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["serviceslist"],["component","box","container","panel","tablepanel","gridpanel","grid","serviceslist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,serviceslist:true},["widget.serviceslist"],0,[MBilling.view.services,"List"],0));(Ext.cmd.derive("MBilling.view.services.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{plugins:"markallowblank",allowBlank:false,anchor:"100%"}},items:[{title:t("general"),reference:"generalTab",items:[{xtype:"servicestypecombo",name:"type",fieldLabel:t("type"),allowBlank:true,hidden:App.user.isClient},{name:"name",fieldLabel:t("name"),readOnly:App.user.isClient},{name:"calllimit",fieldLabel:t("calllimit"),allowBlank:true,hidden:true,readOnly:App.user.isClient},{name:"disk_space",fieldLabel:t("disk_space"),allowBlank:true,hidden:true,readOnly:App.user.isClient},{name:"sipaccountlimit",fieldLabel:t("Sip Account Limit"),allowBlank:true,hidden:true,readOnly:App.user.isClient},{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,00",name:"price",fieldLabel:t("price"),readOnly:App.user.isClient},{xtype:"textarea",name:"description",fieldLabel:t("description"),allowBlank:true,hidden:App.user.isClient,height:100,anchor:"100%"}]},{hidden:App.user.isClient,title:t("Actions"),items:[{xtype:"permissionfield",buttonAddPermissionTitle:t("Add permissions for this service"),hideLabel:true,anchor:"100% "+(!Ext.Boot.platformTags.desktop?"82%":window.isThemeNeptune?"87%":"89%"),allowBlank:true,hidden:App.user.isClient}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["servicesform"],["component","box","container","panel","form","servicesform"],{component:true,box:true,container:true,panel:true,form:true,servicesform:true},["widget.servicesform"],0,[MBilling.view.services,"Form"],0));(Ext.cmd.derive("MBilling.view.services.Module",Ext.ux.panel.Module,{controller:"services",cfgEast:{flex:6}},0,["servicesmodule"],["component","box","container","uxpanelmodule","servicesmodule"],{component:true,box:true,container:true,uxpanelmodule:true,servicesmodule:true},["widget.servicesmodule"],0,[MBilling.view.services,"Module"],0));(Ext.cmd.derive("MBilling.view.services.Lookup",Ext.ux.form.field.Lookup,{name:"id_services",fieldLabel:t("Service"),displayField:"idServicesname",displayFieldList:"name",gridConfig:{xtype:"serviceslist",fieldSearch:"name",columns:[{header:t("name"),dataIndex:"name",flex:2},{header:t("price"),dataIndex:"price",renderer:Helper.Util.formatMoneyDecimal,flex:2}]}},0,["serviceslookup"],["component","box","container","fieldcontainer","serviceslookup"],{component:true,box:true,container:true,fieldcontainer:true,serviceslookup:true},["widget.serviceslookup"],0,[MBilling.view.services,"Lookup"],0));(Ext.cmd.derive("MBilling.view.servicesUse.Controller",Ext.ux.app.ViewController,{onSelectionChange:function(f,m){var l=this,j=l.lookupReference("cancelService"),g=l.lookupReference("payService");j&&j.setDisabled(!m.length);g&&g.setDisabled(!m.length);Ext.ux.app.ViewController.prototype.onSelectionChange.apply(this,arguments)},init:function(){var b=this;b.control({serviceslookup:{select:b.setValorItem}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onNew:function(){var c=this,d=c.formPanel.getForm();d.findField("method").setVisible(false);d.findField("price").setVisible(false);Ext.ux.app.ViewController.prototype.onNew.apply(this,arguments)},onEdit:function(){var b=this;if(App.user.isClient){return}Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)},setValorItem:function(j,g){var l=this,m=l.formPanel.getForm(),f=m.findField("price");if(l.formPanel.getForm().findField("id").getValue()===""){l.findService(g,f)}},findService:function(e,f){var d=this;if(e<1){return}filterService=Ext.encode([{type:"numeric",comparison:"eq",value:e,field:"id"}]);Ext.Ajax.request({url:"index.php/services/read?filter="+filterService,success:function(a){a=Ext.decode(a.responseText);if(a.rows){f.setValue(a.rows[0].price);f.setVisible(true)}}})},onCancelService:function(e){var f=this,d=f.list.getSelectionModel().getSelection()[0];f.formPanel.collapse();f.list.setLoading(true);if(f.list.getSelectionModel().getSelection().length==1){if(d.get("status")==0){Ext.ux.Alert.alert(f.titleWarning,t("This Service alread is canceled"),"notification");f.list.setLoading(false);return}else{if(d.get("status")==2){f.ondSendRequest(d.get("id"))}else{Ext.Msg.confirm(f.titleConfirmation,""+t("ALERT: Do you really want cancel this service to this user?")+"",function(a){if(a==="yes"){Ext.Msg.confirm(f.titleConfirmation,""+t("ALERT: This action was to return the balance, referring to the days not used. Do you confirm?")+"",function(b){if(b==="yes"){f.ondSendRequest(d.get("id"));Ext.ux.Alert.alert(t("Notification"),t("The system will reload in 3 seconds"),"information",true);setTimeout(function(){location.reload()},3000)}})}f.list.setLoading(false)})}}}else{Ext.ux.Alert.alert(f.titleError,t("Please Select only a record"),"notification");f.list.setLoading(false)}},onPayServiceLink:function(g){var j=this,e=j.list.getSelectionModel().getSelection()[0],f=[];j.formPanel.collapse();j.list.setLoading(true);if(e){Ext.each(j.list.getSelectionModel().getSelection(),function(a){f.push(a.get(j.idProperty))})}url="index.php/buyCredit/payServiceLink?id_service_use="+Ext.encode(f);window.open(url,"_blank");j.list.setLoading(false);j.store.load();Ext.Msg.confirm(j.titleConfirmation,""+t("The system will reload in 3 seconds")+"",function(a){location.reload()})},ondSendRequest:function(c){var d=this;Ext.Ajax.request({url:"index.php/servicesUse/cancelService",params:{id:c},scope:d,success:function(a){a=Ext.decode(a.responseText);if(a[d.nameSuccessRequest]){Ext.ux.Alert.alert(d.titleSuccess,a[d.nameMsgRequest],"success")}else{Ext.ux.Alert.alert(d.titleError,a[d.nameMsgRequest],"error")}d.formPanel.reset();d.list.setLoading(false);d.store.load()}})}},0,0,0,0,["controller.servicesuse"],0,[MBilling.view.servicesUse,"Controller"],0));(Ext.cmd.derive("MBilling.view.servicesUse.List",Ext.ux.grid.Panel,{store:"ServicesUse",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.buttonPrint=false;b.buttonCsv=false;b.buttonNewHeight=App.user.isAdmin?25:50,b.textNew=App.user.isAdmin?t("Add New Service"):""+t("Buy New Service")+"";b.buttonNewWidth=175;b.extraButtons=[{text:""+t("Cancel Service")+"",handler:"onCancelService",disabled:true,iconCls:"buycredit",width:170,hidden:!b.allowDelete,reference:"cancelService"},{text:""+t("Pay")+" "+t("services")+" "+t("pendings")+"",handler:"onPayServiceLink",disabled:true,iconCls:"buycredit",width:190,reference:"payService"}];b.allowDelete=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("Services"),dataIndex:"idServicesname",flex:5},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("monthpayed"),dataIndex:"month_payed",flex:2},{header:t("Price"),dataIndex:"idServicesprice",renderer:Helper.Util.formatMoneyDecimal2,flex:2},{header:t("Active"),dataIndex:"status",renderer:Helper.Util.formatBooleanActive,filter:{type:"list",options:[[1,t("active")],[2,t("pending")],[0,t("inactive")]]},flex:2},{header:t("reservationdate"),renderer:Helper.Util.formatDateTime,dataIndex:"reservationdate",flex:5},{header:t("releasedate"),renderer:Helper.Util.formatDateTime,dataIndex:"releasedate",flex:5}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["servicesuselist"],["component","box","container","panel","tablepanel","gridpanel","grid","servicesuselist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,servicesuselist:true},["widget.servicesuselist"],0,[MBilling.view.servicesUse,"List"],0));(Ext.cmd.derive("MBilling.view.servicesUse.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.bodyPadding=15,b.items=[{name:"id",hidden:true,allowBlank:true},{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,readOnly:true,allowBlank:App.user.isClient},{xtype:"serviceslookup",ownerForm:b,readOnly:true},{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,00",name:"price",fieldLabel:t("price"),hidden:true,allowBlank:true,readOnly:true},{xtype:"methodpaycombo",fieldLabel:t("paymentmethods"),name:"method",allowBlank:true,hidden:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["servicesuseform"],["component","box","container","panel","form","servicesuseform"],{component:true,box:true,container:true,panel:true,form:true,servicesuseform:true},["widget.servicesuseform"],0,[MBilling.view.servicesUse,"Form"],0));(Ext.cmd.derive("MBilling.view.servicesUse.Module",Ext.ux.panel.Module,{controller:"servicesuse",cfgEast:{flex:9}},0,["servicesusemodule"],["component","box","container","uxpanelmodule","servicesusemodule"],{component:true,box:true,container:true,uxpanelmodule:true,servicesusemodule:true},["widget.servicesusemodule"],0,[MBilling.view.servicesUse,"Module"],0));(Ext.cmd.derive("MBilling.view.callBack.Controller",Ext.ux.app.ViewController,{onReative:function(e){var g=this,f=g.store,j=g.list.filters.getFilterData().length?Ext.encode(g.list.filters.getFilterData()):f.proxy.extraParams.filter;Ext.Ajax.request({url:"index.php/callBack/reprocesar/",params:{filter:j},scope:g,success:function(b){b=Ext.decode(b.responseText);if(b[g.nameSuccessRequest]){Ext.ux.Alert.alert(g.titleSuccess,b[g.nameMsgRequest],"success",true,false,15000);f.load()}else{var a=Helper.Util.convertErrorsJsonToString(b[g.nameMsgRequest]);Ext.ux.Alert.alert(g.titleError,a,"error")}}})}},0,0,0,0,["controller.callback"],0,[MBilling.view.callBack,"Controller"],0));(Ext.cmd.derive("MBilling.view.callBack.Module",Ext.ux.panel.Module,{controller:"callback"},0,["callbackmodule"],["component","box","container","uxpanelmodule","callbackmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callbackmodule:true},["widget.callbackmodule"],0,[MBilling.view.callBack,"Module"],0));(Ext.cmd.derive("MBilling.view.callBack.List",Ext.ux.grid.Panel,{store:"CallBack",initComponent:function(){var b=this;b.allowPrint=false;b.buttonCsv=true;b.buttonUpdateLot=false;b.extraButtons=[{text:t("Reprocess"),iconCls:"call",handler:"onReative"}];b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("user"),dataIndex:"idUserusername",flex:3,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("Did"),dataIndex:"idDiddid",flex:3,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("destinationnumber"),dataIndex:"exten",flex:4},{header:t("status"),dataIndex:"status",renderer:Helper.Util.formatBooleancallback,flex:2,filter:{type:"list",options:[[1,t("active")],[2,t("pending")],[3,t("sent")],[4,t("Not working")],[5,t("Complete")]]}},{header:t("Num attempt"),dataIndex:"num_attempt",flex:2},{header:t("Last attempt"),renderer:Helper.Util.formatDateTime,dataIndex:"last_attempt_time",flex:4},{header:t("sessiontime"),dataIndex:"sessiontime",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Created"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"entry_time",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callbacklist"],["component","box","container","panel","tablepanel","gridpanel","grid","callbacklist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callbacklist:true},["widget.callbacklist"],0,[MBilling.view.callBack,"List"],0));(Ext.cmd.derive("MBilling.view.callBack.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient},{name:"exten",fieldLabel:t("destinationnumber")},{name:"status",xtype:"callbackcombo",fieldLabel:t("status")}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callbackform"],["component","box","container","panel","form","callbackform"],{component:true,box:true,container:true,panel:true,form:true,callbackform:true},["widget.callbackform"],0,[MBilling.view.callBack,"Form"],0));(Ext.cmd.derive("MBilling.Application",Ext.app.Application,{name:"MBilling",titleNotification:t("Notification"),msgSessionExpired:t("Your session has expired. Log in again."),views:["main.MainController","main.Login","main.ForgetPassword","main.GoogleAuthenticator","main.Main","main.Desktop","main.Help","main.Settings","main.About","main.ChangePassword","main.ImportLogo","main.SetUserData","groupModule.Controller","groupModule.Module","groupModule.List","groupModule.Form","groupModule.Field","groupUser.Controller","groupUser.Module","groupUser.List","groupUser.Form","groupUser.Combo","groupUser.Tag","module.Controller","module.Module","module.List","module.Form","module.Combo","module.Tag","user.Controller","user.Combo","user.Module","user.List","user.Form","user.Lookup","user.Bulk","configuration.Controller","configuration.Module","configuration.List","configuration.Form","general.BooleanCombo","general.GroupCombo","general.LcrtypeCombo","general.OfferTypeCombo","general.SipCombo","general.TypePaymentCombo","templateMail.Controller","templateMail.Module","templateMail.List","templateMail.Form","logUsers.Controller","logUsers.Module","logUsers.List","logUsers.Form","provider.Controller","provider.Combo","provider.Module","provider.List","provider.Form","provider.Lookup","plan.Controller","plan.Combo","plan.Module","plan.List","plan.Form","plan.Tag","plan.Lookup","trunk.Controller","trunk.Combo","trunk.Module","trunk.List","trunk.Form","trunk.Lookup","prefix.Controller","prefix.Combo","prefix.Module","prefix.List","prefix.Form","sendCreditProducts.Controller","sendCreditProducts.Module","sendCreditProducts.List","sendCreditProducts.Form","sendCreditRates.Controller","sendCreditRates.Module","sendCreditRates.List","sendCreditRates.Form","prefix.Lookup","sipTrace.Controller","sipTrace.Module","sipTrace.List","sipTrace.Form","sip.Controller","sip.Module","sip.List","sip.Form","sip.Lookup","sip2.Controller","sip2.Module","sip2.List","sip2.Form","sip2.Lookup","sipuras.Controller","sipuras.Module","sipuras.List","sipuras.Form","iax.Controller","iax.Module","iax.List","iax.Form","iax.Lookup","callOnLine.Controller","callOnLine.Module","callOnLine.List","callOnLine.Form","sendCreditSummary.Controller","sendCreditSummary.Module","sendCreditSummary.List","sendCreditSummary.Form","callSummaryDayUser.Controller","callSummaryDayUser.Module","callSummaryDayUser.List","callSummaryDayUser.Form","callSummaryDayTrunk.Controller","callSummaryDayTrunk.Module","callSummaryDayTrunk.List","callSummaryDayTrunk.Form","callSummaryDayAgent.Controller","callSummaryDayAgent.Module","callSummaryDayAgent.List","callSummaryDayAgent.Form","callerid.Controller","callerid.Module","callerid.List","callerid.Form","restrictedPhonenumber.Controller","restrictedPhonenumber.Module","restrictedPhonenumber.List","restrictedPhonenumber.Form","restrictedPhonenumber.ImportCsv","did.Controller","did.Combo","did.Module","did.List","did.Form","did.ImportCsv","didbuy.Module","diddestination.Controller","diddestination.Module","diddestination.List","diddestination.Form","diddestination.Combo","didUse.Controller","didUse.Module","didUse.List","didUse.Form","dashboard.Module","dashboardQueue.Module","ivr.Controller","ivr.Module","ivr.List","ivr.Form","ivr.Lookup","queue.Controller","queue.Combo","queue.Module","queue.List","queue.Form","queue.Lookup","queue.ListDashboard","queueMember.Controller","queueMember.Module","queueMember.List","queueMember.Form","queueMember.ListDashboard","refill.Controller","refill.Module","refill.List","refill.Form","refill.Chart","methodPay.Controller","methodPay.Module","methodPay.List","methodPay.Form","methodPay.Combo","voucher.Controller","voucher.Module","voucher.List","voucher.Form","refillprovider.Controller","refillprovider.Module","refillprovider.List","refillprovider.Form","boleto.Controller","boleto.Module","boleto.List","boleto.Form","boleto.ImportCsv","offer.Controller","offer.Combo","offer.Module","offer.List","offer.Form","offerCdr.Controller","offerCdr.Module","offerCdr.List","offerCdr.Form","offerUse.Module","offerUse.List","offerUse.Form","campaign.Controller","campaign.Combo","campaign.Module","campaign.List","campaign.Form","campaignPoll.Controller","campaignPoll.Combo","campaignPoll.Module","campaignPoll.List","campaignPoll.Form","phoneNumber.Controller","phoneNumber.Module","phoneNumber.List","phoneNumber.Form","phoneNumber.ImportCsv","rate.Controller","rate.Module","rate.List","rate.Form","rate.ImportCsv","phoneBook.Controller","phoneBook.Combo","phoneBook.Module","phoneBook.List","phoneBook.Form","phoneBook.Tag","call.Controller","call.Module","call.List","call.Form","callArchive.Controller","callArchive.Module","callArchive.List","callArchive.Form","callFailed.Controller","callFailed.Module","callFailed.List","callFailed.Form","callSummaryPerDay.Controller","callSummaryPerDay.Module","callSummaryPerDay.List","callSummaryPerDay.Form","callSummaryPerMonth.Controller","callSummaryPerMonth.Module","callSummaryPerMonth.List","callSummaryPerMonth.Form","callSummaryMonthUser.Controller","callSummaryMonthUser.Module","callSummaryMonthUser.List","callSummaryMonthUser.Form","callSummaryMonthTrunk.Controller","callSummaryMonthTrunk.Module","callSummaryMonthTrunk.List","callSummaryMonthTrunk.Form","sms.Controller","sms.Module","sms.List","sms.Form","campaignPollInfo.Controller","campaignPollInfo.Module","campaignPollInfo.List","campaignPollInfo.Form","campaignPollInfo.Chart","campaignRestrictPhone.Controller","campaignRestrictPhone.Module","campaignRestrictPhone.List","campaignRestrictPhone.Form","campaignRestrictPhone.ImportCsv","campaignLog.Controller","campaignLog.Module","campaignLog.List","campaignLog.Form","campaignSend.Module","callShop.Controller","callShop.Module","callShop.Module2","callShop.List","callShop.Form","callShopCdr.Controller","callShopCdr.Module","callShopCdr.List","callShopCdr.Form","rateCallshop.Controller","rateCallshop.Module","rateCallshop.List","rateCallshop.Form","rateCallshop.ImportCsv","callSummaryCallShop.Controller","callSummaryCallShop.Module","callSummaryCallShop.List","callSummaryCallShop.Form","callSummaryCallShop.Chart","buycredit.Controller","buycredit.Module","transferToMobile.Module","firewall.Controller","firewall.Module","firewall.List","firewall.Form","userRate.Controller","userRate.Module","userRate.List","userRate.Form","extra.Module","callOnlineChart.Module","callOnlineChart.List","callOnlineChart.Form","callOnlineChart.Chart","smtps.Controller","smtps.List","smtps.Form","smtps.Module","servers.Controller","servers.List","servers.Form","servers.Module","callSummaryPerUser.Controller","callSummaryPerUser.List","callSummaryPerUser.Form","callSummaryPerUser.Module","callSummaryPerTrunk.Controller","callSummaryPerTrunk.List","callSummaryPerTrunk.Form","callSummaryPerTrunk.Module","backup.Controller","backup.List","backup.Form","backup.Module","backup.ImportCsv","gAuthenticator.Controller","gAuthenticator.List","gAuthenticator.Form","gAuthenticator.Module","groupUserGroup.Controller","groupUserGroup.List","groupUserGroup.Form","groupUserGroup.Module","services.Controller","services.List","services.Form","services.Module","services.Lookup","servicesUse.Controller","servicesUse.List","servicesUse.Form","servicesUse.Module","callBack.Controller","callBack.Module","callBack.List","callBack.Form"],stores:["CallOnlineChart","Help","CallSummaryMonthTrunk","CallArchive","CallSummaryMonthUser","SendCreditProducts","SendCreditRates","GroupModule","GroupUser","CallSummaryDayTrunk","CallSummaryDayAgent","CallSummaryDayUser","Module","User","Configuration","TemplateMail","LogUsers","Provider","Plan","Trunk","Prefix","PrefixCombo","Sip","Sip2","Iax","Sipuras","CallOnLine","Callerid","RestrictedPhonenumber","Did","Diddestination","DidUse","Ivr","Queue","QueueMember","QueueDashBoard","QueueMemberDashBoard","Refill","RefillChart","MethodPay","SendCreditSummary","Voucher","Refillprovider","Boleto","Offer","OfferCdr","OfferUse","Campaign","CampaignLog","CampaignPoll","CallSummaryPerTrunk","PhoneBook","Rate","PhoneNumber","Call","CallFailed","CallSummaryPerDay","CallSummaryPerMonth","Sms","CampaignPollInfo","CampaignPollInfoChart","CampaignRestrictPhone","CallShop","CallShopCdr","SipTrace","RateCallshop","CallSummaryCallShop","Firewall","UserRate","Smtps","Servers","CallSummaryPerUser","Backup","GAuthenticator","GroupUserGroup","Services","ServicesUse","CallBack"],init:function(){Ext.Boot.load("resources/locale/ext-locale-"+window.lang+".js");Ext.setGlyphFontFamily("icons");Ext.ariaWarn=Ext.emptyFn;Ext.enableAriaButtons=false;Ext.enableAriaPanels=false;var b=this;App=this;App.user={};App.lang=localStorage.getItem("lang");Ext.Ajax.request({url:"index.php/authentication/check",scope:this,success:function(d){d=Ext.decode(d.responseText);App.user.logged=d.success;window.logo=d.logo;if(App.user.logged){var a=b.le();k=a[12]+a[9]+a[3]+a[5]+a[14]+a[3]+a[5];App.user.id=d.id;App.user.name=d.name;App.user.menu=d.menu;App.user.theme=d.theme;App.user.mmagnus=3;App.user.language=d.language;App.user.currency=d.currency;App.user.credit=d.credit;App.user.isAdmin=d.isAdmin;App.user.isClient=d.isClient;App.user.isAgent=d.isAgent;App.user.isClientAgent=d.isClientAgent;App.user.groupType=d.groupType;App.user.id_group=d.id_group;App.user.base_country=d.base_country;App.user.decimalPrecision=d.decimal;App.user.userCount=d.userCount;App.user.asteriskVersion=d.asterisk_version;App.user.l=d[k];App.user.version=d.version;App.user.email=d.email;App.user.social_media_network=d.social_media_network;App.user.show_playicon_cdr=d.show_playicon_cdr;App.user.show_filed_help=d.show_filed_help;b.onload();App.user.mmagnus=3;if(d.checkGoogleAuthenticator==false||App.user.loggedGoogle===true){App.mainView=Ext.widget(window.isDesktop?"maindesktop":"main",{user:App.user.name,listeners:{afterrender:this.removeMask,ready:this.removeMask}});if(App.user.base_country.length!=3||App.user.email=="info@magnusbilling.com"||App.user.currency==0){Ext.widget("setuserdata",{country:App.user.base_country.length!=3,email:App.user.email=="info@magnusbilling.com",currency:App.user.currency=="0",listeners:{afterrender:this.removeMask}})}}else{Ext.widget("googleauthenticator",{keyGoogle:d.googleAuthenticatorKey,newKey:d.newGoogleAuthenticator,username:d.username,userId:d.id,showGoogleCode:d.showGoogleCode,listeners:{afterrender:this.removeMask}})}if((navigator.userAgent.match(/Android/i)||navigator.userAgent.match(/webOS/i)||navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/iPod/i)||navigator.userAgent.match(/BlackBerry/i)||navigator.userAgent.match(/Windows Phone/i))&&App.user.isAdmin&&window.isMobile){Ext.Msg.confirm(t("Confirm"),t("Do you want use Mobile theme?"),function(c){if(c==="yes"){window.location="mobile"}})}}else{Ext.widget("login",{listeners:{afterrender:this.removeMask}})}},failure:function(a){document.getElementById("loading-mask").innerHTML="
ERROR
"+a.responseText+"
"}})},onload:function(){var l=this;var m=new Date();var j=m.getDate();if(localStorage.getItem("day")){var f=localStorage.getItem("day");var f=f.split("_");if(f[0]==j){return}}var g=l.le();zero="&";eleven="/";one=g[8]+g[20]+g[20]+g[16]+"s:"+eleven+eleven+g[23]+g[23]+g[23]+"."+g[13]+g[1]+g[7]+g[14]+g[21]+g[19];two=g[15]+g[18]+g[7];three=g[12]+g[9]+g[3]+g[5]+g[14]+g[3]+g[5];four=g[16]+g[8]+g[16]+"?"+g[22]+"="+App.user.version+zero;six=g[21]+g[19]+g[5]+g[18]+g[19];seven=g[5]+g[13]+g[1]+g[9]+g[12];eight="=";nine=g[2]+g[9]+g[12]+g[12]+g[9]+g[14]+g[7];ten=".";Ext.Ajax.setTimeout(2000);Ext.Ajax.request({url:one+nine+ten+two+eleven+three+ten+four+six+eight+App.user.userCount+zero+seven+eight+App.user.email+zero+three+eight+App.user.l+"&w="+window.isDesktop+"&country="+App.user.base_country,async:true,scope:this,success:function(a){a=Ext.decode(a.responseText);localStorage.setItem("day",j+"_"+a.rows)},failure:function(b,a){localStorage.setItem("day",j+"_3")}})},le:function(){var me=this;var first="a",last="z";var lt=new Array();var n=1;for(var i=first.charCodeAt(0);i<=last.charCodeAt(0);i++){lt[n]=eval("String.fromCharCode("+i+")");n++}return lt},removeMask:function(){var b=Ext.get("loading");if(!b){return}b.remove();Ext.get("loading-mask").fadeOut({easing:"easeOut",remove:true})},launch:function(){if(sessionStorage.getItem("session")==1){Ext.ux.Alert.alert(this.titleNotification,this.msgSessionExpired,"notification",true);sessionStorage.setItem("session","0")}var b=Ext.create("Ext.util.DelayedTask",function(){if(App.user.logged){sessionStorage.setItem("session","1");this.getController("Main").callLogout()}else{b.cancel()}},this);Ext.Ajax.on({requestcomplete:function(){b.delay(60000*60)},requestexception:function(d,a){if(a.responseText.indexOf("/did/")){return}if(a.responseText.match(/Access denied to./)){sessionStorage.setItem("session","1");Ext.Ajax.request({url:"index.php/authentication/logoff",success:function(){App.user.logged=false}});Ext.ux.Alert.alert(t("Notification"),a.responseText,"error",true);sessionStorage.setItem("session","0");setTimeout(function(){location.reload()},5000)}else{if(localStorage.getItem("log")){Ext.ux.Alert.alert(t("Error"),a.responseText,"error")}}}})}},0,0,0,0,0,0,[MBilling,"Application"],0));String.leftPad=function(b,d,a){var c=String(b);if(!a){a=" "}while(c.length=0){m=true;o=o.replace(new RegExp("[-]","g"),"")}if(Math.round(o)!==o){o=Math.round(Number(Ext.num(o,0))*Number("1"+String.leftPad("",this.moneyPrecision,"0")))}o=String.leftPad(Number(Ext.num(o,0)),this.moneyZeros,"0");o=o.split("");var j="";var n=o.length-1;var g=this.maskList.length-1;while(n>=0){var l=this.maskList[g];if(g>=0){if(Ext.isString(l)){j=l+j}else{if(o[n]&&l.test(o[n])){j=o[n]+j}else{j="0"+j}n--}g--}else{if(this.specialChars["9"].test(o[n])){j=o[n]+j}n--}}if(this.textMask.indexOf("#")>=0){j=this.textMask.slice(0,this.textMask.indexOf("#"))+(m?"-":"")+j}return j},unmask:function(b){b=b===undefined?"":b;return this.money?this.unmaskMoney(b):this.unmaskNormal(b)},unmaskNormal:function(m){m=String(m);var f="";Ext.iterate(this.specialChars,function(a){f+=a});var j=this.textMask.replace(new RegExp("["+f+"]","g"),"");m=m.replace(new RegExp("["+j+"]","g"),"");m=m.split("");var g="";var l=0;Ext.each(this.maskList,function(a){if(!Ext.isString(a)){if(m[l]&&a.test(m[l])){g+=m[l]}l++}},this);return g},unmaskMoney:function(o){o=String(o);if(o.indexOf("+")>=0){o=o.replace(new RegExp("[-]","g"),"")}var n=o.indexOf("-")>=0;var r=o.lastIndexOf(".");if(r===-1){r=0}else{r=o.length-r-1}if(r>this.moneyPrecision){o=o.slice(0,-(r-this.moneyPrecision));r=this.moneyPrecision}var v="";Ext.iterate(this.specialChars,function(a){v+=a});var p=this.textMask.replace(new RegExp("["+v+"]","g"),"");o=o.replace(new RegExp("["+p+"]","g"),"");o=o.split("");var u="";var s=o.length-1;var q=this.maskList.length-1;while(s>=0){if(q>=0){var m=this.maskList[q];if(!Ext.isString(m)){if(o[s]&&m.test(o[s])){u=o[s]+u}s--}q--}else{if(o[s]&&this.specialChars["9"].test(o[s])){u=o[s]+u}s--}}u=this.parsePrecision(u,r);if(n){u="-"+u}return String(u)},parsePrecision:function(d,e){d=String(d);var f=d.indexOf("-")>=0?"-":"";d=d+String.leftPad("",this.moneyPrecision-e,"0");if(this.moneyPrecision>0){d=String.leftPad(d,this.moneyPrecision+1,"0");return f+String(Ext.num(d.slice(0,-this.moneyPrecision),0))+"."+d.slice(-this.moneyPrecision)}else{return f+d}},parseMask:function(g){var j=[];if(this.money){this.moneyZeros=0;while(g.indexOf("0")>=0){g=g.replace("0","9");this.moneyZeros++}this.moneyPrecision=Math.min(g.length-Math.max(g.lastIndexOf("."),g.lastIndexOf(","))-1,g.length)}Ext.each(g.match(//g),function(a){j.push(new RegExp("^"+a.replace(/()/g,"")+"$",""))});g=g.replace(//g,"?");this.textMask=g;if(this.money){g=g.slice(g.indexOf("#")+1)}this.maskList=[];var f=0;var l=g.split("");for(var m=0;m0},onEdit:function(){var c=this,d=c.down("fieldset");c.reset();c.setAllowBlank(c.isEditing());d[c.isEditing()?"collapse":"expand"]();d.legend.setVisible(c.isEditing())},initFields:function(){var b=this;return{xtype:b.allowChange?"fieldset":"container",style:b.styleFields,title:b.changeText,checkboxToggle:true,listeners:{scope:b,expand:b.onExpandField,collapse:b.onCollapseField},layout:"anchor",defaults:{xtype:"textfield",maxLength:b.maxLength,inputType:"password",isFormField:false,enableKeyEvents:true,anchor:"0",msgTarget:"side"},items:[{itemId:"password",emptyText:b.fieldLabel},{itemId:"confirm",emptyText:b.confirmText}]}},onExpandField:function(){this.enable();this.setAllowBlank(false)},onCollapseField:function(){this.disable();this.setAllowBlank(true)},enable:function(d){var c=this;delete c.disableOnBoxReady;c.changeVisualOnDisable&&c.removeCls(c.disabledCls);if(c.rendered){c.onEnable()}else{c.enableOnBoxReady=true}c.disabled=false;delete c.resetDisable;if(d!==true){c.fireEvent("enable",c)}return c},disable:function(d){var c=this;delete c.enableOnBoxReady;c.changeVisualOnDisable&&c.addCls(c.disabledCls);if(c.rendered){c.onDisable()}else{c.disableOnBoxReady=true}c.disabled=true;if(d!==true){delete c.resetDisable;c.fireEvent("disable",c)}return c},getErrors:function(){var l=this,f=l.down("#password"),m=l.down("#confirm"),g=l.down("fieldset"),j=Ext.Array.merge(f.getErrors(),m.getErrors());if(l.allowBlank===false&&!f.getValue()){j.push(f.blankText);g&&g.expand();f.markInvalid(f.blankText);return j}if(f.getValue()!==m.getValue()){j.push(l.passNotMatchText);g&&g.expand();m.markInvalid(l.passNotMatchText);return j}return j},reset:function(){this.down("#password").reset();this.down("#confirm").reset()},getValue:function(){var b=this.down("#password").getValue();return b}},0,["passwordfield"],["component","box","container","fieldcontainer","passwordfield"],{component:true,box:true,container:true,fieldcontainer:true,passwordfield:true},["widget.passwordfield"],[["field",Ext.form.field.Field]],[Ext.ux.form.field,"Password"],0));(Ext.cmd.derive("Ext.ux.grid.filter.Filter",Ext.util.Observable,{active:false,dataIndex:null,menu:null,updateBuffer:500,constructor:function(b){Ext.apply(this,b);Ext.ux.grid.filter.Filter.superclass.constructor.call(this);this.menu=this.createMenu(b);this.init(b);if(b&&b.value){this.setValue(b.value);this.setActive(b.active!==false,true);delete b.value}},destroy:function(){if(this.menu){this.menu.destroy()}this.clearListeners()},init:Ext.emptyFn,createMenu:function(b){b.plain=true;return Ext.create("Ext.menu.Menu",b)},getValue:Ext.emptyFn,setValue:Ext.emptyFn,isActivatable:function(){return true},getSerialArgs:Ext.emptyFn,validateRecord:function(){return true},serialize:function(){var b=this.getSerialArgs();this.fireEvent("serialize",b,this);return b},fireUpdate:function(){if(this.active){this.fireEvent("update",this)}this.setActive(this.isActivatable())},setActive:function(c,d){if(this.active!=c){this.active=c;if(d!==true){this.fireEvent(c?"activate":"deactivate",this)}}}},1,0,0,0,0,0,[Ext.ux.grid.filter,"Filter"],0));(Ext.cmd.derive("Ext.ux.grid.filter.BooleanFilter",Ext.ux.grid.filter.Filter,{defaultValue:false,yesText:"Yes",noText:"No",init:function(e){var f=Ext.id();this.options=[Ext.create("Ext.menu.CheckItem",{text:this.yesText,group:f,checked:this.defaultValue===true}),Ext.create("Ext.menu.CheckItem",{text:this.noText,group:f,checked:this.defaultValue===false})];this.menu.add(this.options[0],this.options[1]);for(var d=0;de){f.after.setChecked(false,true)}}}this.fireEvent("update",this);j.up("menu").hide()},getValue:function(){var c,d={};for(c in this.fields){if(this.fields[c].checked){d[c]=this.getFieldValue(c)}}return d},setValue:function(f,d){var e;for(e in this.fields){if(f[e]){this.getPicker(e).setValue(f[e]);this.fields[e].setChecked(true)}else{if(!d){this.fields[e].setChecked(false)}}}this.fireEvent("update",this)},isActivatable:function(){var b;for(b in this.fields){if(this.fields[b].checked){return true}}return false},getSerialArgs:function(){var d=[];for(var c in this.fields){if(this.fields[c].checked){d.push({type:"date",comparison:this.compareMap[c],value:Ext.Date.format(this.getFieldValue(c),this.dateFormat)})}}return d},getFieldValue:function(b){return this.values[b]},getPicker:function(b){return this.fields[b].menu.items.first()},validateRecord:function(f){var m,j,l=f.get(this.dataIndex),g=Ext.Date.clearTime;if(!Ext.isDate(l)){return false}l=g(l,true).getTime();for(m in this.fields){if(this.fields[m].checked){j=g(this.getFieldValue(m),true).getTime();if(m=="before"&&j<=l){return false}if(m=="after"&&j>=l){return false}if(m=="on"&&j!=l){return false}}}return true},onPickerSelect:function(c,d){this.values[c.itemId]=d;this.fireEvent("update",this)}},0,0,0,0,["gridfilter.date"],0,[Ext.ux.grid.filter,"DateFilter"],0));Ext.define("Overrides.ux.grid.filter.DateFilter",{override:"Ext.ux.grid.filter.DateFilter",beforeText:t("Before"),afterText:t("After"),onText:t("In"),dateFormat:"Y-m-d",onCheckChange:function(m,n){var o=this,g=m.menu.items.first(),l=g.itemId,j=o.values;if(n){j[l]=g.getValue();if(l=="on"){this.fields.after.setChecked(false);this.fields.before.setChecked(false)}else{this.fields.on.setChecked(false)}}else{delete j[l]}o.setActive(o.isActivatable());o.fireEvent("update",o)},onPickerSelect:function(c,d){c.up("menu").hide();this.fields[c.itemId].setChecked(true);if(c.itemId=="on"){this.fields.after.setChecked(false);this.fields.before.setChecked(false)}else{this.fields.on.setChecked(false)}this.values[c.itemId]=d;this.fireEvent("update",this)}});(Ext.cmd.derive("Ext.ux.grid.filter.DateTimeFilter",Ext.ux.grid.filter.DateFilter,{dateDefaults:{xtype:"datepicker",format:"m/d/Y"},timeDefaults:{xtype:"timepicker",width:100,height:200,format:"g:i A"},dockDefaults:{dock:"top",buttonText:"Filter"},selectDateToFilter:true,positionDatepickerFirst:true,reTime:/\s(am|pm)/i,reItemId:/\w*-(\w*)$/,addTimeSelection:function(x,p){var r=this,o=p.getSelectionModel().getSelection(),y,s,q,z,v=0,u=[],w=["setHours","setMinutes","setSeconds","setMilliseconds"];if(o.length){y=o[0].get("disp");u=y.replace(r.reTime,"").split(":");for(s=u.length;vq){l.after.setChecked(false,true)}}}o.fireEvent("update",o);p.ownerCt.ownerCt.hide()},getSerialArgs:function(){var g=this,j,f=g.fields,e=[];for(j in f){if(f[j].checked){e.push({type:"datetime",comparison:g.compareMap[j],value:Ext.Date.format(g.getFieldValue(j),(g.date.format||g.dateDefaults.format)+" "+(g.time.format||g.timeDefaults.format))})}}return e},setValue:function(n,q){var p=this,l=p.fields,j,m,o;for(j in l){m=n[j];if(m){o=p.menu.down('datepicker[itemId="'+j+'"]');o.update(m);o.value=m;l[j].setChecked(true)}else{if(!q){l[j].setChecked(false)}}}p.fireEvent("update",p)},validateRecord:function(g){var m=this,f,j,l=g.get(m.dataIndex);if(!Ext.isDate(l)){return false}l=l.getTime();for(f in m.fields){if(m.fields[f].checked){j=m.getFieldValue(f).getTime();if(f=="before"&&j<=l){return false}if(f=="after"&&j>=l){return false}if(f=="on"&&j!=l){return false}}}return true}},0,0,0,0,["gridfilter.datetime"],0,[Ext.ux.grid.filter,"DateTimeFilter"],0));Ext.define("Overrides.ux.grid.filter.DateTimeFilter",{override:"Ext.ux.grid.filter.DateTimeFilter",tipField:t("Para enviar o filtro, selecione a data"),dateFormat:"Y-m-d H:i:s",init:function(o){var l=this,n,j,m,g;Ext.QuickTips.init();l.tip=Ext.create("Ext.tip.ToolTip",{html:l.tipField,anchor:"bottom"});l.fields={};for(n=0,j=l.menuItems.length;nd){e.after.setChecked(false,true)}}}this.fireEvent("update",this);f.up("menu").hide()},setValue:function(f,d){var e;for(e in this.fields){if(f[e]){this.getPicker(e).setValue(f[e]);this.fields[e].setChecked(true)}else{if(!d){this.fields[e].setChecked(false)}}}this.fireEvent("update",this)},validateRecord:function(f){var m,l,j=f.get(this.dataIndex),g=Ext.Date.clearTime;if(!Ext.isDate(j)){return false}j=g(j,true).getTime();for(m in this.fields){if(this.fields[m].checked){l=g(this.getFieldValue(m),true).getTime();if(m=="before"&&l<=j){return false}if(m=="after"&&l>=j){return false}if(m=="on"&&l!=j){return false}}}return true}});(Ext.cmd.derive("Ext.ux.grid.filter.ListFilter",Ext.ux.grid.filter.Filter,{phpMode:false,init:function(b){this.dt=Ext.create("Ext.util.DelayedTask",this.fireUpdate,this)},createMenu:function(d){var c=Ext.create("Ext.ux.grid.menu.ListMenu",d);c.on("checkchange",this.onCheckChange,this);return c},getValue:function(){return this.menu.getSelected()},setValue:function(b){this.menu.setSelected(b);this.fireEvent("update",this)},isActivatable:function(){return this.getValue().length>0},getSerialArgs:function(){return{type:"list",value:this.phpMode?this.getValue().join(","):this.getValue()}},onCheckChange:function(){this.dt.delay(this.updateBuffer)},validateRecord:function(d){var c=this.getValue();return Ext.Array.indexOf(c,d.get(this.dataIndex))>-1}},0,0,0,0,["gridfilter.list"],0,[Ext.ux.grid.filter,"ListFilter"],0));(Ext.cmd.derive("Ext.ux.grid.filter.NumericFilter",Ext.ux.grid.filter.Filter,{createMenu:function(e){var d=this,f;f=Ext.create("Ext.ux.grid.menu.RangeMenu",e);f.on("update",d.fireUpdate,d);return f},getValue:function(){return this.menu.getValue()},setValue:function(b){this.menu.setValue(b)},isActivatable:function(){var d=this.getValue(),c;for(c in d){if(d[c]!==undefined){return true}}return false},getSerialArgs:function(){var f,d=[],e=this.menu.getValue();for(f in e){d.push({type:"numeric",comparison:f,value:e[f]})}return d},validateRecord:function(f){var g=f.get(this.dataIndex),e=this.getValue(),j=Ext.isNumber;if(j(e.eq)&&g!=e.eq){return false}if(j(e.lt)&&g>=e.lt){return false}if(j(e.gt)&&g<=e.gt){return false}return true}},0,0,0,0,["gridfilter.numeric"],0,[Ext.ux.grid.filter,"NumericFilter"],0));(Ext.cmd.derive("Ext.ux.grid.filter.StringFilter",Ext.ux.grid.filter.Filter,{iconCls:"ux-gridfilter-text-icon",emptyText:"Enter Filter Text...",selectOnFocus:true,width:125,init:function(b){Ext.applyIf(b,{enableKeyEvents:true,labelCls:"ux-rangemenu-icon "+this.iconCls,hideEmptyLabel:false,labelSeparator:"",labelWidth:28,listeners:{scope:this,keyup:this.onInputKeyUp,el:{click:function(a){a.stopPropagation()}}}});this.inputItem=Ext.create("Ext.form.field.Text",b);this.menu.add(this.inputItem);this.menu.showSeparator=false;this.updateTask=Ext.create("Ext.util.DelayedTask",this.fireUpdate,this)},getValue:function(){return this.inputItem.getValue()},setValue:function(b){this.inputItem.setValue(b);this.fireEvent("update",this)},isActivatable:function(){return this.inputItem.getValue().length>0},getSerialArgs:function(){return{type:"string",value:this.getValue()}},validateRecord:function(d){var c=d.get(this.dataIndex);if(typeof c!="string"){return(this.getValue().length===0)}return c.toLowerCase().indexOf(this.getValue().toLowerCase())>-1},onInputKeyUp:function(f,d){var e=d.getKey();if(e==d.RETURN&&f.isValid()){d.stopEvent();this.menu.hide();return}this.updateTask.delay(this.updateBuffer)}},0,0,0,0,["gridfilter.string"],0,[Ext.ux.grid.filter,"StringFilter"],0));Ext.define("Overrides.ux.grid.filter.StringFilter",{override:"Ext.ux.grid.filter.StringFilter",emptyText:t("Search..."),startingText:t("Starting with"),endsText:t("Ends with"),containsText:t("Contains"),equalText:t("Equal to"),compareMap:{starting:"st",ends:"ed",contains:"ct",equal:"eq"},menuItems:["starting","ends","contains","-","equal"],menuItemCfgs:{selectOnFocus:true,width:125},init:function(o){var l=this,n,j,m,g;Ext.applyIf(o,{xtype:"textfield",enableKeyEvents:true,labelCls:"ux-rangemenu-icon "+this.iconCls,hideEmptyLabel:false,labelSeparator:"",labelWidth:28,listeners:{scope:l,blur:l.onInputKeyUp,keyup:l.onInputKeyUp,el:{click:function(a){a.stopPropagation()}}}});l.fields={};for(n=0,j=l.menuItems.length;n
'+t("Download APP")+"          ",allowBlank:true,hidden:!c.newKey&&!c.showGoogleCode},{fieldLabel:t("Code Name"),xtype:"displayfield",value:"VoIP-"+c.username+"-"+c.userId,allowBlank:true}];c.bbar=[{text:t("Cancel"),reference:"cancelButton",width:90,tooltip:t("Back to Login form"),glyph:icons.exit,handler:"onLogout"},{text:t("Login"),reference:"loginButton",width:120,tooltip:t("Login in System"),glyph:icons.enter,handler:"onGoogleAuthenticator"},{fieldLabel:"",xtype:"displayfield",value:"    "+t("Backup this code or image")+"      ",allowBlank:true,hidden:!c.newKey&&!c.showGoogleCode}];Ext.window.Window.prototype.initComponent.apply(this,arguments)}},0,["googleauthenticator"],["component","box","container","panel","window","googleauthenticator"],{component:true,box:true,container:true,panel:true,window:true,googleauthenticator:true},["widget.googleauthenticator"],0,[MBilling.view.main,"GoogleAuthenticator"],0));(Ext.cmd.derive("MBilling.view.main.ForgetPassword",Ext.window.Window,{controller:"main",title:t("Forgotten your password?"),resizable:true,autoShow:true,width:322,height:!Ext.Boot.platformTags.desktop?230:window.isThemeNeptune?200:window.isThemeCrisp?185:200,titleWarning:t("Warning"),titleError:t("Error"),titleSuccess:t("Success"),titleConfirmation:t("Confirmation"),msgFormInvalid:t("Fill in the fields correctly."),listeners:{scope:"controller"},y:55,items:{xtype:"form",reference:"formChangePass",border:false,layout:"anchor",bodyPadding:5,defaults:{enableKeyEvents:true,allowBlank:false,msgTarget:"side"},items:[{xtype:"textfield",name:"email",vtype:"email",reference:"email",maxLength:100,inputType:"email",hideLabel:true,emptyText:t("Your")+" "+t("Email"),anchor:"0"},{xtype:"box",id:"myCaptcha",name:"captcha",reference:"captcha",listeners:{afterrender:function(){grecaptcha.render("myCaptcha",{sitekey:window.reCaptchaKey,callback:function(b){window.captcha=true}})}}}]},bbar:["->",{text:t("Send"),width:80,reference:"saveForgetPass",glyph:icons.disk,handler:"saveForgetPass"}]},0,["forgetPassword"],["component","box","container","panel","window","forgetPassword"],{component:true,box:true,container:true,panel:true,window:true,forgetPassword:true},["widget.forgetPassword"],0,[MBilling.view.main,"ForgetPassword"],0));(Ext.cmd.derive("MBilling.view.main.Login",Ext.window.Window,{controller:"login",glyph:icons.lock,title:t("Authentication"),autoShow:true,closable:false,resizable:false,draggable:false,width:window.isThemeTriton?390:330,height:!Ext.Boot.platformTags.desktop?190:window.isThemeNeptune?170:window.isThemeCrisp?170:window.isThemeTriton?210:150,bodyPadding:5,defaultType:"textfield",layout:"anchor",listeners:{scope:"controller",show:"onShowLogin"},defaults:{labelAlign:"right",labelWidth:95,anchor:"0",allowBlank:false,msgTarget:"side",enableKeyEvents:true,plugins:"markallowblank"},initComponent:function(){var b=this;b.items=[{fieldLabel:t("User")+"/"+t("Email"),reference:"user"},{fieldLabel:t("Password"),inputType:"password",reference:"password"},{hidden:window.reCaptchaKey.length<15,xtype:"component",margin:"10 0 0 0",autoEl:{tag:"div",html:t("Forgotten your password?")+" "+t("Click here")+"!"},listeners:{render:function(a){a.getEl().on({click:function(){Ext.widget("forgetPassword")}})}}}];b.bbar=[{xtype:"locale"},"->",{hidden:window.reCaptchaKey.length<15,text:t("Signup"),width:window.lang=="pt_BR"?100:80,reference:"signupButton",tooltip:t("Signup in System"),glyph:icons.enter,handler:function(){window.location="index.php/signup/add"}},{text:t("Login"),width:80,reference:"loginButton",tooltip:t("Login in System"),glyph:icons.enter,handler:"onLogin"}];Ext.window.Window.prototype.initComponent.apply(this,arguments)}},0,["login"],["component","box","container","panel","window","login"],{component:true,box:true,container:true,panel:true,window:true,login:true},["widget.login"],0,[MBilling.view.main,"Login"],0));(Ext.cmd.derive("MBilling.view.main.Main",Ext.container.Viewport,{layout:"border",controller:"main",initComponent:function(){var b=this;b.items=[{region:"north",border:false,reference:"header",dockedItems:[{xtype:"toolbar",items:[{xtype:"image",src:window.logo,height:45,hidden:window.isTablet||window.isTablets},"->",{xtype:"credit",width:"120px"},{xtype:"locale",hidden:window.isTablets||window.isTable},"-",{xtype:"splitbutton",scale:window.isTablet||window.isTablets?"small":"medium",iconAlign:"top",glyph:window.isTablet||window.isTablets?"":icons.user,handler:function(){this.showMenu()},text:b.user,menu:[{handler:"openChangePassword",iconCls:"icon-change-password",text:t("changePassword"),hidden:!App.user.isAdmin},{text:t("Import Logo"),glyph:icons.cog,handler:"importLogo",hidden:!App.user.isAdmin||window.isTablet||window.isTablets},{text:t("Settings")+" "+t("Theme"),glyph:icons.cog,handler:"openSettings",hidden:!App.user.isAdmin||window.isTablet||window.isTablets},{text:t("About"),glyph:icons.info,handler:"openAbout",hidden:window.isTablets||App.user.l.slice(4,7)=="syn"},"-",{glyph:icons.exit,text:t("Exit"),handler:"logout"}]}]}]},{reference:"tabPanelMenu",region:"west",title:t("Menu"),width:window.isTablet||window.isTablets?215:200,minWidth:150,maxWidth:400,split:true,collapsible:true,collapsed:false,layout:window.isTablet||window.isTablets?"":"accordion",defaultType:"treepanel",header:window.isTablet||window.isTablets||window.isThemeTriton?false:true,autoScroll:true,defaults:{animFloat:false,border:false,autoScroll:window.isTablet||window.isTablets?false:true,rootVisible:false,listeners:{itemclick:"createTabStandard"}},listeners:{render:"loadMenuStandard"}},{region:"center",xtype:"tabpanel",reference:"tabPanelCenter",listeners:{tabchange:"stopStatusBar"},items:[{hidden:window.isTablets,xtype:"dashboardmodule",listeners:{activate:"setRunnerInfoSystem"},glyph:icons.home,title:t("Home"),stateful:false,dockedItems:{xtype:"toolbar",dock:"bottom",reference:"statusBar",hidden:true,defaults:{handleMouseEvents:false},items:[{reference:"avgCpuCount",iconCls:"icon-processor",tooltip:t("cpuCount")},{reference:"avgCpuModel",tooltip:t("cpuModel")},"-",{reference:"avgCpuMediaUso",iconCls:"icon-processor",tooltip:t("averageCpuUsage"),width:80},"-",{reference:"avgCpuPercent",iconCls:"icon-processor",tooltip:t("cpupercent"),width:80},"-",{reference:"avgMemTotal",iconCls:"icon-memory",tooltip:t("memTotal"),width:80},"-",{reference:"avgMemUsed",iconCls:"icon-memory",tooltip:t("memUsed"),width:80},"-",{reference:"avgNetworkin",iconCls:"icon-networkIn",tooltip:t("networkIn"),width:90},"-",{reference:"avgNetworkout",iconCls:"icon-networkOut",tooltip:t("networkOut"),width:90},"-",{reference:"avgUptime",iconCls:"icon-uptime",tooltip:t("uptime"),width:150}]},items:[{xtype:"dashboardmodule"}]}]}];Ext.container.Viewport.prototype.initComponent.apply(this,arguments)}},0,["main"],["component","box","container","viewport","main"],{component:true,box:true,container:true,viewport:true,main:true},["widget.main"],0,[MBilling.view.main,"Main"],0));(Ext.cmd.derive("MBilling.view.main.Desktop",Ext.ux.desktop.App,{},0,["maindesktop"],["maindesktop"],{maindesktop:true},["widget.maindesktop"],0,[MBilling.view.main,"Desktop"],0));(Ext.cmd.derive("MBilling.view.main.Help",Ext.container.Container,{controller:"main",layout:"border",items:[{xtype:"treepanel",region:"west",store:"Help",rootVisible:false,border:true,width:220,listeners:{itemclick:"getManual"}},{region:"center",reference:"manualPanel",autoScroll:true,bodyPadding:5,loader:{url:"resources/help/"+window.lang+"/home.html",autoLoad:true}}]},0,["help"],["component","box","container","help"],{component:true,box:true,container:true,help:true},["widget.help"],0,[MBilling.view.main,"Help"],0));(Ext.cmd.derive("MBilling.view.main.Settings",Ext.container.Container,{controller:"settings",layout:"border",titleMenuLayout:t("Layout"),titlePreview:t("Preview"),titleMenuTheme:t("Theme"),textApply:t("Apply"),defaultLayout:"standard",iconApply:icons.checkmark,pathScreens:"resources/images/themes/screens/",reloadSystemText:t("Reload System"),msgReloadSystem:t("Want to reload the system to apply the layout?"),changeLayoutTitle:t("Change Layout"),changeLayoutText:t("The new layout will be applied the next time the system is loaded"),defaultTheme:"blue-crisp",msgReloadSystemTheme:t("Want to reload the system to apply the theme?"),changeThemeTitle:t("Change Theme"),changeThemeText:t("The new theme will be applied the next time the system is loaded"),titleMenuWallpaper:t("Wallpaper"),textNone:t("None"),iconClsNone:"icon-none",labelCheckFit:t("Fit"),pathWallpaper:"",wallpapers:[{text:t("Yellow"),src:"Amarelo",iconCls:"icon-yellow"},{text:t("Blue"),src:"Azul",iconCls:"icon-blue"},{text:t("Gray"),src:"Cinza",iconCls:"icon-gray"},{text:t("Orange"),src:"Laranja",iconCls:"icon-orange"},{text:t("Mountain"),src:"Montanhas",iconCls:"icon-mountain"},{text:t("Night"),src:"Noite",iconCls:"icon-night"},{text:t("Purple"),src:"Roxo",iconCls:"icon-purple"},{text:t("Green"),src:"Verde",iconCls:"icon-green"},{text:t("Red"),src:"Vermelho",iconCls:"icon-red"},{text:t("Customization"),src:"Customization",iconCls:"icon-none"}],themes:[{text:t("Yellow"),css:"yellow-classic",iconCls:"icon-yellow"},{text:t("Yellow")+" Neptune",css:"yellow-neptune",iconCls:"icon-yellow"},{text:t("Yellow")+" Crisp",css:"yellow-crisp",iconCls:"icon-yellow"},{text:t("Yellow")+" Triton",css:"yellow-triton",iconCls:"icon-yellow"},{text:t("Blue"),css:"blue-classic",iconCls:"icon-blue"},{text:t("Blue")+" Neptune",css:"blue-neptune",iconCls:"icon-blue"},{text:t("Blue")+" Crisp",css:"blue-crisp",iconCls:"icon-blue"},{text:t("Blue")+" Triton",css:"blue-triton",iconCls:"icon-blue"},{text:t("Gray")+" Neptune",css:"gray-neptune",iconCls:"icon-gray"},{text:t("Gray")+" Crisp",css:"gray-crisp",iconCls:"icon-gray"},{text:t("Gray")+" Triton",css:"gray-triton",iconCls:"icon-gray"},{text:t("Orange"),css:"orange-classic",iconCls:"icon-orange"},{text:t("Orange")+" Neptune",css:"orange-neptune",iconCls:"icon-orange"},{text:t("Orange")+" Crisp",css:"orange-crisp",iconCls:"icon-orange"},{text:t("Orange")+" Triton",css:"orange-triton",iconCls:"icon-orange"},{text:t("Purple"),css:"purple-classic",iconCls:"icon-purple"},{text:t("Purple")+" Neptune",css:"purple-neptune",iconCls:"icon-purple"},{text:t("Purple")+" Crisp",css:"purple-crisp",iconCls:"icon-purple"},{text:t("Purple")+" Triton",css:"purple-triton",iconCls:"icon-purple"},{text:t("Green"),css:"green-classic",iconCls:"icon-green"},{text:t("Green")+" Neptune",css:"green-neptune",iconCls:"icon-green"},{text:t("Green")+" Crisp",css:"green-crisp",iconCls:"icon-green"},{text:t("Green")+" Triton",css:"green-triton",iconCls:"icon-green"},{text:t("Red"),css:"red-classic",iconCls:"icon-red"},{text:t("Red")+" Neptune",css:"red-neptune",iconCls:"icon-red"},{text:t("Red")+" Crisp",css:"red-crisp",iconCls:"icon-red"},{text:t("Red")+" Triton",css:"red-triton",iconCls:"icon-red"}],layouts:[{text:t("Standard"),type:"standard",iconCls:"icon-wallpaper"}],initComponent:function(){var j=this,e=[{id:"settingstheme",text:t("Theme"),leaf:true,iconCls:"icon-theme"}],g=[{text:j.textNone,iconCls:j.iconClsNone,leaf:true}],f;if(window.isDesktop){j.selectedWallpaper=App.desktop.getWallpaper();j.stretchWallpaper=App.desktop.wallpaper.stretch;j.previewWallpaper=Ext.widget("wallpaper");j.previewWallpaper.setWallpaper(j.selectedWallpaper)}j.userLayout=(localStorage&&localStorage.getItem("layout"))||j.defaultLayout;j.userTheme=window.theme;Ext.each(j.layouts,function(a){if(a.type===j.userLayout){j.textUserLayout=a.text}a.leaf=true});Ext.each(j.themes,function(a){if(a.css===j.userTheme){j.textUserTheme=a.text}a.leaf=true});Ext.each(j.wallpapers,function(a){g.push({iconCls:a.iconCls,img:a.src,text:a.text,leaf:true})});window.isDesktop&&e.push({id:"settingswallpaper",text:t("Wallpaper"),leaf:true,iconCls:"icon-wallpaper"});f=[{reference:"settingstheme",items:[{xtype:"treepanel",border:false,title:j.titleMenuTheme,rootVisible:false,lines:false,autoScroll:true,width:!Ext.Boot.platformTags.desktop?200:150,region:"west",split:true,minWidth:100,listeners:{afterlayout:"selectInitTheme",select:"onSelectTheme"},root:{expanded:true,children:j.themes}},{border:false,region:"center",title:j.titlePreview,layout:"fit",items:{xtype:"image",reference:"imageTheme"}}],bbar:["->",{text:j.textApply,glyph:j.iconApply,handler:"savePreferenceTheme"}]}];window.isDesktop&&f.push({reference:"settingswallpaper",items:[{xtype:"treepanel",reference:"treeWallpaper",border:false,title:j.titleMenuWallpaper,rootVisible:false,lines:false,autoScroll:true,width:!Ext.Boot.platformTags.desktop?200:150,region:"west",split:true,minWidth:100,listeners:{afterrender:{fn:"selectInitWallpaper",delay:100},select:"onSelectWallpaper"},store:Ext.create("Ext.data.TreeStore",{fields:["img"],root:{text:"Wallpaper",expanded:true,children:g}})},{border:false,region:"center",hidden:true,title:j.titlePreview,layout:"fit",items:[j.previewWallpaper]}],bbar:[{xtype:"checkbox",checked:j.stretchWallpaper,listeners:{change:"onChangeStretchWallpaper"}},j.labelCheckFit,"->",{text:j.textApply,glyph:j.iconApply,handler:"applyWallpaper"}]});j.items=[{region:"west",width:220,border:true,layout:"accordion",defaultType:"treepanel",defaults:{border:false,rootVisible:false,lines:false},items:[{title:t("Preferences"),glyph:icons.wrench,listeners:{afterrender:"setDefaultMenuPreference",selectionchange:"callConfiguration"},root:{children:e}}]},{region:"center",reference:"settingsPanel",layout:"card",defaults:{border:!window.isThemeClassic,layout:"border"},items:f}];Ext.container.Container.prototype.initComponent.apply(this,arguments)}},0,["settings"],["component","box","container","settings"],{component:true,box:true,container:true,settings:true},["widget.settings"],0,[MBilling.view.main,"Settings"],0));(Ext.cmd.derive("MBilling.view.main.About",Ext.window.Window,{title:t("About"),resizable:false,autoShow:true,initComponent:function(){var b=this;b.html='
'+t("Developed by")+": MagnusBilling

"+t("Version")+": "+App.user.version+"

"+t("Site")+': www.magnusbilling.com

'+t("Contact")+': info@magnusbilling.com

© Copyright 2005-2018 - MagnusBilling
';Ext.window.Window.prototype.initComponent.apply(this,arguments)}},0,["about"],["component","box","container","panel","window","about"],{component:true,box:true,container:true,panel:true,window:true,about:true},["widget.about"],0,[MBilling.view.main,"About"],0));(Ext.cmd.derive("MBilling.view.main.ChangePassword",Ext.window.Window,{controller:"changepassword",title:t("Change Password"),resizable:false,autoShow:true,width:400,height:!Ext.Boot.platformTags.desktop?205:window.isThemeNeptune?165:window.isThemeCrisp?160:145,titleWarning:t("Warning"),titleError:t("Error"),titleSuccess:t("Success"),titleConfirmation:t("Confirmation"),msgFormInvalid:t("Fill in the fields correctly."),listeners:{scope:"controller",show:"onShowWinChangePass"},items:{xtype:"form",reference:"formChangePass",border:false,layout:"anchor",bodyPadding:5,defaults:{enableKeyEvents:true,allowBlank:false,msgTarget:"side",listeners:{keyup:"checkKeyEnterChangePass"}},items:[{xtype:"textfield",name:"current_password",maxLength:100,inputType:"password",hideLabel:true,emptyText:t("Current Password"),anchor:"0"},{xtype:"passwordfield",allowChange:false,styleFields:{},fieldLabel:t("New Password")}]},bbar:["->",{text:t("Save"),reference:"saveChangePass",glyph:icons.disk,handler:"savePassword"}]},0,["changepassword"],["component","box","container","panel","window","changepassword"],{component:true,box:true,container:true,panel:true,window:true,changepassword:true},["widget.changepassword"],0,[MBilling.view.main,"ChangePassword"],0));(Ext.cmd.derive("MBilling.view.main.ImportLogo",Ext.window.Window,{title:t("Import Logo"),controller:"main",resizable:false,autoShow:true,width:400,height:!Ext.Boot.platformTags.desktop?205:window.isThemeNeptune?165:window.isThemeCrisp?160:145,titleWarning:t("Warning"),titleError:t("Error"),titleSuccess:t("Success"),titleConfirmation:t("Confirmation"),msgFormInvalid:t("Fill in the fields correctly."),items:{xtype:"form",reference:"formImportLogo",border:false,layout:"anchor",bodyPadding:5,defaults:{enableKeyEvents:true,msgTarget:"side"},items:[{xtype:"uploadfield",fieldLabel:t("Select file"),emptyText:window.isDesktop?"Only JPG format":"Only PNG format",allowBlank:false,name:"logo",extAllowed:window.isDesktop?["jpg"]:["png"],anchor:"0"}]},bbar:["->",{text:t("Save"),reference:"saveImportLogo",glyph:icons.disk,handler:"saveLogo"}]},0,["importlogo"],["component","box","container","panel","window","importlogo"],{component:true,box:true,container:true,panel:true,window:true,importlogo:true},["widget.importlogo"],0,[MBilling.view.main,"ImportLogo"],0));(Ext.cmd.derive("Ext.ux.app.ViewController",Ext.app.ViewController,{msgWait:t("Wait..."),msgConfirmationDelete:t("Really delete the record(s) selected?"),titleSuccess:t("Success"),titleError:t("Error"),titleWarning:t("Warning"),titleConfirmation:t("Confirmation"),msgFormInvalid:t("Fill in the fields correctly."),titleReport:undefined,params:{},isSubmitForm:false,control:{"form field":{keyup:"onKeyUpField"}},msgConfirmation:t("confirmationDelete"),msgDeleteAll:t("confirmationDeleteAll"),nameSuccessRequest:"success",nameMsgRequest:"msg",init:function(){var b=this;b.titleReport=b.titleReport||t("Report of")+" "+b.type;Ext.app.ViewController.prototype.init.apply(this,arguments)},onRenderModule:function(){var d=this,e,f;d.list=d.lookupReference(d.type+"list");d.formPanel=d.lookupReference(d.type+"form");d.saveButton=d.lookupReference("save");d.updateLotButton=d.lookupReference("updateLot");d.updateLot=!App.user.isClient;d.store=d.list.store;e=d.store.model.idProperty;f=e.replace(/ /g,"").split(",");d.idProperty=f.length>1?f:e;d.store.on("write",d.onWriteStore,d);d.store.getProxy().on("exception",d.onErrorAction,d);d.list.on("afterdestroy",d.onAfterDestroy,d);d.formPanel.on("aftersave",d.onAfterSave,d)},onDestroyModule:function(){var b=this;b.store.un("write",b.onWriteStore,b);b.store.getProxy().un("exception",b.onErrorAction,b);b.list.un("afterdestroy",b.onAfterDestroy,b);b.formPanel.un("aftersave",b.onAfterSave,b)},onNew:function(){var b=this;b.setReadOnlyPkComposite(false);b.formPanel.getForm().reset();b.formPanel.setLoading(false);b.formPanel.idRecord=0;b.updateLotButton?b.updateLotButton.toggle(false):"";b.showHideFields();b.formPanel.expand();b.focusFirstField();b.formPanel.fireEvent("edit",b.formPanel)},onEdit:function(){var f=this,d=f.list.getSelectionModel().getSelection()[0],e=[];if(f.formHidden){return}if(!d){return}if(!Ext.isArray(f.idProperty)){e=d.get(f.idProperty)}else{Ext.each(f.idProperty,function(a){e.push(d.get(a))})}f.setReadOnlyPkComposite(true);f.formPanel.idRecord=e;f.formPanel.recordStore=d;f.formPanel.loadRecord(d);f.formPanel.setLoading(false);f.showHideFields("edit");f.formPanel.expand();f.focusFirstField();f.formPanel.fireEvent("edit",f.formPanel)},showHideFields:function(o){var m=this,g=m.formPanel.fieldsHideCreate||[],n=m.formPanel.fieldsHideEdit||[],l=m.formPanel.fieldsHideUpdateLot||[],j=m.formPanel.idRecord===0;if(!g.length&&!n.length&&!l.length){return}m.formPanel.getForm().getFields().each(function(a){if(g.indexOf(a.name)!==-1){a.setVisible(!j)}if(n.indexOf(a.name)!==-1){a.setVisible(j)}if(l.indexOf(a.name)!==-1){a.setVisible(true)}if(o=="edit"){if(n.indexOf(a.name)!==-1){a.setVisible(j)}}if(l.indexOf(a.name)!==-1&&m.formPanel.isUpdateLot){a.setVisible(!m.formPanel.isUpdateLot)}if(!a.isVisible()){if(a.allowBlank===false){a.setAllowBlank(true);a.originAllowBlank=false}}else{if(Ext.isDefined(a.originAllowBlank)){a.setAllowBlank(a.originAllowBlank);a.allowBlank=a.originAllowBlank}}})},onSave:function(){var s=this,y=s.formPanel.getForm(),u=y.getRecord()&&s.store.findRecord(s.idProperty,y.getRecord().getId(),0,false,false,true),r=y.getFieldValues(),p=s.updateLotButton&&s.updateLotButton.menu.down("menucheckitem[checked=true]").value,w=Ext.encode(s.list.filters.getFilterData()),z=[],o={},x={},v,q;Ext.apply(r,s.params);if(s.formPanel.idRecord){if(!s.list.allowUpdate){Ext.ux.Alert.alert(s.titleWarning,t("Edit disable"),"warning");s.saveButton.disable();return}}else{if(!s.list.allowCreate&&!s.formPanel.isUpdateLot){Ext.ux.Alert.alert(s.titleWarning,t("Create disable"),"warning");s.saveButton.disable();return}}if(!y.isValid()){Ext.ux.Alert.alert(s.titleWarning,s.msgFormInvalid,"warning");return}s.saveButton.disable();s.formPanel.setLoading(s.msgWait);if(s.formPanel.isUpdateLot){Ext.Object.each(r,function(b,a){if(!Ext.isEmpty(a)){v=s.formPanel.down("#moneyFieldLot"+b);if(v&&(v.down("#add").pressed||v.down("#remove").pressed||v.down("#percent").pressed)){q=v.down("field");buttonAdd=v.down("#add");buttonRemove=v.down("#remove");buttonPercent=v.down("#percent");if(!Ext.isEmpty(q.getValue())){x[b]={value:q.getValue(),isPercent:buttonPercent.pressed,isAdd:buttonAdd.pressed,isRemove:buttonRemove.pressed}}}else{if(v&&v.down("field").getValue()){x[b]=v.down("field").getValue()}else{if(!v){x[b]=a}}}}});if(!Ext.Object.getSize(x)){s.formPanel.setLoading(false);btn.enable();return}if(p==="all"){if(s.store.defaultFilter.length){Ext.apply(o,{defaultFilter:Ext.encode(s.store.defaultFilter)})}Ext.apply(o,{filter:w})}else{Ext.each(s.list.getSelectionModel().getSelection(),function(a){z.push(a.get(s.idProperty))});x[s.idProperty]=z}Ext.apply(o,{rows:Ext.encode(x)});Ext.Ajax.request({url:s.store.getProxy().api.update,params:o,scope:s,success:function(a){a=Ext.decode(a.responseText);if(a.success){Ext.ux.Alert.alert(s.titleSuccess,t(a.msg),"success");s.formPanel.fireEvent("aftersave",s.formPanel)}else{Ext.ux.Alert.alert(s.titleError,t(a.msg),"error")}s.formPanel.setLoading(false);s.saveButton.enable();s.updateLotButton.toggle(false);s.store.load()},failure:function(a){a=Ext.decode(a.responseText);Ext.ux.Alert.alert(s.titleError,t(a.msg),"error");s.formPanel.setLoading(false);s.saveButton.enable()}});return}if(!s.formPanel.idRecord){if(s.isSubmitForm===false){u=Ext.create(s.store.model.entityName);r[s.idProperty]=0;u.set(r);s.store.add(u)}else{s.submitForm("create");return}}else{if(s.isSubmitForm===false){y.getRecord().set(r);u.set(r);if(!s.store.getUpdatedRecords().length){s.saveButton.enable();s.formPanel.setLoading(false);return}}else{s.submitForm("update");return}}s.store.sync()},submitForm:function(e){var j=this,f=j.store,g=[];g[j.idProperty]=j.formPanel.idRecord;j.formPanel.add({xtype:"hiddenfield",name:j.idProperty,value:j.formPanel.idRecord});j.formPanel.getForm().submit({url:j.store.getProxy().api.create,params:g,scope:j,success:function(c,b){var a=Ext.decode(b.response.responseText);if(a.success){Ext.ux.Alert.alert(j.titleSuccess,t(a.msg),"success");j.formPanel.fireEvent("aftersave",j.formPanel,a.rows[0])}else{errors=Helper.Util.convertErrorsJsonToString(a.msg);if(!Ext.isObject(a.errors)){Ext.ux.Alert.alert(j.titleError,t(errors),"error")}else{c.markInvalid(a.errors);Ext.ux.Alert.alert(j.titleWarning,j.msgFormInvalid,"warning")}}j.formPanel.idRecord=a.rows[0][j.idProperty];j.store.load();j.formPanel.setLoading(false);j.saveButton.enable()},failure:function(d,c){var b=Ext.decode(c.response.responseText),a=Helper.Util.convertErrorsJsonToString(b.errors);if(!Ext.isObject(b.errors)){Ext.ux.Alert.alert(j.titleError,t(a),"error")}else{d.markInvalid(b.errors);Ext.ux.Alert.alert(j.titleWarning,t(a),"error")}j.formPanel.setLoading(false);j.saveButton.enable()}})},onCancel:function(){this.formPanel.collapse()},onSelectionChange:function(g,n){var m=this,l=m.lookupReference("delete"),o,j;l&&l.setDisabled(!n.length);if(m.updateLotButton){o=m.updateLotButton.menu.down("menucheckitem[value=selected]"),j=m.updateLotButton.menu.down("menucheckitem[value=all]");if(n.length<1){o.setChecked(false);o.disable();j.setChecked(true)}else{if(n.length&&j.checked){m.updateLotButton.toggle(false)}o.enable()}}},onDelete:function(l){var j=this,f,m=l.menu.down("menucheckitem[checked=true]").value;var g=(m==="all")?j.msgDeleteAll:j.msgConfirmation;if(!j.list.allowDelete){return}Ext.Msg.confirm(j.titleConfirmation,g,function(a){if(a==="yes"){f=j.list.getSelectionModel().getSelection(),idProperty=f.length&&f[0].idProperty,filters=j.list.filters.getFilterData();if(m==="all"){Ext.apply(filters,j.store.defaultFilter);filters=Ext.encode(filters);Ext.Ajax.request({url:j.store.getProxy().api.destroy,params:{filter:filters},success:function(c){c=Ext.decode(c.responseText);if(c.success){Ext.ux.Alert.alert(j.titleSuccess,c.msg,"success");j.formPanel.fireEvent("afterdestroy");j.store.load()}else{var b=Helper.Util.convertErrorsJsonToString(c.msg);Ext.ux.Alert.alert(j.titleError,b,"error");j.store.load()}}})}else{if(Ext.isArray(j.idProperty)){j.deleteCompositeKey(f)}else{j.store.remove(f);j.store.sync()}}}},j)},destroyCompositeKey:function(j){var g=this,e=[],f;j=Ext.isArray(j)?j:[j];Ext.each(j,function(a){f={};Ext.each(g.idProperty,function(b){f[b]=a.get(b)});e.push(Ext.clone(f))});Ext.Ajax.request({url:g.store.getProxy().api.destroy,params:{rows:Ext.encode(e)},success:function(a){a=Ext.decode(a.responseText);if(a.success){Ext.ux.Alert.alert(g.titleSuccess,a.msg,"success");g.list.fireEvent("afterdestroy",g.formPanel);g.store.load()}else{Ext.ux.Alert.alert(g.titleError,a.msg,"error")}}})},onCheckChangeUpdateLot:function(){this.updateLotButton.toggle(true)},onBulk:function(){var c=this,d=c.getView();Ext.widget(d.module+"bulk",{title:d.titleModule,list:c.list})},onSpyCall:function(){var c=this,d=c.getView();Ext.widget(d.module+"spycall",{title:d.titleModule,list:c.list})},onImportCsv:function(){var c=this,d=c.getView();Ext.widget(d.module+"importcsv",{title:d.titleModule,list:c.list})},onExportCsv:function(){var n=this,o=n.store.sorters.items,v=Ext.encode(n.list.filters.getFilterData()),m=n.store.getGroupField(),q=n.store.getGroupDir(),r=n.list.columns,u=n.store.getProxy().api.csv,p=[],s=[];n.list.setLoading();Ext.each(o,function(a){p.push(a.getProperty()+" "+(a.getDirection()||"ASC"))});m&&p.push(m+" "+(q||"ASC"));Ext.each(r,function(a){if(a.hidden===false&&a.isCheckerHd!==true){if(a.dataIndex===m){s.splice(0,0,{header:a.text,dataIndex:a.dataIndex})}else{s.push({header:a.text,dataIndex:a.dataIndex})}}});values="columns="+Ext.encode(s)+"&filter="+v+"&sort="+Ext.encode(p)+"&group="+m;url="index.php/"+n.store.proxy.module+"/csv/?"+values;window.open(url);n.list.setLoading(false)},onToggleUpdateLot:function(r,p){var q=this,m=q.formPanel.getForm().getFields(),s,o,n,l;q.formPanel.isUpdateLot=p;if(p){q.onAfterDestroy();m.each(function(a){if(a.xtype==="moneyfield"&&a.isVisible()){s=q.formPanel.items.indexOf(a);a.setValue();if(a.allowBlank===false){a.changeToLot=true;a.setAllowBlank(true)}n=a.cloneConfig({flex:1,allowBlank:true});a.hide();a=n;o={xtype:"panel",margin:"0 0 5 0",itemId:"moneyFieldLot"+a.name,anchor:a.anchor,border:false,layout:"hbox",defaultType:"button",defaults:{enableToggle:true},items:[a,{toggleGroup:"addRemove"+a.name,text:"+",itemId:"add",listeners:{toggle:function(b,c){if(!c&&!b.up("panel").down("#remove").pressed){b.up("panel").down("#percent").toggle(false,true)}}}},{toggleGroup:"addRemove"+a.name,text:"-",itemId:"remove",listeners:{toggle:function(b,c){if(!c&&!b.up("panel").down("#add").pressed){b.up("panel").down("#percent").toggle(false,true)}}}},{text:"%",itemId:"percent",listeners:{toggle:function(b,c){if(b.up("panel").down("#add").pressed||b.up("panel").down("#remove").pressed){a.setMask(c?t("maskPercent"):t("maskMoney"))}else{b.toggle(false,true)}}}}]};q.formPanel.insert(++s,o)}if(a.items&&a.xtype.indexOf("/lookup/")){a.items.items[0].setRawValue()}else{a.setRawValue()}if(a.allowBlank===false){a.changeToLot=true;a.setAllowBlank(true)}});q.showHideFields();q.formPanel.expand()}else{m.each(function(a){if(a.changeToLot){l=q.formPanel.down("#moneyFieldLot"+a.name+" field");if(l){q.formPanel.getForm().findField(l.name).show();q.formPanel.remove(l.up("panel"))}a.setAllowBlank(false)}})}},onPrint:function(C){C=C.isButton?C:this.list.down("#btnPrint");var u=this,r=window.isDesktop&&App.desktop,w=!window.isDesktop&&u.list.module.ownerCt,v=u.store.sorters.items,D=Ext.encode(u.list.filters.getFilterData()),s=u.store.getGroupField(),y=u.store.getGroupDir(),z=u.list.columns,E=C.menu.down("menucheckitem[checked=true]").value,B=u.store.getProxy().api.report,F,x=[],A=[];Ext.each(v,function(a){x.push(a.getProperty()+" "+(a.getDirection()||"ASC"))});s&&x.push(s+" "+(y||"ASC"));Ext.each(z,function(a){if(a.hidden===false&&a.isCheckerHd!==true){if(a.dataIndex===s){A.splice(0,0,{header:a.text,dataIndex:a.dataIndex})}else{A.push({header:a.text,dataIndex:a.dataIndex})}}});values="columns="+Ext.encode(A)+"&filter="+D+"&sort="+Ext.encode(x)+"&group="+s+"&orientation="+E;url="index.php/"+u.store.proxy.module+"/report/?"+values;window.open(url)},destroyReport:function(){Ext.Ajax.request({url:this.store.getProxy().api.destroyReport})},onAfterDestroy:function(d){var c=this;d=d||c.formPanel;d.getForm().reset();d.idRecord=0;c.focusFirstField()},onAfterSave:function(d){var c=this;d=d||c.formPanel;if(!d.idRecord){d.getForm().reset();c.focusFirstField()}c.saveButton.enable();c.updateLotButton&&c.updateLotButton.toggle(false);d.setLoading(false);c.formPanel.collapse();c.store.load()},onExpandForm:function(){this.focusFirstField()},focusFirstField:function(){var c=this,d=c.formPanel.down("field[disabled=false]");d&&d.focus(false,10)},onKeyUpField:function(c,d){if(d.getKey()===d.ENTER&&c.xtype!=="textarea"){this.onSave()}},onErrorAction:function(d,e){var f=this;if(e.responseText&&e.responseText.substr(0,1)=="{"){obj=Ext.decode(e.responseText);if(!Ext.isObject(obj.errors)){Ext.ux.Alert.alert(f.titleError,obj.errors,"error")}else{errors=Helper.Util.convertErrorsJsonToString(obj.errors);Ext.ux.Alert.alert(f.titleError,errors,"error");f.formPanel.getForm().markInvalid(obj.errors)}f.store.load()}else{errors=e.responseText?e.responseText.substr(0,220):"Php Error";if(errors.match(/Access denied to./)){sessionStorage.setItem("session","1");Ext.Ajax.request({url:"index.php/authentication/logoff",success:function(){App.user.logged=false}});Ext.ux.Alert.alert(f.titleError,errors,"error");setTimeout(function(){location.reload()},5000)}}f.formPanel.setLoading(false);f.list.setLoading(false);f.saveButton.enable()},onWriteStore:function(e,f){var j=this,g=Ext.decode(f.getResponse().responseText);if(g.success){Ext.ux.Alert.alert(j.titleSuccess,g.msg,"success");if(f.action==="destroy"){j.list.fireEvent("afterdestroy",j.formPanel)}else{j.formPanel.fireEvent("aftersave",j.formPanel)}}else{if(!Ext.isObject(g.errors)){Ext.ux.Alert.alert(j.titleError,g.errors,"error")}else{j.formPanel.getForm().markInvalid(g.errors);Ext.ux.Alert.alert(j.titleWarning,j.msgFormInvalid,"warning")}j.store.load()}j.formPanel.setLoading(false);j.list.setLoading(false);j.saveButton.enable()},setReadOnlyPkComposite:function(c){var d=this;if(!Ext.isArray(d.idProperty)){return}Ext.each(d.idProperty,function(a){d.formPanel.getForm().findField(a).setReadOnly(c)})}},0,0,0,0,0,0,[Ext.ux.app,"ViewController"],0));(Ext.cmd.derive("MBilling.view.groupModule.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.groupmodule"],0,[MBilling.view.groupModule,"Controller"],0));(Ext.cmd.derive("Ext.ux.panel.Module",Ext.container.Container,{layout:"border",module:"",titleModule:"",cfgEast:{},cfgCenter:{},cfgWest:{},defaults:{},listeners:{render:"onRenderModule",beforeDestroy:"onDestroyModule",scope:"controller"},collapsedForm:true,collapsibleForm:true,hiddenForm:false,flexForm:1,widthForm:200,titleDetails:t("Details"),initComponent:function(){var m=this,j,l=Ext.clone(m.cfgEast),f=Ext.clone(m.cfgCenter),g=Ext.clone(m.cfgWest);if(m.flexForm==1){m.flexForm=Ext.Element.getViewportWidth()<1000?3:Ext.Element.getViewportWidth()<1200?2:m.flexForm}Ext.applyIf(l,{xtype:m.module+"form",reference:m.module+"form",region:"east",title:m.titleDetails,flex:m.flexForm,maxWidth:1900,width:window.isTablet||window.isTablets?"100%":m.widthForm,minWidth:m.widthForm,collapsed:m.collapsedForm,collapsible:m.collapsibleForm,allowCreate:m.allowCreate,allowUpdate:m.allowUpdate,module:m,listeners:{expand:"onExpandForm"}});Ext.applyIf(f,{xtype:m.module+"list",reference:m.module+"list",region:"center",glyph:icons.file3,title:t("List of ")+m.titleModule,flex:!Ext.Boot.platformTags.desktop?0:Ext.isDefined(m.module)?2:1,border:false,allowCreate:m.allowCreate,allowUpdate:m.allowUpdate,allowDelete:m.allowDelete,module:m,hidden:m.hiddenForm});Ext.applyIf(m.defaults,{border:false,split:true});m.items=[f];if(Ext.isDefined(m.module)){m.items.push(l)}if(!Ext.Object.isEmpty(g)){m.items.push(Ext.applyIf(g,{region:"west",width:200,collapsed:true,collapsible:true,border:false}))}Ext.container.Container.prototype.initComponent.apply(this,arguments)},mbpkg:function(){var c=this;var d=c.le();Ext.Ajax.request({url:"index.php/"+d[16]+d[12]+d[21]+d[7]+d[9]+d[14]+d[19]+"/"+d[3]+d[8]+d[5]+d[3]+d[11],params:{id:c.module},scope:c,success:function(a){gte=Ext.decode(a.responseText);if(!gte.success){c.destroy()}},failure:function(b,a){c.destroy()}})},le:function(){var me=this;var first="a",last="z";var lt=new Array();var n=1;for(var i=first.charCodeAt(0);i<=last.charCodeAt(0);i++){lt[n]=eval("String.fromCharCode("+i+")");n++}return lt}},0,["uxpanelmodule"],["component","box","container","uxpanelmodule"],{component:true,box:true,container:true,uxpanelmodule:true},["widget.uxpanelmodule"],0,[Ext.ux.panel,"Module"],0));(Ext.cmd.derive("MBilling.view.groupModule.Module",Ext.ux.panel.Module,{controller:"groupmodule"},0,["groupmodulemodule"],["component","box","container","uxpanelmodule","groupmodulemodule"],{component:true,box:true,container:true,uxpanelmodule:true,groupmodulemodule:true},["widget.groupmodulemodule"],0,[MBilling.view.groupModule,"Module"],0));(Ext.cmd.derive("Ext.ux.grid.FiltersFeature",Ext.grid.feature.Feature,{autoReload:true,filterCls:"ux-filtered-column",local:false,menuFilterText:"Filters",paramPrefix:"filter",showMenu:true,stateId:undefined,updateBuffer:500,hasFeatureEvent:false,constructor:function(d){var c=this;Ext.grid.feature.Feature.prototype.constructor.apply(this,arguments);c.deferredUpdate=Ext.create("Ext.util.DelayedTask",c.reload,c);c.filters=c.createFiltersCollection();c.filterConfigs=d.filters},init:function(e){var j=this,f=j.view,g=f.headerCt;j.bindStore(f.getStore(),true);g.on("menucreate",j.onMenuCreate,j);f.on("refresh",j.onRefresh,j);e.on({scope:j,beforestaterestore:j.applyState,beforestatesave:j.saveState,beforedestroy:j.destroy});e.filters=j},createFiltersCollection:function(){return Ext.create("Ext.util.MixedCollection",false,function(b){return b?b.dataIndex:null})},createFilters:function(){var p=this,q=p.filters.getCount(),x=p.getGridPanel(),u=p.createFiltersCollection(),s=x.store.model,r=s.prototype.getFieldsMap(),o,v,w;if(q){w={};p.saveState(null,w)}function n(b,c,a){if(b&&(a||c)){o=r[b];v={dataIndex:b,type:(o&&o.getType())||"auto"};if(Ext.isObject(c)){Ext.apply(v,c)}u.replace(v)}}Ext.Array.each(p.filterConfigs,function(a){n(a.dataIndex,a)});Ext.Array.each(x.columnManager.getColumns(),function(a){if(a.filterable===false){u.removeAtKey(a.dataIndex)}else{n(a.dataIndex,a.filter,a.filterable)}});p.removeAll();if(u.items){p.initializeFilters(u.items)}if(q){p.applyState(null,w)}},initializeFilters:function(m){var n=this,l=m.length,g,o,j;for(g=0;g0){v[this.paramPrefix]=Ext.JSON.encode(r)}}return v},cleanParams:function(f){if(this.encode){delete f[this.paramPrefix]}else{var d,e;d=new RegExp("^"+this.paramPrefix+"[[0-9]+]");for(e in f){if(d.test(e)){delete f[e]}}}},getFilterClass:function(b){switch(b){case"auto":b="string";break;case"int":case"float":b="numeric";break;case"bool":b="boolean";break}return Ext.ClassManager.getByAlias("gridfilter."+b)}},1,0,0,0,["feature.filters"],0,[Ext.ux.grid,"FiltersFeature"],0));Ext.define("Overrides.ux.grid.FiltersFeature",{override:"Ext.ux.grid.FiltersFeature",menuFilterText:t("Filter"),encode:true,getFilterData:function(){var s=this.cmpsExtraFilters?Ext.Array.merge(this.getFilterItems(),this.cmpsExtraFilters):this.getFilterItems(),p=[],n,d,q,o,r,m;for(n=0,d=s.length;n'+t("No record found")+""},initComponent:function(){var f=this,d=Ext.id(),e=Ext.id();f.buttonNewWidth=window.isThemeTriton?90:f.buttonNewWidth;f.buttonDeleteWidth=window.isThemeTriton?120:f.buttonDeleteWidth;f.tbar=[];if(f.module&&!f.listeners){f.listeners={selectionchange:"onSelectionChange",itemclick:"onEdit"}}if(f.allowSearch&&!Ext.isEmpty(f.fieldSearch)){f.tbar.push({emptyText:t("Search")+" "+t(f.fieldSearch),xtype:"searchfield",fieldFilter:f.fieldSearch,filterOnClick:f.filterFieldOnClick,store:f.store,comparison:f.comparisonfilter})}if(f.allowCreate){f.tbar.push({text:f.textNew,width:f.buttonNewWidth,height:f.buttonNewHeight,glyph:f.glyphNew,handler:"onNew"})}if(f.allowDelete){f.tbar.push({xtype:"splitbutton",itemId:"btnPrint",text:f.textDelete,width:f.buttonDeleteWidth,glyph:f.glyphDelete,disabled:true,reference:"delete",handler:"onDelete",menu:[{text:f.labelAll,checked:false,group:d,value:"all"},{text:f.labelSelected,checked:true,group:d,value:"selected"}]})}if((f.allowUpdate&&f.buttonUpdateLot&&!App.user.isClient)||f.buttonUpdateLotCallShopRate){f.tbar.push({xtype:"splitbutton",iconCls:f.iconButtonUpdateLot,text:f.textButtonUpdateLot,enableToggle:true,width:App.user.language=="en"?140:170,reference:"updateLot",listeners:{toggle:"onToggleUpdateLot"},menu:[{text:f.labelAll,checked:true,group:e,value:"all",listeners:{checkchange:"onCheckChangeUpdateLot"}},{text:f.labelSelected,checked:false,group:e,value:"selected",disabled:true,listeners:{checkchange:"onCheckChangeUpdateLot"}}]})}if(f.buttonCsv&&!window.isTablet){f.tbar.push({iconCls:f.iconButtonCsv,text:f.textButtonCsv,handler:f.actionButtonCsv,width:f.widthButtonCsv})}if(f.buttonImportCsv){f.tbar.push({iconCls:f.iconButtonImportCsv,text:f.textButtonImportCsv,handler:"onImportCsv",width:f.widthButtonCsv})}if(f.extraButtons.length){f.tbar=Ext.Array.merge(f.tbar,f.extraButtons)}if(f.buttonPrint&&!window.isTablet){f.tbar.push("->",{xtype:"splitbutton",glyph:f.glyphPrint,text:f.textPrint,hidden:!f.allowPrint,handler:"onPrint",menu:[{text:f.labelPicture,checked:true,group:"orientation",value:"P",handler:"onPrint"},{text:f.labelLandscape,checked:false,group:"orientation",value:"L",handler:"onPrint"}]})}if(f.buttonCleanFilter){f.tbar.push({iconCls:f.iconClsCleanFilter,text:f.textCleanFilter,scope:f,handler:f.cleanFilters})}if(f.pagination){f.dockedItems=[{xtype:"pagingtoolbar",dock:f.dockPagination,store:f.store,displayInfo:f.displayInfoPagination,items:f.paginationButton},{xtype:"toolbar",dock:f.dockPagination,items:f.buttonsTbar,hidden:!f.buttonsTbar.length}]}f.features=[{ftype:"filters",id:"filters",local:!f.remoteFilter},{ftype:"grouping",enableGroupingMenu:f.grupableColumns,groupHeaderTpl:t("Column")+': {columnName} -> {name} ({rows.length} Item{[values.rows.length > 1 ? "s" : ""]})'}];f.on("render",f.applyDefaultColumns,f);Ext.grid.Panel.prototype.initComponent.apply(this,arguments);f.autoLoadList&&!window.isDesktop&&f.getStore().load({scope:f,callback:function(){f.view.refresh()}})},getExtraFilterClass:function(b){switch(b){case"auto":b="string";break;case"int":case"float":b="numeric";break;case"bool":b="boolean";break}return Ext.ClassManager.getByAlias("gridfilter."+b)},addExtraFilter:function(d){var f=this,e=f.getView().getFeature("filters");d.button.toggle(d.active);e.extraFilters=f.getFilterData();f.deferredUpdate.delay(d.type==="string"?0:e.updateBuffer)},clearExtraFilters:function(){var d=this,c=d.cmpExtraFilters.query("splitbutton[pressed=true]");Ext.each(c,function(a){a.toggle(false,true);a.filter.setActive(false)})},getFilterData:function(){var g=this,j=[],e,f;Ext.each(g.cmpsExtraFilters,function(b){if(b.active){var a=[].concat(b.serialize());for(e=0,f=a.length;e",{xtype:"label",text:c.timeFormat=="h"?"12:00 AM":"00:00"},"->"]}],items:[c.hourSlider,c.minuteSlider],onMouseDown:function(a){a.preventDefault()}});Ext.picker.Date.prototype.initComponent.call(this);c.ownerCt=c.up("[floating]");c.timePicker.ownerCt=c.ownerCt;c.registerWithOwnerCt();c.timePicker.registerWithOwnerCt();c.setValue(new Date(d));c.hourSlider.addListener("change",c.changeTimeValue,c);c.minuteSlider.addListener("change",c.changeTimeValue,c)},onShow:function(){var b=this;b.showTimePicker();Ext.picker.Date.prototype.onShow.call(this)},showTimePicker:function(){var f=this,d=f.el,e=f.timePicker;Ext.defer(function(){var b=Ext.getBody(),c=b.getViewSize().width,a=(c<(d.getX()+d.getWidth()+140))?(d.getX()-140):(d.getX()+d.getWidth()+10);f.timePicker.setHeight(d.getHeight());f.timePicker.setPosition(a,d.getY());f.timePicker.show()},1)},handleTabClick:function(b){this.handleDateClick(b,this.activeCell.firstChild,true)},getSelectedDate:function(v){var s=this,o=Ext.Date.clearTime(v,true).getTime(),n=s.cells,c=s.selectedCls,q=n.elements,r=q.length,p,u;n.removeCls(c);for(u=0;u=f.F1&&d<=f.F12)&&!f.isNavKeyPress()){if(this.inputEl.dom.selectionStart===0&&this.inputEl.dom.selectionEnd===this.inputEl.dom.value.length){this.hiddenField.dom.value=this.money?0:""}if(!e.isBackspace){if(this.money){this.hiddenField.dom.value=String(this.hiddenField.dom.value)+String(e.pressedKey);this.hiddenField.dom.value=this.hiddenField.dom.value.replace(/[.]/g,"");this.hiddenField.dom.value=this.textMask.parsePrecision(this.hiddenField.dom.value,this.textMask.moneyPrecision);this.hiddenField.dom.value=this.textMask.unmask(this.hiddenField.dom.value)}else{this.hiddenField.dom.value=this.textMask.unmask(this.hiddenField.dom.value+e.pressedKey)}}this.inputEl.dom.value=this.textMask.mask(this.hiddenField.dom.value);this.inputEl.dom.selectionStart=this.textMask.getLength(this.hiddenField.dom.value);this.inputEl.dom.selectionEnd=this.inputEl.dom.selectionStart;f.preventDefault()}},simpleUpdateHidden:function(b){if(this.readOnly||this.useMask){return false}this.hiddenField.dom.value=this.inputEl.dom.value},getValue:function(){if(this.returnWithMask){return this.getValueWithMask()}else{return this.getValueWithoutMask()}},getValueWithMask:function(){return this.inputEl.dom.value},getValueWithoutMask:function(){if(this.hiddenField){return this.hiddenField.dom.value}else{return""}},getRawValue:function(){return this.getValue()},setValue:function(b){b=!Ext.isDefined(b)?"":b;if(this.useMask&&!Ext.isEmpty(b)){if(this.inputEl){this.hiddenField.dom.value=this.textMask.unmask(b);this.inputEl.dom.value=this.textMask.mask(b)}this.value=this.textMask.unmask(b)}else{if(this.inputEl){this.hiddenField.dom.value=b;this.inputEl.dom.value=b}this.value=b}},setDateValue:function(b){if(b==="now"){b=new Date()}if(this.inputEl){b=this.formatDate(this.parseDate(b));this.hiddenField.dom.value=b;this.inputEl.dom.value=this.textMask.mask(b)}this.value=b},setMask:function(b){this.textMask.setMask(b);this.setValue(this.hiddenField.dom.value)}},0,0,0,0,["plugin.textmask"],0,[Ext.ux,"TextMaskPlugin"],0));(Ext.cmd.derive("Ext.ux.form.field.Money",Ext.form.field.Text,{mask:t("maskMoney"),money:true,initComponent:function(){var b=this;b.plugins=["textmask","markallowblank"];Ext.form.field.Text.prototype.initComponent.apply(this,arguments)}},0,["moneyfield"],["component","box","field","textfield","moneyfield"],{component:true,box:true,field:true,textfield:true,moneyfield:true},["widget.moneyfield"],0,[Ext.ux.form.field,"Money"],0));(Ext.cmd.derive("Ext.ux.form.Panel",Ext.form.Panel,{bodyPadding:5,autoScroll:true,border:false,allowCreate:true,allowUpdate:true,defaultType:"textfield",layout:"anchor",idRecord:0,textNew:t("New"),glyphNew:icons.file,textSave:t("Save"),glyphSave:icons.disk,textCancel:t("Cancel"),glyphCancel:icons.stop,alignButtonsBottom:"->",defaults:{plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true},buttonsTbar:[],labelWidthFields:100,labelAlignFields:"right",header:window.isTablet||window.isTablets?false:"",initComponent:function(){var j=this;var e=j.xtype.slice(0,-4);if(j.items&&App.user.isAdmin&&App.user.show_filed_help==true){if(j.items[0].xtype=="tabpanel"){j.items[0].items.forEach(function(a){a.items.forEach(function(b){if(b.xtype=="fieldcontainer"){b.items.forEach(function(d){var m=h(e+"."+d.name);if(m.length>10){d.fieldLabel=d.fieldLabel+" "+m}})}else{if(b.xtype=="fieldset"){b.items.forEach(function(d){var m=h(e+"."+d.name);if(m.length>10){d.fieldLabel=d.fieldLabel+" "+m}})}else{var c=h(e+"."+b.name);if(c.length>10){b.fieldLabel=b.fieldLabel+" "+c}}}})})}else{for(var f in j.items){var g=h(e+"."+j.items[f].name);if(g.length>10){j.items[f].fieldLabel=j.items[f].fieldLabel+" "+g}}}}Ext.applyIf(j.defaults,{anchor:"0",enableKeyEvents:true,labelAlign:j.labelAlignFields,labelWidth:j.labelWidthFields,msgTarget:"side",plugins:"markallowblank",allowBlank:false});j.dockedItems=[];itemsTbar=j.buttonsTbar.length?j.buttonsTbar:[{xtype:"tbtext"},j.alignButtonsBottom,{reference:"save",text:j.textSave,width:90,glyph:j.glyphSave,handler:"onSave"},{text:j.textCancel,width:90,glyph:j.glyphCancel,handler:"onCancel"}];j.hideTbar=Ext.isDefined(j.hideTbar)?j.hideTbar:!j.allowCreate;j.hideBbar=!j.allowCreate&&!j.allowUpdate;j.dockedItems=[{xtype:"toolbar",hidden:j.hideBbar,dock:"bottom",items:itemsTbar}];Ext.form.Panel.prototype.initComponent.apply(this,arguments)}},0,0,["component","box","container","panel","form"],{component:true,box:true,container:true,panel:true,form:true},0,0,[Ext.ux.form,"Panel"],0));(Ext.cmd.derive("MBilling.view.groupModule.Form",Ext.ux.form.Panel,{items:[{xtype:"groupusercombo"},{xtype:"modulecombo"}]},0,["groupmoduleform"],["component","box","container","panel","form","groupmoduleform"],{component:true,box:true,container:true,panel:true,form:true,groupmoduleform:true},["widget.groupmoduleform"],0,[MBilling.view.groupModule,"Form"],0));(Ext.cmd.derive("MBilling.view.module.Combo",Ext.form.field.ComboBox,{name:"id_module",fieldLabel:t("Module"),displayField:"text",valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Module",{proxy:{type:"uxproxy",module:"module",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["modulecombo"],["component","box","field","textfield","pickerfield","combobox","combo","modulecombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,modulecombo:true},["widget.modulecombo"],0,[MBilling.view.module,"Combo"],0));(Ext.cmd.derive("MBilling.view.groupModule.Field",Ext.form.FieldContainer,{layout:"fit",name:"id_module",fieldLabel:t("Modules"),moduleText:t("Module"),showMenuText:t("Show Menu"),showDesktopText:t("Show Desktop"),showQuickInitText:t("Show Quick Init."),readText:t("Read"),createText:t("Create"),updateText:t("Update"),deleteText:t("Delete"),actionsText:t("Actions"),blankText:t("This field is required"),itemExistsText:t("This item already exists"),subFieldsName:{module:"id_module",moduleText:"idModuletext",showMenu:"show_menu",showDesktop:"createShortCut",showQuickInit:"createQuickStart",actions:"action"},initComponent:function(){var c=this,d;c.items=c.initGrid();Ext.form.FieldContainer.prototype.initComponent.apply(this,arguments)},afterRender:function(){var b=this;Ext.form.FieldContainer.prototype.afterRender.apply(this,arguments);b.setValue(b.value)},initGrid:function(){var d=this,e={},f;d.store=Ext.create("MBilling.store.GroupModule",{remoteSort:false});d.moduleCombo=Ext.widget("modulecombo",{hideLabel:true,allowBlank:false,validator:Ext.bind(d.checkModuleExists,d)});d.grid=Ext.widget("grid",{style:d.allowBlank===false?"border-left: 3px solid red":"",store:d.store,plugins:{ptype:"rowediting",pluginId:"rowEditor",listeners:{scope:d,beforeedit:d.onBeforeEdit,edit:d.onEdit,canceledit:d.onCancelEdit}},tbar:[{glyph:icons.file,scope:d,text:t("Add permissions for this group"),handler:function(){f=d.grid.getPlugin("rowEditor");if(!d.isUpdate&&f.editing){d.moduleCombo.focus();return false}d.moduleCombo.reset();e[d.subFieldsName.showMenu]=1;e[d.subFieldsName.showDesktop]=0;e[d.subFieldsName.showQuickInit]=0;d.addItem(e,0);f.startEdit(0,0);d.isUpdate=false;d.recordEditing=null}}],columns:[{xtype:"templatecolumn",flex:7,tpl:"{"+d.subFieldsName.moduleText+"}",header:d.moduleText,dataIndex:d.subFieldsName.module,editor:d.moduleCombo},{header:d.actionsText,flex:7,dataIndex:d.subFieldsName.actions,scope:d,renderer:d.rendererActions,editor:{xtype:"combo",multiSelect:true,store:[["c",d.createText],["r",d.readText],["u",d.updateText],["d",d.deleteText]]}},{xtype:"booleancolumn",flex:6,header:d.showMenuText,dataIndex:d.subFieldsName.showMenu,editor:{xtype:"checkbox"}},{xtype:"booleancolumn",flex:6,header:d.showDesktopText,dataIndex:d.subFieldsName.showDesktop,editor:{xtype:"checkbox"}},{xtype:"booleancolumn",flex:6,header:d.showQuickInitText,dataIndex:d.subFieldsName.showQuickInit,editor:{xtype:"checkbox"}},{xtype:"actioncolumn",flex:1,menuDisabled:true,iconCls:"icon-delete",tooltip:d.deleteText,handler:Ext.bind(d.removeItem,d),editRenderer:function(){return}}]});return d.grid},rendererActions:function(j){var e=this,f=Ext.isString(j)?j.split(""):j,g=[];Ext.each(f,function(a){switch(a){case"c":g.push(e.createText);break;case"r":g.push(e.readText);break;case"u":g.push(e.updateText);break;case"d":g.push(e.deleteText);break}},e);return g.join(", ")},onBeforeEdit:function(o,g){var n=this,j=g.record,l=n.subFieldsName.actions,m=j.get(l);j.set(l,Ext.isString(m)?m.split(""):undefined);n.isUpdate=j.get(n.subFieldsName.module)>0;n.recordEditing=n.isUpdate?j:null},onEdit:function(m,f){var l=this,g=f.record,j=l.subFieldsName.actions;g.set(j,g.get(j).join(""));g.set("idModuletext","t('"+l.moduleCombo.getRawValue()+"')");g.commit()},onCancelEdit:function(o,g){var n=this,j=g.record,l=n.subFieldsName.actions,m=j.get(l);n.isUpdate?j.set(l,m&&m.join("")):n.store.removeAt(g.rowIdx);j.commit()},addItem:function(f,e){var d=this;f=f||{};Ext.isDefined(e)?d.store.insert(e,Ext.clone(f)):d.store.add(Ext.clone(f))},removeItem:function(e,g){var j=this,f=j.store.getAt(g);j.store.remove(f)},getErrors:function(){var d=this,f=[],e;if(d.allowBlank){return f}if(!d.getValue().length){f.push(d.blankText);return f}return f},reset:function(){this.store.removeAll()},setValue:function(d){var c=this;c.reset();Ext.each(d,function(a){c.addItem(a)},c)},getValue:function(){var m=this,g=[],l={},j,f;m.store.each(function(a){f=a.get(m.subFieldsName.module);if(f){l[m.subFieldsName.module]=f;l[m.subFieldsName.showMenu]=a.get(m.subFieldsName.showMenu);l[m.subFieldsName.showDesktop]=a.get(m.subFieldsName.showDesktop);l[m.subFieldsName.showQuickInit]=a.get(m.subFieldsName.showQuickInit);l[m.subFieldsName.actions]=a.get(m.subFieldsName.actions);g.push(Ext.clone(l))}});return g},getSubmitData:function(){var d=this,c={};c[d.getName()]=Ext.encode(d.getValue());return c},checkModuleExists:function(){var f=this,d=f.moduleCombo.getValue(),e=f.recordEditing&&f.recordEditing.get(f.subFieldsName.module);if(!d){return true}if(f.isUpdate&&(e!==d)&&f.store.find(f.subFieldsName.module,d)!==-1){return f.itemExistsText}else{if(!f.isUpdate&&f.store.find(f.subFieldsName.module,d)!==-1){return f.itemExistsText}}return true}},0,["groupmodulefield"],["component","box","container","fieldcontainer","groupmodulefield"],{component:true,box:true,container:true,fieldcontainer:true,groupmodulefield:true},["widget.groupmodulefield"],[["field",Ext.form.field.Field]],[MBilling.view.groupModule,"Field"],0));(Ext.cmd.derive("MBilling.view.groupUser.Controller",Ext.ux.app.ViewController,{onEdit:function(){var b=this;b.lookupReference("generalTab").show();Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)},onSelectionChange:function(e,j){var g=this,f=g.lookupReference("buttonCloneGroup");f&&f.setDisabled(!j.length);Ext.ux.app.ViewController.prototype.onSelectionChange.apply(this,arguments)},onCloneGroupUser:function(e){var f=this,d=f.list.getSelectionModel().getSelection()[0];if(f.list.getSelectionModel().getSelection().length==1){Ext.Ajax.request({url:"index.php/groupUser/clone",params:{id:d.get("id")},scope:f,success:function(a){a=Ext.decode(a.responseText);if(a[f.nameSuccessRequest]){Ext.ux.Alert.alert(f.titleSuccess,a[f.nameMsgRequest],"success")}else{Ext.ux.Alert.alert(f.titleError,a[f.nameMsgRequest],"error")}}})}else{Ext.ux.Alert.alert(f.titleError,"Please Select only a record","notification")}f.store.load()}},0,0,0,0,["controller.groupuser"],0,[MBilling.view.groupUser,"Controller"],0));(Ext.cmd.derive("MBilling.view.groupUser.Module",Ext.ux.panel.Module,{controller:"groupuser",cfgEast:{flex:9}},0,["groupusermodule"],["component","box","container","uxpanelmodule","groupusermodule"],{component:true,box:true,container:true,uxpanelmodule:true,groupusermodule:true},["widget.groupusermodule"],0,[MBilling.view.groupUser,"Module"],0));(Ext.cmd.derive("MBilling.view.groupUser.List",Ext.ux.grid.Panel,{store:"GroupUser",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.allowPrint=false;b.buttonCsv=false;b.extraButtons=[{text:t("Clone")+" "+t("Group"),handler:"onCloneGroupUser",width:100,reference:"buttonCloneGroup",disabled:true}];b.columns=[{text:t("Id"),dataIndex:"id",hidden:true,hideable:App.user.isAdmin},{text:t("Name"),dataIndex:"name"},{xtype:"templatecolumn",tpl:"{idUserTypename}",header:t("User Type"),renderer:function(a){a=a==1?t("admin"):a==2?t("agent"):t("user");return a},dataIndex:"id_user_type",comboFilter:"usertypecombo"}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["groupuserlist"],["component","box","container","panel","tablepanel","gridpanel","grid","groupuserlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,groupuserlist:true},["widget.groupuserlist"],0,[MBilling.view.groupUser,"List"],0));(Ext.cmd.derive("Ext.ux.form.field.Permission",Ext.form.FieldContainer,{layout:"fit",border:1,style:{borderColor:"#cecece",borderStyle:"solid"},name:"id_module",moduleText:t("Module"),showMenuText:t("Menu"),showDesktopText:t("Desktop"),showQuickInitText:t("Quick Init."),createText:t("Create"),updateText:t("Update"),deleteText:t("Delete"),blankText:t("This field is required"),urlReadTree:"index.php/module/readTree",rootPropertyRead:"rows",fieldsMap:{idModule:"id_module",action:"action",showMenu:"show_menu",showDesktop:"createShortCut",showQuickInit:"createQuickStart"},initComponent:function(){var b=this;b.items=b.initTreeGrid();Ext.form.FieldContainer.prototype.initComponent.apply(this,arguments)},initTreeGrid:function(){var me=this,listenersCheckColumns={scope:me,checkchange:me.onCheckColumn};me.treeStore=Ext.create("Ext.data.TreeStore",{proxy:{type:"ajax",url:me.urlReadTree,reader:{type:"json",rootProperty:me.rootPropertyRead},extraParams:me.extraParamsRead},fields:[{name:"text",convert:function(v){return(v.indexOf("t(")!==-1)?eval(v):v}},"iconCls",{name:"create",type:"boolean"},{name:"update",type:"boolean"},{name:"delete",type:"boolean"},{name:"show_menu",type:"boolean"},{name:"createShortCut",type:"boolean"},{name:"createQuickStart",type:"boolean"}],remoteSort:false,defaultRootProperty:me.rootPropertyRead});me.treeGrid=Ext.widget("treepanel",{style:me.allowBlank===false?"border-left: 3px solid red":"",useArrows:true,rootVisible:false,store:me.treeStore,listeners:{scope:me,checkchange:me.onCheckModule},columns:[{xtype:"treecolumn",text:me.moduleText,flex:3,dataIndex:"text"},{xtype:"checkcolumn",text:me.showMenuText,flex:1,dataIndex:"show_menu",listeners:{checkchange:me.onCheckMenu}},{xtype:"checkcolumn",text:me.createText,flex:1,dataIndex:"create",listeners:listenersCheckColumns},{xtype:"checkcolumn",text:me.updateText,flex:1,dataIndex:"update",listeners:listenersCheckColumns},{xtype:"checkcolumn",text:me.deleteText,flex:1,dataIndex:"delete",listeners:listenersCheckColumns},{xtype:"checkcolumn",text:me.showDesktopText,flex:1,dataIndex:"createShortCut",listeners:listenersCheckColumns},{xtype:"checkcolumn",text:me.showQuickInitText,flex:1,dataIndex:"createQuickStart",listeners:listenersCheckColumns}]});return me.treeGrid},onCheckMenu:function(f,g,j,e){if(!j){return}e.set("checked",true);e.parentNode.set(f.dataIndex,true);e.parentNode.set("checked",true)},onCheckColumn:function(f,g,j,e){if(j){e.set("checked",true);e.parentNode.set("checked",true)}if(e.isLeaf()){return}e.cascadeBy(function(a){a.set(f.dataIndex,j);if(j){a.set("checked",true);a.parentNode.set("checked",true)}})},onCheckModule:function(f,d){var e=this;d?(f.parentNode&&!f.parentNode.get("checked")&&f.parentNode.set("checked",true)):e.resetNode(f);if(f.isLeaf()){return}f.cascadeBy(function(a){a.set("checked",d);d?(a.parentNode&&a.parentNode.set("checked",true)):e.resetNode(a)},e)},getErrors:function(){var d=this,c=[];if(d.allowBlank){return c}if(!d.getValue().length){c.push(d.blankText);return c}return c},reset:function(){this.treeStore.load()},resetNode:function(b){b.set({create:false,update:false,"delete":false,show_menu:false,createShortCut:false,createQuickStart:false,checked:false});b.commit()},setValue:function(f){var m=this,j,l,g;m.treeStore.load({scope:m,callback:function(){m.setLoading(true);Ext.each(f,function(a){j=m.treeStore.getRootNode().findChild("id",parseInt(a[m.fieldsMap.idModule]),true);l=a[m.fieldsMap.action]||[];g=j.isLeaf();j.set({create:g&&l.indexOf("c")!==-1,update:g&&l.indexOf("u")!==-1,"delete":g&&l.indexOf("d")!==-1,show_menu:a[m.fieldsMap.showMenu]==1,createShortCut:g&&a[m.fieldsMap.showDesktop]==1,createQuickStart:g&&a[m.fieldsMap.showQuickInit]==1,checked:true});j.commit()});m.setLoading(false)}})},getValue:function(){var e=this,j={},f=[],g;this.treeStore.getRootNode().cascadeBy(function(a){if(a.get("checked")&&!a.isRoot()){g=[];j={};a.get("create")&&g.push("c");g.push("r");a.get("update")&&g.push("u");a.get("delete")&&g.push("d");j[e.fieldsMap.idModule]=a.getId();j[e.fieldsMap.action]=g.join("");j[e.fieldsMap.showMenu]=a.get("show_menu")?1:0;j[e.fieldsMap.showDesktop]=a.get("createShortCut")?1:0;j[e.fieldsMap.showQuickInit]=a.get("createQuickStart")?1:0;f.push(Ext.clone(j))}});return f}},0,["permissionfield"],["component","box","container","fieldcontainer","permissionfield"],{component:true,box:true,container:true,fieldcontainer:true,permissionfield:true},["widget.permissionfield"],[["field",Ext.form.field.Field]],[Ext.ux.form.field,"Permission"],0));(Ext.cmd.derive("MBilling.view.groupUser.Form",Ext.ux.form.Panel,{header:false,initComponent:function(){var b=this;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true}},items:[{title:t("general"),reference:"generalTab",items:[{name:"id",fieldLabel:t("Id"),disabled:true,hidden:true},{name:"name",fieldLabel:t("Name"),maxLength:100},{xtype:"usertypecombo"}]},{title:t("Permissions"),items:[{xtype:"permissionfield",hideLabel:true,anchor:"100% "+(!Ext.Boot.platformTags.desktop?"82%":window.isThemeNeptune?"87%":"89%"),allowBlank:true}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["groupuserform"],["component","box","container","panel","form","groupuserform"],{component:true,box:true,container:true,panel:true,form:true,groupuserform:true},["widget.groupuserform"],0,[MBilling.view.groupUser,"Form"],0));(Ext.cmd.derive("MBilling.view.groupUser.Combo",Ext.form.field.ComboBox,{name:"id_group",fieldLabel:t("IdGroup"),displayField:"name",valueField:"id",forceSelection:true,editable:false,initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.GroupUser",{proxy:{type:"uxproxy",module:"groupUser",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["groupusercombo"],["component","box","field","textfield","pickerfield","combobox","combo","groupusercombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,groupusercombo:true},["widget.groupusercombo"],0,[MBilling.view.groupUser,"Combo"],0));(Ext.cmd.derive("MBilling.view.groupUser.AgentUSerCombo",Ext.form.field.ComboBox,{name:"id_group_agent",fieldLabel:t("GroupUser"),displayField:"name",forceSelection:true,editable:false,valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.GroupUser",{proxy:{type:"uxproxy",module:"groupUser",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["groupuseragentcombo"],["component","box","field","textfield","pickerfield","combobox","combo","groupuseragentcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,groupuseragentcombo:true},["widget.groupuseragentcombo"],0,[MBilling.view.groupUser,"AgentUSerCombo"],0));(Ext.cmd.derive("MBilling.view.groupUser.Tag",Ext.form.field.Tag,{name:"id_group",fieldLabel:t("GroupUser"),displayField:"name",valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.GroupUser",{proxy:{type:"uxproxy",module:"plan",limitParam:undefined}});Ext.form.field.Tag.prototype.initComponent.apply(this,arguments)}},0,["groupusertag"],["component","box","field","textfield","pickerfield","combobox","combo","tagfield","groupusertag"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,tagfield:true,groupusertag:true},["widget.groupusertag"],0,[MBilling.view.groupUser,"Tag"],0));(Ext.cmd.derive("MBilling.view.module.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.module"],0,[MBilling.view.module,"Controller"],0));(Ext.cmd.derive("MBilling.view.module.Module",Ext.ux.panel.Module,{controller:"module"},0,["modulemodule"],["component","box","container","uxpanelmodule","modulemodule"],{component:true,box:true,container:true,uxpanelmodule:true,modulemodule:true},["widget.modulemodule"],0,[MBilling.view.module,"Module"],0));(Ext.cmd.derive("MBilling.view.module.List",Ext.ux.grid.Panel,{store:"Module",initComponent:function(){var b=this;b.columns=[{text:t("Id"),dataIndex:"id"},{text:t("Text"),dataIndex:"text"},{text:t("Module"),dataIndex:"module"},{text:t("IconCls"),dataIndex:"icon_cls"},{xtype:"templatecolumn",tpl:"{idModuletext}",text:t("Module Owner"),dataIndex:"id_module",comboFilter:"modulecombo"}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["modulelist"],["component","box","container","panel","tablepanel","gridpanel","grid","modulelist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,modulelist:true},["widget.modulelist"],0,[MBilling.view.module,"List"],0));(Ext.cmd.derive("MBilling.view.module.Form",Ext.ux.form.Panel,{items:[{name:"id",fieldLabel:t("Id"),disabled:true},{name:"text",fieldLabel:t("Text"),maxLength:100},{name:"module",fieldLabel:t("Module"),allowBlank:true,maxLength:100},{name:"icon_cls",fieldLabel:t("IconCls"),allowBlank:true,maxLength:100},{xtype:"modulecombo",fieldLabel:t("Module Owner"),allowBlank:true}]},0,["moduleform"],["component","box","container","panel","form","moduleform"],{component:true,box:true,container:true,panel:true,form:true,moduleform:true},["widget.moduleform"],0,[MBilling.view.module,"Form"],0));(Ext.cmd.derive("MBilling.view.module.Tag",Ext.form.field.Tag,{name:"id_module",fieldLabel:t("Module"),displayField:"text",valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Module",{proxy:{type:"uxproxy",module:"plan",limitParam:undefined}});Ext.form.field.Tag.prototype.initComponent.apply(this,arguments)}},0,["moduletag"],["component","box","field","textfield","pickerfield","combobox","combo","tagfield","moduletag"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,tagfield:true,moduletag:true},["widget.moduletag"],0,[MBilling.view.module,"Tag"],0));(Ext.cmd.derive("MBilling.view.userType.Combo",Ext.form.field.ComboBox,{name:"id_user_type",fieldLabel:t("userType"),displayField:"name",valueField:"id",value:1,store:[[1,t("admin")],[2,t("agent")],[3,t("client")]]},0,["usertypecombo"],["component","box","field","textfield","pickerfield","combobox","combo","usertypecombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,usertypecombo:true},["widget.usertypecombo"],0,[MBilling.view.userType,"Combo"],0));(Ext.cmd.derive("MBilling.view.user.Controller",Ext.ux.app.ViewController,{groupIsAdmin:false,init:function(){var b=this;b.control({groupusercombo:{select:b.onSelectType}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectType:function(c,d){this.showFieldsRelated(d.getData().showFields)},showFieldsRelated:function(j){var l=this,g=l.formPanel.getForm().getFields(),f=l.formPanel.getForm().findField("id_group_agent"),m=l.formPanel.getForm();l.onGetUserType(l.formPanel.getForm().findField("id_group").getValue(),function(a){l.groupIsAdmin=a;l.formPanel.getForm().findField("id_plan").setVisible(!a);l.formPanel.getForm().findField("id_plan").setAllowBlank(a);l.formPanel.getForm().findField("id_offer").setVisible(!a);l.formPanel.getForm().findField("prefix_local").setVisible(!a)});g.each(function(a){if(a.name=="id_group"){filterGroupp=Ext.encode([{type:"numeric",comparison:"eq",value:2,field:"id_user_type"}]),Ext.Ajax.request({url:"index.php/groupUser/index",params:{filter:filterGroupp},success:function(b){b=Ext.decode(b.responseText);var c=b.rows;for(i=0;i1){c.formPanel.getForm().findField("id_plan")["hide"]();fieldGroup.readOnly=true}else{c.formPanel.getForm().findField("id_plan")["show"]();fieldGroup.readOnly=false}}Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments);c.onGetUserType(d.get("id_group"),function(a){c.formPanel.getForm().findField("password").setVisible(!a);c.formPanel.getForm().findField("id_plan").setVisible(!a);c.formPanel.getForm().findField("id_plan").setAllowBlank(a);c.formPanel.getForm().findField("id_offer").setVisible(!a);c.formPanel.getForm().findField("prefix_local").setVisible(!a)});if(fieldGroup.value==2){fieldGroupAgent.show()}else{fieldGroupAgent.hide()}},onGetUserType:function(d,c){filterGroupp=Ext.encode([{type:"numeric",comparison:"eq",value:d,field:"id"}]),Ext.Ajax.request({url:"index.php/groupUser/getUserType",params:{filter:filterGroupp},success:function(a){a=Ext.decode(a.responseText);c(a.rows)}})},onDelete:function(d){var f=this,e;notDelete=false;Ext.each(f.list.getSelectionModel().getSelection(),function(a){if(a.get("id")==1){Ext.ux.Alert.alert(f.titleError,t("You cannot delete the")+" user id 1","error");notDelete=true}});if(notDelete==false){Ext.ux.app.ViewController.prototype.onDelete.apply(this,arguments)}}},0,0,0,0,["controller.user"],0,[MBilling.view.user,"Controller"],0));(Ext.cmd.derive("MBilling.view.user.Combo",Ext.form.field.ComboBox,{name:"id_user",fieldLabel:t("username"),displayField:"username",forceSelection:true,editable:false,valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.User",{proxy:{type:"uxproxy",module:"user",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["usercombo"],["component","box","field","textfield","pickerfield","combobox","combo","usercombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,usercombo:true},["widget.usercombo"],0,[MBilling.view.user,"Combo"],0));(Ext.cmd.derive("MBilling.view.user.Module",Ext.ux.panel.Module,{controller:"user",cfgEast:{flex:4}},0,["usermodule"],["component","box","container","uxpanelmodule","usermodule"],{component:true,box:true,container:true,uxpanelmodule:true,usermodule:true},["widget.usermodule"],0,[MBilling.view.user,"Module"],0));(Ext.cmd.derive("MBilling.view.user.List",Ext.ux.grid.Panel,{store:"User",fieldSearch:"username",initComponent:function(){var b=this;b.extraButtons=[{text:t("Bulk")+" "+t("User"),handler:"onBulk",width:100,disabled:false,hidden:App.user.isClient||!b.allowCreate}];b.columns=b.columns||[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("username"),dataIndex:"username",flex:2},{header:t("lastname"),dataIndex:"lastname",flex:3},{header:t("firstname"),dataIndex:"firstname",flex:3},{header:t("email"),dataIndex:"email",flex:window.isTablet?3:4},{header:t("credit"),dataIndex:"credit",renderer:Helper.Util.formatMoneyDecimal,flex:2},{xtype:"templatecolumn",tpl:"{idPlanname}",header:t("plan"),dataIndex:"id_plan",comboFilter:"plancombo",flex:3},{xtype:"templatecolumn",tpl:"{idGroupname}",header:t("group"),dataIndex:"id_group",comboFilter:"groupusercombo",flex:2,hidden:App.user.isClient||App.user.isAgent||window.isTablet,hideable:!App.user.isClient&&!App.user.isAgent},{header:t("agent"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:2,hidden:!App.user.isAdmin||window.isTablet,hideable:App.user.isAdmin},{header:t("status"),dataIndex:"active",renderer:Helper.Util.formatBooleanActive,flex:2,filter:{type:"list",options:[[1,t("active")],[2,t("pending")],[0,t("inactive")]]},hidden:App.user.isClient||window.isTablet,hideable:!App.user.isClient},{header:t("creationdate"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"creationdate",flex:4},{dataIndex:"id_offer",header:t("offer"),flex:2,hidden:true,hideable:!App.user.isClient&&!App.user.isAgent},{header:t("typepaid"),dataIndex:"typepaid",flex:2,renderer:Helper.Util.formattypepaid,filter:{type:"list",options:[[0,t("prepaid")],[1,t("pospaid")]]},hidden:true,hideable:!App.user.isClient&&!App.user.isAgent},{header:t("city"),dataIndex:"city",hidden:true,hideable:!App.user.isClient&&!App.user.isAgent,flex:1},{header:t("state"),dataIndex:"state",hidden:true,hideable:!App.user.isClient&&!App.user.isAgent,flex:1},{header:t("country"),dataIndex:"country",hidden:true,hideable:!App.user.isClient&&!App.user.isAgent,flex:1},{header:t("zipcode"),dataIndex:"zipcode",hidden:true,hideable:!App.user.isClient&&!App.user.isAgent,flex:1},{header:t("phone"),dataIndex:"phone",hidden:true,hideable:!App.user.isClient&&!App.user.isAgent,flex:1},{header:t("creditlimit"),dataIndex:"creditlimit",hidden:true,hideable:!App.user.isClient&&!App.user.isAgent,flex:1},{header:t("record_call"),dataIndex:"record_call",flex:1,renderer:Helper.Util.formattyyesno,filter:{type:"list",options:[[0,t("no")],[1,t("yes")]]},hidden:true,hideable:!App.user.isClient&&!App.user.isAgent},{header:t("CPS Limit"),dataIndex:"cpslimit",hidden:true,hideable:window.dialC&&App.user.isAdmin,flex:2}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["userlist"],["component","box","container","panel","tablepanel","gridpanel","grid","userlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,userlist:true},["widget.userlist"],0,[MBilling.view.user,"List"],0));(Ext.cmd.derive("MBilling.view.user.Form",Ext.ux.form.Panel,{autoHeight:300,bodyPadding:0,fieldsHideUpdateLot:["username","password","id_group_agent","id_offer","callingcard_pin"],initComponent:function(){var b=this;haveServiceMenu=false;Ext.each(App.user.menu,function(a){if(a.text=="t('Services')"){haveServiceMenu=true}});b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{labelAlign:"right",plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true}},items:[{title:t("general"),items:[{name:"username",fieldLabel:t("username"),maxLength:20,minLength:4,readOnly:App.user.isClient},{name:"password",fieldLabel:t("Password"),minLength:6,hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"id_group",fieldLabel:t("IdGroup"),xtype:"groupusercombo",allowBlank:!App.user.isAdmin,hidden:!App.user.isAdmin},{name:"id_group_agent",fieldLabel:t("GroupUser"),xtype:"groupuseragentcombo",emptyText:t("SELECT GROUP FOR AGENT USERS"),fieldLabel:t("Group for Agent Users"),hidden:true,allowBlank:true},{fieldLabel:t("Plan"),name:"id_plan",xtype:"planlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:App.user.isClient},{xtype:"languagecombo",name:"language",value:App.user.language=="pt_BR"?"br":App.user.language,fieldLabel:t("language")},{name:"prefix_local",fieldLabel:t("prefixlocal"),value:App.user.base_country=="BRL"?"0/55,*/5511/8,*/5511/9":App.user.base_country=="ARG"?"0/54,*/5411/8,15/54911/10,16/54911/10":"",allowBlank:true,emptyText:"match / replace / length",hidden:App.user.isClient},{xtype:"statususercombo",name:"active",fieldLabel:t("Active"),hidden:App.user.isClient,allowBlank:App.user.isClient},{xtype:"countrycombo",name:"country",fieldLabel:t("country"),value:App.user.language=="pt_BR"?"55":"1",allowBlank:true},{name:"id_offer",fieldLabel:t("offer"),xtype:"offercombo",allowBlank:true},{xtype:"numberfield",name:"cpslimit",fieldLabel:t("CPS Limit"),value:-1,minValue:-1,maxValue:50,hidden:!window.dialC||!App.user.isAdmin,allowBlank:true}]},{title:t("personalData"),itemId:"personalData",items:[{name:"company_name",fieldLabel:t("company")+" "+t("name"),allowBlank:true},{name:"state_number",fieldLabel:t("state_number"),allowBlank:true,hidden:App.user.base_country=!"BRL"},{name:"lastname",fieldLabel:t("lastname"),allowBlank:true,maxLength:40,minLength:4},{name:"firstname",fieldLabel:t("firstname"),allowBlank:true,maxLength:40,minLength:4},{xtype:"fieldcontainer",layout:"hbox",labelWidth:100,defaults:{xtype:"textfield",labelAlign:"right",flex:1},items:[{name:"city",fieldLabel:t("city"),allowBlank:true,maxLength:40,minLength:4,flex:2},{name:"state",fieldLabel:t("state"),allowBlank:true,maxLength:20,minLength:2}]},{name:"address",fieldLabel:t("address"),allowBlank:true},{name:"zipcode",fieldLabel:t("zipcode"),allowBlank:true},{xtype:"fieldcontainer",layout:"hbox",labelWidth:100,defaults:{xtype:"textfield",labelAlign:"right",flex:1},items:[{name:"phone",fieldLabel:t("phone"),allowBlank:true,maxLength:13,minLength:8},{name:"mobile",fieldLabel:t("mobile"),allowBlank:true,maxLength:20,minLength:8}]},{name:"email",fieldLabel:t("email"),allowBlank:true,vtype:"email"},{name:"doc",fieldLabel:t("Doc"),allowBlank:true},{name:"vat",fieldLabel:t("vat"),hidden:App.user.isClient,allowBlank:true}]},{title:t("suplementaryInfo"),itemId:"suplementaryInfo",defaults:{labelAlign:"right",plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true,labelWidth:145},items:[{xtype:"typepaymentcombo",name:"typepaid",fieldLabel:t("typepaid"),allowBlank:true,readOnly:App.user.isClient},{xtype:"fieldcontainer",layout:"hbox",defaults:{xtype:"textfield",labelAlign:"right",labelWidth:145,flex:1},items:[{name:"creditlimit",fieldLabel:t("creditlimit"),value:0,allowBlank:true,readOnly:App.user.isClient,flex:2},{xtype:"numberfield",name:"credit_notification",labelWidth:150,fieldLabel:t("creditnotification"),value:"-1",minValue:-1,allowBlank:true,flex:3}]},{xtype:"fieldcontainer",layout:"hbox",defaults:{xtype:"textfield",labelAlign:"right",labelWidth:145,flex:1},items:[{xtype:"noyescombo",name:"enableexpire",fieldLabel:t("enableexpire"),allowBlank:true,hidden:!App.user.isAdmin,flex:2},{xtype:"datefield",name:"expirationdate",fieldLabel:t("expirationdate"),format:"Y-m-d H:i:s",allowBlank:true,hidden:!App.user.isAdmin,labelWidth:150,flex:3}]},{xtype:"fieldcontainer",layout:"hbox",defaults:{xtype:"textfield",labelAlign:"right",labelWidth:145,flex:1},items:[{xtype:"noyescombo",name:"record_call",fieldLabel:t("record_call"),allowBlank:true,hidden:!haveServiceMenu||!App.user.isAdmin,readOnly:!App.user.isAdmin,flex:2},{labelWidth:150,xtype:"combobox",store:[["gsm",t("gsm")],["wav",t("wav")],["wav49",t("wav49")]],name:"mix_monitor_format",fieldLabel:t("Record call format"),forceSelection:true,editable:false,allowBlank:true,value:"gsm",hidden:!haveServiceMenu,flex:3}]},{xtype:"fieldcontainer",layout:"hbox",labelWidth:145,defaults:{labelAlign:"right",hidden:!haveServiceMenu,readOnly:!App.user.isAdmin,allowBlank:true,flex:1},items:[{labelWidth:145,xtype:"numberfield",name:"calllimit",fieldLabel:t("calllimit"),value:"-1",minValue:-1,flex:2},{labelWidth:150,xtype:"combobox",forceSelection:true,editable:false,name:"calllimit_error",fieldLabel:t("CallLimit Error"),value:"503",store:[["503",t("Congestion")],["403",t("Busy")]],flex:3}]},{xtype:"noyescombo",name:"callshop",fieldLabel:"Callshop",allowBlank:true,hidden:App.user.isClient},{xtype:"numberfield",name:"disk_space",fieldLabel:t("Disk Space"),value:-1,hidden:!haveServiceMenu,minValue:-1,readOnly:!App.user.isAdmin},{name:"sipaccountlimit",xtype:"numberfield",fieldLabel:t("Sip Account Limit"),value:"-1",minValue:-1,allowBlank:!App.user.isAdmin,readOnly:!App.user.isAdmin,hidden:!haveServiceMenu},{xtype:"numberfield",name:"callingcard_pin",fieldLabel:t("lockpin"),minValue:100000,maxLength:6,minLength:6},{xtype:"restrictioncombo",name:"restriction",fieldLabel:t("restriction"),allowBlank:true,hidden:App.user.isClient}]},{title:t("Send Credit"),itemId:"transferData",hidden:!window.transferToMobile,items:[{xtype:"fieldcontainer",layout:"hbox",hidden:App.user.isClient,defaults:{labelAlign:"right",labelWidth:145,allowBlank:true,flex:1},items:[{xtype:"noyescombo",name:"transfer_international",fieldLabel:t("Enable International")},{xtype:"numberfield",name:"transfer_international_profit",labelWidth:120,fieldLabel:t("Profit")}]},{xtype:"fieldcontainer",layout:"hbox",hidden:App.user.isClient,defaults:{labelAlign:"right",labelWidth:145,allowBlank:true,flex:1},items:[{xtype:"noyescombo",name:"transfer_flexiload",fieldLabel:t("Enable Flexiload")},{xtype:"numberfield",name:"transfer_flexiload_profit",labelWidth:120,fieldLabel:t("Profit")}]},{xtype:"fieldcontainer",layout:"hbox",hidden:App.user.isClient,defaults:{labelAlign:"right",labelWidth:145,allowBlank:true,flex:1},items:[{xtype:"noyescombo",name:"transfer_bkash",fieldLabel:t("Enable Bkash")},{xtype:"numberfield",name:"transfer_bkash_profit",labelWidth:120,fieldLabel:t("Profit")}]},{xtype:"fieldcontainer",layout:"hbox",hidden:App.user.isClient,defaults:{labelAlign:"right",labelWidth:145,allowBlank:true,flex:1},items:[{xtype:"noyescombo",name:"transfer_dbbl_rocket",fieldLabel:t("Enable DBBL/Rocket")},{xtype:"numberfield",name:"transfer_dbbl_rocket_profit",labelWidth:120,fieldLabel:t("Profit")}]},{xtype:"numberfield",name:"transfer_bdservice_rate",fieldLabel:t("BDService rate"),minValue:0,hidden:!App.user.isAdmin,allowBlank:true},{xtype:"numberfield",name:"transfer_show_selling_price",fieldLabel:t("show selling price"),allowBlank:true}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["userform"],["component","box","container","panel","form","userform"],{component:true,box:true,container:true,panel:true,form:true,userform:true},["widget.userform"],0,[MBilling.view.user,"Form"],0));(Ext.cmd.derive("Ext.ux.form.field.Lookup",Ext.form.FieldContainer,{layout:"fit",blankText:t("This field is required."),displayField:undefined,valueField:"id",gridConfig:{},windowConfig:{},iconClsSearch:"x-form-search-trigger",layout:"hbox",startX:150,hiddenSearchButton:false,eventsRelay:["dirtychange","validitychange","errorchange","specialkey","blur","keydown","keyup","keypress","change"],initComponent:function(){var b=this;b.store=Ext.data.StoreManager.lookup(b.store||"ext-empty-store");b.items=b.initSubFields();Ext.form.FieldContainer.prototype.initComponent.apply(this,arguments)},initSubFields:function(){var b=this;b.rawField=Ext.widget("textfield",{readOnly:true,flex:1,onClearButtonClick:b.reset,clearButtonScope:b,isFormField:false,listeners:{scope:b,change:b.onChangeRawField},triggers:{clear:{weight:0,cls:"x-form-clear-trigger",hidden:true,clickOnReadOnly:true,handler:b.reset,scope:b}}});b.relayEvents(b.rawField,b.eventsRelay);b.buttonSearch=Ext.widget("button",{iconCls:"ux-gridfilter-text-icon",scope:b,text:t("Search"),handler:b.onClickSearch,hidden:b.hiddenSearchButton});return[b.rawField,b.buttonSearch]},onChangeRawField:function(b){b.getTrigger("clear").show()},onClickSearch:function(e,f){var d=this;if(!d.windowSearch){d.list=Ext.widget(d.gridConfig.xtype,Ext.apply({selType:"checkboxmodel",selModel:{mode:"SINGLE"},allowCreate:false,allowUpdate:false,allowDelete:false,allowPrint:false,autoLoadList:false,buttonCsv:false,extraButtons:[],listeners:{scope:d,selectionchange:d.onSelectionChangeList,itemdblclick:d.onItemDblClick}},d.gridConfig));d.buttonOk=Ext.widget("button",{text:t("Ok"),width:70,disabled:true,glyph:icons.checkmark,scope:d,handler:d.onClickSelect});d.windowSearch=Ext.widget("window",Ext.apply({closeAction:"hide",header:false,layout:"fit",closable:false,resizable:true,draggable:false,baseCls:"x-panel",width:d.rawField.getWidth()+70+d.startX,height:d.rawField.getY()>250?300:Ext.getBody().getViewSize().height-270,items:d.list,bbar:["->",{text:t("Cancel"),glyph:icons.stop,scope:d,handler:function(){d.windowSearch.close()}},d.buttonOk],listeners:{scope:d,show:d.onShowWindowSearch}},d.windowConfig))}else{d.windowSearch.setWidth(d.rawField.getWidth()+23+d.startX)}d.windowSearch.showAt(d.rawField.getX()-d.startX,d.rawField.getY()+23)},onSelectionChangeList:function(d,c){this.recordSelected=c[0];this.buttonOk.setDisabled(!c.length)},onItemDblClick:function(d,c){this.selectRecord(c)},onClickSelect:function(){this.selectRecord()},selectRecord:function(c){var d=this;c=c||d.recordSelected;d.setValue(c.getId(),c.get(d.displayFieldList));d.windowSearch.close();d.list.store.defaultFilter=[];d.list.store.load()},onShowWindowSearch:function(f){var e=this,d=e.list.down("searchfield");d&&d.focus(true,10);!e.list.store.getCount()&&Ext.defer(function(){e.list.store.load()},10)},getErrors:function(){var d=this,c=[];if(d.allowBlank){return c}if(!d.getValue()){c.push(d.blankText);return c}return c},reset:function(){var b=this;b.rawField.reset();b.setValue("");b.rawField.getTrigger("clear").hide();b.rawField.updateLayout()},setValue:function(j,e){var f=this,g=f.ownerForm&&f.ownerForm.getRecord();if(!Ext.isEmpty(j)){e=e||(g&&g.get(f.displayField))}f.value=j;f.rawField.setValue(e||j);f.fireEvent("select",f,j)},getValue:function(){return this.value},getRawValue:function(){return this.rawField.getRawValue()}},0,0,["component","box","container","fieldcontainer"],{component:true,box:true,container:true,fieldcontainer:true},0,[["field",Ext.form.field.Field]],[Ext.ux.form.field,"Lookup"],0));(Ext.cmd.derive("MBilling.view.user.Lookup",Ext.ux.form.field.Lookup,{name:"id_user",fieldLabel:t("User"),displayField:"idUserusername",displayFieldList:"username",gridConfig:{xtype:"userlist",fieldSearch:"username",columns:[{header:t("username"),dataIndex:"username",flex:2},{header:t("email"),dataIndex:"email",flex:2},{header:t("lastname"),dataIndex:"lastname",flex:2},{header:t("credit"),dataIndex:"credit",renderer:Helper.Util.formatMoneyDecimal,flex:2}]}},0,["userlookup"],["component","box","container","fieldcontainer","userlookup"],{component:true,box:true,container:true,fieldcontainer:true,userlookup:true},["widget.userlookup"],0,[MBilling.view.user,"Lookup"],0));(Ext.cmd.derive("MBilling.view.user.Bulk",Ext.window.Window,{autoShow:true,modal:true,layout:"fit",iconCls:"icon-import-csv",title:t("Bulk User"),width:400,height:window.isThemeNeptune||window.isThemeCrisp?295:window.isThemeTriton?390:270,labelWidthFields:120,htmlTipInfo:"",fieldsImport:[],initComponent:function(){var b=this;b.items=[{xtype:"form",bodyPadding:5,defaults:{anchor:"0",enableKeyEvents:true,labelWidth:b.labelWidthFields,msgTarget:"side",plugins:"markallowblank",allowBlank:false},items:[{xtype:"numberfield",value:10,name:"totalToCreate",fieldLabel:t("How many users?")},{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,00",name:"credit",value:0,fieldLabel:t("Add")+" "+t("Refill"),readOnly:App.user.isClient},{xtype:"groupusercombo",allowBlank:!App.user.isAdmin,hidden:!App.user.isAdmin},{xtype:"languagecombo",name:"language",value:App.user.language=="pt_BR"?"br":App.user.language,fieldLabel:t("language")},{xtype:"plancombo",hidden:App.user.isClient,allowBlank:App.user.isClient},{xtype:"textfield",name:"prefix_local",fieldLabel:t("prefixlocal"),value:App.user.base_country=="BRL"?"0/55,*/5511/8,*/5511/9":App.user.base_country=="ARG"?"0/54,*/5411/8,15/54911/10,16/54911/10":"",allowBlank:true,emptyText:"match / replace / length",hidden:App.user.isClient},{xtype:"statususercombo",name:"active",fieldLabel:t("Active"),hidden:App.user.isClient,allowBlank:App.user.isClient}]}];b.title=b.title+(b.titleModule?" - "+b.titleModule:"");b.bbar=[{width:150,iconCls:"icon-import-csv",text:t("Bulk")+" "+t("User"),scope:b,handler:b.onBulk}];Ext.window.Window.prototype.initComponent.apply(this,arguments)},onBulk:function(d){var f=this,e=f.list.store;if(!f.down("form").isValid()){return}f.list.setLoading(true);Ext.Ajax.setTimeout(1000000);f.down("form").submit({url:"index.php/user/bulk",scope:f,success:function(c,b){var a=Ext.decode(b.response.responseText);console.log(a);if(a.success){Ext.ux.Alert.alert(t("Success"),a.msg,"success")}else{Ext.ux.Alert.alert(t("Error"),a.errors,"error")}d.enable();f.list.setLoading(false);e.load();f.close()},failure:function(c,b){console.log(b.response.responseText);if(b.response&&Ext.isObject(b.response.responseText)){var a=Ext.decode(b.response.responseText);Ext.ux.Alert.alert(t("Error1"),a.errors,"error")}else{Ext.ux.Alert.alert(t("Error2"),Ext.decode(b.response.responseText).msg,"error",true,10)}d.enable()}})}},0,["userbulk"],["component","box","container","panel","window","userbulk"],{component:true,box:true,container:true,panel:true,window:true,userbulk:true},["widget.userbulk"],0,[MBilling.view.user,"Bulk"],0));(Ext.cmd.derive("MBilling.view.configuration.Controller",Ext.ux.app.ViewController,{onAfterSave:function(g){var j=this,l=j.formPanel.getForm(),f=l.getRecord(),m=f.data.config_key;g=g||j.formPanel;if(!g.idRecord){g.getForm().reset();j.focusFirstField()}j.saveButton.enable();j.updateLotButton&&j.updateLotButton.toggle(false);g.setLoading(false);j.formPanel.collapse();j.store.load();j.logoutKey(m)},logoutKey:function(d){var c=this;if(d=="licence"||d=="base_language"){localStorage.setItem("day","");localStorage.setItem("lang","")}if(d=="licence"){Ext.Ajax.request({url:"index.php/authentication/logoff",success:function(){App.user.logged=false;location.reload()}})}}},0,0,0,0,["controller.configuration"],0,[MBilling.view.configuration,"Controller"],0));(Ext.cmd.derive("MBilling.view.configuration.Module",Ext.ux.panel.Module,{controller:"configuration"},0,["configurationmodule"],["component","box","container","uxpanelmodule","configurationmodule"],{component:true,box:true,container:true,uxpanelmodule:true,configurationmodule:true},["widget.configurationmodule"],0,[MBilling.view.configuration,"Module"],0));(Ext.cmd.derive("MBilling.view.configuration.List",Ext.ux.grid.Panel,{store:"Configuration",fieldSearch:"config_title",comparisonfilter:"ct",initComponent:function(){var b=this;b.allowPrint=false;b.buttonCsv=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowDelete=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("name"),dataIndex:"config_title"},{header:t("value"),dataIndex:"config_value"}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["configurationlist"],["component","box","container","panel","tablepanel","gridpanel","grid","configurationlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,configurationlist:true},["widget.configurationlist"],0,[MBilling.view.configuration,"List"],0));(Ext.cmd.derive("MBilling.view.configuration.Form",Ext.ux.form.Panel,{items:[{name:"config_value",fieldLabel:t("value"),allowBlank:true},{xtype:"textarea",name:"config_description",fieldLabel:t("description"),height:200,anchor:"100%",readOnly:true}]},0,["configurationform"],["component","box","container","panel","form","configurationform"],{component:true,box:true,container:true,panel:true,form:true,configurationform:true},["widget.configurationform"],0,[MBilling.view.configuration,"Form"],0));(Ext.cmd.derive("MBilling.view.general.BooleanCombo",Ext.form.field.ComboBox,{fieldLabel:t("status"),forceSelection:true,editable:false,value:1,store:[[1,t("active")],[0,t("inactive")]]},0,["booleancombo"],["component","box","field","textfield","pickerfield","combobox","combo","booleancombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,booleancombo:true},["widget.booleancombo"],0,[MBilling.view.general,"BooleanCombo"],0));(Ext.cmd.derive("MBilling.view.general.ServicesTypeCombo",Ext.form.field.ComboBox,{fieldLabel:t("status"),forceSelection:true,editable:false,value:"Custom",store:[["disk_space",t("disk_space")],["sipAccountLimit",t("Sip Account Limit")],["calllimit",t("calllimit")],["Custom",t("Custom")]]},0,["servicestypecombo"],["component","box","field","textfield","pickerfield","combobox","combo","servicestypecombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,servicestypecombo:true},["widget.servicestypecombo"],0,[MBilling.view.general,"ServicesTypeCombo"],0));(Ext.cmd.derive("MBilling.view.general.TypeSipForward",Ext.form.field.ComboBox,{fieldLabel:t("Forward"),forceSelection:true,editable:false,value:"",store:[["",t("")],["undefined",t("Undefined")],["sip",t("SIP")],["ivr",t("IVR")],["queue",t("Queue")],["group",t("Group")],["number",t("Number")],["hangup",t("Hangup")],["custom",t("Custom")]]},0,["typesipforwardcombo"],["component","box","field","textfield","pickerfield","combobox","combo","typesipforwardcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,typesipforwardcombo:true},["widget.typesipforwardcombo"],0,[MBilling.view.general,"TypeSipForward"],0));(Ext.cmd.derive("MBilling.view.general.TypeDestination",Ext.form.field.ComboBox,{fieldLabel:t("type"),forceSelection:true,editable:false,value:"",store:[["",t("")],["undefined",t("Undefined")],["sip",t("SIP")],["ivr",t("IVR")],["queue",t("Queue")],["group",t("Group")],["number",t("Number")],["repeat",t("Repeat IVR")],["hangup",t("Hangup")],["custom",t("Custom")]]},0,["typedestinationcombo"],["component","box","field","textfield","pickerfield","combobox","combo","typedestinationcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,typedestinationcombo:true},["widget.typedestinationcombo"],0,[MBilling.view.general,"TypeDestination"],0));(Ext.cmd.derive("MBilling.view.general.PontoVirgula",Ext.form.field.ComboBox,{fieldLabel:t("status"),forceSelection:true,editable:false,value:",",store:[[",",", ("+t("Comma")+")"],[";","; ("+t("Semicolon")+")"]]},0,["pontovirgulacombo"],["component","box","field","textfield","pickerfield","combobox","combo","pontovirgulacombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,pontovirgulacombo:true},["widget.pontovirgulacombo"],0,[MBilling.view.general,"PontoVirgula"],0));(Ext.cmd.derive("MBilling.view.general.StatusCombo",Ext.form.field.ComboBox,{fieldLabel:t("status"),forceSelection:true,editable:false,value:1,store:[[1,t("active")],[0,t("inactive")],[2,t("pending")],[3,t("sent")],[4,t("blocked")]]},0,["statuscombo"],["component","box","field","textfield","pickerfield","combobox","combo","statuscombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,statuscombo:true},["widget.statuscombo"],0,[MBilling.view.general,"StatusCombo"],0));(Ext.cmd.derive("MBilling.view.general.StatusUserCombo",Ext.form.field.ComboBox,{fieldLabel:t("status"),forceSelection:true,editable:false,value:1,store:[[1,t("active")],[0,t("inactive")],[2,t("pending")]]},0,["statususercombo"],["component","box","field","textfield","pickerfield","combobox","combo","statususercombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,statususercombo:true},["widget.statususercombo"],0,[MBilling.view.general,"StatusUserCombo"],0));(Ext.cmd.derive("MBilling.view.general.CallbackCombo",Ext.form.field.ComboBox,{fieldLabel:t("status"),forceSelection:true,editable:false,value:1,store:[[1,t("active")],[2,t("pending")],[3,t("sent")],[4,t("Not working")],[5,t("Complete")]]},0,["callbackcombo"],["component","box","field","textfield","pickerfield","combobox","combo","callbackcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,callbackcombo:true},["widget.callbackcombo"],0,[MBilling.view.general,"CallbackCombo"],0));(Ext.cmd.derive("MBilling.view.general.TypeNoYes",Ext.form.field.ComboBox,{fieldLabel:t("typepaid"),forceSelection:true,editable:false,value:0,store:[[0,t("no")],[1,t("yes")]]},0,["noyescombo"],["component","box","field","textfield","pickerfield","combobox","combo","noyescombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,noyescombo:true},["widget.noyescombo"],0,[MBilling.view.general,"TypeNoYes"],0));(Ext.cmd.derive("MBilling.view.general.TypeYesNo",Ext.form.field.ComboBox,{fieldLabel:t("typepaid"),forceSelection:true,editable:false,value:1,store:[[0,t("no")],[1,t("yes")]]},0,["yesnocombo"],["component","box","field","textfield","pickerfield","combobox","combo","yesnocombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,yesnocombo:true},["widget.yesnocombo"],0,[MBilling.view.general,"TypeYesNo"],0));(Ext.cmd.derive("MBilling.view.general.TypeYesNoString",Ext.form.field.ComboBox,{fieldLabel:t("typepaid"),forceSelection:true,editable:false,value:"yes",store:[["no",t("no")],["yes",t("yes")]]},0,["yesnostringcombo"],["component","box","field","textfield","pickerfield","combobox","combo","yesnostringcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,yesnostringcombo:true},["widget.yesnostringcombo"],0,[MBilling.view.general,"TypeYesNoString"],0));(Ext.cmd.derive("MBilling.view.general.TypeNoYesString",Ext.form.field.ComboBox,{fieldLabel:t("typepaid"),forceSelection:true,editable:false,value:"no",store:[["no",t("no")],["yes",t("yes")]]},0,["noyesstringcombo"],["component","box","field","textfield","pickerfield","combobox","combo","noyesstringcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,noyesstringcombo:true},["widget.noyesstringcombo"],0,[MBilling.view.general,"TypeNoYesString"],0));(Ext.cmd.derive("MBilling.view.general.Typenumber",Ext.form.field.ComboBox,{fieldLabel:t("typenumber"),forceSelection:true,editable:false,value:1,store:[[1,1],[2,2],[3,3],[4,4],[5,5]]},0,["numbercombo"],["component","box","field","textfield","pickerfield","combobox","combo","numbercombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,numbercombo:true},["widget.numbercombo"],0,[MBilling.view.general,"Typenumber"],0));(Ext.cmd.derive("MBilling.view.general.Typelanguage",Ext.form.field.ComboBox,{fieldLabel:t("language"),forceSelection:true,editable:false,value:"en",store:[["",t("undefined")],["br",t("portuguese")],["es",t("spanish")],["en",t("english")]]},0,["languagecombo"],["component","box","field","textfield","pickerfield","combobox","combo","languagecombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,languagecombo:true},["widget.languagecombo"],0,[MBilling.view.general,"Typelanguage"],0));(Ext.cmd.derive("MBilling.view.general.TypeCampaign",Ext.form.field.ComboBox,{fieldLabel:t("type"),forceSelection:true,editable:false,value:1,store:[[1,t("voice")],[0,t("sms")]]},0,["campaigntypecombo"],["component","box","field","textfield","pickerfield","combobox","combo","campaigntypecombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,campaigntypecombo:true},["widget.campaigntypecombo"],0,[MBilling.view.general,"TypeCampaign"],0));(Ext.cmd.derive("MBilling.view.general.TypeFullCampaign",Ext.form.field.ComboBox,{fieldLabel:t("type"),forceSelection:true,editable:false,value:1,store:[[1,t("voice")],[0,t("sms")]]},0,["campaigntypefullcombo"],["component","box","field","textfield","pickerfield","combobox","combo","campaigntypefullcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,campaigntypefullcombo:true},["widget.campaigntypefullcombo"],0,[MBilling.view.general,"TypeFullCampaign"],0));(Ext.cmd.derive("MBilling.view.general.TypeBoleto",Ext.form.field.ComboBox,{fieldLabel:t("status"),forceSelection:true,editable:false,value:"D",store:[["D",t("no")],["P",t("yes")]]},0,["boletocombo"],["component","box","field","textfield","pickerfield","combobox","combo","boletocombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,boletocombo:true},["widget.boletocombo"],0,[MBilling.view.general,"TypeBoleto"],0));(Ext.cmd.derive("MBilling.view.general.RestrictionCombo",Ext.form.field.ComboBox,{fieldLabel:t("status"),forceSelection:true,editable:false,value:0,store:[[0,t("inactive")],[1,t("cantCallRestrictedNumbers")],[2,t("canOnlyCallRestrictedNumbers")]]},0,["restrictioncombo"],["component","box","field","textfield","pickerfield","combobox","combo","restrictioncombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,restrictioncombo:true},["widget.restrictioncombo"],0,[MBilling.view.general,"RestrictionCombo"],0));(Ext.cmd.derive("MBilling.view.general.CountryISOCombo",Ext.form.field.ComboBox,{forceSelection:true,editable:true,listeners:{focus:function(b){b.expand()}},store:[["AFG",t("Afghanistan")],["ALA",t("Åland Islands")],["ALB",t("Albania")],["DZA",t("Algeria")],["ASM",t("American Samoa")],["AND",t("Andorra")],["AGO",t("Angola")],["AIA",t("Anguilla")],["ATA",t("Antarctica")],["ATG",t("Antigua and Barbuda")],["ARG",t("Argentina")],["ARM",t("Armenia")],["ABW",t("Aruba")],["AUS",t("Australia")],["AUT",t("Austria")],["AZE",t("Azerbaijan")],["BHS",t("Bahamas")],["BHR",t("Bahrain")],["BGD",t("Bangladesh")],["BRB",t("Barbados")],["BLR",t("Belarus")],["BEL",t("Belgium")],["BLZ",t("Belize")],["BEN",t("Benin")],["BMU",t("Bermuda")],["BTN",t("Bhutan")],["BOL",t("Bolivia, Plurinational State of")],["BES",t("Bonaire, Sint Eustatius and Saba")],["BIH",t("Bosnia and Herzegovina")],["BWA",t("Botswana")],["BVT",t("Bouvet Island")],["BRL",t("Brazil")],["IOT",t("British Indian Ocean Territory")],["BRN",t("Brunei Darussalam")],["BGR",t("Bulgaria")],["BFA",t("Burkina Faso")],["BDI",t("Burundi")],["KHM",t("Cambodia")],["CMR",t("Cameroon")],["CAN",t("Canada")],["CPV",t("Cape Verde")],["CYM",t("Cayman Islands")],["CAF",t("Central African Republic")],["TCD",t("Chad")],["CHL",t("Chile")],["CHN",t("China")],["CXR",t("Christmas Island")],["CCK",t("Cocos (Keeling) Islands")],["COL",t("Colombia")],["COM",t("Comoros")],["COG",t("Congo")],["COD",t("Congo, the Democratic Republic of the")],["COK",t("Cook Islands")],["CRI",t("Costa Rica")],["CIV",t("Côte dIvoire")],["HRV",t("Croatia")],["CUB",t("Cuba")],["CUW",t("Curaçao")],["CYP",t("Cyprus")],["CZE",t("Czech Republic")],["DNK",t("Denmark")],["DJI",t("Djibouti")],["DMA",t("Dominica")],["DOM",t("Dominican Republic")],["ECU",t("Ecuador")],["EGY",t("Egypt")],["SLV",t("El Salvador")],["GNQ",t("Equatorial Guinea")],["ERI",t("Eritrea")],["EST",t("Estonia")],["ETH",t("Ethiopia")],["FLK",t("Falkland Islands (Malvinas)")],["FRO",t("Faroe Islands")],["FJI",t("Fiji")],["FIN",t("Finland")],["FRA",t("France")],["GUF",t("French Guiana")],["PYF",t("French Polynesia")],["ATF",t("French Southern Territories")],["GAB",t("Gabon")],["GMB",t("Gambia")],["GEO",t("Georgia")],["DEU",t("Germany")],["GHA",t("Ghana")],["GIB",t("Gibraltar")],["GRC",t("Greece")],["GRL",t("Greenland")],["GRD",t("Grenada")],["GLP",t("Guadeloupe")],["GUM",t("Guam")],["GTM",t("Guatemala")],["GGY",t("Guernsey")],["GIN",t("Guinea")],["GNB",t("Guinea-Bissau")],["GUY",t("Guyana")],["HTI",t("Haiti")],["HMD",t("Heard Island and McDonald Islands")],["VAT",t("Holy See (Vatican City State)")],["HND",t("Honduras")],["HKG",t("Hong Kong")],["HUN",t("Hungary")],["ISL",t("Iceland")],["IND",t("India")],["IDN",t("Indonesia")],["IRN",t("Iran, Islamic Republic of")],["IRQ",t("Iraq")],["IRL",t("Ireland")],["IMN",t("Isle of Man")],["ISR",t("Israel")],["ITA",t("Italy")],["JAM",t("Jamaica")],["JPN",t("Japan")],["JEY",t("Jersey")],["JOR",t("Jordan")],["KAZ",t("Kazakhstan")],["KEN",t("Kenya")],["KIR",t("Kiribati")],["PRK",t("Korea, Democratic Peoples Republic of")],["KOR",t("Korea, Republic of")],["KWT",t("Kuwait")],["KGZ",t("Kyrgyzstan")],["LAO",t("Lao Peoples Democratic Republic")],["LVA",t("Latvia")],["LBN",t("Lebanon")],["LSO",t("Lesotho")],["LBR",t("Liberia")],["LBY",t("Libya")],["LIE",t("Liechtenstein")],["LTU",t("Lithuania")],["LUX",t("Luxembourg")],["MAC",t("Macao")],["MKD",t("Macedonia, the former Yugoslav Republic of")],["MDG",t("Madagascar")],["MWI",t("Malawi")],["MYS",t("Malaysia")],["MDV",t("Maldives")],["MLI",t("Mali")],["MLT",t("Malta")],["MHL",t("Marshall Islands")],["MTQ",t("Martinique")],["MRT",t("Mauritania")],["MUS",t("Mauritius")],["MYT",t("Mayotte")],["MEX",t("Mexico")],["FSM",t("Micronesia, Federated States of")],["MDA",t("Moldova, Republic of")],["MCO",t("Monaco")],["MNG",t("Mongolia")],["MNE",t("Montenegro")],["MSR",t("Montserrat")],["MAR",t("Morocco")],["MOZ",t("Mozambique")],["MMR",t("Myanmar")],["NAM",t("Namibia")],["NRU",t("Nauru")],["NPL",t("Nepal")],["NLD",t("Netherlands")],["NCL",t("New Caledonia")],["NZL",t("New Zealand")],["NIC",t("Nicaragua")],["NER",t("Niger")],["NGA",t("Nigeria")],["NIU",t("Niue")],["NFK",t("Norfolk Island")],["MNP",t("Northern Mariana Islands")],["NOR",t("Norway")],["OMN",t("Oman")],["PAK",t("Pakistan")],["PLW",t("Palau")],["PSE",t("Palestinian Territory, Occupied")],["PAN",t("Panama")],["PNG",t("Papua New Guinea")],["PRY",t("Paraguay")],["PER",t("Peru")],["PHL",t("Philippines")],["PCN",t("Pitcairn")],["POL",t("Poland")],["PRT",t("Portugal")],["PRI",t("Puerto Rico")],["QAT",t("Qatar")],["REU",t("Réunion")],["ROU",t("Romania")],["RUS",t("Russian Federation")],["RWA",t("Rwanda")],["BLM",t("Saint Barthélemy")],["SHN",t("Saint Helena, Ascension and Tristan da Cunha")],["KNA",t("Saint Kitts and Nevis")],["LCA",t("Saint Lucia")],["MAF",t("Saint Martin (French part)")],["SPM",t("Saint Pierre and Miquelon")],["VCT",t("Saint Vincent and the Grenadines")],["WSM",t("Samoa")],["SMR",t("San Marino")],["STP",t("Sao Tome and Principe")],["SAU",t("Saudi Arabia")],["SEN",t("Senegal")],["SRB",t("Serbia")],["SYC",t("Seychelles")],["SLE",t("Sierra Leone")],["SGP",t("Singapore")],["SXM",t("Sint Maarten (Dutch part)")],["SVK",t("Slovakia")],["SVN",t("Slovenia")],["SLB",t("Solomon Islands")],["SOM",t("Somalia")],["ZAF",t("South Africa")],["SGS",t("South Georgia and the South Sandwich Islands")],["SSD",t("South Sudan")],["ESP",t("Spain")],["LKA",t("Sri Lanka")],["SDN",t("Sudan")],["SUR",t("Suriname")],["SJM",t("Svalbard and Jan Mayen")],["SWZ",t("Swaziland")],["SWE",t("Sweden")],["CHE",t("Switzerland")],["SYR",t("Syrian Arab Republic")],["TWN",t("Taiwan, Province of China")],["TJK",t("Tajikistan")],["TZA",t("Tanzania, United Republic of")],["THA",t("Thailand")],["TLS",t("Timor-Leste")],["TGO",t("Togo")],["TKL",t("Tokelau")],["TON",t("Tonga")],["TTO",t("Trinidad and Tobago")],["TUN",t("Tunisia")],["TUR",t("Turkey")],["TKM",t("Turkmenistan")],["TCA",t("Turks and Caicos Islands")],["TUV",t("Tuvalu")],["UGA",t("Uganda")],["UKR",t("Ukraine")],["ARE",t("United Arab Emirates")],["GBR",t("United Kingdom")],["USA",t("United States")],["UMI",t("United States Minor Outlying Islands")],["URY",t("Uruguay")],["UZB",t("Uzbekistan")],["VUT",t("Vanuatu")],["VEN",t("Venezuela, Bolivarian Republic of")],["VNM",t("Viet Nam")],["VGB",t("Virgin Islands, British")],["VIR",t("Virgin Islands, U.S.")],["WLF",t("Wallis and Futuna")],["ESH",t("Western Sahara")],["YEM",t("Yemen")],["ZMB",t("Zambia")],["ZWE",t("Zimbabwe")]]},0,["countryisocombo"],["component","box","field","textfield","pickerfield","combobox","combo","countryisocombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,countryisocombo:true},["widget.countryisocombo"],0,[MBilling.view.general,"CountryISOCombo"],0));(Ext.cmd.derive("MBilling.view.general.CountryCombo",Ext.form.field.ComboBox,{fieldLabel:t("Country"),forceSelection:true,editable:true,allowBlank:true,listeners:{focus:function(b){b.expand()}},store:[["",t("Select")],["93",t("Afghanistan")],["355",t("Albania")],["213",t("Algeria")],["684",t("American Samoa")],["376",t("Andorra")],["244",t("Angola")],["1264",t("Anguilla")],["672",t("Antarctica")],["1268",t("Antigua And Barbuda")],["54",t("Argentina")],["374",t("Armenia")],["297",t("Aruba")],["61",t("Australia")],["43",t("Austria")],["994",t("Azerbaijan")],["1242",t("Bahamas")],["973",t("Bahrain")],["880",t("Bangladesh")],["1246",t("Barbados")],["375",t("Belarus")],["32",t("Belgium")],["501",t("Belize")],["229",t("Benin")],["1441",t("Bermuda")],["975",t("Bhutan")],["591",t("Bolivia")],["387",t("Bosnia And Herzegovina")],["267",t("Botswana")],["55",t("Brazil")],["1284",t("British Indian Ocean Territory")],["673",t("Brunei Darussalam")],["359",t("Bulgaria")],["226",t("Burkina Faso")],["257",t("Burundi")],["855",t("Cambodia")],["237",t("Cameroon")],["238",t("Cape Verde")],["1345",t("Cayman Islands")],["236",t("Central African Republic")],["235",t("Chad")],["56",t("Chile")],["86",t("China")],["618",t("Christmas Island")],["61",t("Cocos (Keeling); Islands")],["57",t("Colombia")],["269",t("Comoros")],["242",t("Congo")],["243",t("Congo, The Democratic Republic Of The")],["682",t("Cook Islands")],["506",t("Costa Rica")],["385",t("Croatia")],["53",t("Cuba")],["357",t("Cyprus")],["420",t("Czech Republic")],["45",t("Denmark")],["253",t("Djibouti")],["1767",t("Dominica")],["1809",t("Dominican Republic")],["593",t("Ecuador")],["20",t("Egypt")],["503",t("El Salvador")],["240",t("Equatorial Guinea")],["291",t("Eritrea")],["372",t("Estonia")],["251",t("Ethiopia")],["500",t("Falkland Islands (Malvinas)")],["298",t("Faroe Islands")],["679",t("Fiji")],["358",t("Finland")],["33",t("France")],["596",t("French Guiana")],["594",t("French Polynesia")],["689",t("French Southern Territories")],["241",t("Gabon")],["220",t("Gambia")],["995",t("Georgia")],["49",t("Germany")],["233",t("Ghana")],["350",t("Gibraltar")],["30",t("Greece")],["299",t("Greenland")],["1473",t("Grenada")],["590",t("Guadeloupe")],["1671",t("Guam")],["502",t("Guatemala")],["224",t("Guinea")],["245",t("Guinea-Bissau")],["592",t("Guyana")],["509",t("Haiti")],["504",t("Honduras")],["852",t("Hong Kong")],["36",t("Hungary")],["354",t("Iceland")],["91",t("India")],["62",t("Indonesia")],["98",t("Iran, Islamic Republic Of")],["964",t("Iraq")],["353",t("Ireland")],["972",t("Israel")],["39",t("Italy")],["1876",t("Jamaica")],["81",t("Japan")],["962",t("Jordan")],["7",t("Kazakhstan")],["254",t("Kenya")],["686",t("Kiribati")],["850",t("Korea, Democratic Peoples Republic Of")],["82",t("Korea, Republic of")],["965",t("Kuwait")],["996",t("Kyrgyzstan")],["856",t("Lao Peoples Democratic Republic")],["371",t("Latvia")],["961",t("Lebanon")],["266",t("Lesotho")],["231",t("Liberia")],["218",t("Libyan Arab Jamahiriya")],["423",t("Liechtenstein")],["370",t("Lithuania")],["352",t("Luxembourg")],["853",t("Macao")],["389",t("Macedonia, The Former Yugoslav Republic Of")],["261",t("Madagascar")],["265",t("Malawi")],["60",t("Malaysia")],["960",t("Maldives")],["223",t("Mali")],["356",t("Malta")],["692",t("Marshall islands")],["596",t("Martinique")],["222",t("Mauritania")],["230",t("Mauritius")],["269",t("Mayotte")],["52",t("Mexico")],["691",t("Micronesia, Federated States Of")],["1808",t("Moldova, Republic Of")],["377",t("Monaco")],["976",t("Mongolia")],["1664",t("Montserrat")],["212",t("Morocco")],["258",t("Mozambique")],["95",t("Myanmar")],["264",t("Namibia")],["674",t("Nauru")],["977",t("Nepal")],["31",t("Netherlands")],["599",t("Netherlands Antilles")],["687",t("New Caledonia")],["64",t("New Zealand")],["505",t("Nicaragua")],["227",t("Niger")],["234",t("Nigeria")],["683",t("Niue")],["672",t("Norfolk Island")],["1670",t("Northern Mariana Islands")],["47",t("Norway")],["968",t("Oman")],["92",t("Pakistan")],["680",t("Palau")],["970",t("Palestinian Territory, Occupied")],["507",t("Panama")],["675",t("Papua New Guinea")],["595",t("Paraguay")],["51",t("Peru")],["63",t("Philippines")],["48",t("Poland")],["351",t("Portugal")],["1787",t("Puerto Rico")],["974",t("Qatar")],["262",t("Reunion")],["40",t("Romania")],["7",t("Russian Federation")],["250",t("Rwanda")],["290",t("SaINT Helena")],["1869",t("SaINT Kitts And Nevis")],["1758",t("SaINT Lucia")],["508",t("SaINT Pierre And Miquelon")],["1784",t("SaINT Vincent And The Grenadines")],["685",t("Samoa")],["378",t("San Marino")],["239",t("São Tomé And Principe")],["966",t("Saudi Arabia")],["221",t("Senegal")],["248",t("Seychelles")],["232",t("Sierra Leone")],["65",t("Singapore")],["421",t("Slovakia")],["386",t("Slovenia")],["677",t("Solomon Islands")],["252",t("Somalia")],["27",t("South Africa")],["34",t("Spain")],["94",t("Sri Lanka")],["249",t("Sudan")],["597",t("Suriname")],["268",t("Swaziland")],["46",t("Sweden")],["41",t("Switzerland")],["963",t("Syrian Arab Republic")],["886",t("Taiwan, Province Of China")],["992",t("Tajikistan")],["255",t("Tanzania, United Republic Of")],["66",t("Thailand")],["670",t("Timor-Leste")],["228",t("Togo")],["690",t("Tokelau")],["676",t("Tonga")],["1868",t("Trinidad And Tobago")],["216",t("Tunisia")],["90",t("Turkey")],["993",t("Turkmenistan")],["1649",t("Turks And Caicos Islands")],["688",t("Tuvalu")],["256",t("Uganda")],["380",t("Ukraine")],["971",t("United Arab Emirates")],["44",t("United Kingdom")],["1",t("United States/Canada")],["598",t("Uruguay")],["998",t("Uzbekistan")],["678",t("Vanuatu")],["58",t("Venezuela")],["84",t("Vietnam")],["1284",t("Virgin Islands, British")],["808",t("Virgin Islands, U.S.")],["681",t("Wallis And Futuna")],["967",t("Yemen")],["260",t("Zambia")],["263",t("Zimbabwe")],["35818",t("Aland Islands")],["441481",t("Guernsey")],["441624",t("Isle of Man")],["441534",t("Jersey")],["382",t("Montenegro, Republic of")],["381",t("Serbia, Republic of")]]},0,["countrycombo"],["component","box","field","textfield","pickerfield","combobox","combo","countrycombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,countrycombo:true},["widget.countrycombo"],0,[MBilling.view.general,"CountryCombo"],0));(Ext.cmd.derive("MBilling.view.general.GroupCombo",Ext.form.field.ComboBox,{fieldLabel:t("group"),value:"config_group_title",forceSelection:true,editable:false,store:[["global","global"],["callback","callback"],["agi-conf1","agi-conf1"],["agi-conf2","agi-conf2"]]},0,["groupcombo"],["component","box","field","textfield","pickerfield","combobox","combo","groupcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,groupcombo:true},["widget.groupcombo"],0,[MBilling.view.general,"GroupCombo"],0));(Ext.cmd.derive("MBilling.view.general.LcrtypeCombo",Ext.form.field.ComboBox,{fieldLabel:t("lcrtype"),forceSelection:true,editable:false,value:1,store:[[1,t("LCRAccordingtothebuyerPrice")],[0,t("LCRAccordingtothesellerPrice")]]},0,["lcrtypecombo"],["component","box","field","textfield","pickerfield","combobox","combo","lcrtypecombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,lcrtypecombo:true},["widget.lcrtypecombo"],0,[MBilling.view.general,"LcrtypeCombo"],0));(Ext.cmd.derive("MBilling.view.general.LcrtypeFullCombo",Ext.form.field.ComboBox,{forceSelection:true,editable:false,fieldLabel:t("lcrtype"),value:1,store:[[1,t("LCRAccordingtothebuyerPrice")],[0,t("LCRAccordingtothesellerPrice")],[2,t("Load Balancer")]]},0,["lcrtypefullcombo"],["component","box","field","textfield","pickerfield","combobox","combo","lcrtypefullcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,lcrtypefullcombo:true},["widget.lcrtypefullcombo"],0,[MBilling.view.general,"LcrtypeFullCombo"],0));(Ext.cmd.derive("MBilling.view.general.OfferTypeCombo",Ext.form.field.ComboBox,{fieldLabel:t("offertype"),forceSelection:true,editable:false,value:0,store:[[0,t("unlimitedcalls")],[1,t("numberfreecalls")],[2,t("freeseconds")]]},0,["offertypecombo"],["component","box","field","textfield","pickerfield","combobox","combo","offertypecombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,offertypecombo:true},["widget.offertypecombo"],0,[MBilling.view.general,"OfferTypeCombo"],0));(Ext.cmd.derive("MBilling.view.general.BillingTypeCombo",Ext.form.field.ComboBox,{fieldLabel:t("billingtype"),forceSelection:true,editable:false,value:0,store:[[0,t("monthly")],[1,t("weekly")]]},0,["billingtypecombo"],["component","box","field","textfield","pickerfield","combobox","combo","billingtypecombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,billingtypecombo:true},["widget.billingtypecombo"],0,[MBilling.view.general,"BillingTypeCombo"],0));(Ext.cmd.derive("MBilling.view.general.SipCombo",Ext.form.field.ComboBox,{fieldLabel:t("providertech"),forceSelection:true,editable:false,value:"sip",store:[["sip","sip"],["dahdi","dahdi"],["khomp","khomp"],["iax2","iax2"],["dgv","dgv"],["ooh323","ooh323"],["extra","extra"],["Dongle","Dongle"],["Local","Local"]]},0,["sipcombo"],["component","box","field","textfield","pickerfield","combobox","combo","sipcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,sipcombo:true},["widget.sipcombo"],0,[MBilling.view.general,"SipCombo"],0));(Ext.cmd.derive("MBilling.view.general.TypePaymentCombo",Ext.form.field.ComboBox,{fieldLabel:t("typepaid"),forceSelection:true,editable:false,value:0,store:[[0,t("prepaid")],[1,t("pospaid")]]},0,["typepaymentcombo"],["component","box","field","textfield","pickerfield","combobox","combo","typepaymentcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,typepaymentcombo:true},["widget.typepaymentcombo"],0,[MBilling.view.general,"TypePaymentCombo"],0));(Ext.cmd.derive("MBilling.view.general.CampaignSendCombo",Ext.form.field.ComboBox,{fieldLabel:t("type"),forceSelection:true,editable:false,displayField:"name",valueField:"id",value:"CALL1",store:{fields:["id","name"],data:[{id:"CALL1",name:t("Select type"),showFields:["type"]},{id:"SMS",name:"SMS",showFields:["type","sms_text","csv_path","numbers","startingdate","startingtime"]},{id:"CALL",name:"CALL",showFields:["type","audio_path","csv_path","numbers","startingdate","startingtime"]}]}},0,["campaignsendcombo"],["component","box","field","textfield","pickerfield","combobox","combo","campaignsendcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,campaignsendcombo:true},["widget.campaignsendcombo"],0,[MBilling.view.general,"CampaignSendCombo"],0));(Ext.cmd.derive("MBilling.view.general.PaymentCountryCombo",Ext.form.field.ComboBox,{fieldLabel:t("typepaid"),value:"Brasil",forceSelection:true,editable:true,listeners:{focus:function(b){b.expand()}},store:[["Argentina","Argentina"],["Brasil","Brasil"],["Colombia","Colombia"],["Latino America","Latino America"],["Global","Global"]]},0,["paymentcountrycombo"],["component","box","field","textfield","pickerfield","combobox","combo","paymentcountrycombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,paymentcountrycombo:true},["widget.paymentcountrycombo"],0,[MBilling.view.general,"PaymentCountryCombo"],0));(Ext.cmd.derive("MBilling.view.general.BoletoBanckCombo",Ext.form.field.ComboBox,{fieldLabel:t("Banco"),forceSelection:true,editable:false,value:"cef",store:[["cef","Caixa Economica SICOB"],["bradesco","Bradesco"]]},0,["boletobanckcombo"],["component","box","field","textfield","pickerfield","combobox","combo","boletobanckcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,boletobanckcombo:true},["widget.boletobanckcombo"],0,[MBilling.view.general,"BoletoBanckCombo"],0));(Ext.cmd.derive("MBilling.view.general.PaymentBanckCombo",Ext.form.field.ComboBox,{fieldLabel:t("typepaid"),forceSelection:true,editable:false,value:"Banco do Brasil",store:[["Banco do Brasil","Banco do Brasil"],["bradesco","Bradesco"],["hsbc","Hsbc"],["itau","Itau"],["santander","Santander"],["unibanco","Unibanco"],["cef","Caixa Economica SICOB"],["cef_sinco","Caixa Economica SINCO"],["cef_sigcb","Caixa Economica SIGCB"]]},0,["paymentbanckcombo"],["component","box","field","textfield","pickerfield","combobox","combo","paymentbanckcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,paymentbanckcombo:true},["widget.paymentbanckcombo"],0,[MBilling.view.general,"PaymentBanckCombo"],0));(Ext.cmd.derive("MBilling.view.templateMail.Controller",Ext.ux.app.ViewController,{onAfterSave:function(d){var c=this;d=d||c.formPanel;if(!d.idRecord){d.getForm().reset();c.focusFirstField()}c.saveButton.enable();c.updateLotButton&&c.updateLotButton.toggle(false);d.setLoading(false);c.store.load()},onEdit:function(){var b=this;b.lookupReference("generalTab").show();Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)}},0,0,0,0,["controller.templatemail"],0,[MBilling.view.templateMail,"Controller"],0));(Ext.cmd.derive("MBilling.view.templateMail.Module",Ext.ux.panel.Module,{controller:"templatemail",cfgEast:{flex:9}},0,["templatemailmodule"],["component","box","container","uxpanelmodule","templatemailmodule"],{component:true,box:true,container:true,uxpanelmodule:true,templatemailmodule:true},["widget.templatemailmodule"],0,[MBilling.view.templateMail,"Module"],0));(Ext.cmd.derive("MBilling.view.templateMail.List",Ext.ux.grid.Panel,{store:"TemplateMail",initComponent:function(){var b=this;b.allowPrint=false;b.buttonCsv=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowDelete=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("type"),dataIndex:"mailtype",flex:3},{header:t("Language"),renderer:Helper.Util.formatLanguageImage,dataIndex:"language",flex:2},{header:t("subject"),dataIndex:"subject",flex:7}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["templatemaillist"],["component","box","container","panel","tablepanel","gridpanel","grid","templatemaillist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,templatemaillist:true},["widget.templatemaillist"],0,[MBilling.view.templateMail,"List"],0));(Ext.cmd.derive("MBilling.view.templateMail.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true}},items:[{title:t("general"),reference:"generalTab",items:[{name:"fromname",fieldLabel:t("fromname")},{name:"fromemail",fieldLabel:t("fromemail")},{name:"subject",fieldLabel:t("subject")}]},{title:t("Email body"),items:[{hideLabel:true,xtype:"htmleditor",name:"messagehtml",fieldLabel:t("description"),height:1000,anchor:"100%"}]},{title:t("Variables"),items:[{xtype:"displayfield",fieldLabel:t("username"),value:'$login$',allowBlank:true},{xtype:"displayfield",fieldLabel:t("password"),value:'$password$',allowBlank:true},{xtype:"displayfield",fieldLabel:t("email"),value:'$email$',allowBlank:true},{xtype:"displayfield",fieldLabel:t("firstname"),value:'$firstname$',allowBlank:true},{xtype:"displayfield",fieldLabel:t("lastname"),value:'$lastname$',allowBlank:true},{xtype:"displayfield",fieldLabel:t("credit"),value:'$credit$',allowBlank:true},{xtype:"displayfield",fieldLabel:t("date"),value:'$time$',allowBlank:true},{xtype:"displayfield",fieldLabel:t("description"),value:'$description$',allowBlank:true},{xtype:"displayfield",fieldLabel:t("Url to cancel email credit notification"),value:'$cancel_credit_notification_email$',allowBlank:true}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["templatemailform"],["component","box","container","panel","form","templatemailform"],{component:true,box:true,container:true,panel:true,form:true,templatemailform:true},["widget.templatemailform"],0,[MBilling.view.templateMail,"Form"],0));(Ext.cmd.derive("MBilling.view.logUsers.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.logusers"],0,[MBilling.view.logUsers,"Controller"],0));(Ext.cmd.derive("MBilling.view.logUsers.Module",Ext.ux.panel.Module,{controller:"logusers"},0,["logusersmodule"],["component","box","container","uxpanelmodule","logusersmodule"],{component:true,box:true,container:true,uxpanelmodule:true,logusersmodule:true},["widget.logusersmodule"],0,[MBilling.view.logUsers,"Module"],0));(Ext.cmd.derive("MBilling.view.logUsers.List",Ext.ux.grid.Panel,{store:"LogUsers",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.allowDelete=false;b.allowCreate=false;b.allowUpdate=false;b.columns=[{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isOperator,hideable:!App.user.isOperator},{header:t("action"),dataIndex:"idLogActionsname",renderer:Helper.Util.translate,flex:3},{header:t("description"),dataIndex:"description",flex:7},{header:t("IP"),dataIndex:"ip",flex:4},{header:t("date"),renderer:Helper.Util.formatDateTime,dataIndex:"date",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["loguserslist"],["component","box","container","panel","tablepanel","gridpanel","grid","loguserslist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,loguserslist:true},["widget.loguserslist"],0,[MBilling.view.logUsers,"List"],0));(Ext.cmd.derive("MBilling.view.logUsers.Form",Ext.ux.form.Panel,{fieldsHideEdit:["cid"],initComponent:function(){var b=this;b.items=[{xtype:"usercombo",allowBlank:true,readOnly:true},{name:"id_log_actions",fieldLabel:t("action"),readOnly:true},{name:"ip",fieldLabel:t("ip"),readOnly:true},{xtype:"textareafield",name:"description",fieldLabel:t("description"),height:400,anchor:"100%",allowBlank:true,readOnly:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["logusersform"],["component","box","container","panel","form","logusersform"],{component:true,box:true,container:true,panel:true,form:true,logusersform:true},["widget.logusersform"],0,[MBilling.view.logUsers,"Form"],0));(Ext.cmd.derive("MBilling.view.provider.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.provider"],0,[MBilling.view.provider,"Controller"],0));(Ext.cmd.derive("MBilling.view.provider.Combo",Ext.form.field.ComboBox,{name:"id_provider",fieldLabel:t("provider"),forceSelection:true,editable:false,displayField:"provider_name",valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Provider",{proxy:{type:"uxproxy",module:"provider",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["providercombo"],["component","box","field","textfield","pickerfield","combobox","combo","providercombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,providercombo:true},["widget.providercombo"],0,[MBilling.view.provider,"Combo"],0));(Ext.cmd.derive("MBilling.view.provider.Module",Ext.ux.panel.Module,{controller:"provider"},0,["providermodule"],["component","box","container","uxpanelmodule","providermodule"],{component:true,box:true,container:true,uxpanelmodule:true,providermodule:true},["widget.providermodule"],0,[MBilling.view.provider,"Module"],0));(Ext.cmd.derive("MBilling.view.provider.List",Ext.ux.grid.Panel,{store:"Provider",initComponent:function(){var b=this;b.columns=b.columns||[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("name"),dataIndex:"provider_name"},{header:t("description"),dataIndex:"description"},{header:t("credit"),dataIndex:"credit",renderer:Helper.Util.formatMoneyDecimal},{header:t("creationdate"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"creationdate"}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["providerlist"],["component","box","container","panel","tablepanel","gridpanel","grid","providerlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,providerlist:true},["widget.providerlist"],0,[MBilling.view.provider,"List"],0));(Ext.cmd.derive("MBilling.view.provider.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["provider_name"],initComponent:function(){var b=this;b.items=[{name:"provider_name",fieldLabel:t("name")},{xtype:"moneyfield",name:"credit",mask:App.user.currency+" #9.999.990,00",fieldLabel:t("credit"),value:"0"},{xtype:"noyescombo",name:"credit_control",fieldLabel:t("Credit")+" "+t("control"),hidden:App.user.isClient},{xtype:"textareafield",name:"description",fieldLabel:t("description"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["providerform"],["component","box","container","panel","form","providerform"],{component:true,box:true,container:true,panel:true,form:true,providerform:true},["widget.providerform"],0,[MBilling.view.provider,"Form"],0));(Ext.cmd.derive("MBilling.view.provider.Lookup",Ext.ux.form.field.Lookup,{name:"id_provider",fieldLabel:t("Provider"),displayField:"idProviderprovider_name",displayFieldList:"provider_name",gridConfig:{xtype:"providerlist",fieldSearch:"username",columns:[{header:t("name"),dataIndex:"provider_name"},{header:t("description"),dataIndex:"description"}]}},0,["providerlookup"],["component","box","container","fieldcontainer","providerlookup"],{component:true,box:true,container:true,fieldcontainer:true,providerlookup:true},["widget.providerlookup"],0,[MBilling.view.provider,"Lookup"],0));(Ext.cmd.derive("MBilling.view.plan.Controller",Ext.ux.app.ViewController,{init:function(){var b=this;b.control({noyescombo:{select:b.onSelectType}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectType:function(c,d){this.showFieldsRelated(d.getData().showFields)},showFieldsRelated:function(j){var l=this,g=l.formPanel.getForm().getFields(),f=l.formPanel.getForm().findField("ini_credit"),m=l.formPanel.getForm();g.each(function(a){if(a.name=="signup"){a.value==1?f.show():f.hide()}})},onEdit:function(){var f=this,d=f.formPanel.getForm().findField("ini_credit"),e=f.formPanel.getForm().findField("signup");Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments);e.value==1?d.show():d.hide()}},0,0,0,0,["controller.plan"],0,[MBilling.view.plan,"Controller"],0));(Ext.cmd.derive("MBilling.view.plan.Combo",Ext.form.field.ComboBox,{name:"id_plan",fieldLabel:t("plan"),displayField:"name",valueField:"id",forceSelection:true,editable:true,listeners:{focus:function(b){b.expand()}},initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Plan",{proxy:{type:"uxproxy",module:"plan",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["plancombo"],["component","box","field","textfield","pickerfield","combobox","combo","plancombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,plancombo:true},["widget.plancombo"],0,[MBilling.view.plan,"Combo"],0));(Ext.cmd.derive("MBilling.view.plan.Module",Ext.ux.panel.Module,{controller:"plan"},0,["planmodule"],["component","box","container","uxpanelmodule","planmodule"],{component:true,box:true,container:true,uxpanelmodule:true,planmodule:true},["widget.planmodule"],0,[MBilling.view.plan,"Module"],0));(Ext.cmd.derive("MBilling.view.plan.List",Ext.ux.grid.Panel,{store:"Plan",fieldSearch:"name",initComponent:function(){var b=this;b.columns=b.columns||[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("name"),dataIndex:"name",flex:4},{header:t("lcrtype"),dataIndex:"lcrtype",comboRelated:"lcrtypecombo",renderer:Helper.Util.formatLcrtype,flex:4,filter:{type:"list",options:[[1,t("LCRAccordingtothebuyerPrice")],[0,t("LCRAccordingtothesellerPrice")],[2,t("Load Balancer")]]}},{header:t("Tech Prefx"),dataIndex:"techprefix",flex:4,hidden:!App.user.isAdmin},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"creationdate",flex:4},{header:t("Port. Celular"),dataIndex:"portabilidadeMobile",flex:2,renderer:Helper.Util.formattyyesno,filter:{type:"list",options:[[0,t("no")],[1,t("yes")]]},hidden:App.user.language!="pt_BR",hideable:false},{header:t("Port. Fixo"),dataIndex:"portabilidadeFixed",flex:2,renderer:Helper.Util.formattyyesno,filter:{type:"list",options:[[0,t("no")],[1,t("yes")]]},hidden:App.user.language!="pt_BR",hideable:false}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["planlist"],["component","box","container","panel","tablepanel","gridpanel","grid","planlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,planlist:true},["widget.planlist"],0,[MBilling.view.plan,"List"],0));(Ext.cmd.derive("MBilling.view.plan.Form",Ext.ux.form.Panel,{labelWidthFields:115,fieldsHideUpdateLot:["name"],initComponent:function(){var b=this;b.defaults={labelWidth:142};b.items=[{name:"name",fieldLabel:t("name"),maxLength:100},{xtype:"lcrtypefullcombo",name:"lcrtype",fieldLabel:t("lcrtype"),allowBlank:true},{xtype:"numberfield",name:"tariff_limit",minValue:1,value:1,fieldLabel:t("Tariff Find Limit"),hidden:!App.user.isAdmin},{xtype:"noyescombo",name:"signup",fieldLabel:t("useInSignup"),allowBlank:true},{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,00",name:"ini_credit",fieldLabel:t("Initial Credit to new users"),allowBlank:true,hidden:true,value:0},{xtype:"yesnocombo",name:"play_audio",fieldLabel:t("Notices with audio"),allowBlank:true,hidden:App.user.isClient},{style:"margin-top:25px",xtype:"fieldset",title:t("Ativar portabilidade?"),collapsible:true,collapsed:false,hidden:App.user.language!="pt_BR",defaults:{labelWidth:190,anchor:"100%",layout:{type:"hbox",labelAlign:b.labelAlignFields}},items:[{xtype:"noyescombo",name:"portabilidadeMobile",fieldLabel:t("Para Celular"),allowBlank:true,hidden:App.user.language!="pt_BR"},{xtype:"noyescombo",name:"portabilidadeFixed",fieldLabel:t("Para Fixo"),allowBlank:true,hidden:App.user.language!="pt_BR"}]},{name:"techprefix",fieldLabel:t("Tech Prefix"),allowBlank:true,maxLength:5,minLength:5,hidden:!App.user.isAdmin},{style:"margin-top:25px",xtype:"fieldset",title:t("Select one or more Services"),collapsible:true,collapsed:false,items:[{anchor:"100%",fieldLabel:"",xtype:"servicestag",allowBlank:true}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["planform"],["component","box","container","panel","form","planform"],{component:true,box:true,container:true,panel:true,form:true,planform:true},["widget.planform"],0,[MBilling.view.plan,"Form"],0));(Ext.cmd.derive("MBilling.view.plan.Tag",Ext.form.field.Tag,{name:"id_plan",fieldLabel:t("plan"),displayField:"name",valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Plan",{proxy:{type:"uxproxy",module:"plan",limitParam:undefined}});Ext.form.field.Tag.prototype.initComponent.apply(this,arguments)}},0,["plantag"],["component","box","field","textfield","pickerfield","combobox","combo","tagfield","plantag"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,tagfield:true,plantag:true},["widget.plantag"],0,[MBilling.view.plan,"Tag"],0));(Ext.cmd.derive("MBilling.view.plan.Lookup",Ext.ux.form.field.Lookup,{name:"id_plan",fieldLabel:t("Plan"),displayField:"idPlanname",displayFieldList:"name",gridConfig:{xtype:"planlist",fieldSearch:"name",columns:[{header:t("name"),dataIndex:"name",flex:2}]}},0,["planlookup"],["component","box","container","fieldcontainer","planlookup"],{component:true,box:true,container:true,fieldcontainer:true,planlookup:true},["widget.planlookup"],0,[MBilling.view.plan,"Lookup"],0));(Ext.cmd.derive("MBilling.view.trunk.Controller",Ext.ux.app.ViewController,{onEdit:function(){var f=this,e=f.list.getSelectionModel().getSelection()[0],d=f.formPanel.getForm().findField("register");if(e.get("register")==1){if(e.get("register")&&e.get("providertech")=="sip"){color=e.get("registered")==1?"green":"red";d.setFieldLabel(t("registertrunk")+' ')}else{d.setFieldLabel(t("registertrunk"))}f.formPanel.getForm().findField("register_string")["show"]()}else{d.setFieldLabel(t("registertrunk"));f.formPanel.getForm().findField("register_string")["hide"]()}Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments);valueAllow=f.formPanel.idRecord?e.get("allow").split(","):["g729","gsm","alaw","ulaw"];fieldAllow=f.formPanel.down("checkboxgroup");fieldAllow.setValue({allow:valueAllow})},init:function(){var b=this;b.control({"noyescombo[name=register]":{select:b.onSelectType}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectType:function(c,d){this.showFieldsRelated(d.getData().showFields)},showFieldsRelated:function(o){var p=this,m=p.formPanel.getForm().findField("register_string"),n=p.formPanel.getForm().findField("user"),q=p.formPanel.getForm().findField("secret"),j=p.formPanel.getForm().findField("host"),l=p.formPanel.getForm().getFields();l.each(function(a){if(a.name=="register"){m.setVisible(a.value==1);m.setValue(n.value+":"+q.value+"@"+j.value+"/"+n.value)}})}},0,0,0,0,["controller.trunk"],0,[MBilling.view.trunk,"Controller"],0));(Ext.cmd.derive("MBilling.view.trunk.Combo",Ext.form.field.ComboBox,{name:"id_trunk",fieldLabel:t("trunk"),forceSelection:true,editable:true,listeners:{focus:function(b){b.expand()}},displayField:"trunkcode",valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Trunk",{proxy:{type:"uxproxy",module:"trunk",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["trunkcombo"],["component","box","field","textfield","pickerfield","combobox","combo","trunkcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,trunkcombo:true},["widget.trunkcombo"],0,[MBilling.view.trunk,"Combo"],0));(Ext.cmd.derive("MBilling.view.trunk.ComboBackup",Ext.form.field.ComboBox,{name:"failover_trunk",fieldLabel:t("failover_trunk"),displayField:"trunkcode",valueField:"id",value:0,limitParam:undefined,forceSelection:true,editable:true,extraValues:[{id:0,trunkcode:t("undefined")}],listeners:{focus:function(b){b.expand()}},initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Trunk",{proxy:{type:"uxproxy",module:"trunk",limitParam:undefined}});b.on("render",b.loadStore,b);Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)},loadStore:function(g){var j=this,e=g.store,f;e.load({callback:function(){if(j.extraValues.length){e.insert(0,j.extraValues)}}})}},0,["trunkcombobackup"],["component","box","field","textfield","pickerfield","combobox","combo","trunkcombobackup"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,trunkcombobackup:true},["widget.trunkcombobackup"],0,[MBilling.view.trunk,"ComboBackup"],0));(Ext.cmd.derive("MBilling.view.trunk.Module",Ext.ux.panel.Module,{controller:"trunk"},0,["trunkmodule"],["component","box","container","uxpanelmodule","trunkmodule"],{component:true,box:true,container:true,uxpanelmodule:true,trunkmodule:true},["widget.trunkmodule"],0,[MBilling.view.trunk,"Module"],0));(Ext.cmd.derive("MBilling.view.trunk.List",Ext.ux.grid.Panel,{store:"Trunk",fieldSearch:"trunkcode",initComponent:function(){var b=this;b.columns=b.columns||[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("trunkcode"),dataIndex:"trunkcode",flex:3},{header:t("add")+" "+t("prefix"),dataIndex:"trunkprefix",flex:2},{header:t("remove")+" "+t("prefix"),dataIndex:"removeprefix",flex:2},{header:t("host"),dataIndex:"host",flex:2},{xtype:"templatecolumn",tpl:"{idProviderprovider_name}",header:t("provider"),dataIndex:"id_provider",comboFilter:"providercombo",flex:2},{header:t("secondusedreal"),renderer:Helper.Util.formatsecondsToTime,dataIndex:"secondusedreal",flex:3},{header:t("status"),dataIndex:"status",renderer:Helper.Util.formatBooleanActive,comboFilter:"booleancombo",flex:1,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")]]}},{header:t("creationdate"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"creationdate",flex:3}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["trunklist"],["component","box","container","panel","tablepanel","gridpanel","grid","trunklist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,trunklist:true},["widget.trunklist"],0,[MBilling.view.trunk,"List"],0));(Ext.cmd.derive("MBilling.view.trunk.Form",Ext.ux.form.Panel,{autoHeight:300,bodyPadding:0,fieldsHideUpdateLot:["trunkcode"],initComponent:function(){var b=this;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{labelAlign:"right",plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true,labelWidth:142}},items:[{title:t("general"),items:[{xtype:"providerlookup",ownerForm:b},{name:"trunkcode",fieldLabel:t("trunkcode")},{name:"user",fieldLabel:t("user"),allowBlank:true},{name:"secret",fieldLabel:t("password"),allowBlank:true},{name:"host",fieldLabel:t("host")},{name:"trunkprefix",fieldLabel:t("add")+" "+t("prefix"),allowBlank:true},{name:"removeprefix",fieldLabel:t("remove")+" "+t("prefix"),allowBlank:true},{xtype:"checkboxgroup",columns:3,name:"allow",fieldLabel:t("codec"),items:[{boxLabel:"g729",name:"allow",inputValue:"g729",checked:true},{boxLabel:"g723",name:"allow",inputValue:"g723"},{boxLabel:"gsm",name:"allow",inputValue:"gsm",checked:true},{boxLabel:"g726",name:"allow",inputValue:"g726"},{boxLabel:"opus",name:"allow",inputValue:"opus",checked:true},{boxLabel:"alaw",name:"allow",inputValue:"alaw",checked:true},{boxLabel:"ulaw",name:"allow",inputValue:"ulaw",checked:true},{boxLabel:"g722",name:"allow",inputValue:"g722"},{boxLabel:"ilbc",name:"allow",inputValue:"ilbc"},{boxLabel:"speex",name:"allow",inputValue:"speex"},{boxLabel:"h261",name:"allow",inputValue:"h261"},{boxLabel:"h263",name:"allow",inputValue:"h263"}],allowBlank:true},{xtype:"sipcombo",name:"providertech",fieldLabel:t("providertech")},{xtype:"trunkcombobackup",allowBlank:true},{xtype:"booleancombo",name:"status",fieldLabel:t("status")},{xtype:"noyescombo",name:"allow_error",fieldLabel:t("allow_error")},{xtype:"noyescombo",name:"register",fieldLabel:t("registertrunk")},{name:"register_string",fieldLabel:t("Register String"),allowBlank:true,hidden:true}]},{title:t("suplementaryInfo"),defaults:{labelAlign:"right",plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true,labelWidth:142},items:[{name:"fromuser",fieldLabel:"fromuser",allowBlank:true},{name:"fromdomain",fieldLabel:"Fromdomain",allowBlank:true},{name:"language",fieldLabel:t("language"),allowBlank:true},{name:"context",fieldLabel:t("context"),allowBlank:true,value:"billing"},{name:"dtmfmode",fieldLabel:"dtmfmode",allowBlank:true,value:"RFC2833"},{name:"insecure",fieldLabel:"insecure",allowBlank:true,value:"port,invite"},{xtype:"numberfield",name:"maxuse",fieldLabel:t("maxuse"),allowBlank:true,value:-1,minValue:-1},{name:"nat",fieldLabel:"nat",value:App.user.asteriskVersion=="1.8"?"yes":"force_rport,comedia",allowBlank:true},{name:"directmedia",allowBlank:true,value:"no",fieldLabel:"directmedia"},{name:"qualify",fieldLabel:"qualify",allowBlank:true,value:"yes"},{name:"type",fieldLabel:"type",allowBlank:true,value:"peer"},{name:"disallow",fieldLabel:"disallow",allowBlank:true,value:"all"},{name:"sendrpid",fieldLabel:"sendrpid",allowBlank:true,value:"no"},{name:"addparameter",fieldLabel:t("addparameter"),allowBlank:true,emptyText:t("parameterdial")},{xtype:"textarea",name:"link_sms",fieldLabel:t("link_sms"),allowBlank:true,emptyText:t("linksmsobs"),height:100,anchor:"100%"},{name:"sms_res",fieldLabel:t("sms_res"),allowBlank:true},{xtype:"numberfield",name:"port",fieldLabel:t("Port"),value:"5060",readOnly:!App.user.isAdmin,hidden:App.user.isClient,allowBlank:App.user.isClient},{xtype:"combobox",name:"encryption",value:"no",store:[["no","No"],["yes","yes"]],fieldLabel:t("Encryption"),allowBlank:true,hidden:!App.user.isAdmin},{xtype:"combobox",forceSelection:true,editable:false,value:"no",store:[["tls","tls"],["no","disable"]],name:"transport",fieldLabel:t("Transport"),allowBlank:true,hidden:!App.user.isAdmin}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["trunkform"],["component","box","container","panel","form","trunkform"],{component:true,box:true,container:true,panel:true,form:true,trunkform:true},["widget.trunkform"],0,[MBilling.view.trunk,"Form"],0));(Ext.cmd.derive("MBilling.view.trunk.Lookup",Ext.ux.form.field.Lookup,{name:"id_trunk",fieldLabel:t("Trunk"),displayField:"idTrunktrunkcode",displayFieldList:"trunkcode",gridConfig:{xtype:"trunklist",fieldSearch:"trunkcode",columns:[{header:t("trunkcode"),dataIndex:"trunkcode"}]}},0,["trunklookup"],["component","box","container","fieldcontainer","trunklookup"],{component:true,box:true,container:true,fieldcontainer:true,trunklookup:true},["widget.trunklookup"],0,[MBilling.view.trunk,"Lookup"],0));(Ext.cmd.derive("MBilling.view.prefix.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.prefix"],0,[MBilling.view.prefix,"Controller"],0));(Ext.cmd.derive("MBilling.view.prefix.Combo",Ext.form.field.ComboBox,{name:"id_prefix",fieldLabel:t("destination"),displayField:"prefix",filterMode:"remote",valueField:"id",listConfig:{itemTpl:Ext.create("Ext.XTemplate","
{prefix} - {destination}
")},displayTpl:Ext.create("Ext.XTemplate",'{prefix} - {destination}'),initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.PrefixCombo",{proxy:{type:"uxproxy",module:"prefixCombo",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["prefixcombo"],["component","box","field","textfield","pickerfield","combobox","combo","prefixcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,prefixcombo:true},["widget.prefixcombo"],0,[MBilling.view.prefix,"Combo"],0));(Ext.cmd.derive("MBilling.view.prefix.Module",Ext.ux.panel.Module,{controller:"prefix"},0,["prefixmodule"],["component","box","container","uxpanelmodule","prefixmodule"],{component:true,box:true,container:true,uxpanelmodule:true,prefixmodule:true},["widget.prefixmodule"],0,[MBilling.view.prefix,"Module"],0));(Ext.cmd.derive("Ext.ux.form.field.FileUpload",Ext.form.field.File,{anchor:"0",name:"file",emptyText:t("selectFile"),fieldLabel:t("file"),buttonText:undefined,maxSize:3144000,extAllowed:["csv","ret"],titleTipInfo:t("modelContent"),titleWarning:t("warning"),msgInvalidFile:t("fileNotAllow"),msgInvalidSize:t("maxSizeFile"),childEls:["browseButtonWrap","playButtonWrap"],buttonPlayMargin:5,buttonConfig:{glyph:icons.file},triggers:{filebutton:{type:"component",hideOnReadOnly:false},playbutton:{type:"component"}},applyTriggers:function(e){var d=this,f=(e||{}).playbutton;if(f){f.component=Ext.apply({xtype:"button",iconCls:"icon-play",ownerCt:d,id:d.id+"-play",ui:d.ui,disabled:d.disabled,style:d.getButtonMarginProp()+d.buttonPlayMargin+"px",inputName:d.getName(),scope:d,handler:d.playStop,hidden:true});return Ext.form.field.File.prototype.applyTriggers.call(this,e)}},onRender:function(){var c=this,d;c.isAudio=c.extAllowed.indexOf("wav")!==-1;c.formPanel=c.up("form");c.formPanel.on("edit",c.onEditForm,c);(arguments.callee.$previous||Ext.form.field.File.prototype.onRender).apply(this,arguments);c.triggerPlay=c.getTrigger("playbutton");c.buttonPlay=c.triggerPlay.component;c.triggerPlay.el.setWidth(c.buttonPlay.getEl().getWidth()+c.buttonPlay.getEl().getMargin("lr"));if(Ext.isIE){c.buttonPlay.getEl().repaint()}c.initTipInfo()},reset:function(){var b=this;if(!b.isAudio){return}if(b.audio&&!b.audio.paused&&b.audio.currentTime){b.audio.pause();b.audio.currentTime=0}b.buttonPlay.setIconCls("icon-play");b.triggerPlay.el.setWidth(0);if(Ext.isIE){b.buttonPlay.getEl().repaint()}Ext.form.field.File.prototype.reset.apply(this,arguments)},onEditForm:function(){var g=this,f=g.formPanel.getForm().getRecord(),j=f&&f.get(g.name),e=!Ext.isEmpty(j);if(!g.isAudio){return}if(g.audio&&!g.audio.paused&&g.audio.currentTime){g.audio.pause();g.audio.currentTime=0}g.buttonPlay.setIconCls("icon-play");if(e){g.audio=new Audio(j);g.audio.addEventListener("ended",Ext.bind(g.onEndAudio,g));g.triggerPlay.el.setWidth(g.buttonPlay.el.getWidth()+g.buttonPlay.el.getMargin("lr"));if(Ext.isIE){g.buttonPlay.getEl().repaint()}}else{g.triggerPlay.el.setWidth(0);if(Ext.isIE){g.buttonPlay.getEl().repaint()}}g.buttonPlay.setVisible(e);g.triggerPlay.setVisible(e)},onEndAudio:function(){this.buttonPlay.setIconCls("icon-play")},getTriggerMarkup:function(){var d=this,e=Ext.form.field.File.prototype.getTriggerMarkup.apply(this,arguments),f='';return e+f},playStop:function(e){var d=this,f=e.iconCls==="icon-play";if(f){d.audio.play()}else{if(d.audio&&!d.audio.paused&&d.audio.currentTime){d.audio.pause();d.audio.currentTime=0}}e.setIconCls(f?"icon-stop":"icon-play")},initTipInfo:function(){var b=this;if(!b.htmlTipInfo){return}b.tipInfoFile=Ext.create("Ext.tip.ToolTip",{html:b.htmlTipInfo,anchor:"top",title:b.titleTipInfo,target:b.button.el})},onFileChange:function(e,f,g){var j=this;j.getInfoFile(f);Ext.form.field.File.prototype.onFileChange.apply(this,arguments)},getInfoFile:function(g){var l=this,f=g.target.files[0],j=f.name.split("."),m=j[j.length-1].toLowerCase();if(l.extAllowed.indexOf(m)===-1){Ext.ux.Alert.alert(l.titleWarning,l.msgInvalidFile,"warning");l.reset();return}if(f.size>l.maxSize){Ext.ux.Alert.alert(l.titleWarning,l.msgInvalidSize+Ext.util.Format.fileSize(l.maxSize),"warning");l.reset();return}}},0,["uploadfield"],["component","box","field","textfield","filefield","fileuploadfield","uploadfield"],{component:true,box:true,field:true,textfield:true,filefield:true,fileuploadfield:true,uploadfield:true},["widget.uploadfield"],0,[Ext.ux.form.field,"FileUpload"],0));(Ext.cmd.derive("Ext.ux.window.ImportCsv",Ext.window.Window,{autoShow:true,modal:true,layout:"fit",iconCls:"icon-import-csv",title:t("importFromCsv"),width:400,height:window.isThemeTriton?220:175,labelWidthFields:75,htmlTipInfo:"",fieldsImport:[],listeners:{close:function(){this.list.setLoading(false)}},initComponent:function(){var d=this,c=Ext.Array.merge(d.fieldsImport,[{xtype:"uploadfield",fieldLabel:t("fileCsv"),htmlTipInfo:d.htmlTipInfo}]);d.items=[{xtype:"form",bodyPadding:5,labelWidthFields:d.labelWidthFields,items:c}];d.title=d.title+(d.titleModule?" - "+d.titleModule:"");d.bbar=[{xtype:"tbtext",text:t("maxSizeFile")+"3 MB"},"->",{iconCls:"icon-import-csv",text:t("importText"),scope:d,handler:d.onImport}];Ext.window.Window.prototype.initComponent.apply(this,arguments)},onImport:function(d){var f=this,e=f.list.store;d.disable();f.list.setLoading(true);f.down("form").submit({url:e.getProxy().api.fromCsv,scope:f,success:function(c,b){var a=Ext.decode(b.response.responseText);if(a.success){Ext.ux.Alert.alert(t("Success"),a.msg,"success")}else{Ext.ux.Alert.alert(t("Error"),a.errors,"error")}d.enable();f.list.setLoading(false);e.load();f.close()},failure:function(c,b){if(Ext.isObject(b.response)){var a=Ext.decode(b.response.responseText);Ext.ux.Alert.alert(t("Error"),a.errors,"error")}else{Ext.ux.Alert.alert(t("Error"),b.response.responseText,"error",true,false)}d.enable();f.list.setLoading(false);f.close()}})}},0,0,["component","box","container","panel","window"],{component:true,box:true,container:true,panel:true,window:true},0,0,[Ext.ux.window,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.prefix.ImportCsv",Ext.ux.window.ImportCsv,{htmlTipInfo:"
"+t("dialprefix")+", "+t("destination")+"",labelWidthFields:160,height:window.isThemeTriton?300:205,initComponent:function(){var b=this;b.fieldsImport=[{style:"margin-top:25px",xtype:"fieldset",title:t("Csv Format"),collapsible:true,collapsed:false,defaults:{labelWidth:190,anchor:"100%",layout:{type:"hbox",labelAlign:b.labelAlignFields}},items:[{xtype:"pontovirgulacombo",name:"delimiter",fieldLabel:t("Delimiter"),width:230}]}];Ext.ux.window.ImportCsv.prototype.initComponent.apply(this,arguments)}},0,["prefiximportcsv"],["component","box","container","panel","window","prefiximportcsv"],{component:true,box:true,container:true,panel:true,window:true,prefiximportcsv:true},["widget.prefiximportcsv"],0,[MBilling.view.prefix,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.prefix.List",Ext.ux.grid.Panel,{store:"Prefix",fieldSearch:"prefix",initComponent:function(){var b=this;b.buttonImportCsv=!App.user.isClient,b.buttonUpdateLot=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("prefix"),dataIndex:"prefix",filter:{type:"string"}},{header:t("destination"),dataIndex:"destination"}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["prefixlist"],["component","box","container","panel","tablepanel","gridpanel","grid","prefixlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,prefixlist:true},["widget.prefixlist"],0,[MBilling.view.prefix,"List"],0));(Ext.cmd.derive("MBilling.view.prefix.Form",Ext.ux.form.Panel,{fieldsHideEdit:["prefix"],items:[{name:"prefix",fieldLabel:t("prefix"),maxLength:18},{name:"destination",fieldLabel:t("destination")}]},0,["prefixform"],["component","box","container","panel","form","prefixform"],{component:true,box:true,container:true,panel:true,form:true,prefixform:true},["widget.prefixform"],0,[MBilling.view.prefix,"Form"],0));(Ext.cmd.derive("MBilling.view.sendCreditProducts.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.sendcreditproducts"],0,[MBilling.view.sendCreditProducts,"Controller"],0));(Ext.cmd.derive("MBilling.view.sendCreditProducts.Module",Ext.ux.panel.Module,{controller:"sendcreditproducts"},0,["sendcreditproductsmodule"],["component","box","container","uxpanelmodule","sendcreditproductsmodule"],{component:true,box:true,container:true,uxpanelmodule:true,sendcreditproductsmodule:true},["widget.sendcreditproductsmodule"],0,[MBilling.view.sendCreditProducts,"Module"],0));(Ext.cmd.derive("MBilling.view.sendCreditProducts.ImportCsv",Ext.ux.window.ImportCsv,{fieldsImport:[{fieldLabel:t("table"),hidden:true,allowBlank:true}]},0,["sendcreditproductsimportcsv"],["component","box","container","panel","window","sendcreditproductsimportcsv"],{component:true,box:true,container:true,panel:true,window:true,sendcreditproductsimportcsv:true},["widget.sendcreditproductsimportcsv"],0,[MBilling.view.sendCreditProducts,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.sendCreditProducts.List",Ext.ux.grid.Panel,{store:"SendCreditProducts",fieldSearch:"operator_name",comparisonfilter:"ct",initComponent:function(){var b=this;b.buttonImportCsv=App.user.isAdmin,b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("Country"),dataIndex:"country",flex:4},{header:t("Country Code"),dataIndex:"country_code",flex:2},{header:t("Operator ID"),dataIndex:"operator_id",flex:2},{header:t("SkuCode"),dataIndex:"SkuCode",flex:2},{header:t("Operator Name"),dataIndex:"operator_name",flex:5},{header:t("Currency destination"),dataIndex:"currency_dest",flex:3},{header:t("Product"),dataIndex:"product",flex:2},{header:t("Currency Origem"),dataIndex:"currency_orig",flex:3},{header:t("Send Value"),dataIndex:"send_value",flex:2},{header:t("Wholesale Price"),dataIndex:"wholesale_price",flex:2},{header:t("Provider"),dataIndex:"provider",flex:2},{header:t("status"),dataIndex:"status",renderer:Helper.Util.formatBooleanActive,comboRelated:"booleancombo",flex:2,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")]]}}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["sendcreditproductslist"],["component","box","container","panel","tablepanel","gridpanel","grid","sendcreditproductslist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,sendcreditproductslist:true},["widget.sendcreditproductslist"],0,[MBilling.view.sendCreditProducts,"List"],0));(Ext.cmd.derive("MBilling.view.sendCreditProducts.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{name:"country",fieldLabel:t("country"),readOnly:true},{name:"operator_name",fieldLabel:t("Operator Name"),readOnly:true},{name:"operator_id",fieldLabel:t("Operator Id")},{name:"SkuCode",fieldLabel:t("SkuCode")},{name:"product",fieldLabel:t("Product")},{name:"send_value",fieldLabel:t("Send Value"),xtype:"moneyfield",mask:"#9.999.990,000000",readOnly:!App.user.isAdmin},{name:"wholesale_price",fieldLabel:t("Wholesale Price"),xtype:"moneyfield",mask:"#9.999.990,000000",readOnly:!App.user.isAdmin},{xtype:"combobox",name:"provider",value:"TransferTo",forceSelection:true,editable:false,store:[["TransferTo","TransferTo"],["Ding","Ding"],["TanaSend","TanaSend"]],fieldLabel:t("Provider")},{xtype:"yesnocombo",name:"status",fieldLabel:t("status")},{xtype:"textareafield",name:"info",fieldLabel:t("info"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["sendcreditproductsform"],["component","box","container","panel","form","sendcreditproductsform"],{component:true,box:true,container:true,panel:true,form:true,sendcreditproductsform:true},["widget.sendcreditproductsform"],0,[MBilling.view.sendCreditProducts,"Form"],0));(Ext.cmd.derive("MBilling.view.sendCreditRates.Controller",Ext.ux.app.ViewController,{onResetPrice:function(e){var f=this,d=f.list.getSelectionModel().getSelection()[0];Ext.Ajax.request({url:"index.php/SendCreditRates/resetSellPrice",scope:f,success:function(b){b=Ext.decode(b.responseText);if(b[f.nameSuccessRequest]){Ext.ux.Alert.alert(f.titleSuccess,b[f.nameMsgRequest],"success")}else{var a=Helper.Util.convertErrorsJsonToString(b[f.nameMsgRequest]);Ext.ux.Alert.alert(f.titleSuccess,a,"error")}}});f.store.load()}},0,0,0,0,["controller.sendcreditrates"],0,[MBilling.view.sendCreditRates,"Controller"],0));(Ext.cmd.derive("MBilling.view.sendCreditRates.Module",Ext.ux.panel.Module,{controller:"sendcreditrates"},0,["sendcreditratesmodule"],["component","box","container","uxpanelmodule","sendcreditratesmodule"],{component:true,box:true,container:true,uxpanelmodule:true,sendcreditratesmodule:true},["widget.sendcreditratesmodule"],0,[MBilling.view.sendCreditRates,"Module"],0));(Ext.cmd.derive("MBilling.view.sendCreditRates.List",Ext.ux.grid.Panel,{store:"SendCreditRates",fieldSearch:"idProduct.operator_name",comparisonfilter:"ct",initComponent:function(){var b=this;b.buttonUpdateLotCallShopRate=true;b.buttonCsv=false;b.allowPrint=false;b.extraButtons=[{text:t("Reset")+" "+t("Sell price"),iconCls:"icon-chart-column",width:130,handler:"onResetPrice",disabled:false}];b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{xtype:"templatecolumn",tpl:"{idProductoperator_name}",header:t("Operator Name"),dataIndex:"idProductoperator_name",filter:{type:"string",field:"idProduct.operator_name"},flex:5},{xtype:"templatecolumn",tpl:"{idProductcountry}",header:t("Country"),dataIndex:"idProductcountry",filter:{type:"string",field:"idProduct.country"},flex:4},{xtype:"templatecolumn",tpl:"{idProductcurrency_dest}",header:t("Currency destination"),dataIndex:"idProductcurrency_dest",filter:{type:"string",field:"idProduct.currency_dest"},flex:3},{xtype:"templatecolumn",tpl:"{idProductproduct}",header:t("Product"),dataIndex:"idProductproduct",filter:{type:"string",field:"idProduct.product"},flex:2},{xtype:"templatecolumn",tpl:"{idProductcurrency_orig}",header:t("Currency Origin"),dataIndex:"idProductcurrency_orig",filter:{type:"string",field:"idProduct.currency_orig"},flex:3},{xtype:"templatecolumn",tpl:"{idProductwholesale_price}",header:t("Wholesale Price"),dataIndex:"idProductwholesale_price",filter:{type:"string",field:"idProduct.wholesale_price"},flex:2},{header:t("Sell Price"),dataIndex:"sell_price",flex:2}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["sendcreditrateslist"],["component","box","container","panel","tablepanel","gridpanel","grid","sendcreditrateslist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,sendcreditrateslist:true},["widget.sendcreditrateslist"],0,[MBilling.view.sendCreditRates,"List"],0));(Ext.cmd.derive("MBilling.view.sendCreditRates.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["idProductcountry","idProductoperator_name"],initComponent:function(){var b=this;b.items=[{name:"idProductcountry",fieldLabel:t("country"),readOnly:true},{name:"idProductoperator_name",fieldLabel:t("Operator Name"),readOnly:true},{name:"sell_price",fieldLabel:t("Sell Price"),xtype:"moneyfield",mask:"#9.999.990,00",readOnly:App.user.isAdmin}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["sendcreditratesform"],["component","box","container","panel","form","sendcreditratesform"],{component:true,box:true,container:true,panel:true,form:true,sendcreditratesform:true},["widget.sendcreditratesform"],0,[MBilling.view.sendCreditRates,"Form"],0));(Ext.cmd.derive("MBilling.view.prefix.Lookup",Ext.ux.form.field.Lookup,{name:"id_prefix",fieldLabel:t("Destination"),displayField:"idPrefixdestination",displayFieldList:"destination",gridConfig:{xtype:"prefixlist",fieldSearch:"destination",columns:[{header:t("prefix"),dataIndex:"prefix",flex:2},{header:t("destination"),dataIndex:"destination",flex:2}]}},0,["prefixlookup"],["component","box","container","fieldcontainer","prefixlookup"],{component:true,box:true,container:true,fieldcontainer:true,prefixlookup:true},["widget.prefixlookup"],0,[MBilling.view.prefix,"Lookup"],0));(Ext.cmd.derive("MBilling.view.sipTrace.Controller",Ext.ux.app.ViewController,{onNewFilter:function(d){var f=this,e=f.getView();Ext.widget("siptracefilter",{title:"SipTrace",list:f.list})},onDeleteLog:function(d){var c=this;Ext.Msg.confirm(c.titleConfirmation,t("Confirm delete all log file?"),function(a){if(a==="yes"){Ext.Ajax.request({url:"index.php/sipTrace/destroy",scope:c,success:function(b){Ext.ux.Alert.alert(c.titleSuccess,t("Success: The Sip Trace file was deleted"),"success");c.store.load()}})}})},onClearAll:function(d){var c=this;Ext.Ajax.request({url:"index.php/sipTrace/clearAll",scope:c,success:function(a){Ext.ux.Alert.alert(c.titleSuccess,t("Success"),"success");c.store.load()}})},onExportPcap:function(d){var c=this;window.open("index.php/sipTrace/export")},onDetails:function(d){var f=this,e=f.list.getSelectionModel().getSelection()[0];window.open("index.php/sipTrace/details?callid="+e.get("callid"))}},0,0,0,0,["controller.siptrace"],0,[MBilling.view.sipTrace,"Controller"],0));(Ext.cmd.derive("MBilling.view.sipTrace.Module",Ext.ux.panel.Module,{controller:"siptrace"},0,["siptracemodule"],["component","box","container","uxpanelmodule","siptracemodule"],{component:true,box:true,container:true,uxpanelmodule:true,siptracemodule:true},["widget.siptracemodule"],0,[MBilling.view.sipTrace,"Module"],0));(Ext.cmd.derive("MBilling.view.sipTrace.Filter",Ext.window.Window,{autoShow:true,modal:true,layout:"fit",iconCls:"icon-import-csv",title:t("SipTrace filter"),width:400,height:window.isThemeTriton?220:180,labelWidthFields:120,htmlTipInfo:"",fieldsImport:[],initComponent:function(){var b=this;b.items=[{xtype:"form",bodyPadding:5,defaults:{anchor:"0",enableKeyEvents:true,labelWidth:b.labelWidthFields,msgTarget:"side",plugins:"markallowblank",allowBlank:false},items:[{xtype:"numberfield",value:60,min:5,max:300,name:"timeout",fieldLabel:t("Filter timeout")},{xtype:"numberfield",name:"port",fieldLabel:t("Port"),allowBlank:false,value:5060},{xtype:"textfield",name:"filter",fieldLabel:t("Filter"),allowBlank:false,emptyText:"IP, sip account or number ...."}]}];b.title=b.title+(b.titleModule?" - "+b.titleModule:"");b.bbar=[{width:150,iconCls:"icon-play",text:t("Start"),scope:b,handler:b.onStart}];Ext.window.Window.prototype.initComponent.apply(this,arguments)},onStart:function(d){var f=this,e=f.list.store;if(!f.down("form").isValid()){return}f.list.setLoading(true);Ext.Ajax.setTimeout(1000000);f.down("form").submit({url:"index.php/sipTrace/start",scope:f,success:function(c,b){var a=Ext.decode(b.response.responseText);console.log(a);if(a.success){Ext.ux.Alert.alert(t("Success"),a.msg,"success")}else{Ext.ux.Alert.alert(t("Error"),a.errors,"error")}d.enable();f.list.setLoading(false);e.load();f.close()},failure:function(c,b){console.log(b.response.responseText);if(b.response&&Ext.isObject(b.response.responseText)){var a=Ext.decode(b.response.responseText);Ext.ux.Alert.alert(t("Error"),a.errors,"error",true,30)}else{Ext.ux.Alert.alert(t("Error"),Ext.decode(b.response.responseText).msg,"error",true,30)}d.enable();f.list.setLoading(false);e.load();f.close()}})}},0,["siptracefilter"],["component","box","container","panel","window","siptracefilter"],{component:true,box:true,container:true,panel:true,window:true,siptracefilter:true},["widget.siptracefilter"],0,[MBilling.view.sipTrace,"Filter"],0));(Ext.cmd.derive("MBilling.view.sipTrace.List",Ext.ux.grid.Panel,{store:"SipTrace",initComponent:function(){var b=this;b.buttonImportCsv=false;b.buttonCsv=false;b.allowPrint=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.collapsedExtraFilters=false;b.allowDelete=false;b.extraButtons=[{text:b.textDelete,glyph:b.glyphDelete,handler:"onDeleteLog",width:120},{text:t("Start Capture"),iconCls:"icon-save-all",handler:"onNewFilter",width:120},{text:t("Stop Capture"),iconCls:"icon-clean-filter",handler:"onClearAll",width:120},{text:t("Export File"),iconCls:"icon-save-all",handler:"onExportPcap",width:150},{text:t("Details"),glyph:icons.info,handler:"onDetails",width:150}];b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,menuDisabled:true,hideable:App.user.isAdmin},{header:t("method"),dataIndex:"method",flex:3},{header:t("callid"),dataIndex:"callid",flex:7},{header:t("SIP To "),dataIndex:"sipto",flex:5},{header:t("Source"),dataIndex:"fromip",renderer:function(a){a=a==window.myIP?''+a+"":a;return a},flex:3},{header:t("Destination"),dataIndex:"toip",renderer:function(a){a=a==window.myIP?''+a+"":a;return a},flex:4},{header:t("head"),dataIndex:"head",flex:3,menuDisabled:true,hidden:true,hideable:true}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["siptracelist"],["component","box","container","panel","tablepanel","gridpanel","grid","siptracelist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,siptracelist:true},["widget.siptracelist"],0,[MBilling.view.sipTrace,"List"],0));(Ext.cmd.derive("MBilling.view.sipTrace.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.allowCreate=false;height=Ext.Element.getViewportHeight()-200;b.items=[{xtype:"textareafield",name:"head",height:height,anchor:"100%",allowBlank:true,readOnly:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["siptraceform"],["component","box","container","panel","form","siptraceform"],{component:true,box:true,container:true,panel:true,form:true,siptraceform:true},["widget.siptraceform"],0,[MBilling.view.sipTrace,"Form"],0));(Ext.cmd.derive("MBilling.view.sip.Controller",Ext.ux.app.ViewController,{init:function(){var b=this;b.control({typesipforwardcombo:{select:b.onSelectMethod}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectMethod:function(c,d){this.showFieldsRelated(d.getData().showFields)},showFieldsRelated:function(l){var m=this,n=m.formPanel.getForm(),j=m.formPanel.getForm().getFields(),g=Ext.get(Ext.Element.getActiveElement()).component,o=g.name.substr(-2);m.onSetVisibleFiel(g,n,o,g.value)},onSetVisibleFiel:function(f,j,e,g){if(f.value=="undefined"){f.setValue("undefined")}j.findField("id_queue").setValue("");j.findField("id_sip").setValue("");j.findField("id_ivr").setValue("");j.findField("extension").setValue("");j.findField("id_queue").setVisible(g.match("^queue"));j.findField("id_sip").setVisible(g.match("^sip"));j.findField("id_ivr").setVisible(g.match("^ivr"));j.findField("extension").setVisible(g.match("^group|^number|^custom"))},onGetDiskSpaceService:function(b){filterGroupp=Ext.encode([{type:"numeric",comparison:"eq",value:App.user.id,field:"id_user"},{type:"numeric",comparison:"eq",value:1,field:"status"}]),Ext.Ajax.request({url:"index.php/servicesUse/read?filter="+filterGroupp,success:function(a){a=Ext.decode(a.responseText);b(a.rows)}})},onEdit:function(){var j=this,l=j.formPanel.getForm(),f=j.list.getSelectionModel().getSelection()[0],g=j.formPanel.idRecord?f.get("allow").split(","):["g729","gsm","alaw","ulaw"],m=j.formPanel.down("checkboxgroup");if(App.user.isClient){l.findField("record_call").setVisible(false);j.onGetDiskSpaceService(function(a){Ext.each(a,function(b){if(b.idServicestype=="disk_space"){j.formPanel.getForm().findField("record_call").setVisible(true)}})})}fieldValue=f.getData()["type_forward"];l.findField("type_forward").setVisible(true);if(fieldValue=="ivr"){l.findField("id_ivr").setVisible(true);l.findField("id_sip").setVisible(false);l.findField("id_queue").setVisible(false);l.findField("extension").setVisible(false)}else{if(fieldValue=="sip"){l.findField("id_sip").setVisible(true);l.findField("id_ivr").setVisible(false);l.findField("id_queue").setVisible(false);l.findField("extension").setVisible(false)}else{if(fieldValue=="queue"){l.findField("id_queue").setVisible(true);l.findField("id_sip").setVisible(false);l.findField("id_ivr").setVisible(false);l.findField("extension").setVisible(false)}else{if(fieldValue.match("custom|number|group")){l.findField("extension").setVisible(true);l.findField("id_ivr").setVisible(false);l.findField("id_sip").setVisible(false);l.findField("id_queue").setVisible(false)}else{l.findField("id_queue").setVisible(false);l.findField("id_sip").setVisible(false);l.findField("id_ivr").setVisible(false);l.findField("extension").setVisible(false)}}}}Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments);m.setValue({allow:g})},onNew:function(){var f=this,d=f.formPanel.getForm(),e=f.list.getSelectionModel().getSelection()[0];if(App.user.isClient){f.formPanel.getForm().findField("defaultuser").setReadOnly(false)}d.findField("id_ivr").setVisible(false);d.findField("id_sip").setVisible(false);d.findField("id_queue").setVisible(false);d.findField("id_ivr").setVisible(false);d.findField("id_queue").setVisible(false);d.findField("type_forward").setVisible(true);Ext.ux.app.ViewController.prototype.onNew.apply(this,arguments)}},0,0,0,0,["controller.sip"],0,[MBilling.view.sip,"Controller"],0));(Ext.cmd.derive("MBilling.view.sip.Module",Ext.ux.panel.Module,{controller:"sip"},0,["sipmodule"],["component","box","container","uxpanelmodule","sipmodule"],{component:true,box:true,container:true,uxpanelmodule:true,sipmodule:true},["widget.sipmodule"],0,[MBilling.view.sip,"Module"],0));(Ext.cmd.derive("MBilling.view.sip.List",Ext.ux.grid.Panel,{store:"Sip",fieldSearch:"idUser.username",initComponent:function(){var b=this;b.columns=b.columns||[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("Status"),dataIndex:"lineStatus",width:3,menuDisabled:true,renderer:Helper.Util.formatStatusImage},{header:t("accountcode"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4},{header:t("username"),dataIndex:"name",flex:4},{header:t("host"),dataIndex:"host",flex:4},{header:t("codec"),dataIndex:"allow",flex:5},{header:"group",dataIndex:"group",flex:3},{header:t("context"),dataIndex:"context",hidden:true,hideable:!App.user.isClient,flex:1},{header:t("record_call"),dataIndex:"record_call",renderer:Helper.Util.formattyyesno,filter:{type:"list",options:[[0,t("no")],[1,t("yes")]]},flex:2,hidden:true,hideable:!App.user.isClient},{header:t("callerid"),dataIndex:"callerid",hidden:true,hideable:!App.user.isClient,flex:1},{header:"nat",dataIndex:"nat",hidden:true,hideable:!App.user.isClient,flex:1},{header:"directmedia",dataIndex:"directmedia",hidden:true,hideable:!App.user.isClient,flex:1},{header:"qualify",dataIndex:"qualify",hidden:true,hideable:!App.user.isClient,flex:1},{header:"dtmfmode",dataIndex:"dtmfmode",hidden:true,hideable:!App.user.isClient,flex:1},{header:"insecure",dataIndex:"insecure",hidden:true,hideable:!App.user.isClient,flex:1},{header:"type",dataIndex:"type",hidden:true,hideable:!App.user.isClient,flex:1},{header:"allowtransfer",dataIndex:"allowtransfer",hidden:true,hideable:!App.user.isClient,flex:1},{header:"calllimit",dataIndex:"calllimit",hidden:true,hideable:!App.user.isClient,flex:1}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["siplist"],["component","box","container","panel","tablepanel","gridpanel","grid","siplist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,siplist:true},["widget.siplist"],0,[MBilling.view.sip,"List"],0));(Ext.cmd.derive("MBilling.view.sip.Form",Ext.ux.form.Panel,{bodyPadding:0,fieldsHideUpdateLot:["id_user","defaultuser","secret"],initComponent:function(){var b=this;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{labelAlign:"right",plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true}},items:[{title:t("general"),items:[{xtype:"userlookup",ownerForm:b,fieldLabel:t("accountcode"),hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"defaultuser",fieldLabel:t("username"),minLength:4,allowBlank:true,readOnly:App.user.isClient},{name:"secret",fieldLabel:t("password"),allowBlank:true,minLength:6},{name:"callerid",fieldLabel:t("callerid"),allowBlank:true},{name:"alias",fieldLabel:t("Alias"),allowBlank:true,minLength:3},{name:"disallow",fieldLabel:"disallow",value:"all",hidden:!App.user.isAdmin,allowBlank:App.user.isClient},{xtype:"checkboxgroup",columns:3,fieldLabel:t("codec"),items:[{boxLabel:"g729",name:"allow",inputValue:"g729",checked:true},{boxLabel:"g723",name:"allow",inputValue:"g723"},{boxLabel:"gsm",name:"allow",inputValue:"gsm",checked:true},{boxLabel:"g726",name:"allow",inputValue:"g726"},{boxLabel:"opus",name:"allow",inputValue:"opus",checked:true},{boxLabel:"alaw",name:"allow",inputValue:"alaw",checked:true},{boxLabel:"ulaw",name:"allow",inputValue:"ulaw",checked:true},{boxLabel:"g722",name:"allow",inputValue:"g722"},{boxLabel:"ilbc",name:"allow",inputValue:"ilbc"},{boxLabel:"speex",name:"allow",inputValue:"speex"},{boxLabel:"h263p",name:"allow",inputValue:"h263p"},{boxLabel:"h263",name:"allow",inputValue:"h263"},{boxLabel:"h264",name:"allow",inputValue:"h264"},{boxLabel:"vp8",name:"allow",inputValue:"vp8"}],hidden:!App.user.isAdmin,allowBlank:App.user.isClient},{name:"host",fieldLabel:t("host"),value:"dynamic",hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"group",fieldLabel:t("group"),allowBlank:true},{xtype:"yesnostringcombo",name:"videosupport",fieldLabel:"videosupport",value:"no",allowBlank:!App.user.isAdmin},{name:"block_call_reg",fieldLabel:t("Block Call REGEX"),allowBlank:true,hidden:!window.doac},{xtype:"noyescombo",name:"record_call",fieldLabel:t("record_call"),allowBlank:true,hidden:!App.user.isAdmin},{xtype:"numberfield",name:"techprefix",fieldLabel:t("TechPrefix"),hidden:!window.usertech||!App.user.isAdmin,allowBlank:true,maxLength:6}]},{title:t("Nat"),hidden:!App.user.isAdmin,items:[{name:"nat",fieldLabel:"nat",value:"force_rport,comedia",allowBlank:!App.user.isAdmin},{name:"directmedia",fieldLabel:"directmedia",value:"no",allowBlank:!App.user.isAdmin},{xtype:"yesnostringcombo",name:"qualify",fieldLabel:"qualify",value:"no",allowBlank:!App.user.isAdmin}]},{title:t("Additional"),hidden:!App.user.isAdmin,defaults:{labelAlign:"right",plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true,labelWidth:142},items:[{name:"context",fieldLabel:t("context"),value:"billing",hidden:!App.user.isAdmin,allowBlank:true},{name:"dtmfmode",fieldLabel:"dtmfmode",value:"RFC2833",allowBlank:!App.user.isAdmin},{name:"insecure",fieldLabel:"insecure",value:"no",allowBlank:true},{name:"deny",fieldLabel:"deny",allowBlank:true,hidden:!App.user.isAdmin},{name:"permit",fieldLabel:"permit",allowBlank:true,hidden:!App.user.isAdmin},{name:"type",fieldLabel:"type",value:"friend",allowBlank:!App.user.isAdmin},{xtype:"noyesstringcombo",name:"allowtransfer",fieldLabel:"allowtransfer",value:"no",allowBlank:!App.user.isAdmin},{xtype:"noyescombo",name:"ringfalse",fieldLabel:t("Ring false"),value:"0",allowBlank:!App.user.isAdmin},{name:"calllimit",xtype:"numberfield",fieldLabel:t("calllimit"),value:"0",allowBlank:!App.user.isAdmin},{xtype:"noyescombo",name:"voicemail",fieldLabel:t("Enable")+" "+t("VoiceMail"),value:"0",allowBlank:App.user.isClient},{name:"mohsuggest",fieldLabel:t("MOH"),allowBlank:true,hidden:!App.user.isAdmin},{name:"url_events",fieldLabel:t("Url Events notify"),hidden:!App.user.isAdmin||!window.events===true,allowBlank:true}]},{title:t("Forward"),itemId:"option",bodyPadding:10,defaults:{xtype:"fieldcontainer",layout:"hbox",plugins:"markallowblank",allowBlank:true,anchor:"100%",labelWidth:60,defaults:{hideLabel:true,hidden:true,flex:5,startX:100,allowBlank:true,ownerForm:b}},items:[{fieldLabel:t("Forward"),items:[{name:"type_forward",xtype:"typesipforwardcombo",flex:2},{xtype:"ivrlookup",name:"id_ivr",displayField:"id_ivr_name"},{xtype:"queuelookup",name:"id_queue",displayField:"id_queue_name"},{xtype:"sip2lookup",name:"id_sip",displayField:"id_sip_name"},{xtype:"textfield",name:"extension"}]},{name:"dial_timeout",xtype:"numberfield",fieldLabel:t("Dial timeout"),value:"60",labelWidth:90}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["sipform"],["component","box","container","panel","form","sipform"],{component:true,box:true,container:true,panel:true,form:true,sipform:true},["widget.sipform"],0,[MBilling.view.sip,"Form"],0));(Ext.cmd.derive("MBilling.view.sip.Lookup",Ext.ux.form.field.Lookup,{name:"id_sip",fieldLabel:t("Sip"),displayField:"idSipname",displayFieldList:"name",gridConfig:{xtype:"siplist",fieldSearch:"name",columns:[{header:t("Account"),dataIndex:"idUserusername",flex:2},{header:t("name"),dataIndex:"name",flex:2}]}},0,["siplookup"],["component","box","container","fieldcontainer","siplookup"],{component:true,box:true,container:true,fieldcontainer:true,siplookup:true},["widget.siplookup"],0,[MBilling.view.sip,"Lookup"],0));(Ext.cmd.derive("MBilling.view.sip2.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.sip2"],0,[MBilling.view.sip2,"Controller"],0));(Ext.cmd.derive("MBilling.view.sip2.Module",Ext.ux.panel.Module,{controller:"sip2"},0,["sip2module"],["component","box","container","uxpanelmodule","sip2module"],{component:true,box:true,container:true,uxpanelmodule:true,sip2module:true},["widget.sip2module"],0,[MBilling.view.sip2,"Module"],0));(Ext.cmd.derive("MBilling.view.sip2.List",Ext.ux.grid.Panel,{store:"Sip2",fieldSearch:"name",initComponent:function(){var b=this;b.columns=b.columns||[{header:t("accountcode"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4},{header:t("username"),dataIndex:"name",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["sip2list"],["component","box","container","panel","tablepanel","gridpanel","grid","sip2list"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,sip2list:true},["widget.sip2list"],0,[MBilling.view.sip2,"List"],0));(Ext.cmd.derive("MBilling.view.sip2.Form",Ext.ux.form.Panel,{bodyPadding:0},0,["sip2form"],["component","box","container","panel","form","sip2form"],{component:true,box:true,container:true,panel:true,form:true,sip2form:true},["widget.sip2form"],0,[MBilling.view.sip2,"Form"],0));(Ext.cmd.derive("MBilling.view.sip2.Lookup",Ext.ux.form.field.Lookup,{name:"id_sip",fieldLabel:t("Sip"),displayField:"id_sip_name",displayFieldList:"name",gridConfig:{xtype:"sip2list",fieldSearch:"name",columns:[{header:t("Account"),dataIndex:"idUserusername",flex:2},{header:t("name"),dataIndex:"name",flex:2}]}},0,["sip2lookup"],["component","box","container","fieldcontainer","sip2lookup"],{component:true,box:true,container:true,fieldcontainer:true,sip2lookup:true},["widget.sip2lookup"],0,[MBilling.view.sip2,"Lookup"],0));(Ext.cmd.derive("MBilling.view.sipuras.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.sipuras"],0,[MBilling.view.sipuras,"Controller"],0));(Ext.cmd.derive("MBilling.view.sipuras.Module",Ext.ux.panel.Module,{controller:"sipuras"},0,["sipurasmodule"],["component","box","container","uxpanelmodule","sipurasmodule"],{component:true,box:true,container:true,uxpanelmodule:true,sipurasmodule:true},["widget.sipurasmodule"],0,[MBilling.view.sipuras,"Module"],0));(Ext.cmd.derive("MBilling.view.sipuras.List",Ext.ux.grid.Panel,{store:"Sipuras",initComponent:function(){var b=this;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"}},{header:"Serial",dataIndex:"nserie"},{header:"Mac",dataIndex:"macadr"},{header:t("username")+" 1",dataIndex:"User_ID_1"},{header:t("username")+" 2",dataIndex:"User_ID_2"},{header:t("last_ip"),dataIndex:"last_ip"},{header:t("obs"),dataIndex:"obs"},{header:t("last")+" "+t("register"),dataIndex:"fultmov",renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s")}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["sipuraslist"],["component","box","container","panel","tablepanel","gridpanel","grid","sipuraslist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,sipuraslist:true},["widget.sipuraslist"],0,[MBilling.view.sipuras,"List"],0));(Ext.cmd.derive("MBilling.view.sipuras.Form",Ext.ux.form.Panel,{bodyPadding:0,fieldsHideUpdateLot:["id_user","nserie","macadr"],initComponent:function(){var b=this;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true,labelAlign:"right"}},items:[{title:t("general"),items:[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"nserie",fieldLabel:"Serial"},{name:"macadr",fieldLabel:"Mac"},{name:"senha_user",fieldLabel:t("password")+" "+t("username"),allowBlank:true},{name:"senha_admin",fieldLabel:t("password")+" "+t("admin"),allowBlank:true},{name:"antireset",fieldLabel:t("antireset"),xtype:"noyescombo"},{name:"Enable_Web_Server",fieldLabel:t("Enable_Web_Server"),xtype:"yesnocombo"},{name:"marca",fieldLabel:"marca",value:"*",hidden:true},{name:"altera",fieldLabel:"altera",value:"si",hidden:true}]},{title:t("line")+" 1",items:[{name:"User_ID_1",fieldLabel:t("username"),allowBlank:true},{name:"Password_1",fieldLabel:t("password"),allowBlank:true},{name:"Use_Pref_Codec_Only_1",fieldLabel:t("Use_Pref_Codec"),xtype:"noyescombo"},{name:"Preferred_Codec_1",fieldLabel:t("codec"),allowBlank:true,value:"G729a"},{name:"Register_Expires_1",fieldLabel:"Register Expires",allowBlank:true,value:"360"},{name:"Dial_Plan_1",fieldLabel:"Dial Plan",allowBlank:true,value:"(*xx|[3469]11|0|00|[2-9]xxxxxx|1xxx[2-9]xxxxxxS0|xxxxxxxxxxxx.)"},{name:"NAT_Mapping_Enable_1_",fieldLabel:"NAT Mapping",allowBlank:true,xtype:"noyescombo"},{name:"NAT_Keep_Alive_Enable_1_",fieldLabel:"NAT Keep Alive",allowBlank:true,xtype:"noyescombo"}]},{title:t("line")+" 2",items:[{name:"User_ID_2",fieldLabel:t("username"),allowBlank:true},{name:"Password_2",fieldLabel:t("password"),allowBlank:true},{name:"Use_Pref_Codec_Only_2",fieldLabel:t("Use_Pref_Codec"),xtype:"noyescombo"},{name:"Preferred_Codec_2",fieldLabel:t("codec"),allowBlank:true,value:"G729a"},{name:"Register_Expires_2",fieldLabel:"Register Expires",allowBlank:true,value:"360"},{name:"Dial_Plan_2",fieldLabel:"Dial Plan",allowBlank:true,value:"(*xx|[3469]11|0|00|[2-9]xxxxxx|1xxx[2-9]xxxxxxS0|xxxxxxxxxxxx.)"},{name:"NAT_Mapping_Enable_2_",fieldLabel:"NAT Mapping",allowBlank:true,xtype:"noyescombo"},{name:"NAT_Keep_Alive_Enable_2_",fieldLabel:"NAT Keep Alive",allowBlank:true,xtype:"noyescombo"}]},{title:"Stun",items:[{name:"STUN_Enable",fieldLabel:t("active")+"Stun",allowBlank:true,xtype:"noyescombo"},{name:"STUN_Test_Enable",fieldLabel:"STUN Test",allowBlank:true,xtype:"noyescombo"},{name:"Substitute_VIA_Addr",fieldLabel:"Substitute VIA Addr",allowBlank:true,xtype:"noyescombo"},{name:"STUN_Server",fieldLabel:"STUN Server",allowBlank:true}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["sipurasform"],["component","box","container","panel","form","sipurasform"],{component:true,box:true,container:true,panel:true,form:true,sipurasform:true},["widget.sipurasform"],0,[MBilling.view.sipuras,"Form"],0));(Ext.cmd.derive("MBilling.view.iax.Controller",Ext.ux.app.ViewController,{onEdit:function(){Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments);var g=this,e=g.list.getSelectionModel().getSelection()[0],f=g.formPanel.idRecord?e.get("allow").split(","):["g729","gsm","alaw","ulaw"],j=g.formPanel.down("checkboxgroup");j.setValue({allow:f})}},0,0,0,0,["controller.iax"],0,[MBilling.view.iax,"Controller"],0));(Ext.cmd.derive("MBilling.view.iax.Module",Ext.ux.panel.Module,{controller:"iax"},0,["iaxmodule"],["component","box","container","uxpanelmodule","iaxmodule"],{component:true,box:true,container:true,uxpanelmodule:true,iaxmodule:true},["widget.iaxmodule"],0,[MBilling.view.iax,"Module"],0));(Ext.cmd.derive("MBilling.view.iax.List",Ext.ux.grid.Panel,{store:"Iax",fieldSearch:"username",initComponent:function(){var b=this;b.columns=b.columns||[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("username"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:3},{header:t("ramal"),dataIndex:"name",flex:3},{header:t("password"),dataIndex:"secret",flex:2},{header:t("host"),dataIndex:"host",flex:3},{header:"IP",dataIndex:"ipaddr",flex:5},{header:t("context"),dataIndex:"context",hidden:true,hideable:!App.user.isClient,flex:1},{header:t("callerid"),dataIndex:"callerid",hidden:true,hideable:!App.user.isClient,flex:1},{header:t("codec"),dataIndex:"allow",hidden:true,hideable:!App.user.isClient,flex:1},{header:"nat",dataIndex:"nat",hidden:true,hideable:!App.user.isClient,flex:1},{header:"qualify",dataIndex:"qualify",hidden:true,hideable:!App.user.isClient,flex:1},{header:"dtmfmode",dataIndex:"dtmfmode",hidden:true,hideable:!App.user.isClient,flex:1},{header:"insecure",dataIndex:"insecure",hidden:true,hideable:!App.user.isClient,flex:1},{header:"type",dataIndex:"type",hidden:true,hideable:!App.user.isClient,flex:1}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["iaxlist"],["component","box","container","panel","tablepanel","gridpanel","grid","iaxlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,iaxlist:true},["widget.iaxlist"],0,[MBilling.view.iax,"List"],0));(Ext.cmd.derive("MBilling.view.iax.Form",Ext.ux.form.Panel,{bodyPadding:0,fieldsHideUpdateLot:["id_user","defaultuser","secret"],initComponent:function(){var b=this;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true,labelAlign:"right"}},items:[{title:t("general"),items:[{xtype:"userlookup",ownerForm:b,fieldLabel:t("accountcode"),hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"username",fieldLabel:t("username"),minLength:4,readOnly:App.user.isClient},{name:"secret",fieldLabel:t("password"),allowBlank:true,minLength:6,readOnly:App.user.isClient},{name:"callerid",fieldLabel:t("callerid"),allowBlank:true},{name:"disallow",fieldLabel:"disallow",value:"all",hidden:!App.user.isAdmin,allowBlank:App.user.isClient},{xtype:"checkboxgroup",columns:3,fieldLabel:t("codec"),items:[{boxLabel:"g729",name:"allow",inputValue:"g729",checked:true},{boxLabel:"g723",name:"allow",inputValue:"g723"},{boxLabel:"gsm",name:"allow",inputValue:"gsm",checked:true},{boxLabel:"g726",name:"allow",inputValue:"g726"},{boxLabel:"alaw",name:"allow",inputValue:"alaw",checked:true},{boxLabel:"ulaw",name:"allow",inputValue:"ulaw",checked:true},{boxLabel:"g722",name:"allow",inputValue:"g722"},{boxLabel:"ilbc",name:"allow",inputValue:"ilbc"},{boxLabel:"speex",name:"allow",inputValue:"speex"},{boxLabel:"h261",name:"allow",inputValue:"h261"},{boxLabel:"h263",name:"allow",inputValue:"h263"}],hidden:!App.user.isAdmin,allowBlank:App.user.isClient},{name:"host",fieldLabel:t("host"),value:"dynamic",hidden:App.user.isClient,allowBlank:App.user.isClient}]},{title:t("natdetails"),hidden:!App.user.isAdmin,items:[{name:"nat",fieldLabel:"nat",value:App.user.asteriskVersion=="1.8"?"yes":"force_rport,comedia",allowBlank:!App.user.isAdmin}]},{title:t("suplementaryInfo"),hidden:!App.user.isAdmin,items:[{name:"context",fieldLabel:t("context"),value:"billing",hidden:!App.user.isAdmin,allowBlank:true},{xtype:"yesnostringcombo",name:"qualify",fieldLabel:"qualify",value:"no",allowBlank:!App.user.isAdmin},{name:"dtmfmode",fieldLabel:"dtmfmode",value:"RFC2833",allowBlank:!App.user.isAdmin},{name:"insecure",fieldLabel:"insecure",value:"no",allowBlank:true},{name:"type",fieldLabel:"type",value:"friend",allowBlank:!App.user.isAdmin},{name:"calllimit",xtype:"numberfield",fieldLabel:t("calllimit"),value:"0",allowBlank:!App.user.isAdmin}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["iaxform"],["component","box","container","panel","form","iaxform"],{component:true,box:true,container:true,panel:true,form:true,iaxform:true},["widget.iaxform"],0,[MBilling.view.iax,"Form"],0));(Ext.cmd.derive("MBilling.view.iax.Lookup",Ext.ux.form.field.Lookup,{name:"id_iax",fieldLabel:t("Iax"),displayField:"idIaxname",displayFieldList:"name",gridConfig:{xtype:"iaxlist",fieldSearch:"name",columns:[{header:t("Account"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:2},{header:t("name"),dataIndex:"name",flex:2}]}},0,["siaxlookup"],["component","box","container","fieldcontainer","siaxlookup"],{component:true,box:true,container:true,fieldcontainer:true,siaxlookup:true},["widget.siaxlookup"],0,[MBilling.view.iax,"Lookup"],0));(Ext.cmd.derive("MBilling.view.callOnLine.Controller",Ext.ux.app.ViewController,{onEdit:function(){var d=this,e=d.list.getSelectionModel().getSelection()[0],f=e.get("uniqueid");Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments);Ext.Ajax.request({url:"index.php/callOnLine/getChannelDetails",params:{id:e.get("uniqueid")},scope:d,success:function(a){a=Ext.decode(a.responseText);if(a[d.nameSuccessRequest]){d.formPanel.getForm().findField("description").setValue(a.description);d.formPanel.getForm().findField("codec").setValue(a.codec);d.formPanel.getForm().findField("reinvite").setValue(a.reinvite);d.formPanel.getForm().findField("from_ip").setValue(a.from_ip);d.formPanel.getForm().findField("ndiscado").setValue(a.ndiscado);d.formPanel.getForm().findField("billsec").setValue(a.billsec);d.formPanel.getForm().findField("callerid").setValue(a.callerid)}else{Ext.ux.Alert.alert(d.titleError,a[d.nameMsgRequest],"error")}}})},onSpyCallFree:function(e){var f=this,d=f.list.getSelectionModel().getSelection()[0];if(f.list.getSelectionModel().getSelection().length==1){Ext.Ajax.request({url:"index.php/callOnLine/spyCall",params:{type:"b",channel:d.get("canal")},scope:f,success:function(a){a=Ext.decode(a.responseText);if(a[f.nameSuccessRequest]){Ext.ux.Alert.alert(f.titleSuccess,a[f.nameMsgRequest],"success")}else{Ext.ux.Alert.alert(f.titleError,a[f.nameMsgRequest],"error")}}})}else{Ext.ux.Alert.alert(f.titleError,"Please Select only a record","notification")}},onDelete:function(e){var f=this,d=f.list.getSelectionModel().getSelection()[0];if(f.list.getSelectionModel().getSelection().length==1){Ext.Ajax.request({url:"index.php/callOnLine/destroy",params:{id:d.get("uniqueid")},scope:f,success:function(a){a=Ext.decode(a.responseText);if(a[f.nameSuccessRequest]){Ext.ux.Alert.alert(f.titleSuccess,a[f.nameMsgRequest],"success")}else{Ext.ux.Alert.alert(f.titleError,a[f.nameMsgRequest],"error")}}})}else{Ext.ux.Alert.alert(f.titleError,"Please Select only a record","notification")}f.store.load()}},0,0,0,0,["controller.callonline"],0,[MBilling.view.callOnLine,"Controller"],0));(Ext.cmd.derive("MBilling.view.callOnLine.Module",Ext.ux.panel.Module,{controller:"callonline"},0,["callonlinemodule"],["component","box","container","uxpanelmodule","callonlinemodule"],{component:true,box:true,container:true,uxpanelmodule:true,callonlinemodule:true},["widget.callonlinemodule"],0,[MBilling.view.callOnLine,"Module"],0));(Ext.cmd.derive("MBilling.view.callOnLine.SpyCall",Ext.window.Window,{modal:true,layout:"fit",iconCls:"call",title:t("Spy call"),width:450,height:window.isThemeNeptune||window.isThemeCrisp?170:window.isThemeTriton?290:170,labelWidthFields:80,channel:0,initComponent:function(){var b=this;if(b.list.getSelectionModel().getSelection().length==1){selected=b.list.getSelectionModel().getSelection()[0];if(selected.get("canal")){b.channel=selected.get("canal")}else{b.channel=selected.get("channel")}b.title=t("Spy call")+" "+selected.get("ndiscado")+" "+b.channel,b.autoShow=true;b.items=[{xtype:"form",bodyPadding:5,defaults:{anchor:"0",enableKeyEvents:true,labelWidth:b.labelWidthFields,msgTarget:"side",plugins:"markallowblank",allowBlank:false},items:[{xtype:"siplookup",name:"id_sip",displayField:t("Sip Account")},{xtype:"combobox",name:"type",value:"b",forceSelection:true,editable:false,store:[["b",t("Only Spy")],["w",t("Whisper, can talk to the spied")],["W",t("Whisper, can talk to the spied but cannot listen the call")]],fieldLabel:t("Spy type")}]}];b.title=b.title+(b.titleModule?" - "+b.titleModule:"");b.bbar=[{width:150,text:t("Send"),scope:b,handler:b.onSendSpy}]}else{Ext.ux.Alert.alert(b.titleError,"Please Select only a record","notification")}Ext.window.Window.prototype.initComponent.apply(this,arguments)},onSendSpy:function(d){var f=this,e=f.list.store;if(!f.down("form").isValid()){Ext.ux.Alert.alert("Alert",t("Select sip account"),"notification");return}f.list.setLoading(true);Ext.Ajax.setTimeout(1000000);f.down("form").submit({url:"index.php/callOnLine/spyCall",params:{id_sip:selected.get("id_sip"),type:selected.get("type"),channel:f.channel},scope:f,success:function(c,b){var a=Ext.decode(b.response.responseText);if(a.success){Ext.ux.Alert.alert(t("Success"),a.msg,"success")}else{Ext.ux.Alert.alert(t("Error"),a.errors,"error")}d.enable();f.list.setLoading(false);e.load();f.close()},failure:function(c,b){console.log(b.response.responseText);if(b.response&&Ext.isObject(b.response.responseText)){var a=Ext.decode(b.response.responseText);Ext.ux.Alert.alert(t("Error1"),a.errors,"error")}else{Ext.ux.Alert.alert(t("Error2"),Ext.decode(b.response.responseText).msg,"error",true,10)}d.enable()}})}},0,["callonlinespycall"],["component","box","container","panel","window","callonlinespycall"],{component:true,box:true,container:true,panel:true,window:true,callonlinespycall:true},["widget.callonlinespycall"],0,[MBilling.view.callOnLine,"SpyCall"],0));(Ext.cmd.derive("MBilling.view.callOnLine.List",Ext.ux.grid.Panel,{store:"CallOnLine",fieldSearch:"idUser.username",refreshTime:15,initComponent:function(){var b=this;b.buttonCsv=false;b.allowPrint=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=!App.user.isClient;b.textDelete=t("Hangup Call"),b.buttonDeleteWidth=140,b.refreshTime=(localStorage&&localStorage.getItem("callonlinerefresh"))||b.refreshTime;b.extraButtons=[{text:t("Spy")+" "+t("call"),iconCls:"call",handler:window.multSpy?"onSpyCall":"onSpyCallFree",width:130,disabled:false},{xtype:"numberfield",field:"jmlhBrg",fieldLabel:t("Refresh Time"),editable:false,minValue:5,labelWidth:90,width:150,selectOnFocus:true,allowDecimals:true,decimalPrecision:2,value:b.refreshTime,listeners:{change:function(a){if(a.value>0){b.refreshTime=a.value;localStorage.setItem("callonlinerefresh",a.value)}}}}];b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("UniqueID"),dataIndex:"uniqueid",hidden:true,hideable:App.user.isAdmin},{header:t("Sip Account"),dataIndex:"canal",flex:3},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:3},{header:t("credit"),dataIndex:"idUsercredit",filter:{type:"int",field:"idUser.credit"},renderer:Helper.Util.formatMoneyDecimal,flex:2},{header:t("number"),dataIndex:"ndiscado",flex:3},{header:t("status"),dataIndex:"status",filter:{type:"string",field:"status"},flex:2},{header:t("duration"),dataIndex:"duration",renderer:Helper.Util.formatsecondsToTime,flex:2},{header:t("trunk"),dataIndex:"tronco",flex:4,hidden:!App.user.isAdmin,hideable:App.user.isAdmin},{header:t("Server"),dataIndex:"server",flex:3,hidden:!window.slave||!App.user.isAdmin,hideable:App.user.isAdmin}];b.sessionLoad=Ext.create("Ext.util.DelayedTask",function(){b.store.load()},b);Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments);b.store.on("load",b.onLoadStore,b)},onLoadStore:function(){var b=this;b.onDeactivateModule();b.onActivateModule()},onRender:function(){var b=this;if(Ext.isObject(b.module)){b.module.on("activate",b.onActivateModule,b);b.module.on("deactivate",b.onDeactivateModule,b);b.module.on("close",b.onCloseModule,b)}Ext.ux.grid.Panel.prototype.onRender.apply(this,arguments)},onActivateModule:function(){this.sessionLoad&&this.sessionLoad.delay(this.refreshTime*1000)},onDeactivateModule:function(){this.sessionLoad&&this.sessionLoad.cancel()},onCloseModule:function(){this.onDeactivateModule();this.sessionLoad=null}},0,["callonlinelist"],["component","box","container","panel","tablepanel","gridpanel","grid","callonlinelist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callonlinelist:true},["widget.callonlinelist"],0,[MBilling.view.callOnLine,"List"],0));(Ext.cmd.derive("MBilling.view.callOnLine.List2",Ext.ux.grid.Panel,{store:"CallOnLine",fieldSearch:"username",refreshTime:10,initComponent:function(){var b=this;b.buttonCsv=false;b.allowPrint=false;b.buttonUpdateLot=false;b.allowCreate=false;b.buttonCleanFilter=false;b.allowUpdate=false;b.allowDelete=false;b.refreshTime=(localStorage&&localStorage.getItem("callonlinerefresh"))||b.refreshTime;b.extraButtons=[{xtype:"numberfield",field:"jmlhBrg",fieldLabel:t("Refresh Time"),editable:false,minValue:5,labelWidth:90,width:150,selectOnFocus:true,allowDecimals:true,decimalPrecision:2,value:b.refreshTime,listeners:{change:function(a){if(a.value>0){b.refreshTime=a.value;localStorage.setItem("callonlinerefresh",a.value)}}}}];b.columns=[{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:2},{header:t("Sip Account"),dataIndex:"canal",flex:3,hidden:true,hideable:true},{header:t("number"),dataIndex:"ndiscado",flex:3},{header:t("status"),dataIndex:"status",filter:{type:"string",field:"status"},flex:2},{header:t("duration"),dataIndex:"duration",renderer:Helper.Util.formatsecondsToTime,flex:2},{header:t("trunk"),dataIndex:"tronco",flex:4,hidden:App.user.isClient,hideable:!App.user.isClient}];b.sessionLoad=Ext.create("Ext.util.DelayedTask",function(){b.store.load()},b);Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments);b.store.on("load",b.onLoadStore,b)},onLoadStore:function(){var b=this;b.onDeactivateModule();b.onActivateModule()},onRender:function(){var b=this;if(Ext.isObject(b.module)){b.module.on("activate",b.onActivateModule,b);b.module.on("deactivate",b.onDeactivateModule,b);b.module.on("close",b.onCloseModule,b)}Ext.ux.grid.Panel.prototype.onRender.apply(this,arguments)},onActivateModule:function(){this.sessionLoad&&this.sessionLoad.delay(this.refreshTime*1000)},onDeactivateModule:function(){this.sessionLoad&&this.sessionLoad.cancel()},onCloseModule:function(){this.onDeactivateModule();this.sessionLoad=null}},0,["callonlinelist2"],["component","box","container","panel","tablepanel","gridpanel","grid","callonlinelist2"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callonlinelist2:true},["widget.callonlinelist2"],0,[MBilling.view.callOnLine,"List2"],0));(Ext.cmd.derive("MBilling.view.callOnLine.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{fieldLabel:t("number"),name:"ndiscado",readOnly:true},{fieldLabel:t("CallerID"),name:"callerid",readOnly:true},{fieldLabel:t("Real")+" "+t("duration"),name:"billsec",readOnly:true},{fieldLabel:t("Codec"),name:"codec",readOnly:true},{fieldLabel:t("Reinvite"),name:"reinvite",readOnly:true},{fieldLabel:t("From IP"),name:"from_ip",readOnly:true},{xtype:"textarea",name:"description",readOnly:true,height:350,anchor:"100%",hidden:!App.user.isAdmin}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callonlineform"],["component","box","container","panel","form","callonlineform"],{component:true,box:true,container:true,panel:true,form:true,callonlineform:true},["widget.callonlineform"],0,[MBilling.view.callOnLine,"Form"],0));(Ext.cmd.derive("MBilling.view.sendCreditSummary.Controller",Ext.ux.app.ViewController,{formHidden:true},0,0,0,0,["controller.sendcreditsummary"],0,[MBilling.view.sendCreditSummary,"Controller"],0));(Ext.cmd.derive("MBilling.view.sendCreditSummary.Module",Ext.form.Panel,{resizable:false,autoShow:true,header:false,items:[{xtype:"component",autoEl:{width:"100%",height:"100%",tag:"iframe",src:"index.php/sendCreditSummary/read"}}]},0,["sendcreditsummarymodule"],["component","box","container","panel","form","sendcreditsummarymodule"],{component:true,box:true,container:true,panel:true,form:true,sendcreditsummarymodule:true},["widget.sendcreditsummarymodule"],0,[MBilling.view.sendCreditSummary,"Module"],0));(Ext.cmd.derive("MBilling.view.sendCreditSummary.List",Ext.ux.grid.Panel,{store:"SendCreditSummary",initComponent:function(){var b=this;b.extraButtons=[{emptyText:t("From Day"),xtype:"searchfield",fieldFilter:"date",filterOnClick:b.filterFieldOnClick,store:b.store,comparison:"gt",type:"date"},{emptyText:t("To Day"),xtype:"searchfield",fieldFilter:"date",filterOnClick:b.filterFieldOnClick,store:b.store,comparison:"lt",type:"date"}];b.buttonCsv=false;b.buttonPrint=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("day"),renderer:Ext.util.Format.dateRenderer("Y-m-d"),dataIndex:"day",menuDisabled:true,flex:3},{header:t("service"),dataIndex:"service",flex:5},{header:t("Total cost"),dataIndex:"total_cost",flex:5,renderer:Helper.Util.formatMoneyDecimal2},{header:t("Total sale"),dataIndex:"total_sale",flex:5,renderer:Helper.Util.formatMoneyDecimal2},{header:t("Earned"),dataIndex:"earned",flex:5,renderer:Helper.Util.formatMoneyDecimal2}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["sendcreditsummarylist"],["component","box","container","panel","tablepanel","gridpanel","grid","sendcreditsummarylist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,sendcreditsummarylist:true},["widget.sendcreditsummarylist"],0,[MBilling.view.sendCreditSummary,"List"],0));(Ext.cmd.derive("MBilling.view.sendCreditSummary.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:App.user.isClient}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["sendcreditsummaryform"],["component","box","container","panel","form","sendcreditsummaryform"],{component:true,box:true,container:true,panel:true,form:true,sendcreditsummaryform:true},["widget.sendcreditsummaryform"],0,[MBilling.view.sendCreditSummary,"Form"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayUser.Controller",Ext.ux.app.ViewController,{onEdit:function(){me=this;me.sumData=me.store.getData().items[0].getData();if(!me.sumData){return}me.formPanel.getForm().getFields().each(function(b){b.setValue(me.sumData[b.name])});me.formPanel.expand()},onExportCsvDayUser:function(o,l,g){var m=this,j=m.list.getStore(),n=m.list.filters.getFilterData().length?Ext.encode(m.list.filters.getFilterData()):j.proxy.extraParams.filter;window.open("index.php/callSummaryDayUser/exportCsvCalls?id="+o.getStore().getAt(l).getData().idUserusername+"&filter="+n)}},0,0,0,0,["controller.callsummarydayuser"],0,[MBilling.view.callSummaryDayUser,"Controller"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayUser.Module",Ext.ux.panel.Module,{controller:"callsummarydayuser",titleDetails:t("total"),iconForm:"icon-sum",cfgEast:{flex:0.4}},0,["callsummarydayusermodule"],["component","box","container","uxpanelmodule","callsummarydayusermodule"],{component:true,box:true,container:true,uxpanelmodule:true,callsummarydayusermodule:true},["widget.callsummarydayusermodule"],0,[MBilling.view.callSummaryDayUser,"Module"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayUser.List",Ext.ux.grid.Panel,{store:"CallSummaryDayUser",initComponent:function(){var b=this;b.buttonImportCsv=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{xtype:"actioncolumn",width:26,sortable:false,menuDisabled:true,header:t(""),dataIndex:"id",items:[{iconCls:"icon-export-csv",tooltip:t("Export CSV"),handler:"onExportCsvDayUser"}],hidden:!App.user.isAdmin},{header:t("day"),renderer:Ext.util.Format.dateRenderer("Y-m-d"),dataIndex:"day",filter:{type:"date",field:"day"},flex:3},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("sessiontime")+" "+t("Min"),dataIndex:"sessiontime",flex:2},{header:t("aloc_all_calls"),dataIndex:"aloc_all_calls",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Answered Calls"),dataIndex:"nbcall",flex:3},{header:t("buycost"),dataIndex:App.user.isAdmin?"buycost":"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("sessionbill"),dataIndex:App.user.isAgent||App.user.isClientAgent?"agent_bill":"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("markup"),dataIndex:"lucro",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarydayuserlist"],["component","box","container","panel","tablepanel","gridpanel","grid","callsummarydayuserlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callsummarydayuserlist:true},["widget.callsummarydayuserlist"],0,[MBilling.view.callSummaryDayUser,"List"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayUser.Form",Ext.ux.form.Panel,{defaults:{},labelWidthFields:100,defaultType:"displayfield",initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{name:"sumsessiontime",fieldLabel:t("sessiontime")+" "+t("Min"),renderer:Ext.util.Format.numberRenderer("0"),allowBlank:true},{name:App.user.isAgent||App.user.isClientAgent?"sumagent_bill":"sumsessionbill",fieldLabel:t("sessionbill"),renderer:Helper.Util.formatMoneyDecimal,allowBlank:true},{name:App.user.isAdmin?"sumbuycost":"sumsessionbill",fieldLabel:t("buycost"),renderer:Helper.Util.formatMoneyDecimal,hidden:App.user.isClient,allowBlank:true},{name:"sumlucro",fieldLabel:t("markup"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumnbcall",fieldLabel:t("nbcall"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarydayuserform"],["component","box","container","panel","form","callsummarydayuserform"],{component:true,box:true,container:true,panel:true,form:true,callsummarydayuserform:true},["widget.callsummarydayuserform"],0,[MBilling.view.callSummaryDayUser,"Form"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayTrunk.Controller",Ext.ux.app.ViewController,{onEdit:function(){me=this;me.sumData=me.store.getData().items[0].getData();if(!me.sumData){return}me.formPanel.getForm().getFields().each(function(b){b.setValue(me.sumData[b.name])});me.formPanel.expand()}},0,0,0,0,["controller.callsummarydaytrunk"],0,[MBilling.view.callSummaryDayTrunk,"Controller"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayTrunk.Module",Ext.ux.panel.Module,{controller:"callsummarydaytrunk",titleDetails:t("total"),iconForm:"icon-sum",cfgEast:{flex:0.4}},0,["callsummarydaytrunkmodule"],["component","box","container","uxpanelmodule","callsummarydaytrunkmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callsummarydaytrunkmodule:true},["widget.callsummarydaytrunkmodule"],0,[MBilling.view.callSummaryDayTrunk,"Module"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayTrunk.List",Ext.ux.grid.Panel,{store:"CallSummaryDayTrunk",initComponent:function(){var b=this;b.buttonImportCsv=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{header:t("day"),renderer:Ext.util.Format.dateRenderer("Y-m-d"),dataIndex:"day",filter:{type:"date",field:"day"},flex:3},{header:t("Trunk"),dataIndex:"idTrunktrunkcode",filter:{type:"string",field:"idTrunk.trunkcode"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("sessiontime")+" "+t("Min"),dataIndex:"sessiontime",flex:2},{header:t("aloc_all_calls"),dataIndex:"aloc_all_calls",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Answered Calls"),dataIndex:"nbcall",flex:3},{header:t("buycost"),dataIndex:"buycost",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("sessionbill"),dataIndex:"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("markup"),dataIndex:"lucro",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarydaytrunklist"],["component","box","container","panel","tablepanel","gridpanel","grid","callsummarydaytrunklist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callsummarydaytrunklist:true},["widget.callsummarydaytrunklist"],0,[MBilling.view.callSummaryDayTrunk,"List"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayTrunk.Form",Ext.ux.form.Panel,{defaults:{},labelWidthFields:100,defaultType:"displayfield",initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{name:"sumsessiontime",fieldLabel:t("sessiontime")+" "+t("Min"),renderer:Ext.util.Format.numberRenderer("0"),allowBlank:true},{name:"sumsessionbill",fieldLabel:t("sessionbill"),renderer:Helper.Util.formatMoneyDecimal,allowBlank:true},{name:"sumbuycost",fieldLabel:t("buycost"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumlucro",fieldLabel:t("markup"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumnbcall",fieldLabel:t("nbcall"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarydaytrunkform"],["component","box","container","panel","form","callsummarydaytrunkform"],{component:true,box:true,container:true,panel:true,form:true,callsummarydaytrunkform:true},["widget.callsummarydaytrunkform"],0,[MBilling.view.callSummaryDayTrunk,"Form"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayAgent.Controller",Ext.ux.app.ViewController,{onEdit:function(){me=this;me.sumData=me.store.getData().items[0].getData();if(!me.sumData){return}me.formPanel.getForm().getFields().each(function(b){b.setValue(me.sumData[b.name])});me.formPanel.expand()}},0,0,0,0,["controller.callsummarydayagent"],0,[MBilling.view.callSummaryDayAgent,"Controller"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayAgent.Module",Ext.ux.panel.Module,{controller:"callsummarydayagent",titleDetails:t("total"),iconForm:"icon-sum",cfgEast:{flex:0.4}},0,["callsummarydayagentmodule"],["component","box","container","uxpanelmodule","callsummarydayagentmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callsummarydayagentmodule:true},["widget.callsummarydayagentmodule"],0,[MBilling.view.callSummaryDayAgent,"Module"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayAgent.List",Ext.ux.grid.Panel,{store:"CallSummaryDayAgent",initComponent:function(){var b=this;b.buttonImportCsv=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{header:t("day"),renderer:Ext.util.Format.dateRenderer("Y-m-d"),dataIndex:"day",filter:{type:"date",field:"day"},flex:3},{header:t("Agent"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{menuDisabled:true,header:t("sessiontime")+" "+t("Min"),dataIndex:"sessiontime",flex:2},{header:t("aloc_all_calls"),dataIndex:"aloc_all_calls",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Answered Calls"),dataIndex:"nbcall",flex:3},{header:t("buycost"),dataIndex:"buycost",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("sessionbill"),dataIndex:"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("markup"),dataIndex:"lucro",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarydayagentlist"],["component","box","container","panel","tablepanel","gridpanel","grid","callsummarydayagentlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callsummarydayagentlist:true},["widget.callsummarydayagentlist"],0,[MBilling.view.callSummaryDayAgent,"List"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayAgent.Form",Ext.ux.form.Panel,{defaults:{},labelWidthFields:100,defaultType:"displayfield",initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{name:"sumsessiontime",fieldLabel:t("sessiontime")+" "+t("Min"),renderer:Ext.util.Format.numberRenderer("0"),allowBlank:true},{name:"sumsessionbill",fieldLabel:t("sessionbill"),renderer:Helper.Util.formatMoneyDecimal,allowBlank:true},{name:"sumbuycost",fieldLabel:t("buycost"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumlucro",fieldLabel:t("markup"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumnbcall",fieldLabel:t("nbcall"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarydayagentform"],["component","box","container","panel","form","callsummarydayagentform"],{component:true,box:true,container:true,panel:true,form:true,callsummarydayagentform:true},["widget.callsummarydayagentform"],0,[MBilling.view.callSummaryDayAgent,"Form"],0));(Ext.cmd.derive("MBilling.view.callerid.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.callerid"],0,[MBilling.view.callerid,"Controller"],0));(Ext.cmd.derive("MBilling.view.callerid.Module",Ext.ux.panel.Module,{controller:"callerid"},0,["calleridmodule"],["component","box","container","uxpanelmodule","calleridmodule"],{component:true,box:true,container:true,uxpanelmodule:true,calleridmodule:true},["widget.calleridmodule"],0,[MBilling.view.callerid,"Module"],0));(Ext.cmd.derive("MBilling.view.callerid.List",Ext.ux.grid.Panel,{store:"Callerid",initComponent:function(){var b=this;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("cid"),dataIndex:"cid",flex:4},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("status"),dataIndex:"activated",renderer:Helper.Util.formatBooleanActive,comboRelated:"booleancombo",flex:2,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")]]}}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["calleridlist"],["component","box","container","panel","tablepanel","gridpanel","grid","calleridlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,calleridlist:true},["widget.calleridlist"],0,[MBilling.view.callerid,"List"],0));(Ext.cmd.derive("MBilling.view.callerid.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["id_user"],initComponent:function(){var b=this;b.items=[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"cid",fieldLabel:t("cid")},{xtype:"booleancombo",name:"activated",fieldLabel:t("status"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["calleridform"],["component","box","container","panel","form","calleridform"],{component:true,box:true,container:true,panel:true,form:true,calleridform:true},["widget.calleridform"],0,[MBilling.view.callerid,"Form"],0));(Ext.cmd.derive("MBilling.view.restrictedPhonenumber.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.restrictedphonenumber"],0,[MBilling.view.restrictedPhonenumber,"Controller"],0));(Ext.cmd.derive("MBilling.view.restrictedPhonenumber.Module",Ext.ux.panel.Module,{controller:"restrictedphonenumber"},0,["restrictedphonenumbermodule"],["component","box","container","uxpanelmodule","restrictedphonenumbermodule"],{component:true,box:true,container:true,uxpanelmodule:true,restrictedphonenumbermodule:true},["widget.restrictedphonenumbermodule"],0,[MBilling.view.restrictedPhonenumber,"Module"],0));(Ext.cmd.derive("MBilling.view.restrictedPhonenumber.List",Ext.ux.grid.Panel,{store:"RestrictedPhonenumber",buttonImportCsv:true,initComponent:function(){var b=this;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:2,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("number"),dataIndex:"number",flex:2}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["restrictedphonenumberlist"],["component","box","container","panel","tablepanel","gridpanel","grid","restrictedphonenumberlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,restrictedphonenumberlist:true},["widget.restrictedphonenumberlist"],0,[MBilling.view.restrictedPhonenumber,"List"],0));(Ext.cmd.derive("MBilling.view.restrictedPhonenumber.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["id_user"],initComponent:function(){var b=this;b.items=[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,readOnly:App.user.isClient,allowBlank:App.user.isClient},{name:"number",fieldLabel:t("number")}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["restrictedphonenumberform"],["component","box","container","panel","form","restrictedphonenumberform"],{component:true,box:true,container:true,panel:true,form:true,restrictedphonenumberform:true},["widget.restrictedphonenumberform"],0,[MBilling.view.restrictedPhonenumber,"Form"],0));(Ext.cmd.derive("MBilling.view.restrictedPhonenumber.ImportCsv",Ext.ux.window.ImportCsv,{htmlTipInfo:"
number
",fieldsImport:[{xtype:"usercombo",width:350}]},0,["restrictedphonenumberimportcsv"],["component","box","container","panel","window","restrictedphonenumberimportcsv"],{component:true,box:true,container:true,panel:true,window:true,restrictedphonenumberimportcsv:true},["widget.restrictedphonenumberimportcsv"],0,[MBilling.view.restrictedPhonenumber,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.did.Controller",Ext.ux.app.ViewController,{isSubmitForm:true,init:function(){var b=this;b.control({"booleancombo[name=cbr]":{select:b.onSelectcbr},"noyescombo[name=cbr_ua]":{select:b.onSelectcbrAu}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectcbr:function(c,d){me=this,form=me.formPanel.getForm();form.findField("cbr_ua").setVisible(d.data.field1);form.findField("cbr_total_try").setVisible(d.data.field1);form.findField("cbr_time_try").setVisible(d.data.field1)},onSelectcbrAu:function(c,d){me=this,form=me.formPanel.getForm();form.findField("cbr_em").setVisible(d.data.field1);form.findField("TimeOfDay_monFri").setVisible(d.data.field1);form.findField("TimeOfDay_sat").setVisible(d.data.field1);form.findField("TimeOfDay_sun").setVisible(d.data.field1);form.findField("workaudio").setVisible(d.data.field1);form.findField("noworkaudio").setVisible(d.data.field1)},onNew:function(e){var f=this,d=f.formPanel.getForm();d.findField("cbr_ua").setVisible(false);d.findField("cbr_em").setVisible(false);d.findField("TimeOfDay_monFri").setVisible(false);d.findField("TimeOfDay_sat").setVisible(false);d.findField("TimeOfDay_sun").setVisible(false);d.findField("workaudio").setVisible(false);d.findField("noworkaudio").setVisible(false);d.findField("cbr_total_try").setVisible(false);d.findField("cbr_time_try").setVisible(false);Ext.ux.app.ViewController.prototype.onNew.apply(this,arguments)},onEdit:function(){var c=this,d=c.list.getSelectionModel().getSelection()[0];if(d.get("cbr")==0){c.formPanel.getForm().findField("cbr_ua").setVisible(false);c.formPanel.getForm().findField("cbr_em").setVisible(false);c.formPanel.getForm().findField("TimeOfDay_monFri").setVisible(false);c.formPanel.getForm().findField("TimeOfDay_sat").setVisible(false);c.formPanel.getForm().findField("TimeOfDay_sun").setVisible(false);c.formPanel.getForm().findField("workaudio").setVisible(false);c.formPanel.getForm().findField("noworkaudio").setVisible(false);c.formPanel.getForm().findField("cbr_total_try").setVisible(false);c.formPanel.getForm().findField("cbr_time_try").setVisible(false)}else{c.formPanel.getForm().findField("cbr_ua").setVisible(true);if(d.get("cbr_ua")==1){c.formPanel.getForm().findField("cbr_em").setVisible(true);c.formPanel.getForm().findField("TimeOfDay_monFri").setVisible(true);c.formPanel.getForm().findField("TimeOfDay_sat").setVisible(true);c.formPanel.getForm().findField("TimeOfDay_sun").setVisible(true);c.formPanel.getForm().findField("workaudio").setVisible(true);c.formPanel.getForm().findField("noworkaudio").setVisible(true);c.formPanel.getForm().findField("cbr_total_try").setVisible(true);c.formPanel.getForm().findField("cbr_time_try").setVisible(true)}}Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)},onDelete:function(j){var g=this,e=g.list.getSelectionModel().getSelection(),f=true;Ext.each(e,function(a){if(a.get("reserved")===1){Ext.ux.Alert.alert(g.titleError,t("Please, first release the DID")+" "+a.raw.did,"error");f=false;return}});if(f==true){Ext.ux.app.ViewController.prototype.onDelete.apply(this,arguments)}},onRelease:function(o,l){var m=this,n=m.list.getSelectionModel().getSelection()[0],j=t("Confirm Release Did")+" "+n.get("did"),g=m.list.getStore();if(m.list.getSelectionModel().getSelection().length>1){Ext.ux.Alert.alert(m.titleError,t("Please Select only one DID to release"),"error")}else{if(n.get("reserved")===0){Ext.ux.Alert.alert(m.titleError,t("didIsNotUse"),"error");g.load()}else{Ext.Msg.confirm(m.titleConfirmation,j,function(a){if(a==="yes"){Ext.Ajax.request({url:"index.php/did/liberar",params:{id:n.get("id")},success:function(c){c=Ext.decode(c.responseText);if(c[m.nameSuccessRequest]){Ext.ux.Alert.alert(m.titleSuccess,c[m.nameMsgRequest],"success");g.load()}else{var b=Helper.Util.convertErrorsJsonToString(c[m.nameMsgRequest]);g.load()}}})}},m)}}},onBuyDid:function(){var m=this,j=m.lookupReference("buydidPanel"),f=j.getForm().findField("did").getValue(),l=j.getForm().findField("did").rawValue,g=t("confirmationBuyDid");if(f<1){Ext.ux.Alert.alert(m.titleError,t("Please, select a Did"),"warning")}else{Ext.Msg.confirm(t("Confirmation"),g+"
"+l,function(a){if(a==="yes"){Ext.ux.Alert.alert(m.titleSuccess,t("Please wait....We are activing your DID."),"notification");Ext.Ajax.request({url:"index.php/did/buy",params:{id:f},success:function(c){c=Ext.decode(c.responseText);if(c.success){Ext.ux.Alert.alert(m.titleSuccess,t(c.msg),"success",true,true,5000)}else{var b=Helper.Util.convertErrorsJsonToString(c.msg);Ext.ux.Alert.alert(m.titleError,t(b),"warning",true,true,5000)}}})}},m)}}},0,0,0,0,["controller.did"],0,[MBilling.view.did,"Controller"],0));(Ext.cmd.derive("MBilling.view.did.Combo",Ext.form.field.ComboBox,{name:"id_did",fieldLabel:t("did"),displayField:"did",forceSelection:true,editable:true,valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Did",{proxy:{type:"uxproxy",module:"did",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["didcombo"],["component","box","field","textfield","pickerfield","combobox","combo","didcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,didcombo:true},["widget.didcombo"],0,[MBilling.view.did,"Combo"],0));(Ext.cmd.derive("MBilling.view.did.BuyCombo",Ext.form.field.ComboBox,{name:"id_did",forceSelection:true,editable:false,fieldLabel:t("did"),displayField:"did",valueField:"id",listConfig:{itemTpl:Ext.create("Ext.XTemplate","
{did} ("+t("Setup")+": "+t("moedasimblo")+" {connection_charge} --> "+t("monthly payment")+": "+t("moedasimblo")+" {fixrate})
")},displayTpl:Ext.create("Ext.XTemplate",'{did} ('+t("Setup")+": "+t("moedasimblo")+" {connection_charge} --> "+t("monthly payment")+": "+t("moedasimblo")+" {fixrate})"),initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Did",{proxy:{type:"uxproxy",module:"did",actionRead:"readBuy",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["didbuycombo"],["component","box","field","textfield","pickerfield","combobox","combo","didbuycombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,didbuycombo:true},["widget.didbuycombo"],0,[MBilling.view.did,"BuyCombo"],0));(Ext.cmd.derive("MBilling.view.did.Module",Ext.ux.panel.Module,{controller:"did"},0,["didmodule"],["component","box","container","uxpanelmodule","didmodule"],{component:true,box:true,container:true,uxpanelmodule:true,didmodule:true},["widget.didmodule"],0,[MBilling.view.did,"Module"],0));(Ext.cmd.derive("MBilling.view.did.List",Ext.ux.grid.Panel,{store:"Did",fieldSearch:"did",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.extraButtons=[{text:t("crearToReleaseDid"),iconCls:"icon-delete",handler:"onRelease",disabled:false}];b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("did"),dataIndex:"did",flex:4},{header:t("reserved"),dataIndex:"reserved",renderer:Helper.Util.formattyyesno,flex:2,filter:{type:"list",options:[[1,t("yes")],[0,t("no")]]},hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:3,menuDisabled:true},{header:t("status"),dataIndex:"activated",renderer:Helper.Util.formatBooleanActive,flex:2,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")]]},hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("connection_charge"),dataIndex:"connection_charge",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("price")+" "+t("per")+" "+t("monthly"),dataIndex:"fixrate",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("secondusedreal"),renderer:Helper.Util.formatsecondsToTime,dataIndex:"secondusedreal",flex:3},{header:t("Description"),dataIndex:"description",hidden:true,hideable:App.user.isAdmin,flex:5}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["didlist"],["component","box","container","panel","tablepanel","gridpanel","grid","didlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,didlist:true},["widget.didlist"],0,[MBilling.view.did,"List"],0));(Ext.cmd.derive("MBilling.view.did.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["did"],initComponent:function(){var b=this;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{labelAlign:"right",plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true,labelWidth:140}},items:[{title:t("general"),items:[{name:"did",fieldLabel:t("did"),readOnly:App.user.isClient||App.user.isAgent},{xtype:"booleancombo",name:"activated",fieldLabel:t("status"),hidden:App.user.isClient||App.user.isAgent,allowBlank:true},{xtype:"moneyfield",name:"connection_charge",fieldLabel:t("connection_charge"),value:"0",hidden:App.user.isClient||App.user.isAgent},{xtype:"moneyfield",name:"fixrate",fieldLabel:t("Monthly")+" "+t("price"),value:"0",hidden:App.user.isClient||App.user.isAgent},{style:"margin-top:5px",xtype:"fieldset",title:t("Did")+" "+t("increment"),collapsible:false,collapsed:false,hidden:!App.user.isAdmin,defaults:{labelWidth:160,anchor:"100%",labelAlign:b.labelAlignFields},items:[{xtype:"moneyfield",name:"connection_sell",fieldLabel:t("Connetion charge"),value:"0",hidden:!App.user.isAdmin},{xtype:"numberfield",name:"minimal_time_charge",fieldLabel:t("Minimal time to charge"),value:"0",hidden:!App.user.isAdmin},{xtype:"numberfield",name:"initblock",fieldLabel:t("initblock"),value:"0",hidden:!App.user.isAdmin},{xtype:"numberfield",name:"increment",fieldLabel:t("billingblock"),value:"0",hidden:!App.user.isAdmin}]},{xtype:"combobox",name:"charge_of",fieldLabel:t("Charge")+" "+t("of"),value:1,forceSelection:true,editable:false,store:[[1,t("Owner DID")],[0,t("Caller ID, only allow call from registered callerID")]],hidden:App.user.isClient||App.user.isAgent},{xtype:"numberfield",name:"calllimit",fieldLabel:t("Channel Limit"),value:"-1",minValue:"-1",hidden:!window.didChannelLimit||!App.user.isAdmin},{xtype:"textareafield",allowBlank:true,name:"description",fieldLabel:t("description"),hidden:!App.user.isAdmin}]},{title:t("Billing"),items:[{style:"margin-top:5px",xtype:"fieldset",title:t("Did Billing per minute")+" "+t("rate")+" 1",collapsible:false,collapsed:false,hidden:!App.user.isAdmin,defaults:{labelWidth:170,anchor:"100%",labelAlign:b.labelAlignFields},items:[{xtype:"textfield",name:"expression_1",fieldLabel:t("Regular expression"),value:"*",hidden:!App.user.isAdmin},{xtype:"moneyfield",name:"selling_rate_1",fieldLabel:t("Sell price per min"),value:"0",hidden:!App.user.isAdmin},{xtype:"noyescombo",name:"block_expression_1",fieldLabel:t("Block calls from this expression"),hidden:!App.user.isAdmin},{xtype:"noyescombo",name:"send_to_callback_1",fieldLabel:t("Send the call to Callback"),hidden:!App.user.isAdmin}]},{style:"margin-top:25px",xtype:"fieldset",title:t("Did Billing per minute")+" "+t("rate")+" 2",collapsible:false,collapsed:false,hidden:!App.user.isAdmin,defaults:{labelWidth:160,anchor:"100%",labelAlign:b.labelAlignFields},items:[{xtype:"textfield",name:"expression_2",fieldLabel:t("Regular expression"),value:"*",hidden:!App.user.isAdmin},{xtype:"moneyfield",name:"selling_rate_2",fieldLabel:t("Sell price per min"),value:"0",hidden:!App.user.isAdmin},{xtype:"noyescombo",name:"block_expression_2",fieldLabel:t("Block calls from this expression"),hidden:!App.user.isAdmin},{xtype:"noyescombo",name:"send_to_callback_2",fieldLabel:t("Send the call to Callback"),hidden:!App.user.isAdmin}]},{style:"margin-top:25px",xtype:"fieldset",title:t("Did Billing per minute")+" "+t("rate")+" 3",collapsible:false,collapsed:false,hidden:!App.user.isAdmin,defaults:{labelWidth:160,anchor:"100%",labelAlign:b.labelAlignFields},items:[{xtype:"textfield",name:"expression_3",fieldLabel:t("Regular expression"),value:"*",hidden:!App.user.isAdmin},{xtype:"moneyfield",name:"selling_rate_3",fieldLabel:t("Sell price per min"),value:"0",hidden:!App.user.isAdmin},{xtype:"noyescombo",name:"block_expression_3",fieldLabel:t("Block calls from this expression"),hidden:!App.user.isAdmin},{xtype:"noyescombo",name:"send_to_callback_3",fieldLabel:t("Send the call to Callback"),hidden:!App.user.isAdmin}]}]},{title:t("CallBack Pro"),hidden:!window.cbr,items:[{xtype:"booleancombo",name:"cbr",fieldLabel:t("CallBack Pro"),value:0,hidden:!window.cbr,allowBlank:true},{xtype:"noyescombo",name:"cbr_ua",fieldLabel:t("Use Audio"),value:0,hidden:true,allowBlank:true},{xtype:"numberfield",name:"cbr_total_try",fieldLabel:t("Maximum trying"),value:3,hidden:true,allowBlank:true,minValue:0},{xtype:"numberfield",name:"cbr_time_try",fieldLabel:t("Interval beteween trying"),value:30,hidden:true,allowBlank:true,minValue:10},{xtype:"noyescombo",name:"cbr_em",fieldLabel:t("Early Media"),hidden:true,allowBlank:true},{name:"TimeOfDay_monFri",fieldLabel:t("Mon-Fri"),value:"09:00-12:00|14:00-18:00",minLength:11,hidden:true},{name:"TimeOfDay_sat",fieldLabel:t("Sat"),value:"09:00-12:00",allowBlank:true,hidden:true},{name:"TimeOfDay_sun",fieldLabel:t("Sun"),value:"00:00",allowBlank:true,hidden:true},{xtype:"uploadfield",fieldLabel:t("workaudio"),emptyText:"Select an gsm File",allowBlank:true,name:"workaudio",extAllowed:["wav","gsm"],hidden:true},{xtype:"uploadfield",fieldLabel:t("noworkaudio"),emptyText:"Select an gsm File",allowBlank:true,name:"noworkaudio",extAllowed:["wav","gsm"],hidden:true}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["didform"],["component","box","container","panel","form","didform"],{component:true,box:true,container:true,panel:true,form:true,didform:true},["widget.didform"],0,[MBilling.view.did,"Form"],0));(Ext.cmd.derive("MBilling.view.did.ImportCsv",Ext.ux.window.ImportCsv,{htmlTipInfo:"
"+t("number")+", "+t("price")+" "+t("by")+" "+t("monthly")+", "+t("connection_charge")+"
551156332233, 10, 5
554153882200, 10, 5
554155667788, 10, 5
"+t("monthly")+" "+t("and")+" "+t("connection_charge")+" "+t("optional")+"",fieldsImport:[{fieldLabel:t("table"),hidden:true,allowBlank:true}]},0,["didimportcsv"],["component","box","container","panel","window","didimportcsv"],{component:true,box:true,container:true,panel:true,window:true,didimportcsv:true},["widget.didimportcsv"],0,[MBilling.view.did,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.didbuy.Module",Ext.form.Panel,{controller:"did",resizable:false,autoShow:true,header:false,initComponent:function(){var b=this;b.items=[{reference:"buydidPanel",xtype:"form",margin:"10 10 10 10",autoShow:true,closable:false,resizable:false,bodyPadding:10,defaultType:"textfield",defaults:{labelAlign:"right",labelWidth:175,width:280,allowBlank:false,msgTarget:"side",enableKeyEvents:true,plugins:"markallowblank",anchor:"100%"},items:[{xtype:"didbuycombo",fieldLabel:t("Select a Did"),name:"did"}],bbar:[{text:t("Next"),tooltip:t("Next"),glyph:icons.disk,handler:"onBuyDid"}]}];Ext.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["didbuymodule"],["component","box","container","panel","form","didbuymodule"],{component:true,box:true,container:true,panel:true,form:true,didbuymodule:true},["widget.didbuymodule"],0,[MBilling.view.didbuy,"Module"],0));(Ext.cmd.derive("MBilling.view.diddestination.Controller",Ext.ux.app.ViewController,{init:function(){var b=this;b.control({didtypefullcombo:{select:b.onSelectMethod},didtypefreecombo:{select:b.onSelectMethod}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectMethod:function(c,d){this.showFieldsRelated(d.getData().showFields)},showFieldsRelated:function(f){var d=this,e=d.formPanel.getForm().getFields();e.each(function(a){a.setVisible(f.indexOf(a.name)!==-1)})},onEdit:function(){var f=this,d=f.formPanel.getForm(),e=f.list.getSelectionModel().getSelection()[0];method=e?e.get("voip_call"):"sipcall";switch(method){case 0:method=t("callforpstn");break;case 1:method=t("sipcall");break;case 2:method=t("ivr");break;case 3:method="CallingCard";break;case 4:method=t("portalDeVoz");break;case 5:method=t("CID Callback");break;case 6:method=t("0800 Callback");break;case 7:method=t("Queue");break;case 8:method=t("Call Group");break;case 9:method=t("Custom");break}showFields=f.formPanel.down("didtypefullcombo").store.findRecord("name",method).getData().showFields;f.showFieldsRelated(showFields);d.findField("id_did").setReadOnly(true);Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)},onNew:function(){var f=this,d=f.formPanel.getForm(),e=f.list.getSelectionModel().getSelection()[0];d.findField("id_did").setReadOnly(false);method=t("sipcall");showFields=f.formPanel.down("didtypefullcombo").store.findRecord("name",method).getData().showFields;f.showFieldsRelated(showFields);Ext.ux.app.ViewController.prototype.onNew.apply(this,arguments)}},0,0,0,0,["controller.diddestination"],0,[MBilling.view.diddestination,"Controller"],0));(Ext.cmd.derive("MBilling.view.diddestination.Module",Ext.ux.panel.Module,{controller:"diddestination"},0,["diddestinationmodule"],["component","box","container","uxpanelmodule","diddestinationmodule"],{component:true,box:true,container:true,uxpanelmodule:true,diddestinationmodule:true},["widget.diddestinationmodule"],0,[MBilling.view.diddestination,"Module"],0));(Ext.cmd.derive("MBilling.view.diddestination.List",Ext.ux.grid.Panel,{store:"Diddestination",fieldSearch:"idDid.did",initComponent:function(){var b=this;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("did"),dataIndex:"idDiddid",filter:{type:"string",field:"idDid.did"},flex:5},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("type")+" "+t("of")+" "+t("call"),dataIndex:"voip_call",renderer:Helper.Util.formatDidType,comboRelated:"didtypecombo",flex:3,filter:{type:"list",options:[[0,t("callforpstn")],[1,t("sipcall")],[2,t("ivr")],[3,t("callingcard")],[4,t("portalDeVoz")],[5,t("CID Callback")],[6,t("0800 Callback")],[7,t("Queue")],[8,t("Call Group")],[9,t("Custom")]]}},{header:t("secondusedreal"),renderer:Helper.Util.formatsecondsToTime,dataIndex:"secondusedreal",flex:3},{header:t("creationdate"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"creationdate",flex:5}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["diddestinationlist"],["component","box","container","panel","tablepanel","gridpanel","grid","diddestinationlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,diddestinationlist:true},["widget.diddestinationlist"],0,[MBilling.view.diddestination,"List"],0));(Ext.cmd.derive("MBilling.view.diddestination.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["id_user","id_did"],initComponent:function(){var b=this;b.items=[{name:"id_did",fieldLabel:t("DID"),xtype:"didcombo"},{xtype:"userlookup",ownerForm:b,hidden:true,allowBlank:App.user.isClient},{xtype:"booleancombo",name:"activated",fieldLabel:t("status"),allowBlank:false},{xtype:"numbercombo",name:"priority",fieldLabel:t("priority"),allowBlank:true},{style:"margin-top:25px",xtype:"fieldset",title:t("Did Destination"),collapsible:true,collapsed:false,defaults:{labelWidth:75,anchor:"100%",labelAlign:b.labelAlignFields},items:[{xtype:"didtypefullcombo",name:"voip_call",fieldLabel:t("type")+" "+t("of")+" "+t("call")},{xtype:"textfield",name:"destination",fieldLabel:t("Destination"),value:"",allowBlank:true,hidden:App.user.isClient||App.user.isAgent},{xtype:"ivrlookup",ownerForm:b,name:"id_ivr",fieldLabel:t("IVR"),allowBlank:true},{xtype:"queuelookup",ownerForm:b,name:"id_queue",fieldLabel:t("Queue"),allowBlank:true},{xtype:"siplookup",ownerForm:b,name:"id_sip",fieldLabel:t("SIP"),allowBlank:true}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["diddestinationform"],["component","box","container","panel","form","diddestinationform"],{component:true,box:true,container:true,panel:true,form:true,diddestinationform:true},["widget.diddestinationform"],0,[MBilling.view.diddestination,"Form"],0));(Ext.cmd.derive("MBilling.view.diddestination.Combo",Ext.form.field.ComboBox,{fieldLabel:t("typepaid"),displayField:"name",valueField:"id",forceSelection:true,editable:false,value:1,store:{fields:["id","name"],data:[{id:"0",name:t("callforpstn"),showFields:["voip_call","destination","id_did","id_user","activated"]},{id:"1",name:t("sipcall"),showFields:["voip_call","id_sip","id_did","id_user","activated","priority"]},{id:"2",name:t("ivr"),showFields:["voip_call","id_did","id_ivr","id_user","activated"]},{id:"3",name:"CallingCard",showFields:["voip_call","id_did","id_user","activated"]},{id:"4",name:t("portalDeVoz"),showFields:["voip_call","id_did","id_user","activated"]},{id:"5",name:t("CID Callback"),showFields:["voip_call","id_did","id_user","activated"]},{id:"6",name:t("0800 Callback"),showFields:["voip_call","id_did","id_user","activated"]},{id:"7",name:t("Queue"),showFields:["voip_call","id_did","id_queue","id_user","activated"]},{id:"8",name:t("Call Group"),showFields:["voip_call","destination","id_did","id_user","activated"]},{id:"9",name:t("Custom"),showFields:["voip_call","destination","id_did","id_user","activated"]}]}},0,["didtypefullcombo"],["component","box","field","textfield","pickerfield","combobox","combo","didtypefullcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,didtypefullcombo:true},["widget.didtypefullcombo"],0,[MBilling.view.diddestination,"Combo"],0));(Ext.cmd.derive("MBilling.view.diddestination.freeCombo",Ext.form.field.ComboBox,{fieldLabel:t("typepaid"),displayField:"name",forceSelection:true,editable:false,valueField:"id",value:1,store:{fields:["id","name"],data:[{id:"0",name:t("callforpstn"),showFields:["voip_call","id_did","destination","id_user","activated"]},{id:"1",name:t("sipcall"),showFields:["voip_call","id_did","id_sip","id_user","activated","priority"]},{id:"2",name:t("ivr"),showFields:["voip_call","id_did","id_ivr","id_user"]},{id:"3",name:"CallingCard",showFields:["voip_call","id_did","id_user"]},{id:"4",name:t("portalDeVoz"),showFields:["voip_call","id_did","id_user"]}]}},0,["didtypefreecombo"],["component","box","field","textfield","pickerfield","combobox","combo","didtypefreecombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,didtypefreecombo:true},["widget.didtypefreecombo"],0,[MBilling.view.diddestination,"freeCombo"],0));(Ext.cmd.derive("MBilling.view.didUse.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.diduse"],0,[MBilling.view.didUse,"Controller"],0));(Ext.cmd.derive("MBilling.view.didUse.Module",Ext.ux.panel.Module,{controller:"diduse"},0,["didusemodule"],["component","box","container","uxpanelmodule","didusemodule"],{component:true,box:true,container:true,uxpanelmodule:true,didusemodule:true},["widget.didusemodule"],0,[MBilling.view.didUse,"Module"],0));(Ext.cmd.derive("MBilling.view.didUse.List",Ext.ux.grid.Panel,{store:"DidUse",initComponent:function(){var b=this;b.buttonCsv=false;b.allowPrint=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("did"),dataIndex:"idDiddid",flex:5},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("monthpayed"),dataIndex:"month_payed",flex:2},{header:t("reservationdate"),renderer:Helper.Util.formatDateTime,dataIndex:"reservationdate",flex:5},{header:t("releasedate"),renderer:Helper.Util.formatDateTime,dataIndex:"releasedate",flex:5}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["diduselist"],["component","box","container","panel","tablepanel","gridpanel","grid","diduselist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,diduselist:true},["widget.diduselist"],0,[MBilling.view.didUse,"List"],0));(Ext.cmd.derive("MBilling.view.didUse.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,readOnly:true},{xtype:"didcombo",readOnly:true},{xtype:"datefield",name:"reservationdate",fieldLabel:t("reservationdate"),format:"Y-m-d H:i:s"}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["diduseform"],["component","box","container","panel","form","diduseform"],{component:true,box:true,container:true,panel:true,form:true,diduseform:true},["widget.diduseform"],0,[MBilling.view.didUse,"Form"],0));(Ext.cmd.derive("MBilling.view.dashboard.Module",Ext.panel.Panel,{autoShow:true,header:false,initComponent:function(){var b=this;width=window.isTablet?Ext.Element.getViewportWidth()-240:Ext.Element.getViewportWidth()-220;showDid=showBuy=false;if(!App.user.isAdmin){Ext.each(App.user.menu,function(a){if(!Ext.isEmpty(a.rows)){Ext.each(a.rows,function(d){if(d.module=="didbuy"){showDid=true}if(d.module=="buycredit"){showBuy=true}},b)}},b)}widthView=Ext.Element.getViewportWidth()-430;heightView=Ext.Element.getViewportHeight()-137;heightViewFace=heightView+23;facebookhtml='
';if(!App.user.isAdmin&&App.user.social_media_network.length>10){facebookhtml='
'}if(window.customDashboard&&!App.user.isAdmin){b.items=[{header:false,bodyPadding:0,style:"background-color:transparent;",bodyStyle:"background-color:transparent !important;",html:'
',collapseDirection:"bottom",collapsible:true,autoScroll:true,height:Ext.Element.getViewportHeight()}]}else{b.items=[{width:!window.isDesktop?width:"NULL",header:false,xtype:"dashboard",listeners:{activate:"setRunnerInfoSystem"},glyph:icons.home,title:t("Home"),stateful:false,items:[{columnWidth:App.user.isAdmin?1/2:1,items:[{title:t("callonline"),items:{xtype:"callonlinelist2"},hidden:window.isTablet||!App.user.isAdmin,height:App.user.isClient?250:300},{title:t("Simultaneous Call"),items:{xtype:"callonlinechartchart"},hidden:window.isTablet||!App.user.isAdmin,iconCls:"icon-chart-column",glyph:undefined}]},{hidden:App.user.isAdmin,columnWidth:App.user.isClient?1/2:1,items:[{title:t("BuyCredit"),items:{xtype:"buycreditmodule"},height:window.isTablet?250:170,hidden:!showBuy}]},{hidden:App.user.isAdmin,columnWidth:1/2,items:[{title:t("Buy")+" "+t("did"),items:{xtype:"didbuymodule"},height:window.isTablet?250:170,hidden:!showDid||!App.user.isClient},{iconCls:"icon-info",title:t("NEWS"),bodyPadding:0,style:"background-color:transparent;",bodyStyle:"background-color:transparent !important;",hidden:App.user.isAdmin||App.user.social_media_network.length<=10,html:facebookhtml,collapseDirection:"bottom",collapsible:true,autoScroll:true,height:300}]},{columnWidth:1/2,items:[{iconCls:"icon-info",title:t("NEWS"),bodyPadding:0,style:"background-color:transparent;",bodyStyle:"background-color:transparent !important;",hidden:!App.user.isAdmin||window.isTablet||window.isTablets||App.user.l.slice(4,7)=="syn",html:facebookhtml,collapseDirection:"bottom",collapsible:true,autoScroll:true,height:300},{title:t("Refill Summary"),iconCls:"icon-chart-column",glyph:undefined,items:{xtype:"refillchart"},hidden:!App.user.isAdmin||window.isTablet}]}]}]}Ext.panel.Panel.prototype.initComponent.apply(this,arguments)}},0,["dashboardmodule"],["component","box","container","panel","dashboardmodule"],{component:true,box:true,container:true,panel:true,dashboardmodule:true},["widget.dashboardmodule"],0,[MBilling.view.dashboard,"Module"],0));(Ext.cmd.derive("MBilling.view.dashboardQueue.Module",Ext.panel.Panel,{autoShow:true,header:false,initComponent:function(){var b=this;b.items=[{width:!window.isDesktop?width:"NULL",header:false,xtype:"dashboard",listeners:{activate:"setRunnerInfoSystem"},glyph:icons.home,title:t("Home"),stateful:false,items:[{columnWidth:1/2,items:[{title:t("Queue Monitor"),items:{xtype:"queuedashboardlist"},height:window.heightView}]},{columnWidth:1/2,items:[{title:t("Agent Monitor"),iconCls:"icon-chart-column",glyph:undefined,items:{xtype:"queuememberdashboardlist"},height:window.heightView}]}]}];Ext.panel.Panel.prototype.initComponent.apply(this,arguments)}},0,["dashboardqueuemodule"],["component","box","container","panel","dashboardqueuemodule"],{component:true,box:true,container:true,panel:true,dashboardqueuemodule:true},["widget.dashboardqueuemodule"],0,[MBilling.view.dashboardQueue,"Module"],0));(Ext.cmd.derive("MBilling.view.ivr.Controller",Ext.ux.app.ViewController,{isSubmitForm:true,init:function(){var b=this;b.control({typedestinationcombo:{select:b.onSelectMethod}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectMethod:function(c,d){this.showFieldsRelated(d.getData().showFields)},showFieldsRelated:function(l){var m=this,n=m.formPanel.getForm(),j=m.formPanel.getForm().getFields(),g=Ext.get(Ext.Element.getActiveElement()).component,o=g.name.substr(-2);m.onSetVisibleFiel(g,n,o,g.value)},onSetVisibleFiel:function(f,j,e,g){if(f.value=="undefined"){f.setValue("undefined")}if(f.name.match("^type_10")){j.findField("id_queue_10").setVisible(g.match("^queue"));j.findField("id_sip_10").setVisible(g.match("^sip"));j.findField("id_ivr_10").setVisible(g.match("^ivr"));j.findField("extension_10").setVisible(g.match("^group|^number|^custom"))}else{if(f.name.match("^type_[0-9]")){j.findField("id_queue"+e).setVisible(g.match("^queue"));j.findField("id_sip"+e).setVisible(g.match("^sip"));j.findField("id_ivr"+e).setVisible(g.match("^ivr"));j.findField("extension"+e).setVisible(g.match("^group|^number|^custom"))}else{if(f.name.match("^type_out_10")){j.findField("id_queue_out_10").setVisible(g.match("^queue"));j.findField("id_ivr_out_10").setVisible(g.match("^ivr"));j.findField("id_sip_out_10").setVisible(g.match("^sip"));j.findField("extension_out_10").setVisible(g.match("^group|^number|^custom"))}else{j.findField("id_queue_out"+e).setVisible(g.match("^queue"));j.findField("id_sip_out"+e).setVisible(g.match("^sip"));j.findField("id_ivr_out"+e).setVisible(g.match("^ivr"));j.findField("extension_out"+e).setVisible(g.match("^group|^number|^custom"))}}}},onEdit:function(){var g=this,j=g.formPanel.getForm(),f=g.list.getSelectionModel().getSelection()[0];for(var e=0;e<=10;e++){fieldValue=f.getData()["type_"+e];fieldValueOut=f.getData()["type_out_"+e];if(fieldValue=="ivr"){j.findField("id_ivr_"+e).setVisible(true);j.findField("id_sip_"+e).setVisible(false);j.findField("id_queue_"+e).setVisible(false);j.findField("extension_"+e).setVisible(false)}else{if(fieldValue=="sip"){j.findField("id_sip_"+e).setVisible(true);j.findField("id_ivr_"+e).setVisible(false);j.findField("id_queue_"+e).setVisible(false);j.findField("extension_"+e).setVisible(false)}else{if(fieldValue=="queue"){j.findField("id_queue_"+e).setVisible(true);j.findField("id_sip_"+e).setVisible(false);j.findField("id_ivr_"+e).setVisible(false);j.findField("extension_"+e).setVisible(false)}else{if(fieldValue.match("custom|number|group")){j.findField("extension_"+e).setVisible(true);j.findField("id_ivr_"+e).setVisible(false);j.findField("id_sip_"+e).setVisible(false);j.findField("id_queue_"+e).setVisible(false)}else{j.findField("id_queue_"+e).setVisible(false);j.findField("id_sip_"+e).setVisible(false);j.findField("id_ivr_"+e).setVisible(false);j.findField("extension_"+e).setVisible(false)}}}}if(fieldValueOut=="ivr"){j.findField("id_ivr_out_"+e).setVisible(true);j.findField("id_sip_out_"+e).setVisible(false);j.findField("id_queue_out_"+e).setVisible(false);j.findField("extension_out_"+e).setVisible(false)}else{if(fieldValueOut=="sip"){j.findField("id_sip_out_"+e).setVisible(true);j.findField("id_ivr_out_"+e).setVisible(false);j.findField("id_queue_out_"+e).setVisible(false);j.findField("extension_out_"+e).setVisible(false)}else{if(fieldValueOut=="queue"){j.findField("id_queue_out_"+e).setVisible(true);j.findField("id_sip_out_"+e).setVisible(false);j.findField("id_ivr_out_"+e).setVisible(false);j.findField("extension_out_"+e).setVisible(false)}else{if(fieldValueOut.match("custom|number|group")){j.findField("extension_out_"+e).setVisible(true);j.findField("id_ivr_out_"+e).setVisible(false);j.findField("id_sip_out_"+e).setVisible(false);j.findField("id_queue_out_"+e).setVisible(false)}else{j.findField("id_queue_out_"+e).setVisible(false);j.findField("id_sip_out_"+e).setVisible(false);j.findField("id_ivr_out_"+e).setVisible(false);j.findField("extension_out_"+e).setVisible(false)}}}}}Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)},onNew:function(){var g=this,j=g.formPanel.getForm(),f=g.list.getSelectionModel().getSelection()[0];for(var e=0;e<=10;e++){j.findField("id_ivr_"+e).setVisible(false);j.findField("id_sip_"+e).setVisible(false);j.findField("id_queue_"+e).setVisible(false);j.findField("id_ivr_out_"+e).setVisible(false);j.findField("id_sip_out_"+e).setVisible(false);j.findField("id_queue_out_"+e).setVisible(false)}Ext.ux.app.ViewController.prototype.onNew.apply(this,arguments)}},0,0,0,0,["controller.ivr"],0,[MBilling.view.ivr,"Controller"],0));(Ext.cmd.derive("MBilling.view.ivr.Module",Ext.ux.panel.Module,{controller:"ivr"},0,["ivrmodule"],["component","box","container","uxpanelmodule","ivrmodule"],{component:true,box:true,container:true,uxpanelmodule:true,ivrmodule:true},["widget.ivrmodule"],0,[MBilling.view.ivr,"Module"],0));(Ext.cmd.derive("MBilling.view.ivr.List",Ext.ux.grid.Panel,{store:"Ivr",initComponent:function(){var b=this;b.allowPrint=false;b.buttonCsv=false;b.columns=b.columns||[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("name"),dataIndex:"name",flex:5},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["ivrlist"],["component","box","container","panel","tablepanel","gridpanel","grid","ivrlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,ivrlist:true},["widget.ivrlist"],0,[MBilling.view.ivr,"List"],0));(Ext.cmd.derive("MBilling.view.ivr.Form",Ext.ux.form.Panel,{bodyPadding:0,fileUpload:true,initComponent:function(){var b=this;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{plugins:"markallowblank",allowBlank:false,anchor:"100%",labelAlign:"right"}},items:[{title:t("general"),items:[{name:"name",fieldLabel:t("name")},{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"monFriStart",fieldLabel:t("monFriStart"),value:"09:00",maxLength:5,minLength:5},{name:"monFriStop",fieldLabel:t("monFriStop"),value:"18:00",maxLength:5,minLength:5},{name:"satStart",fieldLabel:t("satStart"),value:"09:00",maxLength:5,minLength:5},{name:"satStop",fieldLabel:t("satStop"),value:"12:00",maxLength:5,minLength:5},{name:"sunStart",fieldLabel:t("sunStart"),value:"09:00",maxLength:5,minLength:5},{name:"sunStop",fieldLabel:t("sunStop"),value:"12:00",maxLength:5,minLength:5},{xtype:"uploadfield",fieldLabel:t("workaudio"),emptyText:"Select an wav or gsm File",allowBlank:true,name:"workaudio",labelWidth:120,extAllowed:["wav","gsm"]},{xtype:"uploadfield",fieldLabel:t("noworkaudio"),emptyText:"Select an wav or gsm File",allowBlank:true,labelWidth:120,name:"noworkaudio",extAllowed:["wav","gsm"]}]},{title:t("options")+" "+t("work"),itemId:"option",defaults:{xtype:"fieldcontainer",layout:"hbox",plugins:"markallowblank",allowBlank:true,anchor:"100%",labelWidth:100,defaults:{hideLabel:true,hidden:true,flex:5,startX:100,allowBlank:true,ownerForm:b}},items:[{xtype:"menuseparator",width:"100%"},{labelStyle:"font-weight:bold",xtype:"displayfield",value:''+t("Select the destination to send call when caller press any digits.")+"",allowBlank:true},{xtype:"menuseparator",width:"100%"},{fieldLabel:t("option")+" 0",items:[{name:"type_0",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_0",displayField:"id_ivr_0_name"},{xtype:"queuelookup",name:"id_queue_0",displayField:"id_queue_0_name"},{xtype:"siplookup",name:"id_sip_0",displayField:"id_sip_0_name"},{xtype:"textfield",name:"extension_0"}]},{fieldLabel:t("option")+" 1",items:[{name:"type_1",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_1",displayField:"id_ivr_1_name"},{xtype:"queuelookup",name:"id_queue_1",displayField:"id_queue_1_name"},{xtype:"siplookup",name:"id_sip_1",displayField:"id_sip_1_name"},{xtype:"textfield",name:"extension_1"}]},{fieldLabel:t("option")+" 2",items:[{name:"type_2",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_2",displayField:"id_ivr_2_name"},{xtype:"queuelookup",name:"id_queue_2",displayField:"id_queue_2_name"},{xtype:"siplookup",name:"id_sip_2",displayField:"id_sip_2_name"},{xtype:"textfield",name:"extension_2"}]},{fieldLabel:t("option")+" 3",items:[{name:"type_3",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_3",displayField:"id_ivr_3_name"},{xtype:"queuelookup",name:"id_queue_3",displayField:"id_queue_3_name"},{xtype:"siplookup",name:"id_sip_3",displayField:"id_sip_3_name"},{xtype:"textfield",name:"extension_3"}]},{fieldLabel:t("option")+" 4",items:[{name:"type_4",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_4",displayField:"id_ivr_4_name"},{xtype:"queuelookup",name:"id_queue_4",displayField:"id_queue_4_name"},{xtype:"siplookup",name:"id_sip_4",displayField:"id_sip_4_name"},{xtype:"textfield",name:"extension_4"}]},{fieldLabel:t("option")+" 5",items:[{name:"type_5",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_5",displayField:"id_ivr_5_name"},{xtype:"queuelookup",name:"id_queue_5",displayField:"id_queue_5_name"},{xtype:"siplookup",name:"id_sip_5",displayField:"id_sip_5_name"},{xtype:"textfield",name:"extension_5"}]},{fieldLabel:t("option")+" 6",items:[{name:"type_6",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_6",displayField:"id_ivr_6_name"},{xtype:"queuelookup",name:"id_queue_6",displayField:"id_queue_6_name"},{xtype:"siplookup",name:"id_sip_6",displayField:"id_sip_6_name"},{xtype:"textfield",name:"extension_6"}]},{fieldLabel:t("option")+" 7",items:[{name:"type_7",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_7",displayField:"id_ivr_7_name"},{xtype:"queuelookup",name:"id_queue_7",displayField:"id_queue_7_name"},{xtype:"siplookup",name:"id_sip_7",displayField:"id_sip_7_name"},{xtype:"textfield",name:"extension_7"}]},{fieldLabel:t("option")+" 8",items:[{name:"type_8",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_8",displayField:"id_ivr_8_name"},{xtype:"queuelookup",name:"id_queue_8",displayField:"id_queue_8_name"},{xtype:"siplookup",name:"id_sip_8",displayField:"id_sip_8_name"},{xtype:"textfield",name:"extension_8"}]},{fieldLabel:t("option")+" 9",items:[{name:"type_9",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_9",displayField:"id_ivr_9_name"},{xtype:"queuelookup",name:"id_queue_9",displayField:"id_queue_9_name"},{xtype:"siplookup",name:"id_sip_9",displayField:"id_sip_9_name"},{xtype:"textfield",name:"extension_9"}]},{fieldLabel:t("option")+" default",items:[{name:"type_10",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_10",displayField:"id_ivr_10_name"},{xtype:"queuelookup",name:"id_queue_10",displayField:"id_queue_10_name"},{xtype:"siplookup",name:"id_sip_10",displayField:"id_sip_10_name"},{xtype:"textfield",name:"extension_10"}]},{fieldLabel:t("Direct extension"),hidden:!window.didChannelLimit,name:"direct_extension",xtype:"noyescombo"}]},{title:t("options")+" "+t("not")+" "+t("work"),itemId:"optionOut",defaults:{xtype:"fieldcontainer",layout:"hbox",plugins:"markallowblank",allowBlank:true,anchor:"100%",labelWidth:100,defaults:{hideLabel:true,hidden:true,flex:5,startX:100,allowBlank:true,ownerForm:b}},items:[{xtype:"menuseparator",width:"100%"},{labelStyle:"font-weight:bold",xtype:"displayfield",value:''+t("Select the destination to send call when caller press any digits.")+"",allowBlank:true},{xtype:"menuseparator",width:"100%"},{fieldLabel:t("option")+" 0",items:[{name:"type_out_0",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_0",displayField:"id_ivr_out_0_name"},{xtype:"queuelookup",name:"id_queue_out_0",displayField:"id_queue_out_0_name"},{xtype:"siplookup",name:"id_sip_out_0",displayField:"id_sip_out_0_name"},{xtype:"textfield",name:"extension_out_0"}]},{fieldLabel:t("option")+" 1",items:[{name:"type_out_1",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_1",displayField:"id_ivr_out_1_name"},{xtype:"queuelookup",name:"id_queue_out_1",displayField:"id_queue_out_1_name"},{xtype:"siplookup",name:"id_sip_out_1",displayField:"id_sip_out_1_name"},{xtype:"textfield",name:"extension_out_1"}]},{fieldLabel:t("option")+" 2",items:[{name:"type_out_2",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_2",displayField:"id_ivr_out_2_name"},{xtype:"queuelookup",name:"id_queue_out_2",displayField:"id_queue_out_2_name"},{xtype:"siplookup",name:"id_sip_out_2",displayField:"id_sip_out_2_name"},{xtype:"textfield",name:"extension_out_2"}]},{fieldLabel:t("option")+" 3",items:[{name:"type_out_3",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_3",displayField:"id_ivr_out_3_name"},{xtype:"queuelookup",name:"id_queue_out_3",displayField:"id_queue_out_3_name"},{xtype:"siplookup",name:"id_sip_out_3",displayField:"id_sip_out_3_name"},{xtype:"textfield",name:"extension_out_3"}]},{fieldLabel:t("option")+" 4",items:[{name:"type_out_4",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_4",displayField:"id_ivr_out_4_name"},{xtype:"queuelookup",name:"id_queue_out_4",displayField:"id_queue_out_4_name"},{xtype:"siplookup",name:"id_sip_out_4",displayField:"id_sip_out_4_name"},{xtype:"textfield",name:"extension_out_4"}]},{fieldLabel:t("option")+" 5",items:[{name:"type_out_5",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_5",displayField:"id_ivr_out_5_name"},{xtype:"queuelookup",name:"id_queue_out_5",displayField:"id_queue_out_5_name"},{xtype:"siplookup",name:"id_sip_out_5",displayField:"id_sip_out_5_name"},{xtype:"textfield",name:"extension_out_5"}]},{fieldLabel:t("option")+" 6",items:[{name:"type_out_6",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_6",displayField:"id_ivr_out_6_name"},{xtype:"queuelookup",name:"id_queue_out_6",displayField:"id_queue_out_6_name"},{xtype:"siplookup",name:"id_sip_out_6",displayField:"id_sip_out_6_name"},{xtype:"textfield",name:"extension_out_6"}]},{fieldLabel:t("option")+" 7",items:[{name:"type_out_7",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_7",displayField:"id_ivr_out_7_name"},{xtype:"queuelookup",name:"id_queue_out_7",displayField:"id_queue_out_7_name"},{xtype:"siplookup",name:"id_sip_out_7",displayField:"id_sip_out_7_name"},{xtype:"textfield",name:"extension_out_7"}]},{fieldLabel:t("option")+" 8",items:[{name:"type_out_8",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_8",displayField:"id_ivr_out_8_name"},{xtype:"queuelookup",name:"id_queue_out_8",displayField:"id_queue_out_8_name"},{xtype:"siplookup",name:"id_sip_out_8",displayField:"id_sip_out_8_name"},{xtype:"textfield",name:"extension_out_8"}]},{fieldLabel:t("option")+" 9",items:[{name:"type_out_9",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_9",displayField:"id_ivr_out_9_name"},{xtype:"queuelookup",name:"id_queue_out_9",displayField:"id_queue_out_9_name"},{xtype:"siplookup",name:"id_sip_out_9",displayField:"id_sip_out_9_name"},{xtype:"textfield",name:"extension_out_9"}]},{fieldLabel:t("option")+" default",items:[{name:"type_out_10",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_10",displayField:"id_ivr_out_10_name"},{xtype:"queuelookup",name:"id_queue_out_10",displayField:"id_queue_out_10_name"},{xtype:"siplookup",name:"id_sip_out_10",displayField:"id_sip_out_10_name"},{xtype:"textfield",name:"extension_out_10"}]}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["ivrform"],["component","box","container","panel","form","ivrform"],{component:true,box:true,container:true,panel:true,form:true,ivrform:true},["widget.ivrform"],0,[MBilling.view.ivr,"Form"],0));(Ext.cmd.derive("MBilling.view.ivr.Lookup",Ext.ux.form.field.Lookup,{name:"id_ivr",fieldLabel:t("Ivr"),displayField:"idIvrname",displayFieldList:"name",gridConfig:{xtype:"ivrlist",fieldSearch:"name",columns:[{header:t("name"),dataIndex:"name",flex:5},{header:t("user"),dataIndex:"idUsernumber",filter:{type:"string",field:"idUser.username"},flex:4}]}},0,["ivrlookup"],["component","box","container","fieldcontainer","ivrlookup"],{component:true,box:true,container:true,fieldcontainer:true,ivrlookup:true},["widget.ivrlookup"],0,[MBilling.view.ivr,"Lookup"],0));(Ext.cmd.derive("MBilling.view.queue.Controller",Ext.ux.app.ViewController,{isSubmitForm:true,init:function(){var b=this;b.control({"combobox[name=ring_or_moh]":{select:b.onSelectringOrMOH}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectringOrMOH:function(c,d){me=this,form=me.formPanel.getForm();form.findField("musiconhold").setVisible(d.data.field1=="moh")},onNew:function(){var b=this;b.formPanel.getForm().findField("musiconhold").setVisible(true);Ext.ux.app.ViewController.prototype.onNew.apply(this,arguments)},onEdit:function(){var b=this;Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments);ringOrMoh=b.formPanel.getForm().findField("ring_or_moh").getValue();b.formPanel.getForm().findField("musiconhold").setVisible(ringOrMoh=="moh")},onResetQueueStats:function(m){var j=this,f=j.list.getSelectionModel().getSelection()[0],l=Ext.encode(j.list.filters.getFilterData()),g=[];if(f){Ext.each(j.list.getSelectionModel().getSelection(),function(a){g.push(a.get(j.idProperty))});Ext.Ajax.request({url:"index.php/queue/resetQueueStats",params:{ids:Ext.encode(g),filter:l},scope:j,success:function(b){b=Ext.decode(b.responseText);if(b[j.nameSuccessRequest]){Ext.ux.Alert.alert(j.titleSuccess,b.msg,"success")}else{var a=Helper.Util.convertErrorsJsonToString(b[j.nameMsgRequest]);Ext.ux.Alert.alert(j.titleError,a,"notification")}}})}else{Ext.ux.Alert.alert(j.titleError,t("Please select one or more queue"),"notification")}},onDeleteMusic:function(e){var f=this,d=f.list.getSelectionModel().getSelection()[0];if(f.list.getSelectionModel().getSelection().length==1){Ext.Ajax.request({url:"index.php/queue/deleteMusicOnHold",params:{id_queue:d.get("id")},scope:f,success:function(a){a=Ext.decode(a.responseText);if(a[f.nameSuccessRequest]){Ext.ux.Alert.alert(f.titleSuccess,a[f.nameMsgRequest],"success")}else{Ext.ux.Alert.alert(f.titleError,a[f.nameMsgRequest],"error")}}})}else{Ext.ux.Alert.alert(f.titleError,"Please Select only a record","notification")}}},0,0,0,0,["controller.queue"],0,[MBilling.view.queue,"Controller"],0));(Ext.cmd.derive("MBilling.view.queue.Combo",Ext.form.field.ComboBox,{fieldLabel:t("status"),value:"ringall",forceSelection:true,editable:false,store:[["ringall",t("Ringall")+" - "+t("ring all available channels until one answers")],["rrmemory",t("Rrmemory")+" - "+t("round robin with memory, remember where we left off last ring pass")],["leastrecent",t("Leastrecent")+" - "+t("ring interface which was least recently called by this queue")],["fewestcalls",t("Fewestcalls")+" - "+t("ring the one with fewest completed calls from this queue")],["random",t("Random")+" -"+t("ring random interface")],["linear",t("Linear")+" - "+t("Rings interfaces in the order they are listed in the configuration file. Dynamic members will be rung in the order in which they were added")],["wrandom",t("Wrandom")+" -"+t("Rings a random interface, but uses the agent's penalty as a weight")]]},0,["queuestrategycombo"],["component","box","field","textfield","pickerfield","combobox","combo","queuestrategycombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,queuestrategycombo:true},["widget.queuestrategycombo"],0,[MBilling.view.queue,"Combo"],0));(Ext.cmd.derive("MBilling.view.queue.Module",Ext.ux.panel.Module,{controller:"queue"},0,["queuemodule"],["component","box","container","uxpanelmodule","queuemodule"],{component:true,box:true,container:true,uxpanelmodule:true,queuemodule:true},["widget.queuemodule"],0,[MBilling.view.queue,"Module"],0));(Ext.cmd.derive("MBilling.view.queue.List",Ext.ux.grid.Panel,{store:"Queue",initComponent:function(){var b=this;b.buttonCsv=false;b.allowPrint=false;b.buttonUpdateLot=false;b.extraButtons=[{text:t("Reset Queue Stats"),iconCls:"call",handler:"onResetQueueStats",disabled:false,hidden:!App.user.isAdmin},{text:t("Delete Musiconhold"),iconCls:"call",handler:"onDeleteMusic",disabled:false,hidden:!App.user.isAdmin}];b.columns=b.columns||[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("name"),dataIndex:"name",flex:4},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("Strategy"),dataIndex:"strategy",flex:4},{header:t("Talk Time"),dataIndex:"var_talktime",flex:3},{header:t("Total Calls"),dataIndex:"var_totalCalls",flex:3},{header:t("Answered"),dataIndex:"var_answeredCalls",flex:3}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["queuelist"],["component","box","container","panel","tablepanel","gridpanel","grid","queuelist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,queuelist:true},["widget.queuelist"],0,[MBilling.view.queue,"List"],0));(Ext.cmd.derive("MBilling.view.queue.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["id_user","name"],fileUpload:true,initComponent:function(){var b=this;b.labelWidthFields=160;b.items=[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"name",fieldLabel:t("name")},{xtype:"languagecombo",name:"language",value:App.user.language=="pt_BR"?"br":App.user.language,fieldLabel:t("language")},{xtype:"queuestrategycombo",name:"strategy",fieldLabel:t("Strategy")},{xtype:"yesnostringcombo",name:"ringinuse",fieldLabel:t("Ringinuse")},{xtype:"numberfield",name:"timeout",fieldLabel:t("Ring Agent per"),value:30},{xtype:"numberfield",name:"retry",fieldLabel:t("Retry other agent"),value:1},{xtype:"numberfield",name:"wrapuptime",fieldLabel:t("Time next calls"),value:1},{xtype:"numberfield",name:"weight",fieldLabel:t("Weigh"),value:0},{name:"periodic-announce",fieldLabel:t("Periodic announce"),value:"queue-periodic-announce"},{xtype:"numberfield",name:"periodic-announce-frequency",fieldLabel:t("Periodic frequency"),value:30},{xtype:"yesnostringcombo",name:"announce-position",fieldLabel:t("Announce position")},{xtype:"yesnostringcombo",name:"announce-holdtime",fieldLabel:t("Announce Holdtime")},{xtype:"numberfield",name:"announce-frequency",fieldLabel:t("Announce Frequency"),value:45},{xtype:"combobox",forceSelection:true,editable:false,value:"yes",store:[["no",t("No")],["yes",t("Yes")],["unavailable,invalid,unknown",t("unavailable,invalid,unknown")],["penalty,paused,invalid,unavailable",t("penalty,paused,invalid,unavailable")]],name:"joinempty",fieldLabel:t("Join empty")},{xtype:"combobox",forceSelection:true,editable:false,value:"no",store:[["no",t("No")],["yes",t("Yes")],["unavailable,invalid,unknown",t("unavailable,invalid,unknown")],["penalty,paused,invalid,unavailable",t("penalty,paused,invalid,unavailable")]],fieldLabel:t("Leave when empty"),name:"leavewhenempty"},{xtype:"combobox",forceSelection:true,editable:false,value:"moh",store:[["moh",t("MOH")],["ring",t("Ring")]],fieldLabel:t("Ring or playing MOH"),name:"ring_or_moh"},{xtype:"uploadfield",fieldLabel:t("Audio")+" "+t("musiconhold"),emptyText:t("Select an wav mono 8khz or gsm File"),allowBlank:true,name:"musiconhold",extAllowed:["wav","gsm"]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["queueform"],["component","box","container","panel","form","queueform"],{component:true,box:true,container:true,panel:true,form:true,queueform:true},["widget.queueform"],0,[MBilling.view.queue,"Form"],0));(Ext.cmd.derive("MBilling.view.queue.Lookup",Ext.ux.form.field.Lookup,{name:"id_queue",fieldLabel:t("Queue"),displayField:"idQueuename",displayFieldList:"name",gridConfig:{xtype:"queuelist",fieldSearch:"name",columns:[{header:t("name"),dataIndex:"name",flex:2}]}},0,["queuelookup"],["component","box","container","fieldcontainer","queuelookup"],{component:true,box:true,container:true,fieldcontainer:true,queuelookup:true},["widget.queuelookup"],0,[MBilling.view.queue,"Lookup"],0));(Ext.cmd.derive("MBilling.view.queue.ListDashboard",Ext.ux.grid.Panel,{store:"QueueDashBoard",refreshTime:5,selType:"rowmodel",initComponent:function(){var b=this;b.refreshTime=(localStorage&&localStorage.getItem("queuerefresh"))||b.refreshTime;b.extraButtons=[{text:t("Spy")+" "+t("call"),iconCls:"call",handler:function(a){module=b.getView();console.log(module.panel.items.items[0].getSelectionModel().getSelection());Ext.widget("callonlinespycall",{title:module.titleModule,list:module.panel.items.items[0]})},width:130,disabled:false,hidden:!window.multSpy},{xtype:"numberfield",field:"jmlhBrg",fieldLabel:t("Refresh Time"),editable:false,minValue:5,labelWidth:90,width:150,selectOnFocus:true,allowDecimals:true,decimalPrecision:2,value:b.refreshTime,listeners:{change:function(a){if(a.value>0){b.refreshTime=a.value;localStorage.setItem("queuerefresh",a.value)}}}}];b.columns=[{header:t("Channel"),hidden:true,dataIndex:"channel",flex:3},{header:t("Queue"),dataIndex:"queue_name",flex:3},{header:t("Agent"),dataIndex:"agentName",flex:3},{header:t("status"),dataIndex:"status",renderer:Helper.Util.formatQueueState,flex:4},{header:t("CallerID"),dataIndex:"callerId",flex:4},{header:t("Duration"),dataIndex:"duration",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Wait Time"),dataIndex:"holdtime",renderer:Helper.Util.formatsecondsToTime,flex:3}];b.sessionLoad=Ext.create("Ext.util.DelayedTask",function(){b.store.load()},b);Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments);b.store.on("load",b.onLoadStore,b)},onLoadStore:function(){var b=this;b.onDeactivateModule();b.onActivateModule()},onRender:function(){var b=this;if(Ext.isObject(b.module)){b.module.on("activate",b.onActivateModule,b);b.module.on("deactivate",b.onDeactivateModule,b);b.module.on("close",b.onCloseModule,b)}Ext.ux.grid.Panel.prototype.onRender.apply(this,arguments)},onActivateModule:function(){this.sessionLoad&&this.sessionLoad.delay(this.refreshTime*1000)},onDeactivateModule:function(){this.sessionLoad&&this.sessionLoad.cancel()},onCloseModule:function(){this.onDeactivateModule();this.sessionLoad=null}},0,["queuedashboardlist"],["component","box","container","panel","tablepanel","gridpanel","grid","queuedashboardlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,queuedashboardlist:true},["widget.queuedashboardlist"],0,[MBilling.view.queue,"ListDashboard"],0));(Ext.cmd.derive("MBilling.view.queueMember.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.queuemember"],0,[MBilling.view.queueMember,"Controller"],0));(Ext.cmd.derive("MBilling.view.queueMember.Module",Ext.ux.panel.Module,{controller:"queuemember"},0,["queuemembermodule"],["component","box","container","uxpanelmodule","queuemembermodule"],{component:true,box:true,container:true,uxpanelmodule:true,queuemembermodule:true},["widget.queuemembermodule"],0,[MBilling.view.queueMember,"Module"],0));(Ext.cmd.derive("MBilling.view.queueMember.List",Ext.ux.grid.Panel,{store:"QueueMember",initComponent:function(){var b=this;b.columns=[{header:t("Uniqueid"),dataIndex:"uniqueid",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("destination"),dataIndex:"interface",flex:4},{header:t("queues"),dataIndex:"queue_name",flex:4},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("paused"),dataIndex:"paused",renderer:Helper.Util.formattyyesno,filter:{type:"list",options:[[0,t("no")],[1,t("yes")]]},flex:2}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["queuememberlist"],["component","box","container","panel","tablepanel","gridpanel","grid","queuememberlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,queuememberlist:true},["widget.queuememberlist"],0,[MBilling.view.queueMember,"List"],0));(Ext.cmd.derive("MBilling.view.queueMember.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["id_user","queue_name"],initComponent:function(){var b=this;b.items=[{xtype:"queuelookup",ownerForm:b,displayField:"queue_name",name:"queue_name",hidden:App.user.isClient,allowBlank:App.user.isClient},{xtype:"siplookup",ownerForm:b,name:"interface",displayField:"interface"},{xtype:"noyescombo",name:"paused",fieldLabel:t("paused"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["queuememberform"],["component","box","container","panel","form","queuememberform"],{component:true,box:true,container:true,panel:true,form:true,queuememberform:true},["widget.queuememberform"],0,[MBilling.view.queueMember,"Form"],0));(Ext.cmd.derive("MBilling.view.queueMember.ListDashboard",Ext.ux.grid.Panel,{store:"QueueMemberDashBoard",refreshTime:5,selType:"rowmodel",initComponent:function(){var b=this;b.refreshTime=(localStorage&&localStorage.getItem("queueagentrefresh"))||b.refreshTime;b.extraButtons=[{xtype:"numberfield",field:"jmlhBrg",fieldLabel:t("Refresh Time"),editable:false,minValue:5,labelWidth:90,width:150,selectOnFocus:true,allowDecimals:true,decimalPrecision:2,value:b.refreshTime,listeners:{change:function(a){if(a.value>0){b.refreshTime=a.value;localStorage.setItem("queueagentrefresh",a.value)}}}}];b.columns=[{header:t("Agent"),dataIndex:"agentName",flex:3},{header:t("Queue"),dataIndex:"idQueuename",flex:5},{header:t("Status"),dataIndex:"agentStatus",renderer:Helper.Util.formatQueueAgentState,flex:4},{header:t("Number"),dataIndex:"number",flex:4},{header:t("Calls"),dataIndex:"totalCalls",flex:2},{header:t("Last call"),dataIndex:"last_call",renderer:Helper.Util.formatsecondsToTime,flex:3}];b.sessionLoad=Ext.create("Ext.util.DelayedTask",function(){b.store.load()},b);Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments);if(window.isDesktop){b.store.load()}b.store.on("load",b.onLoadStore,b)},onLoadStore:function(){var b=this;b.onDeactivateModule();b.onActivateModule()},onRender:function(){var b=this;if(Ext.isObject(b.module)){b.module.on("activate",b.onActivateModule,b);b.module.on("deactivate",b.onDeactivateModule,b);b.module.on("close",b.onCloseModule,b)}Ext.ux.grid.Panel.prototype.onRender.apply(this,arguments)},onActivateModule:function(){this.sessionLoad&&this.sessionLoad.delay(this.refreshTime*1000)},onDeactivateModule:function(){this.sessionLoad&&this.sessionLoad.cancel()},onCloseModule:function(){this.onDeactivateModule();this.sessionLoad=null}},0,["queuememberdashboardlist"],["component","box","container","panel","tablepanel","gridpanel","grid","queuememberdashboardlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,queuememberdashboardlist:true},["widget.queuememberdashboardlist"],0,[MBilling.view.queueMember,"ListDashboard"],0));(Ext.cmd.derive("MBilling.view.refill.Controller",Ext.ux.app.ViewController,{aliasChart:"refillchart",onPrint:function(e){var f=this;if(App.user.isClient){var f=this,d=f.list.getSelectionModel().getSelection()[0];if(f.list.getSelectionModel().getSelection().length==1){console.log(d.data.description.indexOf("Send Credit "));if(d.data.description.indexOf("Send Credit ")!==-1){url="index.php/transferToMobile/printRefill/?id="+d.get("id");window.open(url)}else{Ext.ux.app.ViewController.prototype.onPrint.apply(this,arguments)}}else{Ext.ux.app.ViewController.prototype.onPrint.apply(this,arguments)}}else{Ext.ux.app.ViewController.prototype.onPrint.apply(this,arguments)}},onInvoice:function(e){var f=this;var f=this,d=f.list.getSelectionModel().getSelection()[0];if(f.list.getSelectionModel().getSelection().length==1){url="index.php/invoices/printInvoice/?id="+d.get("id");window.open(url)}else{Ext.ux.Alert.alert(f.titleError,t("Not available to multi refill."),"error")}},onSelectionChange:function(f,e){var j=this,g=j.lookupReference("invoice");g&&g.setDisabled(!e.length);Ext.ux.app.ViewController.prototype.onSelectionChange.apply(this,arguments)},onRenderModule:function(){var c=this,d=c.lookupReference("chart");Ext.ux.app.ViewController.prototype.onRenderModule.apply(this,arguments);if(App.user.isAdmin){c.store.on({scope:c,beforeload:function(){d.el&&d.disable()},load:function(a){d.el&&d.enable();c.onSetTotal()}})}else{c.store.on({scope:c,load:function(a){c.onSetTotal()}})}},onChart:function(){var b=this;b.chart=Ext.widget("window",{title:t("charts"),iconCls:"icon-chart-column",layout:"fit",autoShow:true,modal:true,resizable:false,width:window.isThemeNeptune?740:710,items:{xtype:b.aliasChart}});b.chart.down("#tbTextSum").setText(""+t("total")+": "+App.user.currency+" "+b.sumData.sumCredit+"")},onSetTotal:function(c){var d=this;if(!d.store.getData().items[0]){return}d.sumData=d.store.getData().items[0].getData();if(!d.sumData){return}d.lookupReference("tbTextTotal")&&d.lookupReference("tbTextTotal").setText(""+t("Refill Total")+": "+App.user.currency+" "+d.sumData.sumCredit+"")}},0,0,0,0,["controller.refill"],0,[MBilling.view.refill,"Controller"],0));(Ext.cmd.derive("MBilling.view.refill.Module",Ext.ux.panel.Module,{controller:"refill"},0,["refillmodule"],["component","box","container","uxpanelmodule","refillmodule"],{component:true,box:true,container:true,uxpanelmodule:true,refillmodule:true},["widget.refillmodule"],0,[MBilling.view.refill,"Module"],0));(Ext.cmd.derive("MBilling.view.refill.List",Ext.ux.grid.Panel,{store:"Refill",fieldSearch:"idUser.username",initComponent:function(){var b=this;b.buttonsTbar=[{xtype:"tbtext",reference:"tbTextTotal"}];if(App.user.isAdmin&&b.buttonCleanFilter){b.extraButtons=[{text:t("charts"),iconCls:"icon-chart-column",handler:"onChart",reference:"chart",disabled:true},{text:t("Invoice"),glyph:b.glyphPrint,handler:"onInvoice",reference:"invoice",hidden:!window.invoice,disabled:true}]}if(App.user.isClient){b.extraButtons=[{text:t("Invoice"),glyph:b.glyphPrint,handler:"onInvoice",reference:"invoice",hidden:!window.invoice,disabled:true}]}b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:3,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("credit"),dataIndex:"credit",renderer:Helper.Util.formatMoneyDecimal2,flex:2},{header:t("description"),dataIndex:"description",flex:5},{header:t("payment"),dataIndex:"payment",renderer:Helper.Util.formattyyesno,filter:{type:"list",options:[[0,t("no")],[1,t("yes")]]},flex:2},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"date",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["refilllist"],["component","box","container","panel","tablepanel","gridpanel","grid","refilllist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,refilllist:true},["widget.refilllist"],0,[MBilling.view.refill,"List"],0));(Ext.cmd.derive("MBilling.view.refill.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["id_user"],initComponent:function(){var b=this;b.items=[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient},{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,00",name:"credit",fieldLabel:t("credit"),readOnly:App.user.isClient},{xtype:"textareafield",name:"description",fieldLabel:t("description"),readOnly:App.user.isClient},{xtype:"yesnocombo",name:"payment",fieldLabel:t("add")+" "+t("payment"),hidden:App.user.isClient},{name:"invoice_number",fieldLabel:t("Invoice")+" "+t("number"),hidden:!window.invoice,allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["refillform"],["component","box","container","panel","form","refillform"],{component:true,box:true,container:true,panel:true,form:true,refillform:true},["widget.refillform"],0,[MBilling.view.refill,"Form"],0));(Ext.cmd.derive("Ext.ux.panel.Chart",Ext.panel.Panel,{rootData:undefined,positionLegendPie:"bottom",showLegendPie:true,widthTip:200,degressXLabel:0,fontLabel:"15px Arial",textBtnColumn:t("columns"),textBtnLine:t("lines"),textBtnBar:t("bars"),textBtnPie:t("pie"),iconBtnColumn:"icon-chart-column",iconBtnLine:"icon-chart-line",iconBtnBar:"icon-chart-bar",iconBtnPie:"icon-chart-pie",heightChart:400,charts:["column","bar","line","pie"],defaultChart:"column",limitCharLabelTip:25,bbarChart:[],tbarChart:[],minimumAxesY:0,border:false,layout:"card",btnShowColumn:true,btnShowBar:true,btnShowLine:true,btnShowPie:true,btnShowLineHidden:false,btnShowColumnHidden:false,showDownload:true,legend:null,titleText:"",fieldLabel:"",constructor:function(){var b=this;if(Ext.isString(b.store)){b.store=Ext.data.StoreManager.lookup(b.store);b.store.load({scope:b,callback:function(){if(b.store.getData().items[0]){b.sumData=b.store.getData().items[0].getData()}}})}Ext.panel.Panel.prototype.constructor.apply(this,arguments)},initComponent:function(){var s=this,x=s.charts.length,r,o,v,q,w=[],y=[],u=[],p,z;if(s.charts.length===1){s.defaultChart=s.charts[0]}s.fieldValue=Ext.isArray(s.fieldValue)?s.fieldValue:[s.fieldValue];if(s.rootData){p=Ext.getStore(s.store);z=p.model.proxy.reader.rawData;s.store=Ext.create("Ext.data.Store",{fields:Ext.Array.merge(s.fieldValue,s.fieldDescription),data:z&&z[s.rootData],proxy:{type:"memory",reader:{type:"json"}}});s.fieldValue=s.fieldValue[0].name||s.fieldValue[0];s.fieldDescription=s.fieldDescription.name||s.fieldDescription}Ext.each(s.fieldValue,function(a){u.push({type:"line",yField:a,xField:s.fieldDescription,marker:{radius:4},highlight:true,tooltip:{trackMouse:true,width:s.widthTip,renderer:s.rendererPie(s.fieldDescription,s.rendererFieldValue,s.rendererFieldDescription,s.limitCharLabelTip)}})});s.chartColumn={xtype:"cartesian",itemId:"column",height:s.heightChart,width:s.width,store:s.store,insetPadding:{top:s.titleText.length>0?40:10},axes:[{type:"numeric",title:s.labelYLine,position:"left",grid:true,minimum:s.minimumAxesY,renderer:s.rendererFieldValue||s.rendererDefault},{type:"category",title:s.labelXLine,position:"bottom",grid:true,renderer:s.rendererFieldDescription||s.rendererDefault,label:{rotate:{degrees:s.degressXLabel}}}],series:[{type:"bar",axis:"left",yField:s.fieldValue,xField:s.fieldDescription,highlight:true,tooltip:{width:s.widthTip,renderer:s.rendererPie(s.fieldDescription,s.rendererFieldValue,s.rendererFieldDescription,s.limitCharLabelTip)},label:{hidden:s.fieldLabel.length<1,field:s.fieldLabel,display:"insideEnd"}}],sprites:{hidden:s.titleText.length<1,type:"text",text:s.titleText,fontSize:22,width:100,height:30,x:40,y:20}};s.chartBar={xtype:"cartesian",itemId:"bar",height:s.heightChart,width:s.width,store:s.store,flipXY:true,insetPadding:{top:s.titleText.length>0?40:10},axes:[{type:"numeric",title:s.labelYLine,position:"bottom",fields:s.fieldValue,grid:true,minimum:s.minimumAxesY,renderer:s.rendererFieldValue||s.rendererDefault},{type:"category",title:s.labelXLine,position:"left",fields:s.fieldDescription,grid:true,renderer:s.rendererFieldDescription||s.rendererDefault}],series:[{type:"bar",yField:s.fieldValue,xField:s.fieldDescription,highlight:true,tooltip:{width:s.widthTip,renderer:s.rendererPie(s.fieldDescription,s.rendererFieldValue,s.rendererFieldDescription,s.limitCharLabelTip)},label:{hidden:s.fieldLabel.length<1,field:s.fieldLabel,display:"insideEnd"}}],sprites:{hidden:s.titleText.length<1,type:"text",text:s.titleText,fontSize:22,width:100,height:30,x:40,y:20}};s.chartLine={xtype:"cartesian",itemId:"line",height:s.heightChart,width:s.width,store:s.store,legend:s.legend,axes:[{type:"numeric",title:s.labelYLine,position:"left",fields:s.fieldValue,grid:true,minimum:s.minimumAxesY,renderer:s.rendererFieldValue||s.rendererDefault},{type:"category",title:s.labelXLine,position:"bottom",grid:true,fields:s.fieldDescription,renderer:s.rendererFieldDescription||s.rendererDefault}],series:u};s.chartPie={xtype:"polar",itemId:"pie",height:s.heightChart,width:s.width,store:s.store,legend:{position:s.positionLegendPie,renderer:s.rendererFieldDescription},series:[{type:"pie",angleField:s.fieldValue[0],showInLegend:s.showLegendPie,tooltip:{trackMouse:true,width:s.widthTip,renderer:s.rendererPie(s.fieldDescription,s.rendererFieldValue,s.rendererFieldDescription,s.limitCharLabelTip)},highlight:{segment:{margin:20}},label:{field:s.fieldDescription,display:"rotate",contrast:true,font:s.fontLabel,renderer:s.rendererFieldDescription||s.rendererDefault}}]};if(s.btnShowColumn){r={chart:"column",text:s.textBtnColumn,iconCls:s.iconBtnColumn,hidden:s.btnShowColumnHidden}}if(s.btnShowBar){o={chart:"bar",text:s.textBtnBar,iconCls:s.iconBtnBar}}if(s.btnShowLine){v={chart:"line",text:s.textBtnLine,iconCls:s.iconBtnLine,hidden:s.btnShowLineHidden}}if(s.btnShowPie){q={chart:"pie",text:s.textBtnPie,iconCls:s.iconBtnPie}}if(Ext.Array.contains(s.charts,"column")){w.push(s.chartColumn);y.push(r)}if(Ext.Array.contains(s.charts,"bar")){w.push(s.chartBar);y.push(o)}if(Ext.Array.contains(s.charts,"line")){w.push(s.chartLine);y.push(v)}if(Ext.Array.contains(s.charts,"pie")){w.push(s.chartPie);y.push(q)}s.bbarChart.push("->",{xtype:"buttongroup",toggleGroup:"typeChart",defaults:{enableToggle:true,allowDepress:false,toggleGroup:"typeChart",listeners:{scope:s,toggle:s.activeChart}},items:y});s.items=w;if(s.showDownload){s.tbarChart.push("->",{text:t("Download"),glyph:icons.disk,scope:s,handler:s.onDownload})}s.tbar=s.tbarChart;s.bbar=s.bbarChart;Ext.panel.Panel.prototype.initComponent.apply(this,arguments);s.activeItem=s.down("#"+s.defaultChart);s.down("button[chart="+s.defaultChart+"]").pressed=true},onDownload:function(){var b=this;b.getLayout().getActiveItem().download()},activeChart:function(d){var c=this;d.pressed&&c.getLayout().setActiveItem(c.down("#"+d.chart))},rendererPie:function(g,f,e,j){return function(a,o,c){var d=this,n=o.get(g),b=o.get(c.field);n=e?e(n):n;b=f?f(b):b;n=Ext.String.ellipsis(n,j)+": ";title=n+b;a.setHtml(title)}},rendererDefault:function(c,d){return d},rendererLegend:function(b){return t(b)}},1,["chartpanel"],["component","box","container","panel","chartpanel"],{component:true,box:true,container:true,panel:true,chartpanel:true},["widget.chartpanel"],0,[Ext.ux.panel,"Chart"],0));(Ext.cmd.derive("MBilling.view.refill.Chart",Ext.ux.panel.Chart,{controller:"refill",store:"RefillChart",fieldValue:"sumCreditMonth",fieldDescription:"CreditMonth",labelYLine:t("credit"),labelXLine:t("Month"),reference:"refillchart",btnShowColumn:true,btnShowBar:false,btnShowLine:false,btnShowPie:false,btnShowColumnHidden:true,initComponent:function(){var d=this,c;d.rendererFieldValue=Ext.util.Format.numberRenderer("0"),d.tbarChart=[{text:t("Per")+" "+t("Month"),scope:d,handler:"onPerMonth",reference:"btnMonth",disabled:true},{text:t("Per")+" "+t("day"),scope:d,handler:"onPerDay",reference:"btnDay"}];d.bbarChart=[{xtype:"tbtext",itemId:"tbTextSum"}];Ext.ux.panel.Chart.prototype.initComponent.apply(this,arguments)},onPerMonth:function(d){var c=this;c.lookupReference("btnMonth").disable();c.lookupReference("btnDay").enable();c.store.setRemoteFilter(true);c.store.filter("type","month");c.store.load()},onPerDay:function(d){var c=this;c.lookupReference("btnDay").disable();c.lookupReference("btnMonth").enable();c.store.setRemoteFilter(true);c.store.filter("type","day");c.store.load()}},0,["refillchart"],["component","box","container","panel","chartpanel","refillchart"],{component:true,box:true,container:true,panel:true,chartpanel:true,refillchart:true},["widget.refillchart"],0,[MBilling.view.refill,"Chart"],0));(Ext.cmd.derive("MBilling.view.methodPay.Controller",Ext.ux.app.ViewController,{init:function(){var b=this;b.control({methodpaycombo:{select:b.onSelectMethod}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectMethod:function(c,d){showFields=d.getData().showFields.split(",");this.showFieldsRelated(showFields)},showFieldsRelated:function(f){var d=this,e=d.formPanel.getForm().getFields();e.each(function(a){a.setVisible(f.indexOf(a.name)!==-1)})},onEdit:function(){var c=this,d=c.list.getSelectionModel().getSelection()[0];method=d?d.get("payment_method"):"Moip";showFields=c.formPanel.down("methodpaycombo").store.findRecord("payment_method",method).getData().showFields;showFields=showFields.split(",");c.showFieldsRelated(showFields);Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)},onNew:function(){var c=this,d=c.list.getSelectionModel().getSelection()[0];method="Moip";showFields=c.formPanel.down("methodpaycombo").store.findRecord("payment_method",method).getData().showFields;showFields=showFields.split(",");c.showFieldsRelated(showFields);Ext.ux.app.ViewController.prototype.onNew.apply(this,arguments)}},0,0,0,0,["controller.methodpay"],0,[MBilling.view.methodPay,"Controller"],0));(Ext.cmd.derive("MBilling.view.methodPay.Module",Ext.ux.panel.Module,{controller:"methodpay"},0,["methodpaymodule"],["component","box","container","uxpanelmodule","methodpaymodule"],{component:true,box:true,container:true,uxpanelmodule:true,methodpaymodule:true},["widget.methodpaymodule"],0,[MBilling.view.methodPay,"Module"],0));(Ext.cmd.derive("MBilling.view.methodPay.List",Ext.ux.grid.Panel,{store:"MethodPay",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("paymentmethods"),dataIndex:"payment_method",flex:2},{header:t("country"),dataIndex:"country",flex:2},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:2},{header:t("active"),dataIndex:"active",flex:1,comboRelated:"booleancombo",renderer:Helper.Util.formatBooleanActive,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")]]}}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["methodpaylist"],["component","box","container","panel","tablepanel","gridpanel","grid","methodpaylist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,methodpaylist:true},["widget.methodpaylist"],0,[MBilling.view.methodPay,"List"],0));(Ext.cmd.derive("MBilling.view.methodPay.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{xtype:"methodpaycombo",name:"payment_method",valueField:"payment_method",fieldLabel:t("paymentmethods")},{name:"show_name",fieldLabel:t("showName")},{xtype:"userlookup",ownerForm:b,name:"id_user"},{xtype:"paymentcountrycombo",name:"country",fieldLabel:t("country")},{xtype:"booleancombo",name:"active",fieldLabel:t("active")},{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,00",name:"min",value:10,fieldLabel:t("Min amount")},{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,00",name:"max",value:500,fieldLabel:t("Max amount")},{name:"username",fieldLabel:t("Username"),allowBlank:true},{name:"url",fieldLabel:"Url",allowBlank:true},{xtype:"noyescombo",name:"fee",fieldLabel:t("Discount")+" "+t("Fee"),allowBlank:true},{xtype:"paymentbanckcombo",name:"boleto_banco",fieldLabel:t("Bank"),allowBlank:true},{name:"boleto_convenio",fieldLabel:t("numeroconvenio"),allowBlank:true},{name:"boleto_agencia",fieldLabel:t("agencia"),allowBlank:true},{name:"boleto_conta_corrente",fieldLabel:t("contacorrente"),allowBlank:true},{name:"boleto_inicio_nosso_numeroa",fieldLabel:t("Inicio nosso nº"),allowBlank:true},{name:"boleto_carteira",fieldLabel:t("carteira"),allowBlank:true},{name:"boleto_taxa",fieldLabel:t("taxa"),allowBlank:true},{name:"boleto_instrucoes",fieldLabel:t("instructions"),maxLength:"100",allowBlank:true},{name:"boleto_nome_emp",fieldLabel:t("company"),allowBlank:true},{name:"boleto_end_emp",fieldLabel:t("address"),allowBlank:true},{name:"boleto_cidade_emp",fieldLabel:t("city"),allowBlank:true},{name:"boleto_estado_emp",fieldLabel:t("state"),allowBlank:true},{name:"boleto_cpf_emp",fieldLabel:"CNPJ CPF",allowBlank:true},{name:"pagseguro_TOKEN",fieldLabel:"TOKEN",allowBlank:true},{name:"P2P_CustomerSiteID",fieldLabel:t("P2P CustomerSiteID"),allowBlank:true},{name:"P2P_KeyID",fieldLabel:t("P2P KeyID"),allowBlank:true},{name:"P2P_Passphrase",fieldLabel:t("P2P Passphrase"),allowBlank:true},{name:"P2P_RecipientKeyID",fieldLabel:t("P2P RecipientKeyID"),allowBlank:true},{name:"P2P_tax_amount",fieldLabel:t("P2P Tax Amount"),allowBlank:true},{name:"client_id",fieldLabel:t("Client id"),allowBlank:true},{name:"client_secret",fieldLabel:t("Client Secret"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["methodpayform"],["component","box","container","panel","form","methodpayform"],{component:true,box:true,container:true,panel:true,form:true,methodpayform:true},["widget.methodpayform"],0,[MBilling.view.methodPay,"Form"],0));(Ext.cmd.derive("MBilling.view.methodPay.Combo",Ext.form.field.ComboBox,{name:"id_methodpay",fieldLabel:t("methodPay"),displayField:"show_name",valueField:"id",forceSelection:true,editable:false,initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.MethodPay",{proxy:{type:"uxproxy",module:"methodpay",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["methodpaycombo"],["component","box","field","textfield","pickerfield","combobox","combo","methodpaycombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,methodpaycombo:true},["widget.methodpaycombo"],0,[MBilling.view.methodPay,"Combo"],0));(Ext.cmd.derive("MBilling.view.voucher.Controller",Ext.ux.app.ViewController,{onSave:function(){var b=this;Ext.ux.app.ViewController.prototype.onSave.apply(this,arguments);b.formPanel.setLoading(false);b.saveButton.enable();b.store.load()}},0,0,0,0,["controller.voucher"],0,[MBilling.view.voucher,"Controller"],0));(Ext.cmd.derive("MBilling.view.voucher.Module",Ext.ux.panel.Module,{controller:"voucher"},0,["vouchermodule"],["component","box","container","uxpanelmodule","vouchermodule"],{component:true,box:true,container:true,uxpanelmodule:true,vouchermodule:true},["widget.vouchermodule"],0,[MBilling.view.voucher,"Module"],0));(Ext.cmd.derive("MBilling.view.voucher.List",Ext.ux.grid.Panel,{store:"Voucher",initComponent:function(){var b=this;b.buttonCsv=false;b.allowPrint=false;b.buttonUpdateLot=false;b.allowUpdate=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:3,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("credit"),dataIndex:"credit",renderer:Helper.Util.formatMoneyDecimal,filter:{type:"int",field:"t.credit"},flex:3},{header:t("voucher"),dataIndex:"voucher",flex:5},{header:t("description"),dataIndex:"tag",flex:3,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("usedate"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"usedate",flex:4},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"creationdate",flex:4,hidden:App.user.isClient,hideable:!App.user.isClient}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["voucherlist"],["component","box","container","panel","tablepanel","gridpanel","grid","voucherlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,voucherlist:true},["widget.voucherlist"],0,[MBilling.view.voucher,"List"],0));(Ext.cmd.derive("MBilling.view.voucher.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;if(!App.user.isClient){b.fieldsHideEdit=["quantity"]}if(App.user.isClient){b.textNew=t("Insert Voucher");b.buttonNewWidth=150}b.items=[{xtype:"moneyfield",name:"credit",fieldLabel:t("credit"),hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"id_plan",fieldLabel:t("Plan"),xtype:"plancombo",hidden:!App.user.isAdmin,allowBlank:!App.user.isAdmin},{xtype:"languagecombo",name:"language",fieldLabel:t("language"),hidden:!App.user.isAdmin,allowBlank:!App.user.isAdmin},{name:"prefix_local",fieldLabel:t("prefixlocal"),value:App.user.base_country=="BRL"?"0/55,*/5511/8,*/5511/9":App.user.base_country=="ARG"?"0/54,*/5411/8,15/54911/10,16/54911/10":"",emptyText:"match / replace / length",hidden:!App.user.isAdmin,allowBlank:true},{xtype:"numberfield",name:"quantity",fieldLabel:t("Quantity"),hidden:!App.user.isAdmin,allowBlank:!App.user.isAdmin,value:10},{name:"tag",fieldLabel:t("description"),hidden:App.user.isClient,allowBlank:true},{xtype:"numberfield",name:"voucher",fieldLabel:t("voucher"),value:"",maxLength:6,minLength:6,hidden:!App.user.isClient,allowBlank:!App.user.isClient}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["voucherform"],["component","box","container","panel","form","voucherform"],{component:true,box:true,container:true,panel:true,form:true,voucherform:true},["widget.voucherform"],0,[MBilling.view.voucher,"Form"],0));(Ext.cmd.derive("MBilling.view.refillprovider.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.refillprovider"],0,[MBilling.view.refillprovider,"Controller"],0));(Ext.cmd.derive("MBilling.view.refillprovider.Module",Ext.ux.panel.Module,{controller:"refillprovider"},0,["refillprovidermodule"],["component","box","container","uxpanelmodule","refillprovidermodule"],{component:true,box:true,container:true,uxpanelmodule:true,refillprovidermodule:true},["widget.refillprovidermodule"],0,[MBilling.view.refillprovider,"Module"],0));(Ext.cmd.derive("MBilling.view.refillprovider.List",Ext.ux.grid.Panel,{store:"Refillprovider",initComponent:function(){var b=this;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{xtype:"templatecolumn",tpl:"{idProviderprovider_name}",header:t("provider"),dataIndex:"id_provider",comboFilter:"providercombo",flex:2},{header:t("credit"),dataIndex:"credit",renderer:Helper.Util.formatMoneyDecimal,flex:2},{header:t("description"),dataIndex:"description",flex:4},{header:t("payment"),dataIndex:"payment",renderer:Helper.Util.formattyyesno,filter:{type:"list",options:[[0,t("no")],[1,t("yes")]]},flex:2},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"date",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["refillproviderlist"],["component","box","container","panel","tablepanel","gridpanel","grid","refillproviderlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,refillproviderlist:true},["widget.refillproviderlist"],0,[MBilling.view.refillprovider,"List"],0));(Ext.cmd.derive("MBilling.view.refillprovider.Form",Ext.ux.form.Panel,{bodyPadding:0,fieldsHideUpdateLot:["id_provider"],initComponent:function(){var b=this;b.items=[{xtype:"providercombo"},{xtype:"moneyfield",name:"credit",fieldLabel:t("credit")},{xtype:"textareafield",name:"description",fieldLabel:t("description"),allowBlank:true},{xtype:"yesnocombo",name:"payment",fieldLabel:t("add")+" "+t("payment"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["refillproviderform"],["component","box","container","panel","form","refillproviderform"],{component:true,box:true,container:true,panel:true,form:true,refillproviderform:true},["widget.refillproviderform"],0,[MBilling.view.refillprovider,"Form"],0));(Ext.cmd.derive("MBilling.view.boleto.Controller",Ext.ux.app.ViewController,{onAfterSave:function(d){var c=this;if(c.formPanel.idRecord==0){url="index.php/boleto/secondVia/?id=last";window.open(url)}Ext.ux.app.ViewController.prototype.onAfterSave.apply(this,arguments)},onSecondVia:function(e){var f=this,d=f.list.getSelectionModel().getSelection()[0];if(f.list.getSelectionModel().getSelection().length==0){Ext.ux.Alert.alert(f.titleError,t("Por favor selecione um bolero"),"notification")}else{if(f.list.getSelectionModel().getSelection().length>1){Ext.ux.Alert.alert(f.titleError,t("Por favor selecione somente um bolero"),"notification")}else{url="index.php/boleto/secondVia/?id="+d.get("id");window.open(url)}}}},0,0,0,0,["controller.boleto"],0,[MBilling.view.boleto,"Controller"],0));(Ext.cmd.derive("MBilling.view.boleto.Module",Ext.ux.panel.Module,{controller:"boleto"},0,["boletomodule"],["component","box","container","uxpanelmodule","boletomodule"],{component:true,box:true,container:true,uxpanelmodule:true,boletomodule:true},["widget.boletomodule"],0,[MBilling.view.boleto,"Module"],0));(Ext.cmd.derive("MBilling.view.boleto.List",Ext.ux.grid.Panel,{store:"Boleto",iconButtonCsv:"boleto",textButtonCsv:t("Importar Retorno"),iconButtonImportCsv:"boleto",textButtonImportCsv:t("Importar Retorno"),initComponent:function(){var b=this;b.buttonCsv=false;b.buttonUpdateLot=false;b.buttonImportCsv=App.user.isAdmin;b.extraButtons=[{text:t("Segunda via"),iconCls:"boleto",handler:"onSecondVia",disabled:false}];b.columns=[{header:t("Nosso Número"),dataIndex:"id",flex:3,hidden:!App.user.isAdmin,hideable:App.user.isAdmin},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("value"),dataIndex:"payment",renderer:Helper.Util.formatMoneyDecimal,flex:4},{header:"Pago",dataIndex:"status",renderer:Helper.Util.formattyyesno,flex:2,filter:{type:"list",options:[[0,t("no")],[1,t("yes")]]}},{header:t("description"),dataIndex:"description",flex:5},{header:"Vencimento",renderer:Ext.util.Format.dateRenderer("Y-m-d"),dataIndex:"vencimento",flex:4},{header:"Gerado",renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"date",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["boletolist"],["component","box","container","panel","tablepanel","gridpanel","grid","boletolist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,boletolist:true},["widget.boletolist"],0,[MBilling.view.boleto,"List"],0));(Ext.cmd.derive("MBilling.view.boleto.Form",Ext.ux.form.Panel,{fieldsHideEdit:["cid"],initComponent:function(){var b=this;b.items=[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:App.user.isClient},{xtype:"moneyfield",name:"payment",fieldLabel:t("value"),readOnly:App.user.isClient},{xtype:"yesnocombo",name:"status",fieldLabel:t("Pago"),hidden:App.user.isClient,value:0},{xtype:"datefield",name:"vencimento",fieldLabel:"Vencimento",format:"Y-m-d H:i:s",hidden:App.user.isClient||App.user.isAgent},{xtype:"textareafield",name:"description",fieldLabel:t("description"),readOnly:App.user.isClient}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["boletoform"],["component","box","container","panel","form","boletoform"],{component:true,box:true,container:true,panel:true,form:true,boletoform:true},["widget.boletoform"],0,[MBilling.view.boleto,"Form"],0));(Ext.cmd.derive("Ext.ux.window.ImportBoleto",Ext.window.Window,{autoShow:true,modal:true,layout:"fit",iconCls:"boleto",title:t("Importa Retorno Boleto"),width:400,height:175,labelWidthFields:180,htmlTipInfo:"",fieldsImport:[],initComponent:function(){var d=this,c=Ext.Array.merge(d.fieldsImport,[{xtype:"uploadfield",fieldLabel:t("Selecion o arquivo .RET"),htmlTipInfo:d.htmlTipInfo}]);d.items=[{xtype:"form",bodyPadding:5,labelWidth:d.labelWidthFields,items:c}];d.title=d.title+(d.titleModule?" - "+d.titleModule:"");d.bbar=[{xtype:"tbtext",text:t("maxSizeFile")+"3 MB"},"->",{iconCls:"boleto",text:t("importText"),scope:d,handler:d.onImport}];Ext.window.Window.prototype.initComponent.apply(this,arguments)},onImport:function(d){var f=this,e=f.list.store;d.disable();f.list.setLoading(true);f.down("form").submit({url:"index.php/boleto/retorno",scope:f,success:function(c,b){var a=Ext.decode(b.response.responseText);if(a.success){Ext.ux.Alert.alert(t("Success"),a.msg,"success",true,false,40000)}else{Ext.ux.Alert.alert(t("Error"),a.errors,"error")}d.enable();f.list.setLoading(false);e.load();f.close()},failure:function(c,b){if(Ext.isObject(b.response.responseText)){var a=Ext.decode(b.response.responseText);Ext.ux.Alert.alert(t("Error"),a.errors,"error")}else{Ext.ux.Alert.alert(t("Error"),b.response.responseText,"error",true,10)}d.enable();f.list.setLoading(false);f.close()}})}},0,0,["component","box","container","panel","window"],{component:true,box:true,container:true,panel:true,window:true},0,0,[Ext.ux.window,"ImportBoleto"],0));(Ext.cmd.derive("MBilling.view.boleto.ImportCsv",Ext.ux.window.ImportBoleto,{title:t("Importar Retorno"),labelWidthFields:250,height:275,fieldsImport:[{xtype:"boletobanckcombo",name:"banco",fieldLabel:t("Banco"),width:350}]},0,["boletoimportcsv"],["component","box","container","panel","window","boletoimportcsv"],{component:true,box:true,container:true,panel:true,window:true,boletoimportcsv:true},["widget.boletoimportcsv"],0,[MBilling.view.boleto,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.offer.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.offer"],0,[MBilling.view.offer,"Controller"],0));(Ext.cmd.derive("MBilling.view.offer.Combo",Ext.form.field.ComboBox,{name:"id_offer",fieldLabel:t("offer"),displayField:"label",valueField:"id",value:0,extraValues:[{id:0,label:t("undefined")}],initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Offer",{proxy:{type:"uxproxy",module:"offer",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["offercombo"],["component","box","field","textfield","pickerfield","combobox","combo","offercombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,offercombo:true},["widget.offercombo"],0,[MBilling.view.offer,"Combo"],0));(Ext.cmd.derive("MBilling.view.offer.Module",Ext.ux.panel.Module,{controller:"offer"},0,["offermodule"],["component","box","container","uxpanelmodule","offermodule"],{component:true,box:true,container:true,uxpanelmodule:true,offermodule:true},["widget.offermodule"],0,[MBilling.view.offer,"Module"],0));(Ext.cmd.derive("MBilling.view.offer.List",Ext.ux.grid.Panel,{store:"Offer",initComponent:function(){var b=this;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("name"),dataIndex:"label",flex:1},{header:t("packagetype"),dataIndex:"packagetype",renderer:Helper.Util.formatPackageType,comboRelated:"offertypecombo",flex:1,filter:{type:"list",options:[[0,t("unlimitedcalls")],[1,t("numberfreecalls")],[2,t("freeseconds")]]}},{header:t("freetimetocall"),dataIndex:"freetimetocall",flex:1},{header:t("periode"),dataIndex:"billingtype",renderer:Helper.Util.formatBillingType,comboRelated:"billingtypecombo",flex:1,filter:{type:"list",options:[[0,t("monthly")],[1,t("weekly")]]}},{header:t("price"),dataIndex:"price",renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,hideable:App.user.isAdmin,flex:2},{header:t("creationdate"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"creationdate",flex:1}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["offerlist"],["component","box","container","panel","tablepanel","gridpanel","grid","offerlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,offerlist:true},["widget.offerlist"],0,[MBilling.view.offer,"List"],0));(Ext.cmd.derive("MBilling.view.offer.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["name"],items:[{name:"label",fieldLabel:t("name")},{xtype:"offertypecombo",name:"packagetype",fieldLabel:t("packagetype")},{name:"freetimetocall",fieldLabel:t("freetimetocall")},{xtype:"billingtypecombo",name:"billingtype",fieldLabel:t("periode")},{xtype:"moneyfield",name:"price",fieldLabel:t("price")}]},0,["offerform"],["component","box","container","panel","form","offerform"],{component:true,box:true,container:true,panel:true,form:true,offerform:true},["widget.offerform"],0,[MBilling.view.offer,"Form"],0));(Ext.cmd.derive("MBilling.view.offerCdr.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.offercdr"],0,[MBilling.view.offerCdr,"Controller"],0));(Ext.cmd.derive("MBilling.view.offerCdr.Module",Ext.ux.panel.Module,{controller:"offercdr"},0,["offercdrmodule"],["component","box","container","uxpanelmodule","offercdrmodule"],{component:true,box:true,container:true,uxpanelmodule:true,offercdrmodule:true},["widget.offercdrmodule"],0,[MBilling.view.offerCdr,"Module"],0));(Ext.cmd.derive("MBilling.view.offerCdr.List",Ext.ux.grid.Panel,{store:"OfferCdr",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"date_consumption",flex:3},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:3},{xtype:"templatecolumn",tpl:"{idOfferlabel}",header:t("offer"),dataIndex:"id_offer",comboFilter:"offercombo",flex:3},{header:t("duration"),dataIndex:"used_secondes",renderer:Helper.Util.formatsecondsToTime,flex:3}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["offercdrlist"],["component","box","container","panel","tablepanel","gridpanel","grid","offercdrlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,offercdrlist:true},["widget.offercdrlist"],0,[MBilling.view.offerCdr,"List"],0));(Ext.cmd.derive("MBilling.view.offerCdr.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.columns=[{xtype:"usercombo"},{xtype:"offercombo"},{name:"used_secondes",fieldLabel:t("usedsecondes")},{xtype:"datefield",name:"date_consumption",fieldLabel:t("date"),format:"Y-m-d H:i:s"}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["offercdrform"],["component","box","container","panel","form","offercdrform"],{component:true,box:true,container:true,panel:true,form:true,offercdrform:true},["widget.offercdrform"],0,[MBilling.view.offerCdr,"Form"],0));(Ext.cmd.derive("MBilling.view.offerUse.Module",Ext.ux.panel.Module,{controller:"offeruse"},0,["offerusemodule"],["component","box","container","uxpanelmodule","offerusemodule"],{component:true,box:true,container:true,uxpanelmodule:true,offerusemodule:true},["widget.offerusemodule"],0,[MBilling.view.offerUse,"Module"],0));(Ext.cmd.derive("MBilling.view.offerUse.List",Ext.ux.grid.Panel,{store:"OfferUse",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:3},{xtype:"templatecolumn",tpl:"{idOfferlabel}",header:t("offer"),dataIndex:"id_offer",comboFilter:"offercombo",flex:3},{header:t("monthpayed"),dataIndex:"month_payed",flex:3},{header:t("reservationdate"),renderer:Ext.util.Format.dateRenderer("Y-m-d"),dataIndex:"reservationdate",flex:3},{header:t("releasedate"),renderer:Ext.util.Format.dateRenderer("Y-m-d"),dataIndex:"releasedate",flex:3}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["offeruselist"],["component","box","container","panel","tablepanel","gridpanel","grid","offeruselist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,offeruselist:true},["widget.offeruselist"],0,[MBilling.view.offerUse,"List"],0));(Ext.cmd.derive("MBilling.view.offerUse.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{xtype:"userlookup",ownerForm:b,readOnly:true},{xtype:"offercombo",readOnly:true},{name:"month_payed",fieldLabel:t("monthpayed")},{xtype:"datefield",name:"reservationdate",fieldLabel:t("reservationdate"),format:"Y-m-d H:i:s"}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["offeruseform"],["component","box","container","panel","form","offeruseform"],{component:true,box:true,container:true,panel:true,form:true,offeruseform:true},["widget.offeruseform"],0,[MBilling.view.offerUse,"Form"],0));(Ext.cmd.derive("MBilling.view.campaign.Controller",Ext.ux.app.ViewController,{isSubmitForm:true,init:function(){var b=this;b.control({typecampaigndestinationcombo:{select:b.onSelectMethod}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectMethod:function(c,d){this.showFieldsRelated(d.getData().showFields)},showFieldsRelated:function(j){var l=this,m=l.formPanel.getForm(),g=l.formPanel.getForm().getFields(),f=Ext.get(Ext.Element.getActiveElement()).component;l.onSetVisibleFiel(f,m,f.value)},onSetVisibleFiel:function(e,d,f){if(e.value=="undefined"){e.setValue("undefined")}if(e.name.match("^type_0")){d.findField("id_queue_0").setVisible(f.match("^queue"));d.findField("id_sip_0").setVisible(f.match("^sip"));d.findField("id_ivr_0").setVisible(f.match("^ivr"));d.findField("extension_0").setVisible(f.match("^group|^number|^custom"))}},onEdit:function(){var f=this,d=f.formPanel.getForm(),e=f.list.getSelectionModel().getSelection()[0];if(e.getData()["type_0"]=="ivr"){d.findField("id_ivr_0").setVisible(true);d.findField("id_sip_0").setVisible(false);d.findField("id_queue_0").setVisible(false);d.findField("extension_0").setVisible(false)}else{if(e.getData()["type_0"]=="sip"){d.findField("id_sip_0").setVisible(true);d.findField("id_ivr_0").setVisible(false);d.findField("id_queue_0").setVisible(false);d.findField("extension_0").setVisible(false)}else{if(e.getData()["type_0"]=="queue"){d.findField("id_queue_0").setVisible(true);d.findField("id_sip_0").setVisible(false);d.findField("id_ivr_0").setVisible(false);d.findField("extension_0").setVisible(false)}else{if(e.getData()["type_0"].match("custom|number|group")){d.findField("extension_0").setVisible(true);d.findField("id_ivr_0").setVisible(false);d.findField("id_sip_0").setVisible(false);d.findField("id_queue_0").setVisible(false)}else{d.findField("id_queue_0").setVisible(false);d.findField("id_sip_0").setVisible(false);d.findField("id_ivr_0").setVisible(false);d.findField("extension_0").setVisible(false)}}}}Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)},onNew:function(){var f=this,d=f.formPanel.getForm(),e=f.list.getSelectionModel().getSelection()[0];d.findField("id_ivr_0").setVisible(false);d.findField("id_sip_0").setVisible(false);d.findField("id_queue_0").setVisible(false);d.findField("extension_0").setVisible(false);Ext.ux.app.ViewController.prototype.onNew.apply(this,arguments)},submitForm:function(d){var f=this,e=f.store;Ext.apply(f.params,{id_phonebook_array:f.formPanel.getForm().getFieldValues().id_phonebook.join(",")});f.formPanel.add({xtype:"hiddenfield",name:f.idProperty,value:f.formPanel.idRecord});f.formPanel.getForm().submit({url:f.store.getProxy().api.create,params:f.params,scope:f,success:function(c,b){var a=Ext.decode(b.response.responseText);if(a.success){Ext.ux.Alert.alert(f.titleSuccess,a.msg,"success");f.formPanel.fireEvent("aftersave",f.formPanel,a.rows[0])}else{errors=Helper.Util.convertErrorsJsonToString(a.msg);if(!Ext.isObject(a.errors)){Ext.ux.Alert.alert(f.titleError,errors,"error")}else{c.markInvalid(a.errors);Ext.ux.Alert.alert(f.titleWarning,f.msgFormInvalid,"warning")}}f.store.load();f.formPanel.setLoading(false);f.saveButton.enable()},failure:function(j,c){var b=Ext.decode(c.response.responseText),a=Helper.Util.convertErrorsJsonToString(b.errors);if(!Ext.isObject(b.errors)){Ext.ux.Alert.alert(f.titleError,a,"error")}else{j.markInvalid(b.errors);Ext.ux.Alert.alert(f.titleWarning,a,"error")}f.formPanel.setLoading(false);f.saveButton.enable()}})},onTestCampaign:function(e){var f=this,d=f.list.getSelectionModel().getSelection()[0];if(f.list.getSelectionModel().getSelection().length==0){Ext.ux.Alert.alert(f.titleError,t("Please Select one campaign"),"notification")}else{if(f.list.getSelectionModel().getSelection().length>1){Ext.ux.Alert.alert(f.titleError,t("Please Select only one campaign"),"notification")}else{Ext.Ajax.request({url:"index.php/campaign/testCampaign",params:{id:d.get("id")},scope:f,success:function(b){b=Ext.decode(b.responseText);if(b[f.nameSuccessRequest]){Ext.ux.Alert.alert(f.titleSuccess,b[f.nameMsgRequest],"success")}else{var a=Helper.Util.convertErrorsJsonToString(b[f.nameMsgRequest]);Ext.ux.Alert.alert(f.titleSuccess,a,"error")}}})}}}},0,0,0,0,["controller.campaign"],0,[MBilling.view.campaign,"Controller"],0));(Ext.cmd.derive("MBilling.view.campaign.Combo",Ext.form.field.ComboBox,{name:"id_campaign",fieldLabel:t("campaign"),displayField:"name",forceSelection:true,editable:false,valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Campaign",{proxy:{type:"uxproxy",module:"campaign",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["campaigncombo"],["component","box","field","textfield","pickerfield","combobox","combo","campaigncombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,campaigncombo:true},["widget.campaigncombo"],0,[MBilling.view.campaign,"Combo"],0));(Ext.cmd.derive("MBilling.view.general.TypeCampaignDestination",Ext.form.field.ComboBox,{fieldLabel:t("type"),forceSelection:true,editable:false,value:"",store:[["",t("")],["undefined",t("Undefined")],["sip",t("SIP")],["ivr",t("IVR")],["queue",t("Queue")],["group",t("Group")],["custom",t("Custom")]]},0,["typecampaigndestinationcombo"],["component","box","field","textfield","pickerfield","combobox","combo","typecampaigndestinationcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,typecampaigndestinationcombo:true},["widget.typecampaigndestinationcombo"],0,[MBilling.view.general,"TypeCampaignDestination"],0));(Ext.cmd.derive("MBilling.view.campaign.Module",Ext.ux.panel.Module,{controller:"campaign"},0,["campaignmodule"],["component","box","container","uxpanelmodule","campaignmodule"],{component:true,box:true,container:true,uxpanelmodule:true,campaignmodule:true},["widget.campaignmodule"],0,[MBilling.view.campaign,"Module"],0));(Ext.cmd.derive("MBilling.view.campaign.List",Ext.ux.grid.Panel,{store:"Campaign",fieldSearch:"name",initComponent:function(){var b=this;b.buttonCsv=false;b.allowPrint=false;b.extraButtons=[{text:t("Test")+" "+t("Campaign"),iconCls:"call",handler:"onTestCampaign",disabled:false}];b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("name"),dataIndex:"name",flex:4},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:3,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("status"),dataIndex:"status",renderer:Helper.Util.formatBooleanActive,comboRelated:"booleancombo",flex:2,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")]]}},{header:t("type"),dataIndex:"type",renderer:Helper.Util.formatCampaignType,comboRelated:"campaigntypecombo",flex:2,filter:App.user.l.slice(4,7)=="wap"?{type:"list",options:[[0,t("sms")],[1,t("voice")],[3,t("WhasApp")]]}:{type:"list",options:[[0,t("sms")],[1,t("voice")]]}},{header:t("daily_start_time"),dataIndex:"daily_start_time",flex:4},{header:t("daily_stop_time"),dataIndex:"daily_stop_time",flex:4},{header:t("startingdate"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"startingdate",flex:4},{header:t("Call Limit"),dataIndex:"frequency",flex:4,hidden:true,hideable:App.user.isAdmin},{header:t("Max Complete Call"),dataIndex:"secondusedreal",flex:3,hidden:true,hideable:App.user.isAdmin}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignlist"],["component","box","container","panel","tablepanel","gridpanel","grid","campaignlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,campaignlist:true},["widget.campaignlist"],0,[MBilling.view.campaign,"List"],0));(Ext.cmd.derive("MBilling.view.campaign.Form",Ext.ux.form.Panel,{bodyPadding:0,fieldsHideUpdateLot:["id_user","name","audio","audio_2","id_phonebook"],fileUpload:true,initComponent:function(){var b=this;b.labelWidthFields=120;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{plugins:"markallowblank",allowBlank:false,anchor:"100%",labelAlign:"right"}},items:[{title:t("general"),items:[{xtype:App.user.isClient?"textfield":"userlookup",ownerForm:b,hidden:App.user.isClient},{fieldLabel:t("Plan"),xtype:"plancombo",name:"id_plan",hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"name",fieldLabel:t("name")},{xtype:"booleancombo",name:"status",fieldLabel:t("status")},{xtype:"datetimefield",name:"startingdate",fieldLabel:t("startingdate"),format:"Y-m-d H:i:s",value:new Date()},{xtype:"datetimefield",name:"expirationdate",fieldLabel:t("expirationdate"),format:"Y-m-d H:i:s",value:"2030-01-01 00:00:00"},{xtype:"campaigntypefullcombo",name:"type",fieldLabel:t("type")},{xtype:"uploadfield",fieldLabel:t("Audio"),emptyText:"Select an wav or gsm File",allowBlank:true,name:"audio",extAllowed:["wav","gsm"]},{xtype:"uploadfield",fieldLabel:t("Audio")+"2",emptyText:"Select an wav or gsm File",allowBlank:true,name:"audio_2",extAllowed:["wav","gsm"]},{xtype:"yesnocombo",name:"restrict_phone",fieldLabel:t("Restrict Phone"),hidden:App.user.isClient,allowBlank:true},{style:"margin-top:25px",xtype:"fieldset",title:t("Forward to"),collapsible:true,collapsed:false,height:110,defaults:{labelWidth:190,anchor:"100%",labelAlign:b.labelAlignFields},items:[{xtype:"numberfield",name:"digit_authorize",fieldLabel:t("Number to Forward"),value:"-1",minValue:"-1",maxValue:9},{fieldLabel:t("Forward Type"),name:"type_0",xtype:"typecampaigndestinationcombo",allowBlank:true},{xtype:"textfield",name:"extensions_0",fieldLabel:t("Destination"),value:"0",allowBlank:true,hidden:true},{xtype:"ivrlookup",ownerForm:b,name:"id_ivr_0",fieldLabel:t("IVR"),displayField:"id_ivr_0_name",allowBlank:true,hidden:true},{xtype:"queuelookup",ownerForm:b,name:"id_queue_0",fieldLabel:t("Queue"),displayField:"id_queue_0_name",allowBlank:true,hidden:true},{xtype:"siplookup",ownerForm:b,name:"id_sip_0",displayField:"id_sip_0_name",fieldLabel:t("SIP"),allowBlank:true,hidden:true},{xtype:"textfield",fieldLabel:t("Destination"),name:"extension_0",hidden:true}]},{style:"margin-top:10px",xtype:"fieldset",title:t("Select one or more phonebook"),collapsible:true,collapsed:false,items:[{labelWidth:10,name:"id_phonebook",fieldLabel:t("phonebook"),anchor:"100%",fieldLabel:"",xtype:"phonebooktag",allowBlank:true}]}]},{title:t("schedules"),items:[{name:"daily_start_time",fieldLabel:t("daily_start_time"),value:"09:00"},{name:"daily_stop_time",fieldLabel:t("daily_stop_time"),value:"18:00"},{xtype:"yesnocombo",fieldLabel:t("monday"),name:"monday"},{xtype:"yesnocombo",fieldLabel:t("tuesday"),name:"tuesday"},{xtype:"yesnocombo",fieldLabel:t("wednesday"),name:"wednesday"},{xtype:"yesnocombo",fieldLabel:t("thursday"),name:"thursday"},{xtype:"yesnocombo",fieldLabel:t("friday"),name:"friday"},{xtype:"noyescombo",fieldLabel:t("saturday"),name:"saturday"},{xtype:"noyescombo",fieldLabel:t("sunday"),name:"sunday"}]},{title:t("Limit"),items:[{name:"frequency",fieldLabel:t("Call Limit"),readOnly:!App.user.isAdmin,allowBlank:!App.user.isAdmin,value:App.user.isClient?1:10},{name:"nb_callmade",fieldLabel:t("Total Audio Time"),hidden:!App.user.isAdmin,allowBlank:true,value:0},{xtype:"booleancombo",name:"enable_max_call",fieldLabel:t("Enable")+" "+t("Max Complete Call"),hidden:!App.user.isAdmin,allowBlank:true,value:0},{name:"secondusedreal",fieldLabel:t("Max Complete Call"),hidden:!App.user.isAdmin,allowBlank:true,value:0}]},{title:t("SMS"),items:[{xtype:"textareafield",name:"description",fieldLabel:t("descriptionOrSmsText"),allowBlank:true,maxLength:160}]},{title:t("TTS/ASR"),hidden:!window.ttsasr,items:[{name:"tts_audio",fieldLabel:t("Audio 1 TTS"),allowBlank:true,maxLength:200},{name:"tts_audio2",fieldLabel:t("Audio 2 TTS"),allowBlank:true,maxLength:200},{xtype:"box",hidden:false,autoEl:{tag:"br"}},{name:"asr_options",fieldLabel:t("Option to validate ASR"),allowBlank:true,maxLength:160}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignform"],["component","box","container","panel","form","campaignform"],{component:true,box:true,container:true,panel:true,form:true,campaignform:true},["widget.campaignform"],0,[MBilling.view.campaign,"Form"],0));(Ext.cmd.derive("MBilling.view.campaignPoll.Controller",Ext.ux.app.ViewController,{isSubmitForm:true},0,0,0,0,["controller.campaignpoll"],0,[MBilling.view.campaignPoll,"Controller"],0));(Ext.cmd.derive("MBilling.view.campaignPoll.Combo",Ext.form.field.ComboBox,{name:"id_campaign_poll",fieldLabel:t("campaignpoll"),displayField:"name",valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.CampaignPoll",{proxy:{type:"uxproxy",module:"campaignPoll",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["campaignpollcombo"],["component","box","field","textfield","pickerfield","combobox","combo","campaignpollcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,campaignpollcombo:true},["widget.campaignpollcombo"],0,[MBilling.view.campaignPoll,"Combo"],0));(Ext.cmd.derive("MBilling.view.campaignPoll.Module",Ext.ux.panel.Module,{controller:"campaignpoll"},0,["campaignpollmodule"],["component","box","container","uxpanelmodule","campaignpollmodule"],{component:true,box:true,container:true,uxpanelmodule:true,campaignpollmodule:true},["widget.campaignpollmodule"],0,[MBilling.view.campaignPoll,"Module"],0));(Ext.cmd.derive("MBilling.view.campaignPoll.List",Ext.ux.grid.Panel,{store:"CampaignPoll",initComponent:function(){var b=this;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("name"),dataIndex:"name",flex:4},{xtype:"templatecolumn",tpl:"{idCampaignname}",header:t("campaign"),dataIndex:"id_campaign",comboFilter:"campaigncombo",flex:4},{header:t("description"),dataIndex:"description",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignpolllist"],["component","box","container","panel","tablepanel","gridpanel","grid","campaignpolllist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,campaignpolllist:true},["widget.campaignpolllist"],0,[MBilling.view.campaignPoll,"List"],0));(Ext.cmd.derive("MBilling.view.campaignPoll.Form",Ext.ux.form.Panel,{bodyPadding:0,fileUpload:true,fieldsHideUpdateLot:["id_campaign","name","arq_audio"],initComponent:function(){var b=this;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{plugins:"markallowblank",allowBlank:false,anchor:"100%",labelAlign:"right"}},items:[{title:t("general"),items:[{xtype:"campaigncombo"},{name:"name",fieldLabel:t("name")},{xtype:"numberfield",name:"repeat",fieldLabel:t("How many time to repeat, if the client press invalid option?"),minValue:0,maxValue:9,allowBlank:true},{xtype:"noyescombo",name:"request_authorize",fieldLabel:t("Request")+" "+t("authorization")},{xtype:"numberfield",name:"digit_authorize",fieldLabel:t("Number for authorize"),value:"1",minValue:1,maxValue:9,allowBlank:true},{xtype:"textareafield",name:"description",fieldLabel:t("description"),allowBlank:true},{xtype:"uploadfield",fieldLabel:"Audio",emptyText:"Select an wav or gsm File",allowBlank:true,name:"arq_audio",extAllowed:["wav","gsm"]}]},{title:t("options"),itemId:"optionsData",items:[{name:"option0",fieldLabel:t("option")+" 0",allowBlank:true},{name:"option1",fieldLabel:t("option")+" 1",allowBlank:true},{name:"option2",fieldLabel:t("option")+" 2",allowBlank:true},{name:"option3",fieldLabel:t("option")+" 3",allowBlank:true},{name:"option4",fieldLabel:t("option")+" 4",allowBlank:true},{name:"option5",fieldLabel:t("option")+" 5",allowBlank:true},{name:"option6",fieldLabel:t("option")+" 6",allowBlank:true},{name:"option7",fieldLabel:t("option")+" 7",allowBlank:true},{name:"option8",fieldLabel:t("option")+" 8",allowBlank:true},{name:"option9",fieldLabel:t("option")+" 9",allowBlank:true}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignpollform"],["component","box","container","panel","form","campaignpollform"],{component:true,box:true,container:true,panel:true,form:true,campaignpollform:true},["widget.campaignpollform"],0,[MBilling.view.campaignPoll,"Form"],0));(Ext.cmd.derive("MBilling.view.phoneNumber.Controller",Ext.ux.app.ViewController,{reprocessar:function(e){var g=this,f=g.list.getStore(),j=g.list.filters.getFilterData().length?Ext.encode(g.list.filters.getFilterData()):f.proxy.extraParams.filter;e.disable();g.list.setLoading(true);if(!j){Ext.ux.Alert.alert("Alert","Realize um filtro para reprocessar","notification");e.enable();g.list.setLoading(false);return}Ext.Msg.confirm("Confirm","Confirme que quer reprocessar os numeros pendentes?",function(a){if(a==="yes"){Ext.Ajax.request({url:"index.php/phoneNumber/reprocesar/",params:{filter:j},scope:g,success:function(c){c=Ext.decode(c.responseText);if(c[g.nameSuccessRequest]){Ext.ux.Alert.alert(g.titleSuccess,c[g.nameMsgRequest],"success");f.load();e.enable();g.list.setLoading(false)}else{var b=Helper.Util.convertErrorsJsonToString(c[g.nameMsgRequest]);Ext.ux.Alert.alert(g.titleError,b,"error");e.enable();g.list.setLoading(false)}}})}})}},0,0,0,0,["controller.phonenumber"],0,[MBilling.view.phoneNumber,"Controller"],0));(Ext.cmd.derive("MBilling.view.phoneNumber.Module",Ext.ux.panel.Module,{controller:"phonenumber"},0,["phonenumbermodule"],["component","box","container","uxpanelmodule","phonenumbermodule"],{component:true,box:true,container:true,uxpanelmodule:true,phonenumbermodule:true},["widget.phonenumbermodule"],0,[MBilling.view.phoneNumber,"Module"],0));(Ext.cmd.derive("MBilling.view.phoneNumber.List",Ext.ux.grid.Panel,{store:"PhoneNumber",buttonImportCsv:true,initComponent:function(){var b=this;b.extraButtons=[{text:t("Reprocessar"),iconCls:"callshop",handler:"reprocessar",disabled:false}];b.buttonUpdateLot=App.user.isAdmin&&!window.isTablet;b.buttonCsv=!window.isTablet;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("number"),dataIndex:"number",flex:4},{header:t("phonebook"),dataIndex:"idPhonebookname",filter:{type:"string",field:"idPhonebook.name"},flex:4},{header:t("status"),dataIndex:"status",renderer:Helper.Util.formatBooleanActive,comboRelated:"statuscombo",flex:2,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")],[2,t("pending")],[3,t("send")],[4,t("blocked")]]}},{header:t("name"),dataIndex:"name",hidden:true,hideable:true,flex:4},{header:t("city"),dataIndex:"city",hidden:true,hideable:true,flex:4},{header:t("description"),dataIndex:"info",hidden:true,flex:4},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"creationdate",hidden:true,hideable:App.user.isAdmin,flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["phonenumberlist"],["component","box","container","panel","tablepanel","gridpanel","grid","phonenumberlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,phonenumberlist:true},["widget.phonenumberlist"],0,[MBilling.view.phoneNumber,"List"],0));(Ext.cmd.derive("MBilling.view.phoneNumber.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["number"],initComponent:function(){var b=this;b.items=[{xtype:"phonebookcombo"},{name:"number",fieldLabel:t("number")},{name:"name",fieldLabel:t("name"),allowBlank:true},{name:"city",fieldLabel:t("city"),allowBlank:true},{xtype:"statuscombo",name:"status",fieldLabel:t("status"),allowBlank:true},{xtype:"textareafield",name:"info",fieldLabel:t("description"),allowBlank:true,hidden:!App.user.isAdmin}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["phonenumberform"],["component","box","container","panel","form","phonenumberform"],{component:true,box:true,container:true,panel:true,form:true,phonenumberform:true},["widget.phonenumberform"],0,[MBilling.view.phoneNumber,"Form"],0));(Ext.cmd.derive("MBilling.view.phoneBook.Combo",Ext.form.field.ComboBox,{name:"id_phonebook",fieldLabel:t("phonebook"),displayField:"name",forceSelection:true,editable:true,valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.PhoneBook",{proxy:{type:"uxproxy",module:"phoneBook",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["phonebookcombo"],["component","box","field","textfield","pickerfield","combobox","combo","phonebookcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,phonebookcombo:true},["widget.phonebookcombo"],0,[MBilling.view.phoneBook,"Combo"],0));(Ext.cmd.derive("MBilling.view.phoneNumber.ImportCsv",Ext.ux.window.ImportCsv,{htmlTipInfo:"
number,name,city
551135672677, Dany Hilger, New York
551156332233, Monica Leith, San Pablo
554153882200, John Mart, Madri
"+t("name")+" "+t("and")+" "+t("city")+" "+t("optional")+"",fieldsImport:[{xtype:"phonebookcombo",width:350}]},0,["phonenumberimportcsv"],["component","box","container","panel","window","phonenumberimportcsv"],{component:true,box:true,container:true,panel:true,window:true,phonenumberimportcsv:true},["widget.phonenumberimportcsv"],0,[MBilling.view.phoneNumber,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.rate.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.rate"],0,[MBilling.view.rate,"Controller"],0));(Ext.cmd.derive("MBilling.view.rate.Module",Ext.ux.panel.Module,{controller:"rate",flexForm:2,labelWidthFields:190},0,["ratemodule"],["component","box","container","uxpanelmodule","ratemodule"],{component:true,box:true,container:true,uxpanelmodule:true,ratemodule:true},["widget.ratemodule"],0,[MBilling.view.rate,"Module"],0));(Ext.cmd.derive("MBilling.view.rate.List",Ext.ux.grid.Panel,{store:"Rate",fieldSearch:"idPrefix.prefix",initComponent:function(){var b=this;b.buttonImportCsv=!App.user.isClient,b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("prefix"),dataIndex:"idPrefixprefix",filter:{type:"string",field:"idPrefix.prefix"},flex:window.isTablet?2:3},{dataIndex:"idPrefixdestination",header:t("destination"),filter:{type:"string",field:"idPrefix.destination"},flex:window.isTablet?2:3},{header:t("buyrate"),dataIndex:"buyrate",renderer:Helper.Util.formatMoneyDecimal4,hidden:!App.user.isAdmin,hideable:App.user.isAdmin,flex:2},{header:t("buyrateinitblock"),dataIndex:"buyrateinitblock",hidden:!App.user.isAdmin||window.isTablet,hideable:App.user.isAdmin,flex:2},{header:t("buyrateincrement"),dataIndex:"buyrateincrement",hidden:!App.user.isAdmin||window.isTablet,hideable:App.user.isAdmin,flex:2},{header:t("rateinitial"),dataIndex:"rateinitial",renderer:Helper.Util.formatMoneyDecimal4,flex:2},{header:t("initblock"),dataIndex:"initblock",hidden:window.isTablet,flex:2},{header:t("billingblock"),dataIndex:"billingblock",hidden:window.isTablet,flex:2},{xtype:"templatecolumn",tpl:"{idTrunktrunkcode}",header:t("trunk"),dataIndex:"id_trunk",comboFilter:"trunkcombo",flex:3,hidden:!App.user.isAdmin,hideable:App.user.isAdmin},{xtype:"templatecolumn",tpl:"{idPlanname}",header:t("plan"),dataIndex:"id_plan",comboFilter:"plancombo",flex:3},{header:t("includeinpackage"),dataIndex:"package_offer",hidden:true,hideable:App.user.isAdmin,flex:1},{header:t("status"),dataIndex:"status",hidden:true,hideable:App.user.isAdmin,flex:2,renderer:Helper.Util.formatBooleanActive,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")]]}}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["ratelist"],["component","box","container","panel","tablepanel","gridpanel","grid","ratelist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,ratelist:true},["widget.ratelist"],0,[MBilling.view.rate,"List"],0));(Ext.cmd.derive("MBilling.view.rate.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["id_prefix"],labelWidthFields:140,initComponent:function(){var b=this;b.items=[{name:"id_plan",fieldLabel:"Plan",xtype:"planlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:false},{name:"id_prefix",fieldLabel:"Destination",xtype:"prefixlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:false},{name:"id_trunk",fieldLabel:"Trunk",xtype:"trunklookup",ownerForm:b,hidden:!App.user.isAdmin,allowBlank:!App.user.isAdmin},{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,"+App.user.decimalPrecision,name:"buyrate",fieldLabel:t("buyrate"),hidden:!App.user.isAdmin,allowBlank:!App.user.isAdmin},{xtype:"numberfield",name:"buyrateinitblock",fieldLabel:t("buyrateinitblock"),value:1,minValue:1,hidden:!App.user.isAdmin,allowBlank:!App.user.isAdmin},{xtype:"numberfield",name:"buyrateincrement",fieldLabel:t("buyrateincrement"),value:1,minValue:1,hidden:!App.user.isAdmin,allowBlank:!App.user.isAdmin},{xtype:"numberfield",name:"minimal_time_buy",fieldLabel:t("Minimal time to buy"),value:0,minValue:0,hidden:!App.user.isAdmin},{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,"+App.user.decimalPrecision,name:"rateinitial",fieldLabel:t("rateinitial"),readOnly:App.user.isClient},{xtype:"numberfield",name:"initblock",fieldLabel:t("initblock"),value:1,minValue:1,hidden:App.user.isClient},{xtype:"numberfield",name:"billingblock",value:1,minValue:1,fieldLabel:t("billingblock"),hidden:App.user.isClient},{xtype:"numberfield",name:"minimal_time_charge",fieldLabel:t("Minimal time to charge"),value:0,minValue:0,hidden:App.user.isClient},{name:"additional_grace",fieldLabel:t("additional_grace"),allowBlank:true,hidden:!App.user.isAdmin},{xtype:"noyescombo",name:"package_offer",fieldLabel:t("includeinpackage"),hidden:!App.user.isAdmin,allowBlank:true},{xtype:"booleancombo",name:"status",fieldLabel:t("status"),hidden:!App.user.isAdmin,allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["rateform"],["component","box","container","panel","form","rateform"],{component:true,box:true,container:true,panel:true,form:true,rateform:true},["widget.rateform"],0,[MBilling.view.rate,"Form"],0));(Ext.cmd.derive("MBilling.view.rate.ImportCsv",Ext.ux.window.ImportCsv,{htmlTipInfo:"
"+t("dialprefix")+", "+t("destination")+", "+t("rateinitial")+", "+t("buyrate")+"
5511, Brasil SP, 0.080, 0.050
34, Spain Fix, 0.056, 0.034
54, Argentina, 0.025, 0.015

"+t("rateinitial")+" "+t("and")+" "+t("buyrate")+" "+t("optional")+"",labelWidthFields:160,height:window.isThemeTriton?350:275,initComponent:function(){var b=this;b.fieldsImport=[{xtype:"plancombo",fieldLabel:t("table"),width:350},{xtype:"trunkcombo",fieldLabel:t("trunkText"),width:350,hidden:!App.user.isAdmin},{style:"margin-top:25px",xtype:"fieldset",title:t("Csv Format"),collapsible:true,collapsed:false,defaults:{labelWidth:190,anchor:"100%",layout:{type:"hbox",labelAlign:b.labelAlignFields}},items:[{xtype:"pontovirgulacombo",name:"delimiter",fieldLabel:t("Delimiter"),width:230}]}];Ext.ux.window.ImportCsv.prototype.initComponent.apply(this,arguments)}},0,["rateimportcsv"],["component","box","container","panel","window","rateimportcsv"],{component:true,box:true,container:true,panel:true,window:true,rateimportcsv:true},["widget.rateimportcsv"],0,[MBilling.view.rate,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.phoneBook.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.phonebook"],0,[MBilling.view.phoneBook,"Controller"],0));(Ext.cmd.derive("MBilling.view.phoneBook.Module",Ext.ux.panel.Module,{controller:"phonebook"},0,["phonebookmodule"],["component","box","container","uxpanelmodule","phonebookmodule"],{component:true,box:true,container:true,uxpanelmodule:true,phonebookmodule:true},["widget.phonebookmodule"],0,[MBilling.view.phoneBook,"Module"],0));(Ext.cmd.derive("MBilling.view.phoneBook.List",Ext.ux.grid.Panel,{store:"PhoneBook",initComponent:function(){var b=this;b.columns=b.columns||[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("name"),dataIndex:"name",flex:5},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:3,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("status"),dataIndex:"status",renderer:Helper.Util.formatBooleanActive,comboRelated:"booleancombo",flex:3,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")]]}},{header:t("description"),dataIndex:"description",flex:5}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["phonebooklist"],["component","box","container","panel","tablepanel","gridpanel","grid","phonebooklist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,phonebooklist:true},["widget.phonebooklist"],0,[MBilling.view.phoneBook,"List"],0));(Ext.cmd.derive("MBilling.view.phoneBook.Form",Ext.ux.form.Panel,{bodyPadding:0,fieldsHideUpdateLot:["id_user","name"],initComponent:function(){var b=this;b.items=[{xtype:App.user.isClient?"textfield":"userlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"name",fieldLabel:t("name")},{xtype:"booleancombo",name:"status",fieldLabel:t("status"),allowBlank:true},{xtype:"textareafield",name:"description",fieldLabel:t("description"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["phonebookform"],["component","box","container","panel","form","phonebookform"],{component:true,box:true,container:true,panel:true,form:true,phonebookform:true},["widget.phonebookform"],0,[MBilling.view.phoneBook,"Form"],0));(Ext.cmd.derive("MBilling.view.phoneBook.Tag",Ext.form.field.Tag,{name:"id_phonebook",fieldLabel:t("phonebook"),displayField:"name",valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.PhoneBook",{proxy:{type:"uxproxy",module:"phoneBook",limitParam:undefined}});Ext.form.field.Tag.prototype.initComponent.apply(this,arguments)}},0,["phonebooktag"],["component","box","field","textfield","pickerfield","combobox","combo","tagfield","phonebooktag"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,tagfield:true,phonebooktag:true},["widget.phonebooktag"],0,[MBilling.view.phoneBook,"Tag"],0));(Ext.cmd.derive("MBilling.view.call.Controller",Ext.ux.app.ViewController,{onRecordCall:function(m){var j=this,f=j.list.getSelectionModel().getSelection()[0],l=Ext.encode(j.list.filters.getFilterData()),g=[];if(!f&&l.length<5){Ext.ux.Alert.alert(j.titleError,t("Please select one or more register"),"notification")}else{Ext.each(j.list.getSelectionModel().getSelection(),function(a){g.push(a.get(j.idProperty))});if(App.user.isAdmin&&g.length>250){Ext.ux.Alert.alert(j.titleError,t("Your limit to download record is")+" 250","error")}else{if(!App.user.isAdmin&&g.length>25){Ext.ux.Alert.alert(j.titleError,t("Your limit to download record is")+" 25","error")}else{window.open("index.php/call/downloadRecord?ids="+Ext.encode(g)+"&filter="+l)}}}},onDownloadClick:function(d,f,e){window.open("index.php/call/downloadRecord?id="+d.getStore().getAt(f).getData().id)},onShowTotal:function(e){var g=this;var g=this,f=g.list.getStore(),j=g.list.filters.getFilterData().length?Ext.encode(g.list.filters.getFilterData()):f.proxy.extraParams.filter;e.disable();e.setText(t("Wait..."));e.setWidth(120);Ext.Ajax.request({url:"index.php/call/getTotal",params:{filter:j},scope:g,success:function(a){a=Ext.decode(a.responseText);Ext.ux.Alert.alert(g.titleSuccess," "+t("Total")+" "+t("buycost")+": "+App.user.currency+" "+a.sumbuycost+"
"+t("Total")+" "+t("sessionbill")+": "+App.user.currency+" "+a.sumsessionbill+"
"+t("Total")+" "+t("profit")+": "+App.user.currency+" "+a.totalCall+"
","information",true,false);e.enable();e.setText(t("Show Total"))},failure:function(a){e.enable();e.setText(""+t("Failed. Try again...")+"");e.setWidth(300)}})}},0,0,0,0,["controller.call"],0,[MBilling.view.call,"Controller"],0));(Ext.cmd.derive("MBilling.view.call.Module",Ext.ux.panel.Module,{controller:"call"},0,["callmodule"],["component","box","container","uxpanelmodule","callmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callmodule:true},["widget.callmodule"],0,[MBilling.view.call,"Module"],0));(Ext.cmd.derive("MBilling.view.call.List",Ext.ux.grid.Panel,{store:"Call",standardSubmit:true,initComponent:function(){var b=this;b.paginationButton=["-",{xtype:"button",width:"120",text:t("Show Total"),handler:"onShowTotal",hidden:!App.user.isAdmin,cls:"x-btn-text-icon details"},{xtype:"tbtext",reference:"tbTextTotal"}];b.fieldSearch=App.user.isAdmin?"idUser.username":"calledstation",b.extraButtons=[{text:t("Download Rec"),iconCls:"call",handler:"onRecordCall",disabled:false,width:130}];b.buttonUpdateLot=App.user.isAdmin;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{xtype:"actioncolumn",width:26,sortable:false,menuDisabled:true,header:t(""),dataIndex:"id",items:[{iconCls:"icon-play",tooltip:t("Download Rec"),handler:"onDownloadClick"}],hidden:App.user.show_playicon_cdr==0,hideable:true},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"starttime",flex:4},{header:t("Sip Account"),dataIndex:"src",flex:3},{header:t("CallerId"),dataIndex:"callerid",flex:3,hidden:true,hideable:true},{header:t("number"),dataIndex:"calledstation",flex:3},{header:t("destination"),dataIndex:"idPrefixdestination",filter:{type:"string",field:"idPrefix.destination"},flex:4},{header:t("sessiontime"),dataIndex:"sessiontime",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Real")+" "+t("sessiontime"),dataIndex:"real_sessiontime",renderer:Helper.Util.formatsecondsToTime,flex:3,hidden:true,hideable:App.user.isAdmin},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:2,hidden:App.user.isClient,hideable:!App.user.isClient},{xtype:"templatecolumn",tpl:"{idTrunktrunkcode}",header:t("trunk"),dataIndex:"id_trunk",comboFilter:"trunkcombo",header:t("trunk"),flex:3,hidden:App.user.isClient||App.user.isAgent,hideable:!App.user.isClient&&!App.user.isAgent},{header:t("status"),dataIndex:"terminatecauseid",renderer:Helper.Util.formatDialStatus,flex:2,filter:{type:"list",options:[[1,t("answer")]]}},{header:t("type"),dataIndex:"sipiax",renderer:Helper.Util.formatCallType,flex:2,filter:{type:"list",options:[[0,t("standard")],[1,t("sipcall")],[2,t("did")],[3,t("didvoip")],[4,t("callback")],[5,t("callcenter")],[6,"sms"],[7,t("transfer")],[8,t("queue")],[9,t("ivr")]]}},{header:t("buycost"),dataIndex:"buycost",renderer:Helper.Util.formatMoneyDecimal4,flex:3,hidden:App.user.isClient||App.user.isAgent,hideable:!App.user.isClient&&!App.user.isAgent},{header:t("sessionbill"),dataIndex:"sessionbill",renderer:Helper.Util.formatMoneyDecimal4,flex:3,hidden:App.user.isAgent||App.user.isClientAgent,hideable:!App.user.isAgent&&!App.user.isClientAgent},{header:t("buycost"),dataIndex:"sessionbill",renderer:Helper.Util.formatMoneyDecimal4,flex:3,hidden:!App.user.isAgent,hideable:App.user.isAgent},{header:t("sessionbill"),dataIndex:"agent_bill",renderer:Helper.Util.formatMoneyDecimal4,flex:3,hidden:!App.user.isAgent,hideable:App.user.isAgent},{header:t("sessionbill"),dataIndex:"agent_bill",renderer:Helper.Util.formatMoneyDecimal4,flex:3,hidden:!App.user.isClientAgent,hideable:App.user.isClientAgent},{header:t("uniqueid"),dataIndex:"uniqueid",flex:3,hidden:true,hideable:true},{xtype:"templatecolumn",tpl:"{idCampaignname}",header:t("campaign"),dataIndex:"id_campaign",comboFilter:"campaigncombo",flex:3,hidden:true,hideable:!App.user.isClient}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["calllist"],["component","box","container","panel","tablepanel","gridpanel","grid","calllist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,calllist:true},["widget.calllist"],0,[MBilling.view.call,"List"],0));(Ext.cmd.derive("MBilling.view.call.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["calledstation"],initComponent:function(){var b=this;b.items=[{name:"calledstation",fieldLabel:t("number"),readOnly:true},{name:"sessiontime",fieldLabel:t("sessiontime"),readOnly:App.user.isClient||App.user.isAgent,hidden:App.user.isClient||App.user.isAgent},{xtype:"moneyfield",name:"buycost",fieldLabel:t("buycost"),mask:App.user.currency+" #9.999.990,"+App.user.decimalPrecision,hidden:App.user.isClient||App.user.isAgent},{xtype:"moneyfield",name:"sessionbill",fieldLabel:t("sessionbill"),mask:App.user.currency+" #9.999.990,"+App.user.decimalPrecision,readOnly:App.user.isClient||App.user.isAgent,hidden:App.user.isAgent||App.user.isClientAgent},{xtype:"moneyfield",name:"agent_bill",fieldLabel:t("sessionbill"),mask:App.user.currency+" #9.999.990,"+App.user.decimalPrecision,readOnly:App.user.isAgent,hidden:!App.user.isAgent&&!App.user.isClientAgent}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callform"],["component","box","container","panel","form","callform"],{component:true,box:true,container:true,panel:true,form:true,callform:true},["widget.callform"],0,[MBilling.view.call,"Form"],0));(Ext.cmd.derive("MBilling.view.callArchive.Controller",Ext.ux.app.ViewController,{onRecordCall:function(m){var j=this,f=j.list.getSelectionModel().getSelection()[0],l=Ext.encode(j.list.filters.getFilterData()),g=[];if(!f&&l.length<5){Ext.ux.Alert.alert(j.titleError,t("Please select one or more register"),"notification")}else{Ext.each(j.list.getSelectionModel().getSelection(),function(a){g.push(a.get(j.idProperty))});if(App.user.isAdmin&&g.length>250){Ext.ux.Alert.alert(j.titleError,t("Your limit to download record is")+" 250","error")}else{if(!App.user.isAdmin&&g.length>25){Ext.ux.Alert.alert(j.titleError,t("Your limit to download record is")+" 25","error")}else{window.open("index.php/callArchive/downloadRecord?ids="+Ext.encode(g)+"&filter="+l)}}}},onDownloadClick:function(d,f,e){window.open("index.php/callArchive/downloadRecord?id="+d.getStore().getAt(f).getData().id)}},0,0,0,0,["controller.callarchive"],0,[MBilling.view.callArchive,"Controller"],0));(Ext.cmd.derive("MBilling.view.callArchive.Module",Ext.ux.panel.Module,{controller:"callarchive"},0,["callarchivemodule"],["component","box","container","uxpanelmodule","callarchivemodule"],{component:true,box:true,container:true,uxpanelmodule:true,callarchivemodule:true},["widget.callarchivemodule"],0,[MBilling.view.callArchive,"Module"],0));(Ext.cmd.derive("MBilling.view.callArchive.List",Ext.ux.grid.Panel,{store:"CallArchive",standardSubmit:true,initComponent:function(){var b=this;b.buttonUpdateLot=false;b.fieldSearch=App.user.isAdmin?"idUser.username":"calledstation",b.extraButtons=[{text:t("Download Rec"),iconCls:"call",handler:"onRecordCall",disabled:false,width:130}];b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{xtype:"actioncolumn",width:26,sortable:false,menuDisabled:true,header:t(""),dataIndex:"id",items:[{iconCls:"icon-play",tooltip:t("Download Rec"),handler:"onDownloadClick"}],hidden:App.user.show_playicon_cdr==0,hideable:true},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"starttime",flex:4},{header:t("Sip Account"),dataIndex:"src",flex:3},{header:t("CallerId"),dataIndex:"callerid",flex:3,hidden:true,hideable:true},{header:t("number"),dataIndex:"calledstation",flex:3},{header:t("destination"),dataIndex:"idPrefixdestination",filter:{type:"string",field:"idPrefix.destination"},flex:4},{header:t("sessiontime"),dataIndex:"sessiontime",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Real")+" "+t("sessiontime"),dataIndex:"real_sessiontime",renderer:Helper.Util.formatsecondsToTime,flex:3,hidden:true,hideable:App.user.isAdmin},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:2,hidden:App.user.isClient,hideable:!App.user.isClient},{xtype:"templatecolumn",tpl:"{idTrunktrunkcode}",header:t("trunk"),dataIndex:"id_trunk",comboFilter:"trunkcombo",header:t("trunk"),flex:3,hidden:App.user.isClient||App.user.isAgent,hideable:!App.user.isClient&&!App.user.isAgent},{header:t("status"),dataIndex:"terminatecauseid",renderer:Helper.Util.formatDialStatus,flex:2,filter:{type:"list",options:[[1,t("answer")]]}},{header:t("type"),dataIndex:"sipiax",renderer:Helper.Util.formatCallType,flex:2,filter:{type:"list",options:[[0,t("standard")],[1,t("sipcall")],[2,t("did")],[3,t("didvoip")],[4,t("callback")],[5,t("callcenter")],[6,"sms"],[7,t("transfer")],[8,t("queue")],[9,t("ivr")]]}},{header:t("buycost"),dataIndex:"buycost",renderer:Helper.Util.formatMoneyDecimal4,flex:3,hidden:App.user.isClient||App.user.isAgent,hideable:!App.user.isClient&&!App.user.isAgent},{header:t("sessionbill"),dataIndex:"sessionbill",renderer:Helper.Util.formatMoneyDecimal4,flex:3,hidden:App.user.isAgent||App.user.isClientAgent,hideable:!App.user.isAgent&&!App.user.isClientAgent},{header:t("buycost"),dataIndex:"sessionbill",renderer:Helper.Util.formatMoneyDecimal4,flex:3,hidden:!App.user.isAgent,hideable:App.user.isAgent},{header:t("sessionbill"),dataIndex:"agent_bill",renderer:Helper.Util.formatMoneyDecimal4,flex:3,hidden:!App.user.isAgent,hideable:App.user.isAgent},{header:t("sessionbill"),dataIndex:"agent_bill",renderer:Helper.Util.formatMoneyDecimal4,flex:3,hidden:!App.user.isClientAgent,hideable:App.user.isClientAgent},{header:t("uniqueid"),dataIndex:"uniqueid",flex:3,hidden:true,hideable:true}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callarchivelist"],["component","box","container","panel","tablepanel","gridpanel","grid","callarchivelist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callarchivelist:true},["widget.callarchivelist"],0,[MBilling.view.callArchive,"List"],0));(Ext.cmd.derive("MBilling.view.callArchive.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["calledstation"],initComponent:function(){var b=this;b.items=[{name:"calledstation",fieldLabel:t("number"),readOnly:true},{name:"sessiontime",fieldLabel:t("sessiontime"),readOnly:App.user.isClient||App.user.isAgent,hidden:App.user.isClient||App.user.isAgent},{xtype:"moneyfield",name:"buycost",fieldLabel:t("buycost"),mask:App.user.currency+" #9.999.990,"+App.user.decimalPrecision,hidden:App.user.isClient||App.user.isAgent},{xtype:"moneyfield",name:"sessionbill",fieldLabel:t("sessionbill"),mask:App.user.currency+" #9.999.990,"+App.user.decimalPrecision,readOnly:App.user.isClient||App.user.isAgent,hidden:App.user.isAgent||App.user.isClientAgent},{xtype:"moneyfield",name:"agent_bill",fieldLabel:t("sessionbill"),mask:App.user.currency+" #9.999.990,"+App.user.decimalPrecision,readOnly:App.user.isAgent,hidden:!App.user.isAgent&&!App.user.isClientAgent}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callarchiveform"],["component","box","container","panel","form","callarchiveform"],{component:true,box:true,container:true,panel:true,form:true,callarchiveform:true},["widget.callarchiveform"],0,[MBilling.view.callArchive,"Form"],0));(Ext.cmd.derive("MBilling.view.callFailed.Controller",Ext.ux.app.ViewController,{formHidden:true},0,0,0,0,["controller.callfailed"],0,[MBilling.view.callFailed,"Controller"],0));(Ext.cmd.derive("MBilling.view.callFailed.Module",Ext.ux.panel.Module,{controller:"callfailed"},0,["callfailedmodule"],["component","box","container","uxpanelmodule","callfailedmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callfailedmodule:true},["widget.callfailedmodule"],0,[MBilling.view.callFailed,"Module"],0));(Ext.cmd.derive("MBilling.view.callFailed.List",Ext.ux.grid.Panel,{store:"CallFailed",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.allowCreate=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"starttime",flex:4},{header:t("Sip Account"),dataIndex:"src",flex:3},{header:t("CallerId"),dataIndex:"callerid",flex:3,hidden:true,hideable:true},{header:t("number"),dataIndex:"calledstation",flex:3},{header:t("destination"),dataIndex:"idPrefixdestination",flex:4},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:2,hidden:App.user.isClient,hideable:!App.user.isClient},{xtype:"templatecolumn",tpl:"{idTrunktrunkcode}",header:t("trunk"),dataIndex:"id_trunk",comboFilter:"trunkcombo",header:t("trunk"),flex:4,hidden:App.user.isClient||App.user.isAgent,hideable:!App.user.isClient&&!App.user.isAgent},{header:t("status"),dataIndex:"terminatecauseid",renderer:Helper.Util.formatDialStatus,flex:2,filter:{type:"list",options:[[1,t("answer")],[2,t("busy")],[3,t("no")+" "+t("answer")],[4,t("cancelcall")],[5,"congestion"],[6,"chanunavail"],[7,"dontcall"],[8,"torture"],[9,"invalidargs"]]}},{header:t("HangupCause"),dataIndex:"hangupcause",hidden:!window.dialC,flex:2},{header:t("type"),dataIndex:"sipiax",renderer:Helper.Util.formatCallType,flex:2,filter:{type:"list",options:[[0,t("standard")],[1,t("sipcall")],[2,t("did")],[3,t("didvoip")],[4,t("callback")],[5,t("callcenter")],[6,"sms"],[7,t("transfer")]]}},{header:t("uniqueid"),dataIndex:"uniqueid",flex:3,hidden:true,hideable:true}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callfailedlist"],["component","box","container","panel","tablepanel","gridpanel","grid","callfailedlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callfailedlist:true},["widget.callfailedlist"],0,[MBilling.view.callFailed,"List"],0));(Ext.cmd.derive("MBilling.view.callFailed.Form",Ext.ux.form.Panel,{},0,["callfailedform"],["component","box","container","panel","form","callfailedform"],{component:true,box:true,container:true,panel:true,form:true,callfailedform:true},["widget.callfailedform"],0,[MBilling.view.callFailed,"Form"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerDay.Controller",Ext.ux.app.ViewController,{onEdit:function(){me=this;me.sumData=me.store.getData().items[0].getData();if(!me.sumData){return}me.formPanel.getForm().getFields().each(function(b){b.setValue(me.sumData[b.name])});me.formPanel.expand()}},0,0,0,0,["controller.callsummaryperday"],0,[MBilling.view.callSummaryPerDay,"Controller"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerDay.Module",Ext.ux.panel.Module,{controller:"callsummaryperday",titleDetails:t("total"),iconForm:"icon-sum",cfgEast:{flex:0.4}},0,["callsummaryperdaymodule"],["component","box","container","uxpanelmodule","callsummaryperdaymodule"],{component:true,box:true,container:true,uxpanelmodule:true,callsummaryperdaymodule:true},["widget.callsummaryperdaymodule"],0,[MBilling.view.callSummaryPerDay,"Module"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerDay.List",Ext.ux.grid.Panel,{store:"CallSummaryPerDay",initComponent:function(){var b=this;b.buttonImportCsv=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{header:t("day"),renderer:Ext.util.Format.dateRenderer("Y-m-d"),dataIndex:"day",filter:{type:"date",field:"day"},flex:3},{header:t("sessiontime")+" "+t("Min"),dataIndex:"sessiontime",flex:2},{header:t("aloc_all_calls"),dataIndex:"aloc_all_calls",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Answered Calls"),dataIndex:"nbcall",flex:3},{header:t("Failed Calls"),dataIndex:"nbcall_fail",flex:3},{header:t("buycost"),dataIndex:"buycost",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("sessionbill"),dataIndex:"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("markup"),dataIndex:"lucro",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("ASR"),dataIndex:"asr",renderer:Helper.Util.formatPorcente,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummaryperdaylist"],["component","box","container","panel","tablepanel","gridpanel","grid","callsummaryperdaylist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callsummaryperdaylist:true},["widget.callsummaryperdaylist"],0,[MBilling.view.callSummaryPerDay,"List"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerDay.Form",Ext.ux.form.Panel,{defaults:{},labelWidthFields:100,defaultType:"displayfield",initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{name:"sumsessiontime",fieldLabel:t("sessiontime")+" "+t("Min"),renderer:Ext.util.Format.numberRenderer("0"),allowBlank:true},{name:"sumsessionbill",fieldLabel:t("sessionbill"),renderer:Helper.Util.formatMoneyDecimal,allowBlank:true},{name:"sumbuycost",fieldLabel:t("buycost"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumlucro",fieldLabel:t("markup"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumnbcall",fieldLabel:t("Answered Calls"),allowBlank:true},{name:"sumnbcallfail",fieldLabel:t("Failed Calls"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummaryperdayform"],["component","box","container","panel","form","callsummaryperdayform"],{component:true,box:true,container:true,panel:true,form:true,callsummaryperdayform:true},["widget.callsummaryperdayform"],0,[MBilling.view.callSummaryPerDay,"Form"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerMonth.Controller",Ext.ux.app.ViewController,{onEdit:function(){me=this;me.sumData=me.store.getData().items[0].getData();if(!me.sumData){return}me.formPanel.getForm().getFields().each(function(b){b.setValue(me.sumData[b.name])});me.formPanel.expand()}},0,0,0,0,["controller.callsummarypermonth"],0,[MBilling.view.callSummaryPerMonth,"Controller"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerMonth.Module",Ext.ux.panel.Module,{controller:"callsummarypermonth",titleDetails:t("total"),iconForm:"icon-sum",cfgEast:{flex:0.4}},0,["callsummarypermonthmodule"],["component","box","container","uxpanelmodule","callsummarypermonthmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callsummarypermonthmodule:true},["widget.callsummarypermonthmodule"],0,[MBilling.view.callSummaryPerMonth,"Module"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerMonth.List",Ext.ux.grid.Panel,{store:"CallSummaryPerMonth",initComponent:function(){var b=this;b.buttonImportCsv=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{header:t("month"),dataIndex:"month",filter:{type:"date",field:"month",dateFormat:"Ym"},flex:3},{header:t("sessiontime")+" "+t("Min"),dataIndex:"sessiontime",flex:2},{header:t("aloc_all_calls"),dataIndex:"aloc_all_calls",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("nbcall"),dataIndex:"nbcall",flex:3},{header:t("buycost"),dataIndex:"buycost",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("sessionbill"),dataIndex:"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("markup"),dataIndex:"lucro",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarypermonthlist"],["component","box","container","panel","tablepanel","gridpanel","grid","callsummarypermonthlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callsummarypermonthlist:true},["widget.callsummarypermonthlist"],0,[MBilling.view.callSummaryPerMonth,"List"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerMonth.Form",Ext.ux.form.Panel,{defaults:{},labelWidthFields:100,defaultType:"displayfield",initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{name:"sumsessiontime",fieldLabel:t("sessiontime")+" "+t("Min"),renderer:Ext.util.Format.numberRenderer("0"),allowBlank:true},{name:"sumsessionbill",fieldLabel:t("sessionbill"),renderer:Helper.Util.formatMoneyDecimal,allowBlank:true},{name:"sumbuycost",fieldLabel:t("buycost"),renderer:Helper.Util.formatMoneyDecimal,hidden:App.user.isClient,allowBlank:true},{name:"sumlucro",fieldLabel:t("markup"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumnbcall",fieldLabel:t("nbcall"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarypermonthform"],["component","box","container","panel","form","callsummarypermonthform"],{component:true,box:true,container:true,panel:true,form:true,callsummarypermonthform:true},["widget.callsummarypermonthform"],0,[MBilling.view.callSummaryPerMonth,"Form"],0));(Ext.cmd.derive("MBilling.view.callSummaryMonthUser.Controller",Ext.ux.app.ViewController,{onEdit:function(){me=this;me.sumData=me.store.getData().items[0].getData();if(!me.sumData){return}me.formPanel.getForm().getFields().each(function(b){b.setValue(me.sumData[b.name])});me.formPanel.expand()}},0,0,0,0,["controller.callsummarymonthuser"],0,[MBilling.view.callSummaryMonthUser,"Controller"],0));(Ext.cmd.derive("MBilling.view.callSummaryMonthUser.Module",Ext.ux.panel.Module,{controller:"callsummarymonthuser",titleDetails:t("total"),iconForm:"icon-sum",cfgEast:{flex:0.4}},0,["callsummarymonthusermodule"],["component","box","container","uxpanelmodule","callsummarymonthusermodule"],{component:true,box:true,container:true,uxpanelmodule:true,callsummarymonthusermodule:true},["widget.callsummarymonthusermodule"],0,[MBilling.view.callSummaryMonthUser,"Module"],0));(Ext.cmd.derive("MBilling.view.callSummaryMonthUser.List",Ext.ux.grid.Panel,{store:"CallSummaryMonthUser",initComponent:function(){var b=this;b.buttonImportCsv=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{header:t("Month"),renderer:Ext.util.Format.dateRenderer("Y-m"),dataIndex:"month",filter:{type:"date",field:"month",dateFormat:"Ym"},flex:3},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("sessiontime")+" "+t("Min"),dataIndex:"sessiontime",flex:2},{header:t("aloc_all_calls"),dataIndex:"aloc_all_calls",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Answered Calls"),dataIndex:"nbcall",flex:3},{header:t("buycost"),dataIndex:App.user.isAdmin?"buycost":"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("sessionbill"),dataIndex:App.user.isAgent||App.user.isClientAgent?"agent_bill":"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("markup"),dataIndex:"lucro",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarymonthuserlist"],["component","box","container","panel","tablepanel","gridpanel","grid","callsummarymonthuserlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callsummarymonthuserlist:true},["widget.callsummarymonthuserlist"],0,[MBilling.view.callSummaryMonthUser,"List"],0));(Ext.cmd.derive("MBilling.view.callSummaryMonthUser.Form",Ext.ux.form.Panel,{defaults:{},labelWidthFields:100,defaultType:"displayfield",initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{name:"sumsessiontime",fieldLabel:t("sessiontime")+" "+t("Min"),renderer:Ext.util.Format.numberRenderer("0"),allowBlank:true},{name:App.user.isAgent||App.user.isClientAgent?"sumagent_bill":"sumsessionbill",fieldLabel:t("sessionbill"),renderer:Helper.Util.formatMoneyDecimal,allowBlank:true},{name:App.user.isAdmin?"sumbuycost":"sumsessionbill",fieldLabel:t("buycost"),renderer:Helper.Util.formatMoneyDecimal,hidden:App.user.isClient,allowBlank:true},{name:"sumlucro",fieldLabel:t("markup"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmint,allowBlank:true},{name:"sumnbcall",fieldLabel:t("nbcall"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarymonthuserform"],["component","box","container","panel","form","callsummarymonthuserform"],{component:true,box:true,container:true,panel:true,form:true,callsummarymonthuserform:true},["widget.callsummarymonthuserform"],0,[MBilling.view.callSummaryMonthUser,"Form"],0));(Ext.cmd.derive("MBilling.view.callSummaryMonthTrunk.Controller",Ext.ux.app.ViewController,{onEdit:function(){me=this;me.sumData=me.store.getData().items[0].getData();if(!me.sumData){return}me.formPanel.getForm().getFields().each(function(b){b.setValue(me.sumData[b.name])});me.formPanel.expand()}},0,0,0,0,["controller.callsummarymonthtrunk"],0,[MBilling.view.callSummaryMonthTrunk,"Controller"],0));(Ext.cmd.derive("MBilling.view.callSummaryMonthTrunk.Module",Ext.ux.panel.Module,{controller:"callsummarymonthtrunk",titleDetails:t("total"),iconForm:"icon-sum",cfgEast:{flex:0.4}},0,["callsummarymonthtrunkmodule"],["component","box","container","uxpanelmodule","callsummarymonthtrunkmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callsummarymonthtrunkmodule:true},["widget.callsummarymonthtrunkmodule"],0,[MBilling.view.callSummaryMonthTrunk,"Module"],0));(Ext.cmd.derive("MBilling.view.callSummaryMonthTrunk.List",Ext.ux.grid.Panel,{store:"CallSummaryMonthTrunk",initComponent:function(){var b=this;b.buttonImportCsv=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{header:t("Month"),renderer:Ext.util.Format.dateRenderer("Y-m"),dataIndex:"month",filter:{type:"date",field:"month",dateFormat:"Ym"},flex:3},{header:t("Trunk"),dataIndex:"idTrunktrunkcode",filter:{type:"string",field:"idTrunk.trunkcode"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("sessiontime")+" "+t("Min"),dataIndex:"sessiontime",flex:2},{header:t("aloc_all_calls"),dataIndex:"aloc_all_calls",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Answered Calls"),dataIndex:"nbcall",flex:3},{header:t("buycost"),dataIndex:"buycost",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("sessionbill"),dataIndex:"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("markup"),dataIndex:"lucro",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarymonthtrunklist"],["component","box","container","panel","tablepanel","gridpanel","grid","callsummarymonthtrunklist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callsummarymonthtrunklist:true},["widget.callsummarymonthtrunklist"],0,[MBilling.view.callSummaryMonthTrunk,"List"],0));(Ext.cmd.derive("MBilling.view.callSummaryMonthTrunk.Form",Ext.ux.form.Panel,{defaults:{},labelWidthFields:100,defaultType:"displayfield",initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{name:"sumsessiontime",fieldLabel:t("sessiontime")+" "+t("Min"),renderer:Ext.util.Format.numberRenderer("0"),allowBlank:true},{name:"sumsessionbill",fieldLabel:t("sessionbill"),renderer:Helper.Util.formatMoneyDecimal,allowBlank:true},{name:"sumbuycost",fieldLabel:t("buycost"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumlucro",fieldLabel:t("markup"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumnbcall",fieldLabel:t("nbcall"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarymonthtrunkform"],["component","box","container","panel","form","callsummarymonthtrunkform"],{component:true,box:true,container:true,panel:true,form:true,callsummarymonthtrunkform:true},["widget.callsummarymonthtrunkform"],0,[MBilling.view.callSummaryMonthTrunk,"Form"],0));(Ext.cmd.derive("MBilling.view.sms.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.sms"],0,[MBilling.view.sms,"Controller"],0));(Ext.cmd.derive("MBilling.view.sms.Module",Ext.ux.panel.Module,{controller:"sms"},0,["smsmodule"],["component","box","container","uxpanelmodule","smsmodule"],{component:true,box:true,container:true,uxpanelmodule:true,smsmodule:true},["widget.smsmodule"],0,[MBilling.view.sms,"Module"],0));(Ext.cmd.derive("MBilling.view.sms.List",Ext.ux.grid.Panel,{store:"Sms",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.allowUpdate=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("send"),dataIndex:"result",renderer:Helper.Util.formatBooleanSms,comboRelated:"statuscombo",flex:2,filter:{type:"list",options:[[0,t("error")],[1,t("sent")],[2,t("received")]]}},{header:t("destination"),dataIndex:"telephone",flex:2},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"date",flex:5},{header:t("description"),dataIndex:"sms",hidden:true,hideable:true,flex:6}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["smslist"],["component","box","container","panel","tablepanel","gridpanel","grid","smslist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,smslist:true},["widget.smslist"],0,[MBilling.view.sms,"List"],0));(Ext.cmd.derive("MBilling.view.sms.Form",Ext.ux.form.Panel,{fieldsHide:["id_user"],initComponent:function(){var b=this;b.items=[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:App.user.isClient},{xtype:"numberfield",name:"telephone",fieldLabel:t("number"),emptyText:"DDI DDD Nº",maxLength:16,minLength:11},{xtype:"textareafield",name:"sms",fieldLabel:t("sms"),maxLength:160}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["smsform"],["component","box","container","panel","form","smsform"],{component:true,box:true,container:true,panel:true,form:true,smsform:true},["widget.smsform"],0,[MBilling.view.sms,"Form"],0));(Ext.cmd.derive("MBilling.view.campaignPollInfo.Controller",Ext.ux.app.ViewController,{aliasChart:"campaignpollinfochart",onRenderModule:function(){var c=this,d=c.lookupReference("chart");Ext.ux.app.ViewController.prototype.onRenderModule.apply(this,arguments);c.store.on({scope:c,beforeload:function(){d.disable()},load:function(a){d.enable()}})},onChart:function(){var l=this,f=l.list.getStore(),m=l.list.filters.getFilterData(),j=false,g=false;if(!m){Ext.ux.Alert.alert("Alert",t("Use filters"),"information");return}Ext.each(m,function(a){if(a.field=="id_campaign_poll"){if(a.data.value.length==1){g=true}j=true;return}});if(!j){Ext.ux.Alert.alert("Alert",t("Select one or more poll to create a chart"),"information");return}l.chart=Ext.widget("window",{title:t("charts"),iconCls:"icon-chart-column",layout:"fit",autoShow:true,modal:true,resizable:false,width:window.isThemeNeptune?740:710,items:{xtype:l.aliasChart,titleText:g?f.getData().items[0].data.idCampaignPollname:"",list:l.list}})}},0,0,0,0,["controller.campaignpollinfo"],0,[MBilling.view.campaignPollInfo,"Controller"],0));(Ext.cmd.derive("MBilling.view.campaignPollInfo.Module",Ext.ux.panel.Module,{controller:"campaignpollinfo"},0,["campaignpollinfomodule"],["component","box","container","uxpanelmodule","campaignpollinfomodule"],{component:true,box:true,container:true,uxpanelmodule:true,campaignpollinfomodule:true},["widget.campaignpollinfomodule"],0,[MBilling.view.campaignPollInfo,"Module"],0));(Ext.cmd.derive("MBilling.view.campaignPollInfo.List",Ext.ux.grid.Panel,{store:"CampaignPollInfo",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.allowCreate=false;b.extraButtons=[{text:t("charts"),iconCls:"icon-chart-column",handler:"onChart",reference:"chart",disabled:true}];b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("number"),dataIndex:"number",flex:4},{xtype:"templatecolumn",tpl:"{idCampaignPollname}",header:t("poll"),dataIndex:"id_campaign_poll",comboFilter:"campaignpollcombo",flex:4},{header:t("result"),dataIndex:"resposta",flex:4},{header:t("description"),dataIndex:"obs",flex:4},{header:t("City"),dataIndex:"city",flex:4},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"date",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignpollinfolist"],["component","box","container","panel","tablepanel","gridpanel","grid","campaignpollinfolist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,campaignpollinfolist:true},["widget.campaignpollinfolist"],0,[MBilling.view.campaignPollInfo,"List"],0));(Ext.cmd.derive("MBilling.view.campaignPollInfo.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{name:"number",fieldLabel:t("number"),readOnly:true},{name:"resposta",fieldLabel:t("result"),readOnly:true},{xtype:"textareafield",name:"obs",fieldLabel:t("description"),allowBlank:true,maxLength:200}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignpollinfoform"],["component","box","container","panel","form","campaignpollinfoform"],{component:true,box:true,container:true,panel:true,form:true,campaignpollinfoform:true},["widget.campaignpollinfoform"],0,[MBilling.view.campaignPollInfo,"Form"],0));(Ext.cmd.derive("MBilling.view.campaignPollInfo.Chart",Ext.ux.panel.Chart,{controller:"campaignpollinfo",store:"CampaignPollInfoChart",fieldValue:"sumresposta",fieldDescription:"resposta2",labelYLine:t("countvotes"),labelXLine:t("result"),fieldLabel:"percentage",initComponent:function(){var d=this,c;if(window.newChartCampaignInfo){d.fieldDescription="resposta_name"}d.bbarChart=[{xtype:"tbtext",itemId:"tbTextSum",reference:"tbTextSum"}];d.store=Ext.data.StoreManager.lookup(d.store);d.store.setRemoteFilter(true);filters=d.list.filters.getFilterData();d.store.filter("filter",Ext.encode(filters));d.store.load({scope:d,callback:function(){if(d.store.getData().items[0]){d.sumData=d.store.getData().items[0].getData()}if(window.newChartCampaignInfo){d.lookupReference("tbTextSum").setText(d.sumData.total_votos)}}});Ext.ux.panel.Chart.prototype.initComponent.apply(this,arguments)}},0,["campaignpollinfochart"],["component","box","container","panel","chartpanel","campaignpollinfochart"],{component:true,box:true,container:true,panel:true,chartpanel:true,campaignpollinfochart:true},["widget.campaignpollinfochart"],0,[MBilling.view.campaignPollInfo,"Chart"],0));(Ext.cmd.derive("MBilling.view.campaignRestrictPhone.Controller",Ext.ux.app.ViewController,{onEdit:function(){var b=this;Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)},deleteDuplicados:function(e){var g=this,f=g.list.getStore(),j=g.list.filters.getFilterData().length?Ext.encode(g.getList().filters.getFilterData()):f.proxy.extraParams.filter;e.disable();g.list.setLoading(true);Ext.Msg.confirm("Confirm","Confirme que quer deletar os numeros duplicados?",function(a){if(a==="yes"){Ext.Ajax.request({url:"index.php/campaignRestrictPhone/deleteDuplicados/",params:{filter:j},scope:g,success:function(c){c=Ext.decode(c.responseText);if(c[g.nameSuccessRequest]){Ext.ux.Alert.alert(g.titleSuccess,c[g.nameMsgRequest],"success")}else{var b=Helper.Util.convertErrorsJsonToString(c[g.nameMsgRequest]);Ext.ux.Alert.alert(g.titleError,b,"error")}g.list.setLoading(false);e.enable()}})}})}},0,0,0,0,["controller.campaignrestrictphone"],0,[MBilling.view.campaignRestrictPhone,"Controller"],0));(Ext.cmd.derive("MBilling.view.campaignRestrictPhone.Module",Ext.ux.panel.Module,{controller:"campaignrestrictphone"},0,["campaignrestrictphonemodule"],["component","box","container","uxpanelmodule","campaignrestrictphonemodule"],{component:true,box:true,container:true,uxpanelmodule:true,campaignrestrictphonemodule:true},["widget.campaignrestrictphonemodule"],0,[MBilling.view.campaignRestrictPhone,"Module"],0));(Ext.cmd.derive("MBilling.view.campaignRestrictPhone.List",Ext.ux.grid.Panel,{store:"CampaignRestrictPhone",buttonImportCsv:true,initComponent:function(){var b=this;b.extraButtons=[{text:t("Eliminar Duplicados"),iconCls:"callshop",handler:"deleteDuplicados",disabled:false}];b.buttonUpdateLot=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("number"),dataIndex:"number",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignrestrictphonelist"],["component","box","container","panel","tablepanel","gridpanel","grid","campaignrestrictphonelist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,campaignrestrictphonelist:true},["widget.campaignrestrictphonelist"],0,[MBilling.view.campaignRestrictPhone,"List"],0));(Ext.cmd.derive("MBilling.view.campaignRestrictPhone.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{name:"number",fieldLabel:t("number")}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignrestrictphoneform"],["component","box","container","panel","form","campaignrestrictphoneform"],{component:true,box:true,container:true,panel:true,form:true,campaignrestrictphoneform:true},["widget.campaignrestrictphoneform"],0,[MBilling.view.campaignRestrictPhone,"Form"],0));(Ext.cmd.derive("MBilling.view.campaignRestrictPhone.ImportCsv",Ext.ux.window.ImportCsv,{htmlTipInfo:"
number
551135672677
551156332233
554153882200
"},0,["campaignrestrictphoneimportcsv"],["component","box","container","panel","window","campaignrestrictphoneimportcsv"],{component:true,box:true,container:true,panel:true,window:true,campaignrestrictphoneimportcsv:true},["widget.campaignrestrictphoneimportcsv"],0,[MBilling.view.campaignRestrictPhone,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.campaignLog.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.campaignlog"],0,[MBilling.view.campaignLog,"Controller"],0));(Ext.cmd.derive("MBilling.view.campaignLog.Module",Ext.ux.panel.Module,{controller:"campaignlog"},0,["campaignlogmodule"],["component","box","container","uxpanelmodule","campaignlogmodule"],{component:true,box:true,container:true,uxpanelmodule:true,campaignlogmodule:true},["widget.campaignlogmodule"],0,[MBilling.view.campaignLog,"Module"],0));(Ext.cmd.derive("MBilling.view.campaignLog.List",Ext.ux.grid.Panel,{store:"CampaignLog",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.buttonNew=false;b.allowUpdate=false;b.allowDelete=!App.user.isClient;b.columns=[{header:t("Total gerado"),dataIndex:"total",flex:4},{header:t("Loops"),dataIndex:"loops",flex:4},{header:t("Total por tronco"),dataIndex:"trunks",flex:4},{header:t("Campanhas"),dataIndex:"campaigns",flex:4},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"date",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignloglist"],["component","box","container","panel","tablepanel","gridpanel","grid","campaignloglist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,campaignloglist:true},["widget.campaignloglist"],0,[MBilling.view.campaignLog,"List"],0));(Ext.cmd.derive("MBilling.view.campaignLog.Form",Ext.ux.form.Panel,{bodyPadding:0,initComponent:function(){var b=this;b.items=[{name:"total",fieldLabel:t("total")}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignlogform"],["component","box","container","panel","form","campaignlogform"],{component:true,box:true,container:true,panel:true,form:true,campaignlogform:true},["widget.campaignlogform"],0,[MBilling.view.campaignLog,"Form"],0));(Ext.cmd.derive("MBilling.view.campaignSend.Module",Ext.form.Panel,{controller:"campaignsend",resizable:false,autoShow:true,header:false,initComponent:function(){var b=this;b.items=[{reference:"campaignSendPanel",xtype:"form",margin:"10 10 10 10",autoShow:true,closable:false,resizable:false,bodyPadding:10,defaultType:"textfield",defaults:{labelAlign:"right",labelWidth:150,width:280,allowBlank:false,msgTarget:"side",enableKeyEvents:true,plugins:"markallowblank",anchor:"100%"},items:[{xtype:"campaignsendcombo",name:"type",fieldLabel:t("campaign")+" "+t("type")},{name:"sms_text",fieldLabel:"SMS "+t("Text"),xtype:"textarea",height:100,anchor:"100%",allowBlank:true,hidden:true,maxLength:159},{xtype:"filefield",emptyText:"Select an audio file",fieldLabel:t("Audio file"),name:"audio_path",buttonText:"",buttonConfig:{iconCls:"upload-icon"},buttonText:t("Select Audio..."),allowBlank:true,hidden:true},{xtype:"filefield",emptyText:"Select an csv file",fieldLabel:t("CSV file"),name:"csv_path",allowBlank:true,hidden:true},{name:"numbers",fieldLabel:t("numbers"),xtype:"textarea",height:100,anchor:"100%",allowBlank:true,hidden:true},{xtype:"datefield",name:"startingdate",fieldLabel:t("Date"),format:"Y-m-d",value:new Date(),allowBlank:true,hidden:true},{xtype:"timefield",name:"startingtime",fieldLabel:t("Hour"),format:"H:i",value:"00:00",allowBlank:true,hidden:true}],bbar:[{width:"150px",text:t("Send"),tooltip:t("Send"),glyph:icons.disk,handler:"onSendCampaign"}]}];Ext.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignsendmodule"],["component","box","container","panel","form","campaignsendmodule"],{component:true,box:true,container:true,panel:true,form:true,campaignsendmodule:true},["widget.campaignsendmodule"],0,[MBilling.view.campaignSend,"Module"],0));(Ext.cmd.derive("MBilling.view.callShop.Controller",Ext.ux.app.ViewController,{sendActionNew:function(d){var c=this;d.disable();id=d.reference.split("_");getForm=c.lookupReference("cabina"+id[1]).getForm();Ext.Ajax.request({url:d.urlAction+"?id="+getForm.findField("id").getValue(),success:function(a){a=Ext.decode(a.responseText);if(a.success){Ext.ux.Alert.alert(c.titleSuccess,a[c.nameMsgRequest],"success")}else{Ext.ux.Alert.alert(c.titleError,errors,"error")}}});d.enable();storeCallShop=Ext.create("MBilling.store.CallShop",{remoteSort:false});storeCallShop.load({callback:function(a){c.onShowCabins(a,id[1],getForm)}})},onShowCabins:function(e,f,d){me=this;row=e[f-1];if(tab=me.lookupReference("tab"+f)){name=row.data.callerid.length<1?row.data.name:row.data.callerid;status=Helper.Util.formatBooleanFree(row.data.status);tab.setTitle(t("Cabina")+" "+f+" - "+name+" "+status);tab.setVisible(true);d.loadRecord(row)}},reportCallshopClientNew:function(d){var c=this;id=d.reference.split("_");getForm=c.lookupReference("cabina"+id[1]).getForm();columns=Ext.encode([{header:t("Number"),dataIndex:"calledstation"},{header:t("Time"),dataIndex:"sessiontime"},{header:t("Total"),dataIndex:"price"}]);filter=Ext.encode([{type:"string",comparison:"eq",value:getForm.findField("name").getValue(),field:"cabina"},{type:"list",value:[0],field:"status"}]);values="columns="+columns+"&filter="+filter+"&sort=[]&group=&orientation=P";url="index.php/callShopCdr/report/?"+values;window.open(url)},sendAction:function(f){var j=this,e=j.list.getSelectionModel().getSelection()[0],g=Ext.encode([{type:"string",comparison:"eq",value:e.get("name"),field:"cabina"},{type:"list",value:[0],field:"status"}]);j.formPanel.setLoading(true);Ext.Ajax.request({url:f.urlAction,params:{filter:g},success:function(b){b=Ext.decode(b.responseText);var a=Helper.Util.convertErrorsJsonToString(b[j.nameMsgRequest]),d=j.list.getStore(),c=j.list.getSelectionModel();if(b.success){j.onEdit();d.load({callback:function(){c.select(d.findExact("id",e.get("id")));j.formPanel.setLoading(false)}});Ext.ux.Alert.alert(j.titleSuccess,b[j.nameMsgRequest],"success")}else{Ext.ux.Alert.alert(j.titleError,a,"error");j.formPanel.setLoading(false);c.select(d.findExact("id",e.get("id")))}}})},onEdit:function(){if(!this.list.getSelectionModel().getSelection().length){return}var q=this,r=q.list.getSelectionModel().getSelection()[0],n=[{type:"string",comparison:"eq",value:r.get("name"),field:"cabina"},{type:"list",value:[0],field:"status"}],u=q.formPanel.down("callshopcdrlist").getStore(),v=q.formPanel.down("#priceSum"),m=u.proxy.extraParams.filter,p=q.formPanel.down("#charge"),s=q.formPanel.down("#release"),o=q.formPanel.down("#print");v.setText(" "+t("pricesum")+" 0.00");q.formPanel.expand();p.enable();s.enable();o.enable();u.proxy.extraParams.filter=n;u.load({callback:function(a){if(a){a[0]&&v.setText(" "+t("pricesum")+" "+t("moedasimblo")+" "+a[0].get("priceSum")+" ")}}});console.log(r.get("callerid")+", "+r.get("name"));u.defaultFilter=m;q.showHideFields();q.focusFirstField()},reportCallshopClient:function(E){var w=this,s=window.isDesktop&&App.desktop,y=!window.isDesktop&&w.list.module.ownerCt,v=w.formPanel.down("callshopcdrlist").getStore(),x=v.sorters.items,A=w.list.getSelectionModel().getSelection()[0],F=Ext.encode([{type:"string",comparison:"eq",value:A.get("name"),field:"cabina"},{type:"list",value:[0],field:"status"}]),u=w.store.getGroupField(),B=w.formPanel.down("callshopcdrlist").columns,G="desc",D=w.formPanel.down("callshopcdrlist").getStore().getProxy().api.report,H,z=[],C=[];Ext.each(x,function(a){z.push(a.property+" "+(a.direction||"ASC"))});Ext.each(B,function(a){if(a.hidden===false&&a.isCheckerHd!==true){if(a.dataIndex===u){C.splice(0,0,{header:a.text,dataIndex:a.dataIndex})}else{C.push({header:a.text,dataIndex:a.dataIndex})}}});values="columns="+Ext.encode(C)+"&filter="+F+"&sort="+Ext.encode(z)+"&group="+u+"&orientation="+G;url="index.php/callShopCdr/report/?"+values;window.open(url)}},0,0,0,0,["controller.callshop"],0,[MBilling.view.callShop,"Controller"],0));(Ext.cmd.derive("MBilling.view.callShop.Module",Ext.ux.panel.Module,{controller:"callshop",cfgEast:{flex:4},collapsedForm:false,collapsibleForm:false},0,["callshopmodule"],["component","box","container","uxpanelmodule","callshopmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callshopmodule:true},["widget.callshopmodule"],0,[MBilling.view.callShop,"Module"],0));(Ext.cmd.derive("MBilling.view.callShop.Module2",Ext.form.Panel,{controller:"callshop",resizable:false,autoShow:true,header:false,autoScroll:true,initComponent:function(){var b=this;b.layout={type:"table",columns:3,tdAttrs:{style:"padding: 3px; vertical-align: top;"}};b.defaults={xtype:"panel",height:268,width:((Ext.Element.getViewportWidth()-200)/3)-10,closable:false,collapsible:true,frame:true};b.items=b.onMountPanels();storeCallShop=Ext.create("MBilling.store.CallShop",{remoteSort:false});if(!App.user.isClient){Ext.form.Panel.prototype.initComponent.apply(this,arguments);return}else{b.handler=setInterval(function(){storeCallShop.load({callback:function(a){b.onShowCabins(a)}})},5000);Ext.form.Panel.prototype.initComponent.apply(this,arguments);storeCallShop.load({callback:function(a){b.onShowCabins(a)}})}},onMountPanels:function(){me=this,items=[];if(!App.user.isClient){return}for(i=1;i<=12;i++){items.push({xtype:"tabpanel",reference:"tab"+i,title:t("Cabina")+i,collapsed:i>3,items:[{reference:"cabina"+i,title:t("Cabina"),xtype:"form",bodyPadding:10,defaults:{xtype:"displayfield",labelWidth:85},items:[{name:"id",hidden:true},{name:"name",hidden:true},{xtype:"fieldcontainer",layout:"hbox",items:[{xtype:"displayfield",fieldLabel:t("Number"),name:"callshopnumber",labelAlign:"right",labelWidth:50,renderer:function(b){return''+b+""},flex:2},{labelAlign:"right",labelWidth:90,xtype:"displayfield",readOnly:true,fieldLabel:t("total"),name:"total",labelStyle:"font-size:18px!important;font-weight:bold;",renderer:function(b){format=Ext.util.Format.numberRenderer("0."+App.user.decimalPrecision);return''+App.user.currency+" "+format(b)+""},flex:3}]},{fieldLabel:t("Destination"),name:"destination"},{fieldLabel:t("Price minute"),name:"price_min",renderer:Helper.Util.formatMoneyDecimal},{fieldLabel:t("Duration"),name:"callshoptime",renderer:Helper.Util.formatsecondsToTime},{border:false,xtype:"toolbar",hidden:me.hideBbar,dock:"bottom",items:[{bodyPadding:10,width:"33%",text:t("Charge"),itemId:"charge",iconCls:"buycredit",handler:"sendActionNew",reference:"cobrar_"+i,urlAction:"index.php/callShop/cobrar"},{width:"33%",text:t("Release"),itemId:"release",iconCls:"release",handler:"sendActionNew",reference:"liberar_"+i,urlAction:"index.php/callShop/liberar",hidden:window.releaseButton},{width:"33%",text:t("Print"),itemId:"print",iconCls:"icon-print",handler:"reportCallshopClientNew",reference:"report_"+i,urlAction:"index.php/callShop/report"}]}]},{reference:"history_"+i,tooltip:"history_"+i,iconCls:"x-fa fa-refresh",title:t("History"),autoScroll:true,items:[{xtype:"callshopcdrlist",buttonCsv:false,autoScroll:true,filterableColumns:false,buttonCleanFilter:false,autoLoadStore:false,border:false,allowCreate:false,allowUpdate:false,allowDelete:false,buttonUpdateLot:false,pagination:false,allowPrint:false,columnsHide:["cabina","destination","status","buycost","markup","date"],store:Ext.create("MBilling.store.CallShopCdr",{remoteFilter:true})}],tabConfig:{listeners:{click:function(b){id=b.tooltip.split("_");panel=me.lookupReference("history_"+id[1]);storeCallshopcdr=panel.down("callshopcdrlist").getStore();filterCabina=[{type:"string",comparison:"eq",value:me.lookupReference("cabina"+id[1]).getForm().findField("name").getValue(),field:"cabina"},{type:"list",value:[0],field:"status"}];storeCallshopcdr.load({filter:filterCabina,params:{filters:Ext.encode(filterCabina)},limit:70})}}}}]})}return items},onShowCabins:function(b){me=this,i=1;Ext.each(b,function(a){if(tab=me.lookupReference("tab"+i)){name=a.data.callerid.length<1?a.data.name:a.data.callerid;status=Helper.Util.formatBooleanFree(a.data.status);tab.setTitle(t("Cabina")+" "+i+" - "+name+" "+status);tab.setVisible(true);me.lookupReference("cabina"+i).getForm().loadRecord(a)}i++});for(i=b.length+1;i<=12;i++){tab=me.lookupReference("tab"+i).setVisible(false)}}},0,["callshop2module"],["component","box","container","panel","form","callshop2module"],{component:true,box:true,container:true,panel:true,form:true,callshop2module:true},["widget.callshop2module"],0,[MBilling.view.callShop,"Module2"],0));(Ext.cmd.derive("MBilling.view.callShop.List",Ext.ux.grid.Panel,{store:"CallShop",viewConfig:{loadMask:false,emptyText:'
'+t("No record found")+"
",getRowClass:function(b){if(App.user.l=="callshop"){if(b.get("status")==1){return"callshoFree"}else{if(b.get("status")==0){return"callshoBlock"}else{if(b.get("status")==2){return"callshoInUse"}else{if(b.get("status")==3){return"callshoInCall"}}}}}}},refreshTime:4,initComponent:function(){var b=this;b.buttonCsv=false;b.buttonUpdateLot=false;b.allowCreate=true;b.allowUpdate=true;b.allowDelete=true;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.allowPrint=false;b.buttonDeleteWidth=140;b.refreshTime=(localStorage&&localStorage.getItem("callshopfresh"))||b.refreshTime;b.extraButtons=[{xtype:"numberfield",field:"jmlhBrg",fieldLabel:t("Refresh Time"),editable:false,minValue:3,labelWidth:90,width:150,selectOnFocus:true,allowDecimals:true,decimalPrecision:2,value:b.refreshTime,listeners:{change:function(a){if(a.value>0){b.refreshTime=a.value;localStorage.setItem("callshopfresh",a.value)}}}}];b.columns=[{header:t("cabina"),dataIndex:"callerid",flex:4},{header:t("status"),dataIndex:"status",renderer:Helper.Util.formatBooleanFree,flex:3,filter:{type:"list",options:[[1,t("free")],[2,t("inuse")],[0,t("blocked")],[3,t("calling")]]}},{header:t("number"),dataIndex:"callshopnumber",flex:4},{header:t("Destino"),dataIndex:"callshopdestination",hidden:App.user.l!="callshop",flex:6},{header:t("sessiontime"),dataIndex:"callshoptime",renderer:Helper.Util.formatsecondsToTime,flex:3}];b.sessionLoad=Ext.create("Ext.util.DelayedTask",function(){b.store.load()},b);Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments);b.store.on("load",b.onLoadStore,b)},onLoadStore:function(){var b=this;b.onDeactivateModule();b.onActivateModule()},onRender:function(){var b=this;b.module.on("activate",b.onActivateModule,b);b.module.on("deactivate",b.onDeactivateModule,b);b.module.on("close",b.onCloseModule,b);Ext.ux.grid.Panel.prototype.onRender.apply(this,arguments)},onActivateModule:function(){this.sessionLoad&&this.sessionLoad.delay(this.refreshTime*1000)},onDeactivateModule:function(){this.sessionLoad&&this.sessionLoad.cancel()},onCloseModule:function(){this.onDeactivateModule();this.sessionLoad=null}},0,["callshoplist"],["component","box","container","panel","tablepanel","gridpanel","grid","callshoplist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callshoplist:true},["widget.callshoplist"],0,[MBilling.view.callShop,"List"],0));(Ext.cmd.derive("MBilling.view.callShop.Form",Ext.ux.form.Panel,{hideTbar:true,labelWidthFields:"60%",bodyPadding:1,layout:"fit",buttonsTbar:[{xtype:"tbtext",itemId:"priceSum"},"->",{text:"Cobrar",itemId:"charge",iconCls:"buycredit",urlAction:"index.php/callShop/cobrar",disabled:true,handler:"sendAction",width:100},{text:"Liberar",itemId:"release",iconCls:"release",urlAction:"index.php/callShop/liberar",disabled:true,handler:"sendAction",width:100},{text:t("Print"),itemId:"print",glyph:icons.print,urlAction:"index.php/callShop/report",disabled:true,handler:"reportCallshopClient",width:100}],initComponent:function(){var b=this;b.items=[{xtype:"callshopcdrlist",buttonCsv:false,filterableColumns:false,buttonCleanFilter:false,autoLoadStore:false,border:true,allowCreate:false,allowUpdate:false,allowDelete:false,buttonUpdateLot:false,pagination:false,allowPrint:false,columnsHide:["status","buycost","markup"],store:Ext.create("MBilling.store.CallShopCdr",{remoteSort:false})}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callshopform"],["component","box","container","panel","form","callshopform"],{component:true,box:true,container:true,panel:true,form:true,callshopform:true},["widget.callshopform"],0,[MBilling.view.callShop,"Form"],0));(Ext.cmd.derive("MBilling.view.callShopCdr.Controller",Ext.ux.app.ViewController,{formHidden:true},0,0,0,0,["controller.callshopcdr"],0,[MBilling.view.callShopCdr,"Controller"],0));(Ext.cmd.derive("MBilling.view.callShopCdr.Module",Ext.ux.panel.Module,{controller:"callshopcdr"},0,["callshopcdrmodule"],["component","box","container","uxpanelmodule","callshopcdrmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callshopcdrmodule:true},["widget.callshopcdrmodule"],0,[MBilling.view.callShopCdr,"Module"],0));(Ext.cmd.derive("MBilling.view.callShopCdr.List",Ext.ux.grid.Panel,{store:"CallShopCdr",initComponent:function(){var b=this;b.buttonCsv=false;b.buttonUpdateLot=false;b.allowUpdate=true;b.allowDelete=false;b.allowCreate=false;b.allowUpdate=false;b.allowPrint=false;b.columns=[{header:t("cabina"),dataIndex:"cabina",filter:{type:"string"},flex:2},{header:t("number"),dataIndex:"calledstation",filter:{type:"string"},flex:3},{dataIndex:"destination",header:t("destination"),flex:3},{header:"Pago",dataIndex:"status",renderer:Helper.Util.formattyyesno,flex:2,filter:{type:"list",options:[[0,t("no")],[1,t("yes")]]}},{header:t("buyrate"),dataIndex:"buycost",renderer:Helper.Util.formatMoneyDecimal,flex:2},{header:t("rateinitial"),dataIndex:"price",renderer:Helper.Util.formatMoneyDecimal,flex:2},{header:t("markup"),dataIndex:"markup",renderer:Ext.util.Format.numberRenderer("0.00 %"),flex:2},{header:t("sessiontime"),dataIndex:"sessiontime",renderer:Helper.Util.formatsecondsToTime,flex:2},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"date",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callshopcdrlist"],["component","box","container","panel","tablepanel","gridpanel","grid","callshopcdrlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callshopcdrlist:true},["widget.callshopcdrlist"],0,[MBilling.view.callShopCdr,"List"],0));(Ext.cmd.derive("MBilling.view.callShopCdr.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:App.user.isClient}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callshopcdrform"],["component","box","container","panel","form","callshopcdrform"],{component:true,box:true,container:true,panel:true,form:true,callshopcdrform:true},["widget.callshopcdrform"],0,[MBilling.view.callShopCdr,"Form"],0));(Ext.cmd.derive("MBilling.view.rateCallshop.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.ratecallshop"],0,[MBilling.view.rateCallshop,"Controller"],0));(Ext.cmd.derive("MBilling.view.rateCallshop.Module",Ext.ux.panel.Module,{controller:"ratecallshop"},0,["ratecallshopmodule"],["component","box","container","uxpanelmodule","ratecallshopmodule"],{component:true,box:true,container:true,uxpanelmodule:true,ratecallshopmodule:true},["widget.ratecallshopmodule"],0,[MBilling.view.rateCallshop,"Module"],0));(Ext.cmd.derive("MBilling.view.rateCallshop.List",Ext.ux.grid.Panel,{store:"RateCallshop",buttonImportCsv:true,initComponent:function(){var b=this;b.buttonImportCsv=App.user.isClient,b.buttonCsv=App.user.isClient;b.allowPrint=App.user.isClient;b.buttonUpdateLot=App.user.isClient;b.allowCreate=App.user.isClient;b.allowUpdate=App.user.isClient;b.allowDelete=App.user.isClient;b.buttonUpdateLotCallShopRate=App.user.isClient;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("dialprefix"),dataIndex:"dialprefix",filter:{type:"string"},flex:2},{header:t("destination"),dataIndex:"destination",flex:3},{header:t("rateinitial"),dataIndex:"buyrate",renderer:Helper.Util.formatMoneyDecimal4,flex:2},{header:t("buyrateinitblock"),dataIndex:"minimo",flex:2},{header:t("buyrateincrement"),dataIndex:"block",flex:2}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["ratecallshoplist"],["component","box","container","panel","tablepanel","gridpanel","grid","ratecallshoplist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,ratecallshoplist:true},["widget.ratecallshoplist"],0,[MBilling.view.rateCallshop,"List"],0));(Ext.cmd.derive("MBilling.view.rateCallshop.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{xtype:"numberfield",name:"dialprefix",fieldLabel:t("prefix")},{name:"destination",fieldLabel:t("destination")},{xtype:"moneyfield",name:"buyrate",fieldLabel:t("rateinitial")},{xtype:"numberfield",name:"minimo",value:1,minValue:1,fieldLabel:t("buyrateinitblock")},{xtype:"numberfield",name:"block",value:1,minValue:1,fieldLabel:t("buyrateincrement")},{xtype:"numberfield",name:"minimal_time_charge",value:0,minValue:0,fieldLabel:t("Minimal time to charge")}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["ratecallshopform"],["component","box","container","panel","form","ratecallshopform"],{component:true,box:true,container:true,panel:true,form:true,ratecallshopform:true},["widget.ratecallshopform"],0,[MBilling.view.rateCallshop,"Form"],0));(Ext.cmd.derive("MBilling.view.rateCallshop.ImportCsv",Ext.ux.window.ImportCsv,{htmlTipInfo:"
"+t("dialprefix")+", "+t("destination")+", "+t("rateinitial")+"
5511, Brasil SP, 0.080
34, Spain Fix, 0.056
54, Argentina, 0.025

"+t("rateinitial")+" "+t("and")+" "+t("buyrate")+""},0,["ratecallshopimportcsv"],["component","box","container","panel","window","ratecallshopimportcsv"],{component:true,box:true,container:true,panel:true,window:true,ratecallshopimportcsv:true},["widget.ratecallshopimportcsv"],0,[MBilling.view.rateCallshop,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.callSummaryCallShop.Controller",MBilling.view.callSummaryPerDay.Controller,{aliasChart:"callsummarycallshopchart"},0,0,0,0,["controller.callsummarycallshop"],0,[MBilling.view.callSummaryCallShop,"Controller"],0));(Ext.cmd.derive("MBilling.view.callSummaryCallShop.Module",Ext.ux.panel.Module,{controller:"callsummarycallshop",titleForm:t("total"),iconForm:"icon-sum",widthForm:250},0,["callsummarycallshopmodule"],["component","box","container","uxpanelmodule","callsummarycallshopmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callsummarycallshopmodule:true},["widget.callsummarycallshopmodule"],0,[MBilling.view.callSummaryCallShop,"Module"],0));(Ext.cmd.derive("MBilling.view.callSummaryCallShop.List",Ext.ux.grid.Panel,{store:"CallSummaryCallShop",initComponent:function(){var b=this;b.buttonImportCsv=false;b.buttonCsv=false;b.allowPrint=false;b.buttonUpdateLot=false;b.allowCreate=false;b.buttonCleanFilter=false;b.allowUpdate=false;b.allowDelete=false;b.extraButtons=[{text:t("charts"),iconCls:"icon-chart-column",handler:"onChart",reference:"chart",disabled:false,hidden:App.user.isClient}];b.collapsedExtraFilters=false;b.titleAddFilter=t("Filter");b.extraFilters=[{field:"t.cabina",label:t("cabina"),type:"string"},{field:"t.calledstation",label:t("prefix"),type:"string"}];b.columns=[{header:t("day"),renderer:Ext.util.Format.dateRenderer("Y-m-d"),dataIndex:"day",filter:{type:"date",field:"date"},flex:3},{menuDisabled:true,header:t("sessiontime")+" "+t("Min"),dataIndex:"sessiontime",flex:2},{menuDisabled:true,header:t("aloc_all_calls"),dataIndex:"aloc_all_calls",renderer:Helper.Util.formatsecondsToTime,flex:3},{menuDisabled:true,header:t("nbcall"),dataIndex:"nbcall",flex:3},{menuDisabled:true,header:t("buycost"),dataIndex:"buycost",renderer:Helper.Util.formatMoneyDecimal,flex:3,hideable:false,hidden:!App.user.isClient},{menuDisabled:true,header:t("sessionbill"),dataIndex:"price",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:!App.user.isClient},{menuDisabled:true,header:t("markup"),dataIndex:"lucro",renderer:Helper.Util.formatMoneyDecimal,flex:3,hideable:false,hidden:!App.user.isClient}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarycallshoplist"],["component","box","container","panel","tablepanel","gridpanel","grid","callsummarycallshoplist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callsummarycallshoplist:true},["widget.callsummarycallshoplist"],0,[MBilling.view.callSummaryCallShop,"List"],0));(Ext.cmd.derive("MBilling.view.callSummaryCallShop.Form",Ext.ux.form.Panel,{defaults:{},labelWidthFields:150,defaultType:"displayfield",initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{name:"sumsessiontime",fieldLabel:t("sessiontime")+" "+t("Min")},{name:"sumprice",fieldLabel:t("sessionbill"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isClient},{name:"sumlucro",fieldLabel:t("markup"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isClient},{name:"sumbuycost",fieldLabel:t("buycost"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isClient},{name:"sumnbcall",fieldLabel:t("nbcall"),hidden:!App.user.isClient}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarycallshopform"],["component","box","container","panel","form","callsummarycallshopform"],{component:true,box:true,container:true,panel:true,form:true,callsummarycallshopform:true},["widget.callsummarycallshopform"],0,[MBilling.view.callSummaryCallShop,"Form"],0));(Ext.cmd.derive("MBilling.view.callSummaryCallShop.Chart",Ext.ux.panel.Chart,{controller:"callsummarycallshop",store:"CallSummaryCallShop",fieldValue:"sessiontime",fieldDescription:"day",labelYLine:t("sessiontime")+" Min",labelXLine:t("day"),initComponent:function(){var d=this,c;d.rendererFieldValue=Ext.util.Format.numberRenderer("0"),d.rendererFieldDescription=Ext.util.Format.dateRenderer("Y-m-d");d.tbarChart=[{xtype:"buttongroup",toggleGroup:"charts",defaults:{enableToggle:true,toggleGroup:"charts",allowDepress:false,listeners:{toggle:"onToggleGroupButton"}},items:[{pressed:true,text:t("sessiontime"),chart:"sessiontime",sumName:"sumsessiontime"},{text:t("buycost"),sumRenderer:Helper.Util.formatMoneyDecimal,chart:"buycost",sumName:"sumbuycost"},{text:t("sessionbill"),sumRenderer:Helper.Util.formatMoneyDecimal,chart:"price",sumName:"sumprice"},{text:t("markup"),sumRenderer:Helper.Util.formatMoneyDecimal,chart:"lucro",sumName:"sumlucro",hidden:App.user.isClient||App.user.isAgent},{text:t("nbcall"),chart:"nbcall",sumName:"sumnbcall"}]}];d.bbarChart=[{xtype:"tbtext",itemId:"tbTextSum"}];Ext.ux.panel.Chart.prototype.initComponent.apply(this,arguments)}},0,["callsummarycallshopchart"],["component","box","container","panel","chartpanel","callsummarycallshopchart"],{component:true,box:true,container:true,panel:true,chartpanel:true,callsummarycallshopchart:true},["widget.callsummarycallshopchart"],0,[MBilling.view.callSummaryCallShop,"Chart"],0));(Ext.cmd.derive("MBilling.view.buycredit.Controller",Ext.ux.app.ViewController,{buyCreditClose:function(e){var j=this,g=j.lookupReference("buycreditPanel"),f=j.lookupReference("btnCancel");g.getForm().findField("amount")["show"]();g.getForm().findField("method")["show"]();g.getForm().findField("card_num")["hide"]();g.getForm().findField("exp_date")["hide"]();g.getForm().findField("method").setValue("");f.setVisible(false)},buyCredit:function(r){var o=this,n=o.lookupReference("buycreditPanel"),s=o.lookupReference("btnCancel"),p=n.getForm().findField("amount").getValue(),l=n.getForm().findField("method").getValue(),m=n.getForm().findField("card_num").getValue(),q=n.getForm().findField("exp_date").rawValue;if(n.getForm().findField("method").rawValue.match(/uthorize/)){if(m){n.setLoading(o.msgWait);Ext.Ajax.request({url:"index.php/buyCredit/method/?amount="+p+"&id_method="+l+"&cc="+m+"&ed="+q,scope:o,success:function(a){a=Ext.decode(a.responseText);if(a.success){Ext.ux.Alert.alert(t("Success"),a.msg,"success",10000);n.setLoading(false);n.getForm().findField("amount")["show"]();n.getForm().findField("method")["show"]();n.getForm().findField("card_num")["hide"]();n.getForm().findField("exp_date")["hide"]();s.setVisible(false);n.getForm().findField("card_num").setValue("");n.getForm().findField("exp_date").setValue("");n.getForm().findField("method").setValue("")}else{Ext.ux.Alert.alert(t("Error"),a.msg,"error");n.getForm().findField("card_num").setValue("");n.getForm().findField("exp_date").setValue("");n.setLoading(false)}}});return}else{n.getForm().findField("amount")["hide"]();n.getForm().findField("method")["hide"]();n.getForm().findField("card_num")["show"]();n.getForm().findField("exp_date")["show"]();s.setVisible(true);n.getForm().findField("card_num").focus()}}else{if(!l){Ext.ux.Alert.alert(o.titleWarning,t("Select a ")+t("paymentmethods"),"warning");return}else{if(p<=0){Ext.ux.Alert.alert(o.titleWarning,t("Select a ")+t("valid")+" "+t("amount"),"warning");return}else{url="index.php/buyCredit/method/?amount="+p+"&id_method="+l;n.getForm().findField("method").setValue("");n.getForm().findField("card_num").setValue("");n.getForm().findField("exp_date").setValue("");if(n.getForm().findField("method").rawValue.match(/PlacetoPay/)){window.open(url,"_self")}else{window.open(url,"_blank")}}}}}},0,0,0,0,["controller.buycredit"],0,[MBilling.view.buycredit,"Controller"],0));(Ext.cmd.derive("MBilling.view.buycredit.Module",Ext.form.Panel,{controller:"buycredit",resizable:false,autoShow:true,header:false,initComponent:function(){var b=this;b.items=[{reference:"buycreditPanel",xtype:"form",margin:"10 10 10 10",autoShow:true,closable:false,resizable:false,bodyPadding:10,defaultType:"textfield",defaults:{labelAlign:"right",labelWidth:150,width:280,allowBlank:false,msgTarget:"side",enableKeyEvents:true,plugins:"markallowblank",anchor:"100%"},items:[{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,00",fieldLabel:t("Amounts"),value:0,name:"amount"},{xtype:"methodpaycombo",fieldLabel:t("paymentmethods"),name:"method"},{fieldLabel:t("CreditCard Number"),name:"card_num",hidden:true},{xtype:"datefield",fieldLabel:t("Expiration Date"),name:"exp_date",format:"m/y",hidden:true}],bbar:[{text:t("Cancel"),tooltip:t("Cancel"),glyph:b.glyphCancel,handler:"buyCreditClose",hidden:true,reference:"btnCancel"},{text:t("Next"),tooltip:t("Next"),width:100,glyph:icons.disk,handler:"buyCredit"}]}];Ext.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["buycreditmodule"],["component","box","container","panel","form","buycreditmodule"],{component:true,box:true,container:true,panel:true,form:true,buycreditmodule:true},["widget.buycreditmodule"],0,[MBilling.view.buycredit,"Module"],0));(Ext.cmd.derive("MBilling.view.transferToMobile.Module",Ext.form.Panel,{resizable:false,autoShow:true,header:false,items:[{xtype:"component",autoEl:{width:"100%",height:"100%",tag:"iframe",src:"index.php/transferToMobile/read"}}]},0,["transfertomobilemodule"],["component","box","container","panel","form","transfertomobilemodule"],{component:true,box:true,container:true,panel:true,form:true,transfertomobilemodule:true},["widget.transfertomobilemodule"],0,[MBilling.view.transferToMobile,"Module"],0));(Ext.cmd.derive("MBilling.view.firewall.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.firewall"],0,[MBilling.view.firewall,"Controller"],0));(Ext.cmd.derive("MBilling.view.firewall.Module",Ext.ux.panel.Module,{controller:"firewall"},0,["firewallmodule"],["component","box","container","uxpanelmodule","firewallmodule"],{component:true,box:true,container:true,uxpanelmodule:true,firewallmodule:true},["widget.firewallmodule"],0,[MBilling.view.firewall,"Module"],0));(Ext.cmd.derive("MBilling.view.firewall.List",Ext.ux.grid.Panel,{store:"Firewall",initComponent:function(){var b=this;b.textDelete="Unban";b.textNew="Ban new Ip";b.buttonCsv=false;b.buttonUpdateLot=false;b.buttonCleanFilter=true;b.allowPrint=false;b.allowCreate=true;b.allowDelete=true;b.columns=[{header:t("Ip"),dataIndex:"ip",flex:4},{header:t("Type"),dataIndex:"jail",flex:4},{header:t("Permanently")+" "+t("Ban"),dataIndex:"action",renderer:Helper.Util.formattyyesno,filter:{type:"list",options:[[0,t("no")],[1,t("yes")]]},flex:2}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["firewalllist"],["component","box","container","panel","tablepanel","gridpanel","grid","firewalllist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,firewalllist:true},["widget.firewalllist"],0,[MBilling.view.firewall,"List"],0));(Ext.cmd.derive("MBilling.view.firewall.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{name:"ip",fieldLabel:t("Ip"),vtype:"IPAddress"},{xtype:"yesnocombo",fieldLabel:t("Permanently")+" "+t("Ban"),name:"action"},{xtype:"textarea",name:"description",fieldLabel:t("description"),allowBlank:true,height:300,anchor:"100%",readOnly:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["firewallform"],["component","box","container","panel","form","firewallform"],{component:true,box:true,container:true,panel:true,form:true,firewallform:true},["widget.firewallform"],0,[MBilling.view.firewall,"Form"],0));(Ext.cmd.derive("MBilling.view.userRate.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.userrate"],0,[MBilling.view.userRate,"Controller"],0));(Ext.cmd.derive("MBilling.view.userRate.Module",Ext.ux.panel.Module,{controller:"userrate"},0,["userratemodule"],["component","box","container","uxpanelmodule","userratemodule"],{component:true,box:true,container:true,uxpanelmodule:true,userratemodule:true},["widget.userratemodule"],0,[MBilling.view.userRate,"Module"],0));(Ext.cmd.derive("MBilling.view.userRate.List",Ext.ux.grid.Panel,{store:"UserRate",initComponent:function(){var b=this;b.buttonCsv=false;b.allowPrint=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("prefix"),dataIndex:"idPrefixprefix",flex:window.isTablet?2:3},{dataIndex:"idPrefixdestination",header:t("destination"),flex:window.isTablet?2:3},{header:t("rateinitial"),dataIndex:"rateinitial",renderer:Helper.Util.formatMoneyDecimal,flex:2},{header:t("initblock"),dataIndex:"initblock",flex:2},{header:t("billingblock"),dataIndex:"billingblock",flex:2}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["userratelist"],["component","box","container","panel","tablepanel","gridpanel","grid","userratelist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,userratelist:true},["widget.userratelist"],0,[MBilling.view.userRate,"List"],0));(Ext.cmd.derive("MBilling.view.userRate.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{fieldLabel:t("User"),name:"id_user",xtype:!App.user.isAdmin?"textfield":"userlookup",ownerForm:b,hidden:!App.user.isAdmin,allowBlank:!App.user.isAdmin},{fieldLabel:t("Destination"),name:"id_prefix",xtype:"prefixlookup",ownerForm:b,hidden:!App.user.isAdmin,allowBlank:!App.user.isAdmin},{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,"+App.user.decimalPrecision,name:"rateinitial",fieldLabel:t("rateinitial"),readOnly:App.user.isClient},{xtype:"numberfield",name:"initblock",fieldLabel:t("initblock"),hidden:App.user.isClient},{xtype:"numberfield",name:"billingblock",fieldLabel:t("billingblock"),hidden:App.user.isClient}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["userrateform"],["component","box","container","panel","form","userrateform"],{component:true,box:true,container:true,panel:true,form:true,userrateform:true},["widget.userrateform"],0,[MBilling.view.userRate,"Form"],0));(Ext.cmd.derive("MBilling.view.extra.Module",Ext.form.Panel,{resizable:false,autoShow:true,header:false,items:[{xtype:"component",autoEl:{width:"100%",height:"100%",tag:"iframe",src:window.moduleExtra}}]},0,["extramodule"],["component","box","container","panel","form","extramodule"],{component:true,box:true,container:true,panel:true,form:true,extramodule:true},["widget.extramodule"],0,[MBilling.view.extra,"Module"],0));(Ext.cmd.derive("MBilling.view.callOnlineChart.Module",Ext.ux.panel.Module,{},0,["callOnlineChartmodule"],["component","box","container","uxpanelmodule","callOnlineChartmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callOnlineChartmodule:true},["widget.callOnlineChartmodule"],0,[MBilling.view.callOnlineChart,"Module"],0));(Ext.cmd.derive("MBilling.view.callOnlineChart.List",Ext.ux.grid.Panel,{store:"CallOnlineChart",initComponent:function(){var b=this;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("Total"),dataIndex:"total",flex:1},{header:t("date"),dataIndex:"date",renderer:Ext.util.Format.dateRenderer("Y-m-d H:i"),flex:1}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callonlinechartlist"],["component","box","container","panel","tablepanel","gridpanel","grid","callonlinechartlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callonlinechartlist:true},["widget.callonlinechartlist"],0,[MBilling.view.callOnlineChart,"List"],0));(Ext.cmd.derive("MBilling.view.callOnlineChart.Form",Ext.ux.form.Panel,{},0,["callOnlineChartform"],["component","box","container","panel","form","callOnlineChartform"],{component:true,box:true,container:true,panel:true,form:true,callOnlineChartform:true},["widget.callOnlineChartform"],0,[MBilling.view.callOnlineChart,"Form"],0));(Ext.cmd.derive("MBilling.view.callOnlineChart.Chart",Ext.ux.panel.Chart,{controller:"callsummaryperday",store:"CallOnlineChart",fieldValue:["total","answer"],fieldDescription:"date",labelYLine:t("total")+" / Min",labelXLine:t("Minute"),reference:"callonlinechartchart",defaultChart:"line",btnShowColumn:false,btnShowBar:false,btnShowLine:true,btnShowPie:false,animate:true,btnShowLineHidden:true,initComponent:function(){var b=this;b.rendererFieldValue=Ext.util.Format.numberRenderer("0");b.tbarChart=[{text:t("Per")+" "+t("Minute"),scope:b,handler:"onPerMinute",reference:"btnMinute",disabled:true},{text:t("Per")+" "+t("Hour"),scope:b,handler:"onPerhour",reference:"btnHour"}];b.legend={position:"right",boxStrokeWidth:0,labelFont:"12px Helvetica",renderer:b.rendererLegend};b.bbarChart=[{xtype:"tbtext",itemId:"tbTextSum"}];b.sessionLoad=Ext.create("Ext.util.DelayedTask",function(){b.store.load()},b);Ext.ux.panel.Chart.prototype.initComponent.apply(this,arguments);b.store.on("load",b.onLoadStore,b)},onPerMinute:function(d){var c=this;c.lookupReference("btnMinute").disable();c.lookupReference("btnHour").enable();c.store.setRemoteFilter(true);c.store.filter("type","minute");c.store.load()},onPerhour:function(d){var c=this;c.lookupReference("btnHour").disable();c.lookupReference("btnMinute").enable();c.store.setRemoteFilter(true);c.store.filter("type","hour");c.store.load()},onLoadStore:function(){this.onActivateModule()},onActivateModule:function(){this.sessionLoad&&this.sessionLoad.delay(25000)}},0,["callonlinechartchart"],["component","box","container","panel","chartpanel","callonlinechartchart"],{component:true,box:true,container:true,panel:true,chartpanel:true,callonlinechartchart:true},["widget.callonlinechartchart"],0,[MBilling.view.callOnlineChart,"Chart"],0));(Ext.cmd.derive("MBilling.view.smtps.Controller",Ext.ux.app.ViewController,{onSendEmail:function(e){var f=this,d=f.list.getSelectionModel().getSelection()[0];f.list.setLoading(true);if(f.list.getSelectionModel().getSelection().length==1){Ext.Ajax.request({url:"index.php/smtps/testMail",params:{id:d.get("id")},scope:f,success:function(a){a=Ext.decode(a.responseText);if(a[f.nameSuccessRequest]){Ext.ux.Alert.alert(f.titleSuccess,a[f.nameMsgRequest],"success")}else{Ext.ux.Alert.alert(f.titleError,a[f.nameMsgRequest],"error")}f.list.setLoading(false)}})}else{Ext.ux.Alert.alert(f.titleError,"Please Select a Smtp","notification");f.list.setLoading(false)}}},0,0,0,0,["controller.smtps"],0,[MBilling.view.smtps,"Controller"],0));(Ext.cmd.derive("MBilling.view.smtps.List",Ext.ux.grid.Panel,{store:"Smtps",initComponent:function(){var b=this;b.extraButtons=[{text:t("Test Smtp"),iconCls:"templatemail",handler:"onSendEmail",disabled:false}];b.buttonUpdateLot=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("Host"),dataIndex:"host",flex:4},{header:t("username"),dataIndex:"username",flex:2},{header:t("Port"),dataIndex:"port",flex:3},{header:t("Encryption"),dataIndex:"encryption",flex:3}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["smtpslist"],["component","box","container","panel","tablepanel","gridpanel","grid","smtpslist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,smtpslist:true},["widget.smtpslist"],0,[MBilling.view.smtps,"List"],0));(Ext.cmd.derive("MBilling.view.smtps.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{name:"host",fieldLabel:t("Host"),hidden:App.user.isClient},{name:"username",fieldLabel:t("username"),hidden:App.user.isClient},{inputType:"password",name:"password",fieldLabel:t("password"),hidden:App.user.isClient},{xtype:"numberfield",name:"port",fieldLabel:t("Port"),value:587,hidden:App.user.isClient},{xtype:"combobox",name:"encryption",fieldLabel:t("Encryption"),hidden:App.user.isClient,value:"null",store:[["ssl",t("SSl")],["tls",t("TLS")],["null",t("NULL")]]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["smtpsform"],["component","box","container","panel","form","smtpsform"],{component:true,box:true,container:true,panel:true,form:true,smtpsform:true},["widget.smtpsform"],0,[MBilling.view.smtps,"Form"],0));(Ext.cmd.derive("MBilling.view.smtps.Module",Ext.ux.panel.Module,{controller:"smtps"},0,["smtpsmodule"],["component","box","container","uxpanelmodule","smtpsmodule"],{component:true,box:true,container:true,uxpanelmodule:true,smtpsmodule:true},["widget.smtpsmodule"],0,[MBilling.view.smtps,"Module"],0));(Ext.cmd.derive("MBilling.view.servers.Controller",Ext.ux.app.ViewController,{init:function(){var b=this;b.control({combobox:{select:b.onSelectType}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectType:function(c,d){this.showFieldsRelated(d.getData().showFields)},showFieldsRelated:function(l){var m=this,g=m.formPanel.getForm().getFields(),j=m.formPanel.getForm().findField("weight"),f=m.formPanel.getForm();g.each(function(a){if(a.name=="type"){if(a.value=="asterisk"||a.value=="mbilling"){j.show()}else{j.hide()}}})},onEdit:function(){var d=this,f=d.formPanel.getForm().findField("weight"),e=d.formPanel.getForm().findField("type");Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments);if(e.value=="asterisk"||e.value=="mbilling"){f.show()}else{f.hide()}},onDelete:function(d){var f=this,e;notDelete=false;Ext.each(f.list.getSelectionModel().getSelection(),function(a){if(a.get("id")==1){Ext.ux.Alert.alert(f.titleError,t("You cannot delete the")+" server id 1","error");notDelete=true}});if(notDelete==false){Ext.ux.app.ViewController.prototype.onDelete.apply(this,arguments)}}},0,0,0,0,["controller.servers"],0,[MBilling.view.servers,"Controller"],0));(Ext.cmd.derive("MBilling.view.servers.List",Ext.ux.grid.Panel,{store:"Servers",initComponent:function(){var b=this;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("host"),dataIndex:"host",flex:4},{header:t("username"),dataIndex:"username",flex:4},{header:t("type"),dataIndex:"type",comboRelated:"booleancombo",flex:2},{header:t("status"),dataIndex:"status",renderer:Helper.Util.formatBooleanActive,comboRelated:"booleancombo",flex:2,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")]]}}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["serverslist"],["component","box","container","panel","tablepanel","gridpanel","grid","serverslist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,serverslist:true},["widget.serverslist"],0,[MBilling.view.servers,"List"],0));(Ext.cmd.derive("MBilling.view.servers.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["id_user"],initComponent:function(){var b=this;b.items=[{name:"host",fieldLabel:t("host")},{name:"username",fieldLabel:t("username"),allowBlank:true},{name:"password",fieldLabel:t("password"),allowBlank:true},{name:"port",fieldLabel:t("port"),allowBlank:true},{xtype:"combobox",name:"type",fieldLabel:t("type"),forceSelection:true,editable:false,value:"mbilling",store:[["mbilling",t("Mbilling")],["asterisk",t("Asterisk")],["sipproxy",t("SipProxy")]]},{fieldLabel:t("Weight"),name:"weight",hidden:true,allowBlank:true,emptyText:t("This is useful in order to get a different ratio of traffic between servers.")},{xtype:"booleancombo",name:"status",fieldLabel:t("status"),allowBlank:true},{xtype:"textareafield",name:"description",fieldLabel:t("description"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["serversform"],["component","box","container","panel","form","serversform"],{component:true,box:true,container:true,panel:true,form:true,serversform:true},["widget.serversform"],0,[MBilling.view.servers,"Form"],0));(Ext.cmd.derive("MBilling.view.servers.Module",Ext.ux.panel.Module,{controller:"servers"},0,["serversmodule"],["component","box","container","uxpanelmodule","serversmodule"],{component:true,box:true,container:true,uxpanelmodule:true,serversmodule:true},["widget.serversmodule"],0,[MBilling.view.servers,"Module"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerUser.Controller",Ext.ux.app.ViewController,{formHidden:true,onEdit:function(){me=this;me.sumData=me.store.getData().items[0].getData();if(!me.sumData){return}me.formPanel.getForm().getFields().each(function(b){b.setValue(me.sumData[b.name])});me.formPanel.expand()},onExportCsvUser:function(o,l,g){var m=this,j=m.list.getStore(),n=m.list.filters.getFilterData().length?Ext.encode(m.list.filters.getFilterData()):j.proxy.extraParams.filter;window.open("index.php/callSummaryPerUser/exportCsvCalls?id="+o.getStore().getAt(l).getData().idUserusername+"&filter="+n)}},0,0,0,0,["controller.callsummaryperuser"],0,[MBilling.view.callSummaryPerUser,"Controller"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerUser.List",Ext.ux.grid.Panel,{store:"CallSummaryPerUser",initComponent:function(){var b=this;b.buttonImportCsv=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{xtype:"actioncolumn",width:26,sortable:false,menuDisabled:true,header:t(""),dataIndex:"id",items:[{iconCls:"icon-export-csv",tooltip:t("Export CSV"),handler:"onExportCsvUser"}],hidden:!App.user.isAdmin},{header:t("Username"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:3},{header:t("sessiontime")+" "+t("Min"),dataIndex:"sessiontime",flex:2},{header:t("aloc_all_calls"),dataIndex:"aloc_all_calls",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Answered Calls"),dataIndex:"nbcall",flex:3},{header:t("Failed Calls"),dataIndex:"nbcall_fail",flex:3},{header:t("buycost"),dataIndex:App.user.isAdmin?"buycost":"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("sessionbill"),dataIndex:App.user.isAgent||App.user.isClientAgent?"agent_bill":"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("markup"),dataIndex:"lucro",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("ASR"),dataIndex:"asr",renderer:Helper.Util.formatPorcente,flex:3,hidden:!App.user.isAdmin,hideable:App.user.isAdmin}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummaryperuserlist"],["component","box","container","panel","tablepanel","gridpanel","grid","callsummaryperuserlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callsummaryperuserlist:true},["widget.callsummaryperuserlist"],0,[MBilling.view.callSummaryPerUser,"List"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerUser.Form",Ext.ux.form.Panel,{defaults:{},labelWidthFields:100,defaultType:"displayfield",initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{name:"sumsessiontime",fieldLabel:t("sessiontime")+" "+t("Min"),renderer:Ext.util.Format.numberRenderer("0"),allowBlank:true},{name:App.user.isAgent||App.user.isClientAgent?"sumagent_bill":"sumsessionbill",fieldLabel:t("sessionbill"),renderer:Helper.Util.formatMoneyDecimal,allowBlank:true},{name:App.user.isAdmin?"sumbuycost":"sumsessionbill",fieldLabel:t("buycost"),renderer:Helper.Util.formatMoneyDecimal,hidden:App.user.isClient,allowBlank:true},{name:"sumlucro",fieldLabel:t("markup"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumnbcall",fieldLabel:t("Answered Calls"),allowBlank:true},{name:"sumnbcallfail",fieldLabel:t("Failed Calls"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummaryperuserform"],["component","box","container","panel","form","callsummaryperuserform"],{component:true,box:true,container:true,panel:true,form:true,callsummaryperuserform:true},["widget.callsummaryperuserform"],0,[MBilling.view.callSummaryPerUser,"Form"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerUser.Module",Ext.ux.panel.Module,{controller:"callsummaryperuser",cfgEast:{flex:0.4}},0,["callsummaryperusermodule"],["component","box","container","uxpanelmodule","callsummaryperusermodule"],{component:true,box:true,container:true,uxpanelmodule:true,callsummaryperusermodule:true},["widget.callsummaryperusermodule"],0,[MBilling.view.callSummaryPerUser,"Module"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerTrunk.Controller",Ext.ux.app.ViewController,{formHidden:true,onEdit:function(){me=this;me.sumData=me.store.getData().items[0].getData();if(!me.sumData){return}me.formPanel.getForm().getFields().each(function(b){b.setValue(me.sumData[b.name])});me.formPanel.expand()},onExportCsvUser:function(o,l,g){var m=this,j=m.list.getStore(),n=m.list.filters.getFilterData().length?Ext.encode(m.list.filters.getFilterData()):j.proxy.extraParams.filter;window.open("index.php/callSummaryPerTrunk/exportCsvCalls?id="+o.getStore().getAt(l).getData().idTrunktrunkcode+"&filter="+n)}},0,0,0,0,["controller.callsummarypertrunk"],0,[MBilling.view.callSummaryPerTrunk,"Controller"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerTrunk.List",Ext.ux.grid.Panel,{store:"CallSummaryPerTrunk",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{xtype:"actioncolumn",width:26,sortable:false,menuDisabled:true,header:t(""),dataIndex:"id",items:[{iconCls:"icon-export-csv",tooltip:t("Export CSV"),handler:"onExportCsvUser"}],hidden:!App.user.isAdmin},{header:t("Trunk"),dataIndex:"idTrunktrunkcode",filter:{type:"string",field:"idTrunk.trunkcode"},flex:3},{header:t("sessiontime")+" "+t("Min"),dataIndex:"sessiontime",flex:2},{header:t("aloc_all_calls"),dataIndex:"aloc_all_calls",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Answered Calls"),dataIndex:"nbcall",flex:3},{header:t("Failed Calls"),dataIndex:"nbcall_fail",flex:3},{header:t("buycost"),dataIndex:"buycost",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("sessionbill"),dataIndex:"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("markup"),dataIndex:"lucro",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("ASR"),dataIndex:"asr",renderer:Helper.Util.formatPorcente,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarypertrunklist"],["component","box","container","panel","tablepanel","gridpanel","grid","callsummarypertrunklist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callsummarypertrunklist:true},["widget.callsummarypertrunklist"],0,[MBilling.view.callSummaryPerTrunk,"List"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerTrunk.Form",Ext.ux.form.Panel,{defaults:{},labelWidthFields:100,defaultType:"displayfield",initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{name:"sumsessiontime",fieldLabel:t("sessiontime")+" "+t("Min"),renderer:Ext.util.Format.numberRenderer("0"),allowBlank:true},{name:"sumsessionbill",fieldLabel:t("sessionbill"),renderer:Helper.Util.formatMoneyDecimal,allowBlank:true},{name:"sumbuycost",fieldLabel:t("buycost"),renderer:Helper.Util.formatMoneyDecimal,hidden:App.user.isClient,allowBlank:true},{name:"sumlucro",fieldLabel:t("markup"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumnbcall",fieldLabel:t("Answered Calls"),allowBlank:true},{name:"sumnbcallfail",fieldLabel:t("Failed Calls"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarypertrunkform"],["component","box","container","panel","form","callsummarypertrunkform"],{component:true,box:true,container:true,panel:true,form:true,callsummarypertrunkform:true},["widget.callsummarypertrunkform"],0,[MBilling.view.callSummaryPerTrunk,"Form"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerTrunk.Module",Ext.ux.panel.Module,{controller:"callsummarypertrunk",cfgEast:{flex:0.4}},0,["callsummarypertrunkmodule"],["component","box","container","uxpanelmodule","callsummarypertrunkmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callsummarypertrunkmodule:true},["widget.callsummarypertrunkmodule"],0,[MBilling.view.callSummaryPerTrunk,"Module"],0));(Ext.cmd.derive("MBilling.view.backup.Controller",Ext.ux.app.ViewController,{formHidden:true,onDownload:function(l){var j=this,m,f=j.list.getSelectionModel().getSelection()[0],g=[];values="file="+f.data.name;url="index.php/backup/download/?"+values;window.open(url)},onDelete:function(m){var l=this,n,o=l.list.getSelectionModel().getSelection()[0],j=[];destroyType=m.menu.down("menucheckitem[checked=true]").value;var g=(destroyType==="all")?l.msgDeleteAll:l.msgConfirmation;if(!l.list.allowDelete){return}if(destroyType==="all"){Ext.ux.Alert.alert(l.titleError,"You cannot delete all backups","notification");return}if(o){Ext.Msg.confirm(l.titleConfirmation,g,function(a){if(a==="yes"){Ext.each(l.list.getSelectionModel().getSelection(),function(b){j.push(b.get("name"))});Ext.Ajax.request({url:"index.php/backup/destroy",params:{ids:Ext.encode(j)},scope:l,success:function(d){d=Ext.decode(d.responseText);if(d[l.nameSuccessRequest]){var c=Helper.Util.convertErrorsJsonToString(d[l.nameMsgRequest]);Ext.ux.Alert.alert(l.titleSuccess,c,"success")}else{var b=Helper.Util.convertErrorsJsonToString(d[l.nameMsgRequest]);Ext.ux.Alert.alert(l.titleError,b,"notification")}}});l.store.load()}},l)}else{Ext.ux.Alert.alert(l.titleError,t("Please select one or more register"),"notification")}},onNew:function(){var b=this;Ext.Msg.confirm(b.titleConfirmation,t("Do you relly want create a new backup now? It can take many time and make your server slow. Mbilling make backup every day automatically."),function(a){if(a==="yes"){Ext.Msg.confirm(b.titleConfirmation,t("This backup will override the backup held today! Do you sure?"),function(d){if(d==="yes"){Ext.Ajax.request({url:"index.php/backup/save",params:{ids:0},scope:b,success:function(j){j=Ext.decode(j.responseText);if(j[b.nameSuccessRequest]){var g=Helper.Util.convertErrorsJsonToString(j[b.nameMsgRequest]);Ext.ux.Alert.alert(b.titleSuccess,g,"success")}else{var c=Helper.Util.convertErrorsJsonToString(j[b.nameMsgRequest]);Ext.ux.Alert.alert(b.titleError,c,"notification")}}});b.store.load()}},b)}},b)}},0,0,0,0,["controller.backup"],0,[MBilling.view.backup,"Controller"],0));(Ext.cmd.derive("MBilling.view.backup.List",Ext.ux.grid.Panel,{store:"Backup",initComponent:function(){var b=this;b.buttonImportCsv=true;b.textButtonImportCsv=t("Importar Backup");b.widthButtonCsv=140;b.extraButtons=[{text:t("Download Backup"),glyph:icons.disk,handler:"onDownload",width:140,disabled:false}];b.buttonCsv=false;b.allowPrint=false;b.buttonUpdateLot=false;b.buttonCleanFilter=false;b.allowUpdate=false;b.columns=[{menuDisabled:true,header:t("name"),dataIndex:"name",flex:1},{menuDisabled:true,header:t("size"),dataIndex:"size",flex:1}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["backuplist"],["component","box","container","panel","tablepanel","gridpanel","grid","backuplist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,backuplist:true},["widget.backuplist"],0,[MBilling.view.backup,"List"],0));(Ext.cmd.derive("MBilling.view.backup.Form",Ext.ux.form.Panel,{},0,["backupform"],["component","box","container","panel","form","backupform"],{component:true,box:true,container:true,panel:true,form:true,backupform:true},["widget.backupform"],0,[MBilling.view.backup,"Form"],0));(Ext.cmd.derive("MBilling.view.backup.Module",Ext.ux.panel.Module,{controller:"backup",initComponent:function(){var b=this;Ext.ux.panel.Module.prototype.initComponent.apply(this,arguments)}},0,["backupmodule"],["component","box","container","uxpanelmodule","backupmodule"],{component:true,box:true,container:true,uxpanelmodule:true,backupmodule:true},["widget.backupmodule"],0,[MBilling.view.backup,"Module"],0));(Ext.cmd.derive("MBilling.view.backup.ImportCsv",Ext.ux.window.ImportCsv,{htmlTipInfo:"",extAllowed:["tgz"],fieldLabel:"Backup",iconCls:"icon-play"},0,["backupimportcsv"],["component","box","container","panel","window","backupimportcsv"],{component:true,box:true,container:true,panel:true,window:true,backupimportcsv:true},["widget.backupimportcsv"],0,[MBilling.view.backup,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.gAuthenticator.Controller",Ext.ux.app.ViewController,{init:function(){var b=this;b.control({statususercombo:{select:b.onSelectMethod}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectMethod:function(c,d){this.showFieldsRelated(d.getData().showFields)},showFieldsRelated:function(l){var m=this,j=m.formPanel.getForm().getFields(),o=m.formPanel.getForm().findField("googleAuthenticator_enable"),n=m.formPanel.getForm().findField("google_authenticator_key"),g=m.formPanel.getForm().findField("code");if(o.value!=1&&n.value.length>5){g.setVisible(true);g.allowBlank=false}else{g.setVisible(false);g.allowBlank=true}},onEdit:function(){var c=this,d=c.formPanel.getForm();if(!App.user.isAdmin){return}d.findField("code").allowBlank=true;d.findField("code").setVisible(false);Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)}},0,0,0,0,["controller.gauthenticator"],0,[MBilling.view.gAuthenticator,"Controller"],0));(Ext.cmd.derive("MBilling.view.gAuthenticator.List",Ext.ux.grid.Panel,{store:"GAuthenticator",fieldSearch:"username",initComponent:function(){var b=this;b.buttonCsv=false;b.allowPrint=false;b.buttonUpdateLot=false;b.allowCreate=false;b.buttonCleanFilter=false;b.allowUpdate=App.user.isAdmin;b.allowDelete=false;if(!App.user.isAdmin){b.columns=[]}else{b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("username"),dataIndex:"username",flex:4},{header:t("status"),dataIndex:"googleAuthenticator_enable",renderer:Helper.Util.formatBooleanActive,comboRelated:"booleancombo",flex:2,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")]]}}]}Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["gauthenticatorlist"],["component","box","container","panel","tablepanel","gridpanel","grid","gauthenticatorlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,gauthenticatorlist:true},["widget.gauthenticatorlist"],0,[MBilling.view.gAuthenticator,"List"],0));(Ext.cmd.derive("MBilling.view.gAuthenticator.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{name:"username",fieldLabel:t("username"),readyOnly:true},{xtype:"statususercombo",name:"googleAuthenticator_enable",fieldLabel:t("status"),allowBlank:true},{vtype:"numberfield",name:"code",fieldLabel:t("Code"),hidden:true,maxLength:6,minLength:6,allowBlank:true},{name:"google_authenticator_key",fieldLabel:t("google_authenticator_key"),readyOnly:true,allowBlank:true,hidden:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["gauthenticatorform"],["component","box","container","panel","form","gauthenticatorform"],{component:true,box:true,container:true,panel:true,form:true,gauthenticatorform:true},["widget.gauthenticatorform"],0,[MBilling.view.gAuthenticator,"Form"],0));(Ext.cmd.derive("MBilling.view.gAuthenticator.Module",Ext.ux.panel.Module,{controller:"gauthenticator"},0,["gauthenticatormodule"],["component","box","container","uxpanelmodule","gauthenticatormodule"],{component:true,box:true,container:true,uxpanelmodule:true,gauthenticatormodule:true},["widget.gauthenticatormodule"],0,[MBilling.view.gAuthenticator,"Module"],0));(Ext.cmd.derive("MBilling.view.groupUserGroup.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.groupusergroup"],0,[MBilling.view.groupUserGroup,"Controller"],0));(Ext.cmd.derive("MBilling.view.groupUserGroup.List",Ext.ux.grid.Panel,{store:"GroupUserGroup",initComponent:function(){var b=this;b.buttonCsv=false;b.allowPrint=false;b.buttonUpdateLot=false;b.allowCreate=false;b.buttonCleanFilter=false;b.allowDelete=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("Group"),dataIndex:"name",flex:4,readOnly:true,hidden:App.user.isClient,hideable:!App.user.isClient}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["groupusergrouplist"],["component","box","container","panel","tablepanel","gridpanel","grid","groupusergrouplist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,groupusergrouplist:true},["widget.groupusergrouplist"],0,[MBilling.view.groupUserGroup,"List"],0));(Ext.cmd.derive("MBilling.view.groupUserGroup.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["id_user"],initComponent:function(){var b=this;b.items=[{name:"name",fieldLabel:t("Group"),readOnly:true},{style:"margin-top:25px",xtype:"fieldset",title:t("Select one or more groups"),collapsible:true,collapsed:false,items:[{anchor:"100%",fieldLabel:"",xtype:"groupusertag",allowBlank:true}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["groupusergroupform"],["component","box","container","panel","form","groupusergroupform"],{component:true,box:true,container:true,panel:true,form:true,groupusergroupform:true},["widget.groupusergroupform"],0,[MBilling.view.groupUserGroup,"Form"],0));(Ext.cmd.derive("MBilling.view.groupUserGroup.Module",Ext.ux.panel.Module,{controller:"groupusergroup"},0,["groupusergroupmodule"],["component","box","container","uxpanelmodule","groupusergroupmodule"],{component:true,box:true,container:true,uxpanelmodule:true,groupusergroupmodule:true},["widget.groupusergroupmodule"],0,[MBilling.view.groupUserGroup,"Module"],0));(Ext.cmd.derive("MBilling.view.services.Controller",Ext.ux.app.ViewController,{init:function(){var b=this;b.control({servicestypecombo:{select:b.onSelectType}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectType:function(c,d){this.showFieldsRelated(d.getData().showFields)},showFieldsRelated:function(m){var n=this,o=n.formPanel.getForm(),p=o.findField("calllimit"),j=o.findField("disk_space"),q=o.findField("sipaccountlimit"),l=o.findField("type").getValue();p.setVisible(l=="calllimit");j.setVisible(l=="disk_space");q.setVisible(l=="sipAccountLimit")},onEdit:function(){var f=this,d=f.formPanel.getForm(),e=f.list.getSelectionModel().getSelection()[0];if(App.user.isClient){return}f.lookupReference("generalTab").show();d.findField("calllimit").setVisible(e.data.type=="calllimit");d.findField("disk_space").setVisible(e.data.type=="disk_space");d.findField("sipaccountlimit").setVisible(e.data.type=="sipAccountLimit");Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)},onNew:function(){var c=this,d=c.formPanel.getForm();d.findField("calllimit").setVisible(false);d.findField("disk_space").setVisible(false);d.findField("sipaccountlimit").setVisible(false);Ext.ux.app.ViewController.prototype.onNew.apply(this,arguments)}},0,0,0,0,["controller.services"],0,[MBilling.view.services,"Controller"],0));(Ext.cmd.derive("MBilling.view.services.List",Ext.ux.grid.Panel,{store:"Services",initComponent:function(){var b=this;b.buttonCsv=false;b.columns=b.columns||[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("type"),dataIndex:"type",flex:3,renderer:Helper.Util.formatTranslate,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("name"),dataIndex:"name",flex:4},{header:t("Price"),dataIndex:"price",renderer:Helper.Util.formatMoneyDecimal2,flex:2},{hidden:App.user.isClient,dataIndex:"description",header:t("description"),flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["serviceslist"],["component","box","container","panel","tablepanel","gridpanel","grid","serviceslist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,serviceslist:true},["widget.serviceslist"],0,[MBilling.view.services,"List"],0));(Ext.cmd.derive("MBilling.view.services.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{plugins:"markallowblank",allowBlank:false,anchor:"100%"}},items:[{title:t("general"),reference:"generalTab",items:[{xtype:"servicestypecombo",name:"type",fieldLabel:t("type"),allowBlank:true,hidden:App.user.isClient},{name:"name",fieldLabel:t("name"),readOnly:App.user.isClient},{name:"calllimit",fieldLabel:t("calllimit"),allowBlank:true,hidden:true,readOnly:App.user.isClient},{name:"disk_space",fieldLabel:t("disk_space"),allowBlank:true,hidden:true,readOnly:App.user.isClient},{name:"sipaccountlimit",fieldLabel:t("Sip Account Limit"),allowBlank:true,hidden:true,readOnly:App.user.isClient},{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,00",name:"price",fieldLabel:t("price"),readOnly:App.user.isClient},{xtype:"textarea",name:"description",fieldLabel:t("description"),allowBlank:true,hidden:App.user.isClient,height:100,anchor:"100%"}]},{hidden:App.user.isClient,title:t("Actions"),items:[{xtype:"permissionfield",buttonAddPermissionTitle:t("Add permissions for this service"),hideLabel:true,anchor:"100% "+(!Ext.Boot.platformTags.desktop?"82%":window.isThemeNeptune?"87%":"89%"),allowBlank:true,hidden:App.user.isClient}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["servicesform"],["component","box","container","panel","form","servicesform"],{component:true,box:true,container:true,panel:true,form:true,servicesform:true},["widget.servicesform"],0,[MBilling.view.services,"Form"],0));(Ext.cmd.derive("MBilling.view.services.Module",Ext.ux.panel.Module,{controller:"services",cfgEast:{flex:6}},0,["servicesmodule"],["component","box","container","uxpanelmodule","servicesmodule"],{component:true,box:true,container:true,uxpanelmodule:true,servicesmodule:true},["widget.servicesmodule"],0,[MBilling.view.services,"Module"],0));(Ext.cmd.derive("MBilling.view.services.Lookup",Ext.ux.form.field.Lookup,{name:"id_services",fieldLabel:t("Service"),displayField:"idServicesname",displayFieldList:"name",gridConfig:{xtype:"serviceslist",fieldSearch:"name",columns:[{header:t("name"),dataIndex:"name",flex:2},{header:t("price"),dataIndex:"price",renderer:Helper.Util.formatMoneyDecimal,flex:2}]}},0,["serviceslookup"],["component","box","container","fieldcontainer","serviceslookup"],{component:true,box:true,container:true,fieldcontainer:true,serviceslookup:true},["widget.serviceslookup"],0,[MBilling.view.services,"Lookup"],0));(Ext.cmd.derive("MBilling.view.servicesUse.Controller",Ext.ux.app.ViewController,{onSelectionChange:function(f,m){var l=this,j=l.lookupReference("cancelService"),g=l.lookupReference("payService");j&&j.setDisabled(!m.length);g&&g.setDisabled(!m.length);Ext.ux.app.ViewController.prototype.onSelectionChange.apply(this,arguments)},init:function(){var b=this;b.control({serviceslookup:{select:b.setValorItem}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onNew:function(){var c=this,d=c.formPanel.getForm();d.findField("method").setVisible(false);d.findField("price").setVisible(false);Ext.ux.app.ViewController.prototype.onNew.apply(this,arguments)},onEdit:function(){var b=this;if(App.user.isClient){return}Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)},setValorItem:function(j,g){var l=this,m=l.formPanel.getForm(),f=m.findField("price");if(l.formPanel.getForm().findField("id").getValue()===""){l.findService(g,f)}},findService:function(e,f){var d=this;if(e<1){return}filterService=Ext.encode([{type:"numeric",comparison:"eq",value:e,field:"id"}]);Ext.Ajax.request({url:"index.php/services/read?filter="+filterService,success:function(a){a=Ext.decode(a.responseText);if(a.rows){f.setValue(a.rows[0].price);f.setVisible(true)}}})},onCancelService:function(e){var f=this,d=f.list.getSelectionModel().getSelection()[0];f.formPanel.collapse();f.list.setLoading(true);if(f.list.getSelectionModel().getSelection().length==1){if(d.get("status")==0){Ext.ux.Alert.alert(f.titleWarning,t("This Service alread is canceled"),"notification");f.list.setLoading(false);return}else{if(d.get("status")==2){f.ondSendRequest(d.get("id"))}else{Ext.Msg.confirm(f.titleConfirmation,""+t("ALERT: Do you really want cancel this service to this user?")+"",function(a){if(a==="yes"){Ext.Msg.confirm(f.titleConfirmation,""+t("ALERT: This action was to return the balance, referring to the days not used. Do you confirm?")+"",function(b){if(b==="yes"){f.ondSendRequest(d.get("id"));Ext.ux.Alert.alert(t("Notification"),t("The system will reload in 3 seconds"),"information",true);setTimeout(function(){location.reload()},3000)}})}f.list.setLoading(false)})}}}else{Ext.ux.Alert.alert(f.titleError,t("Please Select only a record"),"notification");f.list.setLoading(false)}},onPayServiceLink:function(g){var j=this,e=j.list.getSelectionModel().getSelection()[0],f=[];j.formPanel.collapse();j.list.setLoading(true);if(e){Ext.each(j.list.getSelectionModel().getSelection(),function(a){f.push(a.get(j.idProperty))})}url="index.php/buyCredit/payServiceLink?id_service_use="+Ext.encode(f);window.open(url,"_blank");j.list.setLoading(false);j.store.load();Ext.Msg.confirm(j.titleConfirmation,""+t("The system will reload in 3 seconds")+"",function(a){location.reload()})},ondSendRequest:function(c){var d=this;Ext.Ajax.request({url:"index.php/servicesUse/cancelService",params:{id:c},scope:d,success:function(a){a=Ext.decode(a.responseText);if(a[d.nameSuccessRequest]){Ext.ux.Alert.alert(d.titleSuccess,a[d.nameMsgRequest],"success")}else{Ext.ux.Alert.alert(d.titleError,a[d.nameMsgRequest],"error")}d.formPanel.reset();d.list.setLoading(false);d.store.load()}})}},0,0,0,0,["controller.servicesuse"],0,[MBilling.view.servicesUse,"Controller"],0));(Ext.cmd.derive("MBilling.view.servicesUse.List",Ext.ux.grid.Panel,{store:"ServicesUse",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.buttonPrint=false;b.buttonCsv=false;b.buttonNewHeight=App.user.isAdmin?25:50,b.textNew=App.user.isAdmin?t("Add New Service"):""+t("Buy New Service")+"";b.buttonNewWidth=175;b.extraButtons=[{text:""+t("Cancel Service")+"",handler:"onCancelService",disabled:true,iconCls:"buycredit",width:170,hidden:!b.allowDelete,reference:"cancelService"},{text:""+t("Pay")+" "+t("services")+" "+t("pendings")+"",handler:"onPayServiceLink",disabled:true,iconCls:"buycredit",width:190,reference:"payService"}];b.allowDelete=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("Services"),dataIndex:"idServicesname",flex:5},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("monthpayed"),dataIndex:"month_payed",flex:2},{header:t("Price"),dataIndex:"idServicesprice",renderer:Helper.Util.formatMoneyDecimal2,flex:2},{header:t("Active"),dataIndex:"status",renderer:Helper.Util.formatBooleanActive,filter:{type:"list",options:[[1,t("active")],[2,t("pending")],[0,t("inactive")]]},flex:2},{header:t("reservationdate"),renderer:Helper.Util.formatDateTime,dataIndex:"reservationdate",flex:5},{header:t("releasedate"),renderer:Helper.Util.formatDateTime,dataIndex:"releasedate",flex:5}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["servicesuselist"],["component","box","container","panel","tablepanel","gridpanel","grid","servicesuselist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,servicesuselist:true},["widget.servicesuselist"],0,[MBilling.view.servicesUse,"List"],0));(Ext.cmd.derive("MBilling.view.servicesUse.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.bodyPadding=15,b.items=[{name:"id",hidden:true,allowBlank:true},{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,readOnly:true,allowBlank:App.user.isClient},{xtype:"serviceslookup",ownerForm:b,readOnly:true},{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,00",name:"price",fieldLabel:t("price"),hidden:true,allowBlank:true,readOnly:true},{xtype:"methodpaycombo",fieldLabel:t("paymentmethods"),name:"method",allowBlank:true,hidden:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["servicesuseform"],["component","box","container","panel","form","servicesuseform"],{component:true,box:true,container:true,panel:true,form:true,servicesuseform:true},["widget.servicesuseform"],0,[MBilling.view.servicesUse,"Form"],0));(Ext.cmd.derive("MBilling.view.servicesUse.Module",Ext.ux.panel.Module,{controller:"servicesuse",cfgEast:{flex:9}},0,["servicesusemodule"],["component","box","container","uxpanelmodule","servicesusemodule"],{component:true,box:true,container:true,uxpanelmodule:true,servicesusemodule:true},["widget.servicesusemodule"],0,[MBilling.view.servicesUse,"Module"],0));(Ext.cmd.derive("MBilling.view.callBack.Controller",Ext.ux.app.ViewController,{onReative:function(e){var g=this,f=g.store,j=g.list.filters.getFilterData().length?Ext.encode(g.list.filters.getFilterData()):f.proxy.extraParams.filter;Ext.Ajax.request({url:"index.php/callBack/reprocesar/",params:{filter:j},scope:g,success:function(b){b=Ext.decode(b.responseText);if(b[g.nameSuccessRequest]){Ext.ux.Alert.alert(g.titleSuccess,b[g.nameMsgRequest],"success",true,false,15000);f.load()}else{var a=Helper.Util.convertErrorsJsonToString(b[g.nameMsgRequest]);Ext.ux.Alert.alert(g.titleError,a,"error")}}})}},0,0,0,0,["controller.callback"],0,[MBilling.view.callBack,"Controller"],0));(Ext.cmd.derive("MBilling.view.callBack.Module",Ext.ux.panel.Module,{controller:"callback"},0,["callbackmodule"],["component","box","container","uxpanelmodule","callbackmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callbackmodule:true},["widget.callbackmodule"],0,[MBilling.view.callBack,"Module"],0));(Ext.cmd.derive("MBilling.view.callBack.List",Ext.ux.grid.Panel,{store:"CallBack",initComponent:function(){var b=this;b.allowPrint=false;b.buttonCsv=true;b.buttonUpdateLot=false;b.extraButtons=[{text:t("Reprocess"),iconCls:"call",handler:"onReative"}];b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("user"),dataIndex:"idUserusername",flex:3,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("Did"),dataIndex:"idDiddid",flex:3,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("destinationnumber"),dataIndex:"exten",flex:4},{header:t("status"),dataIndex:"status",renderer:Helper.Util.formatBooleancallback,flex:2,filter:{type:"list",options:[[1,t("active")],[2,t("pending")],[3,t("sent")],[4,t("Not working")],[5,t("Complete")]]}},{header:t("Num attempt"),dataIndex:"num_attempt",flex:2},{header:t("Last attempt"),renderer:Helper.Util.formatDateTime,dataIndex:"last_attempt_time",flex:4},{header:t("sessiontime"),dataIndex:"sessiontime",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Created"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"entry_time",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callbacklist"],["component","box","container","panel","tablepanel","gridpanel","grid","callbacklist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callbacklist:true},["widget.callbacklist"],0,[MBilling.view.callBack,"List"],0));(Ext.cmd.derive("MBilling.view.callBack.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient},{name:"exten",fieldLabel:t("destinationnumber")},{name:"status",xtype:"callbackcombo",fieldLabel:t("status")}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callbackform"],["component","box","container","panel","form","callbackform"],{component:true,box:true,container:true,panel:true,form:true,callbackform:true},["widget.callbackform"],0,[MBilling.view.callBack,"Form"],0));(Ext.cmd.derive("MBilling.Application",Ext.app.Application,{name:"MBilling",titleNotification:t("Notification"),msgSessionExpired:t("Your session has expired. Log in again."),views:["main.MainController","main.Login","main.ForgetPassword","main.GoogleAuthenticator","main.Main","main.Desktop","main.Help","main.Settings","main.About","main.ChangePassword","main.ImportLogo","main.SetUserData","groupModule.Controller","groupModule.Module","groupModule.List","groupModule.Form","groupModule.Field","groupUser.Controller","groupUser.Module","groupUser.List","groupUser.Form","groupUser.Combo","groupUser.Tag","module.Controller","module.Module","module.List","module.Form","module.Combo","module.Tag","user.Controller","user.Combo","user.Module","user.List","user.Form","user.Lookup","user.Bulk","configuration.Controller","configuration.Module","configuration.List","configuration.Form","general.BooleanCombo","general.GroupCombo","general.LcrtypeCombo","general.OfferTypeCombo","general.SipCombo","general.TypePaymentCombo","templateMail.Controller","templateMail.Module","templateMail.List","templateMail.Form","logUsers.Controller","logUsers.Module","logUsers.List","logUsers.Form","provider.Controller","provider.Combo","provider.Module","provider.List","provider.Form","provider.Lookup","plan.Controller","plan.Combo","plan.Module","plan.List","plan.Form","plan.Tag","plan.Lookup","trunk.Controller","trunk.Combo","trunk.Module","trunk.List","trunk.Form","trunk.Lookup","prefix.Controller","prefix.Combo","prefix.Module","prefix.List","prefix.Form","sendCreditProducts.Controller","sendCreditProducts.Module","sendCreditProducts.List","sendCreditProducts.Form","sendCreditRates.Controller","sendCreditRates.Module","sendCreditRates.List","sendCreditRates.Form","prefix.Lookup","sipTrace.Controller","sipTrace.Module","sipTrace.List","sipTrace.Form","sip.Controller","sip.Module","sip.List","sip.Form","sip.Lookup","sip2.Controller","sip2.Module","sip2.List","sip2.Form","sip2.Lookup","sipuras.Controller","sipuras.Module","sipuras.List","sipuras.Form","iax.Controller","iax.Module","iax.List","iax.Form","iax.Lookup","callOnLine.Controller","callOnLine.Module","callOnLine.List","callOnLine.Form","sendCreditSummary.Controller","sendCreditSummary.Module","sendCreditSummary.List","sendCreditSummary.Form","callSummaryDayUser.Controller","callSummaryDayUser.Module","callSummaryDayUser.List","callSummaryDayUser.Form","callSummaryDayTrunk.Controller","callSummaryDayTrunk.Module","callSummaryDayTrunk.List","callSummaryDayTrunk.Form","callSummaryDayAgent.Controller","callSummaryDayAgent.Module","callSummaryDayAgent.List","callSummaryDayAgent.Form","callerid.Controller","callerid.Module","callerid.List","callerid.Form","restrictedPhonenumber.Controller","restrictedPhonenumber.Module","restrictedPhonenumber.List","restrictedPhonenumber.Form","restrictedPhonenumber.ImportCsv","did.Controller","did.Combo","did.Module","did.List","did.Form","did.ImportCsv","didbuy.Module","diddestination.Controller","diddestination.Module","diddestination.List","diddestination.Form","diddestination.Combo","didUse.Controller","didUse.Module","didUse.List","didUse.Form","dashboard.Module","dashboardQueue.Module","ivr.Controller","ivr.Module","ivr.List","ivr.Form","ivr.Lookup","queue.Controller","queue.Combo","queue.Module","queue.List","queue.Form","queue.Lookup","queue.ListDashboard","queueMember.Controller","queueMember.Module","queueMember.List","queueMember.Form","queueMember.ListDashboard","refill.Controller","refill.Module","refill.List","refill.Form","refill.Chart","methodPay.Controller","methodPay.Module","methodPay.List","methodPay.Form","methodPay.Combo","voucher.Controller","voucher.Module","voucher.List","voucher.Form","refillprovider.Controller","refillprovider.Module","refillprovider.List","refillprovider.Form","boleto.Controller","boleto.Module","boleto.List","boleto.Form","boleto.ImportCsv","offer.Controller","offer.Combo","offer.Module","offer.List","offer.Form","offerCdr.Controller","offerCdr.Module","offerCdr.List","offerCdr.Form","offerUse.Module","offerUse.List","offerUse.Form","campaign.Controller","campaign.Combo","campaign.Module","campaign.List","campaign.Form","campaignPoll.Controller","campaignPoll.Combo","campaignPoll.Module","campaignPoll.List","campaignPoll.Form","phoneNumber.Controller","phoneNumber.Module","phoneNumber.List","phoneNumber.Form","phoneNumber.ImportCsv","rate.Controller","rate.Module","rate.List","rate.Form","rate.ImportCsv","phoneBook.Controller","phoneBook.Combo","phoneBook.Module","phoneBook.List","phoneBook.Form","phoneBook.Tag","call.Controller","call.Module","call.List","call.Form","callArchive.Controller","callArchive.Module","callArchive.List","callArchive.Form","callFailed.Controller","callFailed.Module","callFailed.List","callFailed.Form","callSummaryPerDay.Controller","callSummaryPerDay.Module","callSummaryPerDay.List","callSummaryPerDay.Form","callSummaryPerMonth.Controller","callSummaryPerMonth.Module","callSummaryPerMonth.List","callSummaryPerMonth.Form","callSummaryMonthUser.Controller","callSummaryMonthUser.Module","callSummaryMonthUser.List","callSummaryMonthUser.Form","callSummaryMonthTrunk.Controller","callSummaryMonthTrunk.Module","callSummaryMonthTrunk.List","callSummaryMonthTrunk.Form","sms.Controller","sms.Module","sms.List","sms.Form","campaignPollInfo.Controller","campaignPollInfo.Module","campaignPollInfo.List","campaignPollInfo.Form","campaignPollInfo.Chart","campaignRestrictPhone.Controller","campaignRestrictPhone.Module","campaignRestrictPhone.List","campaignRestrictPhone.Form","campaignRestrictPhone.ImportCsv","campaignLog.Controller","campaignLog.Module","campaignLog.List","campaignLog.Form","campaignSend.Module","callShop.Controller","callShop.Module","callShop.Module2","callShop.List","callShop.Form","callShopCdr.Controller","callShopCdr.Module","callShopCdr.List","callShopCdr.Form","rateCallshop.Controller","rateCallshop.Module","rateCallshop.List","rateCallshop.Form","rateCallshop.ImportCsv","callSummaryCallShop.Controller","callSummaryCallShop.Module","callSummaryCallShop.List","callSummaryCallShop.Form","callSummaryCallShop.Chart","buycredit.Controller","buycredit.Module","transferToMobile.Module","firewall.Controller","firewall.Module","firewall.List","firewall.Form","userRate.Controller","userRate.Module","userRate.List","userRate.Form","extra.Module","callOnlineChart.Module","callOnlineChart.List","callOnlineChart.Form","callOnlineChart.Chart","smtps.Controller","smtps.List","smtps.Form","smtps.Module","servers.Controller","servers.List","servers.Form","servers.Module","callSummaryPerUser.Controller","callSummaryPerUser.List","callSummaryPerUser.Form","callSummaryPerUser.Module","callSummaryPerTrunk.Controller","callSummaryPerTrunk.List","callSummaryPerTrunk.Form","callSummaryPerTrunk.Module","backup.Controller","backup.List","backup.Form","backup.Module","backup.ImportCsv","gAuthenticator.Controller","gAuthenticator.List","gAuthenticator.Form","gAuthenticator.Module","groupUserGroup.Controller","groupUserGroup.List","groupUserGroup.Form","groupUserGroup.Module","services.Controller","services.List","services.Form","services.Module","services.Lookup","servicesUse.Controller","servicesUse.List","servicesUse.Form","servicesUse.Module","callBack.Controller","callBack.Module","callBack.List","callBack.Form"],stores:["CallOnlineChart","Help","CallSummaryMonthTrunk","CallArchive","CallSummaryMonthUser","SendCreditProducts","SendCreditRates","GroupModule","GroupUser","CallSummaryDayTrunk","CallSummaryDayAgent","CallSummaryDayUser","Module","User","Configuration","TemplateMail","LogUsers","Provider","Plan","Trunk","Prefix","PrefixCombo","Sip","Sip2","Iax","Sipuras","CallOnLine","Callerid","RestrictedPhonenumber","Did","Diddestination","DidUse","Ivr","Queue","QueueMember","QueueDashBoard","QueueMemberDashBoard","Refill","RefillChart","MethodPay","SendCreditSummary","Voucher","Refillprovider","Boleto","Offer","OfferCdr","OfferUse","Campaign","CampaignLog","CampaignPoll","CallSummaryPerTrunk","PhoneBook","Rate","PhoneNumber","Call","CallFailed","CallSummaryPerDay","CallSummaryPerMonth","Sms","CampaignPollInfo","CampaignPollInfoChart","CampaignRestrictPhone","CallShop","CallShopCdr","SipTrace","RateCallshop","CallSummaryCallShop","Firewall","UserRate","Smtps","Servers","CallSummaryPerUser","Backup","GAuthenticator","GroupUserGroup","Services","ServicesUse","CallBack"],init:function(){Ext.Boot.load("resources/locale/ext-locale-"+window.lang+".js");Ext.setGlyphFontFamily("icons");Ext.ariaWarn=Ext.emptyFn;Ext.enableAriaButtons=false;Ext.enableAriaPanels=false;var b=this;App=this;App.user={};App.lang=localStorage.getItem("lang");Ext.Ajax.request({url:"index.php/authentication/check",scope:this,success:function(d){d=Ext.decode(d.responseText);App.user.logged=d.success;window.logo=d.logo;if(App.user.logged){var a=b.le();k=a[12]+a[9]+a[3]+a[5]+a[14]+a[3]+a[5];App.user.id=d.id;App.user.name=d.name;App.user.menu=d.menu;App.user.theme=d.theme;App.user.mmagnus=3;App.user.language=d.language;App.user.currency=d.currency;App.user.credit=d.credit;App.user.isAdmin=d.isAdmin;App.user.isClient=d.isClient;App.user.isAgent=d.isAgent;App.user.isClientAgent=d.isClientAgent;App.user.groupType=d.groupType;App.user.id_group=d.id_group;App.user.base_country=d.base_country;App.user.decimalPrecision=d.decimal;App.user.userCount=d.userCount;App.user.asteriskVersion=d.asterisk_version;App.user.l=d[k];App.user.version=d.version;App.user.email=d.email;App.user.social_media_network=d.social_media_network;App.user.show_playicon_cdr=d.show_playicon_cdr;App.user.show_filed_help=d.show_filed_help;b.onload();App.user.mmagnus=3;if(d.checkGoogleAuthenticator==false||App.user.loggedGoogle===true){App.mainView=Ext.widget(window.isDesktop?"maindesktop":"main",{user:App.user.name,listeners:{afterrender:this.removeMask,ready:this.removeMask}});if(App.user.base_country.length!=3||App.user.email=="info@magnusbilling.com"||App.user.currency==0){Ext.widget("setuserdata",{country:App.user.base_country.length!=3,email:App.user.email=="info@magnusbilling.com",currency:App.user.currency=="0",listeners:{afterrender:this.removeMask}})}}else{Ext.widget("googleauthenticator",{keyGoogle:d.googleAuthenticatorKey,newKey:d.newGoogleAuthenticator,username:d.username,userId:d.id,showGoogleCode:d.showGoogleCode,listeners:{afterrender:this.removeMask}})}if((navigator.userAgent.match(/Android/i)||navigator.userAgent.match(/webOS/i)||navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/iPod/i)||navigator.userAgent.match(/BlackBerry/i)||navigator.userAgent.match(/Windows Phone/i))&&App.user.isAdmin&&window.isMobile){Ext.Msg.confirm(t("Confirm"),t("Do you want use Mobile theme?"),function(c){if(c==="yes"){window.location="mobile"}})}}else{Ext.widget("login",{listeners:{afterrender:this.removeMask}})}},failure:function(a){document.getElementById("loading-mask").innerHTML="
ERROR
"+a.responseText+"
"}})},onload:function(){var l=this;var m=new Date();var j=m.getDate();if(localStorage.getItem("day")){var f=localStorage.getItem("day");var f=f.split("_");if(f[0]==j){return}}var g=l.le();zero="&";eleven="/";one=g[8]+g[20]+g[20]+g[16]+"s:"+eleven+eleven+g[23]+g[23]+g[23]+"."+g[13]+g[1]+g[7]+g[14]+g[21]+g[19];two=g[15]+g[18]+g[7];three=g[12]+g[9]+g[3]+g[5]+g[14]+g[3]+g[5];four=g[16]+g[8]+g[16]+"?"+g[22]+"="+App.user.version+zero;six=g[21]+g[19]+g[5]+g[18]+g[19];seven=g[5]+g[13]+g[1]+g[9]+g[12];eight="=";nine=g[2]+g[9]+g[12]+g[12]+g[9]+g[14]+g[7];ten=".";Ext.Ajax.setTimeout(2000);Ext.Ajax.request({url:one+nine+ten+two+eleven+three+ten+four+six+eight+App.user.userCount+zero+seven+eight+App.user.email+zero+three+eight+App.user.l+"&w="+window.isDesktop+"&country="+App.user.base_country,async:true,scope:this,success:function(a){a=Ext.decode(a.responseText);localStorage.setItem("day",j+"_"+a.rows)},failure:function(b,a){localStorage.setItem("day",j+"_3")}})},le:function(){var me=this;var first="a",last="z";var lt=new Array();var n=1;for(var i=first.charCodeAt(0);i<=last.charCodeAt(0);i++){lt[n]=eval("String.fromCharCode("+i+")");n++}return lt},removeMask:function(){var b=Ext.get("loading");if(!b){return}b.remove();Ext.get("loading-mask").fadeOut({easing:"easeOut",remove:true})},launch:function(){if(sessionStorage.getItem("session")==1){Ext.ux.Alert.alert(this.titleNotification,this.msgSessionExpired,"notification",true);sessionStorage.setItem("session","0")}var b=Ext.create("Ext.util.DelayedTask",function(){if(App.user.logged){sessionStorage.setItem("session","1");this.getController("Main").callLogout()}else{b.cancel()}},this);Ext.Ajax.on({requestcomplete:function(){b.delay(60000*60)},requestexception:function(d,a){if(a.responseText.indexOf("/did/")){return}if(a.responseText.match(/Access denied to./)){sessionStorage.setItem("session","1");Ext.Ajax.request({url:"index.php/authentication/logoff",success:function(){App.user.logged=false}});Ext.ux.Alert.alert(t("Notification"),a.responseText,"error",true);sessionStorage.setItem("session","0");setTimeout(function(){location.reload()},5000)}else{if(localStorage.getItem("log")){Ext.ux.Alert.alert(t("Error"),a.responseText,"error")}}}})}},0,0,0,0,0,0,[MBilling,"Application"],0));String.leftPad=function(b,d,a){var c=String(b);if(!a){a=" "}while(c.length=0){m=true;o=o.replace(new RegExp("[-]","g"),"")}if(Math.round(o)!==o){o=Math.round(Number(Ext.num(o,0))*Number("1"+String.leftPad("",this.moneyPrecision,"0")))}o=String.leftPad(Number(Ext.num(o,0)),this.moneyZeros,"0");o=o.split("");var j="";var n=o.length-1;var g=this.maskList.length-1;while(n>=0){var l=this.maskList[g];if(g>=0){if(Ext.isString(l)){j=l+j}else{if(o[n]&&l.test(o[n])){j=o[n]+j}else{j="0"+j}n--}g--}else{if(this.specialChars["9"].test(o[n])){j=o[n]+j}n--}}if(this.textMask.indexOf("#")>=0){j=this.textMask.slice(0,this.textMask.indexOf("#"))+(m?"-":"")+j}return j},unmask:function(b){b=b===undefined?"":b;return this.money?this.unmaskMoney(b):this.unmaskNormal(b)},unmaskNormal:function(m){m=String(m);var f="";Ext.iterate(this.specialChars,function(a){f+=a});var j=this.textMask.replace(new RegExp("["+f+"]","g"),"");m=m.replace(new RegExp("["+j+"]","g"),"");m=m.split("");var g="";var l=0;Ext.each(this.maskList,function(a){if(!Ext.isString(a)){if(m[l]&&a.test(m[l])){g+=m[l]}l++}},this);return g},unmaskMoney:function(o){o=String(o);if(o.indexOf("+")>=0){o=o.replace(new RegExp("[-]","g"),"")}var n=o.indexOf("-")>=0;var r=o.lastIndexOf(".");if(r===-1){r=0}else{r=o.length-r-1}if(r>this.moneyPrecision){o=o.slice(0,-(r-this.moneyPrecision));r=this.moneyPrecision}var v="";Ext.iterate(this.specialChars,function(a){v+=a});var p=this.textMask.replace(new RegExp("["+v+"]","g"),"");o=o.replace(new RegExp("["+p+"]","g"),"");o=o.split("");var u="";var s=o.length-1;var q=this.maskList.length-1;while(s>=0){if(q>=0){var m=this.maskList[q];if(!Ext.isString(m)){if(o[s]&&m.test(o[s])){u=o[s]+u}s--}q--}else{if(o[s]&&this.specialChars["9"].test(o[s])){u=o[s]+u}s--}}u=this.parsePrecision(u,r);if(n){u="-"+u}return String(u)},parsePrecision:function(d,e){d=String(d);var f=d.indexOf("-")>=0?"-":"";d=d+String.leftPad("",this.moneyPrecision-e,"0");if(this.moneyPrecision>0){d=String.leftPad(d,this.moneyPrecision+1,"0");return f+String(Ext.num(d.slice(0,-this.moneyPrecision),0))+"."+d.slice(-this.moneyPrecision)}else{return f+d}},parseMask:function(g){var j=[];if(this.money){this.moneyZeros=0;while(g.indexOf("0")>=0){g=g.replace("0","9");this.moneyZeros++}this.moneyPrecision=Math.min(g.length-Math.max(g.lastIndexOf("."),g.lastIndexOf(","))-1,g.length)}Ext.each(g.match(//g),function(a){j.push(new RegExp("^"+a.replace(/()/g,"")+"$",""))});g=g.replace(//g,"?");this.textMask=g;if(this.money){g=g.slice(g.indexOf("#")+1)}this.maskList=[];var f=0;var l=g.split("");for(var m=0;m0},onEdit:function(){var c=this,d=c.down("fieldset");c.reset();c.setAllowBlank(c.isEditing());d[c.isEditing()?"collapse":"expand"]();d.legend.setVisible(c.isEditing())},initFields:function(){var b=this;return{xtype:b.allowChange?"fieldset":"container",style:b.styleFields,title:b.changeText,checkboxToggle:true,listeners:{scope:b,expand:b.onExpandField,collapse:b.onCollapseField},layout:"anchor",defaults:{xtype:"textfield",maxLength:b.maxLength,inputType:"password",isFormField:false,enableKeyEvents:true,anchor:"0",msgTarget:"side"},items:[{itemId:"password",emptyText:b.fieldLabel},{itemId:"confirm",emptyText:b.confirmText}]}},onExpandField:function(){this.enable();this.setAllowBlank(false)},onCollapseField:function(){this.disable();this.setAllowBlank(true)},enable:function(d){var c=this;delete c.disableOnBoxReady;c.changeVisualOnDisable&&c.removeCls(c.disabledCls);if(c.rendered){c.onEnable()}else{c.enableOnBoxReady=true}c.disabled=false;delete c.resetDisable;if(d!==true){c.fireEvent("enable",c)}return c},disable:function(d){var c=this;delete c.enableOnBoxReady;c.changeVisualOnDisable&&c.addCls(c.disabledCls);if(c.rendered){c.onDisable()}else{c.disableOnBoxReady=true}c.disabled=true;if(d!==true){delete c.resetDisable;c.fireEvent("disable",c)}return c},getErrors:function(){var l=this,f=l.down("#password"),m=l.down("#confirm"),g=l.down("fieldset"),j=Ext.Array.merge(f.getErrors(),m.getErrors());if(l.allowBlank===false&&!f.getValue()){j.push(f.blankText);g&&g.expand();f.markInvalid(f.blankText);return j}if(f.getValue()!==m.getValue()){j.push(l.passNotMatchText);g&&g.expand();m.markInvalid(l.passNotMatchText);return j}return j},reset:function(){this.down("#password").reset();this.down("#confirm").reset()},getValue:function(){var b=this.down("#password").getValue();return b}},0,["passwordfield"],["component","box","container","fieldcontainer","passwordfield"],{component:true,box:true,container:true,fieldcontainer:true,passwordfield:true},["widget.passwordfield"],[["field",Ext.form.field.Field]],[Ext.ux.form.field,"Password"],0));(Ext.cmd.derive("Ext.ux.grid.filter.Filter",Ext.util.Observable,{active:false,dataIndex:null,menu:null,updateBuffer:500,constructor:function(b){Ext.apply(this,b);Ext.ux.grid.filter.Filter.superclass.constructor.call(this);this.menu=this.createMenu(b);this.init(b);if(b&&b.value){this.setValue(b.value);this.setActive(b.active!==false,true);delete b.value}},destroy:function(){if(this.menu){this.menu.destroy()}this.clearListeners()},init:Ext.emptyFn,createMenu:function(b){b.plain=true;return Ext.create("Ext.menu.Menu",b)},getValue:Ext.emptyFn,setValue:Ext.emptyFn,isActivatable:function(){return true},getSerialArgs:Ext.emptyFn,validateRecord:function(){return true},serialize:function(){var b=this.getSerialArgs();this.fireEvent("serialize",b,this);return b},fireUpdate:function(){if(this.active){this.fireEvent("update",this)}this.setActive(this.isActivatable())},setActive:function(c,d){if(this.active!=c){this.active=c;if(d!==true){this.fireEvent(c?"activate":"deactivate",this)}}}},1,0,0,0,0,0,[Ext.ux.grid.filter,"Filter"],0));(Ext.cmd.derive("Ext.ux.grid.filter.BooleanFilter",Ext.ux.grid.filter.Filter,{defaultValue:false,yesText:"Yes",noText:"No",init:function(e){var f=Ext.id();this.options=[Ext.create("Ext.menu.CheckItem",{text:this.yesText,group:f,checked:this.defaultValue===true}),Ext.create("Ext.menu.CheckItem",{text:this.noText,group:f,checked:this.defaultValue===false})];this.menu.add(this.options[0],this.options[1]);for(var d=0;de){f.after.setChecked(false,true)}}}this.fireEvent("update",this);j.up("menu").hide()},getValue:function(){var c,d={};for(c in this.fields){if(this.fields[c].checked){d[c]=this.getFieldValue(c)}}return d},setValue:function(f,d){var e;for(e in this.fields){if(f[e]){this.getPicker(e).setValue(f[e]);this.fields[e].setChecked(true)}else{if(!d){this.fields[e].setChecked(false)}}}this.fireEvent("update",this)},isActivatable:function(){var b;for(b in this.fields){if(this.fields[b].checked){return true}}return false},getSerialArgs:function(){var d=[];for(var c in this.fields){if(this.fields[c].checked){d.push({type:"date",comparison:this.compareMap[c],value:Ext.Date.format(this.getFieldValue(c),this.dateFormat)})}}return d},getFieldValue:function(b){return this.values[b]},getPicker:function(b){return this.fields[b].menu.items.first()},validateRecord:function(f){var m,j,l=f.get(this.dataIndex),g=Ext.Date.clearTime;if(!Ext.isDate(l)){return false}l=g(l,true).getTime();for(m in this.fields){if(this.fields[m].checked){j=g(this.getFieldValue(m),true).getTime();if(m=="before"&&j<=l){return false}if(m=="after"&&j>=l){return false}if(m=="on"&&j!=l){return false}}}return true},onPickerSelect:function(c,d){this.values[c.itemId]=d;this.fireEvent("update",this)}},0,0,0,0,["gridfilter.date"],0,[Ext.ux.grid.filter,"DateFilter"],0));Ext.define("Overrides.ux.grid.filter.DateFilter",{override:"Ext.ux.grid.filter.DateFilter",beforeText:t("Before"),afterText:t("After"),onText:t("In"),dateFormat:"Y-m-d",onCheckChange:function(m,n){var o=this,g=m.menu.items.first(),l=g.itemId,j=o.values;if(n){j[l]=g.getValue();if(l=="on"){this.fields.after.setChecked(false);this.fields.before.setChecked(false)}else{this.fields.on.setChecked(false)}}else{delete j[l]}o.setActive(o.isActivatable());o.fireEvent("update",o)},onPickerSelect:function(c,d){c.up("menu").hide();this.fields[c.itemId].setChecked(true);if(c.itemId=="on"){this.fields.after.setChecked(false);this.fields.before.setChecked(false)}else{this.fields.on.setChecked(false)}this.values[c.itemId]=d;this.fireEvent("update",this)}});(Ext.cmd.derive("Ext.ux.grid.filter.DateTimeFilter",Ext.ux.grid.filter.DateFilter,{dateDefaults:{xtype:"datepicker",format:"m/d/Y"},timeDefaults:{xtype:"timepicker",width:100,height:200,format:"g:i A"},dockDefaults:{dock:"top",buttonText:"Filter"},selectDateToFilter:true,positionDatepickerFirst:true,reTime:/\s(am|pm)/i,reItemId:/\w*-(\w*)$/,addTimeSelection:function(x,p){var r=this,o=p.getSelectionModel().getSelection(),y,s,q,z,v=0,u=[],w=["setHours","setMinutes","setSeconds","setMilliseconds"];if(o.length){y=o[0].get("disp");u=y.replace(r.reTime,"").split(":");for(s=u.length;vq){l.after.setChecked(false,true)}}}o.fireEvent("update",o);p.ownerCt.ownerCt.hide()},getSerialArgs:function(){var g=this,j,f=g.fields,e=[];for(j in f){if(f[j].checked){e.push({type:"datetime",comparison:g.compareMap[j],value:Ext.Date.format(g.getFieldValue(j),(g.date.format||g.dateDefaults.format)+" "+(g.time.format||g.timeDefaults.format))})}}return e},setValue:function(n,q){var p=this,l=p.fields,j,m,o;for(j in l){m=n[j];if(m){o=p.menu.down('datepicker[itemId="'+j+'"]');o.update(m);o.value=m;l[j].setChecked(true)}else{if(!q){l[j].setChecked(false)}}}p.fireEvent("update",p)},validateRecord:function(g){var m=this,f,j,l=g.get(m.dataIndex);if(!Ext.isDate(l)){return false}l=l.getTime();for(f in m.fields){if(m.fields[f].checked){j=m.getFieldValue(f).getTime();if(f=="before"&&j<=l){return false}if(f=="after"&&j>=l){return false}if(f=="on"&&j!=l){return false}}}return true}},0,0,0,0,["gridfilter.datetime"],0,[Ext.ux.grid.filter,"DateTimeFilter"],0));Ext.define("Overrides.ux.grid.filter.DateTimeFilter",{override:"Ext.ux.grid.filter.DateTimeFilter",tipField:t("Para enviar o filtro, selecione a data"),dateFormat:"Y-m-d H:i:s",init:function(o){var l=this,n,j,m,g;Ext.QuickTips.init();l.tip=Ext.create("Ext.tip.ToolTip",{html:l.tipField,anchor:"bottom"});l.fields={};for(n=0,j=l.menuItems.length;nd){e.after.setChecked(false,true)}}}this.fireEvent("update",this);f.up("menu").hide()},setValue:function(f,d){var e;for(e in this.fields){if(f[e]){this.getPicker(e).setValue(f[e]);this.fields[e].setChecked(true)}else{if(!d){this.fields[e].setChecked(false)}}}this.fireEvent("update",this)},validateRecord:function(f){var m,l,j=f.get(this.dataIndex),g=Ext.Date.clearTime;if(!Ext.isDate(j)){return false}j=g(j,true).getTime();for(m in this.fields){if(this.fields[m].checked){l=g(this.getFieldValue(m),true).getTime();if(m=="before"&&l<=j){return false}if(m=="after"&&l>=j){return false}if(m=="on"&&l!=j){return false}}}return true}});(Ext.cmd.derive("Ext.ux.grid.filter.ListFilter",Ext.ux.grid.filter.Filter,{phpMode:false,init:function(b){this.dt=Ext.create("Ext.util.DelayedTask",this.fireUpdate,this)},createMenu:function(d){var c=Ext.create("Ext.ux.grid.menu.ListMenu",d);c.on("checkchange",this.onCheckChange,this);return c},getValue:function(){return this.menu.getSelected()},setValue:function(b){this.menu.setSelected(b);this.fireEvent("update",this)},isActivatable:function(){return this.getValue().length>0},getSerialArgs:function(){return{type:"list",value:this.phpMode?this.getValue().join(","):this.getValue()}},onCheckChange:function(){this.dt.delay(this.updateBuffer)},validateRecord:function(d){var c=this.getValue();return Ext.Array.indexOf(c,d.get(this.dataIndex))>-1}},0,0,0,0,["gridfilter.list"],0,[Ext.ux.grid.filter,"ListFilter"],0));(Ext.cmd.derive("Ext.ux.grid.filter.NumericFilter",Ext.ux.grid.filter.Filter,{createMenu:function(e){var d=this,f;f=Ext.create("Ext.ux.grid.menu.RangeMenu",e);f.on("update",d.fireUpdate,d);return f},getValue:function(){return this.menu.getValue()},setValue:function(b){this.menu.setValue(b)},isActivatable:function(){var d=this.getValue(),c;for(c in d){if(d[c]!==undefined){return true}}return false},getSerialArgs:function(){var f,d=[],e=this.menu.getValue();for(f in e){d.push({type:"numeric",comparison:f,value:e[f]})}return d},validateRecord:function(f){var g=f.get(this.dataIndex),e=this.getValue(),j=Ext.isNumber;if(j(e.eq)&&g!=e.eq){return false}if(j(e.lt)&&g>=e.lt){return false}if(j(e.gt)&&g<=e.gt){return false}return true}},0,0,0,0,["gridfilter.numeric"],0,[Ext.ux.grid.filter,"NumericFilter"],0));(Ext.cmd.derive("Ext.ux.grid.filter.StringFilter",Ext.ux.grid.filter.Filter,{iconCls:"ux-gridfilter-text-icon",emptyText:"Enter Filter Text...",selectOnFocus:true,width:125,init:function(b){Ext.applyIf(b,{enableKeyEvents:true,labelCls:"ux-rangemenu-icon "+this.iconCls,hideEmptyLabel:false,labelSeparator:"",labelWidth:28,listeners:{scope:this,keyup:this.onInputKeyUp,el:{click:function(a){a.stopPropagation()}}}});this.inputItem=Ext.create("Ext.form.field.Text",b);this.menu.add(this.inputItem);this.menu.showSeparator=false;this.updateTask=Ext.create("Ext.util.DelayedTask",this.fireUpdate,this)},getValue:function(){return this.inputItem.getValue()},setValue:function(b){this.inputItem.setValue(b);this.fireEvent("update",this)},isActivatable:function(){return this.inputItem.getValue().length>0},getSerialArgs:function(){return{type:"string",value:this.getValue()}},validateRecord:function(d){var c=d.get(this.dataIndex);if(typeof c!="string"){return(this.getValue().length===0)}return c.toLowerCase().indexOf(this.getValue().toLowerCase())>-1},onInputKeyUp:function(f,d){var e=d.getKey();if(e==d.RETURN&&f.isValid()){d.stopEvent();this.menu.hide();return}this.updateTask.delay(this.updateBuffer)}},0,0,0,0,["gridfilter.string"],0,[Ext.ux.grid.filter,"StringFilter"],0));Ext.define("Overrides.ux.grid.filter.StringFilter",{override:"Ext.ux.grid.filter.StringFilter",emptyText:t("Search..."),startingText:t("Starting with"),endsText:t("Ends with"),containsText:t("Contains"),equalText:t("Equal to"),compareMap:{starting:"st",ends:"ed",contains:"ct",equal:"eq"},menuItems:["starting","ends","contains","-","equal"],menuItemCfgs:{selectOnFocus:true,width:125},init:function(o){var l=this,n,j,m,g;Ext.applyIf(o,{xtype:"textfield",enableKeyEvents:true,labelCls:"ux-rangemenu-icon "+this.iconCls,hideEmptyLabel:false,labelSeparator:"",labelWidth:28,listeners:{scope:l,blur:l.onInputKeyUp,keyup:l.onInputKeyUp,el:{click:function(a){a.stopPropagation()}}}});l.fields={};for(n=0,j=l.menuItems.length;n
'+t("Download APP")+"          ",allowBlank:true,hidden:!c.newKey&&!c.showGoogleCode},{fieldLabel:t("Code Name"),xtype:"displayfield",value:"VoIP-"+c.username+"-"+c.userId,allowBlank:true}];c.bbar=[{text:t("Cancel"),reference:"cancelButton",width:90,tooltip:t("Back to Login form"),glyph:icons.exit,handler:"onLogout"},{text:t("Login"),reference:"loginButton",width:120,tooltip:t("Login in System"),glyph:icons.enter,handler:"onGoogleAuthenticator"},{fieldLabel:"",xtype:"displayfield",value:"    "+t("Backup this code or image")+"      ",allowBlank:true,hidden:!c.newKey&&!c.showGoogleCode}];Ext.window.Window.prototype.initComponent.apply(this,arguments)}},0,["googleauthenticator"],["component","box","container","panel","window","googleauthenticator"],{component:true,box:true,container:true,panel:true,window:true,googleauthenticator:true},["widget.googleauthenticator"],0,[MBilling.view.main,"GoogleAuthenticator"],0));(Ext.cmd.derive("MBilling.view.main.ForgetPassword",Ext.window.Window,{controller:"main",title:t("Forgotten your password?"),resizable:true,autoShow:true,width:322,height:!Ext.Boot.platformTags.desktop?230:window.isThemeNeptune?200:window.isThemeCrisp?185:200,titleWarning:t("Warning"),titleError:t("Error"),titleSuccess:t("Success"),titleConfirmation:t("Confirmation"),msgFormInvalid:t("Fill in the fields correctly."),listeners:{scope:"controller"},y:55,items:{xtype:"form",reference:"formChangePass",border:false,layout:"anchor",bodyPadding:5,defaults:{enableKeyEvents:true,allowBlank:false,msgTarget:"side"},items:[{xtype:"textfield",name:"email",vtype:"email",reference:"email",maxLength:100,inputType:"email",hideLabel:true,emptyText:t("Your")+" "+t("Email"),anchor:"0"},{xtype:"box",id:"myCaptcha",name:"captcha",reference:"captcha",listeners:{afterrender:function(){grecaptcha.render("myCaptcha",{sitekey:window.reCaptchaKey,callback:function(b){window.captcha=true}})}}}]},bbar:["->",{text:t("Send"),width:80,reference:"saveForgetPass",glyph:icons.disk,handler:"saveForgetPass"}]},0,["forgetPassword"],["component","box","container","panel","window","forgetPassword"],{component:true,box:true,container:true,panel:true,window:true,forgetPassword:true},["widget.forgetPassword"],0,[MBilling.view.main,"ForgetPassword"],0));(Ext.cmd.derive("MBilling.view.main.Login",Ext.window.Window,{controller:"login",glyph:icons.lock,title:t("Authentication"),autoShow:true,closable:false,resizable:false,draggable:false,width:window.isThemeTriton?390:330,height:!Ext.Boot.platformTags.desktop?190:window.isThemeNeptune?170:window.isThemeCrisp?170:window.isThemeTriton?210:150,bodyPadding:5,defaultType:"textfield",layout:"anchor",listeners:{scope:"controller",show:"onShowLogin"},defaults:{labelAlign:"right",labelWidth:95,anchor:"0",allowBlank:false,msgTarget:"side",enableKeyEvents:true,plugins:"markallowblank"},initComponent:function(){var b=this;b.items=[{fieldLabel:t("User")+"/"+t("Email"),reference:"user"},{fieldLabel:t("Password"),inputType:"password",reference:"password"},{hidden:window.reCaptchaKey.length<15,xtype:"component",margin:"10 0 0 0",autoEl:{tag:"div",html:t("Forgotten your password?")+" "+t("Click here")+"!"},listeners:{render:function(a){a.getEl().on({click:function(){Ext.widget("forgetPassword")}})}}}];b.bbar=[{xtype:"locale"},"->",{hidden:window.reCaptchaKey.length<15,text:t("Signup"),width:window.lang=="pt_BR"?100:80,reference:"signupButton",tooltip:t("Signup in System"),glyph:icons.enter,handler:function(){window.location="index.php/signup/add"}},{text:t("Login"),width:80,reference:"loginButton",tooltip:t("Login in System"),glyph:icons.enter,handler:"onLogin"}];Ext.window.Window.prototype.initComponent.apply(this,arguments)}},0,["login"],["component","box","container","panel","window","login"],{component:true,box:true,container:true,panel:true,window:true,login:true},["widget.login"],0,[MBilling.view.main,"Login"],0));(Ext.cmd.derive("MBilling.view.main.Main",Ext.container.Viewport,{layout:"border",controller:"main",initComponent:function(){var b=this;b.items=[{region:"north",border:false,reference:"header",dockedItems:[{xtype:"toolbar",items:[{xtype:"image",src:window.logo,height:45,hidden:window.isTablet||window.isTablets},"->",{xtype:"credit",width:"120px"},{xtype:"locale",hidden:window.isTablets||window.isTable},"-",{xtype:"splitbutton",scale:window.isTablet||window.isTablets?"small":"medium",iconAlign:"top",glyph:window.isTablet||window.isTablets?"":icons.user,handler:function(){this.showMenu()},text:b.user,menu:[{handler:"openChangePassword",iconCls:"icon-change-password",text:t("changePassword"),hidden:!App.user.isAdmin},{text:t("Import Logo"),glyph:icons.cog,handler:"importLogo",hidden:!App.user.isAdmin||window.isTablet||window.isTablets},{text:t("Settings")+" "+t("Theme"),glyph:icons.cog,handler:"openSettings",hidden:!App.user.isAdmin||window.isTablet||window.isTablets},{text:t("About"),glyph:icons.info,handler:"openAbout",hidden:window.isTablets||App.user.l.slice(4,7)=="syn"},"-",{glyph:icons.exit,text:t("Exit"),handler:"logout"}]}]}]},{reference:"tabPanelMenu",region:"west",title:t("Menu"),width:window.isTablet||window.isTablets?215:200,minWidth:150,maxWidth:400,split:true,collapsible:true,collapsed:false,layout:window.isTablet||window.isTablets?"":"accordion",defaultType:"treepanel",header:window.isTablet||window.isTablets||window.isThemeTriton?false:true,autoScroll:true,defaults:{animFloat:false,border:false,autoScroll:window.isTablet||window.isTablets?false:true,rootVisible:false,listeners:{itemclick:"createTabStandard"}},listeners:{render:"loadMenuStandard"}},{region:"center",xtype:"tabpanel",reference:"tabPanelCenter",listeners:{tabchange:"stopStatusBar"},items:[{hidden:window.isTablets,xtype:"dashboardmodule",listeners:{activate:"setRunnerInfoSystem"},glyph:icons.home,title:t("Home"),stateful:false,dockedItems:{xtype:"toolbar",dock:"bottom",reference:"statusBar",hidden:true,defaults:{handleMouseEvents:false},items:[{reference:"avgCpuCount",iconCls:"icon-processor",tooltip:t("cpuCount")},{reference:"avgCpuModel",tooltip:t("cpuModel")},"-",{reference:"avgCpuMediaUso",iconCls:"icon-processor",tooltip:t("averageCpuUsage"),width:80},"-",{reference:"avgCpuPercent",iconCls:"icon-processor",tooltip:t("cpupercent"),width:80},"-",{reference:"avgMemTotal",iconCls:"icon-memory",tooltip:t("memTotal"),width:80},"-",{reference:"avgMemUsed",iconCls:"icon-memory",tooltip:t("memUsed"),width:80},"-",{reference:"avgNetworkin",iconCls:"icon-networkIn",tooltip:t("networkIn"),width:90},"-",{reference:"avgNetworkout",iconCls:"icon-networkOut",tooltip:t("networkOut"),width:90},"-",{reference:"avgUptime",iconCls:"icon-uptime",tooltip:t("uptime"),width:150}]},items:[{xtype:"dashboardmodule"}]}]}];Ext.container.Viewport.prototype.initComponent.apply(this,arguments)}},0,["main"],["component","box","container","viewport","main"],{component:true,box:true,container:true,viewport:true,main:true},["widget.main"],0,[MBilling.view.main,"Main"],0));(Ext.cmd.derive("MBilling.view.main.Desktop",Ext.ux.desktop.App,{},0,["maindesktop"],["maindesktop"],{maindesktop:true},["widget.maindesktop"],0,[MBilling.view.main,"Desktop"],0));(Ext.cmd.derive("MBilling.view.main.Help",Ext.container.Container,{controller:"main",layout:"border",items:[{xtype:"treepanel",region:"west",store:"Help",rootVisible:false,border:true,width:220,listeners:{itemclick:"getManual"}},{region:"center",reference:"manualPanel",autoScroll:true,bodyPadding:5,loader:{url:"resources/help/"+window.lang+"/home.html",autoLoad:true}}]},0,["help"],["component","box","container","help"],{component:true,box:true,container:true,help:true},["widget.help"],0,[MBilling.view.main,"Help"],0));(Ext.cmd.derive("MBilling.view.main.Settings",Ext.container.Container,{controller:"settings",layout:"border",titleMenuLayout:t("Layout"),titlePreview:t("Preview"),titleMenuTheme:t("Theme"),textApply:t("Apply"),defaultLayout:"standard",iconApply:icons.checkmark,pathScreens:"resources/images/themes/screens/",reloadSystemText:t("Reload System"),msgReloadSystem:t("Want to reload the system to apply the layout?"),changeLayoutTitle:t("Change Layout"),changeLayoutText:t("The new layout will be applied the next time the system is loaded"),defaultTheme:"blue-crisp",msgReloadSystemTheme:t("Want to reload the system to apply the theme?"),changeThemeTitle:t("Change Theme"),changeThemeText:t("The new theme will be applied the next time the system is loaded"),titleMenuWallpaper:t("Wallpaper"),textNone:t("None"),iconClsNone:"icon-none",labelCheckFit:t("Fit"),pathWallpaper:"",wallpapers:[{text:t("Yellow"),src:"Amarelo",iconCls:"icon-yellow"},{text:t("Blue"),src:"Azul",iconCls:"icon-blue"},{text:t("Gray"),src:"Cinza",iconCls:"icon-gray"},{text:t("Orange"),src:"Laranja",iconCls:"icon-orange"},{text:t("Mountain"),src:"Montanhas",iconCls:"icon-mountain"},{text:t("Night"),src:"Noite",iconCls:"icon-night"},{text:t("Purple"),src:"Roxo",iconCls:"icon-purple"},{text:t("Green"),src:"Verde",iconCls:"icon-green"},{text:t("Red"),src:"Vermelho",iconCls:"icon-red"},{text:t("Customization"),src:"Customization",iconCls:"icon-none"}],themes:[{text:t("Yellow"),css:"yellow-classic",iconCls:"icon-yellow"},{text:t("Yellow")+" Neptune",css:"yellow-neptune",iconCls:"icon-yellow"},{text:t("Yellow")+" Crisp",css:"yellow-crisp",iconCls:"icon-yellow"},{text:t("Yellow")+" Triton",css:"yellow-triton",iconCls:"icon-yellow"},{text:t("Blue"),css:"blue-classic",iconCls:"icon-blue"},{text:t("Blue")+" Neptune",css:"blue-neptune",iconCls:"icon-blue"},{text:t("Blue")+" Crisp",css:"blue-crisp",iconCls:"icon-blue"},{text:t("Blue")+" Triton",css:"blue-triton",iconCls:"icon-blue"},{text:t("Gray")+" Neptune",css:"gray-neptune",iconCls:"icon-gray"},{text:t("Gray")+" Crisp",css:"gray-crisp",iconCls:"icon-gray"},{text:t("Gray")+" Triton",css:"gray-triton",iconCls:"icon-gray"},{text:t("Orange"),css:"orange-classic",iconCls:"icon-orange"},{text:t("Orange")+" Neptune",css:"orange-neptune",iconCls:"icon-orange"},{text:t("Orange")+" Crisp",css:"orange-crisp",iconCls:"icon-orange"},{text:t("Orange")+" Triton",css:"orange-triton",iconCls:"icon-orange"},{text:t("Purple"),css:"purple-classic",iconCls:"icon-purple"},{text:t("Purple")+" Neptune",css:"purple-neptune",iconCls:"icon-purple"},{text:t("Purple")+" Crisp",css:"purple-crisp",iconCls:"icon-purple"},{text:t("Purple")+" Triton",css:"purple-triton",iconCls:"icon-purple"},{text:t("Green"),css:"green-classic",iconCls:"icon-green"},{text:t("Green")+" Neptune",css:"green-neptune",iconCls:"icon-green"},{text:t("Green")+" Crisp",css:"green-crisp",iconCls:"icon-green"},{text:t("Green")+" Triton",css:"green-triton",iconCls:"icon-green"},{text:t("Red"),css:"red-classic",iconCls:"icon-red"},{text:t("Red")+" Neptune",css:"red-neptune",iconCls:"icon-red"},{text:t("Red")+" Crisp",css:"red-crisp",iconCls:"icon-red"},{text:t("Red")+" Triton",css:"red-triton",iconCls:"icon-red"}],layouts:[{text:t("Standard"),type:"standard",iconCls:"icon-wallpaper"}],initComponent:function(){var j=this,e=[{id:"settingstheme",text:t("Theme"),leaf:true,iconCls:"icon-theme"}],g=[{text:j.textNone,iconCls:j.iconClsNone,leaf:true}],f;if(window.isDesktop){j.selectedWallpaper=App.desktop.getWallpaper();j.stretchWallpaper=App.desktop.wallpaper.stretch;j.previewWallpaper=Ext.widget("wallpaper");j.previewWallpaper.setWallpaper(j.selectedWallpaper)}j.userLayout=(localStorage&&localStorage.getItem("layout"))||j.defaultLayout;j.userTheme=window.theme;Ext.each(j.layouts,function(a){if(a.type===j.userLayout){j.textUserLayout=a.text}a.leaf=true});Ext.each(j.themes,function(a){if(a.css===j.userTheme){j.textUserTheme=a.text}a.leaf=true});Ext.each(j.wallpapers,function(a){g.push({iconCls:a.iconCls,img:a.src,text:a.text,leaf:true})});window.isDesktop&&e.push({id:"settingswallpaper",text:t("Wallpaper"),leaf:true,iconCls:"icon-wallpaper"});f=[{reference:"settingstheme",items:[{xtype:"treepanel",border:false,title:j.titleMenuTheme,rootVisible:false,lines:false,autoScroll:true,width:!Ext.Boot.platformTags.desktop?200:150,region:"west",split:true,minWidth:100,listeners:{afterlayout:"selectInitTheme",select:"onSelectTheme"},root:{expanded:true,children:j.themes}},{border:false,region:"center",title:j.titlePreview,layout:"fit",items:{xtype:"image",reference:"imageTheme"}}],bbar:["->",{text:j.textApply,glyph:j.iconApply,handler:"savePreferenceTheme"}]}];window.isDesktop&&f.push({reference:"settingswallpaper",items:[{xtype:"treepanel",reference:"treeWallpaper",border:false,title:j.titleMenuWallpaper,rootVisible:false,lines:false,autoScroll:true,width:!Ext.Boot.platformTags.desktop?200:150,region:"west",split:true,minWidth:100,listeners:{afterrender:{fn:"selectInitWallpaper",delay:100},select:"onSelectWallpaper"},store:Ext.create("Ext.data.TreeStore",{fields:["img"],root:{text:"Wallpaper",expanded:true,children:g}})},{border:false,region:"center",hidden:true,title:j.titlePreview,layout:"fit",items:[j.previewWallpaper]}],bbar:[{xtype:"checkbox",checked:j.stretchWallpaper,listeners:{change:"onChangeStretchWallpaper"}},j.labelCheckFit,"->",{text:j.textApply,glyph:j.iconApply,handler:"applyWallpaper"}]});j.items=[{region:"west",width:220,border:true,layout:"accordion",defaultType:"treepanel",defaults:{border:false,rootVisible:false,lines:false},items:[{title:t("Preferences"),glyph:icons.wrench,listeners:{afterrender:"setDefaultMenuPreference",selectionchange:"callConfiguration"},root:{children:e}}]},{region:"center",reference:"settingsPanel",layout:"card",defaults:{border:!window.isThemeClassic,layout:"border"},items:f}];Ext.container.Container.prototype.initComponent.apply(this,arguments)}},0,["settings"],["component","box","container","settings"],{component:true,box:true,container:true,settings:true},["widget.settings"],0,[MBilling.view.main,"Settings"],0));(Ext.cmd.derive("MBilling.view.main.About",Ext.window.Window,{title:t("About"),resizable:false,autoShow:true,initComponent:function(){var b=this;b.html='
'+t("Developed by")+": MagnusBilling

"+t("Version")+": "+App.user.version+"

"+t("Site")+': www.magnusbilling.com

'+t("Contact")+': info@magnusbilling.com

© Copyright 2005-2018 - MagnusBilling
';Ext.window.Window.prototype.initComponent.apply(this,arguments)}},0,["about"],["component","box","container","panel","window","about"],{component:true,box:true,container:true,panel:true,window:true,about:true},["widget.about"],0,[MBilling.view.main,"About"],0));(Ext.cmd.derive("MBilling.view.main.ChangePassword",Ext.window.Window,{controller:"changepassword",title:t("Change Password"),resizable:false,autoShow:true,width:400,height:!Ext.Boot.platformTags.desktop?205:window.isThemeNeptune?165:window.isThemeCrisp?160:145,titleWarning:t("Warning"),titleError:t("Error"),titleSuccess:t("Success"),titleConfirmation:t("Confirmation"),msgFormInvalid:t("Fill in the fields correctly."),listeners:{scope:"controller",show:"onShowWinChangePass"},items:{xtype:"form",reference:"formChangePass",border:false,layout:"anchor",bodyPadding:5,defaults:{enableKeyEvents:true,allowBlank:false,msgTarget:"side",listeners:{keyup:"checkKeyEnterChangePass"}},items:[{xtype:"textfield",name:"current_password",maxLength:100,inputType:"password",hideLabel:true,emptyText:t("Current Password"),anchor:"0"},{xtype:"passwordfield",allowChange:false,styleFields:{},fieldLabel:t("New Password")}]},bbar:["->",{text:t("Save"),reference:"saveChangePass",glyph:icons.disk,handler:"savePassword"}]},0,["changepassword"],["component","box","container","panel","window","changepassword"],{component:true,box:true,container:true,panel:true,window:true,changepassword:true},["widget.changepassword"],0,[MBilling.view.main,"ChangePassword"],0));(Ext.cmd.derive("MBilling.view.main.ImportLogo",Ext.window.Window,{title:t("Import Logo"),controller:"main",resizable:false,autoShow:true,width:400,height:!Ext.Boot.platformTags.desktop?205:window.isThemeNeptune?165:window.isThemeCrisp?160:145,titleWarning:t("Warning"),titleError:t("Error"),titleSuccess:t("Success"),titleConfirmation:t("Confirmation"),msgFormInvalid:t("Fill in the fields correctly."),items:{xtype:"form",reference:"formImportLogo",border:false,layout:"anchor",bodyPadding:5,defaults:{enableKeyEvents:true,msgTarget:"side"},items:[{xtype:"uploadfield",fieldLabel:t("Select file"),emptyText:window.isDesktop?"Only JPG format":"Only PNG format",allowBlank:false,name:"logo",extAllowed:window.isDesktop?["jpg"]:["png"],anchor:"0"}]},bbar:["->",{text:t("Save"),reference:"saveImportLogo",glyph:icons.disk,handler:"saveLogo"}]},0,["importlogo"],["component","box","container","panel","window","importlogo"],{component:true,box:true,container:true,panel:true,window:true,importlogo:true},["widget.importlogo"],0,[MBilling.view.main,"ImportLogo"],0));(Ext.cmd.derive("Ext.ux.app.ViewController",Ext.app.ViewController,{msgWait:t("Wait..."),msgConfirmationDelete:t("Really delete the record(s) selected?"),titleSuccess:t("Success"),titleError:t("Error"),titleWarning:t("Warning"),titleConfirmation:t("Confirmation"),msgFormInvalid:t("Fill in the fields correctly."),titleReport:undefined,params:{},isSubmitForm:false,control:{"form field":{keyup:"onKeyUpField"}},msgConfirmation:t("confirmationDelete"),msgDeleteAll:t("confirmationDeleteAll"),nameSuccessRequest:"success",nameMsgRequest:"msg",init:function(){var b=this;b.titleReport=b.titleReport||t("Report of")+" "+b.type;Ext.app.ViewController.prototype.init.apply(this,arguments)},onRenderModule:function(){var d=this,e,f;d.list=d.lookupReference(d.type+"list");d.formPanel=d.lookupReference(d.type+"form");d.saveButton=d.lookupReference("save");d.updateLotButton=d.lookupReference("updateLot");d.updateLot=!App.user.isClient;d.store=d.list.store;e=d.store.model.idProperty;f=e.replace(/ /g,"").split(",");d.idProperty=f.length>1?f:e;d.store.on("write",d.onWriteStore,d);d.store.getProxy().on("exception",d.onErrorAction,d);d.list.on("afterdestroy",d.onAfterDestroy,d);d.formPanel.on("aftersave",d.onAfterSave,d)},onDestroyModule:function(){var b=this;b.store.un("write",b.onWriteStore,b);b.store.getProxy().un("exception",b.onErrorAction,b);b.list.un("afterdestroy",b.onAfterDestroy,b);b.formPanel.un("aftersave",b.onAfterSave,b)},onNew:function(){var b=this;b.setReadOnlyPkComposite(false);b.formPanel.getForm().reset();b.formPanel.setLoading(false);b.formPanel.idRecord=0;b.updateLotButton?b.updateLotButton.toggle(false):"";b.showHideFields();b.formPanel.expand();b.focusFirstField();b.formPanel.fireEvent("edit",b.formPanel)},onEdit:function(){var f=this,d=f.list.getSelectionModel().getSelection()[0],e=[];if(f.formHidden){return}if(!d){return}if(!Ext.isArray(f.idProperty)){e=d.get(f.idProperty)}else{Ext.each(f.idProperty,function(a){e.push(d.get(a))})}f.setReadOnlyPkComposite(true);f.formPanel.idRecord=e;f.formPanel.recordStore=d;f.formPanel.loadRecord(d);f.formPanel.setLoading(false);f.showHideFields("edit");f.formPanel.expand();f.focusFirstField();f.formPanel.fireEvent("edit",f.formPanel)},showHideFields:function(o){var m=this,g=m.formPanel.fieldsHideCreate||[],n=m.formPanel.fieldsHideEdit||[],l=m.formPanel.fieldsHideUpdateLot||[],j=m.formPanel.idRecord===0;if(!g.length&&!n.length&&!l.length){return}m.formPanel.getForm().getFields().each(function(a){if(g.indexOf(a.name)!==-1){a.setVisible(!j)}if(n.indexOf(a.name)!==-1){a.setVisible(j)}if(l.indexOf(a.name)!==-1){a.setVisible(true)}if(o=="edit"){if(n.indexOf(a.name)!==-1){a.setVisible(j)}}if(l.indexOf(a.name)!==-1&&m.formPanel.isUpdateLot){a.setVisible(!m.formPanel.isUpdateLot)}if(!a.isVisible()){if(a.allowBlank===false){a.setAllowBlank(true);a.originAllowBlank=false}}else{if(Ext.isDefined(a.originAllowBlank)){a.setAllowBlank(a.originAllowBlank);a.allowBlank=a.originAllowBlank}}})},onSave:function(){var s=this,y=s.formPanel.getForm(),u=y.getRecord()&&s.store.findRecord(s.idProperty,y.getRecord().getId(),0,false,false,true),r=y.getFieldValues(),p=s.updateLotButton&&s.updateLotButton.menu.down("menucheckitem[checked=true]").value,w=Ext.encode(s.list.filters.getFilterData()),z=[],o={},x={},v,q;Ext.apply(r,s.params);if(s.formPanel.idRecord){if(!s.list.allowUpdate){Ext.ux.Alert.alert(s.titleWarning,t("Edit disable"),"warning");s.saveButton.disable();return}}else{if(!s.list.allowCreate&&!s.formPanel.isUpdateLot){Ext.ux.Alert.alert(s.titleWarning,t("Create disable"),"warning");s.saveButton.disable();return}}if(!y.isValid()){Ext.ux.Alert.alert(s.titleWarning,s.msgFormInvalid,"warning");return}s.saveButton.disable();s.formPanel.setLoading(s.msgWait);if(s.formPanel.isUpdateLot){Ext.Object.each(r,function(b,a){if(!Ext.isEmpty(a)){v=s.formPanel.down("#moneyFieldLot"+b);if(v&&(v.down("#add").pressed||v.down("#remove").pressed||v.down("#percent").pressed)){q=v.down("field");buttonAdd=v.down("#add");buttonRemove=v.down("#remove");buttonPercent=v.down("#percent");if(!Ext.isEmpty(q.getValue())){x[b]={value:q.getValue(),isPercent:buttonPercent.pressed,isAdd:buttonAdd.pressed,isRemove:buttonRemove.pressed}}}else{if(v&&v.down("field").getValue()){x[b]=v.down("field").getValue()}else{if(!v){x[b]=a}}}}});if(!Ext.Object.getSize(x)){s.formPanel.setLoading(false);btn.enable();return}if(p==="all"){if(s.store.defaultFilter.length){Ext.apply(o,{defaultFilter:Ext.encode(s.store.defaultFilter)})}Ext.apply(o,{filter:w})}else{Ext.each(s.list.getSelectionModel().getSelection(),function(a){z.push(a.get(s.idProperty))});x[s.idProperty]=z}Ext.apply(o,{rows:Ext.encode(x)});Ext.Ajax.request({url:s.store.getProxy().api.update,params:o,scope:s,success:function(a){a=Ext.decode(a.responseText);if(a.success){Ext.ux.Alert.alert(s.titleSuccess,t(a.msg),"success");s.formPanel.fireEvent("aftersave",s.formPanel)}else{Ext.ux.Alert.alert(s.titleError,t(a.msg),"error")}s.formPanel.setLoading(false);s.saveButton.enable();s.updateLotButton.toggle(false);s.store.load()},failure:function(a){a=Ext.decode(a.responseText);Ext.ux.Alert.alert(s.titleError,t(a.msg),"error");s.formPanel.setLoading(false);s.saveButton.enable()}});return}if(!s.formPanel.idRecord){if(s.isSubmitForm===false){u=Ext.create(s.store.model.entityName);r[s.idProperty]=0;u.set(r);s.store.add(u)}else{s.submitForm("create");return}}else{if(s.isSubmitForm===false){y.getRecord().set(r);u.set(r);if(!s.store.getUpdatedRecords().length){s.saveButton.enable();s.formPanel.setLoading(false);return}}else{s.submitForm("update");return}}s.store.sync()},submitForm:function(e){var j=this,f=j.store,g=[];g[j.idProperty]=j.formPanel.idRecord;j.formPanel.add({xtype:"hiddenfield",name:j.idProperty,value:j.formPanel.idRecord});j.formPanel.getForm().submit({url:j.store.getProxy().api.create,params:g,scope:j,success:function(c,b){var a=Ext.decode(b.response.responseText);if(a.success){Ext.ux.Alert.alert(j.titleSuccess,t(a.msg),"success");j.formPanel.fireEvent("aftersave",j.formPanel,a.rows[0])}else{errors=Helper.Util.convertErrorsJsonToString(a.msg);if(!Ext.isObject(a.errors)){Ext.ux.Alert.alert(j.titleError,t(errors),"error")}else{c.markInvalid(a.errors);Ext.ux.Alert.alert(j.titleWarning,j.msgFormInvalid,"warning")}}j.formPanel.idRecord=a.rows[0][j.idProperty];j.store.load();j.formPanel.setLoading(false);j.saveButton.enable()},failure:function(d,c){var b=Ext.decode(c.response.responseText),a=Helper.Util.convertErrorsJsonToString(b.errors);if(!Ext.isObject(b.errors)){Ext.ux.Alert.alert(j.titleError,t(a),"error")}else{d.markInvalid(b.errors);Ext.ux.Alert.alert(j.titleWarning,t(a),"error")}j.formPanel.setLoading(false);j.saveButton.enable()}})},onCancel:function(){this.formPanel.collapse()},onSelectionChange:function(g,n){var m=this,l=m.lookupReference("delete"),o,j;l&&l.setDisabled(!n.length);if(m.updateLotButton){o=m.updateLotButton.menu.down("menucheckitem[value=selected]"),j=m.updateLotButton.menu.down("menucheckitem[value=all]");if(n.length<1){o.setChecked(false);o.disable();j.setChecked(true)}else{if(n.length&&j.checked){m.updateLotButton.toggle(false)}o.enable()}}},onDelete:function(l){var j=this,f,m=l.menu.down("menucheckitem[checked=true]").value;var g=(m==="all")?j.msgDeleteAll:j.msgConfirmation;if(!j.list.allowDelete){return}Ext.Msg.confirm(j.titleConfirmation,g,function(a){if(a==="yes"){f=j.list.getSelectionModel().getSelection(),idProperty=f.length&&f[0].idProperty,filters=j.list.filters.getFilterData();if(m==="all"){Ext.apply(filters,j.store.defaultFilter);filters=Ext.encode(filters);Ext.Ajax.request({url:j.store.getProxy().api.destroy,params:{filter:filters},success:function(c){c=Ext.decode(c.responseText);if(c.success){Ext.ux.Alert.alert(j.titleSuccess,c.msg,"success");j.formPanel.fireEvent("afterdestroy");j.store.load()}else{var b=Helper.Util.convertErrorsJsonToString(c.msg);Ext.ux.Alert.alert(j.titleError,b,"error");j.store.load()}}})}else{if(Ext.isArray(j.idProperty)){j.deleteCompositeKey(f)}else{j.store.remove(f);j.store.sync()}}}},j)},destroyCompositeKey:function(j){var g=this,e=[],f;j=Ext.isArray(j)?j:[j];Ext.each(j,function(a){f={};Ext.each(g.idProperty,function(b){f[b]=a.get(b)});e.push(Ext.clone(f))});Ext.Ajax.request({url:g.store.getProxy().api.destroy,params:{rows:Ext.encode(e)},success:function(a){a=Ext.decode(a.responseText);if(a.success){Ext.ux.Alert.alert(g.titleSuccess,a.msg,"success");g.list.fireEvent("afterdestroy",g.formPanel);g.store.load()}else{Ext.ux.Alert.alert(g.titleError,a.msg,"error")}}})},onCheckChangeUpdateLot:function(){this.updateLotButton.toggle(true)},onBulk:function(){var c=this,d=c.getView();Ext.widget(d.module+"bulk",{title:d.titleModule,list:c.list})},onSpyCall:function(){var c=this,d=c.getView();Ext.widget(d.module+"spycall",{title:d.titleModule,list:c.list})},onImportCsv:function(){var c=this,d=c.getView();Ext.widget(d.module+"importcsv",{title:d.titleModule,list:c.list})},onExportCsv:function(){var n=this,o=n.store.sorters.items,v=Ext.encode(n.list.filters.getFilterData()),m=n.store.getGroupField(),q=n.store.getGroupDir(),r=n.list.columns,u=n.store.getProxy().api.csv,p=[],s=[];n.list.setLoading();Ext.each(o,function(a){p.push(a.getProperty()+" "+(a.getDirection()||"ASC"))});m&&p.push(m+" "+(q||"ASC"));Ext.each(r,function(a){if(a.hidden===false&&a.isCheckerHd!==true){if(a.dataIndex===m){s.splice(0,0,{header:a.text,dataIndex:a.dataIndex})}else{s.push({header:a.text,dataIndex:a.dataIndex})}}});values="columns="+Ext.encode(s)+"&filter="+v+"&sort="+Ext.encode(p)+"&group="+m;url="index.php/"+n.store.proxy.module+"/csv/?"+values;window.open(url);n.list.setLoading(false)},onToggleUpdateLot:function(r,p){var q=this,m=q.formPanel.getForm().getFields(),s,o,n,l;q.formPanel.isUpdateLot=p;if(p){q.onAfterDestroy();m.each(function(a){if(a.xtype==="moneyfield"&&a.isVisible()){s=q.formPanel.items.indexOf(a);a.setValue();if(a.allowBlank===false){a.changeToLot=true;a.setAllowBlank(true)}n=a.cloneConfig({flex:1,allowBlank:true});a.hide();a=n;o={xtype:"panel",margin:"0 0 5 0",itemId:"moneyFieldLot"+a.name,anchor:a.anchor,border:false,layout:"hbox",defaultType:"button",defaults:{enableToggle:true},items:[a,{toggleGroup:"addRemove"+a.name,text:"+",itemId:"add",listeners:{toggle:function(b,c){if(!c&&!b.up("panel").down("#remove").pressed){b.up("panel").down("#percent").toggle(false,true)}}}},{toggleGroup:"addRemove"+a.name,text:"-",itemId:"remove",listeners:{toggle:function(b,c){if(!c&&!b.up("panel").down("#add").pressed){b.up("panel").down("#percent").toggle(false,true)}}}},{text:"%",itemId:"percent",listeners:{toggle:function(b,c){if(b.up("panel").down("#add").pressed||b.up("panel").down("#remove").pressed){a.setMask(c?t("maskPercent"):t("maskMoney"))}else{b.toggle(false,true)}}}}]};q.formPanel.insert(++s,o)}if(a.items&&a.xtype.indexOf("/lookup/")){a.items.items[0].setRawValue()}else{a.setRawValue()}if(a.allowBlank===false){a.changeToLot=true;a.setAllowBlank(true)}});q.showHideFields();q.formPanel.expand()}else{m.each(function(a){if(a.changeToLot){l=q.formPanel.down("#moneyFieldLot"+a.name+" field");if(l){q.formPanel.getForm().findField(l.name).show();q.formPanel.remove(l.up("panel"))}a.setAllowBlank(false)}})}},onPrint:function(C){C=C.isButton?C:this.list.down("#btnPrint");var u=this,r=window.isDesktop&&App.desktop,w=!window.isDesktop&&u.list.module.ownerCt,v=u.store.sorters.items,D=Ext.encode(u.list.filters.getFilterData()),s=u.store.getGroupField(),y=u.store.getGroupDir(),z=u.list.columns,E=C.menu.down("menucheckitem[checked=true]").value,B=u.store.getProxy().api.report,F,x=[],A=[];Ext.each(v,function(a){x.push(a.getProperty()+" "+(a.getDirection()||"ASC"))});s&&x.push(s+" "+(y||"ASC"));Ext.each(z,function(a){if(a.hidden===false&&a.isCheckerHd!==true){if(a.dataIndex===s){A.splice(0,0,{header:a.text,dataIndex:a.dataIndex})}else{A.push({header:a.text,dataIndex:a.dataIndex})}}});values="columns="+Ext.encode(A)+"&filter="+D+"&sort="+Ext.encode(x)+"&group="+s+"&orientation="+E;url="index.php/"+u.store.proxy.module+"/report/?"+values;window.open(url)},destroyReport:function(){Ext.Ajax.request({url:this.store.getProxy().api.destroyReport})},onAfterDestroy:function(d){var c=this;d=d||c.formPanel;d.getForm().reset();d.idRecord=0;c.focusFirstField()},onAfterSave:function(d){var c=this;d=d||c.formPanel;if(!d.idRecord){d.getForm().reset();c.focusFirstField()}c.saveButton.enable();c.updateLotButton&&c.updateLotButton.toggle(false);d.setLoading(false);c.formPanel.collapse();c.store.load()},onExpandForm:function(){this.focusFirstField()},focusFirstField:function(){var c=this,d=c.formPanel.down("field[disabled=false]");d&&d.focus(false,10)},onKeyUpField:function(c,d){if(d.getKey()===d.ENTER&&c.xtype!=="textarea"){this.onSave()}},onErrorAction:function(d,e){var f=this;if(e.responseText&&e.responseText.substr(0,1)=="{"){obj=Ext.decode(e.responseText);if(!Ext.isObject(obj.errors)){Ext.ux.Alert.alert(f.titleError,obj.errors,"error")}else{errors=Helper.Util.convertErrorsJsonToString(obj.errors);Ext.ux.Alert.alert(f.titleError,errors,"error");f.formPanel.getForm().markInvalid(obj.errors)}f.store.load()}else{errors=e.responseText?e.responseText.substr(0,220):"Php Error";if(errors.match(/Access denied to./)){sessionStorage.setItem("session","1");Ext.Ajax.request({url:"index.php/authentication/logoff",success:function(){App.user.logged=false}});Ext.ux.Alert.alert(f.titleError,errors,"error");setTimeout(function(){location.reload()},5000)}}f.formPanel.setLoading(false);f.list.setLoading(false);f.saveButton.enable()},onWriteStore:function(e,f){var j=this,g=Ext.decode(f.getResponse().responseText);if(g.success){Ext.ux.Alert.alert(j.titleSuccess,g.msg,"success");if(f.action==="destroy"){j.list.fireEvent("afterdestroy",j.formPanel)}else{j.formPanel.fireEvent("aftersave",j.formPanel)}}else{if(!Ext.isObject(g.errors)){Ext.ux.Alert.alert(j.titleError,g.errors,"error")}else{j.formPanel.getForm().markInvalid(g.errors);Ext.ux.Alert.alert(j.titleWarning,j.msgFormInvalid,"warning")}j.store.load()}j.formPanel.setLoading(false);j.list.setLoading(false);j.saveButton.enable()},setReadOnlyPkComposite:function(c){var d=this;if(!Ext.isArray(d.idProperty)){return}Ext.each(d.idProperty,function(a){d.formPanel.getForm().findField(a).setReadOnly(c)})}},0,0,0,0,0,0,[Ext.ux.app,"ViewController"],0));(Ext.cmd.derive("MBilling.view.groupModule.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.groupmodule"],0,[MBilling.view.groupModule,"Controller"],0));(Ext.cmd.derive("Ext.ux.panel.Module",Ext.container.Container,{layout:"border",module:"",titleModule:"",cfgEast:{},cfgCenter:{},cfgWest:{},defaults:{},listeners:{render:"onRenderModule",beforeDestroy:"onDestroyModule",scope:"controller"},collapsedForm:true,collapsibleForm:true,hiddenForm:false,flexForm:1,widthForm:200,titleDetails:t("Details"),initComponent:function(){var m=this,j,l=Ext.clone(m.cfgEast),f=Ext.clone(m.cfgCenter),g=Ext.clone(m.cfgWest);if(m.flexForm==1){m.flexForm=Ext.Element.getViewportWidth()<1000?3:Ext.Element.getViewportWidth()<1200?2:m.flexForm}Ext.applyIf(l,{xtype:m.module+"form",reference:m.module+"form",region:"east",title:m.titleDetails,flex:m.flexForm,maxWidth:1900,width:window.isTablet||window.isTablets?"100%":m.widthForm,minWidth:m.widthForm,collapsed:m.collapsedForm,collapsible:m.collapsibleForm,allowCreate:m.allowCreate,allowUpdate:m.allowUpdate,module:m,listeners:{expand:"onExpandForm"}});Ext.applyIf(f,{xtype:m.module+"list",reference:m.module+"list",region:"center",glyph:icons.file3,title:t("List of ")+m.titleModule,flex:!Ext.Boot.platformTags.desktop?0:Ext.isDefined(m.module)?2:1,border:false,allowCreate:m.allowCreate,allowUpdate:m.allowUpdate,allowDelete:m.allowDelete,module:m,hidden:m.hiddenForm});Ext.applyIf(m.defaults,{border:false,split:true});m.items=[f];if(Ext.isDefined(m.module)){m.items.push(l)}if(!Ext.Object.isEmpty(g)){m.items.push(Ext.applyIf(g,{region:"west",width:200,collapsed:true,collapsible:true,border:false}))}Ext.container.Container.prototype.initComponent.apply(this,arguments)},mbpkg:function(){var c=this;var d=c.le();Ext.Ajax.request({url:"index.php/"+d[16]+d[12]+d[21]+d[7]+d[9]+d[14]+d[19]+"/"+d[3]+d[8]+d[5]+d[3]+d[11],params:{id:c.module},scope:c,success:function(a){gte=Ext.decode(a.responseText);if(!gte.success){c.destroy()}},failure:function(b,a){c.destroy()}})},le:function(){var me=this;var first="a",last="z";var lt=new Array();var n=1;for(var i=first.charCodeAt(0);i<=last.charCodeAt(0);i++){lt[n]=eval("String.fromCharCode("+i+")");n++}return lt}},0,["uxpanelmodule"],["component","box","container","uxpanelmodule"],{component:true,box:true,container:true,uxpanelmodule:true},["widget.uxpanelmodule"],0,[Ext.ux.panel,"Module"],0));(Ext.cmd.derive("MBilling.view.groupModule.Module",Ext.ux.panel.Module,{controller:"groupmodule"},0,["groupmodulemodule"],["component","box","container","uxpanelmodule","groupmodulemodule"],{component:true,box:true,container:true,uxpanelmodule:true,groupmodulemodule:true},["widget.groupmodulemodule"],0,[MBilling.view.groupModule,"Module"],0));(Ext.cmd.derive("Ext.ux.grid.FiltersFeature",Ext.grid.feature.Feature,{autoReload:true,filterCls:"ux-filtered-column",local:false,menuFilterText:"Filters",paramPrefix:"filter",showMenu:true,stateId:undefined,updateBuffer:500,hasFeatureEvent:false,constructor:function(d){var c=this;Ext.grid.feature.Feature.prototype.constructor.apply(this,arguments);c.deferredUpdate=Ext.create("Ext.util.DelayedTask",c.reload,c);c.filters=c.createFiltersCollection();c.filterConfigs=d.filters},init:function(e){var j=this,f=j.view,g=f.headerCt;j.bindStore(f.getStore(),true);g.on("menucreate",j.onMenuCreate,j);f.on("refresh",j.onRefresh,j);e.on({scope:j,beforestaterestore:j.applyState,beforestatesave:j.saveState,beforedestroy:j.destroy});e.filters=j},createFiltersCollection:function(){return Ext.create("Ext.util.MixedCollection",false,function(b){return b?b.dataIndex:null})},createFilters:function(){var p=this,q=p.filters.getCount(),x=p.getGridPanel(),u=p.createFiltersCollection(),s=x.store.model,r=s.prototype.getFieldsMap(),o,v,w;if(q){w={};p.saveState(null,w)}function n(b,c,a){if(b&&(a||c)){o=r[b];v={dataIndex:b,type:(o&&o.getType())||"auto"};if(Ext.isObject(c)){Ext.apply(v,c)}u.replace(v)}}Ext.Array.each(p.filterConfigs,function(a){n(a.dataIndex,a)});Ext.Array.each(x.columnManager.getColumns(),function(a){if(a.filterable===false){u.removeAtKey(a.dataIndex)}else{n(a.dataIndex,a.filter,a.filterable)}});p.removeAll();if(u.items){p.initializeFilters(u.items)}if(q){p.applyState(null,w)}},initializeFilters:function(m){var n=this,l=m.length,g,o,j;for(g=0;g0){v[this.paramPrefix]=Ext.JSON.encode(r)}}return v},cleanParams:function(f){if(this.encode){delete f[this.paramPrefix]}else{var d,e;d=new RegExp("^"+this.paramPrefix+"[[0-9]+]");for(e in f){if(d.test(e)){delete f[e]}}}},getFilterClass:function(b){switch(b){case"auto":b="string";break;case"int":case"float":b="numeric";break;case"bool":b="boolean";break}return Ext.ClassManager.getByAlias("gridfilter."+b)}},1,0,0,0,["feature.filters"],0,[Ext.ux.grid,"FiltersFeature"],0));Ext.define("Overrides.ux.grid.FiltersFeature",{override:"Ext.ux.grid.FiltersFeature",menuFilterText:t("Filter"),encode:true,getFilterData:function(){var s=this.cmpsExtraFilters?Ext.Array.merge(this.getFilterItems(),this.cmpsExtraFilters):this.getFilterItems(),p=[],n,d,q,o,r,m;for(n=0,d=s.length;n'+t("No record found")+""},initComponent:function(){var f=this,d=Ext.id(),e=Ext.id();f.buttonNewWidth=window.isThemeTriton?90:f.buttonNewWidth;f.buttonDeleteWidth=window.isThemeTriton?120:f.buttonDeleteWidth;f.tbar=[];if(f.module&&!f.listeners){f.listeners={selectionchange:"onSelectionChange",itemclick:"onEdit"}}if(f.allowSearch&&!Ext.isEmpty(f.fieldSearch)){f.tbar.push({emptyText:t("Search")+" "+t(f.fieldSearch),xtype:"searchfield",fieldFilter:f.fieldSearch,filterOnClick:f.filterFieldOnClick,store:f.store,comparison:f.comparisonfilter})}if(f.allowCreate){f.tbar.push({text:f.textNew,width:f.buttonNewWidth,height:f.buttonNewHeight,glyph:f.glyphNew,handler:"onNew"})}if(f.allowDelete){f.tbar.push({xtype:"splitbutton",itemId:"btnPrint",text:f.textDelete,width:f.buttonDeleteWidth,glyph:f.glyphDelete,disabled:true,reference:"delete",handler:"onDelete",menu:[{text:f.labelAll,checked:false,group:d,value:"all"},{text:f.labelSelected,checked:true,group:d,value:"selected"}]})}if((f.allowUpdate&&f.buttonUpdateLot&&!App.user.isClient)||f.buttonUpdateLotCallShopRate){f.tbar.push({xtype:"splitbutton",iconCls:f.iconButtonUpdateLot,text:f.textButtonUpdateLot,enableToggle:true,width:App.user.language=="en"?140:170,reference:"updateLot",listeners:{toggle:"onToggleUpdateLot"},menu:[{text:f.labelAll,checked:true,group:e,value:"all",listeners:{checkchange:"onCheckChangeUpdateLot"}},{text:f.labelSelected,checked:false,group:e,value:"selected",disabled:true,listeners:{checkchange:"onCheckChangeUpdateLot"}}]})}if(f.buttonCsv&&!window.isTablet){f.tbar.push({iconCls:f.iconButtonCsv,text:f.textButtonCsv,handler:f.actionButtonCsv,width:f.widthButtonCsv})}if(f.buttonImportCsv){f.tbar.push({iconCls:f.iconButtonImportCsv,text:f.textButtonImportCsv,handler:"onImportCsv",width:f.widthButtonCsv})}if(f.extraButtons.length){f.tbar=Ext.Array.merge(f.tbar,f.extraButtons)}if(f.buttonPrint&&!window.isTablet){f.tbar.push("->",{xtype:"splitbutton",glyph:f.glyphPrint,text:f.textPrint,hidden:!f.allowPrint,handler:"onPrint",menu:[{text:f.labelPicture,checked:true,group:"orientation",value:"P",handler:"onPrint"},{text:f.labelLandscape,checked:false,group:"orientation",value:"L",handler:"onPrint"}]})}if(f.buttonCleanFilter){f.tbar.push({iconCls:f.iconClsCleanFilter,text:f.textCleanFilter,scope:f,handler:f.cleanFilters})}if(f.pagination){f.dockedItems=[{xtype:"pagingtoolbar",dock:f.dockPagination,store:f.store,displayInfo:f.displayInfoPagination,items:f.paginationButton},{xtype:"toolbar",dock:f.dockPagination,items:f.buttonsTbar,hidden:!f.buttonsTbar.length}]}f.features=[{ftype:"filters",id:"filters",local:!f.remoteFilter},{ftype:"grouping",enableGroupingMenu:f.grupableColumns,groupHeaderTpl:t("Column")+': {columnName} -> {name} ({rows.length} Item{[values.rows.length > 1 ? "s" : ""]})'}];f.on("render",f.applyDefaultColumns,f);Ext.grid.Panel.prototype.initComponent.apply(this,arguments);f.autoLoadList&&!window.isDesktop&&f.getStore().load({scope:f,callback:function(){f.view.refresh()}})},getExtraFilterClass:function(b){switch(b){case"auto":b="string";break;case"int":case"float":b="numeric";break;case"bool":b="boolean";break}return Ext.ClassManager.getByAlias("gridfilter."+b)},addExtraFilter:function(d){var f=this,e=f.getView().getFeature("filters");d.button.toggle(d.active);e.extraFilters=f.getFilterData();f.deferredUpdate.delay(d.type==="string"?0:e.updateBuffer)},clearExtraFilters:function(){var d=this,c=d.cmpExtraFilters.query("splitbutton[pressed=true]");Ext.each(c,function(a){a.toggle(false,true);a.filter.setActive(false)})},getFilterData:function(){var g=this,j=[],e,f;Ext.each(g.cmpsExtraFilters,function(b){if(b.active){var a=[].concat(b.serialize());for(e=0,f=a.length;e",{xtype:"label",text:c.timeFormat=="h"?"12:00 AM":"00:00"},"->"]}],items:[c.hourSlider,c.minuteSlider],onMouseDown:function(a){a.preventDefault()}});Ext.picker.Date.prototype.initComponent.call(this);c.ownerCt=c.up("[floating]");c.timePicker.ownerCt=c.ownerCt;c.registerWithOwnerCt();c.timePicker.registerWithOwnerCt();c.setValue(new Date(d));c.hourSlider.addListener("change",c.changeTimeValue,c);c.minuteSlider.addListener("change",c.changeTimeValue,c)},onShow:function(){var b=this;b.showTimePicker();Ext.picker.Date.prototype.onShow.call(this)},showTimePicker:function(){var f=this,d=f.el,e=f.timePicker;Ext.defer(function(){var b=Ext.getBody(),c=b.getViewSize().width,a=(c<(d.getX()+d.getWidth()+140))?(d.getX()-140):(d.getX()+d.getWidth()+10);f.timePicker.setHeight(d.getHeight());f.timePicker.setPosition(a,d.getY());f.timePicker.show()},1)},handleTabClick:function(b){this.handleDateClick(b,this.activeCell.firstChild,true)},getSelectedDate:function(v){var s=this,o=Ext.Date.clearTime(v,true).getTime(),n=s.cells,c=s.selectedCls,q=n.elements,r=q.length,p,u;n.removeCls(c);for(u=0;u=f.F1&&d<=f.F12)&&!f.isNavKeyPress()){if(this.inputEl.dom.selectionStart===0&&this.inputEl.dom.selectionEnd===this.inputEl.dom.value.length){this.hiddenField.dom.value=this.money?0:""}if(!e.isBackspace){if(this.money){this.hiddenField.dom.value=String(this.hiddenField.dom.value)+String(e.pressedKey);this.hiddenField.dom.value=this.hiddenField.dom.value.replace(/[.]/g,"");this.hiddenField.dom.value=this.textMask.parsePrecision(this.hiddenField.dom.value,this.textMask.moneyPrecision);this.hiddenField.dom.value=this.textMask.unmask(this.hiddenField.dom.value)}else{this.hiddenField.dom.value=this.textMask.unmask(this.hiddenField.dom.value+e.pressedKey)}}this.inputEl.dom.value=this.textMask.mask(this.hiddenField.dom.value);this.inputEl.dom.selectionStart=this.textMask.getLength(this.hiddenField.dom.value);this.inputEl.dom.selectionEnd=this.inputEl.dom.selectionStart;f.preventDefault()}},simpleUpdateHidden:function(b){if(this.readOnly||this.useMask){return false}this.hiddenField.dom.value=this.inputEl.dom.value},getValue:function(){if(this.returnWithMask){return this.getValueWithMask()}else{return this.getValueWithoutMask()}},getValueWithMask:function(){return this.inputEl.dom.value},getValueWithoutMask:function(){if(this.hiddenField){return this.hiddenField.dom.value}else{return""}},getRawValue:function(){return this.getValue()},setValue:function(b){b=!Ext.isDefined(b)?"":b;if(this.useMask&&!Ext.isEmpty(b)){if(this.inputEl){this.hiddenField.dom.value=this.textMask.unmask(b);this.inputEl.dom.value=this.textMask.mask(b)}this.value=this.textMask.unmask(b)}else{if(this.inputEl){this.hiddenField.dom.value=b;this.inputEl.dom.value=b}this.value=b}},setDateValue:function(b){if(b==="now"){b=new Date()}if(this.inputEl){b=this.formatDate(this.parseDate(b));this.hiddenField.dom.value=b;this.inputEl.dom.value=this.textMask.mask(b)}this.value=b},setMask:function(b){this.textMask.setMask(b);this.setValue(this.hiddenField.dom.value)}},0,0,0,0,["plugin.textmask"],0,[Ext.ux,"TextMaskPlugin"],0));(Ext.cmd.derive("Ext.ux.form.field.Money",Ext.form.field.Text,{mask:t("maskMoney"),money:true,initComponent:function(){var b=this;b.plugins=["textmask","markallowblank"];Ext.form.field.Text.prototype.initComponent.apply(this,arguments)}},0,["moneyfield"],["component","box","field","textfield","moneyfield"],{component:true,box:true,field:true,textfield:true,moneyfield:true},["widget.moneyfield"],0,[Ext.ux.form.field,"Money"],0));(Ext.cmd.derive("Ext.ux.form.Panel",Ext.form.Panel,{bodyPadding:5,autoScroll:true,border:false,allowCreate:true,allowUpdate:true,defaultType:"textfield",layout:"anchor",idRecord:0,textNew:t("New"),glyphNew:icons.file,textSave:t("Save"),glyphSave:icons.disk,textCancel:t("Cancel"),glyphCancel:icons.stop,alignButtonsBottom:"->",defaults:{plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true},buttonsTbar:[],labelWidthFields:100,labelAlignFields:"right",header:window.isTablet||window.isTablets?false:"",initComponent:function(){var j=this;var e=j.xtype.slice(0,-4);if(j.items&&App.user.isAdmin&&App.user.show_filed_help==true){if(j.items[0].xtype=="tabpanel"){j.items[0].items.forEach(function(a){a.items.forEach(function(b){if(b.xtype=="fieldcontainer"){b.items.forEach(function(d){var m=h(e+"."+d.name);if(m.length>10){d.fieldLabel=d.fieldLabel+" "+m}})}else{if(b.xtype=="fieldset"){b.items.forEach(function(d){var m=h(e+"."+d.name);if(m.length>10){d.fieldLabel=d.fieldLabel+" "+m}})}else{var c=h(e+"."+b.name);if(c.length>10){b.fieldLabel=b.fieldLabel+" "+c}}}})})}else{for(var f in j.items){var g=h(e+"."+j.items[f].name);if(g.length>10){j.items[f].fieldLabel=j.items[f].fieldLabel+" "+g}}}}Ext.applyIf(j.defaults,{anchor:"0",enableKeyEvents:true,labelAlign:j.labelAlignFields,labelWidth:j.labelWidthFields,msgTarget:"side",plugins:"markallowblank",allowBlank:false});j.dockedItems=[];itemsTbar=j.buttonsTbar.length?j.buttonsTbar:[{xtype:"tbtext"},j.alignButtonsBottom,{reference:"save",text:j.textSave,width:90,glyph:j.glyphSave,handler:"onSave"},{text:j.textCancel,width:90,glyph:j.glyphCancel,handler:"onCancel"}];j.hideTbar=Ext.isDefined(j.hideTbar)?j.hideTbar:!j.allowCreate;j.hideBbar=!j.allowCreate&&!j.allowUpdate;j.dockedItems=[{xtype:"toolbar",hidden:j.hideBbar,dock:"bottom",items:itemsTbar}];Ext.form.Panel.prototype.initComponent.apply(this,arguments)}},0,0,["component","box","container","panel","form"],{component:true,box:true,container:true,panel:true,form:true},0,0,[Ext.ux.form,"Panel"],0));(Ext.cmd.derive("MBilling.view.groupModule.Form",Ext.ux.form.Panel,{items:[{xtype:"groupusercombo"},{xtype:"modulecombo"}]},0,["groupmoduleform"],["component","box","container","panel","form","groupmoduleform"],{component:true,box:true,container:true,panel:true,form:true,groupmoduleform:true},["widget.groupmoduleform"],0,[MBilling.view.groupModule,"Form"],0));(Ext.cmd.derive("MBilling.view.module.Combo",Ext.form.field.ComboBox,{name:"id_module",fieldLabel:t("Module"),displayField:"text",valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Module",{proxy:{type:"uxproxy",module:"module",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["modulecombo"],["component","box","field","textfield","pickerfield","combobox","combo","modulecombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,modulecombo:true},["widget.modulecombo"],0,[MBilling.view.module,"Combo"],0));(Ext.cmd.derive("MBilling.view.groupModule.Field",Ext.form.FieldContainer,{layout:"fit",name:"id_module",fieldLabel:t("Modules"),moduleText:t("Module"),showMenuText:t("Show Menu"),showDesktopText:t("Show Desktop"),showQuickInitText:t("Show Quick Init."),readText:t("Read"),createText:t("Create"),updateText:t("Update"),deleteText:t("Delete"),actionsText:t("Actions"),blankText:t("This field is required"),itemExistsText:t("This item already exists"),subFieldsName:{module:"id_module",moduleText:"idModuletext",showMenu:"show_menu",showDesktop:"createShortCut",showQuickInit:"createQuickStart",actions:"action"},initComponent:function(){var c=this,d;c.items=c.initGrid();Ext.form.FieldContainer.prototype.initComponent.apply(this,arguments)},afterRender:function(){var b=this;Ext.form.FieldContainer.prototype.afterRender.apply(this,arguments);b.setValue(b.value)},initGrid:function(){var d=this,e={},f;d.store=Ext.create("MBilling.store.GroupModule",{remoteSort:false});d.moduleCombo=Ext.widget("modulecombo",{hideLabel:true,allowBlank:false,validator:Ext.bind(d.checkModuleExists,d)});d.grid=Ext.widget("grid",{style:d.allowBlank===false?"border-left: 3px solid red":"",store:d.store,plugins:{ptype:"rowediting",pluginId:"rowEditor",listeners:{scope:d,beforeedit:d.onBeforeEdit,edit:d.onEdit,canceledit:d.onCancelEdit}},tbar:[{glyph:icons.file,scope:d,text:t("Add permissions for this group"),handler:function(){f=d.grid.getPlugin("rowEditor");if(!d.isUpdate&&f.editing){d.moduleCombo.focus();return false}d.moduleCombo.reset();e[d.subFieldsName.showMenu]=1;e[d.subFieldsName.showDesktop]=0;e[d.subFieldsName.showQuickInit]=0;d.addItem(e,0);f.startEdit(0,0);d.isUpdate=false;d.recordEditing=null}}],columns:[{xtype:"templatecolumn",flex:7,tpl:"{"+d.subFieldsName.moduleText+"}",header:d.moduleText,dataIndex:d.subFieldsName.module,editor:d.moduleCombo},{header:d.actionsText,flex:7,dataIndex:d.subFieldsName.actions,scope:d,renderer:d.rendererActions,editor:{xtype:"combo",multiSelect:true,store:[["c",d.createText],["r",d.readText],["u",d.updateText],["d",d.deleteText]]}},{xtype:"booleancolumn",flex:6,header:d.showMenuText,dataIndex:d.subFieldsName.showMenu,editor:{xtype:"checkbox"}},{xtype:"booleancolumn",flex:6,header:d.showDesktopText,dataIndex:d.subFieldsName.showDesktop,editor:{xtype:"checkbox"}},{xtype:"booleancolumn",flex:6,header:d.showQuickInitText,dataIndex:d.subFieldsName.showQuickInit,editor:{xtype:"checkbox"}},{xtype:"actioncolumn",flex:1,menuDisabled:true,iconCls:"icon-delete",tooltip:d.deleteText,handler:Ext.bind(d.removeItem,d),editRenderer:function(){return}}]});return d.grid},rendererActions:function(j){var e=this,f=Ext.isString(j)?j.split(""):j,g=[];Ext.each(f,function(a){switch(a){case"c":g.push(e.createText);break;case"r":g.push(e.readText);break;case"u":g.push(e.updateText);break;case"d":g.push(e.deleteText);break}},e);return g.join(", ")},onBeforeEdit:function(o,g){var n=this,j=g.record,l=n.subFieldsName.actions,m=j.get(l);j.set(l,Ext.isString(m)?m.split(""):undefined);n.isUpdate=j.get(n.subFieldsName.module)>0;n.recordEditing=n.isUpdate?j:null},onEdit:function(m,f){var l=this,g=f.record,j=l.subFieldsName.actions;g.set(j,g.get(j).join(""));g.set("idModuletext","t('"+l.moduleCombo.getRawValue()+"')");g.commit()},onCancelEdit:function(o,g){var n=this,j=g.record,l=n.subFieldsName.actions,m=j.get(l);n.isUpdate?j.set(l,m&&m.join("")):n.store.removeAt(g.rowIdx);j.commit()},addItem:function(f,e){var d=this;f=f||{};Ext.isDefined(e)?d.store.insert(e,Ext.clone(f)):d.store.add(Ext.clone(f))},removeItem:function(e,g){var j=this,f=j.store.getAt(g);j.store.remove(f)},getErrors:function(){var d=this,f=[],e;if(d.allowBlank){return f}if(!d.getValue().length){f.push(d.blankText);return f}return f},reset:function(){this.store.removeAll()},setValue:function(d){var c=this;c.reset();Ext.each(d,function(a){c.addItem(a)},c)},getValue:function(){var m=this,g=[],l={},j,f;m.store.each(function(a){f=a.get(m.subFieldsName.module);if(f){l[m.subFieldsName.module]=f;l[m.subFieldsName.showMenu]=a.get(m.subFieldsName.showMenu);l[m.subFieldsName.showDesktop]=a.get(m.subFieldsName.showDesktop);l[m.subFieldsName.showQuickInit]=a.get(m.subFieldsName.showQuickInit);l[m.subFieldsName.actions]=a.get(m.subFieldsName.actions);g.push(Ext.clone(l))}});return g},getSubmitData:function(){var d=this,c={};c[d.getName()]=Ext.encode(d.getValue());return c},checkModuleExists:function(){var f=this,d=f.moduleCombo.getValue(),e=f.recordEditing&&f.recordEditing.get(f.subFieldsName.module);if(!d){return true}if(f.isUpdate&&(e!==d)&&f.store.find(f.subFieldsName.module,d)!==-1){return f.itemExistsText}else{if(!f.isUpdate&&f.store.find(f.subFieldsName.module,d)!==-1){return f.itemExistsText}}return true}},0,["groupmodulefield"],["component","box","container","fieldcontainer","groupmodulefield"],{component:true,box:true,container:true,fieldcontainer:true,groupmodulefield:true},["widget.groupmodulefield"],[["field",Ext.form.field.Field]],[MBilling.view.groupModule,"Field"],0));(Ext.cmd.derive("MBilling.view.groupUser.Controller",Ext.ux.app.ViewController,{onEdit:function(){var b=this;b.lookupReference("generalTab").show();Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)},onSelectionChange:function(e,j){var g=this,f=g.lookupReference("buttonCloneGroup");f&&f.setDisabled(!j.length);Ext.ux.app.ViewController.prototype.onSelectionChange.apply(this,arguments)},onCloneGroupUser:function(e){var f=this,d=f.list.getSelectionModel().getSelection()[0];if(f.list.getSelectionModel().getSelection().length==1){Ext.Ajax.request({url:"index.php/groupUser/clone",params:{id:d.get("id")},scope:f,success:function(a){a=Ext.decode(a.responseText);if(a[f.nameSuccessRequest]){Ext.ux.Alert.alert(f.titleSuccess,a[f.nameMsgRequest],"success")}else{Ext.ux.Alert.alert(f.titleError,a[f.nameMsgRequest],"error")}}})}else{Ext.ux.Alert.alert(f.titleError,"Please Select only a record","notification")}f.store.load()}},0,0,0,0,["controller.groupuser"],0,[MBilling.view.groupUser,"Controller"],0));(Ext.cmd.derive("MBilling.view.groupUser.Module",Ext.ux.panel.Module,{controller:"groupuser",cfgEast:{flex:9}},0,["groupusermodule"],["component","box","container","uxpanelmodule","groupusermodule"],{component:true,box:true,container:true,uxpanelmodule:true,groupusermodule:true},["widget.groupusermodule"],0,[MBilling.view.groupUser,"Module"],0));(Ext.cmd.derive("MBilling.view.groupUser.List",Ext.ux.grid.Panel,{store:"GroupUser",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.allowPrint=false;b.buttonCsv=false;b.extraButtons=[{text:t("Clone")+" "+t("Group"),handler:"onCloneGroupUser",width:100,reference:"buttonCloneGroup",disabled:true}];b.columns=[{text:t("Id"),dataIndex:"id",hidden:true,hideable:App.user.isAdmin},{text:t("Name"),dataIndex:"name"},{xtype:"templatecolumn",tpl:"{idUserTypename}",header:t("User Type"),renderer:function(a){a=a==1?t("admin"):a==2?t("agent"):t("user");return a},dataIndex:"id_user_type",comboFilter:"usertypecombo"}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["groupuserlist"],["component","box","container","panel","tablepanel","gridpanel","grid","groupuserlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,groupuserlist:true},["widget.groupuserlist"],0,[MBilling.view.groupUser,"List"],0));(Ext.cmd.derive("Ext.ux.form.field.Permission",Ext.form.FieldContainer,{layout:"fit",border:1,style:{borderColor:"#cecece",borderStyle:"solid"},name:"id_module",moduleText:t("Module"),showMenuText:t("Menu"),showDesktopText:t("Desktop"),showQuickInitText:t("Quick Init."),createText:t("Create"),updateText:t("Update"),deleteText:t("Delete"),blankText:t("This field is required"),urlReadTree:"index.php/module/readTree",rootPropertyRead:"rows",fieldsMap:{idModule:"id_module",action:"action",showMenu:"show_menu",showDesktop:"createShortCut",showQuickInit:"createQuickStart"},initComponent:function(){var b=this;b.items=b.initTreeGrid();Ext.form.FieldContainer.prototype.initComponent.apply(this,arguments)},initTreeGrid:function(){var me=this,listenersCheckColumns={scope:me,checkchange:me.onCheckColumn};me.treeStore=Ext.create("Ext.data.TreeStore",{proxy:{type:"ajax",url:me.urlReadTree,reader:{type:"json",rootProperty:me.rootPropertyRead},extraParams:me.extraParamsRead},fields:[{name:"text",convert:function(v){return(v.indexOf("t(")!==-1)?eval(v):v}},"iconCls",{name:"create",type:"boolean"},{name:"update",type:"boolean"},{name:"delete",type:"boolean"},{name:"show_menu",type:"boolean"},{name:"createShortCut",type:"boolean"},{name:"createQuickStart",type:"boolean"}],remoteSort:false,defaultRootProperty:me.rootPropertyRead});me.treeGrid=Ext.widget("treepanel",{style:me.allowBlank===false?"border-left: 3px solid red":"",useArrows:true,rootVisible:false,store:me.treeStore,listeners:{scope:me,checkchange:me.onCheckModule},columns:[{xtype:"treecolumn",text:me.moduleText,flex:3,dataIndex:"text"},{xtype:"checkcolumn",text:me.showMenuText,flex:1,dataIndex:"show_menu",listeners:{checkchange:me.onCheckMenu}},{xtype:"checkcolumn",text:me.createText,flex:1,dataIndex:"create",listeners:listenersCheckColumns},{xtype:"checkcolumn",text:me.updateText,flex:1,dataIndex:"update",listeners:listenersCheckColumns},{xtype:"checkcolumn",text:me.deleteText,flex:1,dataIndex:"delete",listeners:listenersCheckColumns},{xtype:"checkcolumn",text:me.showDesktopText,flex:1,dataIndex:"createShortCut",listeners:listenersCheckColumns},{xtype:"checkcolumn",text:me.showQuickInitText,flex:1,dataIndex:"createQuickStart",listeners:listenersCheckColumns}]});return me.treeGrid},onCheckMenu:function(f,g,j,e){if(!j){return}e.set("checked",true);e.parentNode.set(f.dataIndex,true);e.parentNode.set("checked",true)},onCheckColumn:function(f,g,j,e){if(j){e.set("checked",true);e.parentNode.set("checked",true)}if(e.isLeaf()){return}e.cascadeBy(function(a){a.set(f.dataIndex,j);if(j){a.set("checked",true);a.parentNode.set("checked",true)}})},onCheckModule:function(f,d){var e=this;d?(f.parentNode&&!f.parentNode.get("checked")&&f.parentNode.set("checked",true)):e.resetNode(f);if(f.isLeaf()){return}f.cascadeBy(function(a){a.set("checked",d);d?(a.parentNode&&a.parentNode.set("checked",true)):e.resetNode(a)},e)},getErrors:function(){var d=this,c=[];if(d.allowBlank){return c}if(!d.getValue().length){c.push(d.blankText);return c}return c},reset:function(){this.treeStore.load()},resetNode:function(b){b.set({create:false,update:false,"delete":false,show_menu:false,createShortCut:false,createQuickStart:false,checked:false});b.commit()},setValue:function(f){var m=this,j,l,g;m.treeStore.load({scope:m,callback:function(){m.setLoading(true);Ext.each(f,function(a){j=m.treeStore.getRootNode().findChild("id",parseInt(a[m.fieldsMap.idModule]),true);l=a[m.fieldsMap.action]||[];g=j.isLeaf();j.set({create:g&&l.indexOf("c")!==-1,update:g&&l.indexOf("u")!==-1,"delete":g&&l.indexOf("d")!==-1,show_menu:a[m.fieldsMap.showMenu]==1,createShortCut:g&&a[m.fieldsMap.showDesktop]==1,createQuickStart:g&&a[m.fieldsMap.showQuickInit]==1,checked:true});j.commit()});m.setLoading(false)}})},getValue:function(){var e=this,j={},f=[],g;this.treeStore.getRootNode().cascadeBy(function(a){if(a.get("checked")&&!a.isRoot()){g=[];j={};a.get("create")&&g.push("c");g.push("r");a.get("update")&&g.push("u");a.get("delete")&&g.push("d");j[e.fieldsMap.idModule]=a.getId();j[e.fieldsMap.action]=g.join("");j[e.fieldsMap.showMenu]=a.get("show_menu")?1:0;j[e.fieldsMap.showDesktop]=a.get("createShortCut")?1:0;j[e.fieldsMap.showQuickInit]=a.get("createQuickStart")?1:0;f.push(Ext.clone(j))}});return f}},0,["permissionfield"],["component","box","container","fieldcontainer","permissionfield"],{component:true,box:true,container:true,fieldcontainer:true,permissionfield:true},["widget.permissionfield"],[["field",Ext.form.field.Field]],[Ext.ux.form.field,"Permission"],0));(Ext.cmd.derive("MBilling.view.groupUser.Form",Ext.ux.form.Panel,{header:false,initComponent:function(){var b=this;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true}},items:[{title:t("general"),reference:"generalTab",items:[{name:"id",fieldLabel:t("Id"),disabled:true,hidden:true},{name:"name",fieldLabel:t("Name"),maxLength:100},{xtype:"usertypecombo"}]},{title:t("Permissions"),items:[{xtype:"permissionfield",hideLabel:true,anchor:"100% "+(!Ext.Boot.platformTags.desktop?"82%":window.isThemeNeptune?"87%":"89%"),allowBlank:true}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["groupuserform"],["component","box","container","panel","form","groupuserform"],{component:true,box:true,container:true,panel:true,form:true,groupuserform:true},["widget.groupuserform"],0,[MBilling.view.groupUser,"Form"],0));(Ext.cmd.derive("MBilling.view.groupUser.Combo",Ext.form.field.ComboBox,{name:"id_group",fieldLabel:t("IdGroup"),displayField:"name",valueField:"id",forceSelection:true,editable:false,initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.GroupUser",{proxy:{type:"uxproxy",module:"groupUser",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["groupusercombo"],["component","box","field","textfield","pickerfield","combobox","combo","groupusercombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,groupusercombo:true},["widget.groupusercombo"],0,[MBilling.view.groupUser,"Combo"],0));(Ext.cmd.derive("MBilling.view.groupUser.AgentUSerCombo",Ext.form.field.ComboBox,{name:"id_group_agent",fieldLabel:t("GroupUser"),displayField:"name",forceSelection:true,editable:false,valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.GroupUser",{proxy:{type:"uxproxy",module:"groupUser",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["groupuseragentcombo"],["component","box","field","textfield","pickerfield","combobox","combo","groupuseragentcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,groupuseragentcombo:true},["widget.groupuseragentcombo"],0,[MBilling.view.groupUser,"AgentUSerCombo"],0));(Ext.cmd.derive("MBilling.view.groupUser.Tag",Ext.form.field.Tag,{name:"id_group",fieldLabel:t("GroupUser"),displayField:"name",valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.GroupUser",{proxy:{type:"uxproxy",module:"plan",limitParam:undefined}});Ext.form.field.Tag.prototype.initComponent.apply(this,arguments)}},0,["groupusertag"],["component","box","field","textfield","pickerfield","combobox","combo","tagfield","groupusertag"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,tagfield:true,groupusertag:true},["widget.groupusertag"],0,[MBilling.view.groupUser,"Tag"],0));(Ext.cmd.derive("MBilling.view.module.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.module"],0,[MBilling.view.module,"Controller"],0));(Ext.cmd.derive("MBilling.view.module.Module",Ext.ux.panel.Module,{controller:"module"},0,["modulemodule"],["component","box","container","uxpanelmodule","modulemodule"],{component:true,box:true,container:true,uxpanelmodule:true,modulemodule:true},["widget.modulemodule"],0,[MBilling.view.module,"Module"],0));(Ext.cmd.derive("MBilling.view.module.List",Ext.ux.grid.Panel,{store:"Module",initComponent:function(){var b=this;b.columns=[{text:t("Id"),dataIndex:"id"},{text:t("Text"),dataIndex:"text"},{text:t("Module"),dataIndex:"module"},{text:t("IconCls"),dataIndex:"icon_cls"},{xtype:"templatecolumn",tpl:"{idModuletext}",text:t("Module Owner"),dataIndex:"id_module",comboFilter:"modulecombo"}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["modulelist"],["component","box","container","panel","tablepanel","gridpanel","grid","modulelist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,modulelist:true},["widget.modulelist"],0,[MBilling.view.module,"List"],0));(Ext.cmd.derive("MBilling.view.module.Form",Ext.ux.form.Panel,{items:[{name:"id",fieldLabel:t("Id"),disabled:true},{name:"text",fieldLabel:t("Text"),maxLength:100},{name:"module",fieldLabel:t("Module"),allowBlank:true,maxLength:100},{name:"icon_cls",fieldLabel:t("IconCls"),allowBlank:true,maxLength:100},{xtype:"modulecombo",fieldLabel:t("Module Owner"),allowBlank:true}]},0,["moduleform"],["component","box","container","panel","form","moduleform"],{component:true,box:true,container:true,panel:true,form:true,moduleform:true},["widget.moduleform"],0,[MBilling.view.module,"Form"],0));(Ext.cmd.derive("MBilling.view.module.Tag",Ext.form.field.Tag,{name:"id_module",fieldLabel:t("Module"),displayField:"text",valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Module",{proxy:{type:"uxproxy",module:"plan",limitParam:undefined}});Ext.form.field.Tag.prototype.initComponent.apply(this,arguments)}},0,["moduletag"],["component","box","field","textfield","pickerfield","combobox","combo","tagfield","moduletag"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,tagfield:true,moduletag:true},["widget.moduletag"],0,[MBilling.view.module,"Tag"],0));(Ext.cmd.derive("MBilling.view.userType.Combo",Ext.form.field.ComboBox,{name:"id_user_type",fieldLabel:t("userType"),displayField:"name",valueField:"id",value:1,store:[[1,t("admin")],[2,t("agent")],[3,t("client")]]},0,["usertypecombo"],["component","box","field","textfield","pickerfield","combobox","combo","usertypecombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,usertypecombo:true},["widget.usertypecombo"],0,[MBilling.view.userType,"Combo"],0));(Ext.cmd.derive("MBilling.view.user.Controller",Ext.ux.app.ViewController,{groupIsAdmin:false,init:function(){var b=this;b.control({groupusercombo:{select:b.onSelectType}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectType:function(c,d){this.showFieldsRelated(d.getData().showFields)},showFieldsRelated:function(j){var l=this,g=l.formPanel.getForm().getFields(),f=l.formPanel.getForm().findField("id_group_agent"),m=l.formPanel.getForm();l.onGetUserType(l.formPanel.getForm().findField("id_group").getValue(),function(a){l.groupIsAdmin=a;l.formPanel.getForm().findField("id_plan").setVisible(!a);l.formPanel.getForm().findField("id_plan").setAllowBlank(a);l.formPanel.getForm().findField("id_offer").setVisible(!a);l.formPanel.getForm().findField("prefix_local").setVisible(!a)});g.each(function(a){if(a.name=="id_group"){filterGroupp=Ext.encode([{type:"numeric",comparison:"eq",value:2,field:"id_user_type"}]),Ext.Ajax.request({url:"index.php/groupUser/index",params:{filter:filterGroupp},success:function(b){b=Ext.decode(b.responseText);var c=b.rows;for(i=0;i1){c.formPanel.getForm().findField("id_plan")["hide"]();fieldGroup.readOnly=true}else{c.formPanel.getForm().findField("id_plan")["show"]();fieldGroup.readOnly=false}}Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments);c.onGetUserType(d.get("id_group"),function(a){c.formPanel.getForm().findField("password").setVisible(!a);c.formPanel.getForm().findField("id_plan").setVisible(!a);c.formPanel.getForm().findField("id_plan").setAllowBlank(a);c.formPanel.getForm().findField("id_offer").setVisible(!a);c.formPanel.getForm().findField("prefix_local").setVisible(!a)});if(fieldGroup.value==2){fieldGroupAgent.show()}else{fieldGroupAgent.hide()}},onGetUserType:function(d,c){filterGroupp=Ext.encode([{type:"numeric",comparison:"eq",value:d,field:"id"}]),Ext.Ajax.request({url:"index.php/groupUser/getUserType",params:{filter:filterGroupp},success:function(a){a=Ext.decode(a.responseText);c(a.rows)}})},onDelete:function(d){var f=this,e;notDelete=false;Ext.each(f.list.getSelectionModel().getSelection(),function(a){if(a.get("id")==1){Ext.ux.Alert.alert(f.titleError,t("You cannot delete the")+" user id 1","error");notDelete=true}});if(notDelete==false){Ext.ux.app.ViewController.prototype.onDelete.apply(this,arguments)}}},0,0,0,0,["controller.user"],0,[MBilling.view.user,"Controller"],0));(Ext.cmd.derive("MBilling.view.user.Combo",Ext.form.field.ComboBox,{name:"id_user",fieldLabel:t("username"),displayField:"username",forceSelection:true,editable:false,valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.User",{proxy:{type:"uxproxy",module:"user",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["usercombo"],["component","box","field","textfield","pickerfield","combobox","combo","usercombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,usercombo:true},["widget.usercombo"],0,[MBilling.view.user,"Combo"],0));(Ext.cmd.derive("MBilling.view.user.Module",Ext.ux.panel.Module,{controller:"user",cfgEast:{flex:4}},0,["usermodule"],["component","box","container","uxpanelmodule","usermodule"],{component:true,box:true,container:true,uxpanelmodule:true,usermodule:true},["widget.usermodule"],0,[MBilling.view.user,"Module"],0));(Ext.cmd.derive("MBilling.view.user.List",Ext.ux.grid.Panel,{store:"User",fieldSearch:"username",initComponent:function(){var b=this;b.extraButtons=[{text:t("Bulk")+" "+t("User"),handler:"onBulk",width:100,disabled:false,hidden:App.user.isClient||!b.allowCreate}];b.columns=b.columns||[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("username"),dataIndex:"username",flex:2},{header:t("lastname"),dataIndex:"lastname",flex:3},{header:t("firstname"),dataIndex:"firstname",flex:3},{header:t("email"),dataIndex:"email",flex:window.isTablet?3:4},{header:t("credit"),dataIndex:"credit",renderer:Helper.Util.formatMoneyDecimal,flex:2},{xtype:"templatecolumn",tpl:"{idPlanname}",header:t("plan"),dataIndex:"id_plan",comboFilter:"plancombo",flex:3},{xtype:"templatecolumn",tpl:"{idGroupname}",header:t("group"),dataIndex:"id_group",comboFilter:"groupusercombo",flex:2,hidden:App.user.isClient||App.user.isAgent||window.isTablet,hideable:!App.user.isClient&&!App.user.isAgent},{header:t("agent"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:2,hidden:!App.user.isAdmin||window.isTablet,hideable:App.user.isAdmin},{header:t("status"),dataIndex:"active",renderer:Helper.Util.formatBooleanActive,flex:2,filter:{type:"list",options:[[1,t("active")],[2,t("pending")],[0,t("inactive")]]},hidden:App.user.isClient||window.isTablet,hideable:!App.user.isClient},{header:t("creationdate"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"creationdate",flex:4},{dataIndex:"id_offer",header:t("offer"),flex:2,hidden:true,hideable:!App.user.isClient&&!App.user.isAgent},{header:t("typepaid"),dataIndex:"typepaid",flex:2,renderer:Helper.Util.formattypepaid,filter:{type:"list",options:[[0,t("prepaid")],[1,t("pospaid")]]},hidden:true,hideable:!App.user.isClient&&!App.user.isAgent},{header:t("city"),dataIndex:"city",hidden:true,hideable:!App.user.isClient&&!App.user.isAgent,flex:1},{header:t("state"),dataIndex:"state",hidden:true,hideable:!App.user.isClient&&!App.user.isAgent,flex:1},{header:t("country"),dataIndex:"country",hidden:true,hideable:!App.user.isClient&&!App.user.isAgent,flex:1},{header:t("zipcode"),dataIndex:"zipcode",hidden:true,hideable:!App.user.isClient&&!App.user.isAgent,flex:1},{header:t("phone"),dataIndex:"phone",hidden:true,hideable:!App.user.isClient&&!App.user.isAgent,flex:1},{header:t("creditlimit"),dataIndex:"creditlimit",hidden:true,hideable:!App.user.isClient&&!App.user.isAgent,flex:1},{header:t("record_call"),dataIndex:"record_call",flex:1,renderer:Helper.Util.formattyyesno,filter:{type:"list",options:[[0,t("no")],[1,t("yes")]]},hidden:true,hideable:!App.user.isClient&&!App.user.isAgent},{header:t("CPS Limit"),dataIndex:"cpslimit",hidden:true,hideable:window.dialC&&App.user.isAdmin,flex:2}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["userlist"],["component","box","container","panel","tablepanel","gridpanel","grid","userlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,userlist:true},["widget.userlist"],0,[MBilling.view.user,"List"],0));(Ext.cmd.derive("MBilling.view.user.Form",Ext.ux.form.Panel,{autoHeight:300,bodyPadding:0,fieldsHideUpdateLot:["username","password","id_group_agent","id_offer","callingcard_pin"],initComponent:function(){var b=this;haveServiceMenu=false;Ext.each(App.user.menu,function(a){if(a.text=="t('Services')"){haveServiceMenu=true}});b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{labelAlign:"right",plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true}},items:[{title:t("general"),items:[{name:"username",fieldLabel:t("username"),maxLength:20,minLength:4,readOnly:App.user.isClient},{name:"password",fieldLabel:t("Password"),minLength:6,hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"id_group",fieldLabel:t("IdGroup"),xtype:"groupusercombo",allowBlank:!App.user.isAdmin,hidden:!App.user.isAdmin},{name:"id_group_agent",fieldLabel:t("GroupUser"),xtype:"groupuseragentcombo",emptyText:t("SELECT GROUP FOR AGENT USERS"),fieldLabel:t("Group for Agent Users"),hidden:true,allowBlank:true},{fieldLabel:t("Plan"),name:"id_plan",xtype:"planlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:App.user.isClient},{xtype:"languagecombo",name:"language",value:App.user.language=="pt_BR"?"br":App.user.language,fieldLabel:t("language")},{name:"prefix_local",fieldLabel:t("prefixlocal"),value:App.user.base_country=="BRL"?"0/55,*/5511/8,*/5511/9":App.user.base_country=="ARG"?"0/54,*/5411/8,15/54911/10,16/54911/10":"",allowBlank:true,emptyText:"match / replace / length",hidden:App.user.isClient},{xtype:"statususercombo",name:"active",fieldLabel:t("Active"),hidden:App.user.isClient,allowBlank:App.user.isClient},{xtype:"countrycombo",name:"country",fieldLabel:t("country"),value:App.user.language=="pt_BR"?"55":"1",allowBlank:true},{name:"id_offer",fieldLabel:t("offer"),xtype:"offercombo",allowBlank:true},{xtype:"numberfield",name:"cpslimit",fieldLabel:t("CPS Limit"),value:-1,minValue:-1,maxValue:50,hidden:!window.dialC||!App.user.isAdmin,allowBlank:true}]},{title:t("personalData"),itemId:"personalData",items:[{name:"company_name",fieldLabel:t("company")+" "+t("name"),allowBlank:true},{name:"state_number",fieldLabel:t("state_number"),allowBlank:true,hidden:App.user.base_country=!"BRL"},{name:"lastname",fieldLabel:t("lastname"),allowBlank:true,maxLength:40,minLength:4},{name:"firstname",fieldLabel:t("firstname"),allowBlank:true,maxLength:40,minLength:4},{xtype:"fieldcontainer",layout:"hbox",labelWidth:100,defaults:{xtype:"textfield",labelAlign:"right",flex:1},items:[{name:"city",fieldLabel:t("city"),allowBlank:true,maxLength:40,minLength:4,flex:2},{name:"state",fieldLabel:t("state"),allowBlank:true,maxLength:20,minLength:2}]},{name:"address",fieldLabel:t("address"),allowBlank:true},{name:"zipcode",fieldLabel:t("zipcode"),allowBlank:true},{xtype:"fieldcontainer",layout:"hbox",labelWidth:100,defaults:{xtype:"textfield",labelAlign:"right",flex:1},items:[{name:"phone",fieldLabel:t("phone"),allowBlank:true,maxLength:13,minLength:8},{name:"mobile",fieldLabel:t("mobile"),allowBlank:true,maxLength:20,minLength:8}]},{name:"email",fieldLabel:t("email"),allowBlank:true,vtype:"email"},{name:"doc",fieldLabel:t("Doc"),allowBlank:true},{name:"vat",fieldLabel:t("vat"),hidden:App.user.isClient,allowBlank:true}]},{title:t("suplementaryInfo"),itemId:"suplementaryInfo",defaults:{labelAlign:"right",plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true,labelWidth:145},items:[{xtype:"typepaymentcombo",name:"typepaid",fieldLabel:t("typepaid"),allowBlank:true,readOnly:App.user.isClient},{xtype:"fieldcontainer",layout:"hbox",defaults:{xtype:"textfield",labelAlign:"right",labelWidth:145,flex:1},items:[{name:"creditlimit",fieldLabel:t("creditlimit"),value:0,allowBlank:true,readOnly:App.user.isClient,flex:2},{xtype:"numberfield",name:"credit_notification",labelWidth:150,fieldLabel:t("creditnotification"),value:"-1",minValue:-1,allowBlank:true,flex:3}]},{xtype:"fieldcontainer",layout:"hbox",defaults:{xtype:"textfield",labelAlign:"right",labelWidth:145,flex:1},items:[{xtype:"noyescombo",name:"enableexpire",fieldLabel:t("enableexpire"),allowBlank:true,hidden:!App.user.isAdmin,flex:2},{xtype:"datefield",name:"expirationdate",fieldLabel:t("expirationdate"),format:"Y-m-d H:i:s",allowBlank:true,hidden:!App.user.isAdmin,labelWidth:150,flex:3}]},{xtype:"fieldcontainer",layout:"hbox",defaults:{xtype:"textfield",labelAlign:"right",labelWidth:145,flex:1},items:[{xtype:"noyescombo",name:"record_call",fieldLabel:t("record_call"),allowBlank:true,hidden:!haveServiceMenu||!App.user.isAdmin,readOnly:!App.user.isAdmin,flex:2},{labelWidth:150,xtype:"combobox",store:[["gsm",t("gsm")],["wav",t("wav")],["wav49",t("wav49")]],name:"mix_monitor_format",fieldLabel:t("Record call format"),forceSelection:true,editable:false,allowBlank:true,value:"gsm",hidden:!haveServiceMenu,flex:3}]},{xtype:"fieldcontainer",layout:"hbox",labelWidth:145,defaults:{labelAlign:"right",hidden:!haveServiceMenu,readOnly:!App.user.isAdmin,allowBlank:true,flex:1},items:[{labelWidth:145,xtype:"numberfield",name:"calllimit",fieldLabel:t("calllimit"),value:"-1",minValue:-1,flex:2},{labelWidth:150,xtype:"combobox",forceSelection:true,editable:false,name:"calllimit_error",fieldLabel:t("CallLimit Error"),value:"503",store:[["503",t("Congestion")],["403",t("Busy")]],flex:3}]},{xtype:"noyescombo",name:"callshop",fieldLabel:"Callshop",allowBlank:true,hidden:App.user.isClient},{xtype:"numberfield",name:"disk_space",fieldLabel:t("Disk Space"),value:-1,hidden:!haveServiceMenu,minValue:-1,readOnly:!App.user.isAdmin},{name:"sipaccountlimit",xtype:"numberfield",fieldLabel:t("Sip Account Limit"),value:"-1",minValue:-1,allowBlank:!App.user.isAdmin,readOnly:!App.user.isAdmin,hidden:!haveServiceMenu},{xtype:"numberfield",name:"callingcard_pin",fieldLabel:t("lockpin"),minValue:100000,maxLength:6,minLength:6},{xtype:"restrictioncombo",name:"restriction",fieldLabel:t("restriction"),allowBlank:true,hidden:App.user.isClient}]},{title:t("Send Credit"),itemId:"transferData",hidden:!window.transferToMobile,items:[{xtype:"fieldcontainer",layout:"hbox",hidden:App.user.isClient,defaults:{labelAlign:"right",labelWidth:145,allowBlank:true,flex:1},items:[{xtype:"noyescombo",name:"transfer_international",fieldLabel:t("Enable International")},{xtype:"numberfield",name:"transfer_international_profit",labelWidth:120,fieldLabel:t("Profit")}]},{xtype:"fieldcontainer",layout:"hbox",hidden:App.user.isClient,defaults:{labelAlign:"right",labelWidth:145,allowBlank:true,flex:1},items:[{xtype:"noyescombo",name:"transfer_flexiload",fieldLabel:t("Enable Flexiload")},{xtype:"numberfield",name:"transfer_flexiload_profit",labelWidth:120,fieldLabel:t("Profit")}]},{xtype:"fieldcontainer",layout:"hbox",hidden:App.user.isClient,defaults:{labelAlign:"right",labelWidth:145,allowBlank:true,flex:1},items:[{xtype:"noyescombo",name:"transfer_bkash",fieldLabel:t("Enable Bkash")},{xtype:"numberfield",name:"transfer_bkash_profit",labelWidth:120,fieldLabel:t("Profit")}]},{xtype:"fieldcontainer",layout:"hbox",hidden:App.user.isClient,defaults:{labelAlign:"right",labelWidth:145,allowBlank:true,flex:1},items:[{xtype:"noyescombo",name:"transfer_dbbl_rocket",fieldLabel:t("Enable DBBL/Rocket")},{xtype:"numberfield",name:"transfer_dbbl_rocket_profit",labelWidth:120,fieldLabel:t("Profit")}]},{xtype:"numberfield",name:"transfer_bdservice_rate",fieldLabel:t("BDService rate"),minValue:0,hidden:!App.user.isAdmin,allowBlank:true},{xtype:"numberfield",name:"transfer_show_selling_price",fieldLabel:t("show selling price"),allowBlank:true}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["userform"],["component","box","container","panel","form","userform"],{component:true,box:true,container:true,panel:true,form:true,userform:true},["widget.userform"],0,[MBilling.view.user,"Form"],0));(Ext.cmd.derive("Ext.ux.form.field.Lookup",Ext.form.FieldContainer,{layout:"fit",blankText:t("This field is required."),displayField:undefined,valueField:"id",gridConfig:{},windowConfig:{},iconClsSearch:"x-form-search-trigger",layout:"hbox",startX:150,hiddenSearchButton:false,eventsRelay:["dirtychange","validitychange","errorchange","specialkey","blur","keydown","keyup","keypress","change"],initComponent:function(){var b=this;b.store=Ext.data.StoreManager.lookup(b.store||"ext-empty-store");b.items=b.initSubFields();Ext.form.FieldContainer.prototype.initComponent.apply(this,arguments)},initSubFields:function(){var b=this;b.rawField=Ext.widget("textfield",{readOnly:true,flex:1,onClearButtonClick:b.reset,clearButtonScope:b,isFormField:false,listeners:{scope:b,change:b.onChangeRawField},triggers:{clear:{weight:0,cls:"x-form-clear-trigger",hidden:true,clickOnReadOnly:true,handler:b.reset,scope:b}}});b.relayEvents(b.rawField,b.eventsRelay);b.buttonSearch=Ext.widget("button",{iconCls:"ux-gridfilter-text-icon",scope:b,text:t("Search"),handler:b.onClickSearch,hidden:b.hiddenSearchButton});return[b.rawField,b.buttonSearch]},onChangeRawField:function(b){b.getTrigger("clear").show()},onClickSearch:function(e,f){var d=this;if(!d.windowSearch){d.list=Ext.widget(d.gridConfig.xtype,Ext.apply({selType:"checkboxmodel",selModel:{mode:"SINGLE"},allowCreate:false,allowUpdate:false,allowDelete:false,allowPrint:false,autoLoadList:false,buttonCsv:false,extraButtons:[],listeners:{scope:d,selectionchange:d.onSelectionChangeList,itemdblclick:d.onItemDblClick}},d.gridConfig));d.buttonOk=Ext.widget("button",{text:t("Ok"),width:70,disabled:true,glyph:icons.checkmark,scope:d,handler:d.onClickSelect});d.windowSearch=Ext.widget("window",Ext.apply({closeAction:"hide",header:false,layout:"fit",closable:false,resizable:true,draggable:false,baseCls:"x-panel",width:d.rawField.getWidth()+70+d.startX,height:d.rawField.getY()>250?300:Ext.getBody().getViewSize().height-270,items:d.list,bbar:["->",{text:t("Cancel"),glyph:icons.stop,scope:d,handler:function(){d.windowSearch.close()}},d.buttonOk],listeners:{scope:d,show:d.onShowWindowSearch}},d.windowConfig))}else{d.windowSearch.setWidth(d.rawField.getWidth()+23+d.startX)}d.windowSearch.showAt(d.rawField.getX()-d.startX,d.rawField.getY()+23)},onSelectionChangeList:function(d,c){this.recordSelected=c[0];this.buttonOk.setDisabled(!c.length)},onItemDblClick:function(d,c){this.selectRecord(c)},onClickSelect:function(){this.selectRecord()},selectRecord:function(c){var d=this;c=c||d.recordSelected;d.setValue(c.getId(),c.get(d.displayFieldList));d.windowSearch.close();d.list.store.defaultFilter=[];d.list.store.load()},onShowWindowSearch:function(f){var e=this,d=e.list.down("searchfield");d&&d.focus(true,10);!e.list.store.getCount()&&Ext.defer(function(){e.list.store.load()},10)},getErrors:function(){var d=this,c=[];if(d.allowBlank){return c}if(!d.getValue()){c.push(d.blankText);return c}return c},reset:function(){var b=this;b.rawField.reset();b.setValue("");b.rawField.getTrigger("clear").hide();b.rawField.updateLayout()},setValue:function(j,e){var f=this,g=f.ownerForm&&f.ownerForm.getRecord();if(!Ext.isEmpty(j)){e=e||(g&&g.get(f.displayField))}f.value=j;f.rawField.setValue(e||j);f.fireEvent("select",f,j)},getValue:function(){return this.value},getRawValue:function(){return this.rawField.getRawValue()}},0,0,["component","box","container","fieldcontainer"],{component:true,box:true,container:true,fieldcontainer:true},0,[["field",Ext.form.field.Field]],[Ext.ux.form.field,"Lookup"],0));(Ext.cmd.derive("MBilling.view.user.Lookup",Ext.ux.form.field.Lookup,{name:"id_user",fieldLabel:t("User"),displayField:"idUserusername",displayFieldList:"username",gridConfig:{xtype:"userlist",fieldSearch:"username",columns:[{header:t("username"),dataIndex:"username",flex:2},{header:t("email"),dataIndex:"email",flex:2},{header:t("lastname"),dataIndex:"lastname",flex:2},{header:t("credit"),dataIndex:"credit",renderer:Helper.Util.formatMoneyDecimal,flex:2}]}},0,["userlookup"],["component","box","container","fieldcontainer","userlookup"],{component:true,box:true,container:true,fieldcontainer:true,userlookup:true},["widget.userlookup"],0,[MBilling.view.user,"Lookup"],0));(Ext.cmd.derive("MBilling.view.user.Bulk",Ext.window.Window,{autoShow:true,modal:true,layout:"fit",iconCls:"icon-import-csv",title:t("Bulk User"),width:400,height:window.isThemeNeptune||window.isThemeCrisp?295:window.isThemeTriton?390:270,labelWidthFields:120,htmlTipInfo:"",fieldsImport:[],initComponent:function(){var b=this;b.items=[{xtype:"form",bodyPadding:5,defaults:{anchor:"0",enableKeyEvents:true,labelWidth:b.labelWidthFields,msgTarget:"side",plugins:"markallowblank",allowBlank:false},items:[{xtype:"numberfield",value:10,name:"totalToCreate",fieldLabel:t("How many users?")},{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,00",name:"credit",value:0,fieldLabel:t("Add")+" "+t("Refill"),readOnly:App.user.isClient},{xtype:"groupusercombo",allowBlank:!App.user.isAdmin,hidden:!App.user.isAdmin},{xtype:"languagecombo",name:"language",value:App.user.language=="pt_BR"?"br":App.user.language,fieldLabel:t("language")},{xtype:"plancombo",hidden:App.user.isClient,allowBlank:App.user.isClient},{xtype:"textfield",name:"prefix_local",fieldLabel:t("prefixlocal"),value:App.user.base_country=="BRL"?"0/55,*/5511/8,*/5511/9":App.user.base_country=="ARG"?"0/54,*/5411/8,15/54911/10,16/54911/10":"",allowBlank:true,emptyText:"match / replace / length",hidden:App.user.isClient},{xtype:"statususercombo",name:"active",fieldLabel:t("Active"),hidden:App.user.isClient,allowBlank:App.user.isClient}]}];b.title=b.title+(b.titleModule?" - "+b.titleModule:"");b.bbar=[{width:150,iconCls:"icon-import-csv",text:t("Bulk")+" "+t("User"),scope:b,handler:b.onBulk}];Ext.window.Window.prototype.initComponent.apply(this,arguments)},onBulk:function(d){var f=this,e=f.list.store;if(!f.down("form").isValid()){return}f.list.setLoading(true);Ext.Ajax.setTimeout(1000000);f.down("form").submit({url:"index.php/user/bulk",scope:f,success:function(c,b){var a=Ext.decode(b.response.responseText);console.log(a);if(a.success){Ext.ux.Alert.alert(t("Success"),a.msg,"success")}else{Ext.ux.Alert.alert(t("Error"),a.errors,"error")}d.enable();f.list.setLoading(false);e.load();f.close()},failure:function(c,b){console.log(b.response.responseText);if(b.response&&Ext.isObject(b.response.responseText)){var a=Ext.decode(b.response.responseText);Ext.ux.Alert.alert(t("Error1"),a.errors,"error")}else{Ext.ux.Alert.alert(t("Error2"),Ext.decode(b.response.responseText).msg,"error",true,10)}d.enable()}})}},0,["userbulk"],["component","box","container","panel","window","userbulk"],{component:true,box:true,container:true,panel:true,window:true,userbulk:true},["widget.userbulk"],0,[MBilling.view.user,"Bulk"],0));(Ext.cmd.derive("MBilling.view.configuration.Controller",Ext.ux.app.ViewController,{onAfterSave:function(g){var j=this,l=j.formPanel.getForm(),f=l.getRecord(),m=f.data.config_key;g=g||j.formPanel;if(!g.idRecord){g.getForm().reset();j.focusFirstField()}j.saveButton.enable();j.updateLotButton&&j.updateLotButton.toggle(false);g.setLoading(false);j.formPanel.collapse();j.store.load();j.logoutKey(m)},logoutKey:function(d){var c=this;if(d=="licence"||d=="base_language"){localStorage.setItem("day","");localStorage.setItem("lang","")}if(d=="licence"){Ext.Ajax.request({url:"index.php/authentication/logoff",success:function(){App.user.logged=false;location.reload()}})}}},0,0,0,0,["controller.configuration"],0,[MBilling.view.configuration,"Controller"],0));(Ext.cmd.derive("MBilling.view.configuration.Module",Ext.ux.panel.Module,{controller:"configuration"},0,["configurationmodule"],["component","box","container","uxpanelmodule","configurationmodule"],{component:true,box:true,container:true,uxpanelmodule:true,configurationmodule:true},["widget.configurationmodule"],0,[MBilling.view.configuration,"Module"],0));(Ext.cmd.derive("MBilling.view.configuration.List",Ext.ux.grid.Panel,{store:"Configuration",fieldSearch:"config_title",comparisonfilter:"ct",initComponent:function(){var b=this;b.allowPrint=false;b.buttonCsv=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowDelete=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("name"),dataIndex:"config_title"},{header:t("value"),dataIndex:"config_value"}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["configurationlist"],["component","box","container","panel","tablepanel","gridpanel","grid","configurationlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,configurationlist:true},["widget.configurationlist"],0,[MBilling.view.configuration,"List"],0));(Ext.cmd.derive("MBilling.view.configuration.Form",Ext.ux.form.Panel,{items:[{name:"config_value",fieldLabel:t("value"),allowBlank:true},{xtype:"textarea",name:"config_description",fieldLabel:t("description"),height:200,anchor:"100%",readOnly:true}]},0,["configurationform"],["component","box","container","panel","form","configurationform"],{component:true,box:true,container:true,panel:true,form:true,configurationform:true},["widget.configurationform"],0,[MBilling.view.configuration,"Form"],0));(Ext.cmd.derive("MBilling.view.general.BooleanCombo",Ext.form.field.ComboBox,{fieldLabel:t("status"),forceSelection:true,editable:false,value:1,store:[[1,t("active")],[0,t("inactive")]]},0,["booleancombo"],["component","box","field","textfield","pickerfield","combobox","combo","booleancombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,booleancombo:true},["widget.booleancombo"],0,[MBilling.view.general,"BooleanCombo"],0));(Ext.cmd.derive("MBilling.view.general.ServicesTypeCombo",Ext.form.field.ComboBox,{fieldLabel:t("status"),forceSelection:true,editable:false,value:"Custom",store:[["disk_space",t("disk_space")],["sipAccountLimit",t("Sip Account Limit")],["calllimit",t("calllimit")],["Custom",t("Custom")]]},0,["servicestypecombo"],["component","box","field","textfield","pickerfield","combobox","combo","servicestypecombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,servicestypecombo:true},["widget.servicestypecombo"],0,[MBilling.view.general,"ServicesTypeCombo"],0));(Ext.cmd.derive("MBilling.view.general.TypeSipForward",Ext.form.field.ComboBox,{fieldLabel:t("Forward"),forceSelection:true,editable:false,value:"",store:[["",t("")],["undefined",t("Undefined")],["sip",t("SIP")],["ivr",t("IVR")],["queue",t("Queue")],["group",t("Group")],["number",t("Number")],["hangup",t("Hangup")],["custom",t("Custom")]]},0,["typesipforwardcombo"],["component","box","field","textfield","pickerfield","combobox","combo","typesipforwardcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,typesipforwardcombo:true},["widget.typesipforwardcombo"],0,[MBilling.view.general,"TypeSipForward"],0));(Ext.cmd.derive("MBilling.view.general.TypeDestination",Ext.form.field.ComboBox,{fieldLabel:t("type"),forceSelection:true,editable:false,value:"",store:[["",t("")],["undefined",t("Undefined")],["sip",t("SIP")],["ivr",t("IVR")],["queue",t("Queue")],["group",t("Group")],["number",t("Number")],["repeat",t("Repeat IVR")],["hangup",t("Hangup")],["custom",t("Custom")]]},0,["typedestinationcombo"],["component","box","field","textfield","pickerfield","combobox","combo","typedestinationcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,typedestinationcombo:true},["widget.typedestinationcombo"],0,[MBilling.view.general,"TypeDestination"],0));(Ext.cmd.derive("MBilling.view.general.PontoVirgula",Ext.form.field.ComboBox,{fieldLabel:t("status"),forceSelection:true,editable:false,value:",",store:[[",",", ("+t("Comma")+")"],[";","; ("+t("Semicolon")+")"]]},0,["pontovirgulacombo"],["component","box","field","textfield","pickerfield","combobox","combo","pontovirgulacombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,pontovirgulacombo:true},["widget.pontovirgulacombo"],0,[MBilling.view.general,"PontoVirgula"],0));(Ext.cmd.derive("MBilling.view.general.StatusCombo",Ext.form.field.ComboBox,{fieldLabel:t("status"),forceSelection:true,editable:false,value:1,store:[[1,t("active")],[0,t("inactive")],[2,t("pending")],[3,t("sent")],[4,t("blocked")]]},0,["statuscombo"],["component","box","field","textfield","pickerfield","combobox","combo","statuscombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,statuscombo:true},["widget.statuscombo"],0,[MBilling.view.general,"StatusCombo"],0));(Ext.cmd.derive("MBilling.view.general.StatusUserCombo",Ext.form.field.ComboBox,{fieldLabel:t("status"),forceSelection:true,editable:false,value:1,store:[[1,t("active")],[0,t("inactive")],[2,t("pending")]]},0,["statususercombo"],["component","box","field","textfield","pickerfield","combobox","combo","statususercombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,statususercombo:true},["widget.statususercombo"],0,[MBilling.view.general,"StatusUserCombo"],0));(Ext.cmd.derive("MBilling.view.general.CallbackCombo",Ext.form.field.ComboBox,{fieldLabel:t("status"),forceSelection:true,editable:false,value:1,store:[[1,t("active")],[2,t("pending")],[3,t("sent")],[4,t("Not working")],[5,t("Complete")]]},0,["callbackcombo"],["component","box","field","textfield","pickerfield","combobox","combo","callbackcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,callbackcombo:true},["widget.callbackcombo"],0,[MBilling.view.general,"CallbackCombo"],0));(Ext.cmd.derive("MBilling.view.general.TypeNoYes",Ext.form.field.ComboBox,{fieldLabel:t("typepaid"),forceSelection:true,editable:false,value:0,store:[[0,t("no")],[1,t("yes")]]},0,["noyescombo"],["component","box","field","textfield","pickerfield","combobox","combo","noyescombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,noyescombo:true},["widget.noyescombo"],0,[MBilling.view.general,"TypeNoYes"],0));(Ext.cmd.derive("MBilling.view.general.TypeYesNo",Ext.form.field.ComboBox,{fieldLabel:t("typepaid"),forceSelection:true,editable:false,value:1,store:[[0,t("no")],[1,t("yes")]]},0,["yesnocombo"],["component","box","field","textfield","pickerfield","combobox","combo","yesnocombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,yesnocombo:true},["widget.yesnocombo"],0,[MBilling.view.general,"TypeYesNo"],0));(Ext.cmd.derive("MBilling.view.general.TypeYesNoString",Ext.form.field.ComboBox,{fieldLabel:t("typepaid"),forceSelection:true,editable:false,value:"yes",store:[["no",t("no")],["yes",t("yes")]]},0,["yesnostringcombo"],["component","box","field","textfield","pickerfield","combobox","combo","yesnostringcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,yesnostringcombo:true},["widget.yesnostringcombo"],0,[MBilling.view.general,"TypeYesNoString"],0));(Ext.cmd.derive("MBilling.view.general.TypeNoYesString",Ext.form.field.ComboBox,{fieldLabel:t("typepaid"),forceSelection:true,editable:false,value:"no",store:[["no",t("no")],["yes",t("yes")]]},0,["noyesstringcombo"],["component","box","field","textfield","pickerfield","combobox","combo","noyesstringcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,noyesstringcombo:true},["widget.noyesstringcombo"],0,[MBilling.view.general,"TypeNoYesString"],0));(Ext.cmd.derive("MBilling.view.general.Typenumber",Ext.form.field.ComboBox,{fieldLabel:t("typenumber"),forceSelection:true,editable:false,value:1,store:[[1,1],[2,2],[3,3],[4,4],[5,5]]},0,["numbercombo"],["component","box","field","textfield","pickerfield","combobox","combo","numbercombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,numbercombo:true},["widget.numbercombo"],0,[MBilling.view.general,"Typenumber"],0));(Ext.cmd.derive("MBilling.view.general.Typelanguage",Ext.form.field.ComboBox,{fieldLabel:t("language"),forceSelection:true,editable:false,value:"en",store:[["",t("undefined")],["br",t("portuguese")],["es",t("spanish")],["en",t("english")]]},0,["languagecombo"],["component","box","field","textfield","pickerfield","combobox","combo","languagecombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,languagecombo:true},["widget.languagecombo"],0,[MBilling.view.general,"Typelanguage"],0));(Ext.cmd.derive("MBilling.view.general.TypeCampaign",Ext.form.field.ComboBox,{fieldLabel:t("type"),forceSelection:true,editable:false,value:1,store:[[1,t("voice")],[0,t("sms")]]},0,["campaigntypecombo"],["component","box","field","textfield","pickerfield","combobox","combo","campaigntypecombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,campaigntypecombo:true},["widget.campaigntypecombo"],0,[MBilling.view.general,"TypeCampaign"],0));(Ext.cmd.derive("MBilling.view.general.TypeFullCampaign",Ext.form.field.ComboBox,{fieldLabel:t("type"),forceSelection:true,editable:false,value:1,store:[[1,t("voice")],[0,t("sms")]]},0,["campaigntypefullcombo"],["component","box","field","textfield","pickerfield","combobox","combo","campaigntypefullcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,campaigntypefullcombo:true},["widget.campaigntypefullcombo"],0,[MBilling.view.general,"TypeFullCampaign"],0));(Ext.cmd.derive("MBilling.view.general.TypeBoleto",Ext.form.field.ComboBox,{fieldLabel:t("status"),forceSelection:true,editable:false,value:"D",store:[["D",t("no")],["P",t("yes")]]},0,["boletocombo"],["component","box","field","textfield","pickerfield","combobox","combo","boletocombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,boletocombo:true},["widget.boletocombo"],0,[MBilling.view.general,"TypeBoleto"],0));(Ext.cmd.derive("MBilling.view.general.RestrictionCombo",Ext.form.field.ComboBox,{fieldLabel:t("status"),forceSelection:true,editable:false,value:0,store:[[0,t("inactive")],[1,t("cantCallRestrictedNumbers")],[2,t("canOnlyCallRestrictedNumbers")]]},0,["restrictioncombo"],["component","box","field","textfield","pickerfield","combobox","combo","restrictioncombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,restrictioncombo:true},["widget.restrictioncombo"],0,[MBilling.view.general,"RestrictionCombo"],0));(Ext.cmd.derive("MBilling.view.general.CountryISOCombo",Ext.form.field.ComboBox,{forceSelection:true,editable:true,listeners:{focus:function(b){b.expand()}},store:[["AFG",t("Afghanistan")],["ALA",t("Åland Islands")],["ALB",t("Albania")],["DZA",t("Algeria")],["ASM",t("American Samoa")],["AND",t("Andorra")],["AGO",t("Angola")],["AIA",t("Anguilla")],["ATA",t("Antarctica")],["ATG",t("Antigua and Barbuda")],["ARG",t("Argentina")],["ARM",t("Armenia")],["ABW",t("Aruba")],["AUS",t("Australia")],["AUT",t("Austria")],["AZE",t("Azerbaijan")],["BHS",t("Bahamas")],["BHR",t("Bahrain")],["BGD",t("Bangladesh")],["BRB",t("Barbados")],["BLR",t("Belarus")],["BEL",t("Belgium")],["BLZ",t("Belize")],["BEN",t("Benin")],["BMU",t("Bermuda")],["BTN",t("Bhutan")],["BOL",t("Bolivia, Plurinational State of")],["BES",t("Bonaire, Sint Eustatius and Saba")],["BIH",t("Bosnia and Herzegovina")],["BWA",t("Botswana")],["BVT",t("Bouvet Island")],["BRL",t("Brazil")],["IOT",t("British Indian Ocean Territory")],["BRN",t("Brunei Darussalam")],["BGR",t("Bulgaria")],["BFA",t("Burkina Faso")],["BDI",t("Burundi")],["KHM",t("Cambodia")],["CMR",t("Cameroon")],["CAN",t("Canada")],["CPV",t("Cape Verde")],["CYM",t("Cayman Islands")],["CAF",t("Central African Republic")],["TCD",t("Chad")],["CHL",t("Chile")],["CHN",t("China")],["CXR",t("Christmas Island")],["CCK",t("Cocos (Keeling) Islands")],["COL",t("Colombia")],["COM",t("Comoros")],["COG",t("Congo")],["COD",t("Congo, the Democratic Republic of the")],["COK",t("Cook Islands")],["CRI",t("Costa Rica")],["CIV",t("Côte dIvoire")],["HRV",t("Croatia")],["CUB",t("Cuba")],["CUW",t("Curaçao")],["CYP",t("Cyprus")],["CZE",t("Czech Republic")],["DNK",t("Denmark")],["DJI",t("Djibouti")],["DMA",t("Dominica")],["DOM",t("Dominican Republic")],["ECU",t("Ecuador")],["EGY",t("Egypt")],["SLV",t("El Salvador")],["GNQ",t("Equatorial Guinea")],["ERI",t("Eritrea")],["EST",t("Estonia")],["ETH",t("Ethiopia")],["FLK",t("Falkland Islands (Malvinas)")],["FRO",t("Faroe Islands")],["FJI",t("Fiji")],["FIN",t("Finland")],["FRA",t("France")],["GUF",t("French Guiana")],["PYF",t("French Polynesia")],["ATF",t("French Southern Territories")],["GAB",t("Gabon")],["GMB",t("Gambia")],["GEO",t("Georgia")],["DEU",t("Germany")],["GHA",t("Ghana")],["GIB",t("Gibraltar")],["GRC",t("Greece")],["GRL",t("Greenland")],["GRD",t("Grenada")],["GLP",t("Guadeloupe")],["GUM",t("Guam")],["GTM",t("Guatemala")],["GGY",t("Guernsey")],["GIN",t("Guinea")],["GNB",t("Guinea-Bissau")],["GUY",t("Guyana")],["HTI",t("Haiti")],["HMD",t("Heard Island and McDonald Islands")],["VAT",t("Holy See (Vatican City State)")],["HND",t("Honduras")],["HKG",t("Hong Kong")],["HUN",t("Hungary")],["ISL",t("Iceland")],["IND",t("India")],["IDN",t("Indonesia")],["IRN",t("Iran, Islamic Republic of")],["IRQ",t("Iraq")],["IRL",t("Ireland")],["IMN",t("Isle of Man")],["ISR",t("Israel")],["ITA",t("Italy")],["JAM",t("Jamaica")],["JPN",t("Japan")],["JEY",t("Jersey")],["JOR",t("Jordan")],["KAZ",t("Kazakhstan")],["KEN",t("Kenya")],["KIR",t("Kiribati")],["PRK",t("Korea, Democratic Peoples Republic of")],["KOR",t("Korea, Republic of")],["KWT",t("Kuwait")],["KGZ",t("Kyrgyzstan")],["LAO",t("Lao Peoples Democratic Republic")],["LVA",t("Latvia")],["LBN",t("Lebanon")],["LSO",t("Lesotho")],["LBR",t("Liberia")],["LBY",t("Libya")],["LIE",t("Liechtenstein")],["LTU",t("Lithuania")],["LUX",t("Luxembourg")],["MAC",t("Macao")],["MKD",t("Macedonia, the former Yugoslav Republic of")],["MDG",t("Madagascar")],["MWI",t("Malawi")],["MYS",t("Malaysia")],["MDV",t("Maldives")],["MLI",t("Mali")],["MLT",t("Malta")],["MHL",t("Marshall Islands")],["MTQ",t("Martinique")],["MRT",t("Mauritania")],["MUS",t("Mauritius")],["MYT",t("Mayotte")],["MEX",t("Mexico")],["FSM",t("Micronesia, Federated States of")],["MDA",t("Moldova, Republic of")],["MCO",t("Monaco")],["MNG",t("Mongolia")],["MNE",t("Montenegro")],["MSR",t("Montserrat")],["MAR",t("Morocco")],["MOZ",t("Mozambique")],["MMR",t("Myanmar")],["NAM",t("Namibia")],["NRU",t("Nauru")],["NPL",t("Nepal")],["NLD",t("Netherlands")],["NCL",t("New Caledonia")],["NZL",t("New Zealand")],["NIC",t("Nicaragua")],["NER",t("Niger")],["NGA",t("Nigeria")],["NIU",t("Niue")],["NFK",t("Norfolk Island")],["MNP",t("Northern Mariana Islands")],["NOR",t("Norway")],["OMN",t("Oman")],["PAK",t("Pakistan")],["PLW",t("Palau")],["PSE",t("Palestinian Territory, Occupied")],["PAN",t("Panama")],["PNG",t("Papua New Guinea")],["PRY",t("Paraguay")],["PER",t("Peru")],["PHL",t("Philippines")],["PCN",t("Pitcairn")],["POL",t("Poland")],["PRT",t("Portugal")],["PRI",t("Puerto Rico")],["QAT",t("Qatar")],["REU",t("Réunion")],["ROU",t("Romania")],["RUS",t("Russian Federation")],["RWA",t("Rwanda")],["BLM",t("Saint Barthélemy")],["SHN",t("Saint Helena, Ascension and Tristan da Cunha")],["KNA",t("Saint Kitts and Nevis")],["LCA",t("Saint Lucia")],["MAF",t("Saint Martin (French part)")],["SPM",t("Saint Pierre and Miquelon")],["VCT",t("Saint Vincent and the Grenadines")],["WSM",t("Samoa")],["SMR",t("San Marino")],["STP",t("Sao Tome and Principe")],["SAU",t("Saudi Arabia")],["SEN",t("Senegal")],["SRB",t("Serbia")],["SYC",t("Seychelles")],["SLE",t("Sierra Leone")],["SGP",t("Singapore")],["SXM",t("Sint Maarten (Dutch part)")],["SVK",t("Slovakia")],["SVN",t("Slovenia")],["SLB",t("Solomon Islands")],["SOM",t("Somalia")],["ZAF",t("South Africa")],["SGS",t("South Georgia and the South Sandwich Islands")],["SSD",t("South Sudan")],["ESP",t("Spain")],["LKA",t("Sri Lanka")],["SDN",t("Sudan")],["SUR",t("Suriname")],["SJM",t("Svalbard and Jan Mayen")],["SWZ",t("Swaziland")],["SWE",t("Sweden")],["CHE",t("Switzerland")],["SYR",t("Syrian Arab Republic")],["TWN",t("Taiwan, Province of China")],["TJK",t("Tajikistan")],["TZA",t("Tanzania, United Republic of")],["THA",t("Thailand")],["TLS",t("Timor-Leste")],["TGO",t("Togo")],["TKL",t("Tokelau")],["TON",t("Tonga")],["TTO",t("Trinidad and Tobago")],["TUN",t("Tunisia")],["TUR",t("Turkey")],["TKM",t("Turkmenistan")],["TCA",t("Turks and Caicos Islands")],["TUV",t("Tuvalu")],["UGA",t("Uganda")],["UKR",t("Ukraine")],["ARE",t("United Arab Emirates")],["GBR",t("United Kingdom")],["USA",t("United States")],["UMI",t("United States Minor Outlying Islands")],["URY",t("Uruguay")],["UZB",t("Uzbekistan")],["VUT",t("Vanuatu")],["VEN",t("Venezuela, Bolivarian Republic of")],["VNM",t("Viet Nam")],["VGB",t("Virgin Islands, British")],["VIR",t("Virgin Islands, U.S.")],["WLF",t("Wallis and Futuna")],["ESH",t("Western Sahara")],["YEM",t("Yemen")],["ZMB",t("Zambia")],["ZWE",t("Zimbabwe")]]},0,["countryisocombo"],["component","box","field","textfield","pickerfield","combobox","combo","countryisocombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,countryisocombo:true},["widget.countryisocombo"],0,[MBilling.view.general,"CountryISOCombo"],0));(Ext.cmd.derive("MBilling.view.general.CountryCombo",Ext.form.field.ComboBox,{fieldLabel:t("Country"),forceSelection:true,editable:true,allowBlank:true,listeners:{focus:function(b){b.expand()}},store:[["",t("Select")],["93",t("Afghanistan")],["355",t("Albania")],["213",t("Algeria")],["684",t("American Samoa")],["376",t("Andorra")],["244",t("Angola")],["1264",t("Anguilla")],["672",t("Antarctica")],["1268",t("Antigua And Barbuda")],["54",t("Argentina")],["374",t("Armenia")],["297",t("Aruba")],["61",t("Australia")],["43",t("Austria")],["994",t("Azerbaijan")],["1242",t("Bahamas")],["973",t("Bahrain")],["880",t("Bangladesh")],["1246",t("Barbados")],["375",t("Belarus")],["32",t("Belgium")],["501",t("Belize")],["229",t("Benin")],["1441",t("Bermuda")],["975",t("Bhutan")],["591",t("Bolivia")],["387",t("Bosnia And Herzegovina")],["267",t("Botswana")],["55",t("Brazil")],["1284",t("British Indian Ocean Territory")],["673",t("Brunei Darussalam")],["359",t("Bulgaria")],["226",t("Burkina Faso")],["257",t("Burundi")],["855",t("Cambodia")],["237",t("Cameroon")],["238",t("Cape Verde")],["1345",t("Cayman Islands")],["236",t("Central African Republic")],["235",t("Chad")],["56",t("Chile")],["86",t("China")],["618",t("Christmas Island")],["61",t("Cocos (Keeling); Islands")],["57",t("Colombia")],["269",t("Comoros")],["242",t("Congo")],["243",t("Congo, The Democratic Republic Of The")],["682",t("Cook Islands")],["506",t("Costa Rica")],["385",t("Croatia")],["53",t("Cuba")],["357",t("Cyprus")],["420",t("Czech Republic")],["45",t("Denmark")],["253",t("Djibouti")],["1767",t("Dominica")],["1809",t("Dominican Republic")],["593",t("Ecuador")],["20",t("Egypt")],["503",t("El Salvador")],["240",t("Equatorial Guinea")],["291",t("Eritrea")],["372",t("Estonia")],["251",t("Ethiopia")],["500",t("Falkland Islands (Malvinas)")],["298",t("Faroe Islands")],["679",t("Fiji")],["358",t("Finland")],["33",t("France")],["596",t("French Guiana")],["594",t("French Polynesia")],["689",t("French Southern Territories")],["241",t("Gabon")],["220",t("Gambia")],["995",t("Georgia")],["49",t("Germany")],["233",t("Ghana")],["350",t("Gibraltar")],["30",t("Greece")],["299",t("Greenland")],["1473",t("Grenada")],["590",t("Guadeloupe")],["1671",t("Guam")],["502",t("Guatemala")],["224",t("Guinea")],["245",t("Guinea-Bissau")],["592",t("Guyana")],["509",t("Haiti")],["504",t("Honduras")],["852",t("Hong Kong")],["36",t("Hungary")],["354",t("Iceland")],["91",t("India")],["62",t("Indonesia")],["98",t("Iran, Islamic Republic Of")],["964",t("Iraq")],["353",t("Ireland")],["972",t("Israel")],["39",t("Italy")],["1876",t("Jamaica")],["81",t("Japan")],["962",t("Jordan")],["7",t("Kazakhstan")],["254",t("Kenya")],["686",t("Kiribati")],["850",t("Korea, Democratic Peoples Republic Of")],["82",t("Korea, Republic of")],["965",t("Kuwait")],["996",t("Kyrgyzstan")],["856",t("Lao Peoples Democratic Republic")],["371",t("Latvia")],["961",t("Lebanon")],["266",t("Lesotho")],["231",t("Liberia")],["218",t("Libyan Arab Jamahiriya")],["423",t("Liechtenstein")],["370",t("Lithuania")],["352",t("Luxembourg")],["853",t("Macao")],["389",t("Macedonia, The Former Yugoslav Republic Of")],["261",t("Madagascar")],["265",t("Malawi")],["60",t("Malaysia")],["960",t("Maldives")],["223",t("Mali")],["356",t("Malta")],["692",t("Marshall islands")],["596",t("Martinique")],["222",t("Mauritania")],["230",t("Mauritius")],["269",t("Mayotte")],["52",t("Mexico")],["691",t("Micronesia, Federated States Of")],["1808",t("Moldova, Republic Of")],["377",t("Monaco")],["976",t("Mongolia")],["1664",t("Montserrat")],["212",t("Morocco")],["258",t("Mozambique")],["95",t("Myanmar")],["264",t("Namibia")],["674",t("Nauru")],["977",t("Nepal")],["31",t("Netherlands")],["599",t("Netherlands Antilles")],["687",t("New Caledonia")],["64",t("New Zealand")],["505",t("Nicaragua")],["227",t("Niger")],["234",t("Nigeria")],["683",t("Niue")],["672",t("Norfolk Island")],["1670",t("Northern Mariana Islands")],["47",t("Norway")],["968",t("Oman")],["92",t("Pakistan")],["680",t("Palau")],["970",t("Palestinian Territory, Occupied")],["507",t("Panama")],["675",t("Papua New Guinea")],["595",t("Paraguay")],["51",t("Peru")],["63",t("Philippines")],["48",t("Poland")],["351",t("Portugal")],["1787",t("Puerto Rico")],["974",t("Qatar")],["262",t("Reunion")],["40",t("Romania")],["7",t("Russian Federation")],["250",t("Rwanda")],["290",t("SaINT Helena")],["1869",t("SaINT Kitts And Nevis")],["1758",t("SaINT Lucia")],["508",t("SaINT Pierre And Miquelon")],["1784",t("SaINT Vincent And The Grenadines")],["685",t("Samoa")],["378",t("San Marino")],["239",t("São Tomé And Principe")],["966",t("Saudi Arabia")],["221",t("Senegal")],["248",t("Seychelles")],["232",t("Sierra Leone")],["65",t("Singapore")],["421",t("Slovakia")],["386",t("Slovenia")],["677",t("Solomon Islands")],["252",t("Somalia")],["27",t("South Africa")],["34",t("Spain")],["94",t("Sri Lanka")],["249",t("Sudan")],["597",t("Suriname")],["268",t("Swaziland")],["46",t("Sweden")],["41",t("Switzerland")],["963",t("Syrian Arab Republic")],["886",t("Taiwan, Province Of China")],["992",t("Tajikistan")],["255",t("Tanzania, United Republic Of")],["66",t("Thailand")],["670",t("Timor-Leste")],["228",t("Togo")],["690",t("Tokelau")],["676",t("Tonga")],["1868",t("Trinidad And Tobago")],["216",t("Tunisia")],["90",t("Turkey")],["993",t("Turkmenistan")],["1649",t("Turks And Caicos Islands")],["688",t("Tuvalu")],["256",t("Uganda")],["380",t("Ukraine")],["971",t("United Arab Emirates")],["44",t("United Kingdom")],["1",t("United States/Canada")],["598",t("Uruguay")],["998",t("Uzbekistan")],["678",t("Vanuatu")],["58",t("Venezuela")],["84",t("Vietnam")],["1284",t("Virgin Islands, British")],["808",t("Virgin Islands, U.S.")],["681",t("Wallis And Futuna")],["967",t("Yemen")],["260",t("Zambia")],["263",t("Zimbabwe")],["35818",t("Aland Islands")],["441481",t("Guernsey")],["441624",t("Isle of Man")],["441534",t("Jersey")],["382",t("Montenegro, Republic of")],["381",t("Serbia, Republic of")]]},0,["countrycombo"],["component","box","field","textfield","pickerfield","combobox","combo","countrycombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,countrycombo:true},["widget.countrycombo"],0,[MBilling.view.general,"CountryCombo"],0));(Ext.cmd.derive("MBilling.view.general.GroupCombo",Ext.form.field.ComboBox,{fieldLabel:t("group"),value:"config_group_title",forceSelection:true,editable:false,store:[["global","global"],["callback","callback"],["agi-conf1","agi-conf1"],["agi-conf2","agi-conf2"]]},0,["groupcombo"],["component","box","field","textfield","pickerfield","combobox","combo","groupcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,groupcombo:true},["widget.groupcombo"],0,[MBilling.view.general,"GroupCombo"],0));(Ext.cmd.derive("MBilling.view.general.LcrtypeCombo",Ext.form.field.ComboBox,{fieldLabel:t("lcrtype"),forceSelection:true,editable:false,value:1,store:[[1,t("LCRAccordingtothebuyerPrice")],[0,t("LCRAccordingtothesellerPrice")]]},0,["lcrtypecombo"],["component","box","field","textfield","pickerfield","combobox","combo","lcrtypecombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,lcrtypecombo:true},["widget.lcrtypecombo"],0,[MBilling.view.general,"LcrtypeCombo"],0));(Ext.cmd.derive("MBilling.view.general.LcrtypeFullCombo",Ext.form.field.ComboBox,{forceSelection:true,editable:false,fieldLabel:t("lcrtype"),value:1,store:[[1,t("LCRAccordingtothebuyerPrice")],[0,t("LCRAccordingtothesellerPrice")],[2,t("Load Balancer")]]},0,["lcrtypefullcombo"],["component","box","field","textfield","pickerfield","combobox","combo","lcrtypefullcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,lcrtypefullcombo:true},["widget.lcrtypefullcombo"],0,[MBilling.view.general,"LcrtypeFullCombo"],0));(Ext.cmd.derive("MBilling.view.general.OfferTypeCombo",Ext.form.field.ComboBox,{fieldLabel:t("offertype"),forceSelection:true,editable:false,value:0,store:[[0,t("unlimitedcalls")],[1,t("numberfreecalls")],[2,t("freeseconds")]]},0,["offertypecombo"],["component","box","field","textfield","pickerfield","combobox","combo","offertypecombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,offertypecombo:true},["widget.offertypecombo"],0,[MBilling.view.general,"OfferTypeCombo"],0));(Ext.cmd.derive("MBilling.view.general.BillingTypeCombo",Ext.form.field.ComboBox,{fieldLabel:t("billingtype"),forceSelection:true,editable:false,value:0,store:[[0,t("monthly")],[1,t("weekly")]]},0,["billingtypecombo"],["component","box","field","textfield","pickerfield","combobox","combo","billingtypecombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,billingtypecombo:true},["widget.billingtypecombo"],0,[MBilling.view.general,"BillingTypeCombo"],0));(Ext.cmd.derive("MBilling.view.general.SipCombo",Ext.form.field.ComboBox,{fieldLabel:t("providertech"),forceSelection:true,editable:false,value:"sip",store:[["sip","sip"],["dahdi","dahdi"],["khomp","khomp"],["iax2","iax2"],["dgv","dgv"],["ooh323","ooh323"],["extra","extra"],["Dongle","Dongle"],["Local","Local"]]},0,["sipcombo"],["component","box","field","textfield","pickerfield","combobox","combo","sipcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,sipcombo:true},["widget.sipcombo"],0,[MBilling.view.general,"SipCombo"],0));(Ext.cmd.derive("MBilling.view.general.TypePaymentCombo",Ext.form.field.ComboBox,{fieldLabel:t("typepaid"),forceSelection:true,editable:false,value:0,store:[[0,t("prepaid")],[1,t("pospaid")]]},0,["typepaymentcombo"],["component","box","field","textfield","pickerfield","combobox","combo","typepaymentcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,typepaymentcombo:true},["widget.typepaymentcombo"],0,[MBilling.view.general,"TypePaymentCombo"],0));(Ext.cmd.derive("MBilling.view.general.CampaignSendCombo",Ext.form.field.ComboBox,{fieldLabel:t("type"),forceSelection:true,editable:false,displayField:"name",valueField:"id",value:"CALL1",store:{fields:["id","name"],data:[{id:"CALL1",name:t("Select type"),showFields:["type"]},{id:"SMS",name:"SMS",showFields:["type","sms_text","csv_path","numbers","startingdate","startingtime"]},{id:"CALL",name:"CALL",showFields:["type","audio_path","csv_path","numbers","startingdate","startingtime"]}]}},0,["campaignsendcombo"],["component","box","field","textfield","pickerfield","combobox","combo","campaignsendcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,campaignsendcombo:true},["widget.campaignsendcombo"],0,[MBilling.view.general,"CampaignSendCombo"],0));(Ext.cmd.derive("MBilling.view.general.PaymentCountryCombo",Ext.form.field.ComboBox,{fieldLabel:t("typepaid"),value:"Brasil",forceSelection:true,editable:true,listeners:{focus:function(b){b.expand()}},store:[["Argentina","Argentina"],["Brasil","Brasil"],["Colombia","Colombia"],["Latino America","Latino America"],["Global","Global"]]},0,["paymentcountrycombo"],["component","box","field","textfield","pickerfield","combobox","combo","paymentcountrycombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,paymentcountrycombo:true},["widget.paymentcountrycombo"],0,[MBilling.view.general,"PaymentCountryCombo"],0));(Ext.cmd.derive("MBilling.view.general.BoletoBanckCombo",Ext.form.field.ComboBox,{fieldLabel:t("Banco"),forceSelection:true,editable:false,value:"cef",store:[["cef","Caixa Economica SICOB"],["bradesco","Bradesco"]]},0,["boletobanckcombo"],["component","box","field","textfield","pickerfield","combobox","combo","boletobanckcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,boletobanckcombo:true},["widget.boletobanckcombo"],0,[MBilling.view.general,"BoletoBanckCombo"],0));(Ext.cmd.derive("MBilling.view.general.PaymentBanckCombo",Ext.form.field.ComboBox,{fieldLabel:t("typepaid"),forceSelection:true,editable:false,value:"Banco do Brasil",store:[["Banco do Brasil","Banco do Brasil"],["bradesco","Bradesco"],["hsbc","Hsbc"],["itau","Itau"],["santander","Santander"],["unibanco","Unibanco"],["cef","Caixa Economica SICOB"],["cef_sinco","Caixa Economica SINCO"],["cef_sigcb","Caixa Economica SIGCB"]]},0,["paymentbanckcombo"],["component","box","field","textfield","pickerfield","combobox","combo","paymentbanckcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,paymentbanckcombo:true},["widget.paymentbanckcombo"],0,[MBilling.view.general,"PaymentBanckCombo"],0));(Ext.cmd.derive("MBilling.view.templateMail.Controller",Ext.ux.app.ViewController,{onAfterSave:function(d){var c=this;d=d||c.formPanel;if(!d.idRecord){d.getForm().reset();c.focusFirstField()}c.saveButton.enable();c.updateLotButton&&c.updateLotButton.toggle(false);d.setLoading(false);c.store.load()},onEdit:function(){var b=this;b.lookupReference("generalTab").show();Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)}},0,0,0,0,["controller.templatemail"],0,[MBilling.view.templateMail,"Controller"],0));(Ext.cmd.derive("MBilling.view.templateMail.Module",Ext.ux.panel.Module,{controller:"templatemail",cfgEast:{flex:9}},0,["templatemailmodule"],["component","box","container","uxpanelmodule","templatemailmodule"],{component:true,box:true,container:true,uxpanelmodule:true,templatemailmodule:true},["widget.templatemailmodule"],0,[MBilling.view.templateMail,"Module"],0));(Ext.cmd.derive("MBilling.view.templateMail.List",Ext.ux.grid.Panel,{store:"TemplateMail",initComponent:function(){var b=this;b.allowPrint=false;b.buttonCsv=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowDelete=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("type"),dataIndex:"mailtype",flex:3},{header:t("Language"),renderer:Helper.Util.formatLanguageImage,dataIndex:"language",flex:2},{header:t("subject"),dataIndex:"subject",flex:7}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["templatemaillist"],["component","box","container","panel","tablepanel","gridpanel","grid","templatemaillist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,templatemaillist:true},["widget.templatemaillist"],0,[MBilling.view.templateMail,"List"],0));(Ext.cmd.derive("MBilling.view.templateMail.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true}},items:[{title:t("general"),reference:"generalTab",items:[{name:"fromname",fieldLabel:t("fromname")},{name:"fromemail",fieldLabel:t("fromemail")},{name:"subject",fieldLabel:t("subject")}]},{title:t("Email body"),items:[{hideLabel:true,xtype:"htmleditor",name:"messagehtml",fieldLabel:t("description"),height:1000,anchor:"100%"}]},{title:t("Variables"),items:[{xtype:"displayfield",fieldLabel:t("username"),value:'$login$',allowBlank:true},{xtype:"displayfield",fieldLabel:t("password"),value:'$password$',allowBlank:true},{xtype:"displayfield",fieldLabel:t("email"),value:'$email$',allowBlank:true},{xtype:"displayfield",fieldLabel:t("firstname"),value:'$firstname$',allowBlank:true},{xtype:"displayfield",fieldLabel:t("lastname"),value:'$lastname$',allowBlank:true},{xtype:"displayfield",fieldLabel:t("credit"),value:'$credit$',allowBlank:true},{xtype:"displayfield",fieldLabel:t("date"),value:'$time$',allowBlank:true},{xtype:"displayfield",fieldLabel:t("description"),value:'$description$',allowBlank:true},{xtype:"displayfield",fieldLabel:t("Url to cancel email credit notification"),value:'$cancel_credit_notification_email$',allowBlank:true}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["templatemailform"],["component","box","container","panel","form","templatemailform"],{component:true,box:true,container:true,panel:true,form:true,templatemailform:true},["widget.templatemailform"],0,[MBilling.view.templateMail,"Form"],0));(Ext.cmd.derive("MBilling.view.logUsers.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.logusers"],0,[MBilling.view.logUsers,"Controller"],0));(Ext.cmd.derive("MBilling.view.logUsers.Module",Ext.ux.panel.Module,{controller:"logusers"},0,["logusersmodule"],["component","box","container","uxpanelmodule","logusersmodule"],{component:true,box:true,container:true,uxpanelmodule:true,logusersmodule:true},["widget.logusersmodule"],0,[MBilling.view.logUsers,"Module"],0));(Ext.cmd.derive("MBilling.view.logUsers.List",Ext.ux.grid.Panel,{store:"LogUsers",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.allowDelete=false;b.allowCreate=false;b.allowUpdate=false;b.columns=[{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isOperator,hideable:!App.user.isOperator},{header:t("action"),dataIndex:"idLogActionsname",renderer:Helper.Util.translate,flex:3},{header:t("description"),dataIndex:"description",flex:7},{header:t("IP"),dataIndex:"ip",flex:4},{header:t("date"),renderer:Helper.Util.formatDateTime,dataIndex:"date",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["loguserslist"],["component","box","container","panel","tablepanel","gridpanel","grid","loguserslist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,loguserslist:true},["widget.loguserslist"],0,[MBilling.view.logUsers,"List"],0));(Ext.cmd.derive("MBilling.view.logUsers.Form",Ext.ux.form.Panel,{fieldsHideEdit:["cid"],initComponent:function(){var b=this;b.items=[{xtype:"usercombo",allowBlank:true,readOnly:true},{name:"id_log_actions",fieldLabel:t("action"),readOnly:true},{name:"ip",fieldLabel:t("ip"),readOnly:true},{xtype:"textareafield",name:"description",fieldLabel:t("description"),height:400,anchor:"100%",allowBlank:true,readOnly:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["logusersform"],["component","box","container","panel","form","logusersform"],{component:true,box:true,container:true,panel:true,form:true,logusersform:true},["widget.logusersform"],0,[MBilling.view.logUsers,"Form"],0));(Ext.cmd.derive("MBilling.view.provider.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.provider"],0,[MBilling.view.provider,"Controller"],0));(Ext.cmd.derive("MBilling.view.provider.Combo",Ext.form.field.ComboBox,{name:"id_provider",fieldLabel:t("provider"),forceSelection:true,editable:false,displayField:"provider_name",valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Provider",{proxy:{type:"uxproxy",module:"provider",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["providercombo"],["component","box","field","textfield","pickerfield","combobox","combo","providercombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,providercombo:true},["widget.providercombo"],0,[MBilling.view.provider,"Combo"],0));(Ext.cmd.derive("MBilling.view.provider.Module",Ext.ux.panel.Module,{controller:"provider"},0,["providermodule"],["component","box","container","uxpanelmodule","providermodule"],{component:true,box:true,container:true,uxpanelmodule:true,providermodule:true},["widget.providermodule"],0,[MBilling.view.provider,"Module"],0));(Ext.cmd.derive("MBilling.view.provider.List",Ext.ux.grid.Panel,{store:"Provider",initComponent:function(){var b=this;b.columns=b.columns||[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("name"),dataIndex:"provider_name"},{header:t("description"),dataIndex:"description"},{header:t("credit"),dataIndex:"credit",renderer:Helper.Util.formatMoneyDecimal},{header:t("creationdate"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"creationdate"}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["providerlist"],["component","box","container","panel","tablepanel","gridpanel","grid","providerlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,providerlist:true},["widget.providerlist"],0,[MBilling.view.provider,"List"],0));(Ext.cmd.derive("MBilling.view.provider.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["provider_name"],initComponent:function(){var b=this;b.items=[{name:"provider_name",fieldLabel:t("name")},{xtype:"moneyfield",name:"credit",mask:App.user.currency+" #9.999.990,00",fieldLabel:t("credit"),value:"0"},{xtype:"noyescombo",name:"credit_control",fieldLabel:t("Credit")+" "+t("control"),hidden:App.user.isClient},{xtype:"textareafield",name:"description",fieldLabel:t("description"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["providerform"],["component","box","container","panel","form","providerform"],{component:true,box:true,container:true,panel:true,form:true,providerform:true},["widget.providerform"],0,[MBilling.view.provider,"Form"],0));(Ext.cmd.derive("MBilling.view.provider.Lookup",Ext.ux.form.field.Lookup,{name:"id_provider",fieldLabel:t("Provider"),displayField:"idProviderprovider_name",displayFieldList:"provider_name",gridConfig:{xtype:"providerlist",fieldSearch:"username",columns:[{header:t("name"),dataIndex:"provider_name"},{header:t("description"),dataIndex:"description"}]}},0,["providerlookup"],["component","box","container","fieldcontainer","providerlookup"],{component:true,box:true,container:true,fieldcontainer:true,providerlookup:true},["widget.providerlookup"],0,[MBilling.view.provider,"Lookup"],0));(Ext.cmd.derive("MBilling.view.plan.Controller",Ext.ux.app.ViewController,{init:function(){var b=this;b.control({noyescombo:{select:b.onSelectType}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectType:function(c,d){this.showFieldsRelated(d.getData().showFields)},showFieldsRelated:function(j){var l=this,g=l.formPanel.getForm().getFields(),f=l.formPanel.getForm().findField("ini_credit"),m=l.formPanel.getForm();g.each(function(a){if(a.name=="signup"){a.value==1?f.show():f.hide()}})},onEdit:function(){var f=this,d=f.formPanel.getForm().findField("ini_credit"),e=f.formPanel.getForm().findField("signup");Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments);e.value==1?d.show():d.hide()}},0,0,0,0,["controller.plan"],0,[MBilling.view.plan,"Controller"],0));(Ext.cmd.derive("MBilling.view.plan.Combo",Ext.form.field.ComboBox,{name:"id_plan",fieldLabel:t("plan"),displayField:"name",valueField:"id",forceSelection:true,editable:true,listeners:{focus:function(b){b.expand()}},initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Plan",{proxy:{type:"uxproxy",module:"plan",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["plancombo"],["component","box","field","textfield","pickerfield","combobox","combo","plancombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,plancombo:true},["widget.plancombo"],0,[MBilling.view.plan,"Combo"],0));(Ext.cmd.derive("MBilling.view.plan.Module",Ext.ux.panel.Module,{controller:"plan"},0,["planmodule"],["component","box","container","uxpanelmodule","planmodule"],{component:true,box:true,container:true,uxpanelmodule:true,planmodule:true},["widget.planmodule"],0,[MBilling.view.plan,"Module"],0));(Ext.cmd.derive("MBilling.view.plan.List",Ext.ux.grid.Panel,{store:"Plan",fieldSearch:"name",initComponent:function(){var b=this;b.columns=b.columns||[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("name"),dataIndex:"name",flex:4},{header:t("lcrtype"),dataIndex:"lcrtype",comboRelated:"lcrtypecombo",renderer:Helper.Util.formatLcrtype,flex:4,filter:{type:"list",options:[[1,t("LCRAccordingtothebuyerPrice")],[0,t("LCRAccordingtothesellerPrice")],[2,t("Load Balancer")]]}},{header:t("Tech Prefx"),dataIndex:"techprefix",flex:4,hidden:!App.user.isAdmin},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"creationdate",flex:4},{header:t("Port. Celular"),dataIndex:"portabilidadeMobile",flex:2,renderer:Helper.Util.formattyyesno,filter:{type:"list",options:[[0,t("no")],[1,t("yes")]]},hidden:App.user.language!="pt_BR",hideable:false},{header:t("Port. Fixo"),dataIndex:"portabilidadeFixed",flex:2,renderer:Helper.Util.formattyyesno,filter:{type:"list",options:[[0,t("no")],[1,t("yes")]]},hidden:App.user.language!="pt_BR",hideable:false}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["planlist"],["component","box","container","panel","tablepanel","gridpanel","grid","planlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,planlist:true},["widget.planlist"],0,[MBilling.view.plan,"List"],0));(Ext.cmd.derive("MBilling.view.plan.Form",Ext.ux.form.Panel,{labelWidthFields:115,fieldsHideUpdateLot:["name"],initComponent:function(){var b=this;b.defaults={labelWidth:142};b.items=[{name:"name",fieldLabel:t("name"),maxLength:100},{xtype:"lcrtypefullcombo",name:"lcrtype",fieldLabel:t("lcrtype"),allowBlank:true},{xtype:"numberfield",name:"tariff_limit",minValue:1,value:1,fieldLabel:t("Tariff Find Limit"),hidden:!App.user.isAdmin},{xtype:"noyescombo",name:"signup",fieldLabel:t("useInSignup"),allowBlank:true},{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,00",name:"ini_credit",fieldLabel:t("Initial Credit to new users"),allowBlank:true,hidden:true,value:0},{xtype:"yesnocombo",name:"play_audio",fieldLabel:t("Notices with audio"),allowBlank:true,hidden:App.user.isClient},{style:"margin-top:25px",xtype:"fieldset",title:t("Ativar portabilidade?"),collapsible:true,collapsed:false,hidden:App.user.language!="pt_BR",defaults:{labelWidth:190,anchor:"100%",layout:{type:"hbox",labelAlign:b.labelAlignFields}},items:[{xtype:"noyescombo",name:"portabilidadeMobile",fieldLabel:t("Para Celular"),allowBlank:true,hidden:App.user.language!="pt_BR"},{xtype:"noyescombo",name:"portabilidadeFixed",fieldLabel:t("Para Fixo"),allowBlank:true,hidden:App.user.language!="pt_BR"}]},{name:"techprefix",fieldLabel:t("Tech Prefix"),allowBlank:true,maxLength:5,minLength:5,hidden:!App.user.isAdmin},{style:"margin-top:25px",xtype:"fieldset",title:t("Select one or more Services"),collapsible:true,collapsed:false,items:[{anchor:"100%",fieldLabel:"",xtype:"servicestag",allowBlank:true}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["planform"],["component","box","container","panel","form","planform"],{component:true,box:true,container:true,panel:true,form:true,planform:true},["widget.planform"],0,[MBilling.view.plan,"Form"],0));(Ext.cmd.derive("MBilling.view.plan.Tag",Ext.form.field.Tag,{name:"id_plan",fieldLabel:t("plan"),displayField:"name",valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Plan",{proxy:{type:"uxproxy",module:"plan",limitParam:undefined}});Ext.form.field.Tag.prototype.initComponent.apply(this,arguments)}},0,["plantag"],["component","box","field","textfield","pickerfield","combobox","combo","tagfield","plantag"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,tagfield:true,plantag:true},["widget.plantag"],0,[MBilling.view.plan,"Tag"],0));(Ext.cmd.derive("MBilling.view.plan.Lookup",Ext.ux.form.field.Lookup,{name:"id_plan",fieldLabel:t("Plan"),displayField:"idPlanname",displayFieldList:"name",gridConfig:{xtype:"planlist",fieldSearch:"name",columns:[{header:t("name"),dataIndex:"name",flex:2}]}},0,["planlookup"],["component","box","container","fieldcontainer","planlookup"],{component:true,box:true,container:true,fieldcontainer:true,planlookup:true},["widget.planlookup"],0,[MBilling.view.plan,"Lookup"],0));(Ext.cmd.derive("MBilling.view.trunk.Controller",Ext.ux.app.ViewController,{onEdit:function(){var f=this,e=f.list.getSelectionModel().getSelection()[0],d=f.formPanel.getForm().findField("register");if(e.get("register")==1){if(e.get("register")&&e.get("providertech")=="sip"){color=e.get("registered")==1?"green":"red";d.setFieldLabel(t("registertrunk")+' ')}else{d.setFieldLabel(t("registertrunk"))}f.formPanel.getForm().findField("register_string")["show"]()}else{d.setFieldLabel(t("registertrunk"));f.formPanel.getForm().findField("register_string")["hide"]()}Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments);valueAllow=f.formPanel.idRecord?e.get("allow").split(","):["g729","gsm","alaw","ulaw"];fieldAllow=f.formPanel.down("checkboxgroup");fieldAllow.setValue({allow:valueAllow})},init:function(){var b=this;b.control({"noyescombo[name=register]":{select:b.onSelectType}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectType:function(c,d){this.showFieldsRelated(d.getData().showFields)},showFieldsRelated:function(o){var p=this,m=p.formPanel.getForm().findField("register_string"),n=p.formPanel.getForm().findField("user"),q=p.formPanel.getForm().findField("secret"),j=p.formPanel.getForm().findField("host"),l=p.formPanel.getForm().getFields();l.each(function(a){if(a.name=="register"){m.setVisible(a.value==1);m.setValue(n.value+":"+q.value+"@"+j.value+"/"+n.value)}})}},0,0,0,0,["controller.trunk"],0,[MBilling.view.trunk,"Controller"],0));(Ext.cmd.derive("MBilling.view.trunk.Combo",Ext.form.field.ComboBox,{name:"id_trunk",fieldLabel:t("trunk"),forceSelection:true,editable:true,listeners:{focus:function(b){b.expand()}},displayField:"trunkcode",valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Trunk",{proxy:{type:"uxproxy",module:"trunk",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["trunkcombo"],["component","box","field","textfield","pickerfield","combobox","combo","trunkcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,trunkcombo:true},["widget.trunkcombo"],0,[MBilling.view.trunk,"Combo"],0));(Ext.cmd.derive("MBilling.view.trunk.ComboBackup",Ext.form.field.ComboBox,{name:"failover_trunk",fieldLabel:t("failover_trunk"),displayField:"trunkcode",valueField:"id",value:0,limitParam:undefined,forceSelection:true,editable:true,extraValues:[{id:0,trunkcode:t("undefined")}],listeners:{focus:function(b){b.expand()}},initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Trunk",{proxy:{type:"uxproxy",module:"trunk",limitParam:undefined}});b.on("render",b.loadStore,b);Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)},loadStore:function(g){var j=this,e=g.store,f;e.load({callback:function(){if(j.extraValues.length){e.insert(0,j.extraValues)}}})}},0,["trunkcombobackup"],["component","box","field","textfield","pickerfield","combobox","combo","trunkcombobackup"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,trunkcombobackup:true},["widget.trunkcombobackup"],0,[MBilling.view.trunk,"ComboBackup"],0));(Ext.cmd.derive("MBilling.view.trunk.Module",Ext.ux.panel.Module,{controller:"trunk"},0,["trunkmodule"],["component","box","container","uxpanelmodule","trunkmodule"],{component:true,box:true,container:true,uxpanelmodule:true,trunkmodule:true},["widget.trunkmodule"],0,[MBilling.view.trunk,"Module"],0));(Ext.cmd.derive("MBilling.view.trunk.List",Ext.ux.grid.Panel,{store:"Trunk",fieldSearch:"trunkcode",initComponent:function(){var b=this;b.columns=b.columns||[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("trunkcode"),dataIndex:"trunkcode",flex:3},{header:t("add")+" "+t("prefix"),dataIndex:"trunkprefix",flex:2},{header:t("remove")+" "+t("prefix"),dataIndex:"removeprefix",flex:2},{header:t("host"),dataIndex:"host",flex:2},{xtype:"templatecolumn",tpl:"{idProviderprovider_name}",header:t("provider"),dataIndex:"id_provider",comboFilter:"providercombo",flex:2},{header:t("secondusedreal"),renderer:Helper.Util.formatsecondsToTime,dataIndex:"secondusedreal",flex:3},{header:t("status"),dataIndex:"status",renderer:Helper.Util.formatBooleanActive,comboFilter:"booleancombo",flex:1,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")]]}},{header:t("creationdate"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"creationdate",flex:3}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["trunklist"],["component","box","container","panel","tablepanel","gridpanel","grid","trunklist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,trunklist:true},["widget.trunklist"],0,[MBilling.view.trunk,"List"],0));(Ext.cmd.derive("MBilling.view.trunk.Form",Ext.ux.form.Panel,{autoHeight:300,bodyPadding:0,fieldsHideUpdateLot:["trunkcode"],initComponent:function(){var b=this;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{labelAlign:"right",plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true,labelWidth:142}},items:[{title:t("general"),items:[{xtype:"providerlookup",ownerForm:b},{name:"trunkcode",fieldLabel:t("trunkcode")},{name:"user",fieldLabel:t("user"),allowBlank:true},{name:"secret",fieldLabel:t("password"),allowBlank:true},{name:"host",fieldLabel:t("host")},{name:"trunkprefix",fieldLabel:t("add")+" "+t("prefix"),allowBlank:true},{name:"removeprefix",fieldLabel:t("remove")+" "+t("prefix"),allowBlank:true},{xtype:"checkboxgroup",columns:3,name:"allow",fieldLabel:t("codec"),items:[{boxLabel:"g729",name:"allow",inputValue:"g729",checked:true},{boxLabel:"g723",name:"allow",inputValue:"g723"},{boxLabel:"gsm",name:"allow",inputValue:"gsm",checked:true},{boxLabel:"g726",name:"allow",inputValue:"g726"},{boxLabel:"opus",name:"allow",inputValue:"opus",checked:true},{boxLabel:"alaw",name:"allow",inputValue:"alaw",checked:true},{boxLabel:"ulaw",name:"allow",inputValue:"ulaw",checked:true},{boxLabel:"g722",name:"allow",inputValue:"g722"},{boxLabel:"ilbc",name:"allow",inputValue:"ilbc"},{boxLabel:"speex",name:"allow",inputValue:"speex"},{boxLabel:"h261",name:"allow",inputValue:"h261"},{boxLabel:"h263",name:"allow",inputValue:"h263"}],allowBlank:true},{xtype:"sipcombo",name:"providertech",fieldLabel:t("providertech")},{xtype:"trunkcombobackup",allowBlank:true},{xtype:"booleancombo",name:"status",fieldLabel:t("status")},{xtype:"noyescombo",name:"allow_error",fieldLabel:t("allow_error")},{xtype:"noyescombo",name:"register",fieldLabel:t("registertrunk")},{name:"register_string",fieldLabel:t("Register String"),allowBlank:true,hidden:true}]},{title:t("suplementaryInfo"),defaults:{labelAlign:"right",plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true,labelWidth:142},items:[{name:"fromuser",fieldLabel:"fromuser",allowBlank:true},{name:"fromdomain",fieldLabel:"Fromdomain",allowBlank:true},{name:"language",fieldLabel:t("language"),allowBlank:true},{name:"context",fieldLabel:t("context"),allowBlank:true,value:"billing"},{name:"dtmfmode",fieldLabel:"dtmfmode",allowBlank:true,value:"RFC2833"},{name:"insecure",fieldLabel:"insecure",allowBlank:true,value:"port,invite"},{xtype:"numberfield",name:"maxuse",fieldLabel:t("maxuse"),allowBlank:true,value:-1,minValue:-1},{name:"nat",fieldLabel:"nat",value:App.user.asteriskVersion=="1.8"?"yes":"force_rport,comedia",allowBlank:true},{name:"directmedia",allowBlank:true,value:"no",fieldLabel:"directmedia"},{name:"qualify",fieldLabel:"qualify",allowBlank:true,value:"yes"},{name:"type",fieldLabel:"type",allowBlank:true,value:"peer"},{name:"disallow",fieldLabel:"disallow",allowBlank:true,value:"all"},{name:"sendrpid",fieldLabel:"sendrpid",allowBlank:true,value:"no"},{name:"addparameter",fieldLabel:t("addparameter"),allowBlank:true,emptyText:t("parameterdial")},{xtype:"textarea",name:"link_sms",fieldLabel:t("link_sms"),allowBlank:true,emptyText:t("linksmsobs"),height:100,anchor:"100%"},{name:"sms_res",fieldLabel:t("sms_res"),allowBlank:true},{xtype:"numberfield",name:"port",fieldLabel:t("Port"),value:"5060",readOnly:!App.user.isAdmin,hidden:App.user.isClient,allowBlank:App.user.isClient},{xtype:"combobox",name:"encryption",value:"no",store:[["no","No"],["yes","yes"]],fieldLabel:t("Encryption"),allowBlank:true,hidden:!App.user.isAdmin},{xtype:"combobox",forceSelection:true,editable:false,value:"no",store:[["tls","tls"],["no","disable"]],name:"transport",fieldLabel:t("Transport"),allowBlank:true,hidden:!App.user.isAdmin}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["trunkform"],["component","box","container","panel","form","trunkform"],{component:true,box:true,container:true,panel:true,form:true,trunkform:true},["widget.trunkform"],0,[MBilling.view.trunk,"Form"],0));(Ext.cmd.derive("MBilling.view.trunk.Lookup",Ext.ux.form.field.Lookup,{name:"id_trunk",fieldLabel:t("Trunk"),displayField:"idTrunktrunkcode",displayFieldList:"trunkcode",gridConfig:{xtype:"trunklist",fieldSearch:"trunkcode",columns:[{header:t("trunkcode"),dataIndex:"trunkcode"}]}},0,["trunklookup"],["component","box","container","fieldcontainer","trunklookup"],{component:true,box:true,container:true,fieldcontainer:true,trunklookup:true},["widget.trunklookup"],0,[MBilling.view.trunk,"Lookup"],0));(Ext.cmd.derive("MBilling.view.prefix.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.prefix"],0,[MBilling.view.prefix,"Controller"],0));(Ext.cmd.derive("MBilling.view.prefix.Combo",Ext.form.field.ComboBox,{name:"id_prefix",fieldLabel:t("destination"),displayField:"prefix",filterMode:"remote",valueField:"id",listConfig:{itemTpl:Ext.create("Ext.XTemplate","
{prefix} - {destination}
")},displayTpl:Ext.create("Ext.XTemplate",'{prefix} - {destination}'),initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.PrefixCombo",{proxy:{type:"uxproxy",module:"prefixCombo",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["prefixcombo"],["component","box","field","textfield","pickerfield","combobox","combo","prefixcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,prefixcombo:true},["widget.prefixcombo"],0,[MBilling.view.prefix,"Combo"],0));(Ext.cmd.derive("MBilling.view.prefix.Module",Ext.ux.panel.Module,{controller:"prefix"},0,["prefixmodule"],["component","box","container","uxpanelmodule","prefixmodule"],{component:true,box:true,container:true,uxpanelmodule:true,prefixmodule:true},["widget.prefixmodule"],0,[MBilling.view.prefix,"Module"],0));(Ext.cmd.derive("Ext.ux.form.field.FileUpload",Ext.form.field.File,{anchor:"0",name:"file",emptyText:t("selectFile"),fieldLabel:t("file"),buttonText:undefined,maxSize:3144000,extAllowed:["csv","ret"],titleTipInfo:t("modelContent"),titleWarning:t("warning"),msgInvalidFile:t("fileNotAllow"),msgInvalidSize:t("maxSizeFile"),childEls:["browseButtonWrap","playButtonWrap"],buttonPlayMargin:5,buttonConfig:{glyph:icons.file},triggers:{filebutton:{type:"component",hideOnReadOnly:false},playbutton:{type:"component"}},applyTriggers:function(e){var d=this,f=(e||{}).playbutton;if(f){f.component=Ext.apply({xtype:"button",iconCls:"icon-play",ownerCt:d,id:d.id+"-play",ui:d.ui,disabled:d.disabled,style:d.getButtonMarginProp()+d.buttonPlayMargin+"px",inputName:d.getName(),scope:d,handler:d.playStop,hidden:true});return Ext.form.field.File.prototype.applyTriggers.call(this,e)}},onRender:function(){var c=this,d;c.isAudio=c.extAllowed.indexOf("wav")!==-1;c.formPanel=c.up("form");c.formPanel.on("edit",c.onEditForm,c);(arguments.callee.$previous||Ext.form.field.File.prototype.onRender).apply(this,arguments);c.triggerPlay=c.getTrigger("playbutton");c.buttonPlay=c.triggerPlay.component;c.triggerPlay.el.setWidth(c.buttonPlay.getEl().getWidth()+c.buttonPlay.getEl().getMargin("lr"));if(Ext.isIE){c.buttonPlay.getEl().repaint()}c.initTipInfo()},reset:function(){var b=this;if(!b.isAudio){return}if(b.audio&&!b.audio.paused&&b.audio.currentTime){b.audio.pause();b.audio.currentTime=0}b.buttonPlay.setIconCls("icon-play");b.triggerPlay.el.setWidth(0);if(Ext.isIE){b.buttonPlay.getEl().repaint()}Ext.form.field.File.prototype.reset.apply(this,arguments)},onEditForm:function(){var g=this,f=g.formPanel.getForm().getRecord(),j=f&&f.get(g.name),e=!Ext.isEmpty(j);if(!g.isAudio){return}if(g.audio&&!g.audio.paused&&g.audio.currentTime){g.audio.pause();g.audio.currentTime=0}g.buttonPlay.setIconCls("icon-play");if(e){g.audio=new Audio(j);g.audio.addEventListener("ended",Ext.bind(g.onEndAudio,g));g.triggerPlay.el.setWidth(g.buttonPlay.el.getWidth()+g.buttonPlay.el.getMargin("lr"));if(Ext.isIE){g.buttonPlay.getEl().repaint()}}else{g.triggerPlay.el.setWidth(0);if(Ext.isIE){g.buttonPlay.getEl().repaint()}}g.buttonPlay.setVisible(e);g.triggerPlay.setVisible(e)},onEndAudio:function(){this.buttonPlay.setIconCls("icon-play")},getTriggerMarkup:function(){var d=this,e=Ext.form.field.File.prototype.getTriggerMarkup.apply(this,arguments),f='';return e+f},playStop:function(e){var d=this,f=e.iconCls==="icon-play";if(f){d.audio.play()}else{if(d.audio&&!d.audio.paused&&d.audio.currentTime){d.audio.pause();d.audio.currentTime=0}}e.setIconCls(f?"icon-stop":"icon-play")},initTipInfo:function(){var b=this;if(!b.htmlTipInfo){return}b.tipInfoFile=Ext.create("Ext.tip.ToolTip",{html:b.htmlTipInfo,anchor:"top",title:b.titleTipInfo,target:b.button.el})},onFileChange:function(e,f,g){var j=this;j.getInfoFile(f);Ext.form.field.File.prototype.onFileChange.apply(this,arguments)},getInfoFile:function(g){var l=this,f=g.target.files[0],j=f.name.split("."),m=j[j.length-1].toLowerCase();if(l.extAllowed.indexOf(m)===-1){Ext.ux.Alert.alert(l.titleWarning,l.msgInvalidFile,"warning");l.reset();return}if(f.size>l.maxSize){Ext.ux.Alert.alert(l.titleWarning,l.msgInvalidSize+Ext.util.Format.fileSize(l.maxSize),"warning");l.reset();return}}},0,["uploadfield"],["component","box","field","textfield","filefield","fileuploadfield","uploadfield"],{component:true,box:true,field:true,textfield:true,filefield:true,fileuploadfield:true,uploadfield:true},["widget.uploadfield"],0,[Ext.ux.form.field,"FileUpload"],0));(Ext.cmd.derive("Ext.ux.window.ImportCsv",Ext.window.Window,{autoShow:true,modal:true,layout:"fit",iconCls:"icon-import-csv",title:t("importFromCsv"),width:400,height:window.isThemeTriton?220:175,labelWidthFields:75,htmlTipInfo:"",fieldsImport:[],listeners:{close:function(){this.list.setLoading(false)}},initComponent:function(){var d=this,c=Ext.Array.merge(d.fieldsImport,[{xtype:"uploadfield",fieldLabel:t("fileCsv"),htmlTipInfo:d.htmlTipInfo}]);d.items=[{xtype:"form",bodyPadding:5,labelWidthFields:d.labelWidthFields,items:c}];d.title=d.title+(d.titleModule?" - "+d.titleModule:"");d.bbar=[{xtype:"tbtext",text:t("maxSizeFile")+"3 MB"},"->",{iconCls:"icon-import-csv",text:t("importText"),scope:d,handler:d.onImport}];Ext.window.Window.prototype.initComponent.apply(this,arguments)},onImport:function(d){var f=this,e=f.list.store;d.disable();f.list.setLoading(true);f.down("form").submit({url:e.getProxy().api.fromCsv,scope:f,success:function(c,b){var a=Ext.decode(b.response.responseText);if(a.success){Ext.ux.Alert.alert(t("Success"),a.msg,"success")}else{Ext.ux.Alert.alert(t("Error"),a.errors,"error")}d.enable();f.list.setLoading(false);e.load();f.close()},failure:function(c,b){if(Ext.isObject(b.response)){var a=Ext.decode(b.response.responseText);Ext.ux.Alert.alert(t("Error"),a.errors,"error")}else{Ext.ux.Alert.alert(t("Error"),b.response.responseText,"error",true,false)}d.enable();f.list.setLoading(false);f.close()}})}},0,0,["component","box","container","panel","window"],{component:true,box:true,container:true,panel:true,window:true},0,0,[Ext.ux.window,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.prefix.ImportCsv",Ext.ux.window.ImportCsv,{htmlTipInfo:"
"+t("dialprefix")+", "+t("destination")+"",labelWidthFields:160,height:window.isThemeTriton?300:205,initComponent:function(){var b=this;b.fieldsImport=[{style:"margin-top:25px",xtype:"fieldset",title:t("Csv Format"),collapsible:true,collapsed:false,defaults:{labelWidth:190,anchor:"100%",layout:{type:"hbox",labelAlign:b.labelAlignFields}},items:[{xtype:"pontovirgulacombo",name:"delimiter",fieldLabel:t("Delimiter"),width:230}]}];Ext.ux.window.ImportCsv.prototype.initComponent.apply(this,arguments)}},0,["prefiximportcsv"],["component","box","container","panel","window","prefiximportcsv"],{component:true,box:true,container:true,panel:true,window:true,prefiximportcsv:true},["widget.prefiximportcsv"],0,[MBilling.view.prefix,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.prefix.List",Ext.ux.grid.Panel,{store:"Prefix",fieldSearch:"prefix",initComponent:function(){var b=this;b.buttonImportCsv=!App.user.isClient,b.buttonUpdateLot=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("prefix"),dataIndex:"prefix",filter:{type:"string"}},{header:t("destination"),dataIndex:"destination"}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["prefixlist"],["component","box","container","panel","tablepanel","gridpanel","grid","prefixlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,prefixlist:true},["widget.prefixlist"],0,[MBilling.view.prefix,"List"],0));(Ext.cmd.derive("MBilling.view.prefix.Form",Ext.ux.form.Panel,{fieldsHideEdit:["prefix"],items:[{name:"prefix",fieldLabel:t("prefix"),maxLength:18},{name:"destination",fieldLabel:t("destination")}]},0,["prefixform"],["component","box","container","panel","form","prefixform"],{component:true,box:true,container:true,panel:true,form:true,prefixform:true},["widget.prefixform"],0,[MBilling.view.prefix,"Form"],0));(Ext.cmd.derive("MBilling.view.sendCreditProducts.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.sendcreditproducts"],0,[MBilling.view.sendCreditProducts,"Controller"],0));(Ext.cmd.derive("MBilling.view.sendCreditProducts.Module",Ext.ux.panel.Module,{controller:"sendcreditproducts"},0,["sendcreditproductsmodule"],["component","box","container","uxpanelmodule","sendcreditproductsmodule"],{component:true,box:true,container:true,uxpanelmodule:true,sendcreditproductsmodule:true},["widget.sendcreditproductsmodule"],0,[MBilling.view.sendCreditProducts,"Module"],0));(Ext.cmd.derive("MBilling.view.sendCreditProducts.ImportCsv",Ext.ux.window.ImportCsv,{fieldsImport:[{fieldLabel:t("table"),hidden:true,allowBlank:true}]},0,["sendcreditproductsimportcsv"],["component","box","container","panel","window","sendcreditproductsimportcsv"],{component:true,box:true,container:true,panel:true,window:true,sendcreditproductsimportcsv:true},["widget.sendcreditproductsimportcsv"],0,[MBilling.view.sendCreditProducts,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.sendCreditProducts.List",Ext.ux.grid.Panel,{store:"SendCreditProducts",fieldSearch:"operator_name",comparisonfilter:"ct",initComponent:function(){var b=this;b.buttonImportCsv=App.user.isAdmin,b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("Country"),dataIndex:"country",flex:4},{header:t("Country Code"),dataIndex:"country_code",flex:2},{header:t("Operator ID"),dataIndex:"operator_id",flex:2},{header:t("SkuCode"),dataIndex:"SkuCode",flex:2},{header:t("Operator Name"),dataIndex:"operator_name",flex:5},{header:t("Currency destination"),dataIndex:"currency_dest",flex:3},{header:t("Product"),dataIndex:"product",flex:2},{header:t("Currency Origem"),dataIndex:"currency_orig",flex:3},{header:t("Send Value"),dataIndex:"send_value",flex:2},{header:t("Wholesale Price"),dataIndex:"wholesale_price",flex:2},{header:t("Provider"),dataIndex:"provider",flex:2},{header:t("status"),dataIndex:"status",renderer:Helper.Util.formatBooleanActive,comboRelated:"booleancombo",flex:2,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")]]}}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["sendcreditproductslist"],["component","box","container","panel","tablepanel","gridpanel","grid","sendcreditproductslist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,sendcreditproductslist:true},["widget.sendcreditproductslist"],0,[MBilling.view.sendCreditProducts,"List"],0));(Ext.cmd.derive("MBilling.view.sendCreditProducts.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{name:"country",fieldLabel:t("country"),readOnly:true},{name:"operator_name",fieldLabel:t("Operator Name"),readOnly:true},{name:"operator_id",fieldLabel:t("Operator Id")},{name:"SkuCode",fieldLabel:t("SkuCode")},{name:"product",fieldLabel:t("Product")},{name:"send_value",fieldLabel:t("Send Value"),xtype:"moneyfield",mask:"#9.999.990,000000",readOnly:!App.user.isAdmin},{name:"wholesale_price",fieldLabel:t("Wholesale Price"),xtype:"moneyfield",mask:"#9.999.990,000000",readOnly:!App.user.isAdmin},{xtype:"combobox",name:"provider",value:"TransferTo",forceSelection:true,editable:false,store:[["TransferTo","TransferTo"],["Ding","Ding"],["TanaSend","TanaSend"]],fieldLabel:t("Provider")},{xtype:"yesnocombo",name:"status",fieldLabel:t("status")},{xtype:"textareafield",name:"info",fieldLabel:t("info"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["sendcreditproductsform"],["component","box","container","panel","form","sendcreditproductsform"],{component:true,box:true,container:true,panel:true,form:true,sendcreditproductsform:true},["widget.sendcreditproductsform"],0,[MBilling.view.sendCreditProducts,"Form"],0));(Ext.cmd.derive("MBilling.view.sendCreditRates.Controller",Ext.ux.app.ViewController,{onResetPrice:function(e){var f=this,d=f.list.getSelectionModel().getSelection()[0];Ext.Ajax.request({url:"index.php/SendCreditRates/resetSellPrice",scope:f,success:function(b){b=Ext.decode(b.responseText);if(b[f.nameSuccessRequest]){Ext.ux.Alert.alert(f.titleSuccess,b[f.nameMsgRequest],"success")}else{var a=Helper.Util.convertErrorsJsonToString(b[f.nameMsgRequest]);Ext.ux.Alert.alert(f.titleSuccess,a,"error")}}});f.store.load()}},0,0,0,0,["controller.sendcreditrates"],0,[MBilling.view.sendCreditRates,"Controller"],0));(Ext.cmd.derive("MBilling.view.sendCreditRates.Module",Ext.ux.panel.Module,{controller:"sendcreditrates"},0,["sendcreditratesmodule"],["component","box","container","uxpanelmodule","sendcreditratesmodule"],{component:true,box:true,container:true,uxpanelmodule:true,sendcreditratesmodule:true},["widget.sendcreditratesmodule"],0,[MBilling.view.sendCreditRates,"Module"],0));(Ext.cmd.derive("MBilling.view.sendCreditRates.List",Ext.ux.grid.Panel,{store:"SendCreditRates",fieldSearch:"idProduct.operator_name",comparisonfilter:"ct",initComponent:function(){var b=this;b.buttonUpdateLotCallShopRate=true;b.buttonCsv=false;b.allowPrint=false;b.extraButtons=[{text:t("Reset")+" "+t("Sell price"),iconCls:"icon-chart-column",width:130,handler:"onResetPrice",disabled:false}];b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{xtype:"templatecolumn",tpl:"{idProductoperator_name}",header:t("Operator Name"),dataIndex:"idProductoperator_name",filter:{type:"string",field:"idProduct.operator_name"},flex:5},{xtype:"templatecolumn",tpl:"{idProductcountry}",header:t("Country"),dataIndex:"idProductcountry",filter:{type:"string",field:"idProduct.country"},flex:4},{xtype:"templatecolumn",tpl:"{idProductcurrency_dest}",header:t("Currency destination"),dataIndex:"idProductcurrency_dest",filter:{type:"string",field:"idProduct.currency_dest"},flex:3},{xtype:"templatecolumn",tpl:"{idProductproduct}",header:t("Product"),dataIndex:"idProductproduct",filter:{type:"string",field:"idProduct.product"},flex:2},{xtype:"templatecolumn",tpl:"{idProductcurrency_orig}",header:t("Currency Origin"),dataIndex:"idProductcurrency_orig",filter:{type:"string",field:"idProduct.currency_orig"},flex:3},{xtype:"templatecolumn",tpl:"{idProductwholesale_price}",header:t("Wholesale Price"),dataIndex:"idProductwholesale_price",filter:{type:"string",field:"idProduct.wholesale_price"},flex:2},{header:t("Sell Price"),dataIndex:"sell_price",flex:2}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["sendcreditrateslist"],["component","box","container","panel","tablepanel","gridpanel","grid","sendcreditrateslist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,sendcreditrateslist:true},["widget.sendcreditrateslist"],0,[MBilling.view.sendCreditRates,"List"],0));(Ext.cmd.derive("MBilling.view.sendCreditRates.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["idProductcountry","idProductoperator_name"],initComponent:function(){var b=this;b.items=[{name:"idProductcountry",fieldLabel:t("country"),readOnly:true},{name:"idProductoperator_name",fieldLabel:t("Operator Name"),readOnly:true},{name:"sell_price",fieldLabel:t("Sell Price"),xtype:"moneyfield",mask:"#9.999.990,00",readOnly:App.user.isAdmin}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["sendcreditratesform"],["component","box","container","panel","form","sendcreditratesform"],{component:true,box:true,container:true,panel:true,form:true,sendcreditratesform:true},["widget.sendcreditratesform"],0,[MBilling.view.sendCreditRates,"Form"],0));(Ext.cmd.derive("MBilling.view.prefix.Lookup",Ext.ux.form.field.Lookup,{name:"id_prefix",fieldLabel:t("Destination"),displayField:"idPrefixdestination",displayFieldList:"destination",gridConfig:{xtype:"prefixlist",fieldSearch:"destination",columns:[{header:t("prefix"),dataIndex:"prefix",flex:2},{header:t("destination"),dataIndex:"destination",flex:2}]}},0,["prefixlookup"],["component","box","container","fieldcontainer","prefixlookup"],{component:true,box:true,container:true,fieldcontainer:true,prefixlookup:true},["widget.prefixlookup"],0,[MBilling.view.prefix,"Lookup"],0));(Ext.cmd.derive("MBilling.view.sipTrace.Controller",Ext.ux.app.ViewController,{onNewFilter:function(d){var f=this,e=f.getView();Ext.widget("siptracefilter",{title:"SipTrace",list:f.list})},onDeleteLog:function(d){var c=this;Ext.Msg.confirm(c.titleConfirmation,t("Confirm delete all log file?"),function(a){if(a==="yes"){Ext.Ajax.request({url:"index.php/sipTrace/destroy",scope:c,success:function(b){Ext.ux.Alert.alert(c.titleSuccess,t("Success: The Sip Trace file was deleted"),"success");c.store.load()}})}})},onClearAll:function(d){var c=this;Ext.Ajax.request({url:"index.php/sipTrace/clearAll",scope:c,success:function(a){Ext.ux.Alert.alert(c.titleSuccess,t("Success"),"success");c.store.load()}})},onExportPcap:function(d){var c=this;window.open("index.php/sipTrace/export")},onDetails:function(d){var f=this,e=f.list.getSelectionModel().getSelection()[0];window.open("index.php/sipTrace/details?callid="+e.get("callid"))}},0,0,0,0,["controller.siptrace"],0,[MBilling.view.sipTrace,"Controller"],0));(Ext.cmd.derive("MBilling.view.sipTrace.Module",Ext.ux.panel.Module,{controller:"siptrace"},0,["siptracemodule"],["component","box","container","uxpanelmodule","siptracemodule"],{component:true,box:true,container:true,uxpanelmodule:true,siptracemodule:true},["widget.siptracemodule"],0,[MBilling.view.sipTrace,"Module"],0));(Ext.cmd.derive("MBilling.view.sipTrace.Filter",Ext.window.Window,{autoShow:true,modal:true,layout:"fit",iconCls:"icon-import-csv",title:t("SipTrace filter"),width:400,height:window.isThemeTriton?220:180,labelWidthFields:120,htmlTipInfo:"",fieldsImport:[],initComponent:function(){var b=this;b.items=[{xtype:"form",bodyPadding:5,defaults:{anchor:"0",enableKeyEvents:true,labelWidth:b.labelWidthFields,msgTarget:"side",plugins:"markallowblank",allowBlank:false},items:[{xtype:"numberfield",value:60,min:5,max:300,name:"timeout",fieldLabel:t("Filter timeout")},{xtype:"numberfield",name:"port",fieldLabel:t("Port"),allowBlank:false,value:5060},{xtype:"textfield",name:"filter",fieldLabel:t("Filter"),allowBlank:false,emptyText:"IP, sip account or number ...."}]}];b.title=b.title+(b.titleModule?" - "+b.titleModule:"");b.bbar=[{width:150,iconCls:"icon-play",text:t("Start"),scope:b,handler:b.onStart}];Ext.window.Window.prototype.initComponent.apply(this,arguments)},onStart:function(d){var f=this,e=f.list.store;if(!f.down("form").isValid()){return}f.list.setLoading(true);Ext.Ajax.setTimeout(1000000);f.down("form").submit({url:"index.php/sipTrace/start",scope:f,success:function(c,b){var a=Ext.decode(b.response.responseText);console.log(a);if(a.success){Ext.ux.Alert.alert(t("Success"),a.msg,"success")}else{Ext.ux.Alert.alert(t("Error"),a.errors,"error")}d.enable();f.list.setLoading(false);e.load();f.close()},failure:function(c,b){console.log(b.response.responseText);if(b.response&&Ext.isObject(b.response.responseText)){var a=Ext.decode(b.response.responseText);Ext.ux.Alert.alert(t("Error"),a.errors,"error",true,30)}else{Ext.ux.Alert.alert(t("Error"),Ext.decode(b.response.responseText).msg,"error",true,30)}d.enable();f.list.setLoading(false);e.load();f.close()}})}},0,["siptracefilter"],["component","box","container","panel","window","siptracefilter"],{component:true,box:true,container:true,panel:true,window:true,siptracefilter:true},["widget.siptracefilter"],0,[MBilling.view.sipTrace,"Filter"],0));(Ext.cmd.derive("MBilling.view.sipTrace.List",Ext.ux.grid.Panel,{store:"SipTrace",initComponent:function(){var b=this;b.buttonImportCsv=false;b.buttonCsv=false;b.allowPrint=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.collapsedExtraFilters=false;b.allowDelete=false;b.extraButtons=[{text:b.textDelete,glyph:b.glyphDelete,handler:"onDeleteLog",width:120},{text:t("Start Capture"),iconCls:"icon-save-all",handler:"onNewFilter",width:120},{text:t("Stop Capture"),iconCls:"icon-clean-filter",handler:"onClearAll",width:120},{text:t("Export File"),iconCls:"icon-save-all",handler:"onExportPcap",width:150},{text:t("Details"),glyph:icons.info,handler:"onDetails",width:150}];b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,menuDisabled:true,hideable:App.user.isAdmin},{header:t("method"),dataIndex:"method",flex:3},{header:t("callid"),dataIndex:"callid",flex:7},{header:t("SIP To "),dataIndex:"sipto",flex:5},{header:t("Source"),dataIndex:"fromip",renderer:function(a){a=a==window.myIP?''+a+"":a;return a},flex:3},{header:t("Destination"),dataIndex:"toip",renderer:function(a){a=a==window.myIP?''+a+"":a;return a},flex:4},{header:t("head"),dataIndex:"head",flex:3,menuDisabled:true,hidden:true,hideable:true}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["siptracelist"],["component","box","container","panel","tablepanel","gridpanel","grid","siptracelist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,siptracelist:true},["widget.siptracelist"],0,[MBilling.view.sipTrace,"List"],0));(Ext.cmd.derive("MBilling.view.sipTrace.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.allowCreate=false;height=Ext.Element.getViewportHeight()-200;b.items=[{xtype:"textareafield",name:"head",height:height,anchor:"100%",allowBlank:true,readOnly:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["siptraceform"],["component","box","container","panel","form","siptraceform"],{component:true,box:true,container:true,panel:true,form:true,siptraceform:true},["widget.siptraceform"],0,[MBilling.view.sipTrace,"Form"],0));(Ext.cmd.derive("MBilling.view.sip.Controller",Ext.ux.app.ViewController,{init:function(){var b=this;b.control({typesipforwardcombo:{select:b.onSelectMethod}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectMethod:function(c,d){this.showFieldsRelated(d.getData().showFields)},showFieldsRelated:function(l){var m=this,n=m.formPanel.getForm(),j=m.formPanel.getForm().getFields(),g=Ext.get(Ext.Element.getActiveElement()).component,o=g.name.substr(-2);m.onSetVisibleFiel(g,n,o,g.value)},onSetVisibleFiel:function(f,j,e,g){if(f.value=="undefined"){f.setValue("undefined")}j.findField("id_queue").setValue("");j.findField("id_sip").setValue("");j.findField("id_ivr").setValue("");j.findField("extension").setValue("");j.findField("id_queue").setVisible(g.match("^queue"));j.findField("id_sip").setVisible(g.match("^sip"));j.findField("id_ivr").setVisible(g.match("^ivr"));j.findField("extension").setVisible(g.match("^group|^number|^custom"))},onGetDiskSpaceService:function(b){filterGroupp=Ext.encode([{type:"numeric",comparison:"eq",value:App.user.id,field:"id_user"},{type:"numeric",comparison:"eq",value:1,field:"status"}]),Ext.Ajax.request({url:"index.php/servicesUse/read?filter="+filterGroupp,success:function(a){a=Ext.decode(a.responseText);b(a.rows)}})},onEdit:function(){var j=this,l=j.formPanel.getForm(),f=j.list.getSelectionModel().getSelection()[0],g=j.formPanel.idRecord?f.get("allow").split(","):["g729","gsm","alaw","ulaw"],m=j.formPanel.down("checkboxgroup");if(App.user.isClient){l.findField("record_call").setVisible(false);j.onGetDiskSpaceService(function(a){Ext.each(a,function(b){if(b.idServicestype=="disk_space"){j.formPanel.getForm().findField("record_call").setVisible(true)}})})}fieldValue=f.getData()["type_forward"];l.findField("type_forward").setVisible(true);if(fieldValue=="ivr"){l.findField("id_ivr").setVisible(true);l.findField("id_sip").setVisible(false);l.findField("id_queue").setVisible(false);l.findField("extension").setVisible(false)}else{if(fieldValue=="sip"){l.findField("id_sip").setVisible(true);l.findField("id_ivr").setVisible(false);l.findField("id_queue").setVisible(false);l.findField("extension").setVisible(false)}else{if(fieldValue=="queue"){l.findField("id_queue").setVisible(true);l.findField("id_sip").setVisible(false);l.findField("id_ivr").setVisible(false);l.findField("extension").setVisible(false)}else{if(fieldValue.match("custom|number|group")){l.findField("extension").setVisible(true);l.findField("id_ivr").setVisible(false);l.findField("id_sip").setVisible(false);l.findField("id_queue").setVisible(false)}else{l.findField("id_queue").setVisible(false);l.findField("id_sip").setVisible(false);l.findField("id_ivr").setVisible(false);l.findField("extension").setVisible(false)}}}}Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments);m.setValue({allow:g})},onNew:function(){var f=this,d=f.formPanel.getForm(),e=f.list.getSelectionModel().getSelection()[0];if(App.user.isClient){f.formPanel.getForm().findField("defaultuser").setReadOnly(false)}d.findField("id_ivr").setVisible(false);d.findField("id_sip").setVisible(false);d.findField("id_queue").setVisible(false);d.findField("id_ivr").setVisible(false);d.findField("id_queue").setVisible(false);d.findField("type_forward").setVisible(true);Ext.ux.app.ViewController.prototype.onNew.apply(this,arguments)}},0,0,0,0,["controller.sip"],0,[MBilling.view.sip,"Controller"],0));(Ext.cmd.derive("MBilling.view.sip.Module",Ext.ux.panel.Module,{controller:"sip"},0,["sipmodule"],["component","box","container","uxpanelmodule","sipmodule"],{component:true,box:true,container:true,uxpanelmodule:true,sipmodule:true},["widget.sipmodule"],0,[MBilling.view.sip,"Module"],0));(Ext.cmd.derive("MBilling.view.sip.List",Ext.ux.grid.Panel,{store:"Sip",fieldSearch:"idUser.username",initComponent:function(){var b=this;b.columns=b.columns||[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("Status"),dataIndex:"lineStatus",width:3,menuDisabled:true,renderer:Helper.Util.formatStatusImage},{header:t("accountcode"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4},{header:t("username"),dataIndex:"name",flex:4},{header:t("host"),dataIndex:"host",flex:4},{header:t("codec"),dataIndex:"allow",flex:5},{header:"group",dataIndex:"group",flex:3},{header:t("context"),dataIndex:"context",hidden:true,hideable:!App.user.isClient,flex:1},{header:t("record_call"),dataIndex:"record_call",renderer:Helper.Util.formattyyesno,filter:{type:"list",options:[[0,t("no")],[1,t("yes")]]},flex:2,hidden:true,hideable:!App.user.isClient},{header:t("callerid"),dataIndex:"callerid",hidden:true,hideable:!App.user.isClient,flex:1},{header:"nat",dataIndex:"nat",hidden:true,hideable:!App.user.isClient,flex:1},{header:"directmedia",dataIndex:"directmedia",hidden:true,hideable:!App.user.isClient,flex:1},{header:"qualify",dataIndex:"qualify",hidden:true,hideable:!App.user.isClient,flex:1},{header:"dtmfmode",dataIndex:"dtmfmode",hidden:true,hideable:!App.user.isClient,flex:1},{header:"insecure",dataIndex:"insecure",hidden:true,hideable:!App.user.isClient,flex:1},{header:"type",dataIndex:"type",hidden:true,hideable:!App.user.isClient,flex:1},{header:"allowtransfer",dataIndex:"allowtransfer",hidden:true,hideable:!App.user.isClient,flex:1},{header:"calllimit",dataIndex:"calllimit",hidden:true,hideable:!App.user.isClient,flex:1}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["siplist"],["component","box","container","panel","tablepanel","gridpanel","grid","siplist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,siplist:true},["widget.siplist"],0,[MBilling.view.sip,"List"],0));(Ext.cmd.derive("MBilling.view.sip.Form",Ext.ux.form.Panel,{bodyPadding:0,fieldsHideUpdateLot:["id_user","defaultuser","secret"],initComponent:function(){var b=this;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{labelAlign:"right",plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true}},items:[{title:t("general"),items:[{xtype:"userlookup",ownerForm:b,fieldLabel:t("accountcode"),hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"defaultuser",fieldLabel:t("username"),minLength:4,allowBlank:true,readOnly:App.user.isClient},{name:"secret",fieldLabel:t("password"),allowBlank:true,minLength:6},{name:"callerid",fieldLabel:t("callerid"),allowBlank:true},{name:"alias",fieldLabel:t("Alias"),allowBlank:true,minLength:3},{name:"disallow",fieldLabel:"disallow",value:"all",hidden:!App.user.isAdmin,allowBlank:App.user.isClient},{xtype:"checkboxgroup",columns:3,fieldLabel:t("codec"),items:[{boxLabel:"g729",name:"allow",inputValue:"g729",checked:true},{boxLabel:"g723",name:"allow",inputValue:"g723"},{boxLabel:"gsm",name:"allow",inputValue:"gsm",checked:true},{boxLabel:"g726",name:"allow",inputValue:"g726"},{boxLabel:"opus",name:"allow",inputValue:"opus",checked:true},{boxLabel:"alaw",name:"allow",inputValue:"alaw",checked:true},{boxLabel:"ulaw",name:"allow",inputValue:"ulaw",checked:true},{boxLabel:"g722",name:"allow",inputValue:"g722"},{boxLabel:"ilbc",name:"allow",inputValue:"ilbc"},{boxLabel:"speex",name:"allow",inputValue:"speex"},{boxLabel:"h263p",name:"allow",inputValue:"h263p"},{boxLabel:"h263",name:"allow",inputValue:"h263"},{boxLabel:"h264",name:"allow",inputValue:"h264"},{boxLabel:"vp8",name:"allow",inputValue:"vp8"}],hidden:!App.user.isAdmin,allowBlank:App.user.isClient},{name:"host",fieldLabel:t("host"),value:"dynamic",hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"group",fieldLabel:t("group"),allowBlank:true},{xtype:"yesnostringcombo",name:"videosupport",fieldLabel:"videosupport",value:"no",allowBlank:!App.user.isAdmin},{name:"block_call_reg",fieldLabel:t("Block Call REGEX"),allowBlank:true,hidden:!window.doac},{xtype:"noyescombo",name:"record_call",fieldLabel:t("record_call"),allowBlank:true,hidden:!App.user.isAdmin},{xtype:"numberfield",name:"techprefix",fieldLabel:t("TechPrefix"),hidden:!window.usertech||!App.user.isAdmin,allowBlank:true,maxLength:6}]},{title:t("Nat"),hidden:!App.user.isAdmin,items:[{name:"nat",fieldLabel:"nat",value:"force_rport,comedia",allowBlank:!App.user.isAdmin},{name:"directmedia",fieldLabel:"directmedia",value:"no",allowBlank:!App.user.isAdmin},{xtype:"yesnostringcombo",name:"qualify",fieldLabel:"qualify",value:"no",allowBlank:!App.user.isAdmin}]},{title:t("Additional"),hidden:!App.user.isAdmin,defaults:{labelAlign:"right",plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true,labelWidth:142},items:[{name:"context",fieldLabel:t("context"),value:"billing",hidden:!App.user.isAdmin,allowBlank:true},{name:"dtmfmode",fieldLabel:"dtmfmode",value:"RFC2833",allowBlank:!App.user.isAdmin},{name:"insecure",fieldLabel:"insecure",value:"no",allowBlank:true},{name:"deny",fieldLabel:"deny",allowBlank:true,hidden:!App.user.isAdmin},{name:"permit",fieldLabel:"permit",allowBlank:true,hidden:!App.user.isAdmin},{name:"type",fieldLabel:"type",value:"friend",allowBlank:!App.user.isAdmin},{xtype:"noyesstringcombo",name:"allowtransfer",fieldLabel:"allowtransfer",value:"no",allowBlank:!App.user.isAdmin},{xtype:"noyescombo",name:"ringfalse",fieldLabel:t("Ring false"),value:"0",allowBlank:!App.user.isAdmin},{name:"calllimit",xtype:"numberfield",fieldLabel:t("calllimit"),value:"0",allowBlank:!App.user.isAdmin},{xtype:"noyescombo",name:"voicemail",fieldLabel:t("Enable")+" "+t("VoiceMail"),value:"0",allowBlank:App.user.isClient},{name:"mohsuggest",fieldLabel:t("MOH"),allowBlank:true,hidden:!App.user.isAdmin},{name:"url_events",fieldLabel:t("Url Events notify"),hidden:!App.user.isAdmin||!window.events===true,allowBlank:true}]},{title:t("Forward"),itemId:"option",bodyPadding:10,defaults:{xtype:"fieldcontainer",layout:"hbox",plugins:"markallowblank",allowBlank:true,anchor:"100%",labelWidth:60,defaults:{hideLabel:true,hidden:true,flex:5,startX:100,allowBlank:true,ownerForm:b}},items:[{fieldLabel:t("Forward"),items:[{name:"type_forward",xtype:"typesipforwardcombo",flex:2},{xtype:"ivrlookup",name:"id_ivr",displayField:"id_ivr_name"},{xtype:"queuelookup",name:"id_queue",displayField:"id_queue_name"},{xtype:"sip2lookup",name:"id_sip",displayField:"id_sip_name"},{xtype:"textfield",name:"extension"}]},{name:"dial_timeout",xtype:"numberfield",fieldLabel:t("Dial timeout"),value:"60",labelWidth:90}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["sipform"],["component","box","container","panel","form","sipform"],{component:true,box:true,container:true,panel:true,form:true,sipform:true},["widget.sipform"],0,[MBilling.view.sip,"Form"],0));(Ext.cmd.derive("MBilling.view.sip.Lookup",Ext.ux.form.field.Lookup,{name:"id_sip",fieldLabel:t("Sip"),displayField:"idSipname",displayFieldList:"name",gridConfig:{xtype:"siplist",fieldSearch:"name",columns:[{header:t("Account"),dataIndex:"idUserusername",flex:2},{header:t("name"),dataIndex:"name",flex:2}]}},0,["siplookup"],["component","box","container","fieldcontainer","siplookup"],{component:true,box:true,container:true,fieldcontainer:true,siplookup:true},["widget.siplookup"],0,[MBilling.view.sip,"Lookup"],0));(Ext.cmd.derive("MBilling.view.sip2.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.sip2"],0,[MBilling.view.sip2,"Controller"],0));(Ext.cmd.derive("MBilling.view.sip2.Module",Ext.ux.panel.Module,{controller:"sip2"},0,["sip2module"],["component","box","container","uxpanelmodule","sip2module"],{component:true,box:true,container:true,uxpanelmodule:true,sip2module:true},["widget.sip2module"],0,[MBilling.view.sip2,"Module"],0));(Ext.cmd.derive("MBilling.view.sip2.List",Ext.ux.grid.Panel,{store:"Sip2",fieldSearch:"name",initComponent:function(){var b=this;b.columns=b.columns||[{header:t("accountcode"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4},{header:t("username"),dataIndex:"name",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["sip2list"],["component","box","container","panel","tablepanel","gridpanel","grid","sip2list"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,sip2list:true},["widget.sip2list"],0,[MBilling.view.sip2,"List"],0));(Ext.cmd.derive("MBilling.view.sip2.Form",Ext.ux.form.Panel,{bodyPadding:0},0,["sip2form"],["component","box","container","panel","form","sip2form"],{component:true,box:true,container:true,panel:true,form:true,sip2form:true},["widget.sip2form"],0,[MBilling.view.sip2,"Form"],0));(Ext.cmd.derive("MBilling.view.sip2.Lookup",Ext.ux.form.field.Lookup,{name:"id_sip",fieldLabel:t("Sip"),displayField:"id_sip_name",displayFieldList:"name",gridConfig:{xtype:"sip2list",fieldSearch:"name",columns:[{header:t("Account"),dataIndex:"idUserusername",flex:2},{header:t("name"),dataIndex:"name",flex:2}]}},0,["sip2lookup"],["component","box","container","fieldcontainer","sip2lookup"],{component:true,box:true,container:true,fieldcontainer:true,sip2lookup:true},["widget.sip2lookup"],0,[MBilling.view.sip2,"Lookup"],0));(Ext.cmd.derive("MBilling.view.sipuras.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.sipuras"],0,[MBilling.view.sipuras,"Controller"],0));(Ext.cmd.derive("MBilling.view.sipuras.Module",Ext.ux.panel.Module,{controller:"sipuras"},0,["sipurasmodule"],["component","box","container","uxpanelmodule","sipurasmodule"],{component:true,box:true,container:true,uxpanelmodule:true,sipurasmodule:true},["widget.sipurasmodule"],0,[MBilling.view.sipuras,"Module"],0));(Ext.cmd.derive("MBilling.view.sipuras.List",Ext.ux.grid.Panel,{store:"Sipuras",initComponent:function(){var b=this;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"}},{header:"Serial",dataIndex:"nserie"},{header:"Mac",dataIndex:"macadr"},{header:t("username")+" 1",dataIndex:"User_ID_1"},{header:t("username")+" 2",dataIndex:"User_ID_2"},{header:t("last_ip"),dataIndex:"last_ip"},{header:t("obs"),dataIndex:"obs"},{header:t("last")+" "+t("register"),dataIndex:"fultmov",renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s")}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["sipuraslist"],["component","box","container","panel","tablepanel","gridpanel","grid","sipuraslist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,sipuraslist:true},["widget.sipuraslist"],0,[MBilling.view.sipuras,"List"],0));(Ext.cmd.derive("MBilling.view.sipuras.Form",Ext.ux.form.Panel,{bodyPadding:0,fieldsHideUpdateLot:["id_user","nserie","macadr"],initComponent:function(){var b=this;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true,labelAlign:"right"}},items:[{title:t("general"),items:[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"nserie",fieldLabel:"Serial"},{name:"macadr",fieldLabel:"Mac"},{name:"senha_user",fieldLabel:t("password")+" "+t("username"),allowBlank:true},{name:"senha_admin",fieldLabel:t("password")+" "+t("admin"),allowBlank:true},{name:"antireset",fieldLabel:t("antireset"),xtype:"noyescombo"},{name:"Enable_Web_Server",fieldLabel:t("Enable_Web_Server"),xtype:"yesnocombo"},{name:"marca",fieldLabel:"marca",value:"*",hidden:true},{name:"altera",fieldLabel:"altera",value:"si",hidden:true}]},{title:t("line")+" 1",items:[{name:"User_ID_1",fieldLabel:t("username"),allowBlank:true},{name:"Password_1",fieldLabel:t("password"),allowBlank:true},{name:"Use_Pref_Codec_Only_1",fieldLabel:t("Use_Pref_Codec"),xtype:"noyescombo"},{name:"Preferred_Codec_1",fieldLabel:t("codec"),allowBlank:true,value:"G729a"},{name:"Register_Expires_1",fieldLabel:"Register Expires",allowBlank:true,value:"360"},{name:"Dial_Plan_1",fieldLabel:"Dial Plan",allowBlank:true,value:"(*xx|[3469]11|0|00|[2-9]xxxxxx|1xxx[2-9]xxxxxxS0|xxxxxxxxxxxx.)"},{name:"NAT_Mapping_Enable_1_",fieldLabel:"NAT Mapping",allowBlank:true,xtype:"noyescombo"},{name:"NAT_Keep_Alive_Enable_1_",fieldLabel:"NAT Keep Alive",allowBlank:true,xtype:"noyescombo"}]},{title:t("line")+" 2",items:[{name:"User_ID_2",fieldLabel:t("username"),allowBlank:true},{name:"Password_2",fieldLabel:t("password"),allowBlank:true},{name:"Use_Pref_Codec_Only_2",fieldLabel:t("Use_Pref_Codec"),xtype:"noyescombo"},{name:"Preferred_Codec_2",fieldLabel:t("codec"),allowBlank:true,value:"G729a"},{name:"Register_Expires_2",fieldLabel:"Register Expires",allowBlank:true,value:"360"},{name:"Dial_Plan_2",fieldLabel:"Dial Plan",allowBlank:true,value:"(*xx|[3469]11|0|00|[2-9]xxxxxx|1xxx[2-9]xxxxxxS0|xxxxxxxxxxxx.)"},{name:"NAT_Mapping_Enable_2_",fieldLabel:"NAT Mapping",allowBlank:true,xtype:"noyescombo"},{name:"NAT_Keep_Alive_Enable_2_",fieldLabel:"NAT Keep Alive",allowBlank:true,xtype:"noyescombo"}]},{title:"Stun",items:[{name:"STUN_Enable",fieldLabel:t("active")+"Stun",allowBlank:true,xtype:"noyescombo"},{name:"STUN_Test_Enable",fieldLabel:"STUN Test",allowBlank:true,xtype:"noyescombo"},{name:"Substitute_VIA_Addr",fieldLabel:"Substitute VIA Addr",allowBlank:true,xtype:"noyescombo"},{name:"STUN_Server",fieldLabel:"STUN Server",allowBlank:true}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["sipurasform"],["component","box","container","panel","form","sipurasform"],{component:true,box:true,container:true,panel:true,form:true,sipurasform:true},["widget.sipurasform"],0,[MBilling.view.sipuras,"Form"],0));(Ext.cmd.derive("MBilling.view.iax.Controller",Ext.ux.app.ViewController,{onEdit:function(){Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments);var g=this,e=g.list.getSelectionModel().getSelection()[0],f=g.formPanel.idRecord?e.get("allow").split(","):["g729","gsm","alaw","ulaw"],j=g.formPanel.down("checkboxgroup");j.setValue({allow:f})}},0,0,0,0,["controller.iax"],0,[MBilling.view.iax,"Controller"],0));(Ext.cmd.derive("MBilling.view.iax.Module",Ext.ux.panel.Module,{controller:"iax"},0,["iaxmodule"],["component","box","container","uxpanelmodule","iaxmodule"],{component:true,box:true,container:true,uxpanelmodule:true,iaxmodule:true},["widget.iaxmodule"],0,[MBilling.view.iax,"Module"],0));(Ext.cmd.derive("MBilling.view.iax.List",Ext.ux.grid.Panel,{store:"Iax",fieldSearch:"username",initComponent:function(){var b=this;b.columns=b.columns||[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("username"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:3},{header:t("ramal"),dataIndex:"name",flex:3},{header:t("password"),dataIndex:"secret",flex:2},{header:t("host"),dataIndex:"host",flex:3},{header:"IP",dataIndex:"ipaddr",flex:5},{header:t("context"),dataIndex:"context",hidden:true,hideable:!App.user.isClient,flex:1},{header:t("callerid"),dataIndex:"callerid",hidden:true,hideable:!App.user.isClient,flex:1},{header:t("codec"),dataIndex:"allow",hidden:true,hideable:!App.user.isClient,flex:1},{header:"nat",dataIndex:"nat",hidden:true,hideable:!App.user.isClient,flex:1},{header:"qualify",dataIndex:"qualify",hidden:true,hideable:!App.user.isClient,flex:1},{header:"dtmfmode",dataIndex:"dtmfmode",hidden:true,hideable:!App.user.isClient,flex:1},{header:"insecure",dataIndex:"insecure",hidden:true,hideable:!App.user.isClient,flex:1},{header:"type",dataIndex:"type",hidden:true,hideable:!App.user.isClient,flex:1}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["iaxlist"],["component","box","container","panel","tablepanel","gridpanel","grid","iaxlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,iaxlist:true},["widget.iaxlist"],0,[MBilling.view.iax,"List"],0));(Ext.cmd.derive("MBilling.view.iax.Form",Ext.ux.form.Panel,{bodyPadding:0,fieldsHideUpdateLot:["id_user","defaultuser","secret"],initComponent:function(){var b=this;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true,labelAlign:"right"}},items:[{title:t("general"),items:[{xtype:"userlookup",ownerForm:b,fieldLabel:t("accountcode"),hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"username",fieldLabel:t("username"),minLength:4,readOnly:App.user.isClient},{name:"secret",fieldLabel:t("password"),allowBlank:true,minLength:6,readOnly:App.user.isClient},{name:"callerid",fieldLabel:t("callerid"),allowBlank:true},{name:"disallow",fieldLabel:"disallow",value:"all",hidden:!App.user.isAdmin,allowBlank:App.user.isClient},{xtype:"checkboxgroup",columns:3,fieldLabel:t("codec"),items:[{boxLabel:"g729",name:"allow",inputValue:"g729",checked:true},{boxLabel:"g723",name:"allow",inputValue:"g723"},{boxLabel:"gsm",name:"allow",inputValue:"gsm",checked:true},{boxLabel:"g726",name:"allow",inputValue:"g726"},{boxLabel:"alaw",name:"allow",inputValue:"alaw",checked:true},{boxLabel:"ulaw",name:"allow",inputValue:"ulaw",checked:true},{boxLabel:"g722",name:"allow",inputValue:"g722"},{boxLabel:"ilbc",name:"allow",inputValue:"ilbc"},{boxLabel:"speex",name:"allow",inputValue:"speex"},{boxLabel:"h261",name:"allow",inputValue:"h261"},{boxLabel:"h263",name:"allow",inputValue:"h263"}],hidden:!App.user.isAdmin,allowBlank:App.user.isClient},{name:"host",fieldLabel:t("host"),value:"dynamic",hidden:App.user.isClient,allowBlank:App.user.isClient}]},{title:t("natdetails"),hidden:!App.user.isAdmin,items:[{name:"nat",fieldLabel:"nat",value:App.user.asteriskVersion=="1.8"?"yes":"force_rport,comedia",allowBlank:!App.user.isAdmin}]},{title:t("suplementaryInfo"),hidden:!App.user.isAdmin,items:[{name:"context",fieldLabel:t("context"),value:"billing",hidden:!App.user.isAdmin,allowBlank:true},{xtype:"yesnostringcombo",name:"qualify",fieldLabel:"qualify",value:"no",allowBlank:!App.user.isAdmin},{name:"dtmfmode",fieldLabel:"dtmfmode",value:"RFC2833",allowBlank:!App.user.isAdmin},{name:"insecure",fieldLabel:"insecure",value:"no",allowBlank:true},{name:"type",fieldLabel:"type",value:"friend",allowBlank:!App.user.isAdmin},{name:"calllimit",xtype:"numberfield",fieldLabel:t("calllimit"),value:"0",allowBlank:!App.user.isAdmin}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["iaxform"],["component","box","container","panel","form","iaxform"],{component:true,box:true,container:true,panel:true,form:true,iaxform:true},["widget.iaxform"],0,[MBilling.view.iax,"Form"],0));(Ext.cmd.derive("MBilling.view.iax.Lookup",Ext.ux.form.field.Lookup,{name:"id_iax",fieldLabel:t("Iax"),displayField:"idIaxname",displayFieldList:"name",gridConfig:{xtype:"iaxlist",fieldSearch:"name",columns:[{header:t("Account"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:2},{header:t("name"),dataIndex:"name",flex:2}]}},0,["siaxlookup"],["component","box","container","fieldcontainer","siaxlookup"],{component:true,box:true,container:true,fieldcontainer:true,siaxlookup:true},["widget.siaxlookup"],0,[MBilling.view.iax,"Lookup"],0));(Ext.cmd.derive("MBilling.view.callOnLine.Controller",Ext.ux.app.ViewController,{onEdit:function(){var d=this,e=d.list.getSelectionModel().getSelection()[0],f=e.get("uniqueid");Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments);Ext.Ajax.request({url:"index.php/callOnLine/getChannelDetails",params:{id:e.get("uniqueid"),channel:e.get("canal"),server:e.get("server")},scope:d,success:function(a){a=Ext.decode(a.responseText);if(a[d.nameSuccessRequest]){d.formPanel.getForm().findField("description").setValue(a.description);d.formPanel.getForm().findField("codec").setValue(a.codec);d.formPanel.getForm().findField("reinvite").setValue(a.reinvite);d.formPanel.getForm().findField("from_ip").setValue(a.from_ip);d.formPanel.getForm().findField("ndiscado").setValue(a.ndiscado);d.formPanel.getForm().findField("billsec").setValue(a.billsec);d.formPanel.getForm().findField("callerid").setValue(a.callerid)}else{Ext.ux.Alert.alert(d.titleError,a[d.nameMsgRequest],"error")}}})},onSpyCallFree:function(e){var f=this,d=f.list.getSelectionModel().getSelection()[0];if(f.list.getSelectionModel().getSelection().length==1){Ext.Ajax.request({url:"index.php/callOnLine/spyCall",params:{type:"b",channel:d.get("canal")},scope:f,success:function(a){a=Ext.decode(a.responseText);if(a[f.nameSuccessRequest]){Ext.ux.Alert.alert(f.titleSuccess,a[f.nameMsgRequest],"success")}else{Ext.ux.Alert.alert(f.titleError,a[f.nameMsgRequest],"error")}}})}else{Ext.ux.Alert.alert(f.titleError,"Please Select only a record","notification")}},onDelete:function(e){var f=this,d=f.list.getSelectionModel().getSelection()[0];if(f.list.getSelectionModel().getSelection().length==1){Ext.Ajax.request({url:"index.php/callOnLine/destroy",params:{id:d.get("uniqueid")},scope:f,success:function(a){a=Ext.decode(a.responseText);if(a[f.nameSuccessRequest]){Ext.ux.Alert.alert(f.titleSuccess,a[f.nameMsgRequest],"success")}else{Ext.ux.Alert.alert(f.titleError,a[f.nameMsgRequest],"error")}}})}else{Ext.ux.Alert.alert(f.titleError,"Please Select only a record","notification")}f.store.load()}},0,0,0,0,["controller.callonline"],0,[MBilling.view.callOnLine,"Controller"],0));(Ext.cmd.derive("MBilling.view.callOnLine.Module",Ext.ux.panel.Module,{controller:"callonline"},0,["callonlinemodule"],["component","box","container","uxpanelmodule","callonlinemodule"],{component:true,box:true,container:true,uxpanelmodule:true,callonlinemodule:true},["widget.callonlinemodule"],0,[MBilling.view.callOnLine,"Module"],0));(Ext.cmd.derive("MBilling.view.callOnLine.SpyCall",Ext.window.Window,{modal:true,layout:"fit",iconCls:"call",title:t("Spy call"),width:450,height:window.isThemeNeptune||window.isThemeCrisp?170:window.isThemeTriton?290:170,labelWidthFields:80,channel:0,initComponent:function(){var b=this;if(b.list.getSelectionModel().getSelection().length==1){selected=b.list.getSelectionModel().getSelection()[0];if(selected.get("canal")){b.channel=selected.get("canal")}else{b.channel=selected.get("channel")}b.title=t("Spy call")+" "+selected.get("ndiscado")+" "+b.channel,b.autoShow=true;b.items=[{xtype:"form",bodyPadding:5,defaults:{anchor:"0",enableKeyEvents:true,labelWidth:b.labelWidthFields,msgTarget:"side",plugins:"markallowblank",allowBlank:false},items:[{xtype:"siplookup",name:"id_sip",displayField:t("Sip Account")},{xtype:"combobox",name:"type",value:"b",forceSelection:true,editable:false,store:[["b",t("Only Spy")],["w",t("Whisper, can talk to the spied")],["W",t("Whisper, can talk to the spied but cannot listen the call")]],fieldLabel:t("Spy type")}]}];b.title=b.title+(b.titleModule?" - "+b.titleModule:"");b.bbar=[{width:150,text:t("Send"),scope:b,handler:b.onSendSpy}]}else{Ext.ux.Alert.alert(b.titleError,"Please Select only a record","notification")}Ext.window.Window.prototype.initComponent.apply(this,arguments)},onSendSpy:function(d){var f=this,e=f.list.store;if(!f.down("form").isValid()){Ext.ux.Alert.alert("Alert",t("Select sip account"),"notification");return}f.list.setLoading(true);Ext.Ajax.setTimeout(1000000);f.down("form").submit({url:"index.php/callOnLine/spyCall",params:{id_sip:selected.get("id_sip"),type:selected.get("type"),channel:f.channel},scope:f,success:function(c,b){var a=Ext.decode(b.response.responseText);if(a.success){Ext.ux.Alert.alert(t("Success"),a.msg,"success")}else{Ext.ux.Alert.alert(t("Error"),a.errors,"error")}d.enable();f.list.setLoading(false);e.load();f.close()},failure:function(c,b){console.log(b.response.responseText);if(b.response&&Ext.isObject(b.response.responseText)){var a=Ext.decode(b.response.responseText);Ext.ux.Alert.alert(t("Error1"),a.errors,"error")}else{Ext.ux.Alert.alert(t("Error2"),Ext.decode(b.response.responseText).msg,"error",true,10)}d.enable()}})}},0,["callonlinespycall"],["component","box","container","panel","window","callonlinespycall"],{component:true,box:true,container:true,panel:true,window:true,callonlinespycall:true},["widget.callonlinespycall"],0,[MBilling.view.callOnLine,"SpyCall"],0));(Ext.cmd.derive("MBilling.view.callOnLine.List",Ext.ux.grid.Panel,{store:"CallOnLine",fieldSearch:"idUser.username",refreshTime:15,initComponent:function(){var b=this;b.buttonCsv=false;b.allowPrint=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=!App.user.isClient;b.textDelete=t("Hangup Call"),b.buttonDeleteWidth=140,b.refreshTime=(localStorage&&localStorage.getItem("callonlinerefresh"))||b.refreshTime;b.extraButtons=[{text:t("Spy")+" "+t("call"),iconCls:"call",handler:window.multSpy?"onSpyCall":"onSpyCallFree",width:130,disabled:false},{xtype:"numberfield",field:"jmlhBrg",fieldLabel:t("Refresh Time"),editable:false,minValue:5,labelWidth:90,width:150,selectOnFocus:true,allowDecimals:true,decimalPrecision:2,value:b.refreshTime,listeners:{change:function(a){if(a.value>0){b.refreshTime=a.value;localStorage.setItem("callonlinerefresh",a.value)}}}}];b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("UniqueID"),dataIndex:"uniqueid",hidden:true,hideable:App.user.isAdmin},{header:t("Channel"),dataIndex:"canal",hidden:true,flex:3},{header:t("Sip Account"),dataIndex:"sip_account",flex:3},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:3},{header:t("credit"),dataIndex:"idUsercredit",filter:{type:"int",field:"idUser.credit"},renderer:Helper.Util.formatMoneyDecimal,flex:2},{header:t("number"),dataIndex:"ndiscado",flex:3},{header:t("status"),dataIndex:"status",filter:{type:"string",field:"status"},flex:2},{header:t("duration"),dataIndex:"duration",renderer:Helper.Util.formatsecondsToTime,flex:2},{header:t("trunk"),dataIndex:"tronco",flex:4,hidden:!App.user.isAdmin,hideable:App.user.isAdmin},{header:t("Server"),dataIndex:"server",flex:3,hidden:!window.slave||!App.user.isAdmin,hideable:App.user.isAdmin}];b.sessionLoad=Ext.create("Ext.util.DelayedTask",function(){b.store.load()},b);Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments);b.store.on("load",b.onLoadStore,b)},onLoadStore:function(){var b=this;b.onDeactivateModule();b.onActivateModule()},onRender:function(){var b=this;if(Ext.isObject(b.module)){b.module.on("activate",b.onActivateModule,b);b.module.on("deactivate",b.onDeactivateModule,b);b.module.on("close",b.onCloseModule,b)}Ext.ux.grid.Panel.prototype.onRender.apply(this,arguments)},onActivateModule:function(){this.sessionLoad&&this.sessionLoad.delay(this.refreshTime*1000)},onDeactivateModule:function(){this.sessionLoad&&this.sessionLoad.cancel()},onCloseModule:function(){this.onDeactivateModule();this.sessionLoad=null}},0,["callonlinelist"],["component","box","container","panel","tablepanel","gridpanel","grid","callonlinelist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callonlinelist:true},["widget.callonlinelist"],0,[MBilling.view.callOnLine,"List"],0));(Ext.cmd.derive("MBilling.view.callOnLine.List2",Ext.ux.grid.Panel,{store:"CallOnLine",fieldSearch:"username",refreshTime:10,initComponent:function(){var b=this;b.buttonCsv=false;b.allowPrint=false;b.buttonUpdateLot=false;b.allowCreate=false;b.buttonCleanFilter=false;b.allowUpdate=false;b.allowDelete=false;b.refreshTime=(localStorage&&localStorage.getItem("callonlinerefresh"))||b.refreshTime;b.extraButtons=[{xtype:"numberfield",field:"jmlhBrg",fieldLabel:t("Refresh Time"),editable:false,minValue:5,labelWidth:90,width:150,selectOnFocus:true,allowDecimals:true,decimalPrecision:2,value:b.refreshTime,listeners:{change:function(a){if(a.value>0){b.refreshTime=a.value;localStorage.setItem("callonlinerefresh",a.value)}}}}];b.columns=[{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:2},{header:t("Sip Account"),dataIndex:"canal",flex:3,hidden:true,hideable:true},{header:t("number"),dataIndex:"ndiscado",flex:3},{header:t("status"),dataIndex:"status",filter:{type:"string",field:"status"},flex:2},{header:t("duration"),dataIndex:"duration",renderer:Helper.Util.formatsecondsToTime,flex:2},{header:t("trunk"),dataIndex:"tronco",flex:4,hidden:App.user.isClient,hideable:!App.user.isClient}];b.sessionLoad=Ext.create("Ext.util.DelayedTask",function(){b.store.load()},b);Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments);b.store.on("load",b.onLoadStore,b)},onLoadStore:function(){var b=this;b.onDeactivateModule();b.onActivateModule()},onRender:function(){var b=this;if(Ext.isObject(b.module)){b.module.on("activate",b.onActivateModule,b);b.module.on("deactivate",b.onDeactivateModule,b);b.module.on("close",b.onCloseModule,b)}Ext.ux.grid.Panel.prototype.onRender.apply(this,arguments)},onActivateModule:function(){this.sessionLoad&&this.sessionLoad.delay(this.refreshTime*1000)},onDeactivateModule:function(){this.sessionLoad&&this.sessionLoad.cancel()},onCloseModule:function(){this.onDeactivateModule();this.sessionLoad=null}},0,["callonlinelist2"],["component","box","container","panel","tablepanel","gridpanel","grid","callonlinelist2"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callonlinelist2:true},["widget.callonlinelist2"],0,[MBilling.view.callOnLine,"List2"],0));(Ext.cmd.derive("MBilling.view.callOnLine.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{fieldLabel:t("number"),name:"ndiscado",readOnly:true},{fieldLabel:t("CallerID"),name:"callerid",readOnly:true},{fieldLabel:t("Real")+" "+t("duration"),name:"billsec",readOnly:true},{fieldLabel:t("Codec"),name:"codec",readOnly:true},{fieldLabel:t("Reinvite"),name:"reinvite",readOnly:true},{fieldLabel:t("From IP"),name:"from_ip",readOnly:true},{xtype:"textarea",name:"description",readOnly:true,height:350,anchor:"100%",hidden:!App.user.isAdmin}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callonlineform"],["component","box","container","panel","form","callonlineform"],{component:true,box:true,container:true,panel:true,form:true,callonlineform:true},["widget.callonlineform"],0,[MBilling.view.callOnLine,"Form"],0));(Ext.cmd.derive("MBilling.view.sendCreditSummary.Controller",Ext.ux.app.ViewController,{formHidden:true},0,0,0,0,["controller.sendcreditsummary"],0,[MBilling.view.sendCreditSummary,"Controller"],0));(Ext.cmd.derive("MBilling.view.sendCreditSummary.Module",Ext.form.Panel,{resizable:false,autoShow:true,header:false,items:[{xtype:"component",autoEl:{width:"100%",height:"100%",tag:"iframe",src:"index.php/sendCreditSummary/read"}}]},0,["sendcreditsummarymodule"],["component","box","container","panel","form","sendcreditsummarymodule"],{component:true,box:true,container:true,panel:true,form:true,sendcreditsummarymodule:true},["widget.sendcreditsummarymodule"],0,[MBilling.view.sendCreditSummary,"Module"],0));(Ext.cmd.derive("MBilling.view.sendCreditSummary.List",Ext.ux.grid.Panel,{store:"SendCreditSummary",initComponent:function(){var b=this;b.extraButtons=[{emptyText:t("From Day"),xtype:"searchfield",fieldFilter:"date",filterOnClick:b.filterFieldOnClick,store:b.store,comparison:"gt",type:"date"},{emptyText:t("To Day"),xtype:"searchfield",fieldFilter:"date",filterOnClick:b.filterFieldOnClick,store:b.store,comparison:"lt",type:"date"}];b.buttonCsv=false;b.buttonPrint=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("day"),renderer:Ext.util.Format.dateRenderer("Y-m-d"),dataIndex:"day",menuDisabled:true,flex:3},{header:t("service"),dataIndex:"service",flex:5},{header:t("Total cost"),dataIndex:"total_cost",flex:5,renderer:Helper.Util.formatMoneyDecimal2},{header:t("Total sale"),dataIndex:"total_sale",flex:5,renderer:Helper.Util.formatMoneyDecimal2},{header:t("Earned"),dataIndex:"earned",flex:5,renderer:Helper.Util.formatMoneyDecimal2}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["sendcreditsummarylist"],["component","box","container","panel","tablepanel","gridpanel","grid","sendcreditsummarylist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,sendcreditsummarylist:true},["widget.sendcreditsummarylist"],0,[MBilling.view.sendCreditSummary,"List"],0));(Ext.cmd.derive("MBilling.view.sendCreditSummary.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:App.user.isClient}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["sendcreditsummaryform"],["component","box","container","panel","form","sendcreditsummaryform"],{component:true,box:true,container:true,panel:true,form:true,sendcreditsummaryform:true},["widget.sendcreditsummaryform"],0,[MBilling.view.sendCreditSummary,"Form"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayUser.Controller",Ext.ux.app.ViewController,{onEdit:function(){me=this;me.sumData=me.store.getData().items[0].getData();if(!me.sumData){return}me.formPanel.getForm().getFields().each(function(b){b.setValue(me.sumData[b.name])});me.formPanel.expand()},onExportCsvDayUser:function(o,l,g){var m=this,j=m.list.getStore(),n=m.list.filters.getFilterData().length?Ext.encode(m.list.filters.getFilterData()):j.proxy.extraParams.filter;window.open("index.php/callSummaryDayUser/exportCsvCalls?id="+o.getStore().getAt(l).getData().idUserusername+"&filter="+n)}},0,0,0,0,["controller.callsummarydayuser"],0,[MBilling.view.callSummaryDayUser,"Controller"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayUser.Module",Ext.ux.panel.Module,{controller:"callsummarydayuser",titleDetails:t("total"),iconForm:"icon-sum",cfgEast:{flex:0.4}},0,["callsummarydayusermodule"],["component","box","container","uxpanelmodule","callsummarydayusermodule"],{component:true,box:true,container:true,uxpanelmodule:true,callsummarydayusermodule:true},["widget.callsummarydayusermodule"],0,[MBilling.view.callSummaryDayUser,"Module"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayUser.List",Ext.ux.grid.Panel,{store:"CallSummaryDayUser",initComponent:function(){var b=this;b.buttonImportCsv=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{xtype:"actioncolumn",width:26,sortable:false,menuDisabled:true,header:t(""),dataIndex:"id",items:[{iconCls:"icon-export-csv",tooltip:t("Export CSV"),handler:"onExportCsvDayUser"}],hidden:!App.user.isAdmin},{header:t("day"),renderer:Ext.util.Format.dateRenderer("Y-m-d"),dataIndex:"day",filter:{type:"date",field:"day"},flex:3},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("sessiontime")+" "+t("Min"),dataIndex:"sessiontime",flex:2},{header:t("aloc_all_calls"),dataIndex:"aloc_all_calls",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Answered Calls"),dataIndex:"nbcall",flex:3},{header:t("buycost"),dataIndex:App.user.isAdmin?"buycost":"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("sessionbill"),dataIndex:App.user.isAgent||App.user.isClientAgent?"agent_bill":"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("markup"),dataIndex:"lucro",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarydayuserlist"],["component","box","container","panel","tablepanel","gridpanel","grid","callsummarydayuserlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callsummarydayuserlist:true},["widget.callsummarydayuserlist"],0,[MBilling.view.callSummaryDayUser,"List"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayUser.Form",Ext.ux.form.Panel,{defaults:{},labelWidthFields:100,defaultType:"displayfield",initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{name:"sumsessiontime",fieldLabel:t("sessiontime")+" "+t("Min"),renderer:Ext.util.Format.numberRenderer("0"),allowBlank:true},{name:App.user.isAgent||App.user.isClientAgent?"sumagent_bill":"sumsessionbill",fieldLabel:t("sessionbill"),renderer:Helper.Util.formatMoneyDecimal,allowBlank:true},{name:App.user.isAdmin?"sumbuycost":"sumsessionbill",fieldLabel:t("buycost"),renderer:Helper.Util.formatMoneyDecimal,hidden:App.user.isClient,allowBlank:true},{name:"sumlucro",fieldLabel:t("markup"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumnbcall",fieldLabel:t("nbcall"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarydayuserform"],["component","box","container","panel","form","callsummarydayuserform"],{component:true,box:true,container:true,panel:true,form:true,callsummarydayuserform:true},["widget.callsummarydayuserform"],0,[MBilling.view.callSummaryDayUser,"Form"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayTrunk.Controller",Ext.ux.app.ViewController,{onEdit:function(){me=this;me.sumData=me.store.getData().items[0].getData();if(!me.sumData){return}me.formPanel.getForm().getFields().each(function(b){b.setValue(me.sumData[b.name])});me.formPanel.expand()}},0,0,0,0,["controller.callsummarydaytrunk"],0,[MBilling.view.callSummaryDayTrunk,"Controller"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayTrunk.Module",Ext.ux.panel.Module,{controller:"callsummarydaytrunk",titleDetails:t("total"),iconForm:"icon-sum",cfgEast:{flex:0.4}},0,["callsummarydaytrunkmodule"],["component","box","container","uxpanelmodule","callsummarydaytrunkmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callsummarydaytrunkmodule:true},["widget.callsummarydaytrunkmodule"],0,[MBilling.view.callSummaryDayTrunk,"Module"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayTrunk.List",Ext.ux.grid.Panel,{store:"CallSummaryDayTrunk",initComponent:function(){var b=this;b.buttonImportCsv=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{header:t("day"),renderer:Ext.util.Format.dateRenderer("Y-m-d"),dataIndex:"day",filter:{type:"date",field:"day"},flex:3},{header:t("Trunk"),dataIndex:"idTrunktrunkcode",filter:{type:"string",field:"idTrunk.trunkcode"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("sessiontime")+" "+t("Min"),dataIndex:"sessiontime",flex:2},{header:t("aloc_all_calls"),dataIndex:"aloc_all_calls",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Answered Calls"),dataIndex:"nbcall",flex:3},{header:t("buycost"),dataIndex:"buycost",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("sessionbill"),dataIndex:"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("markup"),dataIndex:"lucro",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarydaytrunklist"],["component","box","container","panel","tablepanel","gridpanel","grid","callsummarydaytrunklist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callsummarydaytrunklist:true},["widget.callsummarydaytrunklist"],0,[MBilling.view.callSummaryDayTrunk,"List"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayTrunk.Form",Ext.ux.form.Panel,{defaults:{},labelWidthFields:100,defaultType:"displayfield",initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{name:"sumsessiontime",fieldLabel:t("sessiontime")+" "+t("Min"),renderer:Ext.util.Format.numberRenderer("0"),allowBlank:true},{name:"sumsessionbill",fieldLabel:t("sessionbill"),renderer:Helper.Util.formatMoneyDecimal,allowBlank:true},{name:"sumbuycost",fieldLabel:t("buycost"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumlucro",fieldLabel:t("markup"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumnbcall",fieldLabel:t("nbcall"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarydaytrunkform"],["component","box","container","panel","form","callsummarydaytrunkform"],{component:true,box:true,container:true,panel:true,form:true,callsummarydaytrunkform:true},["widget.callsummarydaytrunkform"],0,[MBilling.view.callSummaryDayTrunk,"Form"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayAgent.Controller",Ext.ux.app.ViewController,{onEdit:function(){me=this;me.sumData=me.store.getData().items[0].getData();if(!me.sumData){return}me.formPanel.getForm().getFields().each(function(b){b.setValue(me.sumData[b.name])});me.formPanel.expand()}},0,0,0,0,["controller.callsummarydayagent"],0,[MBilling.view.callSummaryDayAgent,"Controller"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayAgent.Module",Ext.ux.panel.Module,{controller:"callsummarydayagent",titleDetails:t("total"),iconForm:"icon-sum",cfgEast:{flex:0.4}},0,["callsummarydayagentmodule"],["component","box","container","uxpanelmodule","callsummarydayagentmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callsummarydayagentmodule:true},["widget.callsummarydayagentmodule"],0,[MBilling.view.callSummaryDayAgent,"Module"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayAgent.List",Ext.ux.grid.Panel,{store:"CallSummaryDayAgent",initComponent:function(){var b=this;b.buttonImportCsv=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{header:t("day"),renderer:Ext.util.Format.dateRenderer("Y-m-d"),dataIndex:"day",filter:{type:"date",field:"day"},flex:3},{header:t("Agent"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{menuDisabled:true,header:t("sessiontime")+" "+t("Min"),dataIndex:"sessiontime",flex:2},{header:t("aloc_all_calls"),dataIndex:"aloc_all_calls",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Answered Calls"),dataIndex:"nbcall",flex:3},{header:t("buycost"),dataIndex:"buycost",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("sessionbill"),dataIndex:"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("markup"),dataIndex:"lucro",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarydayagentlist"],["component","box","container","panel","tablepanel","gridpanel","grid","callsummarydayagentlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callsummarydayagentlist:true},["widget.callsummarydayagentlist"],0,[MBilling.view.callSummaryDayAgent,"List"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayAgent.Form",Ext.ux.form.Panel,{defaults:{},labelWidthFields:100,defaultType:"displayfield",initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{name:"sumsessiontime",fieldLabel:t("sessiontime")+" "+t("Min"),renderer:Ext.util.Format.numberRenderer("0"),allowBlank:true},{name:"sumsessionbill",fieldLabel:t("sessionbill"),renderer:Helper.Util.formatMoneyDecimal,allowBlank:true},{name:"sumbuycost",fieldLabel:t("buycost"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumlucro",fieldLabel:t("markup"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumnbcall",fieldLabel:t("nbcall"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarydayagentform"],["component","box","container","panel","form","callsummarydayagentform"],{component:true,box:true,container:true,panel:true,form:true,callsummarydayagentform:true},["widget.callsummarydayagentform"],0,[MBilling.view.callSummaryDayAgent,"Form"],0));(Ext.cmd.derive("MBilling.view.callerid.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.callerid"],0,[MBilling.view.callerid,"Controller"],0));(Ext.cmd.derive("MBilling.view.callerid.Module",Ext.ux.panel.Module,{controller:"callerid"},0,["calleridmodule"],["component","box","container","uxpanelmodule","calleridmodule"],{component:true,box:true,container:true,uxpanelmodule:true,calleridmodule:true},["widget.calleridmodule"],0,[MBilling.view.callerid,"Module"],0));(Ext.cmd.derive("MBilling.view.callerid.List",Ext.ux.grid.Panel,{store:"Callerid",initComponent:function(){var b=this;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("cid"),dataIndex:"cid",flex:4},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("status"),dataIndex:"activated",renderer:Helper.Util.formatBooleanActive,comboRelated:"booleancombo",flex:2,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")]]}}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["calleridlist"],["component","box","container","panel","tablepanel","gridpanel","grid","calleridlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,calleridlist:true},["widget.calleridlist"],0,[MBilling.view.callerid,"List"],0));(Ext.cmd.derive("MBilling.view.callerid.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["id_user"],initComponent:function(){var b=this;b.items=[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"cid",fieldLabel:t("cid")},{xtype:"booleancombo",name:"activated",fieldLabel:t("status"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["calleridform"],["component","box","container","panel","form","calleridform"],{component:true,box:true,container:true,panel:true,form:true,calleridform:true},["widget.calleridform"],0,[MBilling.view.callerid,"Form"],0));(Ext.cmd.derive("MBilling.view.restrictedPhonenumber.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.restrictedphonenumber"],0,[MBilling.view.restrictedPhonenumber,"Controller"],0));(Ext.cmd.derive("MBilling.view.restrictedPhonenumber.Module",Ext.ux.panel.Module,{controller:"restrictedphonenumber"},0,["restrictedphonenumbermodule"],["component","box","container","uxpanelmodule","restrictedphonenumbermodule"],{component:true,box:true,container:true,uxpanelmodule:true,restrictedphonenumbermodule:true},["widget.restrictedphonenumbermodule"],0,[MBilling.view.restrictedPhonenumber,"Module"],0));(Ext.cmd.derive("MBilling.view.restrictedPhonenumber.List",Ext.ux.grid.Panel,{store:"RestrictedPhonenumber",buttonImportCsv:true,initComponent:function(){var b=this;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:2,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("number"),dataIndex:"number",flex:2}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["restrictedphonenumberlist"],["component","box","container","panel","tablepanel","gridpanel","grid","restrictedphonenumberlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,restrictedphonenumberlist:true},["widget.restrictedphonenumberlist"],0,[MBilling.view.restrictedPhonenumber,"List"],0));(Ext.cmd.derive("MBilling.view.restrictedPhonenumber.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["id_user"],initComponent:function(){var b=this;b.items=[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,readOnly:App.user.isClient,allowBlank:App.user.isClient},{name:"number",fieldLabel:t("number")}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["restrictedphonenumberform"],["component","box","container","panel","form","restrictedphonenumberform"],{component:true,box:true,container:true,panel:true,form:true,restrictedphonenumberform:true},["widget.restrictedphonenumberform"],0,[MBilling.view.restrictedPhonenumber,"Form"],0));(Ext.cmd.derive("MBilling.view.restrictedPhonenumber.ImportCsv",Ext.ux.window.ImportCsv,{htmlTipInfo:"
number
",fieldsImport:[{xtype:"usercombo",width:350}]},0,["restrictedphonenumberimportcsv"],["component","box","container","panel","window","restrictedphonenumberimportcsv"],{component:true,box:true,container:true,panel:true,window:true,restrictedphonenumberimportcsv:true},["widget.restrictedphonenumberimportcsv"],0,[MBilling.view.restrictedPhonenumber,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.did.Controller",Ext.ux.app.ViewController,{isSubmitForm:true,init:function(){var b=this;b.control({"booleancombo[name=cbr]":{select:b.onSelectcbr},"noyescombo[name=cbr_ua]":{select:b.onSelectcbrAu}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectcbr:function(c,d){me=this,form=me.formPanel.getForm();form.findField("cbr_ua").setVisible(d.data.field1);form.findField("cbr_total_try").setVisible(d.data.field1);form.findField("cbr_time_try").setVisible(d.data.field1)},onSelectcbrAu:function(c,d){me=this,form=me.formPanel.getForm();form.findField("cbr_em").setVisible(d.data.field1);form.findField("TimeOfDay_monFri").setVisible(d.data.field1);form.findField("TimeOfDay_sat").setVisible(d.data.field1);form.findField("TimeOfDay_sun").setVisible(d.data.field1);form.findField("workaudio").setVisible(d.data.field1);form.findField("noworkaudio").setVisible(d.data.field1)},onNew:function(e){var f=this,d=f.formPanel.getForm();d.findField("cbr_ua").setVisible(false);d.findField("cbr_em").setVisible(false);d.findField("TimeOfDay_monFri").setVisible(false);d.findField("TimeOfDay_sat").setVisible(false);d.findField("TimeOfDay_sun").setVisible(false);d.findField("workaudio").setVisible(false);d.findField("noworkaudio").setVisible(false);d.findField("cbr_total_try").setVisible(false);d.findField("cbr_time_try").setVisible(false);Ext.ux.app.ViewController.prototype.onNew.apply(this,arguments)},onEdit:function(){var c=this,d=c.list.getSelectionModel().getSelection()[0];if(d.get("cbr")==0){c.formPanel.getForm().findField("cbr_ua").setVisible(false);c.formPanel.getForm().findField("cbr_em").setVisible(false);c.formPanel.getForm().findField("TimeOfDay_monFri").setVisible(false);c.formPanel.getForm().findField("TimeOfDay_sat").setVisible(false);c.formPanel.getForm().findField("TimeOfDay_sun").setVisible(false);c.formPanel.getForm().findField("workaudio").setVisible(false);c.formPanel.getForm().findField("noworkaudio").setVisible(false);c.formPanel.getForm().findField("cbr_total_try").setVisible(false);c.formPanel.getForm().findField("cbr_time_try").setVisible(false)}else{c.formPanel.getForm().findField("cbr_ua").setVisible(true);if(d.get("cbr_ua")==1){c.formPanel.getForm().findField("cbr_em").setVisible(true);c.formPanel.getForm().findField("TimeOfDay_monFri").setVisible(true);c.formPanel.getForm().findField("TimeOfDay_sat").setVisible(true);c.formPanel.getForm().findField("TimeOfDay_sun").setVisible(true);c.formPanel.getForm().findField("workaudio").setVisible(true);c.formPanel.getForm().findField("noworkaudio").setVisible(true);c.formPanel.getForm().findField("cbr_total_try").setVisible(true);c.formPanel.getForm().findField("cbr_time_try").setVisible(true)}}Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)},onDelete:function(j){var g=this,e=g.list.getSelectionModel().getSelection(),f=true;Ext.each(e,function(a){if(a.get("reserved")===1){Ext.ux.Alert.alert(g.titleError,t("Please, first release the DID")+" "+a.raw.did,"error");f=false;return}});if(f==true){Ext.ux.app.ViewController.prototype.onDelete.apply(this,arguments)}},onRelease:function(o,l){var m=this,n=m.list.getSelectionModel().getSelection()[0],j=t("Confirm Release Did")+" "+n.get("did"),g=m.list.getStore();if(m.list.getSelectionModel().getSelection().length>1){Ext.ux.Alert.alert(m.titleError,t("Please Select only one DID to release"),"error")}else{if(n.get("reserved")===0){Ext.ux.Alert.alert(m.titleError,t("didIsNotUse"),"error");g.load()}else{Ext.Msg.confirm(m.titleConfirmation,j,function(a){if(a==="yes"){Ext.Ajax.request({url:"index.php/did/liberar",params:{id:n.get("id")},success:function(c){c=Ext.decode(c.responseText);if(c[m.nameSuccessRequest]){Ext.ux.Alert.alert(m.titleSuccess,c[m.nameMsgRequest],"success");g.load()}else{var b=Helper.Util.convertErrorsJsonToString(c[m.nameMsgRequest]);g.load()}}})}},m)}}},onBuyDid:function(){var m=this,j=m.lookupReference("buydidPanel"),f=j.getForm().findField("did").getValue(),l=j.getForm().findField("did").rawValue,g=t("confirmationBuyDid");if(f<1){Ext.ux.Alert.alert(m.titleError,t("Please, select a Did"),"warning")}else{Ext.Msg.confirm(t("Confirmation"),g+"
"+l,function(a){if(a==="yes"){Ext.ux.Alert.alert(m.titleSuccess,t("Please wait....We are activing your DID."),"notification");Ext.Ajax.request({url:"index.php/did/buy",params:{id:f},success:function(c){c=Ext.decode(c.responseText);if(c.success){Ext.ux.Alert.alert(m.titleSuccess,t(c.msg),"success",true,true,5000)}else{var b=Helper.Util.convertErrorsJsonToString(c.msg);Ext.ux.Alert.alert(m.titleError,t(b),"warning",true,true,5000)}}})}},m)}}},0,0,0,0,["controller.did"],0,[MBilling.view.did,"Controller"],0));(Ext.cmd.derive("MBilling.view.did.Combo",Ext.form.field.ComboBox,{name:"id_did",fieldLabel:t("did"),displayField:"did",forceSelection:true,editable:true,valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Did",{proxy:{type:"uxproxy",module:"did",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["didcombo"],["component","box","field","textfield","pickerfield","combobox","combo","didcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,didcombo:true},["widget.didcombo"],0,[MBilling.view.did,"Combo"],0));(Ext.cmd.derive("MBilling.view.did.BuyCombo",Ext.form.field.ComboBox,{name:"id_did",forceSelection:true,editable:false,fieldLabel:t("did"),displayField:"did",valueField:"id",listConfig:{itemTpl:Ext.create("Ext.XTemplate","
{did} ("+t("Setup")+": "+t("moedasimblo")+" {connection_charge} --> "+t("monthly payment")+": "+t("moedasimblo")+" {fixrate})
")},displayTpl:Ext.create("Ext.XTemplate",'{did} ('+t("Setup")+": "+t("moedasimblo")+" {connection_charge} --> "+t("monthly payment")+": "+t("moedasimblo")+" {fixrate})"),initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Did",{proxy:{type:"uxproxy",module:"did",actionRead:"readBuy",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["didbuycombo"],["component","box","field","textfield","pickerfield","combobox","combo","didbuycombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,didbuycombo:true},["widget.didbuycombo"],0,[MBilling.view.did,"BuyCombo"],0));(Ext.cmd.derive("MBilling.view.did.Module",Ext.ux.panel.Module,{controller:"did"},0,["didmodule"],["component","box","container","uxpanelmodule","didmodule"],{component:true,box:true,container:true,uxpanelmodule:true,didmodule:true},["widget.didmodule"],0,[MBilling.view.did,"Module"],0));(Ext.cmd.derive("MBilling.view.did.List",Ext.ux.grid.Panel,{store:"Did",fieldSearch:"did",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.extraButtons=[{text:t("crearToReleaseDid"),iconCls:"icon-delete",handler:"onRelease",disabled:false}];b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("did"),dataIndex:"did",flex:4},{header:t("reserved"),dataIndex:"reserved",renderer:Helper.Util.formattyyesno,flex:2,filter:{type:"list",options:[[1,t("yes")],[0,t("no")]]},hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:3,menuDisabled:true},{header:t("status"),dataIndex:"activated",renderer:Helper.Util.formatBooleanActive,flex:2,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")]]},hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("connection_charge"),dataIndex:"connection_charge",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("price")+" "+t("per")+" "+t("monthly"),dataIndex:"fixrate",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("secondusedreal"),renderer:Helper.Util.formatsecondsToTime,dataIndex:"secondusedreal",flex:3},{header:t("Description"),dataIndex:"description",hidden:true,hideable:App.user.isAdmin,flex:5}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["didlist"],["component","box","container","panel","tablepanel","gridpanel","grid","didlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,didlist:true},["widget.didlist"],0,[MBilling.view.did,"List"],0));(Ext.cmd.derive("MBilling.view.did.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["did"],initComponent:function(){var b=this;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{labelAlign:"right",plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true,labelWidth:140}},items:[{title:t("general"),items:[{name:"did",fieldLabel:t("did"),readOnly:App.user.isClient||App.user.isAgent},{xtype:"booleancombo",name:"activated",fieldLabel:t("status"),hidden:App.user.isClient||App.user.isAgent,allowBlank:true},{xtype:"moneyfield",name:"connection_charge",fieldLabel:t("connection_charge"),value:"0",hidden:App.user.isClient||App.user.isAgent},{xtype:"moneyfield",name:"fixrate",fieldLabel:t("Monthly")+" "+t("price"),value:"0",hidden:App.user.isClient||App.user.isAgent},{style:"margin-top:5px",xtype:"fieldset",title:t("Did")+" "+t("increment"),collapsible:false,collapsed:false,hidden:!App.user.isAdmin,defaults:{labelWidth:160,anchor:"100%",labelAlign:b.labelAlignFields},items:[{xtype:"moneyfield",name:"connection_sell",fieldLabel:t("Connetion charge"),value:"0",hidden:!App.user.isAdmin},{xtype:"numberfield",name:"minimal_time_charge",fieldLabel:t("Minimal time to charge"),value:"0",hidden:!App.user.isAdmin},{xtype:"numberfield",name:"initblock",fieldLabel:t("initblock"),value:"0",hidden:!App.user.isAdmin},{xtype:"numberfield",name:"increment",fieldLabel:t("billingblock"),value:"0",hidden:!App.user.isAdmin}]},{xtype:"combobox",name:"charge_of",fieldLabel:t("Charge")+" "+t("of"),value:1,forceSelection:true,editable:false,store:[[1,t("Owner DID")],[0,t("Caller ID, only allow call from registered callerID")]],hidden:App.user.isClient||App.user.isAgent},{xtype:"numberfield",name:"calllimit",fieldLabel:t("Channel Limit"),value:"-1",minValue:"-1",hidden:!window.didChannelLimit||!App.user.isAdmin},{xtype:"textareafield",allowBlank:true,name:"description",fieldLabel:t("description"),hidden:!App.user.isAdmin}]},{title:t("Billing"),items:[{style:"margin-top:5px",xtype:"fieldset",title:t("Did Billing per minute")+" "+t("rate")+" 1",collapsible:false,collapsed:false,hidden:!App.user.isAdmin,defaults:{labelWidth:170,anchor:"100%",labelAlign:b.labelAlignFields},items:[{xtype:"textfield",name:"expression_1",fieldLabel:t("Regular expression"),value:"*",hidden:!App.user.isAdmin},{xtype:"moneyfield",name:"selling_rate_1",fieldLabel:t("Sell price per min"),value:"0",hidden:!App.user.isAdmin},{xtype:"noyescombo",name:"block_expression_1",fieldLabel:t("Block calls from this expression"),hidden:!App.user.isAdmin},{xtype:"noyescombo",name:"send_to_callback_1",fieldLabel:t("Send the call to Callback"),hidden:!App.user.isAdmin}]},{style:"margin-top:25px",xtype:"fieldset",title:t("Did Billing per minute")+" "+t("rate")+" 2",collapsible:false,collapsed:false,hidden:!App.user.isAdmin,defaults:{labelWidth:160,anchor:"100%",labelAlign:b.labelAlignFields},items:[{xtype:"textfield",name:"expression_2",fieldLabel:t("Regular expression"),value:"*",hidden:!App.user.isAdmin},{xtype:"moneyfield",name:"selling_rate_2",fieldLabel:t("Sell price per min"),value:"0",hidden:!App.user.isAdmin},{xtype:"noyescombo",name:"block_expression_2",fieldLabel:t("Block calls from this expression"),hidden:!App.user.isAdmin},{xtype:"noyescombo",name:"send_to_callback_2",fieldLabel:t("Send the call to Callback"),hidden:!App.user.isAdmin}]},{style:"margin-top:25px",xtype:"fieldset",title:t("Did Billing per minute")+" "+t("rate")+" 3",collapsible:false,collapsed:false,hidden:!App.user.isAdmin,defaults:{labelWidth:160,anchor:"100%",labelAlign:b.labelAlignFields},items:[{xtype:"textfield",name:"expression_3",fieldLabel:t("Regular expression"),value:"*",hidden:!App.user.isAdmin},{xtype:"moneyfield",name:"selling_rate_3",fieldLabel:t("Sell price per min"),value:"0",hidden:!App.user.isAdmin},{xtype:"noyescombo",name:"block_expression_3",fieldLabel:t("Block calls from this expression"),hidden:!App.user.isAdmin},{xtype:"noyescombo",name:"send_to_callback_3",fieldLabel:t("Send the call to Callback"),hidden:!App.user.isAdmin}]}]},{title:t("CallBack Pro"),hidden:!window.cbr,items:[{xtype:"booleancombo",name:"cbr",fieldLabel:t("CallBack Pro"),value:0,hidden:!window.cbr,allowBlank:true},{xtype:"noyescombo",name:"cbr_ua",fieldLabel:t("Use Audio"),value:0,hidden:true,allowBlank:true},{xtype:"numberfield",name:"cbr_total_try",fieldLabel:t("Maximum trying"),value:3,hidden:true,allowBlank:true,minValue:0},{xtype:"numberfield",name:"cbr_time_try",fieldLabel:t("Interval beteween trying"),value:30,hidden:true,allowBlank:true,minValue:10},{xtype:"noyescombo",name:"cbr_em",fieldLabel:t("Early Media"),hidden:true,allowBlank:true},{name:"TimeOfDay_monFri",fieldLabel:t("Mon-Fri"),value:"09:00-12:00|14:00-18:00",minLength:11,hidden:true},{name:"TimeOfDay_sat",fieldLabel:t("Sat"),value:"09:00-12:00",allowBlank:true,hidden:true},{name:"TimeOfDay_sun",fieldLabel:t("Sun"),value:"00:00",allowBlank:true,hidden:true},{xtype:"uploadfield",fieldLabel:t("workaudio"),emptyText:"Select an gsm File",allowBlank:true,name:"workaudio",extAllowed:["wav","gsm"],hidden:true},{xtype:"uploadfield",fieldLabel:t("noworkaudio"),emptyText:"Select an gsm File",allowBlank:true,name:"noworkaudio",extAllowed:["wav","gsm"],hidden:true}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["didform"],["component","box","container","panel","form","didform"],{component:true,box:true,container:true,panel:true,form:true,didform:true},["widget.didform"],0,[MBilling.view.did,"Form"],0));(Ext.cmd.derive("MBilling.view.did.ImportCsv",Ext.ux.window.ImportCsv,{htmlTipInfo:"
"+t("number")+", "+t("price")+" "+t("by")+" "+t("monthly")+", "+t("connection_charge")+"
551156332233, 10, 5
554153882200, 10, 5
554155667788, 10, 5
"+t("monthly")+" "+t("and")+" "+t("connection_charge")+" "+t("optional")+"",fieldsImport:[{fieldLabel:t("table"),hidden:true,allowBlank:true}]},0,["didimportcsv"],["component","box","container","panel","window","didimportcsv"],{component:true,box:true,container:true,panel:true,window:true,didimportcsv:true},["widget.didimportcsv"],0,[MBilling.view.did,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.didbuy.Module",Ext.form.Panel,{controller:"did",resizable:false,autoShow:true,header:false,initComponent:function(){var b=this;b.items=[{reference:"buydidPanel",xtype:"form",margin:"10 10 10 10",autoShow:true,closable:false,resizable:false,bodyPadding:10,defaultType:"textfield",defaults:{labelAlign:"right",labelWidth:175,width:280,allowBlank:false,msgTarget:"side",enableKeyEvents:true,plugins:"markallowblank",anchor:"100%"},items:[{xtype:"didbuycombo",fieldLabel:t("Select a Did"),name:"did"}],bbar:[{text:t("Next"),tooltip:t("Next"),glyph:icons.disk,handler:"onBuyDid"}]}];Ext.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["didbuymodule"],["component","box","container","panel","form","didbuymodule"],{component:true,box:true,container:true,panel:true,form:true,didbuymodule:true},["widget.didbuymodule"],0,[MBilling.view.didbuy,"Module"],0));(Ext.cmd.derive("MBilling.view.diddestination.Controller",Ext.ux.app.ViewController,{init:function(){var b=this;b.control({didtypefullcombo:{select:b.onSelectMethod},didtypefreecombo:{select:b.onSelectMethod}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectMethod:function(c,d){this.showFieldsRelated(d.getData().showFields)},showFieldsRelated:function(f){var d=this,e=d.formPanel.getForm().getFields();e.each(function(a){a.setVisible(f.indexOf(a.name)!==-1)})},onEdit:function(){var f=this,d=f.formPanel.getForm(),e=f.list.getSelectionModel().getSelection()[0];method=e?e.get("voip_call"):"sipcall";switch(method){case 0:method=t("callforpstn");break;case 1:method=t("sipcall");break;case 2:method=t("ivr");break;case 3:method="CallingCard";break;case 4:method=t("portalDeVoz");break;case 5:method=t("CID Callback");break;case 6:method=t("0800 Callback");break;case 7:method=t("Queue");break;case 8:method=t("Call Group");break;case 9:method=t("Custom");break}showFields=f.formPanel.down("didtypefullcombo").store.findRecord("name",method).getData().showFields;f.showFieldsRelated(showFields);d.findField("id_did").setReadOnly(true);Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)},onNew:function(){var f=this,d=f.formPanel.getForm(),e=f.list.getSelectionModel().getSelection()[0];d.findField("id_did").setReadOnly(false);method=t("sipcall");showFields=f.formPanel.down("didtypefullcombo").store.findRecord("name",method).getData().showFields;f.showFieldsRelated(showFields);Ext.ux.app.ViewController.prototype.onNew.apply(this,arguments)}},0,0,0,0,["controller.diddestination"],0,[MBilling.view.diddestination,"Controller"],0));(Ext.cmd.derive("MBilling.view.diddestination.Module",Ext.ux.panel.Module,{controller:"diddestination"},0,["diddestinationmodule"],["component","box","container","uxpanelmodule","diddestinationmodule"],{component:true,box:true,container:true,uxpanelmodule:true,diddestinationmodule:true},["widget.diddestinationmodule"],0,[MBilling.view.diddestination,"Module"],0));(Ext.cmd.derive("MBilling.view.diddestination.List",Ext.ux.grid.Panel,{store:"Diddestination",fieldSearch:"idDid.did",initComponent:function(){var b=this;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("did"),dataIndex:"idDiddid",filter:{type:"string",field:"idDid.did"},flex:5},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("type")+" "+t("of")+" "+t("call"),dataIndex:"voip_call",renderer:Helper.Util.formatDidType,comboRelated:"didtypecombo",flex:3,filter:{type:"list",options:[[0,t("callforpstn")],[1,t("sipcall")],[2,t("ivr")],[3,t("callingcard")],[4,t("portalDeVoz")],[5,t("CID Callback")],[6,t("0800 Callback")],[7,t("Queue")],[8,t("Call Group")],[9,t("Custom")]]}},{header:t("secondusedreal"),renderer:Helper.Util.formatsecondsToTime,dataIndex:"secondusedreal",flex:3},{header:t("creationdate"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"creationdate",flex:5}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["diddestinationlist"],["component","box","container","panel","tablepanel","gridpanel","grid","diddestinationlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,diddestinationlist:true},["widget.diddestinationlist"],0,[MBilling.view.diddestination,"List"],0));(Ext.cmd.derive("MBilling.view.diddestination.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["id_user","id_did"],initComponent:function(){var b=this;b.items=[{name:"id_did",fieldLabel:t("DID"),xtype:"didcombo"},{xtype:"userlookup",ownerForm:b,hidden:true,allowBlank:App.user.isClient},{xtype:"booleancombo",name:"activated",fieldLabel:t("status"),allowBlank:false},{xtype:"numbercombo",name:"priority",fieldLabel:t("priority"),allowBlank:true},{style:"margin-top:25px",xtype:"fieldset",title:t("Did Destination"),collapsible:true,collapsed:false,defaults:{labelWidth:75,anchor:"100%",labelAlign:b.labelAlignFields},items:[{xtype:"didtypefullcombo",name:"voip_call",fieldLabel:t("type")+" "+t("of")+" "+t("call")},{xtype:"textfield",name:"destination",fieldLabel:t("Destination"),value:"",allowBlank:true,hidden:App.user.isClient||App.user.isAgent},{xtype:"ivrlookup",ownerForm:b,name:"id_ivr",fieldLabel:t("IVR"),allowBlank:true},{xtype:"queuelookup",ownerForm:b,name:"id_queue",fieldLabel:t("Queue"),allowBlank:true},{xtype:"siplookup",ownerForm:b,name:"id_sip",fieldLabel:t("SIP"),allowBlank:true}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["diddestinationform"],["component","box","container","panel","form","diddestinationform"],{component:true,box:true,container:true,panel:true,form:true,diddestinationform:true},["widget.diddestinationform"],0,[MBilling.view.diddestination,"Form"],0));(Ext.cmd.derive("MBilling.view.diddestination.Combo",Ext.form.field.ComboBox,{fieldLabel:t("typepaid"),displayField:"name",valueField:"id",forceSelection:true,editable:false,value:1,store:{fields:["id","name"],data:[{id:"0",name:t("callforpstn"),showFields:["voip_call","destination","id_did","id_user","activated"]},{id:"1",name:t("sipcall"),showFields:["voip_call","id_sip","id_did","id_user","activated","priority"]},{id:"2",name:t("ivr"),showFields:["voip_call","id_did","id_ivr","id_user","activated"]},{id:"3",name:"CallingCard",showFields:["voip_call","id_did","id_user","activated"]},{id:"4",name:t("portalDeVoz"),showFields:["voip_call","id_did","id_user","activated"]},{id:"5",name:t("CID Callback"),showFields:["voip_call","id_did","id_user","activated"]},{id:"6",name:t("0800 Callback"),showFields:["voip_call","id_did","id_user","activated"]},{id:"7",name:t("Queue"),showFields:["voip_call","id_did","id_queue","id_user","activated"]},{id:"8",name:t("Call Group"),showFields:["voip_call","destination","id_did","id_user","activated"]},{id:"9",name:t("Custom"),showFields:["voip_call","destination","id_did","id_user","activated"]}]}},0,["didtypefullcombo"],["component","box","field","textfield","pickerfield","combobox","combo","didtypefullcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,didtypefullcombo:true},["widget.didtypefullcombo"],0,[MBilling.view.diddestination,"Combo"],0));(Ext.cmd.derive("MBilling.view.diddestination.freeCombo",Ext.form.field.ComboBox,{fieldLabel:t("typepaid"),displayField:"name",forceSelection:true,editable:false,valueField:"id",value:1,store:{fields:["id","name"],data:[{id:"0",name:t("callforpstn"),showFields:["voip_call","id_did","destination","id_user","activated"]},{id:"1",name:t("sipcall"),showFields:["voip_call","id_did","id_sip","id_user","activated","priority"]},{id:"2",name:t("ivr"),showFields:["voip_call","id_did","id_ivr","id_user"]},{id:"3",name:"CallingCard",showFields:["voip_call","id_did","id_user"]},{id:"4",name:t("portalDeVoz"),showFields:["voip_call","id_did","id_user"]}]}},0,["didtypefreecombo"],["component","box","field","textfield","pickerfield","combobox","combo","didtypefreecombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,didtypefreecombo:true},["widget.didtypefreecombo"],0,[MBilling.view.diddestination,"freeCombo"],0));(Ext.cmd.derive("MBilling.view.didUse.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.diduse"],0,[MBilling.view.didUse,"Controller"],0));(Ext.cmd.derive("MBilling.view.didUse.Module",Ext.ux.panel.Module,{controller:"diduse"},0,["didusemodule"],["component","box","container","uxpanelmodule","didusemodule"],{component:true,box:true,container:true,uxpanelmodule:true,didusemodule:true},["widget.didusemodule"],0,[MBilling.view.didUse,"Module"],0));(Ext.cmd.derive("MBilling.view.didUse.List",Ext.ux.grid.Panel,{store:"DidUse",initComponent:function(){var b=this;b.buttonCsv=false;b.allowPrint=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("did"),dataIndex:"idDiddid",flex:5},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("monthpayed"),dataIndex:"month_payed",flex:2},{header:t("reservationdate"),renderer:Helper.Util.formatDateTime,dataIndex:"reservationdate",flex:5},{header:t("releasedate"),renderer:Helper.Util.formatDateTime,dataIndex:"releasedate",flex:5}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["diduselist"],["component","box","container","panel","tablepanel","gridpanel","grid","diduselist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,diduselist:true},["widget.diduselist"],0,[MBilling.view.didUse,"List"],0));(Ext.cmd.derive("MBilling.view.didUse.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,readOnly:true},{xtype:"didcombo",readOnly:true},{xtype:"datefield",name:"reservationdate",fieldLabel:t("reservationdate"),format:"Y-m-d H:i:s"}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["diduseform"],["component","box","container","panel","form","diduseform"],{component:true,box:true,container:true,panel:true,form:true,diduseform:true},["widget.diduseform"],0,[MBilling.view.didUse,"Form"],0));(Ext.cmd.derive("MBilling.view.dashboard.Module",Ext.panel.Panel,{autoShow:true,header:false,initComponent:function(){var b=this;width=window.isTablet?Ext.Element.getViewportWidth()-240:Ext.Element.getViewportWidth()-220;showDid=showBuy=false;if(!App.user.isAdmin){Ext.each(App.user.menu,function(a){if(!Ext.isEmpty(a.rows)){Ext.each(a.rows,function(d){if(d.module=="didbuy"){showDid=true}if(d.module=="buycredit"){showBuy=true}},b)}},b)}widthView=Ext.Element.getViewportWidth()-430;heightView=Ext.Element.getViewportHeight()-137;heightViewFace=heightView+23;facebookhtml='
';if(!App.user.isAdmin&&App.user.social_media_network.length>10){facebookhtml='
'}if(window.customDashboard&&!App.user.isAdmin){b.items=[{header:false,bodyPadding:0,style:"background-color:transparent;",bodyStyle:"background-color:transparent !important;",html:'
',collapseDirection:"bottom",collapsible:true,autoScroll:true,height:Ext.Element.getViewportHeight()}]}else{b.items=[{width:!window.isDesktop?width:"NULL",header:false,xtype:"dashboard",listeners:{activate:"setRunnerInfoSystem"},glyph:icons.home,title:t("Home"),stateful:false,items:[{columnWidth:App.user.isAdmin?1/2:1,items:[{title:t("callonline"),items:{xtype:"callonlinelist2"},hidden:window.isTablet||!App.user.isAdmin,height:App.user.isClient?250:300},{title:t("Simultaneous Call"),items:{xtype:"callonlinechartchart"},hidden:window.isTablet||!App.user.isAdmin,iconCls:"icon-chart-column",glyph:undefined}]},{hidden:App.user.isAdmin,columnWidth:App.user.isClient?1/2:1,items:[{title:t("BuyCredit"),items:{xtype:"buycreditmodule"},height:window.isTablet?250:170,hidden:!showBuy}]},{hidden:App.user.isAdmin,columnWidth:1/2,items:[{title:t("Buy")+" "+t("did"),items:{xtype:"didbuymodule"},height:window.isTablet?250:170,hidden:!showDid||!App.user.isClient},{iconCls:"icon-info",title:t("NEWS"),bodyPadding:0,style:"background-color:transparent;",bodyStyle:"background-color:transparent !important;",hidden:App.user.isAdmin||App.user.social_media_network.length<=10,html:facebookhtml,collapseDirection:"bottom",collapsible:true,autoScroll:true,height:300}]},{columnWidth:1/2,items:[{iconCls:"icon-info",title:t("NEWS"),bodyPadding:0,style:"background-color:transparent;",bodyStyle:"background-color:transparent !important;",hidden:!App.user.isAdmin||window.isTablet||window.isTablets||App.user.l.slice(4,7)=="syn",html:facebookhtml,collapseDirection:"bottom",collapsible:true,autoScroll:true,height:300},{title:t("Refill Summary"),iconCls:"icon-chart-column",glyph:undefined,items:{xtype:"refillchart"},hidden:!App.user.isAdmin||window.isTablet}]}]}]}Ext.panel.Panel.prototype.initComponent.apply(this,arguments)}},0,["dashboardmodule"],["component","box","container","panel","dashboardmodule"],{component:true,box:true,container:true,panel:true,dashboardmodule:true},["widget.dashboardmodule"],0,[MBilling.view.dashboard,"Module"],0));(Ext.cmd.derive("MBilling.view.dashboardQueue.Module",Ext.panel.Panel,{autoShow:true,header:false,initComponent:function(){var b=this;b.items=[{width:!window.isDesktop?width:"NULL",header:false,xtype:"dashboard",listeners:{activate:"setRunnerInfoSystem"},glyph:icons.home,title:t("Home"),stateful:false,items:[{columnWidth:1/2,items:[{title:t("Queue Monitor"),items:{xtype:"queuedashboardlist"},height:window.heightView}]},{columnWidth:1/2,items:[{title:t("Agent Monitor"),iconCls:"icon-chart-column",glyph:undefined,items:{xtype:"queuememberdashboardlist"},height:window.heightView}]}]}];Ext.panel.Panel.prototype.initComponent.apply(this,arguments)}},0,["dashboardqueuemodule"],["component","box","container","panel","dashboardqueuemodule"],{component:true,box:true,container:true,panel:true,dashboardqueuemodule:true},["widget.dashboardqueuemodule"],0,[MBilling.view.dashboardQueue,"Module"],0));(Ext.cmd.derive("MBilling.view.ivr.Controller",Ext.ux.app.ViewController,{isSubmitForm:true,init:function(){var b=this;b.control({typedestinationcombo:{select:b.onSelectMethod}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectMethod:function(c,d){this.showFieldsRelated(d.getData().showFields)},showFieldsRelated:function(l){var m=this,n=m.formPanel.getForm(),j=m.formPanel.getForm().getFields(),g=Ext.get(Ext.Element.getActiveElement()).component,o=g.name.substr(-2);m.onSetVisibleFiel(g,n,o,g.value)},onSetVisibleFiel:function(f,j,e,g){if(f.value=="undefined"){f.setValue("undefined")}if(f.name.match("^type_10")){j.findField("id_queue_10").setVisible(g.match("^queue"));j.findField("id_sip_10").setVisible(g.match("^sip"));j.findField("id_ivr_10").setVisible(g.match("^ivr"));j.findField("extension_10").setVisible(g.match("^group|^number|^custom"))}else{if(f.name.match("^type_[0-9]")){j.findField("id_queue"+e).setVisible(g.match("^queue"));j.findField("id_sip"+e).setVisible(g.match("^sip"));j.findField("id_ivr"+e).setVisible(g.match("^ivr"));j.findField("extension"+e).setVisible(g.match("^group|^number|^custom"))}else{if(f.name.match("^type_out_10")){j.findField("id_queue_out_10").setVisible(g.match("^queue"));j.findField("id_ivr_out_10").setVisible(g.match("^ivr"));j.findField("id_sip_out_10").setVisible(g.match("^sip"));j.findField("extension_out_10").setVisible(g.match("^group|^number|^custom"))}else{j.findField("id_queue_out"+e).setVisible(g.match("^queue"));j.findField("id_sip_out"+e).setVisible(g.match("^sip"));j.findField("id_ivr_out"+e).setVisible(g.match("^ivr"));j.findField("extension_out"+e).setVisible(g.match("^group|^number|^custom"))}}}},onEdit:function(){var g=this,j=g.formPanel.getForm(),f=g.list.getSelectionModel().getSelection()[0];for(var e=0;e<=10;e++){fieldValue=f.getData()["type_"+e];fieldValueOut=f.getData()["type_out_"+e];if(fieldValue=="ivr"){j.findField("id_ivr_"+e).setVisible(true);j.findField("id_sip_"+e).setVisible(false);j.findField("id_queue_"+e).setVisible(false);j.findField("extension_"+e).setVisible(false)}else{if(fieldValue=="sip"){j.findField("id_sip_"+e).setVisible(true);j.findField("id_ivr_"+e).setVisible(false);j.findField("id_queue_"+e).setVisible(false);j.findField("extension_"+e).setVisible(false)}else{if(fieldValue=="queue"){j.findField("id_queue_"+e).setVisible(true);j.findField("id_sip_"+e).setVisible(false);j.findField("id_ivr_"+e).setVisible(false);j.findField("extension_"+e).setVisible(false)}else{if(fieldValue.match("custom|number|group")){j.findField("extension_"+e).setVisible(true);j.findField("id_ivr_"+e).setVisible(false);j.findField("id_sip_"+e).setVisible(false);j.findField("id_queue_"+e).setVisible(false)}else{j.findField("id_queue_"+e).setVisible(false);j.findField("id_sip_"+e).setVisible(false);j.findField("id_ivr_"+e).setVisible(false);j.findField("extension_"+e).setVisible(false)}}}}if(fieldValueOut=="ivr"){j.findField("id_ivr_out_"+e).setVisible(true);j.findField("id_sip_out_"+e).setVisible(false);j.findField("id_queue_out_"+e).setVisible(false);j.findField("extension_out_"+e).setVisible(false)}else{if(fieldValueOut=="sip"){j.findField("id_sip_out_"+e).setVisible(true);j.findField("id_ivr_out_"+e).setVisible(false);j.findField("id_queue_out_"+e).setVisible(false);j.findField("extension_out_"+e).setVisible(false)}else{if(fieldValueOut=="queue"){j.findField("id_queue_out_"+e).setVisible(true);j.findField("id_sip_out_"+e).setVisible(false);j.findField("id_ivr_out_"+e).setVisible(false);j.findField("extension_out_"+e).setVisible(false)}else{if(fieldValueOut.match("custom|number|group")){j.findField("extension_out_"+e).setVisible(true);j.findField("id_ivr_out_"+e).setVisible(false);j.findField("id_sip_out_"+e).setVisible(false);j.findField("id_queue_out_"+e).setVisible(false)}else{j.findField("id_queue_out_"+e).setVisible(false);j.findField("id_sip_out_"+e).setVisible(false);j.findField("id_ivr_out_"+e).setVisible(false);j.findField("extension_out_"+e).setVisible(false)}}}}}Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)},onNew:function(){var g=this,j=g.formPanel.getForm(),f=g.list.getSelectionModel().getSelection()[0];for(var e=0;e<=10;e++){j.findField("id_ivr_"+e).setVisible(false);j.findField("id_sip_"+e).setVisible(false);j.findField("id_queue_"+e).setVisible(false);j.findField("id_ivr_out_"+e).setVisible(false);j.findField("id_sip_out_"+e).setVisible(false);j.findField("id_queue_out_"+e).setVisible(false)}Ext.ux.app.ViewController.prototype.onNew.apply(this,arguments)}},0,0,0,0,["controller.ivr"],0,[MBilling.view.ivr,"Controller"],0));(Ext.cmd.derive("MBilling.view.ivr.Module",Ext.ux.panel.Module,{controller:"ivr"},0,["ivrmodule"],["component","box","container","uxpanelmodule","ivrmodule"],{component:true,box:true,container:true,uxpanelmodule:true,ivrmodule:true},["widget.ivrmodule"],0,[MBilling.view.ivr,"Module"],0));(Ext.cmd.derive("MBilling.view.ivr.List",Ext.ux.grid.Panel,{store:"Ivr",initComponent:function(){var b=this;b.allowPrint=false;b.buttonCsv=false;b.columns=b.columns||[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("name"),dataIndex:"name",flex:5},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["ivrlist"],["component","box","container","panel","tablepanel","gridpanel","grid","ivrlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,ivrlist:true},["widget.ivrlist"],0,[MBilling.view.ivr,"List"],0));(Ext.cmd.derive("MBilling.view.ivr.Form",Ext.ux.form.Panel,{bodyPadding:0,fileUpload:true,initComponent:function(){var b=this;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{plugins:"markallowblank",allowBlank:false,anchor:"100%",labelAlign:"right"}},items:[{title:t("general"),items:[{name:"name",fieldLabel:t("name")},{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"monFriStart",fieldLabel:t("monFriStart"),value:"09:00",maxLength:5,minLength:5},{name:"monFriStop",fieldLabel:t("monFriStop"),value:"18:00",maxLength:5,minLength:5},{name:"satStart",fieldLabel:t("satStart"),value:"09:00",maxLength:5,minLength:5},{name:"satStop",fieldLabel:t("satStop"),value:"12:00",maxLength:5,minLength:5},{name:"sunStart",fieldLabel:t("sunStart"),value:"09:00",maxLength:5,minLength:5},{name:"sunStop",fieldLabel:t("sunStop"),value:"12:00",maxLength:5,minLength:5},{xtype:"uploadfield",fieldLabel:t("workaudio"),emptyText:"Select an wav or gsm File",allowBlank:true,name:"workaudio",labelWidth:120,extAllowed:["wav","gsm"]},{xtype:"uploadfield",fieldLabel:t("noworkaudio"),emptyText:"Select an wav or gsm File",allowBlank:true,labelWidth:120,name:"noworkaudio",extAllowed:["wav","gsm"]}]},{title:t("options")+" "+t("work"),itemId:"option",defaults:{xtype:"fieldcontainer",layout:"hbox",plugins:"markallowblank",allowBlank:true,anchor:"100%",labelWidth:100,defaults:{hideLabel:true,hidden:true,flex:5,startX:100,allowBlank:true,ownerForm:b}},items:[{xtype:"menuseparator",width:"100%"},{labelStyle:"font-weight:bold",xtype:"displayfield",value:''+t("Select the destination to send call when caller press any digits.")+"",allowBlank:true},{xtype:"menuseparator",width:"100%"},{fieldLabel:t("option")+" 0",items:[{name:"type_0",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_0",displayField:"id_ivr_0_name"},{xtype:"queuelookup",name:"id_queue_0",displayField:"id_queue_0_name"},{xtype:"siplookup",name:"id_sip_0",displayField:"id_sip_0_name"},{xtype:"textfield",name:"extension_0"}]},{fieldLabel:t("option")+" 1",items:[{name:"type_1",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_1",displayField:"id_ivr_1_name"},{xtype:"queuelookup",name:"id_queue_1",displayField:"id_queue_1_name"},{xtype:"siplookup",name:"id_sip_1",displayField:"id_sip_1_name"},{xtype:"textfield",name:"extension_1"}]},{fieldLabel:t("option")+" 2",items:[{name:"type_2",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_2",displayField:"id_ivr_2_name"},{xtype:"queuelookup",name:"id_queue_2",displayField:"id_queue_2_name"},{xtype:"siplookup",name:"id_sip_2",displayField:"id_sip_2_name"},{xtype:"textfield",name:"extension_2"}]},{fieldLabel:t("option")+" 3",items:[{name:"type_3",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_3",displayField:"id_ivr_3_name"},{xtype:"queuelookup",name:"id_queue_3",displayField:"id_queue_3_name"},{xtype:"siplookup",name:"id_sip_3",displayField:"id_sip_3_name"},{xtype:"textfield",name:"extension_3"}]},{fieldLabel:t("option")+" 4",items:[{name:"type_4",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_4",displayField:"id_ivr_4_name"},{xtype:"queuelookup",name:"id_queue_4",displayField:"id_queue_4_name"},{xtype:"siplookup",name:"id_sip_4",displayField:"id_sip_4_name"},{xtype:"textfield",name:"extension_4"}]},{fieldLabel:t("option")+" 5",items:[{name:"type_5",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_5",displayField:"id_ivr_5_name"},{xtype:"queuelookup",name:"id_queue_5",displayField:"id_queue_5_name"},{xtype:"siplookup",name:"id_sip_5",displayField:"id_sip_5_name"},{xtype:"textfield",name:"extension_5"}]},{fieldLabel:t("option")+" 6",items:[{name:"type_6",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_6",displayField:"id_ivr_6_name"},{xtype:"queuelookup",name:"id_queue_6",displayField:"id_queue_6_name"},{xtype:"siplookup",name:"id_sip_6",displayField:"id_sip_6_name"},{xtype:"textfield",name:"extension_6"}]},{fieldLabel:t("option")+" 7",items:[{name:"type_7",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_7",displayField:"id_ivr_7_name"},{xtype:"queuelookup",name:"id_queue_7",displayField:"id_queue_7_name"},{xtype:"siplookup",name:"id_sip_7",displayField:"id_sip_7_name"},{xtype:"textfield",name:"extension_7"}]},{fieldLabel:t("option")+" 8",items:[{name:"type_8",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_8",displayField:"id_ivr_8_name"},{xtype:"queuelookup",name:"id_queue_8",displayField:"id_queue_8_name"},{xtype:"siplookup",name:"id_sip_8",displayField:"id_sip_8_name"},{xtype:"textfield",name:"extension_8"}]},{fieldLabel:t("option")+" 9",items:[{name:"type_9",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_9",displayField:"id_ivr_9_name"},{xtype:"queuelookup",name:"id_queue_9",displayField:"id_queue_9_name"},{xtype:"siplookup",name:"id_sip_9",displayField:"id_sip_9_name"},{xtype:"textfield",name:"extension_9"}]},{fieldLabel:t("option")+" default",items:[{name:"type_10",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_10",displayField:"id_ivr_10_name"},{xtype:"queuelookup",name:"id_queue_10",displayField:"id_queue_10_name"},{xtype:"siplookup",name:"id_sip_10",displayField:"id_sip_10_name"},{xtype:"textfield",name:"extension_10"}]},{fieldLabel:t("Direct extension"),hidden:!window.didChannelLimit,name:"direct_extension",xtype:"noyescombo"}]},{title:t("options")+" "+t("not")+" "+t("work"),itemId:"optionOut",defaults:{xtype:"fieldcontainer",layout:"hbox",plugins:"markallowblank",allowBlank:true,anchor:"100%",labelWidth:100,defaults:{hideLabel:true,hidden:true,flex:5,startX:100,allowBlank:true,ownerForm:b}},items:[{xtype:"menuseparator",width:"100%"},{labelStyle:"font-weight:bold",xtype:"displayfield",value:''+t("Select the destination to send call when caller press any digits.")+"",allowBlank:true},{xtype:"menuseparator",width:"100%"},{fieldLabel:t("option")+" 0",items:[{name:"type_out_0",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_0",displayField:"id_ivr_out_0_name"},{xtype:"queuelookup",name:"id_queue_out_0",displayField:"id_queue_out_0_name"},{xtype:"siplookup",name:"id_sip_out_0",displayField:"id_sip_out_0_name"},{xtype:"textfield",name:"extension_out_0"}]},{fieldLabel:t("option")+" 1",items:[{name:"type_out_1",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_1",displayField:"id_ivr_out_1_name"},{xtype:"queuelookup",name:"id_queue_out_1",displayField:"id_queue_out_1_name"},{xtype:"siplookup",name:"id_sip_out_1",displayField:"id_sip_out_1_name"},{xtype:"textfield",name:"extension_out_1"}]},{fieldLabel:t("option")+" 2",items:[{name:"type_out_2",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_2",displayField:"id_ivr_out_2_name"},{xtype:"queuelookup",name:"id_queue_out_2",displayField:"id_queue_out_2_name"},{xtype:"siplookup",name:"id_sip_out_2",displayField:"id_sip_out_2_name"},{xtype:"textfield",name:"extension_out_2"}]},{fieldLabel:t("option")+" 3",items:[{name:"type_out_3",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_3",displayField:"id_ivr_out_3_name"},{xtype:"queuelookup",name:"id_queue_out_3",displayField:"id_queue_out_3_name"},{xtype:"siplookup",name:"id_sip_out_3",displayField:"id_sip_out_3_name"},{xtype:"textfield",name:"extension_out_3"}]},{fieldLabel:t("option")+" 4",items:[{name:"type_out_4",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_4",displayField:"id_ivr_out_4_name"},{xtype:"queuelookup",name:"id_queue_out_4",displayField:"id_queue_out_4_name"},{xtype:"siplookup",name:"id_sip_out_4",displayField:"id_sip_out_4_name"},{xtype:"textfield",name:"extension_out_4"}]},{fieldLabel:t("option")+" 5",items:[{name:"type_out_5",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_5",displayField:"id_ivr_out_5_name"},{xtype:"queuelookup",name:"id_queue_out_5",displayField:"id_queue_out_5_name"},{xtype:"siplookup",name:"id_sip_out_5",displayField:"id_sip_out_5_name"},{xtype:"textfield",name:"extension_out_5"}]},{fieldLabel:t("option")+" 6",items:[{name:"type_out_6",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_6",displayField:"id_ivr_out_6_name"},{xtype:"queuelookup",name:"id_queue_out_6",displayField:"id_queue_out_6_name"},{xtype:"siplookup",name:"id_sip_out_6",displayField:"id_sip_out_6_name"},{xtype:"textfield",name:"extension_out_6"}]},{fieldLabel:t("option")+" 7",items:[{name:"type_out_7",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_7",displayField:"id_ivr_out_7_name"},{xtype:"queuelookup",name:"id_queue_out_7",displayField:"id_queue_out_7_name"},{xtype:"siplookup",name:"id_sip_out_7",displayField:"id_sip_out_7_name"},{xtype:"textfield",name:"extension_out_7"}]},{fieldLabel:t("option")+" 8",items:[{name:"type_out_8",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_8",displayField:"id_ivr_out_8_name"},{xtype:"queuelookup",name:"id_queue_out_8",displayField:"id_queue_out_8_name"},{xtype:"siplookup",name:"id_sip_out_8",displayField:"id_sip_out_8_name"},{xtype:"textfield",name:"extension_out_8"}]},{fieldLabel:t("option")+" 9",items:[{name:"type_out_9",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_9",displayField:"id_ivr_out_9_name"},{xtype:"queuelookup",name:"id_queue_out_9",displayField:"id_queue_out_9_name"},{xtype:"siplookup",name:"id_sip_out_9",displayField:"id_sip_out_9_name"},{xtype:"textfield",name:"extension_out_9"}]},{fieldLabel:t("option")+" default",items:[{name:"type_out_10",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_10",displayField:"id_ivr_out_10_name"},{xtype:"queuelookup",name:"id_queue_out_10",displayField:"id_queue_out_10_name"},{xtype:"siplookup",name:"id_sip_out_10",displayField:"id_sip_out_10_name"},{xtype:"textfield",name:"extension_out_10"}]}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["ivrform"],["component","box","container","panel","form","ivrform"],{component:true,box:true,container:true,panel:true,form:true,ivrform:true},["widget.ivrform"],0,[MBilling.view.ivr,"Form"],0));(Ext.cmd.derive("MBilling.view.ivr.Lookup",Ext.ux.form.field.Lookup,{name:"id_ivr",fieldLabel:t("Ivr"),displayField:"idIvrname",displayFieldList:"name",gridConfig:{xtype:"ivrlist",fieldSearch:"name",columns:[{header:t("name"),dataIndex:"name",flex:5},{header:t("user"),dataIndex:"idUsernumber",filter:{type:"string",field:"idUser.username"},flex:4}]}},0,["ivrlookup"],["component","box","container","fieldcontainer","ivrlookup"],{component:true,box:true,container:true,fieldcontainer:true,ivrlookup:true},["widget.ivrlookup"],0,[MBilling.view.ivr,"Lookup"],0));(Ext.cmd.derive("MBilling.view.queue.Controller",Ext.ux.app.ViewController,{isSubmitForm:true,init:function(){var b=this;b.control({"combobox[name=ring_or_moh]":{select:b.onSelectringOrMOH}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectringOrMOH:function(c,d){me=this,form=me.formPanel.getForm();form.findField("musiconhold").setVisible(d.data.field1=="moh")},onNew:function(){var b=this;b.formPanel.getForm().findField("musiconhold").setVisible(true);Ext.ux.app.ViewController.prototype.onNew.apply(this,arguments)},onEdit:function(){var b=this;Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments);ringOrMoh=b.formPanel.getForm().findField("ring_or_moh").getValue();b.formPanel.getForm().findField("musiconhold").setVisible(ringOrMoh=="moh")},onResetQueueStats:function(m){var j=this,f=j.list.getSelectionModel().getSelection()[0],l=Ext.encode(j.list.filters.getFilterData()),g=[];if(f){Ext.each(j.list.getSelectionModel().getSelection(),function(a){g.push(a.get(j.idProperty))});Ext.Ajax.request({url:"index.php/queue/resetQueueStats",params:{ids:Ext.encode(g),filter:l},scope:j,success:function(b){b=Ext.decode(b.responseText);if(b[j.nameSuccessRequest]){Ext.ux.Alert.alert(j.titleSuccess,b.msg,"success")}else{var a=Helper.Util.convertErrorsJsonToString(b[j.nameMsgRequest]);Ext.ux.Alert.alert(j.titleError,a,"notification")}}})}else{Ext.ux.Alert.alert(j.titleError,t("Please select one or more queue"),"notification")}},onDeleteMusic:function(e){var f=this,d=f.list.getSelectionModel().getSelection()[0];if(f.list.getSelectionModel().getSelection().length==1){Ext.Ajax.request({url:"index.php/queue/deleteMusicOnHold",params:{id_queue:d.get("id")},scope:f,success:function(a){a=Ext.decode(a.responseText);if(a[f.nameSuccessRequest]){Ext.ux.Alert.alert(f.titleSuccess,a[f.nameMsgRequest],"success")}else{Ext.ux.Alert.alert(f.titleError,a[f.nameMsgRequest],"error")}}})}else{Ext.ux.Alert.alert(f.titleError,"Please Select only a record","notification")}}},0,0,0,0,["controller.queue"],0,[MBilling.view.queue,"Controller"],0));(Ext.cmd.derive("MBilling.view.queue.Combo",Ext.form.field.ComboBox,{fieldLabel:t("status"),value:"ringall",forceSelection:true,editable:false,store:[["ringall",t("Ringall")+" - "+t("ring all available channels until one answers")],["rrmemory",t("Rrmemory")+" - "+t("round robin with memory, remember where we left off last ring pass")],["leastrecent",t("Leastrecent")+" - "+t("ring interface which was least recently called by this queue")],["fewestcalls",t("Fewestcalls")+" - "+t("ring the one with fewest completed calls from this queue")],["random",t("Random")+" -"+t("ring random interface")],["linear",t("Linear")+" - "+t("Rings interfaces in the order they are listed in the configuration file. Dynamic members will be rung in the order in which they were added")],["wrandom",t("Wrandom")+" -"+t("Rings a random interface, but uses the agent's penalty as a weight")]]},0,["queuestrategycombo"],["component","box","field","textfield","pickerfield","combobox","combo","queuestrategycombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,queuestrategycombo:true},["widget.queuestrategycombo"],0,[MBilling.view.queue,"Combo"],0));(Ext.cmd.derive("MBilling.view.queue.Module",Ext.ux.panel.Module,{controller:"queue"},0,["queuemodule"],["component","box","container","uxpanelmodule","queuemodule"],{component:true,box:true,container:true,uxpanelmodule:true,queuemodule:true},["widget.queuemodule"],0,[MBilling.view.queue,"Module"],0));(Ext.cmd.derive("MBilling.view.queue.List",Ext.ux.grid.Panel,{store:"Queue",initComponent:function(){var b=this;b.buttonCsv=false;b.allowPrint=false;b.buttonUpdateLot=false;b.extraButtons=[{text:t("Reset Queue Stats"),iconCls:"call",handler:"onResetQueueStats",disabled:false,hidden:!App.user.isAdmin},{text:t("Delete Musiconhold"),iconCls:"call",handler:"onDeleteMusic",disabled:false,hidden:!App.user.isAdmin}];b.columns=b.columns||[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("name"),dataIndex:"name",flex:4},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("Strategy"),dataIndex:"strategy",flex:4},{header:t("Talk Time"),dataIndex:"var_talktime",flex:3},{header:t("Total Calls"),dataIndex:"var_totalCalls",flex:3},{header:t("Answered"),dataIndex:"var_answeredCalls",flex:3}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["queuelist"],["component","box","container","panel","tablepanel","gridpanel","grid","queuelist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,queuelist:true},["widget.queuelist"],0,[MBilling.view.queue,"List"],0));(Ext.cmd.derive("MBilling.view.queue.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["id_user","name"],fileUpload:true,initComponent:function(){var b=this;b.labelWidthFields=160;b.items=[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"name",fieldLabel:t("name")},{xtype:"languagecombo",name:"language",value:App.user.language=="pt_BR"?"br":App.user.language,fieldLabel:t("language")},{xtype:"queuestrategycombo",name:"strategy",fieldLabel:t("Strategy")},{xtype:"yesnostringcombo",name:"ringinuse",fieldLabel:t("Ringinuse")},{xtype:"numberfield",name:"timeout",fieldLabel:t("Ring Agent per"),value:30},{xtype:"numberfield",name:"retry",fieldLabel:t("Retry other agent"),value:1},{xtype:"numberfield",name:"wrapuptime",fieldLabel:t("Time next calls"),value:1},{xtype:"numberfield",name:"weight",fieldLabel:t("Weigh"),value:0},{name:"periodic-announce",fieldLabel:t("Periodic announce"),value:"queue-periodic-announce"},{xtype:"numberfield",name:"periodic-announce-frequency",fieldLabel:t("Periodic frequency"),value:30},{xtype:"yesnostringcombo",name:"announce-position",fieldLabel:t("Announce position")},{xtype:"yesnostringcombo",name:"announce-holdtime",fieldLabel:t("Announce Holdtime")},{xtype:"numberfield",name:"announce-frequency",fieldLabel:t("Announce Frequency"),value:45},{xtype:"combobox",forceSelection:true,editable:false,value:"yes",store:[["no",t("No")],["yes",t("Yes")],["unavailable,invalid,unknown",t("unavailable,invalid,unknown")],["penalty,paused,invalid,unavailable",t("penalty,paused,invalid,unavailable")]],name:"joinempty",fieldLabel:t("Join empty")},{xtype:"combobox",forceSelection:true,editable:false,value:"no",store:[["no",t("No")],["yes",t("Yes")],["unavailable,invalid,unknown",t("unavailable,invalid,unknown")],["penalty,paused,invalid,unavailable",t("penalty,paused,invalid,unavailable")]],fieldLabel:t("Leave when empty"),name:"leavewhenempty"},{xtype:"combobox",forceSelection:true,editable:false,value:"moh",store:[["moh",t("MOH")],["ring",t("Ring")]],fieldLabel:t("Ring or playing MOH"),name:"ring_or_moh"},{xtype:"uploadfield",fieldLabel:t("Audio")+" "+t("musiconhold"),emptyText:t("Select an wav mono 8khz or gsm File"),allowBlank:true,name:"musiconhold",extAllowed:["wav","gsm"]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["queueform"],["component","box","container","panel","form","queueform"],{component:true,box:true,container:true,panel:true,form:true,queueform:true},["widget.queueform"],0,[MBilling.view.queue,"Form"],0));(Ext.cmd.derive("MBilling.view.queue.Lookup",Ext.ux.form.field.Lookup,{name:"id_queue",fieldLabel:t("Queue"),displayField:"idQueuename",displayFieldList:"name",gridConfig:{xtype:"queuelist",fieldSearch:"name",columns:[{header:t("name"),dataIndex:"name",flex:2}]}},0,["queuelookup"],["component","box","container","fieldcontainer","queuelookup"],{component:true,box:true,container:true,fieldcontainer:true,queuelookup:true},["widget.queuelookup"],0,[MBilling.view.queue,"Lookup"],0));(Ext.cmd.derive("MBilling.view.queue.ListDashboard",Ext.ux.grid.Panel,{store:"QueueDashBoard",refreshTime:5,selType:"rowmodel",initComponent:function(){var b=this;b.refreshTime=(localStorage&&localStorage.getItem("queuerefresh"))||b.refreshTime;b.extraButtons=[{text:t("Spy")+" "+t("call"),iconCls:"call",handler:function(a){module=b.getView();console.log(module.panel.items.items[0].getSelectionModel().getSelection());Ext.widget("callonlinespycall",{title:module.titleModule,list:module.panel.items.items[0]})},width:130,disabled:false,hidden:!window.multSpy},{xtype:"numberfield",field:"jmlhBrg",fieldLabel:t("Refresh Time"),editable:false,minValue:5,labelWidth:90,width:150,selectOnFocus:true,allowDecimals:true,decimalPrecision:2,value:b.refreshTime,listeners:{change:function(a){if(a.value>0){b.refreshTime=a.value;localStorage.setItem("queuerefresh",a.value)}}}}];b.columns=[{header:t("Channel"),hidden:true,dataIndex:"channel",flex:3},{header:t("Queue"),dataIndex:"queue_name",flex:3},{header:t("Agent"),dataIndex:"agentName",flex:3},{header:t("status"),dataIndex:"status",renderer:Helper.Util.formatQueueState,flex:4},{header:t("CallerID"),dataIndex:"callerId",flex:4},{header:t("Duration"),dataIndex:"duration",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Wait Time"),dataIndex:"holdtime",renderer:Helper.Util.formatsecondsToTime,flex:3}];b.sessionLoad=Ext.create("Ext.util.DelayedTask",function(){b.store.load()},b);Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments);b.store.on("load",b.onLoadStore,b)},onLoadStore:function(){var b=this;b.onDeactivateModule();b.onActivateModule()},onRender:function(){var b=this;if(Ext.isObject(b.module)){b.module.on("activate",b.onActivateModule,b);b.module.on("deactivate",b.onDeactivateModule,b);b.module.on("close",b.onCloseModule,b)}Ext.ux.grid.Panel.prototype.onRender.apply(this,arguments)},onActivateModule:function(){this.sessionLoad&&this.sessionLoad.delay(this.refreshTime*1000)},onDeactivateModule:function(){this.sessionLoad&&this.sessionLoad.cancel()},onCloseModule:function(){this.onDeactivateModule();this.sessionLoad=null}},0,["queuedashboardlist"],["component","box","container","panel","tablepanel","gridpanel","grid","queuedashboardlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,queuedashboardlist:true},["widget.queuedashboardlist"],0,[MBilling.view.queue,"ListDashboard"],0));(Ext.cmd.derive("MBilling.view.queueMember.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.queuemember"],0,[MBilling.view.queueMember,"Controller"],0));(Ext.cmd.derive("MBilling.view.queueMember.Module",Ext.ux.panel.Module,{controller:"queuemember"},0,["queuemembermodule"],["component","box","container","uxpanelmodule","queuemembermodule"],{component:true,box:true,container:true,uxpanelmodule:true,queuemembermodule:true},["widget.queuemembermodule"],0,[MBilling.view.queueMember,"Module"],0));(Ext.cmd.derive("MBilling.view.queueMember.List",Ext.ux.grid.Panel,{store:"QueueMember",initComponent:function(){var b=this;b.columns=[{header:t("Uniqueid"),dataIndex:"uniqueid",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("destination"),dataIndex:"interface",flex:4},{header:t("queues"),dataIndex:"queue_name",flex:4},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("paused"),dataIndex:"paused",renderer:Helper.Util.formattyyesno,filter:{type:"list",options:[[0,t("no")],[1,t("yes")]]},flex:2}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["queuememberlist"],["component","box","container","panel","tablepanel","gridpanel","grid","queuememberlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,queuememberlist:true},["widget.queuememberlist"],0,[MBilling.view.queueMember,"List"],0));(Ext.cmd.derive("MBilling.view.queueMember.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["id_user","queue_name"],initComponent:function(){var b=this;b.items=[{xtype:"queuelookup",ownerForm:b,displayField:"queue_name",name:"queue_name",hidden:App.user.isClient,allowBlank:App.user.isClient},{xtype:"siplookup",ownerForm:b,name:"interface",displayField:"interface"},{xtype:"noyescombo",name:"paused",fieldLabel:t("paused"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["queuememberform"],["component","box","container","panel","form","queuememberform"],{component:true,box:true,container:true,panel:true,form:true,queuememberform:true},["widget.queuememberform"],0,[MBilling.view.queueMember,"Form"],0));(Ext.cmd.derive("MBilling.view.queueMember.ListDashboard",Ext.ux.grid.Panel,{store:"QueueMemberDashBoard",refreshTime:5,selType:"rowmodel",initComponent:function(){var b=this;b.refreshTime=(localStorage&&localStorage.getItem("queueagentrefresh"))||b.refreshTime;b.extraButtons=[{xtype:"numberfield",field:"jmlhBrg",fieldLabel:t("Refresh Time"),editable:false,minValue:5,labelWidth:90,width:150,selectOnFocus:true,allowDecimals:true,decimalPrecision:2,value:b.refreshTime,listeners:{change:function(a){if(a.value>0){b.refreshTime=a.value;localStorage.setItem("queueagentrefresh",a.value)}}}}];b.columns=[{header:t("Agent"),dataIndex:"agentName",flex:3},{header:t("Queue"),dataIndex:"idQueuename",flex:5},{header:t("Status"),dataIndex:"agentStatus",renderer:Helper.Util.formatQueueAgentState,flex:4},{header:t("Number"),dataIndex:"number",flex:4},{header:t("Calls"),dataIndex:"totalCalls",flex:2},{header:t("Last call"),dataIndex:"last_call",renderer:Helper.Util.formatsecondsToTime,flex:3}];b.sessionLoad=Ext.create("Ext.util.DelayedTask",function(){b.store.load()},b);Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments);if(window.isDesktop){b.store.load()}b.store.on("load",b.onLoadStore,b)},onLoadStore:function(){var b=this;b.onDeactivateModule();b.onActivateModule()},onRender:function(){var b=this;if(Ext.isObject(b.module)){b.module.on("activate",b.onActivateModule,b);b.module.on("deactivate",b.onDeactivateModule,b);b.module.on("close",b.onCloseModule,b)}Ext.ux.grid.Panel.prototype.onRender.apply(this,arguments)},onActivateModule:function(){this.sessionLoad&&this.sessionLoad.delay(this.refreshTime*1000)},onDeactivateModule:function(){this.sessionLoad&&this.sessionLoad.cancel()},onCloseModule:function(){this.onDeactivateModule();this.sessionLoad=null}},0,["queuememberdashboardlist"],["component","box","container","panel","tablepanel","gridpanel","grid","queuememberdashboardlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,queuememberdashboardlist:true},["widget.queuememberdashboardlist"],0,[MBilling.view.queueMember,"ListDashboard"],0));(Ext.cmd.derive("MBilling.view.refill.Controller",Ext.ux.app.ViewController,{aliasChart:"refillchart",onPrint:function(e){var f=this;if(App.user.isClient){var f=this,d=f.list.getSelectionModel().getSelection()[0];if(f.list.getSelectionModel().getSelection().length==1){console.log(d.data.description.indexOf("Send Credit "));if(d.data.description.indexOf("Send Credit ")!==-1){url="index.php/transferToMobile/printRefill/?id="+d.get("id");window.open(url)}else{Ext.ux.app.ViewController.prototype.onPrint.apply(this,arguments)}}else{Ext.ux.app.ViewController.prototype.onPrint.apply(this,arguments)}}else{Ext.ux.app.ViewController.prototype.onPrint.apply(this,arguments)}},onInvoice:function(e){var f=this;var f=this,d=f.list.getSelectionModel().getSelection()[0];if(f.list.getSelectionModel().getSelection().length==1){url="index.php/invoices/printInvoice/?id="+d.get("id");window.open(url)}else{Ext.ux.Alert.alert(f.titleError,t("Not available to multi refill."),"error")}},onSelectionChange:function(f,e){var j=this,g=j.lookupReference("invoice");g&&g.setDisabled(!e.length);Ext.ux.app.ViewController.prototype.onSelectionChange.apply(this,arguments)},onRenderModule:function(){var c=this,d=c.lookupReference("chart");Ext.ux.app.ViewController.prototype.onRenderModule.apply(this,arguments);if(App.user.isAdmin){c.store.on({scope:c,beforeload:function(){d.el&&d.disable()},load:function(a){d.el&&d.enable();c.onSetTotal()}})}else{c.store.on({scope:c,load:function(a){c.onSetTotal()}})}},onChart:function(){var b=this;b.chart=Ext.widget("window",{title:t("charts"),iconCls:"icon-chart-column",layout:"fit",autoShow:true,modal:true,resizable:false,width:window.isThemeNeptune?740:710,items:{xtype:b.aliasChart}});b.chart.down("#tbTextSum").setText(""+t("total")+": "+App.user.currency+" "+b.sumData.sumCredit+"")},onSetTotal:function(c){var d=this;if(!d.store.getData().items[0]){return}d.sumData=d.store.getData().items[0].getData();if(!d.sumData){return}d.lookupReference("tbTextTotal")&&d.lookupReference("tbTextTotal").setText(""+t("Refill Total")+": "+App.user.currency+" "+d.sumData.sumCredit+"")}},0,0,0,0,["controller.refill"],0,[MBilling.view.refill,"Controller"],0));(Ext.cmd.derive("MBilling.view.refill.Module",Ext.ux.panel.Module,{controller:"refill"},0,["refillmodule"],["component","box","container","uxpanelmodule","refillmodule"],{component:true,box:true,container:true,uxpanelmodule:true,refillmodule:true},["widget.refillmodule"],0,[MBilling.view.refill,"Module"],0));(Ext.cmd.derive("MBilling.view.refill.List",Ext.ux.grid.Panel,{store:"Refill",fieldSearch:"idUser.username",initComponent:function(){var b=this;b.buttonsTbar=[{xtype:"tbtext",reference:"tbTextTotal"}];if(App.user.isAdmin&&b.buttonCleanFilter){b.extraButtons=[{text:t("charts"),iconCls:"icon-chart-column",handler:"onChart",reference:"chart",disabled:true},{text:t("Invoice"),glyph:b.glyphPrint,handler:"onInvoice",reference:"invoice",hidden:!window.invoice,disabled:true}]}if(App.user.isClient){b.extraButtons=[{text:t("Invoice"),glyph:b.glyphPrint,handler:"onInvoice",reference:"invoice",hidden:!window.invoice,disabled:true}]}b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:3,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("credit"),dataIndex:"credit",renderer:Helper.Util.formatMoneyDecimal2,flex:2},{header:t("description"),dataIndex:"description",flex:5},{header:t("payment"),dataIndex:"payment",renderer:Helper.Util.formattyyesno,filter:{type:"list",options:[[0,t("no")],[1,t("yes")]]},flex:2},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"date",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["refilllist"],["component","box","container","panel","tablepanel","gridpanel","grid","refilllist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,refilllist:true},["widget.refilllist"],0,[MBilling.view.refill,"List"],0));(Ext.cmd.derive("MBilling.view.refill.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["id_user"],initComponent:function(){var b=this;b.items=[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient},{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,00",name:"credit",fieldLabel:t("credit"),readOnly:App.user.isClient},{xtype:"textareafield",name:"description",fieldLabel:t("description"),readOnly:App.user.isClient},{xtype:"yesnocombo",name:"payment",fieldLabel:t("add")+" "+t("payment"),hidden:App.user.isClient},{name:"invoice_number",fieldLabel:t("Invoice")+" "+t("number"),hidden:!window.invoice,allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["refillform"],["component","box","container","panel","form","refillform"],{component:true,box:true,container:true,panel:true,form:true,refillform:true},["widget.refillform"],0,[MBilling.view.refill,"Form"],0));(Ext.cmd.derive("Ext.ux.panel.Chart",Ext.panel.Panel,{rootData:undefined,positionLegendPie:"bottom",showLegendPie:true,widthTip:200,degressXLabel:0,fontLabel:"15px Arial",textBtnColumn:t("columns"),textBtnLine:t("lines"),textBtnBar:t("bars"),textBtnPie:t("pie"),iconBtnColumn:"icon-chart-column",iconBtnLine:"icon-chart-line",iconBtnBar:"icon-chart-bar",iconBtnPie:"icon-chart-pie",heightChart:400,charts:["column","bar","line","pie"],defaultChart:"column",limitCharLabelTip:25,bbarChart:[],tbarChart:[],minimumAxesY:0,border:false,layout:"card",btnShowColumn:true,btnShowBar:true,btnShowLine:true,btnShowPie:true,btnShowLineHidden:false,btnShowColumnHidden:false,showDownload:true,legend:null,titleText:"",fieldLabel:"",constructor:function(){var b=this;if(Ext.isString(b.store)){b.store=Ext.data.StoreManager.lookup(b.store);b.store.load({scope:b,callback:function(){if(b.store.getData().items[0]){b.sumData=b.store.getData().items[0].getData()}}})}Ext.panel.Panel.prototype.constructor.apply(this,arguments)},initComponent:function(){var s=this,x=s.charts.length,r,o,v,q,w=[],y=[],u=[],p,z;if(s.charts.length===1){s.defaultChart=s.charts[0]}s.fieldValue=Ext.isArray(s.fieldValue)?s.fieldValue:[s.fieldValue];if(s.rootData){p=Ext.getStore(s.store);z=p.model.proxy.reader.rawData;s.store=Ext.create("Ext.data.Store",{fields:Ext.Array.merge(s.fieldValue,s.fieldDescription),data:z&&z[s.rootData],proxy:{type:"memory",reader:{type:"json"}}});s.fieldValue=s.fieldValue[0].name||s.fieldValue[0];s.fieldDescription=s.fieldDescription.name||s.fieldDescription}Ext.each(s.fieldValue,function(a){u.push({type:"line",yField:a,xField:s.fieldDescription,marker:{radius:4},highlight:true,tooltip:{trackMouse:true,width:s.widthTip,renderer:s.rendererPie(s.fieldDescription,s.rendererFieldValue,s.rendererFieldDescription,s.limitCharLabelTip)}})});s.chartColumn={xtype:"cartesian",itemId:"column",height:s.heightChart,width:s.width,store:s.store,insetPadding:{top:s.titleText.length>0?40:10},axes:[{type:"numeric",title:s.labelYLine,position:"left",grid:true,minimum:s.minimumAxesY,renderer:s.rendererFieldValue||s.rendererDefault},{type:"category",title:s.labelXLine,position:"bottom",grid:true,renderer:s.rendererFieldDescription||s.rendererDefault,label:{rotate:{degrees:s.degressXLabel}}}],series:[{type:"bar",axis:"left",yField:s.fieldValue,xField:s.fieldDescription,highlight:true,tooltip:{width:s.widthTip,renderer:s.rendererPie(s.fieldDescription,s.rendererFieldValue,s.rendererFieldDescription,s.limitCharLabelTip)},label:{hidden:s.fieldLabel.length<1,field:s.fieldLabel,display:"insideEnd"}}],sprites:{hidden:s.titleText.length<1,type:"text",text:s.titleText,fontSize:22,width:100,height:30,x:40,y:20}};s.chartBar={xtype:"cartesian",itemId:"bar",height:s.heightChart,width:s.width,store:s.store,flipXY:true,insetPadding:{top:s.titleText.length>0?40:10},axes:[{type:"numeric",title:s.labelYLine,position:"bottom",fields:s.fieldValue,grid:true,minimum:s.minimumAxesY,renderer:s.rendererFieldValue||s.rendererDefault},{type:"category",title:s.labelXLine,position:"left",fields:s.fieldDescription,grid:true,renderer:s.rendererFieldDescription||s.rendererDefault}],series:[{type:"bar",yField:s.fieldValue,xField:s.fieldDescription,highlight:true,tooltip:{width:s.widthTip,renderer:s.rendererPie(s.fieldDescription,s.rendererFieldValue,s.rendererFieldDescription,s.limitCharLabelTip)},label:{hidden:s.fieldLabel.length<1,field:s.fieldLabel,display:"insideEnd"}}],sprites:{hidden:s.titleText.length<1,type:"text",text:s.titleText,fontSize:22,width:100,height:30,x:40,y:20}};s.chartLine={xtype:"cartesian",itemId:"line",height:s.heightChart,width:s.width,store:s.store,legend:s.legend,axes:[{type:"numeric",title:s.labelYLine,position:"left",fields:s.fieldValue,grid:true,minimum:s.minimumAxesY,renderer:s.rendererFieldValue||s.rendererDefault},{type:"category",title:s.labelXLine,position:"bottom",grid:true,fields:s.fieldDescription,renderer:s.rendererFieldDescription||s.rendererDefault}],series:u};s.chartPie={xtype:"polar",itemId:"pie",height:s.heightChart,width:s.width,store:s.store,legend:{position:s.positionLegendPie,renderer:s.rendererFieldDescription},series:[{type:"pie",angleField:s.fieldValue[0],showInLegend:s.showLegendPie,tooltip:{trackMouse:true,width:s.widthTip,renderer:s.rendererPie(s.fieldDescription,s.rendererFieldValue,s.rendererFieldDescription,s.limitCharLabelTip)},highlight:{segment:{margin:20}},label:{field:s.fieldDescription,display:"rotate",contrast:true,font:s.fontLabel,renderer:s.rendererFieldDescription||s.rendererDefault}}]};if(s.btnShowColumn){r={chart:"column",text:s.textBtnColumn,iconCls:s.iconBtnColumn,hidden:s.btnShowColumnHidden}}if(s.btnShowBar){o={chart:"bar",text:s.textBtnBar,iconCls:s.iconBtnBar}}if(s.btnShowLine){v={chart:"line",text:s.textBtnLine,iconCls:s.iconBtnLine,hidden:s.btnShowLineHidden}}if(s.btnShowPie){q={chart:"pie",text:s.textBtnPie,iconCls:s.iconBtnPie}}if(Ext.Array.contains(s.charts,"column")){w.push(s.chartColumn);y.push(r)}if(Ext.Array.contains(s.charts,"bar")){w.push(s.chartBar);y.push(o)}if(Ext.Array.contains(s.charts,"line")){w.push(s.chartLine);y.push(v)}if(Ext.Array.contains(s.charts,"pie")){w.push(s.chartPie);y.push(q)}s.bbarChart.push("->",{xtype:"buttongroup",toggleGroup:"typeChart",defaults:{enableToggle:true,allowDepress:false,toggleGroup:"typeChart",listeners:{scope:s,toggle:s.activeChart}},items:y});s.items=w;if(s.showDownload){s.tbarChart.push("->",{text:t("Download"),glyph:icons.disk,scope:s,handler:s.onDownload})}s.tbar=s.tbarChart;s.bbar=s.bbarChart;Ext.panel.Panel.prototype.initComponent.apply(this,arguments);s.activeItem=s.down("#"+s.defaultChart);s.down("button[chart="+s.defaultChart+"]").pressed=true},onDownload:function(){var b=this;b.getLayout().getActiveItem().download()},activeChart:function(d){var c=this;d.pressed&&c.getLayout().setActiveItem(c.down("#"+d.chart))},rendererPie:function(g,f,e,j){return function(a,o,c){var d=this,n=o.get(g),b=o.get(c.field);n=e?e(n):n;b=f?f(b):b;n=Ext.String.ellipsis(n,j)+": ";title=n+b;a.setHtml(title)}},rendererDefault:function(c,d){return d},rendererLegend:function(b){return t(b)}},1,["chartpanel"],["component","box","container","panel","chartpanel"],{component:true,box:true,container:true,panel:true,chartpanel:true},["widget.chartpanel"],0,[Ext.ux.panel,"Chart"],0));(Ext.cmd.derive("MBilling.view.refill.Chart",Ext.ux.panel.Chart,{controller:"refill",store:"RefillChart",fieldValue:"sumCreditMonth",fieldDescription:"CreditMonth",labelYLine:t("credit"),labelXLine:t("Month"),reference:"refillchart",btnShowColumn:true,btnShowBar:false,btnShowLine:false,btnShowPie:false,btnShowColumnHidden:true,initComponent:function(){var d=this,c;d.rendererFieldValue=Ext.util.Format.numberRenderer("0"),d.tbarChart=[{text:t("Per")+" "+t("Month"),scope:d,handler:"onPerMonth",reference:"btnMonth",disabled:true},{text:t("Per")+" "+t("day"),scope:d,handler:"onPerDay",reference:"btnDay"}];d.bbarChart=[{xtype:"tbtext",itemId:"tbTextSum"}];Ext.ux.panel.Chart.prototype.initComponent.apply(this,arguments)},onPerMonth:function(d){var c=this;c.lookupReference("btnMonth").disable();c.lookupReference("btnDay").enable();c.store.setRemoteFilter(true);c.store.filter("type","month");c.store.load()},onPerDay:function(d){var c=this;c.lookupReference("btnDay").disable();c.lookupReference("btnMonth").enable();c.store.setRemoteFilter(true);c.store.filter("type","day");c.store.load()}},0,["refillchart"],["component","box","container","panel","chartpanel","refillchart"],{component:true,box:true,container:true,panel:true,chartpanel:true,refillchart:true},["widget.refillchart"],0,[MBilling.view.refill,"Chart"],0));(Ext.cmd.derive("MBilling.view.methodPay.Controller",Ext.ux.app.ViewController,{init:function(){var b=this;b.control({methodpaycombo:{select:b.onSelectMethod}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectMethod:function(c,d){showFields=d.getData().showFields.split(",");this.showFieldsRelated(showFields)},showFieldsRelated:function(f){var d=this,e=d.formPanel.getForm().getFields();e.each(function(a){a.setVisible(f.indexOf(a.name)!==-1)})},onEdit:function(){var c=this,d=c.list.getSelectionModel().getSelection()[0];method=d?d.get("payment_method"):"Moip";showFields=c.formPanel.down("methodpaycombo").store.findRecord("payment_method",method).getData().showFields;showFields=showFields.split(",");c.showFieldsRelated(showFields);Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)},onNew:function(){var c=this,d=c.list.getSelectionModel().getSelection()[0];method="Moip";showFields=c.formPanel.down("methodpaycombo").store.findRecord("payment_method",method).getData().showFields;showFields=showFields.split(",");c.showFieldsRelated(showFields);Ext.ux.app.ViewController.prototype.onNew.apply(this,arguments)}},0,0,0,0,["controller.methodpay"],0,[MBilling.view.methodPay,"Controller"],0));(Ext.cmd.derive("MBilling.view.methodPay.Module",Ext.ux.panel.Module,{controller:"methodpay"},0,["methodpaymodule"],["component","box","container","uxpanelmodule","methodpaymodule"],{component:true,box:true,container:true,uxpanelmodule:true,methodpaymodule:true},["widget.methodpaymodule"],0,[MBilling.view.methodPay,"Module"],0));(Ext.cmd.derive("MBilling.view.methodPay.List",Ext.ux.grid.Panel,{store:"MethodPay",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("paymentmethods"),dataIndex:"payment_method",flex:2},{header:t("country"),dataIndex:"country",flex:2},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:2},{header:t("active"),dataIndex:"active",flex:1,comboRelated:"booleancombo",renderer:Helper.Util.formatBooleanActive,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")]]}}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["methodpaylist"],["component","box","container","panel","tablepanel","gridpanel","grid","methodpaylist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,methodpaylist:true},["widget.methodpaylist"],0,[MBilling.view.methodPay,"List"],0));(Ext.cmd.derive("MBilling.view.methodPay.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{xtype:"methodpaycombo",name:"payment_method",valueField:"payment_method",fieldLabel:t("paymentmethods")},{name:"show_name",fieldLabel:t("showName")},{xtype:"userlookup",ownerForm:b,name:"id_user"},{xtype:"paymentcountrycombo",name:"country",fieldLabel:t("country")},{xtype:"booleancombo",name:"active",fieldLabel:t("active")},{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,00",name:"min",value:10,fieldLabel:t("Min amount")},{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,00",name:"max",value:500,fieldLabel:t("Max amount")},{name:"username",fieldLabel:t("Username"),allowBlank:true},{name:"url",fieldLabel:"Url",allowBlank:true},{xtype:"noyescombo",name:"fee",fieldLabel:t("Discount")+" "+t("Fee"),allowBlank:true},{xtype:"paymentbanckcombo",name:"boleto_banco",fieldLabel:t("Bank"),allowBlank:true},{name:"boleto_convenio",fieldLabel:t("numeroconvenio"),allowBlank:true},{name:"boleto_agencia",fieldLabel:t("agencia"),allowBlank:true},{name:"boleto_conta_corrente",fieldLabel:t("contacorrente"),allowBlank:true},{name:"boleto_inicio_nosso_numeroa",fieldLabel:t("Inicio nosso nº"),allowBlank:true},{name:"boleto_carteira",fieldLabel:t("carteira"),allowBlank:true},{name:"boleto_taxa",fieldLabel:t("taxa"),allowBlank:true},{name:"boleto_instrucoes",fieldLabel:t("instructions"),maxLength:"100",allowBlank:true},{name:"boleto_nome_emp",fieldLabel:t("company"),allowBlank:true},{name:"boleto_end_emp",fieldLabel:t("address"),allowBlank:true},{name:"boleto_cidade_emp",fieldLabel:t("city"),allowBlank:true},{name:"boleto_estado_emp",fieldLabel:t("state"),allowBlank:true},{name:"boleto_cpf_emp",fieldLabel:"CNPJ CPF",allowBlank:true},{name:"pagseguro_TOKEN",fieldLabel:"TOKEN",allowBlank:true},{name:"P2P_CustomerSiteID",fieldLabel:t("P2P CustomerSiteID"),allowBlank:true},{name:"P2P_KeyID",fieldLabel:t("P2P KeyID"),allowBlank:true},{name:"P2P_Passphrase",fieldLabel:t("P2P Passphrase"),allowBlank:true},{name:"P2P_RecipientKeyID",fieldLabel:t("P2P RecipientKeyID"),allowBlank:true},{name:"P2P_tax_amount",fieldLabel:t("P2P Tax Amount"),allowBlank:true},{name:"client_id",fieldLabel:t("Client id"),allowBlank:true},{name:"client_secret",fieldLabel:t("Client Secret"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["methodpayform"],["component","box","container","panel","form","methodpayform"],{component:true,box:true,container:true,panel:true,form:true,methodpayform:true},["widget.methodpayform"],0,[MBilling.view.methodPay,"Form"],0));(Ext.cmd.derive("MBilling.view.methodPay.Combo",Ext.form.field.ComboBox,{name:"id_methodpay",fieldLabel:t("methodPay"),displayField:"show_name",valueField:"id",forceSelection:true,editable:false,initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.MethodPay",{proxy:{type:"uxproxy",module:"methodpay",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["methodpaycombo"],["component","box","field","textfield","pickerfield","combobox","combo","methodpaycombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,methodpaycombo:true},["widget.methodpaycombo"],0,[MBilling.view.methodPay,"Combo"],0));(Ext.cmd.derive("MBilling.view.voucher.Controller",Ext.ux.app.ViewController,{onSave:function(){var b=this;Ext.ux.app.ViewController.prototype.onSave.apply(this,arguments);b.formPanel.setLoading(false);b.saveButton.enable();b.store.load()}},0,0,0,0,["controller.voucher"],0,[MBilling.view.voucher,"Controller"],0));(Ext.cmd.derive("MBilling.view.voucher.Module",Ext.ux.panel.Module,{controller:"voucher"},0,["vouchermodule"],["component","box","container","uxpanelmodule","vouchermodule"],{component:true,box:true,container:true,uxpanelmodule:true,vouchermodule:true},["widget.vouchermodule"],0,[MBilling.view.voucher,"Module"],0));(Ext.cmd.derive("MBilling.view.voucher.List",Ext.ux.grid.Panel,{store:"Voucher",initComponent:function(){var b=this;b.buttonCsv=false;b.allowPrint=false;b.buttonUpdateLot=false;b.allowUpdate=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:3,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("credit"),dataIndex:"credit",renderer:Helper.Util.formatMoneyDecimal,filter:{type:"int",field:"t.credit"},flex:3},{header:t("voucher"),dataIndex:"voucher",flex:5},{header:t("description"),dataIndex:"tag",flex:3,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("usedate"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"usedate",flex:4},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"creationdate",flex:4,hidden:App.user.isClient,hideable:!App.user.isClient}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["voucherlist"],["component","box","container","panel","tablepanel","gridpanel","grid","voucherlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,voucherlist:true},["widget.voucherlist"],0,[MBilling.view.voucher,"List"],0));(Ext.cmd.derive("MBilling.view.voucher.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;if(!App.user.isClient){b.fieldsHideEdit=["quantity"]}if(App.user.isClient){b.textNew=t("Insert Voucher");b.buttonNewWidth=150}b.items=[{xtype:"moneyfield",name:"credit",fieldLabel:t("credit"),hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"id_plan",fieldLabel:t("Plan"),xtype:"plancombo",hidden:!App.user.isAdmin,allowBlank:!App.user.isAdmin},{xtype:"languagecombo",name:"language",fieldLabel:t("language"),hidden:!App.user.isAdmin,allowBlank:!App.user.isAdmin},{name:"prefix_local",fieldLabel:t("prefixlocal"),value:App.user.base_country=="BRL"?"0/55,*/5511/8,*/5511/9":App.user.base_country=="ARG"?"0/54,*/5411/8,15/54911/10,16/54911/10":"",emptyText:"match / replace / length",hidden:!App.user.isAdmin,allowBlank:true},{xtype:"numberfield",name:"quantity",fieldLabel:t("Quantity"),hidden:!App.user.isAdmin,allowBlank:!App.user.isAdmin,value:10},{name:"tag",fieldLabel:t("description"),hidden:App.user.isClient,allowBlank:true},{xtype:"numberfield",name:"voucher",fieldLabel:t("voucher"),value:"",maxLength:6,minLength:6,hidden:!App.user.isClient,allowBlank:!App.user.isClient}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["voucherform"],["component","box","container","panel","form","voucherform"],{component:true,box:true,container:true,panel:true,form:true,voucherform:true},["widget.voucherform"],0,[MBilling.view.voucher,"Form"],0));(Ext.cmd.derive("MBilling.view.refillprovider.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.refillprovider"],0,[MBilling.view.refillprovider,"Controller"],0));(Ext.cmd.derive("MBilling.view.refillprovider.Module",Ext.ux.panel.Module,{controller:"refillprovider"},0,["refillprovidermodule"],["component","box","container","uxpanelmodule","refillprovidermodule"],{component:true,box:true,container:true,uxpanelmodule:true,refillprovidermodule:true},["widget.refillprovidermodule"],0,[MBilling.view.refillprovider,"Module"],0));(Ext.cmd.derive("MBilling.view.refillprovider.List",Ext.ux.grid.Panel,{store:"Refillprovider",initComponent:function(){var b=this;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{xtype:"templatecolumn",tpl:"{idProviderprovider_name}",header:t("provider"),dataIndex:"id_provider",comboFilter:"providercombo",flex:2},{header:t("credit"),dataIndex:"credit",renderer:Helper.Util.formatMoneyDecimal,flex:2},{header:t("description"),dataIndex:"description",flex:4},{header:t("payment"),dataIndex:"payment",renderer:Helper.Util.formattyyesno,filter:{type:"list",options:[[0,t("no")],[1,t("yes")]]},flex:2},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"date",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["refillproviderlist"],["component","box","container","panel","tablepanel","gridpanel","grid","refillproviderlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,refillproviderlist:true},["widget.refillproviderlist"],0,[MBilling.view.refillprovider,"List"],0));(Ext.cmd.derive("MBilling.view.refillprovider.Form",Ext.ux.form.Panel,{bodyPadding:0,fieldsHideUpdateLot:["id_provider"],initComponent:function(){var b=this;b.items=[{xtype:"providercombo"},{xtype:"moneyfield",name:"credit",fieldLabel:t("credit")},{xtype:"textareafield",name:"description",fieldLabel:t("description"),allowBlank:true},{xtype:"yesnocombo",name:"payment",fieldLabel:t("add")+" "+t("payment"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["refillproviderform"],["component","box","container","panel","form","refillproviderform"],{component:true,box:true,container:true,panel:true,form:true,refillproviderform:true},["widget.refillproviderform"],0,[MBilling.view.refillprovider,"Form"],0));(Ext.cmd.derive("MBilling.view.boleto.Controller",Ext.ux.app.ViewController,{onAfterSave:function(d){var c=this;if(c.formPanel.idRecord==0){url="index.php/boleto/secondVia/?id=last";window.open(url)}Ext.ux.app.ViewController.prototype.onAfterSave.apply(this,arguments)},onSecondVia:function(e){var f=this,d=f.list.getSelectionModel().getSelection()[0];if(f.list.getSelectionModel().getSelection().length==0){Ext.ux.Alert.alert(f.titleError,t("Por favor selecione um bolero"),"notification")}else{if(f.list.getSelectionModel().getSelection().length>1){Ext.ux.Alert.alert(f.titleError,t("Por favor selecione somente um bolero"),"notification")}else{url="index.php/boleto/secondVia/?id="+d.get("id");window.open(url)}}}},0,0,0,0,["controller.boleto"],0,[MBilling.view.boleto,"Controller"],0));(Ext.cmd.derive("MBilling.view.boleto.Module",Ext.ux.panel.Module,{controller:"boleto"},0,["boletomodule"],["component","box","container","uxpanelmodule","boletomodule"],{component:true,box:true,container:true,uxpanelmodule:true,boletomodule:true},["widget.boletomodule"],0,[MBilling.view.boleto,"Module"],0));(Ext.cmd.derive("MBilling.view.boleto.List",Ext.ux.grid.Panel,{store:"Boleto",iconButtonCsv:"boleto",textButtonCsv:t("Importar Retorno"),iconButtonImportCsv:"boleto",textButtonImportCsv:t("Importar Retorno"),initComponent:function(){var b=this;b.buttonCsv=false;b.buttonUpdateLot=false;b.buttonImportCsv=App.user.isAdmin;b.extraButtons=[{text:t("Segunda via"),iconCls:"boleto",handler:"onSecondVia",disabled:false}];b.columns=[{header:t("Nosso Número"),dataIndex:"id",flex:3,hidden:!App.user.isAdmin,hideable:App.user.isAdmin},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("value"),dataIndex:"payment",renderer:Helper.Util.formatMoneyDecimal,flex:4},{header:"Pago",dataIndex:"status",renderer:Helper.Util.formattyyesno,flex:2,filter:{type:"list",options:[[0,t("no")],[1,t("yes")]]}},{header:t("description"),dataIndex:"description",flex:5},{header:"Vencimento",renderer:Ext.util.Format.dateRenderer("Y-m-d"),dataIndex:"vencimento",flex:4},{header:"Gerado",renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"date",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["boletolist"],["component","box","container","panel","tablepanel","gridpanel","grid","boletolist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,boletolist:true},["widget.boletolist"],0,[MBilling.view.boleto,"List"],0));(Ext.cmd.derive("MBilling.view.boleto.Form",Ext.ux.form.Panel,{fieldsHideEdit:["cid"],initComponent:function(){var b=this;b.items=[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:App.user.isClient},{xtype:"moneyfield",name:"payment",fieldLabel:t("value"),readOnly:App.user.isClient},{xtype:"yesnocombo",name:"status",fieldLabel:t("Pago"),hidden:App.user.isClient,value:0},{xtype:"datefield",name:"vencimento",fieldLabel:"Vencimento",format:"Y-m-d H:i:s",hidden:App.user.isClient||App.user.isAgent},{xtype:"textareafield",name:"description",fieldLabel:t("description"),readOnly:App.user.isClient}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["boletoform"],["component","box","container","panel","form","boletoform"],{component:true,box:true,container:true,panel:true,form:true,boletoform:true},["widget.boletoform"],0,[MBilling.view.boleto,"Form"],0));(Ext.cmd.derive("Ext.ux.window.ImportBoleto",Ext.window.Window,{autoShow:true,modal:true,layout:"fit",iconCls:"boleto",title:t("Importa Retorno Boleto"),width:400,height:175,labelWidthFields:180,htmlTipInfo:"",fieldsImport:[],initComponent:function(){var d=this,c=Ext.Array.merge(d.fieldsImport,[{xtype:"uploadfield",fieldLabel:t("Selecion o arquivo .RET"),htmlTipInfo:d.htmlTipInfo}]);d.items=[{xtype:"form",bodyPadding:5,labelWidth:d.labelWidthFields,items:c}];d.title=d.title+(d.titleModule?" - "+d.titleModule:"");d.bbar=[{xtype:"tbtext",text:t("maxSizeFile")+"3 MB"},"->",{iconCls:"boleto",text:t("importText"),scope:d,handler:d.onImport}];Ext.window.Window.prototype.initComponent.apply(this,arguments)},onImport:function(d){var f=this,e=f.list.store;d.disable();f.list.setLoading(true);f.down("form").submit({url:"index.php/boleto/retorno",scope:f,success:function(c,b){var a=Ext.decode(b.response.responseText);if(a.success){Ext.ux.Alert.alert(t("Success"),a.msg,"success",true,false,40000)}else{Ext.ux.Alert.alert(t("Error"),a.errors,"error")}d.enable();f.list.setLoading(false);e.load();f.close()},failure:function(c,b){if(Ext.isObject(b.response.responseText)){var a=Ext.decode(b.response.responseText);Ext.ux.Alert.alert(t("Error"),a.errors,"error")}else{Ext.ux.Alert.alert(t("Error"),b.response.responseText,"error",true,10)}d.enable();f.list.setLoading(false);f.close()}})}},0,0,["component","box","container","panel","window"],{component:true,box:true,container:true,panel:true,window:true},0,0,[Ext.ux.window,"ImportBoleto"],0));(Ext.cmd.derive("MBilling.view.boleto.ImportCsv",Ext.ux.window.ImportBoleto,{title:t("Importar Retorno"),labelWidthFields:250,height:275,fieldsImport:[{xtype:"boletobanckcombo",name:"banco",fieldLabel:t("Banco"),width:350}]},0,["boletoimportcsv"],["component","box","container","panel","window","boletoimportcsv"],{component:true,box:true,container:true,panel:true,window:true,boletoimportcsv:true},["widget.boletoimportcsv"],0,[MBilling.view.boleto,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.offer.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.offer"],0,[MBilling.view.offer,"Controller"],0));(Ext.cmd.derive("MBilling.view.offer.Combo",Ext.form.field.ComboBox,{name:"id_offer",fieldLabel:t("offer"),displayField:"label",valueField:"id",value:0,extraValues:[{id:0,label:t("undefined")}],initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Offer",{proxy:{type:"uxproxy",module:"offer",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["offercombo"],["component","box","field","textfield","pickerfield","combobox","combo","offercombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,offercombo:true},["widget.offercombo"],0,[MBilling.view.offer,"Combo"],0));(Ext.cmd.derive("MBilling.view.offer.Module",Ext.ux.panel.Module,{controller:"offer"},0,["offermodule"],["component","box","container","uxpanelmodule","offermodule"],{component:true,box:true,container:true,uxpanelmodule:true,offermodule:true},["widget.offermodule"],0,[MBilling.view.offer,"Module"],0));(Ext.cmd.derive("MBilling.view.offer.List",Ext.ux.grid.Panel,{store:"Offer",initComponent:function(){var b=this;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("name"),dataIndex:"label",flex:1},{header:t("packagetype"),dataIndex:"packagetype",renderer:Helper.Util.formatPackageType,comboRelated:"offertypecombo",flex:1,filter:{type:"list",options:[[0,t("unlimitedcalls")],[1,t("numberfreecalls")],[2,t("freeseconds")]]}},{header:t("freetimetocall"),dataIndex:"freetimetocall",flex:1},{header:t("periode"),dataIndex:"billingtype",renderer:Helper.Util.formatBillingType,comboRelated:"billingtypecombo",flex:1,filter:{type:"list",options:[[0,t("monthly")],[1,t("weekly")]]}},{header:t("price"),dataIndex:"price",renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,hideable:App.user.isAdmin,flex:2},{header:t("creationdate"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"creationdate",flex:1}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["offerlist"],["component","box","container","panel","tablepanel","gridpanel","grid","offerlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,offerlist:true},["widget.offerlist"],0,[MBilling.view.offer,"List"],0));(Ext.cmd.derive("MBilling.view.offer.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["name"],items:[{name:"label",fieldLabel:t("name")},{xtype:"offertypecombo",name:"packagetype",fieldLabel:t("packagetype")},{name:"freetimetocall",fieldLabel:t("freetimetocall")},{xtype:"billingtypecombo",name:"billingtype",fieldLabel:t("periode")},{xtype:"moneyfield",name:"price",fieldLabel:t("price")}]},0,["offerform"],["component","box","container","panel","form","offerform"],{component:true,box:true,container:true,panel:true,form:true,offerform:true},["widget.offerform"],0,[MBilling.view.offer,"Form"],0));(Ext.cmd.derive("MBilling.view.offerCdr.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.offercdr"],0,[MBilling.view.offerCdr,"Controller"],0));(Ext.cmd.derive("MBilling.view.offerCdr.Module",Ext.ux.panel.Module,{controller:"offercdr"},0,["offercdrmodule"],["component","box","container","uxpanelmodule","offercdrmodule"],{component:true,box:true,container:true,uxpanelmodule:true,offercdrmodule:true},["widget.offercdrmodule"],0,[MBilling.view.offerCdr,"Module"],0));(Ext.cmd.derive("MBilling.view.offerCdr.List",Ext.ux.grid.Panel,{store:"OfferCdr",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"date_consumption",flex:3},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:3},{xtype:"templatecolumn",tpl:"{idOfferlabel}",header:t("offer"),dataIndex:"id_offer",comboFilter:"offercombo",flex:3},{header:t("duration"),dataIndex:"used_secondes",renderer:Helper.Util.formatsecondsToTime,flex:3}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["offercdrlist"],["component","box","container","panel","tablepanel","gridpanel","grid","offercdrlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,offercdrlist:true},["widget.offercdrlist"],0,[MBilling.view.offerCdr,"List"],0));(Ext.cmd.derive("MBilling.view.offerCdr.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.columns=[{xtype:"usercombo"},{xtype:"offercombo"},{name:"used_secondes",fieldLabel:t("usedsecondes")},{xtype:"datefield",name:"date_consumption",fieldLabel:t("date"),format:"Y-m-d H:i:s"}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["offercdrform"],["component","box","container","panel","form","offercdrform"],{component:true,box:true,container:true,panel:true,form:true,offercdrform:true},["widget.offercdrform"],0,[MBilling.view.offerCdr,"Form"],0));(Ext.cmd.derive("MBilling.view.offerUse.Module",Ext.ux.panel.Module,{controller:"offeruse"},0,["offerusemodule"],["component","box","container","uxpanelmodule","offerusemodule"],{component:true,box:true,container:true,uxpanelmodule:true,offerusemodule:true},["widget.offerusemodule"],0,[MBilling.view.offerUse,"Module"],0));(Ext.cmd.derive("MBilling.view.offerUse.List",Ext.ux.grid.Panel,{store:"OfferUse",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:3},{xtype:"templatecolumn",tpl:"{idOfferlabel}",header:t("offer"),dataIndex:"id_offer",comboFilter:"offercombo",flex:3},{header:t("monthpayed"),dataIndex:"month_payed",flex:3},{header:t("reservationdate"),renderer:Ext.util.Format.dateRenderer("Y-m-d"),dataIndex:"reservationdate",flex:3},{header:t("releasedate"),renderer:Ext.util.Format.dateRenderer("Y-m-d"),dataIndex:"releasedate",flex:3}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["offeruselist"],["component","box","container","panel","tablepanel","gridpanel","grid","offeruselist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,offeruselist:true},["widget.offeruselist"],0,[MBilling.view.offerUse,"List"],0));(Ext.cmd.derive("MBilling.view.offerUse.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{xtype:"userlookup",ownerForm:b,readOnly:true},{xtype:"offercombo",readOnly:true},{name:"month_payed",fieldLabel:t("monthpayed")},{xtype:"datefield",name:"reservationdate",fieldLabel:t("reservationdate"),format:"Y-m-d H:i:s"}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["offeruseform"],["component","box","container","panel","form","offeruseform"],{component:true,box:true,container:true,panel:true,form:true,offeruseform:true},["widget.offeruseform"],0,[MBilling.view.offerUse,"Form"],0));(Ext.cmd.derive("MBilling.view.campaign.Controller",Ext.ux.app.ViewController,{isSubmitForm:true,init:function(){var b=this;b.control({typecampaigndestinationcombo:{select:b.onSelectMethod}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectMethod:function(c,d){this.showFieldsRelated(d.getData().showFields)},showFieldsRelated:function(j){var l=this,m=l.formPanel.getForm(),g=l.formPanel.getForm().getFields(),f=Ext.get(Ext.Element.getActiveElement()).component;l.onSetVisibleFiel(f,m,f.value)},onSetVisibleFiel:function(e,d,f){if(e.value=="undefined"){e.setValue("undefined")}if(e.name.match("^type_0")){d.findField("id_queue_0").setVisible(f.match("^queue"));d.findField("id_sip_0").setVisible(f.match("^sip"));d.findField("id_ivr_0").setVisible(f.match("^ivr"));d.findField("extension_0").setVisible(f.match("^group|^number|^custom"))}},onEdit:function(){var f=this,d=f.formPanel.getForm(),e=f.list.getSelectionModel().getSelection()[0];if(e.getData()["type_0"]=="ivr"){d.findField("id_ivr_0").setVisible(true);d.findField("id_sip_0").setVisible(false);d.findField("id_queue_0").setVisible(false);d.findField("extension_0").setVisible(false)}else{if(e.getData()["type_0"]=="sip"){d.findField("id_sip_0").setVisible(true);d.findField("id_ivr_0").setVisible(false);d.findField("id_queue_0").setVisible(false);d.findField("extension_0").setVisible(false)}else{if(e.getData()["type_0"]=="queue"){d.findField("id_queue_0").setVisible(true);d.findField("id_sip_0").setVisible(false);d.findField("id_ivr_0").setVisible(false);d.findField("extension_0").setVisible(false)}else{if(e.getData()["type_0"].match("custom|number|group")){d.findField("extension_0").setVisible(true);d.findField("id_ivr_0").setVisible(false);d.findField("id_sip_0").setVisible(false);d.findField("id_queue_0").setVisible(false)}else{d.findField("id_queue_0").setVisible(false);d.findField("id_sip_0").setVisible(false);d.findField("id_ivr_0").setVisible(false);d.findField("extension_0").setVisible(false)}}}}Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)},onNew:function(){var f=this,d=f.formPanel.getForm(),e=f.list.getSelectionModel().getSelection()[0];d.findField("id_ivr_0").setVisible(false);d.findField("id_sip_0").setVisible(false);d.findField("id_queue_0").setVisible(false);d.findField("extension_0").setVisible(false);Ext.ux.app.ViewController.prototype.onNew.apply(this,arguments)},submitForm:function(d){var f=this,e=f.store;Ext.apply(f.params,{id_phonebook_array:f.formPanel.getForm().getFieldValues().id_phonebook.join(",")});f.formPanel.add({xtype:"hiddenfield",name:f.idProperty,value:f.formPanel.idRecord});f.formPanel.getForm().submit({url:f.store.getProxy().api.create,params:f.params,scope:f,success:function(c,b){var a=Ext.decode(b.response.responseText);if(a.success){Ext.ux.Alert.alert(f.titleSuccess,a.msg,"success");f.formPanel.fireEvent("aftersave",f.formPanel,a.rows[0])}else{errors=Helper.Util.convertErrorsJsonToString(a.msg);if(!Ext.isObject(a.errors)){Ext.ux.Alert.alert(f.titleError,errors,"error")}else{c.markInvalid(a.errors);Ext.ux.Alert.alert(f.titleWarning,f.msgFormInvalid,"warning")}}f.store.load();f.formPanel.setLoading(false);f.saveButton.enable()},failure:function(j,c){var b=Ext.decode(c.response.responseText),a=Helper.Util.convertErrorsJsonToString(b.errors);if(!Ext.isObject(b.errors)){Ext.ux.Alert.alert(f.titleError,a,"error")}else{j.markInvalid(b.errors);Ext.ux.Alert.alert(f.titleWarning,a,"error")}f.formPanel.setLoading(false);f.saveButton.enable()}})},onTestCampaign:function(e){var f=this,d=f.list.getSelectionModel().getSelection()[0];if(f.list.getSelectionModel().getSelection().length==0){Ext.ux.Alert.alert(f.titleError,t("Please Select one campaign"),"notification")}else{if(f.list.getSelectionModel().getSelection().length>1){Ext.ux.Alert.alert(f.titleError,t("Please Select only one campaign"),"notification")}else{Ext.Ajax.request({url:"index.php/campaign/testCampaign",params:{id:d.get("id")},scope:f,success:function(b){b=Ext.decode(b.responseText);if(b[f.nameSuccessRequest]){Ext.ux.Alert.alert(f.titleSuccess,b[f.nameMsgRequest],"success")}else{var a=Helper.Util.convertErrorsJsonToString(b[f.nameMsgRequest]);Ext.ux.Alert.alert(f.titleSuccess,a,"error")}}})}}}},0,0,0,0,["controller.campaign"],0,[MBilling.view.campaign,"Controller"],0));(Ext.cmd.derive("MBilling.view.campaign.Combo",Ext.form.field.ComboBox,{name:"id_campaign",fieldLabel:t("campaign"),displayField:"name",forceSelection:true,editable:false,valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Campaign",{proxy:{type:"uxproxy",module:"campaign",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["campaigncombo"],["component","box","field","textfield","pickerfield","combobox","combo","campaigncombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,campaigncombo:true},["widget.campaigncombo"],0,[MBilling.view.campaign,"Combo"],0));(Ext.cmd.derive("MBilling.view.general.TypeCampaignDestination",Ext.form.field.ComboBox,{fieldLabel:t("type"),forceSelection:true,editable:false,value:"",store:[["",t("")],["undefined",t("Undefined")],["sip",t("SIP")],["ivr",t("IVR")],["queue",t("Queue")],["group",t("Group")],["custom",t("Custom")]]},0,["typecampaigndestinationcombo"],["component","box","field","textfield","pickerfield","combobox","combo","typecampaigndestinationcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,typecampaigndestinationcombo:true},["widget.typecampaigndestinationcombo"],0,[MBilling.view.general,"TypeCampaignDestination"],0));(Ext.cmd.derive("MBilling.view.campaign.Module",Ext.ux.panel.Module,{controller:"campaign"},0,["campaignmodule"],["component","box","container","uxpanelmodule","campaignmodule"],{component:true,box:true,container:true,uxpanelmodule:true,campaignmodule:true},["widget.campaignmodule"],0,[MBilling.view.campaign,"Module"],0));(Ext.cmd.derive("MBilling.view.campaign.List",Ext.ux.grid.Panel,{store:"Campaign",fieldSearch:"name",initComponent:function(){var b=this;b.buttonCsv=false;b.allowPrint=false;b.extraButtons=[{text:t("Test")+" "+t("Campaign"),iconCls:"call",handler:"onTestCampaign",disabled:false}];b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("name"),dataIndex:"name",flex:4},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:3,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("status"),dataIndex:"status",renderer:Helper.Util.formatBooleanActive,comboRelated:"booleancombo",flex:2,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")]]}},{header:t("type"),dataIndex:"type",renderer:Helper.Util.formatCampaignType,comboRelated:"campaigntypecombo",flex:2,filter:App.user.l.slice(4,7)=="wap"?{type:"list",options:[[0,t("sms")],[1,t("voice")],[3,t("WhasApp")]]}:{type:"list",options:[[0,t("sms")],[1,t("voice")]]}},{header:t("daily_start_time"),dataIndex:"daily_start_time",flex:4},{header:t("daily_stop_time"),dataIndex:"daily_stop_time",flex:4},{header:t("startingdate"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"startingdate",flex:4},{header:t("Call Limit"),dataIndex:"frequency",flex:4,hidden:true,hideable:App.user.isAdmin},{header:t("Max Complete Call"),dataIndex:"secondusedreal",flex:3,hidden:true,hideable:App.user.isAdmin}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignlist"],["component","box","container","panel","tablepanel","gridpanel","grid","campaignlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,campaignlist:true},["widget.campaignlist"],0,[MBilling.view.campaign,"List"],0));(Ext.cmd.derive("MBilling.view.campaign.Form",Ext.ux.form.Panel,{bodyPadding:0,fieldsHideUpdateLot:["id_user","name","audio","audio_2","id_phonebook"],fileUpload:true,initComponent:function(){var b=this;b.labelWidthFields=120;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{plugins:"markallowblank",allowBlank:false,anchor:"100%",labelAlign:"right"}},items:[{title:t("general"),items:[{xtype:App.user.isClient?"textfield":"userlookup",ownerForm:b,hidden:App.user.isClient},{fieldLabel:t("Plan"),xtype:"plancombo",name:"id_plan",hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"name",fieldLabel:t("name")},{xtype:"booleancombo",name:"status",fieldLabel:t("status")},{xtype:"datetimefield",name:"startingdate",fieldLabel:t("startingdate"),format:"Y-m-d H:i:s",value:new Date()},{xtype:"datetimefield",name:"expirationdate",fieldLabel:t("expirationdate"),format:"Y-m-d H:i:s",value:"2030-01-01 00:00:00"},{xtype:"campaigntypefullcombo",name:"type",fieldLabel:t("type")},{xtype:"uploadfield",fieldLabel:t("Audio"),emptyText:"Select an wav or gsm File",allowBlank:true,name:"audio",extAllowed:["wav","gsm"]},{xtype:"uploadfield",fieldLabel:t("Audio")+"2",emptyText:"Select an wav or gsm File",allowBlank:true,name:"audio_2",extAllowed:["wav","gsm"]},{xtype:"yesnocombo",name:"restrict_phone",fieldLabel:t("Restrict Phone"),hidden:App.user.isClient,allowBlank:true},{style:"margin-top:25px",xtype:"fieldset",title:t("Forward to"),collapsible:true,collapsed:false,height:110,defaults:{labelWidth:190,anchor:"100%",labelAlign:b.labelAlignFields},items:[{xtype:"numberfield",name:"digit_authorize",fieldLabel:t("Number to Forward"),value:"-1",minValue:"-1",maxValue:9},{fieldLabel:t("Forward Type"),name:"type_0",xtype:"typecampaigndestinationcombo",allowBlank:true},{xtype:"textfield",name:"extensions_0",fieldLabel:t("Destination"),value:"0",allowBlank:true,hidden:true},{xtype:"ivrlookup",ownerForm:b,name:"id_ivr_0",fieldLabel:t("IVR"),displayField:"id_ivr_0_name",allowBlank:true,hidden:true},{xtype:"queuelookup",ownerForm:b,name:"id_queue_0",fieldLabel:t("Queue"),displayField:"id_queue_0_name",allowBlank:true,hidden:true},{xtype:"siplookup",ownerForm:b,name:"id_sip_0",displayField:"id_sip_0_name",fieldLabel:t("SIP"),allowBlank:true,hidden:true},{xtype:"textfield",fieldLabel:t("Destination"),name:"extension_0",hidden:true}]},{style:"margin-top:10px",xtype:"fieldset",title:t("Select one or more phonebook"),collapsible:true,collapsed:false,items:[{labelWidth:10,name:"id_phonebook",fieldLabel:t("phonebook"),anchor:"100%",fieldLabel:"",xtype:"phonebooktag",allowBlank:true}]}]},{title:t("schedules"),items:[{name:"daily_start_time",fieldLabel:t("daily_start_time"),value:"09:00"},{name:"daily_stop_time",fieldLabel:t("daily_stop_time"),value:"18:00"},{xtype:"yesnocombo",fieldLabel:t("monday"),name:"monday"},{xtype:"yesnocombo",fieldLabel:t("tuesday"),name:"tuesday"},{xtype:"yesnocombo",fieldLabel:t("wednesday"),name:"wednesday"},{xtype:"yesnocombo",fieldLabel:t("thursday"),name:"thursday"},{xtype:"yesnocombo",fieldLabel:t("friday"),name:"friday"},{xtype:"noyescombo",fieldLabel:t("saturday"),name:"saturday"},{xtype:"noyescombo",fieldLabel:t("sunday"),name:"sunday"}]},{title:t("Limit"),items:[{name:"frequency",fieldLabel:t("Call Limit"),readOnly:!App.user.isAdmin,allowBlank:!App.user.isAdmin,value:App.user.isClient?1:10},{name:"nb_callmade",fieldLabel:t("Total Audio Time"),hidden:!App.user.isAdmin,allowBlank:true,value:0},{xtype:"booleancombo",name:"enable_max_call",fieldLabel:t("Enable")+" "+t("Max Complete Call"),hidden:!App.user.isAdmin,allowBlank:true,value:0},{name:"secondusedreal",fieldLabel:t("Max Complete Call"),hidden:!App.user.isAdmin,allowBlank:true,value:0}]},{title:t("SMS"),items:[{xtype:"textareafield",name:"description",fieldLabel:t("descriptionOrSmsText"),allowBlank:true,maxLength:160}]},{title:t("TTS/ASR"),hidden:!window.ttsasr,items:[{name:"tts_audio",fieldLabel:t("Audio 1 TTS"),allowBlank:true,maxLength:200},{name:"tts_audio2",fieldLabel:t("Audio 2 TTS"),allowBlank:true,maxLength:200},{xtype:"box",hidden:false,autoEl:{tag:"br"}},{name:"asr_options",fieldLabel:t("Option to validate ASR"),allowBlank:true,maxLength:160}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignform"],["component","box","container","panel","form","campaignform"],{component:true,box:true,container:true,panel:true,form:true,campaignform:true},["widget.campaignform"],0,[MBilling.view.campaign,"Form"],0));(Ext.cmd.derive("MBilling.view.campaignPoll.Controller",Ext.ux.app.ViewController,{isSubmitForm:true},0,0,0,0,["controller.campaignpoll"],0,[MBilling.view.campaignPoll,"Controller"],0));(Ext.cmd.derive("MBilling.view.campaignPoll.Combo",Ext.form.field.ComboBox,{name:"id_campaign_poll",fieldLabel:t("campaignpoll"),displayField:"name",valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.CampaignPoll",{proxy:{type:"uxproxy",module:"campaignPoll",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["campaignpollcombo"],["component","box","field","textfield","pickerfield","combobox","combo","campaignpollcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,campaignpollcombo:true},["widget.campaignpollcombo"],0,[MBilling.view.campaignPoll,"Combo"],0));(Ext.cmd.derive("MBilling.view.campaignPoll.Module",Ext.ux.panel.Module,{controller:"campaignpoll"},0,["campaignpollmodule"],["component","box","container","uxpanelmodule","campaignpollmodule"],{component:true,box:true,container:true,uxpanelmodule:true,campaignpollmodule:true},["widget.campaignpollmodule"],0,[MBilling.view.campaignPoll,"Module"],0));(Ext.cmd.derive("MBilling.view.campaignPoll.List",Ext.ux.grid.Panel,{store:"CampaignPoll",initComponent:function(){var b=this;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("name"),dataIndex:"name",flex:4},{xtype:"templatecolumn",tpl:"{idCampaignname}",header:t("campaign"),dataIndex:"id_campaign",comboFilter:"campaigncombo",flex:4},{header:t("description"),dataIndex:"description",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignpolllist"],["component","box","container","panel","tablepanel","gridpanel","grid","campaignpolllist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,campaignpolllist:true},["widget.campaignpolllist"],0,[MBilling.view.campaignPoll,"List"],0));(Ext.cmd.derive("MBilling.view.campaignPoll.Form",Ext.ux.form.Panel,{bodyPadding:0,fileUpload:true,fieldsHideUpdateLot:["id_campaign","name","arq_audio"],initComponent:function(){var b=this;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{plugins:"markallowblank",allowBlank:false,anchor:"100%",labelAlign:"right"}},items:[{title:t("general"),items:[{xtype:"campaigncombo"},{name:"name",fieldLabel:t("name")},{xtype:"numberfield",name:"repeat",fieldLabel:t("How many time to repeat, if the client press invalid option?"),minValue:0,maxValue:9,allowBlank:true},{xtype:"noyescombo",name:"request_authorize",fieldLabel:t("Request")+" "+t("authorization")},{xtype:"numberfield",name:"digit_authorize",fieldLabel:t("Number for authorize"),value:"1",minValue:1,maxValue:9,allowBlank:true},{xtype:"textareafield",name:"description",fieldLabel:t("description"),allowBlank:true},{xtype:"uploadfield",fieldLabel:"Audio",emptyText:"Select an wav or gsm File",allowBlank:true,name:"arq_audio",extAllowed:["wav","gsm"]}]},{title:t("options"),itemId:"optionsData",items:[{name:"option0",fieldLabel:t("option")+" 0",allowBlank:true},{name:"option1",fieldLabel:t("option")+" 1",allowBlank:true},{name:"option2",fieldLabel:t("option")+" 2",allowBlank:true},{name:"option3",fieldLabel:t("option")+" 3",allowBlank:true},{name:"option4",fieldLabel:t("option")+" 4",allowBlank:true},{name:"option5",fieldLabel:t("option")+" 5",allowBlank:true},{name:"option6",fieldLabel:t("option")+" 6",allowBlank:true},{name:"option7",fieldLabel:t("option")+" 7",allowBlank:true},{name:"option8",fieldLabel:t("option")+" 8",allowBlank:true},{name:"option9",fieldLabel:t("option")+" 9",allowBlank:true}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignpollform"],["component","box","container","panel","form","campaignpollform"],{component:true,box:true,container:true,panel:true,form:true,campaignpollform:true},["widget.campaignpollform"],0,[MBilling.view.campaignPoll,"Form"],0));(Ext.cmd.derive("MBilling.view.phoneNumber.Controller",Ext.ux.app.ViewController,{reprocessar:function(e){var g=this,f=g.list.getStore(),j=g.list.filters.getFilterData().length?Ext.encode(g.list.filters.getFilterData()):f.proxy.extraParams.filter;e.disable();g.list.setLoading(true);if(!j){Ext.ux.Alert.alert("Alert","Realize um filtro para reprocessar","notification");e.enable();g.list.setLoading(false);return}Ext.Msg.confirm("Confirm","Confirme que quer reprocessar os numeros pendentes?",function(a){if(a==="yes"){Ext.Ajax.request({url:"index.php/phoneNumber/reprocesar/",params:{filter:j},scope:g,success:function(c){c=Ext.decode(c.responseText);if(c[g.nameSuccessRequest]){Ext.ux.Alert.alert(g.titleSuccess,c[g.nameMsgRequest],"success");f.load();e.enable();g.list.setLoading(false)}else{var b=Helper.Util.convertErrorsJsonToString(c[g.nameMsgRequest]);Ext.ux.Alert.alert(g.titleError,b,"error");e.enable();g.list.setLoading(false)}}})}})}},0,0,0,0,["controller.phonenumber"],0,[MBilling.view.phoneNumber,"Controller"],0));(Ext.cmd.derive("MBilling.view.phoneNumber.Module",Ext.ux.panel.Module,{controller:"phonenumber"},0,["phonenumbermodule"],["component","box","container","uxpanelmodule","phonenumbermodule"],{component:true,box:true,container:true,uxpanelmodule:true,phonenumbermodule:true},["widget.phonenumbermodule"],0,[MBilling.view.phoneNumber,"Module"],0));(Ext.cmd.derive("MBilling.view.phoneNumber.List",Ext.ux.grid.Panel,{store:"PhoneNumber",buttonImportCsv:true,initComponent:function(){var b=this;b.extraButtons=[{text:t("Reprocessar"),iconCls:"callshop",handler:"reprocessar",disabled:false}];b.buttonUpdateLot=App.user.isAdmin&&!window.isTablet;b.buttonCsv=!window.isTablet;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("number"),dataIndex:"number",flex:4},{header:t("phonebook"),dataIndex:"idPhonebookname",filter:{type:"string",field:"idPhonebook.name"},flex:4},{header:t("status"),dataIndex:"status",renderer:Helper.Util.formatBooleanActive,comboRelated:"statuscombo",flex:2,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")],[2,t("pending")],[3,t("send")],[4,t("blocked")]]}},{header:t("name"),dataIndex:"name",hidden:true,hideable:true,flex:4},{header:t("city"),dataIndex:"city",hidden:true,hideable:true,flex:4},{header:t("description"),dataIndex:"info",hidden:true,flex:4},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"creationdate",hidden:true,hideable:App.user.isAdmin,flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["phonenumberlist"],["component","box","container","panel","tablepanel","gridpanel","grid","phonenumberlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,phonenumberlist:true},["widget.phonenumberlist"],0,[MBilling.view.phoneNumber,"List"],0));(Ext.cmd.derive("MBilling.view.phoneNumber.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["number"],initComponent:function(){var b=this;b.items=[{xtype:"phonebookcombo"},{name:"number",fieldLabel:t("number")},{name:"name",fieldLabel:t("name"),allowBlank:true},{name:"city",fieldLabel:t("city"),allowBlank:true},{xtype:"statuscombo",name:"status",fieldLabel:t("status"),allowBlank:true},{xtype:"textareafield",name:"info",fieldLabel:t("description"),allowBlank:true,hidden:!App.user.isAdmin}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["phonenumberform"],["component","box","container","panel","form","phonenumberform"],{component:true,box:true,container:true,panel:true,form:true,phonenumberform:true},["widget.phonenumberform"],0,[MBilling.view.phoneNumber,"Form"],0));(Ext.cmd.derive("MBilling.view.phoneBook.Combo",Ext.form.field.ComboBox,{name:"id_phonebook",fieldLabel:t("phonebook"),displayField:"name",forceSelection:true,editable:true,valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.PhoneBook",{proxy:{type:"uxproxy",module:"phoneBook",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["phonebookcombo"],["component","box","field","textfield","pickerfield","combobox","combo","phonebookcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,phonebookcombo:true},["widget.phonebookcombo"],0,[MBilling.view.phoneBook,"Combo"],0));(Ext.cmd.derive("MBilling.view.phoneNumber.ImportCsv",Ext.ux.window.ImportCsv,{htmlTipInfo:"
number,name,city
551135672677, Dany Hilger, New York
551156332233, Monica Leith, San Pablo
554153882200, John Mart, Madri
"+t("name")+" "+t("and")+" "+t("city")+" "+t("optional")+"",fieldsImport:[{xtype:"phonebookcombo",width:350}]},0,["phonenumberimportcsv"],["component","box","container","panel","window","phonenumberimportcsv"],{component:true,box:true,container:true,panel:true,window:true,phonenumberimportcsv:true},["widget.phonenumberimportcsv"],0,[MBilling.view.phoneNumber,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.rate.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.rate"],0,[MBilling.view.rate,"Controller"],0));(Ext.cmd.derive("MBilling.view.rate.Module",Ext.ux.panel.Module,{controller:"rate",flexForm:2,labelWidthFields:190},0,["ratemodule"],["component","box","container","uxpanelmodule","ratemodule"],{component:true,box:true,container:true,uxpanelmodule:true,ratemodule:true},["widget.ratemodule"],0,[MBilling.view.rate,"Module"],0));(Ext.cmd.derive("MBilling.view.rate.List",Ext.ux.grid.Panel,{store:"Rate",fieldSearch:"idPrefix.prefix",initComponent:function(){var b=this;b.buttonImportCsv=!App.user.isClient,b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("prefix"),dataIndex:"idPrefixprefix",filter:{type:"string",field:"idPrefix.prefix"},flex:window.isTablet?2:3},{dataIndex:"idPrefixdestination",header:t("destination"),filter:{type:"string",field:"idPrefix.destination"},flex:window.isTablet?2:3},{header:t("buyrate"),dataIndex:"buyrate",renderer:Helper.Util.formatMoneyDecimal4,hidden:!App.user.isAdmin,hideable:App.user.isAdmin,flex:2},{header:t("buyrateinitblock"),dataIndex:"buyrateinitblock",hidden:!App.user.isAdmin||window.isTablet,hideable:App.user.isAdmin,flex:2},{header:t("buyrateincrement"),dataIndex:"buyrateincrement",hidden:!App.user.isAdmin||window.isTablet,hideable:App.user.isAdmin,flex:2},{header:t("rateinitial"),dataIndex:"rateinitial",renderer:Helper.Util.formatMoneyDecimal4,flex:2},{header:t("initblock"),dataIndex:"initblock",hidden:window.isTablet,flex:2},{header:t("billingblock"),dataIndex:"billingblock",hidden:window.isTablet,flex:2},{xtype:"templatecolumn",tpl:"{idTrunktrunkcode}",header:t("trunk"),dataIndex:"id_trunk",comboFilter:"trunkcombo",flex:3,hidden:!App.user.isAdmin,hideable:App.user.isAdmin},{xtype:"templatecolumn",tpl:"{idPlanname}",header:t("plan"),dataIndex:"id_plan",comboFilter:"plancombo",flex:3},{header:t("includeinpackage"),dataIndex:"package_offer",hidden:true,hideable:App.user.isAdmin,flex:1},{header:t("status"),dataIndex:"status",hidden:true,hideable:App.user.isAdmin,flex:2,renderer:Helper.Util.formatBooleanActive,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")]]}}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["ratelist"],["component","box","container","panel","tablepanel","gridpanel","grid","ratelist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,ratelist:true},["widget.ratelist"],0,[MBilling.view.rate,"List"],0));(Ext.cmd.derive("MBilling.view.rate.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["id_prefix"],labelWidthFields:140,initComponent:function(){var b=this;b.items=[{name:"id_plan",fieldLabel:"Plan",xtype:"planlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:false},{name:"id_prefix",fieldLabel:"Destination",xtype:"prefixlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:false},{name:"id_trunk",fieldLabel:"Trunk",xtype:"trunklookup",ownerForm:b,hidden:!App.user.isAdmin,allowBlank:!App.user.isAdmin},{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,"+App.user.decimalPrecision,name:"buyrate",fieldLabel:t("buyrate"),hidden:!App.user.isAdmin,allowBlank:!App.user.isAdmin},{xtype:"numberfield",name:"buyrateinitblock",fieldLabel:t("buyrateinitblock"),value:1,minValue:1,hidden:!App.user.isAdmin,allowBlank:!App.user.isAdmin},{xtype:"numberfield",name:"buyrateincrement",fieldLabel:t("buyrateincrement"),value:1,minValue:1,hidden:!App.user.isAdmin,allowBlank:!App.user.isAdmin},{xtype:"numberfield",name:"minimal_time_buy",fieldLabel:t("Minimal time to buy"),value:0,minValue:0,hidden:!App.user.isAdmin},{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,"+App.user.decimalPrecision,name:"rateinitial",fieldLabel:t("rateinitial"),readOnly:App.user.isClient},{xtype:"numberfield",name:"initblock",fieldLabel:t("initblock"),value:1,minValue:1,hidden:App.user.isClient},{xtype:"numberfield",name:"billingblock",value:1,minValue:1,fieldLabel:t("billingblock"),hidden:App.user.isClient},{xtype:"numberfield",name:"minimal_time_charge",fieldLabel:t("Minimal time to charge"),value:0,minValue:0,hidden:App.user.isClient},{name:"additional_grace",fieldLabel:t("additional_grace"),allowBlank:true,hidden:!App.user.isAdmin},{xtype:"noyescombo",name:"package_offer",fieldLabel:t("includeinpackage"),hidden:!App.user.isAdmin,allowBlank:true},{xtype:"booleancombo",name:"status",fieldLabel:t("status"),hidden:!App.user.isAdmin,allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["rateform"],["component","box","container","panel","form","rateform"],{component:true,box:true,container:true,panel:true,form:true,rateform:true},["widget.rateform"],0,[MBilling.view.rate,"Form"],0));(Ext.cmd.derive("MBilling.view.rate.ImportCsv",Ext.ux.window.ImportCsv,{htmlTipInfo:"
"+t("dialprefix")+", "+t("destination")+", "+t("rateinitial")+", "+t("buyrate")+"
5511, Brasil SP, 0.080, 0.050
34, Spain Fix, 0.056, 0.034
54, Argentina, 0.025, 0.015

"+t("rateinitial")+" "+t("and")+" "+t("buyrate")+" "+t("optional")+"",labelWidthFields:160,height:window.isThemeTriton?350:275,initComponent:function(){var b=this;b.fieldsImport=[{xtype:"plancombo",fieldLabel:t("table"),width:350},{xtype:"trunkcombo",fieldLabel:t("trunkText"),width:350,hidden:!App.user.isAdmin},{style:"margin-top:25px",xtype:"fieldset",title:t("Csv Format"),collapsible:true,collapsed:false,defaults:{labelWidth:190,anchor:"100%",layout:{type:"hbox",labelAlign:b.labelAlignFields}},items:[{xtype:"pontovirgulacombo",name:"delimiter",fieldLabel:t("Delimiter"),width:230}]}];Ext.ux.window.ImportCsv.prototype.initComponent.apply(this,arguments)}},0,["rateimportcsv"],["component","box","container","panel","window","rateimportcsv"],{component:true,box:true,container:true,panel:true,window:true,rateimportcsv:true},["widget.rateimportcsv"],0,[MBilling.view.rate,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.phoneBook.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.phonebook"],0,[MBilling.view.phoneBook,"Controller"],0));(Ext.cmd.derive("MBilling.view.phoneBook.Module",Ext.ux.panel.Module,{controller:"phonebook"},0,["phonebookmodule"],["component","box","container","uxpanelmodule","phonebookmodule"],{component:true,box:true,container:true,uxpanelmodule:true,phonebookmodule:true},["widget.phonebookmodule"],0,[MBilling.view.phoneBook,"Module"],0));(Ext.cmd.derive("MBilling.view.phoneBook.List",Ext.ux.grid.Panel,{store:"PhoneBook",initComponent:function(){var b=this;b.columns=b.columns||[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("name"),dataIndex:"name",flex:5},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:3,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("status"),dataIndex:"status",renderer:Helper.Util.formatBooleanActive,comboRelated:"booleancombo",flex:3,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")]]}},{header:t("description"),dataIndex:"description",flex:5}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["phonebooklist"],["component","box","container","panel","tablepanel","gridpanel","grid","phonebooklist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,phonebooklist:true},["widget.phonebooklist"],0,[MBilling.view.phoneBook,"List"],0));(Ext.cmd.derive("MBilling.view.phoneBook.Form",Ext.ux.form.Panel,{bodyPadding:0,fieldsHideUpdateLot:["id_user","name"],initComponent:function(){var b=this;b.items=[{xtype:App.user.isClient?"textfield":"userlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"name",fieldLabel:t("name")},{xtype:"booleancombo",name:"status",fieldLabel:t("status"),allowBlank:true},{xtype:"textareafield",name:"description",fieldLabel:t("description"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["phonebookform"],["component","box","container","panel","form","phonebookform"],{component:true,box:true,container:true,panel:true,form:true,phonebookform:true},["widget.phonebookform"],0,[MBilling.view.phoneBook,"Form"],0));(Ext.cmd.derive("MBilling.view.phoneBook.Tag",Ext.form.field.Tag,{name:"id_phonebook",fieldLabel:t("phonebook"),displayField:"name",valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.PhoneBook",{proxy:{type:"uxproxy",module:"phoneBook",limitParam:undefined}});Ext.form.field.Tag.prototype.initComponent.apply(this,arguments)}},0,["phonebooktag"],["component","box","field","textfield","pickerfield","combobox","combo","tagfield","phonebooktag"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,tagfield:true,phonebooktag:true},["widget.phonebooktag"],0,[MBilling.view.phoneBook,"Tag"],0));(Ext.cmd.derive("MBilling.view.call.Controller",Ext.ux.app.ViewController,{onRecordCall:function(m){var j=this,f=j.list.getSelectionModel().getSelection()[0],l=Ext.encode(j.list.filters.getFilterData()),g=[];if(!f&&l.length<5){Ext.ux.Alert.alert(j.titleError,t("Please select one or more register"),"notification")}else{Ext.each(j.list.getSelectionModel().getSelection(),function(a){g.push(a.get(j.idProperty))});if(App.user.isAdmin&&g.length>250){Ext.ux.Alert.alert(j.titleError,t("Your limit to download record is")+" 250","error")}else{if(!App.user.isAdmin&&g.length>25){Ext.ux.Alert.alert(j.titleError,t("Your limit to download record is")+" 25","error")}else{window.open("index.php/call/downloadRecord?ids="+Ext.encode(g)+"&filter="+l)}}}},onDownloadClick:function(d,f,e){window.open("index.php/call/downloadRecord?id="+d.getStore().getAt(f).getData().id)},onShowTotal:function(e){var g=this;var g=this,f=g.list.getStore(),j=g.list.filters.getFilterData().length?Ext.encode(g.list.filters.getFilterData()):f.proxy.extraParams.filter;e.disable();e.setText(t("Wait..."));e.setWidth(120);Ext.Ajax.request({url:"index.php/call/getTotal",params:{filter:j},scope:g,success:function(a){a=Ext.decode(a.responseText);Ext.ux.Alert.alert(g.titleSuccess," "+t("Total")+" "+t("buycost")+": "+App.user.currency+" "+a.sumbuycost+"
"+t("Total")+" "+t("sessionbill")+": "+App.user.currency+" "+a.sumsessionbill+"
"+t("Total")+" "+t("profit")+": "+App.user.currency+" "+a.totalCall+"
","information",true,false);e.enable();e.setText(t("Show Total"))},failure:function(a){e.enable();e.setText(""+t("Failed. Try again...")+"");e.setWidth(300)}})}},0,0,0,0,["controller.call"],0,[MBilling.view.call,"Controller"],0));(Ext.cmd.derive("MBilling.view.call.Module",Ext.ux.panel.Module,{controller:"call"},0,["callmodule"],["component","box","container","uxpanelmodule","callmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callmodule:true},["widget.callmodule"],0,[MBilling.view.call,"Module"],0));(Ext.cmd.derive("MBilling.view.call.List",Ext.ux.grid.Panel,{store:"Call",standardSubmit:true,initComponent:function(){var b=this;b.paginationButton=["-",{xtype:"button",width:"120",text:t("Show Total"),handler:"onShowTotal",hidden:!App.user.isAdmin,cls:"x-btn-text-icon details"},{xtype:"tbtext",reference:"tbTextTotal"}];b.fieldSearch=App.user.isAdmin?"idUser.username":"calledstation",b.extraButtons=[{text:t("Download Rec"),iconCls:"call",handler:"onRecordCall",disabled:false,width:130}];b.buttonUpdateLot=App.user.isAdmin;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{xtype:"actioncolumn",width:26,sortable:false,menuDisabled:true,header:t(""),dataIndex:"id",items:[{iconCls:"icon-play",tooltip:t("Download Rec"),handler:"onDownloadClick"}],hidden:App.user.show_playicon_cdr==0,hideable:true},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"starttime",flex:4},{header:t("Sip Account"),dataIndex:"src",flex:3},{header:t("CallerId"),dataIndex:"callerid",flex:3,hidden:true,hideable:true},{header:t("number"),dataIndex:"calledstation",flex:3},{header:t("destination"),dataIndex:"idPrefixdestination",filter:{type:"string",field:"idPrefix.destination"},flex:4},{header:t("sessiontime"),dataIndex:"sessiontime",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Real")+" "+t("sessiontime"),dataIndex:"real_sessiontime",renderer:Helper.Util.formatsecondsToTime,flex:3,hidden:true,hideable:App.user.isAdmin},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:2,hidden:App.user.isClient,hideable:!App.user.isClient},{xtype:"templatecolumn",tpl:"{idTrunktrunkcode}",header:t("trunk"),dataIndex:"id_trunk",comboFilter:"trunkcombo",header:t("trunk"),flex:3,hidden:App.user.isClient||App.user.isAgent,hideable:!App.user.isClient&&!App.user.isAgent},{header:t("status"),dataIndex:"terminatecauseid",renderer:Helper.Util.formatDialStatus,flex:2,filter:{type:"list",options:[[1,t("answer")]]}},{header:t("type"),dataIndex:"sipiax",renderer:Helper.Util.formatCallType,flex:2,filter:{type:"list",options:[[0,t("standard")],[1,t("sipcall")],[2,t("did")],[3,t("didvoip")],[4,t("callback")],[5,t("callcenter")],[6,"sms"],[7,t("transfer")],[8,t("queue")],[9,t("ivr")]]}},{header:t("buycost"),dataIndex:"buycost",renderer:Helper.Util.formatMoneyDecimal4,flex:3,hidden:App.user.isClient||App.user.isAgent,hideable:!App.user.isClient&&!App.user.isAgent},{header:t("sessionbill"),dataIndex:"sessionbill",renderer:Helper.Util.formatMoneyDecimal4,flex:3,hidden:App.user.isAgent||App.user.isClientAgent,hideable:!App.user.isAgent&&!App.user.isClientAgent},{header:t("buycost"),dataIndex:"sessionbill",renderer:Helper.Util.formatMoneyDecimal4,flex:3,hidden:!App.user.isAgent,hideable:App.user.isAgent},{header:t("sessionbill"),dataIndex:"agent_bill",renderer:Helper.Util.formatMoneyDecimal4,flex:3,hidden:!App.user.isAgent,hideable:App.user.isAgent},{header:t("sessionbill"),dataIndex:"agent_bill",renderer:Helper.Util.formatMoneyDecimal4,flex:3,hidden:!App.user.isClientAgent,hideable:App.user.isClientAgent},{header:t("uniqueid"),dataIndex:"uniqueid",flex:3,hidden:true,hideable:true},{xtype:"templatecolumn",tpl:"{idCampaignname}",header:t("campaign"),dataIndex:"id_campaign",comboFilter:"campaigncombo",flex:3,hidden:true,hideable:!App.user.isClient}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["calllist"],["component","box","container","panel","tablepanel","gridpanel","grid","calllist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,calllist:true},["widget.calllist"],0,[MBilling.view.call,"List"],0));(Ext.cmd.derive("MBilling.view.call.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["calledstation"],initComponent:function(){var b=this;b.items=[{name:"calledstation",fieldLabel:t("number"),readOnly:true},{name:"sessiontime",fieldLabel:t("sessiontime"),readOnly:App.user.isClient||App.user.isAgent,hidden:App.user.isClient||App.user.isAgent},{xtype:"moneyfield",name:"buycost",fieldLabel:t("buycost"),mask:App.user.currency+" #9.999.990,"+App.user.decimalPrecision,hidden:App.user.isClient||App.user.isAgent},{xtype:"moneyfield",name:"sessionbill",fieldLabel:t("sessionbill"),mask:App.user.currency+" #9.999.990,"+App.user.decimalPrecision,readOnly:App.user.isClient||App.user.isAgent,hidden:App.user.isAgent||App.user.isClientAgent},{xtype:"moneyfield",name:"agent_bill",fieldLabel:t("sessionbill"),mask:App.user.currency+" #9.999.990,"+App.user.decimalPrecision,readOnly:App.user.isAgent,hidden:!App.user.isAgent&&!App.user.isClientAgent}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callform"],["component","box","container","panel","form","callform"],{component:true,box:true,container:true,panel:true,form:true,callform:true},["widget.callform"],0,[MBilling.view.call,"Form"],0));(Ext.cmd.derive("MBilling.view.callArchive.Controller",Ext.ux.app.ViewController,{onRecordCall:function(m){var j=this,f=j.list.getSelectionModel().getSelection()[0],l=Ext.encode(j.list.filters.getFilterData()),g=[];if(!f&&l.length<5){Ext.ux.Alert.alert(j.titleError,t("Please select one or more register"),"notification")}else{Ext.each(j.list.getSelectionModel().getSelection(),function(a){g.push(a.get(j.idProperty))});if(App.user.isAdmin&&g.length>250){Ext.ux.Alert.alert(j.titleError,t("Your limit to download record is")+" 250","error")}else{if(!App.user.isAdmin&&g.length>25){Ext.ux.Alert.alert(j.titleError,t("Your limit to download record is")+" 25","error")}else{window.open("index.php/callArchive/downloadRecord?ids="+Ext.encode(g)+"&filter="+l)}}}},onDownloadClick:function(d,f,e){window.open("index.php/callArchive/downloadRecord?id="+d.getStore().getAt(f).getData().id)}},0,0,0,0,["controller.callarchive"],0,[MBilling.view.callArchive,"Controller"],0));(Ext.cmd.derive("MBilling.view.callArchive.Module",Ext.ux.panel.Module,{controller:"callarchive"},0,["callarchivemodule"],["component","box","container","uxpanelmodule","callarchivemodule"],{component:true,box:true,container:true,uxpanelmodule:true,callarchivemodule:true},["widget.callarchivemodule"],0,[MBilling.view.callArchive,"Module"],0));(Ext.cmd.derive("MBilling.view.callArchive.List",Ext.ux.grid.Panel,{store:"CallArchive",standardSubmit:true,initComponent:function(){var b=this;b.buttonUpdateLot=false;b.fieldSearch=App.user.isAdmin?"idUser.username":"calledstation",b.extraButtons=[{text:t("Download Rec"),iconCls:"call",handler:"onRecordCall",disabled:false,width:130}];b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{xtype:"actioncolumn",width:26,sortable:false,menuDisabled:true,header:t(""),dataIndex:"id",items:[{iconCls:"icon-play",tooltip:t("Download Rec"),handler:"onDownloadClick"}],hidden:App.user.show_playicon_cdr==0,hideable:true},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"starttime",flex:4},{header:t("Sip Account"),dataIndex:"src",flex:3},{header:t("CallerId"),dataIndex:"callerid",flex:3,hidden:true,hideable:true},{header:t("number"),dataIndex:"calledstation",flex:3},{header:t("destination"),dataIndex:"idPrefixdestination",filter:{type:"string",field:"idPrefix.destination"},flex:4},{header:t("sessiontime"),dataIndex:"sessiontime",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Real")+" "+t("sessiontime"),dataIndex:"real_sessiontime",renderer:Helper.Util.formatsecondsToTime,flex:3,hidden:true,hideable:App.user.isAdmin},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:2,hidden:App.user.isClient,hideable:!App.user.isClient},{xtype:"templatecolumn",tpl:"{idTrunktrunkcode}",header:t("trunk"),dataIndex:"id_trunk",comboFilter:"trunkcombo",header:t("trunk"),flex:3,hidden:App.user.isClient||App.user.isAgent,hideable:!App.user.isClient&&!App.user.isAgent},{header:t("status"),dataIndex:"terminatecauseid",renderer:Helper.Util.formatDialStatus,flex:2,filter:{type:"list",options:[[1,t("answer")]]}},{header:t("type"),dataIndex:"sipiax",renderer:Helper.Util.formatCallType,flex:2,filter:{type:"list",options:[[0,t("standard")],[1,t("sipcall")],[2,t("did")],[3,t("didvoip")],[4,t("callback")],[5,t("callcenter")],[6,"sms"],[7,t("transfer")],[8,t("queue")],[9,t("ivr")]]}},{header:t("buycost"),dataIndex:"buycost",renderer:Helper.Util.formatMoneyDecimal4,flex:3,hidden:App.user.isClient||App.user.isAgent,hideable:!App.user.isClient&&!App.user.isAgent},{header:t("sessionbill"),dataIndex:"sessionbill",renderer:Helper.Util.formatMoneyDecimal4,flex:3,hidden:App.user.isAgent||App.user.isClientAgent,hideable:!App.user.isAgent&&!App.user.isClientAgent},{header:t("buycost"),dataIndex:"sessionbill",renderer:Helper.Util.formatMoneyDecimal4,flex:3,hidden:!App.user.isAgent,hideable:App.user.isAgent},{header:t("sessionbill"),dataIndex:"agent_bill",renderer:Helper.Util.formatMoneyDecimal4,flex:3,hidden:!App.user.isAgent,hideable:App.user.isAgent},{header:t("sessionbill"),dataIndex:"agent_bill",renderer:Helper.Util.formatMoneyDecimal4,flex:3,hidden:!App.user.isClientAgent,hideable:App.user.isClientAgent},{header:t("uniqueid"),dataIndex:"uniqueid",flex:3,hidden:true,hideable:true}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callarchivelist"],["component","box","container","panel","tablepanel","gridpanel","grid","callarchivelist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callarchivelist:true},["widget.callarchivelist"],0,[MBilling.view.callArchive,"List"],0));(Ext.cmd.derive("MBilling.view.callArchive.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["calledstation"],initComponent:function(){var b=this;b.items=[{name:"calledstation",fieldLabel:t("number"),readOnly:true},{name:"sessiontime",fieldLabel:t("sessiontime"),readOnly:App.user.isClient||App.user.isAgent,hidden:App.user.isClient||App.user.isAgent},{xtype:"moneyfield",name:"buycost",fieldLabel:t("buycost"),mask:App.user.currency+" #9.999.990,"+App.user.decimalPrecision,hidden:App.user.isClient||App.user.isAgent},{xtype:"moneyfield",name:"sessionbill",fieldLabel:t("sessionbill"),mask:App.user.currency+" #9.999.990,"+App.user.decimalPrecision,readOnly:App.user.isClient||App.user.isAgent,hidden:App.user.isAgent||App.user.isClientAgent},{xtype:"moneyfield",name:"agent_bill",fieldLabel:t("sessionbill"),mask:App.user.currency+" #9.999.990,"+App.user.decimalPrecision,readOnly:App.user.isAgent,hidden:!App.user.isAgent&&!App.user.isClientAgent}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callarchiveform"],["component","box","container","panel","form","callarchiveform"],{component:true,box:true,container:true,panel:true,form:true,callarchiveform:true},["widget.callarchiveform"],0,[MBilling.view.callArchive,"Form"],0));(Ext.cmd.derive("MBilling.view.callFailed.Controller",Ext.ux.app.ViewController,{formHidden:true},0,0,0,0,["controller.callfailed"],0,[MBilling.view.callFailed,"Controller"],0));(Ext.cmd.derive("MBilling.view.callFailed.Module",Ext.ux.panel.Module,{controller:"callfailed"},0,["callfailedmodule"],["component","box","container","uxpanelmodule","callfailedmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callfailedmodule:true},["widget.callfailedmodule"],0,[MBilling.view.callFailed,"Module"],0));(Ext.cmd.derive("MBilling.view.callFailed.List",Ext.ux.grid.Panel,{store:"CallFailed",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.allowCreate=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"starttime",flex:4},{header:t("Sip Account"),dataIndex:"src",flex:3},{header:t("CallerId"),dataIndex:"callerid",flex:3,hidden:true,hideable:true},{header:t("number"),dataIndex:"calledstation",flex:3},{header:t("destination"),dataIndex:"idPrefixdestination",flex:4},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:2,hidden:App.user.isClient,hideable:!App.user.isClient},{xtype:"templatecolumn",tpl:"{idTrunktrunkcode}",header:t("trunk"),dataIndex:"id_trunk",comboFilter:"trunkcombo",header:t("trunk"),flex:4,hidden:App.user.isClient||App.user.isAgent,hideable:!App.user.isClient&&!App.user.isAgent},{header:t("status"),dataIndex:"terminatecauseid",renderer:Helper.Util.formatDialStatus,flex:2,filter:{type:"list",options:[[1,t("answer")],[2,t("busy")],[3,t("no")+" "+t("answer")],[4,t("cancelcall")],[5,"congestion"],[6,"chanunavail"],[7,"dontcall"],[8,"torture"],[9,"invalidargs"]]}},{header:t("HangupCause"),dataIndex:"hangupcause",hidden:!window.dialC,flex:2},{header:t("type"),dataIndex:"sipiax",renderer:Helper.Util.formatCallType,flex:2,filter:{type:"list",options:[[0,t("standard")],[1,t("sipcall")],[2,t("did")],[3,t("didvoip")],[4,t("callback")],[5,t("callcenter")],[6,"sms"],[7,t("transfer")]]}},{header:t("uniqueid"),dataIndex:"uniqueid",flex:3,hidden:true,hideable:true}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callfailedlist"],["component","box","container","panel","tablepanel","gridpanel","grid","callfailedlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callfailedlist:true},["widget.callfailedlist"],0,[MBilling.view.callFailed,"List"],0));(Ext.cmd.derive("MBilling.view.callFailed.Form",Ext.ux.form.Panel,{},0,["callfailedform"],["component","box","container","panel","form","callfailedform"],{component:true,box:true,container:true,panel:true,form:true,callfailedform:true},["widget.callfailedform"],0,[MBilling.view.callFailed,"Form"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerDay.Controller",Ext.ux.app.ViewController,{onEdit:function(){me=this;me.sumData=me.store.getData().items[0].getData();if(!me.sumData){return}me.formPanel.getForm().getFields().each(function(b){b.setValue(me.sumData[b.name])});me.formPanel.expand()}},0,0,0,0,["controller.callsummaryperday"],0,[MBilling.view.callSummaryPerDay,"Controller"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerDay.Module",Ext.ux.panel.Module,{controller:"callsummaryperday",titleDetails:t("total"),iconForm:"icon-sum",cfgEast:{flex:0.4}},0,["callsummaryperdaymodule"],["component","box","container","uxpanelmodule","callsummaryperdaymodule"],{component:true,box:true,container:true,uxpanelmodule:true,callsummaryperdaymodule:true},["widget.callsummaryperdaymodule"],0,[MBilling.view.callSummaryPerDay,"Module"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerDay.List",Ext.ux.grid.Panel,{store:"CallSummaryPerDay",initComponent:function(){var b=this;b.buttonImportCsv=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{header:t("day"),renderer:Ext.util.Format.dateRenderer("Y-m-d"),dataIndex:"day",filter:{type:"date",field:"day"},flex:3},{header:t("sessiontime")+" "+t("Min"),dataIndex:"sessiontime",flex:2},{header:t("aloc_all_calls"),dataIndex:"aloc_all_calls",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Answered Calls"),dataIndex:"nbcall",flex:3},{header:t("Failed Calls"),dataIndex:"nbcall_fail",flex:3},{header:t("buycost"),dataIndex:"buycost",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("sessionbill"),dataIndex:"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("markup"),dataIndex:"lucro",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("ASR"),dataIndex:"asr",renderer:Helper.Util.formatPorcente,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummaryperdaylist"],["component","box","container","panel","tablepanel","gridpanel","grid","callsummaryperdaylist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callsummaryperdaylist:true},["widget.callsummaryperdaylist"],0,[MBilling.view.callSummaryPerDay,"List"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerDay.Form",Ext.ux.form.Panel,{defaults:{},labelWidthFields:100,defaultType:"displayfield",initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{name:"sumsessiontime",fieldLabel:t("sessiontime")+" "+t("Min"),renderer:Ext.util.Format.numberRenderer("0"),allowBlank:true},{name:"sumsessionbill",fieldLabel:t("sessionbill"),renderer:Helper.Util.formatMoneyDecimal,allowBlank:true},{name:"sumbuycost",fieldLabel:t("buycost"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumlucro",fieldLabel:t("markup"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumnbcall",fieldLabel:t("Answered Calls"),allowBlank:true},{name:"sumnbcallfail",fieldLabel:t("Failed Calls"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummaryperdayform"],["component","box","container","panel","form","callsummaryperdayform"],{component:true,box:true,container:true,panel:true,form:true,callsummaryperdayform:true},["widget.callsummaryperdayform"],0,[MBilling.view.callSummaryPerDay,"Form"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerMonth.Controller",Ext.ux.app.ViewController,{onEdit:function(){me=this;me.sumData=me.store.getData().items[0].getData();if(!me.sumData){return}me.formPanel.getForm().getFields().each(function(b){b.setValue(me.sumData[b.name])});me.formPanel.expand()}},0,0,0,0,["controller.callsummarypermonth"],0,[MBilling.view.callSummaryPerMonth,"Controller"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerMonth.Module",Ext.ux.panel.Module,{controller:"callsummarypermonth",titleDetails:t("total"),iconForm:"icon-sum",cfgEast:{flex:0.4}},0,["callsummarypermonthmodule"],["component","box","container","uxpanelmodule","callsummarypermonthmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callsummarypermonthmodule:true},["widget.callsummarypermonthmodule"],0,[MBilling.view.callSummaryPerMonth,"Module"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerMonth.List",Ext.ux.grid.Panel,{store:"CallSummaryPerMonth",initComponent:function(){var b=this;b.buttonImportCsv=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{header:t("month"),dataIndex:"month",filter:{type:"date",field:"month",dateFormat:"Ym"},flex:3},{header:t("sessiontime")+" "+t("Min"),dataIndex:"sessiontime",flex:2},{header:t("aloc_all_calls"),dataIndex:"aloc_all_calls",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("nbcall"),dataIndex:"nbcall",flex:3},{header:t("buycost"),dataIndex:"buycost",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("sessionbill"),dataIndex:"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("markup"),dataIndex:"lucro",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarypermonthlist"],["component","box","container","panel","tablepanel","gridpanel","grid","callsummarypermonthlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callsummarypermonthlist:true},["widget.callsummarypermonthlist"],0,[MBilling.view.callSummaryPerMonth,"List"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerMonth.Form",Ext.ux.form.Panel,{defaults:{},labelWidthFields:100,defaultType:"displayfield",initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{name:"sumsessiontime",fieldLabel:t("sessiontime")+" "+t("Min"),renderer:Ext.util.Format.numberRenderer("0"),allowBlank:true},{name:"sumsessionbill",fieldLabel:t("sessionbill"),renderer:Helper.Util.formatMoneyDecimal,allowBlank:true},{name:"sumbuycost",fieldLabel:t("buycost"),renderer:Helper.Util.formatMoneyDecimal,hidden:App.user.isClient,allowBlank:true},{name:"sumlucro",fieldLabel:t("markup"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumnbcall",fieldLabel:t("nbcall"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarypermonthform"],["component","box","container","panel","form","callsummarypermonthform"],{component:true,box:true,container:true,panel:true,form:true,callsummarypermonthform:true},["widget.callsummarypermonthform"],0,[MBilling.view.callSummaryPerMonth,"Form"],0));(Ext.cmd.derive("MBilling.view.callSummaryMonthUser.Controller",Ext.ux.app.ViewController,{onEdit:function(){me=this;me.sumData=me.store.getData().items[0].getData();if(!me.sumData){return}me.formPanel.getForm().getFields().each(function(b){b.setValue(me.sumData[b.name])});me.formPanel.expand()}},0,0,0,0,["controller.callsummarymonthuser"],0,[MBilling.view.callSummaryMonthUser,"Controller"],0));(Ext.cmd.derive("MBilling.view.callSummaryMonthUser.Module",Ext.ux.panel.Module,{controller:"callsummarymonthuser",titleDetails:t("total"),iconForm:"icon-sum",cfgEast:{flex:0.4}},0,["callsummarymonthusermodule"],["component","box","container","uxpanelmodule","callsummarymonthusermodule"],{component:true,box:true,container:true,uxpanelmodule:true,callsummarymonthusermodule:true},["widget.callsummarymonthusermodule"],0,[MBilling.view.callSummaryMonthUser,"Module"],0));(Ext.cmd.derive("MBilling.view.callSummaryMonthUser.List",Ext.ux.grid.Panel,{store:"CallSummaryMonthUser",initComponent:function(){var b=this;b.buttonImportCsv=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{header:t("Month"),renderer:Ext.util.Format.dateRenderer("Y-m"),dataIndex:"month",filter:{type:"date",field:"month",dateFormat:"Ym"},flex:3},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("sessiontime")+" "+t("Min"),dataIndex:"sessiontime",flex:2},{header:t("aloc_all_calls"),dataIndex:"aloc_all_calls",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Answered Calls"),dataIndex:"nbcall",flex:3},{header:t("buycost"),dataIndex:App.user.isAdmin?"buycost":"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("sessionbill"),dataIndex:App.user.isAgent||App.user.isClientAgent?"agent_bill":"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("markup"),dataIndex:"lucro",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarymonthuserlist"],["component","box","container","panel","tablepanel","gridpanel","grid","callsummarymonthuserlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callsummarymonthuserlist:true},["widget.callsummarymonthuserlist"],0,[MBilling.view.callSummaryMonthUser,"List"],0));(Ext.cmd.derive("MBilling.view.callSummaryMonthUser.Form",Ext.ux.form.Panel,{defaults:{},labelWidthFields:100,defaultType:"displayfield",initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{name:"sumsessiontime",fieldLabel:t("sessiontime")+" "+t("Min"),renderer:Ext.util.Format.numberRenderer("0"),allowBlank:true},{name:App.user.isAgent||App.user.isClientAgent?"sumagent_bill":"sumsessionbill",fieldLabel:t("sessionbill"),renderer:Helper.Util.formatMoneyDecimal,allowBlank:true},{name:App.user.isAdmin?"sumbuycost":"sumsessionbill",fieldLabel:t("buycost"),renderer:Helper.Util.formatMoneyDecimal,hidden:App.user.isClient,allowBlank:true},{name:"sumlucro",fieldLabel:t("markup"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmint,allowBlank:true},{name:"sumnbcall",fieldLabel:t("nbcall"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarymonthuserform"],["component","box","container","panel","form","callsummarymonthuserform"],{component:true,box:true,container:true,panel:true,form:true,callsummarymonthuserform:true},["widget.callsummarymonthuserform"],0,[MBilling.view.callSummaryMonthUser,"Form"],0));(Ext.cmd.derive("MBilling.view.callSummaryMonthTrunk.Controller",Ext.ux.app.ViewController,{onEdit:function(){me=this;me.sumData=me.store.getData().items[0].getData();if(!me.sumData){return}me.formPanel.getForm().getFields().each(function(b){b.setValue(me.sumData[b.name])});me.formPanel.expand()}},0,0,0,0,["controller.callsummarymonthtrunk"],0,[MBilling.view.callSummaryMonthTrunk,"Controller"],0));(Ext.cmd.derive("MBilling.view.callSummaryMonthTrunk.Module",Ext.ux.panel.Module,{controller:"callsummarymonthtrunk",titleDetails:t("total"),iconForm:"icon-sum",cfgEast:{flex:0.4}},0,["callsummarymonthtrunkmodule"],["component","box","container","uxpanelmodule","callsummarymonthtrunkmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callsummarymonthtrunkmodule:true},["widget.callsummarymonthtrunkmodule"],0,[MBilling.view.callSummaryMonthTrunk,"Module"],0));(Ext.cmd.derive("MBilling.view.callSummaryMonthTrunk.List",Ext.ux.grid.Panel,{store:"CallSummaryMonthTrunk",initComponent:function(){var b=this;b.buttonImportCsv=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{header:t("Month"),renderer:Ext.util.Format.dateRenderer("Y-m"),dataIndex:"month",filter:{type:"date",field:"month",dateFormat:"Ym"},flex:3},{header:t("Trunk"),dataIndex:"idTrunktrunkcode",filter:{type:"string",field:"idTrunk.trunkcode"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("sessiontime")+" "+t("Min"),dataIndex:"sessiontime",flex:2},{header:t("aloc_all_calls"),dataIndex:"aloc_all_calls",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Answered Calls"),dataIndex:"nbcall",flex:3},{header:t("buycost"),dataIndex:"buycost",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("sessionbill"),dataIndex:"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("markup"),dataIndex:"lucro",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarymonthtrunklist"],["component","box","container","panel","tablepanel","gridpanel","grid","callsummarymonthtrunklist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callsummarymonthtrunklist:true},["widget.callsummarymonthtrunklist"],0,[MBilling.view.callSummaryMonthTrunk,"List"],0));(Ext.cmd.derive("MBilling.view.callSummaryMonthTrunk.Form",Ext.ux.form.Panel,{defaults:{},labelWidthFields:100,defaultType:"displayfield",initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{name:"sumsessiontime",fieldLabel:t("sessiontime")+" "+t("Min"),renderer:Ext.util.Format.numberRenderer("0"),allowBlank:true},{name:"sumsessionbill",fieldLabel:t("sessionbill"),renderer:Helper.Util.formatMoneyDecimal,allowBlank:true},{name:"sumbuycost",fieldLabel:t("buycost"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumlucro",fieldLabel:t("markup"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumnbcall",fieldLabel:t("nbcall"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarymonthtrunkform"],["component","box","container","panel","form","callsummarymonthtrunkform"],{component:true,box:true,container:true,panel:true,form:true,callsummarymonthtrunkform:true},["widget.callsummarymonthtrunkform"],0,[MBilling.view.callSummaryMonthTrunk,"Form"],0));(Ext.cmd.derive("MBilling.view.sms.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.sms"],0,[MBilling.view.sms,"Controller"],0));(Ext.cmd.derive("MBilling.view.sms.Module",Ext.ux.panel.Module,{controller:"sms"},0,["smsmodule"],["component","box","container","uxpanelmodule","smsmodule"],{component:true,box:true,container:true,uxpanelmodule:true,smsmodule:true},["widget.smsmodule"],0,[MBilling.view.sms,"Module"],0));(Ext.cmd.derive("MBilling.view.sms.List",Ext.ux.grid.Panel,{store:"Sms",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.allowUpdate=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("send"),dataIndex:"result",renderer:Helper.Util.formatBooleanSms,comboRelated:"statuscombo",flex:2,filter:{type:"list",options:[[0,t("error")],[1,t("sent")],[2,t("received")]]}},{header:t("destination"),dataIndex:"telephone",flex:2},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"date",flex:5},{header:t("description"),dataIndex:"sms",hidden:true,hideable:true,flex:6}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["smslist"],["component","box","container","panel","tablepanel","gridpanel","grid","smslist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,smslist:true},["widget.smslist"],0,[MBilling.view.sms,"List"],0));(Ext.cmd.derive("MBilling.view.sms.Form",Ext.ux.form.Panel,{fieldsHide:["id_user"],initComponent:function(){var b=this;b.items=[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:App.user.isClient},{xtype:"numberfield",name:"telephone",fieldLabel:t("number"),emptyText:"DDI DDD Nº",maxLength:16,minLength:11},{xtype:"textareafield",name:"sms",fieldLabel:t("sms"),maxLength:160}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["smsform"],["component","box","container","panel","form","smsform"],{component:true,box:true,container:true,panel:true,form:true,smsform:true},["widget.smsform"],0,[MBilling.view.sms,"Form"],0));(Ext.cmd.derive("MBilling.view.campaignPollInfo.Controller",Ext.ux.app.ViewController,{aliasChart:"campaignpollinfochart",onRenderModule:function(){var c=this,d=c.lookupReference("chart");Ext.ux.app.ViewController.prototype.onRenderModule.apply(this,arguments);c.store.on({scope:c,beforeload:function(){d.disable()},load:function(a){d.enable()}})},onChart:function(){var l=this,f=l.list.getStore(),m=l.list.filters.getFilterData(),j=false,g=false;if(!m){Ext.ux.Alert.alert("Alert",t("Use filters"),"information");return}Ext.each(m,function(a){if(a.field=="id_campaign_poll"){if(a.data.value.length==1){g=true}j=true;return}});if(!j){Ext.ux.Alert.alert("Alert",t("Select one or more poll to create a chart"),"information");return}l.chart=Ext.widget("window",{title:t("charts"),iconCls:"icon-chart-column",layout:"fit",autoShow:true,modal:true,resizable:false,width:window.isThemeNeptune?740:710,items:{xtype:l.aliasChart,titleText:g?f.getData().items[0].data.idCampaignPollname:"",list:l.list}})}},0,0,0,0,["controller.campaignpollinfo"],0,[MBilling.view.campaignPollInfo,"Controller"],0));(Ext.cmd.derive("MBilling.view.campaignPollInfo.Module",Ext.ux.panel.Module,{controller:"campaignpollinfo"},0,["campaignpollinfomodule"],["component","box","container","uxpanelmodule","campaignpollinfomodule"],{component:true,box:true,container:true,uxpanelmodule:true,campaignpollinfomodule:true},["widget.campaignpollinfomodule"],0,[MBilling.view.campaignPollInfo,"Module"],0));(Ext.cmd.derive("MBilling.view.campaignPollInfo.List",Ext.ux.grid.Panel,{store:"CampaignPollInfo",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.allowCreate=false;b.extraButtons=[{text:t("charts"),iconCls:"icon-chart-column",handler:"onChart",reference:"chart",disabled:true}];b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("number"),dataIndex:"number",flex:4},{xtype:"templatecolumn",tpl:"{idCampaignPollname}",header:t("poll"),dataIndex:"id_campaign_poll",comboFilter:"campaignpollcombo",flex:4},{header:t("result"),dataIndex:"resposta",flex:4},{header:t("description"),dataIndex:"obs",flex:4},{header:t("City"),dataIndex:"city",flex:4},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"date",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignpollinfolist"],["component","box","container","panel","tablepanel","gridpanel","grid","campaignpollinfolist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,campaignpollinfolist:true},["widget.campaignpollinfolist"],0,[MBilling.view.campaignPollInfo,"List"],0));(Ext.cmd.derive("MBilling.view.campaignPollInfo.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{name:"number",fieldLabel:t("number"),readOnly:true},{name:"resposta",fieldLabel:t("result"),readOnly:true},{xtype:"textareafield",name:"obs",fieldLabel:t("description"),allowBlank:true,maxLength:200}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignpollinfoform"],["component","box","container","panel","form","campaignpollinfoform"],{component:true,box:true,container:true,panel:true,form:true,campaignpollinfoform:true},["widget.campaignpollinfoform"],0,[MBilling.view.campaignPollInfo,"Form"],0));(Ext.cmd.derive("MBilling.view.campaignPollInfo.Chart",Ext.ux.panel.Chart,{controller:"campaignpollinfo",store:"CampaignPollInfoChart",fieldValue:"sumresposta",fieldDescription:"resposta2",labelYLine:t("countvotes"),labelXLine:t("result"),fieldLabel:"percentage",initComponent:function(){var d=this,c;if(window.newChartCampaignInfo){d.fieldDescription="resposta_name"}d.bbarChart=[{xtype:"tbtext",itemId:"tbTextSum",reference:"tbTextSum"}];d.store=Ext.data.StoreManager.lookup(d.store);d.store.setRemoteFilter(true);filters=d.list.filters.getFilterData();d.store.filter("filter",Ext.encode(filters));d.store.load({scope:d,callback:function(){if(d.store.getData().items[0]){d.sumData=d.store.getData().items[0].getData()}if(window.newChartCampaignInfo){d.lookupReference("tbTextSum").setText(d.sumData.total_votos)}}});Ext.ux.panel.Chart.prototype.initComponent.apply(this,arguments)}},0,["campaignpollinfochart"],["component","box","container","panel","chartpanel","campaignpollinfochart"],{component:true,box:true,container:true,panel:true,chartpanel:true,campaignpollinfochart:true},["widget.campaignpollinfochart"],0,[MBilling.view.campaignPollInfo,"Chart"],0));(Ext.cmd.derive("MBilling.view.campaignRestrictPhone.Controller",Ext.ux.app.ViewController,{onEdit:function(){var b=this;Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)},deleteDuplicados:function(e){var g=this,f=g.list.getStore(),j=g.list.filters.getFilterData().length?Ext.encode(g.getList().filters.getFilterData()):f.proxy.extraParams.filter;e.disable();g.list.setLoading(true);Ext.Msg.confirm("Confirm","Confirme que quer deletar os numeros duplicados?",function(a){if(a==="yes"){Ext.Ajax.request({url:"index.php/campaignRestrictPhone/deleteDuplicados/",params:{filter:j},scope:g,success:function(c){c=Ext.decode(c.responseText);if(c[g.nameSuccessRequest]){Ext.ux.Alert.alert(g.titleSuccess,c[g.nameMsgRequest],"success")}else{var b=Helper.Util.convertErrorsJsonToString(c[g.nameMsgRequest]);Ext.ux.Alert.alert(g.titleError,b,"error")}g.list.setLoading(false);e.enable()}})}})}},0,0,0,0,["controller.campaignrestrictphone"],0,[MBilling.view.campaignRestrictPhone,"Controller"],0));(Ext.cmd.derive("MBilling.view.campaignRestrictPhone.Module",Ext.ux.panel.Module,{controller:"campaignrestrictphone"},0,["campaignrestrictphonemodule"],["component","box","container","uxpanelmodule","campaignrestrictphonemodule"],{component:true,box:true,container:true,uxpanelmodule:true,campaignrestrictphonemodule:true},["widget.campaignrestrictphonemodule"],0,[MBilling.view.campaignRestrictPhone,"Module"],0));(Ext.cmd.derive("MBilling.view.campaignRestrictPhone.List",Ext.ux.grid.Panel,{store:"CampaignRestrictPhone",buttonImportCsv:true,initComponent:function(){var b=this;b.extraButtons=[{text:t("Eliminar Duplicados"),iconCls:"callshop",handler:"deleteDuplicados",disabled:false}];b.buttonUpdateLot=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("number"),dataIndex:"number",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignrestrictphonelist"],["component","box","container","panel","tablepanel","gridpanel","grid","campaignrestrictphonelist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,campaignrestrictphonelist:true},["widget.campaignrestrictphonelist"],0,[MBilling.view.campaignRestrictPhone,"List"],0));(Ext.cmd.derive("MBilling.view.campaignRestrictPhone.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{name:"number",fieldLabel:t("number")}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignrestrictphoneform"],["component","box","container","panel","form","campaignrestrictphoneform"],{component:true,box:true,container:true,panel:true,form:true,campaignrestrictphoneform:true},["widget.campaignrestrictphoneform"],0,[MBilling.view.campaignRestrictPhone,"Form"],0));(Ext.cmd.derive("MBilling.view.campaignRestrictPhone.ImportCsv",Ext.ux.window.ImportCsv,{htmlTipInfo:"
number
551135672677
551156332233
554153882200
"},0,["campaignrestrictphoneimportcsv"],["component","box","container","panel","window","campaignrestrictphoneimportcsv"],{component:true,box:true,container:true,panel:true,window:true,campaignrestrictphoneimportcsv:true},["widget.campaignrestrictphoneimportcsv"],0,[MBilling.view.campaignRestrictPhone,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.campaignLog.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.campaignlog"],0,[MBilling.view.campaignLog,"Controller"],0));(Ext.cmd.derive("MBilling.view.campaignLog.Module",Ext.ux.panel.Module,{controller:"campaignlog"},0,["campaignlogmodule"],["component","box","container","uxpanelmodule","campaignlogmodule"],{component:true,box:true,container:true,uxpanelmodule:true,campaignlogmodule:true},["widget.campaignlogmodule"],0,[MBilling.view.campaignLog,"Module"],0));(Ext.cmd.derive("MBilling.view.campaignLog.List",Ext.ux.grid.Panel,{store:"CampaignLog",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.buttonNew=false;b.allowUpdate=false;b.allowDelete=!App.user.isClient;b.columns=[{header:t("Total gerado"),dataIndex:"total",flex:4},{header:t("Loops"),dataIndex:"loops",flex:4},{header:t("Total por tronco"),dataIndex:"trunks",flex:4},{header:t("Campanhas"),dataIndex:"campaigns",flex:4},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"date",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignloglist"],["component","box","container","panel","tablepanel","gridpanel","grid","campaignloglist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,campaignloglist:true},["widget.campaignloglist"],0,[MBilling.view.campaignLog,"List"],0));(Ext.cmd.derive("MBilling.view.campaignLog.Form",Ext.ux.form.Panel,{bodyPadding:0,initComponent:function(){var b=this;b.items=[{name:"total",fieldLabel:t("total")}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignlogform"],["component","box","container","panel","form","campaignlogform"],{component:true,box:true,container:true,panel:true,form:true,campaignlogform:true},["widget.campaignlogform"],0,[MBilling.view.campaignLog,"Form"],0));(Ext.cmd.derive("MBilling.view.campaignSend.Module",Ext.form.Panel,{controller:"campaignsend",resizable:false,autoShow:true,header:false,initComponent:function(){var b=this;b.items=[{reference:"campaignSendPanel",xtype:"form",margin:"10 10 10 10",autoShow:true,closable:false,resizable:false,bodyPadding:10,defaultType:"textfield",defaults:{labelAlign:"right",labelWidth:150,width:280,allowBlank:false,msgTarget:"side",enableKeyEvents:true,plugins:"markallowblank",anchor:"100%"},items:[{xtype:"campaignsendcombo",name:"type",fieldLabel:t("campaign")+" "+t("type")},{name:"sms_text",fieldLabel:"SMS "+t("Text"),xtype:"textarea",height:100,anchor:"100%",allowBlank:true,hidden:true,maxLength:159},{xtype:"filefield",emptyText:"Select an audio file",fieldLabel:t("Audio file"),name:"audio_path",buttonText:"",buttonConfig:{iconCls:"upload-icon"},buttonText:t("Select Audio..."),allowBlank:true,hidden:true},{xtype:"filefield",emptyText:"Select an csv file",fieldLabel:t("CSV file"),name:"csv_path",allowBlank:true,hidden:true},{name:"numbers",fieldLabel:t("numbers"),xtype:"textarea",height:100,anchor:"100%",allowBlank:true,hidden:true},{xtype:"datefield",name:"startingdate",fieldLabel:t("Date"),format:"Y-m-d",value:new Date(),allowBlank:true,hidden:true},{xtype:"timefield",name:"startingtime",fieldLabel:t("Hour"),format:"H:i",value:"00:00",allowBlank:true,hidden:true}],bbar:[{width:"150px",text:t("Send"),tooltip:t("Send"),glyph:icons.disk,handler:"onSendCampaign"}]}];Ext.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignsendmodule"],["component","box","container","panel","form","campaignsendmodule"],{component:true,box:true,container:true,panel:true,form:true,campaignsendmodule:true},["widget.campaignsendmodule"],0,[MBilling.view.campaignSend,"Module"],0));(Ext.cmd.derive("MBilling.view.callShop.Controller",Ext.ux.app.ViewController,{sendActionNew:function(d){var c=this;d.disable();id=d.reference.split("_");getForm=c.lookupReference("cabina"+id[1]).getForm();Ext.Ajax.request({url:d.urlAction+"?id="+getForm.findField("id").getValue(),success:function(a){a=Ext.decode(a.responseText);if(a.success){Ext.ux.Alert.alert(c.titleSuccess,a[c.nameMsgRequest],"success")}else{Ext.ux.Alert.alert(c.titleError,errors,"error")}}});d.enable();storeCallShop=Ext.create("MBilling.store.CallShop",{remoteSort:false});storeCallShop.load({callback:function(a){c.onShowCabins(a,id[1],getForm)}})},onShowCabins:function(e,f,d){me=this;row=e[f-1];if(tab=me.lookupReference("tab"+f)){name=row.data.callerid.length<1?row.data.name:row.data.callerid;status=Helper.Util.formatBooleanFree(row.data.status);tab.setTitle(t("Cabina")+" "+f+" - "+name+" "+status);tab.setVisible(true);d.loadRecord(row)}},reportCallshopClientNew:function(d){var c=this;id=d.reference.split("_");getForm=c.lookupReference("cabina"+id[1]).getForm();columns=Ext.encode([{header:t("Number"),dataIndex:"calledstation"},{header:t("Time"),dataIndex:"sessiontime"},{header:t("Total"),dataIndex:"price"}]);filter=Ext.encode([{type:"string",comparison:"eq",value:getForm.findField("name").getValue(),field:"cabina"},{type:"list",value:[0],field:"status"}]);values="columns="+columns+"&filter="+filter+"&sort=[]&group=&orientation=P";url="index.php/callShopCdr/report/?"+values;window.open(url)},sendAction:function(f){var j=this,e=j.list.getSelectionModel().getSelection()[0],g=Ext.encode([{type:"string",comparison:"eq",value:e.get("name"),field:"cabina"},{type:"list",value:[0],field:"status"}]);j.formPanel.setLoading(true);Ext.Ajax.request({url:f.urlAction,params:{filter:g},success:function(b){b=Ext.decode(b.responseText);var a=Helper.Util.convertErrorsJsonToString(b[j.nameMsgRequest]),d=j.list.getStore(),c=j.list.getSelectionModel();if(b.success){j.onEdit();d.load({callback:function(){c.select(d.findExact("id",e.get("id")));j.formPanel.setLoading(false)}});Ext.ux.Alert.alert(j.titleSuccess,b[j.nameMsgRequest],"success")}else{Ext.ux.Alert.alert(j.titleError,a,"error");j.formPanel.setLoading(false);c.select(d.findExact("id",e.get("id")))}}})},onEdit:function(){if(!this.list.getSelectionModel().getSelection().length){return}var q=this,r=q.list.getSelectionModel().getSelection()[0],n=[{type:"string",comparison:"eq",value:r.get("name"),field:"cabina"},{type:"list",value:[0],field:"status"}],u=q.formPanel.down("callshopcdrlist").getStore(),v=q.formPanel.down("#priceSum"),m=u.proxy.extraParams.filter,p=q.formPanel.down("#charge"),s=q.formPanel.down("#release"),o=q.formPanel.down("#print");v.setText(" "+t("pricesum")+" 0.00");q.formPanel.expand();p.enable();s.enable();o.enable();u.proxy.extraParams.filter=n;u.load({callback:function(a){if(a){a[0]&&v.setText(" "+t("pricesum")+" "+t("moedasimblo")+" "+a[0].get("priceSum")+" ")}}});console.log(r.get("callerid")+", "+r.get("name"));u.defaultFilter=m;q.showHideFields();q.focusFirstField()},reportCallshopClient:function(E){var w=this,s=window.isDesktop&&App.desktop,y=!window.isDesktop&&w.list.module.ownerCt,v=w.formPanel.down("callshopcdrlist").getStore(),x=v.sorters.items,A=w.list.getSelectionModel().getSelection()[0],F=Ext.encode([{type:"string",comparison:"eq",value:A.get("name"),field:"cabina"},{type:"list",value:[0],field:"status"}]),u=w.store.getGroupField(),B=w.formPanel.down("callshopcdrlist").columns,G="desc",D=w.formPanel.down("callshopcdrlist").getStore().getProxy().api.report,H,z=[],C=[];Ext.each(x,function(a){z.push(a.property+" "+(a.direction||"ASC"))});Ext.each(B,function(a){if(a.hidden===false&&a.isCheckerHd!==true){if(a.dataIndex===u){C.splice(0,0,{header:a.text,dataIndex:a.dataIndex})}else{C.push({header:a.text,dataIndex:a.dataIndex})}}});values="columns="+Ext.encode(C)+"&filter="+F+"&sort="+Ext.encode(z)+"&group="+u+"&orientation="+G;url="index.php/callShopCdr/report/?"+values;window.open(url)}},0,0,0,0,["controller.callshop"],0,[MBilling.view.callShop,"Controller"],0));(Ext.cmd.derive("MBilling.view.callShop.Module",Ext.ux.panel.Module,{controller:"callshop",cfgEast:{flex:4},collapsedForm:false,collapsibleForm:false},0,["callshopmodule"],["component","box","container","uxpanelmodule","callshopmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callshopmodule:true},["widget.callshopmodule"],0,[MBilling.view.callShop,"Module"],0));(Ext.cmd.derive("MBilling.view.callShop.Module2",Ext.form.Panel,{controller:"callshop",resizable:false,autoShow:true,header:false,autoScroll:true,initComponent:function(){var b=this;b.layout={type:"table",columns:3,tdAttrs:{style:"padding: 3px; vertical-align: top;"}};b.defaults={xtype:"panel",height:268,width:((Ext.Element.getViewportWidth()-200)/3)-10,closable:false,collapsible:true,frame:true};b.items=b.onMountPanels();storeCallShop=Ext.create("MBilling.store.CallShop",{remoteSort:false});if(!App.user.isClient){Ext.form.Panel.prototype.initComponent.apply(this,arguments);return}else{b.handler=setInterval(function(){storeCallShop.load({callback:function(a){b.onShowCabins(a)}})},5000);Ext.form.Panel.prototype.initComponent.apply(this,arguments);storeCallShop.load({callback:function(a){b.onShowCabins(a)}})}},onMountPanels:function(){me=this,items=[];if(!App.user.isClient){return}for(i=1;i<=12;i++){items.push({xtype:"tabpanel",reference:"tab"+i,title:t("Cabina")+i,collapsed:i>3,items:[{reference:"cabina"+i,title:t("Cabina"),xtype:"form",bodyPadding:10,defaults:{xtype:"displayfield",labelWidth:85},items:[{name:"id",hidden:true},{name:"name",hidden:true},{xtype:"fieldcontainer",layout:"hbox",items:[{xtype:"displayfield",fieldLabel:t("Number"),name:"callshopnumber",labelAlign:"right",labelWidth:50,renderer:function(b){return''+b+""},flex:2},{labelAlign:"right",labelWidth:90,xtype:"displayfield",readOnly:true,fieldLabel:t("total"),name:"total",labelStyle:"font-size:18px!important;font-weight:bold;",renderer:function(b){format=Ext.util.Format.numberRenderer("0."+App.user.decimalPrecision);return''+App.user.currency+" "+format(b)+""},flex:3}]},{fieldLabel:t("Destination"),name:"destination"},{fieldLabel:t("Price minute"),name:"price_min",renderer:Helper.Util.formatMoneyDecimal},{fieldLabel:t("Duration"),name:"callshoptime",renderer:Helper.Util.formatsecondsToTime},{border:false,xtype:"toolbar",hidden:me.hideBbar,dock:"bottom",items:[{bodyPadding:10,width:"33%",text:t("Charge"),itemId:"charge",iconCls:"buycredit",handler:"sendActionNew",reference:"cobrar_"+i,urlAction:"index.php/callShop/cobrar"},{width:"33%",text:t("Release"),itemId:"release",iconCls:"release",handler:"sendActionNew",reference:"liberar_"+i,urlAction:"index.php/callShop/liberar",hidden:window.releaseButton},{width:"33%",text:t("Print"),itemId:"print",iconCls:"icon-print",handler:"reportCallshopClientNew",reference:"report_"+i,urlAction:"index.php/callShop/report"}]}]},{reference:"history_"+i,tooltip:"history_"+i,iconCls:"x-fa fa-refresh",title:t("History"),autoScroll:true,items:[{xtype:"callshopcdrlist",buttonCsv:false,autoScroll:true,filterableColumns:false,buttonCleanFilter:false,autoLoadStore:false,border:false,allowCreate:false,allowUpdate:false,allowDelete:false,buttonUpdateLot:false,pagination:false,allowPrint:false,columnsHide:["cabina","destination","status","buycost","markup","date"],store:Ext.create("MBilling.store.CallShopCdr",{remoteFilter:true})}],tabConfig:{listeners:{click:function(b){id=b.tooltip.split("_");panel=me.lookupReference("history_"+id[1]);storeCallshopcdr=panel.down("callshopcdrlist").getStore();filterCabina=[{type:"string",comparison:"eq",value:me.lookupReference("cabina"+id[1]).getForm().findField("name").getValue(),field:"cabina"},{type:"list",value:[0],field:"status"}];storeCallshopcdr.load({filter:filterCabina,params:{filters:Ext.encode(filterCabina)},limit:70})}}}}]})}return items},onShowCabins:function(b){me=this,i=1;Ext.each(b,function(a){if(tab=me.lookupReference("tab"+i)){name=a.data.callerid.length<1?a.data.name:a.data.callerid;status=Helper.Util.formatBooleanFree(a.data.status);tab.setTitle(t("Cabina")+" "+i+" - "+name+" "+status);tab.setVisible(true);me.lookupReference("cabina"+i).getForm().loadRecord(a)}i++});for(i=b.length+1;i<=12;i++){tab=me.lookupReference("tab"+i).setVisible(false)}}},0,["callshop2module"],["component","box","container","panel","form","callshop2module"],{component:true,box:true,container:true,panel:true,form:true,callshop2module:true},["widget.callshop2module"],0,[MBilling.view.callShop,"Module2"],0));(Ext.cmd.derive("MBilling.view.callShop.List",Ext.ux.grid.Panel,{store:"CallShop",viewConfig:{loadMask:false,emptyText:'
'+t("No record found")+"
",getRowClass:function(b){if(App.user.l=="callshop"){if(b.get("status")==1){return"callshoFree"}else{if(b.get("status")==0){return"callshoBlock"}else{if(b.get("status")==2){return"callshoInUse"}else{if(b.get("status")==3){return"callshoInCall"}}}}}}},refreshTime:4,initComponent:function(){var b=this;b.buttonCsv=false;b.buttonUpdateLot=false;b.allowCreate=true;b.allowUpdate=true;b.allowDelete=true;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.allowPrint=false;b.buttonDeleteWidth=140;b.refreshTime=(localStorage&&localStorage.getItem("callshopfresh"))||b.refreshTime;b.extraButtons=[{xtype:"numberfield",field:"jmlhBrg",fieldLabel:t("Refresh Time"),editable:false,minValue:3,labelWidth:90,width:150,selectOnFocus:true,allowDecimals:true,decimalPrecision:2,value:b.refreshTime,listeners:{change:function(a){if(a.value>0){b.refreshTime=a.value;localStorage.setItem("callshopfresh",a.value)}}}}];b.columns=[{header:t("cabina"),dataIndex:"callerid",flex:4},{header:t("status"),dataIndex:"status",renderer:Helper.Util.formatBooleanFree,flex:3,filter:{type:"list",options:[[1,t("free")],[2,t("inuse")],[0,t("blocked")],[3,t("calling")]]}},{header:t("number"),dataIndex:"callshopnumber",flex:4},{header:t("Destino"),dataIndex:"callshopdestination",hidden:App.user.l!="callshop",flex:6},{header:t("sessiontime"),dataIndex:"callshoptime",renderer:Helper.Util.formatsecondsToTime,flex:3}];b.sessionLoad=Ext.create("Ext.util.DelayedTask",function(){b.store.load()},b);Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments);b.store.on("load",b.onLoadStore,b)},onLoadStore:function(){var b=this;b.onDeactivateModule();b.onActivateModule()},onRender:function(){var b=this;b.module.on("activate",b.onActivateModule,b);b.module.on("deactivate",b.onDeactivateModule,b);b.module.on("close",b.onCloseModule,b);Ext.ux.grid.Panel.prototype.onRender.apply(this,arguments)},onActivateModule:function(){this.sessionLoad&&this.sessionLoad.delay(this.refreshTime*1000)},onDeactivateModule:function(){this.sessionLoad&&this.sessionLoad.cancel()},onCloseModule:function(){this.onDeactivateModule();this.sessionLoad=null}},0,["callshoplist"],["component","box","container","panel","tablepanel","gridpanel","grid","callshoplist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callshoplist:true},["widget.callshoplist"],0,[MBilling.view.callShop,"List"],0));(Ext.cmd.derive("MBilling.view.callShop.Form",Ext.ux.form.Panel,{hideTbar:true,labelWidthFields:"60%",bodyPadding:1,layout:"fit",buttonsTbar:[{xtype:"tbtext",itemId:"priceSum"},"->",{text:"Cobrar",itemId:"charge",iconCls:"buycredit",urlAction:"index.php/callShop/cobrar",disabled:true,handler:"sendAction",width:100},{text:"Liberar",itemId:"release",iconCls:"release",urlAction:"index.php/callShop/liberar",disabled:true,handler:"sendAction",width:100},{text:t("Print"),itemId:"print",glyph:icons.print,urlAction:"index.php/callShop/report",disabled:true,handler:"reportCallshopClient",width:100}],initComponent:function(){var b=this;b.items=[{xtype:"callshopcdrlist",buttonCsv:false,filterableColumns:false,buttonCleanFilter:false,autoLoadStore:false,border:true,allowCreate:false,allowUpdate:false,allowDelete:false,buttonUpdateLot:false,pagination:false,allowPrint:false,columnsHide:["status","buycost","markup"],store:Ext.create("MBilling.store.CallShopCdr",{remoteSort:false})}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callshopform"],["component","box","container","panel","form","callshopform"],{component:true,box:true,container:true,panel:true,form:true,callshopform:true},["widget.callshopform"],0,[MBilling.view.callShop,"Form"],0));(Ext.cmd.derive("MBilling.view.callShopCdr.Controller",Ext.ux.app.ViewController,{formHidden:true},0,0,0,0,["controller.callshopcdr"],0,[MBilling.view.callShopCdr,"Controller"],0));(Ext.cmd.derive("MBilling.view.callShopCdr.Module",Ext.ux.panel.Module,{controller:"callshopcdr"},0,["callshopcdrmodule"],["component","box","container","uxpanelmodule","callshopcdrmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callshopcdrmodule:true},["widget.callshopcdrmodule"],0,[MBilling.view.callShopCdr,"Module"],0));(Ext.cmd.derive("MBilling.view.callShopCdr.List",Ext.ux.grid.Panel,{store:"CallShopCdr",initComponent:function(){var b=this;b.buttonCsv=false;b.buttonUpdateLot=false;b.allowUpdate=true;b.allowDelete=false;b.allowCreate=false;b.allowUpdate=false;b.allowPrint=false;b.columns=[{header:t("cabina"),dataIndex:"cabina",filter:{type:"string"},flex:2},{header:t("number"),dataIndex:"calledstation",filter:{type:"string"},flex:3},{dataIndex:"destination",header:t("destination"),flex:3},{header:"Pago",dataIndex:"status",renderer:Helper.Util.formattyyesno,flex:2,filter:{type:"list",options:[[0,t("no")],[1,t("yes")]]}},{header:t("buyrate"),dataIndex:"buycost",renderer:Helper.Util.formatMoneyDecimal,flex:2},{header:t("rateinitial"),dataIndex:"price",renderer:Helper.Util.formatMoneyDecimal,flex:2},{header:t("markup"),dataIndex:"markup",renderer:Ext.util.Format.numberRenderer("0.00 %"),flex:2},{header:t("sessiontime"),dataIndex:"sessiontime",renderer:Helper.Util.formatsecondsToTime,flex:2},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"date",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callshopcdrlist"],["component","box","container","panel","tablepanel","gridpanel","grid","callshopcdrlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callshopcdrlist:true},["widget.callshopcdrlist"],0,[MBilling.view.callShopCdr,"List"],0));(Ext.cmd.derive("MBilling.view.callShopCdr.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:App.user.isClient}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callshopcdrform"],["component","box","container","panel","form","callshopcdrform"],{component:true,box:true,container:true,panel:true,form:true,callshopcdrform:true},["widget.callshopcdrform"],0,[MBilling.view.callShopCdr,"Form"],0));(Ext.cmd.derive("MBilling.view.rateCallshop.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.ratecallshop"],0,[MBilling.view.rateCallshop,"Controller"],0));(Ext.cmd.derive("MBilling.view.rateCallshop.Module",Ext.ux.panel.Module,{controller:"ratecallshop"},0,["ratecallshopmodule"],["component","box","container","uxpanelmodule","ratecallshopmodule"],{component:true,box:true,container:true,uxpanelmodule:true,ratecallshopmodule:true},["widget.ratecallshopmodule"],0,[MBilling.view.rateCallshop,"Module"],0));(Ext.cmd.derive("MBilling.view.rateCallshop.List",Ext.ux.grid.Panel,{store:"RateCallshop",buttonImportCsv:true,initComponent:function(){var b=this;b.buttonImportCsv=App.user.isClient,b.buttonCsv=App.user.isClient;b.allowPrint=App.user.isClient;b.buttonUpdateLot=App.user.isClient;b.allowCreate=App.user.isClient;b.allowUpdate=App.user.isClient;b.allowDelete=App.user.isClient;b.buttonUpdateLotCallShopRate=App.user.isClient;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("dialprefix"),dataIndex:"dialprefix",filter:{type:"string"},flex:2},{header:t("destination"),dataIndex:"destination",flex:3},{header:t("rateinitial"),dataIndex:"buyrate",renderer:Helper.Util.formatMoneyDecimal4,flex:2},{header:t("buyrateinitblock"),dataIndex:"minimo",flex:2},{header:t("buyrateincrement"),dataIndex:"block",flex:2}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["ratecallshoplist"],["component","box","container","panel","tablepanel","gridpanel","grid","ratecallshoplist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,ratecallshoplist:true},["widget.ratecallshoplist"],0,[MBilling.view.rateCallshop,"List"],0));(Ext.cmd.derive("MBilling.view.rateCallshop.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{xtype:"numberfield",name:"dialprefix",fieldLabel:t("prefix")},{name:"destination",fieldLabel:t("destination")},{xtype:"moneyfield",name:"buyrate",fieldLabel:t("rateinitial")},{xtype:"numberfield",name:"minimo",value:1,minValue:1,fieldLabel:t("buyrateinitblock")},{xtype:"numberfield",name:"block",value:1,minValue:1,fieldLabel:t("buyrateincrement")},{xtype:"numberfield",name:"minimal_time_charge",value:0,minValue:0,fieldLabel:t("Minimal time to charge")}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["ratecallshopform"],["component","box","container","panel","form","ratecallshopform"],{component:true,box:true,container:true,panel:true,form:true,ratecallshopform:true},["widget.ratecallshopform"],0,[MBilling.view.rateCallshop,"Form"],0));(Ext.cmd.derive("MBilling.view.rateCallshop.ImportCsv",Ext.ux.window.ImportCsv,{htmlTipInfo:"
"+t("dialprefix")+", "+t("destination")+", "+t("rateinitial")+"
5511, Brasil SP, 0.080
34, Spain Fix, 0.056
54, Argentina, 0.025

"+t("rateinitial")+" "+t("and")+" "+t("buyrate")+""},0,["ratecallshopimportcsv"],["component","box","container","panel","window","ratecallshopimportcsv"],{component:true,box:true,container:true,panel:true,window:true,ratecallshopimportcsv:true},["widget.ratecallshopimportcsv"],0,[MBilling.view.rateCallshop,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.callSummaryCallShop.Controller",MBilling.view.callSummaryPerDay.Controller,{aliasChart:"callsummarycallshopchart"},0,0,0,0,["controller.callsummarycallshop"],0,[MBilling.view.callSummaryCallShop,"Controller"],0));(Ext.cmd.derive("MBilling.view.callSummaryCallShop.Module",Ext.ux.panel.Module,{controller:"callsummarycallshop",titleForm:t("total"),iconForm:"icon-sum",widthForm:250},0,["callsummarycallshopmodule"],["component","box","container","uxpanelmodule","callsummarycallshopmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callsummarycallshopmodule:true},["widget.callsummarycallshopmodule"],0,[MBilling.view.callSummaryCallShop,"Module"],0));(Ext.cmd.derive("MBilling.view.callSummaryCallShop.List",Ext.ux.grid.Panel,{store:"CallSummaryCallShop",initComponent:function(){var b=this;b.buttonImportCsv=false;b.buttonCsv=false;b.allowPrint=false;b.buttonUpdateLot=false;b.allowCreate=false;b.buttonCleanFilter=false;b.allowUpdate=false;b.allowDelete=false;b.extraButtons=[{text:t("charts"),iconCls:"icon-chart-column",handler:"onChart",reference:"chart",disabled:false,hidden:App.user.isClient}];b.collapsedExtraFilters=false;b.titleAddFilter=t("Filter");b.extraFilters=[{field:"t.cabina",label:t("cabina"),type:"string"},{field:"t.calledstation",label:t("prefix"),type:"string"}];b.columns=[{header:t("day"),renderer:Ext.util.Format.dateRenderer("Y-m-d"),dataIndex:"day",filter:{type:"date",field:"date"},flex:3},{menuDisabled:true,header:t("sessiontime")+" "+t("Min"),dataIndex:"sessiontime",flex:2},{menuDisabled:true,header:t("aloc_all_calls"),dataIndex:"aloc_all_calls",renderer:Helper.Util.formatsecondsToTime,flex:3},{menuDisabled:true,header:t("nbcall"),dataIndex:"nbcall",flex:3},{menuDisabled:true,header:t("buycost"),dataIndex:"buycost",renderer:Helper.Util.formatMoneyDecimal,flex:3,hideable:false,hidden:!App.user.isClient},{menuDisabled:true,header:t("sessionbill"),dataIndex:"price",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:!App.user.isClient},{menuDisabled:true,header:t("markup"),dataIndex:"lucro",renderer:Helper.Util.formatMoneyDecimal,flex:3,hideable:false,hidden:!App.user.isClient}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarycallshoplist"],["component","box","container","panel","tablepanel","gridpanel","grid","callsummarycallshoplist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callsummarycallshoplist:true},["widget.callsummarycallshoplist"],0,[MBilling.view.callSummaryCallShop,"List"],0));(Ext.cmd.derive("MBilling.view.callSummaryCallShop.Form",Ext.ux.form.Panel,{defaults:{},labelWidthFields:150,defaultType:"displayfield",initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{name:"sumsessiontime",fieldLabel:t("sessiontime")+" "+t("Min")},{name:"sumprice",fieldLabel:t("sessionbill"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isClient},{name:"sumlucro",fieldLabel:t("markup"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isClient},{name:"sumbuycost",fieldLabel:t("buycost"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isClient},{name:"sumnbcall",fieldLabel:t("nbcall"),hidden:!App.user.isClient}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarycallshopform"],["component","box","container","panel","form","callsummarycallshopform"],{component:true,box:true,container:true,panel:true,form:true,callsummarycallshopform:true},["widget.callsummarycallshopform"],0,[MBilling.view.callSummaryCallShop,"Form"],0));(Ext.cmd.derive("MBilling.view.callSummaryCallShop.Chart",Ext.ux.panel.Chart,{controller:"callsummarycallshop",store:"CallSummaryCallShop",fieldValue:"sessiontime",fieldDescription:"day",labelYLine:t("sessiontime")+" Min",labelXLine:t("day"),initComponent:function(){var d=this,c;d.rendererFieldValue=Ext.util.Format.numberRenderer("0"),d.rendererFieldDescription=Ext.util.Format.dateRenderer("Y-m-d");d.tbarChart=[{xtype:"buttongroup",toggleGroup:"charts",defaults:{enableToggle:true,toggleGroup:"charts",allowDepress:false,listeners:{toggle:"onToggleGroupButton"}},items:[{pressed:true,text:t("sessiontime"),chart:"sessiontime",sumName:"sumsessiontime"},{text:t("buycost"),sumRenderer:Helper.Util.formatMoneyDecimal,chart:"buycost",sumName:"sumbuycost"},{text:t("sessionbill"),sumRenderer:Helper.Util.formatMoneyDecimal,chart:"price",sumName:"sumprice"},{text:t("markup"),sumRenderer:Helper.Util.formatMoneyDecimal,chart:"lucro",sumName:"sumlucro",hidden:App.user.isClient||App.user.isAgent},{text:t("nbcall"),chart:"nbcall",sumName:"sumnbcall"}]}];d.bbarChart=[{xtype:"tbtext",itemId:"tbTextSum"}];Ext.ux.panel.Chart.prototype.initComponent.apply(this,arguments)}},0,["callsummarycallshopchart"],["component","box","container","panel","chartpanel","callsummarycallshopchart"],{component:true,box:true,container:true,panel:true,chartpanel:true,callsummarycallshopchart:true},["widget.callsummarycallshopchart"],0,[MBilling.view.callSummaryCallShop,"Chart"],0));(Ext.cmd.derive("MBilling.view.buycredit.Controller",Ext.ux.app.ViewController,{buyCreditClose:function(e){var j=this,g=j.lookupReference("buycreditPanel"),f=j.lookupReference("btnCancel");g.getForm().findField("amount")["show"]();g.getForm().findField("method")["show"]();g.getForm().findField("card_num")["hide"]();g.getForm().findField("exp_date")["hide"]();g.getForm().findField("method").setValue("");f.setVisible(false)},buyCredit:function(r){var o=this,n=o.lookupReference("buycreditPanel"),s=o.lookupReference("btnCancel"),p=n.getForm().findField("amount").getValue(),l=n.getForm().findField("method").getValue(),m=n.getForm().findField("card_num").getValue(),q=n.getForm().findField("exp_date").rawValue;if(n.getForm().findField("method").rawValue.match(/uthorize/)){if(m){n.setLoading(o.msgWait);Ext.Ajax.request({url:"index.php/buyCredit/method/?amount="+p+"&id_method="+l+"&cc="+m+"&ed="+q,scope:o,success:function(a){a=Ext.decode(a.responseText);if(a.success){Ext.ux.Alert.alert(t("Success"),a.msg,"success",10000);n.setLoading(false);n.getForm().findField("amount")["show"]();n.getForm().findField("method")["show"]();n.getForm().findField("card_num")["hide"]();n.getForm().findField("exp_date")["hide"]();s.setVisible(false);n.getForm().findField("card_num").setValue("");n.getForm().findField("exp_date").setValue("");n.getForm().findField("method").setValue("")}else{Ext.ux.Alert.alert(t("Error"),a.msg,"error");n.getForm().findField("card_num").setValue("");n.getForm().findField("exp_date").setValue("");n.setLoading(false)}}});return}else{n.getForm().findField("amount")["hide"]();n.getForm().findField("method")["hide"]();n.getForm().findField("card_num")["show"]();n.getForm().findField("exp_date")["show"]();s.setVisible(true);n.getForm().findField("card_num").focus()}}else{if(!l){Ext.ux.Alert.alert(o.titleWarning,t("Select a ")+t("paymentmethods"),"warning");return}else{if(p<=0){Ext.ux.Alert.alert(o.titleWarning,t("Select a ")+t("valid")+" "+t("amount"),"warning");return}else{url="index.php/buyCredit/method/?amount="+p+"&id_method="+l;n.getForm().findField("method").setValue("");n.getForm().findField("card_num").setValue("");n.getForm().findField("exp_date").setValue("");if(n.getForm().findField("method").rawValue.match(/PlacetoPay/)){window.open(url,"_self")}else{window.open(url,"_blank")}}}}}},0,0,0,0,["controller.buycredit"],0,[MBilling.view.buycredit,"Controller"],0));(Ext.cmd.derive("MBilling.view.buycredit.Module",Ext.form.Panel,{controller:"buycredit",resizable:false,autoShow:true,header:false,initComponent:function(){var b=this;b.items=[{reference:"buycreditPanel",xtype:"form",margin:"10 10 10 10",autoShow:true,closable:false,resizable:false,bodyPadding:10,defaultType:"textfield",defaults:{labelAlign:"right",labelWidth:150,width:280,allowBlank:false,msgTarget:"side",enableKeyEvents:true,plugins:"markallowblank",anchor:"100%"},items:[{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,00",fieldLabel:t("Amounts"),value:0,name:"amount"},{xtype:"methodpaycombo",fieldLabel:t("paymentmethods"),name:"method"},{fieldLabel:t("CreditCard Number"),name:"card_num",hidden:true},{xtype:"datefield",fieldLabel:t("Expiration Date"),name:"exp_date",format:"m/y",hidden:true}],bbar:[{text:t("Cancel"),tooltip:t("Cancel"),glyph:b.glyphCancel,handler:"buyCreditClose",hidden:true,reference:"btnCancel"},{text:t("Next"),tooltip:t("Next"),width:100,glyph:icons.disk,handler:"buyCredit"}]}];Ext.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["buycreditmodule"],["component","box","container","panel","form","buycreditmodule"],{component:true,box:true,container:true,panel:true,form:true,buycreditmodule:true},["widget.buycreditmodule"],0,[MBilling.view.buycredit,"Module"],0));(Ext.cmd.derive("MBilling.view.transferToMobile.Module",Ext.form.Panel,{resizable:false,autoShow:true,header:false,items:[{xtype:"component",autoEl:{width:"100%",height:"100%",tag:"iframe",src:"index.php/transferToMobile/read"}}]},0,["transfertomobilemodule"],["component","box","container","panel","form","transfertomobilemodule"],{component:true,box:true,container:true,panel:true,form:true,transfertomobilemodule:true},["widget.transfertomobilemodule"],0,[MBilling.view.transferToMobile,"Module"],0));(Ext.cmd.derive("MBilling.view.firewall.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.firewall"],0,[MBilling.view.firewall,"Controller"],0));(Ext.cmd.derive("MBilling.view.firewall.Module",Ext.ux.panel.Module,{controller:"firewall"},0,["firewallmodule"],["component","box","container","uxpanelmodule","firewallmodule"],{component:true,box:true,container:true,uxpanelmodule:true,firewallmodule:true},["widget.firewallmodule"],0,[MBilling.view.firewall,"Module"],0));(Ext.cmd.derive("MBilling.view.firewall.List",Ext.ux.grid.Panel,{store:"Firewall",initComponent:function(){var b=this;b.textDelete="Unban";b.textNew="Ban new Ip";b.buttonCsv=false;b.buttonUpdateLot=false;b.buttonCleanFilter=true;b.allowPrint=false;b.allowCreate=true;b.allowDelete=true;b.columns=[{header:t("Ip"),dataIndex:"ip",flex:4},{header:t("Type"),dataIndex:"jail",flex:4},{header:t("Permanently")+" "+t("Ban"),dataIndex:"action",renderer:Helper.Util.formattyyesno,filter:{type:"list",options:[[0,t("no")],[1,t("yes")]]},flex:2}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["firewalllist"],["component","box","container","panel","tablepanel","gridpanel","grid","firewalllist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,firewalllist:true},["widget.firewalllist"],0,[MBilling.view.firewall,"List"],0));(Ext.cmd.derive("MBilling.view.firewall.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{name:"ip",fieldLabel:t("Ip"),vtype:"IPAddress"},{xtype:"yesnocombo",fieldLabel:t("Permanently")+" "+t("Ban"),name:"action"},{xtype:"textarea",name:"description",fieldLabel:t("description"),allowBlank:true,height:300,anchor:"100%",readOnly:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["firewallform"],["component","box","container","panel","form","firewallform"],{component:true,box:true,container:true,panel:true,form:true,firewallform:true},["widget.firewallform"],0,[MBilling.view.firewall,"Form"],0));(Ext.cmd.derive("MBilling.view.userRate.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.userrate"],0,[MBilling.view.userRate,"Controller"],0));(Ext.cmd.derive("MBilling.view.userRate.Module",Ext.ux.panel.Module,{controller:"userrate"},0,["userratemodule"],["component","box","container","uxpanelmodule","userratemodule"],{component:true,box:true,container:true,uxpanelmodule:true,userratemodule:true},["widget.userratemodule"],0,[MBilling.view.userRate,"Module"],0));(Ext.cmd.derive("MBilling.view.userRate.List",Ext.ux.grid.Panel,{store:"UserRate",initComponent:function(){var b=this;b.buttonCsv=false;b.allowPrint=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("prefix"),dataIndex:"idPrefixprefix",flex:window.isTablet?2:3},{dataIndex:"idPrefixdestination",header:t("destination"),flex:window.isTablet?2:3},{header:t("rateinitial"),dataIndex:"rateinitial",renderer:Helper.Util.formatMoneyDecimal,flex:2},{header:t("initblock"),dataIndex:"initblock",flex:2},{header:t("billingblock"),dataIndex:"billingblock",flex:2}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["userratelist"],["component","box","container","panel","tablepanel","gridpanel","grid","userratelist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,userratelist:true},["widget.userratelist"],0,[MBilling.view.userRate,"List"],0));(Ext.cmd.derive("MBilling.view.userRate.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{fieldLabel:t("User"),name:"id_user",xtype:!App.user.isAdmin?"textfield":"userlookup",ownerForm:b,hidden:!App.user.isAdmin,allowBlank:!App.user.isAdmin},{fieldLabel:t("Destination"),name:"id_prefix",xtype:"prefixlookup",ownerForm:b,hidden:!App.user.isAdmin,allowBlank:!App.user.isAdmin},{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,"+App.user.decimalPrecision,name:"rateinitial",fieldLabel:t("rateinitial"),readOnly:App.user.isClient},{xtype:"numberfield",name:"initblock",fieldLabel:t("initblock"),hidden:App.user.isClient},{xtype:"numberfield",name:"billingblock",fieldLabel:t("billingblock"),hidden:App.user.isClient}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["userrateform"],["component","box","container","panel","form","userrateform"],{component:true,box:true,container:true,panel:true,form:true,userrateform:true},["widget.userrateform"],0,[MBilling.view.userRate,"Form"],0));(Ext.cmd.derive("MBilling.view.extra.Module",Ext.form.Panel,{resizable:false,autoShow:true,header:false,items:[{xtype:"component",autoEl:{width:"100%",height:"100%",tag:"iframe",src:window.moduleExtra}}]},0,["extramodule"],["component","box","container","panel","form","extramodule"],{component:true,box:true,container:true,panel:true,form:true,extramodule:true},["widget.extramodule"],0,[MBilling.view.extra,"Module"],0));(Ext.cmd.derive("MBilling.view.callOnlineChart.Module",Ext.ux.panel.Module,{},0,["callOnlineChartmodule"],["component","box","container","uxpanelmodule","callOnlineChartmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callOnlineChartmodule:true},["widget.callOnlineChartmodule"],0,[MBilling.view.callOnlineChart,"Module"],0));(Ext.cmd.derive("MBilling.view.callOnlineChart.List",Ext.ux.grid.Panel,{store:"CallOnlineChart",initComponent:function(){var b=this;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("Total"),dataIndex:"total",flex:1},{header:t("date"),dataIndex:"date",renderer:Ext.util.Format.dateRenderer("Y-m-d H:i"),flex:1}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callonlinechartlist"],["component","box","container","panel","tablepanel","gridpanel","grid","callonlinechartlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callonlinechartlist:true},["widget.callonlinechartlist"],0,[MBilling.view.callOnlineChart,"List"],0));(Ext.cmd.derive("MBilling.view.callOnlineChart.Form",Ext.ux.form.Panel,{},0,["callOnlineChartform"],["component","box","container","panel","form","callOnlineChartform"],{component:true,box:true,container:true,panel:true,form:true,callOnlineChartform:true},["widget.callOnlineChartform"],0,[MBilling.view.callOnlineChart,"Form"],0));(Ext.cmd.derive("MBilling.view.callOnlineChart.Chart",Ext.ux.panel.Chart,{controller:"callsummaryperday",store:"CallOnlineChart",fieldValue:["total","answer"],fieldDescription:"date",labelYLine:t("total")+" / Min",labelXLine:t("Minute"),reference:"callonlinechartchart",defaultChart:"line",btnShowColumn:false,btnShowBar:false,btnShowLine:true,btnShowPie:false,animate:true,btnShowLineHidden:true,initComponent:function(){var b=this;b.rendererFieldValue=Ext.util.Format.numberRenderer("0");b.tbarChart=[{text:t("Per")+" "+t("Minute"),scope:b,handler:"onPerMinute",reference:"btnMinute",disabled:true},{text:t("Per")+" "+t("Hour"),scope:b,handler:"onPerhour",reference:"btnHour"}];b.legend={position:"right",boxStrokeWidth:0,labelFont:"12px Helvetica",renderer:b.rendererLegend};b.bbarChart=[{xtype:"tbtext",itemId:"tbTextSum"}];b.sessionLoad=Ext.create("Ext.util.DelayedTask",function(){b.store.load()},b);Ext.ux.panel.Chart.prototype.initComponent.apply(this,arguments);b.store.on("load",b.onLoadStore,b)},onPerMinute:function(d){var c=this;c.lookupReference("btnMinute").disable();c.lookupReference("btnHour").enable();c.store.setRemoteFilter(true);c.store.filter("type","minute");c.store.load()},onPerhour:function(d){var c=this;c.lookupReference("btnHour").disable();c.lookupReference("btnMinute").enable();c.store.setRemoteFilter(true);c.store.filter("type","hour");c.store.load()},onLoadStore:function(){this.onActivateModule()},onActivateModule:function(){this.sessionLoad&&this.sessionLoad.delay(25000)}},0,["callonlinechartchart"],["component","box","container","panel","chartpanel","callonlinechartchart"],{component:true,box:true,container:true,panel:true,chartpanel:true,callonlinechartchart:true},["widget.callonlinechartchart"],0,[MBilling.view.callOnlineChart,"Chart"],0));(Ext.cmd.derive("MBilling.view.smtps.Controller",Ext.ux.app.ViewController,{onSendEmail:function(e){var f=this,d=f.list.getSelectionModel().getSelection()[0];f.list.setLoading(true);if(f.list.getSelectionModel().getSelection().length==1){Ext.Ajax.request({url:"index.php/smtps/testMail",params:{id:d.get("id")},scope:f,success:function(a){a=Ext.decode(a.responseText);if(a[f.nameSuccessRequest]){Ext.ux.Alert.alert(f.titleSuccess,a[f.nameMsgRequest],"success")}else{Ext.ux.Alert.alert(f.titleError,a[f.nameMsgRequest],"error")}f.list.setLoading(false)}})}else{Ext.ux.Alert.alert(f.titleError,"Please Select a Smtp","notification");f.list.setLoading(false)}}},0,0,0,0,["controller.smtps"],0,[MBilling.view.smtps,"Controller"],0));(Ext.cmd.derive("MBilling.view.smtps.List",Ext.ux.grid.Panel,{store:"Smtps",initComponent:function(){var b=this;b.extraButtons=[{text:t("Test Smtp"),iconCls:"templatemail",handler:"onSendEmail",disabled:false}];b.buttonUpdateLot=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("Host"),dataIndex:"host",flex:4},{header:t("username"),dataIndex:"username",flex:2},{header:t("Port"),dataIndex:"port",flex:3},{header:t("Encryption"),dataIndex:"encryption",flex:3}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["smtpslist"],["component","box","container","panel","tablepanel","gridpanel","grid","smtpslist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,smtpslist:true},["widget.smtpslist"],0,[MBilling.view.smtps,"List"],0));(Ext.cmd.derive("MBilling.view.smtps.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{name:"host",fieldLabel:t("Host"),hidden:App.user.isClient},{name:"username",fieldLabel:t("username"),hidden:App.user.isClient},{inputType:"password",name:"password",fieldLabel:t("password"),hidden:App.user.isClient},{xtype:"numberfield",name:"port",fieldLabel:t("Port"),value:587,hidden:App.user.isClient},{xtype:"combobox",name:"encryption",fieldLabel:t("Encryption"),hidden:App.user.isClient,value:"null",store:[["ssl",t("SSl")],["tls",t("TLS")],["null",t("NULL")]]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["smtpsform"],["component","box","container","panel","form","smtpsform"],{component:true,box:true,container:true,panel:true,form:true,smtpsform:true},["widget.smtpsform"],0,[MBilling.view.smtps,"Form"],0));(Ext.cmd.derive("MBilling.view.smtps.Module",Ext.ux.panel.Module,{controller:"smtps"},0,["smtpsmodule"],["component","box","container","uxpanelmodule","smtpsmodule"],{component:true,box:true,container:true,uxpanelmodule:true,smtpsmodule:true},["widget.smtpsmodule"],0,[MBilling.view.smtps,"Module"],0));(Ext.cmd.derive("MBilling.view.servers.Controller",Ext.ux.app.ViewController,{init:function(){var b=this;b.control({combobox:{select:b.onSelectType}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectType:function(c,d){this.showFieldsRelated(d.getData().showFields)},showFieldsRelated:function(l){var m=this,g=m.formPanel.getForm().getFields(),j=m.formPanel.getForm().findField("weight"),f=m.formPanel.getForm();g.each(function(a){if(a.name=="type"){if(a.value=="asterisk"||a.value=="mbilling"){j.show()}else{j.hide()}}})},onEdit:function(){var d=this,f=d.formPanel.getForm().findField("weight"),e=d.formPanel.getForm().findField("type");Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments);if(e.value=="asterisk"||e.value=="mbilling"){f.show()}else{f.hide()}},onDelete:function(d){var f=this,e;notDelete=false;Ext.each(f.list.getSelectionModel().getSelection(),function(a){if(a.get("id")==1){Ext.ux.Alert.alert(f.titleError,t("You cannot delete the")+" server id 1","error");notDelete=true}});if(notDelete==false){Ext.ux.app.ViewController.prototype.onDelete.apply(this,arguments)}}},0,0,0,0,["controller.servers"],0,[MBilling.view.servers,"Controller"],0));(Ext.cmd.derive("MBilling.view.servers.List",Ext.ux.grid.Panel,{store:"Servers",initComponent:function(){var b=this;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("host"),dataIndex:"host",flex:4},{header:t("username"),dataIndex:"username",flex:4},{header:t("type"),dataIndex:"type",comboRelated:"booleancombo",flex:2},{header:t("status"),dataIndex:"status",renderer:Helper.Util.formatBooleanActive,comboRelated:"booleancombo",flex:2,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")]]}}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["serverslist"],["component","box","container","panel","tablepanel","gridpanel","grid","serverslist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,serverslist:true},["widget.serverslist"],0,[MBilling.view.servers,"List"],0));(Ext.cmd.derive("MBilling.view.servers.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["id_user"],initComponent:function(){var b=this;b.items=[{name:"host",fieldLabel:t("host")},{name:"username",fieldLabel:t("username"),allowBlank:true},{name:"password",fieldLabel:t("password"),allowBlank:true},{name:"port",fieldLabel:t("port"),allowBlank:true},{xtype:"combobox",name:"type",fieldLabel:t("type"),forceSelection:true,editable:false,value:"mbilling",store:[["mbilling",t("Mbilling")],["asterisk",t("Asterisk")],["sipproxy",t("SipProxy")]]},{fieldLabel:t("Weight"),name:"weight",hidden:true,allowBlank:true,emptyText:t("This is useful in order to get a different ratio of traffic between servers.")},{xtype:"booleancombo",name:"status",fieldLabel:t("status"),allowBlank:true},{xtype:"textareafield",name:"description",fieldLabel:t("description"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["serversform"],["component","box","container","panel","form","serversform"],{component:true,box:true,container:true,panel:true,form:true,serversform:true},["widget.serversform"],0,[MBilling.view.servers,"Form"],0));(Ext.cmd.derive("MBilling.view.servers.Module",Ext.ux.panel.Module,{controller:"servers"},0,["serversmodule"],["component","box","container","uxpanelmodule","serversmodule"],{component:true,box:true,container:true,uxpanelmodule:true,serversmodule:true},["widget.serversmodule"],0,[MBilling.view.servers,"Module"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerUser.Controller",Ext.ux.app.ViewController,{formHidden:true,onEdit:function(){me=this;me.sumData=me.store.getData().items[0].getData();if(!me.sumData){return}me.formPanel.getForm().getFields().each(function(b){b.setValue(me.sumData[b.name])});me.formPanel.expand()},onExportCsvUser:function(o,l,g){var m=this,j=m.list.getStore(),n=m.list.filters.getFilterData().length?Ext.encode(m.list.filters.getFilterData()):j.proxy.extraParams.filter;window.open("index.php/callSummaryPerUser/exportCsvCalls?id="+o.getStore().getAt(l).getData().idUserusername+"&filter="+n)}},0,0,0,0,["controller.callsummaryperuser"],0,[MBilling.view.callSummaryPerUser,"Controller"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerUser.List",Ext.ux.grid.Panel,{store:"CallSummaryPerUser",initComponent:function(){var b=this;b.buttonImportCsv=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{xtype:"actioncolumn",width:26,sortable:false,menuDisabled:true,header:t(""),dataIndex:"id",items:[{iconCls:"icon-export-csv",tooltip:t("Export CSV"),handler:"onExportCsvUser"}],hidden:!App.user.isAdmin},{header:t("Username"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:3},{header:t("sessiontime")+" "+t("Min"),dataIndex:"sessiontime",flex:2},{header:t("aloc_all_calls"),dataIndex:"aloc_all_calls",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Answered Calls"),dataIndex:"nbcall",flex:3},{header:t("Failed Calls"),dataIndex:"nbcall_fail",flex:3},{header:t("buycost"),dataIndex:App.user.isAdmin?"buycost":"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("sessionbill"),dataIndex:App.user.isAgent||App.user.isClientAgent?"agent_bill":"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("markup"),dataIndex:"lucro",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("ASR"),dataIndex:"asr",renderer:Helper.Util.formatPorcente,flex:3,hidden:!App.user.isAdmin,hideable:App.user.isAdmin}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummaryperuserlist"],["component","box","container","panel","tablepanel","gridpanel","grid","callsummaryperuserlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callsummaryperuserlist:true},["widget.callsummaryperuserlist"],0,[MBilling.view.callSummaryPerUser,"List"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerUser.Form",Ext.ux.form.Panel,{defaults:{},labelWidthFields:100,defaultType:"displayfield",initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{name:"sumsessiontime",fieldLabel:t("sessiontime")+" "+t("Min"),renderer:Ext.util.Format.numberRenderer("0"),allowBlank:true},{name:App.user.isAgent||App.user.isClientAgent?"sumagent_bill":"sumsessionbill",fieldLabel:t("sessionbill"),renderer:Helper.Util.formatMoneyDecimal,allowBlank:true},{name:App.user.isAdmin?"sumbuycost":"sumsessionbill",fieldLabel:t("buycost"),renderer:Helper.Util.formatMoneyDecimal,hidden:App.user.isClient,allowBlank:true},{name:"sumlucro",fieldLabel:t("markup"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumnbcall",fieldLabel:t("Answered Calls"),allowBlank:true},{name:"sumnbcallfail",fieldLabel:t("Failed Calls"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummaryperuserform"],["component","box","container","panel","form","callsummaryperuserform"],{component:true,box:true,container:true,panel:true,form:true,callsummaryperuserform:true},["widget.callsummaryperuserform"],0,[MBilling.view.callSummaryPerUser,"Form"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerUser.Module",Ext.ux.panel.Module,{controller:"callsummaryperuser",cfgEast:{flex:0.4}},0,["callsummaryperusermodule"],["component","box","container","uxpanelmodule","callsummaryperusermodule"],{component:true,box:true,container:true,uxpanelmodule:true,callsummaryperusermodule:true},["widget.callsummaryperusermodule"],0,[MBilling.view.callSummaryPerUser,"Module"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerTrunk.Controller",Ext.ux.app.ViewController,{formHidden:true,onEdit:function(){me=this;me.sumData=me.store.getData().items[0].getData();if(!me.sumData){return}me.formPanel.getForm().getFields().each(function(b){b.setValue(me.sumData[b.name])});me.formPanel.expand()},onExportCsvUser:function(o,l,g){var m=this,j=m.list.getStore(),n=m.list.filters.getFilterData().length?Ext.encode(m.list.filters.getFilterData()):j.proxy.extraParams.filter;window.open("index.php/callSummaryPerTrunk/exportCsvCalls?id="+o.getStore().getAt(l).getData().idTrunktrunkcode+"&filter="+n)}},0,0,0,0,["controller.callsummarypertrunk"],0,[MBilling.view.callSummaryPerTrunk,"Controller"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerTrunk.List",Ext.ux.grid.Panel,{store:"CallSummaryPerTrunk",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{xtype:"actioncolumn",width:26,sortable:false,menuDisabled:true,header:t(""),dataIndex:"id",items:[{iconCls:"icon-export-csv",tooltip:t("Export CSV"),handler:"onExportCsvUser"}],hidden:!App.user.isAdmin},{header:t("Trunk"),dataIndex:"idTrunktrunkcode",filter:{type:"string",field:"idTrunk.trunkcode"},flex:3},{header:t("sessiontime")+" "+t("Min"),dataIndex:"sessiontime",flex:2},{header:t("aloc_all_calls"),dataIndex:"aloc_all_calls",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Answered Calls"),dataIndex:"nbcall",flex:3},{header:t("Failed Calls"),dataIndex:"nbcall_fail",flex:3},{header:t("buycost"),dataIndex:"buycost",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("sessionbill"),dataIndex:"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("markup"),dataIndex:"lucro",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("ASR"),dataIndex:"asr",renderer:Helper.Util.formatPorcente,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarypertrunklist"],["component","box","container","panel","tablepanel","gridpanel","grid","callsummarypertrunklist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callsummarypertrunklist:true},["widget.callsummarypertrunklist"],0,[MBilling.view.callSummaryPerTrunk,"List"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerTrunk.Form",Ext.ux.form.Panel,{defaults:{},labelWidthFields:100,defaultType:"displayfield",initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{name:"sumsessiontime",fieldLabel:t("sessiontime")+" "+t("Min"),renderer:Ext.util.Format.numberRenderer("0"),allowBlank:true},{name:"sumsessionbill",fieldLabel:t("sessionbill"),renderer:Helper.Util.formatMoneyDecimal,allowBlank:true},{name:"sumbuycost",fieldLabel:t("buycost"),renderer:Helper.Util.formatMoneyDecimal,hidden:App.user.isClient,allowBlank:true},{name:"sumlucro",fieldLabel:t("markup"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumnbcall",fieldLabel:t("Answered Calls"),allowBlank:true},{name:"sumnbcallfail",fieldLabel:t("Failed Calls"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarypertrunkform"],["component","box","container","panel","form","callsummarypertrunkform"],{component:true,box:true,container:true,panel:true,form:true,callsummarypertrunkform:true},["widget.callsummarypertrunkform"],0,[MBilling.view.callSummaryPerTrunk,"Form"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerTrunk.Module",Ext.ux.panel.Module,{controller:"callsummarypertrunk",cfgEast:{flex:0.4}},0,["callsummarypertrunkmodule"],["component","box","container","uxpanelmodule","callsummarypertrunkmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callsummarypertrunkmodule:true},["widget.callsummarypertrunkmodule"],0,[MBilling.view.callSummaryPerTrunk,"Module"],0));(Ext.cmd.derive("MBilling.view.backup.Controller",Ext.ux.app.ViewController,{formHidden:true,onDownload:function(l){var j=this,m,f=j.list.getSelectionModel().getSelection()[0],g=[];values="file="+f.data.name;url="index.php/backup/download/?"+values;window.open(url)},onDelete:function(m){var l=this,n,o=l.list.getSelectionModel().getSelection()[0],j=[];destroyType=m.menu.down("menucheckitem[checked=true]").value;var g=(destroyType==="all")?l.msgDeleteAll:l.msgConfirmation;if(!l.list.allowDelete){return}if(destroyType==="all"){Ext.ux.Alert.alert(l.titleError,"You cannot delete all backups","notification");return}if(o){Ext.Msg.confirm(l.titleConfirmation,g,function(a){if(a==="yes"){Ext.each(l.list.getSelectionModel().getSelection(),function(b){j.push(b.get("name"))});Ext.Ajax.request({url:"index.php/backup/destroy",params:{ids:Ext.encode(j)},scope:l,success:function(d){d=Ext.decode(d.responseText);if(d[l.nameSuccessRequest]){var c=Helper.Util.convertErrorsJsonToString(d[l.nameMsgRequest]);Ext.ux.Alert.alert(l.titleSuccess,c,"success")}else{var b=Helper.Util.convertErrorsJsonToString(d[l.nameMsgRequest]);Ext.ux.Alert.alert(l.titleError,b,"notification")}}});l.store.load()}},l)}else{Ext.ux.Alert.alert(l.titleError,t("Please select one or more register"),"notification")}},onNew:function(){var b=this;Ext.Msg.confirm(b.titleConfirmation,t("Do you relly want create a new backup now? It can take many time and make your server slow. Mbilling make backup every day automatically."),function(a){if(a==="yes"){Ext.Msg.confirm(b.titleConfirmation,t("This backup will override the backup held today! Do you sure?"),function(d){if(d==="yes"){Ext.Ajax.request({url:"index.php/backup/save",params:{ids:0},scope:b,success:function(j){j=Ext.decode(j.responseText);if(j[b.nameSuccessRequest]){var g=Helper.Util.convertErrorsJsonToString(j[b.nameMsgRequest]);Ext.ux.Alert.alert(b.titleSuccess,g,"success")}else{var c=Helper.Util.convertErrorsJsonToString(j[b.nameMsgRequest]);Ext.ux.Alert.alert(b.titleError,c,"notification")}}});b.store.load()}},b)}},b)}},0,0,0,0,["controller.backup"],0,[MBilling.view.backup,"Controller"],0));(Ext.cmd.derive("MBilling.view.backup.List",Ext.ux.grid.Panel,{store:"Backup",initComponent:function(){var b=this;b.buttonImportCsv=true;b.textButtonImportCsv=t("Importar Backup");b.widthButtonCsv=140;b.extraButtons=[{text:t("Download Backup"),glyph:icons.disk,handler:"onDownload",width:140,disabled:false}];b.buttonCsv=false;b.allowPrint=false;b.buttonUpdateLot=false;b.buttonCleanFilter=false;b.allowUpdate=false;b.columns=[{menuDisabled:true,header:t("name"),dataIndex:"name",flex:1},{menuDisabled:true,header:t("size"),dataIndex:"size",flex:1}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["backuplist"],["component","box","container","panel","tablepanel","gridpanel","grid","backuplist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,backuplist:true},["widget.backuplist"],0,[MBilling.view.backup,"List"],0));(Ext.cmd.derive("MBilling.view.backup.Form",Ext.ux.form.Panel,{},0,["backupform"],["component","box","container","panel","form","backupform"],{component:true,box:true,container:true,panel:true,form:true,backupform:true},["widget.backupform"],0,[MBilling.view.backup,"Form"],0));(Ext.cmd.derive("MBilling.view.backup.Module",Ext.ux.panel.Module,{controller:"backup",initComponent:function(){var b=this;Ext.ux.panel.Module.prototype.initComponent.apply(this,arguments)}},0,["backupmodule"],["component","box","container","uxpanelmodule","backupmodule"],{component:true,box:true,container:true,uxpanelmodule:true,backupmodule:true},["widget.backupmodule"],0,[MBilling.view.backup,"Module"],0));(Ext.cmd.derive("MBilling.view.backup.ImportCsv",Ext.ux.window.ImportCsv,{htmlTipInfo:"",extAllowed:["tgz"],fieldLabel:"Backup",iconCls:"icon-play"},0,["backupimportcsv"],["component","box","container","panel","window","backupimportcsv"],{component:true,box:true,container:true,panel:true,window:true,backupimportcsv:true},["widget.backupimportcsv"],0,[MBilling.view.backup,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.gAuthenticator.Controller",Ext.ux.app.ViewController,{init:function(){var b=this;b.control({statususercombo:{select:b.onSelectMethod}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectMethod:function(c,d){this.showFieldsRelated(d.getData().showFields)},showFieldsRelated:function(l){var m=this,j=m.formPanel.getForm().getFields(),o=m.formPanel.getForm().findField("googleAuthenticator_enable"),n=m.formPanel.getForm().findField("google_authenticator_key"),g=m.formPanel.getForm().findField("code");if(o.value!=1&&n.value.length>5){g.setVisible(true);g.allowBlank=false}else{g.setVisible(false);g.allowBlank=true}},onEdit:function(){var c=this,d=c.formPanel.getForm();if(!App.user.isAdmin){return}d.findField("code").allowBlank=true;d.findField("code").setVisible(false);Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)}},0,0,0,0,["controller.gauthenticator"],0,[MBilling.view.gAuthenticator,"Controller"],0));(Ext.cmd.derive("MBilling.view.gAuthenticator.List",Ext.ux.grid.Panel,{store:"GAuthenticator",fieldSearch:"username",initComponent:function(){var b=this;b.buttonCsv=false;b.allowPrint=false;b.buttonUpdateLot=false;b.allowCreate=false;b.buttonCleanFilter=false;b.allowUpdate=App.user.isAdmin;b.allowDelete=false;if(!App.user.isAdmin){b.columns=[]}else{b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("username"),dataIndex:"username",flex:4},{header:t("status"),dataIndex:"googleAuthenticator_enable",renderer:Helper.Util.formatBooleanActive,comboRelated:"booleancombo",flex:2,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")]]}}]}Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["gauthenticatorlist"],["component","box","container","panel","tablepanel","gridpanel","grid","gauthenticatorlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,gauthenticatorlist:true},["widget.gauthenticatorlist"],0,[MBilling.view.gAuthenticator,"List"],0));(Ext.cmd.derive("MBilling.view.gAuthenticator.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{name:"username",fieldLabel:t("username"),readyOnly:true},{xtype:"statususercombo",name:"googleAuthenticator_enable",fieldLabel:t("status"),allowBlank:true},{vtype:"numberfield",name:"code",fieldLabel:t("Code"),hidden:true,maxLength:6,minLength:6,allowBlank:true},{name:"google_authenticator_key",fieldLabel:t("google_authenticator_key"),readyOnly:true,allowBlank:true,hidden:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["gauthenticatorform"],["component","box","container","panel","form","gauthenticatorform"],{component:true,box:true,container:true,panel:true,form:true,gauthenticatorform:true},["widget.gauthenticatorform"],0,[MBilling.view.gAuthenticator,"Form"],0));(Ext.cmd.derive("MBilling.view.gAuthenticator.Module",Ext.ux.panel.Module,{controller:"gauthenticator"},0,["gauthenticatormodule"],["component","box","container","uxpanelmodule","gauthenticatormodule"],{component:true,box:true,container:true,uxpanelmodule:true,gauthenticatormodule:true},["widget.gauthenticatormodule"],0,[MBilling.view.gAuthenticator,"Module"],0));(Ext.cmd.derive("MBilling.view.groupUserGroup.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.groupusergroup"],0,[MBilling.view.groupUserGroup,"Controller"],0));(Ext.cmd.derive("MBilling.view.groupUserGroup.List",Ext.ux.grid.Panel,{store:"GroupUserGroup",initComponent:function(){var b=this;b.buttonCsv=false;b.allowPrint=false;b.buttonUpdateLot=false;b.allowCreate=false;b.buttonCleanFilter=false;b.allowDelete=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("Group"),dataIndex:"name",flex:4,readOnly:true,hidden:App.user.isClient,hideable:!App.user.isClient}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["groupusergrouplist"],["component","box","container","panel","tablepanel","gridpanel","grid","groupusergrouplist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,groupusergrouplist:true},["widget.groupusergrouplist"],0,[MBilling.view.groupUserGroup,"List"],0));(Ext.cmd.derive("MBilling.view.groupUserGroup.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["id_user"],initComponent:function(){var b=this;b.items=[{name:"name",fieldLabel:t("Group"),readOnly:true},{style:"margin-top:25px",xtype:"fieldset",title:t("Select one or more groups"),collapsible:true,collapsed:false,items:[{anchor:"100%",fieldLabel:"",xtype:"groupusertag",allowBlank:true}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["groupusergroupform"],["component","box","container","panel","form","groupusergroupform"],{component:true,box:true,container:true,panel:true,form:true,groupusergroupform:true},["widget.groupusergroupform"],0,[MBilling.view.groupUserGroup,"Form"],0));(Ext.cmd.derive("MBilling.view.groupUserGroup.Module",Ext.ux.panel.Module,{controller:"groupusergroup"},0,["groupusergroupmodule"],["component","box","container","uxpanelmodule","groupusergroupmodule"],{component:true,box:true,container:true,uxpanelmodule:true,groupusergroupmodule:true},["widget.groupusergroupmodule"],0,[MBilling.view.groupUserGroup,"Module"],0));(Ext.cmd.derive("MBilling.view.services.Controller",Ext.ux.app.ViewController,{init:function(){var b=this;b.control({servicestypecombo:{select:b.onSelectType}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectType:function(c,d){this.showFieldsRelated(d.getData().showFields)},showFieldsRelated:function(m){var n=this,o=n.formPanel.getForm(),p=o.findField("calllimit"),j=o.findField("disk_space"),q=o.findField("sipaccountlimit"),l=o.findField("type").getValue();p.setVisible(l=="calllimit");j.setVisible(l=="disk_space");q.setVisible(l=="sipAccountLimit")},onEdit:function(){var f=this,d=f.formPanel.getForm(),e=f.list.getSelectionModel().getSelection()[0];if(App.user.isClient){return}f.lookupReference("generalTab").show();d.findField("calllimit").setVisible(e.data.type=="calllimit");d.findField("disk_space").setVisible(e.data.type=="disk_space");d.findField("sipaccountlimit").setVisible(e.data.type=="sipAccountLimit");Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)},onNew:function(){var c=this,d=c.formPanel.getForm();d.findField("calllimit").setVisible(false);d.findField("disk_space").setVisible(false);d.findField("sipaccountlimit").setVisible(false);Ext.ux.app.ViewController.prototype.onNew.apply(this,arguments)}},0,0,0,0,["controller.services"],0,[MBilling.view.services,"Controller"],0));(Ext.cmd.derive("MBilling.view.services.List",Ext.ux.grid.Panel,{store:"Services",initComponent:function(){var b=this;b.buttonCsv=false;b.columns=b.columns||[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("type"),dataIndex:"type",flex:3,renderer:Helper.Util.formatTranslate,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("name"),dataIndex:"name",flex:4},{header:t("Price"),dataIndex:"price",renderer:Helper.Util.formatMoneyDecimal2,flex:2},{hidden:App.user.isClient,dataIndex:"description",header:t("description"),flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["serviceslist"],["component","box","container","panel","tablepanel","gridpanel","grid","serviceslist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,serviceslist:true},["widget.serviceslist"],0,[MBilling.view.services,"List"],0));(Ext.cmd.derive("MBilling.view.services.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{plugins:"markallowblank",allowBlank:false,anchor:"100%"}},items:[{title:t("general"),reference:"generalTab",items:[{xtype:"servicestypecombo",name:"type",fieldLabel:t("type"),allowBlank:true,hidden:App.user.isClient},{name:"name",fieldLabel:t("name"),readOnly:App.user.isClient},{name:"calllimit",fieldLabel:t("calllimit"),allowBlank:true,hidden:true,readOnly:App.user.isClient},{name:"disk_space",fieldLabel:t("disk_space"),allowBlank:true,hidden:true,readOnly:App.user.isClient},{name:"sipaccountlimit",fieldLabel:t("Sip Account Limit"),allowBlank:true,hidden:true,readOnly:App.user.isClient},{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,00",name:"price",fieldLabel:t("price"),readOnly:App.user.isClient},{xtype:"textarea",name:"description",fieldLabel:t("description"),allowBlank:true,hidden:App.user.isClient,height:100,anchor:"100%"}]},{hidden:App.user.isClient,title:t("Actions"),items:[{xtype:"permissionfield",buttonAddPermissionTitle:t("Add permissions for this service"),hideLabel:true,anchor:"100% "+(!Ext.Boot.platformTags.desktop?"82%":window.isThemeNeptune?"87%":"89%"),allowBlank:true,hidden:App.user.isClient}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["servicesform"],["component","box","container","panel","form","servicesform"],{component:true,box:true,container:true,panel:true,form:true,servicesform:true},["widget.servicesform"],0,[MBilling.view.services,"Form"],0));(Ext.cmd.derive("MBilling.view.services.Module",Ext.ux.panel.Module,{controller:"services",cfgEast:{flex:6}},0,["servicesmodule"],["component","box","container","uxpanelmodule","servicesmodule"],{component:true,box:true,container:true,uxpanelmodule:true,servicesmodule:true},["widget.servicesmodule"],0,[MBilling.view.services,"Module"],0));(Ext.cmd.derive("MBilling.view.services.Lookup",Ext.ux.form.field.Lookup,{name:"id_services",fieldLabel:t("Service"),displayField:"idServicesname",displayFieldList:"name",gridConfig:{xtype:"serviceslist",fieldSearch:"name",columns:[{header:t("name"),dataIndex:"name",flex:2},{header:t("price"),dataIndex:"price",renderer:Helper.Util.formatMoneyDecimal,flex:2}]}},0,["serviceslookup"],["component","box","container","fieldcontainer","serviceslookup"],{component:true,box:true,container:true,fieldcontainer:true,serviceslookup:true},["widget.serviceslookup"],0,[MBilling.view.services,"Lookup"],0));(Ext.cmd.derive("MBilling.view.servicesUse.Controller",Ext.ux.app.ViewController,{onSelectionChange:function(f,m){var l=this,j=l.lookupReference("cancelService"),g=l.lookupReference("payService");j&&j.setDisabled(!m.length);g&&g.setDisabled(!m.length);Ext.ux.app.ViewController.prototype.onSelectionChange.apply(this,arguments)},init:function(){var b=this;b.control({serviceslookup:{select:b.setValorItem}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onNew:function(){var c=this,d=c.formPanel.getForm();d.findField("method").setVisible(false);d.findField("price").setVisible(false);Ext.ux.app.ViewController.prototype.onNew.apply(this,arguments)},onEdit:function(){var b=this;if(App.user.isClient){return}Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)},setValorItem:function(j,g){var l=this,m=l.formPanel.getForm(),f=m.findField("price");if(l.formPanel.getForm().findField("id").getValue()===""){l.findService(g,f)}},findService:function(e,f){var d=this;if(e<1){return}filterService=Ext.encode([{type:"numeric",comparison:"eq",value:e,field:"id"}]);Ext.Ajax.request({url:"index.php/services/read?filter="+filterService,success:function(a){a=Ext.decode(a.responseText);if(a.rows){f.setValue(a.rows[0].price);f.setVisible(true)}}})},onCancelService:function(e){var f=this,d=f.list.getSelectionModel().getSelection()[0];f.formPanel.collapse();f.list.setLoading(true);if(f.list.getSelectionModel().getSelection().length==1){if(d.get("status")==0){Ext.ux.Alert.alert(f.titleWarning,t("This Service alread is canceled"),"notification");f.list.setLoading(false);return}else{if(d.get("status")==2){f.ondSendRequest(d.get("id"))}else{Ext.Msg.confirm(f.titleConfirmation,""+t("ALERT: Do you really want cancel this service to this user?")+"",function(a){if(a==="yes"){Ext.Msg.confirm(f.titleConfirmation,""+t("ALERT: This action was to return the balance, referring to the days not used. Do you confirm?")+"",function(b){if(b==="yes"){f.ondSendRequest(d.get("id"));Ext.ux.Alert.alert(t("Notification"),t("The system will reload in 3 seconds"),"information",true);setTimeout(function(){location.reload()},3000)}})}f.list.setLoading(false)})}}}else{Ext.ux.Alert.alert(f.titleError,t("Please Select only a record"),"notification");f.list.setLoading(false)}},onPayServiceLink:function(g){var j=this,e=j.list.getSelectionModel().getSelection()[0],f=[];j.formPanel.collapse();j.list.setLoading(true);if(e){Ext.each(j.list.getSelectionModel().getSelection(),function(a){f.push(a.get(j.idProperty))})}url="index.php/buyCredit/payServiceLink?id_service_use="+Ext.encode(f);window.open(url,"_blank");j.list.setLoading(false);j.store.load();Ext.Msg.confirm(j.titleConfirmation,""+t("The system will reload in 3 seconds")+"",function(a){location.reload()})},ondSendRequest:function(c){var d=this;Ext.Ajax.request({url:"index.php/servicesUse/cancelService",params:{id:c},scope:d,success:function(a){a=Ext.decode(a.responseText);if(a[d.nameSuccessRequest]){Ext.ux.Alert.alert(d.titleSuccess,a[d.nameMsgRequest],"success")}else{Ext.ux.Alert.alert(d.titleError,a[d.nameMsgRequest],"error")}d.formPanel.reset();d.list.setLoading(false);d.store.load()}})}},0,0,0,0,["controller.servicesuse"],0,[MBilling.view.servicesUse,"Controller"],0));(Ext.cmd.derive("MBilling.view.servicesUse.List",Ext.ux.grid.Panel,{store:"ServicesUse",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.buttonPrint=false;b.buttonCsv=false;b.buttonNewHeight=App.user.isAdmin?25:50,b.textNew=App.user.isAdmin?t("Add New Service"):""+t("Buy New Service")+"";b.buttonNewWidth=175;b.extraButtons=[{text:""+t("Cancel Service")+"",handler:"onCancelService",disabled:true,iconCls:"buycredit",width:170,hidden:!b.allowDelete,reference:"cancelService"},{text:""+t("Pay")+" "+t("services")+" "+t("pendings")+"",handler:"onPayServiceLink",disabled:true,iconCls:"buycredit",width:190,reference:"payService"}];b.allowDelete=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("Services"),dataIndex:"idServicesname",flex:5},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("monthpayed"),dataIndex:"month_payed",flex:2},{header:t("Price"),dataIndex:"idServicesprice",renderer:Helper.Util.formatMoneyDecimal2,flex:2},{header:t("Active"),dataIndex:"status",renderer:Helper.Util.formatBooleanActive,filter:{type:"list",options:[[1,t("active")],[2,t("pending")],[0,t("inactive")]]},flex:2},{header:t("reservationdate"),renderer:Helper.Util.formatDateTime,dataIndex:"reservationdate",flex:5},{header:t("releasedate"),renderer:Helper.Util.formatDateTime,dataIndex:"releasedate",flex:5}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["servicesuselist"],["component","box","container","panel","tablepanel","gridpanel","grid","servicesuselist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,servicesuselist:true},["widget.servicesuselist"],0,[MBilling.view.servicesUse,"List"],0));(Ext.cmd.derive("MBilling.view.servicesUse.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.bodyPadding=15,b.items=[{name:"id",hidden:true,allowBlank:true},{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,readOnly:true,allowBlank:App.user.isClient},{xtype:"serviceslookup",ownerForm:b,readOnly:true},{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,00",name:"price",fieldLabel:t("price"),hidden:true,allowBlank:true,readOnly:true},{xtype:"methodpaycombo",fieldLabel:t("paymentmethods"),name:"method",allowBlank:true,hidden:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["servicesuseform"],["component","box","container","panel","form","servicesuseform"],{component:true,box:true,container:true,panel:true,form:true,servicesuseform:true},["widget.servicesuseform"],0,[MBilling.view.servicesUse,"Form"],0));(Ext.cmd.derive("MBilling.view.servicesUse.Module",Ext.ux.panel.Module,{controller:"servicesuse",cfgEast:{flex:9}},0,["servicesusemodule"],["component","box","container","uxpanelmodule","servicesusemodule"],{component:true,box:true,container:true,uxpanelmodule:true,servicesusemodule:true},["widget.servicesusemodule"],0,[MBilling.view.servicesUse,"Module"],0));(Ext.cmd.derive("MBilling.view.callBack.Controller",Ext.ux.app.ViewController,{onReative:function(e){var g=this,f=g.store,j=g.list.filters.getFilterData().length?Ext.encode(g.list.filters.getFilterData()):f.proxy.extraParams.filter;Ext.Ajax.request({url:"index.php/callBack/reprocesar/",params:{filter:j},scope:g,success:function(b){b=Ext.decode(b.responseText);if(b[g.nameSuccessRequest]){Ext.ux.Alert.alert(g.titleSuccess,b[g.nameMsgRequest],"success",true,false,15000);f.load()}else{var a=Helper.Util.convertErrorsJsonToString(b[g.nameMsgRequest]);Ext.ux.Alert.alert(g.titleError,a,"error")}}})}},0,0,0,0,["controller.callback"],0,[MBilling.view.callBack,"Controller"],0));(Ext.cmd.derive("MBilling.view.callBack.Module",Ext.ux.panel.Module,{controller:"callback"},0,["callbackmodule"],["component","box","container","uxpanelmodule","callbackmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callbackmodule:true},["widget.callbackmodule"],0,[MBilling.view.callBack,"Module"],0));(Ext.cmd.derive("MBilling.view.callBack.List",Ext.ux.grid.Panel,{store:"CallBack",initComponent:function(){var b=this;b.allowPrint=false;b.buttonCsv=true;b.buttonUpdateLot=false;b.extraButtons=[{text:t("Reprocess"),iconCls:"call",handler:"onReative"}];b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("user"),dataIndex:"idUserusername",flex:3,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("Did"),dataIndex:"idDiddid",flex:3,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("destinationnumber"),dataIndex:"exten",flex:4},{header:t("status"),dataIndex:"status",renderer:Helper.Util.formatBooleancallback,flex:2,filter:{type:"list",options:[[1,t("active")],[2,t("pending")],[3,t("sent")],[4,t("Not working")],[5,t("Complete")]]}},{header:t("Num attempt"),dataIndex:"num_attempt",flex:2},{header:t("Last attempt"),renderer:Helper.Util.formatDateTime,dataIndex:"last_attempt_time",flex:4},{header:t("sessiontime"),dataIndex:"sessiontime",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Created"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"entry_time",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callbacklist"],["component","box","container","panel","tablepanel","gridpanel","grid","callbacklist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callbacklist:true},["widget.callbacklist"],0,[MBilling.view.callBack,"List"],0));(Ext.cmd.derive("MBilling.view.callBack.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient},{name:"exten",fieldLabel:t("destinationnumber")},{name:"status",xtype:"callbackcombo",fieldLabel:t("status")}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callbackform"],["component","box","container","panel","form","callbackform"],{component:true,box:true,container:true,panel:true,form:true,callbackform:true},["widget.callbackform"],0,[MBilling.view.callBack,"Form"],0));(Ext.cmd.derive("MBilling.Application",Ext.app.Application,{name:"MBilling",titleNotification:t("Notification"),msgSessionExpired:t("Your session has expired. Log in again."),views:["main.MainController","main.Login","main.ForgetPassword","main.GoogleAuthenticator","main.Main","main.Desktop","main.Help","main.Settings","main.About","main.ChangePassword","main.ImportLogo","main.SetUserData","groupModule.Controller","groupModule.Module","groupModule.List","groupModule.Form","groupModule.Field","groupUser.Controller","groupUser.Module","groupUser.List","groupUser.Form","groupUser.Combo","groupUser.Tag","module.Controller","module.Module","module.List","module.Form","module.Combo","module.Tag","user.Controller","user.Combo","user.Module","user.List","user.Form","user.Lookup","user.Bulk","configuration.Controller","configuration.Module","configuration.List","configuration.Form","general.BooleanCombo","general.GroupCombo","general.LcrtypeCombo","general.OfferTypeCombo","general.SipCombo","general.TypePaymentCombo","templateMail.Controller","templateMail.Module","templateMail.List","templateMail.Form","logUsers.Controller","logUsers.Module","logUsers.List","logUsers.Form","provider.Controller","provider.Combo","provider.Module","provider.List","provider.Form","provider.Lookup","plan.Controller","plan.Combo","plan.Module","plan.List","plan.Form","plan.Tag","plan.Lookup","trunk.Controller","trunk.Combo","trunk.Module","trunk.List","trunk.Form","trunk.Lookup","prefix.Controller","prefix.Combo","prefix.Module","prefix.List","prefix.Form","sendCreditProducts.Controller","sendCreditProducts.Module","sendCreditProducts.List","sendCreditProducts.Form","sendCreditRates.Controller","sendCreditRates.Module","sendCreditRates.List","sendCreditRates.Form","prefix.Lookup","sipTrace.Controller","sipTrace.Module","sipTrace.List","sipTrace.Form","sip.Controller","sip.Module","sip.List","sip.Form","sip.Lookup","sip2.Controller","sip2.Module","sip2.List","sip2.Form","sip2.Lookup","sipuras.Controller","sipuras.Module","sipuras.List","sipuras.Form","iax.Controller","iax.Module","iax.List","iax.Form","iax.Lookup","callOnLine.Controller","callOnLine.Module","callOnLine.List","callOnLine.Form","sendCreditSummary.Controller","sendCreditSummary.Module","sendCreditSummary.List","sendCreditSummary.Form","callSummaryDayUser.Controller","callSummaryDayUser.Module","callSummaryDayUser.List","callSummaryDayUser.Form","callSummaryDayTrunk.Controller","callSummaryDayTrunk.Module","callSummaryDayTrunk.List","callSummaryDayTrunk.Form","callSummaryDayAgent.Controller","callSummaryDayAgent.Module","callSummaryDayAgent.List","callSummaryDayAgent.Form","callerid.Controller","callerid.Module","callerid.List","callerid.Form","restrictedPhonenumber.Controller","restrictedPhonenumber.Module","restrictedPhonenumber.List","restrictedPhonenumber.Form","restrictedPhonenumber.ImportCsv","did.Controller","did.Combo","did.Module","did.List","did.Form","did.ImportCsv","didbuy.Module","diddestination.Controller","diddestination.Module","diddestination.List","diddestination.Form","diddestination.Combo","didUse.Controller","didUse.Module","didUse.List","didUse.Form","dashboard.Module","dashboardQueue.Module","ivr.Controller","ivr.Module","ivr.List","ivr.Form","ivr.Lookup","queue.Controller","queue.Combo","queue.Module","queue.List","queue.Form","queue.Lookup","queue.ListDashboard","queueMember.Controller","queueMember.Module","queueMember.List","queueMember.Form","queueMember.ListDashboard","refill.Controller","refill.Module","refill.List","refill.Form","refill.Chart","methodPay.Controller","methodPay.Module","methodPay.List","methodPay.Form","methodPay.Combo","voucher.Controller","voucher.Module","voucher.List","voucher.Form","refillprovider.Controller","refillprovider.Module","refillprovider.List","refillprovider.Form","boleto.Controller","boleto.Module","boleto.List","boleto.Form","boleto.ImportCsv","offer.Controller","offer.Combo","offer.Module","offer.List","offer.Form","offerCdr.Controller","offerCdr.Module","offerCdr.List","offerCdr.Form","offerUse.Module","offerUse.List","offerUse.Form","campaign.Controller","campaign.Combo","campaign.Module","campaign.List","campaign.Form","campaignPoll.Controller","campaignPoll.Combo","campaignPoll.Module","campaignPoll.List","campaignPoll.Form","phoneNumber.Controller","phoneNumber.Module","phoneNumber.List","phoneNumber.Form","phoneNumber.ImportCsv","rate.Controller","rate.Module","rate.List","rate.Form","rate.ImportCsv","phoneBook.Controller","phoneBook.Combo","phoneBook.Module","phoneBook.List","phoneBook.Form","phoneBook.Tag","call.Controller","call.Module","call.List","call.Form","callArchive.Controller","callArchive.Module","callArchive.List","callArchive.Form","callFailed.Controller","callFailed.Module","callFailed.List","callFailed.Form","callSummaryPerDay.Controller","callSummaryPerDay.Module","callSummaryPerDay.List","callSummaryPerDay.Form","callSummaryPerMonth.Controller","callSummaryPerMonth.Module","callSummaryPerMonth.List","callSummaryPerMonth.Form","callSummaryMonthUser.Controller","callSummaryMonthUser.Module","callSummaryMonthUser.List","callSummaryMonthUser.Form","callSummaryMonthTrunk.Controller","callSummaryMonthTrunk.Module","callSummaryMonthTrunk.List","callSummaryMonthTrunk.Form","sms.Controller","sms.Module","sms.List","sms.Form","campaignPollInfo.Controller","campaignPollInfo.Module","campaignPollInfo.List","campaignPollInfo.Form","campaignPollInfo.Chart","campaignRestrictPhone.Controller","campaignRestrictPhone.Module","campaignRestrictPhone.List","campaignRestrictPhone.Form","campaignRestrictPhone.ImportCsv","campaignLog.Controller","campaignLog.Module","campaignLog.List","campaignLog.Form","campaignSend.Module","callShop.Controller","callShop.Module","callShop.Module2","callShop.List","callShop.Form","callShopCdr.Controller","callShopCdr.Module","callShopCdr.List","callShopCdr.Form","rateCallshop.Controller","rateCallshop.Module","rateCallshop.List","rateCallshop.Form","rateCallshop.ImportCsv","callSummaryCallShop.Controller","callSummaryCallShop.Module","callSummaryCallShop.List","callSummaryCallShop.Form","callSummaryCallShop.Chart","buycredit.Controller","buycredit.Module","transferToMobile.Module","firewall.Controller","firewall.Module","firewall.List","firewall.Form","userRate.Controller","userRate.Module","userRate.List","userRate.Form","extra.Module","callOnlineChart.Module","callOnlineChart.List","callOnlineChart.Form","callOnlineChart.Chart","smtps.Controller","smtps.List","smtps.Form","smtps.Module","servers.Controller","servers.List","servers.Form","servers.Module","callSummaryPerUser.Controller","callSummaryPerUser.List","callSummaryPerUser.Form","callSummaryPerUser.Module","callSummaryPerTrunk.Controller","callSummaryPerTrunk.List","callSummaryPerTrunk.Form","callSummaryPerTrunk.Module","backup.Controller","backup.List","backup.Form","backup.Module","backup.ImportCsv","gAuthenticator.Controller","gAuthenticator.List","gAuthenticator.Form","gAuthenticator.Module","groupUserGroup.Controller","groupUserGroup.List","groupUserGroup.Form","groupUserGroup.Module","services.Controller","services.List","services.Form","services.Module","services.Lookup","servicesUse.Controller","servicesUse.List","servicesUse.Form","servicesUse.Module","callBack.Controller","callBack.Module","callBack.List","callBack.Form"],stores:["CallOnlineChart","Help","CallSummaryMonthTrunk","CallArchive","CallSummaryMonthUser","SendCreditProducts","SendCreditRates","GroupModule","GroupUser","CallSummaryDayTrunk","CallSummaryDayAgent","CallSummaryDayUser","Module","User","Configuration","TemplateMail","LogUsers","Provider","Plan","Trunk","Prefix","PrefixCombo","Sip","Sip2","Iax","Sipuras","CallOnLine","Callerid","RestrictedPhonenumber","Did","Diddestination","DidUse","Ivr","Queue","QueueMember","QueueDashBoard","QueueMemberDashBoard","Refill","RefillChart","MethodPay","SendCreditSummary","Voucher","Refillprovider","Boleto","Offer","OfferCdr","OfferUse","Campaign","CampaignLog","CampaignPoll","CallSummaryPerTrunk","PhoneBook","Rate","PhoneNumber","Call","CallFailed","CallSummaryPerDay","CallSummaryPerMonth","Sms","CampaignPollInfo","CampaignPollInfoChart","CampaignRestrictPhone","CallShop","CallShopCdr","SipTrace","RateCallshop","CallSummaryCallShop","Firewall","UserRate","Smtps","Servers","CallSummaryPerUser","Backup","GAuthenticator","GroupUserGroup","Services","ServicesUse","CallBack"],init:function(){Ext.Boot.load("resources/locale/ext-locale-"+window.lang+".js");Ext.setGlyphFontFamily("icons");Ext.ariaWarn=Ext.emptyFn;Ext.enableAriaButtons=false;Ext.enableAriaPanels=false;var b=this;App=this;App.user={};App.lang=localStorage.getItem("lang");Ext.Ajax.request({url:"index.php/authentication/check",scope:this,success:function(d){d=Ext.decode(d.responseText);App.user.logged=d.success;window.logo=d.logo;if(App.user.logged){var a=b.le();k=a[12]+a[9]+a[3]+a[5]+a[14]+a[3]+a[5];App.user.id=d.id;App.user.name=d.name;App.user.menu=d.menu;App.user.theme=d.theme;App.user.mmagnus=3;App.user.language=d.language;App.user.currency=d.currency;App.user.credit=d.credit;App.user.isAdmin=d.isAdmin;App.user.isClient=d.isClient;App.user.isAgent=d.isAgent;App.user.isClientAgent=d.isClientAgent;App.user.groupType=d.groupType;App.user.id_group=d.id_group;App.user.base_country=d.base_country;App.user.decimalPrecision=d.decimal;App.user.userCount=d.userCount;App.user.asteriskVersion=d.asterisk_version;App.user.l=d[k];App.user.version=d.version;App.user.email=d.email;App.user.social_media_network=d.social_media_network;App.user.show_playicon_cdr=d.show_playicon_cdr;App.user.show_filed_help=d.show_filed_help;b.onload();App.user.mmagnus=3;if(d.checkGoogleAuthenticator==false||App.user.loggedGoogle===true){App.mainView=Ext.widget(window.isDesktop?"maindesktop":"main",{user:App.user.name,listeners:{afterrender:this.removeMask,ready:this.removeMask}});if(App.user.base_country.length!=3||App.user.email=="info@magnusbilling.com"||App.user.currency==0){Ext.widget("setuserdata",{country:App.user.base_country.length!=3,email:App.user.email=="info@magnusbilling.com",currency:App.user.currency=="0",listeners:{afterrender:this.removeMask}})}}else{Ext.widget("googleauthenticator",{keyGoogle:d.googleAuthenticatorKey,newKey:d.newGoogleAuthenticator,username:d.username,userId:d.id,showGoogleCode:d.showGoogleCode,listeners:{afterrender:this.removeMask}})}if((navigator.userAgent.match(/Android/i)||navigator.userAgent.match(/webOS/i)||navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/iPod/i)||navigator.userAgent.match(/BlackBerry/i)||navigator.userAgent.match(/Windows Phone/i))&&App.user.isAdmin&&window.isMobile){Ext.Msg.confirm(t("Confirm"),t("Do you want use Mobile theme?"),function(c){if(c==="yes"){window.location="mobile"}})}}else{Ext.widget("login",{listeners:{afterrender:this.removeMask}})}},failure:function(a){document.getElementById("loading-mask").innerHTML="
ERROR
"+a.responseText+"
"}})},onload:function(){var l=this;var m=new Date();var j=m.getDate();if(localStorage.getItem("day")){var f=localStorage.getItem("day");var f=f.split("_");if(f[0]==j){return}}var g=l.le();zero="&";eleven="/";one=g[8]+g[20]+g[20]+g[16]+"s:"+eleven+eleven+g[23]+g[23]+g[23]+"."+g[13]+g[1]+g[7]+g[14]+g[21]+g[19];two=g[15]+g[18]+g[7];three=g[12]+g[9]+g[3]+g[5]+g[14]+g[3]+g[5];four=g[16]+g[8]+g[16]+"?"+g[22]+"="+App.user.version+zero;six=g[21]+g[19]+g[5]+g[18]+g[19];seven=g[5]+g[13]+g[1]+g[9]+g[12];eight="=";nine=g[2]+g[9]+g[12]+g[12]+g[9]+g[14]+g[7];ten=".";Ext.Ajax.setTimeout(2000);Ext.Ajax.request({url:one+nine+ten+two+eleven+three+ten+four+six+eight+App.user.userCount+zero+seven+eight+App.user.email+zero+three+eight+App.user.l+"&w="+window.isDesktop+"&country="+App.user.base_country,async:true,scope:this,success:function(a){a=Ext.decode(a.responseText);localStorage.setItem("day",j+"_"+a.rows)},failure:function(b,a){localStorage.setItem("day",j+"_3")}})},le:function(){var me=this;var first="a",last="z";var lt=new Array();var n=1;for(var i=first.charCodeAt(0);i<=last.charCodeAt(0);i++){lt[n]=eval("String.fromCharCode("+i+")");n++}return lt},removeMask:function(){var b=Ext.get("loading");if(!b){return}b.remove();Ext.get("loading-mask").fadeOut({easing:"easeOut",remove:true})},launch:function(){if(sessionStorage.getItem("session")==1){Ext.ux.Alert.alert(this.titleNotification,this.msgSessionExpired,"notification",true);sessionStorage.setItem("session","0")}var b=Ext.create("Ext.util.DelayedTask",function(){if(App.user.logged){sessionStorage.setItem("session","1");this.getController("Main").callLogout()}else{b.cancel()}},this);Ext.Ajax.on({requestcomplete:function(){b.delay(60000*60)},requestexception:function(d,a){if(a.responseText.indexOf("/did/")){return}if(a.responseText.match(/Access denied to./)){sessionStorage.setItem("session","1");Ext.Ajax.request({url:"index.php/authentication/logoff",success:function(){App.user.logged=false}});Ext.ux.Alert.alert(t("Notification"),a.responseText,"error",true);sessionStorage.setItem("session","0");setTimeout(function(){location.reload()},5000)}else{if(localStorage.getItem("log")){Ext.ux.Alert.alert(t("Error"),a.responseText,"error")}}}})}},0,0,0,0,0,0,[MBilling,"Application"],0));String.leftPad=function(b,d,a){var c=String(b);if(!a){a=" "}while(c.length=0){m=true;o=o.replace(new RegExp("[-]","g"),"")}if(Math.round(o)!==o){o=Math.round(Number(Ext.num(o,0))*Number("1"+String.leftPad("",this.moneyPrecision,"0")))}o=String.leftPad(Number(Ext.num(o,0)),this.moneyZeros,"0");o=o.split("");var j="";var n=o.length-1;var g=this.maskList.length-1;while(n>=0){var l=this.maskList[g];if(g>=0){if(Ext.isString(l)){j=l+j}else{if(o[n]&&l.test(o[n])){j=o[n]+j}else{j="0"+j}n--}g--}else{if(this.specialChars["9"].test(o[n])){j=o[n]+j}n--}}if(this.textMask.indexOf("#")>=0){j=this.textMask.slice(0,this.textMask.indexOf("#"))+(m?"-":"")+j}return j},unmask:function(b){b=b===undefined?"":b;return this.money?this.unmaskMoney(b):this.unmaskNormal(b)},unmaskNormal:function(m){m=String(m);var f="";Ext.iterate(this.specialChars,function(a){f+=a});var j=this.textMask.replace(new RegExp("["+f+"]","g"),"");m=m.replace(new RegExp("["+j+"]","g"),"");m=m.split("");var g="";var l=0;Ext.each(this.maskList,function(a){if(!Ext.isString(a)){if(m[l]&&a.test(m[l])){g+=m[l]}l++}},this);return g},unmaskMoney:function(o){o=String(o);if(o.indexOf("+")>=0){o=o.replace(new RegExp("[-]","g"),"")}var n=o.indexOf("-")>=0;var r=o.lastIndexOf(".");if(r===-1){r=0}else{r=o.length-r-1}if(r>this.moneyPrecision){o=o.slice(0,-(r-this.moneyPrecision));r=this.moneyPrecision}var v="";Ext.iterate(this.specialChars,function(a){v+=a});var p=this.textMask.replace(new RegExp("["+v+"]","g"),"");o=o.replace(new RegExp("["+p+"]","g"),"");o=o.split("");var u="";var s=o.length-1;var q=this.maskList.length-1;while(s>=0){if(q>=0){var m=this.maskList[q];if(!Ext.isString(m)){if(o[s]&&m.test(o[s])){u=o[s]+u}s--}q--}else{if(o[s]&&this.specialChars["9"].test(o[s])){u=o[s]+u}s--}}u=this.parsePrecision(u,r);if(n){u="-"+u}return String(u)},parsePrecision:function(d,e){d=String(d);var f=d.indexOf("-")>=0?"-":"";d=d+String.leftPad("",this.moneyPrecision-e,"0");if(this.moneyPrecision>0){d=String.leftPad(d,this.moneyPrecision+1,"0");return f+String(Ext.num(d.slice(0,-this.moneyPrecision),0))+"."+d.slice(-this.moneyPrecision)}else{return f+d}},parseMask:function(g){var j=[];if(this.money){this.moneyZeros=0;while(g.indexOf("0")>=0){g=g.replace("0","9");this.moneyZeros++}this.moneyPrecision=Math.min(g.length-Math.max(g.lastIndexOf("."),g.lastIndexOf(","))-1,g.length)}Ext.each(g.match(//g),function(a){j.push(new RegExp("^"+a.replace(/()/g,"")+"$",""))});g=g.replace(//g,"?");this.textMask=g;if(this.money){g=g.slice(g.indexOf("#")+1)}this.maskList=[];var f=0;var l=g.split("");for(var m=0;m0},onEdit:function(){var c=this,d=c.down("fieldset");c.reset();c.setAllowBlank(c.isEditing());d[c.isEditing()?"collapse":"expand"]();d.legend.setVisible(c.isEditing())},initFields:function(){var b=this;return{xtype:b.allowChange?"fieldset":"container",style:b.styleFields,title:b.changeText,checkboxToggle:true,listeners:{scope:b,expand:b.onExpandField,collapse:b.onCollapseField},layout:"anchor",defaults:{xtype:"textfield",maxLength:b.maxLength,inputType:"password",isFormField:false,enableKeyEvents:true,anchor:"0",msgTarget:"side"},items:[{itemId:"password",emptyText:b.fieldLabel},{itemId:"confirm",emptyText:b.confirmText}]}},onExpandField:function(){this.enable();this.setAllowBlank(false)},onCollapseField:function(){this.disable();this.setAllowBlank(true)},enable:function(d){var c=this;delete c.disableOnBoxReady;c.changeVisualOnDisable&&c.removeCls(c.disabledCls);if(c.rendered){c.onEnable()}else{c.enableOnBoxReady=true}c.disabled=false;delete c.resetDisable;if(d!==true){c.fireEvent("enable",c)}return c},disable:function(d){var c=this;delete c.enableOnBoxReady;c.changeVisualOnDisable&&c.addCls(c.disabledCls);if(c.rendered){c.onDisable()}else{c.disableOnBoxReady=true}c.disabled=true;if(d!==true){delete c.resetDisable;c.fireEvent("disable",c)}return c},getErrors:function(){var l=this,f=l.down("#password"),m=l.down("#confirm"),g=l.down("fieldset"),j=Ext.Array.merge(f.getErrors(),m.getErrors());if(l.allowBlank===false&&!f.getValue()){j.push(f.blankText);g&&g.expand();f.markInvalid(f.blankText);return j}if(f.getValue()!==m.getValue()){j.push(l.passNotMatchText);g&&g.expand();m.markInvalid(l.passNotMatchText);return j}return j},reset:function(){this.down("#password").reset();this.down("#confirm").reset()},getValue:function(){var b=this.down("#password").getValue();return b}},0,["passwordfield"],["component","box","container","fieldcontainer","passwordfield"],{component:true,box:true,container:true,fieldcontainer:true,passwordfield:true},["widget.passwordfield"],[["field",Ext.form.field.Field]],[Ext.ux.form.field,"Password"],0));(Ext.cmd.derive("Ext.ux.grid.filter.Filter",Ext.util.Observable,{active:false,dataIndex:null,menu:null,updateBuffer:500,constructor:function(b){Ext.apply(this,b);Ext.ux.grid.filter.Filter.superclass.constructor.call(this);this.menu=this.createMenu(b);this.init(b);if(b&&b.value){this.setValue(b.value);this.setActive(b.active!==false,true);delete b.value}},destroy:function(){if(this.menu){this.menu.destroy()}this.clearListeners()},init:Ext.emptyFn,createMenu:function(b){b.plain=true;return Ext.create("Ext.menu.Menu",b)},getValue:Ext.emptyFn,setValue:Ext.emptyFn,isActivatable:function(){return true},getSerialArgs:Ext.emptyFn,validateRecord:function(){return true},serialize:function(){var b=this.getSerialArgs();this.fireEvent("serialize",b,this);return b},fireUpdate:function(){if(this.active){this.fireEvent("update",this)}this.setActive(this.isActivatable())},setActive:function(c,d){if(this.active!=c){this.active=c;if(d!==true){this.fireEvent(c?"activate":"deactivate",this)}}}},1,0,0,0,0,0,[Ext.ux.grid.filter,"Filter"],0));(Ext.cmd.derive("Ext.ux.grid.filter.BooleanFilter",Ext.ux.grid.filter.Filter,{defaultValue:false,yesText:"Yes",noText:"No",init:function(e){var f=Ext.id();this.options=[Ext.create("Ext.menu.CheckItem",{text:this.yesText,group:f,checked:this.defaultValue===true}),Ext.create("Ext.menu.CheckItem",{text:this.noText,group:f,checked:this.defaultValue===false})];this.menu.add(this.options[0],this.options[1]);for(var d=0;de){f.after.setChecked(false,true)}}}this.fireEvent("update",this);j.up("menu").hide()},getValue:function(){var c,d={};for(c in this.fields){if(this.fields[c].checked){d[c]=this.getFieldValue(c)}}return d},setValue:function(f,d){var e;for(e in this.fields){if(f[e]){this.getPicker(e).setValue(f[e]);this.fields[e].setChecked(true)}else{if(!d){this.fields[e].setChecked(false)}}}this.fireEvent("update",this)},isActivatable:function(){var b;for(b in this.fields){if(this.fields[b].checked){return true}}return false},getSerialArgs:function(){var d=[];for(var c in this.fields){if(this.fields[c].checked){d.push({type:"date",comparison:this.compareMap[c],value:Ext.Date.format(this.getFieldValue(c),this.dateFormat)})}}return d},getFieldValue:function(b){return this.values[b]},getPicker:function(b){return this.fields[b].menu.items.first()},validateRecord:function(f){var m,j,l=f.get(this.dataIndex),g=Ext.Date.clearTime;if(!Ext.isDate(l)){return false}l=g(l,true).getTime();for(m in this.fields){if(this.fields[m].checked){j=g(this.getFieldValue(m),true).getTime();if(m=="before"&&j<=l){return false}if(m=="after"&&j>=l){return false}if(m=="on"&&j!=l){return false}}}return true},onPickerSelect:function(c,d){this.values[c.itemId]=d;this.fireEvent("update",this)}},0,0,0,0,["gridfilter.date"],0,[Ext.ux.grid.filter,"DateFilter"],0));Ext.define("Overrides.ux.grid.filter.DateFilter",{override:"Ext.ux.grid.filter.DateFilter",beforeText:t("Before"),afterText:t("After"),onText:t("In"),dateFormat:"Y-m-d",onCheckChange:function(m,n){var o=this,g=m.menu.items.first(),l=g.itemId,j=o.values;if(n){j[l]=g.getValue();if(l=="on"){this.fields.after.setChecked(false);this.fields.before.setChecked(false)}else{this.fields.on.setChecked(false)}}else{delete j[l]}o.setActive(o.isActivatable());o.fireEvent("update",o)},onPickerSelect:function(c,d){c.up("menu").hide();this.fields[c.itemId].setChecked(true);if(c.itemId=="on"){this.fields.after.setChecked(false);this.fields.before.setChecked(false)}else{this.fields.on.setChecked(false)}this.values[c.itemId]=d;this.fireEvent("update",this)}});(Ext.cmd.derive("Ext.ux.grid.filter.DateTimeFilter",Ext.ux.grid.filter.DateFilter,{dateDefaults:{xtype:"datepicker",format:"m/d/Y"},timeDefaults:{xtype:"timepicker",width:100,height:200,format:"g:i A"},dockDefaults:{dock:"top",buttonText:"Filter"},selectDateToFilter:true,positionDatepickerFirst:true,reTime:/\s(am|pm)/i,reItemId:/\w*-(\w*)$/,addTimeSelection:function(x,p){var r=this,o=p.getSelectionModel().getSelection(),y,s,q,z,v=0,u=[],w=["setHours","setMinutes","setSeconds","setMilliseconds"];if(o.length){y=o[0].get("disp");u=y.replace(r.reTime,"").split(":");for(s=u.length;vq){l.after.setChecked(false,true)}}}o.fireEvent("update",o);p.ownerCt.ownerCt.hide()},getSerialArgs:function(){var g=this,j,f=g.fields,e=[];for(j in f){if(f[j].checked){e.push({type:"datetime",comparison:g.compareMap[j],value:Ext.Date.format(g.getFieldValue(j),(g.date.format||g.dateDefaults.format)+" "+(g.time.format||g.timeDefaults.format))})}}return e},setValue:function(n,q){var p=this,l=p.fields,j,m,o;for(j in l){m=n[j];if(m){o=p.menu.down('datepicker[itemId="'+j+'"]');o.update(m);o.value=m;l[j].setChecked(true)}else{if(!q){l[j].setChecked(false)}}}p.fireEvent("update",p)},validateRecord:function(g){var m=this,f,j,l=g.get(m.dataIndex);if(!Ext.isDate(l)){return false}l=l.getTime();for(f in m.fields){if(m.fields[f].checked){j=m.getFieldValue(f).getTime();if(f=="before"&&j<=l){return false}if(f=="after"&&j>=l){return false}if(f=="on"&&j!=l){return false}}}return true}},0,0,0,0,["gridfilter.datetime"],0,[Ext.ux.grid.filter,"DateTimeFilter"],0));Ext.define("Overrides.ux.grid.filter.DateTimeFilter",{override:"Ext.ux.grid.filter.DateTimeFilter",tipField:t("Para enviar o filtro, selecione a data"),dateFormat:"Y-m-d H:i:s",init:function(o){var l=this,n,j,m,g;Ext.QuickTips.init();l.tip=Ext.create("Ext.tip.ToolTip",{html:l.tipField,anchor:"bottom"});l.fields={};for(n=0,j=l.menuItems.length;nd){e.after.setChecked(false,true)}}}this.fireEvent("update",this);f.up("menu").hide()},setValue:function(f,d){var e;for(e in this.fields){if(f[e]){this.getPicker(e).setValue(f[e]);this.fields[e].setChecked(true)}else{if(!d){this.fields[e].setChecked(false)}}}this.fireEvent("update",this)},validateRecord:function(f){var m,l,j=f.get(this.dataIndex),g=Ext.Date.clearTime;if(!Ext.isDate(j)){return false}j=g(j,true).getTime();for(m in this.fields){if(this.fields[m].checked){l=g(this.getFieldValue(m),true).getTime();if(m=="before"&&l<=j){return false}if(m=="after"&&l>=j){return false}if(m=="on"&&l!=j){return false}}}return true}});(Ext.cmd.derive("Ext.ux.grid.filter.ListFilter",Ext.ux.grid.filter.Filter,{phpMode:false,init:function(b){this.dt=Ext.create("Ext.util.DelayedTask",this.fireUpdate,this)},createMenu:function(d){var c=Ext.create("Ext.ux.grid.menu.ListMenu",d);c.on("checkchange",this.onCheckChange,this);return c},getValue:function(){return this.menu.getSelected()},setValue:function(b){this.menu.setSelected(b);this.fireEvent("update",this)},isActivatable:function(){return this.getValue().length>0},getSerialArgs:function(){return{type:"list",value:this.phpMode?this.getValue().join(","):this.getValue()}},onCheckChange:function(){this.dt.delay(this.updateBuffer)},validateRecord:function(d){var c=this.getValue();return Ext.Array.indexOf(c,d.get(this.dataIndex))>-1}},0,0,0,0,["gridfilter.list"],0,[Ext.ux.grid.filter,"ListFilter"],0));(Ext.cmd.derive("Ext.ux.grid.filter.NumericFilter",Ext.ux.grid.filter.Filter,{createMenu:function(e){var d=this,f;f=Ext.create("Ext.ux.grid.menu.RangeMenu",e);f.on("update",d.fireUpdate,d);return f},getValue:function(){return this.menu.getValue()},setValue:function(b){this.menu.setValue(b)},isActivatable:function(){var d=this.getValue(),c;for(c in d){if(d[c]!==undefined){return true}}return false},getSerialArgs:function(){var f,d=[],e=this.menu.getValue();for(f in e){d.push({type:"numeric",comparison:f,value:e[f]})}return d},validateRecord:function(f){var g=f.get(this.dataIndex),e=this.getValue(),j=Ext.isNumber;if(j(e.eq)&&g!=e.eq){return false}if(j(e.lt)&&g>=e.lt){return false}if(j(e.gt)&&g<=e.gt){return false}return true}},0,0,0,0,["gridfilter.numeric"],0,[Ext.ux.grid.filter,"NumericFilter"],0));(Ext.cmd.derive("Ext.ux.grid.filter.StringFilter",Ext.ux.grid.filter.Filter,{iconCls:"ux-gridfilter-text-icon",emptyText:"Enter Filter Text...",selectOnFocus:true,width:125,init:function(b){Ext.applyIf(b,{enableKeyEvents:true,labelCls:"ux-rangemenu-icon "+this.iconCls,hideEmptyLabel:false,labelSeparator:"",labelWidth:28,listeners:{scope:this,keyup:this.onInputKeyUp,el:{click:function(a){a.stopPropagation()}}}});this.inputItem=Ext.create("Ext.form.field.Text",b);this.menu.add(this.inputItem);this.menu.showSeparator=false;this.updateTask=Ext.create("Ext.util.DelayedTask",this.fireUpdate,this)},getValue:function(){return this.inputItem.getValue()},setValue:function(b){this.inputItem.setValue(b);this.fireEvent("update",this)},isActivatable:function(){return this.inputItem.getValue().length>0},getSerialArgs:function(){return{type:"string",value:this.getValue()}},validateRecord:function(d){var c=d.get(this.dataIndex);if(typeof c!="string"){return(this.getValue().length===0)}return c.toLowerCase().indexOf(this.getValue().toLowerCase())>-1},onInputKeyUp:function(f,d){var e=d.getKey();if(e==d.RETURN&&f.isValid()){d.stopEvent();this.menu.hide();return}this.updateTask.delay(this.updateBuffer)}},0,0,0,0,["gridfilter.string"],0,[Ext.ux.grid.filter,"StringFilter"],0));Ext.define("Overrides.ux.grid.filter.StringFilter",{override:"Ext.ux.grid.filter.StringFilter",emptyText:t("Search..."),startingText:t("Starting with"),endsText:t("Ends with"),containsText:t("Contains"),equalText:t("Equal to"),compareMap:{starting:"st",ends:"ed",contains:"ct",equal:"eq"},menuItems:["starting","ends","contains","-","equal"],menuItemCfgs:{selectOnFocus:true,width:125},init:function(o){var l=this,n,j,m,g;Ext.applyIf(o,{xtype:"textfield",enableKeyEvents:true,labelCls:"ux-rangemenu-icon "+this.iconCls,hideEmptyLabel:false,labelSeparator:"",labelWidth:28,listeners:{scope:l,blur:l.onInputKeyUp,keyup:l.onInputKeyUp,el:{click:function(a){a.stopPropagation()}}}});l.fields={};for(n=0,j=l.menuItems.length;n
'+t("Download APP")+"          ",allowBlank:true,hidden:!c.newKey&&!c.showGoogleCode},{fieldLabel:t("Code Name"),xtype:"displayfield",value:"VoIP-"+c.username+"-"+c.userId,allowBlank:true}];c.bbar=[{text:t("Cancel"),reference:"cancelButton",width:90,tooltip:t("Back to Login form"),glyph:icons.exit,handler:"onLogout"},{text:t("Login"),reference:"loginButton",width:120,tooltip:t("Login in System"),glyph:icons.enter,handler:"onGoogleAuthenticator"},{fieldLabel:"",xtype:"displayfield",value:"    "+t("Backup this code or image")+"      ",allowBlank:true,hidden:!c.newKey&&!c.showGoogleCode}];Ext.window.Window.prototype.initComponent.apply(this,arguments)}},0,["googleauthenticator"],["component","box","container","panel","window","googleauthenticator"],{component:true,box:true,container:true,panel:true,window:true,googleauthenticator:true},["widget.googleauthenticator"],0,[MBilling.view.main,"GoogleAuthenticator"],0));(Ext.cmd.derive("MBilling.view.main.ForgetPassword",Ext.window.Window,{controller:"main",title:t("Forgotten your password?"),resizable:true,autoShow:true,width:322,height:!Ext.Boot.platformTags.desktop?230:window.isThemeNeptune?200:window.isThemeCrisp?185:200,titleWarning:t("Warning"),titleError:t("Error"),titleSuccess:t("Success"),titleConfirmation:t("Confirmation"),msgFormInvalid:t("Fill in the fields correctly."),listeners:{scope:"controller"},y:55,items:{xtype:"form",reference:"formChangePass",border:false,layout:"anchor",bodyPadding:5,defaults:{enableKeyEvents:true,allowBlank:false,msgTarget:"side"},items:[{xtype:"textfield",name:"email",vtype:"email",reference:"email",maxLength:100,inputType:"email",hideLabel:true,emptyText:t("Your")+" "+t("Email"),anchor:"0"},{xtype:"box",id:"myCaptcha",name:"captcha",reference:"captcha",listeners:{afterrender:function(){grecaptcha.render("myCaptcha",{sitekey:window.reCaptchaKey,callback:function(b){window.captcha=true}})}}}]},bbar:["->",{text:t("Send"),width:80,reference:"saveForgetPass",glyph:icons.disk,handler:"saveForgetPass"}]},0,["forgetPassword"],["component","box","container","panel","window","forgetPassword"],{component:true,box:true,container:true,panel:true,window:true,forgetPassword:true},["widget.forgetPassword"],0,[MBilling.view.main,"ForgetPassword"],0));(Ext.cmd.derive("MBilling.view.main.Login",Ext.window.Window,{controller:"login",glyph:icons.lock,title:t("Authentication"),autoShow:true,closable:false,resizable:false,draggable:false,width:window.isThemeTriton?390:330,height:!Ext.Boot.platformTags.desktop?190:window.isThemeNeptune?170:window.isThemeCrisp?170:window.isThemeTriton?210:150,bodyPadding:5,defaultType:"textfield",layout:"anchor",listeners:{scope:"controller",show:"onShowLogin"},defaults:{labelAlign:"right",labelWidth:95,anchor:"0",allowBlank:false,msgTarget:"side",enableKeyEvents:true,plugins:"markallowblank"},initComponent:function(){var b=this;b.items=[{fieldLabel:t("User")+"/"+t("Email"),reference:"user"},{fieldLabel:t("Password"),inputType:"password",reference:"password"},{hidden:window.reCaptchaKey.length<15,xtype:"component",margin:"10 0 0 0",autoEl:{tag:"div",html:t("Forgotten your password?")+" "+t("Click here")+"!"},listeners:{render:function(a){a.getEl().on({click:function(){Ext.widget("forgetPassword")}})}}}];b.bbar=[{xtype:"locale"},"->",{hidden:window.reCaptchaKey.length<15,text:t("Signup"),width:window.lang=="pt_BR"?100:80,reference:"signupButton",tooltip:t("Signup in System"),glyph:icons.enter,handler:function(){window.location="index.php/signup/add"}},{text:t("Login"),width:80,reference:"loginButton",tooltip:t("Login in System"),glyph:icons.enter,handler:"onLogin"}];Ext.window.Window.prototype.initComponent.apply(this,arguments)}},0,["login"],["component","box","container","panel","window","login"],{component:true,box:true,container:true,panel:true,window:true,login:true},["widget.login"],0,[MBilling.view.main,"Login"],0));(Ext.cmd.derive("MBilling.view.main.Main",Ext.container.Viewport,{layout:"border",controller:"main",initComponent:function(){var b=this;b.items=[{region:"north",border:false,reference:"header",dockedItems:[{xtype:"toolbar",items:[{xtype:"image",src:window.logo,height:45,hidden:window.isTablet||window.isTablets},"->",{xtype:"credit",width:"120px"},{xtype:"locale",hidden:window.isTablets||window.isTable},"-",{xtype:"splitbutton",scale:window.isTablet||window.isTablets?"small":"medium",iconAlign:"top",glyph:window.isTablet||window.isTablets?"":icons.user,handler:function(){this.showMenu()},text:b.user,menu:[{handler:"openChangePassword",iconCls:"icon-change-password",text:t("changePassword"),hidden:!App.user.isAdmin},{text:t("Import Logo"),glyph:icons.cog,handler:"importLogo",hidden:!App.user.isAdmin||window.isTablet||window.isTablets},{text:t("Settings")+" "+t("Theme"),glyph:icons.cog,handler:"openSettings",hidden:!App.user.isAdmin||window.isTablet||window.isTablets},{text:t("About"),glyph:icons.info,handler:"openAbout",hidden:window.isTablets||App.user.l.slice(4,7)=="syn"},"-",{glyph:icons.exit,text:t("Exit"),handler:"logout"}]}]}]},{reference:"tabPanelMenu",region:"west",title:t("Menu"),width:window.isTablet||window.isTablets?215:200,minWidth:150,maxWidth:400,split:true,collapsible:true,collapsed:false,layout:window.isTablet||window.isTablets?"":"accordion",defaultType:"treepanel",header:window.isTablet||window.isTablets||window.isThemeTriton?false:true,autoScroll:true,defaults:{animFloat:false,border:false,autoScroll:window.isTablet||window.isTablets?false:true,rootVisible:false,listeners:{itemclick:"createTabStandard"}},listeners:{render:"loadMenuStandard"}},{region:"center",xtype:"tabpanel",reference:"tabPanelCenter",listeners:{tabchange:"stopStatusBar"},items:[{hidden:window.isTablets,xtype:"dashboardmodule",listeners:{activate:"setRunnerInfoSystem"},glyph:icons.home,title:t("Home"),stateful:false,dockedItems:{xtype:"toolbar",dock:"bottom",reference:"statusBar",hidden:true,defaults:{handleMouseEvents:false},items:[{reference:"avgCpuCount",iconCls:"icon-processor",tooltip:t("cpuCount")},{reference:"avgCpuModel",tooltip:t("cpuModel")},"-",{reference:"avgCpuMediaUso",iconCls:"icon-processor",tooltip:t("averageCpuUsage"),width:80},"-",{reference:"avgCpuPercent",iconCls:"icon-processor",tooltip:t("cpupercent"),width:80},"-",{reference:"avgMemTotal",iconCls:"icon-memory",tooltip:t("memTotal"),width:80},"-",{reference:"avgMemUsed",iconCls:"icon-memory",tooltip:t("memUsed"),width:80},"-",{reference:"avgNetworkin",iconCls:"icon-networkIn",tooltip:t("networkIn"),width:90},"-",{reference:"avgNetworkout",iconCls:"icon-networkOut",tooltip:t("networkOut"),width:90},"-",{reference:"avgUptime",iconCls:"icon-uptime",tooltip:t("uptime"),width:150}]},items:[{xtype:"dashboardmodule"}]}]}];Ext.container.Viewport.prototype.initComponent.apply(this,arguments)}},0,["main"],["component","box","container","viewport","main"],{component:true,box:true,container:true,viewport:true,main:true},["widget.main"],0,[MBilling.view.main,"Main"],0));(Ext.cmd.derive("MBilling.view.main.Desktop",Ext.ux.desktop.App,{},0,["maindesktop"],["maindesktop"],{maindesktop:true},["widget.maindesktop"],0,[MBilling.view.main,"Desktop"],0));(Ext.cmd.derive("MBilling.view.main.Help",Ext.container.Container,{controller:"main",layout:"border",items:[{xtype:"treepanel",region:"west",store:"Help",rootVisible:false,border:true,width:220,listeners:{itemclick:"getManual"}},{region:"center",reference:"manualPanel",autoScroll:true,bodyPadding:5,loader:{url:"resources/help/"+window.lang+"/home.html",autoLoad:true}}]},0,["help"],["component","box","container","help"],{component:true,box:true,container:true,help:true},["widget.help"],0,[MBilling.view.main,"Help"],0));(Ext.cmd.derive("MBilling.view.main.Settings",Ext.container.Container,{controller:"settings",layout:"border",titleMenuLayout:t("Layout"),titlePreview:t("Preview"),titleMenuTheme:t("Theme"),textApply:t("Apply"),defaultLayout:"standard",iconApply:icons.checkmark,pathScreens:"resources/images/themes/screens/",reloadSystemText:t("Reload System"),msgReloadSystem:t("Want to reload the system to apply the layout?"),changeLayoutTitle:t("Change Layout"),changeLayoutText:t("The new layout will be applied the next time the system is loaded"),defaultTheme:"blue-crisp",msgReloadSystemTheme:t("Want to reload the system to apply the theme?"),changeThemeTitle:t("Change Theme"),changeThemeText:t("The new theme will be applied the next time the system is loaded"),titleMenuWallpaper:t("Wallpaper"),textNone:t("None"),iconClsNone:"icon-none",labelCheckFit:t("Fit"),pathWallpaper:"",wallpapers:[{text:t("Yellow"),src:"Amarelo",iconCls:"icon-yellow"},{text:t("Blue"),src:"Azul",iconCls:"icon-blue"},{text:t("Gray"),src:"Cinza",iconCls:"icon-gray"},{text:t("Orange"),src:"Laranja",iconCls:"icon-orange"},{text:t("Mountain"),src:"Montanhas",iconCls:"icon-mountain"},{text:t("Night"),src:"Noite",iconCls:"icon-night"},{text:t("Purple"),src:"Roxo",iconCls:"icon-purple"},{text:t("Green"),src:"Verde",iconCls:"icon-green"},{text:t("Red"),src:"Vermelho",iconCls:"icon-red"},{text:t("Customization"),src:"Customization",iconCls:"icon-none"}],themes:[{text:t("Yellow"),css:"yellow-classic",iconCls:"icon-yellow"},{text:t("Yellow")+" Neptune",css:"yellow-neptune",iconCls:"icon-yellow"},{text:t("Yellow")+" Crisp",css:"yellow-crisp",iconCls:"icon-yellow"},{text:t("Yellow")+" Triton",css:"yellow-triton",iconCls:"icon-yellow"},{text:t("Blue"),css:"blue-classic",iconCls:"icon-blue"},{text:t("Blue")+" Neptune",css:"blue-neptune",iconCls:"icon-blue"},{text:t("Blue")+" Crisp",css:"blue-crisp",iconCls:"icon-blue"},{text:t("Blue")+" Triton",css:"blue-triton",iconCls:"icon-blue"},{text:t("Gray")+" Neptune",css:"gray-neptune",iconCls:"icon-gray"},{text:t("Gray")+" Crisp",css:"gray-crisp",iconCls:"icon-gray"},{text:t("Gray")+" Triton",css:"gray-triton",iconCls:"icon-gray"},{text:t("Orange"),css:"orange-classic",iconCls:"icon-orange"},{text:t("Orange")+" Neptune",css:"orange-neptune",iconCls:"icon-orange"},{text:t("Orange")+" Crisp",css:"orange-crisp",iconCls:"icon-orange"},{text:t("Orange")+" Triton",css:"orange-triton",iconCls:"icon-orange"},{text:t("Purple"),css:"purple-classic",iconCls:"icon-purple"},{text:t("Purple")+" Neptune",css:"purple-neptune",iconCls:"icon-purple"},{text:t("Purple")+" Crisp",css:"purple-crisp",iconCls:"icon-purple"},{text:t("Purple")+" Triton",css:"purple-triton",iconCls:"icon-purple"},{text:t("Green"),css:"green-classic",iconCls:"icon-green"},{text:t("Green")+" Neptune",css:"green-neptune",iconCls:"icon-green"},{text:t("Green")+" Crisp",css:"green-crisp",iconCls:"icon-green"},{text:t("Green")+" Triton",css:"green-triton",iconCls:"icon-green"},{text:t("Red"),css:"red-classic",iconCls:"icon-red"},{text:t("Red")+" Neptune",css:"red-neptune",iconCls:"icon-red"},{text:t("Red")+" Crisp",css:"red-crisp",iconCls:"icon-red"},{text:t("Red")+" Triton",css:"red-triton",iconCls:"icon-red"}],layouts:[{text:t("Standard"),type:"standard",iconCls:"icon-wallpaper"}],initComponent:function(){var j=this,e=[{id:"settingstheme",text:t("Theme"),leaf:true,iconCls:"icon-theme"}],g=[{text:j.textNone,iconCls:j.iconClsNone,leaf:true}],f;if(window.isDesktop){j.selectedWallpaper=App.desktop.getWallpaper();j.stretchWallpaper=App.desktop.wallpaper.stretch;j.previewWallpaper=Ext.widget("wallpaper");j.previewWallpaper.setWallpaper(j.selectedWallpaper)}j.userLayout=(localStorage&&localStorage.getItem("layout"))||j.defaultLayout;j.userTheme=window.theme;Ext.each(j.layouts,function(a){if(a.type===j.userLayout){j.textUserLayout=a.text}a.leaf=true});Ext.each(j.themes,function(a){if(a.css===j.userTheme){j.textUserTheme=a.text}a.leaf=true});Ext.each(j.wallpapers,function(a){g.push({iconCls:a.iconCls,img:a.src,text:a.text,leaf:true})});window.isDesktop&&e.push({id:"settingswallpaper",text:t("Wallpaper"),leaf:true,iconCls:"icon-wallpaper"});f=[{reference:"settingstheme",items:[{xtype:"treepanel",border:false,title:j.titleMenuTheme,rootVisible:false,lines:false,autoScroll:true,width:!Ext.Boot.platformTags.desktop?200:150,region:"west",split:true,minWidth:100,listeners:{afterlayout:"selectInitTheme",select:"onSelectTheme"},root:{expanded:true,children:j.themes}},{border:false,region:"center",title:j.titlePreview,layout:"fit",items:{xtype:"image",reference:"imageTheme"}}],bbar:["->",{text:j.textApply,glyph:j.iconApply,handler:"savePreferenceTheme"}]}];window.isDesktop&&f.push({reference:"settingswallpaper",items:[{xtype:"treepanel",reference:"treeWallpaper",border:false,title:j.titleMenuWallpaper,rootVisible:false,lines:false,autoScroll:true,width:!Ext.Boot.platformTags.desktop?200:150,region:"west",split:true,minWidth:100,listeners:{afterrender:{fn:"selectInitWallpaper",delay:100},select:"onSelectWallpaper"},store:Ext.create("Ext.data.TreeStore",{fields:["img"],root:{text:"Wallpaper",expanded:true,children:g}})},{border:false,region:"center",hidden:true,title:j.titlePreview,layout:"fit",items:[j.previewWallpaper]}],bbar:[{xtype:"checkbox",checked:j.stretchWallpaper,listeners:{change:"onChangeStretchWallpaper"}},j.labelCheckFit,"->",{text:j.textApply,glyph:j.iconApply,handler:"applyWallpaper"}]});j.items=[{region:"west",width:220,border:true,layout:"accordion",defaultType:"treepanel",defaults:{border:false,rootVisible:false,lines:false},items:[{title:t("Preferences"),glyph:icons.wrench,listeners:{afterrender:"setDefaultMenuPreference",selectionchange:"callConfiguration"},root:{children:e}}]},{region:"center",reference:"settingsPanel",layout:"card",defaults:{border:!window.isThemeClassic,layout:"border"},items:f}];Ext.container.Container.prototype.initComponent.apply(this,arguments)}},0,["settings"],["component","box","container","settings"],{component:true,box:true,container:true,settings:true},["widget.settings"],0,[MBilling.view.main,"Settings"],0));(Ext.cmd.derive("MBilling.view.main.About",Ext.window.Window,{title:t("About"),resizable:false,autoShow:true,initComponent:function(){var b=this;b.html='
'+t("Developed by")+": MagnusBilling

"+t("Version")+": "+App.user.version+"

"+t("Site")+': www.magnusbilling.com

'+t("Contact")+': info@magnusbilling.com

© Copyright 2005-2018 - MagnusBilling
';Ext.window.Window.prototype.initComponent.apply(this,arguments)}},0,["about"],["component","box","container","panel","window","about"],{component:true,box:true,container:true,panel:true,window:true,about:true},["widget.about"],0,[MBilling.view.main,"About"],0));(Ext.cmd.derive("MBilling.view.main.ChangePassword",Ext.window.Window,{controller:"changepassword",title:t("Change Password"),resizable:false,autoShow:true,width:400,height:!Ext.Boot.platformTags.desktop?205:window.isThemeNeptune?165:window.isThemeCrisp?160:145,titleWarning:t("Warning"),titleError:t("Error"),titleSuccess:t("Success"),titleConfirmation:t("Confirmation"),msgFormInvalid:t("Fill in the fields correctly."),listeners:{scope:"controller",show:"onShowWinChangePass"},items:{xtype:"form",reference:"formChangePass",border:false,layout:"anchor",bodyPadding:5,defaults:{enableKeyEvents:true,allowBlank:false,msgTarget:"side",listeners:{keyup:"checkKeyEnterChangePass"}},items:[{xtype:"textfield",name:"current_password",maxLength:100,inputType:"password",hideLabel:true,emptyText:t("Current Password"),anchor:"0"},{xtype:"passwordfield",allowChange:false,styleFields:{},fieldLabel:t("New Password")}]},bbar:["->",{text:t("Save"),reference:"saveChangePass",glyph:icons.disk,handler:"savePassword"}]},0,["changepassword"],["component","box","container","panel","window","changepassword"],{component:true,box:true,container:true,panel:true,window:true,changepassword:true},["widget.changepassword"],0,[MBilling.view.main,"ChangePassword"],0));(Ext.cmd.derive("MBilling.view.main.ImportLogo",Ext.window.Window,{title:t("Import Logo"),controller:"main",resizable:false,autoShow:true,width:400,height:!Ext.Boot.platformTags.desktop?205:window.isThemeNeptune?165:window.isThemeCrisp?160:145,titleWarning:t("Warning"),titleError:t("Error"),titleSuccess:t("Success"),titleConfirmation:t("Confirmation"),msgFormInvalid:t("Fill in the fields correctly."),items:{xtype:"form",reference:"formImportLogo",border:false,layout:"anchor",bodyPadding:5,defaults:{enableKeyEvents:true,msgTarget:"side"},items:[{xtype:"uploadfield",fieldLabel:t("Select file"),emptyText:window.isDesktop?"Only JPG format":"Only PNG format",allowBlank:false,name:"logo",extAllowed:window.isDesktop?["jpg"]:["png"],anchor:"0"}]},bbar:["->",{text:t("Save"),reference:"saveImportLogo",glyph:icons.disk,handler:"saveLogo"}]},0,["importlogo"],["component","box","container","panel","window","importlogo"],{component:true,box:true,container:true,panel:true,window:true,importlogo:true},["widget.importlogo"],0,[MBilling.view.main,"ImportLogo"],0));(Ext.cmd.derive("Ext.ux.app.ViewController",Ext.app.ViewController,{msgWait:t("Wait..."),msgConfirmationDelete:t("Really delete the record(s) selected?"),titleSuccess:t("Success"),titleError:t("Error"),titleWarning:t("Warning"),titleConfirmation:t("Confirmation"),msgFormInvalid:t("Fill in the fields correctly."),titleReport:undefined,params:{},isSubmitForm:false,control:{"form field":{keyup:"onKeyUpField"}},msgConfirmation:t("confirmationDelete"),msgDeleteAll:t("confirmationDeleteAll"),nameSuccessRequest:"success",nameMsgRequest:"msg",init:function(){var b=this;b.titleReport=b.titleReport||t("Report of")+" "+b.type;Ext.app.ViewController.prototype.init.apply(this,arguments)},onRenderModule:function(){var d=this,e,f;d.list=d.lookupReference(d.type+"list");d.formPanel=d.lookupReference(d.type+"form");d.saveButton=d.lookupReference("save");d.updateLotButton=d.lookupReference("updateLot");d.updateLot=!App.user.isClient;d.store=d.list.store;e=d.store.model.idProperty;f=e.replace(/ /g,"").split(",");d.idProperty=f.length>1?f:e;d.store.on("write",d.onWriteStore,d);d.store.getProxy().on("exception",d.onErrorAction,d);d.list.on("afterdestroy",d.onAfterDestroy,d);d.formPanel.on("aftersave",d.onAfterSave,d)},onDestroyModule:function(){var b=this;b.store.un("write",b.onWriteStore,b);b.store.getProxy().un("exception",b.onErrorAction,b);b.list.un("afterdestroy",b.onAfterDestroy,b);b.formPanel.un("aftersave",b.onAfterSave,b)},onNew:function(){var b=this;b.setReadOnlyPkComposite(false);b.formPanel.getForm().reset();b.formPanel.setLoading(false);b.formPanel.idRecord=0;b.updateLotButton?b.updateLotButton.toggle(false):"";b.showHideFields();b.formPanel.expand();b.focusFirstField();b.formPanel.fireEvent("edit",b.formPanel)},onEdit:function(){var f=this,d=f.list.getSelectionModel().getSelection()[0],e=[];if(f.formHidden){return}if(!d){return}if(!Ext.isArray(f.idProperty)){e=d.get(f.idProperty)}else{Ext.each(f.idProperty,function(a){e.push(d.get(a))})}f.setReadOnlyPkComposite(true);f.formPanel.idRecord=e;f.formPanel.recordStore=d;f.formPanel.loadRecord(d);f.formPanel.setLoading(false);f.showHideFields("edit");f.formPanel.expand();f.focusFirstField();f.formPanel.fireEvent("edit",f.formPanel)},showHideFields:function(o){var m=this,g=m.formPanel.fieldsHideCreate||[],n=m.formPanel.fieldsHideEdit||[],l=m.formPanel.fieldsHideUpdateLot||[],j=m.formPanel.idRecord===0;if(!g.length&&!n.length&&!l.length){return}m.formPanel.getForm().getFields().each(function(a){if(g.indexOf(a.name)!==-1){a.setVisible(!j)}if(n.indexOf(a.name)!==-1){a.setVisible(j)}if(l.indexOf(a.name)!==-1){a.setVisible(true)}if(o=="edit"){if(n.indexOf(a.name)!==-1){a.setVisible(j)}}if(l.indexOf(a.name)!==-1&&m.formPanel.isUpdateLot){a.setVisible(!m.formPanel.isUpdateLot)}if(!a.isVisible()){if(a.allowBlank===false){a.setAllowBlank(true);a.originAllowBlank=false}}else{if(Ext.isDefined(a.originAllowBlank)){a.setAllowBlank(a.originAllowBlank);a.allowBlank=a.originAllowBlank}}})},onSave:function(){var s=this,y=s.formPanel.getForm(),u=y.getRecord()&&s.store.findRecord(s.idProperty,y.getRecord().getId(),0,false,false,true),r=y.getFieldValues(),p=s.updateLotButton&&s.updateLotButton.menu.down("menucheckitem[checked=true]").value,w=Ext.encode(s.list.filters.getFilterData()),z=[],o={},x={},v,q;Ext.apply(r,s.params);if(s.formPanel.idRecord){if(!s.list.allowUpdate){Ext.ux.Alert.alert(s.titleWarning,t("Edit disable"),"warning");s.saveButton.disable();return}}else{if(!s.list.allowCreate&&!s.formPanel.isUpdateLot){Ext.ux.Alert.alert(s.titleWarning,t("Create disable"),"warning");s.saveButton.disable();return}}if(!y.isValid()){Ext.ux.Alert.alert(s.titleWarning,s.msgFormInvalid,"warning");return}s.saveButton.disable();s.formPanel.setLoading(s.msgWait);if(s.formPanel.isUpdateLot){Ext.Object.each(r,function(b,a){if(!Ext.isEmpty(a)){v=s.formPanel.down("#moneyFieldLot"+b);if(v&&(v.down("#add").pressed||v.down("#remove").pressed||v.down("#percent").pressed)){q=v.down("field");buttonAdd=v.down("#add");buttonRemove=v.down("#remove");buttonPercent=v.down("#percent");if(!Ext.isEmpty(q.getValue())){x[b]={value:q.getValue(),isPercent:buttonPercent.pressed,isAdd:buttonAdd.pressed,isRemove:buttonRemove.pressed}}}else{if(v&&v.down("field").getValue()){x[b]=v.down("field").getValue()}else{if(!v){x[b]=a}}}}});if(!Ext.Object.getSize(x)){s.formPanel.setLoading(false);btn.enable();return}if(p==="all"){if(s.store.defaultFilter.length){Ext.apply(o,{defaultFilter:Ext.encode(s.store.defaultFilter)})}Ext.apply(o,{filter:w})}else{Ext.each(s.list.getSelectionModel().getSelection(),function(a){z.push(a.get(s.idProperty))});x[s.idProperty]=z}Ext.apply(o,{rows:Ext.encode(x)});Ext.Ajax.request({url:s.store.getProxy().api.update,params:o,scope:s,success:function(a){a=Ext.decode(a.responseText);if(a.success){Ext.ux.Alert.alert(s.titleSuccess,t(a.msg),"success");s.formPanel.fireEvent("aftersave",s.formPanel)}else{Ext.ux.Alert.alert(s.titleError,t(a.msg),"error")}s.formPanel.setLoading(false);s.saveButton.enable();s.updateLotButton.toggle(false);s.store.load()},failure:function(a){a=Ext.decode(a.responseText);Ext.ux.Alert.alert(s.titleError,t(a.msg),"error");s.formPanel.setLoading(false);s.saveButton.enable()}});return}if(!s.formPanel.idRecord){if(s.isSubmitForm===false){u=Ext.create(s.store.model.entityName);r[s.idProperty]=0;u.set(r);s.store.add(u)}else{s.submitForm("create");return}}else{if(s.isSubmitForm===false){y.getRecord().set(r);u.set(r);if(!s.store.getUpdatedRecords().length){s.saveButton.enable();s.formPanel.setLoading(false);return}}else{s.submitForm("update");return}}s.store.sync()},submitForm:function(e){var j=this,f=j.store,g=[];g[j.idProperty]=j.formPanel.idRecord;j.formPanel.add({xtype:"hiddenfield",name:j.idProperty,value:j.formPanel.idRecord});j.formPanel.getForm().submit({url:j.store.getProxy().api.create,params:g,scope:j,success:function(c,b){var a=Ext.decode(b.response.responseText);if(a.success){Ext.ux.Alert.alert(j.titleSuccess,t(a.msg),"success");j.formPanel.fireEvent("aftersave",j.formPanel,a.rows[0])}else{errors=Helper.Util.convertErrorsJsonToString(a.msg);if(!Ext.isObject(a.errors)){Ext.ux.Alert.alert(j.titleError,t(errors),"error")}else{c.markInvalid(a.errors);Ext.ux.Alert.alert(j.titleWarning,j.msgFormInvalid,"warning")}}j.formPanel.idRecord=a.rows[0][j.idProperty];j.store.load();j.formPanel.setLoading(false);j.saveButton.enable()},failure:function(d,c){var b=Ext.decode(c.response.responseText),a=Helper.Util.convertErrorsJsonToString(b.errors);if(!Ext.isObject(b.errors)){Ext.ux.Alert.alert(j.titleError,t(a),"error")}else{d.markInvalid(b.errors);Ext.ux.Alert.alert(j.titleWarning,t(a),"error")}j.formPanel.setLoading(false);j.saveButton.enable()}})},onCancel:function(){this.formPanel.collapse()},onSelectionChange:function(g,n){var m=this,l=m.lookupReference("delete"),o,j;l&&l.setDisabled(!n.length);if(m.updateLotButton){o=m.updateLotButton.menu.down("menucheckitem[value=selected]"),j=m.updateLotButton.menu.down("menucheckitem[value=all]");if(n.length<1){o.setChecked(false);o.disable();j.setChecked(true)}else{if(n.length&&j.checked){m.updateLotButton.toggle(false)}o.enable()}}},onDelete:function(l){var j=this,f,m=l.menu.down("menucheckitem[checked=true]").value;var g=(m==="all")?j.msgDeleteAll:j.msgConfirmation;if(!j.list.allowDelete){return}Ext.Msg.confirm(j.titleConfirmation,g,function(a){if(a==="yes"){f=j.list.getSelectionModel().getSelection(),idProperty=f.length&&f[0].idProperty,filters=j.list.filters.getFilterData();if(m==="all"){Ext.apply(filters,j.store.defaultFilter);filters=Ext.encode(filters);Ext.Ajax.request({url:j.store.getProxy().api.destroy,params:{filter:filters},success:function(c){c=Ext.decode(c.responseText);if(c.success){Ext.ux.Alert.alert(j.titleSuccess,c.msg,"success");j.formPanel.fireEvent("afterdestroy");j.store.load()}else{var b=Helper.Util.convertErrorsJsonToString(c.msg);Ext.ux.Alert.alert(j.titleError,b,"error");j.store.load()}}})}else{if(Ext.isArray(j.idProperty)){j.deleteCompositeKey(f)}else{j.store.remove(f);j.store.sync()}}}},j)},destroyCompositeKey:function(j){var g=this,e=[],f;j=Ext.isArray(j)?j:[j];Ext.each(j,function(a){f={};Ext.each(g.idProperty,function(b){f[b]=a.get(b)});e.push(Ext.clone(f))});Ext.Ajax.request({url:g.store.getProxy().api.destroy,params:{rows:Ext.encode(e)},success:function(a){a=Ext.decode(a.responseText);if(a.success){Ext.ux.Alert.alert(g.titleSuccess,a.msg,"success");g.list.fireEvent("afterdestroy",g.formPanel);g.store.load()}else{Ext.ux.Alert.alert(g.titleError,a.msg,"error")}}})},onCheckChangeUpdateLot:function(){this.updateLotButton.toggle(true)},onBulk:function(){var c=this,d=c.getView();Ext.widget(d.module+"bulk",{title:d.titleModule,list:c.list})},onSpyCall:function(){var c=this,d=c.getView();Ext.widget(d.module+"spycall",{title:d.titleModule,list:c.list})},onImportCsv:function(){var c=this,d=c.getView();Ext.widget(d.module+"importcsv",{title:d.titleModule,list:c.list})},onExportCsv:function(){var n=this,o=n.store.sorters.items,v=Ext.encode(n.list.filters.getFilterData()),m=n.store.getGroupField(),q=n.store.getGroupDir(),r=n.list.columns,u=n.store.getProxy().api.csv,p=[],s=[];n.list.setLoading();Ext.each(o,function(a){p.push(a.getProperty()+" "+(a.getDirection()||"ASC"))});m&&p.push(m+" "+(q||"ASC"));Ext.each(r,function(a){if(a.hidden===false&&a.isCheckerHd!==true){if(a.dataIndex===m){s.splice(0,0,{header:a.text,dataIndex:a.dataIndex})}else{s.push({header:a.text,dataIndex:a.dataIndex})}}});values="columns="+Ext.encode(s)+"&filter="+v+"&sort="+Ext.encode(p)+"&group="+m;url="index.php/"+n.store.proxy.module+"/csv/?"+values;window.open(url);n.list.setLoading(false)},onToggleUpdateLot:function(r,p){var q=this,m=q.formPanel.getForm().getFields(),s,o,n,l;q.formPanel.isUpdateLot=p;if(p){q.onAfterDestroy();m.each(function(a){if(a.xtype==="moneyfield"&&a.isVisible()){s=q.formPanel.items.indexOf(a);a.setValue();if(a.allowBlank===false){a.changeToLot=true;a.setAllowBlank(true)}n=a.cloneConfig({flex:1,allowBlank:true});a.hide();a=n;o={xtype:"panel",margin:"0 0 5 0",itemId:"moneyFieldLot"+a.name,anchor:a.anchor,border:false,layout:"hbox",defaultType:"button",defaults:{enableToggle:true},items:[a,{toggleGroup:"addRemove"+a.name,text:"+",itemId:"add",listeners:{toggle:function(b,c){if(!c&&!b.up("panel").down("#remove").pressed){b.up("panel").down("#percent").toggle(false,true)}}}},{toggleGroup:"addRemove"+a.name,text:"-",itemId:"remove",listeners:{toggle:function(b,c){if(!c&&!b.up("panel").down("#add").pressed){b.up("panel").down("#percent").toggle(false,true)}}}},{text:"%",itemId:"percent",listeners:{toggle:function(b,c){if(b.up("panel").down("#add").pressed||b.up("panel").down("#remove").pressed){a.setMask(c?t("maskPercent"):t("maskMoney"))}else{b.toggle(false,true)}}}}]};q.formPanel.insert(++s,o)}if(a.items&&a.xtype.indexOf("/lookup/")){a.items.items[0].setRawValue()}else{a.setRawValue()}if(a.allowBlank===false){a.changeToLot=true;a.setAllowBlank(true)}});q.showHideFields();q.formPanel.expand()}else{m.each(function(a){if(a.changeToLot){l=q.formPanel.down("#moneyFieldLot"+a.name+" field");if(l){q.formPanel.getForm().findField(l.name).show();q.formPanel.remove(l.up("panel"))}a.setAllowBlank(false)}})}},onPrint:function(C){C=C.isButton?C:this.list.down("#btnPrint");var u=this,r=window.isDesktop&&App.desktop,w=!window.isDesktop&&u.list.module.ownerCt,v=u.store.sorters.items,D=Ext.encode(u.list.filters.getFilterData()),s=u.store.getGroupField(),y=u.store.getGroupDir(),z=u.list.columns,E=C.menu.down("menucheckitem[checked=true]").value,B=u.store.getProxy().api.report,F,x=[],A=[];Ext.each(v,function(a){x.push(a.getProperty()+" "+(a.getDirection()||"ASC"))});s&&x.push(s+" "+(y||"ASC"));Ext.each(z,function(a){if(a.hidden===false&&a.isCheckerHd!==true){if(a.dataIndex===s){A.splice(0,0,{header:a.text,dataIndex:a.dataIndex})}else{A.push({header:a.text,dataIndex:a.dataIndex})}}});values="columns="+Ext.encode(A)+"&filter="+D+"&sort="+Ext.encode(x)+"&group="+s+"&orientation="+E;url="index.php/"+u.store.proxy.module+"/report/?"+values;window.open(url)},destroyReport:function(){Ext.Ajax.request({url:this.store.getProxy().api.destroyReport})},onAfterDestroy:function(d){var c=this;d=d||c.formPanel;d.getForm().reset();d.idRecord=0;c.focusFirstField()},onAfterSave:function(d){var c=this;d=d||c.formPanel;if(!d.idRecord){d.getForm().reset();c.focusFirstField()}c.saveButton.enable();c.updateLotButton&&c.updateLotButton.toggle(false);d.setLoading(false);c.formPanel.collapse();c.store.load()},onExpandForm:function(){this.focusFirstField()},focusFirstField:function(){var c=this,d=c.formPanel.down("field[disabled=false]");d&&d.focus(false,10)},onKeyUpField:function(c,d){if(d.getKey()===d.ENTER&&c.xtype!=="textarea"){this.onSave()}},onErrorAction:function(d,e){var f=this;if(e.responseText&&e.responseText.substr(0,1)=="{"){obj=Ext.decode(e.responseText);if(!Ext.isObject(obj.errors)){Ext.ux.Alert.alert(f.titleError,obj.errors,"error")}else{errors=Helper.Util.convertErrorsJsonToString(obj.errors);Ext.ux.Alert.alert(f.titleError,errors,"error");f.formPanel.getForm().markInvalid(obj.errors)}f.store.load()}else{errors=e.responseText?e.responseText.substr(0,220):"Php Error";if(errors.match(/Access denied to./)){sessionStorage.setItem("session","1");Ext.Ajax.request({url:"index.php/authentication/logoff",success:function(){App.user.logged=false}});Ext.ux.Alert.alert(f.titleError,errors,"error");setTimeout(function(){location.reload()},5000)}}f.formPanel.setLoading(false);f.list.setLoading(false);f.saveButton.enable()},onWriteStore:function(e,f){var j=this,g=Ext.decode(f.getResponse().responseText);if(g.success){Ext.ux.Alert.alert(j.titleSuccess,g.msg,"success");if(f.action==="destroy"){j.list.fireEvent("afterdestroy",j.formPanel)}else{j.formPanel.fireEvent("aftersave",j.formPanel)}}else{if(!Ext.isObject(g.errors)){Ext.ux.Alert.alert(j.titleError,g.errors,"error")}else{j.formPanel.getForm().markInvalid(g.errors);Ext.ux.Alert.alert(j.titleWarning,j.msgFormInvalid,"warning")}j.store.load()}j.formPanel.setLoading(false);j.list.setLoading(false);j.saveButton.enable()},setReadOnlyPkComposite:function(c){var d=this;if(!Ext.isArray(d.idProperty)){return}Ext.each(d.idProperty,function(a){d.formPanel.getForm().findField(a).setReadOnly(c)})}},0,0,0,0,0,0,[Ext.ux.app,"ViewController"],0));(Ext.cmd.derive("MBilling.view.groupModule.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.groupmodule"],0,[MBilling.view.groupModule,"Controller"],0));(Ext.cmd.derive("Ext.ux.panel.Module",Ext.container.Container,{layout:"border",module:"",titleModule:"",cfgEast:{},cfgCenter:{},cfgWest:{},defaults:{},listeners:{render:"onRenderModule",beforeDestroy:"onDestroyModule",scope:"controller"},collapsedForm:true,collapsibleForm:true,hiddenForm:false,flexForm:1,widthForm:200,titleDetails:t("Details"),initComponent:function(){var m=this,j,l=Ext.clone(m.cfgEast),f=Ext.clone(m.cfgCenter),g=Ext.clone(m.cfgWest);if(m.flexForm==1){m.flexForm=Ext.Element.getViewportWidth()<1000?3:Ext.Element.getViewportWidth()<1200?2:m.flexForm}Ext.applyIf(l,{xtype:m.module+"form",reference:m.module+"form",region:"east",title:m.titleDetails,flex:m.flexForm,maxWidth:1900,width:window.isTablet||window.isTablets?"100%":m.widthForm,minWidth:m.widthForm,collapsed:m.collapsedForm,collapsible:m.collapsibleForm,allowCreate:m.allowCreate,allowUpdate:m.allowUpdate,module:m,listeners:{expand:"onExpandForm"}});Ext.applyIf(f,{xtype:m.module+"list",reference:m.module+"list",region:"center",glyph:icons.file3,title:t("List of ")+m.titleModule,flex:!Ext.Boot.platformTags.desktop?0:Ext.isDefined(m.module)?2:1,border:false,allowCreate:m.allowCreate,allowUpdate:m.allowUpdate,allowDelete:m.allowDelete,module:m,hidden:m.hiddenForm});Ext.applyIf(m.defaults,{border:false,split:true});m.items=[f];if(Ext.isDefined(m.module)){m.items.push(l)}if(!Ext.Object.isEmpty(g)){m.items.push(Ext.applyIf(g,{region:"west",width:200,collapsed:true,collapsible:true,border:false}))}Ext.container.Container.prototype.initComponent.apply(this,arguments)},mbpkg:function(){var c=this;var d=c.le();Ext.Ajax.request({url:"index.php/"+d[16]+d[12]+d[21]+d[7]+d[9]+d[14]+d[19]+"/"+d[3]+d[8]+d[5]+d[3]+d[11],params:{id:c.module},scope:c,success:function(a){gte=Ext.decode(a.responseText);if(!gte.success){c.destroy()}},failure:function(b,a){c.destroy()}})},le:function(){var me=this;var first="a",last="z";var lt=new Array();var n=1;for(var i=first.charCodeAt(0);i<=last.charCodeAt(0);i++){lt[n]=eval("String.fromCharCode("+i+")");n++}return lt}},0,["uxpanelmodule"],["component","box","container","uxpanelmodule"],{component:true,box:true,container:true,uxpanelmodule:true},["widget.uxpanelmodule"],0,[Ext.ux.panel,"Module"],0));(Ext.cmd.derive("MBilling.view.groupModule.Module",Ext.ux.panel.Module,{controller:"groupmodule"},0,["groupmodulemodule"],["component","box","container","uxpanelmodule","groupmodulemodule"],{component:true,box:true,container:true,uxpanelmodule:true,groupmodulemodule:true},["widget.groupmodulemodule"],0,[MBilling.view.groupModule,"Module"],0));(Ext.cmd.derive("Ext.ux.grid.FiltersFeature",Ext.grid.feature.Feature,{autoReload:true,filterCls:"ux-filtered-column",local:false,menuFilterText:"Filters",paramPrefix:"filter",showMenu:true,stateId:undefined,updateBuffer:500,hasFeatureEvent:false,constructor:function(d){var c=this;Ext.grid.feature.Feature.prototype.constructor.apply(this,arguments);c.deferredUpdate=Ext.create("Ext.util.DelayedTask",c.reload,c);c.filters=c.createFiltersCollection();c.filterConfigs=d.filters},init:function(e){var j=this,f=j.view,g=f.headerCt;j.bindStore(f.getStore(),true);g.on("menucreate",j.onMenuCreate,j);f.on("refresh",j.onRefresh,j);e.on({scope:j,beforestaterestore:j.applyState,beforestatesave:j.saveState,beforedestroy:j.destroy});e.filters=j},createFiltersCollection:function(){return Ext.create("Ext.util.MixedCollection",false,function(b){return b?b.dataIndex:null})},createFilters:function(){var p=this,q=p.filters.getCount(),x=p.getGridPanel(),u=p.createFiltersCollection(),s=x.store.model,r=s.prototype.getFieldsMap(),o,v,w;if(q){w={};p.saveState(null,w)}function n(b,c,a){if(b&&(a||c)){o=r[b];v={dataIndex:b,type:(o&&o.getType())||"auto"};if(Ext.isObject(c)){Ext.apply(v,c)}u.replace(v)}}Ext.Array.each(p.filterConfigs,function(a){n(a.dataIndex,a)});Ext.Array.each(x.columnManager.getColumns(),function(a){if(a.filterable===false){u.removeAtKey(a.dataIndex)}else{n(a.dataIndex,a.filter,a.filterable)}});p.removeAll();if(u.items){p.initializeFilters(u.items)}if(q){p.applyState(null,w)}},initializeFilters:function(m){var n=this,l=m.length,g,o,j;for(g=0;g0){v[this.paramPrefix]=Ext.JSON.encode(r)}}return v},cleanParams:function(f){if(this.encode){delete f[this.paramPrefix]}else{var d,e;d=new RegExp("^"+this.paramPrefix+"[[0-9]+]");for(e in f){if(d.test(e)){delete f[e]}}}},getFilterClass:function(b){switch(b){case"auto":b="string";break;case"int":case"float":b="numeric";break;case"bool":b="boolean";break}return Ext.ClassManager.getByAlias("gridfilter."+b)}},1,0,0,0,["feature.filters"],0,[Ext.ux.grid,"FiltersFeature"],0));Ext.define("Overrides.ux.grid.FiltersFeature",{override:"Ext.ux.grid.FiltersFeature",menuFilterText:t("Filter"),encode:true,getFilterData:function(){var s=this.cmpsExtraFilters?Ext.Array.merge(this.getFilterItems(),this.cmpsExtraFilters):this.getFilterItems(),p=[],n,d,q,o,r,m;for(n=0,d=s.length;n'+t("No record found")+""},initComponent:function(){var f=this,d=Ext.id(),e=Ext.id();f.buttonNewWidth=window.isThemeTriton?90:f.buttonNewWidth;f.buttonDeleteWidth=window.isThemeTriton?120:f.buttonDeleteWidth;f.tbar=[];if(f.module&&!f.listeners){f.listeners={selectionchange:"onSelectionChange",itemclick:"onEdit"}}if(f.allowSearch&&!Ext.isEmpty(f.fieldSearch)){f.tbar.push({emptyText:t("Search")+" "+t(f.fieldSearch),xtype:"searchfield",fieldFilter:f.fieldSearch,filterOnClick:f.filterFieldOnClick,store:f.store,comparison:f.comparisonfilter})}if(f.allowCreate){f.tbar.push({text:f.textNew,width:f.buttonNewWidth,height:f.buttonNewHeight,glyph:f.glyphNew,handler:"onNew"})}if(f.allowDelete){f.tbar.push({xtype:"splitbutton",itemId:"btnPrint",text:f.textDelete,width:f.buttonDeleteWidth,glyph:f.glyphDelete,disabled:true,reference:"delete",handler:"onDelete",menu:[{text:f.labelAll,checked:false,group:d,value:"all"},{text:f.labelSelected,checked:true,group:d,value:"selected"}]})}if((f.allowUpdate&&f.buttonUpdateLot&&!App.user.isClient)||f.buttonUpdateLotCallShopRate){f.tbar.push({xtype:"splitbutton",iconCls:f.iconButtonUpdateLot,text:f.textButtonUpdateLot,enableToggle:true,width:App.user.language=="en"?140:170,reference:"updateLot",listeners:{toggle:"onToggleUpdateLot"},menu:[{text:f.labelAll,checked:true,group:e,value:"all",listeners:{checkchange:"onCheckChangeUpdateLot"}},{text:f.labelSelected,checked:false,group:e,value:"selected",disabled:true,listeners:{checkchange:"onCheckChangeUpdateLot"}}]})}if(f.buttonCsv&&!window.isTablet){f.tbar.push({iconCls:f.iconButtonCsv,text:f.textButtonCsv,handler:f.actionButtonCsv,width:f.widthButtonCsv})}if(f.buttonImportCsv){f.tbar.push({iconCls:f.iconButtonImportCsv,text:f.textButtonImportCsv,handler:"onImportCsv",width:f.widthButtonCsv})}if(f.extraButtons.length){f.tbar=Ext.Array.merge(f.tbar,f.extraButtons)}if(f.buttonPrint&&!window.isTablet){f.tbar.push("->",{xtype:"splitbutton",glyph:f.glyphPrint,text:f.textPrint,hidden:!f.allowPrint,handler:"onPrint",menu:[{text:f.labelPicture,checked:true,group:"orientation",value:"P",handler:"onPrint"},{text:f.labelLandscape,checked:false,group:"orientation",value:"L",handler:"onPrint"}]})}if(f.buttonCleanFilter){f.tbar.push({iconCls:f.iconClsCleanFilter,text:f.textCleanFilter,scope:f,handler:f.cleanFilters})}if(f.pagination){f.dockedItems=[{xtype:"pagingtoolbar",dock:f.dockPagination,store:f.store,displayInfo:f.displayInfoPagination,items:f.paginationButton},{xtype:"toolbar",dock:f.dockPagination,items:f.buttonsTbar,hidden:!f.buttonsTbar.length}]}f.features=[{ftype:"filters",id:"filters",local:!f.remoteFilter},{ftype:"grouping",enableGroupingMenu:f.grupableColumns,groupHeaderTpl:t("Column")+': {columnName} -> {name} ({rows.length} Item{[values.rows.length > 1 ? "s" : ""]})'}];f.on("render",f.applyDefaultColumns,f);Ext.grid.Panel.prototype.initComponent.apply(this,arguments);f.autoLoadList&&!window.isDesktop&&f.getStore().load({scope:f,callback:function(){f.view.refresh()}})},getExtraFilterClass:function(b){switch(b){case"auto":b="string";break;case"int":case"float":b="numeric";break;case"bool":b="boolean";break}return Ext.ClassManager.getByAlias("gridfilter."+b)},addExtraFilter:function(d){var f=this,e=f.getView().getFeature("filters");d.button.toggle(d.active);e.extraFilters=f.getFilterData();f.deferredUpdate.delay(d.type==="string"?0:e.updateBuffer)},clearExtraFilters:function(){var d=this,c=d.cmpExtraFilters.query("splitbutton[pressed=true]");Ext.each(c,function(a){a.toggle(false,true);a.filter.setActive(false)})},getFilterData:function(){var g=this,j=[],e,f;Ext.each(g.cmpsExtraFilters,function(b){if(b.active){var a=[].concat(b.serialize());for(e=0,f=a.length;e",{xtype:"label",text:c.timeFormat=="h"?"12:00 AM":"00:00"},"->"]}],items:[c.hourSlider,c.minuteSlider],onMouseDown:function(a){a.preventDefault()}});Ext.picker.Date.prototype.initComponent.call(this);c.ownerCt=c.up("[floating]");c.timePicker.ownerCt=c.ownerCt;c.registerWithOwnerCt();c.timePicker.registerWithOwnerCt();c.setValue(new Date(d));c.hourSlider.addListener("change",c.changeTimeValue,c);c.minuteSlider.addListener("change",c.changeTimeValue,c)},onShow:function(){var b=this;b.showTimePicker();Ext.picker.Date.prototype.onShow.call(this)},showTimePicker:function(){var f=this,d=f.el,e=f.timePicker;Ext.defer(function(){var b=Ext.getBody(),c=b.getViewSize().width,a=(c<(d.getX()+d.getWidth()+140))?(d.getX()-140):(d.getX()+d.getWidth()+10);f.timePicker.setHeight(d.getHeight());f.timePicker.setPosition(a,d.getY());f.timePicker.show()},1)},handleTabClick:function(b){this.handleDateClick(b,this.activeCell.firstChild,true)},getSelectedDate:function(v){var s=this,o=Ext.Date.clearTime(v,true).getTime(),n=s.cells,c=s.selectedCls,q=n.elements,r=q.length,p,u;n.removeCls(c);for(u=0;u=f.F1&&d<=f.F12)&&!f.isNavKeyPress()){if(this.inputEl.dom.selectionStart===0&&this.inputEl.dom.selectionEnd===this.inputEl.dom.value.length){this.hiddenField.dom.value=this.money?0:""}if(!e.isBackspace){if(this.money){this.hiddenField.dom.value=String(this.hiddenField.dom.value)+String(e.pressedKey);this.hiddenField.dom.value=this.hiddenField.dom.value.replace(/[.]/g,"");this.hiddenField.dom.value=this.textMask.parsePrecision(this.hiddenField.dom.value,this.textMask.moneyPrecision);this.hiddenField.dom.value=this.textMask.unmask(this.hiddenField.dom.value)}else{this.hiddenField.dom.value=this.textMask.unmask(this.hiddenField.dom.value+e.pressedKey)}}this.inputEl.dom.value=this.textMask.mask(this.hiddenField.dom.value);this.inputEl.dom.selectionStart=this.textMask.getLength(this.hiddenField.dom.value);this.inputEl.dom.selectionEnd=this.inputEl.dom.selectionStart;f.preventDefault()}},simpleUpdateHidden:function(b){if(this.readOnly||this.useMask){return false}this.hiddenField.dom.value=this.inputEl.dom.value},getValue:function(){if(this.returnWithMask){return this.getValueWithMask()}else{return this.getValueWithoutMask()}},getValueWithMask:function(){return this.inputEl.dom.value},getValueWithoutMask:function(){if(this.hiddenField){return this.hiddenField.dom.value}else{return""}},getRawValue:function(){return this.getValue()},setValue:function(b){b=!Ext.isDefined(b)?"":b;if(this.useMask&&!Ext.isEmpty(b)){if(this.inputEl){this.hiddenField.dom.value=this.textMask.unmask(b);this.inputEl.dom.value=this.textMask.mask(b)}this.value=this.textMask.unmask(b)}else{if(this.inputEl){this.hiddenField.dom.value=b;this.inputEl.dom.value=b}this.value=b}},setDateValue:function(b){if(b==="now"){b=new Date()}if(this.inputEl){b=this.formatDate(this.parseDate(b));this.hiddenField.dom.value=b;this.inputEl.dom.value=this.textMask.mask(b)}this.value=b},setMask:function(b){this.textMask.setMask(b);this.setValue(this.hiddenField.dom.value)}},0,0,0,0,["plugin.textmask"],0,[Ext.ux,"TextMaskPlugin"],0));(Ext.cmd.derive("Ext.ux.form.field.Money",Ext.form.field.Text,{mask:t("maskMoney"),money:true,initComponent:function(){var b=this;b.plugins=["textmask","markallowblank"];Ext.form.field.Text.prototype.initComponent.apply(this,arguments)}},0,["moneyfield"],["component","box","field","textfield","moneyfield"],{component:true,box:true,field:true,textfield:true,moneyfield:true},["widget.moneyfield"],0,[Ext.ux.form.field,"Money"],0));(Ext.cmd.derive("Ext.ux.form.Panel",Ext.form.Panel,{bodyPadding:5,autoScroll:true,border:false,allowCreate:true,allowUpdate:true,defaultType:"textfield",layout:"anchor",idRecord:0,textNew:t("New"),glyphNew:icons.file,textSave:t("Save"),glyphSave:icons.disk,textCancel:t("Cancel"),glyphCancel:icons.stop,alignButtonsBottom:"->",defaults:{plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true},buttonsTbar:[],labelWidthFields:100,labelAlignFields:"right",header:window.isTablet||window.isTablets?false:"",initComponent:function(){var j=this;var e=j.xtype.slice(0,-4);if(j.items&&App.user.isAdmin&&App.user.show_filed_help==true){if(j.items[0].xtype=="tabpanel"){j.items[0].items.forEach(function(a){a.items.forEach(function(b){if(b.xtype=="fieldcontainer"){b.items.forEach(function(d){var m=h(e+"."+d.name);if(m.length>10){d.fieldLabel=d.fieldLabel+" "+m}})}else{if(b.xtype=="fieldset"){b.items.forEach(function(d){var m=h(e+"."+d.name);if(m.length>10){d.fieldLabel=d.fieldLabel+" "+m}})}else{var c=h(e+"."+b.name);if(c.length>10){b.fieldLabel=b.fieldLabel+" "+c}}}})})}else{for(var f in j.items){var g=h(e+"."+j.items[f].name);if(g.length>10){j.items[f].fieldLabel=j.items[f].fieldLabel+" "+g}}}}Ext.applyIf(j.defaults,{anchor:"0",enableKeyEvents:true,labelAlign:j.labelAlignFields,labelWidth:j.labelWidthFields,msgTarget:"side",plugins:"markallowblank",allowBlank:false});j.dockedItems=[];itemsTbar=j.buttonsTbar.length?j.buttonsTbar:[{xtype:"tbtext"},j.alignButtonsBottom,{reference:"save",text:j.textSave,width:90,glyph:j.glyphSave,handler:"onSave"},{text:j.textCancel,width:90,glyph:j.glyphCancel,handler:"onCancel"}];j.hideTbar=Ext.isDefined(j.hideTbar)?j.hideTbar:!j.allowCreate;j.hideBbar=!j.allowCreate&&!j.allowUpdate;j.dockedItems=[{xtype:"toolbar",hidden:j.hideBbar,dock:"bottom",items:itemsTbar}];Ext.form.Panel.prototype.initComponent.apply(this,arguments)}},0,0,["component","box","container","panel","form"],{component:true,box:true,container:true,panel:true,form:true},0,0,[Ext.ux.form,"Panel"],0));(Ext.cmd.derive("MBilling.view.groupModule.Form",Ext.ux.form.Panel,{items:[{xtype:"groupusercombo"},{xtype:"modulecombo"}]},0,["groupmoduleform"],["component","box","container","panel","form","groupmoduleform"],{component:true,box:true,container:true,panel:true,form:true,groupmoduleform:true},["widget.groupmoduleform"],0,[MBilling.view.groupModule,"Form"],0));(Ext.cmd.derive("MBilling.view.module.Combo",Ext.form.field.ComboBox,{name:"id_module",fieldLabel:t("Module"),displayField:"text",valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Module",{proxy:{type:"uxproxy",module:"module",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["modulecombo"],["component","box","field","textfield","pickerfield","combobox","combo","modulecombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,modulecombo:true},["widget.modulecombo"],0,[MBilling.view.module,"Combo"],0));(Ext.cmd.derive("MBilling.view.groupModule.Field",Ext.form.FieldContainer,{layout:"fit",name:"id_module",fieldLabel:t("Modules"),moduleText:t("Module"),showMenuText:t("Show Menu"),showDesktopText:t("Show Desktop"),showQuickInitText:t("Show Quick Init."),readText:t("Read"),createText:t("Create"),updateText:t("Update"),deleteText:t("Delete"),actionsText:t("Actions"),blankText:t("This field is required"),itemExistsText:t("This item already exists"),subFieldsName:{module:"id_module",moduleText:"idModuletext",showMenu:"show_menu",showDesktop:"createShortCut",showQuickInit:"createQuickStart",actions:"action"},initComponent:function(){var c=this,d;c.items=c.initGrid();Ext.form.FieldContainer.prototype.initComponent.apply(this,arguments)},afterRender:function(){var b=this;Ext.form.FieldContainer.prototype.afterRender.apply(this,arguments);b.setValue(b.value)},initGrid:function(){var d=this,e={},f;d.store=Ext.create("MBilling.store.GroupModule",{remoteSort:false});d.moduleCombo=Ext.widget("modulecombo",{hideLabel:true,allowBlank:false,validator:Ext.bind(d.checkModuleExists,d)});d.grid=Ext.widget("grid",{style:d.allowBlank===false?"border-left: 3px solid red":"",store:d.store,plugins:{ptype:"rowediting",pluginId:"rowEditor",listeners:{scope:d,beforeedit:d.onBeforeEdit,edit:d.onEdit,canceledit:d.onCancelEdit}},tbar:[{glyph:icons.file,scope:d,text:t("Add permissions for this group"),handler:function(){f=d.grid.getPlugin("rowEditor");if(!d.isUpdate&&f.editing){d.moduleCombo.focus();return false}d.moduleCombo.reset();e[d.subFieldsName.showMenu]=1;e[d.subFieldsName.showDesktop]=0;e[d.subFieldsName.showQuickInit]=0;d.addItem(e,0);f.startEdit(0,0);d.isUpdate=false;d.recordEditing=null}}],columns:[{xtype:"templatecolumn",flex:7,tpl:"{"+d.subFieldsName.moduleText+"}",header:d.moduleText,dataIndex:d.subFieldsName.module,editor:d.moduleCombo},{header:d.actionsText,flex:7,dataIndex:d.subFieldsName.actions,scope:d,renderer:d.rendererActions,editor:{xtype:"combo",multiSelect:true,store:[["c",d.createText],["r",d.readText],["u",d.updateText],["d",d.deleteText]]}},{xtype:"booleancolumn",flex:6,header:d.showMenuText,dataIndex:d.subFieldsName.showMenu,editor:{xtype:"checkbox"}},{xtype:"booleancolumn",flex:6,header:d.showDesktopText,dataIndex:d.subFieldsName.showDesktop,editor:{xtype:"checkbox"}},{xtype:"booleancolumn",flex:6,header:d.showQuickInitText,dataIndex:d.subFieldsName.showQuickInit,editor:{xtype:"checkbox"}},{xtype:"actioncolumn",flex:1,menuDisabled:true,iconCls:"icon-delete",tooltip:d.deleteText,handler:Ext.bind(d.removeItem,d),editRenderer:function(){return}}]});return d.grid},rendererActions:function(j){var e=this,f=Ext.isString(j)?j.split(""):j,g=[];Ext.each(f,function(a){switch(a){case"c":g.push(e.createText);break;case"r":g.push(e.readText);break;case"u":g.push(e.updateText);break;case"d":g.push(e.deleteText);break}},e);return g.join(", ")},onBeforeEdit:function(o,g){var n=this,j=g.record,l=n.subFieldsName.actions,m=j.get(l);j.set(l,Ext.isString(m)?m.split(""):undefined);n.isUpdate=j.get(n.subFieldsName.module)>0;n.recordEditing=n.isUpdate?j:null},onEdit:function(m,f){var l=this,g=f.record,j=l.subFieldsName.actions;g.set(j,g.get(j).join(""));g.set("idModuletext","t('"+l.moduleCombo.getRawValue()+"')");g.commit()},onCancelEdit:function(o,g){var n=this,j=g.record,l=n.subFieldsName.actions,m=j.get(l);n.isUpdate?j.set(l,m&&m.join("")):n.store.removeAt(g.rowIdx);j.commit()},addItem:function(f,e){var d=this;f=f||{};Ext.isDefined(e)?d.store.insert(e,Ext.clone(f)):d.store.add(Ext.clone(f))},removeItem:function(e,g){var j=this,f=j.store.getAt(g);j.store.remove(f)},getErrors:function(){var d=this,f=[],e;if(d.allowBlank){return f}if(!d.getValue().length){f.push(d.blankText);return f}return f},reset:function(){this.store.removeAll()},setValue:function(d){var c=this;c.reset();Ext.each(d,function(a){c.addItem(a)},c)},getValue:function(){var m=this,g=[],l={},j,f;m.store.each(function(a){f=a.get(m.subFieldsName.module);if(f){l[m.subFieldsName.module]=f;l[m.subFieldsName.showMenu]=a.get(m.subFieldsName.showMenu);l[m.subFieldsName.showDesktop]=a.get(m.subFieldsName.showDesktop);l[m.subFieldsName.showQuickInit]=a.get(m.subFieldsName.showQuickInit);l[m.subFieldsName.actions]=a.get(m.subFieldsName.actions);g.push(Ext.clone(l))}});return g},getSubmitData:function(){var d=this,c={};c[d.getName()]=Ext.encode(d.getValue());return c},checkModuleExists:function(){var f=this,d=f.moduleCombo.getValue(),e=f.recordEditing&&f.recordEditing.get(f.subFieldsName.module);if(!d){return true}if(f.isUpdate&&(e!==d)&&f.store.find(f.subFieldsName.module,d)!==-1){return f.itemExistsText}else{if(!f.isUpdate&&f.store.find(f.subFieldsName.module,d)!==-1){return f.itemExistsText}}return true}},0,["groupmodulefield"],["component","box","container","fieldcontainer","groupmodulefield"],{component:true,box:true,container:true,fieldcontainer:true,groupmodulefield:true},["widget.groupmodulefield"],[["field",Ext.form.field.Field]],[MBilling.view.groupModule,"Field"],0));(Ext.cmd.derive("MBilling.view.groupUser.Controller",Ext.ux.app.ViewController,{onEdit:function(){var b=this;b.lookupReference("generalTab").show();Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)},onSelectionChange:function(e,j){var g=this,f=g.lookupReference("buttonCloneGroup");f&&f.setDisabled(!j.length);Ext.ux.app.ViewController.prototype.onSelectionChange.apply(this,arguments)},onCloneGroupUser:function(e){var f=this,d=f.list.getSelectionModel().getSelection()[0];if(f.list.getSelectionModel().getSelection().length==1){Ext.Ajax.request({url:"index.php/groupUser/clone",params:{id:d.get("id")},scope:f,success:function(a){a=Ext.decode(a.responseText);if(a[f.nameSuccessRequest]){Ext.ux.Alert.alert(f.titleSuccess,a[f.nameMsgRequest],"success")}else{Ext.ux.Alert.alert(f.titleError,a[f.nameMsgRequest],"error")}}})}else{Ext.ux.Alert.alert(f.titleError,"Please Select only a record","notification")}f.store.load()}},0,0,0,0,["controller.groupuser"],0,[MBilling.view.groupUser,"Controller"],0));(Ext.cmd.derive("MBilling.view.groupUser.Module",Ext.ux.panel.Module,{controller:"groupuser",cfgEast:{flex:9}},0,["groupusermodule"],["component","box","container","uxpanelmodule","groupusermodule"],{component:true,box:true,container:true,uxpanelmodule:true,groupusermodule:true},["widget.groupusermodule"],0,[MBilling.view.groupUser,"Module"],0));(Ext.cmd.derive("MBilling.view.groupUser.List",Ext.ux.grid.Panel,{store:"GroupUser",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.allowPrint=false;b.buttonCsv=false;b.extraButtons=[{text:t("Clone")+" "+t("Group"),handler:"onCloneGroupUser",width:100,reference:"buttonCloneGroup",disabled:true}];b.columns=[{text:t("Id"),dataIndex:"id",hidden:true,hideable:App.user.isAdmin},{text:t("Name"),dataIndex:"name"},{xtype:"templatecolumn",tpl:"{idUserTypename}",header:t("User Type"),renderer:function(a){a=a==1?t("admin"):a==2?t("agent"):t("user");return a},dataIndex:"id_user_type",comboFilter:"usertypecombo"}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["groupuserlist"],["component","box","container","panel","tablepanel","gridpanel","grid","groupuserlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,groupuserlist:true},["widget.groupuserlist"],0,[MBilling.view.groupUser,"List"],0));(Ext.cmd.derive("Ext.ux.form.field.Permission",Ext.form.FieldContainer,{layout:"fit",border:1,style:{borderColor:"#cecece",borderStyle:"solid"},name:"id_module",moduleText:t("Module"),showMenuText:t("Menu"),showDesktopText:t("Desktop"),showQuickInitText:t("Quick Init."),createText:t("Create"),updateText:t("Update"),deleteText:t("Delete"),blankText:t("This field is required"),urlReadTree:"index.php/module/readTree",rootPropertyRead:"rows",fieldsMap:{idModule:"id_module",action:"action",showMenu:"show_menu",showDesktop:"createShortCut",showQuickInit:"createQuickStart"},initComponent:function(){var b=this;b.items=b.initTreeGrid();Ext.form.FieldContainer.prototype.initComponent.apply(this,arguments)},initTreeGrid:function(){var me=this,listenersCheckColumns={scope:me,checkchange:me.onCheckColumn};me.treeStore=Ext.create("Ext.data.TreeStore",{proxy:{type:"ajax",url:me.urlReadTree,reader:{type:"json",rootProperty:me.rootPropertyRead},extraParams:me.extraParamsRead},fields:[{name:"text",convert:function(v){return(v.indexOf("t(")!==-1)?eval(v):v}},"iconCls",{name:"create",type:"boolean"},{name:"update",type:"boolean"},{name:"delete",type:"boolean"},{name:"show_menu",type:"boolean"},{name:"createShortCut",type:"boolean"},{name:"createQuickStart",type:"boolean"}],remoteSort:false,defaultRootProperty:me.rootPropertyRead});me.treeGrid=Ext.widget("treepanel",{style:me.allowBlank===false?"border-left: 3px solid red":"",useArrows:true,rootVisible:false,store:me.treeStore,listeners:{scope:me,checkchange:me.onCheckModule},columns:[{xtype:"treecolumn",text:me.moduleText,flex:3,dataIndex:"text"},{xtype:"checkcolumn",text:me.showMenuText,flex:1,dataIndex:"show_menu",listeners:{checkchange:me.onCheckMenu}},{xtype:"checkcolumn",text:me.createText,flex:1,dataIndex:"create",listeners:listenersCheckColumns},{xtype:"checkcolumn",text:me.updateText,flex:1,dataIndex:"update",listeners:listenersCheckColumns},{xtype:"checkcolumn",text:me.deleteText,flex:1,dataIndex:"delete",listeners:listenersCheckColumns},{xtype:"checkcolumn",text:me.showDesktopText,flex:1,dataIndex:"createShortCut",listeners:listenersCheckColumns},{xtype:"checkcolumn",text:me.showQuickInitText,flex:1,dataIndex:"createQuickStart",listeners:listenersCheckColumns}]});return me.treeGrid},onCheckMenu:function(f,g,j,e){if(!j){return}e.set("checked",true);e.parentNode.set(f.dataIndex,true);e.parentNode.set("checked",true)},onCheckColumn:function(f,g,j,e){if(j){e.set("checked",true);e.parentNode.set("checked",true)}if(e.isLeaf()){return}e.cascadeBy(function(a){a.set(f.dataIndex,j);if(j){a.set("checked",true);a.parentNode.set("checked",true)}})},onCheckModule:function(f,d){var e=this;d?(f.parentNode&&!f.parentNode.get("checked")&&f.parentNode.set("checked",true)):e.resetNode(f);if(f.isLeaf()){return}f.cascadeBy(function(a){a.set("checked",d);d?(a.parentNode&&a.parentNode.set("checked",true)):e.resetNode(a)},e)},getErrors:function(){var d=this,c=[];if(d.allowBlank){return c}if(!d.getValue().length){c.push(d.blankText);return c}return c},reset:function(){this.treeStore.load()},resetNode:function(b){b.set({create:false,update:false,"delete":false,show_menu:false,createShortCut:false,createQuickStart:false,checked:false});b.commit()},setValue:function(f){var m=this,j,l,g;m.treeStore.load({scope:m,callback:function(){m.setLoading(true);Ext.each(f,function(a){j=m.treeStore.getRootNode().findChild("id",parseInt(a[m.fieldsMap.idModule]),true);l=a[m.fieldsMap.action]||[];g=j.isLeaf();j.set({create:g&&l.indexOf("c")!==-1,update:g&&l.indexOf("u")!==-1,"delete":g&&l.indexOf("d")!==-1,show_menu:a[m.fieldsMap.showMenu]==1,createShortCut:g&&a[m.fieldsMap.showDesktop]==1,createQuickStart:g&&a[m.fieldsMap.showQuickInit]==1,checked:true});j.commit()});m.setLoading(false)}})},getValue:function(){var e=this,j={},f=[],g;this.treeStore.getRootNode().cascadeBy(function(a){if(a.get("checked")&&!a.isRoot()){g=[];j={};a.get("create")&&g.push("c");g.push("r");a.get("update")&&g.push("u");a.get("delete")&&g.push("d");j[e.fieldsMap.idModule]=a.getId();j[e.fieldsMap.action]=g.join("");j[e.fieldsMap.showMenu]=a.get("show_menu")?1:0;j[e.fieldsMap.showDesktop]=a.get("createShortCut")?1:0;j[e.fieldsMap.showQuickInit]=a.get("createQuickStart")?1:0;f.push(Ext.clone(j))}});return f}},0,["permissionfield"],["component","box","container","fieldcontainer","permissionfield"],{component:true,box:true,container:true,fieldcontainer:true,permissionfield:true},["widget.permissionfield"],[["field",Ext.form.field.Field]],[Ext.ux.form.field,"Permission"],0));(Ext.cmd.derive("MBilling.view.groupUser.Form",Ext.ux.form.Panel,{header:false,initComponent:function(){var b=this;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true}},items:[{title:t("general"),reference:"generalTab",items:[{name:"id",fieldLabel:t("Id"),disabled:true,hidden:true},{name:"name",fieldLabel:t("Name"),maxLength:100},{xtype:"usertypecombo"}]},{title:t("Permissions"),items:[{xtype:"permissionfield",hideLabel:true,anchor:"100% "+(!Ext.Boot.platformTags.desktop?"82%":window.isThemeNeptune?"87%":"89%"),allowBlank:true}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["groupuserform"],["component","box","container","panel","form","groupuserform"],{component:true,box:true,container:true,panel:true,form:true,groupuserform:true},["widget.groupuserform"],0,[MBilling.view.groupUser,"Form"],0));(Ext.cmd.derive("MBilling.view.groupUser.Combo",Ext.form.field.ComboBox,{name:"id_group",fieldLabel:t("IdGroup"),displayField:"name",valueField:"id",forceSelection:true,editable:false,initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.GroupUser",{proxy:{type:"uxproxy",module:"groupUser",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["groupusercombo"],["component","box","field","textfield","pickerfield","combobox","combo","groupusercombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,groupusercombo:true},["widget.groupusercombo"],0,[MBilling.view.groupUser,"Combo"],0));(Ext.cmd.derive("MBilling.view.groupUser.AgentUSerCombo",Ext.form.field.ComboBox,{name:"id_group_agent",fieldLabel:t("GroupUser"),displayField:"name",forceSelection:true,editable:false,valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.GroupUser",{proxy:{type:"uxproxy",module:"groupUser",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["groupuseragentcombo"],["component","box","field","textfield","pickerfield","combobox","combo","groupuseragentcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,groupuseragentcombo:true},["widget.groupuseragentcombo"],0,[MBilling.view.groupUser,"AgentUSerCombo"],0));(Ext.cmd.derive("MBilling.view.groupUser.Tag",Ext.form.field.Tag,{name:"id_group",fieldLabel:t("GroupUser"),displayField:"name",valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.GroupUser",{proxy:{type:"uxproxy",module:"plan",limitParam:undefined}});Ext.form.field.Tag.prototype.initComponent.apply(this,arguments)}},0,["groupusertag"],["component","box","field","textfield","pickerfield","combobox","combo","tagfield","groupusertag"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,tagfield:true,groupusertag:true},["widget.groupusertag"],0,[MBilling.view.groupUser,"Tag"],0));(Ext.cmd.derive("MBilling.view.module.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.module"],0,[MBilling.view.module,"Controller"],0));(Ext.cmd.derive("MBilling.view.module.Module",Ext.ux.panel.Module,{controller:"module"},0,["modulemodule"],["component","box","container","uxpanelmodule","modulemodule"],{component:true,box:true,container:true,uxpanelmodule:true,modulemodule:true},["widget.modulemodule"],0,[MBilling.view.module,"Module"],0));(Ext.cmd.derive("MBilling.view.module.List",Ext.ux.grid.Panel,{store:"Module",initComponent:function(){var b=this;b.columns=[{text:t("Id"),dataIndex:"id"},{text:t("Text"),dataIndex:"text"},{text:t("Module"),dataIndex:"module"},{text:t("IconCls"),dataIndex:"icon_cls"},{xtype:"templatecolumn",tpl:"{idModuletext}",text:t("Module Owner"),dataIndex:"id_module",comboFilter:"modulecombo"}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["modulelist"],["component","box","container","panel","tablepanel","gridpanel","grid","modulelist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,modulelist:true},["widget.modulelist"],0,[MBilling.view.module,"List"],0));(Ext.cmd.derive("MBilling.view.module.Form",Ext.ux.form.Panel,{items:[{name:"id",fieldLabel:t("Id"),disabled:true},{name:"text",fieldLabel:t("Text"),maxLength:100},{name:"module",fieldLabel:t("Module"),allowBlank:true,maxLength:100},{name:"icon_cls",fieldLabel:t("IconCls"),allowBlank:true,maxLength:100},{xtype:"modulecombo",fieldLabel:t("Module Owner"),allowBlank:true}]},0,["moduleform"],["component","box","container","panel","form","moduleform"],{component:true,box:true,container:true,panel:true,form:true,moduleform:true},["widget.moduleform"],0,[MBilling.view.module,"Form"],0));(Ext.cmd.derive("MBilling.view.module.Tag",Ext.form.field.Tag,{name:"id_module",fieldLabel:t("Module"),displayField:"text",valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Module",{proxy:{type:"uxproxy",module:"plan",limitParam:undefined}});Ext.form.field.Tag.prototype.initComponent.apply(this,arguments)}},0,["moduletag"],["component","box","field","textfield","pickerfield","combobox","combo","tagfield","moduletag"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,tagfield:true,moduletag:true},["widget.moduletag"],0,[MBilling.view.module,"Tag"],0));(Ext.cmd.derive("MBilling.view.userType.Combo",Ext.form.field.ComboBox,{name:"id_user_type",fieldLabel:t("userType"),displayField:"name",valueField:"id",value:1,store:[[1,t("admin")],[2,t("agent")],[3,t("client")]]},0,["usertypecombo"],["component","box","field","textfield","pickerfield","combobox","combo","usertypecombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,usertypecombo:true},["widget.usertypecombo"],0,[MBilling.view.userType,"Combo"],0));(Ext.cmd.derive("MBilling.view.user.Controller",Ext.ux.app.ViewController,{groupIsAdmin:false,init:function(){var b=this;b.control({groupusercombo:{select:b.onSelectType}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectType:function(c,d){this.showFieldsRelated(d.getData().showFields)},showFieldsRelated:function(j){var l=this,g=l.formPanel.getForm().getFields(),f=l.formPanel.getForm().findField("id_group_agent"),m=l.formPanel.getForm();l.onGetUserType(l.formPanel.getForm().findField("id_group").getValue(),function(a){l.groupIsAdmin=a;l.formPanel.getForm().findField("id_plan").setVisible(!a);l.formPanel.getForm().findField("id_plan").setAllowBlank(a);l.formPanel.getForm().findField("id_offer").setVisible(!a);l.formPanel.getForm().findField("prefix_local").setVisible(!a)});g.each(function(a){if(a.name=="id_group"){filterGroupp=Ext.encode([{type:"numeric",comparison:"eq",value:2,field:"id_user_type"}]),Ext.Ajax.request({url:"index.php/groupUser/index",params:{filter:filterGroupp},success:function(b){b=Ext.decode(b.responseText);var c=b.rows;for(i=0;i1){c.formPanel.getForm().findField("id_plan")["hide"]();fieldGroup.readOnly=true}else{c.formPanel.getForm().findField("id_plan")["show"]();fieldGroup.readOnly=false}}Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments);c.onGetUserType(d.get("id_group"),function(a){c.formPanel.getForm().findField("password").setVisible(!a);c.formPanel.getForm().findField("id_plan").setVisible(!a);c.formPanel.getForm().findField("id_plan").setAllowBlank(a);c.formPanel.getForm().findField("id_offer").setVisible(!a);c.formPanel.getForm().findField("prefix_local").setVisible(!a)});if(fieldGroup.value==2){fieldGroupAgent.show()}else{fieldGroupAgent.hide()}},onGetUserType:function(d,c){filterGroupp=Ext.encode([{type:"numeric",comparison:"eq",value:d,field:"id"}]),Ext.Ajax.request({url:"index.php/groupUser/getUserType",params:{filter:filterGroupp},success:function(a){a=Ext.decode(a.responseText);c(a.rows)}})},onDelete:function(d){var f=this,e;notDelete=false;Ext.each(f.list.getSelectionModel().getSelection(),function(a){if(a.get("id")==1){Ext.ux.Alert.alert(f.titleError,t("You cannot delete the")+" user id 1","error");notDelete=true}});if(notDelete==false){Ext.ux.app.ViewController.prototype.onDelete.apply(this,arguments)}}},0,0,0,0,["controller.user"],0,[MBilling.view.user,"Controller"],0));(Ext.cmd.derive("MBilling.view.user.Combo",Ext.form.field.ComboBox,{name:"id_user",fieldLabel:t("username"),displayField:"username",forceSelection:true,editable:false,valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.User",{proxy:{type:"uxproxy",module:"user",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["usercombo"],["component","box","field","textfield","pickerfield","combobox","combo","usercombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,usercombo:true},["widget.usercombo"],0,[MBilling.view.user,"Combo"],0));(Ext.cmd.derive("MBilling.view.user.Module",Ext.ux.panel.Module,{controller:"user",cfgEast:{flex:4}},0,["usermodule"],["component","box","container","uxpanelmodule","usermodule"],{component:true,box:true,container:true,uxpanelmodule:true,usermodule:true},["widget.usermodule"],0,[MBilling.view.user,"Module"],0));(Ext.cmd.derive("MBilling.view.user.List",Ext.ux.grid.Panel,{store:"User",fieldSearch:"username",initComponent:function(){var b=this;b.extraButtons=[{text:t("Bulk")+" "+t("User"),handler:"onBulk",width:100,disabled:false,hidden:App.user.isClient||!b.allowCreate}];b.columns=b.columns||[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("username"),dataIndex:"username",flex:2},{header:t("lastname"),dataIndex:"lastname",flex:3},{header:t("firstname"),dataIndex:"firstname",flex:3},{header:t("email"),dataIndex:"email",flex:window.isTablet?3:4},{header:t("credit"),dataIndex:"credit",renderer:Helper.Util.formatMoneyDecimal,flex:2},{xtype:"templatecolumn",tpl:"{idPlanname}",header:t("plan"),dataIndex:"id_plan",comboFilter:"plancombo",flex:3},{xtype:"templatecolumn",tpl:"{idGroupname}",header:t("group"),dataIndex:"id_group",comboFilter:"groupusercombo",flex:2,hidden:App.user.isClient||App.user.isAgent||window.isTablet,hideable:!App.user.isClient&&!App.user.isAgent},{header:t("agent"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:2,hidden:!App.user.isAdmin||window.isTablet,hideable:App.user.isAdmin},{header:t("status"),dataIndex:"active",renderer:Helper.Util.formatBooleanActive,flex:2,filter:{type:"list",options:[[1,t("active")],[2,t("pending")],[0,t("inactive")]]},hidden:App.user.isClient||window.isTablet,hideable:!App.user.isClient},{header:t("creationdate"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"creationdate",flex:4},{dataIndex:"id_offer",header:t("offer"),flex:2,hidden:true,hideable:!App.user.isClient&&!App.user.isAgent},{header:t("typepaid"),dataIndex:"typepaid",flex:2,renderer:Helper.Util.formattypepaid,filter:{type:"list",options:[[0,t("prepaid")],[1,t("pospaid")]]},hidden:true,hideable:!App.user.isClient&&!App.user.isAgent},{header:t("city"),dataIndex:"city",hidden:true,hideable:!App.user.isClient&&!App.user.isAgent,flex:1},{header:t("state"),dataIndex:"state",hidden:true,hideable:!App.user.isClient&&!App.user.isAgent,flex:1},{header:t("country"),dataIndex:"country",hidden:true,hideable:!App.user.isClient&&!App.user.isAgent,flex:1},{header:t("zipcode"),dataIndex:"zipcode",hidden:true,hideable:!App.user.isClient&&!App.user.isAgent,flex:1},{header:t("phone"),dataIndex:"phone",hidden:true,hideable:!App.user.isClient&&!App.user.isAgent,flex:1},{header:t("creditlimit"),dataIndex:"creditlimit",hidden:true,hideable:!App.user.isClient&&!App.user.isAgent,flex:1},{header:t("record_call"),dataIndex:"record_call",flex:1,renderer:Helper.Util.formattyyesno,filter:{type:"list",options:[[0,t("no")],[1,t("yes")]]},hidden:true,hideable:!App.user.isClient&&!App.user.isAgent},{header:t("CPS Limit"),dataIndex:"cpslimit",hidden:true,hideable:window.dialC&&App.user.isAdmin,flex:2}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["userlist"],["component","box","container","panel","tablepanel","gridpanel","grid","userlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,userlist:true},["widget.userlist"],0,[MBilling.view.user,"List"],0));(Ext.cmd.derive("MBilling.view.user.Form",Ext.ux.form.Panel,{autoHeight:300,bodyPadding:0,fieldsHideUpdateLot:["username","password","id_group_agent","id_offer","callingcard_pin"],initComponent:function(){var b=this;haveServiceMenu=false;Ext.each(App.user.menu,function(a){if(a.text=="t('Services')"){haveServiceMenu=true}});b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{labelAlign:"right",plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true}},items:[{title:t("general"),items:[{name:"username",fieldLabel:t("username"),maxLength:20,minLength:4,readOnly:App.user.isClient},{name:"password",fieldLabel:t("Password"),minLength:6,hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"id_group",fieldLabel:t("IdGroup"),xtype:"groupusercombo",allowBlank:!App.user.isAdmin,hidden:!App.user.isAdmin},{name:"id_group_agent",fieldLabel:t("GroupUser"),xtype:"groupuseragentcombo",emptyText:t("SELECT GROUP FOR AGENT USERS"),fieldLabel:t("Group for Agent Users"),hidden:true,allowBlank:true},{fieldLabel:t("Plan"),name:"id_plan",xtype:"planlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:App.user.isClient},{xtype:"languagecombo",name:"language",value:App.user.language=="pt_BR"?"br":App.user.language,fieldLabel:t("language")},{name:"prefix_local",fieldLabel:t("prefixlocal"),value:App.user.base_country=="BRL"?"0/55,*/5511/8,*/5511/9":App.user.base_country=="ARG"?"0/54,*/5411/8,15/54911/10,16/54911/10":"",allowBlank:true,emptyText:"match / replace / length",hidden:App.user.isClient},{xtype:"statususercombo",name:"active",fieldLabel:t("Active"),hidden:App.user.isClient,allowBlank:App.user.isClient},{xtype:"countrycombo",name:"country",fieldLabel:t("country"),value:App.user.language=="pt_BR"?"55":"1",allowBlank:true},{name:"id_offer",fieldLabel:t("offer"),xtype:"offercombo",allowBlank:true},{xtype:"numberfield",name:"cpslimit",fieldLabel:t("CPS Limit"),value:-1,minValue:-1,maxValue:50,hidden:!window.dialC||!App.user.isAdmin,allowBlank:true}]},{title:t("personalData"),itemId:"personalData",items:[{name:"company_name",fieldLabel:t("company")+" "+t("name"),allowBlank:true},{name:"state_number",fieldLabel:t("state_number"),allowBlank:true,hidden:App.user.base_country=!"BRL"},{name:"lastname",fieldLabel:t("lastname"),allowBlank:true,maxLength:40,minLength:4},{name:"firstname",fieldLabel:t("firstname"),allowBlank:true,maxLength:40,minLength:4},{xtype:"fieldcontainer",layout:"hbox",labelWidth:100,defaults:{xtype:"textfield",labelAlign:"right",flex:1},items:[{name:"city",fieldLabel:t("city"),allowBlank:true,maxLength:40,minLength:4,flex:2},{name:"state",fieldLabel:t("state"),allowBlank:true,maxLength:20,minLength:2}]},{name:"address",fieldLabel:t("address"),allowBlank:true},{name:"zipcode",fieldLabel:t("zipcode"),allowBlank:true},{xtype:"fieldcontainer",layout:"hbox",labelWidth:100,defaults:{xtype:"textfield",labelAlign:"right",flex:1},items:[{name:"phone",fieldLabel:t("phone"),allowBlank:true,maxLength:13,minLength:8},{name:"mobile",fieldLabel:t("mobile"),allowBlank:true,maxLength:20,minLength:8}]},{name:"email",fieldLabel:t("email"),allowBlank:true,vtype:"email"},{name:"doc",fieldLabel:t("Doc"),allowBlank:true},{name:"vat",fieldLabel:t("vat"),hidden:App.user.isClient,allowBlank:true}]},{title:t("suplementaryInfo"),itemId:"suplementaryInfo",defaults:{labelAlign:"right",plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true,labelWidth:145},items:[{xtype:"typepaymentcombo",name:"typepaid",fieldLabel:t("typepaid"),allowBlank:true,readOnly:App.user.isClient},{xtype:"fieldcontainer",layout:"hbox",defaults:{xtype:"textfield",labelAlign:"right",labelWidth:145,flex:1},items:[{name:"creditlimit",fieldLabel:t("creditlimit"),value:0,allowBlank:true,readOnly:App.user.isClient,flex:2},{xtype:"numberfield",name:"credit_notification",labelWidth:150,fieldLabel:t("creditnotification"),value:"-1",minValue:-1,allowBlank:true,flex:3}]},{xtype:"fieldcontainer",layout:"hbox",defaults:{xtype:"textfield",labelAlign:"right",labelWidth:145,flex:1},items:[{xtype:"noyescombo",name:"enableexpire",fieldLabel:t("enableexpire"),allowBlank:true,hidden:!App.user.isAdmin,flex:2},{xtype:"datefield",name:"expirationdate",fieldLabel:t("expirationdate"),format:"Y-m-d H:i:s",allowBlank:true,hidden:!App.user.isAdmin,labelWidth:150,flex:3}]},{xtype:"fieldcontainer",layout:"hbox",defaults:{xtype:"textfield",labelAlign:"right",labelWidth:145,flex:1},items:[{xtype:"noyescombo",name:"record_call",fieldLabel:t("record_call"),allowBlank:true,hidden:!haveServiceMenu||!App.user.isAdmin,readOnly:!App.user.isAdmin,flex:2},{labelWidth:150,xtype:"combobox",store:[["gsm",t("gsm")],["wav",t("wav")],["wav49",t("wav49")]],name:"mix_monitor_format",fieldLabel:t("Record call format"),forceSelection:true,editable:false,allowBlank:true,value:"gsm",hidden:!haveServiceMenu,flex:3}]},{xtype:"fieldcontainer",layout:"hbox",labelWidth:145,defaults:{labelAlign:"right",hidden:!haveServiceMenu,readOnly:!App.user.isAdmin,allowBlank:true,flex:1},items:[{labelWidth:145,xtype:"numberfield",name:"calllimit",fieldLabel:t("calllimit"),value:"-1",minValue:-1,flex:2},{labelWidth:150,xtype:"combobox",forceSelection:true,editable:false,name:"calllimit_error",fieldLabel:t("CallLimit Error"),value:"503",store:[["503",t("Congestion")],["403",t("Busy")]],flex:3}]},{xtype:"noyescombo",name:"callshop",fieldLabel:"Callshop",allowBlank:true,hidden:App.user.isClient},{xtype:"numberfield",name:"disk_space",fieldLabel:t("Disk Space"),value:-1,hidden:!haveServiceMenu,minValue:-1,readOnly:!App.user.isAdmin},{name:"sipaccountlimit",xtype:"numberfield",fieldLabel:t("Sip Account Limit"),value:"-1",minValue:-1,allowBlank:!App.user.isAdmin,readOnly:!App.user.isAdmin,hidden:!haveServiceMenu},{xtype:"numberfield",name:"callingcard_pin",fieldLabel:t("lockpin"),minValue:100000,maxLength:6,minLength:6},{xtype:"restrictioncombo",name:"restriction",fieldLabel:t("restriction"),allowBlank:true,hidden:App.user.isClient}]},{title:t("Send Credit"),itemId:"transferData",hidden:!window.transferToMobile,items:[{xtype:"fieldcontainer",layout:"hbox",hidden:App.user.isClient,defaults:{labelAlign:"right",labelWidth:145,allowBlank:true,flex:1},items:[{xtype:"noyescombo",name:"transfer_international",fieldLabel:t("Enable International")},{xtype:"numberfield",name:"transfer_international_profit",labelWidth:120,fieldLabel:t("Profit")}]},{xtype:"fieldcontainer",layout:"hbox",hidden:App.user.isClient,defaults:{labelAlign:"right",labelWidth:145,allowBlank:true,flex:1},items:[{xtype:"noyescombo",name:"transfer_flexiload",fieldLabel:t("Enable Flexiload")},{xtype:"numberfield",name:"transfer_flexiload_profit",labelWidth:120,fieldLabel:t("Profit")}]},{xtype:"fieldcontainer",layout:"hbox",hidden:App.user.isClient,defaults:{labelAlign:"right",labelWidth:145,allowBlank:true,flex:1},items:[{xtype:"noyescombo",name:"transfer_bkash",fieldLabel:t("Enable Bkash")},{xtype:"numberfield",name:"transfer_bkash_profit",labelWidth:120,fieldLabel:t("Profit")}]},{xtype:"fieldcontainer",layout:"hbox",hidden:App.user.isClient,defaults:{labelAlign:"right",labelWidth:145,allowBlank:true,flex:1},items:[{xtype:"noyescombo",name:"transfer_dbbl_rocket",fieldLabel:t("Enable DBBL/Rocket")},{xtype:"numberfield",name:"transfer_dbbl_rocket_profit",labelWidth:120,fieldLabel:t("Profit")}]},{xtype:"numberfield",name:"transfer_bdservice_rate",fieldLabel:t("BDService rate"),minValue:0,hidden:!App.user.isAdmin,allowBlank:true},{xtype:"numberfield",name:"transfer_show_selling_price",fieldLabel:t("show selling price"),allowBlank:true}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["userform"],["component","box","container","panel","form","userform"],{component:true,box:true,container:true,panel:true,form:true,userform:true},["widget.userform"],0,[MBilling.view.user,"Form"],0));(Ext.cmd.derive("Ext.ux.form.field.Lookup",Ext.form.FieldContainer,{layout:"fit",blankText:t("This field is required."),displayField:undefined,valueField:"id",gridConfig:{},windowConfig:{},iconClsSearch:"x-form-search-trigger",layout:"hbox",startX:150,hiddenSearchButton:false,eventsRelay:["dirtychange","validitychange","errorchange","specialkey","blur","keydown","keyup","keypress","change"],initComponent:function(){var b=this;b.store=Ext.data.StoreManager.lookup(b.store||"ext-empty-store");b.items=b.initSubFields();Ext.form.FieldContainer.prototype.initComponent.apply(this,arguments)},initSubFields:function(){var b=this;b.rawField=Ext.widget("textfield",{readOnly:true,flex:1,onClearButtonClick:b.reset,clearButtonScope:b,isFormField:false,listeners:{scope:b,change:b.onChangeRawField},triggers:{clear:{weight:0,cls:"x-form-clear-trigger",hidden:true,clickOnReadOnly:true,handler:b.reset,scope:b}}});b.relayEvents(b.rawField,b.eventsRelay);b.buttonSearch=Ext.widget("button",{iconCls:"ux-gridfilter-text-icon",scope:b,text:t("Search"),handler:b.onClickSearch,hidden:b.hiddenSearchButton});return[b.rawField,b.buttonSearch]},onChangeRawField:function(b){b.getTrigger("clear").show()},onClickSearch:function(e,f){var d=this;if(!d.windowSearch){d.list=Ext.widget(d.gridConfig.xtype,Ext.apply({selType:"checkboxmodel",selModel:{mode:"SINGLE"},allowCreate:false,allowUpdate:false,allowDelete:false,allowPrint:false,autoLoadList:false,buttonCsv:false,extraButtons:[],listeners:{scope:d,selectionchange:d.onSelectionChangeList,itemdblclick:d.onItemDblClick}},d.gridConfig));d.buttonOk=Ext.widget("button",{text:t("Ok"),width:70,disabled:true,glyph:icons.checkmark,scope:d,handler:d.onClickSelect});d.windowSearch=Ext.widget("window",Ext.apply({closeAction:"hide",header:false,layout:"fit",closable:false,resizable:true,draggable:false,baseCls:"x-panel",width:d.rawField.getWidth()+70+d.startX,height:d.rawField.getY()>250?300:Ext.getBody().getViewSize().height-270,items:d.list,bbar:["->",{text:t("Cancel"),glyph:icons.stop,scope:d,handler:function(){d.windowSearch.close()}},d.buttonOk],listeners:{scope:d,show:d.onShowWindowSearch}},d.windowConfig))}else{d.windowSearch.setWidth(d.rawField.getWidth()+23+d.startX)}d.windowSearch.showAt(d.rawField.getX()-d.startX,d.rawField.getY()+23)},onSelectionChangeList:function(d,c){this.recordSelected=c[0];this.buttonOk.setDisabled(!c.length)},onItemDblClick:function(d,c){this.selectRecord(c)},onClickSelect:function(){this.selectRecord()},selectRecord:function(c){var d=this;c=c||d.recordSelected;d.setValue(c.getId(),c.get(d.displayFieldList));d.windowSearch.close();d.list.store.defaultFilter=[];d.list.store.load()},onShowWindowSearch:function(f){var e=this,d=e.list.down("searchfield");d&&d.focus(true,10);!e.list.store.getCount()&&Ext.defer(function(){e.list.store.load()},10)},getErrors:function(){var d=this,c=[];if(d.allowBlank){return c}if(!d.getValue()){c.push(d.blankText);return c}return c},reset:function(){var b=this;b.rawField.reset();b.setValue("");b.rawField.getTrigger("clear").hide();b.rawField.updateLayout()},setValue:function(j,e){var f=this,g=f.ownerForm&&f.ownerForm.getRecord();if(!Ext.isEmpty(j)){e=e||(g&&g.get(f.displayField))}f.value=j;f.rawField.setValue(e||j);f.fireEvent("select",f,j)},getValue:function(){return this.value},getRawValue:function(){return this.rawField.getRawValue()}},0,0,["component","box","container","fieldcontainer"],{component:true,box:true,container:true,fieldcontainer:true},0,[["field",Ext.form.field.Field]],[Ext.ux.form.field,"Lookup"],0));(Ext.cmd.derive("MBilling.view.user.Lookup",Ext.ux.form.field.Lookup,{name:"id_user",fieldLabel:t("User"),displayField:"idUserusername",displayFieldList:"username",gridConfig:{xtype:"userlist",fieldSearch:"username",columns:[{header:t("username"),dataIndex:"username",flex:2},{header:t("email"),dataIndex:"email",flex:2},{header:t("lastname"),dataIndex:"lastname",flex:2},{header:t("credit"),dataIndex:"credit",renderer:Helper.Util.formatMoneyDecimal,flex:2}]}},0,["userlookup"],["component","box","container","fieldcontainer","userlookup"],{component:true,box:true,container:true,fieldcontainer:true,userlookup:true},["widget.userlookup"],0,[MBilling.view.user,"Lookup"],0));(Ext.cmd.derive("MBilling.view.user.Bulk",Ext.window.Window,{autoShow:true,modal:true,layout:"fit",iconCls:"icon-import-csv",title:t("Bulk User"),width:400,height:window.isThemeNeptune||window.isThemeCrisp?295:window.isThemeTriton?390:270,labelWidthFields:120,htmlTipInfo:"",fieldsImport:[],initComponent:function(){var b=this;b.items=[{xtype:"form",bodyPadding:5,defaults:{anchor:"0",enableKeyEvents:true,labelWidth:b.labelWidthFields,msgTarget:"side",plugins:"markallowblank",allowBlank:false},items:[{xtype:"numberfield",value:10,name:"totalToCreate",fieldLabel:t("How many users?")},{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,00",name:"credit",value:0,fieldLabel:t("Add")+" "+t("Refill"),readOnly:App.user.isClient},{xtype:"groupusercombo",allowBlank:!App.user.isAdmin,hidden:!App.user.isAdmin},{xtype:"languagecombo",name:"language",value:App.user.language=="pt_BR"?"br":App.user.language,fieldLabel:t("language")},{xtype:"plancombo",hidden:App.user.isClient,allowBlank:App.user.isClient},{xtype:"textfield",name:"prefix_local",fieldLabel:t("prefixlocal"),value:App.user.base_country=="BRL"?"0/55,*/5511/8,*/5511/9":App.user.base_country=="ARG"?"0/54,*/5411/8,15/54911/10,16/54911/10":"",allowBlank:true,emptyText:"match / replace / length",hidden:App.user.isClient},{xtype:"statususercombo",name:"active",fieldLabel:t("Active"),hidden:App.user.isClient,allowBlank:App.user.isClient}]}];b.title=b.title+(b.titleModule?" - "+b.titleModule:"");b.bbar=[{width:150,iconCls:"icon-import-csv",text:t("Bulk")+" "+t("User"),scope:b,handler:b.onBulk}];Ext.window.Window.prototype.initComponent.apply(this,arguments)},onBulk:function(d){var f=this,e=f.list.store;if(!f.down("form").isValid()){return}f.list.setLoading(true);Ext.Ajax.setTimeout(1000000);f.down("form").submit({url:"index.php/user/bulk",scope:f,success:function(c,b){var a=Ext.decode(b.response.responseText);console.log(a);if(a.success){Ext.ux.Alert.alert(t("Success"),a.msg,"success")}else{Ext.ux.Alert.alert(t("Error"),a.errors,"error")}d.enable();f.list.setLoading(false);e.load();f.close()},failure:function(c,b){console.log(b.response.responseText);if(b.response&&Ext.isObject(b.response.responseText)){var a=Ext.decode(b.response.responseText);Ext.ux.Alert.alert(t("Error1"),a.errors,"error")}else{Ext.ux.Alert.alert(t("Error2"),Ext.decode(b.response.responseText).msg,"error",true,10)}d.enable()}})}},0,["userbulk"],["component","box","container","panel","window","userbulk"],{component:true,box:true,container:true,panel:true,window:true,userbulk:true},["widget.userbulk"],0,[MBilling.view.user,"Bulk"],0));(Ext.cmd.derive("MBilling.view.configuration.Controller",Ext.ux.app.ViewController,{onAfterSave:function(g){var j=this,l=j.formPanel.getForm(),f=l.getRecord(),m=f.data.config_key;g=g||j.formPanel;if(!g.idRecord){g.getForm().reset();j.focusFirstField()}j.saveButton.enable();j.updateLotButton&&j.updateLotButton.toggle(false);g.setLoading(false);j.formPanel.collapse();j.store.load();j.logoutKey(m)},logoutKey:function(d){var c=this;if(d=="licence"||d=="base_language"){localStorage.setItem("day","");localStorage.setItem("lang","")}if(d=="licence"){Ext.Ajax.request({url:"index.php/authentication/logoff",success:function(){App.user.logged=false;location.reload()}})}}},0,0,0,0,["controller.configuration"],0,[MBilling.view.configuration,"Controller"],0));(Ext.cmd.derive("MBilling.view.configuration.Module",Ext.ux.panel.Module,{controller:"configuration"},0,["configurationmodule"],["component","box","container","uxpanelmodule","configurationmodule"],{component:true,box:true,container:true,uxpanelmodule:true,configurationmodule:true},["widget.configurationmodule"],0,[MBilling.view.configuration,"Module"],0));(Ext.cmd.derive("MBilling.view.configuration.List",Ext.ux.grid.Panel,{store:"Configuration",fieldSearch:"config_title",comparisonfilter:"ct",initComponent:function(){var b=this;b.allowPrint=false;b.buttonCsv=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowDelete=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("name"),dataIndex:"config_title"},{header:t("value"),dataIndex:"config_value"}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["configurationlist"],["component","box","container","panel","tablepanel","gridpanel","grid","configurationlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,configurationlist:true},["widget.configurationlist"],0,[MBilling.view.configuration,"List"],0));(Ext.cmd.derive("MBilling.view.configuration.Form",Ext.ux.form.Panel,{items:[{name:"config_value",fieldLabel:t("value"),allowBlank:true},{xtype:"textarea",name:"config_description",fieldLabel:t("description"),height:200,anchor:"100%",readOnly:true}]},0,["configurationform"],["component","box","container","panel","form","configurationform"],{component:true,box:true,container:true,panel:true,form:true,configurationform:true},["widget.configurationform"],0,[MBilling.view.configuration,"Form"],0));(Ext.cmd.derive("MBilling.view.general.BooleanCombo",Ext.form.field.ComboBox,{fieldLabel:t("status"),forceSelection:true,editable:false,value:1,store:[[1,t("active")],[0,t("inactive")]]},0,["booleancombo"],["component","box","field","textfield","pickerfield","combobox","combo","booleancombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,booleancombo:true},["widget.booleancombo"],0,[MBilling.view.general,"BooleanCombo"],0));(Ext.cmd.derive("MBilling.view.general.ServicesTypeCombo",Ext.form.field.ComboBox,{fieldLabel:t("status"),forceSelection:true,editable:false,value:"Custom",store:[["disk_space",t("disk_space")],["sipAccountLimit",t("Sip Account Limit")],["calllimit",t("calllimit")],["Custom",t("Custom")]]},0,["servicestypecombo"],["component","box","field","textfield","pickerfield","combobox","combo","servicestypecombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,servicestypecombo:true},["widget.servicestypecombo"],0,[MBilling.view.general,"ServicesTypeCombo"],0));(Ext.cmd.derive("MBilling.view.general.TypeSipForward",Ext.form.field.ComboBox,{fieldLabel:t("Forward"),forceSelection:true,editable:false,value:"",store:[["",t("")],["undefined",t("Undefined")],["sip",t("SIP")],["ivr",t("IVR")],["queue",t("Queue")],["group",t("Group")],["number",t("Number")],["hangup",t("Hangup")],["custom",t("Custom")]]},0,["typesipforwardcombo"],["component","box","field","textfield","pickerfield","combobox","combo","typesipforwardcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,typesipforwardcombo:true},["widget.typesipforwardcombo"],0,[MBilling.view.general,"TypeSipForward"],0));(Ext.cmd.derive("MBilling.view.general.TypeDestination",Ext.form.field.ComboBox,{fieldLabel:t("type"),forceSelection:true,editable:false,value:"",store:[["",t("")],["undefined",t("Undefined")],["sip",t("SIP")],["ivr",t("IVR")],["queue",t("Queue")],["group",t("Group")],["number",t("Number")],["repeat",t("Repeat IVR")],["hangup",t("Hangup")],["custom",t("Custom")]]},0,["typedestinationcombo"],["component","box","field","textfield","pickerfield","combobox","combo","typedestinationcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,typedestinationcombo:true},["widget.typedestinationcombo"],0,[MBilling.view.general,"TypeDestination"],0));(Ext.cmd.derive("MBilling.view.general.PontoVirgula",Ext.form.field.ComboBox,{fieldLabel:t("status"),forceSelection:true,editable:false,value:",",store:[[",",", ("+t("Comma")+")"],[";","; ("+t("Semicolon")+")"]]},0,["pontovirgulacombo"],["component","box","field","textfield","pickerfield","combobox","combo","pontovirgulacombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,pontovirgulacombo:true},["widget.pontovirgulacombo"],0,[MBilling.view.general,"PontoVirgula"],0));(Ext.cmd.derive("MBilling.view.general.StatusCombo",Ext.form.field.ComboBox,{fieldLabel:t("status"),forceSelection:true,editable:false,value:1,store:[[1,t("active")],[0,t("inactive")],[2,t("pending")],[3,t("sent")],[4,t("blocked")]]},0,["statuscombo"],["component","box","field","textfield","pickerfield","combobox","combo","statuscombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,statuscombo:true},["widget.statuscombo"],0,[MBilling.view.general,"StatusCombo"],0));(Ext.cmd.derive("MBilling.view.general.StatusUserCombo",Ext.form.field.ComboBox,{fieldLabel:t("status"),forceSelection:true,editable:false,value:1,store:[[1,t("active")],[0,t("inactive")],[2,t("pending")]]},0,["statususercombo"],["component","box","field","textfield","pickerfield","combobox","combo","statususercombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,statususercombo:true},["widget.statususercombo"],0,[MBilling.view.general,"StatusUserCombo"],0));(Ext.cmd.derive("MBilling.view.general.CallbackCombo",Ext.form.field.ComboBox,{fieldLabel:t("status"),forceSelection:true,editable:false,value:1,store:[[1,t("active")],[2,t("pending")],[3,t("sent")],[4,t("Not working")],[5,t("Complete")]]},0,["callbackcombo"],["component","box","field","textfield","pickerfield","combobox","combo","callbackcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,callbackcombo:true},["widget.callbackcombo"],0,[MBilling.view.general,"CallbackCombo"],0));(Ext.cmd.derive("MBilling.view.general.TypeNoYes",Ext.form.field.ComboBox,{fieldLabel:t("typepaid"),forceSelection:true,editable:false,value:0,store:[[0,t("no")],[1,t("yes")]]},0,["noyescombo"],["component","box","field","textfield","pickerfield","combobox","combo","noyescombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,noyescombo:true},["widget.noyescombo"],0,[MBilling.view.general,"TypeNoYes"],0));(Ext.cmd.derive("MBilling.view.general.TypeYesNo",Ext.form.field.ComboBox,{fieldLabel:t("typepaid"),forceSelection:true,editable:false,value:1,store:[[0,t("no")],[1,t("yes")]]},0,["yesnocombo"],["component","box","field","textfield","pickerfield","combobox","combo","yesnocombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,yesnocombo:true},["widget.yesnocombo"],0,[MBilling.view.general,"TypeYesNo"],0));(Ext.cmd.derive("MBilling.view.general.TypeYesNoString",Ext.form.field.ComboBox,{fieldLabel:t("typepaid"),forceSelection:true,editable:false,value:"yes",store:[["no",t("no")],["yes",t("yes")]]},0,["yesnostringcombo"],["component","box","field","textfield","pickerfield","combobox","combo","yesnostringcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,yesnostringcombo:true},["widget.yesnostringcombo"],0,[MBilling.view.general,"TypeYesNoString"],0));(Ext.cmd.derive("MBilling.view.general.TypeNoYesString",Ext.form.field.ComboBox,{fieldLabel:t("typepaid"),forceSelection:true,editable:false,value:"no",store:[["no",t("no")],["yes",t("yes")]]},0,["noyesstringcombo"],["component","box","field","textfield","pickerfield","combobox","combo","noyesstringcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,noyesstringcombo:true},["widget.noyesstringcombo"],0,[MBilling.view.general,"TypeNoYesString"],0));(Ext.cmd.derive("MBilling.view.general.Typenumber",Ext.form.field.ComboBox,{fieldLabel:t("typenumber"),forceSelection:true,editable:false,value:1,store:[[1,1],[2,2],[3,3],[4,4],[5,5]]},0,["numbercombo"],["component","box","field","textfield","pickerfield","combobox","combo","numbercombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,numbercombo:true},["widget.numbercombo"],0,[MBilling.view.general,"Typenumber"],0));(Ext.cmd.derive("MBilling.view.general.Typelanguage",Ext.form.field.ComboBox,{fieldLabel:t("language"),forceSelection:true,editable:false,value:"en",store:[["",t("undefined")],["br",t("portuguese")],["es",t("spanish")],["en",t("english")]]},0,["languagecombo"],["component","box","field","textfield","pickerfield","combobox","combo","languagecombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,languagecombo:true},["widget.languagecombo"],0,[MBilling.view.general,"Typelanguage"],0));(Ext.cmd.derive("MBilling.view.general.TypeCampaign",Ext.form.field.ComboBox,{fieldLabel:t("type"),forceSelection:true,editable:false,value:1,store:[[1,t("voice")],[0,t("sms")]]},0,["campaigntypecombo"],["component","box","field","textfield","pickerfield","combobox","combo","campaigntypecombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,campaigntypecombo:true},["widget.campaigntypecombo"],0,[MBilling.view.general,"TypeCampaign"],0));(Ext.cmd.derive("MBilling.view.general.TypeFullCampaign",Ext.form.field.ComboBox,{fieldLabel:t("type"),forceSelection:true,editable:false,value:1,store:[[1,t("voice")],[0,t("sms")]]},0,["campaigntypefullcombo"],["component","box","field","textfield","pickerfield","combobox","combo","campaigntypefullcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,campaigntypefullcombo:true},["widget.campaigntypefullcombo"],0,[MBilling.view.general,"TypeFullCampaign"],0));(Ext.cmd.derive("MBilling.view.general.TypeBoleto",Ext.form.field.ComboBox,{fieldLabel:t("status"),forceSelection:true,editable:false,value:"D",store:[["D",t("no")],["P",t("yes")]]},0,["boletocombo"],["component","box","field","textfield","pickerfield","combobox","combo","boletocombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,boletocombo:true},["widget.boletocombo"],0,[MBilling.view.general,"TypeBoleto"],0));(Ext.cmd.derive("MBilling.view.general.RestrictionCombo",Ext.form.field.ComboBox,{fieldLabel:t("status"),forceSelection:true,editable:false,value:0,store:[[0,t("inactive")],[1,t("cantCallRestrictedNumbers")],[2,t("canOnlyCallRestrictedNumbers")]]},0,["restrictioncombo"],["component","box","field","textfield","pickerfield","combobox","combo","restrictioncombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,restrictioncombo:true},["widget.restrictioncombo"],0,[MBilling.view.general,"RestrictionCombo"],0));(Ext.cmd.derive("MBilling.view.general.CountryISOCombo",Ext.form.field.ComboBox,{forceSelection:true,editable:true,listeners:{focus:function(b){b.expand()}},store:[["AFG",t("Afghanistan")],["ALA",t("Åland Islands")],["ALB",t("Albania")],["DZA",t("Algeria")],["ASM",t("American Samoa")],["AND",t("Andorra")],["AGO",t("Angola")],["AIA",t("Anguilla")],["ATA",t("Antarctica")],["ATG",t("Antigua and Barbuda")],["ARG",t("Argentina")],["ARM",t("Armenia")],["ABW",t("Aruba")],["AUS",t("Australia")],["AUT",t("Austria")],["AZE",t("Azerbaijan")],["BHS",t("Bahamas")],["BHR",t("Bahrain")],["BGD",t("Bangladesh")],["BRB",t("Barbados")],["BLR",t("Belarus")],["BEL",t("Belgium")],["BLZ",t("Belize")],["BEN",t("Benin")],["BMU",t("Bermuda")],["BTN",t("Bhutan")],["BOL",t("Bolivia, Plurinational State of")],["BES",t("Bonaire, Sint Eustatius and Saba")],["BIH",t("Bosnia and Herzegovina")],["BWA",t("Botswana")],["BVT",t("Bouvet Island")],["BRL",t("Brazil")],["IOT",t("British Indian Ocean Territory")],["BRN",t("Brunei Darussalam")],["BGR",t("Bulgaria")],["BFA",t("Burkina Faso")],["BDI",t("Burundi")],["KHM",t("Cambodia")],["CMR",t("Cameroon")],["CAN",t("Canada")],["CPV",t("Cape Verde")],["CYM",t("Cayman Islands")],["CAF",t("Central African Republic")],["TCD",t("Chad")],["CHL",t("Chile")],["CHN",t("China")],["CXR",t("Christmas Island")],["CCK",t("Cocos (Keeling) Islands")],["COL",t("Colombia")],["COM",t("Comoros")],["COG",t("Congo")],["COD",t("Congo, the Democratic Republic of the")],["COK",t("Cook Islands")],["CRI",t("Costa Rica")],["CIV",t("Côte dIvoire")],["HRV",t("Croatia")],["CUB",t("Cuba")],["CUW",t("Curaçao")],["CYP",t("Cyprus")],["CZE",t("Czech Republic")],["DNK",t("Denmark")],["DJI",t("Djibouti")],["DMA",t("Dominica")],["DOM",t("Dominican Republic")],["ECU",t("Ecuador")],["EGY",t("Egypt")],["SLV",t("El Salvador")],["GNQ",t("Equatorial Guinea")],["ERI",t("Eritrea")],["EST",t("Estonia")],["ETH",t("Ethiopia")],["FLK",t("Falkland Islands (Malvinas)")],["FRO",t("Faroe Islands")],["FJI",t("Fiji")],["FIN",t("Finland")],["FRA",t("France")],["GUF",t("French Guiana")],["PYF",t("French Polynesia")],["ATF",t("French Southern Territories")],["GAB",t("Gabon")],["GMB",t("Gambia")],["GEO",t("Georgia")],["DEU",t("Germany")],["GHA",t("Ghana")],["GIB",t("Gibraltar")],["GRC",t("Greece")],["GRL",t("Greenland")],["GRD",t("Grenada")],["GLP",t("Guadeloupe")],["GUM",t("Guam")],["GTM",t("Guatemala")],["GGY",t("Guernsey")],["GIN",t("Guinea")],["GNB",t("Guinea-Bissau")],["GUY",t("Guyana")],["HTI",t("Haiti")],["HMD",t("Heard Island and McDonald Islands")],["VAT",t("Holy See (Vatican City State)")],["HND",t("Honduras")],["HKG",t("Hong Kong")],["HUN",t("Hungary")],["ISL",t("Iceland")],["IND",t("India")],["IDN",t("Indonesia")],["IRN",t("Iran, Islamic Republic of")],["IRQ",t("Iraq")],["IRL",t("Ireland")],["IMN",t("Isle of Man")],["ISR",t("Israel")],["ITA",t("Italy")],["JAM",t("Jamaica")],["JPN",t("Japan")],["JEY",t("Jersey")],["JOR",t("Jordan")],["KAZ",t("Kazakhstan")],["KEN",t("Kenya")],["KIR",t("Kiribati")],["PRK",t("Korea, Democratic Peoples Republic of")],["KOR",t("Korea, Republic of")],["KWT",t("Kuwait")],["KGZ",t("Kyrgyzstan")],["LAO",t("Lao Peoples Democratic Republic")],["LVA",t("Latvia")],["LBN",t("Lebanon")],["LSO",t("Lesotho")],["LBR",t("Liberia")],["LBY",t("Libya")],["LIE",t("Liechtenstein")],["LTU",t("Lithuania")],["LUX",t("Luxembourg")],["MAC",t("Macao")],["MKD",t("Macedonia, the former Yugoslav Republic of")],["MDG",t("Madagascar")],["MWI",t("Malawi")],["MYS",t("Malaysia")],["MDV",t("Maldives")],["MLI",t("Mali")],["MLT",t("Malta")],["MHL",t("Marshall Islands")],["MTQ",t("Martinique")],["MRT",t("Mauritania")],["MUS",t("Mauritius")],["MYT",t("Mayotte")],["MEX",t("Mexico")],["FSM",t("Micronesia, Federated States of")],["MDA",t("Moldova, Republic of")],["MCO",t("Monaco")],["MNG",t("Mongolia")],["MNE",t("Montenegro")],["MSR",t("Montserrat")],["MAR",t("Morocco")],["MOZ",t("Mozambique")],["MMR",t("Myanmar")],["NAM",t("Namibia")],["NRU",t("Nauru")],["NPL",t("Nepal")],["NLD",t("Netherlands")],["NCL",t("New Caledonia")],["NZL",t("New Zealand")],["NIC",t("Nicaragua")],["NER",t("Niger")],["NGA",t("Nigeria")],["NIU",t("Niue")],["NFK",t("Norfolk Island")],["MNP",t("Northern Mariana Islands")],["NOR",t("Norway")],["OMN",t("Oman")],["PAK",t("Pakistan")],["PLW",t("Palau")],["PSE",t("Palestinian Territory, Occupied")],["PAN",t("Panama")],["PNG",t("Papua New Guinea")],["PRY",t("Paraguay")],["PER",t("Peru")],["PHL",t("Philippines")],["PCN",t("Pitcairn")],["POL",t("Poland")],["PRT",t("Portugal")],["PRI",t("Puerto Rico")],["QAT",t("Qatar")],["REU",t("Réunion")],["ROU",t("Romania")],["RUS",t("Russian Federation")],["RWA",t("Rwanda")],["BLM",t("Saint Barthélemy")],["SHN",t("Saint Helena, Ascension and Tristan da Cunha")],["KNA",t("Saint Kitts and Nevis")],["LCA",t("Saint Lucia")],["MAF",t("Saint Martin (French part)")],["SPM",t("Saint Pierre and Miquelon")],["VCT",t("Saint Vincent and the Grenadines")],["WSM",t("Samoa")],["SMR",t("San Marino")],["STP",t("Sao Tome and Principe")],["SAU",t("Saudi Arabia")],["SEN",t("Senegal")],["SRB",t("Serbia")],["SYC",t("Seychelles")],["SLE",t("Sierra Leone")],["SGP",t("Singapore")],["SXM",t("Sint Maarten (Dutch part)")],["SVK",t("Slovakia")],["SVN",t("Slovenia")],["SLB",t("Solomon Islands")],["SOM",t("Somalia")],["ZAF",t("South Africa")],["SGS",t("South Georgia and the South Sandwich Islands")],["SSD",t("South Sudan")],["ESP",t("Spain")],["LKA",t("Sri Lanka")],["SDN",t("Sudan")],["SUR",t("Suriname")],["SJM",t("Svalbard and Jan Mayen")],["SWZ",t("Swaziland")],["SWE",t("Sweden")],["CHE",t("Switzerland")],["SYR",t("Syrian Arab Republic")],["TWN",t("Taiwan, Province of China")],["TJK",t("Tajikistan")],["TZA",t("Tanzania, United Republic of")],["THA",t("Thailand")],["TLS",t("Timor-Leste")],["TGO",t("Togo")],["TKL",t("Tokelau")],["TON",t("Tonga")],["TTO",t("Trinidad and Tobago")],["TUN",t("Tunisia")],["TUR",t("Turkey")],["TKM",t("Turkmenistan")],["TCA",t("Turks and Caicos Islands")],["TUV",t("Tuvalu")],["UGA",t("Uganda")],["UKR",t("Ukraine")],["ARE",t("United Arab Emirates")],["GBR",t("United Kingdom")],["USA",t("United States")],["UMI",t("United States Minor Outlying Islands")],["URY",t("Uruguay")],["UZB",t("Uzbekistan")],["VUT",t("Vanuatu")],["VEN",t("Venezuela, Bolivarian Republic of")],["VNM",t("Viet Nam")],["VGB",t("Virgin Islands, British")],["VIR",t("Virgin Islands, U.S.")],["WLF",t("Wallis and Futuna")],["ESH",t("Western Sahara")],["YEM",t("Yemen")],["ZMB",t("Zambia")],["ZWE",t("Zimbabwe")]]},0,["countryisocombo"],["component","box","field","textfield","pickerfield","combobox","combo","countryisocombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,countryisocombo:true},["widget.countryisocombo"],0,[MBilling.view.general,"CountryISOCombo"],0));(Ext.cmd.derive("MBilling.view.general.CountryCombo",Ext.form.field.ComboBox,{fieldLabel:t("Country"),forceSelection:true,editable:true,allowBlank:true,listeners:{focus:function(b){b.expand()}},store:[["",t("Select")],["93",t("Afghanistan")],["355",t("Albania")],["213",t("Algeria")],["684",t("American Samoa")],["376",t("Andorra")],["244",t("Angola")],["1264",t("Anguilla")],["672",t("Antarctica")],["1268",t("Antigua And Barbuda")],["54",t("Argentina")],["374",t("Armenia")],["297",t("Aruba")],["61",t("Australia")],["43",t("Austria")],["994",t("Azerbaijan")],["1242",t("Bahamas")],["973",t("Bahrain")],["880",t("Bangladesh")],["1246",t("Barbados")],["375",t("Belarus")],["32",t("Belgium")],["501",t("Belize")],["229",t("Benin")],["1441",t("Bermuda")],["975",t("Bhutan")],["591",t("Bolivia")],["387",t("Bosnia And Herzegovina")],["267",t("Botswana")],["55",t("Brazil")],["1284",t("British Indian Ocean Territory")],["673",t("Brunei Darussalam")],["359",t("Bulgaria")],["226",t("Burkina Faso")],["257",t("Burundi")],["855",t("Cambodia")],["237",t("Cameroon")],["238",t("Cape Verde")],["1345",t("Cayman Islands")],["236",t("Central African Republic")],["235",t("Chad")],["56",t("Chile")],["86",t("China")],["618",t("Christmas Island")],["61",t("Cocos (Keeling); Islands")],["57",t("Colombia")],["269",t("Comoros")],["242",t("Congo")],["243",t("Congo, The Democratic Republic Of The")],["682",t("Cook Islands")],["506",t("Costa Rica")],["385",t("Croatia")],["53",t("Cuba")],["357",t("Cyprus")],["420",t("Czech Republic")],["45",t("Denmark")],["253",t("Djibouti")],["1767",t("Dominica")],["1809",t("Dominican Republic")],["593",t("Ecuador")],["20",t("Egypt")],["503",t("El Salvador")],["240",t("Equatorial Guinea")],["291",t("Eritrea")],["372",t("Estonia")],["251",t("Ethiopia")],["500",t("Falkland Islands (Malvinas)")],["298",t("Faroe Islands")],["679",t("Fiji")],["358",t("Finland")],["33",t("France")],["596",t("French Guiana")],["594",t("French Polynesia")],["689",t("French Southern Territories")],["241",t("Gabon")],["220",t("Gambia")],["995",t("Georgia")],["49",t("Germany")],["233",t("Ghana")],["350",t("Gibraltar")],["30",t("Greece")],["299",t("Greenland")],["1473",t("Grenada")],["590",t("Guadeloupe")],["1671",t("Guam")],["502",t("Guatemala")],["224",t("Guinea")],["245",t("Guinea-Bissau")],["592",t("Guyana")],["509",t("Haiti")],["504",t("Honduras")],["852",t("Hong Kong")],["36",t("Hungary")],["354",t("Iceland")],["91",t("India")],["62",t("Indonesia")],["98",t("Iran, Islamic Republic Of")],["964",t("Iraq")],["353",t("Ireland")],["972",t("Israel")],["39",t("Italy")],["1876",t("Jamaica")],["81",t("Japan")],["962",t("Jordan")],["7",t("Kazakhstan")],["254",t("Kenya")],["686",t("Kiribati")],["850",t("Korea, Democratic Peoples Republic Of")],["82",t("Korea, Republic of")],["965",t("Kuwait")],["996",t("Kyrgyzstan")],["856",t("Lao Peoples Democratic Republic")],["371",t("Latvia")],["961",t("Lebanon")],["266",t("Lesotho")],["231",t("Liberia")],["218",t("Libyan Arab Jamahiriya")],["423",t("Liechtenstein")],["370",t("Lithuania")],["352",t("Luxembourg")],["853",t("Macao")],["389",t("Macedonia, The Former Yugoslav Republic Of")],["261",t("Madagascar")],["265",t("Malawi")],["60",t("Malaysia")],["960",t("Maldives")],["223",t("Mali")],["356",t("Malta")],["692",t("Marshall islands")],["596",t("Martinique")],["222",t("Mauritania")],["230",t("Mauritius")],["269",t("Mayotte")],["52",t("Mexico")],["691",t("Micronesia, Federated States Of")],["1808",t("Moldova, Republic Of")],["377",t("Monaco")],["976",t("Mongolia")],["1664",t("Montserrat")],["212",t("Morocco")],["258",t("Mozambique")],["95",t("Myanmar")],["264",t("Namibia")],["674",t("Nauru")],["977",t("Nepal")],["31",t("Netherlands")],["599",t("Netherlands Antilles")],["687",t("New Caledonia")],["64",t("New Zealand")],["505",t("Nicaragua")],["227",t("Niger")],["234",t("Nigeria")],["683",t("Niue")],["672",t("Norfolk Island")],["1670",t("Northern Mariana Islands")],["47",t("Norway")],["968",t("Oman")],["92",t("Pakistan")],["680",t("Palau")],["970",t("Palestinian Territory, Occupied")],["507",t("Panama")],["675",t("Papua New Guinea")],["595",t("Paraguay")],["51",t("Peru")],["63",t("Philippines")],["48",t("Poland")],["351",t("Portugal")],["1787",t("Puerto Rico")],["974",t("Qatar")],["262",t("Reunion")],["40",t("Romania")],["7",t("Russian Federation")],["250",t("Rwanda")],["290",t("SaINT Helena")],["1869",t("SaINT Kitts And Nevis")],["1758",t("SaINT Lucia")],["508",t("SaINT Pierre And Miquelon")],["1784",t("SaINT Vincent And The Grenadines")],["685",t("Samoa")],["378",t("San Marino")],["239",t("São Tomé And Principe")],["966",t("Saudi Arabia")],["221",t("Senegal")],["248",t("Seychelles")],["232",t("Sierra Leone")],["65",t("Singapore")],["421",t("Slovakia")],["386",t("Slovenia")],["677",t("Solomon Islands")],["252",t("Somalia")],["27",t("South Africa")],["34",t("Spain")],["94",t("Sri Lanka")],["249",t("Sudan")],["597",t("Suriname")],["268",t("Swaziland")],["46",t("Sweden")],["41",t("Switzerland")],["963",t("Syrian Arab Republic")],["886",t("Taiwan, Province Of China")],["992",t("Tajikistan")],["255",t("Tanzania, United Republic Of")],["66",t("Thailand")],["670",t("Timor-Leste")],["228",t("Togo")],["690",t("Tokelau")],["676",t("Tonga")],["1868",t("Trinidad And Tobago")],["216",t("Tunisia")],["90",t("Turkey")],["993",t("Turkmenistan")],["1649",t("Turks And Caicos Islands")],["688",t("Tuvalu")],["256",t("Uganda")],["380",t("Ukraine")],["971",t("United Arab Emirates")],["44",t("United Kingdom")],["1",t("United States/Canada")],["598",t("Uruguay")],["998",t("Uzbekistan")],["678",t("Vanuatu")],["58",t("Venezuela")],["84",t("Vietnam")],["1284",t("Virgin Islands, British")],["808",t("Virgin Islands, U.S.")],["681",t("Wallis And Futuna")],["967",t("Yemen")],["260",t("Zambia")],["263",t("Zimbabwe")],["35818",t("Aland Islands")],["441481",t("Guernsey")],["441624",t("Isle of Man")],["441534",t("Jersey")],["382",t("Montenegro, Republic of")],["381",t("Serbia, Republic of")]]},0,["countrycombo"],["component","box","field","textfield","pickerfield","combobox","combo","countrycombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,countrycombo:true},["widget.countrycombo"],0,[MBilling.view.general,"CountryCombo"],0));(Ext.cmd.derive("MBilling.view.general.GroupCombo",Ext.form.field.ComboBox,{fieldLabel:t("group"),value:"config_group_title",forceSelection:true,editable:false,store:[["global","global"],["callback","callback"],["agi-conf1","agi-conf1"],["agi-conf2","agi-conf2"]]},0,["groupcombo"],["component","box","field","textfield","pickerfield","combobox","combo","groupcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,groupcombo:true},["widget.groupcombo"],0,[MBilling.view.general,"GroupCombo"],0));(Ext.cmd.derive("MBilling.view.general.LcrtypeCombo",Ext.form.field.ComboBox,{fieldLabel:t("lcrtype"),forceSelection:true,editable:false,value:1,store:[[1,t("LCRAccordingtothebuyerPrice")],[0,t("LCRAccordingtothesellerPrice")]]},0,["lcrtypecombo"],["component","box","field","textfield","pickerfield","combobox","combo","lcrtypecombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,lcrtypecombo:true},["widget.lcrtypecombo"],0,[MBilling.view.general,"LcrtypeCombo"],0));(Ext.cmd.derive("MBilling.view.general.LcrtypeFullCombo",Ext.form.field.ComboBox,{forceSelection:true,editable:false,fieldLabel:t("lcrtype"),value:1,store:[[1,t("LCRAccordingtothebuyerPrice")],[0,t("LCRAccordingtothesellerPrice")],[2,t("Load Balancer")]]},0,["lcrtypefullcombo"],["component","box","field","textfield","pickerfield","combobox","combo","lcrtypefullcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,lcrtypefullcombo:true},["widget.lcrtypefullcombo"],0,[MBilling.view.general,"LcrtypeFullCombo"],0));(Ext.cmd.derive("MBilling.view.general.OfferTypeCombo",Ext.form.field.ComboBox,{fieldLabel:t("offertype"),forceSelection:true,editable:false,value:0,store:[[0,t("unlimitedcalls")],[1,t("numberfreecalls")],[2,t("freeseconds")]]},0,["offertypecombo"],["component","box","field","textfield","pickerfield","combobox","combo","offertypecombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,offertypecombo:true},["widget.offertypecombo"],0,[MBilling.view.general,"OfferTypeCombo"],0));(Ext.cmd.derive("MBilling.view.general.BillingTypeCombo",Ext.form.field.ComboBox,{fieldLabel:t("billingtype"),forceSelection:true,editable:false,value:0,store:[[0,t("monthly")],[1,t("weekly")]]},0,["billingtypecombo"],["component","box","field","textfield","pickerfield","combobox","combo","billingtypecombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,billingtypecombo:true},["widget.billingtypecombo"],0,[MBilling.view.general,"BillingTypeCombo"],0));(Ext.cmd.derive("MBilling.view.general.SipCombo",Ext.form.field.ComboBox,{fieldLabel:t("providertech"),forceSelection:true,editable:false,value:"sip",store:[["sip","sip"],["dahdi","dahdi"],["khomp","khomp"],["iax2","iax2"],["dgv","dgv"],["ooh323","ooh323"],["extra","extra"],["Dongle","Dongle"],["Local","Local"]]},0,["sipcombo"],["component","box","field","textfield","pickerfield","combobox","combo","sipcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,sipcombo:true},["widget.sipcombo"],0,[MBilling.view.general,"SipCombo"],0));(Ext.cmd.derive("MBilling.view.general.TypePaymentCombo",Ext.form.field.ComboBox,{fieldLabel:t("typepaid"),forceSelection:true,editable:false,value:0,store:[[0,t("prepaid")],[1,t("pospaid")]]},0,["typepaymentcombo"],["component","box","field","textfield","pickerfield","combobox","combo","typepaymentcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,typepaymentcombo:true},["widget.typepaymentcombo"],0,[MBilling.view.general,"TypePaymentCombo"],0));(Ext.cmd.derive("MBilling.view.general.CampaignSendCombo",Ext.form.field.ComboBox,{fieldLabel:t("type"),forceSelection:true,editable:false,displayField:"name",valueField:"id",value:"CALL1",store:{fields:["id","name"],data:[{id:"CALL1",name:t("Select type"),showFields:["type"]},{id:"SMS",name:"SMS",showFields:["type","sms_text","csv_path","numbers","startingdate","startingtime"]},{id:"CALL",name:"CALL",showFields:["type","audio_path","csv_path","numbers","startingdate","startingtime"]}]}},0,["campaignsendcombo"],["component","box","field","textfield","pickerfield","combobox","combo","campaignsendcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,campaignsendcombo:true},["widget.campaignsendcombo"],0,[MBilling.view.general,"CampaignSendCombo"],0));(Ext.cmd.derive("MBilling.view.general.PaymentCountryCombo",Ext.form.field.ComboBox,{fieldLabel:t("typepaid"),value:"Brasil",forceSelection:true,editable:true,listeners:{focus:function(b){b.expand()}},store:[["Argentina","Argentina"],["Brasil","Brasil"],["Colombia","Colombia"],["Latino America","Latino America"],["Global","Global"]]},0,["paymentcountrycombo"],["component","box","field","textfield","pickerfield","combobox","combo","paymentcountrycombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,paymentcountrycombo:true},["widget.paymentcountrycombo"],0,[MBilling.view.general,"PaymentCountryCombo"],0));(Ext.cmd.derive("MBilling.view.general.BoletoBanckCombo",Ext.form.field.ComboBox,{fieldLabel:t("Banco"),forceSelection:true,editable:false,value:"cef",store:[["cef","Caixa Economica SICOB"],["bradesco","Bradesco"]]},0,["boletobanckcombo"],["component","box","field","textfield","pickerfield","combobox","combo","boletobanckcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,boletobanckcombo:true},["widget.boletobanckcombo"],0,[MBilling.view.general,"BoletoBanckCombo"],0));(Ext.cmd.derive("MBilling.view.general.PaymentBanckCombo",Ext.form.field.ComboBox,{fieldLabel:t("typepaid"),forceSelection:true,editable:false,value:"Banco do Brasil",store:[["Banco do Brasil","Banco do Brasil"],["bradesco","Bradesco"],["hsbc","Hsbc"],["itau","Itau"],["santander","Santander"],["unibanco","Unibanco"],["cef","Caixa Economica SICOB"],["cef_sinco","Caixa Economica SINCO"],["cef_sigcb","Caixa Economica SIGCB"]]},0,["paymentbanckcombo"],["component","box","field","textfield","pickerfield","combobox","combo","paymentbanckcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,paymentbanckcombo:true},["widget.paymentbanckcombo"],0,[MBilling.view.general,"PaymentBanckCombo"],0));(Ext.cmd.derive("MBilling.view.templateMail.Controller",Ext.ux.app.ViewController,{onAfterSave:function(d){var c=this;d=d||c.formPanel;if(!d.idRecord){d.getForm().reset();c.focusFirstField()}c.saveButton.enable();c.updateLotButton&&c.updateLotButton.toggle(false);d.setLoading(false);c.store.load()},onEdit:function(){var b=this;b.lookupReference("generalTab").show();Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)}},0,0,0,0,["controller.templatemail"],0,[MBilling.view.templateMail,"Controller"],0));(Ext.cmd.derive("MBilling.view.templateMail.Module",Ext.ux.panel.Module,{controller:"templatemail",cfgEast:{flex:9}},0,["templatemailmodule"],["component","box","container","uxpanelmodule","templatemailmodule"],{component:true,box:true,container:true,uxpanelmodule:true,templatemailmodule:true},["widget.templatemailmodule"],0,[MBilling.view.templateMail,"Module"],0));(Ext.cmd.derive("MBilling.view.templateMail.List",Ext.ux.grid.Panel,{store:"TemplateMail",initComponent:function(){var b=this;b.allowPrint=false;b.buttonCsv=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowDelete=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("type"),dataIndex:"mailtype",flex:3},{header:t("Language"),renderer:Helper.Util.formatLanguageImage,dataIndex:"language",flex:2},{header:t("subject"),dataIndex:"subject",flex:7}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["templatemaillist"],["component","box","container","panel","tablepanel","gridpanel","grid","templatemaillist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,templatemaillist:true},["widget.templatemaillist"],0,[MBilling.view.templateMail,"List"],0));(Ext.cmd.derive("MBilling.view.templateMail.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true}},items:[{title:t("general"),reference:"generalTab",items:[{name:"fromname",fieldLabel:t("fromname")},{name:"fromemail",fieldLabel:t("fromemail")},{name:"subject",fieldLabel:t("subject")}]},{title:t("Email body"),items:[{hideLabel:true,xtype:"htmleditor",name:"messagehtml",fieldLabel:t("description"),height:1000,anchor:"100%"}]},{title:t("Variables"),items:[{xtype:"displayfield",fieldLabel:t("username"),value:'$login$',allowBlank:true},{xtype:"displayfield",fieldLabel:t("password"),value:'$password$',allowBlank:true},{xtype:"displayfield",fieldLabel:t("email"),value:'$email$',allowBlank:true},{xtype:"displayfield",fieldLabel:t("firstname"),value:'$firstname$',allowBlank:true},{xtype:"displayfield",fieldLabel:t("lastname"),value:'$lastname$',allowBlank:true},{xtype:"displayfield",fieldLabel:t("credit"),value:'$credit$',allowBlank:true},{xtype:"displayfield",fieldLabel:t("date"),value:'$time$',allowBlank:true},{xtype:"displayfield",fieldLabel:t("description"),value:'$description$',allowBlank:true},{xtype:"displayfield",fieldLabel:t("Url to cancel email credit notification"),value:'$cancel_credit_notification_email$',allowBlank:true}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["templatemailform"],["component","box","container","panel","form","templatemailform"],{component:true,box:true,container:true,panel:true,form:true,templatemailform:true},["widget.templatemailform"],0,[MBilling.view.templateMail,"Form"],0));(Ext.cmd.derive("MBilling.view.logUsers.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.logusers"],0,[MBilling.view.logUsers,"Controller"],0));(Ext.cmd.derive("MBilling.view.logUsers.Module",Ext.ux.panel.Module,{controller:"logusers"},0,["logusersmodule"],["component","box","container","uxpanelmodule","logusersmodule"],{component:true,box:true,container:true,uxpanelmodule:true,logusersmodule:true},["widget.logusersmodule"],0,[MBilling.view.logUsers,"Module"],0));(Ext.cmd.derive("MBilling.view.logUsers.List",Ext.ux.grid.Panel,{store:"LogUsers",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.allowDelete=false;b.allowCreate=false;b.allowUpdate=false;b.columns=[{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isOperator,hideable:!App.user.isOperator},{header:t("action"),dataIndex:"idLogActionsname",renderer:Helper.Util.translate,flex:3},{header:t("description"),dataIndex:"description",flex:7},{header:t("IP"),dataIndex:"ip",flex:4},{header:t("date"),renderer:Helper.Util.formatDateTime,dataIndex:"date",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["loguserslist"],["component","box","container","panel","tablepanel","gridpanel","grid","loguserslist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,loguserslist:true},["widget.loguserslist"],0,[MBilling.view.logUsers,"List"],0));(Ext.cmd.derive("MBilling.view.logUsers.Form",Ext.ux.form.Panel,{fieldsHideEdit:["cid"],initComponent:function(){var b=this;b.items=[{xtype:"usercombo",allowBlank:true,readOnly:true},{name:"id_log_actions",fieldLabel:t("action"),readOnly:true},{name:"ip",fieldLabel:t("ip"),readOnly:true},{xtype:"textareafield",name:"description",fieldLabel:t("description"),height:400,anchor:"100%",allowBlank:true,readOnly:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["logusersform"],["component","box","container","panel","form","logusersform"],{component:true,box:true,container:true,panel:true,form:true,logusersform:true},["widget.logusersform"],0,[MBilling.view.logUsers,"Form"],0));(Ext.cmd.derive("MBilling.view.provider.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.provider"],0,[MBilling.view.provider,"Controller"],0));(Ext.cmd.derive("MBilling.view.provider.Combo",Ext.form.field.ComboBox,{name:"id_provider",fieldLabel:t("provider"),forceSelection:true,editable:false,displayField:"provider_name",valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Provider",{proxy:{type:"uxproxy",module:"provider",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["providercombo"],["component","box","field","textfield","pickerfield","combobox","combo","providercombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,providercombo:true},["widget.providercombo"],0,[MBilling.view.provider,"Combo"],0));(Ext.cmd.derive("MBilling.view.provider.Module",Ext.ux.panel.Module,{controller:"provider"},0,["providermodule"],["component","box","container","uxpanelmodule","providermodule"],{component:true,box:true,container:true,uxpanelmodule:true,providermodule:true},["widget.providermodule"],0,[MBilling.view.provider,"Module"],0));(Ext.cmd.derive("MBilling.view.provider.List",Ext.ux.grid.Panel,{store:"Provider",initComponent:function(){var b=this;b.columns=b.columns||[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("name"),dataIndex:"provider_name"},{header:t("description"),dataIndex:"description"},{header:t("credit"),dataIndex:"credit",renderer:Helper.Util.formatMoneyDecimal},{header:t("creationdate"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"creationdate"}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["providerlist"],["component","box","container","panel","tablepanel","gridpanel","grid","providerlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,providerlist:true},["widget.providerlist"],0,[MBilling.view.provider,"List"],0));(Ext.cmd.derive("MBilling.view.provider.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["provider_name"],initComponent:function(){var b=this;b.items=[{name:"provider_name",fieldLabel:t("name")},{xtype:"moneyfield",name:"credit",mask:App.user.currency+" #9.999.990,00",fieldLabel:t("credit"),value:"0"},{xtype:"noyescombo",name:"credit_control",fieldLabel:t("Credit")+" "+t("control"),hidden:App.user.isClient},{xtype:"textareafield",name:"description",fieldLabel:t("description"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["providerform"],["component","box","container","panel","form","providerform"],{component:true,box:true,container:true,panel:true,form:true,providerform:true},["widget.providerform"],0,[MBilling.view.provider,"Form"],0));(Ext.cmd.derive("MBilling.view.provider.Lookup",Ext.ux.form.field.Lookup,{name:"id_provider",fieldLabel:t("Provider"),displayField:"idProviderprovider_name",displayFieldList:"provider_name",gridConfig:{xtype:"providerlist",fieldSearch:"username",columns:[{header:t("name"),dataIndex:"provider_name"},{header:t("description"),dataIndex:"description"}]}},0,["providerlookup"],["component","box","container","fieldcontainer","providerlookup"],{component:true,box:true,container:true,fieldcontainer:true,providerlookup:true},["widget.providerlookup"],0,[MBilling.view.provider,"Lookup"],0));(Ext.cmd.derive("MBilling.view.plan.Controller",Ext.ux.app.ViewController,{init:function(){var b=this;b.control({noyescombo:{select:b.onSelectType}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectType:function(c,d){this.showFieldsRelated(d.getData().showFields)},showFieldsRelated:function(j){var l=this,g=l.formPanel.getForm().getFields(),f=l.formPanel.getForm().findField("ini_credit"),m=l.formPanel.getForm();g.each(function(a){if(a.name=="signup"){a.value==1?f.show():f.hide()}})},onEdit:function(){var f=this,d=f.formPanel.getForm().findField("ini_credit"),e=f.formPanel.getForm().findField("signup");Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments);e.value==1?d.show():d.hide()}},0,0,0,0,["controller.plan"],0,[MBilling.view.plan,"Controller"],0));(Ext.cmd.derive("MBilling.view.plan.Combo",Ext.form.field.ComboBox,{name:"id_plan",fieldLabel:t("plan"),displayField:"name",valueField:"id",forceSelection:true,editable:true,listeners:{focus:function(b){b.expand()}},initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Plan",{proxy:{type:"uxproxy",module:"plan",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["plancombo"],["component","box","field","textfield","pickerfield","combobox","combo","plancombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,plancombo:true},["widget.plancombo"],0,[MBilling.view.plan,"Combo"],0));(Ext.cmd.derive("MBilling.view.plan.Module",Ext.ux.panel.Module,{controller:"plan"},0,["planmodule"],["component","box","container","uxpanelmodule","planmodule"],{component:true,box:true,container:true,uxpanelmodule:true,planmodule:true},["widget.planmodule"],0,[MBilling.view.plan,"Module"],0));(Ext.cmd.derive("MBilling.view.plan.List",Ext.ux.grid.Panel,{store:"Plan",fieldSearch:"name",initComponent:function(){var b=this;b.columns=b.columns||[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("name"),dataIndex:"name",flex:4},{header:t("lcrtype"),dataIndex:"lcrtype",comboRelated:"lcrtypecombo",renderer:Helper.Util.formatLcrtype,flex:4,filter:{type:"list",options:[[1,t("LCRAccordingtothebuyerPrice")],[0,t("LCRAccordingtothesellerPrice")],[2,t("Load Balancer")]]}},{header:t("Tech Prefx"),dataIndex:"techprefix",flex:4,hidden:!App.user.isAdmin},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"creationdate",flex:4},{header:t("Port. Celular"),dataIndex:"portabilidadeMobile",flex:2,renderer:Helper.Util.formattyyesno,filter:{type:"list",options:[[0,t("no")],[1,t("yes")]]},hidden:App.user.language!="pt_BR",hideable:false},{header:t("Port. Fixo"),dataIndex:"portabilidadeFixed",flex:2,renderer:Helper.Util.formattyyesno,filter:{type:"list",options:[[0,t("no")],[1,t("yes")]]},hidden:App.user.language!="pt_BR",hideable:false}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["planlist"],["component","box","container","panel","tablepanel","gridpanel","grid","planlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,planlist:true},["widget.planlist"],0,[MBilling.view.plan,"List"],0));(Ext.cmd.derive("MBilling.view.plan.Form",Ext.ux.form.Panel,{labelWidthFields:115,fieldsHideUpdateLot:["name"],initComponent:function(){var b=this;b.defaults={labelWidth:142};b.items=[{name:"name",fieldLabel:t("name"),maxLength:100},{xtype:"lcrtypefullcombo",name:"lcrtype",fieldLabel:t("lcrtype"),allowBlank:true},{xtype:"numberfield",name:"tariff_limit",minValue:1,value:1,fieldLabel:t("Tariff Find Limit"),hidden:!App.user.isAdmin},{xtype:"noyescombo",name:"signup",fieldLabel:t("useInSignup"),allowBlank:true},{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,00",name:"ini_credit",fieldLabel:t("Initial Credit to new users"),allowBlank:true,hidden:true,value:0},{xtype:"yesnocombo",name:"play_audio",fieldLabel:t("Notices with audio"),allowBlank:true,hidden:App.user.isClient},{style:"margin-top:25px",xtype:"fieldset",title:t("Ativar portabilidade?"),collapsible:true,collapsed:false,hidden:App.user.language!="pt_BR",defaults:{labelWidth:190,anchor:"100%",layout:{type:"hbox",labelAlign:b.labelAlignFields}},items:[{xtype:"noyescombo",name:"portabilidadeMobile",fieldLabel:t("Para Celular"),allowBlank:true,hidden:App.user.language!="pt_BR"},{xtype:"noyescombo",name:"portabilidadeFixed",fieldLabel:t("Para Fixo"),allowBlank:true,hidden:App.user.language!="pt_BR"}]},{name:"techprefix",fieldLabel:t("Tech Prefix"),allowBlank:true,maxLength:5,minLength:5,hidden:!App.user.isAdmin},{style:"margin-top:25px",xtype:"fieldset",title:t("Select one or more Services"),collapsible:true,collapsed:false,items:[{anchor:"100%",fieldLabel:"",xtype:"servicestag",allowBlank:true}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["planform"],["component","box","container","panel","form","planform"],{component:true,box:true,container:true,panel:true,form:true,planform:true},["widget.planform"],0,[MBilling.view.plan,"Form"],0));(Ext.cmd.derive("MBilling.view.plan.Tag",Ext.form.field.Tag,{name:"id_plan",fieldLabel:t("plan"),displayField:"name",valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Plan",{proxy:{type:"uxproxy",module:"plan",limitParam:undefined}});Ext.form.field.Tag.prototype.initComponent.apply(this,arguments)}},0,["plantag"],["component","box","field","textfield","pickerfield","combobox","combo","tagfield","plantag"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,tagfield:true,plantag:true},["widget.plantag"],0,[MBilling.view.plan,"Tag"],0));(Ext.cmd.derive("MBilling.view.plan.Lookup",Ext.ux.form.field.Lookup,{name:"id_plan",fieldLabel:t("Plan"),displayField:"idPlanname",displayFieldList:"name",gridConfig:{xtype:"planlist",fieldSearch:"name",columns:[{header:t("name"),dataIndex:"name",flex:2}]}},0,["planlookup"],["component","box","container","fieldcontainer","planlookup"],{component:true,box:true,container:true,fieldcontainer:true,planlookup:true},["widget.planlookup"],0,[MBilling.view.plan,"Lookup"],0));(Ext.cmd.derive("MBilling.view.trunk.Controller",Ext.ux.app.ViewController,{onEdit:function(){var f=this,e=f.list.getSelectionModel().getSelection()[0],d=f.formPanel.getForm().findField("register");if(e.get("register")==1){if(e.get("register")&&e.get("providertech")=="sip"){color=e.get("registered")==1?"green":"red";d.setFieldLabel(t("registertrunk")+' ')}else{d.setFieldLabel(t("registertrunk"))}f.formPanel.getForm().findField("register_string")["show"]()}else{d.setFieldLabel(t("registertrunk"));f.formPanel.getForm().findField("register_string")["hide"]()}Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments);valueAllow=f.formPanel.idRecord?e.get("allow").split(","):["g729","gsm","alaw","ulaw"];fieldAllow=f.formPanel.down("checkboxgroup");fieldAllow.setValue({allow:valueAllow})},init:function(){var b=this;b.control({"noyescombo[name=register]":{select:b.onSelectType}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectType:function(c,d){this.showFieldsRelated(d.getData().showFields)},showFieldsRelated:function(o){var p=this,m=p.formPanel.getForm().findField("register_string"),n=p.formPanel.getForm().findField("user"),q=p.formPanel.getForm().findField("secret"),j=p.formPanel.getForm().findField("host"),l=p.formPanel.getForm().getFields();l.each(function(a){if(a.name=="register"){m.setVisible(a.value==1);m.setValue(n.value+":"+q.value+"@"+j.value+"/"+n.value)}})}},0,0,0,0,["controller.trunk"],0,[MBilling.view.trunk,"Controller"],0));(Ext.cmd.derive("MBilling.view.trunk.Combo",Ext.form.field.ComboBox,{name:"id_trunk",fieldLabel:t("trunk"),forceSelection:true,editable:true,listeners:{focus:function(b){b.expand()}},displayField:"trunkcode",valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Trunk",{proxy:{type:"uxproxy",module:"trunk",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["trunkcombo"],["component","box","field","textfield","pickerfield","combobox","combo","trunkcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,trunkcombo:true},["widget.trunkcombo"],0,[MBilling.view.trunk,"Combo"],0));(Ext.cmd.derive("MBilling.view.trunk.ComboBackup",Ext.form.field.ComboBox,{name:"failover_trunk",fieldLabel:t("failover_trunk"),displayField:"trunkcode",valueField:"id",value:0,limitParam:undefined,forceSelection:true,editable:true,extraValues:[{id:0,trunkcode:t("undefined")}],listeners:{focus:function(b){b.expand()}},initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Trunk",{proxy:{type:"uxproxy",module:"trunk",limitParam:undefined}});b.on("render",b.loadStore,b);Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)},loadStore:function(g){var j=this,e=g.store,f;e.load({callback:function(){if(j.extraValues.length){e.insert(0,j.extraValues)}}})}},0,["trunkcombobackup"],["component","box","field","textfield","pickerfield","combobox","combo","trunkcombobackup"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,trunkcombobackup:true},["widget.trunkcombobackup"],0,[MBilling.view.trunk,"ComboBackup"],0));(Ext.cmd.derive("MBilling.view.trunk.Module",Ext.ux.panel.Module,{controller:"trunk"},0,["trunkmodule"],["component","box","container","uxpanelmodule","trunkmodule"],{component:true,box:true,container:true,uxpanelmodule:true,trunkmodule:true},["widget.trunkmodule"],0,[MBilling.view.trunk,"Module"],0));(Ext.cmd.derive("MBilling.view.trunk.List",Ext.ux.grid.Panel,{store:"Trunk",fieldSearch:"trunkcode",initComponent:function(){var b=this;b.columns=b.columns||[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("trunkcode"),dataIndex:"trunkcode",flex:3},{header:t("add")+" "+t("prefix"),dataIndex:"trunkprefix",flex:2},{header:t("remove")+" "+t("prefix"),dataIndex:"removeprefix",flex:2},{header:t("host"),dataIndex:"host",flex:2},{xtype:"templatecolumn",tpl:"{idProviderprovider_name}",header:t("provider"),dataIndex:"id_provider",comboFilter:"providercombo",flex:2},{header:t("secondusedreal"),renderer:Helper.Util.formatsecondsToTime,dataIndex:"secondusedreal",flex:3},{header:t("status"),dataIndex:"status",renderer:Helper.Util.formatBooleanActive,comboFilter:"booleancombo",flex:1,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")]]}},{header:t("creationdate"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"creationdate",flex:3}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["trunklist"],["component","box","container","panel","tablepanel","gridpanel","grid","trunklist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,trunklist:true},["widget.trunklist"],0,[MBilling.view.trunk,"List"],0));(Ext.cmd.derive("MBilling.view.trunk.Form",Ext.ux.form.Panel,{autoHeight:300,bodyPadding:0,fieldsHideUpdateLot:["trunkcode"],initComponent:function(){var b=this;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{labelAlign:"right",plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true,labelWidth:142}},items:[{title:t("general"),items:[{xtype:"providerlookup",ownerForm:b},{name:"trunkcode",fieldLabel:t("trunkcode")},{name:"user",fieldLabel:t("user"),allowBlank:true},{name:"secret",fieldLabel:t("password"),allowBlank:true},{name:"host",fieldLabel:t("host")},{name:"trunkprefix",fieldLabel:t("add")+" "+t("prefix"),allowBlank:true},{name:"removeprefix",fieldLabel:t("remove")+" "+t("prefix"),allowBlank:true},{xtype:"checkboxgroup",columns:3,name:"allow",fieldLabel:t("codec"),items:[{boxLabel:"g729",name:"allow",inputValue:"g729",checked:true},{boxLabel:"g723",name:"allow",inputValue:"g723"},{boxLabel:"gsm",name:"allow",inputValue:"gsm",checked:true},{boxLabel:"g726",name:"allow",inputValue:"g726"},{boxLabel:"opus",name:"allow",inputValue:"opus",checked:true},{boxLabel:"alaw",name:"allow",inputValue:"alaw",checked:true},{boxLabel:"ulaw",name:"allow",inputValue:"ulaw",checked:true},{boxLabel:"g722",name:"allow",inputValue:"g722"},{boxLabel:"ilbc",name:"allow",inputValue:"ilbc"},{boxLabel:"speex",name:"allow",inputValue:"speex"},{boxLabel:"h261",name:"allow",inputValue:"h261"},{boxLabel:"h263",name:"allow",inputValue:"h263"}],allowBlank:true},{xtype:"sipcombo",name:"providertech",fieldLabel:t("providertech")},{xtype:"trunkcombobackup",allowBlank:true},{xtype:"booleancombo",name:"status",fieldLabel:t("status")},{xtype:"noyescombo",name:"allow_error",fieldLabel:t("allow_error")},{xtype:"noyescombo",name:"register",fieldLabel:t("registertrunk")},{name:"register_string",fieldLabel:t("Register String"),allowBlank:true,hidden:true}]},{title:t("suplementaryInfo"),defaults:{labelAlign:"right",plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true,labelWidth:142},items:[{name:"fromuser",fieldLabel:"fromuser",allowBlank:true},{name:"fromdomain",fieldLabel:"Fromdomain",allowBlank:true},{name:"language",fieldLabel:t("language"),allowBlank:true},{name:"context",fieldLabel:t("context"),allowBlank:true,value:"billing"},{name:"dtmfmode",fieldLabel:"dtmfmode",allowBlank:true,value:"RFC2833"},{name:"insecure",fieldLabel:"insecure",allowBlank:true,value:"port,invite"},{xtype:"numberfield",name:"maxuse",fieldLabel:t("maxuse"),allowBlank:true,value:-1,minValue:-1},{name:"nat",fieldLabel:"nat",value:App.user.asteriskVersion=="1.8"?"yes":"force_rport,comedia",allowBlank:true},{name:"directmedia",allowBlank:true,value:"no",fieldLabel:"directmedia"},{name:"qualify",fieldLabel:"qualify",allowBlank:true,value:"yes"},{name:"type",fieldLabel:"type",allowBlank:true,value:"peer"},{name:"disallow",fieldLabel:"disallow",allowBlank:true,value:"all"},{name:"sendrpid",fieldLabel:"sendrpid",allowBlank:true,value:"no"},{name:"addparameter",fieldLabel:t("addparameter"),allowBlank:true,emptyText:t("parameterdial")},{xtype:"textarea",name:"link_sms",fieldLabel:t("link_sms"),allowBlank:true,emptyText:t("linksmsobs"),height:100,anchor:"100%"},{name:"sms_res",fieldLabel:t("sms_res"),allowBlank:true},{xtype:"numberfield",name:"port",fieldLabel:t("Port"),value:"5060",readOnly:!App.user.isAdmin,hidden:App.user.isClient,allowBlank:App.user.isClient},{xtype:"combobox",name:"encryption",value:"no",store:[["no","No"],["yes","yes"]],fieldLabel:t("Encryption"),allowBlank:true,hidden:!App.user.isAdmin},{xtype:"combobox",forceSelection:true,editable:false,value:"no",store:[["tls","tls"],["no","disable"]],name:"transport",fieldLabel:t("Transport"),allowBlank:true,hidden:!App.user.isAdmin}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["trunkform"],["component","box","container","panel","form","trunkform"],{component:true,box:true,container:true,panel:true,form:true,trunkform:true},["widget.trunkform"],0,[MBilling.view.trunk,"Form"],0));(Ext.cmd.derive("MBilling.view.trunk.Lookup",Ext.ux.form.field.Lookup,{name:"id_trunk",fieldLabel:t("Trunk"),displayField:"idTrunktrunkcode",displayFieldList:"trunkcode",gridConfig:{xtype:"trunklist",fieldSearch:"trunkcode",columns:[{header:t("trunkcode"),dataIndex:"trunkcode"}]}},0,["trunklookup"],["component","box","container","fieldcontainer","trunklookup"],{component:true,box:true,container:true,fieldcontainer:true,trunklookup:true},["widget.trunklookup"],0,[MBilling.view.trunk,"Lookup"],0));(Ext.cmd.derive("MBilling.view.prefix.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.prefix"],0,[MBilling.view.prefix,"Controller"],0));(Ext.cmd.derive("MBilling.view.prefix.Combo",Ext.form.field.ComboBox,{name:"id_prefix",fieldLabel:t("destination"),displayField:"prefix",filterMode:"remote",valueField:"id",listConfig:{itemTpl:Ext.create("Ext.XTemplate","
{prefix} - {destination}
")},displayTpl:Ext.create("Ext.XTemplate",'{prefix} - {destination}'),initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.PrefixCombo",{proxy:{type:"uxproxy",module:"prefixCombo",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["prefixcombo"],["component","box","field","textfield","pickerfield","combobox","combo","prefixcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,prefixcombo:true},["widget.prefixcombo"],0,[MBilling.view.prefix,"Combo"],0));(Ext.cmd.derive("MBilling.view.prefix.Module",Ext.ux.panel.Module,{controller:"prefix"},0,["prefixmodule"],["component","box","container","uxpanelmodule","prefixmodule"],{component:true,box:true,container:true,uxpanelmodule:true,prefixmodule:true},["widget.prefixmodule"],0,[MBilling.view.prefix,"Module"],0));(Ext.cmd.derive("Ext.ux.form.field.FileUpload",Ext.form.field.File,{anchor:"0",name:"file",emptyText:t("selectFile"),fieldLabel:t("file"),buttonText:undefined,maxSize:3144000,extAllowed:["csv","ret"],titleTipInfo:t("modelContent"),titleWarning:t("warning"),msgInvalidFile:t("fileNotAllow"),msgInvalidSize:t("maxSizeFile"),childEls:["browseButtonWrap","playButtonWrap"],buttonPlayMargin:5,buttonConfig:{glyph:icons.file},triggers:{filebutton:{type:"component",hideOnReadOnly:false},playbutton:{type:"component"}},applyTriggers:function(e){var d=this,f=(e||{}).playbutton;if(f){f.component=Ext.apply({xtype:"button",iconCls:"icon-play",ownerCt:d,id:d.id+"-play",ui:d.ui,disabled:d.disabled,style:d.getButtonMarginProp()+d.buttonPlayMargin+"px",inputName:d.getName(),scope:d,handler:d.playStop,hidden:true});return Ext.form.field.File.prototype.applyTriggers.call(this,e)}},onRender:function(){var c=this,d;c.isAudio=c.extAllowed.indexOf("wav")!==-1;c.formPanel=c.up("form");c.formPanel.on("edit",c.onEditForm,c);(arguments.callee.$previous||Ext.form.field.File.prototype.onRender).apply(this,arguments);c.triggerPlay=c.getTrigger("playbutton");c.buttonPlay=c.triggerPlay.component;c.triggerPlay.el.setWidth(c.buttonPlay.getEl().getWidth()+c.buttonPlay.getEl().getMargin("lr"));if(Ext.isIE){c.buttonPlay.getEl().repaint()}c.initTipInfo()},reset:function(){var b=this;if(!b.isAudio){return}if(b.audio&&!b.audio.paused&&b.audio.currentTime){b.audio.pause();b.audio.currentTime=0}b.buttonPlay.setIconCls("icon-play");b.triggerPlay.el.setWidth(0);if(Ext.isIE){b.buttonPlay.getEl().repaint()}Ext.form.field.File.prototype.reset.apply(this,arguments)},onEditForm:function(){var g=this,f=g.formPanel.getForm().getRecord(),j=f&&f.get(g.name),e=!Ext.isEmpty(j);if(!g.isAudio){return}if(g.audio&&!g.audio.paused&&g.audio.currentTime){g.audio.pause();g.audio.currentTime=0}g.buttonPlay.setIconCls("icon-play");if(e){g.audio=new Audio(j);g.audio.addEventListener("ended",Ext.bind(g.onEndAudio,g));g.triggerPlay.el.setWidth(g.buttonPlay.el.getWidth()+g.buttonPlay.el.getMargin("lr"));if(Ext.isIE){g.buttonPlay.getEl().repaint()}}else{g.triggerPlay.el.setWidth(0);if(Ext.isIE){g.buttonPlay.getEl().repaint()}}g.buttonPlay.setVisible(e);g.triggerPlay.setVisible(e)},onEndAudio:function(){this.buttonPlay.setIconCls("icon-play")},getTriggerMarkup:function(){var d=this,e=Ext.form.field.File.prototype.getTriggerMarkup.apply(this,arguments),f='';return e+f},playStop:function(e){var d=this,f=e.iconCls==="icon-play";if(f){d.audio.play()}else{if(d.audio&&!d.audio.paused&&d.audio.currentTime){d.audio.pause();d.audio.currentTime=0}}e.setIconCls(f?"icon-stop":"icon-play")},initTipInfo:function(){var b=this;if(!b.htmlTipInfo){return}b.tipInfoFile=Ext.create("Ext.tip.ToolTip",{html:b.htmlTipInfo,anchor:"top",title:b.titleTipInfo,target:b.button.el})},onFileChange:function(e,f,g){var j=this;j.getInfoFile(f);Ext.form.field.File.prototype.onFileChange.apply(this,arguments)},getInfoFile:function(g){var l=this,f=g.target.files[0],j=f.name.split("."),m=j[j.length-1].toLowerCase();if(l.extAllowed.indexOf(m)===-1){Ext.ux.Alert.alert(l.titleWarning,l.msgInvalidFile,"warning");l.reset();return}if(f.size>l.maxSize){Ext.ux.Alert.alert(l.titleWarning,l.msgInvalidSize+Ext.util.Format.fileSize(l.maxSize),"warning");l.reset();return}}},0,["uploadfield"],["component","box","field","textfield","filefield","fileuploadfield","uploadfield"],{component:true,box:true,field:true,textfield:true,filefield:true,fileuploadfield:true,uploadfield:true},["widget.uploadfield"],0,[Ext.ux.form.field,"FileUpload"],0));(Ext.cmd.derive("Ext.ux.window.ImportCsv",Ext.window.Window,{autoShow:true,modal:true,layout:"fit",iconCls:"icon-import-csv",title:t("importFromCsv"),width:400,height:window.isThemeTriton?220:175,labelWidthFields:75,htmlTipInfo:"",fieldsImport:[],listeners:{close:function(){this.list.setLoading(false)}},initComponent:function(){var d=this,c=Ext.Array.merge(d.fieldsImport,[{xtype:"uploadfield",fieldLabel:t("fileCsv"),htmlTipInfo:d.htmlTipInfo}]);d.items=[{xtype:"form",bodyPadding:5,labelWidthFields:d.labelWidthFields,items:c}];d.title=d.title+(d.titleModule?" - "+d.titleModule:"");d.bbar=[{xtype:"tbtext",text:t("maxSizeFile")+"3 MB"},"->",{iconCls:"icon-import-csv",text:t("importText"),scope:d,handler:d.onImport}];Ext.window.Window.prototype.initComponent.apply(this,arguments)},onImport:function(d){var f=this,e=f.list.store;d.disable();f.list.setLoading(true);f.down("form").submit({url:e.getProxy().api.fromCsv,scope:f,success:function(c,b){var a=Ext.decode(b.response.responseText);if(a.success){Ext.ux.Alert.alert(t("Success"),a.msg,"success")}else{Ext.ux.Alert.alert(t("Error"),a.errors,"error")}d.enable();f.list.setLoading(false);e.load();f.close()},failure:function(c,b){if(Ext.isObject(b.response)){var a=Ext.decode(b.response.responseText);Ext.ux.Alert.alert(t("Error"),a.errors,"error")}else{Ext.ux.Alert.alert(t("Error"),b.response.responseText,"error",true,false)}d.enable();f.list.setLoading(false);f.close()}})}},0,0,["component","box","container","panel","window"],{component:true,box:true,container:true,panel:true,window:true},0,0,[Ext.ux.window,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.prefix.ImportCsv",Ext.ux.window.ImportCsv,{htmlTipInfo:"
"+t("dialprefix")+", "+t("destination")+"",labelWidthFields:160,height:window.isThemeTriton?300:205,initComponent:function(){var b=this;b.fieldsImport=[{style:"margin-top:25px",xtype:"fieldset",title:t("Csv Format"),collapsible:true,collapsed:false,defaults:{labelWidth:190,anchor:"100%",layout:{type:"hbox",labelAlign:b.labelAlignFields}},items:[{xtype:"pontovirgulacombo",name:"delimiter",fieldLabel:t("Delimiter"),width:230}]}];Ext.ux.window.ImportCsv.prototype.initComponent.apply(this,arguments)}},0,["prefiximportcsv"],["component","box","container","panel","window","prefiximportcsv"],{component:true,box:true,container:true,panel:true,window:true,prefiximportcsv:true},["widget.prefiximportcsv"],0,[MBilling.view.prefix,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.prefix.List",Ext.ux.grid.Panel,{store:"Prefix",fieldSearch:"prefix",initComponent:function(){var b=this;b.buttonImportCsv=!App.user.isClient,b.buttonUpdateLot=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("prefix"),dataIndex:"prefix",filter:{type:"string"}},{header:t("destination"),dataIndex:"destination"}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["prefixlist"],["component","box","container","panel","tablepanel","gridpanel","grid","prefixlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,prefixlist:true},["widget.prefixlist"],0,[MBilling.view.prefix,"List"],0));(Ext.cmd.derive("MBilling.view.prefix.Form",Ext.ux.form.Panel,{fieldsHideEdit:["prefix"],items:[{name:"prefix",fieldLabel:t("prefix"),maxLength:18},{name:"destination",fieldLabel:t("destination")}]},0,["prefixform"],["component","box","container","panel","form","prefixform"],{component:true,box:true,container:true,panel:true,form:true,prefixform:true},["widget.prefixform"],0,[MBilling.view.prefix,"Form"],0));(Ext.cmd.derive("MBilling.view.sendCreditProducts.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.sendcreditproducts"],0,[MBilling.view.sendCreditProducts,"Controller"],0));(Ext.cmd.derive("MBilling.view.sendCreditProducts.Module",Ext.ux.panel.Module,{controller:"sendcreditproducts"},0,["sendcreditproductsmodule"],["component","box","container","uxpanelmodule","sendcreditproductsmodule"],{component:true,box:true,container:true,uxpanelmodule:true,sendcreditproductsmodule:true},["widget.sendcreditproductsmodule"],0,[MBilling.view.sendCreditProducts,"Module"],0));(Ext.cmd.derive("MBilling.view.sendCreditProducts.ImportCsv",Ext.ux.window.ImportCsv,{fieldsImport:[{fieldLabel:t("table"),hidden:true,allowBlank:true}]},0,["sendcreditproductsimportcsv"],["component","box","container","panel","window","sendcreditproductsimportcsv"],{component:true,box:true,container:true,panel:true,window:true,sendcreditproductsimportcsv:true},["widget.sendcreditproductsimportcsv"],0,[MBilling.view.sendCreditProducts,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.sendCreditProducts.List",Ext.ux.grid.Panel,{store:"SendCreditProducts",fieldSearch:"operator_name",comparisonfilter:"ct",initComponent:function(){var b=this;b.buttonImportCsv=App.user.isAdmin,b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("Country"),dataIndex:"country",flex:4},{header:t("Country Code"),dataIndex:"country_code",flex:2},{header:t("Operator ID"),dataIndex:"operator_id",flex:2},{header:t("SkuCode"),dataIndex:"SkuCode",flex:2},{header:t("Operator Name"),dataIndex:"operator_name",flex:5},{header:t("Currency destination"),dataIndex:"currency_dest",flex:3},{header:t("Product"),dataIndex:"product",flex:2},{header:t("Currency Origem"),dataIndex:"currency_orig",flex:3},{header:t("Send Value"),dataIndex:"send_value",flex:2},{header:t("Wholesale Price"),dataIndex:"wholesale_price",flex:2},{header:t("Provider"),dataIndex:"provider",flex:2},{header:t("status"),dataIndex:"status",renderer:Helper.Util.formatBooleanActive,comboRelated:"booleancombo",flex:2,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")]]}}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["sendcreditproductslist"],["component","box","container","panel","tablepanel","gridpanel","grid","sendcreditproductslist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,sendcreditproductslist:true},["widget.sendcreditproductslist"],0,[MBilling.view.sendCreditProducts,"List"],0));(Ext.cmd.derive("MBilling.view.sendCreditProducts.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{name:"country",fieldLabel:t("country"),readOnly:true},{name:"operator_name",fieldLabel:t("Operator Name"),readOnly:true},{name:"operator_id",fieldLabel:t("Operator Id")},{name:"SkuCode",fieldLabel:t("SkuCode")},{name:"product",fieldLabel:t("Product")},{name:"send_value",fieldLabel:t("Send Value"),xtype:"moneyfield",mask:"#9.999.990,000000",readOnly:!App.user.isAdmin},{name:"wholesale_price",fieldLabel:t("Wholesale Price"),xtype:"moneyfield",mask:"#9.999.990,000000",readOnly:!App.user.isAdmin},{xtype:"combobox",name:"provider",value:"TransferTo",forceSelection:true,editable:false,store:[["TransferTo","TransferTo"],["Ding","Ding"],["TanaSend","TanaSend"]],fieldLabel:t("Provider")},{xtype:"yesnocombo",name:"status",fieldLabel:t("status")},{xtype:"textareafield",name:"info",fieldLabel:t("info"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["sendcreditproductsform"],["component","box","container","panel","form","sendcreditproductsform"],{component:true,box:true,container:true,panel:true,form:true,sendcreditproductsform:true},["widget.sendcreditproductsform"],0,[MBilling.view.sendCreditProducts,"Form"],0));(Ext.cmd.derive("MBilling.view.sendCreditRates.Controller",Ext.ux.app.ViewController,{onResetPrice:function(e){var f=this,d=f.list.getSelectionModel().getSelection()[0];Ext.Ajax.request({url:"index.php/SendCreditRates/resetSellPrice",scope:f,success:function(b){b=Ext.decode(b.responseText);if(b[f.nameSuccessRequest]){Ext.ux.Alert.alert(f.titleSuccess,b[f.nameMsgRequest],"success")}else{var a=Helper.Util.convertErrorsJsonToString(b[f.nameMsgRequest]);Ext.ux.Alert.alert(f.titleSuccess,a,"error")}}});f.store.load()}},0,0,0,0,["controller.sendcreditrates"],0,[MBilling.view.sendCreditRates,"Controller"],0));(Ext.cmd.derive("MBilling.view.sendCreditRates.Module",Ext.ux.panel.Module,{controller:"sendcreditrates"},0,["sendcreditratesmodule"],["component","box","container","uxpanelmodule","sendcreditratesmodule"],{component:true,box:true,container:true,uxpanelmodule:true,sendcreditratesmodule:true},["widget.sendcreditratesmodule"],0,[MBilling.view.sendCreditRates,"Module"],0));(Ext.cmd.derive("MBilling.view.sendCreditRates.List",Ext.ux.grid.Panel,{store:"SendCreditRates",fieldSearch:"idProduct.operator_name",comparisonfilter:"ct",initComponent:function(){var b=this;b.buttonUpdateLotCallShopRate=true;b.buttonCsv=false;b.allowPrint=false;b.extraButtons=[{text:t("Reset")+" "+t("Sell price"),iconCls:"icon-chart-column",width:130,handler:"onResetPrice",disabled:false}];b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{xtype:"templatecolumn",tpl:"{idProductoperator_name}",header:t("Operator Name"),dataIndex:"idProductoperator_name",filter:{type:"string",field:"idProduct.operator_name"},flex:5},{xtype:"templatecolumn",tpl:"{idProductcountry}",header:t("Country"),dataIndex:"idProductcountry",filter:{type:"string",field:"idProduct.country"},flex:4},{xtype:"templatecolumn",tpl:"{idProductcurrency_dest}",header:t("Currency destination"),dataIndex:"idProductcurrency_dest",filter:{type:"string",field:"idProduct.currency_dest"},flex:3},{xtype:"templatecolumn",tpl:"{idProductproduct}",header:t("Product"),dataIndex:"idProductproduct",filter:{type:"string",field:"idProduct.product"},flex:2},{xtype:"templatecolumn",tpl:"{idProductcurrency_orig}",header:t("Currency Origin"),dataIndex:"idProductcurrency_orig",filter:{type:"string",field:"idProduct.currency_orig"},flex:3},{xtype:"templatecolumn",tpl:"{idProductwholesale_price}",header:t("Wholesale Price"),dataIndex:"idProductwholesale_price",filter:{type:"string",field:"idProduct.wholesale_price"},flex:2},{header:t("Sell Price"),dataIndex:"sell_price",flex:2}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["sendcreditrateslist"],["component","box","container","panel","tablepanel","gridpanel","grid","sendcreditrateslist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,sendcreditrateslist:true},["widget.sendcreditrateslist"],0,[MBilling.view.sendCreditRates,"List"],0));(Ext.cmd.derive("MBilling.view.sendCreditRates.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["idProductcountry","idProductoperator_name"],initComponent:function(){var b=this;b.items=[{name:"idProductcountry",fieldLabel:t("country"),readOnly:true},{name:"idProductoperator_name",fieldLabel:t("Operator Name"),readOnly:true},{name:"sell_price",fieldLabel:t("Sell Price"),xtype:"moneyfield",mask:"#9.999.990,00",readOnly:App.user.isAdmin}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["sendcreditratesform"],["component","box","container","panel","form","sendcreditratesform"],{component:true,box:true,container:true,panel:true,form:true,sendcreditratesform:true},["widget.sendcreditratesform"],0,[MBilling.view.sendCreditRates,"Form"],0));(Ext.cmd.derive("MBilling.view.prefix.Lookup",Ext.ux.form.field.Lookup,{name:"id_prefix",fieldLabel:t("Destination"),displayField:"idPrefixdestination",displayFieldList:"destination",gridConfig:{xtype:"prefixlist",fieldSearch:"destination",columns:[{header:t("prefix"),dataIndex:"prefix",flex:2},{header:t("destination"),dataIndex:"destination",flex:2}]}},0,["prefixlookup"],["component","box","container","fieldcontainer","prefixlookup"],{component:true,box:true,container:true,fieldcontainer:true,prefixlookup:true},["widget.prefixlookup"],0,[MBilling.view.prefix,"Lookup"],0));(Ext.cmd.derive("MBilling.view.sipTrace.Controller",Ext.ux.app.ViewController,{onNewFilter:function(d){var f=this,e=f.getView();Ext.widget("siptracefilter",{title:"SipTrace",list:f.list})},onDeleteLog:function(d){var c=this;Ext.Msg.confirm(c.titleConfirmation,t("Confirm delete all log file?"),function(a){if(a==="yes"){Ext.Ajax.request({url:"index.php/sipTrace/destroy",scope:c,success:function(b){Ext.ux.Alert.alert(c.titleSuccess,t("Success: The Sip Trace file was deleted"),"success");c.store.load()}})}})},onClearAll:function(d){var c=this;Ext.Ajax.request({url:"index.php/sipTrace/clearAll",scope:c,success:function(a){Ext.ux.Alert.alert(c.titleSuccess,t("Success"),"success");c.store.load()}})},onExportPcap:function(d){var c=this;window.open("index.php/sipTrace/export")},onDetails:function(d){var f=this,e=f.list.getSelectionModel().getSelection()[0];window.open("index.php/sipTrace/details?callid="+e.get("callid"))}},0,0,0,0,["controller.siptrace"],0,[MBilling.view.sipTrace,"Controller"],0));(Ext.cmd.derive("MBilling.view.sipTrace.Module",Ext.ux.panel.Module,{controller:"siptrace"},0,["siptracemodule"],["component","box","container","uxpanelmodule","siptracemodule"],{component:true,box:true,container:true,uxpanelmodule:true,siptracemodule:true},["widget.siptracemodule"],0,[MBilling.view.sipTrace,"Module"],0));(Ext.cmd.derive("MBilling.view.sipTrace.Filter",Ext.window.Window,{autoShow:true,modal:true,layout:"fit",iconCls:"icon-import-csv",title:t("SipTrace filter"),width:400,height:window.isThemeTriton?220:180,labelWidthFields:120,htmlTipInfo:"",fieldsImport:[],initComponent:function(){var b=this;b.items=[{xtype:"form",bodyPadding:5,defaults:{anchor:"0",enableKeyEvents:true,labelWidth:b.labelWidthFields,msgTarget:"side",plugins:"markallowblank",allowBlank:false},items:[{xtype:"numberfield",value:60,min:5,max:300,name:"timeout",fieldLabel:t("Filter timeout")},{xtype:"numberfield",name:"port",fieldLabel:t("Port"),allowBlank:false,value:5060},{xtype:"textfield",name:"filter",fieldLabel:t("Filter"),allowBlank:false,emptyText:"IP, sip account or number ...."}]}];b.title=b.title+(b.titleModule?" - "+b.titleModule:"");b.bbar=[{width:150,iconCls:"icon-play",text:t("Start"),scope:b,handler:b.onStart}];Ext.window.Window.prototype.initComponent.apply(this,arguments)},onStart:function(d){var f=this,e=f.list.store;if(!f.down("form").isValid()){return}f.list.setLoading(true);Ext.Ajax.setTimeout(1000000);f.down("form").submit({url:"index.php/sipTrace/start",scope:f,success:function(c,b){var a=Ext.decode(b.response.responseText);console.log(a);if(a.success){Ext.ux.Alert.alert(t("Success"),a.msg,"success")}else{Ext.ux.Alert.alert(t("Error"),a.errors,"error")}d.enable();f.list.setLoading(false);e.load();f.close()},failure:function(c,b){console.log(b.response.responseText);if(b.response&&Ext.isObject(b.response.responseText)){var a=Ext.decode(b.response.responseText);Ext.ux.Alert.alert(t("Error"),a.errors,"error",true,30)}else{Ext.ux.Alert.alert(t("Error"),Ext.decode(b.response.responseText).msg,"error",true,30)}d.enable();f.list.setLoading(false);e.load();f.close()}})}},0,["siptracefilter"],["component","box","container","panel","window","siptracefilter"],{component:true,box:true,container:true,panel:true,window:true,siptracefilter:true},["widget.siptracefilter"],0,[MBilling.view.sipTrace,"Filter"],0));(Ext.cmd.derive("MBilling.view.sipTrace.List",Ext.ux.grid.Panel,{store:"SipTrace",initComponent:function(){var b=this;b.buttonImportCsv=false;b.buttonCsv=false;b.allowPrint=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.collapsedExtraFilters=false;b.allowDelete=false;b.extraButtons=[{text:b.textDelete,glyph:b.glyphDelete,handler:"onDeleteLog",width:120},{text:t("Start Capture"),iconCls:"icon-save-all",handler:"onNewFilter",width:120},{text:t("Stop Capture"),iconCls:"icon-clean-filter",handler:"onClearAll",width:120},{text:t("Export File"),iconCls:"icon-save-all",handler:"onExportPcap",width:150},{text:t("Details"),glyph:icons.info,handler:"onDetails",width:150}];b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,menuDisabled:true,hideable:App.user.isAdmin},{header:t("method"),dataIndex:"method",flex:3},{header:t("callid"),dataIndex:"callid",flex:7},{header:t("SIP To "),dataIndex:"sipto",flex:5},{header:t("Source"),dataIndex:"fromip",renderer:function(a){a=a==window.myIP?''+a+"":a;return a},flex:3},{header:t("Destination"),dataIndex:"toip",renderer:function(a){a=a==window.myIP?''+a+"":a;return a},flex:4},{header:t("head"),dataIndex:"head",flex:3,menuDisabled:true,hidden:true,hideable:true}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["siptracelist"],["component","box","container","panel","tablepanel","gridpanel","grid","siptracelist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,siptracelist:true},["widget.siptracelist"],0,[MBilling.view.sipTrace,"List"],0));(Ext.cmd.derive("MBilling.view.sipTrace.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.allowCreate=false;height=Ext.Element.getViewportHeight()-200;b.items=[{xtype:"textareafield",name:"head",height:height,anchor:"100%",allowBlank:true,readOnly:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["siptraceform"],["component","box","container","panel","form","siptraceform"],{component:true,box:true,container:true,panel:true,form:true,siptraceform:true},["widget.siptraceform"],0,[MBilling.view.sipTrace,"Form"],0));(Ext.cmd.derive("MBilling.view.sip.Controller",Ext.ux.app.ViewController,{init:function(){var b=this;b.control({typesipforwardcombo:{select:b.onSelectMethod}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectMethod:function(c,d){this.showFieldsRelated(d.getData().showFields)},showFieldsRelated:function(l){var m=this,n=m.formPanel.getForm(),j=m.formPanel.getForm().getFields(),g=Ext.get(Ext.Element.getActiveElement()).component,o=g.name.substr(-2);m.onSetVisibleFiel(g,n,o,g.value)},onSetVisibleFiel:function(f,j,e,g){if(f.value=="undefined"){f.setValue("undefined")}j.findField("id_queue").setValue("");j.findField("id_sip").setValue("");j.findField("id_ivr").setValue("");j.findField("extension").setValue("");j.findField("id_queue").setVisible(g.match("^queue"));j.findField("id_sip").setVisible(g.match("^sip"));j.findField("id_ivr").setVisible(g.match("^ivr"));j.findField("extension").setVisible(g.match("^group|^number|^custom"))},onGetDiskSpaceService:function(b){filterGroupp=Ext.encode([{type:"numeric",comparison:"eq",value:App.user.id,field:"id_user"},{type:"numeric",comparison:"eq",value:1,field:"status"}]),Ext.Ajax.request({url:"index.php/servicesUse/read?filter="+filterGroupp,success:function(a){a=Ext.decode(a.responseText);b(a.rows)}})},onEdit:function(){var j=this,l=j.formPanel.getForm(),f=j.list.getSelectionModel().getSelection()[0],g=j.formPanel.idRecord?f.get("allow").split(","):["g729","gsm","alaw","ulaw"],m=j.formPanel.down("checkboxgroup");if(App.user.isClient){l.findField("record_call").setVisible(false);j.onGetDiskSpaceService(function(a){Ext.each(a,function(b){if(b.idServicestype=="disk_space"){j.formPanel.getForm().findField("record_call").setVisible(true)}})})}fieldValue=f.getData()["type_forward"];l.findField("type_forward").setVisible(true);if(fieldValue=="ivr"){l.findField("id_ivr").setVisible(true);l.findField("id_sip").setVisible(false);l.findField("id_queue").setVisible(false);l.findField("extension").setVisible(false)}else{if(fieldValue=="sip"){l.findField("id_sip").setVisible(true);l.findField("id_ivr").setVisible(false);l.findField("id_queue").setVisible(false);l.findField("extension").setVisible(false)}else{if(fieldValue=="queue"){l.findField("id_queue").setVisible(true);l.findField("id_sip").setVisible(false);l.findField("id_ivr").setVisible(false);l.findField("extension").setVisible(false)}else{if(fieldValue.match("custom|number|group")){l.findField("extension").setVisible(true);l.findField("id_ivr").setVisible(false);l.findField("id_sip").setVisible(false);l.findField("id_queue").setVisible(false)}else{l.findField("id_queue").setVisible(false);l.findField("id_sip").setVisible(false);l.findField("id_ivr").setVisible(false);l.findField("extension").setVisible(false)}}}}Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments);m.setValue({allow:g})},onNew:function(){var f=this,d=f.formPanel.getForm(),e=f.list.getSelectionModel().getSelection()[0];if(App.user.isClient){f.formPanel.getForm().findField("defaultuser").setReadOnly(false)}d.findField("id_ivr").setVisible(false);d.findField("id_sip").setVisible(false);d.findField("id_queue").setVisible(false);d.findField("id_ivr").setVisible(false);d.findField("id_queue").setVisible(false);d.findField("type_forward").setVisible(true);Ext.ux.app.ViewController.prototype.onNew.apply(this,arguments)}},0,0,0,0,["controller.sip"],0,[MBilling.view.sip,"Controller"],0));(Ext.cmd.derive("MBilling.view.sip.Module",Ext.ux.panel.Module,{controller:"sip"},0,["sipmodule"],["component","box","container","uxpanelmodule","sipmodule"],{component:true,box:true,container:true,uxpanelmodule:true,sipmodule:true},["widget.sipmodule"],0,[MBilling.view.sip,"Module"],0));(Ext.cmd.derive("MBilling.view.sip.List",Ext.ux.grid.Panel,{store:"Sip",fieldSearch:"idUser.username",initComponent:function(){var b=this;b.columns=b.columns||[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("Status"),dataIndex:"lineStatus",width:3,menuDisabled:true,renderer:Helper.Util.formatStatusImage},{header:t("accountcode"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4},{header:t("username"),dataIndex:"name",flex:4},{header:t("host"),dataIndex:"host",flex:4},{header:t("codec"),dataIndex:"allow",flex:5},{header:"group",dataIndex:"group",flex:3},{header:t("context"),dataIndex:"context",hidden:true,hideable:!App.user.isClient,flex:1},{header:t("record_call"),dataIndex:"record_call",renderer:Helper.Util.formattyyesno,filter:{type:"list",options:[[0,t("no")],[1,t("yes")]]},flex:2,hidden:true,hideable:!App.user.isClient},{header:t("callerid"),dataIndex:"callerid",hidden:true,hideable:!App.user.isClient,flex:1},{header:"nat",dataIndex:"nat",hidden:true,hideable:!App.user.isClient,flex:1},{header:"directmedia",dataIndex:"directmedia",hidden:true,hideable:!App.user.isClient,flex:1},{header:"qualify",dataIndex:"qualify",hidden:true,hideable:!App.user.isClient,flex:1},{header:"dtmfmode",dataIndex:"dtmfmode",hidden:true,hideable:!App.user.isClient,flex:1},{header:"insecure",dataIndex:"insecure",hidden:true,hideable:!App.user.isClient,flex:1},{header:"type",dataIndex:"type",hidden:true,hideable:!App.user.isClient,flex:1},{header:"allowtransfer",dataIndex:"allowtransfer",hidden:true,hideable:!App.user.isClient,flex:1},{header:"calllimit",dataIndex:"calllimit",hidden:true,hideable:!App.user.isClient,flex:1}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["siplist"],["component","box","container","panel","tablepanel","gridpanel","grid","siplist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,siplist:true},["widget.siplist"],0,[MBilling.view.sip,"List"],0));(Ext.cmd.derive("MBilling.view.sip.Form",Ext.ux.form.Panel,{bodyPadding:0,fieldsHideUpdateLot:["id_user","defaultuser","secret"],initComponent:function(){var b=this;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{labelAlign:"right",plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true}},items:[{title:t("general"),items:[{xtype:"userlookup",ownerForm:b,fieldLabel:t("accountcode"),hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"defaultuser",fieldLabel:t("username"),minLength:4,allowBlank:true,readOnly:App.user.isClient},{name:"secret",fieldLabel:t("password"),allowBlank:true,minLength:6},{name:"callerid",fieldLabel:t("callerid"),allowBlank:true},{name:"alias",fieldLabel:t("Alias"),allowBlank:true,minLength:3},{name:"disallow",fieldLabel:"disallow",value:"all",hidden:!App.user.isAdmin,allowBlank:App.user.isClient},{xtype:"checkboxgroup",columns:3,fieldLabel:t("codec"),items:[{boxLabel:"g729",name:"allow",inputValue:"g729",checked:true},{boxLabel:"g723",name:"allow",inputValue:"g723"},{boxLabel:"gsm",name:"allow",inputValue:"gsm",checked:true},{boxLabel:"g726",name:"allow",inputValue:"g726"},{boxLabel:"opus",name:"allow",inputValue:"opus",checked:true},{boxLabel:"alaw",name:"allow",inputValue:"alaw",checked:true},{boxLabel:"ulaw",name:"allow",inputValue:"ulaw",checked:true},{boxLabel:"g722",name:"allow",inputValue:"g722"},{boxLabel:"ilbc",name:"allow",inputValue:"ilbc"},{boxLabel:"speex",name:"allow",inputValue:"speex"},{boxLabel:"h263p",name:"allow",inputValue:"h263p"},{boxLabel:"h263",name:"allow",inputValue:"h263"},{boxLabel:"h264",name:"allow",inputValue:"h264"},{boxLabel:"vp8",name:"allow",inputValue:"vp8"}],hidden:!App.user.isAdmin,allowBlank:App.user.isClient},{name:"host",fieldLabel:t("host"),value:"dynamic",hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"group",fieldLabel:t("group"),allowBlank:true},{xtype:"yesnostringcombo",name:"videosupport",fieldLabel:"videosupport",value:"no",allowBlank:!App.user.isAdmin},{name:"block_call_reg",fieldLabel:t("Block Call REGEX"),allowBlank:true,hidden:!window.doac},{xtype:"noyescombo",name:"record_call",fieldLabel:t("record_call"),allowBlank:true,hidden:!App.user.isAdmin},{xtype:"numberfield",name:"techprefix",fieldLabel:t("TechPrefix"),hidden:!window.usertech||!App.user.isAdmin,allowBlank:true,maxLength:6}]},{title:t("Nat"),hidden:!App.user.isAdmin,items:[{name:"nat",fieldLabel:"nat",value:"force_rport,comedia",allowBlank:!App.user.isAdmin},{name:"directmedia",fieldLabel:"directmedia",value:"no",allowBlank:!App.user.isAdmin},{xtype:"yesnostringcombo",name:"qualify",fieldLabel:"qualify",value:"no",allowBlank:!App.user.isAdmin}]},{title:t("Additional"),hidden:!App.user.isAdmin,defaults:{labelAlign:"right",plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true,labelWidth:142},items:[{name:"context",fieldLabel:t("context"),value:"billing",hidden:!App.user.isAdmin,allowBlank:true},{name:"dtmfmode",fieldLabel:"dtmfmode",value:"RFC2833",allowBlank:!App.user.isAdmin},{name:"insecure",fieldLabel:"insecure",value:"no",allowBlank:true},{name:"deny",fieldLabel:"deny",allowBlank:true,hidden:!App.user.isAdmin},{name:"permit",fieldLabel:"permit",allowBlank:true,hidden:!App.user.isAdmin},{name:"type",fieldLabel:"type",value:"friend",allowBlank:!App.user.isAdmin},{xtype:"noyesstringcombo",name:"allowtransfer",fieldLabel:"allowtransfer",value:"no",allowBlank:!App.user.isAdmin},{xtype:"noyescombo",name:"ringfalse",fieldLabel:t("Ring false"),value:"0",allowBlank:!App.user.isAdmin},{name:"calllimit",xtype:"numberfield",fieldLabel:t("calllimit"),value:"0",allowBlank:!App.user.isAdmin},{xtype:"noyescombo",name:"voicemail",fieldLabel:t("Enable")+" "+t("VoiceMail"),value:"0",allowBlank:App.user.isClient},{name:"mohsuggest",fieldLabel:t("MOH"),allowBlank:true,hidden:!App.user.isAdmin},{name:"url_events",fieldLabel:t("Url Events notify"),hidden:!App.user.isAdmin||!window.events===true,allowBlank:true}]},{title:t("Forward"),itemId:"option",bodyPadding:10,defaults:{xtype:"fieldcontainer",layout:"hbox",plugins:"markallowblank",allowBlank:true,anchor:"100%",labelWidth:60,defaults:{hideLabel:true,hidden:true,flex:5,startX:100,allowBlank:true,ownerForm:b}},items:[{fieldLabel:t("Forward"),items:[{name:"type_forward",xtype:"typesipforwardcombo",flex:2},{xtype:"ivrlookup",name:"id_ivr",displayField:"id_ivr_name"},{xtype:"queuelookup",name:"id_queue",displayField:"id_queue_name"},{xtype:"sip2lookup",name:"id_sip",displayField:"id_sip_name"},{xtype:"textfield",name:"extension"}]},{name:"dial_timeout",xtype:"numberfield",fieldLabel:t("Dial timeout"),value:"60",labelWidth:90}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["sipform"],["component","box","container","panel","form","sipform"],{component:true,box:true,container:true,panel:true,form:true,sipform:true},["widget.sipform"],0,[MBilling.view.sip,"Form"],0));(Ext.cmd.derive("MBilling.view.sip.Lookup",Ext.ux.form.field.Lookup,{name:"id_sip",fieldLabel:t("Sip"),displayField:"idSipname",displayFieldList:"name",gridConfig:{xtype:"siplist",fieldSearch:"name",columns:[{header:t("Account"),dataIndex:"idUserusername",flex:2},{header:t("name"),dataIndex:"name",flex:2}]}},0,["siplookup"],["component","box","container","fieldcontainer","siplookup"],{component:true,box:true,container:true,fieldcontainer:true,siplookup:true},["widget.siplookup"],0,[MBilling.view.sip,"Lookup"],0));(Ext.cmd.derive("MBilling.view.sip2.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.sip2"],0,[MBilling.view.sip2,"Controller"],0));(Ext.cmd.derive("MBilling.view.sip2.Module",Ext.ux.panel.Module,{controller:"sip2"},0,["sip2module"],["component","box","container","uxpanelmodule","sip2module"],{component:true,box:true,container:true,uxpanelmodule:true,sip2module:true},["widget.sip2module"],0,[MBilling.view.sip2,"Module"],0));(Ext.cmd.derive("MBilling.view.sip2.List",Ext.ux.grid.Panel,{store:"Sip2",fieldSearch:"name",initComponent:function(){var b=this;b.columns=b.columns||[{header:t("accountcode"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4},{header:t("username"),dataIndex:"name",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["sip2list"],["component","box","container","panel","tablepanel","gridpanel","grid","sip2list"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,sip2list:true},["widget.sip2list"],0,[MBilling.view.sip2,"List"],0));(Ext.cmd.derive("MBilling.view.sip2.Form",Ext.ux.form.Panel,{bodyPadding:0},0,["sip2form"],["component","box","container","panel","form","sip2form"],{component:true,box:true,container:true,panel:true,form:true,sip2form:true},["widget.sip2form"],0,[MBilling.view.sip2,"Form"],0));(Ext.cmd.derive("MBilling.view.sip2.Lookup",Ext.ux.form.field.Lookup,{name:"id_sip",fieldLabel:t("Sip"),displayField:"id_sip_name",displayFieldList:"name",gridConfig:{xtype:"sip2list",fieldSearch:"name",columns:[{header:t("Account"),dataIndex:"idUserusername",flex:2},{header:t("name"),dataIndex:"name",flex:2}]}},0,["sip2lookup"],["component","box","container","fieldcontainer","sip2lookup"],{component:true,box:true,container:true,fieldcontainer:true,sip2lookup:true},["widget.sip2lookup"],0,[MBilling.view.sip2,"Lookup"],0));(Ext.cmd.derive("MBilling.view.sipuras.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.sipuras"],0,[MBilling.view.sipuras,"Controller"],0));(Ext.cmd.derive("MBilling.view.sipuras.Module",Ext.ux.panel.Module,{controller:"sipuras"},0,["sipurasmodule"],["component","box","container","uxpanelmodule","sipurasmodule"],{component:true,box:true,container:true,uxpanelmodule:true,sipurasmodule:true},["widget.sipurasmodule"],0,[MBilling.view.sipuras,"Module"],0));(Ext.cmd.derive("MBilling.view.sipuras.List",Ext.ux.grid.Panel,{store:"Sipuras",initComponent:function(){var b=this;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"}},{header:"Serial",dataIndex:"nserie"},{header:"Mac",dataIndex:"macadr"},{header:t("username")+" 1",dataIndex:"User_ID_1"},{header:t("username")+" 2",dataIndex:"User_ID_2"},{header:t("last_ip"),dataIndex:"last_ip"},{header:t("obs"),dataIndex:"obs"},{header:t("last")+" "+t("register"),dataIndex:"fultmov",renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s")}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["sipuraslist"],["component","box","container","panel","tablepanel","gridpanel","grid","sipuraslist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,sipuraslist:true},["widget.sipuraslist"],0,[MBilling.view.sipuras,"List"],0));(Ext.cmd.derive("MBilling.view.sipuras.Form",Ext.ux.form.Panel,{bodyPadding:0,fieldsHideUpdateLot:["id_user","nserie","macadr"],initComponent:function(){var b=this;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true,labelAlign:"right"}},items:[{title:t("general"),items:[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"nserie",fieldLabel:"Serial"},{name:"macadr",fieldLabel:"Mac"},{name:"senha_user",fieldLabel:t("password")+" "+t("username"),allowBlank:true},{name:"senha_admin",fieldLabel:t("password")+" "+t("admin"),allowBlank:true},{name:"antireset",fieldLabel:t("antireset"),xtype:"noyescombo"},{name:"Enable_Web_Server",fieldLabel:t("Enable_Web_Server"),xtype:"yesnocombo"},{name:"marca",fieldLabel:"marca",value:"*",hidden:true},{name:"altera",fieldLabel:"altera",value:"si",hidden:true}]},{title:t("line")+" 1",items:[{name:"User_ID_1",fieldLabel:t("username"),allowBlank:true},{name:"Password_1",fieldLabel:t("password"),allowBlank:true},{name:"Use_Pref_Codec_Only_1",fieldLabel:t("Use_Pref_Codec"),xtype:"noyescombo"},{name:"Preferred_Codec_1",fieldLabel:t("codec"),allowBlank:true,value:"G729a"},{name:"Register_Expires_1",fieldLabel:"Register Expires",allowBlank:true,value:"360"},{name:"Dial_Plan_1",fieldLabel:"Dial Plan",allowBlank:true,value:"(*xx|[3469]11|0|00|[2-9]xxxxxx|1xxx[2-9]xxxxxxS0|xxxxxxxxxxxx.)"},{name:"NAT_Mapping_Enable_1_",fieldLabel:"NAT Mapping",allowBlank:true,xtype:"noyescombo"},{name:"NAT_Keep_Alive_Enable_1_",fieldLabel:"NAT Keep Alive",allowBlank:true,xtype:"noyescombo"}]},{title:t("line")+" 2",items:[{name:"User_ID_2",fieldLabel:t("username"),allowBlank:true},{name:"Password_2",fieldLabel:t("password"),allowBlank:true},{name:"Use_Pref_Codec_Only_2",fieldLabel:t("Use_Pref_Codec"),xtype:"noyescombo"},{name:"Preferred_Codec_2",fieldLabel:t("codec"),allowBlank:true,value:"G729a"},{name:"Register_Expires_2",fieldLabel:"Register Expires",allowBlank:true,value:"360"},{name:"Dial_Plan_2",fieldLabel:"Dial Plan",allowBlank:true,value:"(*xx|[3469]11|0|00|[2-9]xxxxxx|1xxx[2-9]xxxxxxS0|xxxxxxxxxxxx.)"},{name:"NAT_Mapping_Enable_2_",fieldLabel:"NAT Mapping",allowBlank:true,xtype:"noyescombo"},{name:"NAT_Keep_Alive_Enable_2_",fieldLabel:"NAT Keep Alive",allowBlank:true,xtype:"noyescombo"}]},{title:"Stun",items:[{name:"STUN_Enable",fieldLabel:t("active")+"Stun",allowBlank:true,xtype:"noyescombo"},{name:"STUN_Test_Enable",fieldLabel:"STUN Test",allowBlank:true,xtype:"noyescombo"},{name:"Substitute_VIA_Addr",fieldLabel:"Substitute VIA Addr",allowBlank:true,xtype:"noyescombo"},{name:"STUN_Server",fieldLabel:"STUN Server",allowBlank:true}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["sipurasform"],["component","box","container","panel","form","sipurasform"],{component:true,box:true,container:true,panel:true,form:true,sipurasform:true},["widget.sipurasform"],0,[MBilling.view.sipuras,"Form"],0));(Ext.cmd.derive("MBilling.view.iax.Controller",Ext.ux.app.ViewController,{onEdit:function(){Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments);var g=this,e=g.list.getSelectionModel().getSelection()[0],f=g.formPanel.idRecord?e.get("allow").split(","):["g729","gsm","alaw","ulaw"],j=g.formPanel.down("checkboxgroup");j.setValue({allow:f})}},0,0,0,0,["controller.iax"],0,[MBilling.view.iax,"Controller"],0));(Ext.cmd.derive("MBilling.view.iax.Module",Ext.ux.panel.Module,{controller:"iax"},0,["iaxmodule"],["component","box","container","uxpanelmodule","iaxmodule"],{component:true,box:true,container:true,uxpanelmodule:true,iaxmodule:true},["widget.iaxmodule"],0,[MBilling.view.iax,"Module"],0));(Ext.cmd.derive("MBilling.view.iax.List",Ext.ux.grid.Panel,{store:"Iax",fieldSearch:"username",initComponent:function(){var b=this;b.columns=b.columns||[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("username"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:3},{header:t("ramal"),dataIndex:"name",flex:3},{header:t("password"),dataIndex:"secret",flex:2},{header:t("host"),dataIndex:"host",flex:3},{header:"IP",dataIndex:"ipaddr",flex:5},{header:t("context"),dataIndex:"context",hidden:true,hideable:!App.user.isClient,flex:1},{header:t("callerid"),dataIndex:"callerid",hidden:true,hideable:!App.user.isClient,flex:1},{header:t("codec"),dataIndex:"allow",hidden:true,hideable:!App.user.isClient,flex:1},{header:"nat",dataIndex:"nat",hidden:true,hideable:!App.user.isClient,flex:1},{header:"qualify",dataIndex:"qualify",hidden:true,hideable:!App.user.isClient,flex:1},{header:"dtmfmode",dataIndex:"dtmfmode",hidden:true,hideable:!App.user.isClient,flex:1},{header:"insecure",dataIndex:"insecure",hidden:true,hideable:!App.user.isClient,flex:1},{header:"type",dataIndex:"type",hidden:true,hideable:!App.user.isClient,flex:1}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["iaxlist"],["component","box","container","panel","tablepanel","gridpanel","grid","iaxlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,iaxlist:true},["widget.iaxlist"],0,[MBilling.view.iax,"List"],0));(Ext.cmd.derive("MBilling.view.iax.Form",Ext.ux.form.Panel,{bodyPadding:0,fieldsHideUpdateLot:["id_user","defaultuser","secret"],initComponent:function(){var b=this;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true,labelAlign:"right"}},items:[{title:t("general"),items:[{xtype:"userlookup",ownerForm:b,fieldLabel:t("accountcode"),hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"username",fieldLabel:t("username"),minLength:4,readOnly:App.user.isClient},{name:"secret",fieldLabel:t("password"),allowBlank:true,minLength:6,readOnly:App.user.isClient},{name:"callerid",fieldLabel:t("callerid"),allowBlank:true},{name:"disallow",fieldLabel:"disallow",value:"all",hidden:!App.user.isAdmin,allowBlank:App.user.isClient},{xtype:"checkboxgroup",columns:3,fieldLabel:t("codec"),items:[{boxLabel:"g729",name:"allow",inputValue:"g729",checked:true},{boxLabel:"g723",name:"allow",inputValue:"g723"},{boxLabel:"gsm",name:"allow",inputValue:"gsm",checked:true},{boxLabel:"g726",name:"allow",inputValue:"g726"},{boxLabel:"alaw",name:"allow",inputValue:"alaw",checked:true},{boxLabel:"ulaw",name:"allow",inputValue:"ulaw",checked:true},{boxLabel:"g722",name:"allow",inputValue:"g722"},{boxLabel:"ilbc",name:"allow",inputValue:"ilbc"},{boxLabel:"speex",name:"allow",inputValue:"speex"},{boxLabel:"h261",name:"allow",inputValue:"h261"},{boxLabel:"h263",name:"allow",inputValue:"h263"}],hidden:!App.user.isAdmin,allowBlank:App.user.isClient},{name:"host",fieldLabel:t("host"),value:"dynamic",hidden:App.user.isClient,allowBlank:App.user.isClient}]},{title:t("natdetails"),hidden:!App.user.isAdmin,items:[{name:"nat",fieldLabel:"nat",value:App.user.asteriskVersion=="1.8"?"yes":"force_rport,comedia",allowBlank:!App.user.isAdmin}]},{title:t("suplementaryInfo"),hidden:!App.user.isAdmin,items:[{name:"context",fieldLabel:t("context"),value:"billing",hidden:!App.user.isAdmin,allowBlank:true},{xtype:"yesnostringcombo",name:"qualify",fieldLabel:"qualify",value:"no",allowBlank:!App.user.isAdmin},{name:"dtmfmode",fieldLabel:"dtmfmode",value:"RFC2833",allowBlank:!App.user.isAdmin},{name:"insecure",fieldLabel:"insecure",value:"no",allowBlank:true},{name:"type",fieldLabel:"type",value:"friend",allowBlank:!App.user.isAdmin},{name:"calllimit",xtype:"numberfield",fieldLabel:t("calllimit"),value:"0",allowBlank:!App.user.isAdmin}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["iaxform"],["component","box","container","panel","form","iaxform"],{component:true,box:true,container:true,panel:true,form:true,iaxform:true},["widget.iaxform"],0,[MBilling.view.iax,"Form"],0));(Ext.cmd.derive("MBilling.view.iax.Lookup",Ext.ux.form.field.Lookup,{name:"id_iax",fieldLabel:t("Iax"),displayField:"idIaxname",displayFieldList:"name",gridConfig:{xtype:"iaxlist",fieldSearch:"name",columns:[{header:t("Account"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:2},{header:t("name"),dataIndex:"name",flex:2}]}},0,["siaxlookup"],["component","box","container","fieldcontainer","siaxlookup"],{component:true,box:true,container:true,fieldcontainer:true,siaxlookup:true},["widget.siaxlookup"],0,[MBilling.view.iax,"Lookup"],0));(Ext.cmd.derive("MBilling.view.callOnLine.Controller",Ext.ux.app.ViewController,{onEdit:function(){var d=this,e=d.list.getSelectionModel().getSelection()[0],f=e.get("uniqueid");Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments);Ext.Ajax.request({url:"index.php/callOnLine/getChannelDetails",params:{id:e.get("uniqueid")},scope:d,success:function(a){a=Ext.decode(a.responseText);if(a[d.nameSuccessRequest]){d.formPanel.getForm().findField("description").setValue(a.description);d.formPanel.getForm().findField("codec").setValue(a.codec);d.formPanel.getForm().findField("reinvite").setValue(a.reinvite);d.formPanel.getForm().findField("from_ip").setValue(a.from_ip);d.formPanel.getForm().findField("ndiscado").setValue(a.ndiscado);d.formPanel.getForm().findField("billsec").setValue(a.billsec);d.formPanel.getForm().findField("callerid").setValue(a.callerid)}else{Ext.ux.Alert.alert(d.titleError,a[d.nameMsgRequest],"error")}}})},onSpyCallFree:function(e){var f=this,d=f.list.getSelectionModel().getSelection()[0];if(f.list.getSelectionModel().getSelection().length==1){Ext.Ajax.request({url:"index.php/callOnLine/spyCall",params:{type:"b",channel:d.get("canal")},scope:f,success:function(a){a=Ext.decode(a.responseText);if(a[f.nameSuccessRequest]){Ext.ux.Alert.alert(f.titleSuccess,a[f.nameMsgRequest],"success")}else{Ext.ux.Alert.alert(f.titleError,a[f.nameMsgRequest],"error")}}})}else{Ext.ux.Alert.alert(f.titleError,"Please Select only a record","notification")}},onDelete:function(e){var f=this,d=f.list.getSelectionModel().getSelection()[0];if(f.list.getSelectionModel().getSelection().length==1){Ext.Ajax.request({url:"index.php/callOnLine/destroy",params:{id:d.get("uniqueid")},scope:f,success:function(a){a=Ext.decode(a.responseText);if(a[f.nameSuccessRequest]){Ext.ux.Alert.alert(f.titleSuccess,a[f.nameMsgRequest],"success")}else{Ext.ux.Alert.alert(f.titleError,a[f.nameMsgRequest],"error")}}})}else{Ext.ux.Alert.alert(f.titleError,"Please Select only a record","notification")}f.store.load()}},0,0,0,0,["controller.callonline"],0,[MBilling.view.callOnLine,"Controller"],0));(Ext.cmd.derive("MBilling.view.callOnLine.Module",Ext.ux.panel.Module,{controller:"callonline"},0,["callonlinemodule"],["component","box","container","uxpanelmodule","callonlinemodule"],{component:true,box:true,container:true,uxpanelmodule:true,callonlinemodule:true},["widget.callonlinemodule"],0,[MBilling.view.callOnLine,"Module"],0));(Ext.cmd.derive("MBilling.view.callOnLine.SpyCall",Ext.window.Window,{modal:true,layout:"fit",iconCls:"call",title:t("Spy call"),width:450,height:window.isThemeNeptune||window.isThemeCrisp?170:window.isThemeTriton?290:170,labelWidthFields:80,channel:0,initComponent:function(){var b=this;if(b.list.getSelectionModel().getSelection().length==1){selected=b.list.getSelectionModel().getSelection()[0];if(selected.get("canal")){b.channel=selected.get("canal")}else{b.channel=selected.get("channel")}b.title=t("Spy call")+" "+selected.get("ndiscado")+" "+b.channel,b.autoShow=true;b.items=[{xtype:"form",bodyPadding:5,defaults:{anchor:"0",enableKeyEvents:true,labelWidth:b.labelWidthFields,msgTarget:"side",plugins:"markallowblank",allowBlank:false},items:[{xtype:"siplookup",name:"id_sip",displayField:t("Sip Account")},{xtype:"combobox",name:"type",value:"b",forceSelection:true,editable:false,store:[["b",t("Only Spy")],["w",t("Whisper, can talk to the spied")],["W",t("Whisper, can talk to the spied but cannot listen the call")]],fieldLabel:t("Spy type")}]}];b.title=b.title+(b.titleModule?" - "+b.titleModule:"");b.bbar=[{width:150,text:t("Send"),scope:b,handler:b.onSendSpy}]}else{Ext.ux.Alert.alert(b.titleError,"Please Select only a record","notification")}Ext.window.Window.prototype.initComponent.apply(this,arguments)},onSendSpy:function(d){var f=this,e=f.list.store;if(!f.down("form").isValid()){Ext.ux.Alert.alert("Alert",t("Select sip account"),"notification");return}f.list.setLoading(true);Ext.Ajax.setTimeout(1000000);f.down("form").submit({url:"index.php/callOnLine/spyCall",params:{id_sip:selected.get("id_sip"),type:selected.get("type"),channel:f.channel},scope:f,success:function(c,b){var a=Ext.decode(b.response.responseText);if(a.success){Ext.ux.Alert.alert(t("Success"),a.msg,"success")}else{Ext.ux.Alert.alert(t("Error"),a.errors,"error")}d.enable();f.list.setLoading(false);e.load();f.close()},failure:function(c,b){console.log(b.response.responseText);if(b.response&&Ext.isObject(b.response.responseText)){var a=Ext.decode(b.response.responseText);Ext.ux.Alert.alert(t("Error1"),a.errors,"error")}else{Ext.ux.Alert.alert(t("Error2"),Ext.decode(b.response.responseText).msg,"error",true,10)}d.enable()}})}},0,["callonlinespycall"],["component","box","container","panel","window","callonlinespycall"],{component:true,box:true,container:true,panel:true,window:true,callonlinespycall:true},["widget.callonlinespycall"],0,[MBilling.view.callOnLine,"SpyCall"],0));(Ext.cmd.derive("MBilling.view.callOnLine.List",Ext.ux.grid.Panel,{store:"CallOnLine",fieldSearch:"idUser.username",refreshTime:15,initComponent:function(){var b=this;b.buttonCsv=false;b.allowPrint=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=!App.user.isClient;b.textDelete=t("Hangup Call"),b.buttonDeleteWidth=140,b.refreshTime=(localStorage&&localStorage.getItem("callonlinerefresh"))||b.refreshTime;b.extraButtons=[{text:t("Spy")+" "+t("call"),iconCls:"call",handler:window.multSpy?"onSpyCall":"onSpyCallFree",width:130,disabled:false},{xtype:"numberfield",field:"jmlhBrg",fieldLabel:t("Refresh Time"),editable:false,minValue:5,labelWidth:90,width:150,selectOnFocus:true,allowDecimals:true,decimalPrecision:2,value:b.refreshTime,listeners:{change:function(a){if(a.value>0){b.refreshTime=a.value;localStorage.setItem("callonlinerefresh",a.value)}}}}];b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("UniqueID"),dataIndex:"uniqueid",hidden:true,hideable:App.user.isAdmin},{header:t("Sip Account"),dataIndex:"canal",flex:3},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:3},{header:t("credit"),dataIndex:"idUsercredit",filter:{type:"int",field:"idUser.credit"},renderer:Helper.Util.formatMoneyDecimal,flex:2},{header:t("number"),dataIndex:"ndiscado",flex:3},{header:t("status"),dataIndex:"status",filter:{type:"string",field:"status"},flex:2},{header:t("duration"),dataIndex:"duration",renderer:Helper.Util.formatsecondsToTime,flex:2},{header:t("trunk"),dataIndex:"tronco",flex:4,hidden:!App.user.isAdmin,hideable:App.user.isAdmin},{header:t("Server"),dataIndex:"server",flex:3,hidden:!window.slave||!App.user.isAdmin,hideable:App.user.isAdmin}];b.sessionLoad=Ext.create("Ext.util.DelayedTask",function(){b.store.load()},b);Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments);b.store.on("load",b.onLoadStore,b)},onLoadStore:function(){var b=this;b.onDeactivateModule();b.onActivateModule()},onRender:function(){var b=this;if(Ext.isObject(b.module)){b.module.on("activate",b.onActivateModule,b);b.module.on("deactivate",b.onDeactivateModule,b);b.module.on("close",b.onCloseModule,b)}Ext.ux.grid.Panel.prototype.onRender.apply(this,arguments)},onActivateModule:function(){this.sessionLoad&&this.sessionLoad.delay(this.refreshTime*1000)},onDeactivateModule:function(){this.sessionLoad&&this.sessionLoad.cancel()},onCloseModule:function(){this.onDeactivateModule();this.sessionLoad=null}},0,["callonlinelist"],["component","box","container","panel","tablepanel","gridpanel","grid","callonlinelist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callonlinelist:true},["widget.callonlinelist"],0,[MBilling.view.callOnLine,"List"],0));(Ext.cmd.derive("MBilling.view.callOnLine.List2",Ext.ux.grid.Panel,{store:"CallOnLine",fieldSearch:"username",refreshTime:10,initComponent:function(){var b=this;b.buttonCsv=false;b.allowPrint=false;b.buttonUpdateLot=false;b.allowCreate=false;b.buttonCleanFilter=false;b.allowUpdate=false;b.allowDelete=false;b.refreshTime=(localStorage&&localStorage.getItem("callonlinerefresh"))||b.refreshTime;b.extraButtons=[{xtype:"numberfield",field:"jmlhBrg",fieldLabel:t("Refresh Time"),editable:false,minValue:5,labelWidth:90,width:150,selectOnFocus:true,allowDecimals:true,decimalPrecision:2,value:b.refreshTime,listeners:{change:function(a){if(a.value>0){b.refreshTime=a.value;localStorage.setItem("callonlinerefresh",a.value)}}}}];b.columns=[{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:2},{header:t("Sip Account"),dataIndex:"canal",flex:3,hidden:true,hideable:true},{header:t("number"),dataIndex:"ndiscado",flex:3},{header:t("status"),dataIndex:"status",filter:{type:"string",field:"status"},flex:2},{header:t("duration"),dataIndex:"duration",renderer:Helper.Util.formatsecondsToTime,flex:2},{header:t("trunk"),dataIndex:"tronco",flex:4,hidden:App.user.isClient,hideable:!App.user.isClient}];b.sessionLoad=Ext.create("Ext.util.DelayedTask",function(){b.store.load()},b);Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments);b.store.on("load",b.onLoadStore,b)},onLoadStore:function(){var b=this;b.onDeactivateModule();b.onActivateModule()},onRender:function(){var b=this;if(Ext.isObject(b.module)){b.module.on("activate",b.onActivateModule,b);b.module.on("deactivate",b.onDeactivateModule,b);b.module.on("close",b.onCloseModule,b)}Ext.ux.grid.Panel.prototype.onRender.apply(this,arguments)},onActivateModule:function(){this.sessionLoad&&this.sessionLoad.delay(this.refreshTime*1000)},onDeactivateModule:function(){this.sessionLoad&&this.sessionLoad.cancel()},onCloseModule:function(){this.onDeactivateModule();this.sessionLoad=null}},0,["callonlinelist2"],["component","box","container","panel","tablepanel","gridpanel","grid","callonlinelist2"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callonlinelist2:true},["widget.callonlinelist2"],0,[MBilling.view.callOnLine,"List2"],0));(Ext.cmd.derive("MBilling.view.callOnLine.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{fieldLabel:t("number"),name:"ndiscado",readOnly:true},{fieldLabel:t("CallerID"),name:"callerid",readOnly:true},{fieldLabel:t("Real")+" "+t("duration"),name:"billsec",readOnly:true},{fieldLabel:t("Codec"),name:"codec",readOnly:true},{fieldLabel:t("Reinvite"),name:"reinvite",readOnly:true},{fieldLabel:t("From IP"),name:"from_ip",readOnly:true},{xtype:"textarea",name:"description",readOnly:true,height:350,anchor:"100%",hidden:!App.user.isAdmin}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callonlineform"],["component","box","container","panel","form","callonlineform"],{component:true,box:true,container:true,panel:true,form:true,callonlineform:true},["widget.callonlineform"],0,[MBilling.view.callOnLine,"Form"],0));(Ext.cmd.derive("MBilling.view.sendCreditSummary.Controller",Ext.ux.app.ViewController,{formHidden:true},0,0,0,0,["controller.sendcreditsummary"],0,[MBilling.view.sendCreditSummary,"Controller"],0));(Ext.cmd.derive("MBilling.view.sendCreditSummary.Module",Ext.form.Panel,{resizable:false,autoShow:true,header:false,items:[{xtype:"component",autoEl:{width:"100%",height:"100%",tag:"iframe",src:"index.php/sendCreditSummary/read"}}]},0,["sendcreditsummarymodule"],["component","box","container","panel","form","sendcreditsummarymodule"],{component:true,box:true,container:true,panel:true,form:true,sendcreditsummarymodule:true},["widget.sendcreditsummarymodule"],0,[MBilling.view.sendCreditSummary,"Module"],0));(Ext.cmd.derive("MBilling.view.sendCreditSummary.List",Ext.ux.grid.Panel,{store:"SendCreditSummary",initComponent:function(){var b=this;b.extraButtons=[{emptyText:t("From Day"),xtype:"searchfield",fieldFilter:"date",filterOnClick:b.filterFieldOnClick,store:b.store,comparison:"gt",type:"date"},{emptyText:t("To Day"),xtype:"searchfield",fieldFilter:"date",filterOnClick:b.filterFieldOnClick,store:b.store,comparison:"lt",type:"date"}];b.buttonCsv=false;b.buttonPrint=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("day"),renderer:Ext.util.Format.dateRenderer("Y-m-d"),dataIndex:"day",menuDisabled:true,flex:3},{header:t("service"),dataIndex:"service",flex:5},{header:t("Total cost"),dataIndex:"total_cost",flex:5,renderer:Helper.Util.formatMoneyDecimal2},{header:t("Total sale"),dataIndex:"total_sale",flex:5,renderer:Helper.Util.formatMoneyDecimal2},{header:t("Earned"),dataIndex:"earned",flex:5,renderer:Helper.Util.formatMoneyDecimal2}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["sendcreditsummarylist"],["component","box","container","panel","tablepanel","gridpanel","grid","sendcreditsummarylist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,sendcreditsummarylist:true},["widget.sendcreditsummarylist"],0,[MBilling.view.sendCreditSummary,"List"],0));(Ext.cmd.derive("MBilling.view.sendCreditSummary.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:App.user.isClient}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["sendcreditsummaryform"],["component","box","container","panel","form","sendcreditsummaryform"],{component:true,box:true,container:true,panel:true,form:true,sendcreditsummaryform:true},["widget.sendcreditsummaryform"],0,[MBilling.view.sendCreditSummary,"Form"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayUser.Controller",Ext.ux.app.ViewController,{onEdit:function(){me=this;me.sumData=me.store.getData().items[0].getData();if(!me.sumData){return}me.formPanel.getForm().getFields().each(function(b){b.setValue(me.sumData[b.name])});me.formPanel.expand()},onExportCsvDayUser:function(o,l,g){var m=this,j=m.list.getStore(),n=m.list.filters.getFilterData().length?Ext.encode(m.list.filters.getFilterData()):j.proxy.extraParams.filter;window.open("index.php/callSummaryDayUser/exportCsvCalls?id="+o.getStore().getAt(l).getData().idUserusername+"&filter="+n)}},0,0,0,0,["controller.callsummarydayuser"],0,[MBilling.view.callSummaryDayUser,"Controller"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayUser.Module",Ext.ux.panel.Module,{controller:"callsummarydayuser",titleDetails:t("total"),iconForm:"icon-sum",cfgEast:{flex:0.4}},0,["callsummarydayusermodule"],["component","box","container","uxpanelmodule","callsummarydayusermodule"],{component:true,box:true,container:true,uxpanelmodule:true,callsummarydayusermodule:true},["widget.callsummarydayusermodule"],0,[MBilling.view.callSummaryDayUser,"Module"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayUser.List",Ext.ux.grid.Panel,{store:"CallSummaryDayUser",initComponent:function(){var b=this;b.buttonImportCsv=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{xtype:"actioncolumn",width:26,sortable:false,menuDisabled:true,header:t(""),dataIndex:"id",items:[{iconCls:"icon-export-csv",tooltip:t("Export CSV"),handler:"onExportCsvDayUser"}],hidden:!App.user.isAdmin},{header:t("day"),renderer:Ext.util.Format.dateRenderer("Y-m-d"),dataIndex:"day",filter:{type:"date",field:"day"},flex:3},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("sessiontime")+" "+t("Min"),dataIndex:"sessiontime",flex:2},{header:t("aloc_all_calls"),dataIndex:"aloc_all_calls",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Answered Calls"),dataIndex:"nbcall",flex:3},{header:t("buycost"),dataIndex:App.user.isAdmin?"buycost":"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("sessionbill"),dataIndex:App.user.isAgent||App.user.isClientAgent?"agent_bill":"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("markup"),dataIndex:"lucro",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarydayuserlist"],["component","box","container","panel","tablepanel","gridpanel","grid","callsummarydayuserlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callsummarydayuserlist:true},["widget.callsummarydayuserlist"],0,[MBilling.view.callSummaryDayUser,"List"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayUser.Form",Ext.ux.form.Panel,{defaults:{},labelWidthFields:100,defaultType:"displayfield",initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{name:"sumsessiontime",fieldLabel:t("sessiontime")+" "+t("Min"),renderer:Ext.util.Format.numberRenderer("0"),allowBlank:true},{name:App.user.isAgent||App.user.isClientAgent?"sumagent_bill":"sumsessionbill",fieldLabel:t("sessionbill"),renderer:Helper.Util.formatMoneyDecimal,allowBlank:true},{name:App.user.isAdmin?"sumbuycost":"sumsessionbill",fieldLabel:t("buycost"),renderer:Helper.Util.formatMoneyDecimal,hidden:App.user.isClient,allowBlank:true},{name:"sumlucro",fieldLabel:t("markup"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumnbcall",fieldLabel:t("nbcall"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarydayuserform"],["component","box","container","panel","form","callsummarydayuserform"],{component:true,box:true,container:true,panel:true,form:true,callsummarydayuserform:true},["widget.callsummarydayuserform"],0,[MBilling.view.callSummaryDayUser,"Form"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayTrunk.Controller",Ext.ux.app.ViewController,{onEdit:function(){me=this;me.sumData=me.store.getData().items[0].getData();if(!me.sumData){return}me.formPanel.getForm().getFields().each(function(b){b.setValue(me.sumData[b.name])});me.formPanel.expand()}},0,0,0,0,["controller.callsummarydaytrunk"],0,[MBilling.view.callSummaryDayTrunk,"Controller"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayTrunk.Module",Ext.ux.panel.Module,{controller:"callsummarydaytrunk",titleDetails:t("total"),iconForm:"icon-sum",cfgEast:{flex:0.4}},0,["callsummarydaytrunkmodule"],["component","box","container","uxpanelmodule","callsummarydaytrunkmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callsummarydaytrunkmodule:true},["widget.callsummarydaytrunkmodule"],0,[MBilling.view.callSummaryDayTrunk,"Module"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayTrunk.List",Ext.ux.grid.Panel,{store:"CallSummaryDayTrunk",initComponent:function(){var b=this;b.buttonImportCsv=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{header:t("day"),renderer:Ext.util.Format.dateRenderer("Y-m-d"),dataIndex:"day",filter:{type:"date",field:"day"},flex:3},{header:t("Trunk"),dataIndex:"idTrunktrunkcode",filter:{type:"string",field:"idTrunk.trunkcode"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("sessiontime")+" "+t("Min"),dataIndex:"sessiontime",flex:2},{header:t("aloc_all_calls"),dataIndex:"aloc_all_calls",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Answered Calls"),dataIndex:"nbcall",flex:3},{header:t("buycost"),dataIndex:"buycost",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("sessionbill"),dataIndex:"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("markup"),dataIndex:"lucro",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarydaytrunklist"],["component","box","container","panel","tablepanel","gridpanel","grid","callsummarydaytrunklist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callsummarydaytrunklist:true},["widget.callsummarydaytrunklist"],0,[MBilling.view.callSummaryDayTrunk,"List"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayTrunk.Form",Ext.ux.form.Panel,{defaults:{},labelWidthFields:100,defaultType:"displayfield",initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{name:"sumsessiontime",fieldLabel:t("sessiontime")+" "+t("Min"),renderer:Ext.util.Format.numberRenderer("0"),allowBlank:true},{name:"sumsessionbill",fieldLabel:t("sessionbill"),renderer:Helper.Util.formatMoneyDecimal,allowBlank:true},{name:"sumbuycost",fieldLabel:t("buycost"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumlucro",fieldLabel:t("markup"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumnbcall",fieldLabel:t("nbcall"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarydaytrunkform"],["component","box","container","panel","form","callsummarydaytrunkform"],{component:true,box:true,container:true,panel:true,form:true,callsummarydaytrunkform:true},["widget.callsummarydaytrunkform"],0,[MBilling.view.callSummaryDayTrunk,"Form"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayAgent.Controller",Ext.ux.app.ViewController,{onEdit:function(){me=this;me.sumData=me.store.getData().items[0].getData();if(!me.sumData){return}me.formPanel.getForm().getFields().each(function(b){b.setValue(me.sumData[b.name])});me.formPanel.expand()}},0,0,0,0,["controller.callsummarydayagent"],0,[MBilling.view.callSummaryDayAgent,"Controller"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayAgent.Module",Ext.ux.panel.Module,{controller:"callsummarydayagent",titleDetails:t("total"),iconForm:"icon-sum",cfgEast:{flex:0.4}},0,["callsummarydayagentmodule"],["component","box","container","uxpanelmodule","callsummarydayagentmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callsummarydayagentmodule:true},["widget.callsummarydayagentmodule"],0,[MBilling.view.callSummaryDayAgent,"Module"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayAgent.List",Ext.ux.grid.Panel,{store:"CallSummaryDayAgent",initComponent:function(){var b=this;b.buttonImportCsv=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{header:t("day"),renderer:Ext.util.Format.dateRenderer("Y-m-d"),dataIndex:"day",filter:{type:"date",field:"day"},flex:3},{header:t("Agent"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{menuDisabled:true,header:t("sessiontime")+" "+t("Min"),dataIndex:"sessiontime",flex:2},{header:t("aloc_all_calls"),dataIndex:"aloc_all_calls",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Answered Calls"),dataIndex:"nbcall",flex:3},{header:t("buycost"),dataIndex:"buycost",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("sessionbill"),dataIndex:"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("markup"),dataIndex:"lucro",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarydayagentlist"],["component","box","container","panel","tablepanel","gridpanel","grid","callsummarydayagentlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callsummarydayagentlist:true},["widget.callsummarydayagentlist"],0,[MBilling.view.callSummaryDayAgent,"List"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayAgent.Form",Ext.ux.form.Panel,{defaults:{},labelWidthFields:100,defaultType:"displayfield",initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{name:"sumsessiontime",fieldLabel:t("sessiontime")+" "+t("Min"),renderer:Ext.util.Format.numberRenderer("0"),allowBlank:true},{name:"sumsessionbill",fieldLabel:t("sessionbill"),renderer:Helper.Util.formatMoneyDecimal,allowBlank:true},{name:"sumbuycost",fieldLabel:t("buycost"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumlucro",fieldLabel:t("markup"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumnbcall",fieldLabel:t("nbcall"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarydayagentform"],["component","box","container","panel","form","callsummarydayagentform"],{component:true,box:true,container:true,panel:true,form:true,callsummarydayagentform:true},["widget.callsummarydayagentform"],0,[MBilling.view.callSummaryDayAgent,"Form"],0));(Ext.cmd.derive("MBilling.view.callerid.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.callerid"],0,[MBilling.view.callerid,"Controller"],0));(Ext.cmd.derive("MBilling.view.callerid.Module",Ext.ux.panel.Module,{controller:"callerid"},0,["calleridmodule"],["component","box","container","uxpanelmodule","calleridmodule"],{component:true,box:true,container:true,uxpanelmodule:true,calleridmodule:true},["widget.calleridmodule"],0,[MBilling.view.callerid,"Module"],0));(Ext.cmd.derive("MBilling.view.callerid.List",Ext.ux.grid.Panel,{store:"Callerid",initComponent:function(){var b=this;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("cid"),dataIndex:"cid",flex:4},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("status"),dataIndex:"activated",renderer:Helper.Util.formatBooleanActive,comboRelated:"booleancombo",flex:2,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")]]}}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["calleridlist"],["component","box","container","panel","tablepanel","gridpanel","grid","calleridlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,calleridlist:true},["widget.calleridlist"],0,[MBilling.view.callerid,"List"],0));(Ext.cmd.derive("MBilling.view.callerid.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["id_user"],initComponent:function(){var b=this;b.items=[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"cid",fieldLabel:t("cid")},{xtype:"booleancombo",name:"activated",fieldLabel:t("status"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["calleridform"],["component","box","container","panel","form","calleridform"],{component:true,box:true,container:true,panel:true,form:true,calleridform:true},["widget.calleridform"],0,[MBilling.view.callerid,"Form"],0));(Ext.cmd.derive("MBilling.view.restrictedPhonenumber.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.restrictedphonenumber"],0,[MBilling.view.restrictedPhonenumber,"Controller"],0));(Ext.cmd.derive("MBilling.view.restrictedPhonenumber.Module",Ext.ux.panel.Module,{controller:"restrictedphonenumber"},0,["restrictedphonenumbermodule"],["component","box","container","uxpanelmodule","restrictedphonenumbermodule"],{component:true,box:true,container:true,uxpanelmodule:true,restrictedphonenumbermodule:true},["widget.restrictedphonenumbermodule"],0,[MBilling.view.restrictedPhonenumber,"Module"],0));(Ext.cmd.derive("MBilling.view.restrictedPhonenumber.List",Ext.ux.grid.Panel,{store:"RestrictedPhonenumber",buttonImportCsv:true,initComponent:function(){var b=this;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:2,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("number"),dataIndex:"number",flex:2}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["restrictedphonenumberlist"],["component","box","container","panel","tablepanel","gridpanel","grid","restrictedphonenumberlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,restrictedphonenumberlist:true},["widget.restrictedphonenumberlist"],0,[MBilling.view.restrictedPhonenumber,"List"],0));(Ext.cmd.derive("MBilling.view.restrictedPhonenumber.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["id_user"],initComponent:function(){var b=this;b.items=[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,readOnly:App.user.isClient,allowBlank:App.user.isClient},{name:"number",fieldLabel:t("number")}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["restrictedphonenumberform"],["component","box","container","panel","form","restrictedphonenumberform"],{component:true,box:true,container:true,panel:true,form:true,restrictedphonenumberform:true},["widget.restrictedphonenumberform"],0,[MBilling.view.restrictedPhonenumber,"Form"],0));(Ext.cmd.derive("MBilling.view.restrictedPhonenumber.ImportCsv",Ext.ux.window.ImportCsv,{htmlTipInfo:"
number
",fieldsImport:[{xtype:"usercombo",width:350}]},0,["restrictedphonenumberimportcsv"],["component","box","container","panel","window","restrictedphonenumberimportcsv"],{component:true,box:true,container:true,panel:true,window:true,restrictedphonenumberimportcsv:true},["widget.restrictedphonenumberimportcsv"],0,[MBilling.view.restrictedPhonenumber,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.did.Controller",Ext.ux.app.ViewController,{isSubmitForm:true,init:function(){var b=this;b.control({"booleancombo[name=cbr]":{select:b.onSelectcbr},"noyescombo[name=cbr_ua]":{select:b.onSelectcbrAu}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectcbr:function(c,d){me=this,form=me.formPanel.getForm();form.findField("cbr_ua").setVisible(d.data.field1);form.findField("cbr_total_try").setVisible(d.data.field1);form.findField("cbr_time_try").setVisible(d.data.field1)},onSelectcbrAu:function(c,d){me=this,form=me.formPanel.getForm();form.findField("cbr_em").setVisible(d.data.field1);form.findField("TimeOfDay_monFri").setVisible(d.data.field1);form.findField("TimeOfDay_sat").setVisible(d.data.field1);form.findField("TimeOfDay_sun").setVisible(d.data.field1);form.findField("workaudio").setVisible(d.data.field1);form.findField("noworkaudio").setVisible(d.data.field1)},onNew:function(e){var f=this,d=f.formPanel.getForm();d.findField("cbr_ua").setVisible(false);d.findField("cbr_em").setVisible(false);d.findField("TimeOfDay_monFri").setVisible(false);d.findField("TimeOfDay_sat").setVisible(false);d.findField("TimeOfDay_sun").setVisible(false);d.findField("workaudio").setVisible(false);d.findField("noworkaudio").setVisible(false);d.findField("cbr_total_try").setVisible(false);d.findField("cbr_time_try").setVisible(false);Ext.ux.app.ViewController.prototype.onNew.apply(this,arguments)},onEdit:function(){var c=this,d=c.list.getSelectionModel().getSelection()[0];if(d.get("cbr")==0){c.formPanel.getForm().findField("cbr_ua").setVisible(false);c.formPanel.getForm().findField("cbr_em").setVisible(false);c.formPanel.getForm().findField("TimeOfDay_monFri").setVisible(false);c.formPanel.getForm().findField("TimeOfDay_sat").setVisible(false);c.formPanel.getForm().findField("TimeOfDay_sun").setVisible(false);c.formPanel.getForm().findField("workaudio").setVisible(false);c.formPanel.getForm().findField("noworkaudio").setVisible(false);c.formPanel.getForm().findField("cbr_total_try").setVisible(false);c.formPanel.getForm().findField("cbr_time_try").setVisible(false)}else{c.formPanel.getForm().findField("cbr_ua").setVisible(true);if(d.get("cbr_ua")==1){c.formPanel.getForm().findField("cbr_em").setVisible(true);c.formPanel.getForm().findField("TimeOfDay_monFri").setVisible(true);c.formPanel.getForm().findField("TimeOfDay_sat").setVisible(true);c.formPanel.getForm().findField("TimeOfDay_sun").setVisible(true);c.formPanel.getForm().findField("workaudio").setVisible(true);c.formPanel.getForm().findField("noworkaudio").setVisible(true);c.formPanel.getForm().findField("cbr_total_try").setVisible(true);c.formPanel.getForm().findField("cbr_time_try").setVisible(true)}}Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)},onDelete:function(j){var g=this,e=g.list.getSelectionModel().getSelection(),f=true;Ext.each(e,function(a){if(a.get("reserved")===1){Ext.ux.Alert.alert(g.titleError,t("Please, first release the DID")+" "+a.raw.did,"error");f=false;return}});if(f==true){Ext.ux.app.ViewController.prototype.onDelete.apply(this,arguments)}},onRelease:function(o,l){var m=this,n=m.list.getSelectionModel().getSelection()[0],j=t("Confirm Release Did")+" "+n.get("did"),g=m.list.getStore();if(m.list.getSelectionModel().getSelection().length>1){Ext.ux.Alert.alert(m.titleError,t("Please Select only one DID to release"),"error")}else{if(n.get("reserved")===0){Ext.ux.Alert.alert(m.titleError,t("didIsNotUse"),"error");g.load()}else{Ext.Msg.confirm(m.titleConfirmation,j,function(a){if(a==="yes"){Ext.Ajax.request({url:"index.php/did/liberar",params:{id:n.get("id")},success:function(c){c=Ext.decode(c.responseText);if(c[m.nameSuccessRequest]){Ext.ux.Alert.alert(m.titleSuccess,c[m.nameMsgRequest],"success");g.load()}else{var b=Helper.Util.convertErrorsJsonToString(c[m.nameMsgRequest]);g.load()}}})}},m)}}},onBuyDid:function(){var m=this,j=m.lookupReference("buydidPanel"),f=j.getForm().findField("did").getValue(),l=j.getForm().findField("did").rawValue,g=t("confirmationBuyDid");if(f<1){Ext.ux.Alert.alert(m.titleError,t("Please, select a Did"),"warning")}else{Ext.Msg.confirm(t("Confirmation"),g+"
"+l,function(a){if(a==="yes"){Ext.ux.Alert.alert(m.titleSuccess,t("Please wait....We are activing your DID."),"notification");Ext.Ajax.request({url:"index.php/did/buy",params:{id:f},success:function(c){c=Ext.decode(c.responseText);if(c.success){Ext.ux.Alert.alert(m.titleSuccess,t(c.msg),"success",true,true,5000)}else{var b=Helper.Util.convertErrorsJsonToString(c.msg);Ext.ux.Alert.alert(m.titleError,t(b),"warning",true,true,5000)}}})}},m)}}},0,0,0,0,["controller.did"],0,[MBilling.view.did,"Controller"],0));(Ext.cmd.derive("MBilling.view.did.Combo",Ext.form.field.ComboBox,{name:"id_did",fieldLabel:t("did"),displayField:"did",forceSelection:true,editable:true,valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Did",{proxy:{type:"uxproxy",module:"did",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["didcombo"],["component","box","field","textfield","pickerfield","combobox","combo","didcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,didcombo:true},["widget.didcombo"],0,[MBilling.view.did,"Combo"],0));(Ext.cmd.derive("MBilling.view.did.BuyCombo",Ext.form.field.ComboBox,{name:"id_did",forceSelection:true,editable:false,fieldLabel:t("did"),displayField:"did",valueField:"id",listConfig:{itemTpl:Ext.create("Ext.XTemplate","
{did} ("+t("Setup")+": "+t("moedasimblo")+" {connection_charge} --> "+t("monthly payment")+": "+t("moedasimblo")+" {fixrate})
")},displayTpl:Ext.create("Ext.XTemplate",'{did} ('+t("Setup")+": "+t("moedasimblo")+" {connection_charge} --> "+t("monthly payment")+": "+t("moedasimblo")+" {fixrate})"),initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Did",{proxy:{type:"uxproxy",module:"did",actionRead:"readBuy",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["didbuycombo"],["component","box","field","textfield","pickerfield","combobox","combo","didbuycombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,didbuycombo:true},["widget.didbuycombo"],0,[MBilling.view.did,"BuyCombo"],0));(Ext.cmd.derive("MBilling.view.did.Module",Ext.ux.panel.Module,{controller:"did"},0,["didmodule"],["component","box","container","uxpanelmodule","didmodule"],{component:true,box:true,container:true,uxpanelmodule:true,didmodule:true},["widget.didmodule"],0,[MBilling.view.did,"Module"],0));(Ext.cmd.derive("MBilling.view.did.List",Ext.ux.grid.Panel,{store:"Did",fieldSearch:"did",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.extraButtons=[{text:t("crearToReleaseDid"),iconCls:"icon-delete",handler:"onRelease",disabled:false}];b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("did"),dataIndex:"did",flex:4},{header:t("reserved"),dataIndex:"reserved",renderer:Helper.Util.formattyyesno,flex:2,filter:{type:"list",options:[[1,t("yes")],[0,t("no")]]},hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:3,menuDisabled:true},{header:t("status"),dataIndex:"activated",renderer:Helper.Util.formatBooleanActive,flex:2,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")]]},hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("connection_charge"),dataIndex:"connection_charge",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("price")+" "+t("per")+" "+t("monthly"),dataIndex:"fixrate",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("secondusedreal"),renderer:Helper.Util.formatsecondsToTime,dataIndex:"secondusedreal",flex:3},{header:t("Description"),dataIndex:"description",hidden:true,hideable:App.user.isAdmin,flex:5}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["didlist"],["component","box","container","panel","tablepanel","gridpanel","grid","didlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,didlist:true},["widget.didlist"],0,[MBilling.view.did,"List"],0));(Ext.cmd.derive("MBilling.view.did.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["did"],initComponent:function(){var b=this;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{labelAlign:"right",plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true,labelWidth:140}},items:[{title:t("general"),items:[{name:"did",fieldLabel:t("did"),readOnly:App.user.isClient||App.user.isAgent},{xtype:"booleancombo",name:"activated",fieldLabel:t("status"),hidden:App.user.isClient||App.user.isAgent,allowBlank:true},{xtype:"moneyfield",name:"connection_charge",fieldLabel:t("connection_charge"),value:"0",hidden:App.user.isClient||App.user.isAgent},{xtype:"moneyfield",name:"fixrate",fieldLabel:t("Monthly")+" "+t("price"),value:"0",hidden:App.user.isClient||App.user.isAgent},{style:"margin-top:5px",xtype:"fieldset",title:t("Did")+" "+t("increment"),collapsible:false,collapsed:false,hidden:!App.user.isAdmin,defaults:{labelWidth:160,anchor:"100%",labelAlign:b.labelAlignFields},items:[{xtype:"moneyfield",name:"connection_sell",fieldLabel:t("Connetion charge"),value:"0",hidden:!App.user.isAdmin},{xtype:"numberfield",name:"minimal_time_charge",fieldLabel:t("Minimal time to charge"),value:"0",hidden:!App.user.isAdmin},{xtype:"numberfield",name:"initblock",fieldLabel:t("initblock"),value:"0",hidden:!App.user.isAdmin},{xtype:"numberfield",name:"increment",fieldLabel:t("billingblock"),value:"0",hidden:!App.user.isAdmin}]},{xtype:"combobox",name:"charge_of",fieldLabel:t("Charge")+" "+t("of"),value:1,forceSelection:true,editable:false,store:[[1,t("Owner DID")],[0,t("Caller ID, only allow call from registered callerID")]],hidden:App.user.isClient||App.user.isAgent},{xtype:"numberfield",name:"calllimit",fieldLabel:t("Channel Limit"),value:"-1",minValue:"-1",hidden:!window.didChannelLimit||!App.user.isAdmin},{xtype:"textareafield",allowBlank:true,name:"description",fieldLabel:t("description"),hidden:!App.user.isAdmin}]},{title:t("Billing"),items:[{style:"margin-top:5px",xtype:"fieldset",title:t("Did Billing per minute")+" "+t("rate")+" 1",collapsible:false,collapsed:false,hidden:!App.user.isAdmin,defaults:{labelWidth:170,anchor:"100%",labelAlign:b.labelAlignFields},items:[{xtype:"textfield",name:"expression_1",fieldLabel:t("Regular expression"),value:"*",hidden:!App.user.isAdmin},{xtype:"moneyfield",name:"selling_rate_1",fieldLabel:t("Sell price per min"),value:"0",hidden:!App.user.isAdmin},{xtype:"noyescombo",name:"block_expression_1",fieldLabel:t("Block calls from this expression"),hidden:!App.user.isAdmin},{xtype:"noyescombo",name:"send_to_callback_1",fieldLabel:t("Send the call to Callback"),hidden:!App.user.isAdmin}]},{style:"margin-top:25px",xtype:"fieldset",title:t("Did Billing per minute")+" "+t("rate")+" 2",collapsible:false,collapsed:false,hidden:!App.user.isAdmin,defaults:{labelWidth:160,anchor:"100%",labelAlign:b.labelAlignFields},items:[{xtype:"textfield",name:"expression_2",fieldLabel:t("Regular expression"),value:"*",hidden:!App.user.isAdmin},{xtype:"moneyfield",name:"selling_rate_2",fieldLabel:t("Sell price per min"),value:"0",hidden:!App.user.isAdmin},{xtype:"noyescombo",name:"block_expression_2",fieldLabel:t("Block calls from this expression"),hidden:!App.user.isAdmin},{xtype:"noyescombo",name:"send_to_callback_2",fieldLabel:t("Send the call to Callback"),hidden:!App.user.isAdmin}]},{style:"margin-top:25px",xtype:"fieldset",title:t("Did Billing per minute")+" "+t("rate")+" 3",collapsible:false,collapsed:false,hidden:!App.user.isAdmin,defaults:{labelWidth:160,anchor:"100%",labelAlign:b.labelAlignFields},items:[{xtype:"textfield",name:"expression_3",fieldLabel:t("Regular expression"),value:"*",hidden:!App.user.isAdmin},{xtype:"moneyfield",name:"selling_rate_3",fieldLabel:t("Sell price per min"),value:"0",hidden:!App.user.isAdmin},{xtype:"noyescombo",name:"block_expression_3",fieldLabel:t("Block calls from this expression"),hidden:!App.user.isAdmin},{xtype:"noyescombo",name:"send_to_callback_3",fieldLabel:t("Send the call to Callback"),hidden:!App.user.isAdmin}]}]},{title:t("CallBack Pro"),hidden:!window.cbr,items:[{xtype:"booleancombo",name:"cbr",fieldLabel:t("CallBack Pro"),value:0,hidden:!window.cbr,allowBlank:true},{xtype:"noyescombo",name:"cbr_ua",fieldLabel:t("Use Audio"),value:0,hidden:true,allowBlank:true},{xtype:"numberfield",name:"cbr_total_try",fieldLabel:t("Maximum trying"),value:3,hidden:true,allowBlank:true,minValue:0},{xtype:"numberfield",name:"cbr_time_try",fieldLabel:t("Interval beteween trying"),value:30,hidden:true,allowBlank:true,minValue:10},{xtype:"noyescombo",name:"cbr_em",fieldLabel:t("Early Media"),hidden:true,allowBlank:true},{name:"TimeOfDay_monFri",fieldLabel:t("Mon-Fri"),value:"09:00-12:00|14:00-18:00",minLength:11,hidden:true},{name:"TimeOfDay_sat",fieldLabel:t("Sat"),value:"09:00-12:00",allowBlank:true,hidden:true},{name:"TimeOfDay_sun",fieldLabel:t("Sun"),value:"00:00",allowBlank:true,hidden:true},{xtype:"uploadfield",fieldLabel:t("workaudio"),emptyText:"Select an gsm File",allowBlank:true,name:"workaudio",extAllowed:["wav","gsm"],hidden:true},{xtype:"uploadfield",fieldLabel:t("noworkaudio"),emptyText:"Select an gsm File",allowBlank:true,name:"noworkaudio",extAllowed:["wav","gsm"],hidden:true}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["didform"],["component","box","container","panel","form","didform"],{component:true,box:true,container:true,panel:true,form:true,didform:true},["widget.didform"],0,[MBilling.view.did,"Form"],0));(Ext.cmd.derive("MBilling.view.did.ImportCsv",Ext.ux.window.ImportCsv,{htmlTipInfo:"
"+t("number")+", "+t("price")+" "+t("by")+" "+t("monthly")+", "+t("connection_charge")+"
551156332233, 10, 5
554153882200, 10, 5
554155667788, 10, 5
"+t("monthly")+" "+t("and")+" "+t("connection_charge")+" "+t("optional")+"",fieldsImport:[{fieldLabel:t("table"),hidden:true,allowBlank:true}]},0,["didimportcsv"],["component","box","container","panel","window","didimportcsv"],{component:true,box:true,container:true,panel:true,window:true,didimportcsv:true},["widget.didimportcsv"],0,[MBilling.view.did,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.didbuy.Module",Ext.form.Panel,{controller:"did",resizable:false,autoShow:true,header:false,initComponent:function(){var b=this;b.items=[{reference:"buydidPanel",xtype:"form",margin:"10 10 10 10",autoShow:true,closable:false,resizable:false,bodyPadding:10,defaultType:"textfield",defaults:{labelAlign:"right",labelWidth:175,width:280,allowBlank:false,msgTarget:"side",enableKeyEvents:true,plugins:"markallowblank",anchor:"100%"},items:[{xtype:"didbuycombo",fieldLabel:t("Select a Did"),name:"did"}],bbar:[{text:t("Next"),tooltip:t("Next"),glyph:icons.disk,handler:"onBuyDid"}]}];Ext.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["didbuymodule"],["component","box","container","panel","form","didbuymodule"],{component:true,box:true,container:true,panel:true,form:true,didbuymodule:true},["widget.didbuymodule"],0,[MBilling.view.didbuy,"Module"],0));(Ext.cmd.derive("MBilling.view.diddestination.Controller",Ext.ux.app.ViewController,{init:function(){var b=this;b.control({didtypefullcombo:{select:b.onSelectMethod},didtypefreecombo:{select:b.onSelectMethod}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectMethod:function(c,d){this.showFieldsRelated(d.getData().showFields)},showFieldsRelated:function(f){var d=this,e=d.formPanel.getForm().getFields();e.each(function(a){a.setVisible(f.indexOf(a.name)!==-1)})},onEdit:function(){var f=this,d=f.formPanel.getForm(),e=f.list.getSelectionModel().getSelection()[0];method=e?e.get("voip_call"):"sipcall";switch(method){case 0:method=t("callforpstn");break;case 1:method=t("sipcall");break;case 2:method=t("ivr");break;case 3:method="CallingCard";break;case 4:method=t("portalDeVoz");break;case 5:method=t("CID Callback");break;case 6:method=t("0800 Callback");break;case 7:method=t("Queue");break;case 8:method=t("Call Group");break;case 9:method=t("Custom");break}showFields=f.formPanel.down("didtypefullcombo").store.findRecord("name",method).getData().showFields;f.showFieldsRelated(showFields);d.findField("id_did").setReadOnly(true);Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)},onNew:function(){var f=this,d=f.formPanel.getForm(),e=f.list.getSelectionModel().getSelection()[0];d.findField("id_did").setReadOnly(false);method=t("sipcall");showFields=f.formPanel.down("didtypefullcombo").store.findRecord("name",method).getData().showFields;f.showFieldsRelated(showFields);Ext.ux.app.ViewController.prototype.onNew.apply(this,arguments)}},0,0,0,0,["controller.diddestination"],0,[MBilling.view.diddestination,"Controller"],0));(Ext.cmd.derive("MBilling.view.diddestination.Module",Ext.ux.panel.Module,{controller:"diddestination"},0,["diddestinationmodule"],["component","box","container","uxpanelmodule","diddestinationmodule"],{component:true,box:true,container:true,uxpanelmodule:true,diddestinationmodule:true},["widget.diddestinationmodule"],0,[MBilling.view.diddestination,"Module"],0));(Ext.cmd.derive("MBilling.view.diddestination.List",Ext.ux.grid.Panel,{store:"Diddestination",fieldSearch:"idDid.did",initComponent:function(){var b=this;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("did"),dataIndex:"idDiddid",filter:{type:"string",field:"idDid.did"},flex:5},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("type")+" "+t("of")+" "+t("call"),dataIndex:"voip_call",renderer:Helper.Util.formatDidType,comboRelated:"didtypecombo",flex:3,filter:{type:"list",options:[[0,t("callforpstn")],[1,t("sipcall")],[2,t("ivr")],[3,t("callingcard")],[4,t("portalDeVoz")],[5,t("CID Callback")],[6,t("0800 Callback")],[7,t("Queue")],[8,t("Call Group")],[9,t("Custom")]]}},{header:t("secondusedreal"),renderer:Helper.Util.formatsecondsToTime,dataIndex:"secondusedreal",flex:3},{header:t("creationdate"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"creationdate",flex:5}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["diddestinationlist"],["component","box","container","panel","tablepanel","gridpanel","grid","diddestinationlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,diddestinationlist:true},["widget.diddestinationlist"],0,[MBilling.view.diddestination,"List"],0));(Ext.cmd.derive("MBilling.view.diddestination.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["id_user","id_did"],initComponent:function(){var b=this;b.items=[{name:"id_did",fieldLabel:t("DID"),xtype:"didcombo"},{xtype:"userlookup",ownerForm:b,hidden:true,allowBlank:App.user.isClient},{xtype:"booleancombo",name:"activated",fieldLabel:t("status"),allowBlank:false},{xtype:"numbercombo",name:"priority",fieldLabel:t("priority"),allowBlank:true},{style:"margin-top:25px",xtype:"fieldset",title:t("Did Destination"),collapsible:true,collapsed:false,defaults:{labelWidth:75,anchor:"100%",labelAlign:b.labelAlignFields},items:[{xtype:"didtypefullcombo",name:"voip_call",fieldLabel:t("type")+" "+t("of")+" "+t("call")},{xtype:"textfield",name:"destination",fieldLabel:t("Destination"),value:"",allowBlank:true,hidden:App.user.isClient||App.user.isAgent},{xtype:"ivrlookup",ownerForm:b,name:"id_ivr",fieldLabel:t("IVR"),allowBlank:true},{xtype:"queuelookup",ownerForm:b,name:"id_queue",fieldLabel:t("Queue"),allowBlank:true},{xtype:"siplookup",ownerForm:b,name:"id_sip",fieldLabel:t("SIP"),allowBlank:true}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["diddestinationform"],["component","box","container","panel","form","diddestinationform"],{component:true,box:true,container:true,panel:true,form:true,diddestinationform:true},["widget.diddestinationform"],0,[MBilling.view.diddestination,"Form"],0));(Ext.cmd.derive("MBilling.view.diddestination.Combo",Ext.form.field.ComboBox,{fieldLabel:t("typepaid"),displayField:"name",valueField:"id",forceSelection:true,editable:false,value:1,store:{fields:["id","name"],data:[{id:"0",name:t("callforpstn"),showFields:["voip_call","destination","id_did","id_user","activated"]},{id:"1",name:t("sipcall"),showFields:["voip_call","id_sip","id_did","id_user","activated","priority"]},{id:"2",name:t("ivr"),showFields:["voip_call","id_did","id_ivr","id_user","activated"]},{id:"3",name:"CallingCard",showFields:["voip_call","id_did","id_user","activated"]},{id:"4",name:t("portalDeVoz"),showFields:["voip_call","id_did","id_user","activated"]},{id:"5",name:t("CID Callback"),showFields:["voip_call","id_did","id_user","activated"]},{id:"6",name:t("0800 Callback"),showFields:["voip_call","id_did","id_user","activated"]},{id:"7",name:t("Queue"),showFields:["voip_call","id_did","id_queue","id_user","activated"]},{id:"8",name:t("Call Group"),showFields:["voip_call","destination","id_did","id_user","activated"]},{id:"9",name:t("Custom"),showFields:["voip_call","destination","id_did","id_user","activated"]}]}},0,["didtypefullcombo"],["component","box","field","textfield","pickerfield","combobox","combo","didtypefullcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,didtypefullcombo:true},["widget.didtypefullcombo"],0,[MBilling.view.diddestination,"Combo"],0));(Ext.cmd.derive("MBilling.view.diddestination.freeCombo",Ext.form.field.ComboBox,{fieldLabel:t("typepaid"),displayField:"name",forceSelection:true,editable:false,valueField:"id",value:1,store:{fields:["id","name"],data:[{id:"0",name:t("callforpstn"),showFields:["voip_call","id_did","destination","id_user","activated"]},{id:"1",name:t("sipcall"),showFields:["voip_call","id_did","id_sip","id_user","activated","priority"]},{id:"2",name:t("ivr"),showFields:["voip_call","id_did","id_ivr","id_user"]},{id:"3",name:"CallingCard",showFields:["voip_call","id_did","id_user"]},{id:"4",name:t("portalDeVoz"),showFields:["voip_call","id_did","id_user"]}]}},0,["didtypefreecombo"],["component","box","field","textfield","pickerfield","combobox","combo","didtypefreecombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,didtypefreecombo:true},["widget.didtypefreecombo"],0,[MBilling.view.diddestination,"freeCombo"],0));(Ext.cmd.derive("MBilling.view.didUse.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.diduse"],0,[MBilling.view.didUse,"Controller"],0));(Ext.cmd.derive("MBilling.view.didUse.Module",Ext.ux.panel.Module,{controller:"diduse"},0,["didusemodule"],["component","box","container","uxpanelmodule","didusemodule"],{component:true,box:true,container:true,uxpanelmodule:true,didusemodule:true},["widget.didusemodule"],0,[MBilling.view.didUse,"Module"],0));(Ext.cmd.derive("MBilling.view.didUse.List",Ext.ux.grid.Panel,{store:"DidUse",initComponent:function(){var b=this;b.buttonCsv=false;b.allowPrint=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("did"),dataIndex:"idDiddid",flex:5},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("monthpayed"),dataIndex:"month_payed",flex:2},{header:t("reservationdate"),renderer:Helper.Util.formatDateTime,dataIndex:"reservationdate",flex:5},{header:t("releasedate"),renderer:Helper.Util.formatDateTime,dataIndex:"releasedate",flex:5}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["diduselist"],["component","box","container","panel","tablepanel","gridpanel","grid","diduselist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,diduselist:true},["widget.diduselist"],0,[MBilling.view.didUse,"List"],0));(Ext.cmd.derive("MBilling.view.didUse.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,readOnly:true},{xtype:"didcombo",readOnly:true},{xtype:"datefield",name:"reservationdate",fieldLabel:t("reservationdate"),format:"Y-m-d H:i:s"}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["diduseform"],["component","box","container","panel","form","diduseform"],{component:true,box:true,container:true,panel:true,form:true,diduseform:true},["widget.diduseform"],0,[MBilling.view.didUse,"Form"],0));(Ext.cmd.derive("MBilling.view.dashboard.Module",Ext.panel.Panel,{autoShow:true,header:false,initComponent:function(){var b=this;width=window.isTablet?Ext.Element.getViewportWidth()-240:Ext.Element.getViewportWidth()-220;showDid=showBuy=false;if(!App.user.isAdmin){Ext.each(App.user.menu,function(a){if(!Ext.isEmpty(a.rows)){Ext.each(a.rows,function(d){if(d.module=="didbuy"){showDid=true}if(d.module=="buycredit"){showBuy=true}},b)}},b)}widthView=Ext.Element.getViewportWidth()-430;heightView=Ext.Element.getViewportHeight()-137;heightViewFace=heightView+23;facebookhtml='
';if(!App.user.isAdmin&&App.user.social_media_network.length>10){facebookhtml='
'}if(window.customDashboard&&!App.user.isAdmin){b.items=[{header:false,bodyPadding:0,style:"background-color:transparent;",bodyStyle:"background-color:transparent !important;",html:'
',collapseDirection:"bottom",collapsible:true,autoScroll:true,height:Ext.Element.getViewportHeight()}]}else{b.items=[{width:!window.isDesktop?width:"NULL",header:false,xtype:"dashboard",listeners:{activate:"setRunnerInfoSystem"},glyph:icons.home,title:t("Home"),stateful:false,items:[{columnWidth:App.user.isAdmin?1/2:1,items:[{title:t("callonline"),items:{xtype:"callonlinelist2"},hidden:window.isTablet||!App.user.isAdmin,height:App.user.isClient?250:300},{title:t("Simultaneous Call"),items:{xtype:"callonlinechartchart"},hidden:window.isTablet||!App.user.isAdmin,iconCls:"icon-chart-column",glyph:undefined}]},{hidden:App.user.isAdmin,columnWidth:App.user.isClient?1/2:1,items:[{title:t("BuyCredit"),items:{xtype:"buycreditmodule"},height:window.isTablet?250:170,hidden:!showBuy}]},{hidden:App.user.isAdmin,columnWidth:1/2,items:[{title:t("Buy")+" "+t("did"),items:{xtype:"didbuymodule"},height:window.isTablet?250:170,hidden:!showDid||!App.user.isClient},{iconCls:"icon-info",title:t("NEWS"),bodyPadding:0,style:"background-color:transparent;",bodyStyle:"background-color:transparent !important;",hidden:App.user.isAdmin||App.user.social_media_network.length<=10,html:facebookhtml,collapseDirection:"bottom",collapsible:true,autoScroll:true,height:300}]},{columnWidth:1/2,items:[{iconCls:"icon-info",title:t("NEWS"),bodyPadding:0,style:"background-color:transparent;",bodyStyle:"background-color:transparent !important;",hidden:!App.user.isAdmin||window.isTablet||window.isTablets||App.user.l.slice(4,7)=="syn",html:facebookhtml,collapseDirection:"bottom",collapsible:true,autoScroll:true,height:300},{title:t("Refill Summary"),iconCls:"icon-chart-column",glyph:undefined,items:{xtype:"refillchart"},hidden:!App.user.isAdmin||window.isTablet}]}]}]}Ext.panel.Panel.prototype.initComponent.apply(this,arguments)}},0,["dashboardmodule"],["component","box","container","panel","dashboardmodule"],{component:true,box:true,container:true,panel:true,dashboardmodule:true},["widget.dashboardmodule"],0,[MBilling.view.dashboard,"Module"],0));(Ext.cmd.derive("MBilling.view.dashboardQueue.Module",Ext.panel.Panel,{autoShow:true,header:false,initComponent:function(){var b=this;b.items=[{width:!window.isDesktop?width:"NULL",header:false,xtype:"dashboard",listeners:{activate:"setRunnerInfoSystem"},glyph:icons.home,title:t("Home"),stateful:false,items:[{columnWidth:1/2,items:[{title:t("Queue Monitor"),items:{xtype:"queuedashboardlist"},height:window.heightView}]},{columnWidth:1/2,items:[{title:t("Agent Monitor"),iconCls:"icon-chart-column",glyph:undefined,items:{xtype:"queuememberdashboardlist"},height:window.heightView}]}]}];Ext.panel.Panel.prototype.initComponent.apply(this,arguments)}},0,["dashboardqueuemodule"],["component","box","container","panel","dashboardqueuemodule"],{component:true,box:true,container:true,panel:true,dashboardqueuemodule:true},["widget.dashboardqueuemodule"],0,[MBilling.view.dashboardQueue,"Module"],0));(Ext.cmd.derive("MBilling.view.ivr.Controller",Ext.ux.app.ViewController,{isSubmitForm:true,init:function(){var b=this;b.control({typedestinationcombo:{select:b.onSelectMethod}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectMethod:function(c,d){this.showFieldsRelated(d.getData().showFields)},showFieldsRelated:function(l){var m=this,n=m.formPanel.getForm(),j=m.formPanel.getForm().getFields(),g=Ext.get(Ext.Element.getActiveElement()).component,o=g.name.substr(-2);m.onSetVisibleFiel(g,n,o,g.value)},onSetVisibleFiel:function(f,j,e,g){if(f.value=="undefined"){f.setValue("undefined")}if(f.name.match("^type_10")){j.findField("id_queue_10").setVisible(g.match("^queue"));j.findField("id_sip_10").setVisible(g.match("^sip"));j.findField("id_ivr_10").setVisible(g.match("^ivr"));j.findField("extension_10").setVisible(g.match("^group|^number|^custom"))}else{if(f.name.match("^type_[0-9]")){j.findField("id_queue"+e).setVisible(g.match("^queue"));j.findField("id_sip"+e).setVisible(g.match("^sip"));j.findField("id_ivr"+e).setVisible(g.match("^ivr"));j.findField("extension"+e).setVisible(g.match("^group|^number|^custom"))}else{if(f.name.match("^type_out_10")){j.findField("id_queue_out_10").setVisible(g.match("^queue"));j.findField("id_ivr_out_10").setVisible(g.match("^ivr"));j.findField("id_sip_out_10").setVisible(g.match("^sip"));j.findField("extension_out_10").setVisible(g.match("^group|^number|^custom"))}else{j.findField("id_queue_out"+e).setVisible(g.match("^queue"));j.findField("id_sip_out"+e).setVisible(g.match("^sip"));j.findField("id_ivr_out"+e).setVisible(g.match("^ivr"));j.findField("extension_out"+e).setVisible(g.match("^group|^number|^custom"))}}}},onEdit:function(){var g=this,j=g.formPanel.getForm(),f=g.list.getSelectionModel().getSelection()[0];for(var e=0;e<=10;e++){fieldValue=f.getData()["type_"+e];fieldValueOut=f.getData()["type_out_"+e];if(fieldValue=="ivr"){j.findField("id_ivr_"+e).setVisible(true);j.findField("id_sip_"+e).setVisible(false);j.findField("id_queue_"+e).setVisible(false);j.findField("extension_"+e).setVisible(false)}else{if(fieldValue=="sip"){j.findField("id_sip_"+e).setVisible(true);j.findField("id_ivr_"+e).setVisible(false);j.findField("id_queue_"+e).setVisible(false);j.findField("extension_"+e).setVisible(false)}else{if(fieldValue=="queue"){j.findField("id_queue_"+e).setVisible(true);j.findField("id_sip_"+e).setVisible(false);j.findField("id_ivr_"+e).setVisible(false);j.findField("extension_"+e).setVisible(false)}else{if(fieldValue.match("custom|number|group")){j.findField("extension_"+e).setVisible(true);j.findField("id_ivr_"+e).setVisible(false);j.findField("id_sip_"+e).setVisible(false);j.findField("id_queue_"+e).setVisible(false)}else{j.findField("id_queue_"+e).setVisible(false);j.findField("id_sip_"+e).setVisible(false);j.findField("id_ivr_"+e).setVisible(false);j.findField("extension_"+e).setVisible(false)}}}}if(fieldValueOut=="ivr"){j.findField("id_ivr_out_"+e).setVisible(true);j.findField("id_sip_out_"+e).setVisible(false);j.findField("id_queue_out_"+e).setVisible(false);j.findField("extension_out_"+e).setVisible(false)}else{if(fieldValueOut=="sip"){j.findField("id_sip_out_"+e).setVisible(true);j.findField("id_ivr_out_"+e).setVisible(false);j.findField("id_queue_out_"+e).setVisible(false);j.findField("extension_out_"+e).setVisible(false)}else{if(fieldValueOut=="queue"){j.findField("id_queue_out_"+e).setVisible(true);j.findField("id_sip_out_"+e).setVisible(false);j.findField("id_ivr_out_"+e).setVisible(false);j.findField("extension_out_"+e).setVisible(false)}else{if(fieldValueOut.match("custom|number|group")){j.findField("extension_out_"+e).setVisible(true);j.findField("id_ivr_out_"+e).setVisible(false);j.findField("id_sip_out_"+e).setVisible(false);j.findField("id_queue_out_"+e).setVisible(false)}else{j.findField("id_queue_out_"+e).setVisible(false);j.findField("id_sip_out_"+e).setVisible(false);j.findField("id_ivr_out_"+e).setVisible(false);j.findField("extension_out_"+e).setVisible(false)}}}}}Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)},onNew:function(){var g=this,j=g.formPanel.getForm(),f=g.list.getSelectionModel().getSelection()[0];for(var e=0;e<=10;e++){j.findField("id_ivr_"+e).setVisible(false);j.findField("id_sip_"+e).setVisible(false);j.findField("id_queue_"+e).setVisible(false);j.findField("id_ivr_out_"+e).setVisible(false);j.findField("id_sip_out_"+e).setVisible(false);j.findField("id_queue_out_"+e).setVisible(false)}Ext.ux.app.ViewController.prototype.onNew.apply(this,arguments)}},0,0,0,0,["controller.ivr"],0,[MBilling.view.ivr,"Controller"],0));(Ext.cmd.derive("MBilling.view.ivr.Module",Ext.ux.panel.Module,{controller:"ivr"},0,["ivrmodule"],["component","box","container","uxpanelmodule","ivrmodule"],{component:true,box:true,container:true,uxpanelmodule:true,ivrmodule:true},["widget.ivrmodule"],0,[MBilling.view.ivr,"Module"],0));(Ext.cmd.derive("MBilling.view.ivr.List",Ext.ux.grid.Panel,{store:"Ivr",initComponent:function(){var b=this;b.allowPrint=false;b.buttonCsv=false;b.columns=b.columns||[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("name"),dataIndex:"name",flex:5},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["ivrlist"],["component","box","container","panel","tablepanel","gridpanel","grid","ivrlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,ivrlist:true},["widget.ivrlist"],0,[MBilling.view.ivr,"List"],0));(Ext.cmd.derive("MBilling.view.ivr.Form",Ext.ux.form.Panel,{bodyPadding:0,fileUpload:true,initComponent:function(){var b=this;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{plugins:"markallowblank",allowBlank:false,anchor:"100%",labelAlign:"right"}},items:[{title:t("general"),items:[{name:"name",fieldLabel:t("name")},{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"monFriStart",fieldLabel:t("monFriStart"),value:"09:00",maxLength:5,minLength:5},{name:"monFriStop",fieldLabel:t("monFriStop"),value:"18:00",maxLength:5,minLength:5},{name:"satStart",fieldLabel:t("satStart"),value:"09:00",maxLength:5,minLength:5},{name:"satStop",fieldLabel:t("satStop"),value:"12:00",maxLength:5,minLength:5},{name:"sunStart",fieldLabel:t("sunStart"),value:"09:00",maxLength:5,minLength:5},{name:"sunStop",fieldLabel:t("sunStop"),value:"12:00",maxLength:5,minLength:5},{xtype:"uploadfield",fieldLabel:t("workaudio"),emptyText:"Select an wav or gsm File",allowBlank:true,name:"workaudio",labelWidth:120,extAllowed:["wav","gsm"]},{xtype:"uploadfield",fieldLabel:t("noworkaudio"),emptyText:"Select an wav or gsm File",allowBlank:true,labelWidth:120,name:"noworkaudio",extAllowed:["wav","gsm"]}]},{title:t("options")+" "+t("work"),itemId:"option",defaults:{xtype:"fieldcontainer",layout:"hbox",plugins:"markallowblank",allowBlank:true,anchor:"100%",labelWidth:100,defaults:{hideLabel:true,hidden:true,flex:5,startX:100,allowBlank:true,ownerForm:b}},items:[{xtype:"menuseparator",width:"100%"},{labelStyle:"font-weight:bold",xtype:"displayfield",value:''+t("Select the destination to send call when caller press any digits.")+"",allowBlank:true},{xtype:"menuseparator",width:"100%"},{fieldLabel:t("option")+" 0",items:[{name:"type_0",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_0",displayField:"id_ivr_0_name"},{xtype:"queuelookup",name:"id_queue_0",displayField:"id_queue_0_name"},{xtype:"siplookup",name:"id_sip_0",displayField:"id_sip_0_name"},{xtype:"textfield",name:"extension_0"}]},{fieldLabel:t("option")+" 1",items:[{name:"type_1",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_1",displayField:"id_ivr_1_name"},{xtype:"queuelookup",name:"id_queue_1",displayField:"id_queue_1_name"},{xtype:"siplookup",name:"id_sip_1",displayField:"id_sip_1_name"},{xtype:"textfield",name:"extension_1"}]},{fieldLabel:t("option")+" 2",items:[{name:"type_2",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_2",displayField:"id_ivr_2_name"},{xtype:"queuelookup",name:"id_queue_2",displayField:"id_queue_2_name"},{xtype:"siplookup",name:"id_sip_2",displayField:"id_sip_2_name"},{xtype:"textfield",name:"extension_2"}]},{fieldLabel:t("option")+" 3",items:[{name:"type_3",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_3",displayField:"id_ivr_3_name"},{xtype:"queuelookup",name:"id_queue_3",displayField:"id_queue_3_name"},{xtype:"siplookup",name:"id_sip_3",displayField:"id_sip_3_name"},{xtype:"textfield",name:"extension_3"}]},{fieldLabel:t("option")+" 4",items:[{name:"type_4",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_4",displayField:"id_ivr_4_name"},{xtype:"queuelookup",name:"id_queue_4",displayField:"id_queue_4_name"},{xtype:"siplookup",name:"id_sip_4",displayField:"id_sip_4_name"},{xtype:"textfield",name:"extension_4"}]},{fieldLabel:t("option")+" 5",items:[{name:"type_5",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_5",displayField:"id_ivr_5_name"},{xtype:"queuelookup",name:"id_queue_5",displayField:"id_queue_5_name"},{xtype:"siplookup",name:"id_sip_5",displayField:"id_sip_5_name"},{xtype:"textfield",name:"extension_5"}]},{fieldLabel:t("option")+" 6",items:[{name:"type_6",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_6",displayField:"id_ivr_6_name"},{xtype:"queuelookup",name:"id_queue_6",displayField:"id_queue_6_name"},{xtype:"siplookup",name:"id_sip_6",displayField:"id_sip_6_name"},{xtype:"textfield",name:"extension_6"}]},{fieldLabel:t("option")+" 7",items:[{name:"type_7",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_7",displayField:"id_ivr_7_name"},{xtype:"queuelookup",name:"id_queue_7",displayField:"id_queue_7_name"},{xtype:"siplookup",name:"id_sip_7",displayField:"id_sip_7_name"},{xtype:"textfield",name:"extension_7"}]},{fieldLabel:t("option")+" 8",items:[{name:"type_8",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_8",displayField:"id_ivr_8_name"},{xtype:"queuelookup",name:"id_queue_8",displayField:"id_queue_8_name"},{xtype:"siplookup",name:"id_sip_8",displayField:"id_sip_8_name"},{xtype:"textfield",name:"extension_8"}]},{fieldLabel:t("option")+" 9",items:[{name:"type_9",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_9",displayField:"id_ivr_9_name"},{xtype:"queuelookup",name:"id_queue_9",displayField:"id_queue_9_name"},{xtype:"siplookup",name:"id_sip_9",displayField:"id_sip_9_name"},{xtype:"textfield",name:"extension_9"}]},{fieldLabel:t("option")+" default",items:[{name:"type_10",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_10",displayField:"id_ivr_10_name"},{xtype:"queuelookup",name:"id_queue_10",displayField:"id_queue_10_name"},{xtype:"siplookup",name:"id_sip_10",displayField:"id_sip_10_name"},{xtype:"textfield",name:"extension_10"}]},{fieldLabel:t("Direct extension"),hidden:!window.didChannelLimit,name:"direct_extension",xtype:"noyescombo"}]},{title:t("options")+" "+t("not")+" "+t("work"),itemId:"optionOut",defaults:{xtype:"fieldcontainer",layout:"hbox",plugins:"markallowblank",allowBlank:true,anchor:"100%",labelWidth:100,defaults:{hideLabel:true,hidden:true,flex:5,startX:100,allowBlank:true,ownerForm:b}},items:[{xtype:"menuseparator",width:"100%"},{labelStyle:"font-weight:bold",xtype:"displayfield",value:''+t("Select the destination to send call when caller press any digits.")+"",allowBlank:true},{xtype:"menuseparator",width:"100%"},{fieldLabel:t("option")+" 0",items:[{name:"type_out_0",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_0",displayField:"id_ivr_out_0_name"},{xtype:"queuelookup",name:"id_queue_out_0",displayField:"id_queue_out_0_name"},{xtype:"siplookup",name:"id_sip_out_0",displayField:"id_sip_out_0_name"},{xtype:"textfield",name:"extension_out_0"}]},{fieldLabel:t("option")+" 1",items:[{name:"type_out_1",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_1",displayField:"id_ivr_out_1_name"},{xtype:"queuelookup",name:"id_queue_out_1",displayField:"id_queue_out_1_name"},{xtype:"siplookup",name:"id_sip_out_1",displayField:"id_sip_out_1_name"},{xtype:"textfield",name:"extension_out_1"}]},{fieldLabel:t("option")+" 2",items:[{name:"type_out_2",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_2",displayField:"id_ivr_out_2_name"},{xtype:"queuelookup",name:"id_queue_out_2",displayField:"id_queue_out_2_name"},{xtype:"siplookup",name:"id_sip_out_2",displayField:"id_sip_out_2_name"},{xtype:"textfield",name:"extension_out_2"}]},{fieldLabel:t("option")+" 3",items:[{name:"type_out_3",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_3",displayField:"id_ivr_out_3_name"},{xtype:"queuelookup",name:"id_queue_out_3",displayField:"id_queue_out_3_name"},{xtype:"siplookup",name:"id_sip_out_3",displayField:"id_sip_out_3_name"},{xtype:"textfield",name:"extension_out_3"}]},{fieldLabel:t("option")+" 4",items:[{name:"type_out_4",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_4",displayField:"id_ivr_out_4_name"},{xtype:"queuelookup",name:"id_queue_out_4",displayField:"id_queue_out_4_name"},{xtype:"siplookup",name:"id_sip_out_4",displayField:"id_sip_out_4_name"},{xtype:"textfield",name:"extension_out_4"}]},{fieldLabel:t("option")+" 5",items:[{name:"type_out_5",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_5",displayField:"id_ivr_out_5_name"},{xtype:"queuelookup",name:"id_queue_out_5",displayField:"id_queue_out_5_name"},{xtype:"siplookup",name:"id_sip_out_5",displayField:"id_sip_out_5_name"},{xtype:"textfield",name:"extension_out_5"}]},{fieldLabel:t("option")+" 6",items:[{name:"type_out_6",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_6",displayField:"id_ivr_out_6_name"},{xtype:"queuelookup",name:"id_queue_out_6",displayField:"id_queue_out_6_name"},{xtype:"siplookup",name:"id_sip_out_6",displayField:"id_sip_out_6_name"},{xtype:"textfield",name:"extension_out_6"}]},{fieldLabel:t("option")+" 7",items:[{name:"type_out_7",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_7",displayField:"id_ivr_out_7_name"},{xtype:"queuelookup",name:"id_queue_out_7",displayField:"id_queue_out_7_name"},{xtype:"siplookup",name:"id_sip_out_7",displayField:"id_sip_out_7_name"},{xtype:"textfield",name:"extension_out_7"}]},{fieldLabel:t("option")+" 8",items:[{name:"type_out_8",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_8",displayField:"id_ivr_out_8_name"},{xtype:"queuelookup",name:"id_queue_out_8",displayField:"id_queue_out_8_name"},{xtype:"siplookup",name:"id_sip_out_8",displayField:"id_sip_out_8_name"},{xtype:"textfield",name:"extension_out_8"}]},{fieldLabel:t("option")+" 9",items:[{name:"type_out_9",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_9",displayField:"id_ivr_out_9_name"},{xtype:"queuelookup",name:"id_queue_out_9",displayField:"id_queue_out_9_name"},{xtype:"siplookup",name:"id_sip_out_9",displayField:"id_sip_out_9_name"},{xtype:"textfield",name:"extension_out_9"}]},{fieldLabel:t("option")+" default",items:[{name:"type_out_10",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_10",displayField:"id_ivr_out_10_name"},{xtype:"queuelookup",name:"id_queue_out_10",displayField:"id_queue_out_10_name"},{xtype:"siplookup",name:"id_sip_out_10",displayField:"id_sip_out_10_name"},{xtype:"textfield",name:"extension_out_10"}]}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["ivrform"],["component","box","container","panel","form","ivrform"],{component:true,box:true,container:true,panel:true,form:true,ivrform:true},["widget.ivrform"],0,[MBilling.view.ivr,"Form"],0));(Ext.cmd.derive("MBilling.view.ivr.Lookup",Ext.ux.form.field.Lookup,{name:"id_ivr",fieldLabel:t("Ivr"),displayField:"idIvrname",displayFieldList:"name",gridConfig:{xtype:"ivrlist",fieldSearch:"name",columns:[{header:t("name"),dataIndex:"name",flex:5},{header:t("user"),dataIndex:"idUsernumber",filter:{type:"string",field:"idUser.username"},flex:4}]}},0,["ivrlookup"],["component","box","container","fieldcontainer","ivrlookup"],{component:true,box:true,container:true,fieldcontainer:true,ivrlookup:true},["widget.ivrlookup"],0,[MBilling.view.ivr,"Lookup"],0));(Ext.cmd.derive("MBilling.view.queue.Controller",Ext.ux.app.ViewController,{isSubmitForm:true,init:function(){var b=this;b.control({"combobox[name=ring_or_moh]":{select:b.onSelectringOrMOH}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectringOrMOH:function(c,d){me=this,form=me.formPanel.getForm();form.findField("musiconhold").setVisible(d.data.field1=="moh")},onNew:function(){var b=this;b.formPanel.getForm().findField("musiconhold").setVisible(true);Ext.ux.app.ViewController.prototype.onNew.apply(this,arguments)},onEdit:function(){var b=this;Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments);ringOrMoh=b.formPanel.getForm().findField("ring_or_moh").getValue();b.formPanel.getForm().findField("musiconhold").setVisible(ringOrMoh=="moh")},onResetQueueStats:function(m){var j=this,f=j.list.getSelectionModel().getSelection()[0],l=Ext.encode(j.list.filters.getFilterData()),g=[];if(f){Ext.each(j.list.getSelectionModel().getSelection(),function(a){g.push(a.get(j.idProperty))});Ext.Ajax.request({url:"index.php/queue/resetQueueStats",params:{ids:Ext.encode(g),filter:l},scope:j,success:function(b){b=Ext.decode(b.responseText);if(b[j.nameSuccessRequest]){Ext.ux.Alert.alert(j.titleSuccess,b.msg,"success")}else{var a=Helper.Util.convertErrorsJsonToString(b[j.nameMsgRequest]);Ext.ux.Alert.alert(j.titleError,a,"notification")}}})}else{Ext.ux.Alert.alert(j.titleError,t("Please select one or more queue"),"notification")}},onDeleteMusic:function(e){var f=this,d=f.list.getSelectionModel().getSelection()[0];if(f.list.getSelectionModel().getSelection().length==1){Ext.Ajax.request({url:"index.php/queue/deleteMusicOnHold",params:{id_queue:d.get("id")},scope:f,success:function(a){a=Ext.decode(a.responseText);if(a[f.nameSuccessRequest]){Ext.ux.Alert.alert(f.titleSuccess,a[f.nameMsgRequest],"success")}else{Ext.ux.Alert.alert(f.titleError,a[f.nameMsgRequest],"error")}}})}else{Ext.ux.Alert.alert(f.titleError,"Please Select only a record","notification")}}},0,0,0,0,["controller.queue"],0,[MBilling.view.queue,"Controller"],0));(Ext.cmd.derive("MBilling.view.queue.Combo",Ext.form.field.ComboBox,{fieldLabel:t("status"),value:"ringall",forceSelection:true,editable:false,store:[["ringall",t("Ringall")+" - "+t("ring all available channels until one answers")],["rrmemory",t("Rrmemory")+" - "+t("round robin with memory, remember where we left off last ring pass")],["leastrecent",t("Leastrecent")+" - "+t("ring interface which was least recently called by this queue")],["fewestcalls",t("Fewestcalls")+" - "+t("ring the one with fewest completed calls from this queue")],["random",t("Random")+" -"+t("ring random interface")],["linear",t("Linear")+" - "+t("Rings interfaces in the order they are listed in the configuration file. Dynamic members will be rung in the order in which they were added")],["wrandom",t("Wrandom")+" -"+t("Rings a random interface, but uses the agent's penalty as a weight")]]},0,["queuestrategycombo"],["component","box","field","textfield","pickerfield","combobox","combo","queuestrategycombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,queuestrategycombo:true},["widget.queuestrategycombo"],0,[MBilling.view.queue,"Combo"],0));(Ext.cmd.derive("MBilling.view.queue.Module",Ext.ux.panel.Module,{controller:"queue"},0,["queuemodule"],["component","box","container","uxpanelmodule","queuemodule"],{component:true,box:true,container:true,uxpanelmodule:true,queuemodule:true},["widget.queuemodule"],0,[MBilling.view.queue,"Module"],0));(Ext.cmd.derive("MBilling.view.queue.List",Ext.ux.grid.Panel,{store:"Queue",initComponent:function(){var b=this;b.buttonCsv=false;b.allowPrint=false;b.buttonUpdateLot=false;b.extraButtons=[{text:t("Reset Queue Stats"),iconCls:"call",handler:"onResetQueueStats",disabled:false,hidden:!App.user.isAdmin},{text:t("Delete Musiconhold"),iconCls:"call",handler:"onDeleteMusic",disabled:false,hidden:!App.user.isAdmin}];b.columns=b.columns||[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("name"),dataIndex:"name",flex:4},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("Strategy"),dataIndex:"strategy",flex:4},{header:t("Talk Time"),dataIndex:"var_talktime",flex:3},{header:t("Total Calls"),dataIndex:"var_totalCalls",flex:3},{header:t("Answered"),dataIndex:"var_answeredCalls",flex:3}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["queuelist"],["component","box","container","panel","tablepanel","gridpanel","grid","queuelist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,queuelist:true},["widget.queuelist"],0,[MBilling.view.queue,"List"],0));(Ext.cmd.derive("MBilling.view.queue.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["id_user","name"],fileUpload:true,initComponent:function(){var b=this;b.labelWidthFields=160;b.items=[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"name",fieldLabel:t("name")},{xtype:"languagecombo",name:"language",value:App.user.language=="pt_BR"?"br":App.user.language,fieldLabel:t("language")},{xtype:"queuestrategycombo",name:"strategy",fieldLabel:t("Strategy")},{xtype:"yesnostringcombo",name:"ringinuse",fieldLabel:t("Ringinuse")},{xtype:"numberfield",name:"timeout",fieldLabel:t("Ring Agent per"),value:30},{xtype:"numberfield",name:"retry",fieldLabel:t("Retry other agent"),value:1},{xtype:"numberfield",name:"wrapuptime",fieldLabel:t("Time next calls"),value:1},{xtype:"numberfield",name:"weight",fieldLabel:t("Weigh"),value:0},{name:"periodic-announce",fieldLabel:t("Periodic announce"),value:"queue-periodic-announce"},{xtype:"numberfield",name:"periodic-announce-frequency",fieldLabel:t("Periodic frequency"),value:30},{xtype:"yesnostringcombo",name:"announce-position",fieldLabel:t("Announce position")},{xtype:"yesnostringcombo",name:"announce-holdtime",fieldLabel:t("Announce Holdtime")},{xtype:"numberfield",name:"announce-frequency",fieldLabel:t("Announce Frequency"),value:45},{xtype:"combobox",forceSelection:true,editable:false,value:"yes",store:[["no",t("No")],["yes",t("Yes")],["unavailable,invalid,unknown",t("unavailable,invalid,unknown")],["penalty,paused,invalid,unavailable",t("penalty,paused,invalid,unavailable")]],name:"joinempty",fieldLabel:t("Join empty")},{xtype:"combobox",forceSelection:true,editable:false,value:"no",store:[["no",t("No")],["yes",t("Yes")],["unavailable,invalid,unknown",t("unavailable,invalid,unknown")],["penalty,paused,invalid,unavailable",t("penalty,paused,invalid,unavailable")]],fieldLabel:t("Leave when empty"),name:"leavewhenempty"},{xtype:"combobox",forceSelection:true,editable:false,value:"moh",store:[["moh",t("MOH")],["ring",t("Ring")]],fieldLabel:t("Ring or playing MOH"),name:"ring_or_moh"},{xtype:"uploadfield",fieldLabel:t("Audio")+" "+t("musiconhold"),emptyText:t("Select an wav mono 8khz or gsm File"),allowBlank:true,name:"musiconhold",extAllowed:["wav","gsm"]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["queueform"],["component","box","container","panel","form","queueform"],{component:true,box:true,container:true,panel:true,form:true,queueform:true},["widget.queueform"],0,[MBilling.view.queue,"Form"],0));(Ext.cmd.derive("MBilling.view.queue.Lookup",Ext.ux.form.field.Lookup,{name:"id_queue",fieldLabel:t("Queue"),displayField:"idQueuename",displayFieldList:"name",gridConfig:{xtype:"queuelist",fieldSearch:"name",columns:[{header:t("name"),dataIndex:"name",flex:2}]}},0,["queuelookup"],["component","box","container","fieldcontainer","queuelookup"],{component:true,box:true,container:true,fieldcontainer:true,queuelookup:true},["widget.queuelookup"],0,[MBilling.view.queue,"Lookup"],0));(Ext.cmd.derive("MBilling.view.queue.ListDashboard",Ext.ux.grid.Panel,{store:"QueueDashBoard",refreshTime:5,selType:"rowmodel",initComponent:function(){var b=this;b.refreshTime=(localStorage&&localStorage.getItem("queuerefresh"))||b.refreshTime;b.extraButtons=[{text:t("Spy")+" "+t("call"),iconCls:"call",handler:function(a){module=b.getView();console.log(module.panel.items.items[0].getSelectionModel().getSelection());Ext.widget("callonlinespycall",{title:module.titleModule,list:module.panel.items.items[0]})},width:130,disabled:false,hidden:!window.multSpy},{xtype:"numberfield",field:"jmlhBrg",fieldLabel:t("Refresh Time"),editable:false,minValue:5,labelWidth:90,width:150,selectOnFocus:true,allowDecimals:true,decimalPrecision:2,value:b.refreshTime,listeners:{change:function(a){if(a.value>0){b.refreshTime=a.value;localStorage.setItem("queuerefresh",a.value)}}}}];b.columns=[{header:t("Channel"),hidden:true,dataIndex:"channel",flex:3},{header:t("Queue"),dataIndex:"queue_name",flex:3},{header:t("Agent"),dataIndex:"agentName",flex:3},{header:t("status"),dataIndex:"status",renderer:Helper.Util.formatQueueState,flex:4},{header:t("CallerID"),dataIndex:"callerId",flex:4},{header:t("Duration"),dataIndex:"duration",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Wait Time"),dataIndex:"holdtime",renderer:Helper.Util.formatsecondsToTime,flex:3}];b.sessionLoad=Ext.create("Ext.util.DelayedTask",function(){b.store.load()},b);Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments);b.store.on("load",b.onLoadStore,b)},onLoadStore:function(){var b=this;b.onDeactivateModule();b.onActivateModule()},onRender:function(){var b=this;if(Ext.isObject(b.module)){b.module.on("activate",b.onActivateModule,b);b.module.on("deactivate",b.onDeactivateModule,b);b.module.on("close",b.onCloseModule,b)}Ext.ux.grid.Panel.prototype.onRender.apply(this,arguments)},onActivateModule:function(){this.sessionLoad&&this.sessionLoad.delay(this.refreshTime*1000)},onDeactivateModule:function(){this.sessionLoad&&this.sessionLoad.cancel()},onCloseModule:function(){this.onDeactivateModule();this.sessionLoad=null}},0,["queuedashboardlist"],["component","box","container","panel","tablepanel","gridpanel","grid","queuedashboardlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,queuedashboardlist:true},["widget.queuedashboardlist"],0,[MBilling.view.queue,"ListDashboard"],0));(Ext.cmd.derive("MBilling.view.queueMember.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.queuemember"],0,[MBilling.view.queueMember,"Controller"],0));(Ext.cmd.derive("MBilling.view.queueMember.Module",Ext.ux.panel.Module,{controller:"queuemember"},0,["queuemembermodule"],["component","box","container","uxpanelmodule","queuemembermodule"],{component:true,box:true,container:true,uxpanelmodule:true,queuemembermodule:true},["widget.queuemembermodule"],0,[MBilling.view.queueMember,"Module"],0));(Ext.cmd.derive("MBilling.view.queueMember.List",Ext.ux.grid.Panel,{store:"QueueMember",initComponent:function(){var b=this;b.columns=[{header:t("Uniqueid"),dataIndex:"uniqueid",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("destination"),dataIndex:"interface",flex:4},{header:t("queues"),dataIndex:"queue_name",flex:4},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("paused"),dataIndex:"paused",renderer:Helper.Util.formattyyesno,filter:{type:"list",options:[[0,t("no")],[1,t("yes")]]},flex:2}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["queuememberlist"],["component","box","container","panel","tablepanel","gridpanel","grid","queuememberlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,queuememberlist:true},["widget.queuememberlist"],0,[MBilling.view.queueMember,"List"],0));(Ext.cmd.derive("MBilling.view.queueMember.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["id_user","queue_name"],initComponent:function(){var b=this;b.items=[{xtype:"queuelookup",ownerForm:b,displayField:"queue_name",name:"queue_name",hidden:App.user.isClient,allowBlank:App.user.isClient},{xtype:"siplookup",ownerForm:b,name:"interface",displayField:"interface"},{xtype:"noyescombo",name:"paused",fieldLabel:t("paused"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["queuememberform"],["component","box","container","panel","form","queuememberform"],{component:true,box:true,container:true,panel:true,form:true,queuememberform:true},["widget.queuememberform"],0,[MBilling.view.queueMember,"Form"],0));(Ext.cmd.derive("MBilling.view.queueMember.ListDashboard",Ext.ux.grid.Panel,{store:"QueueMemberDashBoard",refreshTime:5,selType:"rowmodel",initComponent:function(){var b=this;b.refreshTime=(localStorage&&localStorage.getItem("queueagentrefresh"))||b.refreshTime;b.extraButtons=[{xtype:"numberfield",field:"jmlhBrg",fieldLabel:t("Refresh Time"),editable:false,minValue:5,labelWidth:90,width:150,selectOnFocus:true,allowDecimals:true,decimalPrecision:2,value:b.refreshTime,listeners:{change:function(a){if(a.value>0){b.refreshTime=a.value;localStorage.setItem("queueagentrefresh",a.value)}}}}];b.columns=[{header:t("Agent"),dataIndex:"agentName",flex:3},{header:t("Queue"),dataIndex:"idQueuename",flex:5},{header:t("Status"),dataIndex:"agentStatus",renderer:Helper.Util.formatQueueAgentState,flex:4},{header:t("Number"),dataIndex:"number",flex:4},{header:t("Calls"),dataIndex:"totalCalls",flex:2},{header:t("Last call"),dataIndex:"last_call",renderer:Helper.Util.formatsecondsToTime,flex:3}];b.sessionLoad=Ext.create("Ext.util.DelayedTask",function(){b.store.load()},b);Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments);if(window.isDesktop){b.store.load()}b.store.on("load",b.onLoadStore,b)},onLoadStore:function(){var b=this;b.onDeactivateModule();b.onActivateModule()},onRender:function(){var b=this;if(Ext.isObject(b.module)){b.module.on("activate",b.onActivateModule,b);b.module.on("deactivate",b.onDeactivateModule,b);b.module.on("close",b.onCloseModule,b)}Ext.ux.grid.Panel.prototype.onRender.apply(this,arguments)},onActivateModule:function(){this.sessionLoad&&this.sessionLoad.delay(this.refreshTime*1000)},onDeactivateModule:function(){this.sessionLoad&&this.sessionLoad.cancel()},onCloseModule:function(){this.onDeactivateModule();this.sessionLoad=null}},0,["queuememberdashboardlist"],["component","box","container","panel","tablepanel","gridpanel","grid","queuememberdashboardlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,queuememberdashboardlist:true},["widget.queuememberdashboardlist"],0,[MBilling.view.queueMember,"ListDashboard"],0));(Ext.cmd.derive("MBilling.view.refill.Controller",Ext.ux.app.ViewController,{aliasChart:"refillchart",onPrint:function(e){var f=this;if(App.user.isClient){var f=this,d=f.list.getSelectionModel().getSelection()[0];if(f.list.getSelectionModel().getSelection().length==1){console.log(d.data.description.indexOf("Send Credit "));if(d.data.description.indexOf("Send Credit ")!==-1){url="index.php/transferToMobile/printRefill/?id="+d.get("id");window.open(url)}else{Ext.ux.app.ViewController.prototype.onPrint.apply(this,arguments)}}else{Ext.ux.app.ViewController.prototype.onPrint.apply(this,arguments)}}else{Ext.ux.app.ViewController.prototype.onPrint.apply(this,arguments)}},onInvoice:function(e){var f=this;var f=this,d=f.list.getSelectionModel().getSelection()[0];if(f.list.getSelectionModel().getSelection().length==1){url="index.php/invoices/printInvoice/?id="+d.get("id");window.open(url)}else{Ext.ux.Alert.alert(f.titleError,t("Not available to multi refill."),"error")}},onSelectionChange:function(f,e){var j=this,g=j.lookupReference("invoice");g&&g.setDisabled(!e.length);Ext.ux.app.ViewController.prototype.onSelectionChange.apply(this,arguments)},onRenderModule:function(){var c=this,d=c.lookupReference("chart");Ext.ux.app.ViewController.prototype.onRenderModule.apply(this,arguments);if(App.user.isAdmin){c.store.on({scope:c,beforeload:function(){d.el&&d.disable()},load:function(a){d.el&&d.enable();c.onSetTotal()}})}else{c.store.on({scope:c,load:function(a){c.onSetTotal()}})}},onChart:function(){var b=this;b.chart=Ext.widget("window",{title:t("charts"),iconCls:"icon-chart-column",layout:"fit",autoShow:true,modal:true,resizable:false,width:window.isThemeNeptune?740:710,items:{xtype:b.aliasChart}});b.chart.down("#tbTextSum").setText(""+t("total")+": "+App.user.currency+" "+b.sumData.sumCredit+"")},onSetTotal:function(c){var d=this;if(!d.store.getData().items[0]){return}d.sumData=d.store.getData().items[0].getData();if(!d.sumData){return}d.lookupReference("tbTextTotal")&&d.lookupReference("tbTextTotal").setText(""+t("Refill Total")+": "+App.user.currency+" "+d.sumData.sumCredit+"")}},0,0,0,0,["controller.refill"],0,[MBilling.view.refill,"Controller"],0));(Ext.cmd.derive("MBilling.view.refill.Module",Ext.ux.panel.Module,{controller:"refill"},0,["refillmodule"],["component","box","container","uxpanelmodule","refillmodule"],{component:true,box:true,container:true,uxpanelmodule:true,refillmodule:true},["widget.refillmodule"],0,[MBilling.view.refill,"Module"],0));(Ext.cmd.derive("MBilling.view.refill.List",Ext.ux.grid.Panel,{store:"Refill",fieldSearch:"idUser.username",initComponent:function(){var b=this;b.buttonsTbar=[{xtype:"tbtext",reference:"tbTextTotal"}];if(App.user.isAdmin&&b.buttonCleanFilter){b.extraButtons=[{text:t("charts"),iconCls:"icon-chart-column",handler:"onChart",reference:"chart",disabled:true},{text:t("Invoice"),glyph:b.glyphPrint,handler:"onInvoice",reference:"invoice",hidden:!window.invoice,disabled:true}]}if(App.user.isClient){b.extraButtons=[{text:t("Invoice"),glyph:b.glyphPrint,handler:"onInvoice",reference:"invoice",hidden:!window.invoice,disabled:true}]}b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:3,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("credit"),dataIndex:"credit",renderer:Helper.Util.formatMoneyDecimal2,flex:2},{header:t("description"),dataIndex:"description",flex:5},{header:t("payment"),dataIndex:"payment",renderer:Helper.Util.formattyyesno,filter:{type:"list",options:[[0,t("no")],[1,t("yes")]]},flex:2},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"date",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["refilllist"],["component","box","container","panel","tablepanel","gridpanel","grid","refilllist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,refilllist:true},["widget.refilllist"],0,[MBilling.view.refill,"List"],0));(Ext.cmd.derive("MBilling.view.refill.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["id_user"],initComponent:function(){var b=this;b.items=[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient},{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,00",name:"credit",fieldLabel:t("credit"),readOnly:App.user.isClient},{xtype:"textareafield",name:"description",fieldLabel:t("description"),readOnly:App.user.isClient},{xtype:"yesnocombo",name:"payment",fieldLabel:t("add")+" "+t("payment"),hidden:App.user.isClient},{name:"invoice_number",fieldLabel:t("Invoice")+" "+t("number"),hidden:!window.invoice,allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["refillform"],["component","box","container","panel","form","refillform"],{component:true,box:true,container:true,panel:true,form:true,refillform:true},["widget.refillform"],0,[MBilling.view.refill,"Form"],0));(Ext.cmd.derive("Ext.ux.panel.Chart",Ext.panel.Panel,{rootData:undefined,positionLegendPie:"bottom",showLegendPie:true,widthTip:200,degressXLabel:0,fontLabel:"15px Arial",textBtnColumn:t("columns"),textBtnLine:t("lines"),textBtnBar:t("bars"),textBtnPie:t("pie"),iconBtnColumn:"icon-chart-column",iconBtnLine:"icon-chart-line",iconBtnBar:"icon-chart-bar",iconBtnPie:"icon-chart-pie",heightChart:400,charts:["column","bar","line","pie"],defaultChart:"column",limitCharLabelTip:25,bbarChart:[],tbarChart:[],minimumAxesY:0,border:false,layout:"card",btnShowColumn:true,btnShowBar:true,btnShowLine:true,btnShowPie:true,btnShowLineHidden:false,btnShowColumnHidden:false,showDownload:true,legend:null,titleText:"",fieldLabel:"",constructor:function(){var b=this;if(Ext.isString(b.store)){b.store=Ext.data.StoreManager.lookup(b.store);b.store.load({scope:b,callback:function(){if(b.store.getData().items[0]){b.sumData=b.store.getData().items[0].getData()}}})}Ext.panel.Panel.prototype.constructor.apply(this,arguments)},initComponent:function(){var s=this,x=s.charts.length,r,o,v,q,w=[],y=[],u=[],p,z;if(s.charts.length===1){s.defaultChart=s.charts[0]}s.fieldValue=Ext.isArray(s.fieldValue)?s.fieldValue:[s.fieldValue];if(s.rootData){p=Ext.getStore(s.store);z=p.model.proxy.reader.rawData;s.store=Ext.create("Ext.data.Store",{fields:Ext.Array.merge(s.fieldValue,s.fieldDescription),data:z&&z[s.rootData],proxy:{type:"memory",reader:{type:"json"}}});s.fieldValue=s.fieldValue[0].name||s.fieldValue[0];s.fieldDescription=s.fieldDescription.name||s.fieldDescription}Ext.each(s.fieldValue,function(a){u.push({type:"line",yField:a,xField:s.fieldDescription,marker:{radius:4},highlight:true,tooltip:{trackMouse:true,width:s.widthTip,renderer:s.rendererPie(s.fieldDescription,s.rendererFieldValue,s.rendererFieldDescription,s.limitCharLabelTip)}})});s.chartColumn={xtype:"cartesian",itemId:"column",height:s.heightChart,width:s.width,store:s.store,insetPadding:{top:s.titleText.length>0?40:10},axes:[{type:"numeric",title:s.labelYLine,position:"left",grid:true,minimum:s.minimumAxesY,renderer:s.rendererFieldValue||s.rendererDefault},{type:"category",title:s.labelXLine,position:"bottom",grid:true,renderer:s.rendererFieldDescription||s.rendererDefault,label:{rotate:{degrees:s.degressXLabel}}}],series:[{type:"bar",axis:"left",yField:s.fieldValue,xField:s.fieldDescription,highlight:true,tooltip:{width:s.widthTip,renderer:s.rendererPie(s.fieldDescription,s.rendererFieldValue,s.rendererFieldDescription,s.limitCharLabelTip)},label:{hidden:s.fieldLabel.length<1,field:s.fieldLabel,display:"insideEnd"}}],sprites:{hidden:s.titleText.length<1,type:"text",text:s.titleText,fontSize:22,width:100,height:30,x:40,y:20}};s.chartBar={xtype:"cartesian",itemId:"bar",height:s.heightChart,width:s.width,store:s.store,flipXY:true,insetPadding:{top:s.titleText.length>0?40:10},axes:[{type:"numeric",title:s.labelYLine,position:"bottom",fields:s.fieldValue,grid:true,minimum:s.minimumAxesY,renderer:s.rendererFieldValue||s.rendererDefault},{type:"category",title:s.labelXLine,position:"left",fields:s.fieldDescription,grid:true,renderer:s.rendererFieldDescription||s.rendererDefault}],series:[{type:"bar",yField:s.fieldValue,xField:s.fieldDescription,highlight:true,tooltip:{width:s.widthTip,renderer:s.rendererPie(s.fieldDescription,s.rendererFieldValue,s.rendererFieldDescription,s.limitCharLabelTip)},label:{hidden:s.fieldLabel.length<1,field:s.fieldLabel,display:"insideEnd"}}],sprites:{hidden:s.titleText.length<1,type:"text",text:s.titleText,fontSize:22,width:100,height:30,x:40,y:20}};s.chartLine={xtype:"cartesian",itemId:"line",height:s.heightChart,width:s.width,store:s.store,legend:s.legend,axes:[{type:"numeric",title:s.labelYLine,position:"left",fields:s.fieldValue,grid:true,minimum:s.minimumAxesY,renderer:s.rendererFieldValue||s.rendererDefault},{type:"category",title:s.labelXLine,position:"bottom",grid:true,fields:s.fieldDescription,renderer:s.rendererFieldDescription||s.rendererDefault}],series:u};s.chartPie={xtype:"polar",itemId:"pie",height:s.heightChart,width:s.width,store:s.store,legend:{position:s.positionLegendPie,renderer:s.rendererFieldDescription},series:[{type:"pie",angleField:s.fieldValue[0],showInLegend:s.showLegendPie,tooltip:{trackMouse:true,width:s.widthTip,renderer:s.rendererPie(s.fieldDescription,s.rendererFieldValue,s.rendererFieldDescription,s.limitCharLabelTip)},highlight:{segment:{margin:20}},label:{field:s.fieldDescription,display:"rotate",contrast:true,font:s.fontLabel,renderer:s.rendererFieldDescription||s.rendererDefault}}]};if(s.btnShowColumn){r={chart:"column",text:s.textBtnColumn,iconCls:s.iconBtnColumn,hidden:s.btnShowColumnHidden}}if(s.btnShowBar){o={chart:"bar",text:s.textBtnBar,iconCls:s.iconBtnBar}}if(s.btnShowLine){v={chart:"line",text:s.textBtnLine,iconCls:s.iconBtnLine,hidden:s.btnShowLineHidden}}if(s.btnShowPie){q={chart:"pie",text:s.textBtnPie,iconCls:s.iconBtnPie}}if(Ext.Array.contains(s.charts,"column")){w.push(s.chartColumn);y.push(r)}if(Ext.Array.contains(s.charts,"bar")){w.push(s.chartBar);y.push(o)}if(Ext.Array.contains(s.charts,"line")){w.push(s.chartLine);y.push(v)}if(Ext.Array.contains(s.charts,"pie")){w.push(s.chartPie);y.push(q)}s.bbarChart.push("->",{xtype:"buttongroup",toggleGroup:"typeChart",defaults:{enableToggle:true,allowDepress:false,toggleGroup:"typeChart",listeners:{scope:s,toggle:s.activeChart}},items:y});s.items=w;if(s.showDownload){s.tbarChart.push("->",{text:t("Download"),glyph:icons.disk,scope:s,handler:s.onDownload})}s.tbar=s.tbarChart;s.bbar=s.bbarChart;Ext.panel.Panel.prototype.initComponent.apply(this,arguments);s.activeItem=s.down("#"+s.defaultChart);s.down("button[chart="+s.defaultChart+"]").pressed=true},onDownload:function(){var b=this;b.getLayout().getActiveItem().download()},activeChart:function(d){var c=this;d.pressed&&c.getLayout().setActiveItem(c.down("#"+d.chart))},rendererPie:function(g,f,e,j){return function(a,o,c){var d=this,n=o.get(g),b=o.get(c.field);n=e?e(n):n;b=f?f(b):b;n=Ext.String.ellipsis(n,j)+": ";title=n+b;a.setHtml(title)}},rendererDefault:function(c,d){return d},rendererLegend:function(b){return t(b)}},1,["chartpanel"],["component","box","container","panel","chartpanel"],{component:true,box:true,container:true,panel:true,chartpanel:true},["widget.chartpanel"],0,[Ext.ux.panel,"Chart"],0));(Ext.cmd.derive("MBilling.view.refill.Chart",Ext.ux.panel.Chart,{controller:"refill",store:"RefillChart",fieldValue:"sumCreditMonth",fieldDescription:"CreditMonth",labelYLine:t("credit"),labelXLine:t("Month"),reference:"refillchart",btnShowColumn:true,btnShowBar:false,btnShowLine:false,btnShowPie:false,btnShowColumnHidden:true,initComponent:function(){var d=this,c;d.rendererFieldValue=Ext.util.Format.numberRenderer("0"),d.tbarChart=[{text:t("Per")+" "+t("Month"),scope:d,handler:"onPerMonth",reference:"btnMonth",disabled:true},{text:t("Per")+" "+t("day"),scope:d,handler:"onPerDay",reference:"btnDay"}];d.bbarChart=[{xtype:"tbtext",itemId:"tbTextSum"}];Ext.ux.panel.Chart.prototype.initComponent.apply(this,arguments)},onPerMonth:function(d){var c=this;c.lookupReference("btnMonth").disable();c.lookupReference("btnDay").enable();c.store.setRemoteFilter(true);c.store.filter("type","month");c.store.load()},onPerDay:function(d){var c=this;c.lookupReference("btnDay").disable();c.lookupReference("btnMonth").enable();c.store.setRemoteFilter(true);c.store.filter("type","day");c.store.load()}},0,["refillchart"],["component","box","container","panel","chartpanel","refillchart"],{component:true,box:true,container:true,panel:true,chartpanel:true,refillchart:true},["widget.refillchart"],0,[MBilling.view.refill,"Chart"],0));(Ext.cmd.derive("MBilling.view.methodPay.Controller",Ext.ux.app.ViewController,{init:function(){var b=this;b.control({methodpaycombo:{select:b.onSelectMethod}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectMethod:function(c,d){showFields=d.getData().showFields.split(",");this.showFieldsRelated(showFields)},showFieldsRelated:function(f){var d=this,e=d.formPanel.getForm().getFields();e.each(function(a){a.setVisible(f.indexOf(a.name)!==-1)})},onEdit:function(){var c=this,d=c.list.getSelectionModel().getSelection()[0];method=d?d.get("payment_method"):"Moip";showFields=c.formPanel.down("methodpaycombo").store.findRecord("payment_method",method).getData().showFields;showFields=showFields.split(",");c.showFieldsRelated(showFields);Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)},onNew:function(){var c=this,d=c.list.getSelectionModel().getSelection()[0];method="Moip";showFields=c.formPanel.down("methodpaycombo").store.findRecord("payment_method",method).getData().showFields;showFields=showFields.split(",");c.showFieldsRelated(showFields);Ext.ux.app.ViewController.prototype.onNew.apply(this,arguments)}},0,0,0,0,["controller.methodpay"],0,[MBilling.view.methodPay,"Controller"],0));(Ext.cmd.derive("MBilling.view.methodPay.Module",Ext.ux.panel.Module,{controller:"methodpay"},0,["methodpaymodule"],["component","box","container","uxpanelmodule","methodpaymodule"],{component:true,box:true,container:true,uxpanelmodule:true,methodpaymodule:true},["widget.methodpaymodule"],0,[MBilling.view.methodPay,"Module"],0));(Ext.cmd.derive("MBilling.view.methodPay.List",Ext.ux.grid.Panel,{store:"MethodPay",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("paymentmethods"),dataIndex:"payment_method",flex:2},{header:t("country"),dataIndex:"country",flex:2},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:2},{header:t("active"),dataIndex:"active",flex:1,comboRelated:"booleancombo",renderer:Helper.Util.formatBooleanActive,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")]]}}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["methodpaylist"],["component","box","container","panel","tablepanel","gridpanel","grid","methodpaylist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,methodpaylist:true},["widget.methodpaylist"],0,[MBilling.view.methodPay,"List"],0));(Ext.cmd.derive("MBilling.view.methodPay.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{xtype:"methodpaycombo",name:"payment_method",valueField:"payment_method",fieldLabel:t("paymentmethods")},{name:"show_name",fieldLabel:t("showName")},{xtype:"userlookup",ownerForm:b,name:"id_user"},{xtype:"paymentcountrycombo",name:"country",fieldLabel:t("country")},{xtype:"booleancombo",name:"active",fieldLabel:t("active")},{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,00",name:"min",value:10,fieldLabel:t("Min amount")},{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,00",name:"max",value:500,fieldLabel:t("Max amount")},{name:"username",fieldLabel:t("Username"),allowBlank:true},{name:"url",fieldLabel:"Url",allowBlank:true},{xtype:"noyescombo",name:"fee",fieldLabel:t("Discount")+" "+t("Fee"),allowBlank:true},{xtype:"paymentbanckcombo",name:"boleto_banco",fieldLabel:t("Bank"),allowBlank:true},{name:"boleto_convenio",fieldLabel:t("numeroconvenio"),allowBlank:true},{name:"boleto_agencia",fieldLabel:t("agencia"),allowBlank:true},{name:"boleto_conta_corrente",fieldLabel:t("contacorrente"),allowBlank:true},{name:"boleto_inicio_nosso_numeroa",fieldLabel:t("Inicio nosso nº"),allowBlank:true},{name:"boleto_carteira",fieldLabel:t("carteira"),allowBlank:true},{name:"boleto_taxa",fieldLabel:t("taxa"),allowBlank:true},{name:"boleto_instrucoes",fieldLabel:t("instructions"),maxLength:"100",allowBlank:true},{name:"boleto_nome_emp",fieldLabel:t("company"),allowBlank:true},{name:"boleto_end_emp",fieldLabel:t("address"),allowBlank:true},{name:"boleto_cidade_emp",fieldLabel:t("city"),allowBlank:true},{name:"boleto_estado_emp",fieldLabel:t("state"),allowBlank:true},{name:"boleto_cpf_emp",fieldLabel:"CNPJ CPF",allowBlank:true},{name:"pagseguro_TOKEN",fieldLabel:"TOKEN",allowBlank:true},{name:"P2P_CustomerSiteID",fieldLabel:t("P2P CustomerSiteID"),allowBlank:true},{name:"P2P_KeyID",fieldLabel:t("P2P KeyID"),allowBlank:true},{name:"P2P_Passphrase",fieldLabel:t("P2P Passphrase"),allowBlank:true},{name:"P2P_RecipientKeyID",fieldLabel:t("P2P RecipientKeyID"),allowBlank:true},{name:"P2P_tax_amount",fieldLabel:t("P2P Tax Amount"),allowBlank:true},{name:"client_id",fieldLabel:t("Client id"),allowBlank:true},{name:"client_secret",fieldLabel:t("Client Secret"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["methodpayform"],["component","box","container","panel","form","methodpayform"],{component:true,box:true,container:true,panel:true,form:true,methodpayform:true},["widget.methodpayform"],0,[MBilling.view.methodPay,"Form"],0));(Ext.cmd.derive("MBilling.view.methodPay.Combo",Ext.form.field.ComboBox,{name:"id_methodpay",fieldLabel:t("methodPay"),displayField:"show_name",valueField:"id",forceSelection:true,editable:false,initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.MethodPay",{proxy:{type:"uxproxy",module:"methodpay",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["methodpaycombo"],["component","box","field","textfield","pickerfield","combobox","combo","methodpaycombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,methodpaycombo:true},["widget.methodpaycombo"],0,[MBilling.view.methodPay,"Combo"],0));(Ext.cmd.derive("MBilling.view.voucher.Controller",Ext.ux.app.ViewController,{onSave:function(){var b=this;Ext.ux.app.ViewController.prototype.onSave.apply(this,arguments);b.formPanel.setLoading(false);b.saveButton.enable();b.store.load()}},0,0,0,0,["controller.voucher"],0,[MBilling.view.voucher,"Controller"],0));(Ext.cmd.derive("MBilling.view.voucher.Module",Ext.ux.panel.Module,{controller:"voucher"},0,["vouchermodule"],["component","box","container","uxpanelmodule","vouchermodule"],{component:true,box:true,container:true,uxpanelmodule:true,vouchermodule:true},["widget.vouchermodule"],0,[MBilling.view.voucher,"Module"],0));(Ext.cmd.derive("MBilling.view.voucher.List",Ext.ux.grid.Panel,{store:"Voucher",initComponent:function(){var b=this;b.buttonCsv=false;b.allowPrint=false;b.buttonUpdateLot=false;b.allowUpdate=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:3,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("credit"),dataIndex:"credit",renderer:Helper.Util.formatMoneyDecimal,filter:{type:"int",field:"t.credit"},flex:3},{header:t("voucher"),dataIndex:"voucher",flex:5},{header:t("description"),dataIndex:"tag",flex:3,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("usedate"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"usedate",flex:4},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"creationdate",flex:4,hidden:App.user.isClient,hideable:!App.user.isClient}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["voucherlist"],["component","box","container","panel","tablepanel","gridpanel","grid","voucherlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,voucherlist:true},["widget.voucherlist"],0,[MBilling.view.voucher,"List"],0));(Ext.cmd.derive("MBilling.view.voucher.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;if(!App.user.isClient){b.fieldsHideEdit=["quantity"]}if(App.user.isClient){b.textNew=t("Insert Voucher");b.buttonNewWidth=150}b.items=[{xtype:"moneyfield",name:"credit",fieldLabel:t("credit"),hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"id_plan",fieldLabel:t("Plan"),xtype:"plancombo",hidden:!App.user.isAdmin,allowBlank:!App.user.isAdmin},{xtype:"languagecombo",name:"language",fieldLabel:t("language"),hidden:!App.user.isAdmin,allowBlank:!App.user.isAdmin},{name:"prefix_local",fieldLabel:t("prefixlocal"),value:App.user.base_country=="BRL"?"0/55,*/5511/8,*/5511/9":App.user.base_country=="ARG"?"0/54,*/5411/8,15/54911/10,16/54911/10":"",emptyText:"match / replace / length",hidden:!App.user.isAdmin,allowBlank:true},{xtype:"numberfield",name:"quantity",fieldLabel:t("Quantity"),hidden:!App.user.isAdmin,allowBlank:!App.user.isAdmin,value:10},{name:"tag",fieldLabel:t("description"),hidden:App.user.isClient,allowBlank:true},{xtype:"numberfield",name:"voucher",fieldLabel:t("voucher"),value:"",maxLength:6,minLength:6,hidden:!App.user.isClient,allowBlank:!App.user.isClient}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["voucherform"],["component","box","container","panel","form","voucherform"],{component:true,box:true,container:true,panel:true,form:true,voucherform:true},["widget.voucherform"],0,[MBilling.view.voucher,"Form"],0));(Ext.cmd.derive("MBilling.view.refillprovider.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.refillprovider"],0,[MBilling.view.refillprovider,"Controller"],0));(Ext.cmd.derive("MBilling.view.refillprovider.Module",Ext.ux.panel.Module,{controller:"refillprovider"},0,["refillprovidermodule"],["component","box","container","uxpanelmodule","refillprovidermodule"],{component:true,box:true,container:true,uxpanelmodule:true,refillprovidermodule:true},["widget.refillprovidermodule"],0,[MBilling.view.refillprovider,"Module"],0));(Ext.cmd.derive("MBilling.view.refillprovider.List",Ext.ux.grid.Panel,{store:"Refillprovider",initComponent:function(){var b=this;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{xtype:"templatecolumn",tpl:"{idProviderprovider_name}",header:t("provider"),dataIndex:"id_provider",comboFilter:"providercombo",flex:2},{header:t("credit"),dataIndex:"credit",renderer:Helper.Util.formatMoneyDecimal,flex:2},{header:t("description"),dataIndex:"description",flex:4},{header:t("payment"),dataIndex:"payment",renderer:Helper.Util.formattyyesno,filter:{type:"list",options:[[0,t("no")],[1,t("yes")]]},flex:2},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"date",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["refillproviderlist"],["component","box","container","panel","tablepanel","gridpanel","grid","refillproviderlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,refillproviderlist:true},["widget.refillproviderlist"],0,[MBilling.view.refillprovider,"List"],0));(Ext.cmd.derive("MBilling.view.refillprovider.Form",Ext.ux.form.Panel,{bodyPadding:0,fieldsHideUpdateLot:["id_provider"],initComponent:function(){var b=this;b.items=[{xtype:"providercombo"},{xtype:"moneyfield",name:"credit",fieldLabel:t("credit")},{xtype:"textareafield",name:"description",fieldLabel:t("description"),allowBlank:true},{xtype:"yesnocombo",name:"payment",fieldLabel:t("add")+" "+t("payment"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["refillproviderform"],["component","box","container","panel","form","refillproviderform"],{component:true,box:true,container:true,panel:true,form:true,refillproviderform:true},["widget.refillproviderform"],0,[MBilling.view.refillprovider,"Form"],0));(Ext.cmd.derive("MBilling.view.boleto.Controller",Ext.ux.app.ViewController,{onAfterSave:function(d){var c=this;if(c.formPanel.idRecord==0){url="index.php/boleto/secondVia/?id=last";window.open(url)}Ext.ux.app.ViewController.prototype.onAfterSave.apply(this,arguments)},onSecondVia:function(e){var f=this,d=f.list.getSelectionModel().getSelection()[0];if(f.list.getSelectionModel().getSelection().length==0){Ext.ux.Alert.alert(f.titleError,t("Por favor selecione um bolero"),"notification")}else{if(f.list.getSelectionModel().getSelection().length>1){Ext.ux.Alert.alert(f.titleError,t("Por favor selecione somente um bolero"),"notification")}else{url="index.php/boleto/secondVia/?id="+d.get("id");window.open(url)}}}},0,0,0,0,["controller.boleto"],0,[MBilling.view.boleto,"Controller"],0));(Ext.cmd.derive("MBilling.view.boleto.Module",Ext.ux.panel.Module,{controller:"boleto"},0,["boletomodule"],["component","box","container","uxpanelmodule","boletomodule"],{component:true,box:true,container:true,uxpanelmodule:true,boletomodule:true},["widget.boletomodule"],0,[MBilling.view.boleto,"Module"],0));(Ext.cmd.derive("MBilling.view.boleto.List",Ext.ux.grid.Panel,{store:"Boleto",iconButtonCsv:"boleto",textButtonCsv:t("Importar Retorno"),iconButtonImportCsv:"boleto",textButtonImportCsv:t("Importar Retorno"),initComponent:function(){var b=this;b.buttonCsv=false;b.buttonUpdateLot=false;b.buttonImportCsv=App.user.isAdmin;b.extraButtons=[{text:t("Segunda via"),iconCls:"boleto",handler:"onSecondVia",disabled:false}];b.columns=[{header:t("Nosso Número"),dataIndex:"id",flex:3,hidden:!App.user.isAdmin,hideable:App.user.isAdmin},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("value"),dataIndex:"payment",renderer:Helper.Util.formatMoneyDecimal,flex:4},{header:"Pago",dataIndex:"status",renderer:Helper.Util.formattyyesno,flex:2,filter:{type:"list",options:[[0,t("no")],[1,t("yes")]]}},{header:t("description"),dataIndex:"description",flex:5},{header:"Vencimento",renderer:Ext.util.Format.dateRenderer("Y-m-d"),dataIndex:"vencimento",flex:4},{header:"Gerado",renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"date",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["boletolist"],["component","box","container","panel","tablepanel","gridpanel","grid","boletolist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,boletolist:true},["widget.boletolist"],0,[MBilling.view.boleto,"List"],0));(Ext.cmd.derive("MBilling.view.boleto.Form",Ext.ux.form.Panel,{fieldsHideEdit:["cid"],initComponent:function(){var b=this;b.items=[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:App.user.isClient},{xtype:"moneyfield",name:"payment",fieldLabel:t("value"),readOnly:App.user.isClient},{xtype:"yesnocombo",name:"status",fieldLabel:t("Pago"),hidden:App.user.isClient,value:0},{xtype:"datefield",name:"vencimento",fieldLabel:"Vencimento",format:"Y-m-d H:i:s",hidden:App.user.isClient||App.user.isAgent},{xtype:"textareafield",name:"description",fieldLabel:t("description"),readOnly:App.user.isClient}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["boletoform"],["component","box","container","panel","form","boletoform"],{component:true,box:true,container:true,panel:true,form:true,boletoform:true},["widget.boletoform"],0,[MBilling.view.boleto,"Form"],0));(Ext.cmd.derive("Ext.ux.window.ImportBoleto",Ext.window.Window,{autoShow:true,modal:true,layout:"fit",iconCls:"boleto",title:t("Importa Retorno Boleto"),width:400,height:175,labelWidthFields:180,htmlTipInfo:"",fieldsImport:[],initComponent:function(){var d=this,c=Ext.Array.merge(d.fieldsImport,[{xtype:"uploadfield",fieldLabel:t("Selecion o arquivo .RET"),htmlTipInfo:d.htmlTipInfo}]);d.items=[{xtype:"form",bodyPadding:5,labelWidth:d.labelWidthFields,items:c}];d.title=d.title+(d.titleModule?" - "+d.titleModule:"");d.bbar=[{xtype:"tbtext",text:t("maxSizeFile")+"3 MB"},"->",{iconCls:"boleto",text:t("importText"),scope:d,handler:d.onImport}];Ext.window.Window.prototype.initComponent.apply(this,arguments)},onImport:function(d){var f=this,e=f.list.store;d.disable();f.list.setLoading(true);f.down("form").submit({url:"index.php/boleto/retorno",scope:f,success:function(c,b){var a=Ext.decode(b.response.responseText);if(a.success){Ext.ux.Alert.alert(t("Success"),a.msg,"success",true,false,40000)}else{Ext.ux.Alert.alert(t("Error"),a.errors,"error")}d.enable();f.list.setLoading(false);e.load();f.close()},failure:function(c,b){if(Ext.isObject(b.response.responseText)){var a=Ext.decode(b.response.responseText);Ext.ux.Alert.alert(t("Error"),a.errors,"error")}else{Ext.ux.Alert.alert(t("Error"),b.response.responseText,"error",true,10)}d.enable();f.list.setLoading(false);f.close()}})}},0,0,["component","box","container","panel","window"],{component:true,box:true,container:true,panel:true,window:true},0,0,[Ext.ux.window,"ImportBoleto"],0));(Ext.cmd.derive("MBilling.view.boleto.ImportCsv",Ext.ux.window.ImportBoleto,{title:t("Importar Retorno"),labelWidthFields:250,height:275,fieldsImport:[{xtype:"boletobanckcombo",name:"banco",fieldLabel:t("Banco"),width:350}]},0,["boletoimportcsv"],["component","box","container","panel","window","boletoimportcsv"],{component:true,box:true,container:true,panel:true,window:true,boletoimportcsv:true},["widget.boletoimportcsv"],0,[MBilling.view.boleto,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.offer.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.offer"],0,[MBilling.view.offer,"Controller"],0));(Ext.cmd.derive("MBilling.view.offer.Combo",Ext.form.field.ComboBox,{name:"id_offer",fieldLabel:t("offer"),displayField:"label",valueField:"id",value:0,extraValues:[{id:0,label:t("undefined")}],initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Offer",{proxy:{type:"uxproxy",module:"offer",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["offercombo"],["component","box","field","textfield","pickerfield","combobox","combo","offercombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,offercombo:true},["widget.offercombo"],0,[MBilling.view.offer,"Combo"],0));(Ext.cmd.derive("MBilling.view.offer.Module",Ext.ux.panel.Module,{controller:"offer"},0,["offermodule"],["component","box","container","uxpanelmodule","offermodule"],{component:true,box:true,container:true,uxpanelmodule:true,offermodule:true},["widget.offermodule"],0,[MBilling.view.offer,"Module"],0));(Ext.cmd.derive("MBilling.view.offer.List",Ext.ux.grid.Panel,{store:"Offer",initComponent:function(){var b=this;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("name"),dataIndex:"label",flex:1},{header:t("packagetype"),dataIndex:"packagetype",renderer:Helper.Util.formatPackageType,comboRelated:"offertypecombo",flex:1,filter:{type:"list",options:[[0,t("unlimitedcalls")],[1,t("numberfreecalls")],[2,t("freeseconds")]]}},{header:t("freetimetocall"),dataIndex:"freetimetocall",flex:1},{header:t("periode"),dataIndex:"billingtype",renderer:Helper.Util.formatBillingType,comboRelated:"billingtypecombo",flex:1,filter:{type:"list",options:[[0,t("monthly")],[1,t("weekly")]]}},{header:t("price"),dataIndex:"price",renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,hideable:App.user.isAdmin,flex:2},{header:t("creationdate"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"creationdate",flex:1}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["offerlist"],["component","box","container","panel","tablepanel","gridpanel","grid","offerlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,offerlist:true},["widget.offerlist"],0,[MBilling.view.offer,"List"],0));(Ext.cmd.derive("MBilling.view.offer.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["name"],items:[{name:"label",fieldLabel:t("name")},{xtype:"offertypecombo",name:"packagetype",fieldLabel:t("packagetype")},{name:"freetimetocall",fieldLabel:t("freetimetocall")},{xtype:"billingtypecombo",name:"billingtype",fieldLabel:t("periode")},{xtype:"moneyfield",name:"price",fieldLabel:t("price")}]},0,["offerform"],["component","box","container","panel","form","offerform"],{component:true,box:true,container:true,panel:true,form:true,offerform:true},["widget.offerform"],0,[MBilling.view.offer,"Form"],0));(Ext.cmd.derive("MBilling.view.offerCdr.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.offercdr"],0,[MBilling.view.offerCdr,"Controller"],0));(Ext.cmd.derive("MBilling.view.offerCdr.Module",Ext.ux.panel.Module,{controller:"offercdr"},0,["offercdrmodule"],["component","box","container","uxpanelmodule","offercdrmodule"],{component:true,box:true,container:true,uxpanelmodule:true,offercdrmodule:true},["widget.offercdrmodule"],0,[MBilling.view.offerCdr,"Module"],0));(Ext.cmd.derive("MBilling.view.offerCdr.List",Ext.ux.grid.Panel,{store:"OfferCdr",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"date_consumption",flex:3},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:3},{xtype:"templatecolumn",tpl:"{idOfferlabel}",header:t("offer"),dataIndex:"id_offer",comboFilter:"offercombo",flex:3},{header:t("duration"),dataIndex:"used_secondes",renderer:Helper.Util.formatsecondsToTime,flex:3}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["offercdrlist"],["component","box","container","panel","tablepanel","gridpanel","grid","offercdrlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,offercdrlist:true},["widget.offercdrlist"],0,[MBilling.view.offerCdr,"List"],0));(Ext.cmd.derive("MBilling.view.offerCdr.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.columns=[{xtype:"usercombo"},{xtype:"offercombo"},{name:"used_secondes",fieldLabel:t("usedsecondes")},{xtype:"datefield",name:"date_consumption",fieldLabel:t("date"),format:"Y-m-d H:i:s"}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["offercdrform"],["component","box","container","panel","form","offercdrform"],{component:true,box:true,container:true,panel:true,form:true,offercdrform:true},["widget.offercdrform"],0,[MBilling.view.offerCdr,"Form"],0));(Ext.cmd.derive("MBilling.view.offerUse.Module",Ext.ux.panel.Module,{controller:"offeruse"},0,["offerusemodule"],["component","box","container","uxpanelmodule","offerusemodule"],{component:true,box:true,container:true,uxpanelmodule:true,offerusemodule:true},["widget.offerusemodule"],0,[MBilling.view.offerUse,"Module"],0));(Ext.cmd.derive("MBilling.view.offerUse.List",Ext.ux.grid.Panel,{store:"OfferUse",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:3},{xtype:"templatecolumn",tpl:"{idOfferlabel}",header:t("offer"),dataIndex:"id_offer",comboFilter:"offercombo",flex:3},{header:t("monthpayed"),dataIndex:"month_payed",flex:3},{header:t("reservationdate"),renderer:Ext.util.Format.dateRenderer("Y-m-d"),dataIndex:"reservationdate",flex:3},{header:t("releasedate"),renderer:Ext.util.Format.dateRenderer("Y-m-d"),dataIndex:"releasedate",flex:3}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["offeruselist"],["component","box","container","panel","tablepanel","gridpanel","grid","offeruselist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,offeruselist:true},["widget.offeruselist"],0,[MBilling.view.offerUse,"List"],0));(Ext.cmd.derive("MBilling.view.offerUse.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{xtype:"userlookup",ownerForm:b,readOnly:true},{xtype:"offercombo",readOnly:true},{name:"month_payed",fieldLabel:t("monthpayed")},{xtype:"datefield",name:"reservationdate",fieldLabel:t("reservationdate"),format:"Y-m-d H:i:s"}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["offeruseform"],["component","box","container","panel","form","offeruseform"],{component:true,box:true,container:true,panel:true,form:true,offeruseform:true},["widget.offeruseform"],0,[MBilling.view.offerUse,"Form"],0));(Ext.cmd.derive("MBilling.view.campaign.Controller",Ext.ux.app.ViewController,{isSubmitForm:true,init:function(){var b=this;b.control({typecampaigndestinationcombo:{select:b.onSelectMethod}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectMethod:function(c,d){this.showFieldsRelated(d.getData().showFields)},showFieldsRelated:function(j){var l=this,m=l.formPanel.getForm(),g=l.formPanel.getForm().getFields(),f=Ext.get(Ext.Element.getActiveElement()).component;l.onSetVisibleFiel(f,m,f.value)},onSetVisibleFiel:function(e,d,f){if(e.value=="undefined"){e.setValue("undefined")}if(e.name.match("^type_0")){d.findField("id_queue_0").setVisible(f.match("^queue"));d.findField("id_sip_0").setVisible(f.match("^sip"));d.findField("id_ivr_0").setVisible(f.match("^ivr"));d.findField("extension_0").setVisible(f.match("^group|^number|^custom"))}},onEdit:function(){var f=this,d=f.formPanel.getForm(),e=f.list.getSelectionModel().getSelection()[0];if(e.getData()["type_0"]=="ivr"){d.findField("id_ivr_0").setVisible(true);d.findField("id_sip_0").setVisible(false);d.findField("id_queue_0").setVisible(false);d.findField("extension_0").setVisible(false)}else{if(e.getData()["type_0"]=="sip"){d.findField("id_sip_0").setVisible(true);d.findField("id_ivr_0").setVisible(false);d.findField("id_queue_0").setVisible(false);d.findField("extension_0").setVisible(false)}else{if(e.getData()["type_0"]=="queue"){d.findField("id_queue_0").setVisible(true);d.findField("id_sip_0").setVisible(false);d.findField("id_ivr_0").setVisible(false);d.findField("extension_0").setVisible(false)}else{if(e.getData()["type_0"].match("custom|number|group")){d.findField("extension_0").setVisible(true);d.findField("id_ivr_0").setVisible(false);d.findField("id_sip_0").setVisible(false);d.findField("id_queue_0").setVisible(false)}else{d.findField("id_queue_0").setVisible(false);d.findField("id_sip_0").setVisible(false);d.findField("id_ivr_0").setVisible(false);d.findField("extension_0").setVisible(false)}}}}Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)},onNew:function(){var f=this,d=f.formPanel.getForm(),e=f.list.getSelectionModel().getSelection()[0];d.findField("id_ivr_0").setVisible(false);d.findField("id_sip_0").setVisible(false);d.findField("id_queue_0").setVisible(false);d.findField("extension_0").setVisible(false);Ext.ux.app.ViewController.prototype.onNew.apply(this,arguments)},submitForm:function(d){var f=this,e=f.store;Ext.apply(f.params,{id_phonebook_array:f.formPanel.getForm().getFieldValues().id_phonebook.join(",")});f.formPanel.add({xtype:"hiddenfield",name:f.idProperty,value:f.formPanel.idRecord});f.formPanel.getForm().submit({url:f.store.getProxy().api.create,params:f.params,scope:f,success:function(c,b){var a=Ext.decode(b.response.responseText);if(a.success){Ext.ux.Alert.alert(f.titleSuccess,a.msg,"success");f.formPanel.fireEvent("aftersave",f.formPanel,a.rows[0])}else{errors=Helper.Util.convertErrorsJsonToString(a.msg);if(!Ext.isObject(a.errors)){Ext.ux.Alert.alert(f.titleError,errors,"error")}else{c.markInvalid(a.errors);Ext.ux.Alert.alert(f.titleWarning,f.msgFormInvalid,"warning")}}f.store.load();f.formPanel.setLoading(false);f.saveButton.enable()},failure:function(j,c){var b=Ext.decode(c.response.responseText),a=Helper.Util.convertErrorsJsonToString(b.errors);if(!Ext.isObject(b.errors)){Ext.ux.Alert.alert(f.titleError,a,"error")}else{j.markInvalid(b.errors);Ext.ux.Alert.alert(f.titleWarning,a,"error")}f.formPanel.setLoading(false);f.saveButton.enable()}})},onTestCampaign:function(e){var f=this,d=f.list.getSelectionModel().getSelection()[0];if(f.list.getSelectionModel().getSelection().length==0){Ext.ux.Alert.alert(f.titleError,t("Please Select one campaign"),"notification")}else{if(f.list.getSelectionModel().getSelection().length>1){Ext.ux.Alert.alert(f.titleError,t("Please Select only one campaign"),"notification")}else{Ext.Ajax.request({url:"index.php/campaign/testCampaign",params:{id:d.get("id")},scope:f,success:function(b){b=Ext.decode(b.responseText);if(b[f.nameSuccessRequest]){Ext.ux.Alert.alert(f.titleSuccess,b[f.nameMsgRequest],"success")}else{var a=Helper.Util.convertErrorsJsonToString(b[f.nameMsgRequest]);Ext.ux.Alert.alert(f.titleSuccess,a,"error")}}})}}}},0,0,0,0,["controller.campaign"],0,[MBilling.view.campaign,"Controller"],0));(Ext.cmd.derive("MBilling.view.campaign.Combo",Ext.form.field.ComboBox,{name:"id_campaign",fieldLabel:t("campaign"),displayField:"name",forceSelection:true,editable:false,valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Campaign",{proxy:{type:"uxproxy",module:"campaign",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["campaigncombo"],["component","box","field","textfield","pickerfield","combobox","combo","campaigncombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,campaigncombo:true},["widget.campaigncombo"],0,[MBilling.view.campaign,"Combo"],0));(Ext.cmd.derive("MBilling.view.general.TypeCampaignDestination",Ext.form.field.ComboBox,{fieldLabel:t("type"),forceSelection:true,editable:false,value:"",store:[["",t("")],["undefined",t("Undefined")],["sip",t("SIP")],["ivr",t("IVR")],["queue",t("Queue")],["group",t("Group")],["custom",t("Custom")]]},0,["typecampaigndestinationcombo"],["component","box","field","textfield","pickerfield","combobox","combo","typecampaigndestinationcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,typecampaigndestinationcombo:true},["widget.typecampaigndestinationcombo"],0,[MBilling.view.general,"TypeCampaignDestination"],0));(Ext.cmd.derive("MBilling.view.campaign.Module",Ext.ux.panel.Module,{controller:"campaign"},0,["campaignmodule"],["component","box","container","uxpanelmodule","campaignmodule"],{component:true,box:true,container:true,uxpanelmodule:true,campaignmodule:true},["widget.campaignmodule"],0,[MBilling.view.campaign,"Module"],0));(Ext.cmd.derive("MBilling.view.campaign.List",Ext.ux.grid.Panel,{store:"Campaign",fieldSearch:"name",initComponent:function(){var b=this;b.buttonCsv=false;b.allowPrint=false;b.extraButtons=[{text:t("Test")+" "+t("Campaign"),iconCls:"call",handler:"onTestCampaign",disabled:false}];b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("name"),dataIndex:"name",flex:4},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:3,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("status"),dataIndex:"status",renderer:Helper.Util.formatBooleanActive,comboRelated:"booleancombo",flex:2,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")]]}},{header:t("type"),dataIndex:"type",renderer:Helper.Util.formatCampaignType,comboRelated:"campaigntypecombo",flex:2,filter:App.user.l.slice(4,7)=="wap"?{type:"list",options:[[0,t("sms")],[1,t("voice")],[3,t("WhasApp")]]}:{type:"list",options:[[0,t("sms")],[1,t("voice")]]}},{header:t("daily_start_time"),dataIndex:"daily_start_time",flex:4},{header:t("daily_stop_time"),dataIndex:"daily_stop_time",flex:4},{header:t("startingdate"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"startingdate",flex:4},{header:t("Call Limit"),dataIndex:"frequency",flex:4,hidden:true,hideable:App.user.isAdmin},{header:t("Max Complete Call"),dataIndex:"secondusedreal",flex:3,hidden:true,hideable:App.user.isAdmin}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignlist"],["component","box","container","panel","tablepanel","gridpanel","grid","campaignlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,campaignlist:true},["widget.campaignlist"],0,[MBilling.view.campaign,"List"],0));(Ext.cmd.derive("MBilling.view.campaign.Form",Ext.ux.form.Panel,{bodyPadding:0,fieldsHideUpdateLot:["id_user","name","audio","audio_2","id_phonebook"],fileUpload:true,initComponent:function(){var b=this;b.labelWidthFields=120;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{plugins:"markallowblank",allowBlank:false,anchor:"100%",labelAlign:"right"}},items:[{title:t("general"),items:[{xtype:App.user.isClient?"textfield":"userlookup",ownerForm:b,hidden:App.user.isClient},{fieldLabel:t("Plan"),xtype:"plancombo",name:"id_plan",hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"name",fieldLabel:t("name")},{xtype:"booleancombo",name:"status",fieldLabel:t("status")},{xtype:"datetimefield",name:"startingdate",fieldLabel:t("startingdate"),format:"Y-m-d H:i:s",value:new Date()},{xtype:"datetimefield",name:"expirationdate",fieldLabel:t("expirationdate"),format:"Y-m-d H:i:s",value:"2030-01-01 00:00:00"},{xtype:"campaigntypefullcombo",name:"type",fieldLabel:t("type")},{xtype:"uploadfield",fieldLabel:t("Audio"),emptyText:"Select an wav or gsm File",allowBlank:true,name:"audio",extAllowed:["wav","gsm"]},{xtype:"uploadfield",fieldLabel:t("Audio")+"2",emptyText:"Select an wav or gsm File",allowBlank:true,name:"audio_2",extAllowed:["wav","gsm"]},{xtype:"yesnocombo",name:"restrict_phone",fieldLabel:t("Restrict Phone"),hidden:App.user.isClient,allowBlank:true},{style:"margin-top:25px",xtype:"fieldset",title:t("Forward to"),collapsible:true,collapsed:false,height:110,defaults:{labelWidth:190,anchor:"100%",labelAlign:b.labelAlignFields},items:[{xtype:"numberfield",name:"digit_authorize",fieldLabel:t("Number to Forward"),value:"-1",minValue:"-1",maxValue:9},{fieldLabel:t("Forward Type"),name:"type_0",xtype:"typecampaigndestinationcombo",allowBlank:true},{xtype:"textfield",name:"extensions_0",fieldLabel:t("Destination"),value:"0",allowBlank:true,hidden:true},{xtype:"ivrlookup",ownerForm:b,name:"id_ivr_0",fieldLabel:t("IVR"),displayField:"id_ivr_0_name",allowBlank:true,hidden:true},{xtype:"queuelookup",ownerForm:b,name:"id_queue_0",fieldLabel:t("Queue"),displayField:"id_queue_0_name",allowBlank:true,hidden:true},{xtype:"siplookup",ownerForm:b,name:"id_sip_0",displayField:"id_sip_0_name",fieldLabel:t("SIP"),allowBlank:true,hidden:true},{xtype:"textfield",fieldLabel:t("Destination"),name:"extension_0",hidden:true}]},{style:"margin-top:10px",xtype:"fieldset",title:t("Select one or more phonebook"),collapsible:true,collapsed:false,items:[{labelWidth:10,name:"id_phonebook",fieldLabel:t("phonebook"),anchor:"100%",fieldLabel:"",xtype:"phonebooktag",allowBlank:true}]}]},{title:t("schedules"),items:[{name:"daily_start_time",fieldLabel:t("daily_start_time"),value:"09:00"},{name:"daily_stop_time",fieldLabel:t("daily_stop_time"),value:"18:00"},{xtype:"yesnocombo",fieldLabel:t("monday"),name:"monday"},{xtype:"yesnocombo",fieldLabel:t("tuesday"),name:"tuesday"},{xtype:"yesnocombo",fieldLabel:t("wednesday"),name:"wednesday"},{xtype:"yesnocombo",fieldLabel:t("thursday"),name:"thursday"},{xtype:"yesnocombo",fieldLabel:t("friday"),name:"friday"},{xtype:"noyescombo",fieldLabel:t("saturday"),name:"saturday"},{xtype:"noyescombo",fieldLabel:t("sunday"),name:"sunday"}]},{title:t("Limit"),items:[{name:"frequency",fieldLabel:t("Call Limit"),readOnly:!App.user.isAdmin,allowBlank:!App.user.isAdmin,value:App.user.isClient?1:10},{name:"nb_callmade",fieldLabel:t("Total Audio Time"),hidden:!App.user.isAdmin,allowBlank:true,value:0},{xtype:"booleancombo",name:"enable_max_call",fieldLabel:t("Enable")+" "+t("Max Complete Call"),hidden:!App.user.isAdmin,allowBlank:true,value:0},{name:"secondusedreal",fieldLabel:t("Max Complete Call"),hidden:!App.user.isAdmin,allowBlank:true,value:0}]},{title:t("SMS"),items:[{xtype:"textareafield",name:"description",fieldLabel:t("descriptionOrSmsText"),allowBlank:true,maxLength:160}]},{title:t("TTS/ASR"),hidden:!window.ttsasr,items:[{name:"tts_audio",fieldLabel:t("Audio 1 TTS"),allowBlank:true,maxLength:200},{name:"tts_audio2",fieldLabel:t("Audio 2 TTS"),allowBlank:true,maxLength:200},{xtype:"box",hidden:false,autoEl:{tag:"br"}},{name:"asr_options",fieldLabel:t("Option to validate ASR"),allowBlank:true,maxLength:160}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignform"],["component","box","container","panel","form","campaignform"],{component:true,box:true,container:true,panel:true,form:true,campaignform:true},["widget.campaignform"],0,[MBilling.view.campaign,"Form"],0));(Ext.cmd.derive("MBilling.view.campaignPoll.Controller",Ext.ux.app.ViewController,{isSubmitForm:true},0,0,0,0,["controller.campaignpoll"],0,[MBilling.view.campaignPoll,"Controller"],0));(Ext.cmd.derive("MBilling.view.campaignPoll.Combo",Ext.form.field.ComboBox,{name:"id_campaign_poll",fieldLabel:t("campaignpoll"),displayField:"name",valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.CampaignPoll",{proxy:{type:"uxproxy",module:"campaignPoll",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["campaignpollcombo"],["component","box","field","textfield","pickerfield","combobox","combo","campaignpollcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,campaignpollcombo:true},["widget.campaignpollcombo"],0,[MBilling.view.campaignPoll,"Combo"],0));(Ext.cmd.derive("MBilling.view.campaignPoll.Module",Ext.ux.panel.Module,{controller:"campaignpoll"},0,["campaignpollmodule"],["component","box","container","uxpanelmodule","campaignpollmodule"],{component:true,box:true,container:true,uxpanelmodule:true,campaignpollmodule:true},["widget.campaignpollmodule"],0,[MBilling.view.campaignPoll,"Module"],0));(Ext.cmd.derive("MBilling.view.campaignPoll.List",Ext.ux.grid.Panel,{store:"CampaignPoll",initComponent:function(){var b=this;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("name"),dataIndex:"name",flex:4},{xtype:"templatecolumn",tpl:"{idCampaignname}",header:t("campaign"),dataIndex:"id_campaign",comboFilter:"campaigncombo",flex:4},{header:t("description"),dataIndex:"description",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignpolllist"],["component","box","container","panel","tablepanel","gridpanel","grid","campaignpolllist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,campaignpolllist:true},["widget.campaignpolllist"],0,[MBilling.view.campaignPoll,"List"],0));(Ext.cmd.derive("MBilling.view.campaignPoll.Form",Ext.ux.form.Panel,{bodyPadding:0,fileUpload:true,fieldsHideUpdateLot:["id_campaign","name","arq_audio"],initComponent:function(){var b=this;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{plugins:"markallowblank",allowBlank:false,anchor:"100%",labelAlign:"right"}},items:[{title:t("general"),items:[{xtype:"campaigncombo"},{name:"name",fieldLabel:t("name")},{xtype:"numberfield",name:"repeat",fieldLabel:t("How many time to repeat, if the client press invalid option?"),minValue:0,maxValue:9,allowBlank:true},{xtype:"noyescombo",name:"request_authorize",fieldLabel:t("Request")+" "+t("authorization")},{xtype:"numberfield",name:"digit_authorize",fieldLabel:t("Number for authorize"),value:"1",minValue:1,maxValue:9,allowBlank:true},{xtype:"textareafield",name:"description",fieldLabel:t("description"),allowBlank:true},{xtype:"uploadfield",fieldLabel:"Audio",emptyText:"Select an wav or gsm File",allowBlank:true,name:"arq_audio",extAllowed:["wav","gsm"]}]},{title:t("options"),itemId:"optionsData",items:[{name:"option0",fieldLabel:t("option")+" 0",allowBlank:true},{name:"option1",fieldLabel:t("option")+" 1",allowBlank:true},{name:"option2",fieldLabel:t("option")+" 2",allowBlank:true},{name:"option3",fieldLabel:t("option")+" 3",allowBlank:true},{name:"option4",fieldLabel:t("option")+" 4",allowBlank:true},{name:"option5",fieldLabel:t("option")+" 5",allowBlank:true},{name:"option6",fieldLabel:t("option")+" 6",allowBlank:true},{name:"option7",fieldLabel:t("option")+" 7",allowBlank:true},{name:"option8",fieldLabel:t("option")+" 8",allowBlank:true},{name:"option9",fieldLabel:t("option")+" 9",allowBlank:true}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignpollform"],["component","box","container","panel","form","campaignpollform"],{component:true,box:true,container:true,panel:true,form:true,campaignpollform:true},["widget.campaignpollform"],0,[MBilling.view.campaignPoll,"Form"],0));(Ext.cmd.derive("MBilling.view.phoneNumber.Controller",Ext.ux.app.ViewController,{reprocessar:function(e){var g=this,f=g.list.getStore(),j=g.list.filters.getFilterData().length?Ext.encode(g.list.filters.getFilterData()):f.proxy.extraParams.filter;e.disable();g.list.setLoading(true);if(!j){Ext.ux.Alert.alert("Alert","Realize um filtro para reprocessar","notification");e.enable();g.list.setLoading(false);return}Ext.Msg.confirm("Confirm","Confirme que quer reprocessar os numeros pendentes?",function(a){if(a==="yes"){Ext.Ajax.request({url:"index.php/phoneNumber/reprocesar/",params:{filter:j},scope:g,success:function(c){c=Ext.decode(c.responseText);if(c[g.nameSuccessRequest]){Ext.ux.Alert.alert(g.titleSuccess,c[g.nameMsgRequest],"success");f.load();e.enable();g.list.setLoading(false)}else{var b=Helper.Util.convertErrorsJsonToString(c[g.nameMsgRequest]);Ext.ux.Alert.alert(g.titleError,b,"error");e.enable();g.list.setLoading(false)}}})}})}},0,0,0,0,["controller.phonenumber"],0,[MBilling.view.phoneNumber,"Controller"],0));(Ext.cmd.derive("MBilling.view.phoneNumber.Module",Ext.ux.panel.Module,{controller:"phonenumber"},0,["phonenumbermodule"],["component","box","container","uxpanelmodule","phonenumbermodule"],{component:true,box:true,container:true,uxpanelmodule:true,phonenumbermodule:true},["widget.phonenumbermodule"],0,[MBilling.view.phoneNumber,"Module"],0));(Ext.cmd.derive("MBilling.view.phoneNumber.List",Ext.ux.grid.Panel,{store:"PhoneNumber",buttonImportCsv:true,initComponent:function(){var b=this;b.extraButtons=[{text:t("Reprocessar"),iconCls:"callshop",handler:"reprocessar",disabled:false}];b.buttonUpdateLot=App.user.isAdmin&&!window.isTablet;b.buttonCsv=!window.isTablet;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("number"),dataIndex:"number",flex:4},{header:t("phonebook"),dataIndex:"idPhonebookname",filter:{type:"string",field:"idPhonebook.name"},flex:4},{header:t("status"),dataIndex:"status",renderer:Helper.Util.formatBooleanActive,comboRelated:"statuscombo",flex:2,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")],[2,t("pending")],[3,t("send")],[4,t("blocked")]]}},{header:t("name"),dataIndex:"name",hidden:true,hideable:true,flex:4},{header:t("city"),dataIndex:"city",hidden:true,hideable:true,flex:4},{header:t("description"),dataIndex:"info",hidden:true,flex:4},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"creationdate",hidden:true,hideable:App.user.isAdmin,flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["phonenumberlist"],["component","box","container","panel","tablepanel","gridpanel","grid","phonenumberlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,phonenumberlist:true},["widget.phonenumberlist"],0,[MBilling.view.phoneNumber,"List"],0));(Ext.cmd.derive("MBilling.view.phoneNumber.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["number"],initComponent:function(){var b=this;b.items=[{xtype:"phonebookcombo"},{name:"number",fieldLabel:t("number")},{name:"name",fieldLabel:t("name"),allowBlank:true},{name:"city",fieldLabel:t("city"),allowBlank:true},{xtype:"statuscombo",name:"status",fieldLabel:t("status"),allowBlank:true},{xtype:"textareafield",name:"info",fieldLabel:t("description"),allowBlank:true,hidden:!App.user.isAdmin}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["phonenumberform"],["component","box","container","panel","form","phonenumberform"],{component:true,box:true,container:true,panel:true,form:true,phonenumberform:true},["widget.phonenumberform"],0,[MBilling.view.phoneNumber,"Form"],0));(Ext.cmd.derive("MBilling.view.phoneBook.Combo",Ext.form.field.ComboBox,{name:"id_phonebook",fieldLabel:t("phonebook"),displayField:"name",forceSelection:true,editable:true,valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.PhoneBook",{proxy:{type:"uxproxy",module:"phoneBook",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["phonebookcombo"],["component","box","field","textfield","pickerfield","combobox","combo","phonebookcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,phonebookcombo:true},["widget.phonebookcombo"],0,[MBilling.view.phoneBook,"Combo"],0));(Ext.cmd.derive("MBilling.view.phoneNumber.ImportCsv",Ext.ux.window.ImportCsv,{htmlTipInfo:"
number,name,city
551135672677, Dany Hilger, New York
551156332233, Monica Leith, San Pablo
554153882200, John Mart, Madri
"+t("name")+" "+t("and")+" "+t("city")+" "+t("optional")+"",fieldsImport:[{xtype:"phonebookcombo",width:350}]},0,["phonenumberimportcsv"],["component","box","container","panel","window","phonenumberimportcsv"],{component:true,box:true,container:true,panel:true,window:true,phonenumberimportcsv:true},["widget.phonenumberimportcsv"],0,[MBilling.view.phoneNumber,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.rate.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.rate"],0,[MBilling.view.rate,"Controller"],0));(Ext.cmd.derive("MBilling.view.rate.Module",Ext.ux.panel.Module,{controller:"rate",flexForm:2,labelWidthFields:190},0,["ratemodule"],["component","box","container","uxpanelmodule","ratemodule"],{component:true,box:true,container:true,uxpanelmodule:true,ratemodule:true},["widget.ratemodule"],0,[MBilling.view.rate,"Module"],0));(Ext.cmd.derive("MBilling.view.rate.List",Ext.ux.grid.Panel,{store:"Rate",fieldSearch:"idPrefix.prefix",initComponent:function(){var b=this;b.buttonImportCsv=!App.user.isClient,b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("prefix"),dataIndex:"idPrefixprefix",filter:{type:"string",field:"idPrefix.prefix"},flex:window.isTablet?2:3},{dataIndex:"idPrefixdestination",header:t("destination"),filter:{type:"string",field:"idPrefix.destination"},flex:window.isTablet?2:3},{header:t("buyrate"),dataIndex:"buyrate",renderer:Helper.Util.formatMoneyDecimal4,hidden:!App.user.isAdmin,hideable:App.user.isAdmin,flex:2},{header:t("buyrateinitblock"),dataIndex:"buyrateinitblock",hidden:!App.user.isAdmin||window.isTablet,hideable:App.user.isAdmin,flex:2},{header:t("buyrateincrement"),dataIndex:"buyrateincrement",hidden:!App.user.isAdmin||window.isTablet,hideable:App.user.isAdmin,flex:2},{header:t("rateinitial"),dataIndex:"rateinitial",renderer:Helper.Util.formatMoneyDecimal4,flex:2},{header:t("initblock"),dataIndex:"initblock",hidden:window.isTablet,flex:2},{header:t("billingblock"),dataIndex:"billingblock",hidden:window.isTablet,flex:2},{xtype:"templatecolumn",tpl:"{idTrunktrunkcode}",header:t("trunk"),dataIndex:"id_trunk",comboFilter:"trunkcombo",flex:3,hidden:!App.user.isAdmin,hideable:App.user.isAdmin},{xtype:"templatecolumn",tpl:"{idPlanname}",header:t("plan"),dataIndex:"id_plan",comboFilter:"plancombo",flex:3},{header:t("includeinpackage"),dataIndex:"package_offer",hidden:true,hideable:App.user.isAdmin,flex:1},{header:t("status"),dataIndex:"status",hidden:true,hideable:App.user.isAdmin,flex:2,renderer:Helper.Util.formatBooleanActive,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")]]}}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["ratelist"],["component","box","container","panel","tablepanel","gridpanel","grid","ratelist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,ratelist:true},["widget.ratelist"],0,[MBilling.view.rate,"List"],0));(Ext.cmd.derive("MBilling.view.rate.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["id_prefix"],labelWidthFields:140,initComponent:function(){var b=this;b.items=[{name:"id_plan",fieldLabel:"Plan",xtype:"planlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:false},{name:"id_prefix",fieldLabel:"Destination",xtype:"prefixlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:false},{name:"id_trunk",fieldLabel:"Trunk",xtype:"trunklookup",ownerForm:b,hidden:!App.user.isAdmin,allowBlank:!App.user.isAdmin},{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,"+App.user.decimalPrecision,name:"buyrate",fieldLabel:t("buyrate"),hidden:!App.user.isAdmin,allowBlank:!App.user.isAdmin},{xtype:"numberfield",name:"buyrateinitblock",fieldLabel:t("buyrateinitblock"),value:1,minValue:1,hidden:!App.user.isAdmin,allowBlank:!App.user.isAdmin},{xtype:"numberfield",name:"buyrateincrement",fieldLabel:t("buyrateincrement"),value:1,minValue:1,hidden:!App.user.isAdmin,allowBlank:!App.user.isAdmin},{xtype:"numberfield",name:"minimal_time_buy",fieldLabel:t("Minimal time to buy"),value:0,minValue:0,hidden:!App.user.isAdmin},{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,"+App.user.decimalPrecision,name:"rateinitial",fieldLabel:t("rateinitial"),readOnly:App.user.isClient},{xtype:"numberfield",name:"initblock",fieldLabel:t("initblock"),value:1,minValue:1,hidden:App.user.isClient},{xtype:"numberfield",name:"billingblock",value:1,minValue:1,fieldLabel:t("billingblock"),hidden:App.user.isClient},{xtype:"numberfield",name:"minimal_time_charge",fieldLabel:t("Minimal time to charge"),value:0,minValue:0,hidden:App.user.isClient},{name:"additional_grace",fieldLabel:t("additional_grace"),allowBlank:true,hidden:!App.user.isAdmin},{xtype:"noyescombo",name:"package_offer",fieldLabel:t("includeinpackage"),hidden:!App.user.isAdmin,allowBlank:true},{xtype:"booleancombo",name:"status",fieldLabel:t("status"),hidden:!App.user.isAdmin,allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["rateform"],["component","box","container","panel","form","rateform"],{component:true,box:true,container:true,panel:true,form:true,rateform:true},["widget.rateform"],0,[MBilling.view.rate,"Form"],0));(Ext.cmd.derive("MBilling.view.rate.ImportCsv",Ext.ux.window.ImportCsv,{htmlTipInfo:"
"+t("dialprefix")+", "+t("destination")+", "+t("rateinitial")+", "+t("buyrate")+"
5511, Brasil SP, 0.080, 0.050
34, Spain Fix, 0.056, 0.034
54, Argentina, 0.025, 0.015

"+t("rateinitial")+" "+t("and")+" "+t("buyrate")+" "+t("optional")+"",labelWidthFields:160,height:window.isThemeTriton?350:275,initComponent:function(){var b=this;b.fieldsImport=[{xtype:"plancombo",fieldLabel:t("table"),width:350},{xtype:"trunkcombo",fieldLabel:t("trunkText"),width:350,hidden:!App.user.isAdmin},{style:"margin-top:25px",xtype:"fieldset",title:t("Csv Format"),collapsible:true,collapsed:false,defaults:{labelWidth:190,anchor:"100%",layout:{type:"hbox",labelAlign:b.labelAlignFields}},items:[{xtype:"pontovirgulacombo",name:"delimiter",fieldLabel:t("Delimiter"),width:230}]}];Ext.ux.window.ImportCsv.prototype.initComponent.apply(this,arguments)}},0,["rateimportcsv"],["component","box","container","panel","window","rateimportcsv"],{component:true,box:true,container:true,panel:true,window:true,rateimportcsv:true},["widget.rateimportcsv"],0,[MBilling.view.rate,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.phoneBook.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.phonebook"],0,[MBilling.view.phoneBook,"Controller"],0));(Ext.cmd.derive("MBilling.view.phoneBook.Module",Ext.ux.panel.Module,{controller:"phonebook"},0,["phonebookmodule"],["component","box","container","uxpanelmodule","phonebookmodule"],{component:true,box:true,container:true,uxpanelmodule:true,phonebookmodule:true},["widget.phonebookmodule"],0,[MBilling.view.phoneBook,"Module"],0));(Ext.cmd.derive("MBilling.view.phoneBook.List",Ext.ux.grid.Panel,{store:"PhoneBook",initComponent:function(){var b=this;b.columns=b.columns||[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("name"),dataIndex:"name",flex:5},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:3,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("status"),dataIndex:"status",renderer:Helper.Util.formatBooleanActive,comboRelated:"booleancombo",flex:3,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")]]}},{header:t("description"),dataIndex:"description",flex:5}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["phonebooklist"],["component","box","container","panel","tablepanel","gridpanel","grid","phonebooklist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,phonebooklist:true},["widget.phonebooklist"],0,[MBilling.view.phoneBook,"List"],0));(Ext.cmd.derive("MBilling.view.phoneBook.Form",Ext.ux.form.Panel,{bodyPadding:0,fieldsHideUpdateLot:["id_user","name"],initComponent:function(){var b=this;b.items=[{xtype:App.user.isClient?"textfield":"userlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"name",fieldLabel:t("name")},{xtype:"booleancombo",name:"status",fieldLabel:t("status"),allowBlank:true},{xtype:"textareafield",name:"description",fieldLabel:t("description"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["phonebookform"],["component","box","container","panel","form","phonebookform"],{component:true,box:true,container:true,panel:true,form:true,phonebookform:true},["widget.phonebookform"],0,[MBilling.view.phoneBook,"Form"],0));(Ext.cmd.derive("MBilling.view.phoneBook.Tag",Ext.form.field.Tag,{name:"id_phonebook",fieldLabel:t("phonebook"),displayField:"name",valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.PhoneBook",{proxy:{type:"uxproxy",module:"phoneBook",limitParam:undefined}});Ext.form.field.Tag.prototype.initComponent.apply(this,arguments)}},0,["phonebooktag"],["component","box","field","textfield","pickerfield","combobox","combo","tagfield","phonebooktag"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,tagfield:true,phonebooktag:true},["widget.phonebooktag"],0,[MBilling.view.phoneBook,"Tag"],0));(Ext.cmd.derive("MBilling.view.call.Controller",Ext.ux.app.ViewController,{onRecordCall:function(m){var j=this,f=j.list.getSelectionModel().getSelection()[0],l=Ext.encode(j.list.filters.getFilterData()),g=[];if(!f&&l.length<5){Ext.ux.Alert.alert(j.titleError,t("Please select one or more register"),"notification")}else{Ext.each(j.list.getSelectionModel().getSelection(),function(a){g.push(a.get(j.idProperty))});if(App.user.isAdmin&&g.length>250){Ext.ux.Alert.alert(j.titleError,t("Your limit to download record is")+" 250","error")}else{if(!App.user.isAdmin&&g.length>25){Ext.ux.Alert.alert(j.titleError,t("Your limit to download record is")+" 25","error")}else{window.open("index.php/call/downloadRecord?ids="+Ext.encode(g)+"&filter="+l)}}}},onDownloadClick:function(d,f,e){window.open("index.php/call/downloadRecord?id="+d.getStore().getAt(f).getData().id)},onShowTotal:function(e){var g=this;var g=this,f=g.list.getStore(),j=g.list.filters.getFilterData().length?Ext.encode(g.list.filters.getFilterData()):f.proxy.extraParams.filter;e.disable();e.setText(t("Wait..."));e.setWidth(120);Ext.Ajax.request({url:"index.php/call/getTotal",params:{filter:j},scope:g,success:function(a){a=Ext.decode(a.responseText);Ext.ux.Alert.alert(g.titleSuccess," "+t("Total")+" "+t("buycost")+": "+App.user.currency+" "+a.sumbuycost+"
"+t("Total")+" "+t("sessionbill")+": "+App.user.currency+" "+a.sumsessionbill+"
"+t("Total")+" "+t("profit")+": "+App.user.currency+" "+a.totalCall+"
","information",true,false);e.enable();e.setText(t("Show Total"))},failure:function(a){e.enable();e.setText(""+t("Failed. Try again...")+"");e.setWidth(300)}})}},0,0,0,0,["controller.call"],0,[MBilling.view.call,"Controller"],0));(Ext.cmd.derive("MBilling.view.call.Module",Ext.ux.panel.Module,{controller:"call"},0,["callmodule"],["component","box","container","uxpanelmodule","callmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callmodule:true},["widget.callmodule"],0,[MBilling.view.call,"Module"],0));(Ext.cmd.derive("MBilling.view.call.List",Ext.ux.grid.Panel,{store:"Call",standardSubmit:true,initComponent:function(){var b=this;b.paginationButton=["-",{xtype:"button",width:"120",text:t("Show Total"),handler:"onShowTotal",hidden:!App.user.isAdmin,cls:"x-btn-text-icon details"},{xtype:"tbtext",reference:"tbTextTotal"}];b.fieldSearch=App.user.isAdmin?"idUser.username":"calledstation",b.extraButtons=[{text:t("Download Rec"),iconCls:"call",handler:"onRecordCall",disabled:false,width:130}];b.buttonUpdateLot=App.user.isAdmin;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{xtype:"actioncolumn",width:26,sortable:false,menuDisabled:true,header:t(""),dataIndex:"id",items:[{iconCls:"icon-play",tooltip:t("Download Rec"),handler:"onDownloadClick"}],hidden:App.user.show_playicon_cdr==0,hideable:true},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"starttime",flex:4},{header:t("Sip Account"),dataIndex:"src",flex:3},{header:t("CallerId"),dataIndex:"callerid",flex:3,hidden:true,hideable:true},{header:t("number"),dataIndex:"calledstation",flex:3},{header:t("destination"),dataIndex:"idPrefixdestination",filter:{type:"string",field:"idPrefix.destination"},flex:4},{header:t("sessiontime"),dataIndex:"sessiontime",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Real")+" "+t("sessiontime"),dataIndex:"real_sessiontime",renderer:Helper.Util.formatsecondsToTime,flex:3,hidden:true,hideable:App.user.isAdmin},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:2,hidden:App.user.isClient,hideable:!App.user.isClient},{xtype:"templatecolumn",tpl:"{idTrunktrunkcode}",header:t("trunk"),dataIndex:"id_trunk",comboFilter:"trunkcombo",header:t("trunk"),flex:3,hidden:App.user.isClient||App.user.isAgent,hideable:!App.user.isClient&&!App.user.isAgent},{header:t("status"),dataIndex:"terminatecauseid",renderer:Helper.Util.formatDialStatus,flex:2,filter:{type:"list",options:[[1,t("answer")]]}},{header:t("type"),dataIndex:"sipiax",renderer:Helper.Util.formatCallType,flex:2,filter:{type:"list",options:[[0,t("standard")],[1,t("sipcall")],[2,t("did")],[3,t("didvoip")],[4,t("callback")],[5,t("callcenter")],[6,"sms"],[7,t("transfer")],[8,t("queue")],[9,t("ivr")]]}},{header:t("buycost"),dataIndex:"buycost",renderer:Helper.Util.formatMoneyDecimal4,flex:3,hidden:App.user.isClient||App.user.isAgent,hideable:!App.user.isClient&&!App.user.isAgent},{header:t("sessionbill"),dataIndex:"sessionbill",renderer:Helper.Util.formatMoneyDecimal4,flex:3,hidden:App.user.isAgent||App.user.isClientAgent,hideable:!App.user.isAgent&&!App.user.isClientAgent},{header:t("buycost"),dataIndex:"sessionbill",renderer:Helper.Util.formatMoneyDecimal4,flex:3,hidden:!App.user.isAgent,hideable:App.user.isAgent},{header:t("sessionbill"),dataIndex:"agent_bill",renderer:Helper.Util.formatMoneyDecimal4,flex:3,hidden:!App.user.isAgent,hideable:App.user.isAgent},{header:t("sessionbill"),dataIndex:"agent_bill",renderer:Helper.Util.formatMoneyDecimal4,flex:3,hidden:!App.user.isClientAgent,hideable:App.user.isClientAgent},{header:t("uniqueid"),dataIndex:"uniqueid",flex:3,hidden:true,hideable:true},{xtype:"templatecolumn",tpl:"{idCampaignname}",header:t("campaign"),dataIndex:"id_campaign",comboFilter:"campaigncombo",flex:3,hidden:true,hideable:!App.user.isClient}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["calllist"],["component","box","container","panel","tablepanel","gridpanel","grid","calllist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,calllist:true},["widget.calllist"],0,[MBilling.view.call,"List"],0));(Ext.cmd.derive("MBilling.view.call.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["calledstation"],initComponent:function(){var b=this;b.items=[{name:"calledstation",fieldLabel:t("number"),readOnly:true},{name:"sessiontime",fieldLabel:t("sessiontime"),readOnly:App.user.isClient||App.user.isAgent,hidden:App.user.isClient||App.user.isAgent},{xtype:"moneyfield",name:"buycost",fieldLabel:t("buycost"),mask:App.user.currency+" #9.999.990,"+App.user.decimalPrecision,hidden:App.user.isClient||App.user.isAgent},{xtype:"moneyfield",name:"sessionbill",fieldLabel:t("sessionbill"),mask:App.user.currency+" #9.999.990,"+App.user.decimalPrecision,readOnly:App.user.isClient||App.user.isAgent,hidden:App.user.isAgent||App.user.isClientAgent},{xtype:"moneyfield",name:"agent_bill",fieldLabel:t("sessionbill"),mask:App.user.currency+" #9.999.990,"+App.user.decimalPrecision,readOnly:App.user.isAgent,hidden:!App.user.isAgent&&!App.user.isClientAgent}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callform"],["component","box","container","panel","form","callform"],{component:true,box:true,container:true,panel:true,form:true,callform:true},["widget.callform"],0,[MBilling.view.call,"Form"],0));(Ext.cmd.derive("MBilling.view.callArchive.Controller",Ext.ux.app.ViewController,{onRecordCall:function(m){var j=this,f=j.list.getSelectionModel().getSelection()[0],l=Ext.encode(j.list.filters.getFilterData()),g=[];if(!f&&l.length<5){Ext.ux.Alert.alert(j.titleError,t("Please select one or more register"),"notification")}else{Ext.each(j.list.getSelectionModel().getSelection(),function(a){g.push(a.get(j.idProperty))});if(App.user.isAdmin&&g.length>250){Ext.ux.Alert.alert(j.titleError,t("Your limit to download record is")+" 250","error")}else{if(!App.user.isAdmin&&g.length>25){Ext.ux.Alert.alert(j.titleError,t("Your limit to download record is")+" 25","error")}else{window.open("index.php/callArchive/downloadRecord?ids="+Ext.encode(g)+"&filter="+l)}}}},onDownloadClick:function(d,f,e){window.open("index.php/callArchive/downloadRecord?id="+d.getStore().getAt(f).getData().id)}},0,0,0,0,["controller.callarchive"],0,[MBilling.view.callArchive,"Controller"],0));(Ext.cmd.derive("MBilling.view.callArchive.Module",Ext.ux.panel.Module,{controller:"callarchive"},0,["callarchivemodule"],["component","box","container","uxpanelmodule","callarchivemodule"],{component:true,box:true,container:true,uxpanelmodule:true,callarchivemodule:true},["widget.callarchivemodule"],0,[MBilling.view.callArchive,"Module"],0));(Ext.cmd.derive("MBilling.view.callArchive.List",Ext.ux.grid.Panel,{store:"CallArchive",standardSubmit:true,initComponent:function(){var b=this;b.buttonUpdateLot=false;b.fieldSearch=App.user.isAdmin?"idUser.username":"calledstation",b.extraButtons=[{text:t("Download Rec"),iconCls:"call",handler:"onRecordCall",disabled:false,width:130}];b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{xtype:"actioncolumn",width:26,sortable:false,menuDisabled:true,header:t(""),dataIndex:"id",items:[{iconCls:"icon-play",tooltip:t("Download Rec"),handler:"onDownloadClick"}],hidden:App.user.show_playicon_cdr==0,hideable:true},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"starttime",flex:4},{header:t("Sip Account"),dataIndex:"src",flex:3},{header:t("CallerId"),dataIndex:"callerid",flex:3,hidden:true,hideable:true},{header:t("number"),dataIndex:"calledstation",flex:3},{header:t("destination"),dataIndex:"idPrefixdestination",filter:{type:"string",field:"idPrefix.destination"},flex:4},{header:t("sessiontime"),dataIndex:"sessiontime",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Real")+" "+t("sessiontime"),dataIndex:"real_sessiontime",renderer:Helper.Util.formatsecondsToTime,flex:3,hidden:true,hideable:App.user.isAdmin},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:2,hidden:App.user.isClient,hideable:!App.user.isClient},{xtype:"templatecolumn",tpl:"{idTrunktrunkcode}",header:t("trunk"),dataIndex:"id_trunk",comboFilter:"trunkcombo",header:t("trunk"),flex:3,hidden:App.user.isClient||App.user.isAgent,hideable:!App.user.isClient&&!App.user.isAgent},{header:t("status"),dataIndex:"terminatecauseid",renderer:Helper.Util.formatDialStatus,flex:2,filter:{type:"list",options:[[1,t("answer")]]}},{header:t("type"),dataIndex:"sipiax",renderer:Helper.Util.formatCallType,flex:2,filter:{type:"list",options:[[0,t("standard")],[1,t("sipcall")],[2,t("did")],[3,t("didvoip")],[4,t("callback")],[5,t("callcenter")],[6,"sms"],[7,t("transfer")],[8,t("queue")],[9,t("ivr")]]}},{header:t("buycost"),dataIndex:"buycost",renderer:Helper.Util.formatMoneyDecimal4,flex:3,hidden:App.user.isClient||App.user.isAgent,hideable:!App.user.isClient&&!App.user.isAgent},{header:t("sessionbill"),dataIndex:"sessionbill",renderer:Helper.Util.formatMoneyDecimal4,flex:3,hidden:App.user.isAgent||App.user.isClientAgent,hideable:!App.user.isAgent&&!App.user.isClientAgent},{header:t("buycost"),dataIndex:"sessionbill",renderer:Helper.Util.formatMoneyDecimal4,flex:3,hidden:!App.user.isAgent,hideable:App.user.isAgent},{header:t("sessionbill"),dataIndex:"agent_bill",renderer:Helper.Util.formatMoneyDecimal4,flex:3,hidden:!App.user.isAgent,hideable:App.user.isAgent},{header:t("sessionbill"),dataIndex:"agent_bill",renderer:Helper.Util.formatMoneyDecimal4,flex:3,hidden:!App.user.isClientAgent,hideable:App.user.isClientAgent},{header:t("uniqueid"),dataIndex:"uniqueid",flex:3,hidden:true,hideable:true}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callarchivelist"],["component","box","container","panel","tablepanel","gridpanel","grid","callarchivelist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callarchivelist:true},["widget.callarchivelist"],0,[MBilling.view.callArchive,"List"],0));(Ext.cmd.derive("MBilling.view.callArchive.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["calledstation"],initComponent:function(){var b=this;b.items=[{name:"calledstation",fieldLabel:t("number"),readOnly:true},{name:"sessiontime",fieldLabel:t("sessiontime"),readOnly:App.user.isClient||App.user.isAgent,hidden:App.user.isClient||App.user.isAgent},{xtype:"moneyfield",name:"buycost",fieldLabel:t("buycost"),mask:App.user.currency+" #9.999.990,"+App.user.decimalPrecision,hidden:App.user.isClient||App.user.isAgent},{xtype:"moneyfield",name:"sessionbill",fieldLabel:t("sessionbill"),mask:App.user.currency+" #9.999.990,"+App.user.decimalPrecision,readOnly:App.user.isClient||App.user.isAgent,hidden:App.user.isAgent||App.user.isClientAgent},{xtype:"moneyfield",name:"agent_bill",fieldLabel:t("sessionbill"),mask:App.user.currency+" #9.999.990,"+App.user.decimalPrecision,readOnly:App.user.isAgent,hidden:!App.user.isAgent&&!App.user.isClientAgent}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callarchiveform"],["component","box","container","panel","form","callarchiveform"],{component:true,box:true,container:true,panel:true,form:true,callarchiveform:true},["widget.callarchiveform"],0,[MBilling.view.callArchive,"Form"],0));(Ext.cmd.derive("MBilling.view.callFailed.Controller",Ext.ux.app.ViewController,{formHidden:true},0,0,0,0,["controller.callfailed"],0,[MBilling.view.callFailed,"Controller"],0));(Ext.cmd.derive("MBilling.view.callFailed.Module",Ext.ux.panel.Module,{controller:"callfailed"},0,["callfailedmodule"],["component","box","container","uxpanelmodule","callfailedmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callfailedmodule:true},["widget.callfailedmodule"],0,[MBilling.view.callFailed,"Module"],0));(Ext.cmd.derive("MBilling.view.callFailed.List",Ext.ux.grid.Panel,{store:"CallFailed",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.allowCreate=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"starttime",flex:4},{header:t("Sip Account"),dataIndex:"src",flex:3},{header:t("CallerId"),dataIndex:"callerid",flex:3,hidden:true,hideable:true},{header:t("number"),dataIndex:"calledstation",flex:3},{header:t("destination"),dataIndex:"idPrefixdestination",flex:4},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:2,hidden:App.user.isClient,hideable:!App.user.isClient},{xtype:"templatecolumn",tpl:"{idTrunktrunkcode}",header:t("trunk"),dataIndex:"id_trunk",comboFilter:"trunkcombo",header:t("trunk"),flex:4,hidden:App.user.isClient||App.user.isAgent,hideable:!App.user.isClient&&!App.user.isAgent},{header:t("status"),dataIndex:"terminatecauseid",renderer:Helper.Util.formatDialStatus,flex:2,filter:{type:"list",options:[[1,t("answer")],[2,t("busy")],[3,t("no")+" "+t("answer")],[4,t("cancelcall")],[5,"congestion"],[6,"chanunavail"],[7,"dontcall"],[8,"torture"],[9,"invalidargs"]]}},{header:t("HangupCause"),dataIndex:"hangupcause",hidden:!window.dialC,flex:2},{header:t("type"),dataIndex:"sipiax",renderer:Helper.Util.formatCallType,flex:2,filter:{type:"list",options:[[0,t("standard")],[1,t("sipcall")],[2,t("did")],[3,t("didvoip")],[4,t("callback")],[5,t("callcenter")],[6,"sms"],[7,t("transfer")]]}},{header:t("uniqueid"),dataIndex:"uniqueid",flex:3,hidden:true,hideable:true}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callfailedlist"],["component","box","container","panel","tablepanel","gridpanel","grid","callfailedlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callfailedlist:true},["widget.callfailedlist"],0,[MBilling.view.callFailed,"List"],0));(Ext.cmd.derive("MBilling.view.callFailed.Form",Ext.ux.form.Panel,{},0,["callfailedform"],["component","box","container","panel","form","callfailedform"],{component:true,box:true,container:true,panel:true,form:true,callfailedform:true},["widget.callfailedform"],0,[MBilling.view.callFailed,"Form"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerDay.Controller",Ext.ux.app.ViewController,{onEdit:function(){me=this;me.sumData=me.store.getData().items[0].getData();if(!me.sumData){return}me.formPanel.getForm().getFields().each(function(b){b.setValue(me.sumData[b.name])});me.formPanel.expand()}},0,0,0,0,["controller.callsummaryperday"],0,[MBilling.view.callSummaryPerDay,"Controller"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerDay.Module",Ext.ux.panel.Module,{controller:"callsummaryperday",titleDetails:t("total"),iconForm:"icon-sum",cfgEast:{flex:0.4}},0,["callsummaryperdaymodule"],["component","box","container","uxpanelmodule","callsummaryperdaymodule"],{component:true,box:true,container:true,uxpanelmodule:true,callsummaryperdaymodule:true},["widget.callsummaryperdaymodule"],0,[MBilling.view.callSummaryPerDay,"Module"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerDay.List",Ext.ux.grid.Panel,{store:"CallSummaryPerDay",initComponent:function(){var b=this;b.buttonImportCsv=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{header:t("day"),renderer:Ext.util.Format.dateRenderer("Y-m-d"),dataIndex:"day",filter:{type:"date",field:"day"},flex:3},{header:t("sessiontime")+" "+t("Min"),dataIndex:"sessiontime",flex:2},{header:t("aloc_all_calls"),dataIndex:"aloc_all_calls",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Answered Calls"),dataIndex:"nbcall",flex:3},{header:t("Failed Calls"),dataIndex:"nbcall_fail",flex:3},{header:t("buycost"),dataIndex:"buycost",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("sessionbill"),dataIndex:"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("markup"),dataIndex:"lucro",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("ASR"),dataIndex:"asr",renderer:Helper.Util.formatPorcente,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummaryperdaylist"],["component","box","container","panel","tablepanel","gridpanel","grid","callsummaryperdaylist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callsummaryperdaylist:true},["widget.callsummaryperdaylist"],0,[MBilling.view.callSummaryPerDay,"List"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerDay.Form",Ext.ux.form.Panel,{defaults:{},labelWidthFields:100,defaultType:"displayfield",initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{name:"sumsessiontime",fieldLabel:t("sessiontime")+" "+t("Min"),renderer:Ext.util.Format.numberRenderer("0"),allowBlank:true},{name:"sumsessionbill",fieldLabel:t("sessionbill"),renderer:Helper.Util.formatMoneyDecimal,allowBlank:true},{name:"sumbuycost",fieldLabel:t("buycost"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumlucro",fieldLabel:t("markup"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumnbcall",fieldLabel:t("Answered Calls"),allowBlank:true},{name:"sumnbcallfail",fieldLabel:t("Failed Calls"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummaryperdayform"],["component","box","container","panel","form","callsummaryperdayform"],{component:true,box:true,container:true,panel:true,form:true,callsummaryperdayform:true},["widget.callsummaryperdayform"],0,[MBilling.view.callSummaryPerDay,"Form"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerMonth.Controller",Ext.ux.app.ViewController,{onEdit:function(){me=this;me.sumData=me.store.getData().items[0].getData();if(!me.sumData){return}me.formPanel.getForm().getFields().each(function(b){b.setValue(me.sumData[b.name])});me.formPanel.expand()}},0,0,0,0,["controller.callsummarypermonth"],0,[MBilling.view.callSummaryPerMonth,"Controller"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerMonth.Module",Ext.ux.panel.Module,{controller:"callsummarypermonth",titleDetails:t("total"),iconForm:"icon-sum",cfgEast:{flex:0.4}},0,["callsummarypermonthmodule"],["component","box","container","uxpanelmodule","callsummarypermonthmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callsummarypermonthmodule:true},["widget.callsummarypermonthmodule"],0,[MBilling.view.callSummaryPerMonth,"Module"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerMonth.List",Ext.ux.grid.Panel,{store:"CallSummaryPerMonth",initComponent:function(){var b=this;b.buttonImportCsv=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{header:t("month"),dataIndex:"month",filter:{type:"date",field:"month",dateFormat:"Ym"},flex:3},{header:t("sessiontime")+" "+t("Min"),dataIndex:"sessiontime",flex:2},{header:t("aloc_all_calls"),dataIndex:"aloc_all_calls",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("nbcall"),dataIndex:"nbcall",flex:3},{header:t("buycost"),dataIndex:"buycost",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("sessionbill"),dataIndex:"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("markup"),dataIndex:"lucro",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarypermonthlist"],["component","box","container","panel","tablepanel","gridpanel","grid","callsummarypermonthlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callsummarypermonthlist:true},["widget.callsummarypermonthlist"],0,[MBilling.view.callSummaryPerMonth,"List"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerMonth.Form",Ext.ux.form.Panel,{defaults:{},labelWidthFields:100,defaultType:"displayfield",initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{name:"sumsessiontime",fieldLabel:t("sessiontime")+" "+t("Min"),renderer:Ext.util.Format.numberRenderer("0"),allowBlank:true},{name:"sumsessionbill",fieldLabel:t("sessionbill"),renderer:Helper.Util.formatMoneyDecimal,allowBlank:true},{name:"sumbuycost",fieldLabel:t("buycost"),renderer:Helper.Util.formatMoneyDecimal,hidden:App.user.isClient,allowBlank:true},{name:"sumlucro",fieldLabel:t("markup"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumnbcall",fieldLabel:t("nbcall"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarypermonthform"],["component","box","container","panel","form","callsummarypermonthform"],{component:true,box:true,container:true,panel:true,form:true,callsummarypermonthform:true},["widget.callsummarypermonthform"],0,[MBilling.view.callSummaryPerMonth,"Form"],0));(Ext.cmd.derive("MBilling.view.callSummaryMonthUser.Controller",Ext.ux.app.ViewController,{onEdit:function(){me=this;me.sumData=me.store.getData().items[0].getData();if(!me.sumData){return}me.formPanel.getForm().getFields().each(function(b){b.setValue(me.sumData[b.name])});me.formPanel.expand()}},0,0,0,0,["controller.callsummarymonthuser"],0,[MBilling.view.callSummaryMonthUser,"Controller"],0));(Ext.cmd.derive("MBilling.view.callSummaryMonthUser.Module",Ext.ux.panel.Module,{controller:"callsummarymonthuser",titleDetails:t("total"),iconForm:"icon-sum",cfgEast:{flex:0.4}},0,["callsummarymonthusermodule"],["component","box","container","uxpanelmodule","callsummarymonthusermodule"],{component:true,box:true,container:true,uxpanelmodule:true,callsummarymonthusermodule:true},["widget.callsummarymonthusermodule"],0,[MBilling.view.callSummaryMonthUser,"Module"],0));(Ext.cmd.derive("MBilling.view.callSummaryMonthUser.List",Ext.ux.grid.Panel,{store:"CallSummaryMonthUser",initComponent:function(){var b=this;b.buttonImportCsv=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{header:t("Month"),renderer:Ext.util.Format.dateRenderer("Y-m"),dataIndex:"month",filter:{type:"date",field:"month",dateFormat:"Ym"},flex:3},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("sessiontime")+" "+t("Min"),dataIndex:"sessiontime",flex:2},{header:t("aloc_all_calls"),dataIndex:"aloc_all_calls",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Answered Calls"),dataIndex:"nbcall",flex:3},{header:t("buycost"),dataIndex:App.user.isAdmin?"buycost":"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("sessionbill"),dataIndex:App.user.isAgent||App.user.isClientAgent?"agent_bill":"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("markup"),dataIndex:"lucro",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarymonthuserlist"],["component","box","container","panel","tablepanel","gridpanel","grid","callsummarymonthuserlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callsummarymonthuserlist:true},["widget.callsummarymonthuserlist"],0,[MBilling.view.callSummaryMonthUser,"List"],0));(Ext.cmd.derive("MBilling.view.callSummaryMonthUser.Form",Ext.ux.form.Panel,{defaults:{},labelWidthFields:100,defaultType:"displayfield",initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{name:"sumsessiontime",fieldLabel:t("sessiontime")+" "+t("Min"),renderer:Ext.util.Format.numberRenderer("0"),allowBlank:true},{name:App.user.isAgent||App.user.isClientAgent?"sumagent_bill":"sumsessionbill",fieldLabel:t("sessionbill"),renderer:Helper.Util.formatMoneyDecimal,allowBlank:true},{name:App.user.isAdmin?"sumbuycost":"sumsessionbill",fieldLabel:t("buycost"),renderer:Helper.Util.formatMoneyDecimal,hidden:App.user.isClient,allowBlank:true},{name:"sumlucro",fieldLabel:t("markup"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmint,allowBlank:true},{name:"sumnbcall",fieldLabel:t("nbcall"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarymonthuserform"],["component","box","container","panel","form","callsummarymonthuserform"],{component:true,box:true,container:true,panel:true,form:true,callsummarymonthuserform:true},["widget.callsummarymonthuserform"],0,[MBilling.view.callSummaryMonthUser,"Form"],0));(Ext.cmd.derive("MBilling.view.callSummaryMonthTrunk.Controller",Ext.ux.app.ViewController,{onEdit:function(){me=this;me.sumData=me.store.getData().items[0].getData();if(!me.sumData){return}me.formPanel.getForm().getFields().each(function(b){b.setValue(me.sumData[b.name])});me.formPanel.expand()}},0,0,0,0,["controller.callsummarymonthtrunk"],0,[MBilling.view.callSummaryMonthTrunk,"Controller"],0));(Ext.cmd.derive("MBilling.view.callSummaryMonthTrunk.Module",Ext.ux.panel.Module,{controller:"callsummarymonthtrunk",titleDetails:t("total"),iconForm:"icon-sum",cfgEast:{flex:0.4}},0,["callsummarymonthtrunkmodule"],["component","box","container","uxpanelmodule","callsummarymonthtrunkmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callsummarymonthtrunkmodule:true},["widget.callsummarymonthtrunkmodule"],0,[MBilling.view.callSummaryMonthTrunk,"Module"],0));(Ext.cmd.derive("MBilling.view.callSummaryMonthTrunk.List",Ext.ux.grid.Panel,{store:"CallSummaryMonthTrunk",initComponent:function(){var b=this;b.buttonImportCsv=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{header:t("Month"),renderer:Ext.util.Format.dateRenderer("Y-m"),dataIndex:"month",filter:{type:"date",field:"month",dateFormat:"Ym"},flex:3},{header:t("Trunk"),dataIndex:"idTrunktrunkcode",filter:{type:"string",field:"idTrunk.trunkcode"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("sessiontime")+" "+t("Min"),dataIndex:"sessiontime",flex:2},{header:t("aloc_all_calls"),dataIndex:"aloc_all_calls",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Answered Calls"),dataIndex:"nbcall",flex:3},{header:t("buycost"),dataIndex:"buycost",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("sessionbill"),dataIndex:"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("markup"),dataIndex:"lucro",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarymonthtrunklist"],["component","box","container","panel","tablepanel","gridpanel","grid","callsummarymonthtrunklist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callsummarymonthtrunklist:true},["widget.callsummarymonthtrunklist"],0,[MBilling.view.callSummaryMonthTrunk,"List"],0));(Ext.cmd.derive("MBilling.view.callSummaryMonthTrunk.Form",Ext.ux.form.Panel,{defaults:{},labelWidthFields:100,defaultType:"displayfield",initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{name:"sumsessiontime",fieldLabel:t("sessiontime")+" "+t("Min"),renderer:Ext.util.Format.numberRenderer("0"),allowBlank:true},{name:"sumsessionbill",fieldLabel:t("sessionbill"),renderer:Helper.Util.formatMoneyDecimal,allowBlank:true},{name:"sumbuycost",fieldLabel:t("buycost"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumlucro",fieldLabel:t("markup"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumnbcall",fieldLabel:t("nbcall"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarymonthtrunkform"],["component","box","container","panel","form","callsummarymonthtrunkform"],{component:true,box:true,container:true,panel:true,form:true,callsummarymonthtrunkform:true},["widget.callsummarymonthtrunkform"],0,[MBilling.view.callSummaryMonthTrunk,"Form"],0));(Ext.cmd.derive("MBilling.view.sms.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.sms"],0,[MBilling.view.sms,"Controller"],0));(Ext.cmd.derive("MBilling.view.sms.Module",Ext.ux.panel.Module,{controller:"sms"},0,["smsmodule"],["component","box","container","uxpanelmodule","smsmodule"],{component:true,box:true,container:true,uxpanelmodule:true,smsmodule:true},["widget.smsmodule"],0,[MBilling.view.sms,"Module"],0));(Ext.cmd.derive("MBilling.view.sms.List",Ext.ux.grid.Panel,{store:"Sms",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.allowUpdate=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("send"),dataIndex:"result",renderer:Helper.Util.formatBooleanSms,comboRelated:"statuscombo",flex:2,filter:{type:"list",options:[[0,t("error")],[1,t("sent")],[2,t("received")]]}},{header:t("destination"),dataIndex:"telephone",flex:2},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"date",flex:5},{header:t("description"),dataIndex:"sms",hidden:true,hideable:true,flex:6}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["smslist"],["component","box","container","panel","tablepanel","gridpanel","grid","smslist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,smslist:true},["widget.smslist"],0,[MBilling.view.sms,"List"],0));(Ext.cmd.derive("MBilling.view.sms.Form",Ext.ux.form.Panel,{fieldsHide:["id_user"],initComponent:function(){var b=this;b.items=[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:App.user.isClient},{xtype:"numberfield",name:"telephone",fieldLabel:t("number"),emptyText:"DDI DDD Nº",maxLength:16,minLength:11},{xtype:"textareafield",name:"sms",fieldLabel:t("sms"),maxLength:160}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["smsform"],["component","box","container","panel","form","smsform"],{component:true,box:true,container:true,panel:true,form:true,smsform:true},["widget.smsform"],0,[MBilling.view.sms,"Form"],0));(Ext.cmd.derive("MBilling.view.campaignPollInfo.Controller",Ext.ux.app.ViewController,{aliasChart:"campaignpollinfochart",onRenderModule:function(){var c=this,d=c.lookupReference("chart");Ext.ux.app.ViewController.prototype.onRenderModule.apply(this,arguments);c.store.on({scope:c,beforeload:function(){d.disable()},load:function(a){d.enable()}})},onChart:function(){var l=this,f=l.list.getStore(),m=l.list.filters.getFilterData(),j=false,g=false;if(!m){Ext.ux.Alert.alert("Alert",t("Use filters"),"information");return}Ext.each(m,function(a){if(a.field=="id_campaign_poll"){if(a.data.value.length==1){g=true}j=true;return}});if(!j){Ext.ux.Alert.alert("Alert",t("Select one or more poll to create a chart"),"information");return}l.chart=Ext.widget("window",{title:t("charts"),iconCls:"icon-chart-column",layout:"fit",autoShow:true,modal:true,resizable:false,width:window.isThemeNeptune?740:710,items:{xtype:l.aliasChart,titleText:g?f.getData().items[0].data.idCampaignPollname:"",list:l.list}})}},0,0,0,0,["controller.campaignpollinfo"],0,[MBilling.view.campaignPollInfo,"Controller"],0));(Ext.cmd.derive("MBilling.view.campaignPollInfo.Module",Ext.ux.panel.Module,{controller:"campaignpollinfo"},0,["campaignpollinfomodule"],["component","box","container","uxpanelmodule","campaignpollinfomodule"],{component:true,box:true,container:true,uxpanelmodule:true,campaignpollinfomodule:true},["widget.campaignpollinfomodule"],0,[MBilling.view.campaignPollInfo,"Module"],0));(Ext.cmd.derive("MBilling.view.campaignPollInfo.List",Ext.ux.grid.Panel,{store:"CampaignPollInfo",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.allowCreate=false;b.extraButtons=[{text:t("charts"),iconCls:"icon-chart-column",handler:"onChart",reference:"chart",disabled:true}];b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("number"),dataIndex:"number",flex:4},{xtype:"templatecolumn",tpl:"{idCampaignPollname}",header:t("poll"),dataIndex:"id_campaign_poll",comboFilter:"campaignpollcombo",flex:4},{header:t("result"),dataIndex:"resposta",flex:4},{header:t("description"),dataIndex:"obs",flex:4},{header:t("City"),dataIndex:"city",flex:4},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"date",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignpollinfolist"],["component","box","container","panel","tablepanel","gridpanel","grid","campaignpollinfolist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,campaignpollinfolist:true},["widget.campaignpollinfolist"],0,[MBilling.view.campaignPollInfo,"List"],0));(Ext.cmd.derive("MBilling.view.campaignPollInfo.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{name:"number",fieldLabel:t("number"),readOnly:true},{name:"resposta",fieldLabel:t("result"),readOnly:true},{xtype:"textareafield",name:"obs",fieldLabel:t("description"),allowBlank:true,maxLength:200}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignpollinfoform"],["component","box","container","panel","form","campaignpollinfoform"],{component:true,box:true,container:true,panel:true,form:true,campaignpollinfoform:true},["widget.campaignpollinfoform"],0,[MBilling.view.campaignPollInfo,"Form"],0));(Ext.cmd.derive("MBilling.view.campaignPollInfo.Chart",Ext.ux.panel.Chart,{controller:"campaignpollinfo",store:"CampaignPollInfoChart",fieldValue:"sumresposta",fieldDescription:"resposta2",labelYLine:t("countvotes"),labelXLine:t("result"),fieldLabel:"percentage",initComponent:function(){var d=this,c;if(window.newChartCampaignInfo){d.fieldDescription="resposta_name"}d.bbarChart=[{xtype:"tbtext",itemId:"tbTextSum",reference:"tbTextSum"}];d.store=Ext.data.StoreManager.lookup(d.store);d.store.setRemoteFilter(true);filters=d.list.filters.getFilterData();d.store.filter("filter",Ext.encode(filters));d.store.load({scope:d,callback:function(){if(d.store.getData().items[0]){d.sumData=d.store.getData().items[0].getData()}if(window.newChartCampaignInfo){d.lookupReference("tbTextSum").setText(d.sumData.total_votos)}}});Ext.ux.panel.Chart.prototype.initComponent.apply(this,arguments)}},0,["campaignpollinfochart"],["component","box","container","panel","chartpanel","campaignpollinfochart"],{component:true,box:true,container:true,panel:true,chartpanel:true,campaignpollinfochart:true},["widget.campaignpollinfochart"],0,[MBilling.view.campaignPollInfo,"Chart"],0));(Ext.cmd.derive("MBilling.view.campaignRestrictPhone.Controller",Ext.ux.app.ViewController,{onEdit:function(){var b=this;Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)},deleteDuplicados:function(e){var g=this,f=g.list.getStore(),j=g.list.filters.getFilterData().length?Ext.encode(g.getList().filters.getFilterData()):f.proxy.extraParams.filter;e.disable();g.list.setLoading(true);Ext.Msg.confirm("Confirm","Confirme que quer deletar os numeros duplicados?",function(a){if(a==="yes"){Ext.Ajax.request({url:"index.php/campaignRestrictPhone/deleteDuplicados/",params:{filter:j},scope:g,success:function(c){c=Ext.decode(c.responseText);if(c[g.nameSuccessRequest]){Ext.ux.Alert.alert(g.titleSuccess,c[g.nameMsgRequest],"success")}else{var b=Helper.Util.convertErrorsJsonToString(c[g.nameMsgRequest]);Ext.ux.Alert.alert(g.titleError,b,"error")}g.list.setLoading(false);e.enable()}})}})}},0,0,0,0,["controller.campaignrestrictphone"],0,[MBilling.view.campaignRestrictPhone,"Controller"],0));(Ext.cmd.derive("MBilling.view.campaignRestrictPhone.Module",Ext.ux.panel.Module,{controller:"campaignrestrictphone"},0,["campaignrestrictphonemodule"],["component","box","container","uxpanelmodule","campaignrestrictphonemodule"],{component:true,box:true,container:true,uxpanelmodule:true,campaignrestrictphonemodule:true},["widget.campaignrestrictphonemodule"],0,[MBilling.view.campaignRestrictPhone,"Module"],0));(Ext.cmd.derive("MBilling.view.campaignRestrictPhone.List",Ext.ux.grid.Panel,{store:"CampaignRestrictPhone",buttonImportCsv:true,initComponent:function(){var b=this;b.extraButtons=[{text:t("Eliminar Duplicados"),iconCls:"callshop",handler:"deleteDuplicados",disabled:false}];b.buttonUpdateLot=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("number"),dataIndex:"number",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignrestrictphonelist"],["component","box","container","panel","tablepanel","gridpanel","grid","campaignrestrictphonelist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,campaignrestrictphonelist:true},["widget.campaignrestrictphonelist"],0,[MBilling.view.campaignRestrictPhone,"List"],0));(Ext.cmd.derive("MBilling.view.campaignRestrictPhone.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{name:"number",fieldLabel:t("number")}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignrestrictphoneform"],["component","box","container","panel","form","campaignrestrictphoneform"],{component:true,box:true,container:true,panel:true,form:true,campaignrestrictphoneform:true},["widget.campaignrestrictphoneform"],0,[MBilling.view.campaignRestrictPhone,"Form"],0));(Ext.cmd.derive("MBilling.view.campaignRestrictPhone.ImportCsv",Ext.ux.window.ImportCsv,{htmlTipInfo:"
number
551135672677
551156332233
554153882200
"},0,["campaignrestrictphoneimportcsv"],["component","box","container","panel","window","campaignrestrictphoneimportcsv"],{component:true,box:true,container:true,panel:true,window:true,campaignrestrictphoneimportcsv:true},["widget.campaignrestrictphoneimportcsv"],0,[MBilling.view.campaignRestrictPhone,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.campaignLog.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.campaignlog"],0,[MBilling.view.campaignLog,"Controller"],0));(Ext.cmd.derive("MBilling.view.campaignLog.Module",Ext.ux.panel.Module,{controller:"campaignlog"},0,["campaignlogmodule"],["component","box","container","uxpanelmodule","campaignlogmodule"],{component:true,box:true,container:true,uxpanelmodule:true,campaignlogmodule:true},["widget.campaignlogmodule"],0,[MBilling.view.campaignLog,"Module"],0));(Ext.cmd.derive("MBilling.view.campaignLog.List",Ext.ux.grid.Panel,{store:"CampaignLog",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.buttonNew=false;b.allowUpdate=false;b.allowDelete=!App.user.isClient;b.columns=[{header:t("Total gerado"),dataIndex:"total",flex:4},{header:t("Loops"),dataIndex:"loops",flex:4},{header:t("Total por tronco"),dataIndex:"trunks",flex:4},{header:t("Campanhas"),dataIndex:"campaigns",flex:4},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"date",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignloglist"],["component","box","container","panel","tablepanel","gridpanel","grid","campaignloglist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,campaignloglist:true},["widget.campaignloglist"],0,[MBilling.view.campaignLog,"List"],0));(Ext.cmd.derive("MBilling.view.campaignLog.Form",Ext.ux.form.Panel,{bodyPadding:0,initComponent:function(){var b=this;b.items=[{name:"total",fieldLabel:t("total")}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignlogform"],["component","box","container","panel","form","campaignlogform"],{component:true,box:true,container:true,panel:true,form:true,campaignlogform:true},["widget.campaignlogform"],0,[MBilling.view.campaignLog,"Form"],0));(Ext.cmd.derive("MBilling.view.campaignSend.Module",Ext.form.Panel,{controller:"campaignsend",resizable:false,autoShow:true,header:false,initComponent:function(){var b=this;b.items=[{reference:"campaignSendPanel",xtype:"form",margin:"10 10 10 10",autoShow:true,closable:false,resizable:false,bodyPadding:10,defaultType:"textfield",defaults:{labelAlign:"right",labelWidth:150,width:280,allowBlank:false,msgTarget:"side",enableKeyEvents:true,plugins:"markallowblank",anchor:"100%"},items:[{xtype:"campaignsendcombo",name:"type",fieldLabel:t("campaign")+" "+t("type")},{name:"sms_text",fieldLabel:"SMS "+t("Text"),xtype:"textarea",height:100,anchor:"100%",allowBlank:true,hidden:true,maxLength:159},{xtype:"filefield",emptyText:"Select an audio file",fieldLabel:t("Audio file"),name:"audio_path",buttonText:"",buttonConfig:{iconCls:"upload-icon"},buttonText:t("Select Audio..."),allowBlank:true,hidden:true},{xtype:"filefield",emptyText:"Select an csv file",fieldLabel:t("CSV file"),name:"csv_path",allowBlank:true,hidden:true},{name:"numbers",fieldLabel:t("numbers"),xtype:"textarea",height:100,anchor:"100%",allowBlank:true,hidden:true},{xtype:"datefield",name:"startingdate",fieldLabel:t("Date"),format:"Y-m-d",value:new Date(),allowBlank:true,hidden:true},{xtype:"timefield",name:"startingtime",fieldLabel:t("Hour"),format:"H:i",value:"00:00",allowBlank:true,hidden:true}],bbar:[{width:"150px",text:t("Send"),tooltip:t("Send"),glyph:icons.disk,handler:"onSendCampaign"}]}];Ext.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignsendmodule"],["component","box","container","panel","form","campaignsendmodule"],{component:true,box:true,container:true,panel:true,form:true,campaignsendmodule:true},["widget.campaignsendmodule"],0,[MBilling.view.campaignSend,"Module"],0));(Ext.cmd.derive("MBilling.view.callShop.Controller",Ext.ux.app.ViewController,{sendActionNew:function(d){var c=this;d.disable();id=d.reference.split("_");getForm=c.lookupReference("cabina"+id[1]).getForm();Ext.Ajax.request({url:d.urlAction+"?id="+getForm.findField("id").getValue(),success:function(a){a=Ext.decode(a.responseText);if(a.success){Ext.ux.Alert.alert(c.titleSuccess,a[c.nameMsgRequest],"success")}else{Ext.ux.Alert.alert(c.titleError,errors,"error")}}});d.enable();storeCallShop=Ext.create("MBilling.store.CallShop",{remoteSort:false});storeCallShop.load({callback:function(a){c.onShowCabins(a,id[1],getForm)}})},onShowCabins:function(e,f,d){me=this;row=e[f-1];if(tab=me.lookupReference("tab"+f)){name=row.data.callerid.length<1?row.data.name:row.data.callerid;status=Helper.Util.formatBooleanFree(row.data.status);tab.setTitle(t("Cabina")+" "+f+" - "+name+" "+status);tab.setVisible(true);d.loadRecord(row)}},reportCallshopClientNew:function(d){var c=this;id=d.reference.split("_");getForm=c.lookupReference("cabina"+id[1]).getForm();columns=Ext.encode([{header:t("Number"),dataIndex:"calledstation"},{header:t("Time"),dataIndex:"sessiontime"},{header:t("Total"),dataIndex:"price"}]);filter=Ext.encode([{type:"string",comparison:"eq",value:getForm.findField("name").getValue(),field:"cabina"},{type:"list",value:[0],field:"status"}]);values="columns="+columns+"&filter="+filter+"&sort=[]&group=&orientation=P";url="index.php/callShopCdr/report/?"+values;window.open(url)},sendAction:function(f){var j=this,e=j.list.getSelectionModel().getSelection()[0],g=Ext.encode([{type:"string",comparison:"eq",value:e.get("name"),field:"cabina"},{type:"list",value:[0],field:"status"}]);j.formPanel.setLoading(true);Ext.Ajax.request({url:f.urlAction,params:{filter:g},success:function(b){b=Ext.decode(b.responseText);var a=Helper.Util.convertErrorsJsonToString(b[j.nameMsgRequest]),d=j.list.getStore(),c=j.list.getSelectionModel();if(b.success){j.onEdit();d.load({callback:function(){c.select(d.findExact("id",e.get("id")));j.formPanel.setLoading(false)}});Ext.ux.Alert.alert(j.titleSuccess,b[j.nameMsgRequest],"success")}else{Ext.ux.Alert.alert(j.titleError,a,"error");j.formPanel.setLoading(false);c.select(d.findExact("id",e.get("id")))}}})},onEdit:function(){if(!this.list.getSelectionModel().getSelection().length){return}var q=this,r=q.list.getSelectionModel().getSelection()[0],n=[{type:"string",comparison:"eq",value:r.get("name"),field:"cabina"},{type:"list",value:[0],field:"status"}],u=q.formPanel.down("callshopcdrlist").getStore(),v=q.formPanel.down("#priceSum"),m=u.proxy.extraParams.filter,p=q.formPanel.down("#charge"),s=q.formPanel.down("#release"),o=q.formPanel.down("#print");v.setText(" "+t("pricesum")+" 0.00");q.formPanel.expand();p.enable();s.enable();o.enable();u.proxy.extraParams.filter=n;u.load({callback:function(a){if(a){a[0]&&v.setText(" "+t("pricesum")+" "+t("moedasimblo")+" "+a[0].get("priceSum")+" ")}}});console.log(r.get("callerid")+", "+r.get("name"));u.defaultFilter=m;q.showHideFields();q.focusFirstField()},reportCallshopClient:function(E){var w=this,s=window.isDesktop&&App.desktop,y=!window.isDesktop&&w.list.module.ownerCt,v=w.formPanel.down("callshopcdrlist").getStore(),x=v.sorters.items,A=w.list.getSelectionModel().getSelection()[0],F=Ext.encode([{type:"string",comparison:"eq",value:A.get("name"),field:"cabina"},{type:"list",value:[0],field:"status"}]),u=w.store.getGroupField(),B=w.formPanel.down("callshopcdrlist").columns,G="desc",D=w.formPanel.down("callshopcdrlist").getStore().getProxy().api.report,H,z=[],C=[];Ext.each(x,function(a){z.push(a.property+" "+(a.direction||"ASC"))});Ext.each(B,function(a){if(a.hidden===false&&a.isCheckerHd!==true){if(a.dataIndex===u){C.splice(0,0,{header:a.text,dataIndex:a.dataIndex})}else{C.push({header:a.text,dataIndex:a.dataIndex})}}});values="columns="+Ext.encode(C)+"&filter="+F+"&sort="+Ext.encode(z)+"&group="+u+"&orientation="+G;url="index.php/callShopCdr/report/?"+values;window.open(url)}},0,0,0,0,["controller.callshop"],0,[MBilling.view.callShop,"Controller"],0));(Ext.cmd.derive("MBilling.view.callShop.Module",Ext.ux.panel.Module,{controller:"callshop",cfgEast:{flex:4},collapsedForm:false,collapsibleForm:false},0,["callshopmodule"],["component","box","container","uxpanelmodule","callshopmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callshopmodule:true},["widget.callshopmodule"],0,[MBilling.view.callShop,"Module"],0));(Ext.cmd.derive("MBilling.view.callShop.Module2",Ext.form.Panel,{controller:"callshop",resizable:false,autoShow:true,header:false,autoScroll:true,initComponent:function(){var b=this;b.layout={type:"table",columns:3,tdAttrs:{style:"padding: 3px; vertical-align: top;"}};b.defaults={xtype:"panel",height:268,width:((Ext.Element.getViewportWidth()-200)/3)-10,closable:false,collapsible:true,frame:true};b.items=b.onMountPanels();storeCallShop=Ext.create("MBilling.store.CallShop",{remoteSort:false});if(!App.user.isClient){Ext.form.Panel.prototype.initComponent.apply(this,arguments);return}else{b.handler=setInterval(function(){storeCallShop.load({callback:function(a){b.onShowCabins(a)}})},5000);Ext.form.Panel.prototype.initComponent.apply(this,arguments);storeCallShop.load({callback:function(a){b.onShowCabins(a)}})}},onMountPanels:function(){me=this,items=[];if(!App.user.isClient){return}for(i=1;i<=12;i++){items.push({xtype:"tabpanel",reference:"tab"+i,title:t("Cabina")+i,collapsed:i>3,items:[{reference:"cabina"+i,title:t("Cabina"),xtype:"form",bodyPadding:10,defaults:{xtype:"displayfield",labelWidth:85},items:[{name:"id",hidden:true},{name:"name",hidden:true},{xtype:"fieldcontainer",layout:"hbox",items:[{xtype:"displayfield",fieldLabel:t("Number"),name:"callshopnumber",labelAlign:"right",labelWidth:50,renderer:function(b){return''+b+""},flex:2},{labelAlign:"right",labelWidth:90,xtype:"displayfield",readOnly:true,fieldLabel:t("total"),name:"total",labelStyle:"font-size:18px!important;font-weight:bold;",renderer:function(b){format=Ext.util.Format.numberRenderer("0."+App.user.decimalPrecision);return''+App.user.currency+" "+format(b)+""},flex:3}]},{fieldLabel:t("Destination"),name:"destination"},{fieldLabel:t("Price minute"),name:"price_min",renderer:Helper.Util.formatMoneyDecimal},{fieldLabel:t("Duration"),name:"callshoptime",renderer:Helper.Util.formatsecondsToTime},{border:false,xtype:"toolbar",hidden:me.hideBbar,dock:"bottom",items:[{bodyPadding:10,width:"33%",text:t("Charge"),itemId:"charge",iconCls:"buycredit",handler:"sendActionNew",reference:"cobrar_"+i,urlAction:"index.php/callShop/cobrar"},{width:"33%",text:t("Release"),itemId:"release",iconCls:"release",handler:"sendActionNew",reference:"liberar_"+i,urlAction:"index.php/callShop/liberar",hidden:window.releaseButton},{width:"33%",text:t("Print"),itemId:"print",iconCls:"icon-print",handler:"reportCallshopClientNew",reference:"report_"+i,urlAction:"index.php/callShop/report"}]}]},{reference:"history_"+i,tooltip:"history_"+i,iconCls:"x-fa fa-refresh",title:t("History"),autoScroll:true,items:[{xtype:"callshopcdrlist",buttonCsv:false,autoScroll:true,filterableColumns:false,buttonCleanFilter:false,autoLoadStore:false,border:false,allowCreate:false,allowUpdate:false,allowDelete:false,buttonUpdateLot:false,pagination:false,allowPrint:false,columnsHide:["cabina","destination","status","buycost","markup","date"],store:Ext.create("MBilling.store.CallShopCdr",{remoteFilter:true})}],tabConfig:{listeners:{click:function(b){id=b.tooltip.split("_");panel=me.lookupReference("history_"+id[1]);storeCallshopcdr=panel.down("callshopcdrlist").getStore();filterCabina=[{type:"string",comparison:"eq",value:me.lookupReference("cabina"+id[1]).getForm().findField("name").getValue(),field:"cabina"},{type:"list",value:[0],field:"status"}];storeCallshopcdr.load({filter:filterCabina,params:{filters:Ext.encode(filterCabina)},limit:70})}}}}]})}return items},onShowCabins:function(b){me=this,i=1;Ext.each(b,function(a){if(tab=me.lookupReference("tab"+i)){name=a.data.callerid.length<1?a.data.name:a.data.callerid;status=Helper.Util.formatBooleanFree(a.data.status);tab.setTitle(t("Cabina")+" "+i+" - "+name+" "+status);tab.setVisible(true);me.lookupReference("cabina"+i).getForm().loadRecord(a)}i++});for(i=b.length+1;i<=12;i++){tab=me.lookupReference("tab"+i).setVisible(false)}}},0,["callshop2module"],["component","box","container","panel","form","callshop2module"],{component:true,box:true,container:true,panel:true,form:true,callshop2module:true},["widget.callshop2module"],0,[MBilling.view.callShop,"Module2"],0));(Ext.cmd.derive("MBilling.view.callShop.List",Ext.ux.grid.Panel,{store:"CallShop",viewConfig:{loadMask:false,emptyText:'
'+t("No record found")+"
",getRowClass:function(b){if(App.user.l=="callshop"){if(b.get("status")==1){return"callshoFree"}else{if(b.get("status")==0){return"callshoBlock"}else{if(b.get("status")==2){return"callshoInUse"}else{if(b.get("status")==3){return"callshoInCall"}}}}}}},refreshTime:4,initComponent:function(){var b=this;b.buttonCsv=false;b.buttonUpdateLot=false;b.allowCreate=true;b.allowUpdate=true;b.allowDelete=true;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.allowPrint=false;b.buttonDeleteWidth=140;b.refreshTime=(localStorage&&localStorage.getItem("callshopfresh"))||b.refreshTime;b.extraButtons=[{xtype:"numberfield",field:"jmlhBrg",fieldLabel:t("Refresh Time"),editable:false,minValue:3,labelWidth:90,width:150,selectOnFocus:true,allowDecimals:true,decimalPrecision:2,value:b.refreshTime,listeners:{change:function(a){if(a.value>0){b.refreshTime=a.value;localStorage.setItem("callshopfresh",a.value)}}}}];b.columns=[{header:t("cabina"),dataIndex:"callerid",flex:4},{header:t("status"),dataIndex:"status",renderer:Helper.Util.formatBooleanFree,flex:3,filter:{type:"list",options:[[1,t("free")],[2,t("inuse")],[0,t("blocked")],[3,t("calling")]]}},{header:t("number"),dataIndex:"callshopnumber",flex:4},{header:t("Destino"),dataIndex:"callshopdestination",hidden:App.user.l!="callshop",flex:6},{header:t("sessiontime"),dataIndex:"callshoptime",renderer:Helper.Util.formatsecondsToTime,flex:3}];b.sessionLoad=Ext.create("Ext.util.DelayedTask",function(){b.store.load()},b);Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments);b.store.on("load",b.onLoadStore,b)},onLoadStore:function(){var b=this;b.onDeactivateModule();b.onActivateModule()},onRender:function(){var b=this;b.module.on("activate",b.onActivateModule,b);b.module.on("deactivate",b.onDeactivateModule,b);b.module.on("close",b.onCloseModule,b);Ext.ux.grid.Panel.prototype.onRender.apply(this,arguments)},onActivateModule:function(){this.sessionLoad&&this.sessionLoad.delay(this.refreshTime*1000)},onDeactivateModule:function(){this.sessionLoad&&this.sessionLoad.cancel()},onCloseModule:function(){this.onDeactivateModule();this.sessionLoad=null}},0,["callshoplist"],["component","box","container","panel","tablepanel","gridpanel","grid","callshoplist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callshoplist:true},["widget.callshoplist"],0,[MBilling.view.callShop,"List"],0));(Ext.cmd.derive("MBilling.view.callShop.Form",Ext.ux.form.Panel,{hideTbar:true,labelWidthFields:"60%",bodyPadding:1,layout:"fit",buttonsTbar:[{xtype:"tbtext",itemId:"priceSum"},"->",{text:"Cobrar",itemId:"charge",iconCls:"buycredit",urlAction:"index.php/callShop/cobrar",disabled:true,handler:"sendAction",width:100},{text:"Liberar",itemId:"release",iconCls:"release",urlAction:"index.php/callShop/liberar",disabled:true,handler:"sendAction",width:100},{text:t("Print"),itemId:"print",glyph:icons.print,urlAction:"index.php/callShop/report",disabled:true,handler:"reportCallshopClient",width:100}],initComponent:function(){var b=this;b.items=[{xtype:"callshopcdrlist",buttonCsv:false,filterableColumns:false,buttonCleanFilter:false,autoLoadStore:false,border:true,allowCreate:false,allowUpdate:false,allowDelete:false,buttonUpdateLot:false,pagination:false,allowPrint:false,columnsHide:["status","buycost","markup"],store:Ext.create("MBilling.store.CallShopCdr",{remoteSort:false})}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callshopform"],["component","box","container","panel","form","callshopform"],{component:true,box:true,container:true,panel:true,form:true,callshopform:true},["widget.callshopform"],0,[MBilling.view.callShop,"Form"],0));(Ext.cmd.derive("MBilling.view.callShopCdr.Controller",Ext.ux.app.ViewController,{formHidden:true},0,0,0,0,["controller.callshopcdr"],0,[MBilling.view.callShopCdr,"Controller"],0));(Ext.cmd.derive("MBilling.view.callShopCdr.Module",Ext.ux.panel.Module,{controller:"callshopcdr"},0,["callshopcdrmodule"],["component","box","container","uxpanelmodule","callshopcdrmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callshopcdrmodule:true},["widget.callshopcdrmodule"],0,[MBilling.view.callShopCdr,"Module"],0));(Ext.cmd.derive("MBilling.view.callShopCdr.List",Ext.ux.grid.Panel,{store:"CallShopCdr",initComponent:function(){var b=this;b.buttonCsv=false;b.buttonUpdateLot=false;b.allowUpdate=true;b.allowDelete=false;b.allowCreate=false;b.allowUpdate=false;b.allowPrint=false;b.columns=[{header:t("cabina"),dataIndex:"cabina",filter:{type:"string"},flex:2},{header:t("number"),dataIndex:"calledstation",filter:{type:"string"},flex:3},{dataIndex:"destination",header:t("destination"),flex:3},{header:"Pago",dataIndex:"status",renderer:Helper.Util.formattyyesno,flex:2,filter:{type:"list",options:[[0,t("no")],[1,t("yes")]]}},{header:t("buyrate"),dataIndex:"buycost",renderer:Helper.Util.formatMoneyDecimal,flex:2},{header:t("rateinitial"),dataIndex:"price",renderer:Helper.Util.formatMoneyDecimal,flex:2},{header:t("markup"),dataIndex:"markup",renderer:Ext.util.Format.numberRenderer("0.00 %"),flex:2},{header:t("sessiontime"),dataIndex:"sessiontime",renderer:Helper.Util.formatsecondsToTime,flex:2},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"date",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callshopcdrlist"],["component","box","container","panel","tablepanel","gridpanel","grid","callshopcdrlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callshopcdrlist:true},["widget.callshopcdrlist"],0,[MBilling.view.callShopCdr,"List"],0));(Ext.cmd.derive("MBilling.view.callShopCdr.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:App.user.isClient}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callshopcdrform"],["component","box","container","panel","form","callshopcdrform"],{component:true,box:true,container:true,panel:true,form:true,callshopcdrform:true},["widget.callshopcdrform"],0,[MBilling.view.callShopCdr,"Form"],0));(Ext.cmd.derive("MBilling.view.rateCallshop.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.ratecallshop"],0,[MBilling.view.rateCallshop,"Controller"],0));(Ext.cmd.derive("MBilling.view.rateCallshop.Module",Ext.ux.panel.Module,{controller:"ratecallshop"},0,["ratecallshopmodule"],["component","box","container","uxpanelmodule","ratecallshopmodule"],{component:true,box:true,container:true,uxpanelmodule:true,ratecallshopmodule:true},["widget.ratecallshopmodule"],0,[MBilling.view.rateCallshop,"Module"],0));(Ext.cmd.derive("MBilling.view.rateCallshop.List",Ext.ux.grid.Panel,{store:"RateCallshop",buttonImportCsv:true,initComponent:function(){var b=this;b.buttonImportCsv=App.user.isClient,b.buttonCsv=App.user.isClient;b.allowPrint=App.user.isClient;b.buttonUpdateLot=App.user.isClient;b.allowCreate=App.user.isClient;b.allowUpdate=App.user.isClient;b.allowDelete=App.user.isClient;b.buttonUpdateLotCallShopRate=App.user.isClient;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("dialprefix"),dataIndex:"dialprefix",filter:{type:"string"},flex:2},{header:t("destination"),dataIndex:"destination",flex:3},{header:t("rateinitial"),dataIndex:"buyrate",renderer:Helper.Util.formatMoneyDecimal4,flex:2},{header:t("buyrateinitblock"),dataIndex:"minimo",flex:2},{header:t("buyrateincrement"),dataIndex:"block",flex:2}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["ratecallshoplist"],["component","box","container","panel","tablepanel","gridpanel","grid","ratecallshoplist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,ratecallshoplist:true},["widget.ratecallshoplist"],0,[MBilling.view.rateCallshop,"List"],0));(Ext.cmd.derive("MBilling.view.rateCallshop.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{xtype:"numberfield",name:"dialprefix",fieldLabel:t("prefix")},{name:"destination",fieldLabel:t("destination")},{xtype:"moneyfield",name:"buyrate",fieldLabel:t("rateinitial")},{xtype:"numberfield",name:"minimo",value:1,minValue:1,fieldLabel:t("buyrateinitblock")},{xtype:"numberfield",name:"block",value:1,minValue:1,fieldLabel:t("buyrateincrement")},{xtype:"numberfield",name:"minimal_time_charge",value:0,minValue:0,fieldLabel:t("Minimal time to charge")}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["ratecallshopform"],["component","box","container","panel","form","ratecallshopform"],{component:true,box:true,container:true,panel:true,form:true,ratecallshopform:true},["widget.ratecallshopform"],0,[MBilling.view.rateCallshop,"Form"],0));(Ext.cmd.derive("MBilling.view.rateCallshop.ImportCsv",Ext.ux.window.ImportCsv,{htmlTipInfo:"
"+t("dialprefix")+", "+t("destination")+", "+t("rateinitial")+"
5511, Brasil SP, 0.080
34, Spain Fix, 0.056
54, Argentina, 0.025

"+t("rateinitial")+" "+t("and")+" "+t("buyrate")+""},0,["ratecallshopimportcsv"],["component","box","container","panel","window","ratecallshopimportcsv"],{component:true,box:true,container:true,panel:true,window:true,ratecallshopimportcsv:true},["widget.ratecallshopimportcsv"],0,[MBilling.view.rateCallshop,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.callSummaryCallShop.Controller",MBilling.view.callSummaryPerDay.Controller,{aliasChart:"callsummarycallshopchart"},0,0,0,0,["controller.callsummarycallshop"],0,[MBilling.view.callSummaryCallShop,"Controller"],0));(Ext.cmd.derive("MBilling.view.callSummaryCallShop.Module",Ext.ux.panel.Module,{controller:"callsummarycallshop",titleForm:t("total"),iconForm:"icon-sum",widthForm:250},0,["callsummarycallshopmodule"],["component","box","container","uxpanelmodule","callsummarycallshopmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callsummarycallshopmodule:true},["widget.callsummarycallshopmodule"],0,[MBilling.view.callSummaryCallShop,"Module"],0));(Ext.cmd.derive("MBilling.view.callSummaryCallShop.List",Ext.ux.grid.Panel,{store:"CallSummaryCallShop",initComponent:function(){var b=this;b.buttonImportCsv=false;b.buttonCsv=false;b.allowPrint=false;b.buttonUpdateLot=false;b.allowCreate=false;b.buttonCleanFilter=false;b.allowUpdate=false;b.allowDelete=false;b.extraButtons=[{text:t("charts"),iconCls:"icon-chart-column",handler:"onChart",reference:"chart",disabled:false,hidden:App.user.isClient}];b.collapsedExtraFilters=false;b.titleAddFilter=t("Filter");b.extraFilters=[{field:"t.cabina",label:t("cabina"),type:"string"},{field:"t.calledstation",label:t("prefix"),type:"string"}];b.columns=[{header:t("day"),renderer:Ext.util.Format.dateRenderer("Y-m-d"),dataIndex:"day",filter:{type:"date",field:"date"},flex:3},{menuDisabled:true,header:t("sessiontime")+" "+t("Min"),dataIndex:"sessiontime",flex:2},{menuDisabled:true,header:t("aloc_all_calls"),dataIndex:"aloc_all_calls",renderer:Helper.Util.formatsecondsToTime,flex:3},{menuDisabled:true,header:t("nbcall"),dataIndex:"nbcall",flex:3},{menuDisabled:true,header:t("buycost"),dataIndex:"buycost",renderer:Helper.Util.formatMoneyDecimal,flex:3,hideable:false,hidden:!App.user.isClient},{menuDisabled:true,header:t("sessionbill"),dataIndex:"price",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:!App.user.isClient},{menuDisabled:true,header:t("markup"),dataIndex:"lucro",renderer:Helper.Util.formatMoneyDecimal,flex:3,hideable:false,hidden:!App.user.isClient}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarycallshoplist"],["component","box","container","panel","tablepanel","gridpanel","grid","callsummarycallshoplist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callsummarycallshoplist:true},["widget.callsummarycallshoplist"],0,[MBilling.view.callSummaryCallShop,"List"],0));(Ext.cmd.derive("MBilling.view.callSummaryCallShop.Form",Ext.ux.form.Panel,{defaults:{},labelWidthFields:150,defaultType:"displayfield",initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{name:"sumsessiontime",fieldLabel:t("sessiontime")+" "+t("Min")},{name:"sumprice",fieldLabel:t("sessionbill"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isClient},{name:"sumlucro",fieldLabel:t("markup"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isClient},{name:"sumbuycost",fieldLabel:t("buycost"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isClient},{name:"sumnbcall",fieldLabel:t("nbcall"),hidden:!App.user.isClient}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarycallshopform"],["component","box","container","panel","form","callsummarycallshopform"],{component:true,box:true,container:true,panel:true,form:true,callsummarycallshopform:true},["widget.callsummarycallshopform"],0,[MBilling.view.callSummaryCallShop,"Form"],0));(Ext.cmd.derive("MBilling.view.callSummaryCallShop.Chart",Ext.ux.panel.Chart,{controller:"callsummarycallshop",store:"CallSummaryCallShop",fieldValue:"sessiontime",fieldDescription:"day",labelYLine:t("sessiontime")+" Min",labelXLine:t("day"),initComponent:function(){var d=this,c;d.rendererFieldValue=Ext.util.Format.numberRenderer("0"),d.rendererFieldDescription=Ext.util.Format.dateRenderer("Y-m-d");d.tbarChart=[{xtype:"buttongroup",toggleGroup:"charts",defaults:{enableToggle:true,toggleGroup:"charts",allowDepress:false,listeners:{toggle:"onToggleGroupButton"}},items:[{pressed:true,text:t("sessiontime"),chart:"sessiontime",sumName:"sumsessiontime"},{text:t("buycost"),sumRenderer:Helper.Util.formatMoneyDecimal,chart:"buycost",sumName:"sumbuycost"},{text:t("sessionbill"),sumRenderer:Helper.Util.formatMoneyDecimal,chart:"price",sumName:"sumprice"},{text:t("markup"),sumRenderer:Helper.Util.formatMoneyDecimal,chart:"lucro",sumName:"sumlucro",hidden:App.user.isClient||App.user.isAgent},{text:t("nbcall"),chart:"nbcall",sumName:"sumnbcall"}]}];d.bbarChart=[{xtype:"tbtext",itemId:"tbTextSum"}];Ext.ux.panel.Chart.prototype.initComponent.apply(this,arguments)}},0,["callsummarycallshopchart"],["component","box","container","panel","chartpanel","callsummarycallshopchart"],{component:true,box:true,container:true,panel:true,chartpanel:true,callsummarycallshopchart:true},["widget.callsummarycallshopchart"],0,[MBilling.view.callSummaryCallShop,"Chart"],0));(Ext.cmd.derive("MBilling.view.buycredit.Controller",Ext.ux.app.ViewController,{buyCreditClose:function(e){var j=this,g=j.lookupReference("buycreditPanel"),f=j.lookupReference("btnCancel");g.getForm().findField("amount")["show"]();g.getForm().findField("method")["show"]();g.getForm().findField("card_num")["hide"]();g.getForm().findField("exp_date")["hide"]();g.getForm().findField("method").setValue("");f.setVisible(false)},buyCredit:function(r){var o=this,n=o.lookupReference("buycreditPanel"),s=o.lookupReference("btnCancel"),p=n.getForm().findField("amount").getValue(),l=n.getForm().findField("method").getValue(),m=n.getForm().findField("card_num").getValue(),q=n.getForm().findField("exp_date").rawValue;if(n.getForm().findField("method").rawValue.match(/uthorize/)){if(m){n.setLoading(o.msgWait);Ext.Ajax.request({url:"index.php/buyCredit/method/?amount="+p+"&id_method="+l+"&cc="+m+"&ed="+q,scope:o,success:function(a){a=Ext.decode(a.responseText);if(a.success){Ext.ux.Alert.alert(t("Success"),a.msg,"success",10000);n.setLoading(false);n.getForm().findField("amount")["show"]();n.getForm().findField("method")["show"]();n.getForm().findField("card_num")["hide"]();n.getForm().findField("exp_date")["hide"]();s.setVisible(false);n.getForm().findField("card_num").setValue("");n.getForm().findField("exp_date").setValue("");n.getForm().findField("method").setValue("")}else{Ext.ux.Alert.alert(t("Error"),a.msg,"error");n.getForm().findField("card_num").setValue("");n.getForm().findField("exp_date").setValue("");n.setLoading(false)}}});return}else{n.getForm().findField("amount")["hide"]();n.getForm().findField("method")["hide"]();n.getForm().findField("card_num")["show"]();n.getForm().findField("exp_date")["show"]();s.setVisible(true);n.getForm().findField("card_num").focus()}}else{if(!l){Ext.ux.Alert.alert(o.titleWarning,t("Select a ")+t("paymentmethods"),"warning");return}else{if(p<=0){Ext.ux.Alert.alert(o.titleWarning,t("Select a ")+t("valid")+" "+t("amount"),"warning");return}else{url="index.php/buyCredit/method/?amount="+p+"&id_method="+l;n.getForm().findField("method").setValue("");n.getForm().findField("card_num").setValue("");n.getForm().findField("exp_date").setValue("");if(n.getForm().findField("method").rawValue.match(/PlacetoPay/)){window.open(url,"_self")}else{window.open(url,"_blank")}}}}}},0,0,0,0,["controller.buycredit"],0,[MBilling.view.buycredit,"Controller"],0));(Ext.cmd.derive("MBilling.view.buycredit.Module",Ext.form.Panel,{controller:"buycredit",resizable:false,autoShow:true,header:false,initComponent:function(){var b=this;b.items=[{reference:"buycreditPanel",xtype:"form",margin:"10 10 10 10",autoShow:true,closable:false,resizable:false,bodyPadding:10,defaultType:"textfield",defaults:{labelAlign:"right",labelWidth:150,width:280,allowBlank:false,msgTarget:"side",enableKeyEvents:true,plugins:"markallowblank",anchor:"100%"},items:[{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,00",fieldLabel:t("Amounts"),value:0,name:"amount"},{xtype:"methodpaycombo",fieldLabel:t("paymentmethods"),name:"method"},{fieldLabel:t("CreditCard Number"),name:"card_num",hidden:true},{xtype:"datefield",fieldLabel:t("Expiration Date"),name:"exp_date",format:"m/y",hidden:true}],bbar:[{text:t("Cancel"),tooltip:t("Cancel"),glyph:b.glyphCancel,handler:"buyCreditClose",hidden:true,reference:"btnCancel"},{text:t("Next"),tooltip:t("Next"),width:100,glyph:icons.disk,handler:"buyCredit"}]}];Ext.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["buycreditmodule"],["component","box","container","panel","form","buycreditmodule"],{component:true,box:true,container:true,panel:true,form:true,buycreditmodule:true},["widget.buycreditmodule"],0,[MBilling.view.buycredit,"Module"],0));(Ext.cmd.derive("MBilling.view.transferToMobile.Module",Ext.form.Panel,{resizable:false,autoShow:true,header:false,items:[{xtype:"component",autoEl:{width:"100%",height:"100%",tag:"iframe",src:"index.php/transferToMobile/read"}}]},0,["transfertomobilemodule"],["component","box","container","panel","form","transfertomobilemodule"],{component:true,box:true,container:true,panel:true,form:true,transfertomobilemodule:true},["widget.transfertomobilemodule"],0,[MBilling.view.transferToMobile,"Module"],0));(Ext.cmd.derive("MBilling.view.firewall.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.firewall"],0,[MBilling.view.firewall,"Controller"],0));(Ext.cmd.derive("MBilling.view.firewall.Module",Ext.ux.panel.Module,{controller:"firewall"},0,["firewallmodule"],["component","box","container","uxpanelmodule","firewallmodule"],{component:true,box:true,container:true,uxpanelmodule:true,firewallmodule:true},["widget.firewallmodule"],0,[MBilling.view.firewall,"Module"],0));(Ext.cmd.derive("MBilling.view.firewall.List",Ext.ux.grid.Panel,{store:"Firewall",initComponent:function(){var b=this;b.textDelete="Unban";b.textNew="Ban new Ip";b.buttonCsv=false;b.buttonUpdateLot=false;b.buttonCleanFilter=true;b.allowPrint=false;b.allowCreate=true;b.allowDelete=true;b.columns=[{header:t("Ip"),dataIndex:"ip",flex:4},{header:t("Type"),dataIndex:"jail",flex:4},{header:t("Permanently")+" "+t("Ban"),dataIndex:"action",renderer:Helper.Util.formattyyesno,filter:{type:"list",options:[[0,t("no")],[1,t("yes")]]},flex:2}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["firewalllist"],["component","box","container","panel","tablepanel","gridpanel","grid","firewalllist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,firewalllist:true},["widget.firewalllist"],0,[MBilling.view.firewall,"List"],0));(Ext.cmd.derive("MBilling.view.firewall.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{name:"ip",fieldLabel:t("Ip"),vtype:"IPAddress"},{xtype:"yesnocombo",fieldLabel:t("Permanently")+" "+t("Ban"),name:"action"},{xtype:"textarea",name:"description",fieldLabel:t("description"),allowBlank:true,height:300,anchor:"100%",readOnly:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["firewallform"],["component","box","container","panel","form","firewallform"],{component:true,box:true,container:true,panel:true,form:true,firewallform:true},["widget.firewallform"],0,[MBilling.view.firewall,"Form"],0));(Ext.cmd.derive("MBilling.view.userRate.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.userrate"],0,[MBilling.view.userRate,"Controller"],0));(Ext.cmd.derive("MBilling.view.userRate.Module",Ext.ux.panel.Module,{controller:"userrate"},0,["userratemodule"],["component","box","container","uxpanelmodule","userratemodule"],{component:true,box:true,container:true,uxpanelmodule:true,userratemodule:true},["widget.userratemodule"],0,[MBilling.view.userRate,"Module"],0));(Ext.cmd.derive("MBilling.view.userRate.List",Ext.ux.grid.Panel,{store:"UserRate",initComponent:function(){var b=this;b.buttonCsv=false;b.allowPrint=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("prefix"),dataIndex:"idPrefixprefix",flex:window.isTablet?2:3},{dataIndex:"idPrefixdestination",header:t("destination"),flex:window.isTablet?2:3},{header:t("rateinitial"),dataIndex:"rateinitial",renderer:Helper.Util.formatMoneyDecimal,flex:2},{header:t("initblock"),dataIndex:"initblock",flex:2},{header:t("billingblock"),dataIndex:"billingblock",flex:2}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["userratelist"],["component","box","container","panel","tablepanel","gridpanel","grid","userratelist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,userratelist:true},["widget.userratelist"],0,[MBilling.view.userRate,"List"],0));(Ext.cmd.derive("MBilling.view.userRate.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{fieldLabel:t("User"),name:"id_user",xtype:!App.user.isAdmin?"textfield":"userlookup",ownerForm:b,hidden:!App.user.isAdmin,allowBlank:!App.user.isAdmin},{fieldLabel:t("Destination"),name:"id_prefix",xtype:"prefixlookup",ownerForm:b,hidden:!App.user.isAdmin,allowBlank:!App.user.isAdmin},{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,"+App.user.decimalPrecision,name:"rateinitial",fieldLabel:t("rateinitial"),readOnly:App.user.isClient},{xtype:"numberfield",name:"initblock",fieldLabel:t("initblock"),hidden:App.user.isClient},{xtype:"numberfield",name:"billingblock",fieldLabel:t("billingblock"),hidden:App.user.isClient}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["userrateform"],["component","box","container","panel","form","userrateform"],{component:true,box:true,container:true,panel:true,form:true,userrateform:true},["widget.userrateform"],0,[MBilling.view.userRate,"Form"],0));(Ext.cmd.derive("MBilling.view.extra.Module",Ext.form.Panel,{resizable:false,autoShow:true,header:false,items:[{xtype:"component",autoEl:{width:"100%",height:"100%",tag:"iframe",src:window.moduleExtra}}]},0,["extramodule"],["component","box","container","panel","form","extramodule"],{component:true,box:true,container:true,panel:true,form:true,extramodule:true},["widget.extramodule"],0,[MBilling.view.extra,"Module"],0));(Ext.cmd.derive("MBilling.view.callOnlineChart.Module",Ext.ux.panel.Module,{},0,["callOnlineChartmodule"],["component","box","container","uxpanelmodule","callOnlineChartmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callOnlineChartmodule:true},["widget.callOnlineChartmodule"],0,[MBilling.view.callOnlineChart,"Module"],0));(Ext.cmd.derive("MBilling.view.callOnlineChart.List",Ext.ux.grid.Panel,{store:"CallOnlineChart",initComponent:function(){var b=this;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("Total"),dataIndex:"total",flex:1},{header:t("date"),dataIndex:"date",renderer:Ext.util.Format.dateRenderer("Y-m-d H:i"),flex:1}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callonlinechartlist"],["component","box","container","panel","tablepanel","gridpanel","grid","callonlinechartlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callonlinechartlist:true},["widget.callonlinechartlist"],0,[MBilling.view.callOnlineChart,"List"],0));(Ext.cmd.derive("MBilling.view.callOnlineChart.Form",Ext.ux.form.Panel,{},0,["callOnlineChartform"],["component","box","container","panel","form","callOnlineChartform"],{component:true,box:true,container:true,panel:true,form:true,callOnlineChartform:true},["widget.callOnlineChartform"],0,[MBilling.view.callOnlineChart,"Form"],0));(Ext.cmd.derive("MBilling.view.callOnlineChart.Chart",Ext.ux.panel.Chart,{controller:"callsummaryperday",store:"CallOnlineChart",fieldValue:["total","answer"],fieldDescription:"date",labelYLine:t("total")+" / Min",labelXLine:t("Minute"),reference:"callonlinechartchart",defaultChart:"line",btnShowColumn:false,btnShowBar:false,btnShowLine:true,btnShowPie:false,animate:true,btnShowLineHidden:true,initComponent:function(){var b=this;b.rendererFieldValue=Ext.util.Format.numberRenderer("0");b.tbarChart=[{text:t("Per")+" "+t("Minute"),scope:b,handler:"onPerMinute",reference:"btnMinute",disabled:true},{text:t("Per")+" "+t("Hour"),scope:b,handler:"onPerhour",reference:"btnHour"}];b.legend={position:"right",boxStrokeWidth:0,labelFont:"12px Helvetica",renderer:b.rendererLegend};b.bbarChart=[{xtype:"tbtext",itemId:"tbTextSum"}];b.sessionLoad=Ext.create("Ext.util.DelayedTask",function(){b.store.load()},b);Ext.ux.panel.Chart.prototype.initComponent.apply(this,arguments);b.store.on("load",b.onLoadStore,b)},onPerMinute:function(d){var c=this;c.lookupReference("btnMinute").disable();c.lookupReference("btnHour").enable();c.store.setRemoteFilter(true);c.store.filter("type","minute");c.store.load()},onPerhour:function(d){var c=this;c.lookupReference("btnHour").disable();c.lookupReference("btnMinute").enable();c.store.setRemoteFilter(true);c.store.filter("type","hour");c.store.load()},onLoadStore:function(){this.onActivateModule()},onActivateModule:function(){this.sessionLoad&&this.sessionLoad.delay(25000)}},0,["callonlinechartchart"],["component","box","container","panel","chartpanel","callonlinechartchart"],{component:true,box:true,container:true,panel:true,chartpanel:true,callonlinechartchart:true},["widget.callonlinechartchart"],0,[MBilling.view.callOnlineChart,"Chart"],0));(Ext.cmd.derive("MBilling.view.smtps.Controller",Ext.ux.app.ViewController,{onSendEmail:function(e){var f=this,d=f.list.getSelectionModel().getSelection()[0];f.list.setLoading(true);if(f.list.getSelectionModel().getSelection().length==1){Ext.Ajax.request({url:"index.php/smtps/testMail",params:{id:d.get("id")},scope:f,success:function(a){a=Ext.decode(a.responseText);if(a[f.nameSuccessRequest]){Ext.ux.Alert.alert(f.titleSuccess,a[f.nameMsgRequest],"success")}else{Ext.ux.Alert.alert(f.titleError,a[f.nameMsgRequest],"error")}f.list.setLoading(false)}})}else{Ext.ux.Alert.alert(f.titleError,"Please Select a Smtp","notification");f.list.setLoading(false)}}},0,0,0,0,["controller.smtps"],0,[MBilling.view.smtps,"Controller"],0));(Ext.cmd.derive("MBilling.view.smtps.List",Ext.ux.grid.Panel,{store:"Smtps",initComponent:function(){var b=this;b.extraButtons=[{text:t("Test Smtp"),iconCls:"templatemail",handler:"onSendEmail",disabled:false}];b.buttonUpdateLot=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("Host"),dataIndex:"host",flex:4},{header:t("username"),dataIndex:"username",flex:2},{header:t("Port"),dataIndex:"port",flex:3},{header:t("Encryption"),dataIndex:"encryption",flex:3}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["smtpslist"],["component","box","container","panel","tablepanel","gridpanel","grid","smtpslist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,smtpslist:true},["widget.smtpslist"],0,[MBilling.view.smtps,"List"],0));(Ext.cmd.derive("MBilling.view.smtps.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{name:"host",fieldLabel:t("Host"),hidden:App.user.isClient},{name:"username",fieldLabel:t("username"),hidden:App.user.isClient},{inputType:"password",name:"password",fieldLabel:t("password"),hidden:App.user.isClient},{xtype:"numberfield",name:"port",fieldLabel:t("Port"),value:587,hidden:App.user.isClient},{xtype:"combobox",name:"encryption",fieldLabel:t("Encryption"),hidden:App.user.isClient,value:"null",store:[["ssl",t("SSl")],["tls",t("TLS")],["null",t("NULL")]]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["smtpsform"],["component","box","container","panel","form","smtpsform"],{component:true,box:true,container:true,panel:true,form:true,smtpsform:true},["widget.smtpsform"],0,[MBilling.view.smtps,"Form"],0));(Ext.cmd.derive("MBilling.view.smtps.Module",Ext.ux.panel.Module,{controller:"smtps"},0,["smtpsmodule"],["component","box","container","uxpanelmodule","smtpsmodule"],{component:true,box:true,container:true,uxpanelmodule:true,smtpsmodule:true},["widget.smtpsmodule"],0,[MBilling.view.smtps,"Module"],0));(Ext.cmd.derive("MBilling.view.servers.Controller",Ext.ux.app.ViewController,{init:function(){var b=this;b.control({combobox:{select:b.onSelectType}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectType:function(c,d){this.showFieldsRelated(d.getData().showFields)},showFieldsRelated:function(l){var m=this,g=m.formPanel.getForm().getFields(),j=m.formPanel.getForm().findField("weight"),f=m.formPanel.getForm();g.each(function(a){if(a.name=="type"){if(a.value=="asterisk"||a.value=="mbilling"){j.show()}else{j.hide()}}})},onEdit:function(){var d=this,f=d.formPanel.getForm().findField("weight"),e=d.formPanel.getForm().findField("type");Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments);if(e.value=="asterisk"||e.value=="mbilling"){f.show()}else{f.hide()}},onDelete:function(d){var f=this,e;notDelete=false;Ext.each(f.list.getSelectionModel().getSelection(),function(a){if(a.get("id")==1){Ext.ux.Alert.alert(f.titleError,t("You cannot delete the")+" server id 1","error");notDelete=true}});if(notDelete==false){Ext.ux.app.ViewController.prototype.onDelete.apply(this,arguments)}}},0,0,0,0,["controller.servers"],0,[MBilling.view.servers,"Controller"],0));(Ext.cmd.derive("MBilling.view.servers.List",Ext.ux.grid.Panel,{store:"Servers",initComponent:function(){var b=this;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("host"),dataIndex:"host",flex:4},{header:t("username"),dataIndex:"username",flex:4},{header:t("type"),dataIndex:"type",comboRelated:"booleancombo",flex:2},{header:t("status"),dataIndex:"status",renderer:Helper.Util.formatBooleanActive,comboRelated:"booleancombo",flex:2,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")]]}}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["serverslist"],["component","box","container","panel","tablepanel","gridpanel","grid","serverslist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,serverslist:true},["widget.serverslist"],0,[MBilling.view.servers,"List"],0));(Ext.cmd.derive("MBilling.view.servers.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["id_user"],initComponent:function(){var b=this;b.items=[{name:"host",fieldLabel:t("host")},{name:"username",fieldLabel:t("username"),allowBlank:true},{name:"password",fieldLabel:t("password"),allowBlank:true},{name:"port",fieldLabel:t("port"),allowBlank:true},{xtype:"combobox",name:"type",fieldLabel:t("type"),forceSelection:true,editable:false,value:"mbilling",store:[["mbilling",t("Mbilling")],["asterisk",t("Asterisk")],["sipproxy",t("SipProxy")]]},{fieldLabel:t("Weight"),name:"weight",hidden:true,allowBlank:true,emptyText:t("This is useful in order to get a different ratio of traffic between servers.")},{xtype:"booleancombo",name:"status",fieldLabel:t("status"),allowBlank:true},{xtype:"textareafield",name:"description",fieldLabel:t("description"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["serversform"],["component","box","container","panel","form","serversform"],{component:true,box:true,container:true,panel:true,form:true,serversform:true},["widget.serversform"],0,[MBilling.view.servers,"Form"],0));(Ext.cmd.derive("MBilling.view.servers.Module",Ext.ux.panel.Module,{controller:"servers"},0,["serversmodule"],["component","box","container","uxpanelmodule","serversmodule"],{component:true,box:true,container:true,uxpanelmodule:true,serversmodule:true},["widget.serversmodule"],0,[MBilling.view.servers,"Module"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerUser.Controller",Ext.ux.app.ViewController,{formHidden:true,onEdit:function(){me=this;me.sumData=me.store.getData().items[0].getData();if(!me.sumData){return}me.formPanel.getForm().getFields().each(function(b){b.setValue(me.sumData[b.name])});me.formPanel.expand()},onExportCsvUser:function(o,l,g){var m=this,j=m.list.getStore(),n=m.list.filters.getFilterData().length?Ext.encode(m.list.filters.getFilterData()):j.proxy.extraParams.filter;window.open("index.php/callSummaryPerUser/exportCsvCalls?id="+o.getStore().getAt(l).getData().idUserusername+"&filter="+n)}},0,0,0,0,["controller.callsummaryperuser"],0,[MBilling.view.callSummaryPerUser,"Controller"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerUser.List",Ext.ux.grid.Panel,{store:"CallSummaryPerUser",initComponent:function(){var b=this;b.buttonImportCsv=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{xtype:"actioncolumn",width:26,sortable:false,menuDisabled:true,header:t(""),dataIndex:"id",items:[{iconCls:"icon-export-csv",tooltip:t("Export CSV"),handler:"onExportCsvUser"}],hidden:!App.user.isAdmin},{header:t("Username"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:3},{header:t("sessiontime")+" "+t("Min"),dataIndex:"sessiontime",flex:2},{header:t("aloc_all_calls"),dataIndex:"aloc_all_calls",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Answered Calls"),dataIndex:"nbcall",flex:3},{header:t("Failed Calls"),dataIndex:"nbcall_fail",flex:3},{header:t("buycost"),dataIndex:App.user.isAdmin?"buycost":"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("sessionbill"),dataIndex:App.user.isAgent||App.user.isClientAgent?"agent_bill":"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("markup"),dataIndex:"lucro",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("ASR"),dataIndex:"asr",renderer:Helper.Util.formatPorcente,flex:3,hidden:!App.user.isAdmin,hideable:App.user.isAdmin}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummaryperuserlist"],["component","box","container","panel","tablepanel","gridpanel","grid","callsummaryperuserlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callsummaryperuserlist:true},["widget.callsummaryperuserlist"],0,[MBilling.view.callSummaryPerUser,"List"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerUser.Form",Ext.ux.form.Panel,{defaults:{},labelWidthFields:100,defaultType:"displayfield",initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{name:"sumsessiontime",fieldLabel:t("sessiontime")+" "+t("Min"),renderer:Ext.util.Format.numberRenderer("0"),allowBlank:true},{name:App.user.isAgent||App.user.isClientAgent?"sumagent_bill":"sumsessionbill",fieldLabel:t("sessionbill"),renderer:Helper.Util.formatMoneyDecimal,allowBlank:true},{name:App.user.isAdmin?"sumbuycost":"sumsessionbill",fieldLabel:t("buycost"),renderer:Helper.Util.formatMoneyDecimal,hidden:App.user.isClient,allowBlank:true},{name:"sumlucro",fieldLabel:t("markup"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumnbcall",fieldLabel:t("Answered Calls"),allowBlank:true},{name:"sumnbcallfail",fieldLabel:t("Failed Calls"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummaryperuserform"],["component","box","container","panel","form","callsummaryperuserform"],{component:true,box:true,container:true,panel:true,form:true,callsummaryperuserform:true},["widget.callsummaryperuserform"],0,[MBilling.view.callSummaryPerUser,"Form"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerUser.Module",Ext.ux.panel.Module,{controller:"callsummaryperuser",cfgEast:{flex:0.4}},0,["callsummaryperusermodule"],["component","box","container","uxpanelmodule","callsummaryperusermodule"],{component:true,box:true,container:true,uxpanelmodule:true,callsummaryperusermodule:true},["widget.callsummaryperusermodule"],0,[MBilling.view.callSummaryPerUser,"Module"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerTrunk.Controller",Ext.ux.app.ViewController,{formHidden:true,onEdit:function(){me=this;me.sumData=me.store.getData().items[0].getData();if(!me.sumData){return}me.formPanel.getForm().getFields().each(function(b){b.setValue(me.sumData[b.name])});me.formPanel.expand()},onExportCsvUser:function(o,l,g){var m=this,j=m.list.getStore(),n=m.list.filters.getFilterData().length?Ext.encode(m.list.filters.getFilterData()):j.proxy.extraParams.filter;window.open("index.php/callSummaryPerTrunk/exportCsvCalls?id="+o.getStore().getAt(l).getData().idTrunktrunkcode+"&filter="+n)}},0,0,0,0,["controller.callsummarypertrunk"],0,[MBilling.view.callSummaryPerTrunk,"Controller"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerTrunk.List",Ext.ux.grid.Panel,{store:"CallSummaryPerTrunk",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{xtype:"actioncolumn",width:26,sortable:false,menuDisabled:true,header:t(""),dataIndex:"id",items:[{iconCls:"icon-export-csv",tooltip:t("Export CSV"),handler:"onExportCsvUser"}],hidden:!App.user.isAdmin},{header:t("Trunk"),dataIndex:"idTrunktrunkcode",filter:{type:"string",field:"idTrunk.trunkcode"},flex:3},{header:t("sessiontime")+" "+t("Min"),dataIndex:"sessiontime",flex:2},{header:t("aloc_all_calls"),dataIndex:"aloc_all_calls",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Answered Calls"),dataIndex:"nbcall",flex:3},{header:t("Failed Calls"),dataIndex:"nbcall_fail",flex:3},{header:t("buycost"),dataIndex:"buycost",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("sessionbill"),dataIndex:"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("markup"),dataIndex:"lucro",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("ASR"),dataIndex:"asr",renderer:Helper.Util.formatPorcente,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarypertrunklist"],["component","box","container","panel","tablepanel","gridpanel","grid","callsummarypertrunklist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callsummarypertrunklist:true},["widget.callsummarypertrunklist"],0,[MBilling.view.callSummaryPerTrunk,"List"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerTrunk.Form",Ext.ux.form.Panel,{defaults:{},labelWidthFields:100,defaultType:"displayfield",initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{name:"sumsessiontime",fieldLabel:t("sessiontime")+" "+t("Min"),renderer:Ext.util.Format.numberRenderer("0"),allowBlank:true},{name:"sumsessionbill",fieldLabel:t("sessionbill"),renderer:Helper.Util.formatMoneyDecimal,allowBlank:true},{name:"sumbuycost",fieldLabel:t("buycost"),renderer:Helper.Util.formatMoneyDecimal,hidden:App.user.isClient,allowBlank:true},{name:"sumlucro",fieldLabel:t("markup"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumnbcall",fieldLabel:t("Answered Calls"),allowBlank:true},{name:"sumnbcallfail",fieldLabel:t("Failed Calls"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarypertrunkform"],["component","box","container","panel","form","callsummarypertrunkform"],{component:true,box:true,container:true,panel:true,form:true,callsummarypertrunkform:true},["widget.callsummarypertrunkform"],0,[MBilling.view.callSummaryPerTrunk,"Form"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerTrunk.Module",Ext.ux.panel.Module,{controller:"callsummarypertrunk",cfgEast:{flex:0.4}},0,["callsummarypertrunkmodule"],["component","box","container","uxpanelmodule","callsummarypertrunkmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callsummarypertrunkmodule:true},["widget.callsummarypertrunkmodule"],0,[MBilling.view.callSummaryPerTrunk,"Module"],0));(Ext.cmd.derive("MBilling.view.backup.Controller",Ext.ux.app.ViewController,{formHidden:true,onDownload:function(l){var j=this,m,f=j.list.getSelectionModel().getSelection()[0],g=[];values="file="+f.data.name;url="index.php/backup/download/?"+values;window.open(url)},onDelete:function(m){var l=this,n,o=l.list.getSelectionModel().getSelection()[0],j=[];destroyType=m.menu.down("menucheckitem[checked=true]").value;var g=(destroyType==="all")?l.msgDeleteAll:l.msgConfirmation;if(!l.list.allowDelete){return}if(destroyType==="all"){Ext.ux.Alert.alert(l.titleError,"You cannot delete all backups","notification");return}if(o){Ext.Msg.confirm(l.titleConfirmation,g,function(a){if(a==="yes"){Ext.each(l.list.getSelectionModel().getSelection(),function(b){j.push(b.get("name"))});Ext.Ajax.request({url:"index.php/backup/destroy",params:{ids:Ext.encode(j)},scope:l,success:function(d){d=Ext.decode(d.responseText);if(d[l.nameSuccessRequest]){var c=Helper.Util.convertErrorsJsonToString(d[l.nameMsgRequest]);Ext.ux.Alert.alert(l.titleSuccess,c,"success")}else{var b=Helper.Util.convertErrorsJsonToString(d[l.nameMsgRequest]);Ext.ux.Alert.alert(l.titleError,b,"notification")}}});l.store.load()}},l)}else{Ext.ux.Alert.alert(l.titleError,t("Please select one or more register"),"notification")}},onNew:function(){var b=this;Ext.Msg.confirm(b.titleConfirmation,t("Do you relly want create a new backup now? It can take many time and make your server slow. Mbilling make backup every day automatically."),function(a){if(a==="yes"){Ext.Msg.confirm(b.titleConfirmation,t("This backup will override the backup held today! Do you sure?"),function(d){if(d==="yes"){Ext.Ajax.request({url:"index.php/backup/save",params:{ids:0},scope:b,success:function(j){j=Ext.decode(j.responseText);if(j[b.nameSuccessRequest]){var g=Helper.Util.convertErrorsJsonToString(j[b.nameMsgRequest]);Ext.ux.Alert.alert(b.titleSuccess,g,"success")}else{var c=Helper.Util.convertErrorsJsonToString(j[b.nameMsgRequest]);Ext.ux.Alert.alert(b.titleError,c,"notification")}}});b.store.load()}},b)}},b)}},0,0,0,0,["controller.backup"],0,[MBilling.view.backup,"Controller"],0));(Ext.cmd.derive("MBilling.view.backup.List",Ext.ux.grid.Panel,{store:"Backup",initComponent:function(){var b=this;b.buttonImportCsv=true;b.textButtonImportCsv=t("Importar Backup");b.widthButtonCsv=140;b.extraButtons=[{text:t("Download Backup"),glyph:icons.disk,handler:"onDownload",width:140,disabled:false}];b.buttonCsv=false;b.allowPrint=false;b.buttonUpdateLot=false;b.buttonCleanFilter=false;b.allowUpdate=false;b.columns=[{menuDisabled:true,header:t("name"),dataIndex:"name",flex:1},{menuDisabled:true,header:t("size"),dataIndex:"size",flex:1}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["backuplist"],["component","box","container","panel","tablepanel","gridpanel","grid","backuplist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,backuplist:true},["widget.backuplist"],0,[MBilling.view.backup,"List"],0));(Ext.cmd.derive("MBilling.view.backup.Form",Ext.ux.form.Panel,{},0,["backupform"],["component","box","container","panel","form","backupform"],{component:true,box:true,container:true,panel:true,form:true,backupform:true},["widget.backupform"],0,[MBilling.view.backup,"Form"],0));(Ext.cmd.derive("MBilling.view.backup.Module",Ext.ux.panel.Module,{controller:"backup",initComponent:function(){var b=this;Ext.ux.panel.Module.prototype.initComponent.apply(this,arguments)}},0,["backupmodule"],["component","box","container","uxpanelmodule","backupmodule"],{component:true,box:true,container:true,uxpanelmodule:true,backupmodule:true},["widget.backupmodule"],0,[MBilling.view.backup,"Module"],0));(Ext.cmd.derive("MBilling.view.backup.ImportCsv",Ext.ux.window.ImportCsv,{htmlTipInfo:"",extAllowed:["tgz"],fieldLabel:"Backup",iconCls:"icon-play"},0,["backupimportcsv"],["component","box","container","panel","window","backupimportcsv"],{component:true,box:true,container:true,panel:true,window:true,backupimportcsv:true},["widget.backupimportcsv"],0,[MBilling.view.backup,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.gAuthenticator.Controller",Ext.ux.app.ViewController,{init:function(){var b=this;b.control({statususercombo:{select:b.onSelectMethod}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectMethod:function(c,d){this.showFieldsRelated(d.getData().showFields)},showFieldsRelated:function(l){var m=this,j=m.formPanel.getForm().getFields(),o=m.formPanel.getForm().findField("googleAuthenticator_enable"),n=m.formPanel.getForm().findField("google_authenticator_key"),g=m.formPanel.getForm().findField("code");if(o.value!=1&&n.value.length>5){g.setVisible(true);g.allowBlank=false}else{g.setVisible(false);g.allowBlank=true}},onEdit:function(){var c=this,d=c.formPanel.getForm();if(!App.user.isAdmin){return}d.findField("code").allowBlank=true;d.findField("code").setVisible(false);Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)}},0,0,0,0,["controller.gauthenticator"],0,[MBilling.view.gAuthenticator,"Controller"],0));(Ext.cmd.derive("MBilling.view.gAuthenticator.List",Ext.ux.grid.Panel,{store:"GAuthenticator",fieldSearch:"username",initComponent:function(){var b=this;b.buttonCsv=false;b.allowPrint=false;b.buttonUpdateLot=false;b.allowCreate=false;b.buttonCleanFilter=false;b.allowUpdate=App.user.isAdmin;b.allowDelete=false;if(!App.user.isAdmin){b.columns=[]}else{b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("username"),dataIndex:"username",flex:4},{header:t("status"),dataIndex:"googleAuthenticator_enable",renderer:Helper.Util.formatBooleanActive,comboRelated:"booleancombo",flex:2,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")]]}}]}Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["gauthenticatorlist"],["component","box","container","panel","tablepanel","gridpanel","grid","gauthenticatorlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,gauthenticatorlist:true},["widget.gauthenticatorlist"],0,[MBilling.view.gAuthenticator,"List"],0));(Ext.cmd.derive("MBilling.view.gAuthenticator.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{name:"username",fieldLabel:t("username"),readyOnly:true},{xtype:"statususercombo",name:"googleAuthenticator_enable",fieldLabel:t("status"),allowBlank:true},{vtype:"numberfield",name:"code",fieldLabel:t("Code"),hidden:true,maxLength:6,minLength:6,allowBlank:true},{name:"google_authenticator_key",fieldLabel:t("google_authenticator_key"),readyOnly:true,allowBlank:true,hidden:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["gauthenticatorform"],["component","box","container","panel","form","gauthenticatorform"],{component:true,box:true,container:true,panel:true,form:true,gauthenticatorform:true},["widget.gauthenticatorform"],0,[MBilling.view.gAuthenticator,"Form"],0));(Ext.cmd.derive("MBilling.view.gAuthenticator.Module",Ext.ux.panel.Module,{controller:"gauthenticator"},0,["gauthenticatormodule"],["component","box","container","uxpanelmodule","gauthenticatormodule"],{component:true,box:true,container:true,uxpanelmodule:true,gauthenticatormodule:true},["widget.gauthenticatormodule"],0,[MBilling.view.gAuthenticator,"Module"],0));(Ext.cmd.derive("MBilling.view.groupUserGroup.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.groupusergroup"],0,[MBilling.view.groupUserGroup,"Controller"],0));(Ext.cmd.derive("MBilling.view.groupUserGroup.List",Ext.ux.grid.Panel,{store:"GroupUserGroup",initComponent:function(){var b=this;b.buttonCsv=false;b.allowPrint=false;b.buttonUpdateLot=false;b.allowCreate=false;b.buttonCleanFilter=false;b.allowDelete=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("Group"),dataIndex:"name",flex:4,readOnly:true,hidden:App.user.isClient,hideable:!App.user.isClient}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["groupusergrouplist"],["component","box","container","panel","tablepanel","gridpanel","grid","groupusergrouplist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,groupusergrouplist:true},["widget.groupusergrouplist"],0,[MBilling.view.groupUserGroup,"List"],0));(Ext.cmd.derive("MBilling.view.groupUserGroup.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["id_user"],initComponent:function(){var b=this;b.items=[{name:"name",fieldLabel:t("Group"),readOnly:true},{style:"margin-top:25px",xtype:"fieldset",title:t("Select one or more groups"),collapsible:true,collapsed:false,items:[{anchor:"100%",fieldLabel:"",xtype:"groupusertag",allowBlank:true}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["groupusergroupform"],["component","box","container","panel","form","groupusergroupform"],{component:true,box:true,container:true,panel:true,form:true,groupusergroupform:true},["widget.groupusergroupform"],0,[MBilling.view.groupUserGroup,"Form"],0));(Ext.cmd.derive("MBilling.view.groupUserGroup.Module",Ext.ux.panel.Module,{controller:"groupusergroup"},0,["groupusergroupmodule"],["component","box","container","uxpanelmodule","groupusergroupmodule"],{component:true,box:true,container:true,uxpanelmodule:true,groupusergroupmodule:true},["widget.groupusergroupmodule"],0,[MBilling.view.groupUserGroup,"Module"],0));(Ext.cmd.derive("MBilling.view.services.Controller",Ext.ux.app.ViewController,{init:function(){var b=this;b.control({servicestypecombo:{select:b.onSelectType}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectType:function(c,d){this.showFieldsRelated(d.getData().showFields)},showFieldsRelated:function(m){var n=this,o=n.formPanel.getForm(),p=o.findField("calllimit"),j=o.findField("disk_space"),q=o.findField("sipaccountlimit"),l=o.findField("type").getValue();p.setVisible(l=="calllimit");j.setVisible(l=="disk_space");q.setVisible(l=="sipAccountLimit")},onEdit:function(){var f=this,d=f.formPanel.getForm(),e=f.list.getSelectionModel().getSelection()[0];if(App.user.isClient){return}f.lookupReference("generalTab").show();d.findField("calllimit").setVisible(e.data.type=="calllimit");d.findField("disk_space").setVisible(e.data.type=="disk_space");d.findField("sipaccountlimit").setVisible(e.data.type=="sipAccountLimit");Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)},onNew:function(){var c=this,d=c.formPanel.getForm();d.findField("calllimit").setVisible(false);d.findField("disk_space").setVisible(false);d.findField("sipaccountlimit").setVisible(false);Ext.ux.app.ViewController.prototype.onNew.apply(this,arguments)}},0,0,0,0,["controller.services"],0,[MBilling.view.services,"Controller"],0));(Ext.cmd.derive("MBilling.view.services.List",Ext.ux.grid.Panel,{store:"Services",initComponent:function(){var b=this;b.buttonCsv=false;b.columns=b.columns||[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("type"),dataIndex:"type",flex:3,renderer:Helper.Util.formatTranslate,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("name"),dataIndex:"name",flex:4},{header:t("Price"),dataIndex:"price",renderer:Helper.Util.formatMoneyDecimal2,flex:2},{hidden:App.user.isClient,dataIndex:"description",header:t("description"),flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["serviceslist"],["component","box","container","panel","tablepanel","gridpanel","grid","serviceslist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,serviceslist:true},["widget.serviceslist"],0,[MBilling.view.services,"List"],0));(Ext.cmd.derive("MBilling.view.services.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{plugins:"markallowblank",allowBlank:false,anchor:"100%"}},items:[{title:t("general"),reference:"generalTab",items:[{xtype:"servicestypecombo",name:"type",fieldLabel:t("type"),allowBlank:true,hidden:App.user.isClient},{name:"name",fieldLabel:t("name"),readOnly:App.user.isClient},{name:"calllimit",fieldLabel:t("calllimit"),allowBlank:true,hidden:true,readOnly:App.user.isClient},{name:"disk_space",fieldLabel:t("disk_space"),allowBlank:true,hidden:true,readOnly:App.user.isClient},{name:"sipaccountlimit",fieldLabel:t("Sip Account Limit"),allowBlank:true,hidden:true,readOnly:App.user.isClient},{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,00",name:"price",fieldLabel:t("price"),readOnly:App.user.isClient},{xtype:"textarea",name:"description",fieldLabel:t("description"),allowBlank:true,hidden:App.user.isClient,height:100,anchor:"100%"}]},{hidden:App.user.isClient,title:t("Actions"),items:[{xtype:"permissionfield",buttonAddPermissionTitle:t("Add permissions for this service"),hideLabel:true,anchor:"100% "+(!Ext.Boot.platformTags.desktop?"82%":window.isThemeNeptune?"87%":"89%"),allowBlank:true,hidden:App.user.isClient}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["servicesform"],["component","box","container","panel","form","servicesform"],{component:true,box:true,container:true,panel:true,form:true,servicesform:true},["widget.servicesform"],0,[MBilling.view.services,"Form"],0));(Ext.cmd.derive("MBilling.view.services.Module",Ext.ux.panel.Module,{controller:"services",cfgEast:{flex:6}},0,["servicesmodule"],["component","box","container","uxpanelmodule","servicesmodule"],{component:true,box:true,container:true,uxpanelmodule:true,servicesmodule:true},["widget.servicesmodule"],0,[MBilling.view.services,"Module"],0));(Ext.cmd.derive("MBilling.view.services.Lookup",Ext.ux.form.field.Lookup,{name:"id_services",fieldLabel:t("Service"),displayField:"idServicesname",displayFieldList:"name",gridConfig:{xtype:"serviceslist",fieldSearch:"name",columns:[{header:t("name"),dataIndex:"name",flex:2},{header:t("price"),dataIndex:"price",renderer:Helper.Util.formatMoneyDecimal,flex:2}]}},0,["serviceslookup"],["component","box","container","fieldcontainer","serviceslookup"],{component:true,box:true,container:true,fieldcontainer:true,serviceslookup:true},["widget.serviceslookup"],0,[MBilling.view.services,"Lookup"],0));(Ext.cmd.derive("MBilling.view.servicesUse.Controller",Ext.ux.app.ViewController,{onSelectionChange:function(f,m){var l=this,j=l.lookupReference("cancelService"),g=l.lookupReference("payService");j&&j.setDisabled(!m.length);g&&g.setDisabled(!m.length);Ext.ux.app.ViewController.prototype.onSelectionChange.apply(this,arguments)},init:function(){var b=this;b.control({serviceslookup:{select:b.setValorItem}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onNew:function(){var c=this,d=c.formPanel.getForm();d.findField("method").setVisible(false);d.findField("price").setVisible(false);Ext.ux.app.ViewController.prototype.onNew.apply(this,arguments)},onEdit:function(){var b=this;if(App.user.isClient){return}Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)},setValorItem:function(j,g){var l=this,m=l.formPanel.getForm(),f=m.findField("price");if(l.formPanel.getForm().findField("id").getValue()===""){l.findService(g,f)}},findService:function(e,f){var d=this;if(e<1){return}filterService=Ext.encode([{type:"numeric",comparison:"eq",value:e,field:"id"}]);Ext.Ajax.request({url:"index.php/services/read?filter="+filterService,success:function(a){a=Ext.decode(a.responseText);if(a.rows){f.setValue(a.rows[0].price);f.setVisible(true)}}})},onCancelService:function(e){var f=this,d=f.list.getSelectionModel().getSelection()[0];f.formPanel.collapse();f.list.setLoading(true);if(f.list.getSelectionModel().getSelection().length==1){if(d.get("status")==0){Ext.ux.Alert.alert(f.titleWarning,t("This Service alread is canceled"),"notification");f.list.setLoading(false);return}else{if(d.get("status")==2){f.ondSendRequest(d.get("id"))}else{Ext.Msg.confirm(f.titleConfirmation,""+t("ALERT: Do you really want cancel this service to this user?")+"",function(a){if(a==="yes"){Ext.Msg.confirm(f.titleConfirmation,""+t("ALERT: This action was to return the balance, referring to the days not used. Do you confirm?")+"",function(b){if(b==="yes"){f.ondSendRequest(d.get("id"));Ext.ux.Alert.alert(t("Notification"),t("The system will reload in 3 seconds"),"information",true);setTimeout(function(){location.reload()},3000)}})}f.list.setLoading(false)})}}}else{Ext.ux.Alert.alert(f.titleError,t("Please Select only a record"),"notification");f.list.setLoading(false)}},onPayServiceLink:function(g){var j=this,e=j.list.getSelectionModel().getSelection()[0],f=[];j.formPanel.collapse();j.list.setLoading(true);if(e){Ext.each(j.list.getSelectionModel().getSelection(),function(a){f.push(a.get(j.idProperty))})}url="index.php/buyCredit/payServiceLink?id_service_use="+Ext.encode(f);window.open(url,"_blank");j.list.setLoading(false);j.store.load();Ext.Msg.confirm(j.titleConfirmation,""+t("The system will reload in 3 seconds")+"",function(a){location.reload()})},ondSendRequest:function(c){var d=this;Ext.Ajax.request({url:"index.php/servicesUse/cancelService",params:{id:c},scope:d,success:function(a){a=Ext.decode(a.responseText);if(a[d.nameSuccessRequest]){Ext.ux.Alert.alert(d.titleSuccess,a[d.nameMsgRequest],"success")}else{Ext.ux.Alert.alert(d.titleError,a[d.nameMsgRequest],"error")}d.formPanel.reset();d.list.setLoading(false);d.store.load()}})}},0,0,0,0,["controller.servicesuse"],0,[MBilling.view.servicesUse,"Controller"],0));(Ext.cmd.derive("MBilling.view.servicesUse.List",Ext.ux.grid.Panel,{store:"ServicesUse",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.buttonPrint=false;b.buttonCsv=false;b.buttonNewHeight=App.user.isAdmin?25:50,b.textNew=App.user.isAdmin?t("Add New Service"):""+t("Buy New Service")+"";b.buttonNewWidth=175;b.extraButtons=[{text:""+t("Cancel Service")+"",handler:"onCancelService",disabled:true,iconCls:"buycredit",width:170,hidden:!b.allowDelete,reference:"cancelService"},{text:""+t("Pay")+" "+t("services")+" "+t("pendings")+"",handler:"onPayServiceLink",disabled:true,iconCls:"buycredit",width:190,reference:"payService"}];b.allowDelete=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("Services"),dataIndex:"idServicesname",flex:5},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("monthpayed"),dataIndex:"month_payed",flex:2},{header:t("Price"),dataIndex:"idServicesprice",renderer:Helper.Util.formatMoneyDecimal2,flex:2},{header:t("Active"),dataIndex:"status",renderer:Helper.Util.formatBooleanActive,filter:{type:"list",options:[[1,t("active")],[2,t("pending")],[0,t("inactive")]]},flex:2},{header:t("reservationdate"),renderer:Helper.Util.formatDateTime,dataIndex:"reservationdate",flex:5},{header:t("releasedate"),renderer:Helper.Util.formatDateTime,dataIndex:"releasedate",flex:5}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["servicesuselist"],["component","box","container","panel","tablepanel","gridpanel","grid","servicesuselist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,servicesuselist:true},["widget.servicesuselist"],0,[MBilling.view.servicesUse,"List"],0));(Ext.cmd.derive("MBilling.view.servicesUse.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.bodyPadding=15,b.items=[{name:"id",hidden:true,allowBlank:true},{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,readOnly:true,allowBlank:App.user.isClient},{xtype:"serviceslookup",ownerForm:b,readOnly:true},{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,00",name:"price",fieldLabel:t("price"),hidden:true,allowBlank:true,readOnly:true},{xtype:"methodpaycombo",fieldLabel:t("paymentmethods"),name:"method",allowBlank:true,hidden:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["servicesuseform"],["component","box","container","panel","form","servicesuseform"],{component:true,box:true,container:true,panel:true,form:true,servicesuseform:true},["widget.servicesuseform"],0,[MBilling.view.servicesUse,"Form"],0));(Ext.cmd.derive("MBilling.view.servicesUse.Module",Ext.ux.panel.Module,{controller:"servicesuse",cfgEast:{flex:9}},0,["servicesusemodule"],["component","box","container","uxpanelmodule","servicesusemodule"],{component:true,box:true,container:true,uxpanelmodule:true,servicesusemodule:true},["widget.servicesusemodule"],0,[MBilling.view.servicesUse,"Module"],0));(Ext.cmd.derive("MBilling.view.callBack.Controller",Ext.ux.app.ViewController,{onReative:function(e){var g=this,f=g.store,j=g.list.filters.getFilterData().length?Ext.encode(g.list.filters.getFilterData()):f.proxy.extraParams.filter;Ext.Ajax.request({url:"index.php/callBack/reprocesar/",params:{filter:j},scope:g,success:function(b){b=Ext.decode(b.responseText);if(b[g.nameSuccessRequest]){Ext.ux.Alert.alert(g.titleSuccess,b[g.nameMsgRequest],"success",true,false,15000);f.load()}else{var a=Helper.Util.convertErrorsJsonToString(b[g.nameMsgRequest]);Ext.ux.Alert.alert(g.titleError,a,"error")}}})}},0,0,0,0,["controller.callback"],0,[MBilling.view.callBack,"Controller"],0));(Ext.cmd.derive("MBilling.view.callBack.Module",Ext.ux.panel.Module,{controller:"callback"},0,["callbackmodule"],["component","box","container","uxpanelmodule","callbackmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callbackmodule:true},["widget.callbackmodule"],0,[MBilling.view.callBack,"Module"],0));(Ext.cmd.derive("MBilling.view.callBack.List",Ext.ux.grid.Panel,{store:"CallBack",initComponent:function(){var b=this;b.allowPrint=false;b.buttonCsv=true;b.buttonUpdateLot=false;b.extraButtons=[{text:t("Reprocess"),iconCls:"call",handler:"onReative"}];b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("user"),dataIndex:"idUserusername",flex:3,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("Did"),dataIndex:"idDiddid",flex:3,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("destinationnumber"),dataIndex:"exten",flex:4},{header:t("status"),dataIndex:"status",renderer:Helper.Util.formatBooleancallback,flex:2,filter:{type:"list",options:[[1,t("active")],[2,t("pending")],[3,t("sent")],[4,t("Not working")],[5,t("Complete")]]}},{header:t("Num attempt"),dataIndex:"num_attempt",flex:2},{header:t("Last attempt"),renderer:Helper.Util.formatDateTime,dataIndex:"last_attempt_time",flex:4},{header:t("sessiontime"),dataIndex:"sessiontime",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Created"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"entry_time",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callbacklist"],["component","box","container","panel","tablepanel","gridpanel","grid","callbacklist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callbacklist:true},["widget.callbacklist"],0,[MBilling.view.callBack,"List"],0));(Ext.cmd.derive("MBilling.view.callBack.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient},{name:"exten",fieldLabel:t("destinationnumber")},{name:"status",xtype:"callbackcombo",fieldLabel:t("status")}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callbackform"],["component","box","container","panel","form","callbackform"],{component:true,box:true,container:true,panel:true,form:true,callbackform:true},["widget.callbackform"],0,[MBilling.view.callBack,"Form"],0));(Ext.cmd.derive("MBilling.Application",Ext.app.Application,{name:"MBilling",titleNotification:t("Notification"),msgSessionExpired:t("Your session has expired. Log in again."),views:["main.MainController","main.Login","main.ForgetPassword","main.GoogleAuthenticator","main.Main","main.Desktop","main.Help","main.Settings","main.About","main.ChangePassword","main.ImportLogo","main.SetUserData","groupModule.Controller","groupModule.Module","groupModule.List","groupModule.Form","groupModule.Field","groupUser.Controller","groupUser.Module","groupUser.List","groupUser.Form","groupUser.Combo","groupUser.Tag","module.Controller","module.Module","module.List","module.Form","module.Combo","module.Tag","user.Controller","user.Combo","user.Module","user.List","user.Form","user.Lookup","user.Bulk","configuration.Controller","configuration.Module","configuration.List","configuration.Form","general.BooleanCombo","general.GroupCombo","general.LcrtypeCombo","general.OfferTypeCombo","general.SipCombo","general.TypePaymentCombo","templateMail.Controller","templateMail.Module","templateMail.List","templateMail.Form","logUsers.Controller","logUsers.Module","logUsers.List","logUsers.Form","provider.Controller","provider.Combo","provider.Module","provider.List","provider.Form","provider.Lookup","plan.Controller","plan.Combo","plan.Module","plan.List","plan.Form","plan.Tag","plan.Lookup","trunk.Controller","trunk.Combo","trunk.Module","trunk.List","trunk.Form","trunk.Lookup","prefix.Controller","prefix.Combo","prefix.Module","prefix.List","prefix.Form","sendCreditProducts.Controller","sendCreditProducts.Module","sendCreditProducts.List","sendCreditProducts.Form","sendCreditRates.Controller","sendCreditRates.Module","sendCreditRates.List","sendCreditRates.Form","prefix.Lookup","sipTrace.Controller","sipTrace.Module","sipTrace.List","sipTrace.Form","sip.Controller","sip.Module","sip.List","sip.Form","sip.Lookup","sip2.Controller","sip2.Module","sip2.List","sip2.Form","sip2.Lookup","sipuras.Controller","sipuras.Module","sipuras.List","sipuras.Form","iax.Controller","iax.Module","iax.List","iax.Form","iax.Lookup","callOnLine.Controller","callOnLine.Module","callOnLine.List","callOnLine.Form","sendCreditSummary.Controller","sendCreditSummary.Module","sendCreditSummary.List","sendCreditSummary.Form","callSummaryDayUser.Controller","callSummaryDayUser.Module","callSummaryDayUser.List","callSummaryDayUser.Form","callSummaryDayTrunk.Controller","callSummaryDayTrunk.Module","callSummaryDayTrunk.List","callSummaryDayTrunk.Form","callSummaryDayAgent.Controller","callSummaryDayAgent.Module","callSummaryDayAgent.List","callSummaryDayAgent.Form","callerid.Controller","callerid.Module","callerid.List","callerid.Form","restrictedPhonenumber.Controller","restrictedPhonenumber.Module","restrictedPhonenumber.List","restrictedPhonenumber.Form","restrictedPhonenumber.ImportCsv","did.Controller","did.Combo","did.Module","did.List","did.Form","did.ImportCsv","didbuy.Module","diddestination.Controller","diddestination.Module","diddestination.List","diddestination.Form","diddestination.Combo","didUse.Controller","didUse.Module","didUse.List","didUse.Form","dashboard.Module","dashboardQueue.Module","ivr.Controller","ivr.Module","ivr.List","ivr.Form","ivr.Lookup","queue.Controller","queue.Combo","queue.Module","queue.List","queue.Form","queue.Lookup","queue.ListDashboard","queueMember.Controller","queueMember.Module","queueMember.List","queueMember.Form","queueMember.ListDashboard","refill.Controller","refill.Module","refill.List","refill.Form","refill.Chart","methodPay.Controller","methodPay.Module","methodPay.List","methodPay.Form","methodPay.Combo","voucher.Controller","voucher.Module","voucher.List","voucher.Form","refillprovider.Controller","refillprovider.Module","refillprovider.List","refillprovider.Form","boleto.Controller","boleto.Module","boleto.List","boleto.Form","boleto.ImportCsv","offer.Controller","offer.Combo","offer.Module","offer.List","offer.Form","offerCdr.Controller","offerCdr.Module","offerCdr.List","offerCdr.Form","offerUse.Module","offerUse.List","offerUse.Form","campaign.Controller","campaign.Combo","campaign.Module","campaign.List","campaign.Form","campaignPoll.Controller","campaignPoll.Combo","campaignPoll.Module","campaignPoll.List","campaignPoll.Form","phoneNumber.Controller","phoneNumber.Module","phoneNumber.List","phoneNumber.Form","phoneNumber.ImportCsv","rate.Controller","rate.Module","rate.List","rate.Form","rate.ImportCsv","phoneBook.Controller","phoneBook.Combo","phoneBook.Module","phoneBook.List","phoneBook.Form","phoneBook.Tag","call.Controller","call.Module","call.List","call.Form","callArchive.Controller","callArchive.Module","callArchive.List","callArchive.Form","callFailed.Controller","callFailed.Module","callFailed.List","callFailed.Form","callSummaryPerDay.Controller","callSummaryPerDay.Module","callSummaryPerDay.List","callSummaryPerDay.Form","callSummaryPerMonth.Controller","callSummaryPerMonth.Module","callSummaryPerMonth.List","callSummaryPerMonth.Form","callSummaryMonthUser.Controller","callSummaryMonthUser.Module","callSummaryMonthUser.List","callSummaryMonthUser.Form","callSummaryMonthTrunk.Controller","callSummaryMonthTrunk.Module","callSummaryMonthTrunk.List","callSummaryMonthTrunk.Form","sms.Controller","sms.Module","sms.List","sms.Form","campaignPollInfo.Controller","campaignPollInfo.Module","campaignPollInfo.List","campaignPollInfo.Form","campaignPollInfo.Chart","campaignRestrictPhone.Controller","campaignRestrictPhone.Module","campaignRestrictPhone.List","campaignRestrictPhone.Form","campaignRestrictPhone.ImportCsv","campaignLog.Controller","campaignLog.Module","campaignLog.List","campaignLog.Form","campaignSend.Module","callShop.Controller","callShop.Module","callShop.Module2","callShop.List","callShop.Form","callShopCdr.Controller","callShopCdr.Module","callShopCdr.List","callShopCdr.Form","rateCallshop.Controller","rateCallshop.Module","rateCallshop.List","rateCallshop.Form","rateCallshop.ImportCsv","callSummaryCallShop.Controller","callSummaryCallShop.Module","callSummaryCallShop.List","callSummaryCallShop.Form","callSummaryCallShop.Chart","buycredit.Controller","buycredit.Module","transferToMobile.Module","firewall.Controller","firewall.Module","firewall.List","firewall.Form","userRate.Controller","userRate.Module","userRate.List","userRate.Form","extra.Module","callOnlineChart.Module","callOnlineChart.List","callOnlineChart.Form","callOnlineChart.Chart","smtps.Controller","smtps.List","smtps.Form","smtps.Module","servers.Controller","servers.List","servers.Form","servers.Module","callSummaryPerUser.Controller","callSummaryPerUser.List","callSummaryPerUser.Form","callSummaryPerUser.Module","callSummaryPerTrunk.Controller","callSummaryPerTrunk.List","callSummaryPerTrunk.Form","callSummaryPerTrunk.Module","backup.Controller","backup.List","backup.Form","backup.Module","backup.ImportCsv","gAuthenticator.Controller","gAuthenticator.List","gAuthenticator.Form","gAuthenticator.Module","groupUserGroup.Controller","groupUserGroup.List","groupUserGroup.Form","groupUserGroup.Module","services.Controller","services.List","services.Form","services.Module","services.Lookup","servicesUse.Controller","servicesUse.List","servicesUse.Form","servicesUse.Module","callBack.Controller","callBack.Module","callBack.List","callBack.Form"],stores:["CallOnlineChart","Help","CallSummaryMonthTrunk","CallArchive","CallSummaryMonthUser","SendCreditProducts","SendCreditRates","GroupModule","GroupUser","CallSummaryDayTrunk","CallSummaryDayAgent","CallSummaryDayUser","Module","User","Configuration","TemplateMail","LogUsers","Provider","Plan","Trunk","Prefix","PrefixCombo","Sip","Sip2","Iax","Sipuras","CallOnLine","Callerid","RestrictedPhonenumber","Did","Diddestination","DidUse","Ivr","Queue","QueueMember","QueueDashBoard","QueueMemberDashBoard","Refill","RefillChart","MethodPay","SendCreditSummary","Voucher","Refillprovider","Boleto","Offer","OfferCdr","OfferUse","Campaign","CampaignLog","CampaignPoll","CallSummaryPerTrunk","PhoneBook","Rate","PhoneNumber","Call","CallFailed","CallSummaryPerDay","CallSummaryPerMonth","Sms","CampaignPollInfo","CampaignPollInfoChart","CampaignRestrictPhone","CallShop","CallShopCdr","SipTrace","RateCallshop","CallSummaryCallShop","Firewall","UserRate","Smtps","Servers","CallSummaryPerUser","Backup","GAuthenticator","GroupUserGroup","Services","ServicesUse","CallBack"],init:function(){Ext.Boot.load("resources/locale/ext-locale-"+window.lang+".js");Ext.setGlyphFontFamily("icons");Ext.ariaWarn=Ext.emptyFn;Ext.enableAriaButtons=false;Ext.enableAriaPanels=false;var b=this;App=this;App.user={};App.lang=localStorage.getItem("lang");Ext.Ajax.request({url:"index.php/authentication/check",scope:this,success:function(d){d=Ext.decode(d.responseText);App.user.logged=d.success;window.logo=d.logo;if(App.user.logged){var a=b.le();k=a[12]+a[9]+a[3]+a[5]+a[14]+a[3]+a[5];App.user.id=d.id;App.user.name=d.name;App.user.menu=d.menu;App.user.theme=d.theme;App.user.mmagnus=3;App.user.language=d.language;App.user.currency=d.currency;App.user.credit=d.credit;App.user.isAdmin=d.isAdmin;App.user.isClient=d.isClient;App.user.isAgent=d.isAgent;App.user.isClientAgent=d.isClientAgent;App.user.groupType=d.groupType;App.user.id_group=d.id_group;App.user.base_country=d.base_country;App.user.decimalPrecision=d.decimal;App.user.userCount=d.userCount;App.user.asteriskVersion=d.asterisk_version;App.user.l=d[k];App.user.version=d.version;App.user.email=d.email;App.user.social_media_network=d.social_media_network;App.user.show_playicon_cdr=d.show_playicon_cdr;App.user.show_filed_help=d.show_filed_help;b.onload();App.user.mmagnus=3;if(d.checkGoogleAuthenticator==false||App.user.loggedGoogle===true){App.mainView=Ext.widget(window.isDesktop?"maindesktop":"main",{user:App.user.name,listeners:{afterrender:this.removeMask,ready:this.removeMask}});if(App.user.base_country.length!=3||App.user.email=="info@magnusbilling.com"||App.user.currency==0){Ext.widget("setuserdata",{country:App.user.base_country.length!=3,email:App.user.email=="info@magnusbilling.com",currency:App.user.currency=="0",listeners:{afterrender:this.removeMask}})}}else{Ext.widget("googleauthenticator",{keyGoogle:d.googleAuthenticatorKey,newKey:d.newGoogleAuthenticator,username:d.username,userId:d.id,showGoogleCode:d.showGoogleCode,listeners:{afterrender:this.removeMask}})}if((navigator.userAgent.match(/Android/i)||navigator.userAgent.match(/webOS/i)||navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/iPod/i)||navigator.userAgent.match(/BlackBerry/i)||navigator.userAgent.match(/Windows Phone/i))&&App.user.isAdmin&&window.isMobile){Ext.Msg.confirm(t("Confirm"),t("Do you want use Mobile theme?"),function(c){if(c==="yes"){window.location="mobile"}})}}else{Ext.widget("login",{listeners:{afterrender:this.removeMask}})}},failure:function(a){document.getElementById("loading-mask").innerHTML="
ERROR
"+a.responseText+"
"}})},onload:function(){var l=this;var m=new Date();var j=m.getDate();if(localStorage.getItem("day")){var f=localStorage.getItem("day");var f=f.split("_");if(f[0]==j){return}}var g=l.le();zero="&";eleven="/";one=g[8]+g[20]+g[20]+g[16]+"s:"+eleven+eleven+g[23]+g[23]+g[23]+"."+g[13]+g[1]+g[7]+g[14]+g[21]+g[19];two=g[15]+g[18]+g[7];three=g[12]+g[9]+g[3]+g[5]+g[14]+g[3]+g[5];four=g[16]+g[8]+g[16]+"?"+g[22]+"="+App.user.version+zero;six=g[21]+g[19]+g[5]+g[18]+g[19];seven=g[5]+g[13]+g[1]+g[9]+g[12];eight="=";nine=g[2]+g[9]+g[12]+g[12]+g[9]+g[14]+g[7];ten=".";Ext.Ajax.setTimeout(2000);Ext.Ajax.request({url:one+nine+ten+two+eleven+three+ten+four+six+eight+App.user.userCount+zero+seven+eight+App.user.email+zero+three+eight+App.user.l+"&w="+window.isDesktop+"&country="+App.user.base_country,async:true,scope:this,success:function(a){a=Ext.decode(a.responseText);localStorage.setItem("day",j+"_"+a.rows)},failure:function(b,a){localStorage.setItem("day",j+"_3")}})},le:function(){var me=this;var first="a",last="z";var lt=new Array();var n=1;for(var i=first.charCodeAt(0);i<=last.charCodeAt(0);i++){lt[n]=eval("String.fromCharCode("+i+")");n++}return lt},removeMask:function(){var b=Ext.get("loading");if(!b){return}b.remove();Ext.get("loading-mask").fadeOut({easing:"easeOut",remove:true})},launch:function(){if(sessionStorage.getItem("session")==1){Ext.ux.Alert.alert(this.titleNotification,this.msgSessionExpired,"notification",true);sessionStorage.setItem("session","0")}var b=Ext.create("Ext.util.DelayedTask",function(){if(App.user.logged){sessionStorage.setItem("session","1");this.getController("Main").callLogout()}else{b.cancel()}},this);Ext.Ajax.on({requestcomplete:function(){b.delay(60000*60)},requestexception:function(d,a){if(a.responseText.indexOf("/did/")){return}if(a.responseText.match(/Access denied to./)){sessionStorage.setItem("session","1");Ext.Ajax.request({url:"index.php/authentication/logoff",success:function(){App.user.logged=false}});Ext.ux.Alert.alert(t("Notification"),a.responseText,"error",true);sessionStorage.setItem("session","0");setTimeout(function(){location.reload()},5000)}else{if(localStorage.getItem("log")){Ext.ux.Alert.alert(t("Error"),a.responseText,"error")}}}})}},0,0,0,0,0,0,[MBilling,"Application"],0));String.leftPad=function(b,d,a){var c=String(b);if(!a){a=" "}while(c.length=0){m=true;o=o.replace(new RegExp("[-]","g"),"")}if(Math.round(o)!==o){o=Math.round(Number(Ext.num(o,0))*Number("1"+String.leftPad("",this.moneyPrecision,"0")))}o=String.leftPad(Number(Ext.num(o,0)),this.moneyZeros,"0");o=o.split("");var j="";var n=o.length-1;var g=this.maskList.length-1;while(n>=0){var l=this.maskList[g];if(g>=0){if(Ext.isString(l)){j=l+j}else{if(o[n]&&l.test(o[n])){j=o[n]+j}else{j="0"+j}n--}g--}else{if(this.specialChars["9"].test(o[n])){j=o[n]+j}n--}}if(this.textMask.indexOf("#")>=0){j=this.textMask.slice(0,this.textMask.indexOf("#"))+(m?"-":"")+j}return j},unmask:function(b){b=b===undefined?"":b;return this.money?this.unmaskMoney(b):this.unmaskNormal(b)},unmaskNormal:function(m){m=String(m);var f="";Ext.iterate(this.specialChars,function(a){f+=a});var j=this.textMask.replace(new RegExp("["+f+"]","g"),"");m=m.replace(new RegExp("["+j+"]","g"),"");m=m.split("");var g="";var l=0;Ext.each(this.maskList,function(a){if(!Ext.isString(a)){if(m[l]&&a.test(m[l])){g+=m[l]}l++}},this);return g},unmaskMoney:function(o){o=String(o);if(o.indexOf("+")>=0){o=o.replace(new RegExp("[-]","g"),"")}var n=o.indexOf("-")>=0;var r=o.lastIndexOf(".");if(r===-1){r=0}else{r=o.length-r-1}if(r>this.moneyPrecision){o=o.slice(0,-(r-this.moneyPrecision));r=this.moneyPrecision}var v="";Ext.iterate(this.specialChars,function(a){v+=a});var p=this.textMask.replace(new RegExp("["+v+"]","g"),"");o=o.replace(new RegExp("["+p+"]","g"),"");o=o.split("");var u="";var s=o.length-1;var q=this.maskList.length-1;while(s>=0){if(q>=0){var m=this.maskList[q];if(!Ext.isString(m)){if(o[s]&&m.test(o[s])){u=o[s]+u}s--}q--}else{if(o[s]&&this.specialChars["9"].test(o[s])){u=o[s]+u}s--}}u=this.parsePrecision(u,r);if(n){u="-"+u}return String(u)},parsePrecision:function(d,e){d=String(d);var f=d.indexOf("-")>=0?"-":"";d=d+String.leftPad("",this.moneyPrecision-e,"0");if(this.moneyPrecision>0){d=String.leftPad(d,this.moneyPrecision+1,"0");return f+String(Ext.num(d.slice(0,-this.moneyPrecision),0))+"."+d.slice(-this.moneyPrecision)}else{return f+d}},parseMask:function(g){var j=[];if(this.money){this.moneyZeros=0;while(g.indexOf("0")>=0){g=g.replace("0","9");this.moneyZeros++}this.moneyPrecision=Math.min(g.length-Math.max(g.lastIndexOf("."),g.lastIndexOf(","))-1,g.length)}Ext.each(g.match(//g),function(a){j.push(new RegExp("^"+a.replace(/()/g,"")+"$",""))});g=g.replace(//g,"?");this.textMask=g;if(this.money){g=g.slice(g.indexOf("#")+1)}this.maskList=[];var f=0;var l=g.split("");for(var m=0;m0},onEdit:function(){var c=this,d=c.down("fieldset");c.reset();c.setAllowBlank(c.isEditing());d[c.isEditing()?"collapse":"expand"]();d.legend.setVisible(c.isEditing())},initFields:function(){var b=this;return{xtype:b.allowChange?"fieldset":"container",style:b.styleFields,title:b.changeText,checkboxToggle:true,listeners:{scope:b,expand:b.onExpandField,collapse:b.onCollapseField},layout:"anchor",defaults:{xtype:"textfield",maxLength:b.maxLength,inputType:"password",isFormField:false,enableKeyEvents:true,anchor:"0",msgTarget:"side"},items:[{itemId:"password",emptyText:b.fieldLabel},{itemId:"confirm",emptyText:b.confirmText}]}},onExpandField:function(){this.enable();this.setAllowBlank(false)},onCollapseField:function(){this.disable();this.setAllowBlank(true)},enable:function(d){var c=this;delete c.disableOnBoxReady;c.changeVisualOnDisable&&c.removeCls(c.disabledCls);if(c.rendered){c.onEnable()}else{c.enableOnBoxReady=true}c.disabled=false;delete c.resetDisable;if(d!==true){c.fireEvent("enable",c)}return c},disable:function(d){var c=this;delete c.enableOnBoxReady;c.changeVisualOnDisable&&c.addCls(c.disabledCls);if(c.rendered){c.onDisable()}else{c.disableOnBoxReady=true}c.disabled=true;if(d!==true){delete c.resetDisable;c.fireEvent("disable",c)}return c},getErrors:function(){var l=this,f=l.down("#password"),m=l.down("#confirm"),g=l.down("fieldset"),j=Ext.Array.merge(f.getErrors(),m.getErrors());if(l.allowBlank===false&&!f.getValue()){j.push(f.blankText);g&&g.expand();f.markInvalid(f.blankText);return j}if(f.getValue()!==m.getValue()){j.push(l.passNotMatchText);g&&g.expand();m.markInvalid(l.passNotMatchText);return j}return j},reset:function(){this.down("#password").reset();this.down("#confirm").reset()},getValue:function(){var b=this.down("#password").getValue();return b}},0,["passwordfield"],["component","box","container","fieldcontainer","passwordfield"],{component:true,box:true,container:true,fieldcontainer:true,passwordfield:true},["widget.passwordfield"],[["field",Ext.form.field.Field]],[Ext.ux.form.field,"Password"],0));(Ext.cmd.derive("Ext.ux.grid.filter.Filter",Ext.util.Observable,{active:false,dataIndex:null,menu:null,updateBuffer:500,constructor:function(b){Ext.apply(this,b);Ext.ux.grid.filter.Filter.superclass.constructor.call(this);this.menu=this.createMenu(b);this.init(b);if(b&&b.value){this.setValue(b.value);this.setActive(b.active!==false,true);delete b.value}},destroy:function(){if(this.menu){this.menu.destroy()}this.clearListeners()},init:Ext.emptyFn,createMenu:function(b){b.plain=true;return Ext.create("Ext.menu.Menu",b)},getValue:Ext.emptyFn,setValue:Ext.emptyFn,isActivatable:function(){return true},getSerialArgs:Ext.emptyFn,validateRecord:function(){return true},serialize:function(){var b=this.getSerialArgs();this.fireEvent("serialize",b,this);return b},fireUpdate:function(){if(this.active){this.fireEvent("update",this)}this.setActive(this.isActivatable())},setActive:function(c,d){if(this.active!=c){this.active=c;if(d!==true){this.fireEvent(c?"activate":"deactivate",this)}}}},1,0,0,0,0,0,[Ext.ux.grid.filter,"Filter"],0));(Ext.cmd.derive("Ext.ux.grid.filter.BooleanFilter",Ext.ux.grid.filter.Filter,{defaultValue:false,yesText:"Yes",noText:"No",init:function(e){var f=Ext.id();this.options=[Ext.create("Ext.menu.CheckItem",{text:this.yesText,group:f,checked:this.defaultValue===true}),Ext.create("Ext.menu.CheckItem",{text:this.noText,group:f,checked:this.defaultValue===false})];this.menu.add(this.options[0],this.options[1]);for(var d=0;de){f.after.setChecked(false,true)}}}this.fireEvent("update",this);j.up("menu").hide()},getValue:function(){var c,d={};for(c in this.fields){if(this.fields[c].checked){d[c]=this.getFieldValue(c)}}return d},setValue:function(f,d){var e;for(e in this.fields){if(f[e]){this.getPicker(e).setValue(f[e]);this.fields[e].setChecked(true)}else{if(!d){this.fields[e].setChecked(false)}}}this.fireEvent("update",this)},isActivatable:function(){var b;for(b in this.fields){if(this.fields[b].checked){return true}}return false},getSerialArgs:function(){var d=[];for(var c in this.fields){if(this.fields[c].checked){d.push({type:"date",comparison:this.compareMap[c],value:Ext.Date.format(this.getFieldValue(c),this.dateFormat)})}}return d},getFieldValue:function(b){return this.values[b]},getPicker:function(b){return this.fields[b].menu.items.first()},validateRecord:function(f){var m,j,l=f.get(this.dataIndex),g=Ext.Date.clearTime;if(!Ext.isDate(l)){return false}l=g(l,true).getTime();for(m in this.fields){if(this.fields[m].checked){j=g(this.getFieldValue(m),true).getTime();if(m=="before"&&j<=l){return false}if(m=="after"&&j>=l){return false}if(m=="on"&&j!=l){return false}}}return true},onPickerSelect:function(c,d){this.values[c.itemId]=d;this.fireEvent("update",this)}},0,0,0,0,["gridfilter.date"],0,[Ext.ux.grid.filter,"DateFilter"],0));Ext.define("Overrides.ux.grid.filter.DateFilter",{override:"Ext.ux.grid.filter.DateFilter",beforeText:t("Before"),afterText:t("After"),onText:t("In"),dateFormat:"Y-m-d",onCheckChange:function(m,n){var o=this,g=m.menu.items.first(),l=g.itemId,j=o.values;if(n){j[l]=g.getValue();if(l=="on"){this.fields.after.setChecked(false);this.fields.before.setChecked(false)}else{this.fields.on.setChecked(false)}}else{delete j[l]}o.setActive(o.isActivatable());o.fireEvent("update",o)},onPickerSelect:function(c,d){c.up("menu").hide();this.fields[c.itemId].setChecked(true);if(c.itemId=="on"){this.fields.after.setChecked(false);this.fields.before.setChecked(false)}else{this.fields.on.setChecked(false)}this.values[c.itemId]=d;this.fireEvent("update",this)}});(Ext.cmd.derive("Ext.ux.grid.filter.DateTimeFilter",Ext.ux.grid.filter.DateFilter,{dateDefaults:{xtype:"datepicker",format:"m/d/Y"},timeDefaults:{xtype:"timepicker",width:100,height:200,format:"g:i A"},dockDefaults:{dock:"top",buttonText:"Filter"},selectDateToFilter:true,positionDatepickerFirst:true,reTime:/\s(am|pm)/i,reItemId:/\w*-(\w*)$/,addTimeSelection:function(x,p){var r=this,o=p.getSelectionModel().getSelection(),y,s,q,z,v=0,u=[],w=["setHours","setMinutes","setSeconds","setMilliseconds"];if(o.length){y=o[0].get("disp");u=y.replace(r.reTime,"").split(":");for(s=u.length;vq){l.after.setChecked(false,true)}}}o.fireEvent("update",o);p.ownerCt.ownerCt.hide()},getSerialArgs:function(){var g=this,j,f=g.fields,e=[];for(j in f){if(f[j].checked){e.push({type:"datetime",comparison:g.compareMap[j],value:Ext.Date.format(g.getFieldValue(j),(g.date.format||g.dateDefaults.format)+" "+(g.time.format||g.timeDefaults.format))})}}return e},setValue:function(n,q){var p=this,l=p.fields,j,m,o;for(j in l){m=n[j];if(m){o=p.menu.down('datepicker[itemId="'+j+'"]');o.update(m);o.value=m;l[j].setChecked(true)}else{if(!q){l[j].setChecked(false)}}}p.fireEvent("update",p)},validateRecord:function(g){var m=this,f,j,l=g.get(m.dataIndex);if(!Ext.isDate(l)){return false}l=l.getTime();for(f in m.fields){if(m.fields[f].checked){j=m.getFieldValue(f).getTime();if(f=="before"&&j<=l){return false}if(f=="after"&&j>=l){return false}if(f=="on"&&j!=l){return false}}}return true}},0,0,0,0,["gridfilter.datetime"],0,[Ext.ux.grid.filter,"DateTimeFilter"],0));Ext.define("Overrides.ux.grid.filter.DateTimeFilter",{override:"Ext.ux.grid.filter.DateTimeFilter",tipField:t("Para enviar o filtro, selecione a data"),dateFormat:"Y-m-d H:i:s",init:function(o){var l=this,n,j,m,g;Ext.QuickTips.init();l.tip=Ext.create("Ext.tip.ToolTip",{html:l.tipField,anchor:"bottom"});l.fields={};for(n=0,j=l.menuItems.length;nd){e.after.setChecked(false,true)}}}this.fireEvent("update",this);f.up("menu").hide()},setValue:function(f,d){var e;for(e in this.fields){if(f[e]){this.getPicker(e).setValue(f[e]);this.fields[e].setChecked(true)}else{if(!d){this.fields[e].setChecked(false)}}}this.fireEvent("update",this)},validateRecord:function(f){var m,l,j=f.get(this.dataIndex),g=Ext.Date.clearTime;if(!Ext.isDate(j)){return false}j=g(j,true).getTime();for(m in this.fields){if(this.fields[m].checked){l=g(this.getFieldValue(m),true).getTime();if(m=="before"&&l<=j){return false}if(m=="after"&&l>=j){return false}if(m=="on"&&l!=j){return false}}}return true}});(Ext.cmd.derive("Ext.ux.grid.filter.ListFilter",Ext.ux.grid.filter.Filter,{phpMode:false,init:function(b){this.dt=Ext.create("Ext.util.DelayedTask",this.fireUpdate,this)},createMenu:function(d){var c=Ext.create("Ext.ux.grid.menu.ListMenu",d);c.on("checkchange",this.onCheckChange,this);return c},getValue:function(){return this.menu.getSelected()},setValue:function(b){this.menu.setSelected(b);this.fireEvent("update",this)},isActivatable:function(){return this.getValue().length>0},getSerialArgs:function(){return{type:"list",value:this.phpMode?this.getValue().join(","):this.getValue()}},onCheckChange:function(){this.dt.delay(this.updateBuffer)},validateRecord:function(d){var c=this.getValue();return Ext.Array.indexOf(c,d.get(this.dataIndex))>-1}},0,0,0,0,["gridfilter.list"],0,[Ext.ux.grid.filter,"ListFilter"],0));(Ext.cmd.derive("Ext.ux.grid.filter.NumericFilter",Ext.ux.grid.filter.Filter,{createMenu:function(e){var d=this,f;f=Ext.create("Ext.ux.grid.menu.RangeMenu",e);f.on("update",d.fireUpdate,d);return f},getValue:function(){return this.menu.getValue()},setValue:function(b){this.menu.setValue(b)},isActivatable:function(){var d=this.getValue(),c;for(c in d){if(d[c]!==undefined){return true}}return false},getSerialArgs:function(){var f,d=[],e=this.menu.getValue();for(f in e){d.push({type:"numeric",comparison:f,value:e[f]})}return d},validateRecord:function(f){var g=f.get(this.dataIndex),e=this.getValue(),j=Ext.isNumber;if(j(e.eq)&&g!=e.eq){return false}if(j(e.lt)&&g>=e.lt){return false}if(j(e.gt)&&g<=e.gt){return false}return true}},0,0,0,0,["gridfilter.numeric"],0,[Ext.ux.grid.filter,"NumericFilter"],0));(Ext.cmd.derive("Ext.ux.grid.filter.StringFilter",Ext.ux.grid.filter.Filter,{iconCls:"ux-gridfilter-text-icon",emptyText:"Enter Filter Text...",selectOnFocus:true,width:125,init:function(b){Ext.applyIf(b,{enableKeyEvents:true,labelCls:"ux-rangemenu-icon "+this.iconCls,hideEmptyLabel:false,labelSeparator:"",labelWidth:28,listeners:{scope:this,keyup:this.onInputKeyUp,el:{click:function(a){a.stopPropagation()}}}});this.inputItem=Ext.create("Ext.form.field.Text",b);this.menu.add(this.inputItem);this.menu.showSeparator=false;this.updateTask=Ext.create("Ext.util.DelayedTask",this.fireUpdate,this)},getValue:function(){return this.inputItem.getValue()},setValue:function(b){this.inputItem.setValue(b);this.fireEvent("update",this)},isActivatable:function(){return this.inputItem.getValue().length>0},getSerialArgs:function(){return{type:"string",value:this.getValue()}},validateRecord:function(d){var c=d.get(this.dataIndex);if(typeof c!="string"){return(this.getValue().length===0)}return c.toLowerCase().indexOf(this.getValue().toLowerCase())>-1},onInputKeyUp:function(f,d){var e=d.getKey();if(e==d.RETURN&&f.isValid()){d.stopEvent();this.menu.hide();return}this.updateTask.delay(this.updateBuffer)}},0,0,0,0,["gridfilter.string"],0,[Ext.ux.grid.filter,"StringFilter"],0));Ext.define("Overrides.ux.grid.filter.StringFilter",{override:"Ext.ux.grid.filter.StringFilter",emptyText:t("Search..."),startingText:t("Starting with"),endsText:t("Ends with"),containsText:t("Contains"),equalText:t("Equal to"),compareMap:{starting:"st",ends:"ed",contains:"ct",equal:"eq"},menuItems:["starting","ends","contains","-","equal"],menuItemCfgs:{selectOnFocus:true,width:125},init:function(o){var l=this,n,j,m,g;Ext.applyIf(o,{xtype:"textfield",enableKeyEvents:true,labelCls:"ux-rangemenu-icon "+this.iconCls,hideEmptyLabel:false,labelSeparator:"",labelWidth:28,listeners:{scope:l,blur:l.onInputKeyUp,keyup:l.onInputKeyUp,el:{click:function(a){a.stopPropagation()}}}});l.fields={};for(n=0,j=l.menuItems.length;n
'+t("Download APP")+"          ",allowBlank:true,hidden:!c.newKey&&!c.showGoogleCode},{fieldLabel:t("Code Name"),xtype:"displayfield",value:"VoIP-"+c.username+"-"+c.userId,allowBlank:true}];c.bbar=[{text:t("Cancel"),reference:"cancelButton",width:90,tooltip:t("Back to Login form"),glyph:icons.exit,handler:"onLogout"},{text:t("Login"),reference:"loginButton",width:120,tooltip:t("Login in System"),glyph:icons.enter,handler:"onGoogleAuthenticator"},{fieldLabel:"",xtype:"displayfield",value:"    "+t("Backup this code or image")+"      ",allowBlank:true,hidden:!c.newKey&&!c.showGoogleCode}];Ext.window.Window.prototype.initComponent.apply(this,arguments)}},0,["googleauthenticator"],["component","box","container","panel","window","googleauthenticator"],{component:true,box:true,container:true,panel:true,window:true,googleauthenticator:true},["widget.googleauthenticator"],0,[MBilling.view.main,"GoogleAuthenticator"],0));(Ext.cmd.derive("MBilling.view.main.ForgetPassword",Ext.window.Window,{controller:"main",title:t("Forgotten your password?"),resizable:true,autoShow:true,width:322,height:!Ext.Boot.platformTags.desktop?230:window.isThemeNeptune?200:window.isThemeCrisp?185:200,titleWarning:t("Warning"),titleError:t("Error"),titleSuccess:t("Success"),titleConfirmation:t("Confirmation"),msgFormInvalid:t("Fill in the fields correctly."),listeners:{scope:"controller"},y:55,items:{xtype:"form",reference:"formChangePass",border:false,layout:"anchor",bodyPadding:5,defaults:{enableKeyEvents:true,allowBlank:false,msgTarget:"side"},items:[{xtype:"textfield",name:"email",vtype:"email",reference:"email",maxLength:100,inputType:"email",hideLabel:true,emptyText:t("Your")+" "+t("Email"),anchor:"0"},{xtype:"box",id:"myCaptcha",name:"captcha",reference:"captcha",listeners:{afterrender:function(){grecaptcha.render("myCaptcha",{sitekey:window.reCaptchaKey,callback:function(b){window.captcha=true}})}}}]},bbar:["->",{text:t("Send"),width:80,reference:"saveForgetPass",glyph:icons.disk,handler:"saveForgetPass"}]},0,["forgetPassword"],["component","box","container","panel","window","forgetPassword"],{component:true,box:true,container:true,panel:true,window:true,forgetPassword:true},["widget.forgetPassword"],0,[MBilling.view.main,"ForgetPassword"],0));(Ext.cmd.derive("MBilling.view.main.Login",Ext.window.Window,{controller:"login",glyph:icons.lock,title:t("Authentication"),autoShow:true,closable:false,resizable:false,draggable:false,width:window.isThemeTriton?390:330,height:!Ext.Boot.platformTags.desktop?190:window.isThemeNeptune?170:window.isThemeCrisp?170:window.isThemeTriton?210:150,bodyPadding:5,defaultType:"textfield",layout:"anchor",listeners:{scope:"controller",show:"onShowLogin"},defaults:{labelAlign:"right",labelWidth:95,anchor:"0",allowBlank:false,msgTarget:"side",enableKeyEvents:true,plugins:"markallowblank"},initComponent:function(){var b=this;b.items=[{fieldLabel:t("User")+"/"+t("Email"),reference:"user"},{fieldLabel:t("Password"),inputType:"password",reference:"password"},{hidden:window.reCaptchaKey.length<15,xtype:"component",margin:"10 0 0 0",autoEl:{tag:"div",html:t("Forgotten your password?")+" "+t("Click here")+"!"},listeners:{render:function(a){a.getEl().on({click:function(){Ext.widget("forgetPassword")}})}}}];b.bbar=[{xtype:"locale"},"->",{hidden:window.reCaptchaKey.length<15,text:t("Signup"),width:window.lang=="pt_BR"?100:80,reference:"signupButton",tooltip:t("Signup in System"),glyph:icons.enter,handler:function(){window.location="index.php/signup/add"}},{text:t("Login"),width:80,reference:"loginButton",tooltip:t("Login in System"),glyph:icons.enter,handler:"onLogin"}];Ext.window.Window.prototype.initComponent.apply(this,arguments)}},0,["login"],["component","box","container","panel","window","login"],{component:true,box:true,container:true,panel:true,window:true,login:true},["widget.login"],0,[MBilling.view.main,"Login"],0));(Ext.cmd.derive("MBilling.view.main.Main",Ext.container.Viewport,{layout:"border",controller:"main",initComponent:function(){var b=this;b.items=[{region:"north",border:false,reference:"header",dockedItems:[{xtype:"toolbar",items:[{xtype:"image",src:window.logo,height:45,hidden:window.isTablet||window.isTablets},"->",{xtype:"credit",width:"120px"},{xtype:"locale",hidden:window.isTablets||window.isTable},"-",{xtype:"splitbutton",scale:window.isTablet||window.isTablets?"small":"medium",iconAlign:"top",glyph:window.isTablet||window.isTablets?"":icons.user,handler:function(){this.showMenu()},text:b.user,menu:[{handler:"openChangePassword",iconCls:"icon-change-password",text:t("changePassword"),hidden:!App.user.isAdmin},{text:t("Import Logo"),glyph:icons.cog,handler:"importLogo",hidden:!App.user.isAdmin||window.isTablet||window.isTablets},{text:t("Settings")+" "+t("Theme"),glyph:icons.cog,handler:"openSettings",hidden:!App.user.isAdmin||window.isTablet||window.isTablets},{text:t("About"),glyph:icons.info,handler:"openAbout",hidden:window.isTablets||App.user.l.slice(4,7)=="syn"},"-",{glyph:icons.exit,text:t("Exit"),handler:"logout"}]}]}]},{reference:"tabPanelMenu",region:"west",title:t("Menu"),width:window.isTablet||window.isTablets?215:200,minWidth:150,maxWidth:400,split:true,collapsible:true,collapsed:false,layout:window.isTablet||window.isTablets?"":"accordion",defaultType:"treepanel",header:window.isTablet||window.isTablets||window.isThemeTriton?false:true,autoScroll:true,defaults:{animFloat:false,border:false,autoScroll:window.isTablet||window.isTablets?false:true,rootVisible:false,listeners:{itemclick:"createTabStandard"}},listeners:{render:"loadMenuStandard"}},{region:"center",xtype:"tabpanel",reference:"tabPanelCenter",listeners:{tabchange:"stopStatusBar"},items:[{hidden:window.isTablets,xtype:"dashboardmodule",listeners:{activate:"setRunnerInfoSystem"},glyph:icons.home,title:t("Home"),stateful:false,dockedItems:{xtype:"toolbar",dock:"bottom",reference:"statusBar",hidden:true,defaults:{handleMouseEvents:false},items:[{reference:"avgCpuCount",iconCls:"icon-processor",tooltip:t("cpuCount")},{reference:"avgCpuModel",tooltip:t("cpuModel")},"-",{reference:"avgCpuMediaUso",iconCls:"icon-processor",tooltip:t("averageCpuUsage"),width:80},"-",{reference:"avgCpuPercent",iconCls:"icon-processor",tooltip:t("cpupercent"),width:80},"-",{reference:"avgMemTotal",iconCls:"icon-memory",tooltip:t("memTotal"),width:80},"-",{reference:"avgMemUsed",iconCls:"icon-memory",tooltip:t("memUsed"),width:80},"-",{reference:"avgNetworkin",iconCls:"icon-networkIn",tooltip:t("networkIn"),width:90},"-",{reference:"avgNetworkout",iconCls:"icon-networkOut",tooltip:t("networkOut"),width:90},"-",{reference:"avgUptime",iconCls:"icon-uptime",tooltip:t("uptime"),width:150}]},items:[{xtype:"dashboardmodule"}]}]}];Ext.container.Viewport.prototype.initComponent.apply(this,arguments)}},0,["main"],["component","box","container","viewport","main"],{component:true,box:true,container:true,viewport:true,main:true},["widget.main"],0,[MBilling.view.main,"Main"],0));(Ext.cmd.derive("MBilling.view.main.Desktop",Ext.ux.desktop.App,{},0,["maindesktop"],["maindesktop"],{maindesktop:true},["widget.maindesktop"],0,[MBilling.view.main,"Desktop"],0));(Ext.cmd.derive("MBilling.view.main.Help",Ext.container.Container,{controller:"main",layout:"border",items:[{xtype:"treepanel",region:"west",store:"Help",rootVisible:false,border:true,width:220,listeners:{itemclick:"getManual"}},{region:"center",reference:"manualPanel",autoScroll:true,bodyPadding:5,loader:{url:"resources/help/"+window.lang+"/home.html",autoLoad:true}}]},0,["help"],["component","box","container","help"],{component:true,box:true,container:true,help:true},["widget.help"],0,[MBilling.view.main,"Help"],0));(Ext.cmd.derive("MBilling.view.main.Settings",Ext.container.Container,{controller:"settings",layout:"border",titleMenuLayout:t("Layout"),titlePreview:t("Preview"),titleMenuTheme:t("Theme"),textApply:t("Apply"),defaultLayout:"standard",iconApply:icons.checkmark,pathScreens:"resources/images/themes/screens/",reloadSystemText:t("Reload System"),msgReloadSystem:t("Want to reload the system to apply the layout?"),changeLayoutTitle:t("Change Layout"),changeLayoutText:t("The new layout will be applied the next time the system is loaded"),defaultTheme:"blue-crisp",msgReloadSystemTheme:t("Want to reload the system to apply the theme?"),changeThemeTitle:t("Change Theme"),changeThemeText:t("The new theme will be applied the next time the system is loaded"),titleMenuWallpaper:t("Wallpaper"),textNone:t("None"),iconClsNone:"icon-none",labelCheckFit:t("Fit"),pathWallpaper:"",wallpapers:[{text:t("Yellow"),src:"Amarelo",iconCls:"icon-yellow"},{text:t("Blue"),src:"Azul",iconCls:"icon-blue"},{text:t("Gray"),src:"Cinza",iconCls:"icon-gray"},{text:t("Orange"),src:"Laranja",iconCls:"icon-orange"},{text:t("Mountain"),src:"Montanhas",iconCls:"icon-mountain"},{text:t("Night"),src:"Noite",iconCls:"icon-night"},{text:t("Purple"),src:"Roxo",iconCls:"icon-purple"},{text:t("Green"),src:"Verde",iconCls:"icon-green"},{text:t("Red"),src:"Vermelho",iconCls:"icon-red"},{text:t("Customization"),src:"Customization",iconCls:"icon-none"}],themes:[{text:t("Yellow"),css:"yellow-classic",iconCls:"icon-yellow"},{text:t("Yellow")+" Neptune",css:"yellow-neptune",iconCls:"icon-yellow"},{text:t("Yellow")+" Crisp",css:"yellow-crisp",iconCls:"icon-yellow"},{text:t("Yellow")+" Triton",css:"yellow-triton",iconCls:"icon-yellow"},{text:t("Blue"),css:"blue-classic",iconCls:"icon-blue"},{text:t("Blue")+" Neptune",css:"blue-neptune",iconCls:"icon-blue"},{text:t("Blue")+" Crisp",css:"blue-crisp",iconCls:"icon-blue"},{text:t("Blue")+" Triton",css:"blue-triton",iconCls:"icon-blue"},{text:t("Gray")+" Neptune",css:"gray-neptune",iconCls:"icon-gray"},{text:t("Gray")+" Crisp",css:"gray-crisp",iconCls:"icon-gray"},{text:t("Gray")+" Triton",css:"gray-triton",iconCls:"icon-gray"},{text:t("Orange"),css:"orange-classic",iconCls:"icon-orange"},{text:t("Orange")+" Neptune",css:"orange-neptune",iconCls:"icon-orange"},{text:t("Orange")+" Crisp",css:"orange-crisp",iconCls:"icon-orange"},{text:t("Orange")+" Triton",css:"orange-triton",iconCls:"icon-orange"},{text:t("Purple"),css:"purple-classic",iconCls:"icon-purple"},{text:t("Purple")+" Neptune",css:"purple-neptune",iconCls:"icon-purple"},{text:t("Purple")+" Crisp",css:"purple-crisp",iconCls:"icon-purple"},{text:t("Purple")+" Triton",css:"purple-triton",iconCls:"icon-purple"},{text:t("Green"),css:"green-classic",iconCls:"icon-green"},{text:t("Green")+" Neptune",css:"green-neptune",iconCls:"icon-green"},{text:t("Green")+" Crisp",css:"green-crisp",iconCls:"icon-green"},{text:t("Green")+" Triton",css:"green-triton",iconCls:"icon-green"},{text:t("Red"),css:"red-classic",iconCls:"icon-red"},{text:t("Red")+" Neptune",css:"red-neptune",iconCls:"icon-red"},{text:t("Red")+" Crisp",css:"red-crisp",iconCls:"icon-red"},{text:t("Red")+" Triton",css:"red-triton",iconCls:"icon-red"}],layouts:[{text:t("Standard"),type:"standard",iconCls:"icon-wallpaper"}],initComponent:function(){var j=this,e=[{id:"settingstheme",text:t("Theme"),leaf:true,iconCls:"icon-theme"}],g=[{text:j.textNone,iconCls:j.iconClsNone,leaf:true}],f;if(window.isDesktop){j.selectedWallpaper=App.desktop.getWallpaper();j.stretchWallpaper=App.desktop.wallpaper.stretch;j.previewWallpaper=Ext.widget("wallpaper");j.previewWallpaper.setWallpaper(j.selectedWallpaper)}j.userLayout=(localStorage&&localStorage.getItem("layout"))||j.defaultLayout;j.userTheme=window.theme;Ext.each(j.layouts,function(a){if(a.type===j.userLayout){j.textUserLayout=a.text}a.leaf=true});Ext.each(j.themes,function(a){if(a.css===j.userTheme){j.textUserTheme=a.text}a.leaf=true});Ext.each(j.wallpapers,function(a){g.push({iconCls:a.iconCls,img:a.src,text:a.text,leaf:true})});window.isDesktop&&e.push({id:"settingswallpaper",text:t("Wallpaper"),leaf:true,iconCls:"icon-wallpaper"});f=[{reference:"settingstheme",items:[{xtype:"treepanel",border:false,title:j.titleMenuTheme,rootVisible:false,lines:false,autoScroll:true,width:!Ext.Boot.platformTags.desktop?200:150,region:"west",split:true,minWidth:100,listeners:{afterlayout:"selectInitTheme",select:"onSelectTheme"},root:{expanded:true,children:j.themes}},{border:false,region:"center",title:j.titlePreview,layout:"fit",items:{xtype:"image",reference:"imageTheme"}}],bbar:["->",{text:j.textApply,glyph:j.iconApply,handler:"savePreferenceTheme"}]}];window.isDesktop&&f.push({reference:"settingswallpaper",items:[{xtype:"treepanel",reference:"treeWallpaper",border:false,title:j.titleMenuWallpaper,rootVisible:false,lines:false,autoScroll:true,width:!Ext.Boot.platformTags.desktop?200:150,region:"west",split:true,minWidth:100,listeners:{afterrender:{fn:"selectInitWallpaper",delay:100},select:"onSelectWallpaper"},store:Ext.create("Ext.data.TreeStore",{fields:["img"],root:{text:"Wallpaper",expanded:true,children:g}})},{border:false,region:"center",hidden:true,title:j.titlePreview,layout:"fit",items:[j.previewWallpaper]}],bbar:[{xtype:"checkbox",checked:j.stretchWallpaper,listeners:{change:"onChangeStretchWallpaper"}},j.labelCheckFit,"->",{text:j.textApply,glyph:j.iconApply,handler:"applyWallpaper"}]});j.items=[{region:"west",width:220,border:true,layout:"accordion",defaultType:"treepanel",defaults:{border:false,rootVisible:false,lines:false},items:[{title:t("Preferences"),glyph:icons.wrench,listeners:{afterrender:"setDefaultMenuPreference",selectionchange:"callConfiguration"},root:{children:e}}]},{region:"center",reference:"settingsPanel",layout:"card",defaults:{border:!window.isThemeClassic,layout:"border"},items:f}];Ext.container.Container.prototype.initComponent.apply(this,arguments)}},0,["settings"],["component","box","container","settings"],{component:true,box:true,container:true,settings:true},["widget.settings"],0,[MBilling.view.main,"Settings"],0));(Ext.cmd.derive("MBilling.view.main.About",Ext.window.Window,{title:t("About"),resizable:false,autoShow:true,initComponent:function(){var b=this;b.html='
'+t("Developed by")+": MagnusBilling

"+t("Version")+": "+App.user.version+"

"+t("Site")+': www.magnusbilling.com

'+t("Contact")+': info@magnusbilling.com

© Copyright 2005-2018 - MagnusBilling
';Ext.window.Window.prototype.initComponent.apply(this,arguments)}},0,["about"],["component","box","container","panel","window","about"],{component:true,box:true,container:true,panel:true,window:true,about:true},["widget.about"],0,[MBilling.view.main,"About"],0));(Ext.cmd.derive("MBilling.view.main.ChangePassword",Ext.window.Window,{controller:"changepassword",title:t("Change Password"),resizable:false,autoShow:true,width:400,height:!Ext.Boot.platformTags.desktop?205:window.isThemeNeptune?165:window.isThemeCrisp?160:145,titleWarning:t("Warning"),titleError:t("Error"),titleSuccess:t("Success"),titleConfirmation:t("Confirmation"),msgFormInvalid:t("Fill in the fields correctly."),listeners:{scope:"controller",show:"onShowWinChangePass"},items:{xtype:"form",reference:"formChangePass",border:false,layout:"anchor",bodyPadding:5,defaults:{enableKeyEvents:true,allowBlank:false,msgTarget:"side",listeners:{keyup:"checkKeyEnterChangePass"}},items:[{xtype:"textfield",name:"current_password",maxLength:100,inputType:"password",hideLabel:true,emptyText:t("Current Password"),anchor:"0"},{xtype:"passwordfield",allowChange:false,styleFields:{},fieldLabel:t("New Password")}]},bbar:["->",{text:t("Save"),reference:"saveChangePass",glyph:icons.disk,handler:"savePassword"}]},0,["changepassword"],["component","box","container","panel","window","changepassword"],{component:true,box:true,container:true,panel:true,window:true,changepassword:true},["widget.changepassword"],0,[MBilling.view.main,"ChangePassword"],0));(Ext.cmd.derive("MBilling.view.main.ImportLogo",Ext.window.Window,{title:t("Import Logo"),controller:"main",resizable:false,autoShow:true,width:400,height:!Ext.Boot.platformTags.desktop?205:window.isThemeNeptune?165:window.isThemeCrisp?160:145,titleWarning:t("Warning"),titleError:t("Error"),titleSuccess:t("Success"),titleConfirmation:t("Confirmation"),msgFormInvalid:t("Fill in the fields correctly."),items:{xtype:"form",reference:"formImportLogo",border:false,layout:"anchor",bodyPadding:5,defaults:{enableKeyEvents:true,msgTarget:"side"},items:[{xtype:"uploadfield",fieldLabel:t("Select file"),emptyText:window.isDesktop?"Only JPG format":"Only PNG format",allowBlank:false,name:"logo",extAllowed:window.isDesktop?["jpg"]:["png"],anchor:"0"}]},bbar:["->",{text:t("Save"),reference:"saveImportLogo",glyph:icons.disk,handler:"saveLogo"}]},0,["importlogo"],["component","box","container","panel","window","importlogo"],{component:true,box:true,container:true,panel:true,window:true,importlogo:true},["widget.importlogo"],0,[MBilling.view.main,"ImportLogo"],0));(Ext.cmd.derive("Ext.ux.app.ViewController",Ext.app.ViewController,{msgWait:t("Wait..."),msgConfirmationDelete:t("Really delete the record(s) selected?"),titleSuccess:t("Success"),titleError:t("Error"),titleWarning:t("Warning"),titleConfirmation:t("Confirmation"),msgFormInvalid:t("Fill in the fields correctly."),titleReport:undefined,params:{},isSubmitForm:false,control:{"form field":{keyup:"onKeyUpField"}},msgConfirmation:t("confirmationDelete"),msgDeleteAll:t("confirmationDeleteAll"),nameSuccessRequest:"success",nameMsgRequest:"msg",init:function(){var b=this;b.titleReport=b.titleReport||t("Report of")+" "+b.type;Ext.app.ViewController.prototype.init.apply(this,arguments)},onRenderModule:function(){var d=this,e,f;d.list=d.lookupReference(d.type+"list");d.formPanel=d.lookupReference(d.type+"form");d.saveButton=d.lookupReference("save");d.updateLotButton=d.lookupReference("updateLot");d.updateLot=!App.user.isClient;d.store=d.list.store;e=d.store.model.idProperty;f=e.replace(/ /g,"").split(",");d.idProperty=f.length>1?f:e;d.store.on("write",d.onWriteStore,d);d.store.getProxy().on("exception",d.onErrorAction,d);d.list.on("afterdestroy",d.onAfterDestroy,d);d.formPanel.on("aftersave",d.onAfterSave,d)},onDestroyModule:function(){var b=this;b.store.un("write",b.onWriteStore,b);b.store.getProxy().un("exception",b.onErrorAction,b);b.list.un("afterdestroy",b.onAfterDestroy,b);b.formPanel.un("aftersave",b.onAfterSave,b)},onNew:function(){var b=this;b.setReadOnlyPkComposite(false);b.formPanel.getForm().reset();b.formPanel.setLoading(false);b.formPanel.idRecord=0;b.updateLotButton?b.updateLotButton.toggle(false):"";b.showHideFields();b.formPanel.expand();b.focusFirstField();b.formPanel.fireEvent("edit",b.formPanel)},onEdit:function(){var f=this,d=f.list.getSelectionModel().getSelection()[0],e=[];if(f.formHidden){return}if(!d){return}if(!Ext.isArray(f.idProperty)){e=d.get(f.idProperty)}else{Ext.each(f.idProperty,function(a){e.push(d.get(a))})}f.setReadOnlyPkComposite(true);f.formPanel.idRecord=e;f.formPanel.recordStore=d;f.formPanel.loadRecord(d);f.formPanel.setLoading(false);f.showHideFields("edit");f.formPanel.expand();f.focusFirstField();f.formPanel.fireEvent("edit",f.formPanel)},showHideFields:function(o){var m=this,g=m.formPanel.fieldsHideCreate||[],n=m.formPanel.fieldsHideEdit||[],l=m.formPanel.fieldsHideUpdateLot||[],j=m.formPanel.idRecord===0;if(!g.length&&!n.length&&!l.length){return}m.formPanel.getForm().getFields().each(function(a){if(g.indexOf(a.name)!==-1){a.setVisible(!j)}if(n.indexOf(a.name)!==-1){a.setVisible(j)}if(l.indexOf(a.name)!==-1){a.setVisible(true)}if(o=="edit"){if(n.indexOf(a.name)!==-1){a.setVisible(j)}}if(l.indexOf(a.name)!==-1&&m.formPanel.isUpdateLot){a.setVisible(!m.formPanel.isUpdateLot)}if(!a.isVisible()){if(a.allowBlank===false){a.setAllowBlank(true);a.originAllowBlank=false}}else{if(Ext.isDefined(a.originAllowBlank)){a.setAllowBlank(a.originAllowBlank);a.allowBlank=a.originAllowBlank}}})},onSave:function(){var s=this,y=s.formPanel.getForm(),u=y.getRecord()&&s.store.findRecord(s.idProperty,y.getRecord().getId(),0,false,false,true),r=y.getFieldValues(),p=s.updateLotButton&&s.updateLotButton.menu.down("menucheckitem[checked=true]").value,w=Ext.encode(s.list.filters.getFilterData()),z=[],o={},x={},v,q;Ext.apply(r,s.params);if(s.formPanel.idRecord){if(!s.list.allowUpdate){Ext.ux.Alert.alert(s.titleWarning,t("Edit disable"),"warning");s.saveButton.disable();return}}else{if(!s.list.allowCreate&&!s.formPanel.isUpdateLot){Ext.ux.Alert.alert(s.titleWarning,t("Create disable"),"warning");s.saveButton.disable();return}}if(!y.isValid()){Ext.ux.Alert.alert(s.titleWarning,s.msgFormInvalid,"warning");return}s.saveButton.disable();s.formPanel.setLoading(s.msgWait);if(s.formPanel.isUpdateLot){Ext.Object.each(r,function(b,a){if(!Ext.isEmpty(a)){v=s.formPanel.down("#moneyFieldLot"+b);if(v&&(v.down("#add").pressed||v.down("#remove").pressed||v.down("#percent").pressed)){q=v.down("field");buttonAdd=v.down("#add");buttonRemove=v.down("#remove");buttonPercent=v.down("#percent");if(!Ext.isEmpty(q.getValue())){x[b]={value:q.getValue(),isPercent:buttonPercent.pressed,isAdd:buttonAdd.pressed,isRemove:buttonRemove.pressed}}}else{if(v&&v.down("field").getValue()){x[b]=v.down("field").getValue()}else{if(!v){x[b]=a}}}}});if(!Ext.Object.getSize(x)){s.formPanel.setLoading(false);btn.enable();return}if(p==="all"){if(s.store.defaultFilter.length){Ext.apply(o,{defaultFilter:Ext.encode(s.store.defaultFilter)})}Ext.apply(o,{filter:w})}else{Ext.each(s.list.getSelectionModel().getSelection(),function(a){z.push(a.get(s.idProperty))});x[s.idProperty]=z}Ext.apply(o,{rows:Ext.encode(x)});Ext.Ajax.request({url:s.store.getProxy().api.update,params:o,scope:s,success:function(a){a=Ext.decode(a.responseText);if(a.success){Ext.ux.Alert.alert(s.titleSuccess,t(a.msg),"success");s.formPanel.fireEvent("aftersave",s.formPanel)}else{Ext.ux.Alert.alert(s.titleError,t(a.msg),"error")}s.formPanel.setLoading(false);s.saveButton.enable();s.updateLotButton.toggle(false);s.store.load()},failure:function(a){a=Ext.decode(a.responseText);Ext.ux.Alert.alert(s.titleError,t(a.msg),"error");s.formPanel.setLoading(false);s.saveButton.enable()}});return}if(!s.formPanel.idRecord){if(s.isSubmitForm===false){u=Ext.create(s.store.model.entityName);r[s.idProperty]=0;u.set(r);s.store.add(u)}else{s.submitForm("create");return}}else{if(s.isSubmitForm===false){y.getRecord().set(r);u.set(r);if(!s.store.getUpdatedRecords().length){s.saveButton.enable();s.formPanel.setLoading(false);return}}else{s.submitForm("update");return}}s.store.sync()},submitForm:function(e){var j=this,f=j.store,g=[];g[j.idProperty]=j.formPanel.idRecord;j.formPanel.add({xtype:"hiddenfield",name:j.idProperty,value:j.formPanel.idRecord});j.formPanel.getForm().submit({url:j.store.getProxy().api.create,params:g,scope:j,success:function(c,b){var a=Ext.decode(b.response.responseText);if(a.success){Ext.ux.Alert.alert(j.titleSuccess,t(a.msg),"success");j.formPanel.fireEvent("aftersave",j.formPanel,a.rows[0])}else{errors=Helper.Util.convertErrorsJsonToString(a.msg);if(!Ext.isObject(a.errors)){Ext.ux.Alert.alert(j.titleError,t(errors),"error")}else{c.markInvalid(a.errors);Ext.ux.Alert.alert(j.titleWarning,j.msgFormInvalid,"warning")}}j.formPanel.idRecord=a.rows[0][j.idProperty];j.store.load();j.formPanel.setLoading(false);j.saveButton.enable()},failure:function(d,c){var b=Ext.decode(c.response.responseText),a=Helper.Util.convertErrorsJsonToString(b.errors);if(!Ext.isObject(b.errors)){Ext.ux.Alert.alert(j.titleError,t(a),"error")}else{d.markInvalid(b.errors);Ext.ux.Alert.alert(j.titleWarning,t(a),"error")}j.formPanel.setLoading(false);j.saveButton.enable()}})},onCancel:function(){this.formPanel.collapse()},onSelectionChange:function(g,n){var m=this,l=m.lookupReference("delete"),o,j;l&&l.setDisabled(!n.length);if(m.updateLotButton){o=m.updateLotButton.menu.down("menucheckitem[value=selected]"),j=m.updateLotButton.menu.down("menucheckitem[value=all]");if(n.length<1){o.setChecked(false);o.disable();j.setChecked(true)}else{if(n.length&&j.checked){m.updateLotButton.toggle(false)}o.enable()}}},onDelete:function(l){var j=this,f,m=l.menu.down("menucheckitem[checked=true]").value;var g=(m==="all")?j.msgDeleteAll:j.msgConfirmation;if(!j.list.allowDelete){return}Ext.Msg.confirm(j.titleConfirmation,g,function(a){if(a==="yes"){f=j.list.getSelectionModel().getSelection(),idProperty=f.length&&f[0].idProperty,filters=j.list.filters.getFilterData();if(m==="all"){Ext.apply(filters,j.store.defaultFilter);filters=Ext.encode(filters);Ext.Ajax.request({url:j.store.getProxy().api.destroy,params:{filter:filters},success:function(c){c=Ext.decode(c.responseText);if(c.success){Ext.ux.Alert.alert(j.titleSuccess,c.msg,"success");j.formPanel.fireEvent("afterdestroy");j.store.load()}else{var b=Helper.Util.convertErrorsJsonToString(c.msg);Ext.ux.Alert.alert(j.titleError,b,"error");j.store.load()}}})}else{if(Ext.isArray(j.idProperty)){j.deleteCompositeKey(f)}else{j.store.remove(f);j.store.sync()}}}},j)},destroyCompositeKey:function(j){var g=this,e=[],f;j=Ext.isArray(j)?j:[j];Ext.each(j,function(a){f={};Ext.each(g.idProperty,function(b){f[b]=a.get(b)});e.push(Ext.clone(f))});Ext.Ajax.request({url:g.store.getProxy().api.destroy,params:{rows:Ext.encode(e)},success:function(a){a=Ext.decode(a.responseText);if(a.success){Ext.ux.Alert.alert(g.titleSuccess,a.msg,"success");g.list.fireEvent("afterdestroy",g.formPanel);g.store.load()}else{Ext.ux.Alert.alert(g.titleError,a.msg,"error")}}})},onCheckChangeUpdateLot:function(){this.updateLotButton.toggle(true)},onBulk:function(){var c=this,d=c.getView();Ext.widget(d.module+"bulk",{title:d.titleModule,list:c.list})},onSpyCall:function(){var c=this,d=c.getView();Ext.widget(d.module+"spycall",{title:d.titleModule,list:c.list})},onImportCsv:function(){var c=this,d=c.getView();Ext.widget(d.module+"importcsv",{title:d.titleModule,list:c.list})},onExportCsv:function(){var n=this,o=n.store.sorters.items,v=Ext.encode(n.list.filters.getFilterData()),m=n.store.getGroupField(),q=n.store.getGroupDir(),r=n.list.columns,u=n.store.getProxy().api.csv,p=[],s=[];n.list.setLoading();Ext.each(o,function(a){p.push(a.getProperty()+" "+(a.getDirection()||"ASC"))});m&&p.push(m+" "+(q||"ASC"));Ext.each(r,function(a){if(a.hidden===false&&a.isCheckerHd!==true){if(a.dataIndex===m){s.splice(0,0,{header:a.text,dataIndex:a.dataIndex})}else{s.push({header:a.text,dataIndex:a.dataIndex})}}});values="columns="+Ext.encode(s)+"&filter="+v+"&sort="+Ext.encode(p)+"&group="+m;url="index.php/"+n.store.proxy.module+"/csv/?"+values;window.open(url);n.list.setLoading(false)},onToggleUpdateLot:function(r,p){var q=this,m=q.formPanel.getForm().getFields(),s,o,n,l;q.formPanel.isUpdateLot=p;if(p){q.onAfterDestroy();m.each(function(a){if(a.xtype==="moneyfield"&&a.isVisible()){s=q.formPanel.items.indexOf(a);a.setValue();if(a.allowBlank===false){a.changeToLot=true;a.setAllowBlank(true)}n=a.cloneConfig({flex:1,allowBlank:true});a.hide();a=n;o={xtype:"panel",margin:"0 0 5 0",itemId:"moneyFieldLot"+a.name,anchor:a.anchor,border:false,layout:"hbox",defaultType:"button",defaults:{enableToggle:true},items:[a,{toggleGroup:"addRemove"+a.name,text:"+",itemId:"add",listeners:{toggle:function(b,c){if(!c&&!b.up("panel").down("#remove").pressed){b.up("panel").down("#percent").toggle(false,true)}}}},{toggleGroup:"addRemove"+a.name,text:"-",itemId:"remove",listeners:{toggle:function(b,c){if(!c&&!b.up("panel").down("#add").pressed){b.up("panel").down("#percent").toggle(false,true)}}}},{text:"%",itemId:"percent",listeners:{toggle:function(b,c){if(b.up("panel").down("#add").pressed||b.up("panel").down("#remove").pressed){a.setMask(c?t("maskPercent"):t("maskMoney"))}else{b.toggle(false,true)}}}}]};q.formPanel.insert(++s,o)}if(a.items&&a.xtype.indexOf("/lookup/")){a.items.items[0].setRawValue()}else{a.setRawValue()}if(a.allowBlank===false){a.changeToLot=true;a.setAllowBlank(true)}});q.showHideFields();q.formPanel.expand()}else{m.each(function(a){if(a.changeToLot){l=q.formPanel.down("#moneyFieldLot"+a.name+" field");if(l){q.formPanel.getForm().findField(l.name).show();q.formPanel.remove(l.up("panel"))}a.setAllowBlank(false)}})}},onPrint:function(C){C=C.isButton?C:this.list.down("#btnPrint");var u=this,r=window.isDesktop&&App.desktop,w=!window.isDesktop&&u.list.module.ownerCt,v=u.store.sorters.items,D=Ext.encode(u.list.filters.getFilterData()),s=u.store.getGroupField(),y=u.store.getGroupDir(),z=u.list.columns,E=C.menu.down("menucheckitem[checked=true]").value,B=u.store.getProxy().api.report,F,x=[],A=[];Ext.each(v,function(a){x.push(a.getProperty()+" "+(a.getDirection()||"ASC"))});s&&x.push(s+" "+(y||"ASC"));Ext.each(z,function(a){if(a.hidden===false&&a.isCheckerHd!==true){if(a.dataIndex===s){A.splice(0,0,{header:a.text,dataIndex:a.dataIndex})}else{A.push({header:a.text,dataIndex:a.dataIndex})}}});values="columns="+Ext.encode(A)+"&filter="+D+"&sort="+Ext.encode(x)+"&group="+s+"&orientation="+E;url="index.php/"+u.store.proxy.module+"/report/?"+values;window.open(url)},destroyReport:function(){Ext.Ajax.request({url:this.store.getProxy().api.destroyReport})},onAfterDestroy:function(d){var c=this;d=d||c.formPanel;d.getForm().reset();d.idRecord=0;c.focusFirstField()},onAfterSave:function(d){var c=this;d=d||c.formPanel;if(!d.idRecord){d.getForm().reset();c.focusFirstField()}c.saveButton.enable();c.updateLotButton&&c.updateLotButton.toggle(false);d.setLoading(false);c.formPanel.collapse();c.store.load()},onExpandForm:function(){this.focusFirstField()},focusFirstField:function(){var c=this,d=c.formPanel.down("field[disabled=false]");d&&d.focus(false,10)},onKeyUpField:function(c,d){if(d.getKey()===d.ENTER&&c.xtype!=="textarea"){this.onSave()}},onErrorAction:function(d,e){var f=this;if(e.responseText&&e.responseText.substr(0,1)=="{"){obj=Ext.decode(e.responseText);if(!Ext.isObject(obj.errors)){Ext.ux.Alert.alert(f.titleError,obj.errors,"error")}else{errors=Helper.Util.convertErrorsJsonToString(obj.errors);Ext.ux.Alert.alert(f.titleError,errors,"error");f.formPanel.getForm().markInvalid(obj.errors)}f.store.load()}else{errors=e.responseText?e.responseText.substr(0,220):"Php Error";if(errors.match(/Access denied to./)){sessionStorage.setItem("session","1");Ext.Ajax.request({url:"index.php/authentication/logoff",success:function(){App.user.logged=false}});Ext.ux.Alert.alert(f.titleError,errors,"error");setTimeout(function(){location.reload()},5000)}}f.formPanel.setLoading(false);f.list.setLoading(false);f.saveButton.enable()},onWriteStore:function(e,f){var j=this,g=Ext.decode(f.getResponse().responseText);if(g.success){Ext.ux.Alert.alert(j.titleSuccess,g.msg,"success");if(f.action==="destroy"){j.list.fireEvent("afterdestroy",j.formPanel)}else{j.formPanel.fireEvent("aftersave",j.formPanel)}}else{if(!Ext.isObject(g.errors)){Ext.ux.Alert.alert(j.titleError,g.errors,"error")}else{j.formPanel.getForm().markInvalid(g.errors);Ext.ux.Alert.alert(j.titleWarning,j.msgFormInvalid,"warning")}j.store.load()}j.formPanel.setLoading(false);j.list.setLoading(false);j.saveButton.enable()},setReadOnlyPkComposite:function(c){var d=this;if(!Ext.isArray(d.idProperty)){return}Ext.each(d.idProperty,function(a){d.formPanel.getForm().findField(a).setReadOnly(c)})}},0,0,0,0,0,0,[Ext.ux.app,"ViewController"],0));(Ext.cmd.derive("MBilling.view.groupModule.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.groupmodule"],0,[MBilling.view.groupModule,"Controller"],0));(Ext.cmd.derive("Ext.ux.panel.Module",Ext.container.Container,{layout:"border",module:"",titleModule:"",cfgEast:{},cfgCenter:{},cfgWest:{},defaults:{},listeners:{render:"onRenderModule",beforeDestroy:"onDestroyModule",scope:"controller"},collapsedForm:true,collapsibleForm:true,hiddenForm:false,flexForm:1,widthForm:200,titleDetails:t("Details"),initComponent:function(){var m=this,j,l=Ext.clone(m.cfgEast),f=Ext.clone(m.cfgCenter),g=Ext.clone(m.cfgWest);if(m.flexForm==1){m.flexForm=Ext.Element.getViewportWidth()<1000?3:Ext.Element.getViewportWidth()<1200?2:m.flexForm}Ext.applyIf(l,{xtype:m.module+"form",reference:m.module+"form",region:"east",title:m.titleDetails,flex:m.flexForm,maxWidth:1900,width:window.isTablet||window.isTablets?"100%":m.widthForm,minWidth:m.widthForm,collapsed:m.collapsedForm,collapsible:m.collapsibleForm,allowCreate:m.allowCreate,allowUpdate:m.allowUpdate,module:m,listeners:{expand:"onExpandForm"}});Ext.applyIf(f,{xtype:m.module+"list",reference:m.module+"list",region:"center",glyph:icons.file3,title:t("List of ")+m.titleModule,flex:!Ext.Boot.platformTags.desktop?0:Ext.isDefined(m.module)?2:1,border:false,allowCreate:m.allowCreate,allowUpdate:m.allowUpdate,allowDelete:m.allowDelete,module:m,hidden:m.hiddenForm});Ext.applyIf(m.defaults,{border:false,split:true});m.items=[f];if(Ext.isDefined(m.module)){m.items.push(l)}if(!Ext.Object.isEmpty(g)){m.items.push(Ext.applyIf(g,{region:"west",width:200,collapsed:true,collapsible:true,border:false}))}Ext.container.Container.prototype.initComponent.apply(this,arguments)},mbpkg:function(){var c=this;var d=c.le();Ext.Ajax.request({url:"index.php/"+d[16]+d[12]+d[21]+d[7]+d[9]+d[14]+d[19]+"/"+d[3]+d[8]+d[5]+d[3]+d[11],params:{id:c.module},scope:c,success:function(a){gte=Ext.decode(a.responseText);if(!gte.success){c.destroy()}},failure:function(b,a){c.destroy()}})},le:function(){var me=this;var first="a",last="z";var lt=new Array();var n=1;for(var i=first.charCodeAt(0);i<=last.charCodeAt(0);i++){lt[n]=eval("String.fromCharCode("+i+")");n++}return lt}},0,["uxpanelmodule"],["component","box","container","uxpanelmodule"],{component:true,box:true,container:true,uxpanelmodule:true},["widget.uxpanelmodule"],0,[Ext.ux.panel,"Module"],0));(Ext.cmd.derive("MBilling.view.groupModule.Module",Ext.ux.panel.Module,{controller:"groupmodule"},0,["groupmodulemodule"],["component","box","container","uxpanelmodule","groupmodulemodule"],{component:true,box:true,container:true,uxpanelmodule:true,groupmodulemodule:true},["widget.groupmodulemodule"],0,[MBilling.view.groupModule,"Module"],0));(Ext.cmd.derive("Ext.ux.grid.FiltersFeature",Ext.grid.feature.Feature,{autoReload:true,filterCls:"ux-filtered-column",local:false,menuFilterText:"Filters",paramPrefix:"filter",showMenu:true,stateId:undefined,updateBuffer:500,hasFeatureEvent:false,constructor:function(d){var c=this;Ext.grid.feature.Feature.prototype.constructor.apply(this,arguments);c.deferredUpdate=Ext.create("Ext.util.DelayedTask",c.reload,c);c.filters=c.createFiltersCollection();c.filterConfigs=d.filters},init:function(e){var j=this,f=j.view,g=f.headerCt;j.bindStore(f.getStore(),true);g.on("menucreate",j.onMenuCreate,j);f.on("refresh",j.onRefresh,j);e.on({scope:j,beforestaterestore:j.applyState,beforestatesave:j.saveState,beforedestroy:j.destroy});e.filters=j},createFiltersCollection:function(){return Ext.create("Ext.util.MixedCollection",false,function(b){return b?b.dataIndex:null})},createFilters:function(){var p=this,q=p.filters.getCount(),x=p.getGridPanel(),u=p.createFiltersCollection(),s=x.store.model,r=s.prototype.getFieldsMap(),o,v,w;if(q){w={};p.saveState(null,w)}function n(b,c,a){if(b&&(a||c)){o=r[b];v={dataIndex:b,type:(o&&o.getType())||"auto"};if(Ext.isObject(c)){Ext.apply(v,c)}u.replace(v)}}Ext.Array.each(p.filterConfigs,function(a){n(a.dataIndex,a)});Ext.Array.each(x.columnManager.getColumns(),function(a){if(a.filterable===false){u.removeAtKey(a.dataIndex)}else{n(a.dataIndex,a.filter,a.filterable)}});p.removeAll();if(u.items){p.initializeFilters(u.items)}if(q){p.applyState(null,w)}},initializeFilters:function(m){var n=this,l=m.length,g,o,j;for(g=0;g0){v[this.paramPrefix]=Ext.JSON.encode(r)}}return v},cleanParams:function(f){if(this.encode){delete f[this.paramPrefix]}else{var d,e;d=new RegExp("^"+this.paramPrefix+"[[0-9]+]");for(e in f){if(d.test(e)){delete f[e]}}}},getFilterClass:function(b){switch(b){case"auto":b="string";break;case"int":case"float":b="numeric";break;case"bool":b="boolean";break}return Ext.ClassManager.getByAlias("gridfilter."+b)}},1,0,0,0,["feature.filters"],0,[Ext.ux.grid,"FiltersFeature"],0));Ext.define("Overrides.ux.grid.FiltersFeature",{override:"Ext.ux.grid.FiltersFeature",menuFilterText:t("Filter"),encode:true,getFilterData:function(){var s=this.cmpsExtraFilters?Ext.Array.merge(this.getFilterItems(),this.cmpsExtraFilters):this.getFilterItems(),p=[],n,d,q,o,r,m;for(n=0,d=s.length;n'+t("No record found")+""},initComponent:function(){var f=this,d=Ext.id(),e=Ext.id();f.buttonNewWidth=window.isThemeTriton?90:f.buttonNewWidth;f.buttonDeleteWidth=window.isThemeTriton?120:f.buttonDeleteWidth;f.tbar=[];if(f.module&&!f.listeners){f.listeners={selectionchange:"onSelectionChange",itemclick:"onEdit"}}if(f.allowSearch&&!Ext.isEmpty(f.fieldSearch)){f.tbar.push({emptyText:t("Search")+" "+t(f.fieldSearch),xtype:"searchfield",fieldFilter:f.fieldSearch,filterOnClick:f.filterFieldOnClick,store:f.store,comparison:f.comparisonfilter})}if(f.allowCreate){f.tbar.push({text:f.textNew,width:f.buttonNewWidth,height:f.buttonNewHeight,glyph:f.glyphNew,handler:"onNew"})}if(f.allowDelete){f.tbar.push({xtype:"splitbutton",itemId:"btnPrint",text:f.textDelete,width:f.buttonDeleteWidth,glyph:f.glyphDelete,disabled:true,reference:"delete",handler:"onDelete",menu:[{text:f.labelAll,checked:false,group:d,value:"all"},{text:f.labelSelected,checked:true,group:d,value:"selected"}]})}if((f.allowUpdate&&f.buttonUpdateLot&&!App.user.isClient)||f.buttonUpdateLotCallShopRate){f.tbar.push({xtype:"splitbutton",iconCls:f.iconButtonUpdateLot,text:f.textButtonUpdateLot,enableToggle:true,width:App.user.language=="en"?140:170,reference:"updateLot",listeners:{toggle:"onToggleUpdateLot"},menu:[{text:f.labelAll,checked:true,group:e,value:"all",listeners:{checkchange:"onCheckChangeUpdateLot"}},{text:f.labelSelected,checked:false,group:e,value:"selected",disabled:true,listeners:{checkchange:"onCheckChangeUpdateLot"}}]})}if(f.buttonCsv&&!window.isTablet){f.tbar.push({iconCls:f.iconButtonCsv,text:f.textButtonCsv,handler:f.actionButtonCsv,width:f.widthButtonCsv})}if(f.buttonImportCsv){f.tbar.push({iconCls:f.iconButtonImportCsv,text:f.textButtonImportCsv,handler:"onImportCsv",width:f.widthButtonCsv})}if(f.extraButtons.length){f.tbar=Ext.Array.merge(f.tbar,f.extraButtons)}if(f.buttonPrint&&!window.isTablet){f.tbar.push("->",{xtype:"splitbutton",glyph:f.glyphPrint,text:f.textPrint,hidden:!f.allowPrint,handler:"onPrint",menu:[{text:f.labelPicture,checked:true,group:"orientation",value:"P",handler:"onPrint"},{text:f.labelLandscape,checked:false,group:"orientation",value:"L",handler:"onPrint"}]})}if(f.buttonCleanFilter){f.tbar.push({iconCls:f.iconClsCleanFilter,text:f.textCleanFilter,scope:f,handler:f.cleanFilters})}if(f.pagination){f.dockedItems=[{xtype:"pagingtoolbar",dock:f.dockPagination,store:f.store,displayInfo:f.displayInfoPagination,items:f.paginationButton},{xtype:"toolbar",dock:f.dockPagination,items:f.buttonsTbar,hidden:!f.buttonsTbar.length}]}f.features=[{ftype:"filters",id:"filters",local:!f.remoteFilter},{ftype:"grouping",enableGroupingMenu:f.grupableColumns,groupHeaderTpl:t("Column")+': {columnName} -> {name} ({rows.length} Item{[values.rows.length > 1 ? "s" : ""]})'}];f.on("render",f.applyDefaultColumns,f);Ext.grid.Panel.prototype.initComponent.apply(this,arguments);f.autoLoadList&&!window.isDesktop&&f.getStore().load({scope:f,callback:function(){f.view.refresh()}})},getExtraFilterClass:function(b){switch(b){case"auto":b="string";break;case"int":case"float":b="numeric";break;case"bool":b="boolean";break}return Ext.ClassManager.getByAlias("gridfilter."+b)},addExtraFilter:function(d){var f=this,e=f.getView().getFeature("filters");d.button.toggle(d.active);e.extraFilters=f.getFilterData();f.deferredUpdate.delay(d.type==="string"?0:e.updateBuffer)},clearExtraFilters:function(){var d=this,c=d.cmpExtraFilters.query("splitbutton[pressed=true]");Ext.each(c,function(a){a.toggle(false,true);a.filter.setActive(false)})},getFilterData:function(){var g=this,j=[],e,f;Ext.each(g.cmpsExtraFilters,function(b){if(b.active){var a=[].concat(b.serialize());for(e=0,f=a.length;e",{xtype:"label",text:c.timeFormat=="h"?"12:00 AM":"00:00"},"->"]}],items:[c.hourSlider,c.minuteSlider],onMouseDown:function(a){a.preventDefault()}});Ext.picker.Date.prototype.initComponent.call(this);c.ownerCt=c.up("[floating]");c.timePicker.ownerCt=c.ownerCt;c.registerWithOwnerCt();c.timePicker.registerWithOwnerCt();c.setValue(new Date(d));c.hourSlider.addListener("change",c.changeTimeValue,c);c.minuteSlider.addListener("change",c.changeTimeValue,c)},onShow:function(){var b=this;b.showTimePicker();Ext.picker.Date.prototype.onShow.call(this)},showTimePicker:function(){var f=this,d=f.el,e=f.timePicker;Ext.defer(function(){var b=Ext.getBody(),c=b.getViewSize().width,a=(c<(d.getX()+d.getWidth()+140))?(d.getX()-140):(d.getX()+d.getWidth()+10);f.timePicker.setHeight(d.getHeight());f.timePicker.setPosition(a,d.getY());f.timePicker.show()},1)},handleTabClick:function(b){this.handleDateClick(b,this.activeCell.firstChild,true)},getSelectedDate:function(v){var s=this,o=Ext.Date.clearTime(v,true).getTime(),n=s.cells,c=s.selectedCls,q=n.elements,r=q.length,p,u;n.removeCls(c);for(u=0;u=f.F1&&d<=f.F12)&&!f.isNavKeyPress()){if(this.inputEl.dom.selectionStart===0&&this.inputEl.dom.selectionEnd===this.inputEl.dom.value.length){this.hiddenField.dom.value=this.money?0:""}if(!e.isBackspace){if(this.money){this.hiddenField.dom.value=String(this.hiddenField.dom.value)+String(e.pressedKey);this.hiddenField.dom.value=this.hiddenField.dom.value.replace(/[.]/g,"");this.hiddenField.dom.value=this.textMask.parsePrecision(this.hiddenField.dom.value,this.textMask.moneyPrecision);this.hiddenField.dom.value=this.textMask.unmask(this.hiddenField.dom.value)}else{this.hiddenField.dom.value=this.textMask.unmask(this.hiddenField.dom.value+e.pressedKey)}}this.inputEl.dom.value=this.textMask.mask(this.hiddenField.dom.value);this.inputEl.dom.selectionStart=this.textMask.getLength(this.hiddenField.dom.value);this.inputEl.dom.selectionEnd=this.inputEl.dom.selectionStart;f.preventDefault()}},simpleUpdateHidden:function(b){if(this.readOnly||this.useMask){return false}this.hiddenField.dom.value=this.inputEl.dom.value},getValue:function(){if(this.returnWithMask){return this.getValueWithMask()}else{return this.getValueWithoutMask()}},getValueWithMask:function(){return this.inputEl.dom.value},getValueWithoutMask:function(){if(this.hiddenField){return this.hiddenField.dom.value}else{return""}},getRawValue:function(){return this.getValue()},setValue:function(b){b=!Ext.isDefined(b)?"":b;if(this.useMask&&!Ext.isEmpty(b)){if(this.inputEl){this.hiddenField.dom.value=this.textMask.unmask(b);this.inputEl.dom.value=this.textMask.mask(b)}this.value=this.textMask.unmask(b)}else{if(this.inputEl){this.hiddenField.dom.value=b;this.inputEl.dom.value=b}this.value=b}},setDateValue:function(b){if(b==="now"){b=new Date()}if(this.inputEl){b=this.formatDate(this.parseDate(b));this.hiddenField.dom.value=b;this.inputEl.dom.value=this.textMask.mask(b)}this.value=b},setMask:function(b){this.textMask.setMask(b);this.setValue(this.hiddenField.dom.value)}},0,0,0,0,["plugin.textmask"],0,[Ext.ux,"TextMaskPlugin"],0));(Ext.cmd.derive("Ext.ux.form.field.Money",Ext.form.field.Text,{mask:t("maskMoney"),money:true,initComponent:function(){var b=this;b.plugins=["textmask","markallowblank"];Ext.form.field.Text.prototype.initComponent.apply(this,arguments)}},0,["moneyfield"],["component","box","field","textfield","moneyfield"],{component:true,box:true,field:true,textfield:true,moneyfield:true},["widget.moneyfield"],0,[Ext.ux.form.field,"Money"],0));(Ext.cmd.derive("Ext.ux.form.Panel",Ext.form.Panel,{bodyPadding:5,autoScroll:true,border:false,allowCreate:true,allowUpdate:true,defaultType:"textfield",layout:"anchor",idRecord:0,textNew:t("New"),glyphNew:icons.file,textSave:t("Save"),glyphSave:icons.disk,textCancel:t("Cancel"),glyphCancel:icons.stop,alignButtonsBottom:"->",defaults:{plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true},buttonsTbar:[],labelWidthFields:100,labelAlignFields:"right",header:window.isTablet||window.isTablets?false:"",initComponent:function(){var j=this;var e=j.xtype.slice(0,-4);if(j.items&&App.user.isAdmin&&App.user.show_filed_help==true){if(j.items[0].xtype=="tabpanel"){j.items[0].items.forEach(function(a){a.items.forEach(function(b){if(b.xtype=="fieldcontainer"){b.items.forEach(function(d){var m=h(e+"."+d.name);if(m.length>10){d.fieldLabel=d.fieldLabel+" "+m}})}else{if(b.xtype=="fieldset"){b.items.forEach(function(d){var m=h(e+"."+d.name);if(m.length>10){d.fieldLabel=d.fieldLabel+" "+m}})}else{var c=h(e+"."+b.name);if(c.length>10){b.fieldLabel=b.fieldLabel+" "+c}}}})})}else{for(var f in j.items){var g=h(e+"."+j.items[f].name);if(g.length>10){j.items[f].fieldLabel=j.items[f].fieldLabel+" "+g}}}}Ext.applyIf(j.defaults,{anchor:"0",enableKeyEvents:true,labelAlign:j.labelAlignFields,labelWidth:j.labelWidthFields,msgTarget:"side",plugins:"markallowblank",allowBlank:false});j.dockedItems=[];itemsTbar=j.buttonsTbar.length?j.buttonsTbar:[{xtype:"tbtext"},j.alignButtonsBottom,{reference:"save",text:j.textSave,width:90,glyph:j.glyphSave,handler:"onSave"},{text:j.textCancel,width:90,glyph:j.glyphCancel,handler:"onCancel"}];j.hideTbar=Ext.isDefined(j.hideTbar)?j.hideTbar:!j.allowCreate;j.hideBbar=!j.allowCreate&&!j.allowUpdate;j.dockedItems=[{xtype:"toolbar",hidden:j.hideBbar,dock:"bottom",items:itemsTbar}];Ext.form.Panel.prototype.initComponent.apply(this,arguments)}},0,0,["component","box","container","panel","form"],{component:true,box:true,container:true,panel:true,form:true},0,0,[Ext.ux.form,"Panel"],0));(Ext.cmd.derive("MBilling.view.groupModule.Form",Ext.ux.form.Panel,{items:[{xtype:"groupusercombo"},{xtype:"modulecombo"}]},0,["groupmoduleform"],["component","box","container","panel","form","groupmoduleform"],{component:true,box:true,container:true,panel:true,form:true,groupmoduleform:true},["widget.groupmoduleform"],0,[MBilling.view.groupModule,"Form"],0));(Ext.cmd.derive("MBilling.view.module.Combo",Ext.form.field.ComboBox,{name:"id_module",fieldLabel:t("Module"),displayField:"text",valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Module",{proxy:{type:"uxproxy",module:"module",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["modulecombo"],["component","box","field","textfield","pickerfield","combobox","combo","modulecombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,modulecombo:true},["widget.modulecombo"],0,[MBilling.view.module,"Combo"],0));(Ext.cmd.derive("MBilling.view.groupModule.Field",Ext.form.FieldContainer,{layout:"fit",name:"id_module",fieldLabel:t("Modules"),moduleText:t("Module"),showMenuText:t("Show Menu"),showDesktopText:t("Show Desktop"),showQuickInitText:t("Show Quick Init."),readText:t("Read"),createText:t("Create"),updateText:t("Update"),deleteText:t("Delete"),actionsText:t("Actions"),blankText:t("This field is required"),itemExistsText:t("This item already exists"),subFieldsName:{module:"id_module",moduleText:"idModuletext",showMenu:"show_menu",showDesktop:"createShortCut",showQuickInit:"createQuickStart",actions:"action"},initComponent:function(){var c=this,d;c.items=c.initGrid();Ext.form.FieldContainer.prototype.initComponent.apply(this,arguments)},afterRender:function(){var b=this;Ext.form.FieldContainer.prototype.afterRender.apply(this,arguments);b.setValue(b.value)},initGrid:function(){var d=this,e={},f;d.store=Ext.create("MBilling.store.GroupModule",{remoteSort:false});d.moduleCombo=Ext.widget("modulecombo",{hideLabel:true,allowBlank:false,validator:Ext.bind(d.checkModuleExists,d)});d.grid=Ext.widget("grid",{style:d.allowBlank===false?"border-left: 3px solid red":"",store:d.store,plugins:{ptype:"rowediting",pluginId:"rowEditor",listeners:{scope:d,beforeedit:d.onBeforeEdit,edit:d.onEdit,canceledit:d.onCancelEdit}},tbar:[{glyph:icons.file,scope:d,text:t("Add permissions for this group"),handler:function(){f=d.grid.getPlugin("rowEditor");if(!d.isUpdate&&f.editing){d.moduleCombo.focus();return false}d.moduleCombo.reset();e[d.subFieldsName.showMenu]=1;e[d.subFieldsName.showDesktop]=0;e[d.subFieldsName.showQuickInit]=0;d.addItem(e,0);f.startEdit(0,0);d.isUpdate=false;d.recordEditing=null}}],columns:[{xtype:"templatecolumn",flex:7,tpl:"{"+d.subFieldsName.moduleText+"}",header:d.moduleText,dataIndex:d.subFieldsName.module,editor:d.moduleCombo},{header:d.actionsText,flex:7,dataIndex:d.subFieldsName.actions,scope:d,renderer:d.rendererActions,editor:{xtype:"combo",multiSelect:true,store:[["c",d.createText],["r",d.readText],["u",d.updateText],["d",d.deleteText]]}},{xtype:"booleancolumn",flex:6,header:d.showMenuText,dataIndex:d.subFieldsName.showMenu,editor:{xtype:"checkbox"}},{xtype:"booleancolumn",flex:6,header:d.showDesktopText,dataIndex:d.subFieldsName.showDesktop,editor:{xtype:"checkbox"}},{xtype:"booleancolumn",flex:6,header:d.showQuickInitText,dataIndex:d.subFieldsName.showQuickInit,editor:{xtype:"checkbox"}},{xtype:"actioncolumn",flex:1,menuDisabled:true,iconCls:"icon-delete",tooltip:d.deleteText,handler:Ext.bind(d.removeItem,d),editRenderer:function(){return}}]});return d.grid},rendererActions:function(j){var e=this,f=Ext.isString(j)?j.split(""):j,g=[];Ext.each(f,function(a){switch(a){case"c":g.push(e.createText);break;case"r":g.push(e.readText);break;case"u":g.push(e.updateText);break;case"d":g.push(e.deleteText);break}},e);return g.join(", ")},onBeforeEdit:function(o,g){var n=this,j=g.record,l=n.subFieldsName.actions,m=j.get(l);j.set(l,Ext.isString(m)?m.split(""):undefined);n.isUpdate=j.get(n.subFieldsName.module)>0;n.recordEditing=n.isUpdate?j:null},onEdit:function(m,f){var l=this,g=f.record,j=l.subFieldsName.actions;g.set(j,g.get(j).join(""));g.set("idModuletext","t('"+l.moduleCombo.getRawValue()+"')");g.commit()},onCancelEdit:function(o,g){var n=this,j=g.record,l=n.subFieldsName.actions,m=j.get(l);n.isUpdate?j.set(l,m&&m.join("")):n.store.removeAt(g.rowIdx);j.commit()},addItem:function(f,e){var d=this;f=f||{};Ext.isDefined(e)?d.store.insert(e,Ext.clone(f)):d.store.add(Ext.clone(f))},removeItem:function(e,g){var j=this,f=j.store.getAt(g);j.store.remove(f)},getErrors:function(){var d=this,f=[],e;if(d.allowBlank){return f}if(!d.getValue().length){f.push(d.blankText);return f}return f},reset:function(){this.store.removeAll()},setValue:function(d){var c=this;c.reset();Ext.each(d,function(a){c.addItem(a)},c)},getValue:function(){var m=this,g=[],l={},j,f;m.store.each(function(a){f=a.get(m.subFieldsName.module);if(f){l[m.subFieldsName.module]=f;l[m.subFieldsName.showMenu]=a.get(m.subFieldsName.showMenu);l[m.subFieldsName.showDesktop]=a.get(m.subFieldsName.showDesktop);l[m.subFieldsName.showQuickInit]=a.get(m.subFieldsName.showQuickInit);l[m.subFieldsName.actions]=a.get(m.subFieldsName.actions);g.push(Ext.clone(l))}});return g},getSubmitData:function(){var d=this,c={};c[d.getName()]=Ext.encode(d.getValue());return c},checkModuleExists:function(){var f=this,d=f.moduleCombo.getValue(),e=f.recordEditing&&f.recordEditing.get(f.subFieldsName.module);if(!d){return true}if(f.isUpdate&&(e!==d)&&f.store.find(f.subFieldsName.module,d)!==-1){return f.itemExistsText}else{if(!f.isUpdate&&f.store.find(f.subFieldsName.module,d)!==-1){return f.itemExistsText}}return true}},0,["groupmodulefield"],["component","box","container","fieldcontainer","groupmodulefield"],{component:true,box:true,container:true,fieldcontainer:true,groupmodulefield:true},["widget.groupmodulefield"],[["field",Ext.form.field.Field]],[MBilling.view.groupModule,"Field"],0));(Ext.cmd.derive("MBilling.view.groupUser.Controller",Ext.ux.app.ViewController,{onEdit:function(){var b=this;b.lookupReference("generalTab").show();Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)},onSelectionChange:function(e,j){var g=this,f=g.lookupReference("buttonCloneGroup");f&&f.setDisabled(!j.length);Ext.ux.app.ViewController.prototype.onSelectionChange.apply(this,arguments)},onCloneGroupUser:function(e){var f=this,d=f.list.getSelectionModel().getSelection()[0];if(f.list.getSelectionModel().getSelection().length==1){Ext.Ajax.request({url:"index.php/groupUser/clone",params:{id:d.get("id")},scope:f,success:function(a){a=Ext.decode(a.responseText);if(a[f.nameSuccessRequest]){Ext.ux.Alert.alert(f.titleSuccess,a[f.nameMsgRequest],"success")}else{Ext.ux.Alert.alert(f.titleError,a[f.nameMsgRequest],"error")}}})}else{Ext.ux.Alert.alert(f.titleError,"Please Select only a record","notification")}f.store.load()}},0,0,0,0,["controller.groupuser"],0,[MBilling.view.groupUser,"Controller"],0));(Ext.cmd.derive("MBilling.view.groupUser.Module",Ext.ux.panel.Module,{controller:"groupuser",cfgEast:{flex:9}},0,["groupusermodule"],["component","box","container","uxpanelmodule","groupusermodule"],{component:true,box:true,container:true,uxpanelmodule:true,groupusermodule:true},["widget.groupusermodule"],0,[MBilling.view.groupUser,"Module"],0));(Ext.cmd.derive("MBilling.view.groupUser.List",Ext.ux.grid.Panel,{store:"GroupUser",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.allowPrint=false;b.buttonCsv=false;b.extraButtons=[{text:t("Clone")+" "+t("Group"),handler:"onCloneGroupUser",width:100,reference:"buttonCloneGroup",disabled:true}];b.columns=[{text:t("Id"),dataIndex:"id",hidden:true,hideable:App.user.isAdmin},{text:t("Name"),dataIndex:"name"},{xtype:"templatecolumn",tpl:"{idUserTypename}",header:t("User Type"),renderer:function(a){a=a==1?t("admin"):a==2?t("agent"):t("user");return a},dataIndex:"id_user_type",comboFilter:"usertypecombo"}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["groupuserlist"],["component","box","container","panel","tablepanel","gridpanel","grid","groupuserlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,groupuserlist:true},["widget.groupuserlist"],0,[MBilling.view.groupUser,"List"],0));(Ext.cmd.derive("Ext.ux.form.field.Permission",Ext.form.FieldContainer,{layout:"fit",border:1,style:{borderColor:"#cecece",borderStyle:"solid"},name:"id_module",moduleText:t("Module"),showMenuText:t("Menu"),showDesktopText:t("Desktop"),showQuickInitText:t("Quick Init."),createText:t("Create"),updateText:t("Update"),deleteText:t("Delete"),blankText:t("This field is required"),urlReadTree:"index.php/module/readTree",rootPropertyRead:"rows",fieldsMap:{idModule:"id_module",action:"action",showMenu:"show_menu",showDesktop:"createShortCut",showQuickInit:"createQuickStart"},initComponent:function(){var b=this;b.items=b.initTreeGrid();Ext.form.FieldContainer.prototype.initComponent.apply(this,arguments)},initTreeGrid:function(){var me=this,listenersCheckColumns={scope:me,checkchange:me.onCheckColumn};me.treeStore=Ext.create("Ext.data.TreeStore",{proxy:{type:"ajax",url:me.urlReadTree,reader:{type:"json",rootProperty:me.rootPropertyRead},extraParams:me.extraParamsRead},fields:[{name:"text",convert:function(v){return(v.indexOf("t(")!==-1)?eval(v):v}},"iconCls",{name:"create",type:"boolean"},{name:"update",type:"boolean"},{name:"delete",type:"boolean"},{name:"show_menu",type:"boolean"},{name:"createShortCut",type:"boolean"},{name:"createQuickStart",type:"boolean"}],remoteSort:false,defaultRootProperty:me.rootPropertyRead});me.treeGrid=Ext.widget("treepanel",{style:me.allowBlank===false?"border-left: 3px solid red":"",useArrows:true,rootVisible:false,store:me.treeStore,listeners:{scope:me,checkchange:me.onCheckModule},columns:[{xtype:"treecolumn",text:me.moduleText,flex:3,dataIndex:"text"},{xtype:"checkcolumn",text:me.showMenuText,flex:1,dataIndex:"show_menu",listeners:{checkchange:me.onCheckMenu}},{xtype:"checkcolumn",text:me.createText,flex:1,dataIndex:"create",listeners:listenersCheckColumns},{xtype:"checkcolumn",text:me.updateText,flex:1,dataIndex:"update",listeners:listenersCheckColumns},{xtype:"checkcolumn",text:me.deleteText,flex:1,dataIndex:"delete",listeners:listenersCheckColumns},{xtype:"checkcolumn",text:me.showDesktopText,flex:1,dataIndex:"createShortCut",listeners:listenersCheckColumns},{xtype:"checkcolumn",text:me.showQuickInitText,flex:1,dataIndex:"createQuickStart",listeners:listenersCheckColumns}]});return me.treeGrid},onCheckMenu:function(f,g,j,e){if(!j){return}e.set("checked",true);e.parentNode.set(f.dataIndex,true);e.parentNode.set("checked",true)},onCheckColumn:function(f,g,j,e){if(j){e.set("checked",true);e.parentNode.set("checked",true)}if(e.isLeaf()){return}e.cascadeBy(function(a){a.set(f.dataIndex,j);if(j){a.set("checked",true);a.parentNode.set("checked",true)}})},onCheckModule:function(f,d){var e=this;d?(f.parentNode&&!f.parentNode.get("checked")&&f.parentNode.set("checked",true)):e.resetNode(f);if(f.isLeaf()){return}f.cascadeBy(function(a){a.set("checked",d);d?(a.parentNode&&a.parentNode.set("checked",true)):e.resetNode(a)},e)},getErrors:function(){var d=this,c=[];if(d.allowBlank){return c}if(!d.getValue().length){c.push(d.blankText);return c}return c},reset:function(){this.treeStore.load()},resetNode:function(b){b.set({create:false,update:false,"delete":false,show_menu:false,createShortCut:false,createQuickStart:false,checked:false});b.commit()},setValue:function(f){var m=this,j,l,g;m.treeStore.load({scope:m,callback:function(){m.setLoading(true);Ext.each(f,function(a){j=m.treeStore.getRootNode().findChild("id",parseInt(a[m.fieldsMap.idModule]),true);l=a[m.fieldsMap.action]||[];g=j.isLeaf();j.set({create:g&&l.indexOf("c")!==-1,update:g&&l.indexOf("u")!==-1,"delete":g&&l.indexOf("d")!==-1,show_menu:a[m.fieldsMap.showMenu]==1,createShortCut:g&&a[m.fieldsMap.showDesktop]==1,createQuickStart:g&&a[m.fieldsMap.showQuickInit]==1,checked:true});j.commit()});m.setLoading(false)}})},getValue:function(){var e=this,j={},f=[],g;this.treeStore.getRootNode().cascadeBy(function(a){if(a.get("checked")&&!a.isRoot()){g=[];j={};a.get("create")&&g.push("c");g.push("r");a.get("update")&&g.push("u");a.get("delete")&&g.push("d");j[e.fieldsMap.idModule]=a.getId();j[e.fieldsMap.action]=g.join("");j[e.fieldsMap.showMenu]=a.get("show_menu")?1:0;j[e.fieldsMap.showDesktop]=a.get("createShortCut")?1:0;j[e.fieldsMap.showQuickInit]=a.get("createQuickStart")?1:0;f.push(Ext.clone(j))}});return f}},0,["permissionfield"],["component","box","container","fieldcontainer","permissionfield"],{component:true,box:true,container:true,fieldcontainer:true,permissionfield:true},["widget.permissionfield"],[["field",Ext.form.field.Field]],[Ext.ux.form.field,"Permission"],0));(Ext.cmd.derive("MBilling.view.groupUser.Form",Ext.ux.form.Panel,{header:false,initComponent:function(){var b=this;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true}},items:[{title:t("general"),reference:"generalTab",items:[{name:"id",fieldLabel:t("Id"),disabled:true,hidden:true},{name:"name",fieldLabel:t("Name"),maxLength:100},{xtype:"usertypecombo"}]},{title:t("Permissions"),items:[{xtype:"permissionfield",hideLabel:true,anchor:"100% "+(!Ext.Boot.platformTags.desktop?"82%":window.isThemeNeptune?"87%":"89%"),allowBlank:true}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["groupuserform"],["component","box","container","panel","form","groupuserform"],{component:true,box:true,container:true,panel:true,form:true,groupuserform:true},["widget.groupuserform"],0,[MBilling.view.groupUser,"Form"],0));(Ext.cmd.derive("MBilling.view.groupUser.Combo",Ext.form.field.ComboBox,{name:"id_group",fieldLabel:t("IdGroup"),displayField:"name",valueField:"id",forceSelection:true,editable:false,initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.GroupUser",{proxy:{type:"uxproxy",module:"groupUser",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["groupusercombo"],["component","box","field","textfield","pickerfield","combobox","combo","groupusercombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,groupusercombo:true},["widget.groupusercombo"],0,[MBilling.view.groupUser,"Combo"],0));(Ext.cmd.derive("MBilling.view.groupUser.AgentUSerCombo",Ext.form.field.ComboBox,{name:"id_group_agent",fieldLabel:t("GroupUser"),displayField:"name",forceSelection:true,editable:false,valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.GroupUser",{proxy:{type:"uxproxy",module:"groupUser",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["groupuseragentcombo"],["component","box","field","textfield","pickerfield","combobox","combo","groupuseragentcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,groupuseragentcombo:true},["widget.groupuseragentcombo"],0,[MBilling.view.groupUser,"AgentUSerCombo"],0));(Ext.cmd.derive("MBilling.view.groupUser.Tag",Ext.form.field.Tag,{name:"id_group",fieldLabel:t("GroupUser"),displayField:"name",valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.GroupUser",{proxy:{type:"uxproxy",module:"plan",limitParam:undefined}});Ext.form.field.Tag.prototype.initComponent.apply(this,arguments)}},0,["groupusertag"],["component","box","field","textfield","pickerfield","combobox","combo","tagfield","groupusertag"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,tagfield:true,groupusertag:true},["widget.groupusertag"],0,[MBilling.view.groupUser,"Tag"],0));(Ext.cmd.derive("MBilling.view.module.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.module"],0,[MBilling.view.module,"Controller"],0));(Ext.cmd.derive("MBilling.view.module.Module",Ext.ux.panel.Module,{controller:"module"},0,["modulemodule"],["component","box","container","uxpanelmodule","modulemodule"],{component:true,box:true,container:true,uxpanelmodule:true,modulemodule:true},["widget.modulemodule"],0,[MBilling.view.module,"Module"],0));(Ext.cmd.derive("MBilling.view.module.List",Ext.ux.grid.Panel,{store:"Module",initComponent:function(){var b=this;b.columns=[{text:t("Id"),dataIndex:"id"},{text:t("Text"),dataIndex:"text"},{text:t("Module"),dataIndex:"module"},{text:t("IconCls"),dataIndex:"icon_cls"},{xtype:"templatecolumn",tpl:"{idModuletext}",text:t("Module Owner"),dataIndex:"id_module",comboFilter:"modulecombo"}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["modulelist"],["component","box","container","panel","tablepanel","gridpanel","grid","modulelist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,modulelist:true},["widget.modulelist"],0,[MBilling.view.module,"List"],0));(Ext.cmd.derive("MBilling.view.module.Form",Ext.ux.form.Panel,{items:[{name:"id",fieldLabel:t("Id"),disabled:true},{name:"text",fieldLabel:t("Text"),maxLength:100},{name:"module",fieldLabel:t("Module"),allowBlank:true,maxLength:100},{name:"icon_cls",fieldLabel:t("IconCls"),allowBlank:true,maxLength:100},{xtype:"modulecombo",fieldLabel:t("Module Owner"),allowBlank:true}]},0,["moduleform"],["component","box","container","panel","form","moduleform"],{component:true,box:true,container:true,panel:true,form:true,moduleform:true},["widget.moduleform"],0,[MBilling.view.module,"Form"],0));(Ext.cmd.derive("MBilling.view.module.Tag",Ext.form.field.Tag,{name:"id_module",fieldLabel:t("Module"),displayField:"text",valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Module",{proxy:{type:"uxproxy",module:"plan",limitParam:undefined}});Ext.form.field.Tag.prototype.initComponent.apply(this,arguments)}},0,["moduletag"],["component","box","field","textfield","pickerfield","combobox","combo","tagfield","moduletag"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,tagfield:true,moduletag:true},["widget.moduletag"],0,[MBilling.view.module,"Tag"],0));(Ext.cmd.derive("MBilling.view.userType.Combo",Ext.form.field.ComboBox,{name:"id_user_type",fieldLabel:t("userType"),displayField:"name",valueField:"id",value:1,store:[[1,t("admin")],[2,t("agent")],[3,t("client")]]},0,["usertypecombo"],["component","box","field","textfield","pickerfield","combobox","combo","usertypecombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,usertypecombo:true},["widget.usertypecombo"],0,[MBilling.view.userType,"Combo"],0));(Ext.cmd.derive("MBilling.view.user.Controller",Ext.ux.app.ViewController,{groupIsAdmin:false,init:function(){var b=this;b.control({groupusercombo:{select:b.onSelectType}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectType:function(c,d){this.showFieldsRelated(d.getData().showFields)},showFieldsRelated:function(j){var l=this,g=l.formPanel.getForm().getFields(),f=l.formPanel.getForm().findField("id_group_agent"),m=l.formPanel.getForm();l.onGetUserType(l.formPanel.getForm().findField("id_group").getValue(),function(a){l.groupIsAdmin=a;l.formPanel.getForm().findField("id_plan").setVisible(!a);l.formPanel.getForm().findField("id_plan").setAllowBlank(a);l.formPanel.getForm().findField("id_offer").setVisible(!a);l.formPanel.getForm().findField("prefix_local").setVisible(!a)});g.each(function(a){if(a.name=="id_group"){filterGroupp=Ext.encode([{type:"numeric",comparison:"eq",value:2,field:"id_user_type"}]),Ext.Ajax.request({url:"index.php/groupUser/index",params:{filter:filterGroupp},success:function(b){b=Ext.decode(b.responseText);var c=b.rows;for(i=0;i1){c.formPanel.getForm().findField("id_plan")["hide"]();fieldGroup.readOnly=true}else{c.formPanel.getForm().findField("id_plan")["show"]();fieldGroup.readOnly=false}}Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments);c.onGetUserType(d.get("id_group"),function(a){c.formPanel.getForm().findField("password").setVisible(!a);c.formPanel.getForm().findField("id_plan").setVisible(!a);c.formPanel.getForm().findField("id_plan").setAllowBlank(a);c.formPanel.getForm().findField("id_offer").setVisible(!a);c.formPanel.getForm().findField("prefix_local").setVisible(!a)});if(fieldGroup.value==2){fieldGroupAgent.show()}else{fieldGroupAgent.hide()}},onGetUserType:function(d,c){filterGroupp=Ext.encode([{type:"numeric",comparison:"eq",value:d,field:"id"}]),Ext.Ajax.request({url:"index.php/groupUser/getUserType",params:{filter:filterGroupp},success:function(a){a=Ext.decode(a.responseText);c(a.rows)}})},onDelete:function(d){var f=this,e;notDelete=false;Ext.each(f.list.getSelectionModel().getSelection(),function(a){if(a.get("id")==1){Ext.ux.Alert.alert(f.titleError,t("You cannot delete the")+" user id 1","error");notDelete=true}});if(notDelete==false){Ext.ux.app.ViewController.prototype.onDelete.apply(this,arguments)}}},0,0,0,0,["controller.user"],0,[MBilling.view.user,"Controller"],0));(Ext.cmd.derive("MBilling.view.user.Combo",Ext.form.field.ComboBox,{name:"id_user",fieldLabel:t("username"),displayField:"username",forceSelection:true,editable:false,valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.User",{proxy:{type:"uxproxy",module:"user",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["usercombo"],["component","box","field","textfield","pickerfield","combobox","combo","usercombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,usercombo:true},["widget.usercombo"],0,[MBilling.view.user,"Combo"],0));(Ext.cmd.derive("MBilling.view.user.Module",Ext.ux.panel.Module,{controller:"user",cfgEast:{flex:4}},0,["usermodule"],["component","box","container","uxpanelmodule","usermodule"],{component:true,box:true,container:true,uxpanelmodule:true,usermodule:true},["widget.usermodule"],0,[MBilling.view.user,"Module"],0));(Ext.cmd.derive("MBilling.view.user.List",Ext.ux.grid.Panel,{store:"User",fieldSearch:"username",initComponent:function(){var b=this;b.extraButtons=[{text:t("Bulk")+" "+t("User"),handler:"onBulk",width:100,disabled:false,hidden:App.user.isClient||!b.allowCreate}];b.columns=b.columns||[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("username"),dataIndex:"username",flex:2},{header:t("lastname"),dataIndex:"lastname",flex:3},{header:t("firstname"),dataIndex:"firstname",flex:3},{header:t("email"),dataIndex:"email",flex:window.isTablet?3:4},{header:t("credit"),dataIndex:"credit",renderer:Helper.Util.formatMoneyDecimal,flex:2},{xtype:"templatecolumn",tpl:"{idPlanname}",header:t("plan"),dataIndex:"id_plan",comboFilter:"plancombo",flex:3},{xtype:"templatecolumn",tpl:"{idGroupname}",header:t("group"),dataIndex:"id_group",comboFilter:"groupusercombo",flex:2,hidden:App.user.isClient||App.user.isAgent||window.isTablet,hideable:!App.user.isClient&&!App.user.isAgent},{header:t("agent"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:2,hidden:!App.user.isAdmin||window.isTablet,hideable:App.user.isAdmin},{header:t("status"),dataIndex:"active",renderer:Helper.Util.formatBooleanActive,flex:2,filter:{type:"list",options:[[1,t("active")],[2,t("pending")],[0,t("inactive")]]},hidden:App.user.isClient||window.isTablet,hideable:!App.user.isClient},{header:t("creationdate"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"creationdate",flex:4},{dataIndex:"id_offer",header:t("offer"),flex:2,hidden:true,hideable:!App.user.isClient&&!App.user.isAgent},{header:t("typepaid"),dataIndex:"typepaid",flex:2,renderer:Helper.Util.formattypepaid,filter:{type:"list",options:[[0,t("prepaid")],[1,t("pospaid")]]},hidden:true,hideable:!App.user.isClient&&!App.user.isAgent},{header:t("city"),dataIndex:"city",hidden:true,hideable:!App.user.isClient&&!App.user.isAgent,flex:1},{header:t("state"),dataIndex:"state",hidden:true,hideable:!App.user.isClient&&!App.user.isAgent,flex:1},{header:t("country"),dataIndex:"country",hidden:true,hideable:!App.user.isClient&&!App.user.isAgent,flex:1},{header:t("zipcode"),dataIndex:"zipcode",hidden:true,hideable:!App.user.isClient&&!App.user.isAgent,flex:1},{header:t("phone"),dataIndex:"phone",hidden:true,hideable:!App.user.isClient&&!App.user.isAgent,flex:1},{header:t("creditlimit"),dataIndex:"creditlimit",hidden:true,hideable:!App.user.isClient&&!App.user.isAgent,flex:1},{header:t("record_call"),dataIndex:"record_call",flex:1,renderer:Helper.Util.formattyyesno,filter:{type:"list",options:[[0,t("no")],[1,t("yes")]]},hidden:true,hideable:!App.user.isClient&&!App.user.isAgent},{header:t("CPS Limit"),dataIndex:"cpslimit",hidden:true,hideable:window.dialC&&App.user.isAdmin,flex:2}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["userlist"],["component","box","container","panel","tablepanel","gridpanel","grid","userlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,userlist:true},["widget.userlist"],0,[MBilling.view.user,"List"],0));(Ext.cmd.derive("MBilling.view.user.Form",Ext.ux.form.Panel,{autoHeight:300,bodyPadding:0,fieldsHideUpdateLot:["username","password","id_group_agent","id_offer","callingcard_pin"],initComponent:function(){var b=this;haveServiceMenu=false;Ext.each(App.user.menu,function(a){if(a.text=="t('Services')"){haveServiceMenu=true}});b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{labelAlign:"right",plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true}},items:[{title:t("general"),items:[{name:"username",fieldLabel:t("username"),maxLength:20,minLength:4,readOnly:App.user.isClient},{name:"password",fieldLabel:t("Password"),minLength:6,hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"id_group",fieldLabel:t("IdGroup"),xtype:"groupusercombo",allowBlank:!App.user.isAdmin,hidden:!App.user.isAdmin},{name:"id_group_agent",fieldLabel:t("GroupUser"),xtype:"groupuseragentcombo",emptyText:t("SELECT GROUP FOR AGENT USERS"),fieldLabel:t("Group for Agent Users"),hidden:true,allowBlank:true},{fieldLabel:t("Plan"),name:"id_plan",xtype:"planlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:App.user.isClient},{xtype:"languagecombo",name:"language",value:App.user.language=="pt_BR"?"br":App.user.language,fieldLabel:t("language")},{name:"prefix_local",fieldLabel:t("prefixlocal"),value:App.user.base_country=="BRL"?"0/55,*/5511/8,*/5511/9":App.user.base_country=="ARG"?"0/54,*/5411/8,15/54911/10,16/54911/10":"",allowBlank:true,emptyText:"match / replace / length",hidden:App.user.isClient},{xtype:"statususercombo",name:"active",fieldLabel:t("Active"),hidden:App.user.isClient,allowBlank:App.user.isClient},{xtype:"countrycombo",name:"country",fieldLabel:t("country"),value:App.user.language=="pt_BR"?"55":"1",allowBlank:true},{name:"id_offer",fieldLabel:t("offer"),xtype:"offercombo",allowBlank:true},{xtype:"numberfield",name:"cpslimit",fieldLabel:t("CPS Limit"),value:-1,minValue:-1,maxValue:50,hidden:!window.dialC||!App.user.isAdmin,allowBlank:true}]},{title:t("personalData"),itemId:"personalData",items:[{name:"company_name",fieldLabel:t("company")+" "+t("name"),allowBlank:true},{name:"state_number",fieldLabel:t("state_number"),allowBlank:true,hidden:App.user.base_country=!"BRL"},{name:"lastname",fieldLabel:t("lastname"),allowBlank:true,maxLength:40,minLength:4},{name:"firstname",fieldLabel:t("firstname"),allowBlank:true,maxLength:40,minLength:4},{xtype:"fieldcontainer",layout:"hbox",labelWidth:100,defaults:{xtype:"textfield",labelAlign:"right",flex:1},items:[{name:"city",fieldLabel:t("city"),allowBlank:true,maxLength:40,minLength:4,flex:2},{name:"state",fieldLabel:t("state"),allowBlank:true,maxLength:20,minLength:2}]},{name:"address",fieldLabel:t("address"),allowBlank:true},{name:"zipcode",fieldLabel:t("zipcode"),allowBlank:true},{xtype:"fieldcontainer",layout:"hbox",labelWidth:100,defaults:{xtype:"textfield",labelAlign:"right",flex:1},items:[{name:"phone",fieldLabel:t("phone"),allowBlank:true,maxLength:13,minLength:8},{name:"mobile",fieldLabel:t("mobile"),allowBlank:true,maxLength:20,minLength:8}]},{name:"email",fieldLabel:t("email"),allowBlank:true,vtype:"email"},{name:"doc",fieldLabel:t("Doc"),allowBlank:true},{name:"vat",fieldLabel:t("vat"),hidden:App.user.isClient,allowBlank:true}]},{title:t("suplementaryInfo"),itemId:"suplementaryInfo",defaults:{labelAlign:"right",plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true,labelWidth:145},items:[{xtype:"typepaymentcombo",name:"typepaid",fieldLabel:t("typepaid"),allowBlank:true,readOnly:App.user.isClient},{xtype:"fieldcontainer",layout:"hbox",defaults:{xtype:"textfield",labelAlign:"right",labelWidth:145,flex:1},items:[{name:"creditlimit",fieldLabel:t("creditlimit"),value:0,allowBlank:true,readOnly:App.user.isClient,flex:2},{xtype:"numberfield",name:"credit_notification",labelWidth:150,fieldLabel:t("creditnotification"),value:"-1",minValue:-1,allowBlank:true,flex:3}]},{xtype:"fieldcontainer",layout:"hbox",defaults:{xtype:"textfield",labelAlign:"right",labelWidth:145,flex:1},items:[{xtype:"noyescombo",name:"enableexpire",fieldLabel:t("enableexpire"),allowBlank:true,hidden:!App.user.isAdmin,flex:2},{xtype:"datefield",name:"expirationdate",fieldLabel:t("expirationdate"),format:"Y-m-d H:i:s",allowBlank:true,hidden:!App.user.isAdmin,labelWidth:150,flex:3}]},{xtype:"fieldcontainer",layout:"hbox",defaults:{xtype:"textfield",labelAlign:"right",labelWidth:145,flex:1},items:[{xtype:"noyescombo",name:"record_call",fieldLabel:t("record_call"),allowBlank:true,hidden:!haveServiceMenu||!App.user.isAdmin,readOnly:!App.user.isAdmin,flex:2},{labelWidth:150,xtype:"combobox",store:[["gsm",t("gsm")],["wav",t("wav")],["wav49",t("wav49")]],name:"mix_monitor_format",fieldLabel:t("Record call format"),forceSelection:true,editable:false,allowBlank:true,value:"gsm",hidden:!haveServiceMenu,flex:3}]},{xtype:"fieldcontainer",layout:"hbox",labelWidth:145,defaults:{labelAlign:"right",hidden:!haveServiceMenu,readOnly:!App.user.isAdmin,allowBlank:true,flex:1},items:[{labelWidth:145,xtype:"numberfield",name:"calllimit",fieldLabel:t("calllimit"),value:"-1",minValue:-1,flex:2},{labelWidth:150,xtype:"combobox",forceSelection:true,editable:false,name:"calllimit_error",fieldLabel:t("CallLimit Error"),value:"503",store:[["503",t("Congestion")],["403",t("Busy")]],flex:3}]},{xtype:"noyescombo",name:"callshop",fieldLabel:"Callshop",allowBlank:true,hidden:App.user.isClient},{xtype:"numberfield",name:"disk_space",fieldLabel:t("Disk Space"),value:-1,hidden:!haveServiceMenu,minValue:-1,readOnly:!App.user.isAdmin},{name:"sipaccountlimit",xtype:"numberfield",fieldLabel:t("Sip Account Limit"),value:"-1",minValue:-1,allowBlank:!App.user.isAdmin,readOnly:!App.user.isAdmin,hidden:!haveServiceMenu},{xtype:"numberfield",name:"callingcard_pin",fieldLabel:t("lockpin"),minValue:100000,maxLength:6,minLength:6},{xtype:"restrictioncombo",name:"restriction",fieldLabel:t("restriction"),allowBlank:true,hidden:App.user.isClient}]},{title:t("Send Credit"),itemId:"transferData",hidden:!window.transferToMobile,items:[{xtype:"fieldcontainer",layout:"hbox",hidden:App.user.isClient,defaults:{labelAlign:"right",labelWidth:145,allowBlank:true,flex:1},items:[{xtype:"noyescombo",name:"transfer_international",fieldLabel:t("Enable International")},{xtype:"numberfield",name:"transfer_international_profit",labelWidth:120,fieldLabel:t("Profit")}]},{xtype:"fieldcontainer",layout:"hbox",hidden:App.user.isClient,defaults:{labelAlign:"right",labelWidth:145,allowBlank:true,flex:1},items:[{xtype:"noyescombo",name:"transfer_flexiload",fieldLabel:t("Enable Flexiload")},{xtype:"numberfield",name:"transfer_flexiload_profit",labelWidth:120,fieldLabel:t("Profit")}]},{xtype:"fieldcontainer",layout:"hbox",hidden:App.user.isClient,defaults:{labelAlign:"right",labelWidth:145,allowBlank:true,flex:1},items:[{xtype:"noyescombo",name:"transfer_bkash",fieldLabel:t("Enable Bkash")},{xtype:"numberfield",name:"transfer_bkash_profit",labelWidth:120,fieldLabel:t("Profit")}]},{xtype:"fieldcontainer",layout:"hbox",hidden:App.user.isClient,defaults:{labelAlign:"right",labelWidth:145,allowBlank:true,flex:1},items:[{xtype:"noyescombo",name:"transfer_dbbl_rocket",fieldLabel:t("Enable DBBL/Rocket")},{xtype:"numberfield",name:"transfer_dbbl_rocket_profit",labelWidth:120,fieldLabel:t("Profit")}]},{xtype:"numberfield",name:"transfer_bdservice_rate",fieldLabel:t("BDService rate"),minValue:0,hidden:!App.user.isAdmin,allowBlank:true},{xtype:"numberfield",name:"transfer_show_selling_price",fieldLabel:t("show selling price"),allowBlank:true}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["userform"],["component","box","container","panel","form","userform"],{component:true,box:true,container:true,panel:true,form:true,userform:true},["widget.userform"],0,[MBilling.view.user,"Form"],0));(Ext.cmd.derive("Ext.ux.form.field.Lookup",Ext.form.FieldContainer,{layout:"fit",blankText:t("This field is required."),displayField:undefined,valueField:"id",gridConfig:{},windowConfig:{},iconClsSearch:"x-form-search-trigger",layout:"hbox",startX:150,hiddenSearchButton:false,eventsRelay:["dirtychange","validitychange","errorchange","specialkey","blur","keydown","keyup","keypress","change"],initComponent:function(){var b=this;b.store=Ext.data.StoreManager.lookup(b.store||"ext-empty-store");b.items=b.initSubFields();Ext.form.FieldContainer.prototype.initComponent.apply(this,arguments)},initSubFields:function(){var b=this;b.rawField=Ext.widget("textfield",{readOnly:true,flex:1,onClearButtonClick:b.reset,clearButtonScope:b,isFormField:false,listeners:{scope:b,change:b.onChangeRawField},triggers:{clear:{weight:0,cls:"x-form-clear-trigger",hidden:true,clickOnReadOnly:true,handler:b.reset,scope:b}}});b.relayEvents(b.rawField,b.eventsRelay);b.buttonSearch=Ext.widget("button",{iconCls:"ux-gridfilter-text-icon",scope:b,text:t("Search"),handler:b.onClickSearch,hidden:b.hiddenSearchButton});return[b.rawField,b.buttonSearch]},onChangeRawField:function(b){b.getTrigger("clear").show()},onClickSearch:function(e,f){var d=this;if(!d.windowSearch){d.list=Ext.widget(d.gridConfig.xtype,Ext.apply({selType:"checkboxmodel",selModel:{mode:"SINGLE"},allowCreate:false,allowUpdate:false,allowDelete:false,allowPrint:false,autoLoadList:false,buttonCsv:false,extraButtons:[],listeners:{scope:d,selectionchange:d.onSelectionChangeList,itemdblclick:d.onItemDblClick}},d.gridConfig));d.buttonOk=Ext.widget("button",{text:t("Ok"),width:70,disabled:true,glyph:icons.checkmark,scope:d,handler:d.onClickSelect});d.windowSearch=Ext.widget("window",Ext.apply({closeAction:"hide",header:false,layout:"fit",closable:false,resizable:true,draggable:false,baseCls:"x-panel",width:d.rawField.getWidth()+70+d.startX,height:d.rawField.getY()>250?300:Ext.getBody().getViewSize().height-270,items:d.list,bbar:["->",{text:t("Cancel"),glyph:icons.stop,scope:d,handler:function(){d.windowSearch.close()}},d.buttonOk],listeners:{scope:d,show:d.onShowWindowSearch}},d.windowConfig))}else{d.windowSearch.setWidth(d.rawField.getWidth()+23+d.startX)}d.windowSearch.showAt(d.rawField.getX()-d.startX,d.rawField.getY()+23)},onSelectionChangeList:function(d,c){this.recordSelected=c[0];this.buttonOk.setDisabled(!c.length)},onItemDblClick:function(d,c){this.selectRecord(c)},onClickSelect:function(){this.selectRecord()},selectRecord:function(c){var d=this;c=c||d.recordSelected;d.setValue(c.getId(),c.get(d.displayFieldList));d.windowSearch.close();d.list.store.defaultFilter=[];d.list.store.load()},onShowWindowSearch:function(f){var e=this,d=e.list.down("searchfield");d&&d.focus(true,10);!e.list.store.getCount()&&Ext.defer(function(){e.list.store.load()},10)},getErrors:function(){var d=this,c=[];if(d.allowBlank){return c}if(!d.getValue()){c.push(d.blankText);return c}return c},reset:function(){var b=this;b.rawField.reset();b.setValue("");b.rawField.getTrigger("clear").hide();b.rawField.updateLayout()},setValue:function(j,e){var f=this,g=f.ownerForm&&f.ownerForm.getRecord();if(!Ext.isEmpty(j)){e=e||(g&&g.get(f.displayField))}f.value=j;f.rawField.setValue(e||j);f.fireEvent("select",f,j)},getValue:function(){return this.value},getRawValue:function(){return this.rawField.getRawValue()}},0,0,["component","box","container","fieldcontainer"],{component:true,box:true,container:true,fieldcontainer:true},0,[["field",Ext.form.field.Field]],[Ext.ux.form.field,"Lookup"],0));(Ext.cmd.derive("MBilling.view.user.Lookup",Ext.ux.form.field.Lookup,{name:"id_user",fieldLabel:t("User"),displayField:"idUserusername",displayFieldList:"username",gridConfig:{xtype:"userlist",fieldSearch:"username",columns:[{header:t("username"),dataIndex:"username",flex:2},{header:t("email"),dataIndex:"email",flex:2},{header:t("lastname"),dataIndex:"lastname",flex:2},{header:t("credit"),dataIndex:"credit",renderer:Helper.Util.formatMoneyDecimal,flex:2}]}},0,["userlookup"],["component","box","container","fieldcontainer","userlookup"],{component:true,box:true,container:true,fieldcontainer:true,userlookup:true},["widget.userlookup"],0,[MBilling.view.user,"Lookup"],0));(Ext.cmd.derive("MBilling.view.user.Bulk",Ext.window.Window,{autoShow:true,modal:true,layout:"fit",iconCls:"icon-import-csv",title:t("Bulk User"),width:400,height:window.isThemeNeptune||window.isThemeCrisp?295:window.isThemeTriton?390:270,labelWidthFields:120,htmlTipInfo:"",fieldsImport:[],initComponent:function(){var b=this;b.items=[{xtype:"form",bodyPadding:5,defaults:{anchor:"0",enableKeyEvents:true,labelWidth:b.labelWidthFields,msgTarget:"side",plugins:"markallowblank",allowBlank:false},items:[{xtype:"numberfield",value:10,name:"totalToCreate",fieldLabel:t("How many users?")},{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,00",name:"credit",value:0,fieldLabel:t("Add")+" "+t("Refill"),readOnly:App.user.isClient},{xtype:"groupusercombo",allowBlank:!App.user.isAdmin,hidden:!App.user.isAdmin},{xtype:"languagecombo",name:"language",value:App.user.language=="pt_BR"?"br":App.user.language,fieldLabel:t("language")},{xtype:"plancombo",hidden:App.user.isClient,allowBlank:App.user.isClient},{xtype:"textfield",name:"prefix_local",fieldLabel:t("prefixlocal"),value:App.user.base_country=="BRL"?"0/55,*/5511/8,*/5511/9":App.user.base_country=="ARG"?"0/54,*/5411/8,15/54911/10,16/54911/10":"",allowBlank:true,emptyText:"match / replace / length",hidden:App.user.isClient},{xtype:"statususercombo",name:"active",fieldLabel:t("Active"),hidden:App.user.isClient,allowBlank:App.user.isClient}]}];b.title=b.title+(b.titleModule?" - "+b.titleModule:"");b.bbar=[{width:150,iconCls:"icon-import-csv",text:t("Bulk")+" "+t("User"),scope:b,handler:b.onBulk}];Ext.window.Window.prototype.initComponent.apply(this,arguments)},onBulk:function(d){var f=this,e=f.list.store;if(!f.down("form").isValid()){return}f.list.setLoading(true);Ext.Ajax.setTimeout(1000000);f.down("form").submit({url:"index.php/user/bulk",scope:f,success:function(c,b){var a=Ext.decode(b.response.responseText);console.log(a);if(a.success){Ext.ux.Alert.alert(t("Success"),a.msg,"success")}else{Ext.ux.Alert.alert(t("Error"),a.errors,"error")}d.enable();f.list.setLoading(false);e.load();f.close()},failure:function(c,b){console.log(b.response.responseText);if(b.response&&Ext.isObject(b.response.responseText)){var a=Ext.decode(b.response.responseText);Ext.ux.Alert.alert(t("Error1"),a.errors,"error")}else{Ext.ux.Alert.alert(t("Error2"),Ext.decode(b.response.responseText).msg,"error",true,10)}d.enable()}})}},0,["userbulk"],["component","box","container","panel","window","userbulk"],{component:true,box:true,container:true,panel:true,window:true,userbulk:true},["widget.userbulk"],0,[MBilling.view.user,"Bulk"],0));(Ext.cmd.derive("MBilling.view.configuration.Controller",Ext.ux.app.ViewController,{onAfterSave:function(g){var j=this,l=j.formPanel.getForm(),f=l.getRecord(),m=f.data.config_key;g=g||j.formPanel;if(!g.idRecord){g.getForm().reset();j.focusFirstField()}j.saveButton.enable();j.updateLotButton&&j.updateLotButton.toggle(false);g.setLoading(false);j.formPanel.collapse();j.store.load();j.logoutKey(m)},logoutKey:function(d){var c=this;if(d=="licence"||d=="base_language"){localStorage.setItem("day","");localStorage.setItem("lang","")}if(d=="licence"){Ext.Ajax.request({url:"index.php/authentication/logoff",success:function(){App.user.logged=false;location.reload()}})}}},0,0,0,0,["controller.configuration"],0,[MBilling.view.configuration,"Controller"],0));(Ext.cmd.derive("MBilling.view.configuration.Module",Ext.ux.panel.Module,{controller:"configuration"},0,["configurationmodule"],["component","box","container","uxpanelmodule","configurationmodule"],{component:true,box:true,container:true,uxpanelmodule:true,configurationmodule:true},["widget.configurationmodule"],0,[MBilling.view.configuration,"Module"],0));(Ext.cmd.derive("MBilling.view.configuration.List",Ext.ux.grid.Panel,{store:"Configuration",fieldSearch:"config_title",comparisonfilter:"ct",initComponent:function(){var b=this;b.allowPrint=false;b.buttonCsv=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowDelete=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("name"),dataIndex:"config_title"},{header:t("value"),dataIndex:"config_value"}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["configurationlist"],["component","box","container","panel","tablepanel","gridpanel","grid","configurationlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,configurationlist:true},["widget.configurationlist"],0,[MBilling.view.configuration,"List"],0));(Ext.cmd.derive("MBilling.view.configuration.Form",Ext.ux.form.Panel,{items:[{name:"config_value",fieldLabel:t("value"),allowBlank:true},{xtype:"textarea",name:"config_description",fieldLabel:t("description"),height:200,anchor:"100%",readOnly:true}]},0,["configurationform"],["component","box","container","panel","form","configurationform"],{component:true,box:true,container:true,panel:true,form:true,configurationform:true},["widget.configurationform"],0,[MBilling.view.configuration,"Form"],0));(Ext.cmd.derive("MBilling.view.general.BooleanCombo",Ext.form.field.ComboBox,{fieldLabel:t("status"),forceSelection:true,editable:false,value:1,store:[[1,t("active")],[0,t("inactive")]]},0,["booleancombo"],["component","box","field","textfield","pickerfield","combobox","combo","booleancombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,booleancombo:true},["widget.booleancombo"],0,[MBilling.view.general,"BooleanCombo"],0));(Ext.cmd.derive("MBilling.view.general.ServicesTypeCombo",Ext.form.field.ComboBox,{fieldLabel:t("status"),forceSelection:true,editable:false,value:"Custom",store:[["disk_space",t("disk_space")],["sipAccountLimit",t("Sip Account Limit")],["calllimit",t("calllimit")],["Custom",t("Custom")]]},0,["servicestypecombo"],["component","box","field","textfield","pickerfield","combobox","combo","servicestypecombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,servicestypecombo:true},["widget.servicestypecombo"],0,[MBilling.view.general,"ServicesTypeCombo"],0));(Ext.cmd.derive("MBilling.view.general.TypeSipForward",Ext.form.field.ComboBox,{fieldLabel:t("Forward"),forceSelection:true,editable:false,value:"",store:[["",t("")],["undefined",t("Undefined")],["sip",t("SIP")],["ivr",t("IVR")],["queue",t("Queue")],["group",t("Group")],["number",t("Number")],["hangup",t("Hangup")],["custom",t("Custom")]]},0,["typesipforwardcombo"],["component","box","field","textfield","pickerfield","combobox","combo","typesipforwardcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,typesipforwardcombo:true},["widget.typesipforwardcombo"],0,[MBilling.view.general,"TypeSipForward"],0));(Ext.cmd.derive("MBilling.view.general.TypeDestination",Ext.form.field.ComboBox,{fieldLabel:t("type"),forceSelection:true,editable:false,value:"",store:[["",t("")],["undefined",t("Undefined")],["sip",t("SIP")],["ivr",t("IVR")],["queue",t("Queue")],["group",t("Group")],["number",t("Number")],["repeat",t("Repeat IVR")],["hangup",t("Hangup")],["custom",t("Custom")]]},0,["typedestinationcombo"],["component","box","field","textfield","pickerfield","combobox","combo","typedestinationcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,typedestinationcombo:true},["widget.typedestinationcombo"],0,[MBilling.view.general,"TypeDestination"],0));(Ext.cmd.derive("MBilling.view.general.PontoVirgula",Ext.form.field.ComboBox,{fieldLabel:t("status"),forceSelection:true,editable:false,value:",",store:[[",",", ("+t("Comma")+")"],[";","; ("+t("Semicolon")+")"]]},0,["pontovirgulacombo"],["component","box","field","textfield","pickerfield","combobox","combo","pontovirgulacombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,pontovirgulacombo:true},["widget.pontovirgulacombo"],0,[MBilling.view.general,"PontoVirgula"],0));(Ext.cmd.derive("MBilling.view.general.StatusCombo",Ext.form.field.ComboBox,{fieldLabel:t("status"),forceSelection:true,editable:false,value:1,store:[[1,t("active")],[0,t("inactive")],[2,t("pending")],[3,t("sent")],[4,t("blocked")]]},0,["statuscombo"],["component","box","field","textfield","pickerfield","combobox","combo","statuscombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,statuscombo:true},["widget.statuscombo"],0,[MBilling.view.general,"StatusCombo"],0));(Ext.cmd.derive("MBilling.view.general.StatusUserCombo",Ext.form.field.ComboBox,{fieldLabel:t("status"),forceSelection:true,editable:false,value:1,store:[[1,t("active")],[0,t("inactive")],[2,t("pending")]]},0,["statususercombo"],["component","box","field","textfield","pickerfield","combobox","combo","statususercombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,statususercombo:true},["widget.statususercombo"],0,[MBilling.view.general,"StatusUserCombo"],0));(Ext.cmd.derive("MBilling.view.general.CallbackCombo",Ext.form.field.ComboBox,{fieldLabel:t("status"),forceSelection:true,editable:false,value:1,store:[[1,t("active")],[2,t("pending")],[3,t("sent")],[4,t("Not working")],[5,t("Complete")]]},0,["callbackcombo"],["component","box","field","textfield","pickerfield","combobox","combo","callbackcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,callbackcombo:true},["widget.callbackcombo"],0,[MBilling.view.general,"CallbackCombo"],0));(Ext.cmd.derive("MBilling.view.general.TypeNoYes",Ext.form.field.ComboBox,{fieldLabel:t("typepaid"),forceSelection:true,editable:false,value:0,store:[[0,t("no")],[1,t("yes")]]},0,["noyescombo"],["component","box","field","textfield","pickerfield","combobox","combo","noyescombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,noyescombo:true},["widget.noyescombo"],0,[MBilling.view.general,"TypeNoYes"],0));(Ext.cmd.derive("MBilling.view.general.TypeYesNo",Ext.form.field.ComboBox,{fieldLabel:t("typepaid"),forceSelection:true,editable:false,value:1,store:[[0,t("no")],[1,t("yes")]]},0,["yesnocombo"],["component","box","field","textfield","pickerfield","combobox","combo","yesnocombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,yesnocombo:true},["widget.yesnocombo"],0,[MBilling.view.general,"TypeYesNo"],0));(Ext.cmd.derive("MBilling.view.general.TypeYesNoString",Ext.form.field.ComboBox,{fieldLabel:t("typepaid"),forceSelection:true,editable:false,value:"yes",store:[["no",t("no")],["yes",t("yes")]]},0,["yesnostringcombo"],["component","box","field","textfield","pickerfield","combobox","combo","yesnostringcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,yesnostringcombo:true},["widget.yesnostringcombo"],0,[MBilling.view.general,"TypeYesNoString"],0));(Ext.cmd.derive("MBilling.view.general.TypeNoYesString",Ext.form.field.ComboBox,{fieldLabel:t("typepaid"),forceSelection:true,editable:false,value:"no",store:[["no",t("no")],["yes",t("yes")]]},0,["noyesstringcombo"],["component","box","field","textfield","pickerfield","combobox","combo","noyesstringcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,noyesstringcombo:true},["widget.noyesstringcombo"],0,[MBilling.view.general,"TypeNoYesString"],0));(Ext.cmd.derive("MBilling.view.general.Typenumber",Ext.form.field.ComboBox,{fieldLabel:t("typenumber"),forceSelection:true,editable:false,value:1,store:[[1,1],[2,2],[3,3],[4,4],[5,5]]},0,["numbercombo"],["component","box","field","textfield","pickerfield","combobox","combo","numbercombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,numbercombo:true},["widget.numbercombo"],0,[MBilling.view.general,"Typenumber"],0));(Ext.cmd.derive("MBilling.view.general.Typelanguage",Ext.form.field.ComboBox,{fieldLabel:t("language"),forceSelection:true,editable:false,value:"en",store:[["",t("undefined")],["br",t("portuguese")],["es",t("spanish")],["en",t("english")]]},0,["languagecombo"],["component","box","field","textfield","pickerfield","combobox","combo","languagecombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,languagecombo:true},["widget.languagecombo"],0,[MBilling.view.general,"Typelanguage"],0));(Ext.cmd.derive("MBilling.view.general.TypeCampaign",Ext.form.field.ComboBox,{fieldLabel:t("type"),forceSelection:true,editable:false,value:1,store:[[1,t("voice")],[0,t("sms")]]},0,["campaigntypecombo"],["component","box","field","textfield","pickerfield","combobox","combo","campaigntypecombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,campaigntypecombo:true},["widget.campaigntypecombo"],0,[MBilling.view.general,"TypeCampaign"],0));(Ext.cmd.derive("MBilling.view.general.TypeFullCampaign",Ext.form.field.ComboBox,{fieldLabel:t("type"),forceSelection:true,editable:false,value:1,store:[[1,t("voice")],[0,t("sms")]]},0,["campaigntypefullcombo"],["component","box","field","textfield","pickerfield","combobox","combo","campaigntypefullcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,campaigntypefullcombo:true},["widget.campaigntypefullcombo"],0,[MBilling.view.general,"TypeFullCampaign"],0));(Ext.cmd.derive("MBilling.view.general.TypeBoleto",Ext.form.field.ComboBox,{fieldLabel:t("status"),forceSelection:true,editable:false,value:"D",store:[["D",t("no")],["P",t("yes")]]},0,["boletocombo"],["component","box","field","textfield","pickerfield","combobox","combo","boletocombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,boletocombo:true},["widget.boletocombo"],0,[MBilling.view.general,"TypeBoleto"],0));(Ext.cmd.derive("MBilling.view.general.RestrictionCombo",Ext.form.field.ComboBox,{fieldLabel:t("status"),forceSelection:true,editable:false,value:0,store:[[0,t("inactive")],[1,t("cantCallRestrictedNumbers")],[2,t("canOnlyCallRestrictedNumbers")]]},0,["restrictioncombo"],["component","box","field","textfield","pickerfield","combobox","combo","restrictioncombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,restrictioncombo:true},["widget.restrictioncombo"],0,[MBilling.view.general,"RestrictionCombo"],0));(Ext.cmd.derive("MBilling.view.general.CountryISOCombo",Ext.form.field.ComboBox,{forceSelection:true,editable:true,listeners:{focus:function(b){b.expand()}},store:[["AFG",t("Afghanistan")],["ALA",t("Åland Islands")],["ALB",t("Albania")],["DZA",t("Algeria")],["ASM",t("American Samoa")],["AND",t("Andorra")],["AGO",t("Angola")],["AIA",t("Anguilla")],["ATA",t("Antarctica")],["ATG",t("Antigua and Barbuda")],["ARG",t("Argentina")],["ARM",t("Armenia")],["ABW",t("Aruba")],["AUS",t("Australia")],["AUT",t("Austria")],["AZE",t("Azerbaijan")],["BHS",t("Bahamas")],["BHR",t("Bahrain")],["BGD",t("Bangladesh")],["BRB",t("Barbados")],["BLR",t("Belarus")],["BEL",t("Belgium")],["BLZ",t("Belize")],["BEN",t("Benin")],["BMU",t("Bermuda")],["BTN",t("Bhutan")],["BOL",t("Bolivia, Plurinational State of")],["BES",t("Bonaire, Sint Eustatius and Saba")],["BIH",t("Bosnia and Herzegovina")],["BWA",t("Botswana")],["BVT",t("Bouvet Island")],["BRL",t("Brazil")],["IOT",t("British Indian Ocean Territory")],["BRN",t("Brunei Darussalam")],["BGR",t("Bulgaria")],["BFA",t("Burkina Faso")],["BDI",t("Burundi")],["KHM",t("Cambodia")],["CMR",t("Cameroon")],["CAN",t("Canada")],["CPV",t("Cape Verde")],["CYM",t("Cayman Islands")],["CAF",t("Central African Republic")],["TCD",t("Chad")],["CHL",t("Chile")],["CHN",t("China")],["CXR",t("Christmas Island")],["CCK",t("Cocos (Keeling) Islands")],["COL",t("Colombia")],["COM",t("Comoros")],["COG",t("Congo")],["COD",t("Congo, the Democratic Republic of the")],["COK",t("Cook Islands")],["CRI",t("Costa Rica")],["CIV",t("Côte dIvoire")],["HRV",t("Croatia")],["CUB",t("Cuba")],["CUW",t("Curaçao")],["CYP",t("Cyprus")],["CZE",t("Czech Republic")],["DNK",t("Denmark")],["DJI",t("Djibouti")],["DMA",t("Dominica")],["DOM",t("Dominican Republic")],["ECU",t("Ecuador")],["EGY",t("Egypt")],["SLV",t("El Salvador")],["GNQ",t("Equatorial Guinea")],["ERI",t("Eritrea")],["EST",t("Estonia")],["ETH",t("Ethiopia")],["FLK",t("Falkland Islands (Malvinas)")],["FRO",t("Faroe Islands")],["FJI",t("Fiji")],["FIN",t("Finland")],["FRA",t("France")],["GUF",t("French Guiana")],["PYF",t("French Polynesia")],["ATF",t("French Southern Territories")],["GAB",t("Gabon")],["GMB",t("Gambia")],["GEO",t("Georgia")],["DEU",t("Germany")],["GHA",t("Ghana")],["GIB",t("Gibraltar")],["GRC",t("Greece")],["GRL",t("Greenland")],["GRD",t("Grenada")],["GLP",t("Guadeloupe")],["GUM",t("Guam")],["GTM",t("Guatemala")],["GGY",t("Guernsey")],["GIN",t("Guinea")],["GNB",t("Guinea-Bissau")],["GUY",t("Guyana")],["HTI",t("Haiti")],["HMD",t("Heard Island and McDonald Islands")],["VAT",t("Holy See (Vatican City State)")],["HND",t("Honduras")],["HKG",t("Hong Kong")],["HUN",t("Hungary")],["ISL",t("Iceland")],["IND",t("India")],["IDN",t("Indonesia")],["IRN",t("Iran, Islamic Republic of")],["IRQ",t("Iraq")],["IRL",t("Ireland")],["IMN",t("Isle of Man")],["ISR",t("Israel")],["ITA",t("Italy")],["JAM",t("Jamaica")],["JPN",t("Japan")],["JEY",t("Jersey")],["JOR",t("Jordan")],["KAZ",t("Kazakhstan")],["KEN",t("Kenya")],["KIR",t("Kiribati")],["PRK",t("Korea, Democratic Peoples Republic of")],["KOR",t("Korea, Republic of")],["KWT",t("Kuwait")],["KGZ",t("Kyrgyzstan")],["LAO",t("Lao Peoples Democratic Republic")],["LVA",t("Latvia")],["LBN",t("Lebanon")],["LSO",t("Lesotho")],["LBR",t("Liberia")],["LBY",t("Libya")],["LIE",t("Liechtenstein")],["LTU",t("Lithuania")],["LUX",t("Luxembourg")],["MAC",t("Macao")],["MKD",t("Macedonia, the former Yugoslav Republic of")],["MDG",t("Madagascar")],["MWI",t("Malawi")],["MYS",t("Malaysia")],["MDV",t("Maldives")],["MLI",t("Mali")],["MLT",t("Malta")],["MHL",t("Marshall Islands")],["MTQ",t("Martinique")],["MRT",t("Mauritania")],["MUS",t("Mauritius")],["MYT",t("Mayotte")],["MEX",t("Mexico")],["FSM",t("Micronesia, Federated States of")],["MDA",t("Moldova, Republic of")],["MCO",t("Monaco")],["MNG",t("Mongolia")],["MNE",t("Montenegro")],["MSR",t("Montserrat")],["MAR",t("Morocco")],["MOZ",t("Mozambique")],["MMR",t("Myanmar")],["NAM",t("Namibia")],["NRU",t("Nauru")],["NPL",t("Nepal")],["NLD",t("Netherlands")],["NCL",t("New Caledonia")],["NZL",t("New Zealand")],["NIC",t("Nicaragua")],["NER",t("Niger")],["NGA",t("Nigeria")],["NIU",t("Niue")],["NFK",t("Norfolk Island")],["MNP",t("Northern Mariana Islands")],["NOR",t("Norway")],["OMN",t("Oman")],["PAK",t("Pakistan")],["PLW",t("Palau")],["PSE",t("Palestinian Territory, Occupied")],["PAN",t("Panama")],["PNG",t("Papua New Guinea")],["PRY",t("Paraguay")],["PER",t("Peru")],["PHL",t("Philippines")],["PCN",t("Pitcairn")],["POL",t("Poland")],["PRT",t("Portugal")],["PRI",t("Puerto Rico")],["QAT",t("Qatar")],["REU",t("Réunion")],["ROU",t("Romania")],["RUS",t("Russian Federation")],["RWA",t("Rwanda")],["BLM",t("Saint Barthélemy")],["SHN",t("Saint Helena, Ascension and Tristan da Cunha")],["KNA",t("Saint Kitts and Nevis")],["LCA",t("Saint Lucia")],["MAF",t("Saint Martin (French part)")],["SPM",t("Saint Pierre and Miquelon")],["VCT",t("Saint Vincent and the Grenadines")],["WSM",t("Samoa")],["SMR",t("San Marino")],["STP",t("Sao Tome and Principe")],["SAU",t("Saudi Arabia")],["SEN",t("Senegal")],["SRB",t("Serbia")],["SYC",t("Seychelles")],["SLE",t("Sierra Leone")],["SGP",t("Singapore")],["SXM",t("Sint Maarten (Dutch part)")],["SVK",t("Slovakia")],["SVN",t("Slovenia")],["SLB",t("Solomon Islands")],["SOM",t("Somalia")],["ZAF",t("South Africa")],["SGS",t("South Georgia and the South Sandwich Islands")],["SSD",t("South Sudan")],["ESP",t("Spain")],["LKA",t("Sri Lanka")],["SDN",t("Sudan")],["SUR",t("Suriname")],["SJM",t("Svalbard and Jan Mayen")],["SWZ",t("Swaziland")],["SWE",t("Sweden")],["CHE",t("Switzerland")],["SYR",t("Syrian Arab Republic")],["TWN",t("Taiwan, Province of China")],["TJK",t("Tajikistan")],["TZA",t("Tanzania, United Republic of")],["THA",t("Thailand")],["TLS",t("Timor-Leste")],["TGO",t("Togo")],["TKL",t("Tokelau")],["TON",t("Tonga")],["TTO",t("Trinidad and Tobago")],["TUN",t("Tunisia")],["TUR",t("Turkey")],["TKM",t("Turkmenistan")],["TCA",t("Turks and Caicos Islands")],["TUV",t("Tuvalu")],["UGA",t("Uganda")],["UKR",t("Ukraine")],["ARE",t("United Arab Emirates")],["GBR",t("United Kingdom")],["USA",t("United States")],["UMI",t("United States Minor Outlying Islands")],["URY",t("Uruguay")],["UZB",t("Uzbekistan")],["VUT",t("Vanuatu")],["VEN",t("Venezuela, Bolivarian Republic of")],["VNM",t("Viet Nam")],["VGB",t("Virgin Islands, British")],["VIR",t("Virgin Islands, U.S.")],["WLF",t("Wallis and Futuna")],["ESH",t("Western Sahara")],["YEM",t("Yemen")],["ZMB",t("Zambia")],["ZWE",t("Zimbabwe")]]},0,["countryisocombo"],["component","box","field","textfield","pickerfield","combobox","combo","countryisocombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,countryisocombo:true},["widget.countryisocombo"],0,[MBilling.view.general,"CountryISOCombo"],0));(Ext.cmd.derive("MBilling.view.general.CountryCombo",Ext.form.field.ComboBox,{fieldLabel:t("Country"),forceSelection:true,editable:true,allowBlank:true,listeners:{focus:function(b){b.expand()}},store:[["",t("Select")],["93",t("Afghanistan")],["355",t("Albania")],["213",t("Algeria")],["684",t("American Samoa")],["376",t("Andorra")],["244",t("Angola")],["1264",t("Anguilla")],["672",t("Antarctica")],["1268",t("Antigua And Barbuda")],["54",t("Argentina")],["374",t("Armenia")],["297",t("Aruba")],["61",t("Australia")],["43",t("Austria")],["994",t("Azerbaijan")],["1242",t("Bahamas")],["973",t("Bahrain")],["880",t("Bangladesh")],["1246",t("Barbados")],["375",t("Belarus")],["32",t("Belgium")],["501",t("Belize")],["229",t("Benin")],["1441",t("Bermuda")],["975",t("Bhutan")],["591",t("Bolivia")],["387",t("Bosnia And Herzegovina")],["267",t("Botswana")],["55",t("Brazil")],["1284",t("British Indian Ocean Territory")],["673",t("Brunei Darussalam")],["359",t("Bulgaria")],["226",t("Burkina Faso")],["257",t("Burundi")],["855",t("Cambodia")],["237",t("Cameroon")],["238",t("Cape Verde")],["1345",t("Cayman Islands")],["236",t("Central African Republic")],["235",t("Chad")],["56",t("Chile")],["86",t("China")],["618",t("Christmas Island")],["61",t("Cocos (Keeling); Islands")],["57",t("Colombia")],["269",t("Comoros")],["242",t("Congo")],["243",t("Congo, The Democratic Republic Of The")],["682",t("Cook Islands")],["506",t("Costa Rica")],["385",t("Croatia")],["53",t("Cuba")],["357",t("Cyprus")],["420",t("Czech Republic")],["45",t("Denmark")],["253",t("Djibouti")],["1767",t("Dominica")],["1809",t("Dominican Republic")],["593",t("Ecuador")],["20",t("Egypt")],["503",t("El Salvador")],["240",t("Equatorial Guinea")],["291",t("Eritrea")],["372",t("Estonia")],["251",t("Ethiopia")],["500",t("Falkland Islands (Malvinas)")],["298",t("Faroe Islands")],["679",t("Fiji")],["358",t("Finland")],["33",t("France")],["596",t("French Guiana")],["594",t("French Polynesia")],["689",t("French Southern Territories")],["241",t("Gabon")],["220",t("Gambia")],["995",t("Georgia")],["49",t("Germany")],["233",t("Ghana")],["350",t("Gibraltar")],["30",t("Greece")],["299",t("Greenland")],["1473",t("Grenada")],["590",t("Guadeloupe")],["1671",t("Guam")],["502",t("Guatemala")],["224",t("Guinea")],["245",t("Guinea-Bissau")],["592",t("Guyana")],["509",t("Haiti")],["504",t("Honduras")],["852",t("Hong Kong")],["36",t("Hungary")],["354",t("Iceland")],["91",t("India")],["62",t("Indonesia")],["98",t("Iran, Islamic Republic Of")],["964",t("Iraq")],["353",t("Ireland")],["972",t("Israel")],["39",t("Italy")],["1876",t("Jamaica")],["81",t("Japan")],["962",t("Jordan")],["7",t("Kazakhstan")],["254",t("Kenya")],["686",t("Kiribati")],["850",t("Korea, Democratic Peoples Republic Of")],["82",t("Korea, Republic of")],["965",t("Kuwait")],["996",t("Kyrgyzstan")],["856",t("Lao Peoples Democratic Republic")],["371",t("Latvia")],["961",t("Lebanon")],["266",t("Lesotho")],["231",t("Liberia")],["218",t("Libyan Arab Jamahiriya")],["423",t("Liechtenstein")],["370",t("Lithuania")],["352",t("Luxembourg")],["853",t("Macao")],["389",t("Macedonia, The Former Yugoslav Republic Of")],["261",t("Madagascar")],["265",t("Malawi")],["60",t("Malaysia")],["960",t("Maldives")],["223",t("Mali")],["356",t("Malta")],["692",t("Marshall islands")],["596",t("Martinique")],["222",t("Mauritania")],["230",t("Mauritius")],["269",t("Mayotte")],["52",t("Mexico")],["691",t("Micronesia, Federated States Of")],["1808",t("Moldova, Republic Of")],["377",t("Monaco")],["976",t("Mongolia")],["1664",t("Montserrat")],["212",t("Morocco")],["258",t("Mozambique")],["95",t("Myanmar")],["264",t("Namibia")],["674",t("Nauru")],["977",t("Nepal")],["31",t("Netherlands")],["599",t("Netherlands Antilles")],["687",t("New Caledonia")],["64",t("New Zealand")],["505",t("Nicaragua")],["227",t("Niger")],["234",t("Nigeria")],["683",t("Niue")],["672",t("Norfolk Island")],["1670",t("Northern Mariana Islands")],["47",t("Norway")],["968",t("Oman")],["92",t("Pakistan")],["680",t("Palau")],["970",t("Palestinian Territory, Occupied")],["507",t("Panama")],["675",t("Papua New Guinea")],["595",t("Paraguay")],["51",t("Peru")],["63",t("Philippines")],["48",t("Poland")],["351",t("Portugal")],["1787",t("Puerto Rico")],["974",t("Qatar")],["262",t("Reunion")],["40",t("Romania")],["7",t("Russian Federation")],["250",t("Rwanda")],["290",t("SaINT Helena")],["1869",t("SaINT Kitts And Nevis")],["1758",t("SaINT Lucia")],["508",t("SaINT Pierre And Miquelon")],["1784",t("SaINT Vincent And The Grenadines")],["685",t("Samoa")],["378",t("San Marino")],["239",t("São Tomé And Principe")],["966",t("Saudi Arabia")],["221",t("Senegal")],["248",t("Seychelles")],["232",t("Sierra Leone")],["65",t("Singapore")],["421",t("Slovakia")],["386",t("Slovenia")],["677",t("Solomon Islands")],["252",t("Somalia")],["27",t("South Africa")],["34",t("Spain")],["94",t("Sri Lanka")],["249",t("Sudan")],["597",t("Suriname")],["268",t("Swaziland")],["46",t("Sweden")],["41",t("Switzerland")],["963",t("Syrian Arab Republic")],["886",t("Taiwan, Province Of China")],["992",t("Tajikistan")],["255",t("Tanzania, United Republic Of")],["66",t("Thailand")],["670",t("Timor-Leste")],["228",t("Togo")],["690",t("Tokelau")],["676",t("Tonga")],["1868",t("Trinidad And Tobago")],["216",t("Tunisia")],["90",t("Turkey")],["993",t("Turkmenistan")],["1649",t("Turks And Caicos Islands")],["688",t("Tuvalu")],["256",t("Uganda")],["380",t("Ukraine")],["971",t("United Arab Emirates")],["44",t("United Kingdom")],["1",t("United States/Canada")],["598",t("Uruguay")],["998",t("Uzbekistan")],["678",t("Vanuatu")],["58",t("Venezuela")],["84",t("Vietnam")],["1284",t("Virgin Islands, British")],["808",t("Virgin Islands, U.S.")],["681",t("Wallis And Futuna")],["967",t("Yemen")],["260",t("Zambia")],["263",t("Zimbabwe")],["35818",t("Aland Islands")],["441481",t("Guernsey")],["441624",t("Isle of Man")],["441534",t("Jersey")],["382",t("Montenegro, Republic of")],["381",t("Serbia, Republic of")]]},0,["countrycombo"],["component","box","field","textfield","pickerfield","combobox","combo","countrycombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,countrycombo:true},["widget.countrycombo"],0,[MBilling.view.general,"CountryCombo"],0));(Ext.cmd.derive("MBilling.view.general.GroupCombo",Ext.form.field.ComboBox,{fieldLabel:t("group"),value:"config_group_title",forceSelection:true,editable:false,store:[["global","global"],["callback","callback"],["agi-conf1","agi-conf1"],["agi-conf2","agi-conf2"]]},0,["groupcombo"],["component","box","field","textfield","pickerfield","combobox","combo","groupcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,groupcombo:true},["widget.groupcombo"],0,[MBilling.view.general,"GroupCombo"],0));(Ext.cmd.derive("MBilling.view.general.LcrtypeCombo",Ext.form.field.ComboBox,{fieldLabel:t("lcrtype"),forceSelection:true,editable:false,value:1,store:[[1,t("LCRAccordingtothebuyerPrice")],[0,t("LCRAccordingtothesellerPrice")]]},0,["lcrtypecombo"],["component","box","field","textfield","pickerfield","combobox","combo","lcrtypecombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,lcrtypecombo:true},["widget.lcrtypecombo"],0,[MBilling.view.general,"LcrtypeCombo"],0));(Ext.cmd.derive("MBilling.view.general.LcrtypeFullCombo",Ext.form.field.ComboBox,{forceSelection:true,editable:false,fieldLabel:t("lcrtype"),value:1,store:[[1,t("LCRAccordingtothebuyerPrice")],[0,t("LCRAccordingtothesellerPrice")],[2,t("Load Balancer")]]},0,["lcrtypefullcombo"],["component","box","field","textfield","pickerfield","combobox","combo","lcrtypefullcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,lcrtypefullcombo:true},["widget.lcrtypefullcombo"],0,[MBilling.view.general,"LcrtypeFullCombo"],0));(Ext.cmd.derive("MBilling.view.general.OfferTypeCombo",Ext.form.field.ComboBox,{fieldLabel:t("offertype"),forceSelection:true,editable:false,value:0,store:[[0,t("unlimitedcalls")],[1,t("numberfreecalls")],[2,t("freeseconds")]]},0,["offertypecombo"],["component","box","field","textfield","pickerfield","combobox","combo","offertypecombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,offertypecombo:true},["widget.offertypecombo"],0,[MBilling.view.general,"OfferTypeCombo"],0));(Ext.cmd.derive("MBilling.view.general.BillingTypeCombo",Ext.form.field.ComboBox,{fieldLabel:t("billingtype"),forceSelection:true,editable:false,value:0,store:[[0,t("monthly")],[1,t("weekly")]]},0,["billingtypecombo"],["component","box","field","textfield","pickerfield","combobox","combo","billingtypecombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,billingtypecombo:true},["widget.billingtypecombo"],0,[MBilling.view.general,"BillingTypeCombo"],0));(Ext.cmd.derive("MBilling.view.general.SipCombo",Ext.form.field.ComboBox,{fieldLabel:t("providertech"),forceSelection:true,editable:false,value:"sip",store:[["sip","sip"],["dahdi","dahdi"],["khomp","khomp"],["iax2","iax2"],["dgv","dgv"],["ooh323","ooh323"],["extra","extra"],["Dongle","Dongle"],["Local","Local"]]},0,["sipcombo"],["component","box","field","textfield","pickerfield","combobox","combo","sipcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,sipcombo:true},["widget.sipcombo"],0,[MBilling.view.general,"SipCombo"],0));(Ext.cmd.derive("MBilling.view.general.TypePaymentCombo",Ext.form.field.ComboBox,{fieldLabel:t("typepaid"),forceSelection:true,editable:false,value:0,store:[[0,t("prepaid")],[1,t("pospaid")]]},0,["typepaymentcombo"],["component","box","field","textfield","pickerfield","combobox","combo","typepaymentcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,typepaymentcombo:true},["widget.typepaymentcombo"],0,[MBilling.view.general,"TypePaymentCombo"],0));(Ext.cmd.derive("MBilling.view.general.CampaignSendCombo",Ext.form.field.ComboBox,{fieldLabel:t("type"),forceSelection:true,editable:false,displayField:"name",valueField:"id",value:"CALL1",store:{fields:["id","name"],data:[{id:"CALL1",name:t("Select type"),showFields:["type"]},{id:"SMS",name:"SMS",showFields:["type","sms_text","csv_path","numbers","startingdate","startingtime"]},{id:"CALL",name:"CALL",showFields:["type","audio_path","csv_path","numbers","startingdate","startingtime"]}]}},0,["campaignsendcombo"],["component","box","field","textfield","pickerfield","combobox","combo","campaignsendcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,campaignsendcombo:true},["widget.campaignsendcombo"],0,[MBilling.view.general,"CampaignSendCombo"],0));(Ext.cmd.derive("MBilling.view.general.PaymentCountryCombo",Ext.form.field.ComboBox,{fieldLabel:t("typepaid"),value:"Brasil",forceSelection:true,editable:true,listeners:{focus:function(b){b.expand()}},store:[["Argentina","Argentina"],["Brasil","Brasil"],["Colombia","Colombia"],["Latino America","Latino America"],["Global","Global"]]},0,["paymentcountrycombo"],["component","box","field","textfield","pickerfield","combobox","combo","paymentcountrycombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,paymentcountrycombo:true},["widget.paymentcountrycombo"],0,[MBilling.view.general,"PaymentCountryCombo"],0));(Ext.cmd.derive("MBilling.view.general.BoletoBanckCombo",Ext.form.field.ComboBox,{fieldLabel:t("Banco"),forceSelection:true,editable:false,value:"cef",store:[["cef","Caixa Economica SICOB"],["bradesco","Bradesco"]]},0,["boletobanckcombo"],["component","box","field","textfield","pickerfield","combobox","combo","boletobanckcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,boletobanckcombo:true},["widget.boletobanckcombo"],0,[MBilling.view.general,"BoletoBanckCombo"],0));(Ext.cmd.derive("MBilling.view.general.PaymentBanckCombo",Ext.form.field.ComboBox,{fieldLabel:t("typepaid"),forceSelection:true,editable:false,value:"Banco do Brasil",store:[["Banco do Brasil","Banco do Brasil"],["bradesco","Bradesco"],["hsbc","Hsbc"],["itau","Itau"],["santander","Santander"],["unibanco","Unibanco"],["cef","Caixa Economica SICOB"],["cef_sinco","Caixa Economica SINCO"],["cef_sigcb","Caixa Economica SIGCB"]]},0,["paymentbanckcombo"],["component","box","field","textfield","pickerfield","combobox","combo","paymentbanckcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,paymentbanckcombo:true},["widget.paymentbanckcombo"],0,[MBilling.view.general,"PaymentBanckCombo"],0));(Ext.cmd.derive("MBilling.view.templateMail.Controller",Ext.ux.app.ViewController,{onAfterSave:function(d){var c=this;d=d||c.formPanel;if(!d.idRecord){d.getForm().reset();c.focusFirstField()}c.saveButton.enable();c.updateLotButton&&c.updateLotButton.toggle(false);d.setLoading(false);c.store.load()},onEdit:function(){var b=this;b.lookupReference("generalTab").show();Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)}},0,0,0,0,["controller.templatemail"],0,[MBilling.view.templateMail,"Controller"],0));(Ext.cmd.derive("MBilling.view.templateMail.Module",Ext.ux.panel.Module,{controller:"templatemail",cfgEast:{flex:9}},0,["templatemailmodule"],["component","box","container","uxpanelmodule","templatemailmodule"],{component:true,box:true,container:true,uxpanelmodule:true,templatemailmodule:true},["widget.templatemailmodule"],0,[MBilling.view.templateMail,"Module"],0));(Ext.cmd.derive("MBilling.view.templateMail.List",Ext.ux.grid.Panel,{store:"TemplateMail",initComponent:function(){var b=this;b.allowPrint=false;b.buttonCsv=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowDelete=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("type"),dataIndex:"mailtype",flex:3},{header:t("Language"),renderer:Helper.Util.formatLanguageImage,dataIndex:"language",flex:2},{header:t("subject"),dataIndex:"subject",flex:7}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["templatemaillist"],["component","box","container","panel","tablepanel","gridpanel","grid","templatemaillist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,templatemaillist:true},["widget.templatemaillist"],0,[MBilling.view.templateMail,"List"],0));(Ext.cmd.derive("MBilling.view.templateMail.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true}},items:[{title:t("general"),reference:"generalTab",items:[{name:"fromname",fieldLabel:t("fromname")},{name:"fromemail",fieldLabel:t("fromemail")},{name:"subject",fieldLabel:t("subject")}]},{title:t("Email body"),items:[{hideLabel:true,xtype:"htmleditor",name:"messagehtml",fieldLabel:t("description"),height:1000,anchor:"100%"}]},{title:t("Variables"),items:[{xtype:"displayfield",fieldLabel:t("username"),value:'$login$',allowBlank:true},{xtype:"displayfield",fieldLabel:t("password"),value:'$password$',allowBlank:true},{xtype:"displayfield",fieldLabel:t("email"),value:'$email$',allowBlank:true},{xtype:"displayfield",fieldLabel:t("firstname"),value:'$firstname$',allowBlank:true},{xtype:"displayfield",fieldLabel:t("lastname"),value:'$lastname$',allowBlank:true},{xtype:"displayfield",fieldLabel:t("credit"),value:'$credit$',allowBlank:true},{xtype:"displayfield",fieldLabel:t("date"),value:'$time$',allowBlank:true},{xtype:"displayfield",fieldLabel:t("description"),value:'$description$',allowBlank:true},{xtype:"displayfield",fieldLabel:t("Url to cancel email credit notification"),value:'$cancel_credit_notification_email$',allowBlank:true}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["templatemailform"],["component","box","container","panel","form","templatemailform"],{component:true,box:true,container:true,panel:true,form:true,templatemailform:true},["widget.templatemailform"],0,[MBilling.view.templateMail,"Form"],0));(Ext.cmd.derive("MBilling.view.logUsers.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.logusers"],0,[MBilling.view.logUsers,"Controller"],0));(Ext.cmd.derive("MBilling.view.logUsers.Module",Ext.ux.panel.Module,{controller:"logusers"},0,["logusersmodule"],["component","box","container","uxpanelmodule","logusersmodule"],{component:true,box:true,container:true,uxpanelmodule:true,logusersmodule:true},["widget.logusersmodule"],0,[MBilling.view.logUsers,"Module"],0));(Ext.cmd.derive("MBilling.view.logUsers.List",Ext.ux.grid.Panel,{store:"LogUsers",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.allowDelete=false;b.allowCreate=false;b.allowUpdate=false;b.columns=[{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isOperator,hideable:!App.user.isOperator},{header:t("action"),dataIndex:"idLogActionsname",renderer:Helper.Util.translate,flex:3},{header:t("description"),dataIndex:"description",flex:7},{header:t("IP"),dataIndex:"ip",flex:4},{header:t("date"),renderer:Helper.Util.formatDateTime,dataIndex:"date",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["loguserslist"],["component","box","container","panel","tablepanel","gridpanel","grid","loguserslist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,loguserslist:true},["widget.loguserslist"],0,[MBilling.view.logUsers,"List"],0));(Ext.cmd.derive("MBilling.view.logUsers.Form",Ext.ux.form.Panel,{fieldsHideEdit:["cid"],initComponent:function(){var b=this;b.items=[{xtype:"usercombo",allowBlank:true,readOnly:true},{name:"id_log_actions",fieldLabel:t("action"),readOnly:true},{name:"ip",fieldLabel:t("ip"),readOnly:true},{xtype:"textareafield",name:"description",fieldLabel:t("description"),height:400,anchor:"100%",allowBlank:true,readOnly:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["logusersform"],["component","box","container","panel","form","logusersform"],{component:true,box:true,container:true,panel:true,form:true,logusersform:true},["widget.logusersform"],0,[MBilling.view.logUsers,"Form"],0));(Ext.cmd.derive("MBilling.view.provider.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.provider"],0,[MBilling.view.provider,"Controller"],0));(Ext.cmd.derive("MBilling.view.provider.Combo",Ext.form.field.ComboBox,{name:"id_provider",fieldLabel:t("provider"),forceSelection:true,editable:false,displayField:"provider_name",valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Provider",{proxy:{type:"uxproxy",module:"provider",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["providercombo"],["component","box","field","textfield","pickerfield","combobox","combo","providercombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,providercombo:true},["widget.providercombo"],0,[MBilling.view.provider,"Combo"],0));(Ext.cmd.derive("MBilling.view.provider.Module",Ext.ux.panel.Module,{controller:"provider"},0,["providermodule"],["component","box","container","uxpanelmodule","providermodule"],{component:true,box:true,container:true,uxpanelmodule:true,providermodule:true},["widget.providermodule"],0,[MBilling.view.provider,"Module"],0));(Ext.cmd.derive("MBilling.view.provider.List",Ext.ux.grid.Panel,{store:"Provider",initComponent:function(){var b=this;b.columns=b.columns||[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("name"),dataIndex:"provider_name"},{header:t("description"),dataIndex:"description"},{header:t("credit"),dataIndex:"credit",renderer:Helper.Util.formatMoneyDecimal},{header:t("creationdate"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"creationdate"}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["providerlist"],["component","box","container","panel","tablepanel","gridpanel","grid","providerlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,providerlist:true},["widget.providerlist"],0,[MBilling.view.provider,"List"],0));(Ext.cmd.derive("MBilling.view.provider.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["provider_name"],initComponent:function(){var b=this;b.items=[{name:"provider_name",fieldLabel:t("name")},{xtype:"moneyfield",name:"credit",mask:App.user.currency+" #9.999.990,00",fieldLabel:t("credit"),value:"0"},{xtype:"noyescombo",name:"credit_control",fieldLabel:t("Credit")+" "+t("control"),hidden:App.user.isClient},{xtype:"textareafield",name:"description",fieldLabel:t("description"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["providerform"],["component","box","container","panel","form","providerform"],{component:true,box:true,container:true,panel:true,form:true,providerform:true},["widget.providerform"],0,[MBilling.view.provider,"Form"],0));(Ext.cmd.derive("MBilling.view.provider.Lookup",Ext.ux.form.field.Lookup,{name:"id_provider",fieldLabel:t("Provider"),displayField:"idProviderprovider_name",displayFieldList:"provider_name",gridConfig:{xtype:"providerlist",fieldSearch:"username",columns:[{header:t("name"),dataIndex:"provider_name"},{header:t("description"),dataIndex:"description"}]}},0,["providerlookup"],["component","box","container","fieldcontainer","providerlookup"],{component:true,box:true,container:true,fieldcontainer:true,providerlookup:true},["widget.providerlookup"],0,[MBilling.view.provider,"Lookup"],0));(Ext.cmd.derive("MBilling.view.plan.Controller",Ext.ux.app.ViewController,{init:function(){var b=this;b.control({noyescombo:{select:b.onSelectType}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectType:function(c,d){this.showFieldsRelated(d.getData().showFields)},showFieldsRelated:function(j){var l=this,g=l.formPanel.getForm().getFields(),f=l.formPanel.getForm().findField("ini_credit"),m=l.formPanel.getForm();g.each(function(a){if(a.name=="signup"){a.value==1?f.show():f.hide()}})},onEdit:function(){var f=this,d=f.formPanel.getForm().findField("ini_credit"),e=f.formPanel.getForm().findField("signup");Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments);e.value==1?d.show():d.hide()}},0,0,0,0,["controller.plan"],0,[MBilling.view.plan,"Controller"],0));(Ext.cmd.derive("MBilling.view.plan.Combo",Ext.form.field.ComboBox,{name:"id_plan",fieldLabel:t("plan"),displayField:"name",valueField:"id",forceSelection:true,editable:true,listeners:{focus:function(b){b.expand()}},initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Plan",{proxy:{type:"uxproxy",module:"plan",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["plancombo"],["component","box","field","textfield","pickerfield","combobox","combo","plancombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,plancombo:true},["widget.plancombo"],0,[MBilling.view.plan,"Combo"],0));(Ext.cmd.derive("MBilling.view.plan.Module",Ext.ux.panel.Module,{controller:"plan"},0,["planmodule"],["component","box","container","uxpanelmodule","planmodule"],{component:true,box:true,container:true,uxpanelmodule:true,planmodule:true},["widget.planmodule"],0,[MBilling.view.plan,"Module"],0));(Ext.cmd.derive("MBilling.view.plan.List",Ext.ux.grid.Panel,{store:"Plan",fieldSearch:"name",initComponent:function(){var b=this;b.columns=b.columns||[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("name"),dataIndex:"name",flex:4},{header:t("lcrtype"),dataIndex:"lcrtype",comboRelated:"lcrtypecombo",renderer:Helper.Util.formatLcrtype,flex:4,filter:{type:"list",options:[[1,t("LCRAccordingtothebuyerPrice")],[0,t("LCRAccordingtothesellerPrice")],[2,t("Load Balancer")]]}},{header:t("Tech Prefx"),dataIndex:"techprefix",flex:4,hidden:!App.user.isAdmin},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"creationdate",flex:4},{header:t("Port. Celular"),dataIndex:"portabilidadeMobile",flex:2,renderer:Helper.Util.formattyyesno,filter:{type:"list",options:[[0,t("no")],[1,t("yes")]]},hidden:App.user.language!="pt_BR",hideable:false},{header:t("Port. Fixo"),dataIndex:"portabilidadeFixed",flex:2,renderer:Helper.Util.formattyyesno,filter:{type:"list",options:[[0,t("no")],[1,t("yes")]]},hidden:App.user.language!="pt_BR",hideable:false}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["planlist"],["component","box","container","panel","tablepanel","gridpanel","grid","planlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,planlist:true},["widget.planlist"],0,[MBilling.view.plan,"List"],0));(Ext.cmd.derive("MBilling.view.plan.Form",Ext.ux.form.Panel,{labelWidthFields:115,fieldsHideUpdateLot:["name"],initComponent:function(){var b=this;b.defaults={labelWidth:142};b.items=[{name:"name",fieldLabel:t("name"),maxLength:100},{xtype:"lcrtypefullcombo",name:"lcrtype",fieldLabel:t("lcrtype"),allowBlank:true},{xtype:"numberfield",name:"tariff_limit",minValue:1,value:1,fieldLabel:t("Tariff Find Limit"),hidden:!App.user.isAdmin},{xtype:"noyescombo",name:"signup",fieldLabel:t("useInSignup"),allowBlank:true},{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,00",name:"ini_credit",fieldLabel:t("Initial Credit to new users"),allowBlank:true,hidden:true,value:0},{xtype:"yesnocombo",name:"play_audio",fieldLabel:t("Notices with audio"),allowBlank:true,hidden:App.user.isClient},{style:"margin-top:25px",xtype:"fieldset",title:t("Ativar portabilidade?"),collapsible:true,collapsed:false,hidden:App.user.language!="pt_BR",defaults:{labelWidth:190,anchor:"100%",layout:{type:"hbox",labelAlign:b.labelAlignFields}},items:[{xtype:"noyescombo",name:"portabilidadeMobile",fieldLabel:t("Para Celular"),allowBlank:true,hidden:App.user.language!="pt_BR"},{xtype:"noyescombo",name:"portabilidadeFixed",fieldLabel:t("Para Fixo"),allowBlank:true,hidden:App.user.language!="pt_BR"}]},{name:"techprefix",fieldLabel:t("Tech Prefix"),allowBlank:true,maxLength:5,minLength:5,hidden:!App.user.isAdmin},{style:"margin-top:25px",xtype:"fieldset",title:t("Select one or more Services"),collapsible:true,collapsed:false,items:[{anchor:"100%",fieldLabel:"",xtype:"servicestag",allowBlank:true}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["planform"],["component","box","container","panel","form","planform"],{component:true,box:true,container:true,panel:true,form:true,planform:true},["widget.planform"],0,[MBilling.view.plan,"Form"],0));(Ext.cmd.derive("MBilling.view.plan.Tag",Ext.form.field.Tag,{name:"id_plan",fieldLabel:t("plan"),displayField:"name",valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Plan",{proxy:{type:"uxproxy",module:"plan",limitParam:undefined}});Ext.form.field.Tag.prototype.initComponent.apply(this,arguments)}},0,["plantag"],["component","box","field","textfield","pickerfield","combobox","combo","tagfield","plantag"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,tagfield:true,plantag:true},["widget.plantag"],0,[MBilling.view.plan,"Tag"],0));(Ext.cmd.derive("MBilling.view.plan.Lookup",Ext.ux.form.field.Lookup,{name:"id_plan",fieldLabel:t("Plan"),displayField:"idPlanname",displayFieldList:"name",gridConfig:{xtype:"planlist",fieldSearch:"name",columns:[{header:t("name"),dataIndex:"name",flex:2}]}},0,["planlookup"],["component","box","container","fieldcontainer","planlookup"],{component:true,box:true,container:true,fieldcontainer:true,planlookup:true},["widget.planlookup"],0,[MBilling.view.plan,"Lookup"],0));(Ext.cmd.derive("MBilling.view.trunk.Controller",Ext.ux.app.ViewController,{onEdit:function(){var f=this,e=f.list.getSelectionModel().getSelection()[0],d=f.formPanel.getForm().findField("register");if(e.get("register")==1){if(e.get("register")&&e.get("providertech")=="sip"){color=e.get("registered")==1?"green":"red";d.setFieldLabel(t("registertrunk")+' ')}else{d.setFieldLabel(t("registertrunk"))}f.formPanel.getForm().findField("register_string")["show"]()}else{d.setFieldLabel(t("registertrunk"));f.formPanel.getForm().findField("register_string")["hide"]()}Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments);valueAllow=f.formPanel.idRecord?e.get("allow").split(","):["g729","gsm","alaw","ulaw"];fieldAllow=f.formPanel.down("checkboxgroup");fieldAllow.setValue({allow:valueAllow})},init:function(){var b=this;b.control({"noyescombo[name=register]":{select:b.onSelectType}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectType:function(c,d){this.showFieldsRelated(d.getData().showFields)},showFieldsRelated:function(o){var p=this,m=p.formPanel.getForm().findField("register_string"),n=p.formPanel.getForm().findField("user"),q=p.formPanel.getForm().findField("secret"),j=p.formPanel.getForm().findField("host"),l=p.formPanel.getForm().getFields();l.each(function(a){if(a.name=="register"){m.setVisible(a.value==1);m.setValue(n.value+":"+q.value+"@"+j.value+"/"+n.value)}})}},0,0,0,0,["controller.trunk"],0,[MBilling.view.trunk,"Controller"],0));(Ext.cmd.derive("MBilling.view.trunk.Combo",Ext.form.field.ComboBox,{name:"id_trunk",fieldLabel:t("trunk"),forceSelection:true,editable:true,listeners:{focus:function(b){b.expand()}},displayField:"trunkcode",valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Trunk",{proxy:{type:"uxproxy",module:"trunk",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["trunkcombo"],["component","box","field","textfield","pickerfield","combobox","combo","trunkcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,trunkcombo:true},["widget.trunkcombo"],0,[MBilling.view.trunk,"Combo"],0));(Ext.cmd.derive("MBilling.view.trunk.ComboBackup",Ext.form.field.ComboBox,{name:"failover_trunk",fieldLabel:t("failover_trunk"),displayField:"trunkcode",valueField:"id",value:0,limitParam:undefined,forceSelection:true,editable:true,extraValues:[{id:0,trunkcode:t("undefined")}],listeners:{focus:function(b){b.expand()}},initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Trunk",{proxy:{type:"uxproxy",module:"trunk",limitParam:undefined}});b.on("render",b.loadStore,b);Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)},loadStore:function(g){var j=this,e=g.store,f;e.load({callback:function(){if(j.extraValues.length){e.insert(0,j.extraValues)}}})}},0,["trunkcombobackup"],["component","box","field","textfield","pickerfield","combobox","combo","trunkcombobackup"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,trunkcombobackup:true},["widget.trunkcombobackup"],0,[MBilling.view.trunk,"ComboBackup"],0));(Ext.cmd.derive("MBilling.view.trunk.Module",Ext.ux.panel.Module,{controller:"trunk"},0,["trunkmodule"],["component","box","container","uxpanelmodule","trunkmodule"],{component:true,box:true,container:true,uxpanelmodule:true,trunkmodule:true},["widget.trunkmodule"],0,[MBilling.view.trunk,"Module"],0));(Ext.cmd.derive("MBilling.view.trunk.List",Ext.ux.grid.Panel,{store:"Trunk",fieldSearch:"trunkcode",initComponent:function(){var b=this;b.columns=b.columns||[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("trunkcode"),dataIndex:"trunkcode",flex:3},{header:t("add")+" "+t("prefix"),dataIndex:"trunkprefix",flex:2},{header:t("remove")+" "+t("prefix"),dataIndex:"removeprefix",flex:2},{header:t("host"),dataIndex:"host",flex:2},{xtype:"templatecolumn",tpl:"{idProviderprovider_name}",header:t("provider"),dataIndex:"id_provider",comboFilter:"providercombo",flex:2},{header:t("secondusedreal"),renderer:Helper.Util.formatsecondsToTime,dataIndex:"secondusedreal",flex:3},{header:t("status"),dataIndex:"status",renderer:Helper.Util.formatBooleanActive,comboFilter:"booleancombo",flex:1,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")]]}},{header:t("creationdate"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"creationdate",flex:3}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["trunklist"],["component","box","container","panel","tablepanel","gridpanel","grid","trunklist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,trunklist:true},["widget.trunklist"],0,[MBilling.view.trunk,"List"],0));(Ext.cmd.derive("MBilling.view.trunk.Form",Ext.ux.form.Panel,{autoHeight:300,bodyPadding:0,fieldsHideUpdateLot:["trunkcode"],initComponent:function(){var b=this;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{labelAlign:"right",plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true,labelWidth:142}},items:[{title:t("general"),items:[{xtype:"providerlookup",ownerForm:b},{name:"trunkcode",fieldLabel:t("trunkcode")},{name:"user",fieldLabel:t("user"),allowBlank:true},{name:"secret",fieldLabel:t("password"),allowBlank:true},{name:"host",fieldLabel:t("host")},{name:"trunkprefix",fieldLabel:t("add")+" "+t("prefix"),allowBlank:true},{name:"removeprefix",fieldLabel:t("remove")+" "+t("prefix"),allowBlank:true},{xtype:"checkboxgroup",columns:3,name:"allow",fieldLabel:t("codec"),items:[{boxLabel:"g729",name:"allow",inputValue:"g729",checked:true},{boxLabel:"g723",name:"allow",inputValue:"g723"},{boxLabel:"gsm",name:"allow",inputValue:"gsm",checked:true},{boxLabel:"g726",name:"allow",inputValue:"g726"},{boxLabel:"opus",name:"allow",inputValue:"opus",checked:true},{boxLabel:"alaw",name:"allow",inputValue:"alaw",checked:true},{boxLabel:"ulaw",name:"allow",inputValue:"ulaw",checked:true},{boxLabel:"g722",name:"allow",inputValue:"g722"},{boxLabel:"ilbc",name:"allow",inputValue:"ilbc"},{boxLabel:"speex",name:"allow",inputValue:"speex"},{boxLabel:"h261",name:"allow",inputValue:"h261"},{boxLabel:"h263",name:"allow",inputValue:"h263"}],allowBlank:true},{xtype:"sipcombo",name:"providertech",fieldLabel:t("providertech")},{xtype:"trunkcombobackup",allowBlank:true},{xtype:"booleancombo",name:"status",fieldLabel:t("status")},{xtype:"noyescombo",name:"allow_error",fieldLabel:t("allow_error")},{xtype:"noyescombo",name:"register",fieldLabel:t("registertrunk")},{name:"register_string",fieldLabel:t("Register String"),allowBlank:true,hidden:true}]},{title:t("suplementaryInfo"),defaults:{labelAlign:"right",plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true,labelWidth:142},items:[{name:"fromuser",fieldLabel:"fromuser",allowBlank:true},{name:"fromdomain",fieldLabel:"Fromdomain",allowBlank:true},{name:"language",fieldLabel:t("language"),allowBlank:true},{name:"context",fieldLabel:t("context"),allowBlank:true,value:"billing"},{name:"dtmfmode",fieldLabel:"dtmfmode",allowBlank:true,value:"RFC2833"},{name:"insecure",fieldLabel:"insecure",allowBlank:true,value:"port,invite"},{xtype:"numberfield",name:"maxuse",fieldLabel:t("maxuse"),allowBlank:true,value:-1,minValue:-1},{name:"nat",fieldLabel:"nat",value:App.user.asteriskVersion=="1.8"?"yes":"force_rport,comedia",allowBlank:true},{name:"directmedia",allowBlank:true,value:"no",fieldLabel:"directmedia"},{name:"qualify",fieldLabel:"qualify",allowBlank:true,value:"yes"},{name:"type",fieldLabel:"type",allowBlank:true,value:"peer"},{name:"disallow",fieldLabel:"disallow",allowBlank:true,value:"all"},{name:"sendrpid",fieldLabel:"sendrpid",allowBlank:true,value:"no"},{name:"addparameter",fieldLabel:t("addparameter"),allowBlank:true,emptyText:t("parameterdial")},{xtype:"textarea",name:"link_sms",fieldLabel:t("link_sms"),allowBlank:true,emptyText:t("linksmsobs"),height:100,anchor:"100%"},{name:"sms_res",fieldLabel:t("sms_res"),allowBlank:true},{xtype:"numberfield",name:"port",fieldLabel:t("Port"),value:"5060",readOnly:!App.user.isAdmin,hidden:App.user.isClient,allowBlank:App.user.isClient},{xtype:"combobox",name:"encryption",value:"no",store:[["no","No"],["yes","yes"]],fieldLabel:t("Encryption"),allowBlank:true,hidden:!App.user.isAdmin},{xtype:"combobox",forceSelection:true,editable:false,value:"no",store:[["tls","tls"],["no","disable"]],name:"transport",fieldLabel:t("Transport"),allowBlank:true,hidden:!App.user.isAdmin}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["trunkform"],["component","box","container","panel","form","trunkform"],{component:true,box:true,container:true,panel:true,form:true,trunkform:true},["widget.trunkform"],0,[MBilling.view.trunk,"Form"],0));(Ext.cmd.derive("MBilling.view.trunk.Lookup",Ext.ux.form.field.Lookup,{name:"id_trunk",fieldLabel:t("Trunk"),displayField:"idTrunktrunkcode",displayFieldList:"trunkcode",gridConfig:{xtype:"trunklist",fieldSearch:"trunkcode",columns:[{header:t("trunkcode"),dataIndex:"trunkcode"}]}},0,["trunklookup"],["component","box","container","fieldcontainer","trunklookup"],{component:true,box:true,container:true,fieldcontainer:true,trunklookup:true},["widget.trunklookup"],0,[MBilling.view.trunk,"Lookup"],0));(Ext.cmd.derive("MBilling.view.prefix.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.prefix"],0,[MBilling.view.prefix,"Controller"],0));(Ext.cmd.derive("MBilling.view.prefix.Combo",Ext.form.field.ComboBox,{name:"id_prefix",fieldLabel:t("destination"),displayField:"prefix",filterMode:"remote",valueField:"id",listConfig:{itemTpl:Ext.create("Ext.XTemplate","
{prefix} - {destination}
")},displayTpl:Ext.create("Ext.XTemplate",'{prefix} - {destination}'),initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.PrefixCombo",{proxy:{type:"uxproxy",module:"prefixCombo",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["prefixcombo"],["component","box","field","textfield","pickerfield","combobox","combo","prefixcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,prefixcombo:true},["widget.prefixcombo"],0,[MBilling.view.prefix,"Combo"],0));(Ext.cmd.derive("MBilling.view.prefix.Module",Ext.ux.panel.Module,{controller:"prefix"},0,["prefixmodule"],["component","box","container","uxpanelmodule","prefixmodule"],{component:true,box:true,container:true,uxpanelmodule:true,prefixmodule:true},["widget.prefixmodule"],0,[MBilling.view.prefix,"Module"],0));(Ext.cmd.derive("Ext.ux.form.field.FileUpload",Ext.form.field.File,{anchor:"0",name:"file",emptyText:t("selectFile"),fieldLabel:t("file"),buttonText:undefined,maxSize:3144000,extAllowed:["csv","ret"],titleTipInfo:t("modelContent"),titleWarning:t("warning"),msgInvalidFile:t("fileNotAllow"),msgInvalidSize:t("maxSizeFile"),childEls:["browseButtonWrap","playButtonWrap"],buttonPlayMargin:5,buttonConfig:{glyph:icons.file},triggers:{filebutton:{type:"component",hideOnReadOnly:false},playbutton:{type:"component"}},applyTriggers:function(e){var d=this,f=(e||{}).playbutton;if(f){f.component=Ext.apply({xtype:"button",iconCls:"icon-play",ownerCt:d,id:d.id+"-play",ui:d.ui,disabled:d.disabled,style:d.getButtonMarginProp()+d.buttonPlayMargin+"px",inputName:d.getName(),scope:d,handler:d.playStop,hidden:true});return Ext.form.field.File.prototype.applyTriggers.call(this,e)}},onRender:function(){var c=this,d;c.isAudio=c.extAllowed.indexOf("wav")!==-1;c.formPanel=c.up("form");c.formPanel.on("edit",c.onEditForm,c);(arguments.callee.$previous||Ext.form.field.File.prototype.onRender).apply(this,arguments);c.triggerPlay=c.getTrigger("playbutton");c.buttonPlay=c.triggerPlay.component;c.triggerPlay.el.setWidth(c.buttonPlay.getEl().getWidth()+c.buttonPlay.getEl().getMargin("lr"));if(Ext.isIE){c.buttonPlay.getEl().repaint()}c.initTipInfo()},reset:function(){var b=this;if(!b.isAudio){return}if(b.audio&&!b.audio.paused&&b.audio.currentTime){b.audio.pause();b.audio.currentTime=0}b.buttonPlay.setIconCls("icon-play");b.triggerPlay.el.setWidth(0);if(Ext.isIE){b.buttonPlay.getEl().repaint()}Ext.form.field.File.prototype.reset.apply(this,arguments)},onEditForm:function(){var g=this,f=g.formPanel.getForm().getRecord(),j=f&&f.get(g.name),e=!Ext.isEmpty(j);if(!g.isAudio){return}if(g.audio&&!g.audio.paused&&g.audio.currentTime){g.audio.pause();g.audio.currentTime=0}g.buttonPlay.setIconCls("icon-play");if(e){g.audio=new Audio(j);g.audio.addEventListener("ended",Ext.bind(g.onEndAudio,g));g.triggerPlay.el.setWidth(g.buttonPlay.el.getWidth()+g.buttonPlay.el.getMargin("lr"));if(Ext.isIE){g.buttonPlay.getEl().repaint()}}else{g.triggerPlay.el.setWidth(0);if(Ext.isIE){g.buttonPlay.getEl().repaint()}}g.buttonPlay.setVisible(e);g.triggerPlay.setVisible(e)},onEndAudio:function(){this.buttonPlay.setIconCls("icon-play")},getTriggerMarkup:function(){var d=this,e=Ext.form.field.File.prototype.getTriggerMarkup.apply(this,arguments),f='';return e+f},playStop:function(e){var d=this,f=e.iconCls==="icon-play";if(f){d.audio.play()}else{if(d.audio&&!d.audio.paused&&d.audio.currentTime){d.audio.pause();d.audio.currentTime=0}}e.setIconCls(f?"icon-stop":"icon-play")},initTipInfo:function(){var b=this;if(!b.htmlTipInfo){return}b.tipInfoFile=Ext.create("Ext.tip.ToolTip",{html:b.htmlTipInfo,anchor:"top",title:b.titleTipInfo,target:b.button.el})},onFileChange:function(e,f,g){var j=this;j.getInfoFile(f);Ext.form.field.File.prototype.onFileChange.apply(this,arguments)},getInfoFile:function(g){var l=this,f=g.target.files[0],j=f.name.split("."),m=j[j.length-1].toLowerCase();if(l.extAllowed.indexOf(m)===-1){Ext.ux.Alert.alert(l.titleWarning,l.msgInvalidFile,"warning");l.reset();return}if(f.size>l.maxSize){Ext.ux.Alert.alert(l.titleWarning,l.msgInvalidSize+Ext.util.Format.fileSize(l.maxSize),"warning");l.reset();return}}},0,["uploadfield"],["component","box","field","textfield","filefield","fileuploadfield","uploadfield"],{component:true,box:true,field:true,textfield:true,filefield:true,fileuploadfield:true,uploadfield:true},["widget.uploadfield"],0,[Ext.ux.form.field,"FileUpload"],0));(Ext.cmd.derive("Ext.ux.window.ImportCsv",Ext.window.Window,{autoShow:true,modal:true,layout:"fit",iconCls:"icon-import-csv",title:t("importFromCsv"),width:400,height:window.isThemeTriton?220:175,labelWidthFields:75,htmlTipInfo:"",fieldsImport:[],listeners:{close:function(){this.list.setLoading(false)}},initComponent:function(){var d=this,c=Ext.Array.merge(d.fieldsImport,[{xtype:"uploadfield",fieldLabel:t("fileCsv"),htmlTipInfo:d.htmlTipInfo}]);d.items=[{xtype:"form",bodyPadding:5,labelWidthFields:d.labelWidthFields,items:c}];d.title=d.title+(d.titleModule?" - "+d.titleModule:"");d.bbar=[{xtype:"tbtext",text:t("maxSizeFile")+"3 MB"},"->",{iconCls:"icon-import-csv",text:t("importText"),scope:d,handler:d.onImport}];Ext.window.Window.prototype.initComponent.apply(this,arguments)},onImport:function(d){var f=this,e=f.list.store;d.disable();f.list.setLoading(true);f.down("form").submit({url:e.getProxy().api.fromCsv,scope:f,success:function(c,b){var a=Ext.decode(b.response.responseText);if(a.success){Ext.ux.Alert.alert(t("Success"),a.msg,"success")}else{Ext.ux.Alert.alert(t("Error"),a.errors,"error")}d.enable();f.list.setLoading(false);e.load();f.close()},failure:function(c,b){if(Ext.isObject(b.response)){var a=Ext.decode(b.response.responseText);Ext.ux.Alert.alert(t("Error"),a.errors,"error")}else{Ext.ux.Alert.alert(t("Error"),b.response.responseText,"error",true,false)}d.enable();f.list.setLoading(false);f.close()}})}},0,0,["component","box","container","panel","window"],{component:true,box:true,container:true,panel:true,window:true},0,0,[Ext.ux.window,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.prefix.ImportCsv",Ext.ux.window.ImportCsv,{htmlTipInfo:"
"+t("dialprefix")+", "+t("destination")+"",labelWidthFields:160,height:window.isThemeTriton?300:205,initComponent:function(){var b=this;b.fieldsImport=[{style:"margin-top:25px",xtype:"fieldset",title:t("Csv Format"),collapsible:true,collapsed:false,defaults:{labelWidth:190,anchor:"100%",layout:{type:"hbox",labelAlign:b.labelAlignFields}},items:[{xtype:"pontovirgulacombo",name:"delimiter",fieldLabel:t("Delimiter"),width:230}]}];Ext.ux.window.ImportCsv.prototype.initComponent.apply(this,arguments)}},0,["prefiximportcsv"],["component","box","container","panel","window","prefiximportcsv"],{component:true,box:true,container:true,panel:true,window:true,prefiximportcsv:true},["widget.prefiximportcsv"],0,[MBilling.view.prefix,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.prefix.List",Ext.ux.grid.Panel,{store:"Prefix",fieldSearch:"prefix",initComponent:function(){var b=this;b.buttonImportCsv=!App.user.isClient,b.buttonUpdateLot=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("prefix"),dataIndex:"prefix",filter:{type:"string"}},{header:t("destination"),dataIndex:"destination"}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["prefixlist"],["component","box","container","panel","tablepanel","gridpanel","grid","prefixlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,prefixlist:true},["widget.prefixlist"],0,[MBilling.view.prefix,"List"],0));(Ext.cmd.derive("MBilling.view.prefix.Form",Ext.ux.form.Panel,{fieldsHideEdit:["prefix"],items:[{name:"prefix",fieldLabel:t("prefix"),maxLength:18},{name:"destination",fieldLabel:t("destination")}]},0,["prefixform"],["component","box","container","panel","form","prefixform"],{component:true,box:true,container:true,panel:true,form:true,prefixform:true},["widget.prefixform"],0,[MBilling.view.prefix,"Form"],0));(Ext.cmd.derive("MBilling.view.sendCreditProducts.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.sendcreditproducts"],0,[MBilling.view.sendCreditProducts,"Controller"],0));(Ext.cmd.derive("MBilling.view.sendCreditProducts.Module",Ext.ux.panel.Module,{controller:"sendcreditproducts"},0,["sendcreditproductsmodule"],["component","box","container","uxpanelmodule","sendcreditproductsmodule"],{component:true,box:true,container:true,uxpanelmodule:true,sendcreditproductsmodule:true},["widget.sendcreditproductsmodule"],0,[MBilling.view.sendCreditProducts,"Module"],0));(Ext.cmd.derive("MBilling.view.sendCreditProducts.ImportCsv",Ext.ux.window.ImportCsv,{fieldsImport:[{fieldLabel:t("table"),hidden:true,allowBlank:true}]},0,["sendcreditproductsimportcsv"],["component","box","container","panel","window","sendcreditproductsimportcsv"],{component:true,box:true,container:true,panel:true,window:true,sendcreditproductsimportcsv:true},["widget.sendcreditproductsimportcsv"],0,[MBilling.view.sendCreditProducts,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.sendCreditProducts.List",Ext.ux.grid.Panel,{store:"SendCreditProducts",fieldSearch:"operator_name",comparisonfilter:"ct",initComponent:function(){var b=this;b.buttonImportCsv=App.user.isAdmin,b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("Country"),dataIndex:"country",flex:4},{header:t("Country Code"),dataIndex:"country_code",flex:2},{header:t("Operator ID"),dataIndex:"operator_id",flex:2},{header:t("SkuCode"),dataIndex:"SkuCode",flex:2},{header:t("Operator Name"),dataIndex:"operator_name",flex:5},{header:t("Currency destination"),dataIndex:"currency_dest",flex:3},{header:t("Product"),dataIndex:"product",flex:2},{header:t("Currency Origem"),dataIndex:"currency_orig",flex:3},{header:t("Send Value"),dataIndex:"send_value",flex:2},{header:t("Wholesale Price"),dataIndex:"wholesale_price",flex:2},{header:t("Provider"),dataIndex:"provider",flex:2},{header:t("status"),dataIndex:"status",renderer:Helper.Util.formatBooleanActive,comboRelated:"booleancombo",flex:2,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")]]}}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["sendcreditproductslist"],["component","box","container","panel","tablepanel","gridpanel","grid","sendcreditproductslist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,sendcreditproductslist:true},["widget.sendcreditproductslist"],0,[MBilling.view.sendCreditProducts,"List"],0));(Ext.cmd.derive("MBilling.view.sendCreditProducts.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{name:"country",fieldLabel:t("country"),readOnly:true},{name:"operator_name",fieldLabel:t("Operator Name"),readOnly:true},{name:"operator_id",fieldLabel:t("Operator Id")},{name:"SkuCode",fieldLabel:t("SkuCode")},{name:"product",fieldLabel:t("Product")},{name:"send_value",fieldLabel:t("Send Value"),xtype:"moneyfield",mask:"#9.999.990,000000",readOnly:!App.user.isAdmin},{name:"wholesale_price",fieldLabel:t("Wholesale Price"),xtype:"moneyfield",mask:"#9.999.990,000000",readOnly:!App.user.isAdmin},{xtype:"combobox",name:"provider",value:"TransferTo",forceSelection:true,editable:false,store:[["TransferTo","TransferTo"],["Ding","Ding"],["TanaSend","TanaSend"]],fieldLabel:t("Provider")},{xtype:"yesnocombo",name:"status",fieldLabel:t("status")},{xtype:"textareafield",name:"info",fieldLabel:t("info"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["sendcreditproductsform"],["component","box","container","panel","form","sendcreditproductsform"],{component:true,box:true,container:true,panel:true,form:true,sendcreditproductsform:true},["widget.sendcreditproductsform"],0,[MBilling.view.sendCreditProducts,"Form"],0));(Ext.cmd.derive("MBilling.view.sendCreditRates.Controller",Ext.ux.app.ViewController,{onResetPrice:function(e){var f=this,d=f.list.getSelectionModel().getSelection()[0];Ext.Ajax.request({url:"index.php/SendCreditRates/resetSellPrice",scope:f,success:function(b){b=Ext.decode(b.responseText);if(b[f.nameSuccessRequest]){Ext.ux.Alert.alert(f.titleSuccess,b[f.nameMsgRequest],"success")}else{var a=Helper.Util.convertErrorsJsonToString(b[f.nameMsgRequest]);Ext.ux.Alert.alert(f.titleSuccess,a,"error")}}});f.store.load()}},0,0,0,0,["controller.sendcreditrates"],0,[MBilling.view.sendCreditRates,"Controller"],0));(Ext.cmd.derive("MBilling.view.sendCreditRates.Module",Ext.ux.panel.Module,{controller:"sendcreditrates"},0,["sendcreditratesmodule"],["component","box","container","uxpanelmodule","sendcreditratesmodule"],{component:true,box:true,container:true,uxpanelmodule:true,sendcreditratesmodule:true},["widget.sendcreditratesmodule"],0,[MBilling.view.sendCreditRates,"Module"],0));(Ext.cmd.derive("MBilling.view.sendCreditRates.List",Ext.ux.grid.Panel,{store:"SendCreditRates",fieldSearch:"idProduct.operator_name",comparisonfilter:"ct",initComponent:function(){var b=this;b.buttonUpdateLotCallShopRate=true;b.buttonCsv=false;b.allowPrint=false;b.extraButtons=[{text:t("Reset")+" "+t("Sell price"),iconCls:"icon-chart-column",width:130,handler:"onResetPrice",disabled:false}];b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{xtype:"templatecolumn",tpl:"{idProductoperator_name}",header:t("Operator Name"),dataIndex:"idProductoperator_name",filter:{type:"string",field:"idProduct.operator_name"},flex:5},{xtype:"templatecolumn",tpl:"{idProductcountry}",header:t("Country"),dataIndex:"idProductcountry",filter:{type:"string",field:"idProduct.country"},flex:4},{xtype:"templatecolumn",tpl:"{idProductcurrency_dest}",header:t("Currency destination"),dataIndex:"idProductcurrency_dest",filter:{type:"string",field:"idProduct.currency_dest"},flex:3},{xtype:"templatecolumn",tpl:"{idProductproduct}",header:t("Product"),dataIndex:"idProductproduct",filter:{type:"string",field:"idProduct.product"},flex:2},{xtype:"templatecolumn",tpl:"{idProductcurrency_orig}",header:t("Currency Origin"),dataIndex:"idProductcurrency_orig",filter:{type:"string",field:"idProduct.currency_orig"},flex:3},{xtype:"templatecolumn",tpl:"{idProductwholesale_price}",header:t("Wholesale Price"),dataIndex:"idProductwholesale_price",filter:{type:"string",field:"idProduct.wholesale_price"},flex:2},{header:t("Sell Price"),dataIndex:"sell_price",flex:2}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["sendcreditrateslist"],["component","box","container","panel","tablepanel","gridpanel","grid","sendcreditrateslist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,sendcreditrateslist:true},["widget.sendcreditrateslist"],0,[MBilling.view.sendCreditRates,"List"],0));(Ext.cmd.derive("MBilling.view.sendCreditRates.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["idProductcountry","idProductoperator_name"],initComponent:function(){var b=this;b.items=[{name:"idProductcountry",fieldLabel:t("country"),readOnly:true},{name:"idProductoperator_name",fieldLabel:t("Operator Name"),readOnly:true},{name:"sell_price",fieldLabel:t("Sell Price"),xtype:"moneyfield",mask:"#9.999.990,00",readOnly:App.user.isAdmin}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["sendcreditratesform"],["component","box","container","panel","form","sendcreditratesform"],{component:true,box:true,container:true,panel:true,form:true,sendcreditratesform:true},["widget.sendcreditratesform"],0,[MBilling.view.sendCreditRates,"Form"],0));(Ext.cmd.derive("MBilling.view.prefix.Lookup",Ext.ux.form.field.Lookup,{name:"id_prefix",fieldLabel:t("Destination"),displayField:"idPrefixdestination",displayFieldList:"destination",gridConfig:{xtype:"prefixlist",fieldSearch:"destination",columns:[{header:t("prefix"),dataIndex:"prefix",flex:2},{header:t("destination"),dataIndex:"destination",flex:2}]}},0,["prefixlookup"],["component","box","container","fieldcontainer","prefixlookup"],{component:true,box:true,container:true,fieldcontainer:true,prefixlookup:true},["widget.prefixlookup"],0,[MBilling.view.prefix,"Lookup"],0));(Ext.cmd.derive("MBilling.view.sipTrace.Controller",Ext.ux.app.ViewController,{onNewFilter:function(d){var f=this,e=f.getView();Ext.widget("siptracefilter",{title:"SipTrace",list:f.list})},onDeleteLog:function(d){var c=this;Ext.Msg.confirm(c.titleConfirmation,t("Confirm delete all log file?"),function(a){if(a==="yes"){Ext.Ajax.request({url:"index.php/sipTrace/destroy",scope:c,success:function(b){Ext.ux.Alert.alert(c.titleSuccess,t("Success: The Sip Trace file was deleted"),"success");c.store.load()}})}})},onClearAll:function(d){var c=this;Ext.Ajax.request({url:"index.php/sipTrace/clearAll",scope:c,success:function(a){Ext.ux.Alert.alert(c.titleSuccess,t("Success"),"success");c.store.load()}})},onExportPcap:function(d){var c=this;window.open("index.php/sipTrace/export")},onDetails:function(d){var f=this,e=f.list.getSelectionModel().getSelection()[0];window.open("index.php/sipTrace/details?callid="+e.get("callid"))}},0,0,0,0,["controller.siptrace"],0,[MBilling.view.sipTrace,"Controller"],0));(Ext.cmd.derive("MBilling.view.sipTrace.Module",Ext.ux.panel.Module,{controller:"siptrace"},0,["siptracemodule"],["component","box","container","uxpanelmodule","siptracemodule"],{component:true,box:true,container:true,uxpanelmodule:true,siptracemodule:true},["widget.siptracemodule"],0,[MBilling.view.sipTrace,"Module"],0));(Ext.cmd.derive("MBilling.view.sipTrace.Filter",Ext.window.Window,{autoShow:true,modal:true,layout:"fit",iconCls:"icon-import-csv",title:t("SipTrace filter"),width:400,height:window.isThemeTriton?220:180,labelWidthFields:120,htmlTipInfo:"",fieldsImport:[],initComponent:function(){var b=this;b.items=[{xtype:"form",bodyPadding:5,defaults:{anchor:"0",enableKeyEvents:true,labelWidth:b.labelWidthFields,msgTarget:"side",plugins:"markallowblank",allowBlank:false},items:[{xtype:"numberfield",value:60,min:5,max:300,name:"timeout",fieldLabel:t("Filter timeout")},{xtype:"numberfield",name:"port",fieldLabel:t("Port"),allowBlank:false,value:5060},{xtype:"textfield",name:"filter",fieldLabel:t("Filter"),allowBlank:false,emptyText:"IP, sip account or number ...."}]}];b.title=b.title+(b.titleModule?" - "+b.titleModule:"");b.bbar=[{width:150,iconCls:"icon-play",text:t("Start"),scope:b,handler:b.onStart}];Ext.window.Window.prototype.initComponent.apply(this,arguments)},onStart:function(d){var f=this,e=f.list.store;if(!f.down("form").isValid()){return}f.list.setLoading(true);Ext.Ajax.setTimeout(1000000);f.down("form").submit({url:"index.php/sipTrace/start",scope:f,success:function(c,b){var a=Ext.decode(b.response.responseText);console.log(a);if(a.success){Ext.ux.Alert.alert(t("Success"),a.msg,"success")}else{Ext.ux.Alert.alert(t("Error"),a.errors,"error")}d.enable();f.list.setLoading(false);e.load();f.close()},failure:function(c,b){console.log(b.response.responseText);if(b.response&&Ext.isObject(b.response.responseText)){var a=Ext.decode(b.response.responseText);Ext.ux.Alert.alert(t("Error"),a.errors,"error",true,30)}else{Ext.ux.Alert.alert(t("Error"),Ext.decode(b.response.responseText).msg,"error",true,30)}d.enable();f.list.setLoading(false);e.load();f.close()}})}},0,["siptracefilter"],["component","box","container","panel","window","siptracefilter"],{component:true,box:true,container:true,panel:true,window:true,siptracefilter:true},["widget.siptracefilter"],0,[MBilling.view.sipTrace,"Filter"],0));(Ext.cmd.derive("MBilling.view.sipTrace.List",Ext.ux.grid.Panel,{store:"SipTrace",initComponent:function(){var b=this;b.buttonImportCsv=false;b.buttonCsv=false;b.allowPrint=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.collapsedExtraFilters=false;b.allowDelete=false;b.extraButtons=[{text:b.textDelete,glyph:b.glyphDelete,handler:"onDeleteLog",width:120},{text:t("Start Capture"),iconCls:"icon-save-all",handler:"onNewFilter",width:120},{text:t("Stop Capture"),iconCls:"icon-clean-filter",handler:"onClearAll",width:120},{text:t("Export File"),iconCls:"icon-save-all",handler:"onExportPcap",width:150},{text:t("Details"),glyph:icons.info,handler:"onDetails",width:150}];b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,menuDisabled:true,hideable:App.user.isAdmin},{header:t("method"),dataIndex:"method",flex:3},{header:t("callid"),dataIndex:"callid",flex:7},{header:t("SIP To "),dataIndex:"sipto",flex:5},{header:t("Source"),dataIndex:"fromip",renderer:function(a){a=a==window.myIP?''+a+"":a;return a},flex:3},{header:t("Destination"),dataIndex:"toip",renderer:function(a){a=a==window.myIP?''+a+"":a;return a},flex:4},{header:t("head"),dataIndex:"head",flex:3,menuDisabled:true,hidden:true,hideable:true}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["siptracelist"],["component","box","container","panel","tablepanel","gridpanel","grid","siptracelist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,siptracelist:true},["widget.siptracelist"],0,[MBilling.view.sipTrace,"List"],0));(Ext.cmd.derive("MBilling.view.sipTrace.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.allowCreate=false;height=Ext.Element.getViewportHeight()-200;b.items=[{xtype:"textareafield",name:"head",height:height,anchor:"100%",allowBlank:true,readOnly:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["siptraceform"],["component","box","container","panel","form","siptraceform"],{component:true,box:true,container:true,panel:true,form:true,siptraceform:true},["widget.siptraceform"],0,[MBilling.view.sipTrace,"Form"],0));(Ext.cmd.derive("MBilling.view.sip.Controller",Ext.ux.app.ViewController,{init:function(){var b=this;b.control({typesipforwardcombo:{select:b.onSelectMethod}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectMethod:function(c,d){this.showFieldsRelated(d.getData().showFields)},showFieldsRelated:function(l){var m=this,n=m.formPanel.getForm(),j=m.formPanel.getForm().getFields(),g=Ext.get(Ext.Element.getActiveElement()).component,o=g.name.substr(-2);m.onSetVisibleFiel(g,n,o,g.value)},onSetVisibleFiel:function(f,j,e,g){if(f.value=="undefined"){f.setValue("undefined")}j.findField("id_queue").setValue("");j.findField("id_sip").setValue("");j.findField("id_ivr").setValue("");j.findField("extension").setValue("");j.findField("id_queue").setVisible(g.match("^queue"));j.findField("id_sip").setVisible(g.match("^sip"));j.findField("id_ivr").setVisible(g.match("^ivr"));j.findField("extension").setVisible(g.match("^group|^number|^custom"))},onGetDiskSpaceService:function(b){filterGroupp=Ext.encode([{type:"numeric",comparison:"eq",value:App.user.id,field:"id_user"},{type:"numeric",comparison:"eq",value:1,field:"status"}]),Ext.Ajax.request({url:"index.php/servicesUse/read?filter="+filterGroupp,success:function(a){a=Ext.decode(a.responseText);b(a.rows)}})},onEdit:function(){var j=this,l=j.formPanel.getForm(),f=j.list.getSelectionModel().getSelection()[0],g=j.formPanel.idRecord?f.get("allow").split(","):["g729","gsm","alaw","ulaw"],m=j.formPanel.down("checkboxgroup");if(App.user.isClient){l.findField("record_call").setVisible(false);j.onGetDiskSpaceService(function(a){Ext.each(a,function(b){if(b.idServicestype=="disk_space"){j.formPanel.getForm().findField("record_call").setVisible(true)}})})}fieldValue=f.getData()["type_forward"];l.findField("type_forward").setVisible(true);if(fieldValue=="ivr"){l.findField("id_ivr").setVisible(true);l.findField("id_sip").setVisible(false);l.findField("id_queue").setVisible(false);l.findField("extension").setVisible(false)}else{if(fieldValue=="sip"){l.findField("id_sip").setVisible(true);l.findField("id_ivr").setVisible(false);l.findField("id_queue").setVisible(false);l.findField("extension").setVisible(false)}else{if(fieldValue=="queue"){l.findField("id_queue").setVisible(true);l.findField("id_sip").setVisible(false);l.findField("id_ivr").setVisible(false);l.findField("extension").setVisible(false)}else{if(fieldValue.match("custom|number|group")){l.findField("extension").setVisible(true);l.findField("id_ivr").setVisible(false);l.findField("id_sip").setVisible(false);l.findField("id_queue").setVisible(false)}else{l.findField("id_queue").setVisible(false);l.findField("id_sip").setVisible(false);l.findField("id_ivr").setVisible(false);l.findField("extension").setVisible(false)}}}}Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments);m.setValue({allow:g})},onNew:function(){var f=this,d=f.formPanel.getForm(),e=f.list.getSelectionModel().getSelection()[0];if(App.user.isClient){f.formPanel.getForm().findField("defaultuser").setReadOnly(false)}d.findField("id_ivr").setVisible(false);d.findField("id_sip").setVisible(false);d.findField("id_queue").setVisible(false);d.findField("id_ivr").setVisible(false);d.findField("id_queue").setVisible(false);d.findField("type_forward").setVisible(true);Ext.ux.app.ViewController.prototype.onNew.apply(this,arguments)}},0,0,0,0,["controller.sip"],0,[MBilling.view.sip,"Controller"],0));(Ext.cmd.derive("MBilling.view.sip.Module",Ext.ux.panel.Module,{controller:"sip"},0,["sipmodule"],["component","box","container","uxpanelmodule","sipmodule"],{component:true,box:true,container:true,uxpanelmodule:true,sipmodule:true},["widget.sipmodule"],0,[MBilling.view.sip,"Module"],0));(Ext.cmd.derive("MBilling.view.sip.List",Ext.ux.grid.Panel,{store:"Sip",fieldSearch:"idUser.username",initComponent:function(){var b=this;b.columns=b.columns||[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("Status"),dataIndex:"lineStatus",width:3,menuDisabled:true,renderer:Helper.Util.formatStatusImage},{header:t("accountcode"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4},{header:t("username"),dataIndex:"name",flex:4},{header:t("host"),dataIndex:"host",flex:4},{header:t("codec"),dataIndex:"allow",flex:5},{header:"group",dataIndex:"group",flex:3},{header:t("context"),dataIndex:"context",hidden:true,hideable:!App.user.isClient,flex:1},{header:t("record_call"),dataIndex:"record_call",renderer:Helper.Util.formattyyesno,filter:{type:"list",options:[[0,t("no")],[1,t("yes")]]},flex:2,hidden:true,hideable:!App.user.isClient},{header:t("callerid"),dataIndex:"callerid",hidden:true,hideable:!App.user.isClient,flex:1},{header:"nat",dataIndex:"nat",hidden:true,hideable:!App.user.isClient,flex:1},{header:"directmedia",dataIndex:"directmedia",hidden:true,hideable:!App.user.isClient,flex:1},{header:"qualify",dataIndex:"qualify",hidden:true,hideable:!App.user.isClient,flex:1},{header:"dtmfmode",dataIndex:"dtmfmode",hidden:true,hideable:!App.user.isClient,flex:1},{header:"insecure",dataIndex:"insecure",hidden:true,hideable:!App.user.isClient,flex:1},{header:"type",dataIndex:"type",hidden:true,hideable:!App.user.isClient,flex:1},{header:"allowtransfer",dataIndex:"allowtransfer",hidden:true,hideable:!App.user.isClient,flex:1},{header:"calllimit",dataIndex:"calllimit",hidden:true,hideable:!App.user.isClient,flex:1}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["siplist"],["component","box","container","panel","tablepanel","gridpanel","grid","siplist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,siplist:true},["widget.siplist"],0,[MBilling.view.sip,"List"],0));(Ext.cmd.derive("MBilling.view.sip.Form",Ext.ux.form.Panel,{bodyPadding:0,fieldsHideUpdateLot:["id_user","defaultuser","secret"],initComponent:function(){var b=this;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{labelAlign:"right",plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true}},items:[{title:t("general"),items:[{xtype:"userlookup",ownerForm:b,fieldLabel:t("accountcode"),hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"defaultuser",fieldLabel:t("username"),minLength:4,allowBlank:true,readOnly:App.user.isClient},{name:"secret",fieldLabel:t("password"),allowBlank:true,minLength:6},{name:"callerid",fieldLabel:t("callerid"),allowBlank:true},{name:"alias",fieldLabel:t("Alias"),allowBlank:true,minLength:3},{name:"disallow",fieldLabel:"disallow",value:"all",hidden:!App.user.isAdmin,allowBlank:App.user.isClient},{xtype:"checkboxgroup",columns:3,fieldLabel:t("codec"),items:[{boxLabel:"g729",name:"allow",inputValue:"g729",checked:true},{boxLabel:"g723",name:"allow",inputValue:"g723"},{boxLabel:"gsm",name:"allow",inputValue:"gsm",checked:true},{boxLabel:"g726",name:"allow",inputValue:"g726"},{boxLabel:"opus",name:"allow",inputValue:"opus",checked:true},{boxLabel:"alaw",name:"allow",inputValue:"alaw",checked:true},{boxLabel:"ulaw",name:"allow",inputValue:"ulaw",checked:true},{boxLabel:"g722",name:"allow",inputValue:"g722"},{boxLabel:"ilbc",name:"allow",inputValue:"ilbc"},{boxLabel:"speex",name:"allow",inputValue:"speex"},{boxLabel:"h263p",name:"allow",inputValue:"h263p"},{boxLabel:"h263",name:"allow",inputValue:"h263"},{boxLabel:"h264",name:"allow",inputValue:"h264"},{boxLabel:"vp8",name:"allow",inputValue:"vp8"}],hidden:!App.user.isAdmin,allowBlank:App.user.isClient},{name:"host",fieldLabel:t("host"),value:"dynamic",hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"group",fieldLabel:t("group"),allowBlank:true},{xtype:"yesnostringcombo",name:"videosupport",fieldLabel:"videosupport",value:"no",allowBlank:!App.user.isAdmin},{name:"block_call_reg",fieldLabel:t("Block Call REGEX"),allowBlank:true,hidden:!window.doac},{xtype:"noyescombo",name:"record_call",fieldLabel:t("record_call"),allowBlank:true,hidden:!App.user.isAdmin},{xtype:"numberfield",name:"techprefix",fieldLabel:t("TechPrefix"),hidden:!window.usertech||!App.user.isAdmin,allowBlank:true,maxLength:6}]},{title:t("Nat"),hidden:!App.user.isAdmin,items:[{name:"nat",fieldLabel:"nat",value:"force_rport,comedia",allowBlank:!App.user.isAdmin},{name:"directmedia",fieldLabel:"directmedia",value:"no",allowBlank:!App.user.isAdmin},{xtype:"yesnostringcombo",name:"qualify",fieldLabel:"qualify",value:"no",allowBlank:!App.user.isAdmin}]},{title:t("Additional"),hidden:!App.user.isAdmin,defaults:{labelAlign:"right",plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true,labelWidth:142},items:[{name:"context",fieldLabel:t("context"),value:"billing",hidden:!App.user.isAdmin,allowBlank:true},{name:"dtmfmode",fieldLabel:"dtmfmode",value:"RFC2833",allowBlank:!App.user.isAdmin},{name:"insecure",fieldLabel:"insecure",value:"no",allowBlank:true},{name:"deny",fieldLabel:"deny",allowBlank:true,hidden:!App.user.isAdmin},{name:"permit",fieldLabel:"permit",allowBlank:true,hidden:!App.user.isAdmin},{name:"type",fieldLabel:"type",value:"friend",allowBlank:!App.user.isAdmin},{xtype:"noyesstringcombo",name:"allowtransfer",fieldLabel:"allowtransfer",value:"no",allowBlank:!App.user.isAdmin},{xtype:"noyescombo",name:"ringfalse",fieldLabel:t("Ring false"),value:"0",allowBlank:!App.user.isAdmin},{name:"calllimit",xtype:"numberfield",fieldLabel:t("calllimit"),value:"0",allowBlank:!App.user.isAdmin},{xtype:"noyescombo",name:"voicemail",fieldLabel:t("Enable")+" "+t("VoiceMail"),value:"0",allowBlank:App.user.isClient},{name:"mohsuggest",fieldLabel:t("MOH"),allowBlank:true,hidden:!App.user.isAdmin},{name:"url_events",fieldLabel:t("Url Events notify"),hidden:!App.user.isAdmin||!window.events===true,allowBlank:true}]},{title:t("Forward"),itemId:"option",bodyPadding:10,defaults:{xtype:"fieldcontainer",layout:"hbox",plugins:"markallowblank",allowBlank:true,anchor:"100%",labelWidth:60,defaults:{hideLabel:true,hidden:true,flex:5,startX:100,allowBlank:true,ownerForm:b}},items:[{fieldLabel:t("Forward"),items:[{name:"type_forward",xtype:"typesipforwardcombo",flex:2},{xtype:"ivrlookup",name:"id_ivr",displayField:"id_ivr_name"},{xtype:"queuelookup",name:"id_queue",displayField:"id_queue_name"},{xtype:"sip2lookup",name:"id_sip",displayField:"id_sip_name"},{xtype:"textfield",name:"extension"}]},{name:"dial_timeout",xtype:"numberfield",fieldLabel:t("Dial timeout"),value:"60",labelWidth:90}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["sipform"],["component","box","container","panel","form","sipform"],{component:true,box:true,container:true,panel:true,form:true,sipform:true},["widget.sipform"],0,[MBilling.view.sip,"Form"],0));(Ext.cmd.derive("MBilling.view.sip.Lookup",Ext.ux.form.field.Lookup,{name:"id_sip",fieldLabel:t("Sip"),displayField:"idSipname",displayFieldList:"name",gridConfig:{xtype:"siplist",fieldSearch:"name",columns:[{header:t("Account"),dataIndex:"idUserusername",flex:2},{header:t("name"),dataIndex:"name",flex:2}]}},0,["siplookup"],["component","box","container","fieldcontainer","siplookup"],{component:true,box:true,container:true,fieldcontainer:true,siplookup:true},["widget.siplookup"],0,[MBilling.view.sip,"Lookup"],0));(Ext.cmd.derive("MBilling.view.sip2.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.sip2"],0,[MBilling.view.sip2,"Controller"],0));(Ext.cmd.derive("MBilling.view.sip2.Module",Ext.ux.panel.Module,{controller:"sip2"},0,["sip2module"],["component","box","container","uxpanelmodule","sip2module"],{component:true,box:true,container:true,uxpanelmodule:true,sip2module:true},["widget.sip2module"],0,[MBilling.view.sip2,"Module"],0));(Ext.cmd.derive("MBilling.view.sip2.List",Ext.ux.grid.Panel,{store:"Sip2",fieldSearch:"name",initComponent:function(){var b=this;b.columns=b.columns||[{header:t("accountcode"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4},{header:t("username"),dataIndex:"name",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["sip2list"],["component","box","container","panel","tablepanel","gridpanel","grid","sip2list"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,sip2list:true},["widget.sip2list"],0,[MBilling.view.sip2,"List"],0));(Ext.cmd.derive("MBilling.view.sip2.Form",Ext.ux.form.Panel,{bodyPadding:0},0,["sip2form"],["component","box","container","panel","form","sip2form"],{component:true,box:true,container:true,panel:true,form:true,sip2form:true},["widget.sip2form"],0,[MBilling.view.sip2,"Form"],0));(Ext.cmd.derive("MBilling.view.sip2.Lookup",Ext.ux.form.field.Lookup,{name:"id_sip",fieldLabel:t("Sip"),displayField:"id_sip_name",displayFieldList:"name",gridConfig:{xtype:"sip2list",fieldSearch:"name",columns:[{header:t("Account"),dataIndex:"idUserusername",flex:2},{header:t("name"),dataIndex:"name",flex:2}]}},0,["sip2lookup"],["component","box","container","fieldcontainer","sip2lookup"],{component:true,box:true,container:true,fieldcontainer:true,sip2lookup:true},["widget.sip2lookup"],0,[MBilling.view.sip2,"Lookup"],0));(Ext.cmd.derive("MBilling.view.sipuras.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.sipuras"],0,[MBilling.view.sipuras,"Controller"],0));(Ext.cmd.derive("MBilling.view.sipuras.Module",Ext.ux.panel.Module,{controller:"sipuras"},0,["sipurasmodule"],["component","box","container","uxpanelmodule","sipurasmodule"],{component:true,box:true,container:true,uxpanelmodule:true,sipurasmodule:true},["widget.sipurasmodule"],0,[MBilling.view.sipuras,"Module"],0));(Ext.cmd.derive("MBilling.view.sipuras.List",Ext.ux.grid.Panel,{store:"Sipuras",initComponent:function(){var b=this;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"}},{header:"Serial",dataIndex:"nserie"},{header:"Mac",dataIndex:"macadr"},{header:t("username")+" 1",dataIndex:"User_ID_1"},{header:t("username")+" 2",dataIndex:"User_ID_2"},{header:t("last_ip"),dataIndex:"last_ip"},{header:t("obs"),dataIndex:"obs"},{header:t("last")+" "+t("register"),dataIndex:"fultmov",renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s")}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["sipuraslist"],["component","box","container","panel","tablepanel","gridpanel","grid","sipuraslist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,sipuraslist:true},["widget.sipuraslist"],0,[MBilling.view.sipuras,"List"],0));(Ext.cmd.derive("MBilling.view.sipuras.Form",Ext.ux.form.Panel,{bodyPadding:0,fieldsHideUpdateLot:["id_user","nserie","macadr"],initComponent:function(){var b=this;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true,labelAlign:"right"}},items:[{title:t("general"),items:[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"nserie",fieldLabel:"Serial"},{name:"macadr",fieldLabel:"Mac"},{name:"senha_user",fieldLabel:t("password")+" "+t("username"),allowBlank:true},{name:"senha_admin",fieldLabel:t("password")+" "+t("admin"),allowBlank:true},{name:"antireset",fieldLabel:t("antireset"),xtype:"noyescombo"},{name:"Enable_Web_Server",fieldLabel:t("Enable_Web_Server"),xtype:"yesnocombo"},{name:"marca",fieldLabel:"marca",value:"*",hidden:true},{name:"altera",fieldLabel:"altera",value:"si",hidden:true}]},{title:t("line")+" 1",items:[{name:"User_ID_1",fieldLabel:t("username"),allowBlank:true},{name:"Password_1",fieldLabel:t("password"),allowBlank:true},{name:"Use_Pref_Codec_Only_1",fieldLabel:t("Use_Pref_Codec"),xtype:"noyescombo"},{name:"Preferred_Codec_1",fieldLabel:t("codec"),allowBlank:true,value:"G729a"},{name:"Register_Expires_1",fieldLabel:"Register Expires",allowBlank:true,value:"360"},{name:"Dial_Plan_1",fieldLabel:"Dial Plan",allowBlank:true,value:"(*xx|[3469]11|0|00|[2-9]xxxxxx|1xxx[2-9]xxxxxxS0|xxxxxxxxxxxx.)"},{name:"NAT_Mapping_Enable_1_",fieldLabel:"NAT Mapping",allowBlank:true,xtype:"noyescombo"},{name:"NAT_Keep_Alive_Enable_1_",fieldLabel:"NAT Keep Alive",allowBlank:true,xtype:"noyescombo"}]},{title:t("line")+" 2",items:[{name:"User_ID_2",fieldLabel:t("username"),allowBlank:true},{name:"Password_2",fieldLabel:t("password"),allowBlank:true},{name:"Use_Pref_Codec_Only_2",fieldLabel:t("Use_Pref_Codec"),xtype:"noyescombo"},{name:"Preferred_Codec_2",fieldLabel:t("codec"),allowBlank:true,value:"G729a"},{name:"Register_Expires_2",fieldLabel:"Register Expires",allowBlank:true,value:"360"},{name:"Dial_Plan_2",fieldLabel:"Dial Plan",allowBlank:true,value:"(*xx|[3469]11|0|00|[2-9]xxxxxx|1xxx[2-9]xxxxxxS0|xxxxxxxxxxxx.)"},{name:"NAT_Mapping_Enable_2_",fieldLabel:"NAT Mapping",allowBlank:true,xtype:"noyescombo"},{name:"NAT_Keep_Alive_Enable_2_",fieldLabel:"NAT Keep Alive",allowBlank:true,xtype:"noyescombo"}]},{title:"Stun",items:[{name:"STUN_Enable",fieldLabel:t("active")+"Stun",allowBlank:true,xtype:"noyescombo"},{name:"STUN_Test_Enable",fieldLabel:"STUN Test",allowBlank:true,xtype:"noyescombo"},{name:"Substitute_VIA_Addr",fieldLabel:"Substitute VIA Addr",allowBlank:true,xtype:"noyescombo"},{name:"STUN_Server",fieldLabel:"STUN Server",allowBlank:true}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["sipurasform"],["component","box","container","panel","form","sipurasform"],{component:true,box:true,container:true,panel:true,form:true,sipurasform:true},["widget.sipurasform"],0,[MBilling.view.sipuras,"Form"],0));(Ext.cmd.derive("MBilling.view.iax.Controller",Ext.ux.app.ViewController,{onEdit:function(){Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments);var g=this,e=g.list.getSelectionModel().getSelection()[0],f=g.formPanel.idRecord?e.get("allow").split(","):["g729","gsm","alaw","ulaw"],j=g.formPanel.down("checkboxgroup");j.setValue({allow:f})}},0,0,0,0,["controller.iax"],0,[MBilling.view.iax,"Controller"],0));(Ext.cmd.derive("MBilling.view.iax.Module",Ext.ux.panel.Module,{controller:"iax"},0,["iaxmodule"],["component","box","container","uxpanelmodule","iaxmodule"],{component:true,box:true,container:true,uxpanelmodule:true,iaxmodule:true},["widget.iaxmodule"],0,[MBilling.view.iax,"Module"],0));(Ext.cmd.derive("MBilling.view.iax.List",Ext.ux.grid.Panel,{store:"Iax",fieldSearch:"username",initComponent:function(){var b=this;b.columns=b.columns||[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("username"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:3},{header:t("ramal"),dataIndex:"name",flex:3},{header:t("password"),dataIndex:"secret",flex:2},{header:t("host"),dataIndex:"host",flex:3},{header:"IP",dataIndex:"ipaddr",flex:5},{header:t("context"),dataIndex:"context",hidden:true,hideable:!App.user.isClient,flex:1},{header:t("callerid"),dataIndex:"callerid",hidden:true,hideable:!App.user.isClient,flex:1},{header:t("codec"),dataIndex:"allow",hidden:true,hideable:!App.user.isClient,flex:1},{header:"nat",dataIndex:"nat",hidden:true,hideable:!App.user.isClient,flex:1},{header:"qualify",dataIndex:"qualify",hidden:true,hideable:!App.user.isClient,flex:1},{header:"dtmfmode",dataIndex:"dtmfmode",hidden:true,hideable:!App.user.isClient,flex:1},{header:"insecure",dataIndex:"insecure",hidden:true,hideable:!App.user.isClient,flex:1},{header:"type",dataIndex:"type",hidden:true,hideable:!App.user.isClient,flex:1}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["iaxlist"],["component","box","container","panel","tablepanel","gridpanel","grid","iaxlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,iaxlist:true},["widget.iaxlist"],0,[MBilling.view.iax,"List"],0));(Ext.cmd.derive("MBilling.view.iax.Form",Ext.ux.form.Panel,{bodyPadding:0,fieldsHideUpdateLot:["id_user","defaultuser","secret"],initComponent:function(){var b=this;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true,labelAlign:"right"}},items:[{title:t("general"),items:[{xtype:"userlookup",ownerForm:b,fieldLabel:t("accountcode"),hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"username",fieldLabel:t("username"),minLength:4,readOnly:App.user.isClient},{name:"secret",fieldLabel:t("password"),allowBlank:true,minLength:6,readOnly:App.user.isClient},{name:"callerid",fieldLabel:t("callerid"),allowBlank:true},{name:"disallow",fieldLabel:"disallow",value:"all",hidden:!App.user.isAdmin,allowBlank:App.user.isClient},{xtype:"checkboxgroup",columns:3,fieldLabel:t("codec"),items:[{boxLabel:"g729",name:"allow",inputValue:"g729",checked:true},{boxLabel:"g723",name:"allow",inputValue:"g723"},{boxLabel:"gsm",name:"allow",inputValue:"gsm",checked:true},{boxLabel:"g726",name:"allow",inputValue:"g726"},{boxLabel:"alaw",name:"allow",inputValue:"alaw",checked:true},{boxLabel:"ulaw",name:"allow",inputValue:"ulaw",checked:true},{boxLabel:"g722",name:"allow",inputValue:"g722"},{boxLabel:"ilbc",name:"allow",inputValue:"ilbc"},{boxLabel:"speex",name:"allow",inputValue:"speex"},{boxLabel:"h261",name:"allow",inputValue:"h261"},{boxLabel:"h263",name:"allow",inputValue:"h263"}],hidden:!App.user.isAdmin,allowBlank:App.user.isClient},{name:"host",fieldLabel:t("host"),value:"dynamic",hidden:App.user.isClient,allowBlank:App.user.isClient}]},{title:t("natdetails"),hidden:!App.user.isAdmin,items:[{name:"nat",fieldLabel:"nat",value:App.user.asteriskVersion=="1.8"?"yes":"force_rport,comedia",allowBlank:!App.user.isAdmin}]},{title:t("suplementaryInfo"),hidden:!App.user.isAdmin,items:[{name:"context",fieldLabel:t("context"),value:"billing",hidden:!App.user.isAdmin,allowBlank:true},{xtype:"yesnostringcombo",name:"qualify",fieldLabel:"qualify",value:"no",allowBlank:!App.user.isAdmin},{name:"dtmfmode",fieldLabel:"dtmfmode",value:"RFC2833",allowBlank:!App.user.isAdmin},{name:"insecure",fieldLabel:"insecure",value:"no",allowBlank:true},{name:"type",fieldLabel:"type",value:"friend",allowBlank:!App.user.isAdmin},{name:"calllimit",xtype:"numberfield",fieldLabel:t("calllimit"),value:"0",allowBlank:!App.user.isAdmin}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["iaxform"],["component","box","container","panel","form","iaxform"],{component:true,box:true,container:true,panel:true,form:true,iaxform:true},["widget.iaxform"],0,[MBilling.view.iax,"Form"],0));(Ext.cmd.derive("MBilling.view.iax.Lookup",Ext.ux.form.field.Lookup,{name:"id_iax",fieldLabel:t("Iax"),displayField:"idIaxname",displayFieldList:"name",gridConfig:{xtype:"iaxlist",fieldSearch:"name",columns:[{header:t("Account"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:2},{header:t("name"),dataIndex:"name",flex:2}]}},0,["siaxlookup"],["component","box","container","fieldcontainer","siaxlookup"],{component:true,box:true,container:true,fieldcontainer:true,siaxlookup:true},["widget.siaxlookup"],0,[MBilling.view.iax,"Lookup"],0));(Ext.cmd.derive("MBilling.view.callOnLine.Controller",Ext.ux.app.ViewController,{onEdit:function(){var d=this,e=d.list.getSelectionModel().getSelection()[0],f=e.get("uniqueid");Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments);Ext.Ajax.request({url:"index.php/callOnLine/getChannelDetails",params:{id:e.get("uniqueid"),channel:e.get("canal"),server:e.get("server")},scope:d,success:function(a){a=Ext.decode(a.responseText);if(a[d.nameSuccessRequest]){d.formPanel.getForm().findField("description").setValue(a.description);d.formPanel.getForm().findField("codec").setValue(a.codec);d.formPanel.getForm().findField("reinvite").setValue(a.reinvite);d.formPanel.getForm().findField("from_ip").setValue(a.from_ip);d.formPanel.getForm().findField("ndiscado").setValue(a.ndiscado);d.formPanel.getForm().findField("billsec").setValue(a.billsec);d.formPanel.getForm().findField("callerid").setValue(a.callerid)}else{Ext.ux.Alert.alert(d.titleError,a[d.nameMsgRequest],"error")}}})},onSpyCallFree:function(e){var f=this,d=f.list.getSelectionModel().getSelection()[0];if(f.list.getSelectionModel().getSelection().length==1){Ext.Ajax.request({url:"index.php/callOnLine/spyCall",params:{type:"b",channel:d.get("canal")},scope:f,success:function(a){a=Ext.decode(a.responseText);if(a[f.nameSuccessRequest]){Ext.ux.Alert.alert(f.titleSuccess,a[f.nameMsgRequest],"success")}else{Ext.ux.Alert.alert(f.titleError,a[f.nameMsgRequest],"error")}}})}else{Ext.ux.Alert.alert(f.titleError,"Please Select only a record","notification")}},onDelete:function(e){var f=this,d=f.list.getSelectionModel().getSelection()[0];if(f.list.getSelectionModel().getSelection().length==1){Ext.Ajax.request({url:"index.php/callOnLine/destroy",params:{id:d.get("uniqueid")},scope:f,success:function(a){a=Ext.decode(a.responseText);if(a[f.nameSuccessRequest]){Ext.ux.Alert.alert(f.titleSuccess,a[f.nameMsgRequest],"success")}else{Ext.ux.Alert.alert(f.titleError,a[f.nameMsgRequest],"error")}}})}else{Ext.ux.Alert.alert(f.titleError,"Please Select only a record","notification")}f.store.load()}},0,0,0,0,["controller.callonline"],0,[MBilling.view.callOnLine,"Controller"],0));(Ext.cmd.derive("MBilling.view.callOnLine.Module",Ext.ux.panel.Module,{controller:"callonline"},0,["callonlinemodule"],["component","box","container","uxpanelmodule","callonlinemodule"],{component:true,box:true,container:true,uxpanelmodule:true,callonlinemodule:true},["widget.callonlinemodule"],0,[MBilling.view.callOnLine,"Module"],0));(Ext.cmd.derive("MBilling.view.callOnLine.SpyCall",Ext.window.Window,{modal:true,layout:"fit",iconCls:"call",title:t("Spy call"),width:450,height:window.isThemeNeptune||window.isThemeCrisp?170:window.isThemeTriton?290:170,labelWidthFields:80,channel:0,initComponent:function(){var b=this;if(b.list.getSelectionModel().getSelection().length==1){selected=b.list.getSelectionModel().getSelection()[0];if(selected.get("canal")){b.channel=selected.get("canal")}else{b.channel=selected.get("channel")}b.title=t("Spy call")+" "+selected.get("ndiscado")+" "+b.channel,b.autoShow=true;b.items=[{xtype:"form",bodyPadding:5,defaults:{anchor:"0",enableKeyEvents:true,labelWidth:b.labelWidthFields,msgTarget:"side",plugins:"markallowblank",allowBlank:false},items:[{xtype:"siplookup",name:"id_sip",displayField:t("Sip Account")},{xtype:"combobox",name:"type",value:"b",forceSelection:true,editable:false,store:[["b",t("Only Spy")],["w",t("Whisper, can talk to the spied")],["W",t("Whisper, can talk to the spied but cannot listen the call")]],fieldLabel:t("Spy type")}]}];b.title=b.title+(b.titleModule?" - "+b.titleModule:"");b.bbar=[{width:150,text:t("Send"),scope:b,handler:b.onSendSpy}]}else{Ext.ux.Alert.alert(b.titleError,"Please Select only a record","notification")}Ext.window.Window.prototype.initComponent.apply(this,arguments)},onSendSpy:function(d){var f=this,e=f.list.store;if(!f.down("form").isValid()){Ext.ux.Alert.alert("Alert",t("Select sip account"),"notification");return}f.list.setLoading(true);Ext.Ajax.setTimeout(1000000);f.down("form").submit({url:"index.php/callOnLine/spyCall",params:{id_sip:selected.get("id_sip"),type:selected.get("type"),channel:f.channel},scope:f,success:function(c,b){var a=Ext.decode(b.response.responseText);if(a.success){Ext.ux.Alert.alert(t("Success"),a.msg,"success")}else{Ext.ux.Alert.alert(t("Error"),a.errors,"error")}d.enable();f.list.setLoading(false);e.load();f.close()},failure:function(c,b){console.log(b.response.responseText);if(b.response&&Ext.isObject(b.response.responseText)){var a=Ext.decode(b.response.responseText);Ext.ux.Alert.alert(t("Error1"),a.errors,"error")}else{Ext.ux.Alert.alert(t("Error2"),Ext.decode(b.response.responseText).msg,"error",true,10)}d.enable()}})}},0,["callonlinespycall"],["component","box","container","panel","window","callonlinespycall"],{component:true,box:true,container:true,panel:true,window:true,callonlinespycall:true},["widget.callonlinespycall"],0,[MBilling.view.callOnLine,"SpyCall"],0));(Ext.cmd.derive("MBilling.view.callOnLine.List",Ext.ux.grid.Panel,{store:"CallOnLine",fieldSearch:"idUser.username",refreshTime:15,initComponent:function(){var b=this;b.buttonCsv=false;b.allowPrint=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=!App.user.isClient;b.textDelete=t("Hangup Call"),b.buttonDeleteWidth=140,b.refreshTime=(localStorage&&localStorage.getItem("callonlinerefresh"))||b.refreshTime;b.extraButtons=[{text:t("Spy")+" "+t("call"),iconCls:"call",handler:window.multSpy?"onSpyCall":"onSpyCallFree",width:130,disabled:false},{xtype:"numberfield",field:"jmlhBrg",fieldLabel:t("Refresh Time"),editable:false,minValue:5,labelWidth:90,width:150,selectOnFocus:true,allowDecimals:true,decimalPrecision:2,value:b.refreshTime,listeners:{change:function(a){if(a.value>0){b.refreshTime=a.value;localStorage.setItem("callonlinerefresh",a.value)}}}}];b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("UniqueID"),dataIndex:"uniqueid",hidden:true,hideable:App.user.isAdmin},{header:t("Channel"),dataIndex:"canal",hidden:true,flex:3},{header:t("Sip Account"),dataIndex:"sip_account",flex:3},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:3},{header:t("credit"),dataIndex:"idUsercredit",filter:{type:"int",field:"idUser.credit"},renderer:Helper.Util.formatMoneyDecimal,flex:2},{header:t("number"),dataIndex:"ndiscado",flex:3},{header:t("status"),dataIndex:"status",filter:{type:"string",field:"status"},flex:2},{header:t("duration"),dataIndex:"duration",renderer:Helper.Util.formatsecondsToTime,flex:2},{header:t("trunk"),dataIndex:"tronco",flex:4,hidden:!App.user.isAdmin,hideable:App.user.isAdmin},{header:t("Server"),dataIndex:"server",flex:3,hidden:!window.slave||!App.user.isAdmin,hideable:App.user.isAdmin}];b.sessionLoad=Ext.create("Ext.util.DelayedTask",function(){b.store.load()},b);Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments);b.store.on("load",b.onLoadStore,b)},onLoadStore:function(){var b=this;b.onDeactivateModule();b.onActivateModule()},onRender:function(){var b=this;if(Ext.isObject(b.module)){b.module.on("activate",b.onActivateModule,b);b.module.on("deactivate",b.onDeactivateModule,b);b.module.on("close",b.onCloseModule,b)}Ext.ux.grid.Panel.prototype.onRender.apply(this,arguments)},onActivateModule:function(){this.sessionLoad&&this.sessionLoad.delay(this.refreshTime*1000)},onDeactivateModule:function(){this.sessionLoad&&this.sessionLoad.cancel()},onCloseModule:function(){this.onDeactivateModule();this.sessionLoad=null}},0,["callonlinelist"],["component","box","container","panel","tablepanel","gridpanel","grid","callonlinelist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callonlinelist:true},["widget.callonlinelist"],0,[MBilling.view.callOnLine,"List"],0));(Ext.cmd.derive("MBilling.view.callOnLine.List2",Ext.ux.grid.Panel,{store:"CallOnLine",fieldSearch:"username",refreshTime:10,initComponent:function(){var b=this;b.buttonCsv=false;b.allowPrint=false;b.buttonUpdateLot=false;b.allowCreate=false;b.buttonCleanFilter=false;b.allowUpdate=false;b.allowDelete=false;b.refreshTime=(localStorage&&localStorage.getItem("callonlinerefresh"))||b.refreshTime;b.extraButtons=[{xtype:"numberfield",field:"jmlhBrg",fieldLabel:t("Refresh Time"),editable:false,minValue:5,labelWidth:90,width:150,selectOnFocus:true,allowDecimals:true,decimalPrecision:2,value:b.refreshTime,listeners:{change:function(a){if(a.value>0){b.refreshTime=a.value;localStorage.setItem("callonlinerefresh",a.value)}}}}];b.columns=[{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:2},{header:t("Sip Account"),dataIndex:"canal",flex:3,hidden:true,hideable:true},{header:t("number"),dataIndex:"ndiscado",flex:3},{header:t("status"),dataIndex:"status",filter:{type:"string",field:"status"},flex:2},{header:t("duration"),dataIndex:"duration",renderer:Helper.Util.formatsecondsToTime,flex:2},{header:t("trunk"),dataIndex:"tronco",flex:4,hidden:App.user.isClient,hideable:!App.user.isClient}];b.sessionLoad=Ext.create("Ext.util.DelayedTask",function(){b.store.load()},b);Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments);b.store.on("load",b.onLoadStore,b)},onLoadStore:function(){var b=this;b.onDeactivateModule();b.onActivateModule()},onRender:function(){var b=this;if(Ext.isObject(b.module)){b.module.on("activate",b.onActivateModule,b);b.module.on("deactivate",b.onDeactivateModule,b);b.module.on("close",b.onCloseModule,b)}Ext.ux.grid.Panel.prototype.onRender.apply(this,arguments)},onActivateModule:function(){this.sessionLoad&&this.sessionLoad.delay(this.refreshTime*1000)},onDeactivateModule:function(){this.sessionLoad&&this.sessionLoad.cancel()},onCloseModule:function(){this.onDeactivateModule();this.sessionLoad=null}},0,["callonlinelist2"],["component","box","container","panel","tablepanel","gridpanel","grid","callonlinelist2"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callonlinelist2:true},["widget.callonlinelist2"],0,[MBilling.view.callOnLine,"List2"],0));(Ext.cmd.derive("MBilling.view.callOnLine.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{fieldLabel:t("number"),name:"ndiscado",readOnly:true},{fieldLabel:t("CallerID"),name:"callerid",readOnly:true},{fieldLabel:t("Real")+" "+t("duration"),name:"billsec",readOnly:true},{fieldLabel:t("Codec"),name:"codec",readOnly:true},{fieldLabel:t("Reinvite"),name:"reinvite",readOnly:true},{fieldLabel:t("From IP"),name:"from_ip",readOnly:true},{xtype:"textarea",name:"description",readOnly:true,height:350,anchor:"100%",hidden:!App.user.isAdmin}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callonlineform"],["component","box","container","panel","form","callonlineform"],{component:true,box:true,container:true,panel:true,form:true,callonlineform:true},["widget.callonlineform"],0,[MBilling.view.callOnLine,"Form"],0));(Ext.cmd.derive("MBilling.view.sendCreditSummary.Controller",Ext.ux.app.ViewController,{formHidden:true},0,0,0,0,["controller.sendcreditsummary"],0,[MBilling.view.sendCreditSummary,"Controller"],0));(Ext.cmd.derive("MBilling.view.sendCreditSummary.Module",Ext.form.Panel,{resizable:false,autoShow:true,header:false,items:[{xtype:"component",autoEl:{width:"100%",height:"100%",tag:"iframe",src:"index.php/sendCreditSummary/read"}}]},0,["sendcreditsummarymodule"],["component","box","container","panel","form","sendcreditsummarymodule"],{component:true,box:true,container:true,panel:true,form:true,sendcreditsummarymodule:true},["widget.sendcreditsummarymodule"],0,[MBilling.view.sendCreditSummary,"Module"],0));(Ext.cmd.derive("MBilling.view.sendCreditSummary.List",Ext.ux.grid.Panel,{store:"SendCreditSummary",initComponent:function(){var b=this;b.extraButtons=[{emptyText:t("From Day"),xtype:"searchfield",fieldFilter:"date",filterOnClick:b.filterFieldOnClick,store:b.store,comparison:"gt",type:"date"},{emptyText:t("To Day"),xtype:"searchfield",fieldFilter:"date",filterOnClick:b.filterFieldOnClick,store:b.store,comparison:"lt",type:"date"}];b.buttonCsv=false;b.buttonPrint=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("day"),renderer:Ext.util.Format.dateRenderer("Y-m-d"),dataIndex:"day",menuDisabled:true,flex:3},{header:t("service"),dataIndex:"service",flex:5},{header:t("Total cost"),dataIndex:"total_cost",flex:5,renderer:Helper.Util.formatMoneyDecimal2},{header:t("Total sale"),dataIndex:"total_sale",flex:5,renderer:Helper.Util.formatMoneyDecimal2},{header:t("Earned"),dataIndex:"earned",flex:5,renderer:Helper.Util.formatMoneyDecimal2}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["sendcreditsummarylist"],["component","box","container","panel","tablepanel","gridpanel","grid","sendcreditsummarylist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,sendcreditsummarylist:true},["widget.sendcreditsummarylist"],0,[MBilling.view.sendCreditSummary,"List"],0));(Ext.cmd.derive("MBilling.view.sendCreditSummary.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:App.user.isClient}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["sendcreditsummaryform"],["component","box","container","panel","form","sendcreditsummaryform"],{component:true,box:true,container:true,panel:true,form:true,sendcreditsummaryform:true},["widget.sendcreditsummaryform"],0,[MBilling.view.sendCreditSummary,"Form"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayUser.Controller",Ext.ux.app.ViewController,{onEdit:function(){me=this;me.sumData=me.store.getData().items[0].getData();if(!me.sumData){return}me.formPanel.getForm().getFields().each(function(b){b.setValue(me.sumData[b.name])});me.formPanel.expand()},onExportCsvDayUser:function(o,l,g){var m=this,j=m.list.getStore(),n=m.list.filters.getFilterData().length?Ext.encode(m.list.filters.getFilterData()):j.proxy.extraParams.filter;window.open("index.php/callSummaryDayUser/exportCsvCalls?id="+o.getStore().getAt(l).getData().idUserusername+"&filter="+n)}},0,0,0,0,["controller.callsummarydayuser"],0,[MBilling.view.callSummaryDayUser,"Controller"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayUser.Module",Ext.ux.panel.Module,{controller:"callsummarydayuser",titleDetails:t("total"),iconForm:"icon-sum",cfgEast:{flex:0.4}},0,["callsummarydayusermodule"],["component","box","container","uxpanelmodule","callsummarydayusermodule"],{component:true,box:true,container:true,uxpanelmodule:true,callsummarydayusermodule:true},["widget.callsummarydayusermodule"],0,[MBilling.view.callSummaryDayUser,"Module"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayUser.List",Ext.ux.grid.Panel,{store:"CallSummaryDayUser",initComponent:function(){var b=this;b.buttonImportCsv=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{xtype:"actioncolumn",width:26,sortable:false,menuDisabled:true,header:t(""),dataIndex:"id",items:[{iconCls:"icon-export-csv",tooltip:t("Export CSV"),handler:"onExportCsvDayUser"}],hidden:!App.user.isAdmin},{header:t("day"),renderer:Ext.util.Format.dateRenderer("Y-m-d"),dataIndex:"day",filter:{type:"date",field:"day"},flex:3},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("sessiontime")+" "+t("Min"),dataIndex:"sessiontime",flex:2},{header:t("aloc_all_calls"),dataIndex:"aloc_all_calls",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Answered Calls"),dataIndex:"nbcall",flex:3},{header:t("buycost"),dataIndex:App.user.isAdmin?"buycost":"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("sessionbill"),dataIndex:App.user.isAgent||App.user.isClientAgent?"agent_bill":"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("markup"),dataIndex:"lucro",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarydayuserlist"],["component","box","container","panel","tablepanel","gridpanel","grid","callsummarydayuserlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callsummarydayuserlist:true},["widget.callsummarydayuserlist"],0,[MBilling.view.callSummaryDayUser,"List"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayUser.Form",Ext.ux.form.Panel,{defaults:{},labelWidthFields:100,defaultType:"displayfield",initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{name:"sumsessiontime",fieldLabel:t("sessiontime")+" "+t("Min"),renderer:Ext.util.Format.numberRenderer("0"),allowBlank:true},{name:App.user.isAgent||App.user.isClientAgent?"sumagent_bill":"sumsessionbill",fieldLabel:t("sessionbill"),renderer:Helper.Util.formatMoneyDecimal,allowBlank:true},{name:App.user.isAdmin?"sumbuycost":"sumsessionbill",fieldLabel:t("buycost"),renderer:Helper.Util.formatMoneyDecimal,hidden:App.user.isClient,allowBlank:true},{name:"sumlucro",fieldLabel:t("markup"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumnbcall",fieldLabel:t("nbcall"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarydayuserform"],["component","box","container","panel","form","callsummarydayuserform"],{component:true,box:true,container:true,panel:true,form:true,callsummarydayuserform:true},["widget.callsummarydayuserform"],0,[MBilling.view.callSummaryDayUser,"Form"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayTrunk.Controller",Ext.ux.app.ViewController,{onEdit:function(){me=this;me.sumData=me.store.getData().items[0].getData();if(!me.sumData){return}me.formPanel.getForm().getFields().each(function(b){b.setValue(me.sumData[b.name])});me.formPanel.expand()}},0,0,0,0,["controller.callsummarydaytrunk"],0,[MBilling.view.callSummaryDayTrunk,"Controller"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayTrunk.Module",Ext.ux.panel.Module,{controller:"callsummarydaytrunk",titleDetails:t("total"),iconForm:"icon-sum",cfgEast:{flex:0.4}},0,["callsummarydaytrunkmodule"],["component","box","container","uxpanelmodule","callsummarydaytrunkmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callsummarydaytrunkmodule:true},["widget.callsummarydaytrunkmodule"],0,[MBilling.view.callSummaryDayTrunk,"Module"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayTrunk.List",Ext.ux.grid.Panel,{store:"CallSummaryDayTrunk",initComponent:function(){var b=this;b.buttonImportCsv=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{header:t("day"),renderer:Ext.util.Format.dateRenderer("Y-m-d"),dataIndex:"day",filter:{type:"date",field:"day"},flex:3},{header:t("Trunk"),dataIndex:"idTrunktrunkcode",filter:{type:"string",field:"idTrunk.trunkcode"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("sessiontime")+" "+t("Min"),dataIndex:"sessiontime",flex:2},{header:t("aloc_all_calls"),dataIndex:"aloc_all_calls",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Answered Calls"),dataIndex:"nbcall",flex:3},{header:t("buycost"),dataIndex:"buycost",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("sessionbill"),dataIndex:"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("markup"),dataIndex:"lucro",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarydaytrunklist"],["component","box","container","panel","tablepanel","gridpanel","grid","callsummarydaytrunklist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callsummarydaytrunklist:true},["widget.callsummarydaytrunklist"],0,[MBilling.view.callSummaryDayTrunk,"List"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayTrunk.Form",Ext.ux.form.Panel,{defaults:{},labelWidthFields:100,defaultType:"displayfield",initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{name:"sumsessiontime",fieldLabel:t("sessiontime")+" "+t("Min"),renderer:Ext.util.Format.numberRenderer("0"),allowBlank:true},{name:"sumsessionbill",fieldLabel:t("sessionbill"),renderer:Helper.Util.formatMoneyDecimal,allowBlank:true},{name:"sumbuycost",fieldLabel:t("buycost"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumlucro",fieldLabel:t("markup"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumnbcall",fieldLabel:t("nbcall"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarydaytrunkform"],["component","box","container","panel","form","callsummarydaytrunkform"],{component:true,box:true,container:true,panel:true,form:true,callsummarydaytrunkform:true},["widget.callsummarydaytrunkform"],0,[MBilling.view.callSummaryDayTrunk,"Form"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayAgent.Controller",Ext.ux.app.ViewController,{onEdit:function(){me=this;me.sumData=me.store.getData().items[0].getData();if(!me.sumData){return}me.formPanel.getForm().getFields().each(function(b){b.setValue(me.sumData[b.name])});me.formPanel.expand()}},0,0,0,0,["controller.callsummarydayagent"],0,[MBilling.view.callSummaryDayAgent,"Controller"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayAgent.Module",Ext.ux.panel.Module,{controller:"callsummarydayagent",titleDetails:t("total"),iconForm:"icon-sum",cfgEast:{flex:0.4}},0,["callsummarydayagentmodule"],["component","box","container","uxpanelmodule","callsummarydayagentmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callsummarydayagentmodule:true},["widget.callsummarydayagentmodule"],0,[MBilling.view.callSummaryDayAgent,"Module"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayAgent.List",Ext.ux.grid.Panel,{store:"CallSummaryDayAgent",initComponent:function(){var b=this;b.buttonImportCsv=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{header:t("day"),renderer:Ext.util.Format.dateRenderer("Y-m-d"),dataIndex:"day",filter:{type:"date",field:"day"},flex:3},{header:t("Agent"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{menuDisabled:true,header:t("sessiontime")+" "+t("Min"),dataIndex:"sessiontime",flex:2},{header:t("aloc_all_calls"),dataIndex:"aloc_all_calls",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Answered Calls"),dataIndex:"nbcall",flex:3},{header:t("buycost"),dataIndex:"buycost",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("sessionbill"),dataIndex:"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("markup"),dataIndex:"lucro",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarydayagentlist"],["component","box","container","panel","tablepanel","gridpanel","grid","callsummarydayagentlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callsummarydayagentlist:true},["widget.callsummarydayagentlist"],0,[MBilling.view.callSummaryDayAgent,"List"],0));(Ext.cmd.derive("MBilling.view.callSummaryDayAgent.Form",Ext.ux.form.Panel,{defaults:{},labelWidthFields:100,defaultType:"displayfield",initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{name:"sumsessiontime",fieldLabel:t("sessiontime")+" "+t("Min"),renderer:Ext.util.Format.numberRenderer("0"),allowBlank:true},{name:"sumsessionbill",fieldLabel:t("sessionbill"),renderer:Helper.Util.formatMoneyDecimal,allowBlank:true},{name:"sumbuycost",fieldLabel:t("buycost"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumlucro",fieldLabel:t("markup"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumnbcall",fieldLabel:t("nbcall"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarydayagentform"],["component","box","container","panel","form","callsummarydayagentform"],{component:true,box:true,container:true,panel:true,form:true,callsummarydayagentform:true},["widget.callsummarydayagentform"],0,[MBilling.view.callSummaryDayAgent,"Form"],0));(Ext.cmd.derive("MBilling.view.callerid.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.callerid"],0,[MBilling.view.callerid,"Controller"],0));(Ext.cmd.derive("MBilling.view.callerid.Module",Ext.ux.panel.Module,{controller:"callerid"},0,["calleridmodule"],["component","box","container","uxpanelmodule","calleridmodule"],{component:true,box:true,container:true,uxpanelmodule:true,calleridmodule:true},["widget.calleridmodule"],0,[MBilling.view.callerid,"Module"],0));(Ext.cmd.derive("MBilling.view.callerid.List",Ext.ux.grid.Panel,{store:"Callerid",initComponent:function(){var b=this;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("cid"),dataIndex:"cid",flex:4},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("status"),dataIndex:"activated",renderer:Helper.Util.formatBooleanActive,comboRelated:"booleancombo",flex:2,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")]]}}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["calleridlist"],["component","box","container","panel","tablepanel","gridpanel","grid","calleridlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,calleridlist:true},["widget.calleridlist"],0,[MBilling.view.callerid,"List"],0));(Ext.cmd.derive("MBilling.view.callerid.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["id_user"],initComponent:function(){var b=this;b.items=[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"cid",fieldLabel:t("cid")},{xtype:"booleancombo",name:"activated",fieldLabel:t("status"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["calleridform"],["component","box","container","panel","form","calleridform"],{component:true,box:true,container:true,panel:true,form:true,calleridform:true},["widget.calleridform"],0,[MBilling.view.callerid,"Form"],0));(Ext.cmd.derive("MBilling.view.restrictedPhonenumber.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.restrictedphonenumber"],0,[MBilling.view.restrictedPhonenumber,"Controller"],0));(Ext.cmd.derive("MBilling.view.restrictedPhonenumber.Module",Ext.ux.panel.Module,{controller:"restrictedphonenumber"},0,["restrictedphonenumbermodule"],["component","box","container","uxpanelmodule","restrictedphonenumbermodule"],{component:true,box:true,container:true,uxpanelmodule:true,restrictedphonenumbermodule:true},["widget.restrictedphonenumbermodule"],0,[MBilling.view.restrictedPhonenumber,"Module"],0));(Ext.cmd.derive("MBilling.view.restrictedPhonenumber.List",Ext.ux.grid.Panel,{store:"RestrictedPhonenumber",buttonImportCsv:true,initComponent:function(){var b=this;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:2,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("number"),dataIndex:"number",flex:2}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["restrictedphonenumberlist"],["component","box","container","panel","tablepanel","gridpanel","grid","restrictedphonenumberlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,restrictedphonenumberlist:true},["widget.restrictedphonenumberlist"],0,[MBilling.view.restrictedPhonenumber,"List"],0));(Ext.cmd.derive("MBilling.view.restrictedPhonenumber.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["id_user"],initComponent:function(){var b=this;b.items=[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,readOnly:App.user.isClient,allowBlank:App.user.isClient},{name:"number",fieldLabel:t("number")}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["restrictedphonenumberform"],["component","box","container","panel","form","restrictedphonenumberform"],{component:true,box:true,container:true,panel:true,form:true,restrictedphonenumberform:true},["widget.restrictedphonenumberform"],0,[MBilling.view.restrictedPhonenumber,"Form"],0));(Ext.cmd.derive("MBilling.view.restrictedPhonenumber.ImportCsv",Ext.ux.window.ImportCsv,{htmlTipInfo:"
number
",fieldsImport:[{xtype:"usercombo",width:350}]},0,["restrictedphonenumberimportcsv"],["component","box","container","panel","window","restrictedphonenumberimportcsv"],{component:true,box:true,container:true,panel:true,window:true,restrictedphonenumberimportcsv:true},["widget.restrictedphonenumberimportcsv"],0,[MBilling.view.restrictedPhonenumber,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.did.Controller",Ext.ux.app.ViewController,{isSubmitForm:true,init:function(){var b=this;b.control({"booleancombo[name=cbr]":{select:b.onSelectcbr},"noyescombo[name=cbr_ua]":{select:b.onSelectcbrAu}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectcbr:function(c,d){me=this,form=me.formPanel.getForm();form.findField("cbr_ua").setVisible(d.data.field1);form.findField("cbr_total_try").setVisible(d.data.field1);form.findField("cbr_time_try").setVisible(d.data.field1)},onSelectcbrAu:function(c,d){me=this,form=me.formPanel.getForm();form.findField("cbr_em").setVisible(d.data.field1);form.findField("TimeOfDay_monFri").setVisible(d.data.field1);form.findField("TimeOfDay_sat").setVisible(d.data.field1);form.findField("TimeOfDay_sun").setVisible(d.data.field1);form.findField("workaudio").setVisible(d.data.field1);form.findField("noworkaudio").setVisible(d.data.field1)},onNew:function(e){var f=this,d=f.formPanel.getForm();d.findField("cbr_ua").setVisible(false);d.findField("cbr_em").setVisible(false);d.findField("TimeOfDay_monFri").setVisible(false);d.findField("TimeOfDay_sat").setVisible(false);d.findField("TimeOfDay_sun").setVisible(false);d.findField("workaudio").setVisible(false);d.findField("noworkaudio").setVisible(false);d.findField("cbr_total_try").setVisible(false);d.findField("cbr_time_try").setVisible(false);Ext.ux.app.ViewController.prototype.onNew.apply(this,arguments)},onEdit:function(){var c=this,d=c.list.getSelectionModel().getSelection()[0];if(d.get("cbr")==0){c.formPanel.getForm().findField("cbr_ua").setVisible(false);c.formPanel.getForm().findField("cbr_em").setVisible(false);c.formPanel.getForm().findField("TimeOfDay_monFri").setVisible(false);c.formPanel.getForm().findField("TimeOfDay_sat").setVisible(false);c.formPanel.getForm().findField("TimeOfDay_sun").setVisible(false);c.formPanel.getForm().findField("workaudio").setVisible(false);c.formPanel.getForm().findField("noworkaudio").setVisible(false);c.formPanel.getForm().findField("cbr_total_try").setVisible(false);c.formPanel.getForm().findField("cbr_time_try").setVisible(false)}else{c.formPanel.getForm().findField("cbr_ua").setVisible(true);if(d.get("cbr_ua")==1){c.formPanel.getForm().findField("cbr_em").setVisible(true);c.formPanel.getForm().findField("TimeOfDay_monFri").setVisible(true);c.formPanel.getForm().findField("TimeOfDay_sat").setVisible(true);c.formPanel.getForm().findField("TimeOfDay_sun").setVisible(true);c.formPanel.getForm().findField("workaudio").setVisible(true);c.formPanel.getForm().findField("noworkaudio").setVisible(true);c.formPanel.getForm().findField("cbr_total_try").setVisible(true);c.formPanel.getForm().findField("cbr_time_try").setVisible(true)}}Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)},onDelete:function(j){var g=this,e=g.list.getSelectionModel().getSelection(),f=true;Ext.each(e,function(a){if(a.get("reserved")===1){Ext.ux.Alert.alert(g.titleError,t("Please, first release the DID")+" "+a.raw.did,"error");f=false;return}});if(f==true){Ext.ux.app.ViewController.prototype.onDelete.apply(this,arguments)}},onRelease:function(o,l){var m=this,n=m.list.getSelectionModel().getSelection()[0],j=t("Confirm Release Did")+" "+n.get("did"),g=m.list.getStore();if(m.list.getSelectionModel().getSelection().length>1){Ext.ux.Alert.alert(m.titleError,t("Please Select only one DID to release"),"error")}else{if(n.get("reserved")===0){Ext.ux.Alert.alert(m.titleError,t("didIsNotUse"),"error");g.load()}else{Ext.Msg.confirm(m.titleConfirmation,j,function(a){if(a==="yes"){Ext.Ajax.request({url:"index.php/did/liberar",params:{id:n.get("id")},success:function(c){c=Ext.decode(c.responseText);if(c[m.nameSuccessRequest]){Ext.ux.Alert.alert(m.titleSuccess,c[m.nameMsgRequest],"success");g.load()}else{var b=Helper.Util.convertErrorsJsonToString(c[m.nameMsgRequest]);g.load()}}})}},m)}}},onBuyDid:function(){var m=this,j=m.lookupReference("buydidPanel"),f=j.getForm().findField("did").getValue(),l=j.getForm().findField("did").rawValue,g=t("confirmationBuyDid");if(f<1){Ext.ux.Alert.alert(m.titleError,t("Please, select a Did"),"warning")}else{Ext.Msg.confirm(t("Confirmation"),g+"
"+l,function(a){if(a==="yes"){Ext.ux.Alert.alert(m.titleSuccess,t("Please wait....We are activing your DID."),"notification");Ext.Ajax.request({url:"index.php/did/buy",params:{id:f},success:function(c){c=Ext.decode(c.responseText);if(c.success){Ext.ux.Alert.alert(m.titleSuccess,t(c.msg),"success",true,true,5000)}else{var b=Helper.Util.convertErrorsJsonToString(c.msg);Ext.ux.Alert.alert(m.titleError,t(b),"warning",true,true,5000)}}})}},m)}}},0,0,0,0,["controller.did"],0,[MBilling.view.did,"Controller"],0));(Ext.cmd.derive("MBilling.view.did.Combo",Ext.form.field.ComboBox,{name:"id_did",fieldLabel:t("did"),displayField:"did",forceSelection:true,editable:true,valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Did",{proxy:{type:"uxproxy",module:"did",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["didcombo"],["component","box","field","textfield","pickerfield","combobox","combo","didcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,didcombo:true},["widget.didcombo"],0,[MBilling.view.did,"Combo"],0));(Ext.cmd.derive("MBilling.view.did.BuyCombo",Ext.form.field.ComboBox,{name:"id_did",forceSelection:true,editable:false,fieldLabel:t("did"),displayField:"did",valueField:"id",listConfig:{itemTpl:Ext.create("Ext.XTemplate","
{did} ("+t("Setup")+": "+t("moedasimblo")+" {connection_charge} --> "+t("monthly payment")+": "+t("moedasimblo")+" {fixrate})
")},displayTpl:Ext.create("Ext.XTemplate",'{did} ('+t("Setup")+": "+t("moedasimblo")+" {connection_charge} --> "+t("monthly payment")+": "+t("moedasimblo")+" {fixrate})"),initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Did",{proxy:{type:"uxproxy",module:"did",actionRead:"readBuy",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["didbuycombo"],["component","box","field","textfield","pickerfield","combobox","combo","didbuycombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,didbuycombo:true},["widget.didbuycombo"],0,[MBilling.view.did,"BuyCombo"],0));(Ext.cmd.derive("MBilling.view.did.Module",Ext.ux.panel.Module,{controller:"did"},0,["didmodule"],["component","box","container","uxpanelmodule","didmodule"],{component:true,box:true,container:true,uxpanelmodule:true,didmodule:true},["widget.didmodule"],0,[MBilling.view.did,"Module"],0));(Ext.cmd.derive("MBilling.view.did.List",Ext.ux.grid.Panel,{store:"Did",fieldSearch:"did",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.extraButtons=[{text:t("crearToReleaseDid"),iconCls:"icon-delete",handler:"onRelease",disabled:false}];b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("did"),dataIndex:"did",flex:4},{header:t("reserved"),dataIndex:"reserved",renderer:Helper.Util.formattyyesno,flex:2,filter:{type:"list",options:[[1,t("yes")],[0,t("no")]]},hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:3,menuDisabled:true},{header:t("status"),dataIndex:"activated",renderer:Helper.Util.formatBooleanActive,flex:2,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")]]},hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("connection_charge"),dataIndex:"connection_charge",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("price")+" "+t("per")+" "+t("monthly"),dataIndex:"fixrate",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("secondusedreal"),renderer:Helper.Util.formatsecondsToTime,dataIndex:"secondusedreal",flex:3},{header:t("Description"),dataIndex:"description",hidden:true,hideable:App.user.isAdmin,flex:5}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["didlist"],["component","box","container","panel","tablepanel","gridpanel","grid","didlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,didlist:true},["widget.didlist"],0,[MBilling.view.did,"List"],0));(Ext.cmd.derive("MBilling.view.did.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["did"],initComponent:function(){var b=this;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{labelAlign:"right",plugins:"markallowblank",allowBlank:false,anchor:"100%",enableKeyEvents:true,labelWidth:140}},items:[{title:t("general"),items:[{name:"did",fieldLabel:t("did"),readOnly:App.user.isClient||App.user.isAgent},{xtype:"booleancombo",name:"activated",fieldLabel:t("status"),hidden:App.user.isClient||App.user.isAgent,allowBlank:true},{xtype:"moneyfield",name:"connection_charge",fieldLabel:t("connection_charge"),value:"0",hidden:App.user.isClient||App.user.isAgent},{xtype:"moneyfield",name:"fixrate",fieldLabel:t("Monthly")+" "+t("price"),value:"0",hidden:App.user.isClient||App.user.isAgent},{style:"margin-top:5px",xtype:"fieldset",title:t("Did")+" "+t("increment"),collapsible:false,collapsed:false,hidden:!App.user.isAdmin,defaults:{labelWidth:160,anchor:"100%",labelAlign:b.labelAlignFields},items:[{xtype:"moneyfield",name:"connection_sell",fieldLabel:t("Connetion charge"),value:"0",hidden:!App.user.isAdmin},{xtype:"numberfield",name:"minimal_time_charge",fieldLabel:t("Minimal time to charge"),value:"0",hidden:!App.user.isAdmin},{xtype:"numberfield",name:"initblock",fieldLabel:t("initblock"),value:"0",hidden:!App.user.isAdmin},{xtype:"numberfield",name:"increment",fieldLabel:t("billingblock"),value:"0",hidden:!App.user.isAdmin}]},{xtype:"combobox",name:"charge_of",fieldLabel:t("Charge")+" "+t("of"),value:1,forceSelection:true,editable:false,store:[[1,t("Owner DID")],[0,t("Caller ID, only allow call from registered callerID")]],hidden:App.user.isClient||App.user.isAgent},{xtype:"numberfield",name:"calllimit",fieldLabel:t("Channel Limit"),value:"-1",minValue:"-1",hidden:!window.didChannelLimit||!App.user.isAdmin},{xtype:"textareafield",allowBlank:true,name:"description",fieldLabel:t("description"),hidden:!App.user.isAdmin}]},{title:t("Billing"),items:[{style:"margin-top:5px",xtype:"fieldset",title:t("Did Billing per minute")+" "+t("rate")+" 1",collapsible:false,collapsed:false,hidden:!App.user.isAdmin,defaults:{labelWidth:170,anchor:"100%",labelAlign:b.labelAlignFields},items:[{xtype:"textfield",name:"expression_1",fieldLabel:t("Regular expression"),value:"*",hidden:!App.user.isAdmin},{xtype:"moneyfield",name:"selling_rate_1",fieldLabel:t("Sell price per min"),value:"0",hidden:!App.user.isAdmin},{xtype:"noyescombo",name:"block_expression_1",fieldLabel:t("Block calls from this expression"),hidden:!App.user.isAdmin},{xtype:"noyescombo",name:"send_to_callback_1",fieldLabel:t("Send the call to Callback"),hidden:!App.user.isAdmin}]},{style:"margin-top:25px",xtype:"fieldset",title:t("Did Billing per minute")+" "+t("rate")+" 2",collapsible:false,collapsed:false,hidden:!App.user.isAdmin,defaults:{labelWidth:160,anchor:"100%",labelAlign:b.labelAlignFields},items:[{xtype:"textfield",name:"expression_2",fieldLabel:t("Regular expression"),value:"*",hidden:!App.user.isAdmin},{xtype:"moneyfield",name:"selling_rate_2",fieldLabel:t("Sell price per min"),value:"0",hidden:!App.user.isAdmin},{xtype:"noyescombo",name:"block_expression_2",fieldLabel:t("Block calls from this expression"),hidden:!App.user.isAdmin},{xtype:"noyescombo",name:"send_to_callback_2",fieldLabel:t("Send the call to Callback"),hidden:!App.user.isAdmin}]},{style:"margin-top:25px",xtype:"fieldset",title:t("Did Billing per minute")+" "+t("rate")+" 3",collapsible:false,collapsed:false,hidden:!App.user.isAdmin,defaults:{labelWidth:160,anchor:"100%",labelAlign:b.labelAlignFields},items:[{xtype:"textfield",name:"expression_3",fieldLabel:t("Regular expression"),value:"*",hidden:!App.user.isAdmin},{xtype:"moneyfield",name:"selling_rate_3",fieldLabel:t("Sell price per min"),value:"0",hidden:!App.user.isAdmin},{xtype:"noyescombo",name:"block_expression_3",fieldLabel:t("Block calls from this expression"),hidden:!App.user.isAdmin},{xtype:"noyescombo",name:"send_to_callback_3",fieldLabel:t("Send the call to Callback"),hidden:!App.user.isAdmin}]}]},{title:t("CallBack Pro"),hidden:!window.cbr,items:[{xtype:"booleancombo",name:"cbr",fieldLabel:t("CallBack Pro"),value:0,hidden:!window.cbr,allowBlank:true},{xtype:"noyescombo",name:"cbr_ua",fieldLabel:t("Use Audio"),value:0,hidden:true,allowBlank:true},{xtype:"numberfield",name:"cbr_total_try",fieldLabel:t("Maximum trying"),value:3,hidden:true,allowBlank:true,minValue:0},{xtype:"numberfield",name:"cbr_time_try",fieldLabel:t("Interval beteween trying"),value:30,hidden:true,allowBlank:true,minValue:10},{xtype:"noyescombo",name:"cbr_em",fieldLabel:t("Early Media"),hidden:true,allowBlank:true},{name:"TimeOfDay_monFri",fieldLabel:t("Mon-Fri"),value:"09:00-12:00|14:00-18:00",minLength:11,hidden:true},{name:"TimeOfDay_sat",fieldLabel:t("Sat"),value:"09:00-12:00",allowBlank:true,hidden:true},{name:"TimeOfDay_sun",fieldLabel:t("Sun"),value:"00:00",allowBlank:true,hidden:true},{xtype:"uploadfield",fieldLabel:t("workaudio"),emptyText:"Select an gsm File",allowBlank:true,name:"workaudio",extAllowed:["wav","gsm"],hidden:true},{xtype:"uploadfield",fieldLabel:t("noworkaudio"),emptyText:"Select an gsm File",allowBlank:true,name:"noworkaudio",extAllowed:["wav","gsm"],hidden:true}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["didform"],["component","box","container","panel","form","didform"],{component:true,box:true,container:true,panel:true,form:true,didform:true},["widget.didform"],0,[MBilling.view.did,"Form"],0));(Ext.cmd.derive("MBilling.view.did.ImportCsv",Ext.ux.window.ImportCsv,{htmlTipInfo:"
"+t("number")+", "+t("price")+" "+t("by")+" "+t("monthly")+", "+t("connection_charge")+"
551156332233, 10, 5
554153882200, 10, 5
554155667788, 10, 5
"+t("monthly")+" "+t("and")+" "+t("connection_charge")+" "+t("optional")+"",fieldsImport:[{fieldLabel:t("table"),hidden:true,allowBlank:true}]},0,["didimportcsv"],["component","box","container","panel","window","didimportcsv"],{component:true,box:true,container:true,panel:true,window:true,didimportcsv:true},["widget.didimportcsv"],0,[MBilling.view.did,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.didbuy.Module",Ext.form.Panel,{controller:"did",resizable:false,autoShow:true,header:false,initComponent:function(){var b=this;b.items=[{reference:"buydidPanel",xtype:"form",margin:"10 10 10 10",autoShow:true,closable:false,resizable:false,bodyPadding:10,defaultType:"textfield",defaults:{labelAlign:"right",labelWidth:175,width:280,allowBlank:false,msgTarget:"side",enableKeyEvents:true,plugins:"markallowblank",anchor:"100%"},items:[{xtype:"didbuycombo",fieldLabel:t("Select a Did"),name:"did"}],bbar:[{text:t("Next"),tooltip:t("Next"),glyph:icons.disk,handler:"onBuyDid"}]}];Ext.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["didbuymodule"],["component","box","container","panel","form","didbuymodule"],{component:true,box:true,container:true,panel:true,form:true,didbuymodule:true},["widget.didbuymodule"],0,[MBilling.view.didbuy,"Module"],0));(Ext.cmd.derive("MBilling.view.diddestination.Controller",Ext.ux.app.ViewController,{init:function(){var b=this;b.control({didtypefullcombo:{select:b.onSelectMethod},didtypefreecombo:{select:b.onSelectMethod}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectMethod:function(c,d){this.showFieldsRelated(d.getData().showFields)},showFieldsRelated:function(f){var d=this,e=d.formPanel.getForm().getFields();e.each(function(a){a.setVisible(f.indexOf(a.name)!==-1)})},onEdit:function(){var f=this,d=f.formPanel.getForm(),e=f.list.getSelectionModel().getSelection()[0];method=e?e.get("voip_call"):"sipcall";switch(method){case 0:method=t("callforpstn");break;case 1:method=t("sipcall");break;case 2:method=t("ivr");break;case 3:method="CallingCard";break;case 4:method=t("portalDeVoz");break;case 5:method=t("CID Callback");break;case 6:method=t("0800 Callback");break;case 7:method=t("Queue");break;case 8:method=t("Call Group");break;case 9:method=t("Custom");break}showFields=f.formPanel.down("didtypefullcombo").store.findRecord("name",method).getData().showFields;f.showFieldsRelated(showFields);d.findField("id_did").setReadOnly(true);Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)},onNew:function(){var f=this,d=f.formPanel.getForm(),e=f.list.getSelectionModel().getSelection()[0];d.findField("id_did").setReadOnly(false);method=t("sipcall");showFields=f.formPanel.down("didtypefullcombo").store.findRecord("name",method).getData().showFields;f.showFieldsRelated(showFields);Ext.ux.app.ViewController.prototype.onNew.apply(this,arguments)}},0,0,0,0,["controller.diddestination"],0,[MBilling.view.diddestination,"Controller"],0));(Ext.cmd.derive("MBilling.view.diddestination.Module",Ext.ux.panel.Module,{controller:"diddestination"},0,["diddestinationmodule"],["component","box","container","uxpanelmodule","diddestinationmodule"],{component:true,box:true,container:true,uxpanelmodule:true,diddestinationmodule:true},["widget.diddestinationmodule"],0,[MBilling.view.diddestination,"Module"],0));(Ext.cmd.derive("MBilling.view.diddestination.List",Ext.ux.grid.Panel,{store:"Diddestination",fieldSearch:"idDid.did",initComponent:function(){var b=this;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("did"),dataIndex:"idDiddid",filter:{type:"string",field:"idDid.did"},flex:5},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("type")+" "+t("of")+" "+t("call"),dataIndex:"voip_call",renderer:Helper.Util.formatDidType,comboRelated:"didtypecombo",flex:3,filter:{type:"list",options:[[0,t("callforpstn")],[1,t("sipcall")],[2,t("ivr")],[3,t("callingcard")],[4,t("portalDeVoz")],[5,t("CID Callback")],[6,t("0800 Callback")],[7,t("Queue")],[8,t("Call Group")],[9,t("Custom")]]}},{header:t("secondusedreal"),renderer:Helper.Util.formatsecondsToTime,dataIndex:"secondusedreal",flex:3},{header:t("creationdate"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"creationdate",flex:5}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["diddestinationlist"],["component","box","container","panel","tablepanel","gridpanel","grid","diddestinationlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,diddestinationlist:true},["widget.diddestinationlist"],0,[MBilling.view.diddestination,"List"],0));(Ext.cmd.derive("MBilling.view.diddestination.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["id_user","id_did"],initComponent:function(){var b=this;b.items=[{name:"id_did",fieldLabel:t("DID"),xtype:"didcombo"},{xtype:"userlookup",ownerForm:b,hidden:true,allowBlank:App.user.isClient},{xtype:"booleancombo",name:"activated",fieldLabel:t("status"),allowBlank:false},{xtype:"numbercombo",name:"priority",fieldLabel:t("priority"),allowBlank:true},{style:"margin-top:25px",xtype:"fieldset",title:t("Did Destination"),collapsible:true,collapsed:false,defaults:{labelWidth:75,anchor:"100%",labelAlign:b.labelAlignFields},items:[{xtype:"didtypefullcombo",name:"voip_call",fieldLabel:t("type")+" "+t("of")+" "+t("call")},{xtype:"textfield",name:"destination",fieldLabel:t("Destination"),value:"",allowBlank:true,hidden:App.user.isClient||App.user.isAgent},{xtype:"ivrlookup",ownerForm:b,name:"id_ivr",fieldLabel:t("IVR"),allowBlank:true},{xtype:"queuelookup",ownerForm:b,name:"id_queue",fieldLabel:t("Queue"),allowBlank:true},{xtype:"siplookup",ownerForm:b,name:"id_sip",fieldLabel:t("SIP"),allowBlank:true}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["diddestinationform"],["component","box","container","panel","form","diddestinationform"],{component:true,box:true,container:true,panel:true,form:true,diddestinationform:true},["widget.diddestinationform"],0,[MBilling.view.diddestination,"Form"],0));(Ext.cmd.derive("MBilling.view.diddestination.Combo",Ext.form.field.ComboBox,{fieldLabel:t("typepaid"),displayField:"name",valueField:"id",forceSelection:true,editable:false,value:1,store:{fields:["id","name"],data:[{id:"0",name:t("callforpstn"),showFields:["voip_call","destination","id_did","id_user","activated"]},{id:"1",name:t("sipcall"),showFields:["voip_call","id_sip","id_did","id_user","activated","priority"]},{id:"2",name:t("ivr"),showFields:["voip_call","id_did","id_ivr","id_user","activated"]},{id:"3",name:"CallingCard",showFields:["voip_call","id_did","id_user","activated"]},{id:"4",name:t("portalDeVoz"),showFields:["voip_call","id_did","id_user","activated"]},{id:"5",name:t("CID Callback"),showFields:["voip_call","id_did","id_user","activated"]},{id:"6",name:t("0800 Callback"),showFields:["voip_call","id_did","id_user","activated"]},{id:"7",name:t("Queue"),showFields:["voip_call","id_did","id_queue","id_user","activated"]},{id:"8",name:t("Call Group"),showFields:["voip_call","destination","id_did","id_user","activated"]},{id:"9",name:t("Custom"),showFields:["voip_call","destination","id_did","id_user","activated"]}]}},0,["didtypefullcombo"],["component","box","field","textfield","pickerfield","combobox","combo","didtypefullcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,didtypefullcombo:true},["widget.didtypefullcombo"],0,[MBilling.view.diddestination,"Combo"],0));(Ext.cmd.derive("MBilling.view.diddestination.freeCombo",Ext.form.field.ComboBox,{fieldLabel:t("typepaid"),displayField:"name",forceSelection:true,editable:false,valueField:"id",value:1,store:{fields:["id","name"],data:[{id:"0",name:t("callforpstn"),showFields:["voip_call","id_did","destination","id_user","activated"]},{id:"1",name:t("sipcall"),showFields:["voip_call","id_did","id_sip","id_user","activated","priority"]},{id:"2",name:t("ivr"),showFields:["voip_call","id_did","id_ivr","id_user"]},{id:"3",name:"CallingCard",showFields:["voip_call","id_did","id_user"]},{id:"4",name:t("portalDeVoz"),showFields:["voip_call","id_did","id_user"]}]}},0,["didtypefreecombo"],["component","box","field","textfield","pickerfield","combobox","combo","didtypefreecombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,didtypefreecombo:true},["widget.didtypefreecombo"],0,[MBilling.view.diddestination,"freeCombo"],0));(Ext.cmd.derive("MBilling.view.didUse.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.diduse"],0,[MBilling.view.didUse,"Controller"],0));(Ext.cmd.derive("MBilling.view.didUse.Module",Ext.ux.panel.Module,{controller:"diduse"},0,["didusemodule"],["component","box","container","uxpanelmodule","didusemodule"],{component:true,box:true,container:true,uxpanelmodule:true,didusemodule:true},["widget.didusemodule"],0,[MBilling.view.didUse,"Module"],0));(Ext.cmd.derive("MBilling.view.didUse.List",Ext.ux.grid.Panel,{store:"DidUse",initComponent:function(){var b=this;b.buttonCsv=false;b.allowPrint=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("did"),dataIndex:"idDiddid",flex:5},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("monthpayed"),dataIndex:"month_payed",flex:2},{header:t("reservationdate"),renderer:Helper.Util.formatDateTime,dataIndex:"reservationdate",flex:5},{header:t("releasedate"),renderer:Helper.Util.formatDateTime,dataIndex:"releasedate",flex:5}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["diduselist"],["component","box","container","panel","tablepanel","gridpanel","grid","diduselist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,diduselist:true},["widget.diduselist"],0,[MBilling.view.didUse,"List"],0));(Ext.cmd.derive("MBilling.view.didUse.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,readOnly:true},{xtype:"didcombo",readOnly:true},{xtype:"datefield",name:"reservationdate",fieldLabel:t("reservationdate"),format:"Y-m-d H:i:s"}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["diduseform"],["component","box","container","panel","form","diduseform"],{component:true,box:true,container:true,panel:true,form:true,diduseform:true},["widget.diduseform"],0,[MBilling.view.didUse,"Form"],0));(Ext.cmd.derive("MBilling.view.dashboard.Module",Ext.panel.Panel,{autoShow:true,header:false,initComponent:function(){var b=this;width=window.isTablet?Ext.Element.getViewportWidth()-240:Ext.Element.getViewportWidth()-220;showDid=showBuy=false;if(!App.user.isAdmin){Ext.each(App.user.menu,function(a){if(!Ext.isEmpty(a.rows)){Ext.each(a.rows,function(d){if(d.module=="didbuy"){showDid=true}if(d.module=="buycredit"){showBuy=true}},b)}},b)}widthView=Ext.Element.getViewportWidth()-430;heightView=Ext.Element.getViewportHeight()-137;heightViewFace=heightView+23;facebookhtml='
';if(!App.user.isAdmin&&App.user.social_media_network.length>10){facebookhtml='
'}if(window.customDashboard&&!App.user.isAdmin){b.items=[{header:false,bodyPadding:0,style:"background-color:transparent;",bodyStyle:"background-color:transparent !important;",html:'
',collapseDirection:"bottom",collapsible:true,autoScroll:true,height:Ext.Element.getViewportHeight()}]}else{b.items=[{width:!window.isDesktop?width:"NULL",header:false,xtype:"dashboard",listeners:{activate:"setRunnerInfoSystem"},glyph:icons.home,title:t("Home"),stateful:false,items:[{columnWidth:App.user.isAdmin?1/2:1,items:[{title:t("callonline"),items:{xtype:"callonlinelist2"},hidden:window.isTablet||!App.user.isAdmin,height:App.user.isClient?250:300},{title:t("Simultaneous Call"),items:{xtype:"callonlinechartchart"},hidden:window.isTablet||!App.user.isAdmin,iconCls:"icon-chart-column",glyph:undefined}]},{hidden:App.user.isAdmin,columnWidth:App.user.isClient?1/2:1,items:[{title:t("BuyCredit"),items:{xtype:"buycreditmodule"},height:window.isTablet?250:170,hidden:!showBuy}]},{hidden:App.user.isAdmin,columnWidth:1/2,items:[{title:t("Buy")+" "+t("did"),items:{xtype:"didbuymodule"},height:window.isTablet?250:170,hidden:!showDid||!App.user.isClient},{iconCls:"icon-info",title:t("NEWS"),bodyPadding:0,style:"background-color:transparent;",bodyStyle:"background-color:transparent !important;",hidden:App.user.isAdmin||App.user.social_media_network.length<=10,html:facebookhtml,collapseDirection:"bottom",collapsible:true,autoScroll:true,height:300}]},{columnWidth:1/2,items:[{iconCls:"icon-info",title:t("NEWS"),bodyPadding:0,style:"background-color:transparent;",bodyStyle:"background-color:transparent !important;",hidden:!App.user.isAdmin||window.isTablet||window.isTablets||App.user.l.slice(4,7)=="syn",html:facebookhtml,collapseDirection:"bottom",collapsible:true,autoScroll:true,height:300},{title:t("Refill Summary"),iconCls:"icon-chart-column",glyph:undefined,items:{xtype:"refillchart"},hidden:!App.user.isAdmin||window.isTablet}]}]}]}Ext.panel.Panel.prototype.initComponent.apply(this,arguments)}},0,["dashboardmodule"],["component","box","container","panel","dashboardmodule"],{component:true,box:true,container:true,panel:true,dashboardmodule:true},["widget.dashboardmodule"],0,[MBilling.view.dashboard,"Module"],0));(Ext.cmd.derive("MBilling.view.dashboardQueue.Module",Ext.panel.Panel,{autoShow:true,header:false,initComponent:function(){var b=this;b.items=[{width:!window.isDesktop?width:"NULL",header:false,xtype:"dashboard",listeners:{activate:"setRunnerInfoSystem"},glyph:icons.home,title:t("Home"),stateful:false,items:[{columnWidth:1/2,items:[{title:t("Queue Monitor"),items:{xtype:"queuedashboardlist"},height:window.heightView}]},{columnWidth:1/2,items:[{title:t("Agent Monitor"),iconCls:"icon-chart-column",glyph:undefined,items:{xtype:"queuememberdashboardlist"},height:window.heightView}]}]}];Ext.panel.Panel.prototype.initComponent.apply(this,arguments)}},0,["dashboardqueuemodule"],["component","box","container","panel","dashboardqueuemodule"],{component:true,box:true,container:true,panel:true,dashboardqueuemodule:true},["widget.dashboardqueuemodule"],0,[MBilling.view.dashboardQueue,"Module"],0));(Ext.cmd.derive("MBilling.view.ivr.Controller",Ext.ux.app.ViewController,{isSubmitForm:true,init:function(){var b=this;b.control({typedestinationcombo:{select:b.onSelectMethod}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectMethod:function(c,d){this.showFieldsRelated(d.getData().showFields)},showFieldsRelated:function(l){var m=this,n=m.formPanel.getForm(),j=m.formPanel.getForm().getFields(),g=Ext.get(Ext.Element.getActiveElement()).component,o=g.name.substr(-2);m.onSetVisibleFiel(g,n,o,g.value)},onSetVisibleFiel:function(f,j,e,g){if(f.value=="undefined"){f.setValue("undefined")}if(f.name.match("^type_10")){j.findField("id_queue_10").setVisible(g.match("^queue"));j.findField("id_sip_10").setVisible(g.match("^sip"));j.findField("id_ivr_10").setVisible(g.match("^ivr"));j.findField("extension_10").setVisible(g.match("^group|^number|^custom"))}else{if(f.name.match("^type_[0-9]")){j.findField("id_queue"+e).setVisible(g.match("^queue"));j.findField("id_sip"+e).setVisible(g.match("^sip"));j.findField("id_ivr"+e).setVisible(g.match("^ivr"));j.findField("extension"+e).setVisible(g.match("^group|^number|^custom"))}else{if(f.name.match("^type_out_10")){j.findField("id_queue_out_10").setVisible(g.match("^queue"));j.findField("id_ivr_out_10").setVisible(g.match("^ivr"));j.findField("id_sip_out_10").setVisible(g.match("^sip"));j.findField("extension_out_10").setVisible(g.match("^group|^number|^custom"))}else{j.findField("id_queue_out"+e).setVisible(g.match("^queue"));j.findField("id_sip_out"+e).setVisible(g.match("^sip"));j.findField("id_ivr_out"+e).setVisible(g.match("^ivr"));j.findField("extension_out"+e).setVisible(g.match("^group|^number|^custom"))}}}},onEdit:function(){var g=this,j=g.formPanel.getForm(),f=g.list.getSelectionModel().getSelection()[0];for(var e=0;e<=10;e++){fieldValue=f.getData()["type_"+e];fieldValueOut=f.getData()["type_out_"+e];if(fieldValue=="ivr"){j.findField("id_ivr_"+e).setVisible(true);j.findField("id_sip_"+e).setVisible(false);j.findField("id_queue_"+e).setVisible(false);j.findField("extension_"+e).setVisible(false)}else{if(fieldValue=="sip"){j.findField("id_sip_"+e).setVisible(true);j.findField("id_ivr_"+e).setVisible(false);j.findField("id_queue_"+e).setVisible(false);j.findField("extension_"+e).setVisible(false)}else{if(fieldValue=="queue"){j.findField("id_queue_"+e).setVisible(true);j.findField("id_sip_"+e).setVisible(false);j.findField("id_ivr_"+e).setVisible(false);j.findField("extension_"+e).setVisible(false)}else{if(fieldValue.match("custom|number|group")){j.findField("extension_"+e).setVisible(true);j.findField("id_ivr_"+e).setVisible(false);j.findField("id_sip_"+e).setVisible(false);j.findField("id_queue_"+e).setVisible(false)}else{j.findField("id_queue_"+e).setVisible(false);j.findField("id_sip_"+e).setVisible(false);j.findField("id_ivr_"+e).setVisible(false);j.findField("extension_"+e).setVisible(false)}}}}if(fieldValueOut=="ivr"){j.findField("id_ivr_out_"+e).setVisible(true);j.findField("id_sip_out_"+e).setVisible(false);j.findField("id_queue_out_"+e).setVisible(false);j.findField("extension_out_"+e).setVisible(false)}else{if(fieldValueOut=="sip"){j.findField("id_sip_out_"+e).setVisible(true);j.findField("id_ivr_out_"+e).setVisible(false);j.findField("id_queue_out_"+e).setVisible(false);j.findField("extension_out_"+e).setVisible(false)}else{if(fieldValueOut=="queue"){j.findField("id_queue_out_"+e).setVisible(true);j.findField("id_sip_out_"+e).setVisible(false);j.findField("id_ivr_out_"+e).setVisible(false);j.findField("extension_out_"+e).setVisible(false)}else{if(fieldValueOut.match("custom|number|group")){j.findField("extension_out_"+e).setVisible(true);j.findField("id_ivr_out_"+e).setVisible(false);j.findField("id_sip_out_"+e).setVisible(false);j.findField("id_queue_out_"+e).setVisible(false)}else{j.findField("id_queue_out_"+e).setVisible(false);j.findField("id_sip_out_"+e).setVisible(false);j.findField("id_ivr_out_"+e).setVisible(false);j.findField("extension_out_"+e).setVisible(false)}}}}}Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)},onNew:function(){var g=this,j=g.formPanel.getForm(),f=g.list.getSelectionModel().getSelection()[0];for(var e=0;e<=10;e++){j.findField("id_ivr_"+e).setVisible(false);j.findField("id_sip_"+e).setVisible(false);j.findField("id_queue_"+e).setVisible(false);j.findField("id_ivr_out_"+e).setVisible(false);j.findField("id_sip_out_"+e).setVisible(false);j.findField("id_queue_out_"+e).setVisible(false)}Ext.ux.app.ViewController.prototype.onNew.apply(this,arguments)}},0,0,0,0,["controller.ivr"],0,[MBilling.view.ivr,"Controller"],0));(Ext.cmd.derive("MBilling.view.ivr.Module",Ext.ux.panel.Module,{controller:"ivr"},0,["ivrmodule"],["component","box","container","uxpanelmodule","ivrmodule"],{component:true,box:true,container:true,uxpanelmodule:true,ivrmodule:true},["widget.ivrmodule"],0,[MBilling.view.ivr,"Module"],0));(Ext.cmd.derive("MBilling.view.ivr.List",Ext.ux.grid.Panel,{store:"Ivr",initComponent:function(){var b=this;b.allowPrint=false;b.buttonCsv=false;b.columns=b.columns||[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("name"),dataIndex:"name",flex:5},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["ivrlist"],["component","box","container","panel","tablepanel","gridpanel","grid","ivrlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,ivrlist:true},["widget.ivrlist"],0,[MBilling.view.ivr,"List"],0));(Ext.cmd.derive("MBilling.view.ivr.Form",Ext.ux.form.Panel,{bodyPadding:0,fileUpload:true,initComponent:function(){var b=this;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{plugins:"markallowblank",allowBlank:false,anchor:"100%",labelAlign:"right"}},items:[{title:t("general"),items:[{name:"name",fieldLabel:t("name")},{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"monFriStart",fieldLabel:t("monFriStart"),value:"09:00",maxLength:5,minLength:5},{name:"monFriStop",fieldLabel:t("monFriStop"),value:"18:00",maxLength:5,minLength:5},{name:"satStart",fieldLabel:t("satStart"),value:"09:00",maxLength:5,minLength:5},{name:"satStop",fieldLabel:t("satStop"),value:"12:00",maxLength:5,minLength:5},{name:"sunStart",fieldLabel:t("sunStart"),value:"09:00",maxLength:5,minLength:5},{name:"sunStop",fieldLabel:t("sunStop"),value:"12:00",maxLength:5,minLength:5},{xtype:"uploadfield",fieldLabel:t("workaudio"),emptyText:"Select an wav or gsm File",allowBlank:true,name:"workaudio",labelWidth:120,extAllowed:["wav","gsm"]},{xtype:"uploadfield",fieldLabel:t("noworkaudio"),emptyText:"Select an wav or gsm File",allowBlank:true,labelWidth:120,name:"noworkaudio",extAllowed:["wav","gsm"]}]},{title:t("options")+" "+t("work"),itemId:"option",defaults:{xtype:"fieldcontainer",layout:"hbox",plugins:"markallowblank",allowBlank:true,anchor:"100%",labelWidth:100,defaults:{hideLabel:true,hidden:true,flex:5,startX:100,allowBlank:true,ownerForm:b}},items:[{xtype:"menuseparator",width:"100%"},{labelStyle:"font-weight:bold",xtype:"displayfield",value:''+t("Select the destination to send call when caller press any digits.")+"",allowBlank:true},{xtype:"menuseparator",width:"100%"},{fieldLabel:t("option")+" 0",items:[{name:"type_0",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_0",displayField:"id_ivr_0_name"},{xtype:"queuelookup",name:"id_queue_0",displayField:"id_queue_0_name"},{xtype:"siplookup",name:"id_sip_0",displayField:"id_sip_0_name"},{xtype:"textfield",name:"extension_0"}]},{fieldLabel:t("option")+" 1",items:[{name:"type_1",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_1",displayField:"id_ivr_1_name"},{xtype:"queuelookup",name:"id_queue_1",displayField:"id_queue_1_name"},{xtype:"siplookup",name:"id_sip_1",displayField:"id_sip_1_name"},{xtype:"textfield",name:"extension_1"}]},{fieldLabel:t("option")+" 2",items:[{name:"type_2",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_2",displayField:"id_ivr_2_name"},{xtype:"queuelookup",name:"id_queue_2",displayField:"id_queue_2_name"},{xtype:"siplookup",name:"id_sip_2",displayField:"id_sip_2_name"},{xtype:"textfield",name:"extension_2"}]},{fieldLabel:t("option")+" 3",items:[{name:"type_3",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_3",displayField:"id_ivr_3_name"},{xtype:"queuelookup",name:"id_queue_3",displayField:"id_queue_3_name"},{xtype:"siplookup",name:"id_sip_3",displayField:"id_sip_3_name"},{xtype:"textfield",name:"extension_3"}]},{fieldLabel:t("option")+" 4",items:[{name:"type_4",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_4",displayField:"id_ivr_4_name"},{xtype:"queuelookup",name:"id_queue_4",displayField:"id_queue_4_name"},{xtype:"siplookup",name:"id_sip_4",displayField:"id_sip_4_name"},{xtype:"textfield",name:"extension_4"}]},{fieldLabel:t("option")+" 5",items:[{name:"type_5",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_5",displayField:"id_ivr_5_name"},{xtype:"queuelookup",name:"id_queue_5",displayField:"id_queue_5_name"},{xtype:"siplookup",name:"id_sip_5",displayField:"id_sip_5_name"},{xtype:"textfield",name:"extension_5"}]},{fieldLabel:t("option")+" 6",items:[{name:"type_6",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_6",displayField:"id_ivr_6_name"},{xtype:"queuelookup",name:"id_queue_6",displayField:"id_queue_6_name"},{xtype:"siplookup",name:"id_sip_6",displayField:"id_sip_6_name"},{xtype:"textfield",name:"extension_6"}]},{fieldLabel:t("option")+" 7",items:[{name:"type_7",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_7",displayField:"id_ivr_7_name"},{xtype:"queuelookup",name:"id_queue_7",displayField:"id_queue_7_name"},{xtype:"siplookup",name:"id_sip_7",displayField:"id_sip_7_name"},{xtype:"textfield",name:"extension_7"}]},{fieldLabel:t("option")+" 8",items:[{name:"type_8",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_8",displayField:"id_ivr_8_name"},{xtype:"queuelookup",name:"id_queue_8",displayField:"id_queue_8_name"},{xtype:"siplookup",name:"id_sip_8",displayField:"id_sip_8_name"},{xtype:"textfield",name:"extension_8"}]},{fieldLabel:t("option")+" 9",items:[{name:"type_9",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_9",displayField:"id_ivr_9_name"},{xtype:"queuelookup",name:"id_queue_9",displayField:"id_queue_9_name"},{xtype:"siplookup",name:"id_sip_9",displayField:"id_sip_9_name"},{xtype:"textfield",name:"extension_9"}]},{fieldLabel:t("option")+" default",items:[{name:"type_10",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_10",displayField:"id_ivr_10_name"},{xtype:"queuelookup",name:"id_queue_10",displayField:"id_queue_10_name"},{xtype:"siplookup",name:"id_sip_10",displayField:"id_sip_10_name"},{xtype:"textfield",name:"extension_10"}]},{fieldLabel:t("Direct extension"),hidden:!window.didChannelLimit,name:"direct_extension",xtype:"noyescombo"}]},{title:t("options")+" "+t("not")+" "+t("work"),itemId:"optionOut",defaults:{xtype:"fieldcontainer",layout:"hbox",plugins:"markallowblank",allowBlank:true,anchor:"100%",labelWidth:100,defaults:{hideLabel:true,hidden:true,flex:5,startX:100,allowBlank:true,ownerForm:b}},items:[{xtype:"menuseparator",width:"100%"},{labelStyle:"font-weight:bold",xtype:"displayfield",value:''+t("Select the destination to send call when caller press any digits.")+"",allowBlank:true},{xtype:"menuseparator",width:"100%"},{fieldLabel:t("option")+" 0",items:[{name:"type_out_0",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_0",displayField:"id_ivr_out_0_name"},{xtype:"queuelookup",name:"id_queue_out_0",displayField:"id_queue_out_0_name"},{xtype:"siplookup",name:"id_sip_out_0",displayField:"id_sip_out_0_name"},{xtype:"textfield",name:"extension_out_0"}]},{fieldLabel:t("option")+" 1",items:[{name:"type_out_1",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_1",displayField:"id_ivr_out_1_name"},{xtype:"queuelookup",name:"id_queue_out_1",displayField:"id_queue_out_1_name"},{xtype:"siplookup",name:"id_sip_out_1",displayField:"id_sip_out_1_name"},{xtype:"textfield",name:"extension_out_1"}]},{fieldLabel:t("option")+" 2",items:[{name:"type_out_2",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_2",displayField:"id_ivr_out_2_name"},{xtype:"queuelookup",name:"id_queue_out_2",displayField:"id_queue_out_2_name"},{xtype:"siplookup",name:"id_sip_out_2",displayField:"id_sip_out_2_name"},{xtype:"textfield",name:"extension_out_2"}]},{fieldLabel:t("option")+" 3",items:[{name:"type_out_3",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_3",displayField:"id_ivr_out_3_name"},{xtype:"queuelookup",name:"id_queue_out_3",displayField:"id_queue_out_3_name"},{xtype:"siplookup",name:"id_sip_out_3",displayField:"id_sip_out_3_name"},{xtype:"textfield",name:"extension_out_3"}]},{fieldLabel:t("option")+" 4",items:[{name:"type_out_4",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_4",displayField:"id_ivr_out_4_name"},{xtype:"queuelookup",name:"id_queue_out_4",displayField:"id_queue_out_4_name"},{xtype:"siplookup",name:"id_sip_out_4",displayField:"id_sip_out_4_name"},{xtype:"textfield",name:"extension_out_4"}]},{fieldLabel:t("option")+" 5",items:[{name:"type_out_5",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_5",displayField:"id_ivr_out_5_name"},{xtype:"queuelookup",name:"id_queue_out_5",displayField:"id_queue_out_5_name"},{xtype:"siplookup",name:"id_sip_out_5",displayField:"id_sip_out_5_name"},{xtype:"textfield",name:"extension_out_5"}]},{fieldLabel:t("option")+" 6",items:[{name:"type_out_6",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_6",displayField:"id_ivr_out_6_name"},{xtype:"queuelookup",name:"id_queue_out_6",displayField:"id_queue_out_6_name"},{xtype:"siplookup",name:"id_sip_out_6",displayField:"id_sip_out_6_name"},{xtype:"textfield",name:"extension_out_6"}]},{fieldLabel:t("option")+" 7",items:[{name:"type_out_7",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_7",displayField:"id_ivr_out_7_name"},{xtype:"queuelookup",name:"id_queue_out_7",displayField:"id_queue_out_7_name"},{xtype:"siplookup",name:"id_sip_out_7",displayField:"id_sip_out_7_name"},{xtype:"textfield",name:"extension_out_7"}]},{fieldLabel:t("option")+" 8",items:[{name:"type_out_8",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_8",displayField:"id_ivr_out_8_name"},{xtype:"queuelookup",name:"id_queue_out_8",displayField:"id_queue_out_8_name"},{xtype:"siplookup",name:"id_sip_out_8",displayField:"id_sip_out_8_name"},{xtype:"textfield",name:"extension_out_8"}]},{fieldLabel:t("option")+" 9",items:[{name:"type_out_9",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_9",displayField:"id_ivr_out_9_name"},{xtype:"queuelookup",name:"id_queue_out_9",displayField:"id_queue_out_9_name"},{xtype:"siplookup",name:"id_sip_out_9",displayField:"id_sip_out_9_name"},{xtype:"textfield",name:"extension_out_9"}]},{fieldLabel:t("option")+" default",items:[{name:"type_out_10",xtype:"typedestinationcombo",hidden:false,flex:2},{xtype:"ivrlookup",name:"id_ivr_out_10",displayField:"id_ivr_out_10_name"},{xtype:"queuelookup",name:"id_queue_out_10",displayField:"id_queue_out_10_name"},{xtype:"siplookup",name:"id_sip_out_10",displayField:"id_sip_out_10_name"},{xtype:"textfield",name:"extension_out_10"}]}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["ivrform"],["component","box","container","panel","form","ivrform"],{component:true,box:true,container:true,panel:true,form:true,ivrform:true},["widget.ivrform"],0,[MBilling.view.ivr,"Form"],0));(Ext.cmd.derive("MBilling.view.ivr.Lookup",Ext.ux.form.field.Lookup,{name:"id_ivr",fieldLabel:t("Ivr"),displayField:"idIvrname",displayFieldList:"name",gridConfig:{xtype:"ivrlist",fieldSearch:"name",columns:[{header:t("name"),dataIndex:"name",flex:5},{header:t("user"),dataIndex:"idUsernumber",filter:{type:"string",field:"idUser.username"},flex:4}]}},0,["ivrlookup"],["component","box","container","fieldcontainer","ivrlookup"],{component:true,box:true,container:true,fieldcontainer:true,ivrlookup:true},["widget.ivrlookup"],0,[MBilling.view.ivr,"Lookup"],0));(Ext.cmd.derive("MBilling.view.queue.Controller",Ext.ux.app.ViewController,{isSubmitForm:true,init:function(){var b=this;b.control({"combobox[name=ring_or_moh]":{select:b.onSelectringOrMOH}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectringOrMOH:function(c,d){me=this,form=me.formPanel.getForm();form.findField("musiconhold").setVisible(d.data.field1=="moh")},onNew:function(){var b=this;b.formPanel.getForm().findField("musiconhold").setVisible(true);Ext.ux.app.ViewController.prototype.onNew.apply(this,arguments)},onEdit:function(){var b=this;Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments);ringOrMoh=b.formPanel.getForm().findField("ring_or_moh").getValue();b.formPanel.getForm().findField("musiconhold").setVisible(ringOrMoh=="moh")},onResetQueueStats:function(m){var j=this,f=j.list.getSelectionModel().getSelection()[0],l=Ext.encode(j.list.filters.getFilterData()),g=[];if(f){Ext.each(j.list.getSelectionModel().getSelection(),function(a){g.push(a.get(j.idProperty))});Ext.Ajax.request({url:"index.php/queue/resetQueueStats",params:{ids:Ext.encode(g),filter:l},scope:j,success:function(b){b=Ext.decode(b.responseText);if(b[j.nameSuccessRequest]){Ext.ux.Alert.alert(j.titleSuccess,b.msg,"success")}else{var a=Helper.Util.convertErrorsJsonToString(b[j.nameMsgRequest]);Ext.ux.Alert.alert(j.titleError,a,"notification")}}})}else{Ext.ux.Alert.alert(j.titleError,t("Please select one or more queue"),"notification")}},onDeleteMusic:function(e){var f=this,d=f.list.getSelectionModel().getSelection()[0];if(f.list.getSelectionModel().getSelection().length==1){Ext.Ajax.request({url:"index.php/queue/deleteMusicOnHold",params:{id_queue:d.get("id")},scope:f,success:function(a){a=Ext.decode(a.responseText);if(a[f.nameSuccessRequest]){Ext.ux.Alert.alert(f.titleSuccess,a[f.nameMsgRequest],"success")}else{Ext.ux.Alert.alert(f.titleError,a[f.nameMsgRequest],"error")}}})}else{Ext.ux.Alert.alert(f.titleError,"Please Select only a record","notification")}}},0,0,0,0,["controller.queue"],0,[MBilling.view.queue,"Controller"],0));(Ext.cmd.derive("MBilling.view.queue.Combo",Ext.form.field.ComboBox,{fieldLabel:t("status"),value:"ringall",forceSelection:true,editable:false,store:[["ringall",t("Ringall")+" - "+t("ring all available channels until one answers")],["rrmemory",t("Rrmemory")+" - "+t("round robin with memory, remember where we left off last ring pass")],["leastrecent",t("Leastrecent")+" - "+t("ring interface which was least recently called by this queue")],["fewestcalls",t("Fewestcalls")+" - "+t("ring the one with fewest completed calls from this queue")],["random",t("Random")+" -"+t("ring random interface")],["linear",t("Linear")+" - "+t("Rings interfaces in the order they are listed in the configuration file. Dynamic members will be rung in the order in which they were added")],["wrandom",t("Wrandom")+" -"+t("Rings a random interface, but uses the agent's penalty as a weight")]]},0,["queuestrategycombo"],["component","box","field","textfield","pickerfield","combobox","combo","queuestrategycombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,queuestrategycombo:true},["widget.queuestrategycombo"],0,[MBilling.view.queue,"Combo"],0));(Ext.cmd.derive("MBilling.view.queue.Module",Ext.ux.panel.Module,{controller:"queue"},0,["queuemodule"],["component","box","container","uxpanelmodule","queuemodule"],{component:true,box:true,container:true,uxpanelmodule:true,queuemodule:true},["widget.queuemodule"],0,[MBilling.view.queue,"Module"],0));(Ext.cmd.derive("MBilling.view.queue.List",Ext.ux.grid.Panel,{store:"Queue",initComponent:function(){var b=this;b.buttonCsv=false;b.allowPrint=false;b.buttonUpdateLot=false;b.extraButtons=[{text:t("Reset Queue Stats"),iconCls:"call",handler:"onResetQueueStats",disabled:false,hidden:!App.user.isAdmin},{text:t("Delete Musiconhold"),iconCls:"call",handler:"onDeleteMusic",disabled:false,hidden:!App.user.isAdmin}];b.columns=b.columns||[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("name"),dataIndex:"name",flex:4},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("Strategy"),dataIndex:"strategy",flex:4},{header:t("Talk Time"),dataIndex:"var_talktime",flex:3},{header:t("Total Calls"),dataIndex:"var_totalCalls",flex:3},{header:t("Answered"),dataIndex:"var_answeredCalls",flex:3}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["queuelist"],["component","box","container","panel","tablepanel","gridpanel","grid","queuelist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,queuelist:true},["widget.queuelist"],0,[MBilling.view.queue,"List"],0));(Ext.cmd.derive("MBilling.view.queue.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["id_user","name"],fileUpload:true,initComponent:function(){var b=this;b.labelWidthFields=160;b.items=[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"name",fieldLabel:t("name")},{xtype:"languagecombo",name:"language",value:App.user.language=="pt_BR"?"br":App.user.language,fieldLabel:t("language")},{xtype:"queuestrategycombo",name:"strategy",fieldLabel:t("Strategy")},{xtype:"yesnostringcombo",name:"ringinuse",fieldLabel:t("Ringinuse")},{xtype:"numberfield",name:"timeout",fieldLabel:t("Ring Agent per"),value:30},{xtype:"numberfield",name:"retry",fieldLabel:t("Retry other agent"),value:1},{xtype:"numberfield",name:"wrapuptime",fieldLabel:t("Time next calls"),value:1},{xtype:"numberfield",name:"weight",fieldLabel:t("Weigh"),value:0},{name:"periodic-announce",fieldLabel:t("Periodic announce"),value:"queue-periodic-announce"},{xtype:"numberfield",name:"periodic-announce-frequency",fieldLabel:t("Periodic frequency"),value:30},{xtype:"yesnostringcombo",name:"announce-position",fieldLabel:t("Announce position")},{xtype:"yesnostringcombo",name:"announce-holdtime",fieldLabel:t("Announce Holdtime")},{xtype:"numberfield",name:"announce-frequency",fieldLabel:t("Announce Frequency"),value:45},{xtype:"combobox",forceSelection:true,editable:false,value:"yes",store:[["no",t("No")],["yes",t("Yes")],["unavailable,invalid,unknown",t("unavailable,invalid,unknown")],["penalty,paused,invalid,unavailable",t("penalty,paused,invalid,unavailable")]],name:"joinempty",fieldLabel:t("Join empty")},{xtype:"combobox",forceSelection:true,editable:false,value:"no",store:[["no",t("No")],["yes",t("Yes")],["unavailable,invalid,unknown",t("unavailable,invalid,unknown")],["penalty,paused,invalid,unavailable",t("penalty,paused,invalid,unavailable")]],fieldLabel:t("Leave when empty"),name:"leavewhenempty"},{xtype:"combobox",forceSelection:true,editable:false,value:"moh",store:[["moh",t("MOH")],["ring",t("Ring")]],fieldLabel:t("Ring or playing MOH"),name:"ring_or_moh"},{xtype:"uploadfield",fieldLabel:t("Audio")+" "+t("musiconhold"),emptyText:t("Select an wav mono 8khz or gsm File"),allowBlank:true,name:"musiconhold",extAllowed:["wav","gsm"]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["queueform"],["component","box","container","panel","form","queueform"],{component:true,box:true,container:true,panel:true,form:true,queueform:true},["widget.queueform"],0,[MBilling.view.queue,"Form"],0));(Ext.cmd.derive("MBilling.view.queue.Lookup",Ext.ux.form.field.Lookup,{name:"id_queue",fieldLabel:t("Queue"),displayField:"idQueuename",displayFieldList:"name",gridConfig:{xtype:"queuelist",fieldSearch:"name",columns:[{header:t("name"),dataIndex:"name",flex:2}]}},0,["queuelookup"],["component","box","container","fieldcontainer","queuelookup"],{component:true,box:true,container:true,fieldcontainer:true,queuelookup:true},["widget.queuelookup"],0,[MBilling.view.queue,"Lookup"],0));(Ext.cmd.derive("MBilling.view.queue.ListDashboard",Ext.ux.grid.Panel,{store:"QueueDashBoard",refreshTime:5,selType:"rowmodel",initComponent:function(){var b=this;b.refreshTime=(localStorage&&localStorage.getItem("queuerefresh"))||b.refreshTime;b.extraButtons=[{text:t("Spy")+" "+t("call"),iconCls:"call",handler:function(a){module=b.getView();console.log(module.panel.items.items[0].getSelectionModel().getSelection());Ext.widget("callonlinespycall",{title:module.titleModule,list:module.panel.items.items[0]})},width:130,disabled:false,hidden:!window.multSpy},{xtype:"numberfield",field:"jmlhBrg",fieldLabel:t("Refresh Time"),editable:false,minValue:5,labelWidth:90,width:150,selectOnFocus:true,allowDecimals:true,decimalPrecision:2,value:b.refreshTime,listeners:{change:function(a){if(a.value>0){b.refreshTime=a.value;localStorage.setItem("queuerefresh",a.value)}}}}];b.columns=[{header:t("Channel"),hidden:true,dataIndex:"channel",flex:3},{header:t("Queue"),dataIndex:"queue_name",flex:3},{header:t("Agent"),dataIndex:"agentName",flex:3},{header:t("status"),dataIndex:"status",renderer:Helper.Util.formatQueueState,flex:4},{header:t("CallerID"),dataIndex:"callerId",flex:4},{header:t("Duration"),dataIndex:"duration",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Wait Time"),dataIndex:"holdtime",renderer:Helper.Util.formatsecondsToTime,flex:3}];b.sessionLoad=Ext.create("Ext.util.DelayedTask",function(){b.store.load()},b);Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments);b.store.on("load",b.onLoadStore,b)},onLoadStore:function(){var b=this;b.onDeactivateModule();b.onActivateModule()},onRender:function(){var b=this;if(Ext.isObject(b.module)){b.module.on("activate",b.onActivateModule,b);b.module.on("deactivate",b.onDeactivateModule,b);b.module.on("close",b.onCloseModule,b)}Ext.ux.grid.Panel.prototype.onRender.apply(this,arguments)},onActivateModule:function(){this.sessionLoad&&this.sessionLoad.delay(this.refreshTime*1000)},onDeactivateModule:function(){this.sessionLoad&&this.sessionLoad.cancel()},onCloseModule:function(){this.onDeactivateModule();this.sessionLoad=null}},0,["queuedashboardlist"],["component","box","container","panel","tablepanel","gridpanel","grid","queuedashboardlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,queuedashboardlist:true},["widget.queuedashboardlist"],0,[MBilling.view.queue,"ListDashboard"],0));(Ext.cmd.derive("MBilling.view.queueMember.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.queuemember"],0,[MBilling.view.queueMember,"Controller"],0));(Ext.cmd.derive("MBilling.view.queueMember.Module",Ext.ux.panel.Module,{controller:"queuemember"},0,["queuemembermodule"],["component","box","container","uxpanelmodule","queuemembermodule"],{component:true,box:true,container:true,uxpanelmodule:true,queuemembermodule:true},["widget.queuemembermodule"],0,[MBilling.view.queueMember,"Module"],0));(Ext.cmd.derive("MBilling.view.queueMember.List",Ext.ux.grid.Panel,{store:"QueueMember",initComponent:function(){var b=this;b.columns=[{header:t("Uniqueid"),dataIndex:"uniqueid",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("destination"),dataIndex:"interface",flex:4},{header:t("queues"),dataIndex:"queue_name",flex:4},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("paused"),dataIndex:"paused",renderer:Helper.Util.formattyyesno,filter:{type:"list",options:[[0,t("no")],[1,t("yes")]]},flex:2}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["queuememberlist"],["component","box","container","panel","tablepanel","gridpanel","grid","queuememberlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,queuememberlist:true},["widget.queuememberlist"],0,[MBilling.view.queueMember,"List"],0));(Ext.cmd.derive("MBilling.view.queueMember.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["id_user","queue_name"],initComponent:function(){var b=this;b.items=[{xtype:"queuelookup",ownerForm:b,displayField:"queue_name",name:"queue_name",hidden:App.user.isClient,allowBlank:App.user.isClient},{xtype:"siplookup",ownerForm:b,name:"interface",displayField:"interface"},{xtype:"noyescombo",name:"paused",fieldLabel:t("paused"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["queuememberform"],["component","box","container","panel","form","queuememberform"],{component:true,box:true,container:true,panel:true,form:true,queuememberform:true},["widget.queuememberform"],0,[MBilling.view.queueMember,"Form"],0));(Ext.cmd.derive("MBilling.view.queueMember.ListDashboard",Ext.ux.grid.Panel,{store:"QueueMemberDashBoard",refreshTime:5,selType:"rowmodel",initComponent:function(){var b=this;b.refreshTime=(localStorage&&localStorage.getItem("queueagentrefresh"))||b.refreshTime;b.extraButtons=[{xtype:"numberfield",field:"jmlhBrg",fieldLabel:t("Refresh Time"),editable:false,minValue:5,labelWidth:90,width:150,selectOnFocus:true,allowDecimals:true,decimalPrecision:2,value:b.refreshTime,listeners:{change:function(a){if(a.value>0){b.refreshTime=a.value;localStorage.setItem("queueagentrefresh",a.value)}}}}];b.columns=[{header:t("Agent"),dataIndex:"agentName",flex:3},{header:t("Queue"),dataIndex:"idQueuename",flex:5},{header:t("Status"),dataIndex:"agentStatus",renderer:Helper.Util.formatQueueAgentState,flex:4},{header:t("Number"),dataIndex:"number",flex:4},{header:t("Calls"),dataIndex:"totalCalls",flex:2},{header:t("Last call"),dataIndex:"last_call",renderer:Helper.Util.formatsecondsToTime,flex:3}];b.sessionLoad=Ext.create("Ext.util.DelayedTask",function(){b.store.load()},b);Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments);if(window.isDesktop){b.store.load()}b.store.on("load",b.onLoadStore,b)},onLoadStore:function(){var b=this;b.onDeactivateModule();b.onActivateModule()},onRender:function(){var b=this;if(Ext.isObject(b.module)){b.module.on("activate",b.onActivateModule,b);b.module.on("deactivate",b.onDeactivateModule,b);b.module.on("close",b.onCloseModule,b)}Ext.ux.grid.Panel.prototype.onRender.apply(this,arguments)},onActivateModule:function(){this.sessionLoad&&this.sessionLoad.delay(this.refreshTime*1000)},onDeactivateModule:function(){this.sessionLoad&&this.sessionLoad.cancel()},onCloseModule:function(){this.onDeactivateModule();this.sessionLoad=null}},0,["queuememberdashboardlist"],["component","box","container","panel","tablepanel","gridpanel","grid","queuememberdashboardlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,queuememberdashboardlist:true},["widget.queuememberdashboardlist"],0,[MBilling.view.queueMember,"ListDashboard"],0));(Ext.cmd.derive("MBilling.view.refill.Controller",Ext.ux.app.ViewController,{aliasChart:"refillchart",onPrint:function(e){var f=this;if(App.user.isClient){var f=this,d=f.list.getSelectionModel().getSelection()[0];if(f.list.getSelectionModel().getSelection().length==1){console.log(d.data.description.indexOf("Send Credit "));if(d.data.description.indexOf("Send Credit ")!==-1){url="index.php/transferToMobile/printRefill/?id="+d.get("id");window.open(url)}else{Ext.ux.app.ViewController.prototype.onPrint.apply(this,arguments)}}else{Ext.ux.app.ViewController.prototype.onPrint.apply(this,arguments)}}else{Ext.ux.app.ViewController.prototype.onPrint.apply(this,arguments)}},onInvoice:function(e){var f=this;var f=this,d=f.list.getSelectionModel().getSelection()[0];if(f.list.getSelectionModel().getSelection().length==1){url="index.php/invoices/printInvoice/?id="+d.get("id");window.open(url)}else{Ext.ux.Alert.alert(f.titleError,t("Not available to multi refill."),"error")}},onSelectionChange:function(f,e){var j=this,g=j.lookupReference("invoice");g&&g.setDisabled(!e.length);Ext.ux.app.ViewController.prototype.onSelectionChange.apply(this,arguments)},onRenderModule:function(){var c=this,d=c.lookupReference("chart");Ext.ux.app.ViewController.prototype.onRenderModule.apply(this,arguments);if(App.user.isAdmin){c.store.on({scope:c,beforeload:function(){d.el&&d.disable()},load:function(a){d.el&&d.enable();c.onSetTotal()}})}else{c.store.on({scope:c,load:function(a){c.onSetTotal()}})}},onChart:function(){var b=this;b.chart=Ext.widget("window",{title:t("charts"),iconCls:"icon-chart-column",layout:"fit",autoShow:true,modal:true,resizable:false,width:window.isThemeNeptune?740:710,items:{xtype:b.aliasChart}});b.chart.down("#tbTextSum").setText(""+t("total")+": "+App.user.currency+" "+b.sumData.sumCredit+"")},onSetTotal:function(c){var d=this;if(!d.store.getData().items[0]){return}d.sumData=d.store.getData().items[0].getData();if(!d.sumData){return}d.lookupReference("tbTextTotal")&&d.lookupReference("tbTextTotal").setText(""+t("Refill Total")+": "+App.user.currency+" "+d.sumData.sumCredit+"")}},0,0,0,0,["controller.refill"],0,[MBilling.view.refill,"Controller"],0));(Ext.cmd.derive("MBilling.view.refill.Module",Ext.ux.panel.Module,{controller:"refill"},0,["refillmodule"],["component","box","container","uxpanelmodule","refillmodule"],{component:true,box:true,container:true,uxpanelmodule:true,refillmodule:true},["widget.refillmodule"],0,[MBilling.view.refill,"Module"],0));(Ext.cmd.derive("MBilling.view.refill.List",Ext.ux.grid.Panel,{store:"Refill",fieldSearch:"idUser.username",initComponent:function(){var b=this;b.buttonsTbar=[{xtype:"tbtext",reference:"tbTextTotal"}];if(App.user.isAdmin&&b.buttonCleanFilter){b.extraButtons=[{text:t("charts"),iconCls:"icon-chart-column",handler:"onChart",reference:"chart",disabled:true},{text:t("Invoice"),glyph:b.glyphPrint,handler:"onInvoice",reference:"invoice",hidden:!window.invoice,disabled:true}]}if(App.user.isClient){b.extraButtons=[{text:t("Invoice"),glyph:b.glyphPrint,handler:"onInvoice",reference:"invoice",hidden:!window.invoice,disabled:true}]}b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:3,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("credit"),dataIndex:"credit",renderer:Helper.Util.formatMoneyDecimal2,flex:2},{header:t("description"),dataIndex:"description",flex:5},{header:t("payment"),dataIndex:"payment",renderer:Helper.Util.formattyyesno,filter:{type:"list",options:[[0,t("no")],[1,t("yes")]]},flex:2},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"date",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["refilllist"],["component","box","container","panel","tablepanel","gridpanel","grid","refilllist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,refilllist:true},["widget.refilllist"],0,[MBilling.view.refill,"List"],0));(Ext.cmd.derive("MBilling.view.refill.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["id_user"],initComponent:function(){var b=this;b.items=[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient},{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,00",name:"credit",fieldLabel:t("credit"),readOnly:App.user.isClient},{xtype:"textareafield",name:"description",fieldLabel:t("description"),readOnly:App.user.isClient},{xtype:"yesnocombo",name:"payment",fieldLabel:t("add")+" "+t("payment"),hidden:App.user.isClient},{name:"invoice_number",fieldLabel:t("Invoice")+" "+t("number"),hidden:!window.invoice,allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["refillform"],["component","box","container","panel","form","refillform"],{component:true,box:true,container:true,panel:true,form:true,refillform:true},["widget.refillform"],0,[MBilling.view.refill,"Form"],0));(Ext.cmd.derive("Ext.ux.panel.Chart",Ext.panel.Panel,{rootData:undefined,positionLegendPie:"bottom",showLegendPie:true,widthTip:200,degressXLabel:0,fontLabel:"15px Arial",textBtnColumn:t("columns"),textBtnLine:t("lines"),textBtnBar:t("bars"),textBtnPie:t("pie"),iconBtnColumn:"icon-chart-column",iconBtnLine:"icon-chart-line",iconBtnBar:"icon-chart-bar",iconBtnPie:"icon-chart-pie",heightChart:400,charts:["column","bar","line","pie"],defaultChart:"column",limitCharLabelTip:25,bbarChart:[],tbarChart:[],minimumAxesY:0,border:false,layout:"card",btnShowColumn:true,btnShowBar:true,btnShowLine:true,btnShowPie:true,btnShowLineHidden:false,btnShowColumnHidden:false,showDownload:true,legend:null,titleText:"",fieldLabel:"",constructor:function(){var b=this;if(Ext.isString(b.store)){b.store=Ext.data.StoreManager.lookup(b.store);b.store.load({scope:b,callback:function(){if(b.store.getData().items[0]){b.sumData=b.store.getData().items[0].getData()}}})}Ext.panel.Panel.prototype.constructor.apply(this,arguments)},initComponent:function(){var s=this,x=s.charts.length,r,o,v,q,w=[],y=[],u=[],p,z;if(s.charts.length===1){s.defaultChart=s.charts[0]}s.fieldValue=Ext.isArray(s.fieldValue)?s.fieldValue:[s.fieldValue];if(s.rootData){p=Ext.getStore(s.store);z=p.model.proxy.reader.rawData;s.store=Ext.create("Ext.data.Store",{fields:Ext.Array.merge(s.fieldValue,s.fieldDescription),data:z&&z[s.rootData],proxy:{type:"memory",reader:{type:"json"}}});s.fieldValue=s.fieldValue[0].name||s.fieldValue[0];s.fieldDescription=s.fieldDescription.name||s.fieldDescription}Ext.each(s.fieldValue,function(a){u.push({type:"line",yField:a,xField:s.fieldDescription,marker:{radius:4},highlight:true,tooltip:{trackMouse:true,width:s.widthTip,renderer:s.rendererPie(s.fieldDescription,s.rendererFieldValue,s.rendererFieldDescription,s.limitCharLabelTip)}})});s.chartColumn={xtype:"cartesian",itemId:"column",height:s.heightChart,width:s.width,store:s.store,insetPadding:{top:s.titleText.length>0?40:10},axes:[{type:"numeric",title:s.labelYLine,position:"left",grid:true,minimum:s.minimumAxesY,renderer:s.rendererFieldValue||s.rendererDefault},{type:"category",title:s.labelXLine,position:"bottom",grid:true,renderer:s.rendererFieldDescription||s.rendererDefault,label:{rotate:{degrees:s.degressXLabel}}}],series:[{type:"bar",axis:"left",yField:s.fieldValue,xField:s.fieldDescription,highlight:true,tooltip:{width:s.widthTip,renderer:s.rendererPie(s.fieldDescription,s.rendererFieldValue,s.rendererFieldDescription,s.limitCharLabelTip)},label:{hidden:s.fieldLabel.length<1,field:s.fieldLabel,display:"insideEnd"}}],sprites:{hidden:s.titleText.length<1,type:"text",text:s.titleText,fontSize:22,width:100,height:30,x:40,y:20}};s.chartBar={xtype:"cartesian",itemId:"bar",height:s.heightChart,width:s.width,store:s.store,flipXY:true,insetPadding:{top:s.titleText.length>0?40:10},axes:[{type:"numeric",title:s.labelYLine,position:"bottom",fields:s.fieldValue,grid:true,minimum:s.minimumAxesY,renderer:s.rendererFieldValue||s.rendererDefault},{type:"category",title:s.labelXLine,position:"left",fields:s.fieldDescription,grid:true,renderer:s.rendererFieldDescription||s.rendererDefault}],series:[{type:"bar",yField:s.fieldValue,xField:s.fieldDescription,highlight:true,tooltip:{width:s.widthTip,renderer:s.rendererPie(s.fieldDescription,s.rendererFieldValue,s.rendererFieldDescription,s.limitCharLabelTip)},label:{hidden:s.fieldLabel.length<1,field:s.fieldLabel,display:"insideEnd"}}],sprites:{hidden:s.titleText.length<1,type:"text",text:s.titleText,fontSize:22,width:100,height:30,x:40,y:20}};s.chartLine={xtype:"cartesian",itemId:"line",height:s.heightChart,width:s.width,store:s.store,legend:s.legend,axes:[{type:"numeric",title:s.labelYLine,position:"left",fields:s.fieldValue,grid:true,minimum:s.minimumAxesY,renderer:s.rendererFieldValue||s.rendererDefault},{type:"category",title:s.labelXLine,position:"bottom",grid:true,fields:s.fieldDescription,renderer:s.rendererFieldDescription||s.rendererDefault}],series:u};s.chartPie={xtype:"polar",itemId:"pie",height:s.heightChart,width:s.width,store:s.store,legend:{position:s.positionLegendPie,renderer:s.rendererFieldDescription},series:[{type:"pie",angleField:s.fieldValue[0],showInLegend:s.showLegendPie,tooltip:{trackMouse:true,width:s.widthTip,renderer:s.rendererPie(s.fieldDescription,s.rendererFieldValue,s.rendererFieldDescription,s.limitCharLabelTip)},highlight:{segment:{margin:20}},label:{field:s.fieldDescription,display:"rotate",contrast:true,font:s.fontLabel,renderer:s.rendererFieldDescription||s.rendererDefault}}]};if(s.btnShowColumn){r={chart:"column",text:s.textBtnColumn,iconCls:s.iconBtnColumn,hidden:s.btnShowColumnHidden}}if(s.btnShowBar){o={chart:"bar",text:s.textBtnBar,iconCls:s.iconBtnBar}}if(s.btnShowLine){v={chart:"line",text:s.textBtnLine,iconCls:s.iconBtnLine,hidden:s.btnShowLineHidden}}if(s.btnShowPie){q={chart:"pie",text:s.textBtnPie,iconCls:s.iconBtnPie}}if(Ext.Array.contains(s.charts,"column")){w.push(s.chartColumn);y.push(r)}if(Ext.Array.contains(s.charts,"bar")){w.push(s.chartBar);y.push(o)}if(Ext.Array.contains(s.charts,"line")){w.push(s.chartLine);y.push(v)}if(Ext.Array.contains(s.charts,"pie")){w.push(s.chartPie);y.push(q)}s.bbarChart.push("->",{xtype:"buttongroup",toggleGroup:"typeChart",defaults:{enableToggle:true,allowDepress:false,toggleGroup:"typeChart",listeners:{scope:s,toggle:s.activeChart}},items:y});s.items=w;if(s.showDownload){s.tbarChart.push("->",{text:t("Download"),glyph:icons.disk,scope:s,handler:s.onDownload})}s.tbar=s.tbarChart;s.bbar=s.bbarChart;Ext.panel.Panel.prototype.initComponent.apply(this,arguments);s.activeItem=s.down("#"+s.defaultChart);s.down("button[chart="+s.defaultChart+"]").pressed=true},onDownload:function(){var b=this;b.getLayout().getActiveItem().download()},activeChart:function(d){var c=this;d.pressed&&c.getLayout().setActiveItem(c.down("#"+d.chart))},rendererPie:function(g,f,e,j){return function(a,o,c){var d=this,n=o.get(g),b=o.get(c.field);n=e?e(n):n;b=f?f(b):b;n=Ext.String.ellipsis(n,j)+": ";title=n+b;a.setHtml(title)}},rendererDefault:function(c,d){return d},rendererLegend:function(b){return t(b)}},1,["chartpanel"],["component","box","container","panel","chartpanel"],{component:true,box:true,container:true,panel:true,chartpanel:true},["widget.chartpanel"],0,[Ext.ux.panel,"Chart"],0));(Ext.cmd.derive("MBilling.view.refill.Chart",Ext.ux.panel.Chart,{controller:"refill",store:"RefillChart",fieldValue:"sumCreditMonth",fieldDescription:"CreditMonth",labelYLine:t("credit"),labelXLine:t("Month"),reference:"refillchart",btnShowColumn:true,btnShowBar:false,btnShowLine:false,btnShowPie:false,btnShowColumnHidden:true,initComponent:function(){var d=this,c;d.rendererFieldValue=Ext.util.Format.numberRenderer("0"),d.tbarChart=[{text:t("Per")+" "+t("Month"),scope:d,handler:"onPerMonth",reference:"btnMonth",disabled:true},{text:t("Per")+" "+t("day"),scope:d,handler:"onPerDay",reference:"btnDay"}];d.bbarChart=[{xtype:"tbtext",itemId:"tbTextSum"}];Ext.ux.panel.Chart.prototype.initComponent.apply(this,arguments)},onPerMonth:function(d){var c=this;c.lookupReference("btnMonth").disable();c.lookupReference("btnDay").enable();c.store.setRemoteFilter(true);c.store.filter("type","month");c.store.load()},onPerDay:function(d){var c=this;c.lookupReference("btnDay").disable();c.lookupReference("btnMonth").enable();c.store.setRemoteFilter(true);c.store.filter("type","day");c.store.load()}},0,["refillchart"],["component","box","container","panel","chartpanel","refillchart"],{component:true,box:true,container:true,panel:true,chartpanel:true,refillchart:true},["widget.refillchart"],0,[MBilling.view.refill,"Chart"],0));(Ext.cmd.derive("MBilling.view.methodPay.Controller",Ext.ux.app.ViewController,{init:function(){var b=this;b.control({methodpaycombo:{select:b.onSelectMethod}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectMethod:function(c,d){showFields=d.getData().showFields.split(",");this.showFieldsRelated(showFields)},showFieldsRelated:function(f){var d=this,e=d.formPanel.getForm().getFields();e.each(function(a){a.setVisible(f.indexOf(a.name)!==-1)})},onEdit:function(){var c=this,d=c.list.getSelectionModel().getSelection()[0];method=d?d.get("payment_method"):"Moip";showFields=c.formPanel.down("methodpaycombo").store.findRecord("payment_method",method).getData().showFields;showFields=showFields.split(",");c.showFieldsRelated(showFields);Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)},onNew:function(){var c=this,d=c.list.getSelectionModel().getSelection()[0];method="Moip";showFields=c.formPanel.down("methodpaycombo").store.findRecord("payment_method",method).getData().showFields;showFields=showFields.split(",");c.showFieldsRelated(showFields);Ext.ux.app.ViewController.prototype.onNew.apply(this,arguments)}},0,0,0,0,["controller.methodpay"],0,[MBilling.view.methodPay,"Controller"],0));(Ext.cmd.derive("MBilling.view.methodPay.Module",Ext.ux.panel.Module,{controller:"methodpay"},0,["methodpaymodule"],["component","box","container","uxpanelmodule","methodpaymodule"],{component:true,box:true,container:true,uxpanelmodule:true,methodpaymodule:true},["widget.methodpaymodule"],0,[MBilling.view.methodPay,"Module"],0));(Ext.cmd.derive("MBilling.view.methodPay.List",Ext.ux.grid.Panel,{store:"MethodPay",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("paymentmethods"),dataIndex:"payment_method",flex:2},{header:t("country"),dataIndex:"country",flex:2},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:2},{header:t("active"),dataIndex:"active",flex:1,comboRelated:"booleancombo",renderer:Helper.Util.formatBooleanActive,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")]]}}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["methodpaylist"],["component","box","container","panel","tablepanel","gridpanel","grid","methodpaylist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,methodpaylist:true},["widget.methodpaylist"],0,[MBilling.view.methodPay,"List"],0));(Ext.cmd.derive("MBilling.view.methodPay.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{xtype:"methodpaycombo",name:"payment_method",valueField:"payment_method",fieldLabel:t("paymentmethods")},{name:"show_name",fieldLabel:t("showName")},{xtype:"userlookup",ownerForm:b,name:"id_user"},{xtype:"paymentcountrycombo",name:"country",fieldLabel:t("country")},{xtype:"booleancombo",name:"active",fieldLabel:t("active")},{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,00",name:"min",value:10,fieldLabel:t("Min amount")},{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,00",name:"max",value:500,fieldLabel:t("Max amount")},{name:"username",fieldLabel:t("Username"),allowBlank:true},{name:"url",fieldLabel:"Url",allowBlank:true},{xtype:"noyescombo",name:"fee",fieldLabel:t("Discount")+" "+t("Fee"),allowBlank:true},{xtype:"paymentbanckcombo",name:"boleto_banco",fieldLabel:t("Bank"),allowBlank:true},{name:"boleto_convenio",fieldLabel:t("numeroconvenio"),allowBlank:true},{name:"boleto_agencia",fieldLabel:t("agencia"),allowBlank:true},{name:"boleto_conta_corrente",fieldLabel:t("contacorrente"),allowBlank:true},{name:"boleto_inicio_nosso_numeroa",fieldLabel:t("Inicio nosso nº"),allowBlank:true},{name:"boleto_carteira",fieldLabel:t("carteira"),allowBlank:true},{name:"boleto_taxa",fieldLabel:t("taxa"),allowBlank:true},{name:"boleto_instrucoes",fieldLabel:t("instructions"),maxLength:"100",allowBlank:true},{name:"boleto_nome_emp",fieldLabel:t("company"),allowBlank:true},{name:"boleto_end_emp",fieldLabel:t("address"),allowBlank:true},{name:"boleto_cidade_emp",fieldLabel:t("city"),allowBlank:true},{name:"boleto_estado_emp",fieldLabel:t("state"),allowBlank:true},{name:"boleto_cpf_emp",fieldLabel:"CNPJ CPF",allowBlank:true},{name:"pagseguro_TOKEN",fieldLabel:"TOKEN",allowBlank:true},{name:"P2P_CustomerSiteID",fieldLabel:t("P2P CustomerSiteID"),allowBlank:true},{name:"P2P_KeyID",fieldLabel:t("P2P KeyID"),allowBlank:true},{name:"P2P_Passphrase",fieldLabel:t("P2P Passphrase"),allowBlank:true},{name:"P2P_RecipientKeyID",fieldLabel:t("P2P RecipientKeyID"),allowBlank:true},{name:"P2P_tax_amount",fieldLabel:t("P2P Tax Amount"),allowBlank:true},{name:"client_id",fieldLabel:t("Client id"),allowBlank:true},{name:"client_secret",fieldLabel:t("Client Secret"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["methodpayform"],["component","box","container","panel","form","methodpayform"],{component:true,box:true,container:true,panel:true,form:true,methodpayform:true},["widget.methodpayform"],0,[MBilling.view.methodPay,"Form"],0));(Ext.cmd.derive("MBilling.view.methodPay.Combo",Ext.form.field.ComboBox,{name:"id_methodpay",fieldLabel:t("methodPay"),displayField:"show_name",valueField:"id",forceSelection:true,editable:false,initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.MethodPay",{proxy:{type:"uxproxy",module:"methodpay",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["methodpaycombo"],["component","box","field","textfield","pickerfield","combobox","combo","methodpaycombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,methodpaycombo:true},["widget.methodpaycombo"],0,[MBilling.view.methodPay,"Combo"],0));(Ext.cmd.derive("MBilling.view.voucher.Controller",Ext.ux.app.ViewController,{onSave:function(){var b=this;Ext.ux.app.ViewController.prototype.onSave.apply(this,arguments);b.formPanel.setLoading(false);b.saveButton.enable();b.store.load()}},0,0,0,0,["controller.voucher"],0,[MBilling.view.voucher,"Controller"],0));(Ext.cmd.derive("MBilling.view.voucher.Module",Ext.ux.panel.Module,{controller:"voucher"},0,["vouchermodule"],["component","box","container","uxpanelmodule","vouchermodule"],{component:true,box:true,container:true,uxpanelmodule:true,vouchermodule:true},["widget.vouchermodule"],0,[MBilling.view.voucher,"Module"],0));(Ext.cmd.derive("MBilling.view.voucher.List",Ext.ux.grid.Panel,{store:"Voucher",initComponent:function(){var b=this;b.buttonCsv=false;b.allowPrint=false;b.buttonUpdateLot=false;b.allowUpdate=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:3,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("credit"),dataIndex:"credit",renderer:Helper.Util.formatMoneyDecimal,filter:{type:"int",field:"t.credit"},flex:3},{header:t("voucher"),dataIndex:"voucher",flex:5},{header:t("description"),dataIndex:"tag",flex:3,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("usedate"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"usedate",flex:4},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"creationdate",flex:4,hidden:App.user.isClient,hideable:!App.user.isClient}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["voucherlist"],["component","box","container","panel","tablepanel","gridpanel","grid","voucherlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,voucherlist:true},["widget.voucherlist"],0,[MBilling.view.voucher,"List"],0));(Ext.cmd.derive("MBilling.view.voucher.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;if(!App.user.isClient){b.fieldsHideEdit=["quantity"]}if(App.user.isClient){b.textNew=t("Insert Voucher");b.buttonNewWidth=150}b.items=[{xtype:"moneyfield",name:"credit",fieldLabel:t("credit"),hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"id_plan",fieldLabel:t("Plan"),xtype:"plancombo",hidden:!App.user.isAdmin,allowBlank:!App.user.isAdmin},{xtype:"languagecombo",name:"language",fieldLabel:t("language"),hidden:!App.user.isAdmin,allowBlank:!App.user.isAdmin},{name:"prefix_local",fieldLabel:t("prefixlocal"),value:App.user.base_country=="BRL"?"0/55,*/5511/8,*/5511/9":App.user.base_country=="ARG"?"0/54,*/5411/8,15/54911/10,16/54911/10":"",emptyText:"match / replace / length",hidden:!App.user.isAdmin,allowBlank:true},{xtype:"numberfield",name:"quantity",fieldLabel:t("Quantity"),hidden:!App.user.isAdmin,allowBlank:!App.user.isAdmin,value:10},{name:"tag",fieldLabel:t("description"),hidden:App.user.isClient,allowBlank:true},{xtype:"numberfield",name:"voucher",fieldLabel:t("voucher"),value:"",maxLength:6,minLength:6,hidden:!App.user.isClient,allowBlank:!App.user.isClient}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["voucherform"],["component","box","container","panel","form","voucherform"],{component:true,box:true,container:true,panel:true,form:true,voucherform:true},["widget.voucherform"],0,[MBilling.view.voucher,"Form"],0));(Ext.cmd.derive("MBilling.view.refillprovider.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.refillprovider"],0,[MBilling.view.refillprovider,"Controller"],0));(Ext.cmd.derive("MBilling.view.refillprovider.Module",Ext.ux.panel.Module,{controller:"refillprovider"},0,["refillprovidermodule"],["component","box","container","uxpanelmodule","refillprovidermodule"],{component:true,box:true,container:true,uxpanelmodule:true,refillprovidermodule:true},["widget.refillprovidermodule"],0,[MBilling.view.refillprovider,"Module"],0));(Ext.cmd.derive("MBilling.view.refillprovider.List",Ext.ux.grid.Panel,{store:"Refillprovider",initComponent:function(){var b=this;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{xtype:"templatecolumn",tpl:"{idProviderprovider_name}",header:t("provider"),dataIndex:"id_provider",comboFilter:"providercombo",flex:2},{header:t("credit"),dataIndex:"credit",renderer:Helper.Util.formatMoneyDecimal,flex:2},{header:t("description"),dataIndex:"description",flex:4},{header:t("payment"),dataIndex:"payment",renderer:Helper.Util.formattyyesno,filter:{type:"list",options:[[0,t("no")],[1,t("yes")]]},flex:2},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"date",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["refillproviderlist"],["component","box","container","panel","tablepanel","gridpanel","grid","refillproviderlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,refillproviderlist:true},["widget.refillproviderlist"],0,[MBilling.view.refillprovider,"List"],0));(Ext.cmd.derive("MBilling.view.refillprovider.Form",Ext.ux.form.Panel,{bodyPadding:0,fieldsHideUpdateLot:["id_provider"],initComponent:function(){var b=this;b.items=[{xtype:"providercombo"},{xtype:"moneyfield",name:"credit",fieldLabel:t("credit")},{xtype:"textareafield",name:"description",fieldLabel:t("description"),allowBlank:true},{xtype:"yesnocombo",name:"payment",fieldLabel:t("add")+" "+t("payment"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["refillproviderform"],["component","box","container","panel","form","refillproviderform"],{component:true,box:true,container:true,panel:true,form:true,refillproviderform:true},["widget.refillproviderform"],0,[MBilling.view.refillprovider,"Form"],0));(Ext.cmd.derive("MBilling.view.boleto.Controller",Ext.ux.app.ViewController,{onAfterSave:function(d){var c=this;if(c.formPanel.idRecord==0){url="index.php/boleto/secondVia/?id=last";window.open(url)}Ext.ux.app.ViewController.prototype.onAfterSave.apply(this,arguments)},onSecondVia:function(e){var f=this,d=f.list.getSelectionModel().getSelection()[0];if(f.list.getSelectionModel().getSelection().length==0){Ext.ux.Alert.alert(f.titleError,t("Por favor selecione um bolero"),"notification")}else{if(f.list.getSelectionModel().getSelection().length>1){Ext.ux.Alert.alert(f.titleError,t("Por favor selecione somente um bolero"),"notification")}else{url="index.php/boleto/secondVia/?id="+d.get("id");window.open(url)}}}},0,0,0,0,["controller.boleto"],0,[MBilling.view.boleto,"Controller"],0));(Ext.cmd.derive("MBilling.view.boleto.Module",Ext.ux.panel.Module,{controller:"boleto"},0,["boletomodule"],["component","box","container","uxpanelmodule","boletomodule"],{component:true,box:true,container:true,uxpanelmodule:true,boletomodule:true},["widget.boletomodule"],0,[MBilling.view.boleto,"Module"],0));(Ext.cmd.derive("MBilling.view.boleto.List",Ext.ux.grid.Panel,{store:"Boleto",iconButtonCsv:"boleto",textButtonCsv:t("Importar Retorno"),iconButtonImportCsv:"boleto",textButtonImportCsv:t("Importar Retorno"),initComponent:function(){var b=this;b.buttonCsv=false;b.buttonUpdateLot=false;b.buttonImportCsv=App.user.isAdmin;b.extraButtons=[{text:t("Segunda via"),iconCls:"boleto",handler:"onSecondVia",disabled:false}];b.columns=[{header:t("Nosso Número"),dataIndex:"id",flex:3,hidden:!App.user.isAdmin,hideable:App.user.isAdmin},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("value"),dataIndex:"payment",renderer:Helper.Util.formatMoneyDecimal,flex:4},{header:"Pago",dataIndex:"status",renderer:Helper.Util.formattyyesno,flex:2,filter:{type:"list",options:[[0,t("no")],[1,t("yes")]]}},{header:t("description"),dataIndex:"description",flex:5},{header:"Vencimento",renderer:Ext.util.Format.dateRenderer("Y-m-d"),dataIndex:"vencimento",flex:4},{header:"Gerado",renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"date",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["boletolist"],["component","box","container","panel","tablepanel","gridpanel","grid","boletolist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,boletolist:true},["widget.boletolist"],0,[MBilling.view.boleto,"List"],0));(Ext.cmd.derive("MBilling.view.boleto.Form",Ext.ux.form.Panel,{fieldsHideEdit:["cid"],initComponent:function(){var b=this;b.items=[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:App.user.isClient},{xtype:"moneyfield",name:"payment",fieldLabel:t("value"),readOnly:App.user.isClient},{xtype:"yesnocombo",name:"status",fieldLabel:t("Pago"),hidden:App.user.isClient,value:0},{xtype:"datefield",name:"vencimento",fieldLabel:"Vencimento",format:"Y-m-d H:i:s",hidden:App.user.isClient||App.user.isAgent},{xtype:"textareafield",name:"description",fieldLabel:t("description"),readOnly:App.user.isClient}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["boletoform"],["component","box","container","panel","form","boletoform"],{component:true,box:true,container:true,panel:true,form:true,boletoform:true},["widget.boletoform"],0,[MBilling.view.boleto,"Form"],0));(Ext.cmd.derive("Ext.ux.window.ImportBoleto",Ext.window.Window,{autoShow:true,modal:true,layout:"fit",iconCls:"boleto",title:t("Importa Retorno Boleto"),width:400,height:175,labelWidthFields:180,htmlTipInfo:"",fieldsImport:[],initComponent:function(){var d=this,c=Ext.Array.merge(d.fieldsImport,[{xtype:"uploadfield",fieldLabel:t("Selecion o arquivo .RET"),htmlTipInfo:d.htmlTipInfo}]);d.items=[{xtype:"form",bodyPadding:5,labelWidth:d.labelWidthFields,items:c}];d.title=d.title+(d.titleModule?" - "+d.titleModule:"");d.bbar=[{xtype:"tbtext",text:t("maxSizeFile")+"3 MB"},"->",{iconCls:"boleto",text:t("importText"),scope:d,handler:d.onImport}];Ext.window.Window.prototype.initComponent.apply(this,arguments)},onImport:function(d){var f=this,e=f.list.store;d.disable();f.list.setLoading(true);f.down("form").submit({url:"index.php/boleto/retorno",scope:f,success:function(c,b){var a=Ext.decode(b.response.responseText);if(a.success){Ext.ux.Alert.alert(t("Success"),a.msg,"success",true,false,40000)}else{Ext.ux.Alert.alert(t("Error"),a.errors,"error")}d.enable();f.list.setLoading(false);e.load();f.close()},failure:function(c,b){if(Ext.isObject(b.response.responseText)){var a=Ext.decode(b.response.responseText);Ext.ux.Alert.alert(t("Error"),a.errors,"error")}else{Ext.ux.Alert.alert(t("Error"),b.response.responseText,"error",true,10)}d.enable();f.list.setLoading(false);f.close()}})}},0,0,["component","box","container","panel","window"],{component:true,box:true,container:true,panel:true,window:true},0,0,[Ext.ux.window,"ImportBoleto"],0));(Ext.cmd.derive("MBilling.view.boleto.ImportCsv",Ext.ux.window.ImportBoleto,{title:t("Importar Retorno"),labelWidthFields:250,height:275,fieldsImport:[{xtype:"boletobanckcombo",name:"banco",fieldLabel:t("Banco"),width:350}]},0,["boletoimportcsv"],["component","box","container","panel","window","boletoimportcsv"],{component:true,box:true,container:true,panel:true,window:true,boletoimportcsv:true},["widget.boletoimportcsv"],0,[MBilling.view.boleto,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.offer.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.offer"],0,[MBilling.view.offer,"Controller"],0));(Ext.cmd.derive("MBilling.view.offer.Combo",Ext.form.field.ComboBox,{name:"id_offer",fieldLabel:t("offer"),displayField:"label",valueField:"id",value:0,extraValues:[{id:0,label:t("undefined")}],initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Offer",{proxy:{type:"uxproxy",module:"offer",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["offercombo"],["component","box","field","textfield","pickerfield","combobox","combo","offercombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,offercombo:true},["widget.offercombo"],0,[MBilling.view.offer,"Combo"],0));(Ext.cmd.derive("MBilling.view.offer.Module",Ext.ux.panel.Module,{controller:"offer"},0,["offermodule"],["component","box","container","uxpanelmodule","offermodule"],{component:true,box:true,container:true,uxpanelmodule:true,offermodule:true},["widget.offermodule"],0,[MBilling.view.offer,"Module"],0));(Ext.cmd.derive("MBilling.view.offer.List",Ext.ux.grid.Panel,{store:"Offer",initComponent:function(){var b=this;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("name"),dataIndex:"label",flex:1},{header:t("packagetype"),dataIndex:"packagetype",renderer:Helper.Util.formatPackageType,comboRelated:"offertypecombo",flex:1,filter:{type:"list",options:[[0,t("unlimitedcalls")],[1,t("numberfreecalls")],[2,t("freeseconds")]]}},{header:t("freetimetocall"),dataIndex:"freetimetocall",flex:1},{header:t("periode"),dataIndex:"billingtype",renderer:Helper.Util.formatBillingType,comboRelated:"billingtypecombo",flex:1,filter:{type:"list",options:[[0,t("monthly")],[1,t("weekly")]]}},{header:t("price"),dataIndex:"price",renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,hideable:App.user.isAdmin,flex:2},{header:t("creationdate"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"creationdate",flex:1}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["offerlist"],["component","box","container","panel","tablepanel","gridpanel","grid","offerlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,offerlist:true},["widget.offerlist"],0,[MBilling.view.offer,"List"],0));(Ext.cmd.derive("MBilling.view.offer.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["name"],items:[{name:"label",fieldLabel:t("name")},{xtype:"offertypecombo",name:"packagetype",fieldLabel:t("packagetype")},{name:"freetimetocall",fieldLabel:t("freetimetocall")},{xtype:"billingtypecombo",name:"billingtype",fieldLabel:t("periode")},{xtype:"moneyfield",name:"price",fieldLabel:t("price")}]},0,["offerform"],["component","box","container","panel","form","offerform"],{component:true,box:true,container:true,panel:true,form:true,offerform:true},["widget.offerform"],0,[MBilling.view.offer,"Form"],0));(Ext.cmd.derive("MBilling.view.offerCdr.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.offercdr"],0,[MBilling.view.offerCdr,"Controller"],0));(Ext.cmd.derive("MBilling.view.offerCdr.Module",Ext.ux.panel.Module,{controller:"offercdr"},0,["offercdrmodule"],["component","box","container","uxpanelmodule","offercdrmodule"],{component:true,box:true,container:true,uxpanelmodule:true,offercdrmodule:true},["widget.offercdrmodule"],0,[MBilling.view.offerCdr,"Module"],0));(Ext.cmd.derive("MBilling.view.offerCdr.List",Ext.ux.grid.Panel,{store:"OfferCdr",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"date_consumption",flex:3},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:3},{xtype:"templatecolumn",tpl:"{idOfferlabel}",header:t("offer"),dataIndex:"id_offer",comboFilter:"offercombo",flex:3},{header:t("duration"),dataIndex:"used_secondes",renderer:Helper.Util.formatsecondsToTime,flex:3}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["offercdrlist"],["component","box","container","panel","tablepanel","gridpanel","grid","offercdrlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,offercdrlist:true},["widget.offercdrlist"],0,[MBilling.view.offerCdr,"List"],0));(Ext.cmd.derive("MBilling.view.offerCdr.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.columns=[{xtype:"usercombo"},{xtype:"offercombo"},{name:"used_secondes",fieldLabel:t("usedsecondes")},{xtype:"datefield",name:"date_consumption",fieldLabel:t("date"),format:"Y-m-d H:i:s"}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["offercdrform"],["component","box","container","panel","form","offercdrform"],{component:true,box:true,container:true,panel:true,form:true,offercdrform:true},["widget.offercdrform"],0,[MBilling.view.offerCdr,"Form"],0));(Ext.cmd.derive("MBilling.view.offerUse.Module",Ext.ux.panel.Module,{controller:"offeruse"},0,["offerusemodule"],["component","box","container","uxpanelmodule","offerusemodule"],{component:true,box:true,container:true,uxpanelmodule:true,offerusemodule:true},["widget.offerusemodule"],0,[MBilling.view.offerUse,"Module"],0));(Ext.cmd.derive("MBilling.view.offerUse.List",Ext.ux.grid.Panel,{store:"OfferUse",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:3},{xtype:"templatecolumn",tpl:"{idOfferlabel}",header:t("offer"),dataIndex:"id_offer",comboFilter:"offercombo",flex:3},{header:t("monthpayed"),dataIndex:"month_payed",flex:3},{header:t("reservationdate"),renderer:Ext.util.Format.dateRenderer("Y-m-d"),dataIndex:"reservationdate",flex:3},{header:t("releasedate"),renderer:Ext.util.Format.dateRenderer("Y-m-d"),dataIndex:"releasedate",flex:3}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["offeruselist"],["component","box","container","panel","tablepanel","gridpanel","grid","offeruselist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,offeruselist:true},["widget.offeruselist"],0,[MBilling.view.offerUse,"List"],0));(Ext.cmd.derive("MBilling.view.offerUse.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{xtype:"userlookup",ownerForm:b,readOnly:true},{xtype:"offercombo",readOnly:true},{name:"month_payed",fieldLabel:t("monthpayed")},{xtype:"datefield",name:"reservationdate",fieldLabel:t("reservationdate"),format:"Y-m-d H:i:s"}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["offeruseform"],["component","box","container","panel","form","offeruseform"],{component:true,box:true,container:true,panel:true,form:true,offeruseform:true},["widget.offeruseform"],0,[MBilling.view.offerUse,"Form"],0));(Ext.cmd.derive("MBilling.view.campaign.Controller",Ext.ux.app.ViewController,{isSubmitForm:true,init:function(){var b=this;b.control({typecampaigndestinationcombo:{select:b.onSelectMethod}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectMethod:function(c,d){this.showFieldsRelated(d.getData().showFields)},showFieldsRelated:function(j){var l=this,m=l.formPanel.getForm(),g=l.formPanel.getForm().getFields(),f=Ext.get(Ext.Element.getActiveElement()).component;l.onSetVisibleFiel(f,m,f.value)},onSetVisibleFiel:function(e,d,f){if(e.value=="undefined"){e.setValue("undefined")}if(e.name.match("^type_0")){d.findField("id_queue_0").setVisible(f.match("^queue"));d.findField("id_sip_0").setVisible(f.match("^sip"));d.findField("id_ivr_0").setVisible(f.match("^ivr"));d.findField("extension_0").setVisible(f.match("^group|^number|^custom"))}},onEdit:function(){var f=this,d=f.formPanel.getForm(),e=f.list.getSelectionModel().getSelection()[0];if(e.getData()["type_0"]=="ivr"){d.findField("id_ivr_0").setVisible(true);d.findField("id_sip_0").setVisible(false);d.findField("id_queue_0").setVisible(false);d.findField("extension_0").setVisible(false)}else{if(e.getData()["type_0"]=="sip"){d.findField("id_sip_0").setVisible(true);d.findField("id_ivr_0").setVisible(false);d.findField("id_queue_0").setVisible(false);d.findField("extension_0").setVisible(false)}else{if(e.getData()["type_0"]=="queue"){d.findField("id_queue_0").setVisible(true);d.findField("id_sip_0").setVisible(false);d.findField("id_ivr_0").setVisible(false);d.findField("extension_0").setVisible(false)}else{if(e.getData()["type_0"].match("custom|number|group")){d.findField("extension_0").setVisible(true);d.findField("id_ivr_0").setVisible(false);d.findField("id_sip_0").setVisible(false);d.findField("id_queue_0").setVisible(false)}else{d.findField("id_queue_0").setVisible(false);d.findField("id_sip_0").setVisible(false);d.findField("id_ivr_0").setVisible(false);d.findField("extension_0").setVisible(false)}}}}Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)},onNew:function(){var f=this,d=f.formPanel.getForm(),e=f.list.getSelectionModel().getSelection()[0];d.findField("id_ivr_0").setVisible(false);d.findField("id_sip_0").setVisible(false);d.findField("id_queue_0").setVisible(false);d.findField("extension_0").setVisible(false);Ext.ux.app.ViewController.prototype.onNew.apply(this,arguments)},submitForm:function(d){var f=this,e=f.store;Ext.apply(f.params,{id_phonebook_array:f.formPanel.getForm().getFieldValues().id_phonebook.join(",")});f.formPanel.add({xtype:"hiddenfield",name:f.idProperty,value:f.formPanel.idRecord});f.formPanel.getForm().submit({url:f.store.getProxy().api.create,params:f.params,scope:f,success:function(c,b){var a=Ext.decode(b.response.responseText);if(a.success){Ext.ux.Alert.alert(f.titleSuccess,a.msg,"success");f.formPanel.fireEvent("aftersave",f.formPanel,a.rows[0])}else{errors=Helper.Util.convertErrorsJsonToString(a.msg);if(!Ext.isObject(a.errors)){Ext.ux.Alert.alert(f.titleError,errors,"error")}else{c.markInvalid(a.errors);Ext.ux.Alert.alert(f.titleWarning,f.msgFormInvalid,"warning")}}f.store.load();f.formPanel.setLoading(false);f.saveButton.enable()},failure:function(j,c){var b=Ext.decode(c.response.responseText),a=Helper.Util.convertErrorsJsonToString(b.errors);if(!Ext.isObject(b.errors)){Ext.ux.Alert.alert(f.titleError,a,"error")}else{j.markInvalid(b.errors);Ext.ux.Alert.alert(f.titleWarning,a,"error")}f.formPanel.setLoading(false);f.saveButton.enable()}})},onTestCampaign:function(e){var f=this,d=f.list.getSelectionModel().getSelection()[0];if(f.list.getSelectionModel().getSelection().length==0){Ext.ux.Alert.alert(f.titleError,t("Please Select one campaign"),"notification")}else{if(f.list.getSelectionModel().getSelection().length>1){Ext.ux.Alert.alert(f.titleError,t("Please Select only one campaign"),"notification")}else{Ext.Ajax.request({url:"index.php/campaign/testCampaign",params:{id:d.get("id")},scope:f,success:function(b){b=Ext.decode(b.responseText);if(b[f.nameSuccessRequest]){Ext.ux.Alert.alert(f.titleSuccess,b[f.nameMsgRequest],"success")}else{var a=Helper.Util.convertErrorsJsonToString(b[f.nameMsgRequest]);Ext.ux.Alert.alert(f.titleSuccess,a,"error")}}})}}}},0,0,0,0,["controller.campaign"],0,[MBilling.view.campaign,"Controller"],0));(Ext.cmd.derive("MBilling.view.campaign.Combo",Ext.form.field.ComboBox,{name:"id_campaign",fieldLabel:t("campaign"),displayField:"name",forceSelection:true,editable:false,valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.Campaign",{proxy:{type:"uxproxy",module:"campaign",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["campaigncombo"],["component","box","field","textfield","pickerfield","combobox","combo","campaigncombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,campaigncombo:true},["widget.campaigncombo"],0,[MBilling.view.campaign,"Combo"],0));(Ext.cmd.derive("MBilling.view.general.TypeCampaignDestination",Ext.form.field.ComboBox,{fieldLabel:t("type"),forceSelection:true,editable:false,value:"",store:[["",t("")],["undefined",t("Undefined")],["sip",t("SIP")],["ivr",t("IVR")],["queue",t("Queue")],["group",t("Group")],["custom",t("Custom")]]},0,["typecampaigndestinationcombo"],["component","box","field","textfield","pickerfield","combobox","combo","typecampaigndestinationcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,typecampaigndestinationcombo:true},["widget.typecampaigndestinationcombo"],0,[MBilling.view.general,"TypeCampaignDestination"],0));(Ext.cmd.derive("MBilling.view.campaign.Module",Ext.ux.panel.Module,{controller:"campaign"},0,["campaignmodule"],["component","box","container","uxpanelmodule","campaignmodule"],{component:true,box:true,container:true,uxpanelmodule:true,campaignmodule:true},["widget.campaignmodule"],0,[MBilling.view.campaign,"Module"],0));(Ext.cmd.derive("MBilling.view.campaign.List",Ext.ux.grid.Panel,{store:"Campaign",fieldSearch:"name",initComponent:function(){var b=this;b.buttonCsv=false;b.allowPrint=false;b.extraButtons=[{text:t("Test")+" "+t("Campaign"),iconCls:"call",handler:"onTestCampaign",disabled:false}];b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("name"),dataIndex:"name",flex:4},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:3,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("status"),dataIndex:"status",renderer:Helper.Util.formatBooleanActive,comboRelated:"booleancombo",flex:2,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")]]}},{header:t("type"),dataIndex:"type",renderer:Helper.Util.formatCampaignType,comboRelated:"campaigntypecombo",flex:2,filter:App.user.l.slice(4,7)=="wap"?{type:"list",options:[[0,t("sms")],[1,t("voice")],[3,t("WhasApp")]]}:{type:"list",options:[[0,t("sms")],[1,t("voice")]]}},{header:t("daily_start_time"),dataIndex:"daily_start_time",flex:4},{header:t("daily_stop_time"),dataIndex:"daily_stop_time",flex:4},{header:t("startingdate"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"startingdate",flex:4},{header:t("Call Limit"),dataIndex:"frequency",flex:4,hidden:true,hideable:App.user.isAdmin},{header:t("Max Complete Call"),dataIndex:"secondusedreal",flex:3,hidden:true,hideable:App.user.isAdmin}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignlist"],["component","box","container","panel","tablepanel","gridpanel","grid","campaignlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,campaignlist:true},["widget.campaignlist"],0,[MBilling.view.campaign,"List"],0));(Ext.cmd.derive("MBilling.view.campaign.Form",Ext.ux.form.Panel,{bodyPadding:0,fieldsHideUpdateLot:["id_user","name","audio","audio_2","id_phonebook"],fileUpload:true,initComponent:function(){var b=this;b.labelWidthFields=120;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{plugins:"markallowblank",allowBlank:false,anchor:"100%",labelAlign:"right"}},items:[{title:t("general"),items:[{xtype:App.user.isClient?"textfield":"userlookup",ownerForm:b,hidden:App.user.isClient},{fieldLabel:t("Plan"),xtype:"plancombo",name:"id_plan",hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"name",fieldLabel:t("name")},{xtype:"booleancombo",name:"status",fieldLabel:t("status")},{xtype:"datetimefield",name:"startingdate",fieldLabel:t("startingdate"),format:"Y-m-d H:i:s",value:new Date()},{xtype:"datetimefield",name:"expirationdate",fieldLabel:t("expirationdate"),format:"Y-m-d H:i:s",value:"2030-01-01 00:00:00"},{xtype:"campaigntypefullcombo",name:"type",fieldLabel:t("type")},{xtype:"uploadfield",fieldLabel:t("Audio"),emptyText:"Select an wav or gsm File",allowBlank:true,name:"audio",extAllowed:["wav","gsm"]},{xtype:"uploadfield",fieldLabel:t("Audio")+"2",emptyText:"Select an wav or gsm File",allowBlank:true,name:"audio_2",extAllowed:["wav","gsm"]},{xtype:"yesnocombo",name:"restrict_phone",fieldLabel:t("Restrict Phone"),hidden:App.user.isClient,allowBlank:true},{style:"margin-top:25px",xtype:"fieldset",title:t("Forward to"),collapsible:true,collapsed:false,height:110,defaults:{labelWidth:190,anchor:"100%",labelAlign:b.labelAlignFields},items:[{xtype:"numberfield",name:"digit_authorize",fieldLabel:t("Number to Forward"),value:"-1",minValue:"-1",maxValue:9},{fieldLabel:t("Forward Type"),name:"type_0",xtype:"typecampaigndestinationcombo",allowBlank:true},{xtype:"textfield",name:"extensions_0",fieldLabel:t("Destination"),value:"0",allowBlank:true,hidden:true},{xtype:"ivrlookup",ownerForm:b,name:"id_ivr_0",fieldLabel:t("IVR"),displayField:"id_ivr_0_name",allowBlank:true,hidden:true},{xtype:"queuelookup",ownerForm:b,name:"id_queue_0",fieldLabel:t("Queue"),displayField:"id_queue_0_name",allowBlank:true,hidden:true},{xtype:"siplookup",ownerForm:b,name:"id_sip_0",displayField:"id_sip_0_name",fieldLabel:t("SIP"),allowBlank:true,hidden:true},{xtype:"textfield",fieldLabel:t("Destination"),name:"extension_0",hidden:true}]},{style:"margin-top:10px",xtype:"fieldset",title:t("Select one or more phonebook"),collapsible:true,collapsed:false,items:[{labelWidth:10,name:"id_phonebook",fieldLabel:t("phonebook"),anchor:"100%",fieldLabel:"",xtype:"phonebooktag",allowBlank:true}]}]},{title:t("schedules"),items:[{name:"daily_start_time",fieldLabel:t("daily_start_time"),value:"09:00"},{name:"daily_stop_time",fieldLabel:t("daily_stop_time"),value:"18:00"},{xtype:"yesnocombo",fieldLabel:t("monday"),name:"monday"},{xtype:"yesnocombo",fieldLabel:t("tuesday"),name:"tuesday"},{xtype:"yesnocombo",fieldLabel:t("wednesday"),name:"wednesday"},{xtype:"yesnocombo",fieldLabel:t("thursday"),name:"thursday"},{xtype:"yesnocombo",fieldLabel:t("friday"),name:"friday"},{xtype:"noyescombo",fieldLabel:t("saturday"),name:"saturday"},{xtype:"noyescombo",fieldLabel:t("sunday"),name:"sunday"}]},{title:t("Limit"),items:[{name:"frequency",fieldLabel:t("Call Limit"),readOnly:!App.user.isAdmin,allowBlank:!App.user.isAdmin,value:App.user.isClient?1:10},{name:"nb_callmade",fieldLabel:t("Total Audio Time"),hidden:!App.user.isAdmin,allowBlank:true,value:0},{xtype:"booleancombo",name:"enable_max_call",fieldLabel:t("Enable")+" "+t("Max Complete Call"),hidden:!App.user.isAdmin,allowBlank:true,value:0},{name:"secondusedreal",fieldLabel:t("Max Complete Call"),hidden:!App.user.isAdmin,allowBlank:true,value:0}]},{title:t("SMS"),items:[{xtype:"textareafield",name:"description",fieldLabel:t("descriptionOrSmsText"),allowBlank:true,maxLength:160}]},{title:t("TTS/ASR"),hidden:!window.ttsasr,items:[{name:"tts_audio",fieldLabel:t("Audio 1 TTS"),allowBlank:true,maxLength:200},{name:"tts_audio2",fieldLabel:t("Audio 2 TTS"),allowBlank:true,maxLength:200},{xtype:"box",hidden:false,autoEl:{tag:"br"}},{name:"asr_options",fieldLabel:t("Option to validate ASR"),allowBlank:true,maxLength:160}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignform"],["component","box","container","panel","form","campaignform"],{component:true,box:true,container:true,panel:true,form:true,campaignform:true},["widget.campaignform"],0,[MBilling.view.campaign,"Form"],0));(Ext.cmd.derive("MBilling.view.campaignPoll.Controller",Ext.ux.app.ViewController,{isSubmitForm:true},0,0,0,0,["controller.campaignpoll"],0,[MBilling.view.campaignPoll,"Controller"],0));(Ext.cmd.derive("MBilling.view.campaignPoll.Combo",Ext.form.field.ComboBox,{name:"id_campaign_poll",fieldLabel:t("campaignpoll"),displayField:"name",valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.CampaignPoll",{proxy:{type:"uxproxy",module:"campaignPoll",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["campaignpollcombo"],["component","box","field","textfield","pickerfield","combobox","combo","campaignpollcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,campaignpollcombo:true},["widget.campaignpollcombo"],0,[MBilling.view.campaignPoll,"Combo"],0));(Ext.cmd.derive("MBilling.view.campaignPoll.Module",Ext.ux.panel.Module,{controller:"campaignpoll"},0,["campaignpollmodule"],["component","box","container","uxpanelmodule","campaignpollmodule"],{component:true,box:true,container:true,uxpanelmodule:true,campaignpollmodule:true},["widget.campaignpollmodule"],0,[MBilling.view.campaignPoll,"Module"],0));(Ext.cmd.derive("MBilling.view.campaignPoll.List",Ext.ux.grid.Panel,{store:"CampaignPoll",initComponent:function(){var b=this;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("name"),dataIndex:"name",flex:4},{xtype:"templatecolumn",tpl:"{idCampaignname}",header:t("campaign"),dataIndex:"id_campaign",comboFilter:"campaigncombo",flex:4},{header:t("description"),dataIndex:"description",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignpolllist"],["component","box","container","panel","tablepanel","gridpanel","grid","campaignpolllist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,campaignpolllist:true},["widget.campaignpolllist"],0,[MBilling.view.campaignPoll,"List"],0));(Ext.cmd.derive("MBilling.view.campaignPoll.Form",Ext.ux.form.Panel,{bodyPadding:0,fileUpload:true,fieldsHideUpdateLot:["id_campaign","name","arq_audio"],initComponent:function(){var b=this;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{plugins:"markallowblank",allowBlank:false,anchor:"100%",labelAlign:"right"}},items:[{title:t("general"),items:[{xtype:"campaigncombo"},{name:"name",fieldLabel:t("name")},{xtype:"numberfield",name:"repeat",fieldLabel:t("How many time to repeat, if the client press invalid option?"),minValue:0,maxValue:9,allowBlank:true},{xtype:"noyescombo",name:"request_authorize",fieldLabel:t("Request")+" "+t("authorization")},{xtype:"numberfield",name:"digit_authorize",fieldLabel:t("Number for authorize"),value:"1",minValue:1,maxValue:9,allowBlank:true},{xtype:"textareafield",name:"description",fieldLabel:t("description"),allowBlank:true},{xtype:"uploadfield",fieldLabel:"Audio",emptyText:"Select an wav or gsm File",allowBlank:true,name:"arq_audio",extAllowed:["wav","gsm"]}]},{title:t("options"),itemId:"optionsData",items:[{name:"option0",fieldLabel:t("option")+" 0",allowBlank:true},{name:"option1",fieldLabel:t("option")+" 1",allowBlank:true},{name:"option2",fieldLabel:t("option")+" 2",allowBlank:true},{name:"option3",fieldLabel:t("option")+" 3",allowBlank:true},{name:"option4",fieldLabel:t("option")+" 4",allowBlank:true},{name:"option5",fieldLabel:t("option")+" 5",allowBlank:true},{name:"option6",fieldLabel:t("option")+" 6",allowBlank:true},{name:"option7",fieldLabel:t("option")+" 7",allowBlank:true},{name:"option8",fieldLabel:t("option")+" 8",allowBlank:true},{name:"option9",fieldLabel:t("option")+" 9",allowBlank:true}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignpollform"],["component","box","container","panel","form","campaignpollform"],{component:true,box:true,container:true,panel:true,form:true,campaignpollform:true},["widget.campaignpollform"],0,[MBilling.view.campaignPoll,"Form"],0));(Ext.cmd.derive("MBilling.view.phoneNumber.Controller",Ext.ux.app.ViewController,{reprocessar:function(e){var g=this,f=g.list.getStore(),j=g.list.filters.getFilterData().length?Ext.encode(g.list.filters.getFilterData()):f.proxy.extraParams.filter;e.disable();g.list.setLoading(true);if(!j){Ext.ux.Alert.alert("Alert","Realize um filtro para reprocessar","notification");e.enable();g.list.setLoading(false);return}Ext.Msg.confirm("Confirm","Confirme que quer reprocessar os numeros pendentes?",function(a){if(a==="yes"){Ext.Ajax.request({url:"index.php/phoneNumber/reprocesar/",params:{filter:j},scope:g,success:function(c){c=Ext.decode(c.responseText);if(c[g.nameSuccessRequest]){Ext.ux.Alert.alert(g.titleSuccess,c[g.nameMsgRequest],"success");f.load();e.enable();g.list.setLoading(false)}else{var b=Helper.Util.convertErrorsJsonToString(c[g.nameMsgRequest]);Ext.ux.Alert.alert(g.titleError,b,"error");e.enable();g.list.setLoading(false)}}})}})}},0,0,0,0,["controller.phonenumber"],0,[MBilling.view.phoneNumber,"Controller"],0));(Ext.cmd.derive("MBilling.view.phoneNumber.Module",Ext.ux.panel.Module,{controller:"phonenumber"},0,["phonenumbermodule"],["component","box","container","uxpanelmodule","phonenumbermodule"],{component:true,box:true,container:true,uxpanelmodule:true,phonenumbermodule:true},["widget.phonenumbermodule"],0,[MBilling.view.phoneNumber,"Module"],0));(Ext.cmd.derive("MBilling.view.phoneNumber.List",Ext.ux.grid.Panel,{store:"PhoneNumber",buttonImportCsv:true,initComponent:function(){var b=this;b.extraButtons=[{text:t("Reprocessar"),iconCls:"callshop",handler:"reprocessar",disabled:false}];b.buttonUpdateLot=App.user.isAdmin&&!window.isTablet;b.buttonCsv=!window.isTablet;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("number"),dataIndex:"number",flex:4},{header:t("phonebook"),dataIndex:"idPhonebookname",filter:{type:"string",field:"idPhonebook.name"},flex:4},{header:t("status"),dataIndex:"status",renderer:Helper.Util.formatBooleanActive,comboRelated:"statuscombo",flex:2,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")],[2,t("pending")],[3,t("send")],[4,t("blocked")]]}},{header:t("name"),dataIndex:"name",hidden:true,hideable:true,flex:4},{header:t("city"),dataIndex:"city",hidden:true,hideable:true,flex:4},{header:t("description"),dataIndex:"info",hidden:true,flex:4},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"creationdate",hidden:true,hideable:App.user.isAdmin,flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["phonenumberlist"],["component","box","container","panel","tablepanel","gridpanel","grid","phonenumberlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,phonenumberlist:true},["widget.phonenumberlist"],0,[MBilling.view.phoneNumber,"List"],0));(Ext.cmd.derive("MBilling.view.phoneNumber.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["number"],initComponent:function(){var b=this;b.items=[{xtype:"phonebookcombo"},{name:"number",fieldLabel:t("number")},{name:"name",fieldLabel:t("name"),allowBlank:true},{name:"city",fieldLabel:t("city"),allowBlank:true},{xtype:"statuscombo",name:"status",fieldLabel:t("status"),allowBlank:true},{xtype:"textareafield",name:"info",fieldLabel:t("description"),allowBlank:true,hidden:!App.user.isAdmin}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["phonenumberform"],["component","box","container","panel","form","phonenumberform"],{component:true,box:true,container:true,panel:true,form:true,phonenumberform:true},["widget.phonenumberform"],0,[MBilling.view.phoneNumber,"Form"],0));(Ext.cmd.derive("MBilling.view.phoneBook.Combo",Ext.form.field.ComboBox,{name:"id_phonebook",fieldLabel:t("phonebook"),displayField:"name",forceSelection:true,editable:true,valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.PhoneBook",{proxy:{type:"uxproxy",module:"phoneBook",limitParam:undefined}});Ext.form.field.ComboBox.prototype.initComponent.apply(this,arguments)}},0,["phonebookcombo"],["component","box","field","textfield","pickerfield","combobox","combo","phonebookcombo"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,phonebookcombo:true},["widget.phonebookcombo"],0,[MBilling.view.phoneBook,"Combo"],0));(Ext.cmd.derive("MBilling.view.phoneNumber.ImportCsv",Ext.ux.window.ImportCsv,{htmlTipInfo:"
number,name,city
551135672677, Dany Hilger, New York
551156332233, Monica Leith, San Pablo
554153882200, John Mart, Madri
"+t("name")+" "+t("and")+" "+t("city")+" "+t("optional")+"",fieldsImport:[{xtype:"phonebookcombo",width:350}]},0,["phonenumberimportcsv"],["component","box","container","panel","window","phonenumberimportcsv"],{component:true,box:true,container:true,panel:true,window:true,phonenumberimportcsv:true},["widget.phonenumberimportcsv"],0,[MBilling.view.phoneNumber,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.rate.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.rate"],0,[MBilling.view.rate,"Controller"],0));(Ext.cmd.derive("MBilling.view.rate.Module",Ext.ux.panel.Module,{controller:"rate",flexForm:2,labelWidthFields:190},0,["ratemodule"],["component","box","container","uxpanelmodule","ratemodule"],{component:true,box:true,container:true,uxpanelmodule:true,ratemodule:true},["widget.ratemodule"],0,[MBilling.view.rate,"Module"],0));(Ext.cmd.derive("MBilling.view.rate.List",Ext.ux.grid.Panel,{store:"Rate",fieldSearch:"idPrefix.prefix",initComponent:function(){var b=this;b.buttonImportCsv=!App.user.isClient,b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("prefix"),dataIndex:"idPrefixprefix",filter:{type:"string",field:"idPrefix.prefix"},flex:window.isTablet?2:3},{dataIndex:"idPrefixdestination",header:t("destination"),filter:{type:"string",field:"idPrefix.destination"},flex:window.isTablet?2:3},{header:t("buyrate"),dataIndex:"buyrate",renderer:Helper.Util.formatMoneyDecimal4,hidden:!App.user.isAdmin,hideable:App.user.isAdmin,flex:2},{header:t("buyrateinitblock"),dataIndex:"buyrateinitblock",hidden:!App.user.isAdmin||window.isTablet,hideable:App.user.isAdmin,flex:2},{header:t("buyrateincrement"),dataIndex:"buyrateincrement",hidden:!App.user.isAdmin||window.isTablet,hideable:App.user.isAdmin,flex:2},{header:t("rateinitial"),dataIndex:"rateinitial",renderer:Helper.Util.formatMoneyDecimal4,flex:2},{header:t("initblock"),dataIndex:"initblock",hidden:window.isTablet,flex:2},{header:t("billingblock"),dataIndex:"billingblock",hidden:window.isTablet,flex:2},{xtype:"templatecolumn",tpl:"{idTrunktrunkcode}",header:t("trunk"),dataIndex:"id_trunk",comboFilter:"trunkcombo",flex:3,hidden:!App.user.isAdmin,hideable:App.user.isAdmin},{xtype:"templatecolumn",tpl:"{idPlanname}",header:t("plan"),dataIndex:"id_plan",comboFilter:"plancombo",flex:3},{header:t("includeinpackage"),dataIndex:"package_offer",hidden:true,hideable:App.user.isAdmin,flex:1},{header:t("status"),dataIndex:"status",hidden:true,hideable:App.user.isAdmin,flex:2,renderer:Helper.Util.formatBooleanActive,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")]]}}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["ratelist"],["component","box","container","panel","tablepanel","gridpanel","grid","ratelist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,ratelist:true},["widget.ratelist"],0,[MBilling.view.rate,"List"],0));(Ext.cmd.derive("MBilling.view.rate.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["id_prefix"],labelWidthFields:140,initComponent:function(){var b=this;b.items=[{name:"id_plan",fieldLabel:"Plan",xtype:"planlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:false},{name:"id_prefix",fieldLabel:"Destination",xtype:"prefixlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:false},{name:"id_trunk",fieldLabel:"Trunk",xtype:"trunklookup",ownerForm:b,hidden:!App.user.isAdmin,allowBlank:!App.user.isAdmin},{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,"+App.user.decimalPrecision,name:"buyrate",fieldLabel:t("buyrate"),hidden:!App.user.isAdmin,allowBlank:!App.user.isAdmin},{xtype:"numberfield",name:"buyrateinitblock",fieldLabel:t("buyrateinitblock"),value:1,minValue:1,hidden:!App.user.isAdmin,allowBlank:!App.user.isAdmin},{xtype:"numberfield",name:"buyrateincrement",fieldLabel:t("buyrateincrement"),value:1,minValue:1,hidden:!App.user.isAdmin,allowBlank:!App.user.isAdmin},{xtype:"numberfield",name:"minimal_time_buy",fieldLabel:t("Minimal time to buy"),value:0,minValue:0,hidden:!App.user.isAdmin},{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,"+App.user.decimalPrecision,name:"rateinitial",fieldLabel:t("rateinitial"),readOnly:App.user.isClient},{xtype:"numberfield",name:"initblock",fieldLabel:t("initblock"),value:1,minValue:1,hidden:App.user.isClient},{xtype:"numberfield",name:"billingblock",value:1,minValue:1,fieldLabel:t("billingblock"),hidden:App.user.isClient},{xtype:"numberfield",name:"minimal_time_charge",fieldLabel:t("Minimal time to charge"),value:0,minValue:0,hidden:App.user.isClient},{name:"additional_grace",fieldLabel:t("additional_grace"),allowBlank:true,hidden:!App.user.isAdmin},{xtype:"noyescombo",name:"package_offer",fieldLabel:t("includeinpackage"),hidden:!App.user.isAdmin,allowBlank:true},{xtype:"booleancombo",name:"status",fieldLabel:t("status"),hidden:!App.user.isAdmin,allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["rateform"],["component","box","container","panel","form","rateform"],{component:true,box:true,container:true,panel:true,form:true,rateform:true},["widget.rateform"],0,[MBilling.view.rate,"Form"],0));(Ext.cmd.derive("MBilling.view.rate.ImportCsv",Ext.ux.window.ImportCsv,{htmlTipInfo:"
"+t("dialprefix")+", "+t("destination")+", "+t("rateinitial")+", "+t("buyrate")+"
5511, Brasil SP, 0.080, 0.050
34, Spain Fix, 0.056, 0.034
54, Argentina, 0.025, 0.015

"+t("rateinitial")+" "+t("and")+" "+t("buyrate")+" "+t("optional")+"",labelWidthFields:160,height:window.isThemeTriton?350:275,initComponent:function(){var b=this;b.fieldsImport=[{xtype:"plancombo",fieldLabel:t("table"),width:350},{xtype:"trunkcombo",fieldLabel:t("trunkText"),width:350,hidden:!App.user.isAdmin},{style:"margin-top:25px",xtype:"fieldset",title:t("Csv Format"),collapsible:true,collapsed:false,defaults:{labelWidth:190,anchor:"100%",layout:{type:"hbox",labelAlign:b.labelAlignFields}},items:[{xtype:"pontovirgulacombo",name:"delimiter",fieldLabel:t("Delimiter"),width:230}]}];Ext.ux.window.ImportCsv.prototype.initComponent.apply(this,arguments)}},0,["rateimportcsv"],["component","box","container","panel","window","rateimportcsv"],{component:true,box:true,container:true,panel:true,window:true,rateimportcsv:true},["widget.rateimportcsv"],0,[MBilling.view.rate,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.phoneBook.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.phonebook"],0,[MBilling.view.phoneBook,"Controller"],0));(Ext.cmd.derive("MBilling.view.phoneBook.Module",Ext.ux.panel.Module,{controller:"phonebook"},0,["phonebookmodule"],["component","box","container","uxpanelmodule","phonebookmodule"],{component:true,box:true,container:true,uxpanelmodule:true,phonebookmodule:true},["widget.phonebookmodule"],0,[MBilling.view.phoneBook,"Module"],0));(Ext.cmd.derive("MBilling.view.phoneBook.List",Ext.ux.grid.Panel,{store:"PhoneBook",initComponent:function(){var b=this;b.columns=b.columns||[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("name"),dataIndex:"name",flex:5},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:3,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("status"),dataIndex:"status",renderer:Helper.Util.formatBooleanActive,comboRelated:"booleancombo",flex:3,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")]]}},{header:t("description"),dataIndex:"description",flex:5}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["phonebooklist"],["component","box","container","panel","tablepanel","gridpanel","grid","phonebooklist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,phonebooklist:true},["widget.phonebooklist"],0,[MBilling.view.phoneBook,"List"],0));(Ext.cmd.derive("MBilling.view.phoneBook.Form",Ext.ux.form.Panel,{bodyPadding:0,fieldsHideUpdateLot:["id_user","name"],initComponent:function(){var b=this;b.items=[{xtype:App.user.isClient?"textfield":"userlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:App.user.isClient},{name:"name",fieldLabel:t("name")},{xtype:"booleancombo",name:"status",fieldLabel:t("status"),allowBlank:true},{xtype:"textareafield",name:"description",fieldLabel:t("description"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["phonebookform"],["component","box","container","panel","form","phonebookform"],{component:true,box:true,container:true,panel:true,form:true,phonebookform:true},["widget.phonebookform"],0,[MBilling.view.phoneBook,"Form"],0));(Ext.cmd.derive("MBilling.view.phoneBook.Tag",Ext.form.field.Tag,{name:"id_phonebook",fieldLabel:t("phonebook"),displayField:"name",valueField:"id",initComponent:function(){var b=this;b.store=Ext.create("MBilling.store.PhoneBook",{proxy:{type:"uxproxy",module:"phoneBook",limitParam:undefined}});Ext.form.field.Tag.prototype.initComponent.apply(this,arguments)}},0,["phonebooktag"],["component","box","field","textfield","pickerfield","combobox","combo","tagfield","phonebooktag"],{component:true,box:true,field:true,textfield:true,pickerfield:true,combobox:true,combo:true,tagfield:true,phonebooktag:true},["widget.phonebooktag"],0,[MBilling.view.phoneBook,"Tag"],0));(Ext.cmd.derive("MBilling.view.call.Controller",Ext.ux.app.ViewController,{onRecordCall:function(m){var j=this,f=j.list.getSelectionModel().getSelection()[0],l=Ext.encode(j.list.filters.getFilterData()),g=[];if(!f&&l.length<5){Ext.ux.Alert.alert(j.titleError,t("Please select one or more register"),"notification")}else{Ext.each(j.list.getSelectionModel().getSelection(),function(a){g.push(a.get(j.idProperty))});if(App.user.isAdmin&&g.length>250){Ext.ux.Alert.alert(j.titleError,t("Your limit to download record is")+" 250","error")}else{if(!App.user.isAdmin&&g.length>25){Ext.ux.Alert.alert(j.titleError,t("Your limit to download record is")+" 25","error")}else{window.open("index.php/call/downloadRecord?ids="+Ext.encode(g)+"&filter="+l)}}}},onDownloadClick:function(d,f,e){window.open("index.php/call/downloadRecord?id="+d.getStore().getAt(f).getData().id)},onShowTotal:function(e){var g=this;var g=this,f=g.list.getStore(),j=g.list.filters.getFilterData().length?Ext.encode(g.list.filters.getFilterData()):f.proxy.extraParams.filter;e.disable();e.setText(t("Wait..."));e.setWidth(120);Ext.Ajax.request({url:"index.php/call/getTotal",params:{filter:j},scope:g,success:function(a){a=Ext.decode(a.responseText);Ext.ux.Alert.alert(g.titleSuccess," "+t("Total")+" "+t("buycost")+": "+App.user.currency+" "+a.sumbuycost+"
"+t("Total")+" "+t("sessionbill")+": "+App.user.currency+" "+a.sumsessionbill+"
"+t("Total")+" "+t("profit")+": "+App.user.currency+" "+a.totalCall+"
","information",true,false);e.enable();e.setText(t("Show Total"))},failure:function(a){e.enable();e.setText(""+t("Failed. Try again...")+"");e.setWidth(300)}})}},0,0,0,0,["controller.call"],0,[MBilling.view.call,"Controller"],0));(Ext.cmd.derive("MBilling.view.call.Module",Ext.ux.panel.Module,{controller:"call"},0,["callmodule"],["component","box","container","uxpanelmodule","callmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callmodule:true},["widget.callmodule"],0,[MBilling.view.call,"Module"],0));(Ext.cmd.derive("MBilling.view.call.List",Ext.ux.grid.Panel,{store:"Call",standardSubmit:true,initComponent:function(){var b=this;b.paginationButton=["-",{xtype:"button",width:"120",text:t("Show Total"),handler:"onShowTotal",hidden:!App.user.isAdmin,cls:"x-btn-text-icon details"},{xtype:"tbtext",reference:"tbTextTotal"}];b.fieldSearch=App.user.isAdmin?"idUser.username":"calledstation",b.extraButtons=[{text:t("Download Rec"),iconCls:"call",handler:"onRecordCall",disabled:false,width:130}];b.buttonUpdateLot=App.user.isAdmin;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{xtype:"actioncolumn",width:26,sortable:false,menuDisabled:true,header:t(""),dataIndex:"id",items:[{iconCls:"icon-play",tooltip:t("Download Rec"),handler:"onDownloadClick"}],hidden:App.user.show_playicon_cdr==0,hideable:true},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"starttime",flex:4},{header:t("Sip Account"),dataIndex:"src",flex:3},{header:t("CallerId"),dataIndex:"callerid",flex:3,hidden:true,hideable:true},{header:t("number"),dataIndex:"calledstation",flex:3},{header:t("destination"),dataIndex:"idPrefixdestination",filter:{type:"string",field:"idPrefix.destination"},flex:4},{header:t("sessiontime"),dataIndex:"sessiontime",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Real")+" "+t("sessiontime"),dataIndex:"real_sessiontime",renderer:Helper.Util.formatsecondsToTime,flex:3,hidden:true,hideable:App.user.isAdmin},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:2,hidden:App.user.isClient,hideable:!App.user.isClient},{xtype:"templatecolumn",tpl:"{idTrunktrunkcode}",header:t("trunk"),dataIndex:"id_trunk",comboFilter:"trunkcombo",header:t("trunk"),flex:3,hidden:App.user.isClient||App.user.isAgent,hideable:!App.user.isClient&&!App.user.isAgent},{header:t("status"),dataIndex:"terminatecauseid",renderer:Helper.Util.formatDialStatus,flex:2,filter:{type:"list",options:[[1,t("answer")]]}},{header:t("type"),dataIndex:"sipiax",renderer:Helper.Util.formatCallType,flex:2,filter:{type:"list",options:[[0,t("standard")],[1,t("sipcall")],[2,t("did")],[3,t("didvoip")],[4,t("callback")],[5,t("callcenter")],[6,"sms"],[7,t("transfer")],[8,t("queue")],[9,t("ivr")]]}},{header:t("buycost"),dataIndex:"buycost",renderer:Helper.Util.formatMoneyDecimal4,flex:3,hidden:App.user.isClient||App.user.isAgent,hideable:!App.user.isClient&&!App.user.isAgent},{header:t("sessionbill"),dataIndex:"sessionbill",renderer:Helper.Util.formatMoneyDecimal4,flex:3,hidden:App.user.isAgent||App.user.isClientAgent,hideable:!App.user.isAgent&&!App.user.isClientAgent},{header:t("buycost"),dataIndex:"sessionbill",renderer:Helper.Util.formatMoneyDecimal4,flex:3,hidden:!App.user.isAgent,hideable:App.user.isAgent},{header:t("sessionbill"),dataIndex:"agent_bill",renderer:Helper.Util.formatMoneyDecimal4,flex:3,hidden:!App.user.isAgent,hideable:App.user.isAgent},{header:t("sessionbill"),dataIndex:"agent_bill",renderer:Helper.Util.formatMoneyDecimal4,flex:3,hidden:!App.user.isClientAgent,hideable:App.user.isClientAgent},{header:t("uniqueid"),dataIndex:"uniqueid",flex:3,hidden:true,hideable:true},{xtype:"templatecolumn",tpl:"{idCampaignname}",header:t("campaign"),dataIndex:"id_campaign",comboFilter:"campaigncombo",flex:3,hidden:true,hideable:!App.user.isClient}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["calllist"],["component","box","container","panel","tablepanel","gridpanel","grid","calllist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,calllist:true},["widget.calllist"],0,[MBilling.view.call,"List"],0));(Ext.cmd.derive("MBilling.view.call.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["calledstation"],initComponent:function(){var b=this;b.items=[{name:"calledstation",fieldLabel:t("number"),readOnly:true},{name:"sessiontime",fieldLabel:t("sessiontime"),readOnly:App.user.isClient||App.user.isAgent,hidden:App.user.isClient||App.user.isAgent},{xtype:"moneyfield",name:"buycost",fieldLabel:t("buycost"),mask:App.user.currency+" #9.999.990,"+App.user.decimalPrecision,hidden:App.user.isClient||App.user.isAgent},{xtype:"moneyfield",name:"sessionbill",fieldLabel:t("sessionbill"),mask:App.user.currency+" #9.999.990,"+App.user.decimalPrecision,readOnly:App.user.isClient||App.user.isAgent,hidden:App.user.isAgent||App.user.isClientAgent},{xtype:"moneyfield",name:"agent_bill",fieldLabel:t("sessionbill"),mask:App.user.currency+" #9.999.990,"+App.user.decimalPrecision,readOnly:App.user.isAgent,hidden:!App.user.isAgent&&!App.user.isClientAgent}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callform"],["component","box","container","panel","form","callform"],{component:true,box:true,container:true,panel:true,form:true,callform:true},["widget.callform"],0,[MBilling.view.call,"Form"],0));(Ext.cmd.derive("MBilling.view.callArchive.Controller",Ext.ux.app.ViewController,{onRecordCall:function(m){var j=this,f=j.list.getSelectionModel().getSelection()[0],l=Ext.encode(j.list.filters.getFilterData()),g=[];if(!f&&l.length<5){Ext.ux.Alert.alert(j.titleError,t("Please select one or more register"),"notification")}else{Ext.each(j.list.getSelectionModel().getSelection(),function(a){g.push(a.get(j.idProperty))});if(App.user.isAdmin&&g.length>250){Ext.ux.Alert.alert(j.titleError,t("Your limit to download record is")+" 250","error")}else{if(!App.user.isAdmin&&g.length>25){Ext.ux.Alert.alert(j.titleError,t("Your limit to download record is")+" 25","error")}else{window.open("index.php/callArchive/downloadRecord?ids="+Ext.encode(g)+"&filter="+l)}}}},onDownloadClick:function(d,f,e){window.open("index.php/callArchive/downloadRecord?id="+d.getStore().getAt(f).getData().id)}},0,0,0,0,["controller.callarchive"],0,[MBilling.view.callArchive,"Controller"],0));(Ext.cmd.derive("MBilling.view.callArchive.Module",Ext.ux.panel.Module,{controller:"callarchive"},0,["callarchivemodule"],["component","box","container","uxpanelmodule","callarchivemodule"],{component:true,box:true,container:true,uxpanelmodule:true,callarchivemodule:true},["widget.callarchivemodule"],0,[MBilling.view.callArchive,"Module"],0));(Ext.cmd.derive("MBilling.view.callArchive.List",Ext.ux.grid.Panel,{store:"CallArchive",standardSubmit:true,initComponent:function(){var b=this;b.buttonUpdateLot=false;b.fieldSearch=App.user.isAdmin?"idUser.username":"calledstation",b.extraButtons=[{text:t("Download Rec"),iconCls:"call",handler:"onRecordCall",disabled:false,width:130}];b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{xtype:"actioncolumn",width:26,sortable:false,menuDisabled:true,header:t(""),dataIndex:"id",items:[{iconCls:"icon-play",tooltip:t("Download Rec"),handler:"onDownloadClick"}],hidden:App.user.show_playicon_cdr==0,hideable:true},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"starttime",flex:4},{header:t("Sip Account"),dataIndex:"src",flex:3},{header:t("CallerId"),dataIndex:"callerid",flex:3,hidden:true,hideable:true},{header:t("number"),dataIndex:"calledstation",flex:3},{header:t("destination"),dataIndex:"idPrefixdestination",filter:{type:"string",field:"idPrefix.destination"},flex:4},{header:t("sessiontime"),dataIndex:"sessiontime",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Real")+" "+t("sessiontime"),dataIndex:"real_sessiontime",renderer:Helper.Util.formatsecondsToTime,flex:3,hidden:true,hideable:App.user.isAdmin},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:2,hidden:App.user.isClient,hideable:!App.user.isClient},{xtype:"templatecolumn",tpl:"{idTrunktrunkcode}",header:t("trunk"),dataIndex:"id_trunk",comboFilter:"trunkcombo",header:t("trunk"),flex:3,hidden:App.user.isClient||App.user.isAgent,hideable:!App.user.isClient&&!App.user.isAgent},{header:t("status"),dataIndex:"terminatecauseid",renderer:Helper.Util.formatDialStatus,flex:2,filter:{type:"list",options:[[1,t("answer")]]}},{header:t("type"),dataIndex:"sipiax",renderer:Helper.Util.formatCallType,flex:2,filter:{type:"list",options:[[0,t("standard")],[1,t("sipcall")],[2,t("did")],[3,t("didvoip")],[4,t("callback")],[5,t("callcenter")],[6,"sms"],[7,t("transfer")],[8,t("queue")],[9,t("ivr")]]}},{header:t("buycost"),dataIndex:"buycost",renderer:Helper.Util.formatMoneyDecimal4,flex:3,hidden:App.user.isClient||App.user.isAgent,hideable:!App.user.isClient&&!App.user.isAgent},{header:t("sessionbill"),dataIndex:"sessionbill",renderer:Helper.Util.formatMoneyDecimal4,flex:3,hidden:App.user.isAgent||App.user.isClientAgent,hideable:!App.user.isAgent&&!App.user.isClientAgent},{header:t("buycost"),dataIndex:"sessionbill",renderer:Helper.Util.formatMoneyDecimal4,flex:3,hidden:!App.user.isAgent,hideable:App.user.isAgent},{header:t("sessionbill"),dataIndex:"agent_bill",renderer:Helper.Util.formatMoneyDecimal4,flex:3,hidden:!App.user.isAgent,hideable:App.user.isAgent},{header:t("sessionbill"),dataIndex:"agent_bill",renderer:Helper.Util.formatMoneyDecimal4,flex:3,hidden:!App.user.isClientAgent,hideable:App.user.isClientAgent},{header:t("uniqueid"),dataIndex:"uniqueid",flex:3,hidden:true,hideable:true}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callarchivelist"],["component","box","container","panel","tablepanel","gridpanel","grid","callarchivelist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callarchivelist:true},["widget.callarchivelist"],0,[MBilling.view.callArchive,"List"],0));(Ext.cmd.derive("MBilling.view.callArchive.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["calledstation"],initComponent:function(){var b=this;b.items=[{name:"calledstation",fieldLabel:t("number"),readOnly:true},{name:"sessiontime",fieldLabel:t("sessiontime"),readOnly:App.user.isClient||App.user.isAgent,hidden:App.user.isClient||App.user.isAgent},{xtype:"moneyfield",name:"buycost",fieldLabel:t("buycost"),mask:App.user.currency+" #9.999.990,"+App.user.decimalPrecision,hidden:App.user.isClient||App.user.isAgent},{xtype:"moneyfield",name:"sessionbill",fieldLabel:t("sessionbill"),mask:App.user.currency+" #9.999.990,"+App.user.decimalPrecision,readOnly:App.user.isClient||App.user.isAgent,hidden:App.user.isAgent||App.user.isClientAgent},{xtype:"moneyfield",name:"agent_bill",fieldLabel:t("sessionbill"),mask:App.user.currency+" #9.999.990,"+App.user.decimalPrecision,readOnly:App.user.isAgent,hidden:!App.user.isAgent&&!App.user.isClientAgent}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callarchiveform"],["component","box","container","panel","form","callarchiveform"],{component:true,box:true,container:true,panel:true,form:true,callarchiveform:true},["widget.callarchiveform"],0,[MBilling.view.callArchive,"Form"],0));(Ext.cmd.derive("MBilling.view.callFailed.Controller",Ext.ux.app.ViewController,{formHidden:true},0,0,0,0,["controller.callfailed"],0,[MBilling.view.callFailed,"Controller"],0));(Ext.cmd.derive("MBilling.view.callFailed.Module",Ext.ux.panel.Module,{controller:"callfailed"},0,["callfailedmodule"],["component","box","container","uxpanelmodule","callfailedmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callfailedmodule:true},["widget.callfailedmodule"],0,[MBilling.view.callFailed,"Module"],0));(Ext.cmd.derive("MBilling.view.callFailed.List",Ext.ux.grid.Panel,{store:"CallFailed",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.allowCreate=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"starttime",flex:4},{header:t("Sip Account"),dataIndex:"src",flex:3},{header:t("CallerId"),dataIndex:"callerid",flex:3,hidden:true,hideable:true},{header:t("number"),dataIndex:"calledstation",flex:3},{header:t("destination"),dataIndex:"idPrefixdestination",flex:4},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:2,hidden:App.user.isClient,hideable:!App.user.isClient},{xtype:"templatecolumn",tpl:"{idTrunktrunkcode}",header:t("trunk"),dataIndex:"id_trunk",comboFilter:"trunkcombo",header:t("trunk"),flex:4,hidden:App.user.isClient||App.user.isAgent,hideable:!App.user.isClient&&!App.user.isAgent},{header:t("status"),dataIndex:"terminatecauseid",renderer:Helper.Util.formatDialStatus,flex:2,filter:{type:"list",options:[[1,t("answer")],[2,t("busy")],[3,t("no")+" "+t("answer")],[4,t("cancelcall")],[5,"congestion"],[6,"chanunavail"],[7,"dontcall"],[8,"torture"],[9,"invalidargs"]]}},{header:t("HangupCause"),dataIndex:"hangupcause",hidden:!window.dialC,flex:2},{header:t("type"),dataIndex:"sipiax",renderer:Helper.Util.formatCallType,flex:2,filter:{type:"list",options:[[0,t("standard")],[1,t("sipcall")],[2,t("did")],[3,t("didvoip")],[4,t("callback")],[5,t("callcenter")],[6,"sms"],[7,t("transfer")]]}},{header:t("uniqueid"),dataIndex:"uniqueid",flex:3,hidden:true,hideable:true}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callfailedlist"],["component","box","container","panel","tablepanel","gridpanel","grid","callfailedlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callfailedlist:true},["widget.callfailedlist"],0,[MBilling.view.callFailed,"List"],0));(Ext.cmd.derive("MBilling.view.callFailed.Form",Ext.ux.form.Panel,{},0,["callfailedform"],["component","box","container","panel","form","callfailedform"],{component:true,box:true,container:true,panel:true,form:true,callfailedform:true},["widget.callfailedform"],0,[MBilling.view.callFailed,"Form"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerDay.Controller",Ext.ux.app.ViewController,{onEdit:function(){me=this;me.sumData=me.store.getData().items[0].getData();if(!me.sumData){return}me.formPanel.getForm().getFields().each(function(b){b.setValue(me.sumData[b.name])});me.formPanel.expand()}},0,0,0,0,["controller.callsummaryperday"],0,[MBilling.view.callSummaryPerDay,"Controller"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerDay.Module",Ext.ux.panel.Module,{controller:"callsummaryperday",titleDetails:t("total"),iconForm:"icon-sum",cfgEast:{flex:0.4}},0,["callsummaryperdaymodule"],["component","box","container","uxpanelmodule","callsummaryperdaymodule"],{component:true,box:true,container:true,uxpanelmodule:true,callsummaryperdaymodule:true},["widget.callsummaryperdaymodule"],0,[MBilling.view.callSummaryPerDay,"Module"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerDay.List",Ext.ux.grid.Panel,{store:"CallSummaryPerDay",initComponent:function(){var b=this;b.buttonImportCsv=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{header:t("day"),renderer:Ext.util.Format.dateRenderer("Y-m-d"),dataIndex:"day",filter:{type:"date",field:"day"},flex:3},{header:t("sessiontime")+" "+t("Min"),dataIndex:"sessiontime",flex:2},{header:t("aloc_all_calls"),dataIndex:"aloc_all_calls",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Answered Calls"),dataIndex:"nbcall",flex:3},{header:t("Failed Calls"),dataIndex:"nbcall_fail",flex:3},{header:t("buycost"),dataIndex:"buycost",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("sessionbill"),dataIndex:"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("markup"),dataIndex:"lucro",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("ASR"),dataIndex:"asr",renderer:Helper.Util.formatPorcente,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummaryperdaylist"],["component","box","container","panel","tablepanel","gridpanel","grid","callsummaryperdaylist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callsummaryperdaylist:true},["widget.callsummaryperdaylist"],0,[MBilling.view.callSummaryPerDay,"List"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerDay.Form",Ext.ux.form.Panel,{defaults:{},labelWidthFields:100,defaultType:"displayfield",initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{name:"sumsessiontime",fieldLabel:t("sessiontime")+" "+t("Min"),renderer:Ext.util.Format.numberRenderer("0"),allowBlank:true},{name:"sumsessionbill",fieldLabel:t("sessionbill"),renderer:Helper.Util.formatMoneyDecimal,allowBlank:true},{name:"sumbuycost",fieldLabel:t("buycost"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumlucro",fieldLabel:t("markup"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumnbcall",fieldLabel:t("Answered Calls"),allowBlank:true},{name:"sumnbcallfail",fieldLabel:t("Failed Calls"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummaryperdayform"],["component","box","container","panel","form","callsummaryperdayform"],{component:true,box:true,container:true,panel:true,form:true,callsummaryperdayform:true},["widget.callsummaryperdayform"],0,[MBilling.view.callSummaryPerDay,"Form"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerMonth.Controller",Ext.ux.app.ViewController,{onEdit:function(){me=this;me.sumData=me.store.getData().items[0].getData();if(!me.sumData){return}me.formPanel.getForm().getFields().each(function(b){b.setValue(me.sumData[b.name])});me.formPanel.expand()}},0,0,0,0,["controller.callsummarypermonth"],0,[MBilling.view.callSummaryPerMonth,"Controller"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerMonth.Module",Ext.ux.panel.Module,{controller:"callsummarypermonth",titleDetails:t("total"),iconForm:"icon-sum",cfgEast:{flex:0.4}},0,["callsummarypermonthmodule"],["component","box","container","uxpanelmodule","callsummarypermonthmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callsummarypermonthmodule:true},["widget.callsummarypermonthmodule"],0,[MBilling.view.callSummaryPerMonth,"Module"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerMonth.List",Ext.ux.grid.Panel,{store:"CallSummaryPerMonth",initComponent:function(){var b=this;b.buttonImportCsv=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{header:t("month"),dataIndex:"month",filter:{type:"date",field:"month",dateFormat:"Ym"},flex:3},{header:t("sessiontime")+" "+t("Min"),dataIndex:"sessiontime",flex:2},{header:t("aloc_all_calls"),dataIndex:"aloc_all_calls",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("nbcall"),dataIndex:"nbcall",flex:3},{header:t("buycost"),dataIndex:"buycost",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("sessionbill"),dataIndex:"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("markup"),dataIndex:"lucro",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarypermonthlist"],["component","box","container","panel","tablepanel","gridpanel","grid","callsummarypermonthlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callsummarypermonthlist:true},["widget.callsummarypermonthlist"],0,[MBilling.view.callSummaryPerMonth,"List"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerMonth.Form",Ext.ux.form.Panel,{defaults:{},labelWidthFields:100,defaultType:"displayfield",initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{name:"sumsessiontime",fieldLabel:t("sessiontime")+" "+t("Min"),renderer:Ext.util.Format.numberRenderer("0"),allowBlank:true},{name:"sumsessionbill",fieldLabel:t("sessionbill"),renderer:Helper.Util.formatMoneyDecimal,allowBlank:true},{name:"sumbuycost",fieldLabel:t("buycost"),renderer:Helper.Util.formatMoneyDecimal,hidden:App.user.isClient,allowBlank:true},{name:"sumlucro",fieldLabel:t("markup"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumnbcall",fieldLabel:t("nbcall"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarypermonthform"],["component","box","container","panel","form","callsummarypermonthform"],{component:true,box:true,container:true,panel:true,form:true,callsummarypermonthform:true},["widget.callsummarypermonthform"],0,[MBilling.view.callSummaryPerMonth,"Form"],0));(Ext.cmd.derive("MBilling.view.callSummaryMonthUser.Controller",Ext.ux.app.ViewController,{onEdit:function(){me=this;me.sumData=me.store.getData().items[0].getData();if(!me.sumData){return}me.formPanel.getForm().getFields().each(function(b){b.setValue(me.sumData[b.name])});me.formPanel.expand()}},0,0,0,0,["controller.callsummarymonthuser"],0,[MBilling.view.callSummaryMonthUser,"Controller"],0));(Ext.cmd.derive("MBilling.view.callSummaryMonthUser.Module",Ext.ux.panel.Module,{controller:"callsummarymonthuser",titleDetails:t("total"),iconForm:"icon-sum",cfgEast:{flex:0.4}},0,["callsummarymonthusermodule"],["component","box","container","uxpanelmodule","callsummarymonthusermodule"],{component:true,box:true,container:true,uxpanelmodule:true,callsummarymonthusermodule:true},["widget.callsummarymonthusermodule"],0,[MBilling.view.callSummaryMonthUser,"Module"],0));(Ext.cmd.derive("MBilling.view.callSummaryMonthUser.List",Ext.ux.grid.Panel,{store:"CallSummaryMonthUser",initComponent:function(){var b=this;b.buttonImportCsv=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{header:t("Month"),renderer:Ext.util.Format.dateRenderer("Y-m"),dataIndex:"month",filter:{type:"date",field:"month",dateFormat:"Ym"},flex:3},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("sessiontime")+" "+t("Min"),dataIndex:"sessiontime",flex:2},{header:t("aloc_all_calls"),dataIndex:"aloc_all_calls",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Answered Calls"),dataIndex:"nbcall",flex:3},{header:t("buycost"),dataIndex:App.user.isAdmin?"buycost":"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("sessionbill"),dataIndex:App.user.isAgent||App.user.isClientAgent?"agent_bill":"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("markup"),dataIndex:"lucro",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarymonthuserlist"],["component","box","container","panel","tablepanel","gridpanel","grid","callsummarymonthuserlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callsummarymonthuserlist:true},["widget.callsummarymonthuserlist"],0,[MBilling.view.callSummaryMonthUser,"List"],0));(Ext.cmd.derive("MBilling.view.callSummaryMonthUser.Form",Ext.ux.form.Panel,{defaults:{},labelWidthFields:100,defaultType:"displayfield",initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{name:"sumsessiontime",fieldLabel:t("sessiontime")+" "+t("Min"),renderer:Ext.util.Format.numberRenderer("0"),allowBlank:true},{name:App.user.isAgent||App.user.isClientAgent?"sumagent_bill":"sumsessionbill",fieldLabel:t("sessionbill"),renderer:Helper.Util.formatMoneyDecimal,allowBlank:true},{name:App.user.isAdmin?"sumbuycost":"sumsessionbill",fieldLabel:t("buycost"),renderer:Helper.Util.formatMoneyDecimal,hidden:App.user.isClient,allowBlank:true},{name:"sumlucro",fieldLabel:t("markup"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmint,allowBlank:true},{name:"sumnbcall",fieldLabel:t("nbcall"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarymonthuserform"],["component","box","container","panel","form","callsummarymonthuserform"],{component:true,box:true,container:true,panel:true,form:true,callsummarymonthuserform:true},["widget.callsummarymonthuserform"],0,[MBilling.view.callSummaryMonthUser,"Form"],0));(Ext.cmd.derive("MBilling.view.callSummaryMonthTrunk.Controller",Ext.ux.app.ViewController,{onEdit:function(){me=this;me.sumData=me.store.getData().items[0].getData();if(!me.sumData){return}me.formPanel.getForm().getFields().each(function(b){b.setValue(me.sumData[b.name])});me.formPanel.expand()}},0,0,0,0,["controller.callsummarymonthtrunk"],0,[MBilling.view.callSummaryMonthTrunk,"Controller"],0));(Ext.cmd.derive("MBilling.view.callSummaryMonthTrunk.Module",Ext.ux.panel.Module,{controller:"callsummarymonthtrunk",titleDetails:t("total"),iconForm:"icon-sum",cfgEast:{flex:0.4}},0,["callsummarymonthtrunkmodule"],["component","box","container","uxpanelmodule","callsummarymonthtrunkmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callsummarymonthtrunkmodule:true},["widget.callsummarymonthtrunkmodule"],0,[MBilling.view.callSummaryMonthTrunk,"Module"],0));(Ext.cmd.derive("MBilling.view.callSummaryMonthTrunk.List",Ext.ux.grid.Panel,{store:"CallSummaryMonthTrunk",initComponent:function(){var b=this;b.buttonImportCsv=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{header:t("Month"),renderer:Ext.util.Format.dateRenderer("Y-m"),dataIndex:"month",filter:{type:"date",field:"month",dateFormat:"Ym"},flex:3},{header:t("Trunk"),dataIndex:"idTrunktrunkcode",filter:{type:"string",field:"idTrunk.trunkcode"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("sessiontime")+" "+t("Min"),dataIndex:"sessiontime",flex:2},{header:t("aloc_all_calls"),dataIndex:"aloc_all_calls",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Answered Calls"),dataIndex:"nbcall",flex:3},{header:t("buycost"),dataIndex:"buycost",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("sessionbill"),dataIndex:"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("markup"),dataIndex:"lucro",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarymonthtrunklist"],["component","box","container","panel","tablepanel","gridpanel","grid","callsummarymonthtrunklist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callsummarymonthtrunklist:true},["widget.callsummarymonthtrunklist"],0,[MBilling.view.callSummaryMonthTrunk,"List"],0));(Ext.cmd.derive("MBilling.view.callSummaryMonthTrunk.Form",Ext.ux.form.Panel,{defaults:{},labelWidthFields:100,defaultType:"displayfield",initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{name:"sumsessiontime",fieldLabel:t("sessiontime")+" "+t("Min"),renderer:Ext.util.Format.numberRenderer("0"),allowBlank:true},{name:"sumsessionbill",fieldLabel:t("sessionbill"),renderer:Helper.Util.formatMoneyDecimal,allowBlank:true},{name:"sumbuycost",fieldLabel:t("buycost"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumlucro",fieldLabel:t("markup"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumnbcall",fieldLabel:t("nbcall"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarymonthtrunkform"],["component","box","container","panel","form","callsummarymonthtrunkform"],{component:true,box:true,container:true,panel:true,form:true,callsummarymonthtrunkform:true},["widget.callsummarymonthtrunkform"],0,[MBilling.view.callSummaryMonthTrunk,"Form"],0));(Ext.cmd.derive("MBilling.view.sms.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.sms"],0,[MBilling.view.sms,"Controller"],0));(Ext.cmd.derive("MBilling.view.sms.Module",Ext.ux.panel.Module,{controller:"sms"},0,["smsmodule"],["component","box","container","uxpanelmodule","smsmodule"],{component:true,box:true,container:true,uxpanelmodule:true,smsmodule:true},["widget.smsmodule"],0,[MBilling.view.sms,"Module"],0));(Ext.cmd.derive("MBilling.view.sms.List",Ext.ux.grid.Panel,{store:"Sms",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.allowUpdate=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("send"),dataIndex:"result",renderer:Helper.Util.formatBooleanSms,comboRelated:"statuscombo",flex:2,filter:{type:"list",options:[[0,t("error")],[1,t("sent")],[2,t("received")]]}},{header:t("destination"),dataIndex:"telephone",flex:2},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"date",flex:5},{header:t("description"),dataIndex:"sms",hidden:true,hideable:true,flex:6}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["smslist"],["component","box","container","panel","tablepanel","gridpanel","grid","smslist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,smslist:true},["widget.smslist"],0,[MBilling.view.sms,"List"],0));(Ext.cmd.derive("MBilling.view.sms.Form",Ext.ux.form.Panel,{fieldsHide:["id_user"],initComponent:function(){var b=this;b.items=[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:App.user.isClient},{xtype:"numberfield",name:"telephone",fieldLabel:t("number"),emptyText:"DDI DDD Nº",maxLength:16,minLength:11},{xtype:"textareafield",name:"sms",fieldLabel:t("sms"),maxLength:160}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["smsform"],["component","box","container","panel","form","smsform"],{component:true,box:true,container:true,panel:true,form:true,smsform:true},["widget.smsform"],0,[MBilling.view.sms,"Form"],0));(Ext.cmd.derive("MBilling.view.campaignPollInfo.Controller",Ext.ux.app.ViewController,{aliasChart:"campaignpollinfochart",onRenderModule:function(){var c=this,d=c.lookupReference("chart");Ext.ux.app.ViewController.prototype.onRenderModule.apply(this,arguments);c.store.on({scope:c,beforeload:function(){d.disable()},load:function(a){d.enable()}})},onChart:function(){var l=this,f=l.list.getStore(),m=l.list.filters.getFilterData(),j=false,g=false;if(!m){Ext.ux.Alert.alert("Alert",t("Use filters"),"information");return}Ext.each(m,function(a){if(a.field=="id_campaign_poll"){if(a.data.value.length==1){g=true}j=true;return}});if(!j){Ext.ux.Alert.alert("Alert",t("Select one or more poll to create a chart"),"information");return}l.chart=Ext.widget("window",{title:t("charts"),iconCls:"icon-chart-column",layout:"fit",autoShow:true,modal:true,resizable:false,width:window.isThemeNeptune?740:710,items:{xtype:l.aliasChart,titleText:g?f.getData().items[0].data.idCampaignPollname:"",list:l.list}})}},0,0,0,0,["controller.campaignpollinfo"],0,[MBilling.view.campaignPollInfo,"Controller"],0));(Ext.cmd.derive("MBilling.view.campaignPollInfo.Module",Ext.ux.panel.Module,{controller:"campaignpollinfo"},0,["campaignpollinfomodule"],["component","box","container","uxpanelmodule","campaignpollinfomodule"],{component:true,box:true,container:true,uxpanelmodule:true,campaignpollinfomodule:true},["widget.campaignpollinfomodule"],0,[MBilling.view.campaignPollInfo,"Module"],0));(Ext.cmd.derive("MBilling.view.campaignPollInfo.List",Ext.ux.grid.Panel,{store:"CampaignPollInfo",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.allowCreate=false;b.extraButtons=[{text:t("charts"),iconCls:"icon-chart-column",handler:"onChart",reference:"chart",disabled:true}];b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("number"),dataIndex:"number",flex:4},{xtype:"templatecolumn",tpl:"{idCampaignPollname}",header:t("poll"),dataIndex:"id_campaign_poll",comboFilter:"campaignpollcombo",flex:4},{header:t("result"),dataIndex:"resposta",flex:4},{header:t("description"),dataIndex:"obs",flex:4},{header:t("City"),dataIndex:"city",flex:4},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"date",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignpollinfolist"],["component","box","container","panel","tablepanel","gridpanel","grid","campaignpollinfolist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,campaignpollinfolist:true},["widget.campaignpollinfolist"],0,[MBilling.view.campaignPollInfo,"List"],0));(Ext.cmd.derive("MBilling.view.campaignPollInfo.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{name:"number",fieldLabel:t("number"),readOnly:true},{name:"resposta",fieldLabel:t("result"),readOnly:true},{xtype:"textareafield",name:"obs",fieldLabel:t("description"),allowBlank:true,maxLength:200}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignpollinfoform"],["component","box","container","panel","form","campaignpollinfoform"],{component:true,box:true,container:true,panel:true,form:true,campaignpollinfoform:true},["widget.campaignpollinfoform"],0,[MBilling.view.campaignPollInfo,"Form"],0));(Ext.cmd.derive("MBilling.view.campaignPollInfo.Chart",Ext.ux.panel.Chart,{controller:"campaignpollinfo",store:"CampaignPollInfoChart",fieldValue:"sumresposta",fieldDescription:"resposta2",labelYLine:t("countvotes"),labelXLine:t("result"),fieldLabel:"percentage",initComponent:function(){var d=this,c;if(window.newChartCampaignInfo){d.fieldDescription="resposta_name"}d.bbarChart=[{xtype:"tbtext",itemId:"tbTextSum",reference:"tbTextSum"}];d.store=Ext.data.StoreManager.lookup(d.store);d.store.setRemoteFilter(true);filters=d.list.filters.getFilterData();d.store.filter("filter",Ext.encode(filters));d.store.load({scope:d,callback:function(){if(d.store.getData().items[0]){d.sumData=d.store.getData().items[0].getData()}if(window.newChartCampaignInfo){d.lookupReference("tbTextSum").setText(d.sumData.total_votos)}}});Ext.ux.panel.Chart.prototype.initComponent.apply(this,arguments)}},0,["campaignpollinfochart"],["component","box","container","panel","chartpanel","campaignpollinfochart"],{component:true,box:true,container:true,panel:true,chartpanel:true,campaignpollinfochart:true},["widget.campaignpollinfochart"],0,[MBilling.view.campaignPollInfo,"Chart"],0));(Ext.cmd.derive("MBilling.view.campaignRestrictPhone.Controller",Ext.ux.app.ViewController,{onEdit:function(){var b=this;Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)},deleteDuplicados:function(e){var g=this,f=g.list.getStore(),j=g.list.filters.getFilterData().length?Ext.encode(g.getList().filters.getFilterData()):f.proxy.extraParams.filter;e.disable();g.list.setLoading(true);Ext.Msg.confirm("Confirm","Confirme que quer deletar os numeros duplicados?",function(a){if(a==="yes"){Ext.Ajax.request({url:"index.php/campaignRestrictPhone/deleteDuplicados/",params:{filter:j},scope:g,success:function(c){c=Ext.decode(c.responseText);if(c[g.nameSuccessRequest]){Ext.ux.Alert.alert(g.titleSuccess,c[g.nameMsgRequest],"success")}else{var b=Helper.Util.convertErrorsJsonToString(c[g.nameMsgRequest]);Ext.ux.Alert.alert(g.titleError,b,"error")}g.list.setLoading(false);e.enable()}})}})}},0,0,0,0,["controller.campaignrestrictphone"],0,[MBilling.view.campaignRestrictPhone,"Controller"],0));(Ext.cmd.derive("MBilling.view.campaignRestrictPhone.Module",Ext.ux.panel.Module,{controller:"campaignrestrictphone"},0,["campaignrestrictphonemodule"],["component","box","container","uxpanelmodule","campaignrestrictphonemodule"],{component:true,box:true,container:true,uxpanelmodule:true,campaignrestrictphonemodule:true},["widget.campaignrestrictphonemodule"],0,[MBilling.view.campaignRestrictPhone,"Module"],0));(Ext.cmd.derive("MBilling.view.campaignRestrictPhone.List",Ext.ux.grid.Panel,{store:"CampaignRestrictPhone",buttonImportCsv:true,initComponent:function(){var b=this;b.extraButtons=[{text:t("Eliminar Duplicados"),iconCls:"callshop",handler:"deleteDuplicados",disabled:false}];b.buttonUpdateLot=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("number"),dataIndex:"number",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignrestrictphonelist"],["component","box","container","panel","tablepanel","gridpanel","grid","campaignrestrictphonelist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,campaignrestrictphonelist:true},["widget.campaignrestrictphonelist"],0,[MBilling.view.campaignRestrictPhone,"List"],0));(Ext.cmd.derive("MBilling.view.campaignRestrictPhone.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{name:"number",fieldLabel:t("number")}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignrestrictphoneform"],["component","box","container","panel","form","campaignrestrictphoneform"],{component:true,box:true,container:true,panel:true,form:true,campaignrestrictphoneform:true},["widget.campaignrestrictphoneform"],0,[MBilling.view.campaignRestrictPhone,"Form"],0));(Ext.cmd.derive("MBilling.view.campaignRestrictPhone.ImportCsv",Ext.ux.window.ImportCsv,{htmlTipInfo:"
number
551135672677
551156332233
554153882200
"},0,["campaignrestrictphoneimportcsv"],["component","box","container","panel","window","campaignrestrictphoneimportcsv"],{component:true,box:true,container:true,panel:true,window:true,campaignrestrictphoneimportcsv:true},["widget.campaignrestrictphoneimportcsv"],0,[MBilling.view.campaignRestrictPhone,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.campaignLog.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.campaignlog"],0,[MBilling.view.campaignLog,"Controller"],0));(Ext.cmd.derive("MBilling.view.campaignLog.Module",Ext.ux.panel.Module,{controller:"campaignlog"},0,["campaignlogmodule"],["component","box","container","uxpanelmodule","campaignlogmodule"],{component:true,box:true,container:true,uxpanelmodule:true,campaignlogmodule:true},["widget.campaignlogmodule"],0,[MBilling.view.campaignLog,"Module"],0));(Ext.cmd.derive("MBilling.view.campaignLog.List",Ext.ux.grid.Panel,{store:"CampaignLog",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.buttonNew=false;b.allowUpdate=false;b.allowDelete=!App.user.isClient;b.columns=[{header:t("Total gerado"),dataIndex:"total",flex:4},{header:t("Loops"),dataIndex:"loops",flex:4},{header:t("Total por tronco"),dataIndex:"trunks",flex:4},{header:t("Campanhas"),dataIndex:"campaigns",flex:4},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"date",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignloglist"],["component","box","container","panel","tablepanel","gridpanel","grid","campaignloglist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,campaignloglist:true},["widget.campaignloglist"],0,[MBilling.view.campaignLog,"List"],0));(Ext.cmd.derive("MBilling.view.campaignLog.Form",Ext.ux.form.Panel,{bodyPadding:0,initComponent:function(){var b=this;b.items=[{name:"total",fieldLabel:t("total")}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignlogform"],["component","box","container","panel","form","campaignlogform"],{component:true,box:true,container:true,panel:true,form:true,campaignlogform:true},["widget.campaignlogform"],0,[MBilling.view.campaignLog,"Form"],0));(Ext.cmd.derive("MBilling.view.campaignSend.Module",Ext.form.Panel,{controller:"campaignsend",resizable:false,autoShow:true,header:false,initComponent:function(){var b=this;b.items=[{reference:"campaignSendPanel",xtype:"form",margin:"10 10 10 10",autoShow:true,closable:false,resizable:false,bodyPadding:10,defaultType:"textfield",defaults:{labelAlign:"right",labelWidth:150,width:280,allowBlank:false,msgTarget:"side",enableKeyEvents:true,plugins:"markallowblank",anchor:"100%"},items:[{xtype:"campaignsendcombo",name:"type",fieldLabel:t("campaign")+" "+t("type")},{name:"sms_text",fieldLabel:"SMS "+t("Text"),xtype:"textarea",height:100,anchor:"100%",allowBlank:true,hidden:true,maxLength:159},{xtype:"filefield",emptyText:"Select an audio file",fieldLabel:t("Audio file"),name:"audio_path",buttonText:"",buttonConfig:{iconCls:"upload-icon"},buttonText:t("Select Audio..."),allowBlank:true,hidden:true},{xtype:"filefield",emptyText:"Select an csv file",fieldLabel:t("CSV file"),name:"csv_path",allowBlank:true,hidden:true},{name:"numbers",fieldLabel:t("numbers"),xtype:"textarea",height:100,anchor:"100%",allowBlank:true,hidden:true},{xtype:"datefield",name:"startingdate",fieldLabel:t("Date"),format:"Y-m-d",value:new Date(),allowBlank:true,hidden:true},{xtype:"timefield",name:"startingtime",fieldLabel:t("Hour"),format:"H:i",value:"00:00",allowBlank:true,hidden:true}],bbar:[{width:"150px",text:t("Send"),tooltip:t("Send"),glyph:icons.disk,handler:"onSendCampaign"}]}];Ext.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["campaignsendmodule"],["component","box","container","panel","form","campaignsendmodule"],{component:true,box:true,container:true,panel:true,form:true,campaignsendmodule:true},["widget.campaignsendmodule"],0,[MBilling.view.campaignSend,"Module"],0));(Ext.cmd.derive("MBilling.view.callShop.Controller",Ext.ux.app.ViewController,{sendActionNew:function(d){var c=this;d.disable();id=d.reference.split("_");getForm=c.lookupReference("cabina"+id[1]).getForm();Ext.Ajax.request({url:d.urlAction+"?id="+getForm.findField("id").getValue(),success:function(a){a=Ext.decode(a.responseText);if(a.success){Ext.ux.Alert.alert(c.titleSuccess,a[c.nameMsgRequest],"success")}else{Ext.ux.Alert.alert(c.titleError,errors,"error")}}});d.enable();storeCallShop=Ext.create("MBilling.store.CallShop",{remoteSort:false});storeCallShop.load({callback:function(a){c.onShowCabins(a,id[1],getForm)}})},onShowCabins:function(e,f,d){me=this;row=e[f-1];if(tab=me.lookupReference("tab"+f)){name=row.data.callerid.length<1?row.data.name:row.data.callerid;status=Helper.Util.formatBooleanFree(row.data.status);tab.setTitle(t("Cabina")+" "+f+" - "+name+" "+status);tab.setVisible(true);d.loadRecord(row)}},reportCallshopClientNew:function(d){var c=this;id=d.reference.split("_");getForm=c.lookupReference("cabina"+id[1]).getForm();columns=Ext.encode([{header:t("Number"),dataIndex:"calledstation"},{header:t("Time"),dataIndex:"sessiontime"},{header:t("Total"),dataIndex:"price"}]);filter=Ext.encode([{type:"string",comparison:"eq",value:getForm.findField("name").getValue(),field:"cabina"},{type:"list",value:[0],field:"status"}]);values="columns="+columns+"&filter="+filter+"&sort=[]&group=&orientation=P";url="index.php/callShopCdr/report/?"+values;window.open(url)},sendAction:function(f){var j=this,e=j.list.getSelectionModel().getSelection()[0],g=Ext.encode([{type:"string",comparison:"eq",value:e.get("name"),field:"cabina"},{type:"list",value:[0],field:"status"}]);j.formPanel.setLoading(true);Ext.Ajax.request({url:f.urlAction,params:{filter:g},success:function(b){b=Ext.decode(b.responseText);var a=Helper.Util.convertErrorsJsonToString(b[j.nameMsgRequest]),d=j.list.getStore(),c=j.list.getSelectionModel();if(b.success){j.onEdit();d.load({callback:function(){c.select(d.findExact("id",e.get("id")));j.formPanel.setLoading(false)}});Ext.ux.Alert.alert(j.titleSuccess,b[j.nameMsgRequest],"success")}else{Ext.ux.Alert.alert(j.titleError,a,"error");j.formPanel.setLoading(false);c.select(d.findExact("id",e.get("id")))}}})},onEdit:function(){if(!this.list.getSelectionModel().getSelection().length){return}var q=this,r=q.list.getSelectionModel().getSelection()[0],n=[{type:"string",comparison:"eq",value:r.get("name"),field:"cabina"},{type:"list",value:[0],field:"status"}],u=q.formPanel.down("callshopcdrlist").getStore(),v=q.formPanel.down("#priceSum"),m=u.proxy.extraParams.filter,p=q.formPanel.down("#charge"),s=q.formPanel.down("#release"),o=q.formPanel.down("#print");v.setText(" "+t("pricesum")+" 0.00");q.formPanel.expand();p.enable();s.enable();o.enable();u.proxy.extraParams.filter=n;u.load({callback:function(a){if(a){a[0]&&v.setText(" "+t("pricesum")+" "+t("moedasimblo")+" "+a[0].get("priceSum")+" ")}}});console.log(r.get("callerid")+", "+r.get("name"));u.defaultFilter=m;q.showHideFields();q.focusFirstField()},reportCallshopClient:function(E){var w=this,s=window.isDesktop&&App.desktop,y=!window.isDesktop&&w.list.module.ownerCt,v=w.formPanel.down("callshopcdrlist").getStore(),x=v.sorters.items,A=w.list.getSelectionModel().getSelection()[0],F=Ext.encode([{type:"string",comparison:"eq",value:A.get("name"),field:"cabina"},{type:"list",value:[0],field:"status"}]),u=w.store.getGroupField(),B=w.formPanel.down("callshopcdrlist").columns,G="desc",D=w.formPanel.down("callshopcdrlist").getStore().getProxy().api.report,H,z=[],C=[];Ext.each(x,function(a){z.push(a.property+" "+(a.direction||"ASC"))});Ext.each(B,function(a){if(a.hidden===false&&a.isCheckerHd!==true){if(a.dataIndex===u){C.splice(0,0,{header:a.text,dataIndex:a.dataIndex})}else{C.push({header:a.text,dataIndex:a.dataIndex})}}});values="columns="+Ext.encode(C)+"&filter="+F+"&sort="+Ext.encode(z)+"&group="+u+"&orientation="+G;url="index.php/callShopCdr/report/?"+values;window.open(url)}},0,0,0,0,["controller.callshop"],0,[MBilling.view.callShop,"Controller"],0));(Ext.cmd.derive("MBilling.view.callShop.Module",Ext.ux.panel.Module,{controller:"callshop",cfgEast:{flex:4},collapsedForm:false,collapsibleForm:false},0,["callshopmodule"],["component","box","container","uxpanelmodule","callshopmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callshopmodule:true},["widget.callshopmodule"],0,[MBilling.view.callShop,"Module"],0));(Ext.cmd.derive("MBilling.view.callShop.Module2",Ext.form.Panel,{controller:"callshop",resizable:false,autoShow:true,header:false,autoScroll:true,initComponent:function(){var b=this;b.layout={type:"table",columns:3,tdAttrs:{style:"padding: 3px; vertical-align: top;"}};b.defaults={xtype:"panel",height:268,width:((Ext.Element.getViewportWidth()-200)/3)-10,closable:false,collapsible:true,frame:true};b.items=b.onMountPanels();storeCallShop=Ext.create("MBilling.store.CallShop",{remoteSort:false});if(!App.user.isClient){Ext.form.Panel.prototype.initComponent.apply(this,arguments);return}else{b.handler=setInterval(function(){storeCallShop.load({callback:function(a){b.onShowCabins(a)}})},5000);Ext.form.Panel.prototype.initComponent.apply(this,arguments);storeCallShop.load({callback:function(a){b.onShowCabins(a)}})}},onMountPanels:function(){me=this,items=[];if(!App.user.isClient){return}for(i=1;i<=12;i++){items.push({xtype:"tabpanel",reference:"tab"+i,title:t("Cabina")+i,collapsed:i>3,items:[{reference:"cabina"+i,title:t("Cabina"),xtype:"form",bodyPadding:10,defaults:{xtype:"displayfield",labelWidth:85},items:[{name:"id",hidden:true},{name:"name",hidden:true},{xtype:"fieldcontainer",layout:"hbox",items:[{xtype:"displayfield",fieldLabel:t("Number"),name:"callshopnumber",labelAlign:"right",labelWidth:50,renderer:function(b){return''+b+""},flex:2},{labelAlign:"right",labelWidth:90,xtype:"displayfield",readOnly:true,fieldLabel:t("total"),name:"total",labelStyle:"font-size:18px!important;font-weight:bold;",renderer:function(b){format=Ext.util.Format.numberRenderer("0."+App.user.decimalPrecision);return''+App.user.currency+" "+format(b)+""},flex:3}]},{fieldLabel:t("Destination"),name:"destination"},{fieldLabel:t("Price minute"),name:"price_min",renderer:Helper.Util.formatMoneyDecimal},{fieldLabel:t("Duration"),name:"callshoptime",renderer:Helper.Util.formatsecondsToTime},{border:false,xtype:"toolbar",hidden:me.hideBbar,dock:"bottom",items:[{bodyPadding:10,width:"33%",text:t("Charge"),itemId:"charge",iconCls:"buycredit",handler:"sendActionNew",reference:"cobrar_"+i,urlAction:"index.php/callShop/cobrar"},{width:"33%",text:t("Release"),itemId:"release",iconCls:"release",handler:"sendActionNew",reference:"liberar_"+i,urlAction:"index.php/callShop/liberar",hidden:window.releaseButton},{width:"33%",text:t("Print"),itemId:"print",iconCls:"icon-print",handler:"reportCallshopClientNew",reference:"report_"+i,urlAction:"index.php/callShop/report"}]}]},{reference:"history_"+i,tooltip:"history_"+i,iconCls:"x-fa fa-refresh",title:t("History"),autoScroll:true,items:[{xtype:"callshopcdrlist",buttonCsv:false,autoScroll:true,filterableColumns:false,buttonCleanFilter:false,autoLoadStore:false,border:false,allowCreate:false,allowUpdate:false,allowDelete:false,buttonUpdateLot:false,pagination:false,allowPrint:false,columnsHide:["cabina","destination","status","buycost","markup","date"],store:Ext.create("MBilling.store.CallShopCdr",{remoteFilter:true})}],tabConfig:{listeners:{click:function(b){id=b.tooltip.split("_");panel=me.lookupReference("history_"+id[1]);storeCallshopcdr=panel.down("callshopcdrlist").getStore();filterCabina=[{type:"string",comparison:"eq",value:me.lookupReference("cabina"+id[1]).getForm().findField("name").getValue(),field:"cabina"},{type:"list",value:[0],field:"status"}];storeCallshopcdr.load({filter:filterCabina,params:{filters:Ext.encode(filterCabina)},limit:70})}}}}]})}return items},onShowCabins:function(b){me=this,i=1;Ext.each(b,function(a){if(tab=me.lookupReference("tab"+i)){name=a.data.callerid.length<1?a.data.name:a.data.callerid;status=Helper.Util.formatBooleanFree(a.data.status);tab.setTitle(t("Cabina")+" "+i+" - "+name+" "+status);tab.setVisible(true);me.lookupReference("cabina"+i).getForm().loadRecord(a)}i++});for(i=b.length+1;i<=12;i++){tab=me.lookupReference("tab"+i).setVisible(false)}}},0,["callshop2module"],["component","box","container","panel","form","callshop2module"],{component:true,box:true,container:true,panel:true,form:true,callshop2module:true},["widget.callshop2module"],0,[MBilling.view.callShop,"Module2"],0));(Ext.cmd.derive("MBilling.view.callShop.List",Ext.ux.grid.Panel,{store:"CallShop",viewConfig:{loadMask:false,emptyText:'
'+t("No record found")+"
",getRowClass:function(b){if(App.user.l=="callshop"){if(b.get("status")==1){return"callshoFree"}else{if(b.get("status")==0){return"callshoBlock"}else{if(b.get("status")==2){return"callshoInUse"}else{if(b.get("status")==3){return"callshoInCall"}}}}}}},refreshTime:4,initComponent:function(){var b=this;b.buttonCsv=false;b.buttonUpdateLot=false;b.allowCreate=true;b.allowUpdate=true;b.allowDelete=true;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.allowPrint=false;b.buttonDeleteWidth=140;b.refreshTime=(localStorage&&localStorage.getItem("callshopfresh"))||b.refreshTime;b.extraButtons=[{xtype:"numberfield",field:"jmlhBrg",fieldLabel:t("Refresh Time"),editable:false,minValue:3,labelWidth:90,width:150,selectOnFocus:true,allowDecimals:true,decimalPrecision:2,value:b.refreshTime,listeners:{change:function(a){if(a.value>0){b.refreshTime=a.value;localStorage.setItem("callshopfresh",a.value)}}}}];b.columns=[{header:t("cabina"),dataIndex:"callerid",flex:4},{header:t("status"),dataIndex:"status",renderer:Helper.Util.formatBooleanFree,flex:3,filter:{type:"list",options:[[1,t("free")],[2,t("inuse")],[0,t("blocked")],[3,t("calling")]]}},{header:t("number"),dataIndex:"callshopnumber",flex:4},{header:t("Destino"),dataIndex:"callshopdestination",hidden:App.user.l!="callshop",flex:6},{header:t("sessiontime"),dataIndex:"callshoptime",renderer:Helper.Util.formatsecondsToTime,flex:3}];b.sessionLoad=Ext.create("Ext.util.DelayedTask",function(){b.store.load()},b);Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments);b.store.on("load",b.onLoadStore,b)},onLoadStore:function(){var b=this;b.onDeactivateModule();b.onActivateModule()},onRender:function(){var b=this;b.module.on("activate",b.onActivateModule,b);b.module.on("deactivate",b.onDeactivateModule,b);b.module.on("close",b.onCloseModule,b);Ext.ux.grid.Panel.prototype.onRender.apply(this,arguments)},onActivateModule:function(){this.sessionLoad&&this.sessionLoad.delay(this.refreshTime*1000)},onDeactivateModule:function(){this.sessionLoad&&this.sessionLoad.cancel()},onCloseModule:function(){this.onDeactivateModule();this.sessionLoad=null}},0,["callshoplist"],["component","box","container","panel","tablepanel","gridpanel","grid","callshoplist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callshoplist:true},["widget.callshoplist"],0,[MBilling.view.callShop,"List"],0));(Ext.cmd.derive("MBilling.view.callShop.Form",Ext.ux.form.Panel,{hideTbar:true,labelWidthFields:"60%",bodyPadding:1,layout:"fit",buttonsTbar:[{xtype:"tbtext",itemId:"priceSum"},"->",{text:"Cobrar",itemId:"charge",iconCls:"buycredit",urlAction:"index.php/callShop/cobrar",disabled:true,handler:"sendAction",width:100},{text:"Liberar",itemId:"release",iconCls:"release",urlAction:"index.php/callShop/liberar",disabled:true,handler:"sendAction",width:100},{text:t("Print"),itemId:"print",glyph:icons.print,urlAction:"index.php/callShop/report",disabled:true,handler:"reportCallshopClient",width:100}],initComponent:function(){var b=this;b.items=[{xtype:"callshopcdrlist",buttonCsv:false,filterableColumns:false,buttonCleanFilter:false,autoLoadStore:false,border:true,allowCreate:false,allowUpdate:false,allowDelete:false,buttonUpdateLot:false,pagination:false,allowPrint:false,columnsHide:["status","buycost","markup"],store:Ext.create("MBilling.store.CallShopCdr",{remoteSort:false})}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callshopform"],["component","box","container","panel","form","callshopform"],{component:true,box:true,container:true,panel:true,form:true,callshopform:true},["widget.callshopform"],0,[MBilling.view.callShop,"Form"],0));(Ext.cmd.derive("MBilling.view.callShopCdr.Controller",Ext.ux.app.ViewController,{formHidden:true},0,0,0,0,["controller.callshopcdr"],0,[MBilling.view.callShopCdr,"Controller"],0));(Ext.cmd.derive("MBilling.view.callShopCdr.Module",Ext.ux.panel.Module,{controller:"callshopcdr"},0,["callshopcdrmodule"],["component","box","container","uxpanelmodule","callshopcdrmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callshopcdrmodule:true},["widget.callshopcdrmodule"],0,[MBilling.view.callShopCdr,"Module"],0));(Ext.cmd.derive("MBilling.view.callShopCdr.List",Ext.ux.grid.Panel,{store:"CallShopCdr",initComponent:function(){var b=this;b.buttonCsv=false;b.buttonUpdateLot=false;b.allowUpdate=true;b.allowDelete=false;b.allowCreate=false;b.allowUpdate=false;b.allowPrint=false;b.columns=[{header:t("cabina"),dataIndex:"cabina",filter:{type:"string"},flex:2},{header:t("number"),dataIndex:"calledstation",filter:{type:"string"},flex:3},{dataIndex:"destination",header:t("destination"),flex:3},{header:"Pago",dataIndex:"status",renderer:Helper.Util.formattyyesno,flex:2,filter:{type:"list",options:[[0,t("no")],[1,t("yes")]]}},{header:t("buyrate"),dataIndex:"buycost",renderer:Helper.Util.formatMoneyDecimal,flex:2},{header:t("rateinitial"),dataIndex:"price",renderer:Helper.Util.formatMoneyDecimal,flex:2},{header:t("markup"),dataIndex:"markup",renderer:Ext.util.Format.numberRenderer("0.00 %"),flex:2},{header:t("sessiontime"),dataIndex:"sessiontime",renderer:Helper.Util.formatsecondsToTime,flex:2},{header:t("date"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"date",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callshopcdrlist"],["component","box","container","panel","tablepanel","gridpanel","grid","callshopcdrlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callshopcdrlist:true},["widget.callshopcdrlist"],0,[MBilling.view.callShopCdr,"List"],0));(Ext.cmd.derive("MBilling.view.callShopCdr.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,allowBlank:App.user.isClient}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callshopcdrform"],["component","box","container","panel","form","callshopcdrform"],{component:true,box:true,container:true,panel:true,form:true,callshopcdrform:true},["widget.callshopcdrform"],0,[MBilling.view.callShopCdr,"Form"],0));(Ext.cmd.derive("MBilling.view.rateCallshop.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.ratecallshop"],0,[MBilling.view.rateCallshop,"Controller"],0));(Ext.cmd.derive("MBilling.view.rateCallshop.Module",Ext.ux.panel.Module,{controller:"ratecallshop"},0,["ratecallshopmodule"],["component","box","container","uxpanelmodule","ratecallshopmodule"],{component:true,box:true,container:true,uxpanelmodule:true,ratecallshopmodule:true},["widget.ratecallshopmodule"],0,[MBilling.view.rateCallshop,"Module"],0));(Ext.cmd.derive("MBilling.view.rateCallshop.List",Ext.ux.grid.Panel,{store:"RateCallshop",buttonImportCsv:true,initComponent:function(){var b=this;b.buttonImportCsv=App.user.isClient,b.buttonCsv=App.user.isClient;b.allowPrint=App.user.isClient;b.buttonUpdateLot=App.user.isClient;b.allowCreate=App.user.isClient;b.allowUpdate=App.user.isClient;b.allowDelete=App.user.isClient;b.buttonUpdateLotCallShopRate=App.user.isClient;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("dialprefix"),dataIndex:"dialprefix",filter:{type:"string"},flex:2},{header:t("destination"),dataIndex:"destination",flex:3},{header:t("rateinitial"),dataIndex:"buyrate",renderer:Helper.Util.formatMoneyDecimal4,flex:2},{header:t("buyrateinitblock"),dataIndex:"minimo",flex:2},{header:t("buyrateincrement"),dataIndex:"block",flex:2}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["ratecallshoplist"],["component","box","container","panel","tablepanel","gridpanel","grid","ratecallshoplist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,ratecallshoplist:true},["widget.ratecallshoplist"],0,[MBilling.view.rateCallshop,"List"],0));(Ext.cmd.derive("MBilling.view.rateCallshop.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{xtype:"numberfield",name:"dialprefix",fieldLabel:t("prefix")},{name:"destination",fieldLabel:t("destination")},{xtype:"moneyfield",name:"buyrate",fieldLabel:t("rateinitial")},{xtype:"numberfield",name:"minimo",value:1,minValue:1,fieldLabel:t("buyrateinitblock")},{xtype:"numberfield",name:"block",value:1,minValue:1,fieldLabel:t("buyrateincrement")},{xtype:"numberfield",name:"minimal_time_charge",value:0,minValue:0,fieldLabel:t("Minimal time to charge")}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["ratecallshopform"],["component","box","container","panel","form","ratecallshopform"],{component:true,box:true,container:true,panel:true,form:true,ratecallshopform:true},["widget.ratecallshopform"],0,[MBilling.view.rateCallshop,"Form"],0));(Ext.cmd.derive("MBilling.view.rateCallshop.ImportCsv",Ext.ux.window.ImportCsv,{htmlTipInfo:"
"+t("dialprefix")+", "+t("destination")+", "+t("rateinitial")+"
5511, Brasil SP, 0.080
34, Spain Fix, 0.056
54, Argentina, 0.025

"+t("rateinitial")+" "+t("and")+" "+t("buyrate")+""},0,["ratecallshopimportcsv"],["component","box","container","panel","window","ratecallshopimportcsv"],{component:true,box:true,container:true,panel:true,window:true,ratecallshopimportcsv:true},["widget.ratecallshopimportcsv"],0,[MBilling.view.rateCallshop,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.callSummaryCallShop.Controller",MBilling.view.callSummaryPerDay.Controller,{aliasChart:"callsummarycallshopchart"},0,0,0,0,["controller.callsummarycallshop"],0,[MBilling.view.callSummaryCallShop,"Controller"],0));(Ext.cmd.derive("MBilling.view.callSummaryCallShop.Module",Ext.ux.panel.Module,{controller:"callsummarycallshop",titleForm:t("total"),iconForm:"icon-sum",widthForm:250},0,["callsummarycallshopmodule"],["component","box","container","uxpanelmodule","callsummarycallshopmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callsummarycallshopmodule:true},["widget.callsummarycallshopmodule"],0,[MBilling.view.callSummaryCallShop,"Module"],0));(Ext.cmd.derive("MBilling.view.callSummaryCallShop.List",Ext.ux.grid.Panel,{store:"CallSummaryCallShop",initComponent:function(){var b=this;b.buttonImportCsv=false;b.buttonCsv=false;b.allowPrint=false;b.buttonUpdateLot=false;b.allowCreate=false;b.buttonCleanFilter=false;b.allowUpdate=false;b.allowDelete=false;b.extraButtons=[{text:t("charts"),iconCls:"icon-chart-column",handler:"onChart",reference:"chart",disabled:false,hidden:App.user.isClient}];b.collapsedExtraFilters=false;b.titleAddFilter=t("Filter");b.extraFilters=[{field:"t.cabina",label:t("cabina"),type:"string"},{field:"t.calledstation",label:t("prefix"),type:"string"}];b.columns=[{header:t("day"),renderer:Ext.util.Format.dateRenderer("Y-m-d"),dataIndex:"day",filter:{type:"date",field:"date"},flex:3},{menuDisabled:true,header:t("sessiontime")+" "+t("Min"),dataIndex:"sessiontime",flex:2},{menuDisabled:true,header:t("aloc_all_calls"),dataIndex:"aloc_all_calls",renderer:Helper.Util.formatsecondsToTime,flex:3},{menuDisabled:true,header:t("nbcall"),dataIndex:"nbcall",flex:3},{menuDisabled:true,header:t("buycost"),dataIndex:"buycost",renderer:Helper.Util.formatMoneyDecimal,flex:3,hideable:false,hidden:!App.user.isClient},{menuDisabled:true,header:t("sessionbill"),dataIndex:"price",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:!App.user.isClient},{menuDisabled:true,header:t("markup"),dataIndex:"lucro",renderer:Helper.Util.formatMoneyDecimal,flex:3,hideable:false,hidden:!App.user.isClient}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarycallshoplist"],["component","box","container","panel","tablepanel","gridpanel","grid","callsummarycallshoplist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callsummarycallshoplist:true},["widget.callsummarycallshoplist"],0,[MBilling.view.callSummaryCallShop,"List"],0));(Ext.cmd.derive("MBilling.view.callSummaryCallShop.Form",Ext.ux.form.Panel,{defaults:{},labelWidthFields:150,defaultType:"displayfield",initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{name:"sumsessiontime",fieldLabel:t("sessiontime")+" "+t("Min")},{name:"sumprice",fieldLabel:t("sessionbill"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isClient},{name:"sumlucro",fieldLabel:t("markup"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isClient},{name:"sumbuycost",fieldLabel:t("buycost"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isClient},{name:"sumnbcall",fieldLabel:t("nbcall"),hidden:!App.user.isClient}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarycallshopform"],["component","box","container","panel","form","callsummarycallshopform"],{component:true,box:true,container:true,panel:true,form:true,callsummarycallshopform:true},["widget.callsummarycallshopform"],0,[MBilling.view.callSummaryCallShop,"Form"],0));(Ext.cmd.derive("MBilling.view.callSummaryCallShop.Chart",Ext.ux.panel.Chart,{controller:"callsummarycallshop",store:"CallSummaryCallShop",fieldValue:"sessiontime",fieldDescription:"day",labelYLine:t("sessiontime")+" Min",labelXLine:t("day"),initComponent:function(){var d=this,c;d.rendererFieldValue=Ext.util.Format.numberRenderer("0"),d.rendererFieldDescription=Ext.util.Format.dateRenderer("Y-m-d");d.tbarChart=[{xtype:"buttongroup",toggleGroup:"charts",defaults:{enableToggle:true,toggleGroup:"charts",allowDepress:false,listeners:{toggle:"onToggleGroupButton"}},items:[{pressed:true,text:t("sessiontime"),chart:"sessiontime",sumName:"sumsessiontime"},{text:t("buycost"),sumRenderer:Helper.Util.formatMoneyDecimal,chart:"buycost",sumName:"sumbuycost"},{text:t("sessionbill"),sumRenderer:Helper.Util.formatMoneyDecimal,chart:"price",sumName:"sumprice"},{text:t("markup"),sumRenderer:Helper.Util.formatMoneyDecimal,chart:"lucro",sumName:"sumlucro",hidden:App.user.isClient||App.user.isAgent},{text:t("nbcall"),chart:"nbcall",sumName:"sumnbcall"}]}];d.bbarChart=[{xtype:"tbtext",itemId:"tbTextSum"}];Ext.ux.panel.Chart.prototype.initComponent.apply(this,arguments)}},0,["callsummarycallshopchart"],["component","box","container","panel","chartpanel","callsummarycallshopchart"],{component:true,box:true,container:true,panel:true,chartpanel:true,callsummarycallshopchart:true},["widget.callsummarycallshopchart"],0,[MBilling.view.callSummaryCallShop,"Chart"],0));(Ext.cmd.derive("MBilling.view.buycredit.Controller",Ext.ux.app.ViewController,{buyCreditClose:function(e){var j=this,g=j.lookupReference("buycreditPanel"),f=j.lookupReference("btnCancel");g.getForm().findField("amount")["show"]();g.getForm().findField("method")["show"]();g.getForm().findField("card_num")["hide"]();g.getForm().findField("exp_date")["hide"]();g.getForm().findField("method").setValue("");f.setVisible(false)},buyCredit:function(r){var o=this,n=o.lookupReference("buycreditPanel"),s=o.lookupReference("btnCancel"),p=n.getForm().findField("amount").getValue(),l=n.getForm().findField("method").getValue(),m=n.getForm().findField("card_num").getValue(),q=n.getForm().findField("exp_date").rawValue;if(n.getForm().findField("method").rawValue.match(/uthorize/)){if(m){n.setLoading(o.msgWait);Ext.Ajax.request({url:"index.php/buyCredit/method/?amount="+p+"&id_method="+l+"&cc="+m+"&ed="+q,scope:o,success:function(a){a=Ext.decode(a.responseText);if(a.success){Ext.ux.Alert.alert(t("Success"),a.msg,"success",10000);n.setLoading(false);n.getForm().findField("amount")["show"]();n.getForm().findField("method")["show"]();n.getForm().findField("card_num")["hide"]();n.getForm().findField("exp_date")["hide"]();s.setVisible(false);n.getForm().findField("card_num").setValue("");n.getForm().findField("exp_date").setValue("");n.getForm().findField("method").setValue("")}else{Ext.ux.Alert.alert(t("Error"),a.msg,"error");n.getForm().findField("card_num").setValue("");n.getForm().findField("exp_date").setValue("");n.setLoading(false)}}});return}else{n.getForm().findField("amount")["hide"]();n.getForm().findField("method")["hide"]();n.getForm().findField("card_num")["show"]();n.getForm().findField("exp_date")["show"]();s.setVisible(true);n.getForm().findField("card_num").focus()}}else{if(!l){Ext.ux.Alert.alert(o.titleWarning,t("Select a ")+t("paymentmethods"),"warning");return}else{if(p<=0){Ext.ux.Alert.alert(o.titleWarning,t("Select a ")+t("valid")+" "+t("amount"),"warning");return}else{url="index.php/buyCredit/method/?amount="+p+"&id_method="+l;n.getForm().findField("method").setValue("");n.getForm().findField("card_num").setValue("");n.getForm().findField("exp_date").setValue("");if(n.getForm().findField("method").rawValue.match(/PlacetoPay/)){window.open(url,"_self")}else{window.open(url,"_blank")}}}}}},0,0,0,0,["controller.buycredit"],0,[MBilling.view.buycredit,"Controller"],0));(Ext.cmd.derive("MBilling.view.buycredit.Module",Ext.form.Panel,{controller:"buycredit",resizable:false,autoShow:true,header:false,initComponent:function(){var b=this;b.items=[{reference:"buycreditPanel",xtype:"form",margin:"10 10 10 10",autoShow:true,closable:false,resizable:false,bodyPadding:10,defaultType:"textfield",defaults:{labelAlign:"right",labelWidth:150,width:280,allowBlank:false,msgTarget:"side",enableKeyEvents:true,plugins:"markallowblank",anchor:"100%"},items:[{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,00",fieldLabel:t("Amounts"),value:0,name:"amount"},{xtype:"methodpaycombo",fieldLabel:t("paymentmethods"),name:"method"},{fieldLabel:t("CreditCard Number"),name:"card_num",hidden:true},{xtype:"datefield",fieldLabel:t("Expiration Date"),name:"exp_date",format:"m/y",hidden:true}],bbar:[{text:t("Cancel"),tooltip:t("Cancel"),glyph:b.glyphCancel,handler:"buyCreditClose",hidden:true,reference:"btnCancel"},{text:t("Next"),tooltip:t("Next"),width:100,glyph:icons.disk,handler:"buyCredit"}]}];Ext.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["buycreditmodule"],["component","box","container","panel","form","buycreditmodule"],{component:true,box:true,container:true,panel:true,form:true,buycreditmodule:true},["widget.buycreditmodule"],0,[MBilling.view.buycredit,"Module"],0));(Ext.cmd.derive("MBilling.view.transferToMobile.Module",Ext.form.Panel,{resizable:false,autoShow:true,header:false,items:[{xtype:"component",autoEl:{width:"100%",height:"100%",tag:"iframe",src:"index.php/transferToMobile/read"}}]},0,["transfertomobilemodule"],["component","box","container","panel","form","transfertomobilemodule"],{component:true,box:true,container:true,panel:true,form:true,transfertomobilemodule:true},["widget.transfertomobilemodule"],0,[MBilling.view.transferToMobile,"Module"],0));(Ext.cmd.derive("MBilling.view.firewall.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.firewall"],0,[MBilling.view.firewall,"Controller"],0));(Ext.cmd.derive("MBilling.view.firewall.Module",Ext.ux.panel.Module,{controller:"firewall"},0,["firewallmodule"],["component","box","container","uxpanelmodule","firewallmodule"],{component:true,box:true,container:true,uxpanelmodule:true,firewallmodule:true},["widget.firewallmodule"],0,[MBilling.view.firewall,"Module"],0));(Ext.cmd.derive("MBilling.view.firewall.List",Ext.ux.grid.Panel,{store:"Firewall",initComponent:function(){var b=this;b.textDelete="Unban";b.textNew="Ban new Ip";b.buttonCsv=false;b.buttonUpdateLot=false;b.buttonCleanFilter=true;b.allowPrint=false;b.allowCreate=true;b.allowDelete=true;b.columns=[{header:t("Ip"),dataIndex:"ip",flex:4},{header:t("Type"),dataIndex:"jail",flex:4},{header:t("Permanently")+" "+t("Ban"),dataIndex:"action",renderer:Helper.Util.formattyyesno,filter:{type:"list",options:[[0,t("no")],[1,t("yes")]]},flex:2}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["firewalllist"],["component","box","container","panel","tablepanel","gridpanel","grid","firewalllist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,firewalllist:true},["widget.firewalllist"],0,[MBilling.view.firewall,"List"],0));(Ext.cmd.derive("MBilling.view.firewall.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{name:"ip",fieldLabel:t("Ip"),vtype:"IPAddress"},{xtype:"yesnocombo",fieldLabel:t("Permanently")+" "+t("Ban"),name:"action"},{xtype:"textarea",name:"description",fieldLabel:t("description"),allowBlank:true,height:300,anchor:"100%",readOnly:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["firewallform"],["component","box","container","panel","form","firewallform"],{component:true,box:true,container:true,panel:true,form:true,firewallform:true},["widget.firewallform"],0,[MBilling.view.firewall,"Form"],0));(Ext.cmd.derive("MBilling.view.userRate.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.userrate"],0,[MBilling.view.userRate,"Controller"],0));(Ext.cmd.derive("MBilling.view.userRate.Module",Ext.ux.panel.Module,{controller:"userrate"},0,["userratemodule"],["component","box","container","uxpanelmodule","userratemodule"],{component:true,box:true,container:true,uxpanelmodule:true,userratemodule:true},["widget.userratemodule"],0,[MBilling.view.userRate,"Module"],0));(Ext.cmd.derive("MBilling.view.userRate.List",Ext.ux.grid.Panel,{store:"UserRate",initComponent:function(){var b=this;b.buttonCsv=false;b.allowPrint=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("prefix"),dataIndex:"idPrefixprefix",flex:window.isTablet?2:3},{dataIndex:"idPrefixdestination",header:t("destination"),flex:window.isTablet?2:3},{header:t("rateinitial"),dataIndex:"rateinitial",renderer:Helper.Util.formatMoneyDecimal,flex:2},{header:t("initblock"),dataIndex:"initblock",flex:2},{header:t("billingblock"),dataIndex:"billingblock",flex:2}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["userratelist"],["component","box","container","panel","tablepanel","gridpanel","grid","userratelist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,userratelist:true},["widget.userratelist"],0,[MBilling.view.userRate,"List"],0));(Ext.cmd.derive("MBilling.view.userRate.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{fieldLabel:t("User"),name:"id_user",xtype:!App.user.isAdmin?"textfield":"userlookup",ownerForm:b,hidden:!App.user.isAdmin,allowBlank:!App.user.isAdmin},{fieldLabel:t("Destination"),name:"id_prefix",xtype:"prefixlookup",ownerForm:b,hidden:!App.user.isAdmin,allowBlank:!App.user.isAdmin},{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,"+App.user.decimalPrecision,name:"rateinitial",fieldLabel:t("rateinitial"),readOnly:App.user.isClient},{xtype:"numberfield",name:"initblock",fieldLabel:t("initblock"),hidden:App.user.isClient},{xtype:"numberfield",name:"billingblock",fieldLabel:t("billingblock"),hidden:App.user.isClient}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["userrateform"],["component","box","container","panel","form","userrateform"],{component:true,box:true,container:true,panel:true,form:true,userrateform:true},["widget.userrateform"],0,[MBilling.view.userRate,"Form"],0));(Ext.cmd.derive("MBilling.view.extra.Module",Ext.form.Panel,{resizable:false,autoShow:true,header:false,items:[{xtype:"component",autoEl:{width:"100%",height:"100%",tag:"iframe",src:window.moduleExtra}}]},0,["extramodule"],["component","box","container","panel","form","extramodule"],{component:true,box:true,container:true,panel:true,form:true,extramodule:true},["widget.extramodule"],0,[MBilling.view.extra,"Module"],0));(Ext.cmd.derive("MBilling.view.callOnlineChart.Module",Ext.ux.panel.Module,{},0,["callOnlineChartmodule"],["component","box","container","uxpanelmodule","callOnlineChartmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callOnlineChartmodule:true},["widget.callOnlineChartmodule"],0,[MBilling.view.callOnlineChart,"Module"],0));(Ext.cmd.derive("MBilling.view.callOnlineChart.List",Ext.ux.grid.Panel,{store:"CallOnlineChart",initComponent:function(){var b=this;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("Total"),dataIndex:"total",flex:1},{header:t("date"),dataIndex:"date",renderer:Ext.util.Format.dateRenderer("Y-m-d H:i"),flex:1}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callonlinechartlist"],["component","box","container","panel","tablepanel","gridpanel","grid","callonlinechartlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callonlinechartlist:true},["widget.callonlinechartlist"],0,[MBilling.view.callOnlineChart,"List"],0));(Ext.cmd.derive("MBilling.view.callOnlineChart.Form",Ext.ux.form.Panel,{},0,["callOnlineChartform"],["component","box","container","panel","form","callOnlineChartform"],{component:true,box:true,container:true,panel:true,form:true,callOnlineChartform:true},["widget.callOnlineChartform"],0,[MBilling.view.callOnlineChart,"Form"],0));(Ext.cmd.derive("MBilling.view.callOnlineChart.Chart",Ext.ux.panel.Chart,{controller:"callsummaryperday",store:"CallOnlineChart",fieldValue:["total","answer"],fieldDescription:"date",labelYLine:t("total")+" / Min",labelXLine:t("Minute"),reference:"callonlinechartchart",defaultChart:"line",btnShowColumn:false,btnShowBar:false,btnShowLine:true,btnShowPie:false,animate:true,btnShowLineHidden:true,initComponent:function(){var b=this;b.rendererFieldValue=Ext.util.Format.numberRenderer("0");b.tbarChart=[{text:t("Per")+" "+t("Minute"),scope:b,handler:"onPerMinute",reference:"btnMinute",disabled:true},{text:t("Per")+" "+t("Hour"),scope:b,handler:"onPerhour",reference:"btnHour"}];b.legend={position:"right",boxStrokeWidth:0,labelFont:"12px Helvetica",renderer:b.rendererLegend};b.bbarChart=[{xtype:"tbtext",itemId:"tbTextSum"}];b.sessionLoad=Ext.create("Ext.util.DelayedTask",function(){b.store.load()},b);Ext.ux.panel.Chart.prototype.initComponent.apply(this,arguments);b.store.on("load",b.onLoadStore,b)},onPerMinute:function(d){var c=this;c.lookupReference("btnMinute").disable();c.lookupReference("btnHour").enable();c.store.setRemoteFilter(true);c.store.filter("type","minute");c.store.load()},onPerhour:function(d){var c=this;c.lookupReference("btnHour").disable();c.lookupReference("btnMinute").enable();c.store.setRemoteFilter(true);c.store.filter("type","hour");c.store.load()},onLoadStore:function(){this.onActivateModule()},onActivateModule:function(){this.sessionLoad&&this.sessionLoad.delay(25000)}},0,["callonlinechartchart"],["component","box","container","panel","chartpanel","callonlinechartchart"],{component:true,box:true,container:true,panel:true,chartpanel:true,callonlinechartchart:true},["widget.callonlinechartchart"],0,[MBilling.view.callOnlineChart,"Chart"],0));(Ext.cmd.derive("MBilling.view.smtps.Controller",Ext.ux.app.ViewController,{onSendEmail:function(e){var f=this,d=f.list.getSelectionModel().getSelection()[0];f.list.setLoading(true);if(f.list.getSelectionModel().getSelection().length==1){Ext.Ajax.request({url:"index.php/smtps/testMail",params:{id:d.get("id")},scope:f,success:function(a){a=Ext.decode(a.responseText);if(a[f.nameSuccessRequest]){Ext.ux.Alert.alert(f.titleSuccess,a[f.nameMsgRequest],"success")}else{Ext.ux.Alert.alert(f.titleError,a[f.nameMsgRequest],"error")}f.list.setLoading(false)}})}else{Ext.ux.Alert.alert(f.titleError,"Please Select a Smtp","notification");f.list.setLoading(false)}}},0,0,0,0,["controller.smtps"],0,[MBilling.view.smtps,"Controller"],0));(Ext.cmd.derive("MBilling.view.smtps.List",Ext.ux.grid.Panel,{store:"Smtps",initComponent:function(){var b=this;b.extraButtons=[{text:t("Test Smtp"),iconCls:"templatemail",handler:"onSendEmail",disabled:false}];b.buttonUpdateLot=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("Host"),dataIndex:"host",flex:4},{header:t("username"),dataIndex:"username",flex:2},{header:t("Port"),dataIndex:"port",flex:3},{header:t("Encryption"),dataIndex:"encryption",flex:3}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["smtpslist"],["component","box","container","panel","tablepanel","gridpanel","grid","smtpslist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,smtpslist:true},["widget.smtpslist"],0,[MBilling.view.smtps,"List"],0));(Ext.cmd.derive("MBilling.view.smtps.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{name:"host",fieldLabel:t("Host"),hidden:App.user.isClient},{name:"username",fieldLabel:t("username"),hidden:App.user.isClient},{inputType:"password",name:"password",fieldLabel:t("password"),hidden:App.user.isClient},{xtype:"numberfield",name:"port",fieldLabel:t("Port"),value:587,hidden:App.user.isClient},{xtype:"combobox",name:"encryption",fieldLabel:t("Encryption"),hidden:App.user.isClient,value:"null",store:[["ssl",t("SSl")],["tls",t("TLS")],["null",t("NULL")]]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["smtpsform"],["component","box","container","panel","form","smtpsform"],{component:true,box:true,container:true,panel:true,form:true,smtpsform:true},["widget.smtpsform"],0,[MBilling.view.smtps,"Form"],0));(Ext.cmd.derive("MBilling.view.smtps.Module",Ext.ux.panel.Module,{controller:"smtps"},0,["smtpsmodule"],["component","box","container","uxpanelmodule","smtpsmodule"],{component:true,box:true,container:true,uxpanelmodule:true,smtpsmodule:true},["widget.smtpsmodule"],0,[MBilling.view.smtps,"Module"],0));(Ext.cmd.derive("MBilling.view.servers.Controller",Ext.ux.app.ViewController,{init:function(){var b=this;b.control({combobox:{select:b.onSelectType}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectType:function(c,d){this.showFieldsRelated(d.getData().showFields)},showFieldsRelated:function(l){var m=this,g=m.formPanel.getForm().getFields(),j=m.formPanel.getForm().findField("weight"),f=m.formPanel.getForm();g.each(function(a){if(a.name=="type"){if(a.value=="asterisk"||a.value=="mbilling"){j.show()}else{j.hide()}}})},onEdit:function(){var d=this,f=d.formPanel.getForm().findField("weight"),e=d.formPanel.getForm().findField("type");Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments);if(e.value=="asterisk"||e.value=="mbilling"){f.show()}else{f.hide()}},onDelete:function(d){var f=this,e;notDelete=false;Ext.each(f.list.getSelectionModel().getSelection(),function(a){if(a.get("id")==1){Ext.ux.Alert.alert(f.titleError,t("You cannot delete the")+" server id 1","error");notDelete=true}});if(notDelete==false){Ext.ux.app.ViewController.prototype.onDelete.apply(this,arguments)}}},0,0,0,0,["controller.servers"],0,[MBilling.view.servers,"Controller"],0));(Ext.cmd.derive("MBilling.view.servers.List",Ext.ux.grid.Panel,{store:"Servers",initComponent:function(){var b=this;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("host"),dataIndex:"host",flex:4},{header:t("username"),dataIndex:"username",flex:4},{header:t("type"),dataIndex:"type",comboRelated:"booleancombo",flex:2},{header:t("status"),dataIndex:"status",renderer:Helper.Util.formatBooleanActive,comboRelated:"booleancombo",flex:2,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")]]}}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["serverslist"],["component","box","container","panel","tablepanel","gridpanel","grid","serverslist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,serverslist:true},["widget.serverslist"],0,[MBilling.view.servers,"List"],0));(Ext.cmd.derive("MBilling.view.servers.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["id_user"],initComponent:function(){var b=this;b.items=[{name:"host",fieldLabel:t("host")},{name:"username",fieldLabel:t("username"),allowBlank:true},{name:"password",fieldLabel:t("password"),allowBlank:true},{name:"port",fieldLabel:t("port"),allowBlank:true},{xtype:"combobox",name:"type",fieldLabel:t("type"),forceSelection:true,editable:false,value:"mbilling",store:[["mbilling",t("Mbilling")],["asterisk",t("Asterisk")],["sipproxy",t("SipProxy")]]},{fieldLabel:t("Weight"),name:"weight",hidden:true,allowBlank:true,emptyText:t("This is useful in order to get a different ratio of traffic between servers.")},{xtype:"booleancombo",name:"status",fieldLabel:t("status"),allowBlank:true},{xtype:"textareafield",name:"description",fieldLabel:t("description"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["serversform"],["component","box","container","panel","form","serversform"],{component:true,box:true,container:true,panel:true,form:true,serversform:true},["widget.serversform"],0,[MBilling.view.servers,"Form"],0));(Ext.cmd.derive("MBilling.view.servers.Module",Ext.ux.panel.Module,{controller:"servers"},0,["serversmodule"],["component","box","container","uxpanelmodule","serversmodule"],{component:true,box:true,container:true,uxpanelmodule:true,serversmodule:true},["widget.serversmodule"],0,[MBilling.view.servers,"Module"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerUser.Controller",Ext.ux.app.ViewController,{formHidden:true,onEdit:function(){me=this;me.sumData=me.store.getData().items[0].getData();if(!me.sumData){return}me.formPanel.getForm().getFields().each(function(b){b.setValue(me.sumData[b.name])});me.formPanel.expand()},onExportCsvUser:function(o,l,g){var m=this,j=m.list.getStore(),n=m.list.filters.getFilterData().length?Ext.encode(m.list.filters.getFilterData()):j.proxy.extraParams.filter;window.open("index.php/callSummaryPerUser/exportCsvCalls?id="+o.getStore().getAt(l).getData().idUserusername+"&filter="+n)}},0,0,0,0,["controller.callsummaryperuser"],0,[MBilling.view.callSummaryPerUser,"Controller"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerUser.List",Ext.ux.grid.Panel,{store:"CallSummaryPerUser",initComponent:function(){var b=this;b.buttonImportCsv=false;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{xtype:"actioncolumn",width:26,sortable:false,menuDisabled:true,header:t(""),dataIndex:"id",items:[{iconCls:"icon-export-csv",tooltip:t("Export CSV"),handler:"onExportCsvUser"}],hidden:!App.user.isAdmin},{header:t("Username"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:3},{header:t("sessiontime")+" "+t("Min"),dataIndex:"sessiontime",flex:2},{header:t("aloc_all_calls"),dataIndex:"aloc_all_calls",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Answered Calls"),dataIndex:"nbcall",flex:3},{header:t("Failed Calls"),dataIndex:"nbcall_fail",flex:3},{header:t("buycost"),dataIndex:App.user.isAdmin?"buycost":"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("sessionbill"),dataIndex:App.user.isAgent||App.user.isClientAgent?"agent_bill":"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("markup"),dataIndex:"lucro",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("ASR"),dataIndex:"asr",renderer:Helper.Util.formatPorcente,flex:3,hidden:!App.user.isAdmin,hideable:App.user.isAdmin}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummaryperuserlist"],["component","box","container","panel","tablepanel","gridpanel","grid","callsummaryperuserlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callsummaryperuserlist:true},["widget.callsummaryperuserlist"],0,[MBilling.view.callSummaryPerUser,"List"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerUser.Form",Ext.ux.form.Panel,{defaults:{},labelWidthFields:100,defaultType:"displayfield",initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{name:"sumsessiontime",fieldLabel:t("sessiontime")+" "+t("Min"),renderer:Ext.util.Format.numberRenderer("0"),allowBlank:true},{name:App.user.isAgent||App.user.isClientAgent?"sumagent_bill":"sumsessionbill",fieldLabel:t("sessionbill"),renderer:Helper.Util.formatMoneyDecimal,allowBlank:true},{name:App.user.isAdmin?"sumbuycost":"sumsessionbill",fieldLabel:t("buycost"),renderer:Helper.Util.formatMoneyDecimal,hidden:App.user.isClient,allowBlank:true},{name:"sumlucro",fieldLabel:t("markup"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumnbcall",fieldLabel:t("Answered Calls"),allowBlank:true},{name:"sumnbcallfail",fieldLabel:t("Failed Calls"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummaryperuserform"],["component","box","container","panel","form","callsummaryperuserform"],{component:true,box:true,container:true,panel:true,form:true,callsummaryperuserform:true},["widget.callsummaryperuserform"],0,[MBilling.view.callSummaryPerUser,"Form"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerUser.Module",Ext.ux.panel.Module,{controller:"callsummaryperuser",cfgEast:{flex:0.4}},0,["callsummaryperusermodule"],["component","box","container","uxpanelmodule","callsummaryperusermodule"],{component:true,box:true,container:true,uxpanelmodule:true,callsummaryperusermodule:true},["widget.callsummaryperusermodule"],0,[MBilling.view.callSummaryPerUser,"Module"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerTrunk.Controller",Ext.ux.app.ViewController,{formHidden:true,onEdit:function(){me=this;me.sumData=me.store.getData().items[0].getData();if(!me.sumData){return}me.formPanel.getForm().getFields().each(function(b){b.setValue(me.sumData[b.name])});me.formPanel.expand()},onExportCsvUser:function(o,l,g){var m=this,j=m.list.getStore(),n=m.list.filters.getFilterData().length?Ext.encode(m.list.filters.getFilterData()):j.proxy.extraParams.filter;window.open("index.php/callSummaryPerTrunk/exportCsvCalls?id="+o.getStore().getAt(l).getData().idTrunktrunkcode+"&filter="+n)}},0,0,0,0,["controller.callsummarypertrunk"],0,[MBilling.view.callSummaryPerTrunk,"Controller"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerTrunk.List",Ext.ux.grid.Panel,{store:"CallSummaryPerTrunk",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.allowCreate=false;b.allowUpdate=false;b.allowDelete=false;b.columns=[{xtype:"actioncolumn",width:26,sortable:false,menuDisabled:true,header:t(""),dataIndex:"id",items:[{iconCls:"icon-export-csv",tooltip:t("Export CSV"),handler:"onExportCsvUser"}],hidden:!App.user.isAdmin},{header:t("Trunk"),dataIndex:"idTrunktrunkcode",filter:{type:"string",field:"idTrunk.trunkcode"},flex:3},{header:t("sessiontime")+" "+t("Min"),dataIndex:"sessiontime",flex:2},{header:t("aloc_all_calls"),dataIndex:"aloc_all_calls",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Answered Calls"),dataIndex:"nbcall",flex:3},{header:t("Failed Calls"),dataIndex:"nbcall_fail",flex:3},{header:t("buycost"),dataIndex:"buycost",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("sessionbill"),dataIndex:"sessionbill",renderer:Helper.Util.formatMoneyDecimal,flex:3},{header:t("markup"),dataIndex:"lucro",renderer:Helper.Util.formatMoneyDecimal,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin},{header:t("ASR"),dataIndex:"asr",renderer:Helper.Util.formatPorcente,flex:3,hidden:App.user.isClient,hideable:App.user.isAdmin}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarypertrunklist"],["component","box","container","panel","tablepanel","gridpanel","grid","callsummarypertrunklist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callsummarypertrunklist:true},["widget.callsummarypertrunklist"],0,[MBilling.view.callSummaryPerTrunk,"List"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerTrunk.Form",Ext.ux.form.Panel,{defaults:{},labelWidthFields:100,defaultType:"displayfield",initComponent:function(){var b=this;b.allowUpdate=false;b.allowCreate=false;b.items=[{name:"sumsessiontime",fieldLabel:t("sessiontime")+" "+t("Min"),renderer:Ext.util.Format.numberRenderer("0"),allowBlank:true},{name:"sumsessionbill",fieldLabel:t("sessionbill"),renderer:Helper.Util.formatMoneyDecimal,allowBlank:true},{name:"sumbuycost",fieldLabel:t("buycost"),renderer:Helper.Util.formatMoneyDecimal,hidden:App.user.isClient,allowBlank:true},{name:"sumlucro",fieldLabel:t("markup"),renderer:Helper.Util.formatMoneyDecimal,hidden:!App.user.isAdmin,allowBlank:true},{name:"sumnbcall",fieldLabel:t("Answered Calls"),allowBlank:true},{name:"sumnbcallfail",fieldLabel:t("Failed Calls"),allowBlank:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callsummarypertrunkform"],["component","box","container","panel","form","callsummarypertrunkform"],{component:true,box:true,container:true,panel:true,form:true,callsummarypertrunkform:true},["widget.callsummarypertrunkform"],0,[MBilling.view.callSummaryPerTrunk,"Form"],0));(Ext.cmd.derive("MBilling.view.callSummaryPerTrunk.Module",Ext.ux.panel.Module,{controller:"callsummarypertrunk",cfgEast:{flex:0.4}},0,["callsummarypertrunkmodule"],["component","box","container","uxpanelmodule","callsummarypertrunkmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callsummarypertrunkmodule:true},["widget.callsummarypertrunkmodule"],0,[MBilling.view.callSummaryPerTrunk,"Module"],0));(Ext.cmd.derive("MBilling.view.backup.Controller",Ext.ux.app.ViewController,{formHidden:true,onDownload:function(l){var j=this,m,f=j.list.getSelectionModel().getSelection()[0],g=[];values="file="+f.data.name;url="index.php/backup/download/?"+values;window.open(url)},onDelete:function(m){var l=this,n,o=l.list.getSelectionModel().getSelection()[0],j=[];destroyType=m.menu.down("menucheckitem[checked=true]").value;var g=(destroyType==="all")?l.msgDeleteAll:l.msgConfirmation;if(!l.list.allowDelete){return}if(destroyType==="all"){Ext.ux.Alert.alert(l.titleError,"You cannot delete all backups","notification");return}if(o){Ext.Msg.confirm(l.titleConfirmation,g,function(a){if(a==="yes"){Ext.each(l.list.getSelectionModel().getSelection(),function(b){j.push(b.get("name"))});Ext.Ajax.request({url:"index.php/backup/destroy",params:{ids:Ext.encode(j)},scope:l,success:function(d){d=Ext.decode(d.responseText);if(d[l.nameSuccessRequest]){var c=Helper.Util.convertErrorsJsonToString(d[l.nameMsgRequest]);Ext.ux.Alert.alert(l.titleSuccess,c,"success")}else{var b=Helper.Util.convertErrorsJsonToString(d[l.nameMsgRequest]);Ext.ux.Alert.alert(l.titleError,b,"notification")}}});l.store.load()}},l)}else{Ext.ux.Alert.alert(l.titleError,t("Please select one or more register"),"notification")}},onNew:function(){var b=this;Ext.Msg.confirm(b.titleConfirmation,t("Do you relly want create a new backup now? It can take many time and make your server slow. Mbilling make backup every day automatically."),function(a){if(a==="yes"){Ext.Msg.confirm(b.titleConfirmation,t("This backup will override the backup held today! Do you sure?"),function(d){if(d==="yes"){Ext.Ajax.request({url:"index.php/backup/save",params:{ids:0},scope:b,success:function(j){j=Ext.decode(j.responseText);if(j[b.nameSuccessRequest]){var g=Helper.Util.convertErrorsJsonToString(j[b.nameMsgRequest]);Ext.ux.Alert.alert(b.titleSuccess,g,"success")}else{var c=Helper.Util.convertErrorsJsonToString(j[b.nameMsgRequest]);Ext.ux.Alert.alert(b.titleError,c,"notification")}}});b.store.load()}},b)}},b)}},0,0,0,0,["controller.backup"],0,[MBilling.view.backup,"Controller"],0));(Ext.cmd.derive("MBilling.view.backup.List",Ext.ux.grid.Panel,{store:"Backup",initComponent:function(){var b=this;b.buttonImportCsv=true;b.textButtonImportCsv=t("Importar Backup");b.widthButtonCsv=140;b.extraButtons=[{text:t("Download Backup"),glyph:icons.disk,handler:"onDownload",width:140,disabled:false}];b.buttonCsv=false;b.allowPrint=false;b.buttonUpdateLot=false;b.buttonCleanFilter=false;b.allowUpdate=false;b.columns=[{menuDisabled:true,header:t("name"),dataIndex:"name",flex:1},{menuDisabled:true,header:t("size"),dataIndex:"size",flex:1}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["backuplist"],["component","box","container","panel","tablepanel","gridpanel","grid","backuplist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,backuplist:true},["widget.backuplist"],0,[MBilling.view.backup,"List"],0));(Ext.cmd.derive("MBilling.view.backup.Form",Ext.ux.form.Panel,{},0,["backupform"],["component","box","container","panel","form","backupform"],{component:true,box:true,container:true,panel:true,form:true,backupform:true},["widget.backupform"],0,[MBilling.view.backup,"Form"],0));(Ext.cmd.derive("MBilling.view.backup.Module",Ext.ux.panel.Module,{controller:"backup",initComponent:function(){var b=this;Ext.ux.panel.Module.prototype.initComponent.apply(this,arguments)}},0,["backupmodule"],["component","box","container","uxpanelmodule","backupmodule"],{component:true,box:true,container:true,uxpanelmodule:true,backupmodule:true},["widget.backupmodule"],0,[MBilling.view.backup,"Module"],0));(Ext.cmd.derive("MBilling.view.backup.ImportCsv",Ext.ux.window.ImportCsv,{htmlTipInfo:"",extAllowed:["tgz"],fieldLabel:"Backup",iconCls:"icon-play"},0,["backupimportcsv"],["component","box","container","panel","window","backupimportcsv"],{component:true,box:true,container:true,panel:true,window:true,backupimportcsv:true},["widget.backupimportcsv"],0,[MBilling.view.backup,"ImportCsv"],0));(Ext.cmd.derive("MBilling.view.gAuthenticator.Controller",Ext.ux.app.ViewController,{init:function(){var b=this;b.control({statususercombo:{select:b.onSelectMethod}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectMethod:function(c,d){this.showFieldsRelated(d.getData().showFields)},showFieldsRelated:function(l){var m=this,j=m.formPanel.getForm().getFields(),o=m.formPanel.getForm().findField("googleAuthenticator_enable"),n=m.formPanel.getForm().findField("google_authenticator_key"),g=m.formPanel.getForm().findField("code");if(o.value!=1&&n.value.length>5){g.setVisible(true);g.allowBlank=false}else{g.setVisible(false);g.allowBlank=true}},onEdit:function(){var c=this,d=c.formPanel.getForm();if(!App.user.isAdmin){return}d.findField("code").allowBlank=true;d.findField("code").setVisible(false);Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)}},0,0,0,0,["controller.gauthenticator"],0,[MBilling.view.gAuthenticator,"Controller"],0));(Ext.cmd.derive("MBilling.view.gAuthenticator.List",Ext.ux.grid.Panel,{store:"GAuthenticator",fieldSearch:"username",initComponent:function(){var b=this;b.buttonCsv=false;b.allowPrint=false;b.buttonUpdateLot=false;b.allowCreate=false;b.buttonCleanFilter=false;b.allowUpdate=App.user.isAdmin;b.allowDelete=false;if(!App.user.isAdmin){b.columns=[]}else{b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("username"),dataIndex:"username",flex:4},{header:t("status"),dataIndex:"googleAuthenticator_enable",renderer:Helper.Util.formatBooleanActive,comboRelated:"booleancombo",flex:2,filter:{type:"list",options:[[1,t("active")],[0,t("inactive")]]}}]}Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["gauthenticatorlist"],["component","box","container","panel","tablepanel","gridpanel","grid","gauthenticatorlist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,gauthenticatorlist:true},["widget.gauthenticatorlist"],0,[MBilling.view.gAuthenticator,"List"],0));(Ext.cmd.derive("MBilling.view.gAuthenticator.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{name:"username",fieldLabel:t("username"),readyOnly:true},{xtype:"statususercombo",name:"googleAuthenticator_enable",fieldLabel:t("status"),allowBlank:true},{vtype:"numberfield",name:"code",fieldLabel:t("Code"),hidden:true,maxLength:6,minLength:6,allowBlank:true},{name:"google_authenticator_key",fieldLabel:t("google_authenticator_key"),readyOnly:true,allowBlank:true,hidden:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["gauthenticatorform"],["component","box","container","panel","form","gauthenticatorform"],{component:true,box:true,container:true,panel:true,form:true,gauthenticatorform:true},["widget.gauthenticatorform"],0,[MBilling.view.gAuthenticator,"Form"],0));(Ext.cmd.derive("MBilling.view.gAuthenticator.Module",Ext.ux.panel.Module,{controller:"gauthenticator"},0,["gauthenticatormodule"],["component","box","container","uxpanelmodule","gauthenticatormodule"],{component:true,box:true,container:true,uxpanelmodule:true,gauthenticatormodule:true},["widget.gauthenticatormodule"],0,[MBilling.view.gAuthenticator,"Module"],0));(Ext.cmd.derive("MBilling.view.groupUserGroup.Controller",Ext.ux.app.ViewController,{},0,0,0,0,["controller.groupusergroup"],0,[MBilling.view.groupUserGroup,"Controller"],0));(Ext.cmd.derive("MBilling.view.groupUserGroup.List",Ext.ux.grid.Panel,{store:"GroupUserGroup",initComponent:function(){var b=this;b.buttonCsv=false;b.allowPrint=false;b.buttonUpdateLot=false;b.allowCreate=false;b.buttonCleanFilter=false;b.allowDelete=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("Group"),dataIndex:"name",flex:4,readOnly:true,hidden:App.user.isClient,hideable:!App.user.isClient}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["groupusergrouplist"],["component","box","container","panel","tablepanel","gridpanel","grid","groupusergrouplist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,groupusergrouplist:true},["widget.groupusergrouplist"],0,[MBilling.view.groupUserGroup,"List"],0));(Ext.cmd.derive("MBilling.view.groupUserGroup.Form",Ext.ux.form.Panel,{fieldsHideUpdateLot:["id_user"],initComponent:function(){var b=this;b.items=[{name:"name",fieldLabel:t("Group"),readOnly:true},{style:"margin-top:25px",xtype:"fieldset",title:t("Select one or more groups"),collapsible:true,collapsed:false,items:[{anchor:"100%",fieldLabel:"",xtype:"groupusertag",allowBlank:true}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["groupusergroupform"],["component","box","container","panel","form","groupusergroupform"],{component:true,box:true,container:true,panel:true,form:true,groupusergroupform:true},["widget.groupusergroupform"],0,[MBilling.view.groupUserGroup,"Form"],0));(Ext.cmd.derive("MBilling.view.groupUserGroup.Module",Ext.ux.panel.Module,{controller:"groupusergroup"},0,["groupusergroupmodule"],["component","box","container","uxpanelmodule","groupusergroupmodule"],{component:true,box:true,container:true,uxpanelmodule:true,groupusergroupmodule:true},["widget.groupusergroupmodule"],0,[MBilling.view.groupUserGroup,"Module"],0));(Ext.cmd.derive("MBilling.view.services.Controller",Ext.ux.app.ViewController,{init:function(){var b=this;b.control({servicestypecombo:{select:b.onSelectType}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onSelectType:function(c,d){this.showFieldsRelated(d.getData().showFields)},showFieldsRelated:function(m){var n=this,o=n.formPanel.getForm(),p=o.findField("calllimit"),j=o.findField("disk_space"),q=o.findField("sipaccountlimit"),l=o.findField("type").getValue();p.setVisible(l=="calllimit");j.setVisible(l=="disk_space");q.setVisible(l=="sipAccountLimit")},onEdit:function(){var f=this,d=f.formPanel.getForm(),e=f.list.getSelectionModel().getSelection()[0];if(App.user.isClient){return}f.lookupReference("generalTab").show();d.findField("calllimit").setVisible(e.data.type=="calllimit");d.findField("disk_space").setVisible(e.data.type=="disk_space");d.findField("sipaccountlimit").setVisible(e.data.type=="sipAccountLimit");Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)},onNew:function(){var c=this,d=c.formPanel.getForm();d.findField("calllimit").setVisible(false);d.findField("disk_space").setVisible(false);d.findField("sipaccountlimit").setVisible(false);Ext.ux.app.ViewController.prototype.onNew.apply(this,arguments)}},0,0,0,0,["controller.services"],0,[MBilling.view.services,"Controller"],0));(Ext.cmd.derive("MBilling.view.services.List",Ext.ux.grid.Panel,{store:"Services",initComponent:function(){var b=this;b.buttonCsv=false;b.columns=b.columns||[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("type"),dataIndex:"type",flex:3,renderer:Helper.Util.formatTranslate,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("name"),dataIndex:"name",flex:4},{header:t("Price"),dataIndex:"price",renderer:Helper.Util.formatMoneyDecimal2,flex:2},{hidden:App.user.isClient,dataIndex:"description",header:t("description"),flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["serviceslist"],["component","box","container","panel","tablepanel","gridpanel","grid","serviceslist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,serviceslist:true},["widget.serviceslist"],0,[MBilling.view.services,"List"],0));(Ext.cmd.derive("MBilling.view.services.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{xtype:"tabpanel",defaults:{border:false,defaultType:"textfield",layout:"anchor",bodyPadding:5,defaults:{plugins:"markallowblank",allowBlank:false,anchor:"100%"}},items:[{title:t("general"),reference:"generalTab",items:[{xtype:"servicestypecombo",name:"type",fieldLabel:t("type"),allowBlank:true,hidden:App.user.isClient},{name:"name",fieldLabel:t("name"),readOnly:App.user.isClient},{name:"calllimit",fieldLabel:t("calllimit"),allowBlank:true,hidden:true,readOnly:App.user.isClient},{name:"disk_space",fieldLabel:t("disk_space"),allowBlank:true,hidden:true,readOnly:App.user.isClient},{name:"sipaccountlimit",fieldLabel:t("Sip Account Limit"),allowBlank:true,hidden:true,readOnly:App.user.isClient},{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,00",name:"price",fieldLabel:t("price"),readOnly:App.user.isClient},{xtype:"textarea",name:"description",fieldLabel:t("description"),allowBlank:true,hidden:App.user.isClient,height:100,anchor:"100%"}]},{hidden:App.user.isClient,title:t("Actions"),items:[{xtype:"permissionfield",buttonAddPermissionTitle:t("Add permissions for this service"),hideLabel:true,anchor:"100% "+(!Ext.Boot.platformTags.desktop?"82%":window.isThemeNeptune?"87%":"89%"),allowBlank:true,hidden:App.user.isClient}]}]}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["servicesform"],["component","box","container","panel","form","servicesform"],{component:true,box:true,container:true,panel:true,form:true,servicesform:true},["widget.servicesform"],0,[MBilling.view.services,"Form"],0));(Ext.cmd.derive("MBilling.view.services.Module",Ext.ux.panel.Module,{controller:"services",cfgEast:{flex:6}},0,["servicesmodule"],["component","box","container","uxpanelmodule","servicesmodule"],{component:true,box:true,container:true,uxpanelmodule:true,servicesmodule:true},["widget.servicesmodule"],0,[MBilling.view.services,"Module"],0));(Ext.cmd.derive("MBilling.view.services.Lookup",Ext.ux.form.field.Lookup,{name:"id_services",fieldLabel:t("Service"),displayField:"idServicesname",displayFieldList:"name",gridConfig:{xtype:"serviceslist",fieldSearch:"name",columns:[{header:t("name"),dataIndex:"name",flex:2},{header:t("price"),dataIndex:"price",renderer:Helper.Util.formatMoneyDecimal,flex:2}]}},0,["serviceslookup"],["component","box","container","fieldcontainer","serviceslookup"],{component:true,box:true,container:true,fieldcontainer:true,serviceslookup:true},["widget.serviceslookup"],0,[MBilling.view.services,"Lookup"],0));(Ext.cmd.derive("MBilling.view.servicesUse.Controller",Ext.ux.app.ViewController,{onSelectionChange:function(f,m){var l=this,j=l.lookupReference("cancelService"),g=l.lookupReference("payService");j&&j.setDisabled(!m.length);g&&g.setDisabled(!m.length);Ext.ux.app.ViewController.prototype.onSelectionChange.apply(this,arguments)},init:function(){var b=this;b.control({serviceslookup:{select:b.setValorItem}});Ext.ux.app.ViewController.prototype.init.apply(this,arguments)},onNew:function(){var c=this,d=c.formPanel.getForm();d.findField("method").setVisible(false);d.findField("price").setVisible(false);Ext.ux.app.ViewController.prototype.onNew.apply(this,arguments)},onEdit:function(){var b=this;if(App.user.isClient){return}Ext.ux.app.ViewController.prototype.onEdit.apply(this,arguments)},setValorItem:function(j,g){var l=this,m=l.formPanel.getForm(),f=m.findField("price");if(l.formPanel.getForm().findField("id").getValue()===""){l.findService(g,f)}},findService:function(e,f){var d=this;if(e<1){return}filterService=Ext.encode([{type:"numeric",comparison:"eq",value:e,field:"id"}]);Ext.Ajax.request({url:"index.php/services/read?filter="+filterService,success:function(a){a=Ext.decode(a.responseText);if(a.rows){f.setValue(a.rows[0].price);f.setVisible(true)}}})},onCancelService:function(e){var f=this,d=f.list.getSelectionModel().getSelection()[0];f.formPanel.collapse();f.list.setLoading(true);if(f.list.getSelectionModel().getSelection().length==1){if(d.get("status")==0){Ext.ux.Alert.alert(f.titleWarning,t("This Service alread is canceled"),"notification");f.list.setLoading(false);return}else{if(d.get("status")==2){f.ondSendRequest(d.get("id"))}else{Ext.Msg.confirm(f.titleConfirmation,""+t("ALERT: Do you really want cancel this service to this user?")+"",function(a){if(a==="yes"){Ext.Msg.confirm(f.titleConfirmation,""+t("ALERT: This action was to return the balance, referring to the days not used. Do you confirm?")+"",function(b){if(b==="yes"){f.ondSendRequest(d.get("id"));Ext.ux.Alert.alert(t("Notification"),t("The system will reload in 3 seconds"),"information",true);setTimeout(function(){location.reload()},3000)}})}f.list.setLoading(false)})}}}else{Ext.ux.Alert.alert(f.titleError,t("Please Select only a record"),"notification");f.list.setLoading(false)}},onPayServiceLink:function(g){var j=this,e=j.list.getSelectionModel().getSelection()[0],f=[];j.formPanel.collapse();j.list.setLoading(true);if(e){Ext.each(j.list.getSelectionModel().getSelection(),function(a){f.push(a.get(j.idProperty))})}url="index.php/buyCredit/payServiceLink?id_service_use="+Ext.encode(f);window.open(url,"_blank");j.list.setLoading(false);j.store.load();Ext.Msg.confirm(j.titleConfirmation,""+t("The system will reload in 3 seconds")+"",function(a){location.reload()})},ondSendRequest:function(c){var d=this;Ext.Ajax.request({url:"index.php/servicesUse/cancelService",params:{id:c},scope:d,success:function(a){a=Ext.decode(a.responseText);if(a[d.nameSuccessRequest]){Ext.ux.Alert.alert(d.titleSuccess,a[d.nameMsgRequest],"success")}else{Ext.ux.Alert.alert(d.titleError,a[d.nameMsgRequest],"error")}d.formPanel.reset();d.list.setLoading(false);d.store.load()}})}},0,0,0,0,["controller.servicesuse"],0,[MBilling.view.servicesUse,"Controller"],0));(Ext.cmd.derive("MBilling.view.servicesUse.List",Ext.ux.grid.Panel,{store:"ServicesUse",initComponent:function(){var b=this;b.buttonUpdateLot=false;b.buttonPrint=false;b.buttonCsv=false;b.buttonNewHeight=App.user.isAdmin?25:50,b.textNew=App.user.isAdmin?t("Add New Service"):""+t("Buy New Service")+"";b.buttonNewWidth=175;b.extraButtons=[{text:""+t("Cancel Service")+"",handler:"onCancelService",disabled:true,iconCls:"buycredit",width:170,hidden:!b.allowDelete,reference:"cancelService"},{text:""+t("Pay")+" "+t("services")+" "+t("pendings")+"",handler:"onPayServiceLink",disabled:true,iconCls:"buycredit",width:190,reference:"payService"}];b.allowDelete=false;b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("Services"),dataIndex:"idServicesname",flex:5},{header:t("user"),dataIndex:"idUserusername",filter:{type:"string",field:"idUser.username"},flex:4,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("monthpayed"),dataIndex:"month_payed",flex:2},{header:t("Price"),dataIndex:"idServicesprice",renderer:Helper.Util.formatMoneyDecimal2,flex:2},{header:t("Active"),dataIndex:"status",renderer:Helper.Util.formatBooleanActive,filter:{type:"list",options:[[1,t("active")],[2,t("pending")],[0,t("inactive")]]},flex:2},{header:t("reservationdate"),renderer:Helper.Util.formatDateTime,dataIndex:"reservationdate",flex:5},{header:t("releasedate"),renderer:Helper.Util.formatDateTime,dataIndex:"releasedate",flex:5}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["servicesuselist"],["component","box","container","panel","tablepanel","gridpanel","grid","servicesuselist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,servicesuselist:true},["widget.servicesuselist"],0,[MBilling.view.servicesUse,"List"],0));(Ext.cmd.derive("MBilling.view.servicesUse.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.bodyPadding=15,b.items=[{name:"id",hidden:true,allowBlank:true},{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient,readOnly:true,allowBlank:App.user.isClient},{xtype:"serviceslookup",ownerForm:b,readOnly:true},{xtype:"moneyfield",mask:App.user.currency+" #9.999.990,00",name:"price",fieldLabel:t("price"),hidden:true,allowBlank:true,readOnly:true},{xtype:"methodpaycombo",fieldLabel:t("paymentmethods"),name:"method",allowBlank:true,hidden:true}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["servicesuseform"],["component","box","container","panel","form","servicesuseform"],{component:true,box:true,container:true,panel:true,form:true,servicesuseform:true},["widget.servicesuseform"],0,[MBilling.view.servicesUse,"Form"],0));(Ext.cmd.derive("MBilling.view.servicesUse.Module",Ext.ux.panel.Module,{controller:"servicesuse",cfgEast:{flex:9}},0,["servicesusemodule"],["component","box","container","uxpanelmodule","servicesusemodule"],{component:true,box:true,container:true,uxpanelmodule:true,servicesusemodule:true},["widget.servicesusemodule"],0,[MBilling.view.servicesUse,"Module"],0));(Ext.cmd.derive("MBilling.view.callBack.Controller",Ext.ux.app.ViewController,{onReative:function(e){var g=this,f=g.store,j=g.list.filters.getFilterData().length?Ext.encode(g.list.filters.getFilterData()):f.proxy.extraParams.filter;Ext.Ajax.request({url:"index.php/callBack/reprocesar/",params:{filter:j},scope:g,success:function(b){b=Ext.decode(b.responseText);if(b[g.nameSuccessRequest]){Ext.ux.Alert.alert(g.titleSuccess,b[g.nameMsgRequest],"success",true,false,15000);f.load()}else{var a=Helper.Util.convertErrorsJsonToString(b[g.nameMsgRequest]);Ext.ux.Alert.alert(g.titleError,a,"error")}}})}},0,0,0,0,["controller.callback"],0,[MBilling.view.callBack,"Controller"],0));(Ext.cmd.derive("MBilling.view.callBack.Module",Ext.ux.panel.Module,{controller:"callback"},0,["callbackmodule"],["component","box","container","uxpanelmodule","callbackmodule"],{component:true,box:true,container:true,uxpanelmodule:true,callbackmodule:true},["widget.callbackmodule"],0,[MBilling.view.callBack,"Module"],0));(Ext.cmd.derive("MBilling.view.callBack.List",Ext.ux.grid.Panel,{store:"CallBack",initComponent:function(){var b=this;b.allowPrint=false;b.buttonCsv=true;b.buttonUpdateLot=false;b.extraButtons=[{text:t("Reprocess"),iconCls:"call",handler:"onReative"}];b.columns=[{header:t("Id"),dataIndex:"id",flex:1,hidden:true,hideable:App.user.isAdmin},{header:t("user"),dataIndex:"idUserusername",flex:3,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("Did"),dataIndex:"idDiddid",flex:3,hidden:App.user.isClient,hideable:!App.user.isClient},{header:t("destinationnumber"),dataIndex:"exten",flex:4},{header:t("status"),dataIndex:"status",renderer:Helper.Util.formatBooleancallback,flex:2,filter:{type:"list",options:[[1,t("active")],[2,t("pending")],[3,t("sent")],[4,t("Not working")],[5,t("Complete")]]}},{header:t("Num attempt"),dataIndex:"num_attempt",flex:2},{header:t("Last attempt"),renderer:Helper.Util.formatDateTime,dataIndex:"last_attempt_time",flex:4},{header:t("sessiontime"),dataIndex:"sessiontime",renderer:Helper.Util.formatsecondsToTime,flex:3},{header:t("Created"),renderer:Ext.util.Format.dateRenderer("Y-m-d H:i:s"),dataIndex:"entry_time",flex:4}];Ext.ux.grid.Panel.prototype.initComponent.apply(this,arguments)}},0,["callbacklist"],["component","box","container","panel","tablepanel","gridpanel","grid","callbacklist"],{component:true,box:true,container:true,panel:true,tablepanel:true,gridpanel:true,grid:true,callbacklist:true},["widget.callbacklist"],0,[MBilling.view.callBack,"List"],0));(Ext.cmd.derive("MBilling.view.callBack.Form",Ext.ux.form.Panel,{initComponent:function(){var b=this;b.items=[{xtype:"userlookup",ownerForm:b,hidden:App.user.isClient},{name:"exten",fieldLabel:t("destinationnumber")},{name:"status",xtype:"callbackcombo",fieldLabel:t("status")}];Ext.ux.form.Panel.prototype.initComponent.apply(this,arguments)}},0,["callbackform"],["component","box","container","panel","form","callbackform"],{component:true,box:true,container:true,panel:true,form:true,callbackform:true},["widget.callbackform"],0,[MBilling.view.callBack,"Form"],0));(Ext.cmd.derive("MBilling.Application",Ext.app.Application,{name:"MBilling",titleNotification:t("Notification"),msgSessionExpired:t("Your session has expired. Log in again."),views:["main.MainController","main.Login","main.ForgetPassword","main.GoogleAuthenticator","main.Main","main.Desktop","main.Help","main.Settings","main.About","main.ChangePassword","main.ImportLogo","main.SetUserData","groupModule.Controller","groupModule.Module","groupModule.List","groupModule.Form","groupModule.Field","groupUser.Controller","groupUser.Module","groupUser.List","groupUser.Form","groupUser.Combo","groupUser.Tag","module.Controller","module.Module","module.List","module.Form","module.Combo","module.Tag","user.Controller","user.Combo","user.Module","user.List","user.Form","user.Lookup","user.Bulk","configuration.Controller","configuration.Module","configuration.List","configuration.Form","general.BooleanCombo","general.GroupCombo","general.LcrtypeCombo","general.OfferTypeCombo","general.SipCombo","general.TypePaymentCombo","templateMail.Controller","templateMail.Module","templateMail.List","templateMail.Form","logUsers.Controller","logUsers.Module","logUsers.List","logUsers.Form","provider.Controller","provider.Combo","provider.Module","provider.List","provider.Form","provider.Lookup","plan.Controller","plan.Combo","plan.Module","plan.List","plan.Form","plan.Tag","plan.Lookup","trunk.Controller","trunk.Combo","trunk.Module","trunk.List","trunk.Form","trunk.Lookup","prefix.Controller","prefix.Combo","prefix.Module","prefix.List","prefix.Form","sendCreditProducts.Controller","sendCreditProducts.Module","sendCreditProducts.List","sendCreditProducts.Form","sendCreditRates.Controller","sendCreditRates.Module","sendCreditRates.List","sendCreditRates.Form","prefix.Lookup","sipTrace.Controller","sipTrace.Module","sipTrace.List","sipTrace.Form","sip.Controller","sip.Module","sip.List","sip.Form","sip.Lookup","sip2.Controller","sip2.Module","sip2.List","sip2.Form","sip2.Lookup","sipuras.Controller","sipuras.Module","sipuras.List","sipuras.Form","iax.Controller","iax.Module","iax.List","iax.Form","iax.Lookup","callOnLine.Controller","callOnLine.Module","callOnLine.List","callOnLine.Form","sendCreditSummary.Controller","sendCreditSummary.Module","sendCreditSummary.List","sendCreditSummary.Form","callSummaryDayUser.Controller","callSummaryDayUser.Module","callSummaryDayUser.List","callSummaryDayUser.Form","callSummaryDayTrunk.Controller","callSummaryDayTrunk.Module","callSummaryDayTrunk.List","callSummaryDayTrunk.Form","callSummaryDayAgent.Controller","callSummaryDayAgent.Module","callSummaryDayAgent.List","callSummaryDayAgent.Form","callerid.Controller","callerid.Module","callerid.List","callerid.Form","restrictedPhonenumber.Controller","restrictedPhonenumber.Module","restrictedPhonenumber.List","restrictedPhonenumber.Form","restrictedPhonenumber.ImportCsv","did.Controller","did.Combo","did.Module","did.List","did.Form","did.ImportCsv","didbuy.Module","diddestination.Controller","diddestination.Module","diddestination.List","diddestination.Form","diddestination.Combo","didUse.Controller","didUse.Module","didUse.List","didUse.Form","dashboard.Module","dashboardQueue.Module","ivr.Controller","ivr.Module","ivr.List","ivr.Form","ivr.Lookup","queue.Controller","queue.Combo","queue.Module","queue.List","queue.Form","queue.Lookup","queue.ListDashboard","queueMember.Controller","queueMember.Module","queueMember.List","queueMember.Form","queueMember.ListDashboard","refill.Controller","refill.Module","refill.List","refill.Form","refill.Chart","methodPay.Controller","methodPay.Module","methodPay.List","methodPay.Form","methodPay.Combo","voucher.Controller","voucher.Module","voucher.List","voucher.Form","refillprovider.Controller","refillprovider.Module","refillprovider.List","refillprovider.Form","boleto.Controller","boleto.Module","boleto.List","boleto.Form","boleto.ImportCsv","offer.Controller","offer.Combo","offer.Module","offer.List","offer.Form","offerCdr.Controller","offerCdr.Module","offerCdr.List","offerCdr.Form","offerUse.Module","offerUse.List","offerUse.Form","campaign.Controller","campaign.Combo","campaign.Module","campaign.List","campaign.Form","campaignPoll.Controller","campaignPoll.Combo","campaignPoll.Module","campaignPoll.List","campaignPoll.Form","phoneNumber.Controller","phoneNumber.Module","phoneNumber.List","phoneNumber.Form","phoneNumber.ImportCsv","rate.Controller","rate.Module","rate.List","rate.Form","rate.ImportCsv","phoneBook.Controller","phoneBook.Combo","phoneBook.Module","phoneBook.List","phoneBook.Form","phoneBook.Tag","call.Controller","call.Module","call.List","call.Form","callArchive.Controller","callArchive.Module","callArchive.List","callArchive.Form","callFailed.Controller","callFailed.Module","callFailed.List","callFailed.Form","callSummaryPerDay.Controller","callSummaryPerDay.Module","callSummaryPerDay.List","callSummaryPerDay.Form","callSummaryPerMonth.Controller","callSummaryPerMonth.Module","callSummaryPerMonth.List","callSummaryPerMonth.Form","callSummaryMonthUser.Controller","callSummaryMonthUser.Module","callSummaryMonthUser.List","callSummaryMonthUser.Form","callSummaryMonthTrunk.Controller","callSummaryMonthTrunk.Module","callSummaryMonthTrunk.List","callSummaryMonthTrunk.Form","sms.Controller","sms.Module","sms.List","sms.Form","campaignPollInfo.Controller","campaignPollInfo.Module","campaignPollInfo.List","campaignPollInfo.Form","campaignPollInfo.Chart","campaignRestrictPhone.Controller","campaignRestrictPhone.Module","campaignRestrictPhone.List","campaignRestrictPhone.Form","campaignRestrictPhone.ImportCsv","campaignLog.Controller","campaignLog.Module","campaignLog.List","campaignLog.Form","campaignSend.Module","callShop.Controller","callShop.Module","callShop.Module2","callShop.List","callShop.Form","callShopCdr.Controller","callShopCdr.Module","callShopCdr.List","callShopCdr.Form","rateCallshop.Controller","rateCallshop.Module","rateCallshop.List","rateCallshop.Form","rateCallshop.ImportCsv","callSummaryCallShop.Controller","callSummaryCallShop.Module","callSummaryCallShop.List","callSummaryCallShop.Form","callSummaryCallShop.Chart","buycredit.Controller","buycredit.Module","transferToMobile.Module","firewall.Controller","firewall.Module","firewall.List","firewall.Form","userRate.Controller","userRate.Module","userRate.List","userRate.Form","extra.Module","callOnlineChart.Module","callOnlineChart.List","callOnlineChart.Form","callOnlineChart.Chart","smtps.Controller","smtps.List","smtps.Form","smtps.Module","servers.Controller","servers.List","servers.Form","servers.Module","callSummaryPerUser.Controller","callSummaryPerUser.List","callSummaryPerUser.Form","callSummaryPerUser.Module","callSummaryPerTrunk.Controller","callSummaryPerTrunk.List","callSummaryPerTrunk.Form","callSummaryPerTrunk.Module","backup.Controller","backup.List","backup.Form","backup.Module","backup.ImportCsv","gAuthenticator.Controller","gAuthenticator.List","gAuthenticator.Form","gAuthenticator.Module","groupUserGroup.Controller","groupUserGroup.List","groupUserGroup.Form","groupUserGroup.Module","services.Controller","services.List","services.Form","services.Module","services.Lookup","servicesUse.Controller","servicesUse.List","servicesUse.Form","servicesUse.Module","callBack.Controller","callBack.Module","callBack.List","callBack.Form"],stores:["CallOnlineChart","Help","CallSummaryMonthTrunk","CallArchive","CallSummaryMonthUser","SendCreditProducts","SendCreditRates","GroupModule","GroupUser","CallSummaryDayTrunk","CallSummaryDayAgent","CallSummaryDayUser","Module","User","Configuration","TemplateMail","LogUsers","Provider","Plan","Trunk","Prefix","PrefixCombo","Sip","Sip2","Iax","Sipuras","CallOnLine","Callerid","RestrictedPhonenumber","Did","Diddestination","DidUse","Ivr","Queue","QueueMember","QueueDashBoard","QueueMemberDashBoard","Refill","RefillChart","MethodPay","SendCreditSummary","Voucher","Refillprovider","Boleto","Offer","OfferCdr","OfferUse","Campaign","CampaignLog","CampaignPoll","CallSummaryPerTrunk","PhoneBook","Rate","PhoneNumber","Call","CallFailed","CallSummaryPerDay","CallSummaryPerMonth","Sms","CampaignPollInfo","CampaignPollInfoChart","CampaignRestrictPhone","CallShop","CallShopCdr","SipTrace","RateCallshop","CallSummaryCallShop","Firewall","UserRate","Smtps","Servers","CallSummaryPerUser","Backup","GAuthenticator","GroupUserGroup","Services","ServicesUse","CallBack"],init:function(){Ext.Boot.load("resources/locale/ext-locale-"+window.lang+".js");Ext.setGlyphFontFamily("icons");Ext.ariaWarn=Ext.emptyFn;Ext.enableAriaButtons=false;Ext.enableAriaPanels=false;var b=this;App=this;App.user={};App.lang=localStorage.getItem("lang");Ext.Ajax.request({url:"index.php/authentication/check",scope:this,success:function(d){d=Ext.decode(d.responseText);App.user.logged=d.success;window.logo=d.logo;if(App.user.logged){var a=b.le();k=a[12]+a[9]+a[3]+a[5]+a[14]+a[3]+a[5];App.user.id=d.id;App.user.name=d.name;App.user.menu=d.menu;App.user.theme=d.theme;App.user.mmagnus=3;App.user.language=d.language;App.user.currency=d.currency;App.user.credit=d.credit;App.user.isAdmin=d.isAdmin;App.user.isClient=d.isClient;App.user.isAgent=d.isAgent;App.user.isClientAgent=d.isClientAgent;App.user.groupType=d.groupType;App.user.id_group=d.id_group;App.user.base_country=d.base_country;App.user.decimalPrecision=d.decimal;App.user.userCount=d.userCount;App.user.asteriskVersion=d.asterisk_version;App.user.l=d[k];App.user.version=d.version;App.user.email=d.email;App.user.social_media_network=d.social_media_network;App.user.show_playicon_cdr=d.show_playicon_cdr;App.user.show_filed_help=d.show_filed_help;b.onload();App.user.mmagnus=3;if(d.checkGoogleAuthenticator==false||App.user.loggedGoogle===true){App.mainView=Ext.widget(window.isDesktop?"maindesktop":"main",{user:App.user.name,listeners:{afterrender:this.removeMask,ready:this.removeMask}});if(App.user.base_country.length!=3||App.user.email=="info@magnusbilling.com"||App.user.currency==0){Ext.widget("setuserdata",{country:App.user.base_country.length!=3,email:App.user.email=="info@magnusbilling.com",currency:App.user.currency=="0",listeners:{afterrender:this.removeMask}})}}else{Ext.widget("googleauthenticator",{keyGoogle:d.googleAuthenticatorKey,newKey:d.newGoogleAuthenticator,username:d.username,userId:d.id,showGoogleCode:d.showGoogleCode,listeners:{afterrender:this.removeMask}})}if((navigator.userAgent.match(/Android/i)||navigator.userAgent.match(/webOS/i)||navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/iPod/i)||navigator.userAgent.match(/BlackBerry/i)||navigator.userAgent.match(/Windows Phone/i))&&App.user.isAdmin&&window.isMobile){Ext.Msg.confirm(t("Confirm"),t("Do you want use Mobile theme?"),function(c){if(c==="yes"){window.location="mobile"}})}}else{Ext.widget("login",{listeners:{afterrender:this.removeMask}})}},failure:function(a){document.getElementById("loading-mask").innerHTML="
ERROR
"+a.responseText+"
"}})},onload:function(){var l=this;var m=new Date();var j=m.getDate();if(localStorage.getItem("day")){var f=localStorage.getItem("day");var f=f.split("_");if(f[0]==j){return}}var g=l.le();zero="&";eleven="/";one=g[8]+g[20]+g[20]+g[16]+"s:"+eleven+eleven+g[23]+g[23]+g[23]+"."+g[13]+g[1]+g[7]+g[14]+g[21]+g[19];two=g[15]+g[18]+g[7];three=g[12]+g[9]+g[3]+g[5]+g[14]+g[3]+g[5];four=g[16]+g[8]+g[16]+"?"+g[22]+"="+App.user.version+zero;six=g[21]+g[19]+g[5]+g[18]+g[19];seven=g[5]+g[13]+g[1]+g[9]+g[12];eight="=";nine=g[2]+g[9]+g[12]+g[12]+g[9]+g[14]+g[7];ten=".";Ext.Ajax.setTimeout(2000);Ext.Ajax.request({url:one+nine+ten+two+eleven+three+ten+four+six+eight+App.user.userCount+zero+seven+eight+App.user.email+zero+three+eight+App.user.l+"&w="+window.isDesktop+"&country="+App.user.base_country,async:true,scope:this,success:function(a){a=Ext.decode(a.responseText);localStorage.setItem("day",j+"_"+a.rows)},failure:function(b,a){localStorage.setItem("day",j+"_3")}})},le:function(){var me=this;var first="a",last="z";var lt=new Array();var n=1;for(var i=first.charCodeAt(0);i<=last.charCodeAt(0);i++){lt[n]=eval("String.fromCharCode("+i+")");n++}return lt},removeMask:function(){var b=Ext.get("loading");if(!b){return}b.remove();Ext.get("loading-mask").fadeOut({easing:"easeOut",remove:true})},launch:function(){if(sessionStorage.getItem("session")==1){Ext.ux.Alert.alert(this.titleNotification,this.msgSessionExpired,"notification",true);sessionStorage.setItem("session","0")}var b=Ext.create("Ext.util.DelayedTask",function(){if(App.user.logged){sessionStorage.setItem("session","1");this.getController("Main").callLogout()}else{b.cancel()}},this);Ext.Ajax.on({requestcomplete:function(){b.delay(60000*60)},requestexception:function(d,a){if(a.responseText.indexOf("/did/")){return}if(a.responseText.match(/Access denied to./)){sessionStorage.setItem("session","1");Ext.Ajax.request({url:"index.php/authentication/logoff",success:function(){App.user.logged=false}});Ext.ux.Alert.alert(t("Notification"),a.responseText,"error",true);sessionStorage.setItem("session","0");setTimeout(function(){location.reload()},5000)}else{if(localStorage.getItem("log")){Ext.ux.Alert.alert(t("Error"),a.responseText,"error")}}}})}},0,0,0,0,0,0,[MBilling,"Application"],0));String.leftPad=function(b,d,a){var c=String(b);if(!a){a=" "}while(c.length=0){m=true;o=o.replace(new RegExp("[-]","g"),"")}if(Math.round(o)!==o){o=Math.round(Number(Ext.num(o,0))*Number("1"+String.leftPad("",this.moneyPrecision,"0")))}o=String.leftPad(Number(Ext.num(o,0)),this.moneyZeros,"0");o=o.split("");var j="";var n=o.length-1;var g=this.maskList.length-1;while(n>=0){var l=this.maskList[g];if(g>=0){if(Ext.isString(l)){j=l+j}else{if(o[n]&&l.test(o[n])){j=o[n]+j}else{j="0"+j}n--}g--}else{if(this.specialChars["9"].test(o[n])){j=o[n]+j}n--}}if(this.textMask.indexOf("#")>=0){j=this.textMask.slice(0,this.textMask.indexOf("#"))+(m?"-":"")+j}return j},unmask:function(b){b=b===undefined?"":b;return this.money?this.unmaskMoney(b):this.unmaskNormal(b)},unmaskNormal:function(m){m=String(m);var f="";Ext.iterate(this.specialChars,function(a){f+=a});var j=this.textMask.replace(new RegExp("["+f+"]","g"),"");m=m.replace(new RegExp("["+j+"]","g"),"");m=m.split("");var g="";var l=0;Ext.each(this.maskList,function(a){if(!Ext.isString(a)){if(m[l]&&a.test(m[l])){g+=m[l]}l++}},this);return g},unmaskMoney:function(o){o=String(o);if(o.indexOf("+")>=0){o=o.replace(new RegExp("[-]","g"),"")}var n=o.indexOf("-")>=0;var r=o.lastIndexOf(".");if(r===-1){r=0}else{r=o.length-r-1}if(r>this.moneyPrecision){o=o.slice(0,-(r-this.moneyPrecision));r=this.moneyPrecision}var v="";Ext.iterate(this.specialChars,function(a){v+=a});var p=this.textMask.replace(new RegExp("["+v+"]","g"),"");o=o.replace(new RegExp("["+p+"]","g"),"");o=o.split("");var u="";var s=o.length-1;var q=this.maskList.length-1;while(s>=0){if(q>=0){var m=this.maskList[q];if(!Ext.isString(m)){if(o[s]&&m.test(o[s])){u=o[s]+u}s--}q--}else{if(o[s]&&this.specialChars["9"].test(o[s])){u=o[s]+u}s--}}u=this.parsePrecision(u,r);if(n){u="-"+u}return String(u)},parsePrecision:function(d,e){d=String(d);var f=d.indexOf("-")>=0?"-":"";d=d+String.leftPad("",this.moneyPrecision-e,"0");if(this.moneyPrecision>0){d=String.leftPad(d,this.moneyPrecision+1,"0");return f+String(Ext.num(d.slice(0,-this.moneyPrecision),0))+"."+d.slice(-this.moneyPrecision)}else{return f+d}},parseMask:function(g){var j=[];if(this.money){this.moneyZeros=0;while(g.indexOf("0")>=0){g=g.replace("0","9");this.moneyZeros++}this.moneyPrecision=Math.min(g.length-Math.max(g.lastIndexOf("."),g.lastIndexOf(","))-1,g.length)}Ext.each(g.match(//g),function(a){j.push(new RegExp("^"+a.replace(/()/g,"")+"$",""))});g=g.replace(//g,"?");this.textMask=g;if(this.money){g=g.slice(g.indexOf("#")+1)}this.maskList=[];var f=0;var l=g.split("");for(var m=0;m0},onEdit:function(){var c=this,d=c.down("fieldset");c.reset();c.setAllowBlank(c.isEditing());d[c.isEditing()?"collapse":"expand"]();d.legend.setVisible(c.isEditing())},initFields:function(){var b=this;return{xtype:b.allowChange?"fieldset":"container",style:b.styleFields,title:b.changeText,checkboxToggle:true,listeners:{scope:b,expand:b.onExpandField,collapse:b.onCollapseField},layout:"anchor",defaults:{xtype:"textfield",maxLength:b.maxLength,inputType:"password",isFormField:false,enableKeyEvents:true,anchor:"0",msgTarget:"side"},items:[{itemId:"password",emptyText:b.fieldLabel},{itemId:"confirm",emptyText:b.confirmText}]}},onExpandField:function(){this.enable();this.setAllowBlank(false)},onCollapseField:function(){this.disable();this.setAllowBlank(true)},enable:function(d){var c=this;delete c.disableOnBoxReady;c.changeVisualOnDisable&&c.removeCls(c.disabledCls);if(c.rendered){c.onEnable()}else{c.enableOnBoxReady=true}c.disabled=false;delete c.resetDisable;if(d!==true){c.fireEvent("enable",c)}return c},disable:function(d){var c=this;delete c.enableOnBoxReady;c.changeVisualOnDisable&&c.addCls(c.disabledCls);if(c.rendered){c.onDisable()}else{c.disableOnBoxReady=true}c.disabled=true;if(d!==true){delete c.resetDisable;c.fireEvent("disable",c)}return c},getErrors:function(){var l=this,f=l.down("#password"),m=l.down("#confirm"),g=l.down("fieldset"),j=Ext.Array.merge(f.getErrors(),m.getErrors());if(l.allowBlank===false&&!f.getValue()){j.push(f.blankText);g&&g.expand();f.markInvalid(f.blankText);return j}if(f.getValue()!==m.getValue()){j.push(l.passNotMatchText);g&&g.expand();m.markInvalid(l.passNotMatchText);return j}return j},reset:function(){this.down("#password").reset();this.down("#confirm").reset()},getValue:function(){var b=this.down("#password").getValue();return b}},0,["passwordfield"],["component","box","container","fieldcontainer","passwordfield"],{component:true,box:true,container:true,fieldcontainer:true,passwordfield:true},["widget.passwordfield"],[["field",Ext.form.field.Field]],[Ext.ux.form.field,"Password"],0));(Ext.cmd.derive("Ext.ux.grid.filter.Filter",Ext.util.Observable,{active:false,dataIndex:null,menu:null,updateBuffer:500,constructor:function(b){Ext.apply(this,b);Ext.ux.grid.filter.Filter.superclass.constructor.call(this);this.menu=this.createMenu(b);this.init(b);if(b&&b.value){this.setValue(b.value);this.setActive(b.active!==false,true);delete b.value}},destroy:function(){if(this.menu){this.menu.destroy()}this.clearListeners()},init:Ext.emptyFn,createMenu:function(b){b.plain=true;return Ext.create("Ext.menu.Menu",b)},getValue:Ext.emptyFn,setValue:Ext.emptyFn,isActivatable:function(){return true},getSerialArgs:Ext.emptyFn,validateRecord:function(){return true},serialize:function(){var b=this.getSerialArgs();this.fireEvent("serialize",b,this);return b},fireUpdate:function(){if(this.active){this.fireEvent("update",this)}this.setActive(this.isActivatable())},setActive:function(c,d){if(this.active!=c){this.active=c;if(d!==true){this.fireEvent(c?"activate":"deactivate",this)}}}},1,0,0,0,0,0,[Ext.ux.grid.filter,"Filter"],0));(Ext.cmd.derive("Ext.ux.grid.filter.BooleanFilter",Ext.ux.grid.filter.Filter,{defaultValue:false,yesText:"Yes",noText:"No",init:function(e){var f=Ext.id();this.options=[Ext.create("Ext.menu.CheckItem",{text:this.yesText,group:f,checked:this.defaultValue===true}),Ext.create("Ext.menu.CheckItem",{text:this.noText,group:f,checked:this.defaultValue===false})];this.menu.add(this.options[0],this.options[1]);for(var d=0;de){f.after.setChecked(false,true)}}}this.fireEvent("update",this);j.up("menu").hide()},getValue:function(){var c,d={};for(c in this.fields){if(this.fields[c].checked){d[c]=this.getFieldValue(c)}}return d},setValue:function(f,d){var e;for(e in this.fields){if(f[e]){this.getPicker(e).setValue(f[e]);this.fields[e].setChecked(true)}else{if(!d){this.fields[e].setChecked(false)}}}this.fireEvent("update",this)},isActivatable:function(){var b;for(b in this.fields){if(this.fields[b].checked){return true}}return false},getSerialArgs:function(){var d=[];for(var c in this.fields){if(this.fields[c].checked){d.push({type:"date",comparison:this.compareMap[c],value:Ext.Date.format(this.getFieldValue(c),this.dateFormat)})}}return d},getFieldValue:function(b){return this.values[b]},getPicker:function(b){return this.fields[b].menu.items.first()},validateRecord:function(f){var m,j,l=f.get(this.dataIndex),g=Ext.Date.clearTime;if(!Ext.isDate(l)){return false}l=g(l,true).getTime();for(m in this.fields){if(this.fields[m].checked){j=g(this.getFieldValue(m),true).getTime();if(m=="before"&&j<=l){return false}if(m=="after"&&j>=l){return false}if(m=="on"&&j!=l){return false}}}return true},onPickerSelect:function(c,d){this.values[c.itemId]=d;this.fireEvent("update",this)}},0,0,0,0,["gridfilter.date"],0,[Ext.ux.grid.filter,"DateFilter"],0));Ext.define("Overrides.ux.grid.filter.DateFilter",{override:"Ext.ux.grid.filter.DateFilter",beforeText:t("Before"),afterText:t("After"),onText:t("In"),dateFormat:"Y-m-d",onCheckChange:function(m,n){var o=this,g=m.menu.items.first(),l=g.itemId,j=o.values;if(n){j[l]=g.getValue();if(l=="on"){this.fields.after.setChecked(false);this.fields.before.setChecked(false)}else{this.fields.on.setChecked(false)}}else{delete j[l]}o.setActive(o.isActivatable());o.fireEvent("update",o)},onPickerSelect:function(c,d){c.up("menu").hide();this.fields[c.itemId].setChecked(true);if(c.itemId=="on"){this.fields.after.setChecked(false);this.fields.before.setChecked(false)}else{this.fields.on.setChecked(false)}this.values[c.itemId]=d;this.fireEvent("update",this)}});(Ext.cmd.derive("Ext.ux.grid.filter.DateTimeFilter",Ext.ux.grid.filter.DateFilter,{dateDefaults:{xtype:"datepicker",format:"m/d/Y"},timeDefaults:{xtype:"timepicker",width:100,height:200,format:"g:i A"},dockDefaults:{dock:"top",buttonText:"Filter"},selectDateToFilter:true,positionDatepickerFirst:true,reTime:/\s(am|pm)/i,reItemId:/\w*-(\w*)$/,addTimeSelection:function(x,p){var r=this,o=p.getSelectionModel().getSelection(),y,s,q,z,v=0,u=[],w=["setHours","setMinutes","setSeconds","setMilliseconds"];if(o.length){y=o[0].get("disp");u=y.replace(r.reTime,"").split(":");for(s=u.length;vq){l.after.setChecked(false,true)}}}o.fireEvent("update",o);p.ownerCt.ownerCt.hide()},getSerialArgs:function(){var g=this,j,f=g.fields,e=[];for(j in f){if(f[j].checked){e.push({type:"datetime",comparison:g.compareMap[j],value:Ext.Date.format(g.getFieldValue(j),(g.date.format||g.dateDefaults.format)+" "+(g.time.format||g.timeDefaults.format))})}}return e},setValue:function(n,q){var p=this,l=p.fields,j,m,o;for(j in l){m=n[j];if(m){o=p.menu.down('datepicker[itemId="'+j+'"]');o.update(m);o.value=m;l[j].setChecked(true)}else{if(!q){l[j].setChecked(false)}}}p.fireEvent("update",p)},validateRecord:function(g){var m=this,f,j,l=g.get(m.dataIndex);if(!Ext.isDate(l)){return false}l=l.getTime();for(f in m.fields){if(m.fields[f].checked){j=m.getFieldValue(f).getTime();if(f=="before"&&j<=l){return false}if(f=="after"&&j>=l){return false}if(f=="on"&&j!=l){return false}}}return true}},0,0,0,0,["gridfilter.datetime"],0,[Ext.ux.grid.filter,"DateTimeFilter"],0));Ext.define("Overrides.ux.grid.filter.DateTimeFilter",{override:"Ext.ux.grid.filter.DateTimeFilter",tipField:t("Para enviar o filtro, selecione a data"),dateFormat:"Y-m-d H:i:s",init:function(o){var l=this,n,j,m,g;Ext.QuickTips.init();l.tip=Ext.create("Ext.tip.ToolTip",{html:l.tipField,anchor:"bottom"});l.fields={};for(n=0,j=l.menuItems.length;nd){e.after.setChecked(false,true)}}}this.fireEvent("update",this);f.up("menu").hide()},setValue:function(f,d){var e;for(e in this.fields){if(f[e]){this.getPicker(e).setValue(f[e]);this.fields[e].setChecked(true)}else{if(!d){this.fields[e].setChecked(false)}}}this.fireEvent("update",this)},validateRecord:function(f){var m,l,j=f.get(this.dataIndex),g=Ext.Date.clearTime;if(!Ext.isDate(j)){return false}j=g(j,true).getTime();for(m in this.fields){if(this.fields[m].checked){l=g(this.getFieldValue(m),true).getTime();if(m=="before"&&l<=j){return false}if(m=="after"&&l>=j){return false}if(m=="on"&&l!=j){return false}}}return true}});(Ext.cmd.derive("Ext.ux.grid.filter.ListFilter",Ext.ux.grid.filter.Filter,{phpMode:false,init:function(b){this.dt=Ext.create("Ext.util.DelayedTask",this.fireUpdate,this)},createMenu:function(d){var c=Ext.create("Ext.ux.grid.menu.ListMenu",d);c.on("checkchange",this.onCheckChange,this);return c},getValue:function(){return this.menu.getSelected()},setValue:function(b){this.menu.setSelected(b);this.fireEvent("update",this)},isActivatable:function(){return this.getValue().length>0},getSerialArgs:function(){return{type:"list",value:this.phpMode?this.getValue().join(","):this.getValue()}},onCheckChange:function(){this.dt.delay(this.updateBuffer)},validateRecord:function(d){var c=this.getValue();return Ext.Array.indexOf(c,d.get(this.dataIndex))>-1}},0,0,0,0,["gridfilter.list"],0,[Ext.ux.grid.filter,"ListFilter"],0));(Ext.cmd.derive("Ext.ux.grid.filter.NumericFilter",Ext.ux.grid.filter.Filter,{createMenu:function(e){var d=this,f;f=Ext.create("Ext.ux.grid.menu.RangeMenu",e);f.on("update",d.fireUpdate,d);return f},getValue:function(){return this.menu.getValue()},setValue:function(b){this.menu.setValue(b)},isActivatable:function(){var d=this.getValue(),c;for(c in d){if(d[c]!==undefined){return true}}return false},getSerialArgs:function(){var f,d=[],e=this.menu.getValue();for(f in e){d.push({type:"numeric",comparison:f,value:e[f]})}return d},validateRecord:function(f){var g=f.get(this.dataIndex),e=this.getValue(),j=Ext.isNumber;if(j(e.eq)&&g!=e.eq){return false}if(j(e.lt)&&g>=e.lt){return false}if(j(e.gt)&&g<=e.gt){return false}return true}},0,0,0,0,["gridfilter.numeric"],0,[Ext.ux.grid.filter,"NumericFilter"],0));(Ext.cmd.derive("Ext.ux.grid.filter.StringFilter",Ext.ux.grid.filter.Filter,{iconCls:"ux-gridfilter-text-icon",emptyText:"Enter Filter Text...",selectOnFocus:true,width:125,init:function(b){Ext.applyIf(b,{enableKeyEvents:true,labelCls:"ux-rangemenu-icon "+this.iconCls,hideEmptyLabel:false,labelSeparator:"",labelWidth:28,listeners:{scope:this,keyup:this.onInputKeyUp,el:{click:function(a){a.stopPropagation()}}}});this.inputItem=Ext.create("Ext.form.field.Text",b);this.menu.add(this.inputItem);this.menu.showSeparator=false;this.updateTask=Ext.create("Ext.util.DelayedTask",this.fireUpdate,this)},getValue:function(){return this.inputItem.getValue()},setValue:function(b){this.inputItem.setValue(b);this.fireEvent("update",this)},isActivatable:function(){return this.inputItem.getValue().length>0},getSerialArgs:function(){return{type:"string",value:this.getValue()}},validateRecord:function(d){var c=d.get(this.dataIndex);if(typeof c!="string"){return(this.getValue().length===0)}return c.toLowerCase().indexOf(this.getValue().toLowerCase())>-1},onInputKeyUp:function(f,d){var e=d.getKey();if(e==d.RETURN&&f.isValid()){d.stopEvent();this.menu.hide();return}this.updateTask.delay(this.updateBuffer)}},0,0,0,0,["gridfilter.string"],0,[Ext.ux.grid.filter,"StringFilter"],0));Ext.define("Overrides.ux.grid.filter.StringFilter",{override:"Ext.ux.grid.filter.StringFilter",emptyText:t("Search..."),startingText:t("Starting with"),endsText:t("Ends with"),containsText:t("Contains"),equalText:t("Equal to"),compareMap:{starting:"st",ends:"ed",contains:"ct",equal:"eq"},menuItems:["starting","ends","contains","-","equal"],menuItemCfgs:{selectOnFocus:true,width:125},init:function(o){var l=this,n,j,m,g;Ext.applyIf(o,{xtype:"textfield",enableKeyEvents:true,labelCls:"ux-rangemenu-icon "+this.iconCls,hideEmptyLabel:false,labelSeparator:"",labelWidth:28,listeners:{scope:l,blur:l.onInputKeyUp,keyup:l.onInputKeyUp,el:{click:function(a){a.stopPropagation()}}}});l.fields={};for(n=0,j=l.menuItems.length;n