DataObjects/Core_domain.php
[Pman.Core] / Pman.Dialog.CorePersonContact.js
index 6722481..a90c347 100644 (file)
@@ -32,10 +32,10 @@ Pman.Dialog.CorePersonContact = {
             xns: Roo,
             closable : false,
             collapsible : false,
-            height : 350,
+            height : 290,
             resizable : false,
             title : "Edit / Create Contact Details",
-            width : 500,
+            width : 450,
             items : [
                 {
                     xtype: 'ContentPanel',
@@ -155,12 +155,20 @@ Pman.Dialog.CorePersonContact = {
                                             }
                                             Pman.Dialog.Office.show(cfg, function(data) {
                                                         _this.form.setValues({
-                                                            company_id_name : data.name,
-                                                            company_id : data.id
+                                                            office_id_name : data.name,
+                                                            office_id : data.id
                                                     });
                                                 }); 
                                             
                                             
+                                        },
+                                        beforequery : function (combo, query, forceAll, cancel, e)
+                                        {
+                                                var coid = _this.form.findField('company_id').getValue();
+                                                if (coid < 1 ) {
+                                                    Ext.MessageBox.alert("Error", "Select An Company First");
+                                                    return false;
+                                                }
                                         }
                                     },
                                     allowBlank : 'false',
@@ -216,7 +224,8 @@ Pman.Dialog.CorePersonContact = {
                                     xns: Roo.form,
                                     fieldLabel : 'Name',
                                     name : 'name',
-                                    width : 300
+                                    width : 300,
+                                    allowBlank : true
                                 },
                                 {
                                     xtype: 'TextField',
@@ -242,6 +251,7 @@ Pman.Dialog.CorePersonContact = {
                                 {
                                     xtype: 'TextField',
                                     xns: Roo.form,
+                                    allowBlank : false,
                                     fieldLabel : 'Email',
                                     name : 'email',
                                     width : 200