Pman.Dialog.PersonEditor.js
[Pman.Core] / Pman.Dialog.PersonEditor.js
index 8f32832..9f73756 100644 (file)
@@ -37,7 +37,7 @@ Pman.Dialog.PersonEditor.prototype = {
                 title: 'Edit Contact Details',
                 modal: true,
                 width:  530,
-                height: 300,
+                height: 400,
                 shadow:true,
                 minWidth:200,
                 minHeight:180,
@@ -232,7 +232,7 @@ Pman.Dialog.PersonEditor.prototype = {
                         beforeload : function(st,o)
                         {
                         
-                            o.params.isOwner = 0;
+                            o.params['!comptype'] = 'OWNER';
                         },
                         loadexception : Pman.loadException
                     
@@ -263,7 +263,7 @@ Pman.Dialog.PersonEditor.prototype = {
                     adderclick : function()
                     {
                         var cb = this;
-                        Pman.Dialog.Companies.show( {  id: 0 },  function(data) {
+                        Pman.Dialog.CoreCompanies.show( {  id: 0 },  function(data) {
                             cb.setFromData(data);
                         }); 
                     }
@@ -455,12 +455,82 @@ Pman.Dialog.PersonEditor.prototype = {
                 xtype : 'TextField',
                 width : 300
             },
+            country : {
+                xtype: 'ComboBoxArray',
+                xns: Roo.form,
+                fieldLabel : 'Journalist',
+                hiddenName : 'country_id',
+                name : 'country',
+                width : 300,
+                combo : {
+                    xtype: 'ComboBox',
+                    xns: Roo.form,
+                    listeners : {
+                        add : function (combo)
+                        {
+                            Pman.Dialog.ClippingJournalist.show({
+                                id:0,
+                                _clipping_id : _this.form.findField('id').getValue(),
+                                publication : _this.data.media_name,
+                                country : _this.data.country,
+                                campaign_id : _this.data.project_id,
+                                campaign_name : _this.data.project_id_name
+
+                            });
+                        }
+                    },
+                    allowBlank : true,
+                    alwaysQuery : true,
+                    displayField : 'name',
+                    editable : false,
+                    emptyText : "Select News",
+                    fieldLabel : 'Journalist',
+                    forceSelection : true,
+                    idField : 'id',
+                    loadingText : "Searching...",
+                    minChars : 2,
+                    pageSize : 20,
+                    tpl : '<div class="x-grid-cell-text x-btn button"><b>{name}</b>,  {publication}, {country_tr}</div>',
+                    triggerAction : 'all',
+                    typeAhead : true,
+                    valueField : 'id',
+                    width : 480,
+                    store : {
+                        xtype: 'Store',
+                        xns: Roo.data,
+                        listeners : {
+                            beforeload : function (_self, o){
+                                o.params = o.params || {};
+                                o.params.campaign_id = _this.data.project_id;
+                            }
+                        },
+                        isLocal : false,
+                        proxy : {
+                            xtype: 'HttpProxy',
+                            xns: Roo.data,
+                            method : 'GET',
+                            url : baseURL + '/Roo/Clipping_journalist.php'
+                        },
+                        reader : {
+                            xtype: 'JsonReader',
+                            xns: Roo.data,
+                            id : 'id',
+                            root : 'data',
+                            totalProperty : 'total',
+                            fields : [
+                                {"name":"id","type":"int"},
+                                {"name":"name","type":"string"}
+                            ]
+                        }
+                    }
+                }
+            },
             passwd1 : {
                 name : 'passwd1',
                 fieldLabel : "New Password ",
                 value : '',
                 allowBlank : true, // must be filled in as we rely on it for login details..
-                inputType: 'password',
+                inputType: 'password', // << if comment out this input type, it should be ok
                 xtype : 'SecurePass',
                 width : 220,
                 imageRoot : rootURL + '/Pman/templates/images'
@@ -471,7 +541,7 @@ Pman.Dialog.PersonEditor.prototype = {
                 fieldLabel : "Password (type again to confirm)",
                 value : '',
                 allowBlank : true, // must be filled in as we rely on it for login details..
-                inputType: 'password',
+                inputType: 'password', // << if comment out this input type, it should be ok
                 xtype : 'TextField',
                 width : 220
             },