Commit 10026313 authored by Frank Bergmann's avatar Frank Bergmann

- updating ConfDB before demo

parent 2c37586c
......@@ -30,6 +30,7 @@ create table im_conf_items (
references acs_objects,
conf_item_name varchar(1000) not null,
conf_item_nr varchar(500) not null,
conf_item_version varchar(500),
-- Unique code for label
conf_item_code varchar(500),
......@@ -334,7 +335,7 @@ SELECT im_category_new(11802, 'Software', 'Intranet Conf Item Type');
SELECT im_category_new(11804, 'Process', 'Intranet Conf Item Type');
SELECT im_category_new(11806, 'License', 'Intranet Conf Item Type');
SELECT im_category_new(11808, 'Specs', 'Intranet Conf Item Type');
update im_categories set enabled_p = 'f' where category_id in (11800, 11804, 11808);
update im_categories set enabled_p = 'f' where category_id in (11804, 11808);
-- reserved to 11849
......@@ -346,10 +347,18 @@ SELECT im_category_new(11856, 'Server', 'Intranet Conf Item Type');
SELECT im_category_new(11858, 'Host', 'Intranet Conf Item Type');
SELECT im_category_new(11860, 'Mainframe', 'Intranet Conf Item Type');
SELECT im_category_new(11862, 'Network Device', 'Intranet Conf Item Type');
SELECT im_category_hierarchy_new('Personal Computer','Hardware','Intranet Conf Item Type');
SELECT im_category_hierarchy_new('Workstation','Hardware','Intranet Conf Item Type');
SELECT im_category_hierarchy_new('Laptop','Hardware','Intranet Conf Item Type');
SELECT im_category_hierarchy_new('Server','Hardware','Intranet Conf Item Type');
SELECT im_category_hierarchy_new('Host','Hardware','Intranet Conf Item Type');
SELECT im_category_hierarchy_new('Mainframe','Hardware','Intranet Conf Item Type');
SELECT im_category_hierarchy_new('Network Device','Hardware','Intranet Conf Item Type');
-- reserved to 11899
-- Personal Computer Hardware Components
SELECT im_category_new(11900, 'Personal Computer Hardware Component', 'Intranet Conf Item Type');
-- Hardware Components
SELECT im_category_new(11900, 'Hardware Component', 'Intranet Conf Item Type');
SELECT im_category_new(11902, 'Computer Bios', 'Intranet Conf Item Type');
SELECT im_category_new(11904, 'Computer Controller', 'Intranet Conf Item Type');
SELECT im_category_new(11906, 'Computer Drive', 'Intranet Conf Item Type');
......@@ -366,18 +375,47 @@ SELECT im_category_new(11926, 'Computer Slot', 'Intranet Conf Item Type');
SELECT im_category_new(11928, 'Computer Sound Device', 'Intranet Conf Item Type');
SELECT im_category_new(11930, 'Computer Storage Device', 'Intranet Conf Item Type');
SELECT im_category_new(11932, 'Computer Video Device', 'Intranet Conf Item Type');
SELECT im_category_hierarchy_new('Hardware Component','Hardware','Intranet Conf Item Type');
SELECT im_category_hierarchy_new('Computer Bios','Hardware Component','Intranet Conf Item Type');
SELECT im_category_hierarchy_new('Computer Controller','Hardware Component','Intranet Conf Item Type');
SELECT im_category_hierarchy_new('Computer Drive','Hardware Component','Intranet Conf Item Type');
SELECT im_category_hierarchy_new('Computer File','Hardware Component','Intranet Conf Item Type');
SELECT im_category_hierarchy_new('Computer Input Device','Hardware Component','Intranet Conf Item Type');
SELECT im_category_hierarchy_new('Computer Lock','Hardware Component','Intranet Conf Item Type');
SELECT im_category_hierarchy_new('Computer Memory','Hardware Component','Intranet Conf Item Type');
SELECT im_category_hierarchy_new('Computer Modem','Hardware Component','Intranet Conf Item Type');
SELECT im_category_hierarchy_new('Computer Monitor','Hardware Component','Intranet Conf Item Type');
SELECT im_category_hierarchy_new('Computer Network Device','Hardware Component','Intranet Conf Item Type');
SELECT im_category_hierarchy_new('Computer Port','Hardware Component','Intranet Conf Item Type');
SELECT im_category_hierarchy_new('Computer Printer Driver','Hardware Component','Intranet Conf Item Type');
SELECT im_category_hierarchy_new('Computer Slot','Hardware Component','Intranet Conf Item Type');
SELECT im_category_hierarchy_new('Computer Sound Device','Hardware Component','Intranet Conf Item Type');
SELECT im_category_hierarchy_new('Computer Storage Device','Hardware Component','Intranet Conf Item Type');
SELECT im_category_hierarchy_new('Computer Video Device','Hardware Component','Intranet Conf Item Type');
-- reserved to 11999
-- Personal Computer Software
SELECT im_category_new(12000, 'Personal Computer Software Component', 'Intranet Conf Item Type');
-- Software
SELECT im_category_new(12000, 'Software Component', 'Intranet Conf Item Type');
SELECT im_category_new(12002, 'Computer Software Package', 'Intranet Conf Item Type');
SELECT im_category_new(12004, 'Computer Driver', 'Intranet Conf Item Type');
SELECT im_category_new(12006, 'Software Application', 'Intranet Conf Item Type');
SELECT im_category_hierarchy_new('Software Component','Software','Intranet Conf Item Type');
SELECT im_category_hierarchy_new('Computer Software Package','Software Component','Intranet Conf Item Type');
SELECT im_category_hierarchy_new('Computer Driver','Software Component','Intranet Conf Item Type');
SELECT im_category_hierarchy_new('Software Application','Software','Intranet Conf Item Type');
-- reserved to 12099
-- Network Hardware
SELECT im_category_new(12100, 'Network Router', 'Intranet Conf Item Type');
SELECT im_category_new(12102, 'Network Switch', 'Intranet Conf Item Type');
SELECT im_category_hierarchy_new('Network Router','Hardware','Intranet Conf Item Type');
SELECT im_category_hierarchy_new('Network Switch','Hardware','Intranet Conf Item Type');
-- reserved to 12199
-- IPs & Network
......@@ -390,6 +428,9 @@ SELECT im_category_new(12204, 'Network', 'Intranet Conf Item Type');
SELECT im_category_new(11980, 'Host Table', 'Intranet Conf Item Type');
SELECT im_category_new(11982, 'Host Program', 'Intranet Conf Item Type');
SELECT im_category_new(11984, 'Host Screen', 'Intranet Conf Item Type');
SELECT im_category_hierarchy_new('Host Table','Software','Intranet Conf Item Type');
SELECT im_category_hierarchy_new('Host Program','Software','Intranet Conf Item Type');
SELECT im_category_hierarchy_new('Host Screen','Software','Intranet Conf Item Type');
......
......@@ -131,6 +131,7 @@ ad_proc -public im_conf_item_update_sql {
conf_item_name = :conf_item_name,
conf_item_nr = :conf_item_nr,
conf_item_code = :conf_item_code,
conf_item_version = :conf_item_version,
conf_item_parent_id = :conf_item_parent_id,
conf_item_type_id = :conf_item_type_id,
conf_item_status_id = :conf_item_status_id,
......
......@@ -48,6 +48,11 @@ if {$add_conf_item_p} {
append admin_links " <li><a href=\"[export_vars -base /intranet-confdb/new {return_url {form_mode "edit"}}]\">[lang::message::lookup "" intranet-confdb.Add_a_new_Conf_Item "Add a new Configuration Item"]</a>\n"
}
if {"" != $admin_links} {
set admin_links "<ul>\n$admin_links\n</ul>\n"
}
# ---------------------------------------------------------------
# Filter with Dynamic Fields
# ---------------------------------------------------------------
......
......@@ -61,6 +61,8 @@ ad_form \
{conf_item_name:text(text),optional {label "[lang::message::lookup {} intranet-core.Conf_Item_Name {Conf Item Name}]"} {html {size 60}}}
{conf_item_nr:text(text) {label "[lang::message::lookup {} intranet-core.Conf_Item_Nr {Conf Item Nr.}]"} {html {size 40}}}
{conf_item_code:text(text),optional {label "[lang::message::lookup {} intranet-core.Conf_Item_Code {Conf Item Code}]"} {html {size 40}}}
{conf_item_version:text(text),optional {label "[lang::message::lookup {} intranet-core.Conf_Item_Version {Version}]"} {html {size 40}}}
{conf_item_parent_id:text(select),optional {label "[lang::message::lookup {} intranet-core.Conf_Item_Parent {Parent}]"} {options $conf_item_parent_options} }
{conf_item_type_id:text(im_category_tree) {label "[lang::message::lookup {} intranet-core.Conf_Item_Type {Type}]"} {custom {category_type "Intranet Conf Item Type" translate_p 1 include_empty_p 0} } }
{conf_item_status_id:text(im_category_tree) {label "[lang::message::lookup {} intranet-core.Conf_Item_Status {Status}]"} {custom {category_type "Intranet Conf Item Status" translate_p 1 include_empty_p 0}} }
......@@ -75,13 +77,15 @@ ad_form \
if {![info exists conf_item_type_id]} { set conf_item_type_id ""}
set field_cnt [im_dynfield::append_attributes_to_form \
-form_display_mode $form_mode \
-object_subtype_id $conf_item_type_id \
-object_type "im_conf_item" \
-form_id $form_id \
-object_id $conf_item_id \
]
if {[info exists conf_item_id]} {
set field_cnt [im_dynfield::append_attributes_to_form \
-form_display_mode $form_mode \
-object_subtype_id $conf_item_type_id \
-object_type "im_conf_item" \
-form_id $form_id \
-object_id $conf_item_id \
]
}
ad_form -extend -name $form_id \
......@@ -109,7 +113,7 @@ ad_form -extend -name $form_id \
)
"
set exists_p [db_string exists "select count(*) from im_conf_items where conf_item_id = :conf_item_id"]
if {!$exists_p} { db_string new $conf_item_new_sql }
if {!$exists_p} { set conf_item_id [db_string new $conf_item_new_sql] }
db_dml update [im_conf_item_update_sql -include_dynfields_p 1]
if {"" != $conf_item_project_id} {
im_conf_item_new_project_rel -project_id $conf_item_project_id -conf_item_id $conf_item_id
......@@ -198,6 +202,11 @@ set hardware_id [db_string hardware_id "select ocs_id from im_conf_items where c
set result ""
if {[db_table_exists "ocs_hardware"]} {
if {"" == $conf_item_type_id} { set conf_item_type_id [db_string type "select conf_item_type_id from im_conf_items where conf_item_id = :conf_item_id" -default 0]}
if {[im_category_is_a $conf_item_type_id 11850]} {
append result [im_generic_table_component -table_name "ocs_drives" -select_column "hardware_id" -select_value $hardware_id -exclude_columns {id hardware_id}]
append result [im_generic_table_component -table_name "ocs_monitors" -select_column "hardware_id" -select_value $hardware_id -exclude_columns {id hardware_id}]
append result [im_generic_table_component -table_name "ocs_inputs" -select_column "hardware_id" -select_value $hardware_id -exclude_columns {id hardware_id}]
......@@ -218,6 +227,7 @@ append result [im_generic_table_component -table_name "ocs_softwares" -select_co
# append result [im_generic_table_component -table_name "ocs_locks" -select_column "hardware_id" -select_value $hardware_id -exclude_columns {id hardware_id}]
# append result [im_generic_table_component -table_name "ocs_network_devices" -select_column "hardware_id" -select_value $hardware_id -exclude_columns {id hardware_id}]
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment