*
* {tag: 'div', style: 'display:block;position:absolute;top:2;left:300;width:100%;height:25px'});
*
+ *
+ * CHANGES
+ * - gtranslate moved to Pman.GoogleTranslate
+ *
+ *
*/
if (typeof(_T) == 'undefined') { _T={};}
+
Pman = new Roo.Document(
//resizeTabs: true,
alwaysShowTabs: true,
minTabWidth: 140
- } /*,
+ } ,
south: {
+ collapsible : true,
+ collapsed : true,
split:false,
- initialSize: 25,
+ height: 120,
titlebar: false
}
- */
+
});
this.fireEvent('beforeload',this);
this.layout.beginUpdate();
this.layout.add('north', new Roo.ContentPanel('title', 'North'));
var au = Pman.Login.authUser;
- if (au.id > 0 && au.company_id_background_color.length) {
+ if (au.id > 0 && au.company_id_background_color && au.company_id_background_color.length) {
Roo.get('title').dom.style.backgroundColor = '#' + au.company_id_background_color;
Roo.get('headerInformation').dom.style.color = this.invertColor('#' + au.company_id_background_color);
}
var forceAdmin = function(data)
{
if (!data || !data.id) {
+ //Roo.log("Force Admin");
Pman.Dialog.PersonStaff.show(
{
id : 0,
- company_id : Pman.Login.authUser.company_id * 1,
+ company_id : Pman.Login.authUser.company_id_id * 1,
company_id_name : Pman.Login.authUser.company_id_name
}, function(data) {
forceAdmin(data);
});
return;
}
+ Pman.Login.authUser.company_id_id = data.id;
Pman.Login.authUser.company_id = data.id;
Pman.Login.authUser.company_id_name = data.name;
forceAdmin();
}
if (Pman.Login.authUser.id < 0) {
+ // admin company has been created - create the user..
+ if (Pman.Login.authUser.company_id_id* 1 > 0) {
+ forceAdmin();
+ return;
+ }
+
forceCompany();
/// create account..
this.download(c);
},
+
+
prettyDate : function (value)
{
if (typeof(value) == 'string') {
if (typeof(mod) == 'function') {
mod();
- } else {
- if (mod.parent.layout && !mod.module.disabled) {
+ } else if (mod.parent.layout && !mod.module.disabled) {
+ // honour permname setings..
+ if (mod.permname && mod.permname.length) {
+ if (Pman.hasPerm(mod.permname, 'S')) {
+ mod.module.add(mod.parent.layout, mod.region);
+ }
+ } else {
mod.module.add(mod.parent.layout, mod.region);
}
-
+
+
}
},
- gtranslate : function(str, src, dest, cb) {
- // load script:
-
-
- var x = new Roo.data.ScriptTagProxy({
- url: 'http://ajax.googleapis.com/ajax/services/language/translate',
- callbackParam : 'callback'
- });
- x.load(
- {
- v: '1.0',
- q : str,
- langpair : src + '|' +dest
- }, // end params.
- { // reader
- readRecords : function (o) {
- if (!o.responseData) {
- return o;
- }
- return o.responseData.translatedText;
- }
- },
- function (result) {
- cb(result);
- },
- this,
- []
- );
-
-
-
- } ,
invertColor : function(c)
{
// read..