buildCompleted : false, // flag to say if we are building interface..
events : {
+ 'beforeauth' : true, // fired after page ready, before authentication check
'beforeload' : true, // fired after page ready, before module building.
'load' : true, // fired after module building
'authrefreshed' : true // fire on auth updated?? - should be on Login?!?!?
onBuildComplete : function ()
{
-
this.building = false;
//this.layout.getRegion('center').showPanel(0);
//this.layout.endUpdate();
this.finalize();
this.fireEvent('load',this);
+ if (Pman.Login.authUser) {
+ (function() {
+ if (typeof(FS) == 'undefined') {
+ Roo.log("failed to initialize FS");
+ return;
+ }
+
+ FS.identify(Pman.Login.authUser.id, {
+ displayName: Pman.Login.authUser.firstname + ' ' + Pman.Login.authUser.lastname,
+ email: Pman.Login.authUser.email
+ });
+ }).defer(300);
+ }
+
},
listeners : {
Roo.state.Manager.setProvider(new Roo.state.CookieProvider());
Roo.bootstrap.Tooltip.init();
-
- // reset password!!!!
- /*
- if (showNewPass.length) {
- Pman.PasswordChange.show( { passwordReset : showNewPass },
- function(data) {
- // fail and success we do a load...
- Pman.Login.onLoad();
- }
- );
- return;
- }
- */
+
Pman.Login.onLoad();
},
},
loadUserInterface : function()
- {
-
+ {
if (this.buildCompleted) { // it get's called from auth checking.. no need to build again..
return;
}
// triggers after authentication verified...
+ if(typeof(uiConfig.fullstory) != 'undefined'){
+ this.fullstory();
+ }
+
if (Roo.get('loading')) {
Roo.get('loading').remove();
}
Pman.building = true;
-
+ Roo.XComponent.hideProgress = true;
Roo.XComponent.on('beforebuild', this.onBeforeBuild, this);
Roo.XComponent.on('buildcomplete', this.onBuildComplete, this);
},
- genericDelete : function(tab,tbl) {
+ genericDelete : function(tab,tbl) {
var r = [];
for(var i = 0; i < s.length; i++) {
r.push(s[i].json.id);
}
-
+
Roo.bootstrap.MessageBox.confirm("Confirm", "Are you sure you want to delete that?",
function(btn) {
if (btn != 'yes') {
return;
}
+
//tab.grid.mask("Deleting");
new Pman.Request({
url: baseURL + '/Roo/'+tbl+'.php',
},
failure: function(act) {
- Roo.log(act);
+ Roo.bootstrap.MessageBox.hide();
+
+ //Roo.log(act);
var msg = '';
try {
msg = act.errorMsg;
}
//tab.grid.unmask();
Roo.bootstrap.MessageBox.alert("Error", msg);
+
}
});
return '';
},
/* fired before building - check permissions on a component.. */
- beforeBuild : function() {
-
+ onBeforeBuild : function(obj)
+ {
if (typeof(obj.part) == 'undefined') {
return;
}
var permname = obj.part.join('.');
Roo.log("CHECKING: "+ permname);
-
- // we now have permission...
- // obj.moduleOwner '.' lname
-
- if (Pman.Login.authUser.hasPermExists(permname) && !Pman.Login.authUser.hasPerm(permname,'S')) {
+
+ if (typeof(appDisabled) != 'undefined' && appDisabled.indexOf(permname)> -1) {
+ obj.disabled = true;
+ }
+ // we now have permission...
+ // obj.moduleOwner '.' lname
+
+ if (Pman.Login.hasPermExists(permname) && !Pman.Login.hasPerm(permname,'S')) {
// it's a turned off permission...
Roo.log(permname + " is Disabled for this user");
obj.disabled = true;
}
if (obj.permname && obj.permname.length &&
- Pman.Login.authUser.hasPermExists(obj.permname) && !Pman.Login.authUser.hasPerm(obj.permname,'S')) {
+ Pman.Login.hasPermExists(obj.permname) && !Pman.Login.hasPerm(obj.permname,'S')) {
// it's a turned off permission...
Roo.log(obj.permname + " is Disabled for this user");
obj.disabled = true;
}
+ },
+
+ fullstory : function()
+ {
+ if(uiConfig.fullstory.domains.indexOf(location.host) < 0){
+ return;
+ }
+
+ window['_fs_debug'] = false;
+ window['_fs_host'] = 'fullstory.com';
+ window['_fs_org'] = uiConfig.fullstory.account;
+ window['_fs_namespace'] = 'FS';
+ (function(m,n,e,t,l,o,g,y){
+ if (e in m) {if(m.console && m.console.log) { m.console.log('FullStory namespace conflict. Please set window["_fs_namespace"].');} return;}
+ g=m[e]=function(a,b){g.q?g.q.push([a,b]):g._api(a,b);};g.q=[];
+ o=n.createElement(t);o.async=1;o.src='https://'+_fs_host+'/s/fs.js';
+ y=n.getElementsByTagName(t)[0];y.parentNode.insertBefore(o,y);
+ g.identify=function(i,v){g(l,{uid:i});if(v){g(l,v)}};g.setUserVars=function(v){g(l,v)};
+ g.identifyAccount=function(i,v){o='account';v=v||{};v.acctId=i;g(o,v)};
+ g.clearUserCookie=function(c,d,i){if(!c || document.cookie.match('fs_uid=[`;`]*`[`;`]*`[`;`]*`')){
+ d=n.domain;while(1){n.cookie='fs_uid=;domain='+d+
+ ';path=/;expires='+new Date(0).toUTCString();i=d.indexOf('.');if(i<0){break;}d=d.slice(i+1)}}};
+ })(window,document,window['_fs_namespace'],'script','user');
}
});