- "listeners": {
- "|activate": "function() {\n _this.panel = this;\n if (_this.grid) {\n// _this.grid.footer.onClick('first');\n }\n}"
- },
- "background": false,
- "fitContainer": true,
- "fitToFrame": true,
- "region": "center",
- "tableName": "core_notify_recur",
- "title": "core_notify_recur",
- "xtype": "GridPanel",
- "|xns": "Roo",
- "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}",
- "|rowdblclick": "function (_self, rowIndex, e)\n{\n if (!_this.dialog) return;\n _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() {\n _this.grid.footer.onClick('first');\n }); \n}\n",
- "afteredit": "function (e)\n{\n e.record.commit();\n}"
- },
- "*prop": "grid",
- "autoExpandColumn": "freq_day",
- "clicksToEdit": 1,
- "loadMask": true,
- "xtype": "EditorGrid",
- "|xns": "Roo.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}"
- },
- "*prop": "dataSource",
- "remoteSort": true,
- "xtype": "Store",
- "|sortInfo": "{ field : 'freq', direction: 'ASC' }",
- "|xns": "Roo.data",
- "items": [
- {
- "*prop": "proxy",
- "xtype": "HttpProxy",
- "method": "GET",
- "|url": "baseURL + '/Roo/core_notify_recur.php'",
- "|xns": "Roo.data"
- },
- {
- "*prop": "reader",
- "id": "id",
- "root": "data",
- "totalProperty": "total",
- "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": "toolbar",
- "xtype": "Toolbar",
- "|xns": "Roo",
- "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,\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"
- },
- "cls": "x-btn-text-icon",
- "text": "Add",
- "xtype": "Button",
- "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
- "|xns": "Roo.Toolbar"
- },
- {
- "|xns": "Roo.Toolbar",
- "xtype": "Fill"
- },
- {
- "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 "
- },
- "cls": "x-btn-text-icon",
- "text": "Delete",
- "xtype": "Button",
- "|icon": "rootURL + '/Pman/templates/images/trash.gif'",
- "|xns": "Roo.Toolbar"
- }
- ]
- },
- {
- "*prop": "colModel[]",
- "dataIndex": "dtstart",
- "header": "From",
- "width": 75,
- "xtype": "ColumnModel",
- "|renderer": "function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }",
- "|xns": "Roo.grid",
- "items": [
- {
- "|xns": "Roo.grid",
- "xtype": "GridEditor",
- "*prop": "editor",
- "items": [
- {
- "|xns": "Roo.form",
- "xtype": "DateField",
- "*prop": "field"
- }
- ]
- }
- ]
- },
- {
- "*prop": "colModel[]",
- "dataIndex": "dtend",
- "header": "Until",
- "width": 75,
- "xtype": "ColumnModel",
- "|renderer": "function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }",
- "|xns": "Roo.grid",
- "items": [
- {
- "|xns": "Roo.grid",
- "xtype": "GridEditor",
- "*prop": "editor",
- "items": [
- {
- "|xns": "Roo.form",
- "xtype": "DateField",
- "*prop": "field"
- }
- ]
- }
- ]
- },
- {
- "*prop": "colModel[]",
- "dataIndex": "freq_day",
- "header": "on day(s)",
- "width": 100,
- "xtype": "ColumnModel",
- "|renderer": "function(v,x,r) { \n \n if (v.length) {\n \n var cm = _this.grid.colModel;\n \n var ci = cm.getColumnByDataIndex(this.name);\n \n var tv = [];\n var vals = Roo.decode(v);\n Roo.each(vals, function(k) {\n var r = this.findRecord(this.valueField, k);\n if(r){\n tv.push(r.data[this.displayField]);\n }else if(this.valueNotFoundText !== undefined){\n tv.push( this.valueNotFoundText );\n }\n },ci.editor.field);\n\n r.data[this.name + '_name'] = tv.join(', ');\n return String.format('{0}',tv.join(', '));\n\n \n \n }\n r.data[this.name + '_name'] = '';\n return String.format('{0}', r.data.freq_day_name || v); \n \n}",
- "|xns": "Roo.grid",
- "items": [
- {
- "|xns": "Roo.grid",
- "xtype": "GridEditor",
- "*prop": "editor",
- "items": [
- {
- "*prop": "field",
- "allowBlank": false,
- "displayField": "title",
- "editable": false,
- "fieldLabel": "Country",
- "hiddenName": "freq_day",
- "listWidth": 300,
- "mode": "local",
- "name": "freq_day_name",
- "pageSize": 40,
- "triggerAction": "all",
- "valueField": "code",
- "xtype": "ComboCheck",
- "|xns": "Roo.form",
- "items": [
- {
- "*prop": "store",
- "xtype": "SimpleStore",
- "|data": "(function() { \n var ret = [];\n Roo.each(Date.dayNames, function(d) {\n ret.push([ d.substring(0,3).toUpperCase(), d ]);\n });\n return ret;\n})()",
- "|fields": "['code', 'title']",
- "|sortInfo": "{ field : 'title', direction: 'ASC' }",
- "|xns": "Roo.data"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "*prop": "colModel[]",
- "dataIndex": "freq_hour",
- "header": "at Hour(s)",
- "width": 250,
- "xtype": "ColumnModel",
- "|renderer": "function(v,x,r) { \n \n \n if (v.length) {\n \n var cm = _this.grid.colModel;\n \n var ci = cm.getColumnByDataIndex(this.name);\n \n var tv = [];\n var vals = Roo.decode(v);\n Roo.each(vals, function(k) {\n var r = this.findRecord(this.valueField, k);\n if(r){\n tv.push(r.data[this.displayField]);\n }else if(this.valueNotFoundText !== undefined){\n tv.push( this.valueNotFoundText );\n }\n },ci.editor.field);\n\n r.data[this.name + '_name'] = tv.join(', ');\n return String.format('{0}',tv.join(', '));\n\n \n \n }\n r.data[this.name + '_name'] = '';\n return String.format('{0}', r.data.freq_hour_name || v); \n \n}",
- "|xns": "Roo.grid",
- "items": [
- {
- "|xns": "Roo.grid",
- "xtype": "GridEditor",
- "*prop": "editor",
- "items": [
- {
- "*prop": "field",
- "allowBlank": false,
- "displayField": "title",
- "editable": false,
- "fieldLabel": "Country",
- "hiddenName": "freq_hour",
- "listWidth": 300,
- "mode": "local",
- "name": "freq_hour_name",
- "pageSize": 40,
- "triggerAction": "all",
- "valueField": "code",
- "xtype": "ComboCheck",
- "|xns": "Roo.form",
- "items": [
- {
- "*prop": "store",
- "xtype": "SimpleStore",
- "|data": "(function() { \n var ret = [];\n for (var i = 5; i < 25; i++) {\n var h = i < 10 ? ('0' + i) : i;\n var mer = i < 12 || i > 23 ? 'am' : 'pm';\n var dh = i < 13 ? i : i-12;\n \n ret.push([ h+':00', dh+':00' + mer ]);\n ret.push([ h+':00', dh+':30' + mer ]); \n }\n return ret;\n})()",
- "|fields": "['code', 'title']",
- "|sortInfo": "{ field : 'title', direction: 'ASC' }",
- "|xns": "Roo.data"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "*prop": "colModel[]",
- "dataIndex": "tz",
- "header": "Timezone",
- "width": 100,
- "xtype": "ColumnModel",
- "|renderer": "function(v) { return String.format('{0}', v); }",
- "|xns": "Roo.grid",
- "items": [
- {
- "|xns": "Roo.grid",
- "xtype": "GridEditor",
- "*prop": "editor",
- "items": [
- {
- "*prop": "field",
- "allowBlank": "false",
- "editable": true,
- "emptyText": "Select timezone",
- "fieldLabel": "core_enum",
- "forceSelection": true,
- "listWidth": 400,
- "loadingText": "Searching...",
- "minChars": 2,
- "name": "tz",
- "pageSize": 999,
- "qtip": "Select timezone",
- "queryParam": "q",
- "selectOnFocus": true,
- "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{tz}</b> </div>",
- "triggerAction": "all",
- "typeAhead": true,
- "valueField": "tz",
- "width": 300,
- "xtype": "ComboBox",
- "|xns": "Roo.form",
- "items": [
- {
- "listeners": {
- "|beforeload": "function (_self, o){\n o.params = o.params || {};\n // set more here\n}\n"
- },
- "*prop": "store",
- "remoteSort": true,
- "xtype": "Store",
- "|sortInfo": "{ direction : 'ASC', field: 'tz' }",
- "|xns": "Roo.data",
- "items": [
- {
- "*prop": "proxy",
- "method": "GET",
- "xtype": "HttpProxy",
- "|url": "baseURL + '/Core/I18n/Timezone.php'\n",
- "|xns": "Roo.data"
- },
- {
- "*prop": "reader",
- "id": "id",
- "root": "data",
- "totalProperty": "total",
- "xtype": "JsonReader",
- "|fields": "[{\"name\":\"tz\",\"type\":\"string\"}]",
- "|xns": "Roo.data"
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "xtype": "ColumnModel",
- "header": "Last event",
- "width": 75,
- "dataIndex": "last_event_id",
- "|renderer": "function(v) { return String.format('{0}', v); }",
- "|xns": "Roo.grid",
- "*prop": "colModel[]"
- }
- ]
- }
- ]
+ "id" : "id",
+ "root" : "data",
+ "xtype" : "JsonReader",
+ "$ xns" : "Roo.data",
+ "$ fields" : "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"etype\",\"type\":\"string\"}]",
+ "* prop" : "reader",
+ "totalProperty" : "total"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "xtype" : "ColumnModel",
+ "width" : 75,
+ "header" : "From",
+ "$ renderer" : "function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }",
+ "$ xns" : "Roo.grid",
+ "* prop" : "colModel[]",
+ "dataIndex" : "dtstart",
+ "items" : [
+ {
+ "xtype" : "GridEditor",
+ "$ xns" : "Roo.grid",
+ "* prop" : "editor",
+ "items" : [
+ {
+ "xtype" : "DateField",
+ "$ xns" : "Roo.form",
+ "* prop" : "field"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "xtype" : "ColumnModel",
+ "width" : 75,
+ "header" : "Until",
+ "$ renderer" : "function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }",
+ "$ xns" : "Roo.grid",
+ "* prop" : "colModel[]",
+ "dataIndex" : "dtend",
+ "items" : [
+ {
+ "xtype" : "GridEditor",
+ "$ xns" : "Roo.grid",
+ "* prop" : "editor",
+ "items" : [
+ {
+ "xtype" : "DateField",
+ "$ xns" : "Roo.form",
+ "* prop" : "field"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "xtype" : "ColumnModel",
+ "width" : 150,
+ "header" : "on day(s)",
+ "$ renderer" : "function(v,x,r) { \n \n if (v.length) {\n \n var cm = _this.grid.colModel;\n \n var ci = cm.getColumnByDataIndex(this.name);\n \n var tv = [];\n var vals = Roo.decode(v);\n Roo.each(vals, function(k) {\n var r = this.findRecord(this.valueField, k);\n if(r){\n tv.push(r.data[this.displayField]);\n }else if(this.valueNotFoundText !== undefined){\n tv.push( this.valueNotFoundText );\n }\n },ci.editor.field);\n\n r.data[this.name + '_name'] = tv.join(', ');\n return String.format('{0}',tv.join(', '));\n\n \n \n }\n r.data[this.name + '_name'] = '';\n return String.format('{0}', r.data.freq_day_name || v); \n \n}",
+ "$ xns" : "Roo.grid",
+ "* prop" : "colModel[]",
+ "dataIndex" : "freq_day",
+ "items" : [
+ {
+ "xtype" : "GridEditor",
+ "$ xns" : "Roo.grid",
+ "* prop" : "editor",
+ "items" : [
+ {
+ "listWidth" : 300,
+ "triggerAction" : "all",
+ "fieldLabel" : "Country",
+ "pageSize" : 40,
+ "displayField" : "title",
+ "hiddenName" : "freq_day",
+ "valueField" : "code",
+ "xtype" : "ComboCheck",
+ "allowBlank" : false,
+ "editable" : false,
+ "$ xns" : "Roo.form",
+ "* prop" : "field",
+ "mode" : "local",
+ "name" : "freq_day_name",
+ "items" : [
+ {
+ "| data" : "(function() { \n var ret = [];\n Roo.each(Date.dayNames, function(d) {\n ret.push([ d.substring(0,3).toUpperCase(), d ]);\n });\n return ret;\n})()",
+ "xtype" : "SimpleStore",
+ "$ fields" : "['code', 'title']",
+ "$ sortInfo" : "{ field : 'title', direction: 'ASC' }",
+ "$ xns" : "Roo.data",
+ "* prop" : "store"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "xtype" : "ColumnModel",
+ "width" : 100,
+ "header" : "at Hour(s)",
+ "$ renderer" : "function(v,x,r) { \n \n \n if (v.length) {\n \n var cm = _this.grid.colModel;\n \n var ci = cm.getColumnByDataIndex(this.name);\n \n var tv = [];\n var vals = Roo.decode(v);\n Roo.each(vals, function(k) {\n var r = this.findRecord(this.valueField, k);\n if(r){\n tv.push(r.data[this.displayField]);\n }else if(this.valueNotFoundText !== undefined){\n tv.push( this.valueNotFoundText );\n }\n },ci.editor.field);\n\n r.data[this.name + '_name'] = tv.join(', ');\n return String.format('{0}',tv.join(', '));\n\n \n \n }\n r.data[this.name + '_name'] = '';\n return String.format('{0}', r.data.freq_hour_name || v); \n \n}",
+ "$ xns" : "Roo.grid",
+ "* prop" : "colModel[]",
+ "dataIndex" : "freq_hour",
+ "items" : [
+ {
+ "xtype" : "GridEditor",
+ "$ xns" : "Roo.grid",
+ "* prop" : "editor",
+ "items" : [
+ {
+ "listWidth" : 300,
+ "triggerAction" : "all",
+ "fieldLabel" : "Country",
+ "pageSize" : 40,
+ "displayField" : "title",
+ "hiddenName" : "freq_hour",
+ "valueField" : "code",
+ "xtype" : "ComboCheck",
+ "allowBlank" : false,
+ "editable" : false,
+ "$ xns" : "Roo.form",
+ "* prop" : "field",
+ "mode" : "local",
+ "name" : "freq_hour_name",
+ "items" : [
+ {
+ "| data" : "(function() { \n var ret = [];\n for (var i = 5; i < 25; i++) {\n var h = i < 10 ? ('0' + i) : i;\n var mer = i < 12 || i > 23 ? 'am' : 'pm';\n var dh = i < 13 ? i : i-12;\n \n ret.push([ h+':00', dh+':00' + mer ]);\n ret.push([ h+':30', dh+':30' + mer ]); \n }\n return ret;\n})()",
+ "xtype" : "SimpleStore",
+ "$ fields" : "['code', 'title']",
+ "$ sortInfo" : "{ field : 'title', direction: 'ASC' }",
+ "$ xns" : "Roo.data",
+ "* prop" : "store"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "xtype" : "ColumnModel",
+ "width" : 100,
+ "header" : "Timezone",
+ "$ renderer" : "function(v) { return String.format('{0}', v); }",
+ "$ xns" : "Roo.grid",
+ "* prop" : "colModel[]",
+ "dataIndex" : "tz",
+ "items" : [
+ {
+ "xtype" : "GridEditor",
+ "$ xns" : "Roo.grid",
+ "* prop" : "editor",
+ "items" : [
+ {
+ "listWidth" : 400,
+ "triggerAction" : "all",
+ "fieldLabel" : "core_enum",
+ "forceSelection" : true,
+ "selectOnFocus" : true,
+ "pageSize" : 999,
+ "displayField" : "tz",
+ "emptyText" : "Select timezone",
+ "minChars" : 2,
+ "xtype" : "ComboBox",
+ "allowBlank" : false,
+ "typeAhead" : true,
+ "editable" : true,
+ "width" : 300,
+ "$ xns" : "Roo.form",
+ "* prop" : "field",
+ "name" : "tz",
+ "qtip" : "Select timezone",
+ "queryParam" : "q",
+ "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{tz}</b> </div>",
+ "loadingText" : "Searching...",
+ "items" : [
+ {
+ "listeners" : {
+ "|beforeload" : "function (_self, o){\n o.params = o.params || {};\n // set more here\n}\n"
+ },
+ "xtype" : "Store",
+ "remoteSort" : true,
+ "$ sortInfo" : "{ direction : 'ASC', field: 'tz' }",
+ "$ xns" : "Roo.data",
+ "* prop" : "store",
+ "items" : [
+ {
+ "$ url" : "baseURL + '/Core/I18n/Timezone.php'\n",
+ "method" : "GET",
+ "xtype" : "HttpProxy",
+ "$ xns" : "Roo.data",
+ "* prop" : "proxy"