2008-09-04 Esteban Sanchez <estebans@artica.es>

* 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
This commit is contained in:
esanchezm 2008-09-04 14:44:24 +00:00
parent d73805e616
commit a203b53ff5
4 changed files with 47 additions and 5 deletions

View File

@ -1,3 +1,13 @@
2008-09-04 Esteban Sanchez <estebans@artica.es>
* 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 <slerena@artica.es>
* reporting/fgraph.php: In grafico_eventos_grupo() array_multisort

View File

@ -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 '<h2>Updating...</h2>';
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 '<h5 class="suc">'.__('There\'s a new update for Pandora')."</h5>";
$table->width = '50%';
$table->head = array ();
$table->data = array ();
$table->head[0] = '<strong>'.__('Description').'</strong>';
$table->data[0][0] = html_entity_decode ($package->description);
$table->data[0][0] = '<strong>'.__('Id').'</strong>';
$table->data[0][1] = $package->id;
$table->data[1][0] = '<strong>'.__('Timestamp').'</strong>';
$table->data[1][1] = $package->timestamp;
$table->data[2][0] = '<strong>'.__('Description').'</strong>';
$table->data[2][1] = html_entity_decode ($package->description);
print_table ($table);
echo '<div class="action-buttons" style="width: '.$table->width.'">';
echo '<form method="post">';
echo __('Overwrite local changes');
print_checkbox ('force_update', '1', false);
echo '<p />';
print_input_hidden ('update_package', 1);
print_submit_button (__('Update'), 'update_button', false, 'class="sub upd"');
echo '</form>';
echo '</div>';
}
echo '<h4>'.__('Your system version number is').': '.$settings->current_update.'</h4>';

View File

@ -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');

View File

@ -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