DataObjects/ProjectDirectory.php
[Pman.Core] / Pman.Dialog.PersonEditor.js
index e66dbbe..8f32832 100644 (file)
@@ -551,7 +551,7 @@ Pman.Dialog.PersonEditor.prototype = {
             return;
             
         }
-        if (!this.form.findField('company_id').getValue()) {
+        if (this.form.findField('company_id') && !this.form.findField('company_id').getValue()) {
             Ext.MessageBox.alert("Error", "Select a Company");
             return;
         }
@@ -611,7 +611,7 @@ Pman.Dialog.PersonEditor.prototype = {
         this.data = data;
         this.create();
         this.form.reset();
-        if (data._fetch) {
+        if ( this._id) {
             this.dialog.show();
             this.dialog.el.mask("Loading");
             this.form.doAction('load', {
@@ -624,9 +624,10 @@ Pman.Dialog.PersonEditor.prototype = {
             });
            // this.fireEvent('show');
             return;
-        } else {
-            this.form.setValues(data);
         }
+        //} else {
+        this.form.setValues(data);
+        //}
         this.form.fireEvent('actioncomplete', this.form,{
             type : 'setdata',
             data: data
@@ -719,7 +720,7 @@ Pman.Dialog.PersonEditor.prototype = {
              
             var c = ar[i];
             i++;
-            Pman.request({
+            new Pman.Request({
                 url : baseURL+'/Core/SendIntro.html',
                 method : 'POST',
                 params: c,