The branch, master has been updated via 13b9403d742617703f76c92a18f0aa56a0f480ff (commit) from 87d19393b321f363a4857e9b3518dd9e7c1b5e3b (commit)
- Log ----------------------------------------------------------------- commit 13b9403d742617703f76c92a18f0aa56a0f480ff Author: Michal Čihař mcihar@novell.com Date: Fri Apr 16 16:26:13 2010 +0200
rfe #2964518 [interface] Allow to choose servers from configuration for synchronisation.
-----------------------------------------------------------------------
Summary of changes: 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 18032ff..f3dd9fc 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 6aa0a37..d9a965f 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 c1c873b..c4e08fb 100644 --- a/server_synchronize.php +++ b/server_synchronize.php @@ -1126,35 +1126,65 @@ if (isset($_REQUEST['synchronize_db'])) { <td colspan="2" style="text-align: center"> <select name="' . $type . '_type" id="' . $type . '_type" class="server_selector"> <option value="rmt">' . $GLOBALS['strRemoteServer'] . '</option> - <option value="cur">' . $GLOBALS['strCurrentServer'] . '</option> + <option value="cur">' . $GLOBALS['strCurrentServer'] . '</option>'; + foreach ($GLOBALS['cfg']['Servers'] as $key => $tmp_server) { + if (empty($tmp_server['host'])) { + continue; + } + + if (!empty($tmp_server['verbose'])) { + $label = $tmp_server['verbose']; + } else { + $label = $tmp_server['host']; + if (!empty($tmp_server['port'])) { + $label .= ':' . $tmp_server['port']; + } + } + $value = $tmp_server['host']; + $value .= '||||'; + if (empty($tmp_server['port']) && empty($tmp_server['socket'])) { + $value .= '3306'; + } else { + $value .= $tmp_server['port']; + } + $value .= '||||'; + $value .= $tmp_server['socket']; + $value .= '||||'; + $value .= $tmp_server['user']; + $value .= '||||'; + $value .= $tmp_server['only_db']; + echo '<option value="' . $value . '">' + . htmlspecialchars(sprintf(__('Configuration: %s'), $label)) . '</option>' . "\n"; + } // end foreach + echo ' </select> </td> </tr> - <tr class="even toggler"> + <tr class="even toggler remote-server"> <td>' . $GLOBALS['strHost'] . '</td> - <td><input type="text" name="' . $type . '_host" /></td> + <td><input type="text" name="' . $type . '_host" class="server-host" /></td> </tr> - <tr class="odd toggler"> + <tr class="odd toggler remote-server"> <td>' . $GLOBALS['strPort'] . '</td> - <td><input type="text" name="' . $type . '_port" value="3306" maxlength="5" size="5" /></td> + <td><input type="text" name="' . $type . '_port" class="server-port" value="3306" maxlength="5" size="5" /></td> </tr> - <tr class="even toggler"> + <tr class="even toggler remote-server"> <td>' . $GLOBALS['strSocket'] . '</td> - <td><input type="text" name="' . $type . '_socket" /></td> + <td><input type="text" name="' . $type . '_socket" class="server-socket" /></td> </tr> - <tr class="odd toggler"> + <tr class="odd toggler remote-server"> <td>' . $GLOBALS['strUserName']. '</td> - <td><input type="text" name="'. $type . '_username" /></td> + <td><input type="text" name="'. $type . '_username" class="server-user" /></td> </tr> - <tr class="even toggler"> + <tr class="even toggler remote-server"> <td>' . $GLOBALS['strPassword'] . '</td> - <td><input type="password" name="' . $type . '_pass" /> </td> + <td><input type="password" name="' . $type . '_pass" class="server-pass" /> </td> </tr> - <tr class="odd toggler"> + <tr class="odd toggler remote-server"> <td>' . $GLOBALS['strDatabase'] . '</td> - <td><input type="text" name="' . $type . '_db" /></td> + <td><input type="text" name="' . $type . '_db" class="server-db" /></td> </tr> - <tr class="even toggler" style="display: none;"> + <tr class="even toggler current-server" style="display: none;"> <td>' . $GLOBALS['strDatabase'] . '</td> <td>'; // these unset() do not complain if the elements do not exist
hooks/post-receive