Fix #6685 - more changes as per inspection master xls
authorAlan Knowles <alan@roojs.com>
Tue, 27 Apr 2021 09:52:26 +0000 (17:52 +0800)
committerAlan Knowles <alan@roojs.com>
Tue, 27 Apr 2021 09:52:26 +0000 (17:52 +0800)
DataObjects/Core_setting.php
Pman.Dialog.CoreColumnConfig.bjs [new file with mode: 0644]
Pman.Dialog.CoreColumnConfig.js [new file with mode: 0644]
Pman.Download.js

index 97ec8bd..e1eea76 100644 (file)
@@ -55,7 +55,11 @@ class Pman_Core_DataObjects_Core_setting extends DB_DataObject
     
     function beforeInsert($q, $roo)
     {
-        exit;
+        if (isset($q['is_encrypt'])) {
+            $roo->jerr("no direct access for setting encrypted data at present?");
+        }
+        // we store column data in here now - so it has to be insertable.
+        //exit;
     }
     
     function getKeyDirectory()
diff --git a/Pman.Dialog.CoreColumnConfig.bjs b/Pman.Dialog.CoreColumnConfig.bjs
new file mode 100644 (file)
index 0000000..1bff557
--- /dev/null
@@ -0,0 +1,113 @@
+{
+ "name" : "Pman.Dialog.CoreColumnConfig",
+ "parent" : "",
+ "title" : "",
+ "path" : "/home/alan/gitlive/Pman.Core/Pman.Dialog.CoreColumnConfig.bjs",
+ "permname" : "",
+ "modOrder" : "001",
+ "strings" : {
+  "cfcd208495d565ef66e7dff9f98764da" : "0",
+  "ea4788705e6873b424c65e91c2846b19" : "Cancel",
+  "c40cab5f875bb6c270d800eff77a4af0" : "Save Column Configuration",
+  "b5a7adde1af5c87d7fd797b6245c2a39" : "Description",
+  "c9cc8cce247e49bae79f15173ce97354" : "Save"
+ },
+ "named_strings" : {
+  "description_fieldLabel" : "b5a7adde1af5c87d7fd797b6245c2a39",
+  "name_value" : "cfcd208495d565ef66e7dff9f98764da"
+ },
+ "items" : [
+  {
+   "listeners" : {
+    "show" : "function (_self)\n{\n    \n}"
+   },
+   "modal" : true,
+   "collapsible" : false,
+   "background" : true,
+   "title" : "Save Column Configuration",
+   "xtype" : "LayoutDialog",
+   "width" : 400,
+   "$ xns" : "Roo",
+   "closable" : false,
+   "resizable" : false,
+   "height" : 110,
+   "items" : [
+    {
+     "xtype" : "LayoutRegion",
+     "$ xns" : "Roo",
+     "titlebar" : false,
+     "* prop" : "center"
+    },
+    {
+     "background" : true,
+     "region" : "center",
+     "fitToFrame" : true,
+     "xtype" : "ContentPanel",
+     "$ xns" : "Roo",
+     "items" : [
+      {
+       "listeners" : {
+        "|actioncomplete" : "function (_self, action)\n{\n  if (action.type == 'setdata') {\n\n        \n        \n        if(typeof(_this.data.title) != 'undefined' && _this.data.title.length){\n            _this.dialog.setTitle(_this.data.title);\n        }\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        _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",
+        "|rendered" : "function (form)\n{\n   _this.form = form;\n}"
+       },
+       "$ url" : "baseURL + '/Roo/core_setting'",
+       "method" : "POST",
+       "xtype" : "Form",
+       "style" : "padding:5px",
+       "$ xns" : "Roo.form",
+       "items" : [
+        {
+         "fieldLabel" : "Description",
+         "xtype" : "TextField",
+         "allowBlank" : false,
+         "width" : 250,
+         "$ xns" : "Roo.form",
+         "name" : "description"
+        },
+        {
+         "xtype" : "Hidden",
+         "$ xns" : "Roo.form",
+         "name" : "module"
+        },
+        {
+         "xtype" : "Hidden",
+         "$ xns" : "Roo.form",
+         "name" : "val"
+        },
+        {
+         "xtype" : "Hidden",
+         "value" : 0,
+         "$ xns" : "Roo.form",
+         "name" : "name"
+        },
+        {
+         "xtype" : "Hidden",
+         "$ xns" : "Roo.form",
+         "name" : "id"
+        }
+       ]
+      }
+     ]
+    },
+    {
+     "listeners" : {
+      "|click" : "function() {\n    _this.form.reset();\n    _this.dialog.hide();\n}"
+     },
+     "text" : "Cancel",
+     "xtype" : "Button",
+     "$ xns" : "Roo",
+     "* prop" : "buttons[]"
+    },
+    {
+     "listeners" : {
+      "|click" : "function() {\n\n     \n    _this.form.doAction('submit');\n    \n}"
+     },
+     "text" : "Save",
+     "xtype" : "Button",
+     "$ xns" : "Roo",
+     "* prop" : "buttons[]"
+    }
+   ]
+  }
+ ]
+}
\ No newline at end of file
diff --git a/Pman.Dialog.CoreColumnConfig.js b/Pman.Dialog.CoreColumnConfig.js
new file mode 100644 (file)
index 0000000..9e9cbed
--- /dev/null
@@ -0,0 +1,191 @@
+//<script type="text/javascript">
+
+// Auto generated file - created by app.Builder.js- do not edit directly (at present!)
+
+Roo.namespace('Pman.Dialog');
+
+Pman.Dialog.CoreColumnConfig = {
+
+ _strings : {
+  'cfcd208495d565ef66e7dff9f98764da' :"0",
+  'ea4788705e6873b424c65e91c2846b19' :"Cancel",
+  'c40cab5f875bb6c270d800eff77a4af0' :"Save Column Configuration",
+  'b5a7adde1af5c87d7fd797b6245c2a39' :"Description",
+  'c9cc8cce247e49bae79f15173ce97354' :"Save"
+ },
+ _named_strings : {
+  'description_fieldLabel' : 'b5a7adde1af5c87d7fd797b6245c2a39' /* Description */ ,
+  'name_value' : 'cfcd208495d565ef66e7dff9f98764da' /* 0 */ 
+ },
+
+ dialog : false,
+ callback:  false,
+
+ show : function(data, cb)
+ {
+  if (!this.dialog) {
+   this.create();
+  }
+
+  this.callback = cb;
+  this.data = data;
+  this.dialog.show(this.data._el);
+  if (this.form) {
+   this.form.reset();
+   this.form.setValues(data);
+   this.form.fireEvent('actioncomplete', this.form,  { type: 'setdata', data: data });
+  }
+
+ },
+
+ create : function()
+ {
+   var _this = this;
+   this.dialog = Roo.factory({
+    xtype : 'LayoutDialog',
+    background : true,
+    closable : false,
+    collapsible : false,
+    height : 110,
+    modal : true,
+    resizable : false,
+    title : _this._strings['c40cab5f875bb6c270d800eff77a4af0'] /* Save Column Configuration */,
+    width : 400,
+    listeners : {
+     show : function (_self)
+      {
+          
+      }
+    },
+    xns : Roo,
+    '|xns' : 'Roo',
+    center : {
+     xtype : 'LayoutRegion',
+     titlebar : false,
+     xns : Roo,
+     '|xns' : 'Roo'
+    },
+    buttons : [
+     {
+      xtype : 'Button',
+      text : _this._strings['ea4788705e6873b424c65e91c2846b19'] /* Cancel */,
+      listeners : {
+       click : function() {
+            _this.form.reset();
+            _this.dialog.hide();
+        }
+      },
+      xns : Roo,
+      '|xns' : 'Roo'
+     },
+     {
+      xtype : 'Button',
+      text : _this._strings['c9cc8cce247e49bae79f15173ce97354'] /* Save */,
+      listeners : {
+       click : function() {
+        
+             
+            _this.form.doAction('submit');
+            
+        }
+      },
+      xns : Roo,
+      '|xns' : 'Roo'
+     }
+    ],
+    items  : [
+     {
+      xtype : 'ContentPanel',
+      background : true,
+      fitToFrame : true,
+      region : 'center',
+      xns : Roo,
+      '|xns' : 'Roo',
+      items  : [
+       {
+        xtype : 'Form',
+        method : 'POST',
+        style : 'padding:5px',
+        url : baseURL + '/Roo/core_setting',
+        listeners : {
+         actioncomplete : function (_self, action)
+          {
+            if (action.type == 'setdata') {
+          
+                  
+                  
+                  if(typeof(_this.data.title) != 'undefined' && _this.data.title.length){
+                      _this.dialog.setTitle(_this.data.title);
+                  }
+            
+                  if(_this.data.id){
+                      _this.dialog.el.mask("Loading");
+                      this.load({ method: 'GET', params: { '_id' : _this.data.id }}); 
+                  }
+                 
+                 return;
+              }
+              if (action.type == 'load') {
+                  _this.dialog.el.unmask();
+                  return;
+              }
+              if (action.type == 'submit' ) {
+                  _this.dialog.el.unmask();
+                  _this.dialog.hide();
+          
+                  if (_this.callback) {
+                     _this.callback.call(_this, action.result.data);
+                  }
+                  _this.form.reset();
+              }
+          },
+         rendered : function (form)
+          {
+             _this.form = form;
+          }
+        },
+        xns : Roo.form,
+        '|xns' : 'Roo.form',
+        items  : [
+         {
+          xtype : 'TextField',
+          allowBlank : false,
+          fieldLabel : _this._strings['b5a7adde1af5c87d7fd797b6245c2a39'] /* Description */,
+          name : 'description',
+          width : 250,
+          xns : Roo.form,
+          '|xns' : 'Roo.form'
+         },
+         {
+          xtype : 'Hidden',
+          name : 'module',
+          xns : Roo.form,
+          '|xns' : 'Roo.form'
+         },
+         {
+          xtype : 'Hidden',
+          name : 'val',
+          xns : Roo.form,
+          '|xns' : 'Roo.form'
+         },
+         {
+          xtype : 'Hidden',
+          name : 'name',
+          value : 0,
+          xns : Roo.form,
+          '|xns' : 'Roo.form'
+         },
+         {
+          xtype : 'Hidden',
+          name : 'id',
+          xns : Roo.form,
+          '|xns' : 'Roo.form'
+         }
+        ]
+       }
+      ]
+     }
+    ]
+   });
+ }
+};
index 2f16b24..4483120 100644 (file)
@@ -26,7 +26,7 @@ var t = new Pman.Download({
  
  * @cfg {String} csvCols  - use '*' to override grid coluns
  * @cfg {String} csvTitles - use '*' to override grid coluns
-
+ * @cfg {String} hiddenCols - default 'show'  (use 'hide' to not display them on download)
  
  
 * @cfg {Function} success (optional) MAY fire on download completed (fails on attachments)..
@@ -163,7 +163,7 @@ Pman.Download = function(cfg)
         }
         
     }
-    
+    Roo.MessageBox.alert("Downloading", "The file should download shortly");
     req.send(this.form);
     /*
     (function() {
@@ -196,6 +196,9 @@ Roo.apply(Pman.Download.prototype, {
     success : false,
     failure : false,
     
+    hiddenCols : 'show', // set to 'hide' to hide them..
+    
+    
     // private..
     //used by simple GET method.
     createCsvFrame: function()
@@ -328,6 +331,11 @@ Roo.apply(Pman.Download.prototype, {
         } else {
             
             Roo.each(this.grid.cm.config, function(c,i) {
+                
+                if (t.hiddenCols != 'show' && t.grid.cm.isHidden(i)) {
+                    return;
+                }
+                
                 t.params['csvCols['+i+']'] = c.dataIndex;
                 t.params['csvTitles['+i+']'] = c.header;