2012-09-12 Hirofumi Kosaka <kosaka@rworks.jp>

* include/functions_users.php
	godmode/groups/configure_group.php
	godmode/groups/group_list.php
	pandoradb.sql
	pandoradb_data.sql
	pandoradb.postgreSQL.sql
	pandoradb.oracle.sql
	pandoradb.data.postgreSQL.sql
	pandoradb.data.oracle.sql
	extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql
	extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql
	extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql: Added
	'description' column to Group.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6961 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
hkosaka 2012-09-12 08:13:57 +00:00
parent 823f66da25
commit f7d17faa16
13 changed files with 83 additions and 38 deletions

View File

@ -1,3 +1,19 @@
2012-09-12 Hirofumi Kosaka <kosaka@rworks.jp>
* include/functions_users.php
godmode/groups/configure_group.php
godmode/groups/group_list.php
pandoradb.sql
pandoradb_data.sql
pandoradb.postgreSQL.sql
pandoradb.oracle.sql
pandoradb.data.postgreSQL.sql
pandoradb.data.oracle.sql
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql: Added
'description' column to Group.
2012-09-11 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
* include/functions_reporting.php

View File

@ -122,6 +122,11 @@ CREATE TABLE IF NOT EXISTS `tplanned_downtime_modules` (
ALTER TABLE `tevento` ADD COLUMN (`source` tinytext NOT NULL,
`id_extra` tinytext NOT NULL);
-- -----------------------------------------------------
-- Table `tgrupo`
-- -----------------------------------------------------
ALTER TABLE `tgrupo` ADD COLUMN `description` text;
-- -----------------------------------------------------
-- Table `talert_snmp`
-- -----------------------------------------------------

View File

@ -144,6 +144,11 @@ CREATE OR REPLACE TRIGGER tplanned_downtime_modules_inc BEFORE INSERT ON tplanne
ALTER TABLE tevento ADD (source VARCHAR2(100) default '' NOT NULL);
ALTER TABLE tevento ADD (id_extra VARCHAR2(100) default '' NOT NULL);
-- -----------------------------------------------------
-- Table `tgrupo`
-- -----------------------------------------------------
ALTER TABLE tgrupo ADD (description CLOB);
-- -----------------------------------------------------
-- Table `talert_snmp`
-- -----------------------------------------------------

View File

@ -136,6 +136,12 @@ CREATE TABLE "tplanned_downtime_modules" (
ALTER TABLE "tevento" ADD COLUMN "source" text NULL default '';
ALTER TABLE "tevento" ADD COLUMN "id_extra" text NULL default '';
-- -----------------------------------------------------
-- Table `tgrupo`
-- -----------------------------------------------------
ALTER TABLE "tgrupo" ADD COLUMN "description" text;
-- -----------------------------------------------------
-- Table `talert_snmp`
-- -----------------------------------------------------

View File

@ -49,6 +49,7 @@ if ($id_group) {
$custom_id = $group["custom_id"];
$propagate = $group["propagate"];
$skin = $group["id_skin"];
$description = $group["description"];
}
else {
echo "<h3 class='error'>".__('There was a problem loading group')."</h3>";
@ -116,6 +117,9 @@ $table->data[4][1] = html_print_checkbox('propagate', 1, $propagate, true);
$table->data[5][0] = __('Custom ID');
$table->data[5][1] = html_print_input_text ('custom_id', $custom_id, '', 16, 255, true);
$table->data[6][0] = __('Description');
$table->data[6][1] = html_print_input_text ('description', $description, '', 60, 255, true);
$isFunctionSkins = enterprise_include_once ('include/functions_skins.php');
if ($isFunctionSkins !== ENTERPRISE_NOT_HOOK) {
$table->data[6][0] = __('Skin');

View File

@ -147,6 +147,7 @@ if ($create_group) {
$alerts_disabled = (bool) get_parameter ('alerts_disabled');
$custom_id = (string) get_parameter ('custom_id');
$skin = (string) get_parameter ('skin');
$description = (string) get_parameter ('description');
$check = db_get_value('nombre', 'tgrupo', 'nombre', $name);
@ -159,7 +160,8 @@ $check = db_get_value('nombre', 'tgrupo', 'nombre', $name);
'parent' => $id_parent,
'disabled' => $alerts_disabled,
'custom_id' => $custom_id,
'id_skin' => $skin
'id_skin' => $skin,
'description' => $description
);
$result = db_process_sql_insert('tgrupo', $values);
@ -186,26 +188,28 @@ if ($update_group) {
$name = (string) get_parameter ('name');
$icon = (string) get_parameter ('icon');
$id_parent = (int) get_parameter ('id_parent');
$description = (string) get_parameter ('description');
$alerts_enabled = (bool) get_parameter ('alerts_enabled');
$custom_id = (string) get_parameter ('custom_id');
$propagate = (bool) get_parameter('propagate');
$skin = (string) get_parameter ('skin');
$description = (string) get_parameter ('description');
/*Check if name field is empty*/
if( $name != "") {
switch ($config["dbtype"]) {
case "mysql":
$sql = sprintf ('UPDATE tgrupo SET nombre = "%s",
icon = "%s", disabled = %d, parent = %d, custom_id = "%s", propagate = %d, id_skin = %d
icon = "%s", disabled = %d, parent = %d, custom_id = "%s", propagate = %d, id_skin = %d, description = "%s"
WHERE id_grupo = %d',
$name, substr ($icon, 0, -4), !$alerts_enabled, $id_parent, $custom_id, $propagate, $skin, $id_group);
$name, substr ($icon, 0, -4), !$alerts_enabled, $id_parent, $custom_id, $propagate, $skin, $description, $id_group);
break;
case "postgresql":
case "oracle":
$sql = sprintf ('UPDATE tgrupo SET nombre = \'%s\',
icon = \'%s\', disabled = %d, parent = %d, custom_id = \'%s\', propagate = %d, id_skin = %d
icon = \'%s\', disabled = %d, parent = %d, custom_id = \'%s\', propagate = %d, id_skin = %d, description = \'%s\'
WHERE id_grupo = %d',
$name, substr ($icon, 0, -4), !$alerts_enabled, $id_parent, $custom_id, $propagate, $skin, $id_group);
$name, substr ($icon, 0, -4), !$alerts_enabled, $id_parent, $custom_id, $propagate, $skin, $description, $id_group);
break;
}
$result = db_process_sql ($sql);
@ -260,10 +264,11 @@ if (!empty($groups)) {
$table->head[1] = __('ID');
$table->head[2] = __('Icon');
$table->head[3] = __('Alerts');
$table->head[4] = __('Actions');
$table->head[4] = __('Description');
$table->head[5] = __('Actions');
$table->align = array ();
$table->align[2] = 'center';
$table->align[4] = 'center';
$table->align[5] = 'center';
$table->data = array ();
$iterator = 0;
@ -347,14 +352,15 @@ if (!empty($groups)) {
$data[1] = $group['id_grupo'];
$data[2] = ui_print_group_icon($group['id_grupo'], true);
$data[3] = $group['disabled'] ? __('Disabled') : __('Enabled');
$data[4] = $group['description'];
if ($group['id_grupo'] == 0) {
$data[4] = '';
$data[5] = '';
}
else {
$data[4] = '<a href="index.php?sec=gagente&sec2=godmode/groups/configure_group&id_group='.$group['id_grupo'].'">' . html_print_image("images/config.png", true, array("alt" => __('Edit'), "title" => __('Edit'), "border" => '0'));
$data[5] = '<a href="index.php?sec=gagente&sec2=godmode/groups/configure_group&id_group='.$group['id_grupo'].'">' . html_print_image("images/config.png", true, array("alt" => __('Edit'), "title" => __('Edit'), "border" => '0'));
//Check if there is only a group to unable delete it
if ((count($groups) > 3) || (count($groups) <= 3 && $group['parent'] != 0)) {
$data[4] .= '&nbsp;&nbsp;<a href="index.php?sec=gagente&sec2=godmode/groups/group_list&id_group='.$id_group.'&delete_group=1" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">' . html_print_image("images/cross.png", true, array("alt" => __('Delete'), "border" => '0'));
$data[5] .= '&nbsp;&nbsp;<a href="index.php?sec=gagente&sec2=godmode/groups/group_list&id_group='.$id_group.'&delete_group=1" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">' . html_print_image("images/cross.png", true, array("alt" => __('Delete'), "border" => '0'));
}
}

View File

@ -165,7 +165,7 @@ function users_get_groups ($id_user = false, $privilege = "AR", $returnAllGroup
if ($returnAllColumns) {
$groupall = array('id_grupo' => 0, 'nombre' => __('All'),
'icon' => 'world', 'parent' => 0, 'disabled' => 0,
'custom_id' => null, 'propagate' => 0);
'custom_id' => null, 'description' => '', 'propagate' => 0);
}
else {
$groupall = array('id_grupo' => 0, 'nombre' => __("All"));

View File

@ -151,14 +151,14 @@ END;;
--
BEGIN
LOCK TABLE tgrupo IN EXCLUSIVE MODE;
INSERT INTO tgrupo (id_grupo, nombre, icon, parent, propagate, disabled, custom_id, id_skin) VALUES (2,'Servers','server_database',0,0,0,'',1);
INSERT INTO tgrupo (id_grupo, nombre, icon, parent, propagate, disabled, custom_id, id_skin) VALUES (4,'Firewalls','firewall',0,0,0,'',1);
INSERT INTO tgrupo (id_grupo, nombre, icon, parent, propagate, disabled, custom_id, id_skin) VALUES (8,'Databases','database_gear',0,0,0,'',1);
INSERT INTO tgrupo (id_grupo, nombre, icon, parent, propagate, disabled, custom_id, id_skin) VALUES (9,'Network','transmit',0,0,0,'',1);
INSERT INTO tgrupo (id_grupo, nombre, icon, parent, propagate, disabled, custom_id, id_skin) VALUES (10,'Unknown','world',0,0,0,'',1);
INSERT INTO tgrupo (id_grupo, nombre, icon, parent, propagate, disabled, custom_id, id_skin) VALUES (11,'Workstations','computer',0,0,0,'',1);
INSERT INTO tgrupo (id_grupo, nombre, icon, parent, propagate, disabled, custom_id, id_skin) VALUES (12,'Applications','applications',0,0,0,'',1);
INSERT INTO tgrupo (id_grupo, nombre, icon, parent, propagate, disabled, custom_id, id_skin) VALUES (13,'Web','world',0,0,0,'',1);
INSERT INTO tgrupo (id_grupo, nombre, icon, parent, propagate, disabled, custom_id, id_skin, description) VALUES (2,'Servers','server_database',0,0,0,'',1,'');
INSERT INTO tgrupo (id_grupo, nombre, icon, parent, propagate, disabled, custom_id, id_skin, description) VALUES (4,'Firewalls','firewall',0,0,0,'',1,'');
INSERT INTO tgrupo (id_grupo, nombre, icon, parent, propagate, disabled, custom_id, id_skin, description) VALUES (8,'Databases','database_gear',0,0,0,'',1,'');
INSERT INTO tgrupo (id_grupo, nombre, icon, parent, propagate, disabled, custom_id, id_skin, description) VALUES (9,'Network','transmit',0,0,0,'',1,'');
INSERT INTO tgrupo (id_grupo, nombre, icon, parent, propagate, disabled, custom_id, id_skin, description) VALUES (10,'Unknown','world',0,0,0,'',1,'');
INSERT INTO tgrupo (id_grupo, nombre, icon, parent, propagate, disabled, custom_id, id_skin, description) VALUES (11,'Workstations','computer',0,0,0,'',1,'');
INSERT INTO tgrupo (id_grupo, nombre, icon, parent, propagate, disabled, custom_id, id_skin, description) VALUES (12,'Applications','applications',0,0,0,'',1,'');
INSERT INTO tgrupo (id_grupo, nombre, icon, parent, propagate, disabled, custom_id, id_skin, description) VALUES (13,'Web','world',0,0,0,'',1,'');
COMMIT;
END;;

View File

@ -133,16 +133,16 @@ SELECT setval('tconfig_os_id_os_seq', (SELECT (SELECT MAX(id_os) FROM tconfig_os
--
BEGIN WORK;
LOCK TABLE "tgrupo";
INSERT INTO "tgrupo" ("id_grupo", "nombre", "icon", "parent", "propagate", "disabled", "custom_id", "id_skin")
INSERT INTO "tgrupo" ("id_grupo", "nombre", "icon", "parent", "propagate", "disabled", "custom_id", "id_skin", "description")
VALUES
(2,'Servers','server_database',0,0,0,'',1),
(4,'Firewalls','firewall',0,0,0,'',1),
(8,'Databases','database_gear',0,0,0,'',1),
(9,'Network','transmit',0,0,0,'',1),
(10,'Unknown','world',0,0,0,'',1),
(11,'Workstations','computer',0,0,0,'',1),
(12,'Applications','applications',0,0,0,'',1),
(13,'Web','world',0,0,0,'',1);
(2,'Servers','server_database',0,0,0,'',1,''),
(4,'Firewalls','firewall',0,0,0,'',1,''),
(8,'Databases','database_gear',0,0,0,'',1,''),
(9,'Network','transmit',0,0,0,'',1,''),
(10,'Unknown','world',0,0,0,'',1,''),
(11,'Workstations','computer',0,0,0,'',1,''),
(12,'Applications','applications',0,0,0,'',1,''),
(13,'Web','world',0,0,0,'',1,'');
COMMIT WORK;
SELECT setval('tgrupo_id_grupo_seq', (SELECT (SELECT MAX(id_grupo) FROM tgrupo)));

View File

@ -565,7 +565,8 @@ CREATE TABLE tgrupo (
propagate NUMBER(5, 0) default 0,
disabled NUMBER(5, 0) default 0,
custom_id VARCHAR2(255) default '',
id_skin NUMBER(10, 0) DEFAULT 0 NOT NULL
id_skin NUMBER(10, 0) DEFAULT 0 NOT NULL,
description CLOB
);
CREATE SEQUENCE tgrupo_s INCREMENT BY 1 START WITH 1;

View File

@ -461,7 +461,8 @@ CREATE TABLE "tgrupo" (
"propagate" SMALLINT default 0,
"disabled" SMALLINT default 0,
"custom_id" varchar(255) default '',
"id_skin" INTEGER NOT NULL DEFAULT 0
"id_skin" INTEGER NOT NULL DEFAULT 0,
"description" text
);
CREATE TABLE "tincidencia" (

View File

@ -546,6 +546,7 @@ CREATE TABLE IF NOT EXISTS `tgrupo` (
`disabled` tinyint(3) unsigned NOT NULL default '0',
`custom_id` varchar(255) default '',
`id_skin` int(10) unsigned NOT NULL default '0',
`description` text,
PRIMARY KEY (`id_grupo`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

View File

@ -133,14 +133,14 @@ UNLOCK TABLES;
LOCK TABLES `tgrupo` WRITE;
INSERT INTO `tgrupo` VALUES
(2,'Servers','server_database',0,0,0,'',1),
(4,'Firewalls','firewall',0,0,0,'',1),
(8,'Databases','database_gear',0,0,0,'',1),
(9,'Network','transmit',0,0,0,'',1),
(10,'Unknown','world',0,0,0,'',1),
(11,'Workstations','computer',0,0,0,'',1),
(12,'Applications','applications',0,0,0,'',1),
(13,'Web','world',0,0,0,'',1);
(2,'Servers','server_database',0,0,0,'',1,''),
(4,'Firewalls','firewall',0,0,0,'',1,''),
(8,'Databases','database_gear',0,0,0,'',1,''),
(9,'Network','transmit',0,0,0,'',1,''),
(10,'Unknown','world',0,0,0,'',1,''),
(11,'Workstations','computer',0,0,0,'',1,''),
(12,'Applications','applications',0,0,0,'',1,''),
(13,'Web','world',0,0,0,'',1,'');
UNLOCK TABLES;