{ "name" : "Pman.Dialog.CoreNotifyRecur", "parent" : "", "title" : "", "path" : "/home/edward/gitlive/Pman.Core/Pman.Dialog.CoreNotifyRecur.bjs", "permname" : "", "modOrder" : "001", "strings" : { "3728af837fe70019577ddb0ed7125ee5" : "Until", "ec211f7c20af43e742bf2570c3cb84f9" : "Add", "023a5dfa857c4aa0156e6685231a1dbd" : "Select Type", "6c768695a8efb18436d5b7b4374cdb45" : "Select core_enum", "157e432ec303efd7d537b653cb255ccc" : "on day(s)", "236df51bb0e6416236e255b528346fca" : "Timezone", "44c68bed631ff6e62aecc4a4d32176e6" : "Select timezone", "1243daf593fa297e07ab03bf06d925af" : "Searching...", "b26686c0a708faee42861d8b905e882e" : "Last Sent", "c1d32776cd2d2afcd2c45a52f58679f4" : "Modify Recurrent Notifications", "5da618e8e4b89c66fe86e32cdafde142" : "From", "ce527d7432bab413730f25c794648e46" : "at Hour(s)", "c7179f16884513c990b6cbf44aef7fc3" : "core_notify_recur", "f2a6c498fb90ee345d997f888fce3b18" : "Delete", "a1fa27779242b4902f7ae3bdd5c6d508" : "Type", "f92965e2c8a7afb3c1b9a5c09a263636" : "Done" }, "items" : [ { "listeners" : { "show" : "function (_self)\n{\n _this.grid.ds.load({});\n}" }, "modal" : true, "xtype" : "LayoutDialog", "title" : "Modify Recurrent Notifications", "width" : 800, "$ xns" : "Roo", "resizable" : true, "height" : 550, "items" : [ { "loadOnce" : true, "autoScroll" : true, "xtype" : "LayoutRegion", "$ xns" : "Roo", "* prop" : "center" }, { "listeners" : { "|activate" : "function() {\n _this.panel = this;\n if (_this.grid) {\n// _this.grid.footer.onClick('first');\n }\n}" }, "region" : "center", "fitToFrame" : true, "background" : false, "title" : "core_notify_recur", "xtype" : "GridPanel", "fitContainer" : true, "$ xns" : "Roo", "tableName" : "core_notify_recur", "items" : [ { "listeners" : { "|render" : "function() \n{\n _this.grid = this; \n //_this.dialog = Pman.Dialog.FILL_IN\n if (_this.panel.active) {\n // this.footer.onClick('first');\n }\n}", "afteredit" : "function (e)\n{\n e.record.commit();\n}" }, "autoExpandColumn" : "freq_day", "xtype" : "EditorGrid", "loadMask" : true, "clicksToEdit" : 1, "$ xns" : "Roo.grid", "* prop" : "grid", "items" : [ { "listeners" : { "update" : "function (_self, record, operation)\n{\n //Roo.log(operation);\n if (operation != 'commit') {\n return;\n }\n var p = Roo.apply({}, record.data);\n p.dtstart = record.data.dtstart.format('Y-m-d');\n p.dtend = record.data.dtend.format('Y-m-d'); \n \n \n new Pman.Request({\n url : baseURL + '/Roo/Core_notify_recur',\n method :'POST',\n params : p,\n success : function(data)\n {\n //Roo.log(data);\n record.set('id', data.data.id);\n },\n failure : function() {\n Roo.MessageBox.alert(\"Error\", \"There was a problem saving\");\n }\n });\n \n \n \n}", "beforeload" : "function (_self, o)\n{\n if (!_this.data) {\n return false;\n }\n o.params = Roo.apply(o.params || {}, {\n person_id : _this.data.person_id,\n onid : _this.data.onid,\n ontable : _this.data.ontable,\n method : _this.data.method\n });\n \n}" }, "xtype" : "Store", "remoteSort" : true, "$ sortInfo" : "{ field : 'freq', direction: 'ASC' }", "$ xns" : "Roo.data", "* prop" : "dataSource", "items" : [ { "$ url" : "baseURL + '/Roo/core_notify_recur.php'", "xtype" : "HttpProxy", "method" : "GET", "$ xns" : "Roo.data", "* prop" : "proxy" }, { "id" : "id", "root" : "data", "xtype" : "JsonReader", "$ fields" : "[\n {\n 'name': 'id',\n 'type': 'int'\n },\n {\n 'name': 'person_id',\n 'type': 'int'\n },\n {\n 'name': 'dtstart',\n 'type': 'date',\n 'dateFormat': 'Y-m-d'\n },\n {\n 'name': 'dtend',\n 'type': 'date',\n 'dateFormat': 'Y-m-d'\n },\n {\n 'name': 'tz',\n 'type': 'float'\n },\n {\n 'name': 'last_applied_dt',\n 'type': 'date',\n 'dateFormat': 'Y-m-d'\n },\n {\n 'name': 'freq',\n 'type': 'string'\n },\n {\n 'name': 'freq_day',\n 'type': 'string'\n },\n {\n 'name': 'freq_hour',\n 'type': 'string'\n },\n {\n 'name': 'last_event_id',\n 'type': 'int'\n },\n {\n 'name': 'method',\n 'type': 'string'\n }\n]", "$ xns" : "Roo.data", "* prop" : "reader", "totalProperty" : "total" } ] }, { "xtype" : "Toolbar", "$ xns" : "Roo", "* prop" : "toolbar", "items" : [ { "listeners" : { "|click" : "function()\n{\n var grid = _this.grid;\n var r = grid.getDataSource().reader.newRow({\n // defaults..\n person_id : _this.data.person_id,\n dtstart : new Date(),\n dtend : Date.parseDate('2050-01-01', 'Y-m-d'),\n tz : 'Asia/Hong_Kong',\n onid : _this.data.onid,\n ontable : _this.data.ontable,\n method : _this.data.method, // default...\n \n method_id : _this.data.method_id, // default...\n method_id_display_name : _this.data.method_id_display_name, // default... \n \n last_event_id : 0,\n freq_day_name : '',\n freq_hour_name : '',\n freq_name : ''\n \n \n });\n grid.stopEditing();\n grid.getDataSource().insert(0, r); \n grid.startEditing(0, 2); \n \n\n}\n" }, "text" : "Add", "xtype" : "Button", "cls" : "x-btn-text-icon", "$ icon" : "Roo.rootURL + 'images/default/dd/drop-add.gif'", "$ xns" : "Roo.Toolbar" }, { "xtype" : "Fill", "$ xns" : "Roo.Toolbar" }, { "listeners" : { "|click" : "function()\n{\n _this.grid.stopEditing();\n var s = _this.grid.selModel.getSelectedCell();\n if (!s) {\n Roo.MessageBox.alert(\"Error\", \"Select row\");\n return;\n }\n \n new Pman.Request({\n url : baseURL + '/Roo/core_notify_recur',\n method : 'POST',\n params : {\n _delete : _this.grid.ds.getAt(s[0]).data.id\n }, \n success : function() {\n _this.grid.ds.load({});\n },\n failure : function() {\n Roo.MessageBox.alert(\"Error\", \"Deleting failed - try reloading\");\n }\n });\n \n}\n " }, "text" : "Delete", "xtype" : "Button", "cls" : "x-btn-text-icon", "$ icon" : "rootURL + '/Pman/templates/images/trash.gif'", "$ xns" : "Roo.Toolbar" } ] }, { "xtype" : "ColumnModel", "width" : 120, "header" : "Type", "$ renderer" : "function(v,x,r) {\n return String.format('{0}', r.data.method_id_display_name); \n}", "$ xns" : "Roo.grid", "* prop" : "colModel[]", "dataIndex" : "method_id", "items" : [ { "xtype" : "GridEditor", "$ xns" : "Roo.grid", "* prop" : "editor", "items" : [ { "listWidth" : 400, "triggerAction" : "all", "fieldLabel" : "core_enum", "forceSelection" : true, "selectOnFocus" : true, "pageSize" : 20, "displayField" : "display_name", "emptyText" : "Select Type", "hiddenName" : "method_id", "valueField" : "id", "xtype" : "ComboBox", "allowBlank" : false, "typeAhead" : true, "editable" : false, "width" : 300, "$ xns" : "Roo.form", "* prop" : "field", "name" : "method_id_display_name", "qtip" : "Select core_enum", "tpl" : "