// Auto generated file - created by app.Builder.js- do not edit directly (at present!)
MTrackWeb.Layout = new Roo.XComponent({
+ part : ["MTrackWeb","Layout"],
order : '001-MTrackWeb.Layout',
region : 'center',
parent : false,
name : "unnamed module",
disabled : false,
- tree : function()
+ permname : '',
+ _tree : function()
{
var _this = this;
var MODULE = this;
return {
xtype: 'NestedLayoutPanel',
xns: Roo,
+ listeners : {
+ activate : function (_self)
+ {
+
+ }
+ },
+ getProjectName : function() {
+ return MTrack.projectCombo.el.dom.value;
+ },
+ getProjectId : function() {
+ return MTrack.projectCombo.getValue();
+ },
layout : {
xtype: 'BorderLayout',
xns: Roo,
region : 'north',
content : '<div class="banner-username"></div>' +
'<div id="banner">' +
- '<a href="' + rootURL + '"><img style="float: left;margin-right: 10px;" src="' +
- rootURL + '/Roojscom/templates/images/roojsorg_logo-55.png" width="150" height="55"></a>' +
+ '<a href="' + baseURL + '"><img style="float: left;margin-right: 10px;" src="' +
+ '/Roojscom/templates/images/roojsorg_logo-55.png" width="150" height="55"></a>' +
'<div class="banner-title">Project Tracker</div>'+
'</div>'
},
{
xtype: 'ContentPanel',
xns: Roo,
- region : 'center',
- title : "test"
+ region : 'south',
+ content : ' <div id="footer">' +
+ '<div class="navfoot">' +
+ 'Powered by <a href="http://www.roojs.com/mtrack/index.php/Browse/default/web.mtrack">web.mtrack</a>' +
+ ' based on Wez\'s ' +
+ '<a href="http://bitbucket.org/wez/mtrack/">mtrack</a>' +
+ '</div>' +
+ '</div>'
}
],
north : {
{
xtype: 'ComboBox',
xns: Roo.form,
+ listeners : {
+ beforeselect : function (combo, rec, index)
+ {
+ // this should post to the system, - to register active Project..
+ // it's not really needed in new version... but done for compat.
+ // at present..
+ Roo.Ajax.request( {
+ method: 'POST',
+ url : baseURL + '/Projects/' + rec.data.id,
+ success : function (data) {
+ // then, it should refresh the current active tab..
+ MTrack.ajaxLoad( MTrack.currentURL);
+ }
+ });
+
+ },
+ render : function (_self)
+ {
+
+ _this.projectCombo = _self;
+ // BC..
+ MTrack.projectCombo = _self;
+
+ // set the default value to our current project..
+ this.setFromData({
+ id : project_id,
+ name : project_name
+ });
+ }
+ },
allowBlank : false,
alwaysQuery : true,
displayField : 'name',
pageSize : 40,
qtip : "Select Project",
selectOnFocus : true,
- tpl : '<div class="x-grid-cell-text x-btn button"><b>{code}</b> {name} </div>',
+ tpl : '<div class="x-grid-cell-text x-btn">{name} - <b>{code}</b> </div>',
triggerAction : 'all',
typeAhead : true,
valueField : 'id',
- width : 200,
+ width : 150,
store : {
xtype: 'Store',
xns: Roo.data,
xtype: 'HttpProxy',
xns: Roo.data,
method : 'GET',
- url : baseURL + '/Projects.php'
+ url : baseURL + '/Roo/core_project.php'
},
reader : {
xtype: 'JsonReader',
}
}
},
+ {
+ xtype: 'Separator',
+ xns: Roo.Toolbar
+ },
+ {
+ xtype: 'TextField',
+ xns: Roo.form,
+ listeners : {
+ specialkey : function (_self, e)
+ {
+ if (e.getKey() == 13) {
+ // search!
+ }
+ }
+ },
+ emptyText : "Search (to be done..)",
+ width : 100
+ },
{
xtype: 'Button',
xns: Roo.Toolbar,
- text : "test"
+ cls : 'x-btn-icon',
+ icon : rootURL + '/Pman/templates/images/search.gif'
+ },
+ {
+ xtype: 'Separator',
+ xns: Roo.Toolbar
+ },
+ {
+ xtype: 'SplitButton',
+ xns: Roo.Toolbar,
+ listeners : {
+ click : function (_self, e)
+ {
+ var bt = this;
+ if (!Pman.Login.authUser.id) {
+ Pman.Login.show(false, function() {
+ bt.setText('Logout');
+ Roo.select('.banner-username').first().update(
+ String.format('You are logged in as {0} <{1}>',
+ Pman.Login.authUser.name,
+ Pman.Login.authUser.email));
+
+
+ // set the default value to our current project..
+ MTrack.projectCombo.setFromData({
+ id : Pman.Login.authUser.project.id,
+ name : Pman.Login.authUser.project.name
+ });
+
+ MTrack.ajaxLoad( MTrack.currentURL);
+ //document.location = baseURL + '/Report/1?ts=' + Math.random();
+ // reload the project list!??
+ // reload the active page
+ });
+ } else {
+ Roo.MessageBox.confirm("Logout",
+ "Are you sure you want to Log out?",
+ function(r) {
+ if (r!='yes') {
+ return;
+ }
+
+ Pman.Login.logout();
+ }
+ );
+ // should for a reload..
+ }
+ },
+ render : function (_self)
+ {
+ if (typeof(Pman) == 'undefined') {
+ return;
+ }
+
+ // if we are logged in.. change stuff..
+ if (!Pman.Login.authUser.id) {
+ // not logged in..
+ return;
+ }
+ // logged in..
+ this.el.child("button:first").setStyle(
+ 'background-image', 'url(' + rootURL + '/Pman/templates/images/logout.gif)');
+ this.setText('Logout');
+ Roo.select('.banner-username').first().update(
+ String.format('You are logged in as {0} <{1}>',
+ Pman.Login.authUser.name,
+ Pman.Login.authUser.email));
+ // change the icon..
+
+ }
+ },
+ cls : 'x-btn-text-icon',
+ text : "Login",
+ icon : rootURL + '/Pman/templates/images/lock.gif',
+ menu : {
+ xtype: 'Menu',
+ xns: Roo.menu,
+ items : [
+ {
+ xtype: 'Item',
+ xns: Roo.menu,
+ text : "Request Account"
+ },
+ {
+ xtype: 'Item',
+ xns: Roo.menu,
+ text : "Send Invite to a Friend"
+ },
+ {
+ xtype: 'Separator',
+ xns: Roo.menu
+ },
+ {
+ xtype: 'Item',
+ xns: Roo.menu,
+ listeners : {
+ render : function (_self)
+ {
+ _this.changePassword = _self;
+ }
+ },
+ text : "Change Password"
+ }
+ ]
+ }
}
]
}