Pman.Dialog.PersonStaff.show(
{
id : 0,
- company_id : Pman.Login.authUser.company_id_id * 1,
+ company_id : Pman.Login.authUser.company_id * 1,
company_id_name : Pman.Login.authUser.company_id_name
}, function(data) {
forceAdmin(data);
);
return;
}
+
Roo.state.Manager.set('Pman.Login.username', data.email),
window.onbeforeunload = false;
document.location = baseURL + '?ts=' + Math.random();
if (Pman.Login.authUser.id < 0) {
// admin company has been created - create the user..
- if (Pman.Login.authUser.company_id_id* 1 > 0) {
+ if (Pman.Login.authUser.company_id* 1 > 0) {
forceAdmin();
return;
}
}
return res;
},
- genericDelete : function(tab,tbl) {
-
- var r = [];
-
-
- var s = tab.grid.getSelectionModel().getSelections();
- if (!s.length) {
- Roo.MessageBox.alert("Error", "Select at least one Row to delete" );
- return '';
- }
- var reader = tab.grid.reader || tab.grid.ds.reader;
- for(var i = 0; i < s.length; i++) {
- r.push(reader.getId(s[i].json));
- }
-
- Roo.MessageBox.confirm("Confirm", "Are you sure you want to delete that?",
- function(btn) {
- if (btn != 'yes') {
- return;
- }
- // what about the toolbar??
- tab.grid.getView().mainWrap.mask("Deleting");
- new Pman.Request({
- url: baseURL + '/Roo/'+tbl+'.php',
- method: 'POST',
- params: {
- _delete : r.join(',')
- },
- success: function(response) {
- tab.grid.getView().mainWrap.unmask();
- if ( tab.paging ) {
- tab.paging.onClick('refresh');
- } else if (tab.grid.footer && tab.grid.footer.onClick) {
- // new xtype built grids
- tab.grid.footer.onClick('refresh');
- } else if (tab.refresh) {
- tab.refresh(); // this might cause problems as panels have a refresh method?
- } else {
- tab.grid.getDataSource().load();
- }
-
-
-
- },
- failure: function(act) {
- Roo.log(act);
- var msg = '';
- try {
- msg = act.errorMsg;
- } catch(e) {
- msg = "Error deleting";
- }
- tab.grid.getView().mainWrap.unmask();
- Roo.MessageBox.alert("Error", msg);
- }
-
- });
- }
-
- );
- return '';
+ genericDelete : function(tab,tbl)
+ {
+ Pman.Delete.progress(tab,tbl)
},
xregister : function(obj)
{
- Roo.log(obj);
+
// work out owner..
if (!Pman.appModules === false) {
Pman.appModules = typeof(AppModules ) == 'undefined'? [] :
// Roo.log("CALLING XComponent register with : " + obj.name);
-
- // this will call xregister as it's the on.register handler..
Roo.log(obj);
+ // this will call xregister as it's the on.register handler..
Roo.XComponent.register(obj.isTop ? obj : Roo.apply(obj.module, obj));
} ,