[pgadmin-hackers] Fix for issue RM1348 [pgadmin4]

2016-06-13 Thread Harshal Dhumal
Hi,

PFA patch for issue RM1348.

Issue fixed: Not to show multiple 'Reset Layout' options under file menu.
Also restructured code related to reset layout functionality.

-- 
*Harshal Dhumal*
*Software Engineer*

EnterpriseDB India: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
diff --git a/web/pgadmin/browser/templates/browser/js/browser.js b/web/pgadmin/browser/templates/browser/js/browser.js
index 91aaa81..ae99ff6 100644
--- a/web/pgadmin/browser/templates/browser/js/browser.js
+++ b/web/pgadmin/browser/templates/browser/js/browser.js
@@ -12,8 +12,7 @@ function(require, $, _, S, Bootstrap, pgAdmin, alertify, CodeMirror) {
 
   // Some scripts do export their object in the window only.
   // Generally the one, which do no have AMD support.
-  var wcDocker = window.wcDocker,
-onbeforeunload_flag = true;
+  var wcDocker = window.wcDocker;
   $ = $ || window.jQuery || window.$;
   Bootstrap = Bootstrap || window.Bootstrap;
 
@@ -256,19 +255,9 @@ function(require, $, _, S, Bootstrap, pgAdmin, alertify, CodeMirror) {
   }], false);
 $obj_mnu.append(create_submenu.$el);
   }
-  // Drop down menu for reset layout
-  var $file_mnu = navbar.find('li#mnu_file > ul.dropdown-menu').first();
-  if($file_mnu) {
-$file_mnu.append('' +
- '' +
- '{{ _('Reset Layout') }}' +
- ''
-);
-  }
 },
 init: function() {
   var obj=this;
-  obj.save_layout = true;
   if (obj.initialized) {
 return;
   }
@@ -276,7 +265,7 @@ function(require, $, _, S, Bootstrap, pgAdmin, alertify, CodeMirror) {
 
   // Store the main browser layout
   $(window).bind('unload', function() {
-  if(obj.docker && obj.save_layout) {
+  if(obj.docker) {
 state = obj.docker.save();
 settings = { setting: "Browser/Layout", value: state };
 $.ajax({
@@ -650,38 +639,6 @@ function(require, $, _, S, Bootstrap, pgAdmin, alertify, CodeMirror) {
   navbar.children('#mnu_obj').removeClass('hide');
obj.enable_disable_menus();
 },
-// We will force unload method to not to save current layout
-// and reload the window
-reset_current_layout: function() {
-  var obj = this;
-  alertify.confirm('{{ _('Reset layout') }}',
-'{{ _('Are you sure you want to reset the current layout? This will cause the application to reload and any un-saved data will be lost.') }}',
-function() {
-  // User clicked OK button...
-  var current_url = document.URL;
-
-  // Delete the record from database as well, then only reload page
-  $.ajax({
-url: '{{ url_for('settings.reset_layout') }}',
-type: 'DELETE',
-async: false,
-error: function() {
-  console.log('Something went wrong on server while resetting layout');
-}
-  });
-
-  // Toggle flag which will prevents save again
-  obj.save_layout = false;
-  // Flag will prevent onbeforeunload function to be called
-  onbeforeunload_flag = false;
-  // Now reload page
-  location.reload(true);
-},
-function() {
-  // Do nothing as user cancel the operation
-}
-  );
-},
 // General function to handle callbacks for object or dialog help.
 showHelp: function(type, url, node, item, label) {
   if (type == "object_help") {
@@ -736,18 +693,16 @@ function(require, $, _, S, Bootstrap, pgAdmin, alertify, CodeMirror) {
   });
 
   window.onbeforeunload = function(ev) {
-var e = ev || window.event;
-if(onbeforeunload_flag) {
-  var msg = '{{ _('Do you really want to leave the page?') }}';
+var e = ev || window.event,
+msg = '{{ _('Do you really want to leave the page?') }}';
 
-  // For IE and Firefox prior to version 4
-  if (e) {
-e.returnValue = msg;
-  }
-
-  // For Safari
-  return msg;
+// For IE and Firefox prior to version 4
+if (e) {
+  e.returnValue = msg;
 }
+
+// For Safari
+return msg;
   };
 
   return pgAdmin.Browser;
diff --git a/web/pgadmin/settings/__init__.py b/web/pgadmin/settings/__init__.py
index a3f529e..97a34e8 100644
--- a/web/pgadmin/settings/__init__.py
+++ b/web/pgadmin/settings/__init__.py
@@ -13,14 +13,41 @@ from flask.ext.login import current_user
 
 from pgadmin.model import db, Setting
 import traceback
-from flask import Response, request, render_template
+from flask import Response, request, render_template, url_for
 from flask.ext.security import login_required
 
-from pgadmin.utils.ajax import make_json_response
+from pgadmin.utils.ajax import make_json_response, bad_request
 from pgadmin.utils import PgAdminModule
+from pgadmin.utils.menu import MenuItem
+from flask.ext.babel import gettext
 
 MODULE_NAME = 'settings'
 
+
+class 

Re: [pgadmin-hackers] Fix for RM1318 [pgadmin4]

2016-06-13 Thread Harshal Dhumal
Hi,

PFA patch for issue RM1318 with remaining bug fixes.


On Mon, Jun 13, 2016 at 8:49 PM, Dave Page  wrote:

> On Mon, Jun 13, 2016 at 7:25 AM, Harshal Dhumal
>  wrote:
> > Hi,
> >
> > PFA attached patch for issue RM1318.
> >
> >
> > Issue fixed: Added help buttons on backup, restore, maintenance, user
> > management dialogs.
>
> Thanks - I've committed this as-is, however the following issues
> should also be fixed:
>
> - The help for the User Manager dialogue cannot be used because the
> dialogue is modal.
>

Changed user dialog to non modal from modal dialog.


>
> - There's no help button on the Preferences dialogue. It should also
> be made non-modal so the user can actually use the help once it's
> displayed.
>
Added missing help button and also changed dialog to non modal.



>
> Thanks.
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
diff --git a/web/pgadmin/preferences/templates/preferences/preferences.js b/web/pgadmin/preferences/templates/preferences/preferences.js
index 69053b3..0600a8c 100644
--- a/web/pgadmin/preferences/templates/preferences/preferences.js
+++ b/web/pgadmin/preferences/templates/preferences/preferences.js
@@ -1,8 +1,8 @@
 define(
-  ['jquery', 'alertify', 'pgadmin', 'underscore', 'backform', 'pgadmin.backform'],
+  ['jquery', 'alertify', 'pgadmin', 'underscore', 'backform', 'pgadmin.browser', 'pgadmin.backform'],
 
   // This defines the Preference/Options Dialog for pgAdmin IV.
-  function($, alertify, pgAdmin, _, Backform) {
+  function($, alertify, pgAdmin, _, Backform, pgBrowser) {
 pgAdmin = pgAdmin || window.pgAdmin || {};
 
 /*
@@ -351,12 +351,13 @@ define(
 },
 setup:function(){
   return {
-buttons:[
-  {
+buttons:[{
+text: '', key: 27, className: 'btn btn-default pull-left fa fa-lg fa-question',
+attrs:{name:'dialog_help', type:'button', label: '{{ _('Preferences') }}',
+url: '{{ url_for('help.static', filename='preferences_dialog.html') }}'}
+  },{
 text: "{{ _('OK') }}", key: 13, className: "btn btn-primary fa fa-lg fa-save pg-alertify-button"
-
-  },
-  {
+  },{
 text: "{{ _('Cancel') }}", className: "btn btn-danger fa fa-lg fa-times pg-alertify-button"
   }
 ],
@@ -365,12 +366,20 @@ define(
   padding: !1,
   overflow: !1,
   title: '{{ _('Preferences')|safe }}',
-  closableByDimmer: false
+  closableByDimmer: false,
+  modal:false
 }
   };
 },
-callback: function(closeEvent){
-  if (closeEvent.button.text == "{{ _('OK') }}"){
+callback: function(e){
+  if (e.button.element.name == "dialog_help") {
+  e.cancel = true;
+  pgBrowser.showHelp(e.button.element.name, e.button.element.getAttribute('url'),
+null, null, e.button.element.getAttribute('label'));
+  return;
+   }
+
+  if (e.button.text == "{{ _('OK') }}"){
 preferences.updateAll();
   }
 },
diff --git a/web/pgadmin/tools/user_management/templates/user_management/js/user_management.js b/web/pgadmin/tools/user_management/templates/user_management/js/user_management.js
index 4e01863..9109044 100644
--- a/web/pgadmin/tools/user_management/templates/user_management/js/user_management.js
+++ b/web/pgadmin/tools/user_management/templates/user_management/js/user_management.js
@@ -390,7 +390,7 @@ define([
 //disable both padding and overflow control.
 padding : !1,
 overflow: !1,
-model: 0,
+modal: false,
 resizable: true,
 maximizable: true,
 pinnable: false,

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


[pgadmin-hackers] pgadmin4 slow with large tables compared to pgadmin3

2016-06-13 Thread Colin Beckingham
I have the latest fully patched pgadmin4. Runs fine on openSUSE Leap 
42.1 using browser Firefox.
When I load a full large table such as the words table (140K records) 
from wordnet, pgadmin3 takes about 2 seconds to display.
On pgadmin4 I wait about 30+ seconds and click through about 5 reminders 
that "a script has stopped working, do you want to continue."
Eventually the table loads so this is not a bug report, more a question 
about how to streamline access to large tables. I am quite aware that it 
would run much faster by running a query with criteria asking for a 
subset of the table records, but just wondering if this is to be 
standard in pgadmin4. I can also disable the warnings, but this will 
prevent me from seeing issues with other scripts.



--
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


[pgadmin-hackers] pgAdmin 4 commit: Fix file type detection for Python 2.6. Fixes #1330

2016-06-13 Thread Dave Page
Fix file type detection for Python 2.6. Fixes #1330

To find out the type of file selected using FileManager in query tool, we use 
bitwise OR( | ) on two sets which is not working on python-2.6.9 version.
Now we took list of elements instead of sets to fix the issue.

Branch
--
master

Details
---
http://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=677008af10d93d8b11b9a88341c5d69ff9c7e68b
Author: Surinder Kumar 

Modified Files
--
web/pgadmin/tools/sqleditor/__init__.py | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)


-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] [pgAdmin4][Patch]: RM#1330 - Syntax error while running pgadmin_beta with python2.6.9

2016-06-13 Thread Dave Page
Thanks, applied.

On Mon, Jun 13, 2016 at 8:55 AM, Surinder Kumar
 wrote:
> Hi,
>
> Please find attached patch for RM#1330.
> Issue: To find out the type of file selected using FileManager in query
> tool, we use bitwise OR( | ) on two sets which is not working on
> python-2.6.9 version.
> Now we took list of elements instead of sets to fix the issue.
>
> This fix is tested on python-2.6.9, python-2.7.1 & python3.5
>
> Please review.
>
>
> Thanks,
> Surinder Kumar
>
>
> --
> Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgadmin-hackers
>



-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


[pgadmin-hackers] pgAdmin 4 commit: Fix "global name 'execfile' not defined".

2016-06-13 Thread Dave Page
Fix "global name 'execfile' not defined".

execfile was removed in Python 3.0. This
uses 'exec(open(filename).read())' as an
alternative, which works on all Python
versions.

Branch
--
master

Details
---
http://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=8b770ae479429edf8438b8cf459c312c1f3c0a96
Author: Sebastiaan van Stijn 

Modified Files
--
web/pgAdmin4.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)


-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] PATCH: To fixed uncomment issue (pgAdmin4)

2016-06-13 Thread Dave Page
Thanks, applied.

On Mon, Jun 13, 2016 at 7:40 AM, Murtuza Zabuawala
 wrote:
> Hi,
>
> PFA patch to fix the uncommenting issue with various nodes, due to this user
> was not able to remove comments from objects.
>
> Please review.
> (RM#1331)
>
>
> Regards,
> Murtuza
>
>
> --
> Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgadmin-hackers
>



-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


[pgadmin-hackers] pgAdmin 4 commit: Fix comment removal for various nodes. Fixes #1331

2016-06-13 Thread Dave Page
Fix comment removal for various nodes. Fixes #1331

Branch
--
master

Details
---
http://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=1f9d0ffc54187e3e326827222a4a028c01b33c90
Author: Murtuza Zabuawala 

Modified Files
--
.../event_triggers/templates/event_triggers/sql/9.3_plus/update.sql | 4 ++--
.../schemas/collations/templates/collation/sql/9.1_plus/update.sql  | 2 +-
.../templates/domain_constraints/sql/9.2_plus/update.sql| 4 ++--
.../schemas/domains/templates/domains/sql/9.1_plus/update.sql   | 2 +-
.../schemas/domains/templates/domains/sql/9.2_plus/update.sql   | 2 +-
.../databases/schemas/templates/schema/pg/9.1_plus/sql/update.sql   | 2 +-
.../databases/schemas/templates/schema/pg/9.2_plus/sql/update.sql   | 2 +-
.../databases/schemas/templates/schema/ppas/9.1_plus/sql/update.sql | 2 +-
.../databases/schemas/templates/schema/ppas/9.2_plus/sql/update.sql | 2 +-
.../databases/schemas/types/templates/type/sql/9.1_plus/update.sql  | 2 +-
.../servers/databases/templates/databases/js/databases.js   | 6 --
.../databases/templates/databases/sql/9.1_plus/alter_online.sql | 2 +-
.../databases/templates/databases/sql/9.2_plus/alter_online.sql | 2 +-
.../databases/templates/databases/sql/9.3_plus/alter_online.sql | 2 +-
.../tablespaces/templates/tablespaces/sql/9.1_plus/update.sql   | 4 ++--
.../tablespaces/templates/tablespaces/sql/9.2_plus/update.sql   | 2 +-
16 files changed, 22 insertions(+), 20 deletions(-)


-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] Fix for RM1318 [pgadmin4]

2016-06-13 Thread Dave Page
On Mon, Jun 13, 2016 at 7:25 AM, Harshal Dhumal
 wrote:
> Hi,
>
> PFA attached patch for issue RM1318.
>
>
> Issue fixed: Added help buttons on backup, restore, maintenance, user
> management dialogs.

Thanks - I've committed this as-is, however the following issues
should also be fixed:

- The help for the User Manager dialogue cannot be used because the
dialogue is modal.

- There's no help button on the Preferences dialogue. It should also
be made non-modal so the user can actually use the help once it's
displayed.

Thanks.

-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


[pgadmin-hackers] pgAdmin 4 commit: Help buttons for various dialogues.

2016-06-13 Thread Dave Page
Help buttons for various dialogues.

Branch
--
master

Details
---
http://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=970d3aafbf38e4a9fee52a85f96529076fafb1e4

Modified Files
--
web/pgadmin/browser/__init__.py| 11 +
.../browser/templates/browser/js/browser.js| 52 +-
web/pgadmin/static/css/overrides.css   |  4 +-
.../tools/backup/templates/backup/js/backup.js | 50 -
.../templates/maintenance/js/maintenance.js| 29 +---
.../tools/restore/templates/restore/js/restore.js  | 42 +++--
.../user_management/js/user_management.js  | 10 +
7 files changed, 166 insertions(+), 32 deletions(-)


-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] PATCH: Added Statistics functionality for many nodes (pgAdmin4)

2016-06-13 Thread Dave Page
On Mon, Jun 13, 2016 at 12:29 PM, Murtuza Zabuawala
 wrote:
> The strange effects that leads to.
>
>
>> On 13-Jun-2016, at 4:55 pm, Dave Page  wrote:
>>
>> Hi
>>
>> On Mon, Jun 13, 2016 at 12:18 PM, Murtuza Zabuawala
>>  wrote:
>>> Hi Dave,
>>>
>>> I tried with fresh install of 9.4 version but still not able to re-produce 
>>> the issue, I also tried switching python version 2.7/3.5 but still no luck.
>>> I also checked with Neel & Surinder on their system but still not able to 
>>> re-produce the issue.
>>
>> What can't you reproduce - the queries returning zero rows, or the
>> strange effects that leads to?

Hmm, neither can I now. I wonder if something didn't refresh correctly...

I do notice that we don't return stats for the Sequences, Trigger
functions or Functions nodes though.


-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] PATCH: Added Statistics functionality for many nodes (pgAdmin4)

2016-06-13 Thread Murtuza Zabuawala
Hi Dave,

I tried with fresh install of 9.4 version but still not able to re-produce the 
issue, I also tried switching python version 2.7/3.5 but still no luck.
I also checked with Neel & Surinder on their system but still not able to 
re-produce the issue.

 
Regards,
Murtuza

> On 10-Jun-2016, at 8:56 pm, Dave Page  wrote:
> 
> On Thu, Jun 9, 2016 at 9:21 AM, Murtuza Zabuawala
>  wrote:
>> Hi Ashesh/Dave,
>> 
>> I tried setting 'track_functions' to false in postgresql.conf. but then I am
>> not able to start server got error saying false is not correct argument
>> (Version: PG 9.5).
>> Then I also set it to all and try running function & check the stats.
>> 
>> I am getting proper output in both cases, with stats & without stats(PFA
>> screenshot)
>> 
>> Let me know if I missed anything here.
> 
> You might need to reset the server stats (or re-initdb to be sure
> everything is fresh and clean). FYI, I saw this on PostgreSQL 9.4.
> 
> 
> -- 
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
> 
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company



-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


[pgadmin-hackers] PATCH: To fixed the issue in server node (pgAdmin4)

2016-06-13 Thread Murtuza Zabuawala
Hi,

PFA minor patch to fix the issue for RM#1144.


--
Regards,
Murtuza Zabuawala
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


RM_1144.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


[pgadmin-hackers] pgAdmin website commit: Link to the tracker from the support index page

2016-06-13 Thread Dave Page
Link to the tracker from the support index page.

Branch
--
master

Details
---
http://git.postgresql.org/gitweb?p=pgadmin-www.git;a=commitdiff;h=0bf7d88ef2fe8aa3696c17f827357c3d3c00ce30

Modified Files
--
support/index.php | 2 ++
1 file changed, 2 insertions(+)


-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


[pgadmin-hackers] PATCH: To add "Move objects..” functionality in tablespace (pgAdmin4)

2016-06-13 Thread Murtuza Zabuawala
Hi,

PFA patch to add "Move objects..” functionality in tablespace node.
(RM#1286)

Additionally I have removed pre_9.1 sql's & align SQL line indentation as
well.
Please review.

Regards,
Murtuza


RM_1286.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] Ordering of results in query templates involving UNION

2016-06-13 Thread Dave Page
Hi,

On Sun, Jun 12, 2016 at 11:18 PM, Edmund Horner  wrote:
> Hi,
>
> I was trying out the beta download and noticed that the SQL definition for
> some of my constraints had the columns in the wrong order.  I traced this to
> https://git.postgresql.org/gitweb/?p=pgadmin4.git;a=blob;f=web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/index_constraint/sql/get_constraint_cols.sql;hb=702609517f23be7c14e2f9d655f66ea8ac43dd9c
> which has the form of a SELECT ... UNION  SELECT ... for each column in the
> constraint.  I was able to fix this one case by appending the loop index as
> a new column and ordering by that:
>
> {% for n in range(colcnt|int) %}
> {% if loop.index != 1 %}
> UNION SELECT  pg_get_indexdef({{ cid|string }}, {{ loop.index|string }},
> true) AS column, {{ loop.index|string }} AS idx
> {% else %}
> SELECT  pg_get_indexdef({{ cid|string }} , {{ loop.index|string }} ,
> true) AS column, {{ loop.index|string }} AS idx
> {% endif %}
> {% endfor %}
> ORDER BY idx
>
> There are a few other templates where it looks like the same pattern
> happens.  In a lot of them you use UNION ALL, which may coincidentally
> return rows the same order as the individual SELECT statements.  In the one
> above you use UNION so hashing is used and rows are returned in a less
> predictable order.  I think that even in the first case an ORDER BY clause
> is required for correctness -- or the rows need to be sorted in the client
> code before generating the SQL.
>
> I have not attached a patch as I've not been involved on pgAdmin
> development.  But if the problem and the fix makes sense I would be happy to
> work on one to try to add ordering to UNION-based query templates (e.g. the
> ones on this list
> https://git.postgresql.org/gitweb/?p=pgadmin4.git=search=HEAD=grep=UNION
> ).

Good catch - a patch would be very welcome, thanks!


-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


[pgadmin-hackers] pgAdmin III commit: Include the Negator when reverse engineering SQL fo

2016-06-13 Thread Dave Page
Include the Negator when reverse engineering SQL for Operators

Branch
--
REL-1_22_0_PATCHES

Details
---
http://git.postgresql.org/gitweb?p=pgadmin3.git;a=commitdiff;h=14a327400c42333466aa7246dd94ca9fc865c076
Author: Julien Rouhaud 

Modified Files
--
CHANGELOG | 2 ++
pgadmin/schema/pgOperator.cpp | 1 +
2 files changed, 3 insertions(+)


-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


[pgadmin-hackers] pgAdmin III commit: Include the Negator when reverse engineering SQL fo

2016-06-13 Thread Dave Page
Include the Negator when reverse engineering SQL for Operators

Branch
--
master

Details
---
http://git.postgresql.org/gitweb?p=pgadmin3.git;a=commitdiff;h=794527d97e2e3b01399954f3b79c8e2585b908dd
Author: Julien Rouhaud 

Modified Files
--
CHANGELOG | 2 ++
pgadmin/schema/pgOperator.cpp | 1 +
2 files changed, 3 insertions(+)


-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


[pgadmin-hackers] [pgAdmin4][Patch]: RM#1330 - Syntax error while running pgadmin_beta with python2.6.9

2016-06-13 Thread Surinder Kumar
Hi,

Please find attached patch for RM#1330.
*Issue: *To find out the type of file selected using FileManager in query
tool, we use bitwise OR( | ) on two sets which is not working on
python-2.6.9 version.
Now we took list of elements instead of sets to fix the issue.

This fix is tested on python-2.6.9, python-2.7.1 & python3.5

Please review.


Thanks,
Surinder Kumar


RM#1330.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


[pgadmin-hackers] [PATCH] fix "global name 'execfile' not defined"

2016-06-13 Thread Sebastiaan van Stijn
execfile was removed in Python 3.0. This
uses 'exec(open(filename).read())' as an
alternative, which works on all Python
versions.

Signed-off-by: Sebastiaan van Stijn 



0001-fix-global-name-execfile-not-defined.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


[pgadmin-hackers] PATCH: To fixed uncomment issue (pgAdmin4)

2016-06-13 Thread Murtuza Zabuawala
Hi,

PFA patch to fix the uncommenting issue with various nodes, due to this
user was not able to remove comments from objects.

Please review.
(RM#1331)


Regards,
Murtuza


fixed_uncommenting_issue.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


[pgadmin-hackers] Fix for RM1318 [pgadmin4]

2016-06-13 Thread Harshal Dhumal
Hi,

PFA attached patch for issue RM1318.


Issue fixed: Added help buttons on backup, restore, maintenance, user
management dialogs.



-- 
*Harshal Dhumal*
*Software Engineer*

EnterpriseDB India: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
diff --git a/web/pgadmin/browser/__init__.py b/web/pgadmin/browser/__init__.py
index e82b673..8cd356b 100644
--- a/web/pgadmin/browser/__init__.py
+++ b/web/pgadmin/browser/__init__.py
@@ -485,6 +485,15 @@ def index():
 def browser_js():
 layout = get_setting('Browser/Layout', default='')
 snippets = []
+
+prefs = Preferences.module('paths')
+
+pg_help_path_pref = prefs.preference('pg_help_path')
+pg_help_path = pg_help_path_pref.get()
+
+edbas_help_path_pref = prefs.preference('edbas_help_path')
+edbas_help_path = edbas_help_path_pref.get()
+
 for submodule in current_blueprint.submodules:
 snippets.extend(submodule.jssnippets)
 return make_response(
@@ -492,6 +501,8 @@ def browser_js():
 'browser/js/browser.js',
 layout=layout,
 jssnippets=snippets,
+pg_help_path=pg_help_path,
+edbas_help_path=edbas_help_path,
 _=gettext
 ),
 200, {'Content-Type': 'application/x-javascript'})
diff --git a/web/pgadmin/browser/templates/browser/js/browser.js b/web/pgadmin/browser/templates/browser/js/browser.js
index 12ffd6f..91aaa81 100644
--- a/web/pgadmin/browser/templates/browser/js/browser.js
+++ b/web/pgadmin/browser/templates/browser/js/browser.js
@@ -681,10 +681,60 @@ function(require, $, _, S, Bootstrap, pgAdmin, alertify, CodeMirror) {
   // Do nothing as user cancel the operation
 }
   );
+},
+// General function to handle callbacks for object or dialog help.
+showHelp: function(type, url, node, item, label) {
+  if (type == "object_help") {
+// See if we can find an existing panel, if not, create one
+pnlSqlHelp = this.docker.findPanels('pnl_sql_help')[0];
+
+if (pnlSqlHelp == null) {
+  pnlProperties = this.docker.findPanels('properties')[0];
+  this.docker.addPanel('pnl_sql_help', wcDocker.DOCK.STACKED, pnlProperties);
+  pnlSqlHelp = this.docker.findPanels('pnl_sql_help')[0];
+}
+
+// Construct the URL
+server = node.getTreeNodeHierarchy(item).server;
+
+baseUrl = '{{ pg_help_path }}'
+if (server.server_type == 'ppas') {
+  baseUrl = '{{ edbas_help_path }}'
+}
+
+major = Math.floor(server.version / 1)
+minor = Math.floor(server.version / 100) - (major * 100)
+
+baseUrl = baseUrl.replace('$VERSION$', major + '.' + minor)
+if (!S(baseUrl).endsWith('/')) {
+  baseUrl = baseUrl + '/'
+}
+fullUrl = baseUrl+ url;
+// Update the panel
+iframe = $(pnlSqlHelp).data('embeddedFrame');
+pnlSqlHelp.title('Help: '+ label);
+
+pnlSqlHelp.focus();
+iframe.openURL(fullUrl);
+  } else if(type == "dialog_help") {
+// See if we can find an existing panel, if not, create one
+pnlDialogHelp = this.docker.findPanels('pnl_online_help')[0];
+
+if (pnlDialogHelp == null) {
+  pnlProperties = this.docker.findPanels('properties')[0];
+  this.docker.addPanel('pnl_online_help', wcDocker.DOCK.STACKED, pnlProperties);
+  pnlDialogHelp = this.docker.findPanels('pnl_online_help')[0];
+}
+
+// Update the panel
+iframe = $(pnlDialogHelp).data('embeddedFrame');
+
+pnlDialogHelp.focus();
+iframe.openURL(url);
+  }
 }
   });
 
-
   window.onbeforeunload = function(ev) {
 var e = ev || window.event;
 if(onbeforeunload_flag) {
diff --git a/web/pgadmin/static/css/overrides.css b/web/pgadmin/static/css/overrides.css
index 403de28..41ffde0 100755
--- a/web/pgadmin/static/css/overrides.css
+++ b/web/pgadmin/static/css/overrides.css
@@ -1028,7 +1028,7 @@ ul.nav.nav-tabs {
 }
 
 .alertify .ajs-footer .ajs-buttons .ajs-button {
-  min-width: 80px;
+  min-width: 40px;
   min-height: 30px;
 }
 
@@ -1343,4 +1343,4 @@ height: calc(100% - 35px);
 
 .pg-panel-statistics-container > table > thead > tr > th:last-child {
   border-right: 0px;
-}
\ No newline at end of file
+}
diff --git a/web/pgadmin/tools/backup/templates/backup/js/backup.js b/web/pgadmin/tools/backup/templates/backup/js/backup.js
index dcdd2a2..8fff960 100644
--- a/web/pgadmin/tools/backup/templates/backup/js/backup.js
+++ b/web/pgadmin/tools/backup/templates/backup/js/backup.js
@@ -385,6 +385,14 @@ TODO LIST FOR BACKUP:
setup:function() {
 return {
   buttons: [{
+  text: '', key: 27, className: 'btn btn-default pull-left fa fa-lg fa-info',
+  attrs:{name:'object_help', type:'button', url: 'backup.html', label: '{{ _('Backup') }}'}
+