From 91eda84092ae5eaa967a80ee8ca33b8b084fd5a3 Mon Sep 17 00:00:00 2001 From: vgilc Date: Thu, 8 Mar 2012 16:42:31 +0000 Subject: [PATCH] 2012-03-08 Vanessa Gil * pandoradb.sql pandoradb.oracle.sql pandoradb.postgreSQL.sql extras/pandoradb_migrate_4.0.x_to_4.1.mysql.sql extras/pandoradb_migrate_4.0.x_to_4.1.oracle.sql extras/pandoradb_migrate_4.0.x_to_4.1.postgreSQL.sql: Added fields 'section' and 'data_section' to tusuario. * index.php include/functions.php operation/users/user_edit.php: Customize home screen. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5726 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 14 +++ .../pandoradb_migrate_4.0.x_to_4.1.mysql.sql | 7 ++ .../pandoradb_migrate_4.0.x_to_4.1.oracle.sql | 7 ++ ...doradb_migrate_4.0.x_to_4.1.postgreSQL.sql | 7 ++ pandora_console/include/functions.php | 12 +++ pandora_console/index.php | 49 ++++++++-- pandora_console/operation/users/user_edit.php | 89 ++++++++++++++++++- pandora_console/pandoradb.oracle.sql | 4 +- pandora_console/pandoradb.postgreSQL.sql | 4 +- pandora_console/pandoradb.sql | 2 + 10 files changed, 187 insertions(+), 8 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index f31415b408..f5b7ce2c40 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,17 @@ +2012-03-08 Vanessa Gil + + * pandoradb.sql + pandoradb.oracle.sql + pandoradb.postgreSQL.sql + extras/pandoradb_migrate_4.0.x_to_4.1.mysql.sql + extras/pandoradb_migrate_4.0.x_to_4.1.oracle.sql + extras/pandoradb_migrate_4.0.x_to_4.1.postgreSQL.sql: Added fields + 'section' and 'data_section' to tusuario. + + * index.php + include/functions.php + operation/users/user_edit.php: Customize home screen. + 2012-03-08 Sergio Martin * include/functions_graph.php diff --git a/pandora_console/extras/pandoradb_migrate_4.0.x_to_4.1.mysql.sql b/pandora_console/extras/pandoradb_migrate_4.0.x_to_4.1.mysql.sql index aed626afe9..264da47bfc 100644 --- a/pandora_console/extras/pandoradb_migrate_4.0.x_to_4.1.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_4.0.x_to_4.1.mysql.sql @@ -179,3 +179,10 @@ ALTER TABLE `tgraph` ADD COLUMN `id_graph_template` int(11) NOT NULL DEFAULT 0; UPDATE ttipo_modulo SET descripcion='Generic data' WHERE id_tipo=1; UPDATE ttipo_modulo SET descripcion='Generic data incremental' WHERE id_tipo=4; + +-- ----------------------------------------------------- +-- Table `tusuario` +-- ----------------------------------------------------- +ALTER TABLE `tusuario` ADD COLUMN `section` TEXT NOT NULL; + +ALTER TABLE `tusuario` ADD COLUMN `data_section` TEXT NOT NULL; diff --git a/pandora_console/extras/pandoradb_migrate_4.0.x_to_4.1.oracle.sql b/pandora_console/extras/pandoradb_migrate_4.0.x_to_4.1.oracle.sql index 4a7054ef96..3fcd842ca2 100644 --- a/pandora_console/extras/pandoradb_migrate_4.0.x_to_4.1.oracle.sql +++ b/pandora_console/extras/pandoradb_migrate_4.0.x_to_4.1.oracle.sql @@ -170,3 +170,10 @@ ALTER TABLE tgraph ADD (id_graph_template NUMBER(11, 0) default 0 NOT NULL); UPDATE ttipo_modulo SET descripcion='Generic data' WHERE id_tipo=1; UPDATE ttipo_modulo SET descripcion='Generic data incremental' WHERE id_tipo=4; + +-- ----------------------------------------------------- +-- Table `tusuario` +-- ----------------------------------------------------- +ALTER TABLE tusuario ADD (section VARCHAR2(255) NOT NULL); + +ALTER TABLE tusuario ADD (data_section VARCHAR2(255) NOT NULL); diff --git a/pandora_console/extras/pandoradb_migrate_4.0.x_to_4.1.postgreSQL.sql b/pandora_console/extras/pandoradb_migrate_4.0.x_to_4.1.postgreSQL.sql index c2ac245b14..1e40909a17 100644 --- a/pandora_console/extras/pandoradb_migrate_4.0.x_to_4.1.postgreSQL.sql +++ b/pandora_console/extras/pandoradb_migrate_4.0.x_to_4.1.postgreSQL.sql @@ -157,3 +157,10 @@ ALTER TABLE "tgraph" ADD COLUMN "id_graph_template" INTEGER NOT NULL default 0; UPDATE "ttipo_modulo" SET "descripcion"='Generic data' WHERE "id_tipo"=1; UPDATE "ttipo_modulo" SET "descripcion"='Generic data incremental' WHERE "id_tipo"=4; + +-- ----------------------------------------------------- +-- Table `tusuario` +-- ----------------------------------------------------- +ALTER TABLE "tusuario" ADD COLUMN "section" varchar(255) NOT NULL; + +ALTER TABLE "tusuario" ADD COLUMN "data_section" varchar(255) NOT NULL; diff --git a/pandora_console/include/functions.php b/pandora_console/include/functions.php index 4a0158ed3f..d3ff11cba0 100644 --- a/pandora_console/include/functions.php +++ b/pandora_console/include/functions.php @@ -1504,4 +1504,16 @@ function get_os_name ($id_os) { return (string) db_get_value ('name', 'tconfig_os', 'id_os', (int) $id_os); } +/** + * Get user's dashboards + * + * @param int user id. + * + * @return array Dashboard name of the given user. + */ +function get_user_dashboards ($id_user) { + $sql = "SELECT name FROM tdashboard WHERE id_user="."'".$id_user."'"; + return db_get_all_rows_sql ($sql); +} + ?> diff --git a/pandora_console/index.php b/pandora_console/index.php index e4bdab6770..aa31b65dad 100644 --- a/pandora_console/index.php +++ b/pandora_console/index.php @@ -220,7 +220,6 @@ if (isset ($_GET["bye"])) { */ extensions_load_extensions ($config['extensions']); - // Header if ($config["pure"] == 0) { echo '