+ },
+ xns : Roo.Toolbar,
+ '|xns' : 'Roo.Toolbar'
+ },
+ {
+ xtype : 'Button',
+ cls : 'x-btn-text-icon',
+ icon : Roo.rootURL + 'images/default/tree/leaf.gif',
+ text : _this._strings['7dce122004969d56ae2e0245cb754d35'] /* Edit */,
+ listeners : {
+ click : function()
+ {
+ var s = _this.grid.getSelectionModel().getSelections();
+ if (!s.length || (s.length > 1)) {
+ Roo.MessageBox.alert("Error", s.length ? "Select only one Row" : "Select a Row");
+ return;
+ }
+ if (!_this.dialog) {
+ return;
+ }
+ _this.dialog.show(s[0].data, function() {
+ _this.grid.footer.onClick('first');
+ });
+
+ }
+ },
+ xns : Roo.Toolbar,
+ '|xns' : 'Roo.Toolbar'
+ },
+ {
+ xtype : 'Separator',
+ xns : Roo.Toolbar,
+ '|xns' : 'Roo.Toolbar'
+ },
+ {
+ xtype : 'TextItem',
+ text : _this._strings['13348442cc6a27032d2b4aa28b75a5d3'] /* Search */,
+ xns : Roo.Toolbar,
+ '|xns' : 'Roo.Toolbar'
+ },
+ {
+ xtype : 'TextField',
+ listeners : {
+ render : function (_self)
+ {
+ _this.searchBox = _self;
+ },
+ specialkey : function (_self, e)
+ {
+ if(e.getKey() == 13) {
+ _this.grid.footer.onClick('first');
+ }
+ }
+ },
+ xns : Roo.form,
+ '|xns' : 'Roo.form'
+ },
+ {
+ xtype : 'Button',
+ cls : 'x-btn-icon',
+ icon : rootURL + '/Pman/templates/images/search.gif',
+ listeners : {
+ click : function (_self, e)
+ {
+ _this.grid.footer.onClick('first');
+ }
+ },
+ xns : Roo.Toolbar,
+ '|xns' : 'Roo.Toolbar'
+ },
+ {
+ xtype : 'Button',
+ cls : 'x-btn-icon',
+ icon : rootURL + '/Pman/templates/images/edit-clear.gif',
+ listeners : {
+ click : function (_self, e)
+ {
+ _this.searchBox.setValue('');
+ _this.grid.footer.onClick('first');
+ }
+ },
+ xns : Roo.Toolbar,
+ '|xns' : 'Roo.Toolbar'
+ },
+ {
+ xtype : 'Separator',
+ xns : Roo.Toolbar,
+ '|xns' : 'Roo.Toolbar'
+ },
+ {
+ xtype : 'TextItem',
+ text : _this._strings['917d465e9a9e8b16a8da50a1ca8156ca'] /* Show: */,
+ xns : Roo.Toolbar,
+ '|xns' : 'Roo.Toolbar'
+ },
+ {
+ xtype : 'Button',
+ enableToggle : true,
+ pressed : false,
+ text : _this._strings['b1c94ca2fbc3e78fc30069c8d0f01680'] /* All */,
+ toggleGroup : 'pgrp',
+ listeners : {
+ toggle : function (_self,st)
+ {
+ if (st) { _this.grid.filter = 'P,N,U'; }
+ _this.grid.footer.onClick('first');
+
+ }
+ },
+ xns : Roo.Toolbar,
+ '|xns' : 'Roo.Toolbar'
+ },
+ {
+ xtype : 'Button',
+ enableToggle : true,
+ pressed : true,
+ text : _this._strings['54e1d44609e3abed11f6e1eb6ae54988'] /* Projects */,
+ toggleGroup : 'pgrp',
+ listeners : {
+ toggle : function (_self,st)
+ {
+ if (st) { _this.grid.filter = 'P,U'; }
+ _this.grid.footer.onClick('first');
+
+ }
+ },
+ xns : Roo.Toolbar,
+ '|xns' : 'Roo.Toolbar'
+ },
+ {
+ xtype : 'Button',
+ enableToggle : true,
+ pressed : false,
+ text : _this._strings['0f111c111475c934057e6f8bb8314d56'] /* Non-Projects */,
+ toggleGroup : 'pgrp',
+ listeners : {
+ toggle : function (_self,st)
+ {
+ if (st) { _this.grid.filter = 'N'; }
+ _this.grid.footer.onClick('first');
+
+ }
+ },
+ xns : Roo.Toolbar,
+ '|xns' : 'Roo.Toolbar'
+ },
+ {
+ xtype : 'Button',
+ enableToggle : true,
+ pressed : false,
+ text : _this._strings['03f4a47830f97377a35321051685071e'] /* Closed */,
+ toggleGroup : 'pgrp',
+ listeners : {
+ toggle : function (_self, st)
+ {
+ if (st) { _this.grid.filter = 'X,C'; }
+ _this.grid.footer.onClick('first');
+
+ }
+ },
+ xns : Roo.Toolbar,
+ '|xns' : 'Roo.Toolbar'
+ }
+ ]
+ },
+ dataSource : {
+ xtype : 'Store',
+ remoteSort : true,
+ sortInfo : { field : 'code', direction: 'ASC' },
+ listeners : {
+ beforeload : function (_self, o)
+ {
+ if (!_this.searchBox) {
+ return false;
+ }
+ o.params = o.params ? o.params : {};
+ o.params['query[project_search]'] = _this.searchBox.getValue();
+ o.params['query[project_filter]'] = _this.grid.filter;
+ }
+ },
+ xns : Roo.data,
+ '|xns' : 'Roo.data',
+ proxy : {
+ xtype : 'HttpProxy',
+ method : 'GET',
+ url : baseURL + '/Roo/core_project.php',
+ xns : Roo.data,
+ '|xns' : 'Roo.data'
+ },
+ reader : {
+ xtype : 'JsonReader',
+ fields : [
+ {
+ 'name': 'id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'name',
+ 'type': 'string'
+ },
+ {
+ 'name': 'remarks',
+ 'type': 'string'
+ },
+ {
+ 'name': 'owner_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'code',
+ 'type': 'string'
+ },
+ {
+ 'name': 'active',
+ 'type': 'int'
+ },
+ {
+ 'name': 'type',
+ 'type': 'string'
+ },
+ {
+ 'name': 'client_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'team_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'file_location',
+ 'type': 'string'
+ },
+ {
+ 'name': 'open_date',
+ 'type': 'date',
+ 'dateFormat': 'Y-m-d'
+ },
+ {
+ 'name': 'open_by',
+ 'type': 'int'
+ },
+ {
+ 'name': 'close_date',
+ 'type': 'date',
+ 'dateFormat': 'Y-m-d'
+ },
+ {
+ 'name': 'countries',
+ 'type': 'string'
+ },
+ {
+ 'name': 'languages',
+ 'type': 'string'
+ },
+ {
+ 'name': 'agency_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'client_id_code',
+ 'type': 'string'
+ },
+ {
+ 'name': 'client_id_name',
+ 'type': 'string'
+ },
+ {
+ 'name': 'client_id_remarks',
+ 'type': 'string'
+ },
+ {
+ 'name': 'client_id_owner_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'client_id_address',
+ 'type': 'string'
+ },
+ {
+ 'name': 'client_id_tel',
+ 'type': 'string'
+ },
+ {
+ 'name': 'client_id_fax',
+ 'type': 'string'
+ },
+ {
+ 'name': 'client_id_email',
+ 'type': 'string'
+ },
+ {
+ 'name': 'client_id_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'client_id_isOwner',
+ 'type': 'int'
+ },
+ {
+ 'name': 'client_id_logo_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'client_id_background_color',
+ 'type': 'string'
+ },
+ {
+ 'name': 'client_id_comptype',
+ 'type': 'string'
+ },
+ {
+ 'name': 'client_id_url',
+ 'type': 'string'
+ },
+ {
+ 'name': 'client_id_main_office_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'client_id_created_by',
+ 'type': 'int'
+ },
+ {
+ 'name': 'client_id_created_dt',
+ 'type': 'date'
+ },
+ {
+ 'name': 'client_id_updated_by',
+ 'type': 'int'
+ },
+ {
+ 'name': 'client_id_updated_dt',
+ 'type': 'date'
+ },
+ {
+ 'name': 'client_id_passwd',
+ 'type': 'string'
+ },
+ {
+ 'name': 'agency_id_code',
+ 'type': 'string'
+ },
+ {
+ 'name': 'agency_id_name',
+ 'type': 'string'
+ },
+ {
+ 'name': 'agency_id_remarks',
+ 'type': 'string'
+ },
+ {
+ 'name': 'agency_id_owner_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'agency_id_address',
+ 'type': 'string'
+ },
+ {
+ 'name': 'agency_id_tel',
+ 'type': 'string'
+ },
+ {
+ 'name': 'agency_id_fax',
+ 'type': 'string'
+ },
+ {
+ 'name': 'agency_id_email',
+ 'type': 'string'
+ },
+ {
+ 'name': 'agency_id_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'agency_id_isOwner',
+ 'type': 'int'
+ },
+ {
+ 'name': 'agency_id_logo_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'agency_id_background_color',
+ 'type': 'string'
+ },
+ {
+ 'name': 'agency_id_comptype',
+ 'type': 'string'
+ },
+ {
+ 'name': 'agency_id_url',
+ 'type': 'string'
+ },
+ {
+ 'name': 'agency_id_main_office_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'agency_id_created_by',
+ 'type': 'int'
+ },
+ {
+ 'name': 'agency_id_created_dt',
+ 'type': 'date'
+ },
+ {
+ 'name': 'agency_id_updated_by',
+ 'type': 'int'
+ },
+ {
+ 'name': 'agency_id_updated_dt',
+ 'type': 'date'
+ },
+ {
+ 'name': 'agency_id_passwd',
+ 'type': 'string'
+ },
+ {
+ 'name': 'team_id_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'team_id_name',
+ 'type': 'string'
+ },
+ {
+ 'name': 'team_id_type',
+ 'type': 'int'
+ },
+ {
+ 'name': 'team_id_leader',
+ 'type': 'int'
+ },
+ {
+ 'name': 'open_by_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'open_by_office_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'open_by_name',
+ 'type': 'string'
+ },
+ {
+ 'name': 'open_by_phone',
+ 'type': 'string'
+ },
+ {
+ 'name': 'open_by_fax',
+ 'type': 'string'
+ },
+ {
+ 'name': 'open_by_email',
+ 'type': 'string'
+ },
+ {
+ 'name': 'open_by_company_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'open_by_role',
+ 'type': 'string'
+ },
+ {
+ 'name': 'open_by_active',
+ 'type': 'int'
+ },
+ {
+ 'name': 'open_by_remarks',
+ 'type': 'string'
+ },
+ {
+ 'name': 'open_by_passwd',
+ 'type': 'string'
+ },
+ {
+ 'name': 'open_by_owner_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'open_by_lang',
+ 'type': 'string'
+ },
+ {
+ 'name': 'open_by_no_reset_sent',
+ 'type': 'int'
+ },
+ {
+ 'name': 'open_by_action_type',
+ 'type': 'string'
+ },
+ {
+ 'name': 'open_by_project_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'owner_id_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'owner_id_office_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'owner_id_name',
+ 'type': 'string'
+ },
+ {
+ 'name': 'owner_id_phone',
+ 'type': 'string'
+ },
+ {
+ 'name': 'owner_id_fax',
+ 'type': 'string'
+ },
+ {
+ 'name': 'owner_id_email',
+ 'type': 'string'
+ },
+ {
+ 'name': 'owner_id_company_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'owner_id_role',
+ 'type': 'string'
+ },
+ {
+ 'name': 'owner_id_active',
+ 'type': 'int'
+ },
+ {
+ 'name': 'owner_id_remarks',
+ 'type': 'string'
+ },
+ {
+ 'name': 'owner_id_passwd',
+ 'type': 'string'
+ },
+ {
+ 'name': 'owner_id_owner_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'owner_id_lang',
+ 'type': 'string'
+ },
+ {
+ 'name': 'owner_id_no_reset_sent',
+ 'type': 'int'
+ },
+ {
+ 'name': 'owner_id_action_type',
+ 'type': 'string'
+ },
+ {
+ 'name': 'owner_id_project_id',
+ 'type': 'int'
+ }
+ ],
+ id : 'id',
+ root : 'data',
+ totalProperty : 'total',
+ xns : Roo.data,
+ '|xns' : 'Roo.data'
+ }
+ },
+ sm : {
+ xtype : 'RowSelectionModel',
+ singleSelect : true,
+ listeners : {
+ afterselectionchange : function (_self)
+ {
+ // load project members.
+ }
+ },
+ xns : Roo.grid,
+ '|xns' : 'Roo.grid'
+ },
+ colModel : [
+ {
+ xtype : 'ColumnModel',
+ dataIndex : 'type',
+ header : _this._strings['a1fa27779242b4902f7ae3bdd5c6d508'] /* Type */,
+ renderer : function(v) { return _this.grid.typeToString(v);},
+ sortable : true,
+ width : 70,
+ xns : Roo.grid,
+ '|xns' : 'Roo.grid'
+ },
+ {
+ xtype : 'ColumnModel',
+ dataIndex : 'client_id_name',
+ header : _this._strings['577d7068826de925ea2aec01dbadf5e4'] /* Client */,
+ renderer : function(v) { return String.format('{0}', v); },
+ width : 75,
+ xns : Roo.grid,
+ '|xns' : 'Roo.grid'
+ },
+ {
+ xtype : 'ColumnModel',
+ dataIndex : 'code',
+ header : _this._strings['ca0dbad92a874b2f69b549293387925e'] /* Code */,
+ renderer : function(v) { return String.format('{0}', v); },
+ sortable : true,
+ width : 120,
+ xns : Roo.grid,
+ '|xns' : 'Roo.grid'
+ },
+ {
+ xtype : 'ColumnModel',
+ dataIndex : 'name',
+ header : _this._strings['49ee3087348e8d44e1feda1917443987'] /* Name */,
+ renderer : function(v) { return String.format('{0}', v); },
+ sortable : true,
+ width : 200,
+ xns : Roo.grid,
+ '|xns' : 'Roo.grid'
+ }
+ ]
+ }
+ }
+ ]
+ }
+ }; }