From a203b53ff5380ca6f1955857f9a07954fb2c3f09 Mon Sep 17 00:00:00 2001 From: esanchezm Date: Thu, 4 Sep 2008 14:44:24 +0000 Subject: [PATCH] 2008-09-04 Esteban Sanchez * extensions/update_manager/main.php: Added option to update packages. * include/functions_db.php: Added default value to get_user_groups, so if no parameter is giving, it will asume running user. * include/languages/Makefile: Added missing options to add comments to index.pot file. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1083 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 10 ++++++ .../extensions/update_manager/main.php | 33 +++++++++++++++++-- pandora_console/include/functions_db.php | 7 +++- pandora_console/include/languages/Makefile | 2 +- 4 files changed, 47 insertions(+), 5 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index c5fd3ee593..9edc3f7352 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,13 @@ +2008-09-04 Esteban Sanchez + + * extensions/update_manager/main.php: Added option to update packages. + + * include/functions_db.php: Added default value to get_user_groups, + so if no parameter is giving, it will asume running user. + + * include/languages/Makefile: Added missing options to add comments to + index.pot file. + 2008-09-03 Sancho Lerena * reporting/fgraph.php: In grafico_eventos_grupo() array_multisort diff --git a/pandora_console/extensions/update_manager/main.php b/pandora_console/extensions/update_manager/main.php index 6a94822ea5..856f576fb6 100644 --- a/pandora_console/extensions/update_manager/main.php +++ b/pandora_console/extensions/update_manager/main.php @@ -48,6 +48,18 @@ if ($settings->customer_key == FREE_USER) { } $user_key = get_user_key ($settings); +$update_package = (bool) get_parameter_post ('update_package'); + +if ($update_package) { + echo '

Updating...

'; + flush (); + $force = (bool) get_parameter_post ('force_update'); + + um_client_upgrade_to_latest ($user_key, $force); + /* TODO: Add a new in tnews */ + $settings = um_db_load_settings (); +} + $package = um_client_check_latest_update ($settings, $user_key); if (is_int ($package) && $package == 1) { @@ -60,12 +72,27 @@ if (is_int ($package) && $package == 1) { echo '
'.__('There\'s a new update for Pandora')."
"; $table->width = '50%'; - $table->head = array (); $table->data = array (); - $table->head[0] = ''.__('Description').''; - $table->data[0][0] = html_entity_decode ($package->description); + + $table->data[0][0] = ''.__('Id').''; + $table->data[0][1] = $package->id; + + $table->data[1][0] = ''.__('Timestamp').''; + $table->data[1][1] = $package->timestamp; + + $table->data[2][0] = ''.__('Description').''; + $table->data[2][1] = html_entity_decode ($package->description); print_table ($table); + echo '
'; + echo '
'; + echo __('Overwrite local changes'); + print_checkbox ('force_update', '1', false); + echo '

'; + print_input_hidden ('update_package', 1); + print_submit_button (__('Update'), 'update_button', false, 'class="sub upd"'); + echo '

'; + echo '
'; } echo '

'.__('Your system version number is').': '.$settings->current_update.'

'; diff --git a/pandora_console/include/functions_db.php b/pandora_console/include/functions_db.php index b398d99ef6..ddefb592bd 100644 --- a/pandora_console/include/functions_db.php +++ b/pandora_console/include/functions_db.php @@ -1032,7 +1032,12 @@ function list_group2 ($id_user) { * * @return A list of the groups the user has reading privileges. */ -function get_user_groups ($id_user) { +function get_user_groups ($id_user = 0) { + if ($id_user == 0) { + global $config; + $id_user = $config['id_user']; + } + $user_groups = array (); $groups = get_db_all_rows_in_table ('tgrupo', 'nombre'); diff --git a/pandora_console/include/languages/Makefile b/pandora_console/include/languages/Makefile index 38acc42e98..bd9ee0287e 100644 --- a/pandora_console/include/languages/Makefile +++ b/pandora_console/include/languages/Makefile @@ -1,5 +1,5 @@ all: ast.mo ca.mo de.mo es.mo fr.mo gl.mo it.mo pt_br.mo - xgettext `find ../../ -name "*\.php"` --output=index.pot --keyword=__ + xgettext `find ../../ -name "*\.php"` --output=index.pot --keyword=__ --add-comments=/// ast.mo: ast.po msgfmt ast.po -o ast.mo