DataObjects/Companies.php
[Pman.Core] / Pman.Dialog.CoreNotifyRecurKeywords.bjs
index b740a3e..7f90bd4 100644 (file)
@@ -6,11 +6,12 @@
  "permname" : "",
  "modOrder" : "001",
  "strings" : {
-  "cfcd208495d565ef66e7dff9f98764da" : "0",
-  "c4ca4238a0b923820dcc509a6f75849b" : "1",
+  "0ee0f676f631ad4e8a5844314a3a20de" : "Select campaign",
+  "1243daf593fa297e07ab03bf06d925af" : "Searching...",
   "ea4788705e6873b424c65e91c2846b19" : "Cancel",
   "e0aa021e21dddbd6d8cecec71e9cf564" : "OK",
-  "790f855c2139f2faecb810519e90b833" : "Add Notification Keywords"
+  "790f855c2139f2faecb810519e90b833" : "Add Notification Keywords",
+  "ded4cba1b04eb8236e24a3e39470d8a7" : "Select Campaign"
  },
  "items" : [
   {
    "background" : true,
    "title" : "Add Notification Keywords",
    "xtype" : "LayoutDialog",
-   "width" : 400,
+   "width" : 600,
    "$ xns" : "Roo",
    "closable" : false,
    "resizable" : false,
-   "height" : 150,
+   "height" : 180,
    "items" : [
     {
      "xtype" : "LayoutRegion",
      "items" : [
       {
        "listeners" : {
-        "|actioncomplete" : "function (_self, action)\n{\n  if (action.type == 'setdata') {\n\n       return;\n    }\n    if (action.type == 'load') {\n        _this.dialog.el.unmask();\n        return;\n    }\n    if (action.type == 'submit' ) {\n        _this.dialog.el.unmask();\n        _this.dialog.hide();\n\n        if (_this.callback) {\n           _this.callback.call(_this, action.result.data);\n        }\n        _this.form.reset();\n    }\n}\n",
+        "|actioncomplete" : "function (_self, action)\n{\n  if (action.type == 'setdata') {\n        \n        if(_this.data.id){\n            _this.dialog.el.mask(\"Loading\");\n            this.load({ method: 'GET', params: { '_id' : _this.data.id }}); \n        }\n        \n        return;\n    }\n    if (action.type == 'load') {\n        \n        _this.dialog.el.unmask();\n        \n        _this.data = action.result.data;\n        \n        if(typeof(_this.data.keywords) != 'undefined'){\n            var n = Roo.decode(_this.data.keywords);\n            _this.form.findField('keyword_filters').setValue(n);\n        }\n        \n        return;\n    }\n    if (action.type == 'submit' ) {\n        _this.dialog.el.unmask();\n        _this.dialog.hide();\n\n        if (_this.callback) {\n           _this.callback.call(_this, action.result.data);\n        }\n        _this.form.reset();\n    }\n}\n",
         "|rendered" : "function (form)\n{\n   _this.form = form;\n}"
        },
-       "$ url" : "baseURL + '/Roo/core_enum.php'",
+       "$ url" : "baseURL + '/Roo/Core_notify_recur.php'",
        "xtype" : "Form",
        "method" : "POST",
        "style" : "margin: 5px",
        "$ xns" : "Roo.form",
        "items" : [
         {
-         "fieldLabel" : "Name",
-         "hidden" : true,
-         "xtype" : "TextField",
+         "alwaysQuery" : true,
+         "listWidth" : 400,
+         "triggerAction" : "all",
+         "fieldLabel" : "Campaign",
+         "forceSelection" : true,
+         "selectOnFocus" : true,
+         "pageSize" : 20,
+         "Number width" : 400,
+         "displayField" : "name",
+         "emptyText" : "Select Campaign",
+         "hiddenName" : "campaign_id",
+         "minChars" : 2,
+         "valueField" : "id",
+         "xtype" : "ComboBox",
          "allowBlank" : false,
-         "actionMode" : "fieldEl",
-         "width" : 200,
+         "typeAhead" : false,
+         "editable" : true,
          "$ xns" : "Roo.form",
-         "name" : "name"
+         "name" : "campaign_id_name",
+         "qtip" : "Select campaign",
+         "queryParam" : "query[name]",
+         "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b></div>",
+         "loadingText" : "Searching...",
+         "items" : [
+          {
+           "listeners" : {
+            "|beforeload" : "function (_self, o){\n    o.params = o.params || {};\n    \n}\n"
+           },
+           "xtype" : "Store",
+           "remoteSort" : true,
+           "$ sortInfo" : "{ direction : 'DESC', field: 'id' }",
+           "$ xns" : "Roo.data",
+           "* prop" : "store",
+           "items" : [
+            {
+             "$ url" : "baseURL + '/Roo/Projects.php'",
+             "method" : "GET",
+             "xtype" : "HttpProxy",
+             "$ xns" : "Roo.data",
+             "* prop" : "proxy"
+            },
+            {
+             "id" : "id",
+             "root" : "data",
+             "xtype" : "JsonReader",
+             "$ xns" : "Roo.data",
+             "$ fields" : "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"name\",\"type\":\"string\"}]",
+             "* prop" : "reader",
+             "totalProperty" : "total"
+            }
+           ]
+          }
+         ]
         },
         {
-         "listeners" : {
-          "keyup" : "function (_self, e)\n{\n    _this.form.findField('name').setValue(this.getValue().replace(/[^a-z0-9]/ig, '').toUpperCase());\n    \n}"
-         },
-         "fieldLabel" : "Display Name",
-         "xtype" : "TextField",
-         "allowBlank" : false,
-         "width" : 200,
-         "$ xns" : "Roo.form",
-         "name" : "display_name"
-        },
-        {
-         "String actionMode" : "fieldEl",
-         "Boolean checked" : true,
-         "fieldLabel" : "Active",
-         "inputValue" : 1,
-         "hidden" : true,
-         "value" : 1,
-         "xtype" : "Checkbox",
-         "valueOff" : 0,
-         "$ xns" : "Roo.form",
-         "name" : "active"
-        },
-        {
-         "xtype" : "Hidden",
-         "$ xns" : "Roo.form",
-         "name" : "etype"
-        },
-        {
-         "xtype" : "Hidden",
-         "value" : 0,
+         "Boolean allowBlank" : false,
+         "fieldLabel" : "Keywords",
+         "hiddenName" : "keyword_filters",
+         "xtype" : "ComboBoxArray",
+         "width" : 410,
          "$ xns" : "Roo.form",
-         "name" : "seqid"
+         "name" : "keyword_filters_name",
+         "items" : [
+          {
+           "alwaysQuery" : true,
+           "listWidth" : 400,
+           "triggerAction" : "all",
+           "fieldLabel" : "Keyword",
+           "forceSelection" : true,
+           "displayField" : "keyword",
+           "minChars" : 2,
+           "valueField" : "id",
+           "xtype" : "ComboBox",
+           "allowBlank" : true,
+           "editable" : true,
+           "width" : 400,
+           "$ xns" : "Roo.form",
+           "* prop" : "combo",
+           "queryParam" : "query[keyword]",
+           "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{keyword}</b> </div>",
+           "items" : [
+            {
+             "listeners" : {
+              "beforeload" : "function (_self, o){\n    o.params = o.params || {};\n    \n    var s = _this.form.findField('campaign_id').getValue() * 1;\n    \n    if(isNaN(s) || s < 1){\n        return false;\n    }\n    \n    o.params.is_active  = 1;\n    o.params.is_keyword = 1;\n    o.params.project_id = s;\n}\n"
+             },
+             "xtype" : "Store",
+             "remoteSort" : true,
+             "$ sortInfo" : "{ direction : 'ASC', field: 'display_name' }",
+             "$ xns" : "Roo.data",
+             "* prop" : "store",
+             "items" : [
+              {
+               "$ url" : "baseURL + '/Roo/clipping_keywords.php'",
+               "xtype" : "HttpProxy",
+               "method" : "GET",
+               "$ xns" : "Roo.data",
+               "* prop" : "proxy"
+              },
+              {
+               "id" : "code",
+               "root" : "data",
+               "xtype" : "JsonReader",
+               "$ fields" : "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"keyword\",\"type\":\"string\"}]",
+               "$ xns" : "Roo.data",
+               "* prop" : "reader",
+               "totalProperty" : "total"
+              }
+             ]
+            }
+           ]
+          }
+         ]
         },
         {
          "xtype" : "Hidden",
     },
     {
      "listeners" : {
-      "|click" : "function() {\n\n    var name =     _this.form.findField('name').getValue();\n    name = name.toUpperCase().replace(/[^A-Z]+/g, '');\n    if (!name.length) {\n        Roo.MessageBox.alert(\"Error\",\"Please fill in a valid name\");\n        return;\n    }\n    _this.form.findField('name').setValue(name);\n \n    _this.form.doAction('submit');\n    \n}"
+      "|click" : "function() {\n    \n    _this.form.doAction('submit');\n    \n}"
      },
      "text" : "OK",
      "xtype" : "Button",