From 13b9403d742617703f76c92a18f0aa56a0f480ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Fri, 16 Apr 2010 16:26:13 +0200 Subject: [PATCH] rfe #2964518 [interface] Allow to choose servers from configuration for synchronisation. --- ChangeLog | 2 ++ js/server_synchronize.js | 20 +++++++++++++- server_synchronize.php | 58 ++++++++++++++++++++++++++++++---------- 3 files changed, 65 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index 18032ffba..f3dd9fce3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -73,6 +73,8 @@ $Id$ thanks to Sutharshan Balachandren. - rfe #2981999 [interface] Default sort order is now SMART. - rfe #2972969 [interface] Fix flipping of headers in non-IE browsers. ++ rfe #2964518 [interface] Allow to choose servers from configuration for + synchronisation. 3.3.3.0 (not yet released) - patch #2982480 [navi] Do not group if there would be one table in group, diff --git a/js/server_synchronize.js b/js/server_synchronize.js index 6aa0a3760..d9a965ff0 100644 --- a/js/server_synchronize.js +++ b/js/server_synchronize.js @@ -5,6 +5,24 @@ */ $(document).ready(function() { $('.server_selector').change(function() { - $(this).closest('tbody').children('.toggler').toggle(); + var server = $('.server_selector').val(); + if (server == 'cur') { + $(this).closest('tbody').children('.current-server').css('display', ''); + $(this).closest('tbody').children('.remote-server').css('display', 'none'); + } else if (server == 'rmt') { + $(this).closest('tbody').children('.current-server').css('display', 'none'); + $(this).closest('tbody').children('.remote-server').css('display', ''); + } else { + $(this).closest('tbody').children('.current-server').css('display', 'none'); + $(this).closest('tbody').children('.remote-server').css('display', ''); + var parts = server.split('||||'); + $('#src_host').val(parts[0]); + $(this).closest('tbody').find('.server-host').val(parts[0]); + $(this).closest('tbody').find('.server-port').val(parts[1]); + $(this).closest('tbody').find('.server-socket').val(parts[2]); + $(this).closest('tbody').find('.server-user').val(parts[3]); + $(this).closest('tbody').find('.server-pass').val(''); + $(this).closest('tbody').find('.server-db').val(parts[4]) + } }); }); diff --git a/server_synchronize.php b/server_synchronize.php index c1c873b55..c4e08fbda 100644 --- a/server_synchronize.php +++ b/server_synchronize.php @@ -1126,35 +1126,65 @@ if (isset($_REQUEST['synchronize_db'])) { - + ' . $GLOBALS['strHost'] . ' - + - + ' . $GLOBALS['strPort'] . ' - + - + ' . $GLOBALS['strSocket'] . ' - + - + ' . $GLOBALS['strUserName']. ' - + - + ' . $GLOBALS['strPassword'] . ' - + - + ' . $GLOBALS['strDatabase'] . ' - + - + ' . $GLOBALS['strDatabase'] . ' '; // these unset() do not complain if the elements do not exist