php warnings
[Pman.MTrack] / Pman.Dialog.MTrackMilestone.js
index 0b92826..b4cf973 100644 (file)
@@ -32,10 +32,11 @@ Pman.Dialog.MTrackMilestone = {
             xns: Roo,
             closable : false,
             collapsible : false,
-            height : 320,
+            height : 350,
+            modal : true,
             resizable : false,
-            title : "Edit / Create mtrack_milestone",
-            width : 450,
+            title : "Edit / Create Milestone",
+            width : 400,
             items : [
                 {
                     xtype: 'ContentPanel',
@@ -49,17 +50,19 @@ Pman.Dialog.MTrackMilestone = {
                                 actioncomplete : function(_self,action)
                                 {
                                     if (action.type == 'setdata') {
-                                       //_this.dialog.el.mask("Loading");
-                                       //this.load({ method: 'GET', params: { '_id' : _this.data.id }});
+                                        if (_this.data.id) {
+                                           this.load({ method: 'GET', params: { '_id' : _this.data.id }});
+                                       }
                                        return;
+                                       
                                     }
                                     if (action.type == 'load') {
-                                        _this.dialog.el.unmask();
+                                
                                         return;
                                     }
                                     if (action.type =='submit') {
                                     
-                                        _this.dialog.el.unmask();
+                                
                                         _this.dialog.hide();
                                     
                                          if (_this.callback) {
@@ -78,12 +81,19 @@ Pman.Dialog.MTrackMilestone = {
                             style : 'margin:10px;',
                             url : baseURL + '/Roo/mtrack_milestone.php',
                             items : [
+                                {
+                                    xtype: 'TextField',
+                                    xns: Roo.form,
+                                    fieldLabel : 'Name',
+                                    name : 'name',
+                                    width : 200
+                                },
                                 {
                                     xtype: 'ComboBox',
                                     xns: Roo.form,
-                                    allowBlank : 'false',
+                                    allowBlank : false,
                                     displayField : 'name',
-                                    editable : 'false',
+                                    editable : false,
                                     emptyText : "Select Project",
                                     fieldLabel : 'Project',
                                     forceSelection : true,
@@ -92,31 +102,30 @@ Pman.Dialog.MTrackMilestone = {
                                     loadingText : "Searching...",
                                     minChars : 2,
                                     name : 'project_id_name',
-                                    pageSize : 20,
+                                    pageSize : 50,
                                     qtip : "Select Projects",
                                     queryParam : 'query[name]',
                                     selectOnFocus : true,
-                                    tpl : '<div class="x-grid-cell-text x-btn button"><b>{name}</b> </div>',
+                                    tpl : '<div class="x-grid-cell-text x-btn button"><b>{code}</b> {name}</div>',
                                     triggerAction : 'all',
-                                    typeAhead : true,
                                     valueField : 'id',
-                                    width : 300,
+                                    width : 200,
                                     store : {
                                         xtype: 'Store',
                                         xns: Roo.data,
-                                        remoteSort : true,
-                                        sortInfo : { direction : 'ASC', field: 'id' },
                                         listeners : {
                                             beforeload : function (_self, o){
                                                 o.params = o.params || {};
                                                 // set more here
                                             }
                                         },
+                                        remoteSort : true,
+                                        sortInfo : { direction : 'ASC', field: 'code' },
                                         proxy : {
                                             xtype: 'HttpProxy',
                                             xns: Roo.data,
                                             method : 'GET',
-                                            url : baseURL + '/Roo/Projects.php'
+                                            url : baseURL + '/Roo/core_project'
                                         },
                                         reader : {
                                             xtype: 'JsonReader',
@@ -128,41 +137,49 @@ Pman.Dialog.MTrackMilestone = {
                                         }
                                     }
                                 },
-                                {
-                                    xtype: 'TextField',
-                                    xns: Roo.form,
-                                    fieldLabel : 'Name',
-                                    name : 'name',
-                                    width : 300
-                                },
                                 {
                                     xtype: 'TextArea',
                                     xns: Roo.form,
                                     fieldLabel : 'Description',
-                                    height : 100,
                                     name : 'description',
-                                    width : 300
+                                    width : 200,
+                                    height : 100
                                 },
                                 {
                                     xtype: 'DateField',
                                     xns: Roo.form,
+                                    altFormats : 'Y-m-d H:i:s',
                                     fieldLabel : 'Startdate',
+                                    format : 'Y-m-d',
                                     name : 'startdate',
-                                    width : 75
+                                    width : 100
                                 },
                                 {
                                     xtype: 'DateField',
                                     xns: Roo.form,
+                                    altFormats : 'Y-m-d H:i:s',
                                     fieldLabel : 'Duedate',
+                                    format : 'Y-m-d',
                                     name : 'duedate',
-                                    width : 75
+                                    width : 100
                                 },
                                 {
                                     xtype: 'DateField',
                                     xns: Roo.form,
+                                    altFormats : 'Y-m-d H:i:s',
                                     fieldLabel : 'Completed',
+                                    format : 'Y-m-d',
                                     name : 'completed',
-                                    width : 75
+                                    width : 100
+                                },
+                                {
+                                    xtype: 'Checkbox',
+                                    xns: Roo.form,
+                                    boxLabel : 'On hold',
+                                    fieldLabel : 'Status',
+                                    inputValue : 1,
+                                    name : 'on_hold',
+                                    valueOff : 0
                                 },
                                 {
                                     xtype: 'Hidden',
@@ -199,7 +216,7 @@ Pman.Dialog.MTrackMilestone = {
                             // do some checks?
                              
                             
-                            _this.dialog.el.mask("Saving");
+                         
                             _this.form.doAction("submit");
                         
                         }