diff options
| author | artem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2007-12-03 09:14:49 +0000 |
|---|---|---|
| committer | artem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2007-12-03 09:14:49 +0000 |
| commit | bde9b2e7b9eb5c5d18e89de32ae3033d2cc415d8 (patch) | |
| tree | 692baf5e75aa1b9409470a5bdb443c68fb1812b4 | |
| parent | 7a9fe385773913d7feeb9cd60a19467f4526345b (diff) | |
| download | zabbix-bde9b2e7b9eb5c5d18e89de32ae3033d2cc415d8.tar.gz zabbix-bde9b2e7b9eb5c5d18e89de32ae3033d2cc415d8.tar.xz zabbix-bde9b2e7b9eb5c5d18e89de32ae3033d2cc415d8.zip | |
- [DEV-52] changes in schema.sql (Artem)
git-svn-id: svn://svn.zabbix.com/trunk@5127 97f52cf1-0a1b-0410-bd0e-c28be96e8082
| -rw-r--r-- | create/schema/schema.sql | 12 | ||||
| -rw-r--r-- | frontends/php/include/forms.inc.php | 20 | ||||
| -rw-r--r-- | frontends/php/include/maps.inc.php | 10 | ||||
| -rw-r--r-- | frontends/php/map.php | 9 | ||||
| -rw-r--r-- | frontends/php/sysmap.php | 11 |
5 files changed, 32 insertions, 30 deletions
diff --git a/create/schema/schema.sql b/create/schema/schema.sql index b6b02eb1..03c2a533 100644 --- a/create/schema/schema.sql +++ b/create/schema/schema.sql @@ -582,11 +582,15 @@ FIELD |linkid |t_id |'0' |NOT NULL |0 FIELD |sysmapid |t_id |'0' |NOT NULL |ZBX_SYNC FIELD |selementid1 |t_id |'0' |NOT NULL |ZBX_SYNC FIELD |selementid2 |t_id |'0' |NOT NULL |ZBX_SYNC +FIELD |drawtype |t_integer |'0' |NOT NULL |ZBX_SYNC +FIELD |color |t_varchar(32) |'Black'|NOT NULL |ZBX_SYNC + +TABLE|sysmaps_link_triggers|linkid|ZBX_SYNC +FIELD |linkid |t_id |'0' |NOT NULL |ZBX_SYNC FIELD |triggerid |t_id | | |ZBX_SYNC -FIELD |drawtype_off |t_integer |'0' |NOT NULL |ZBX_SYNC -FIELD |color_off |t_varchar(32) |'Black'|NOT NULL |ZBX_SYNC -FIELD |drawtype_on |t_integer |'0' |NOT NULL |ZBX_SYNC -FIELD |color_on |t_varchar(32) |'Red' |NOT NULL |ZBX_SYNC +FIELD |drawtype |t_integer |'0' |NOT NULL |ZBX_SYNC +FIELD |color |t_varchar(32) |'Black'|NOT NULL |ZBX_SYNC +INDEX |1 |linkid TABLE|sysmaps_elements|selementid|ZBX_SYNC FIELD |selementid |t_id |'0' |NOT NULL |0 diff --git a/frontends/php/include/forms.inc.php b/frontends/php/include/forms.inc.php index 55cb5388..9d2e3574 100644 --- a/frontends/php/include/forms.inc.php +++ b/frontends/php/include/forms.inc.php @@ -4880,8 +4880,8 @@ include_once 'include/discovery.inc.php'; $selementid1 = $db_link["selementid1"]; $selementid2 = $db_link["selementid2"]; $triggers = array(); - $drawtype_off = $db_link["drawtype_off"]; - $color_off = $db_link["color_off"]; + $drawtype = $db_link["drawtype"]; + $color = $db_link["color"]; $res = DBselect('SELECT * FROM sysmaps_link_triggers WHERE linkid='.$_REQUEST["linkid"]); while($rows=DBfetch($res)){ @@ -4893,8 +4893,8 @@ include_once 'include/discovery.inc.php'; $selementid1 = get_request("selementid1", 0); $selementid2 = get_request("selementid2", 0); $triggers = get_request("triggers", array()); - $drawtype_off = get_request("drawtype_off", 0); - $color_off = get_request("color_off", 0); + $drawtype = get_request("drawtype", 0); + $color = get_request("color", 0); } /* START comboboxes preparations */ @@ -4931,18 +4931,18 @@ include_once 'include/discovery.inc.php'; $cmbElements2->AddItem($db_selement["selementid"],$label); } - $cmbType_off = new CComboBox("drawtype_off",$drawtype_off); + $cmbType = new CComboBox("drawtype",$drawtype); foreach(map_link_drawtypes() as $i){ $value = map_link_drawtype2str($i); - $cmbType_off->AddItem($i, $value); + $cmbType->AddItem($i, $value); } - $cmbColor_off = new CComboBox("color_off",$color_off); + $cmbColor = new CComboBox("color",$color); foreach(array('Black','Blue','Cyan','Dark Blue','Dark Green', 'Dark Red','Dark Yellow','Green','Red','White','Yellow') as $value) { - $cmbColor_off->AddItem($value, $value); + $cmbColor->AddItem($value, $value); } /* END preparation */ @@ -5013,8 +5013,8 @@ include_once 'include/discovery.inc.php'; //---------- - $frmCnct->AddRow(S_TYPE.' ('.S_OFF.')',$cmbType_off); - $frmCnct->AddRow(S_COLOR.' ('.S_OFF.')',$cmbColor_off); + $frmCnct->AddRow(S_TYPE.' ('.S_OFF.')',$cmbType); + $frmCnct->AddRow(S_COLOR.' ('.S_OFF.')',$cmbColor); $frmCnct->AddItemToBottomRow(new CButton("save_link",S_SAVE)); if(isset($_REQUEST["linkid"])) diff --git a/frontends/php/include/maps.inc.php b/frontends/php/include/maps.inc.php index d380c9cf..d56250aa 100644 --- a/frontends/php/include/maps.inc.php +++ b/frontends/php/include/maps.inc.php @@ -203,7 +203,7 @@ return $sysmapid; } - function add_link($sysmapid,$selementid1,$selementid2,$triggers,$drawtype_off,$color_off){ + function add_link($sysmapid,$selementid1,$selementid2,$triggers,$drawtype,$color){ $linkid=get_dbid("sysmaps_links","linkid"); $result=TRUE; @@ -216,8 +216,8 @@ } $result&=DBexecute("insert into sysmaps_links". - " (linkid,sysmapid,selementid1,selementid2,drawtype_off,color_off)". - " values ($linkid,$sysmapid,$selementid1,$selementid2,$drawtype_off,".zbx_dbstr($color_off).")"); + " (linkid,sysmapid,selementid1,selementid2,drawtype,color)". + " values ($linkid,$sysmapid,$selementid1,$selementid2,$drawtype,".zbx_dbstr($color).")"); if(!$result) return $result; @@ -225,7 +225,7 @@ return $linkid; } - function update_link($linkid,$sysmapid,$selementid1,$selementid2,$triggers,$drawtype_off,$color_off){ + function update_link($linkid,$sysmapid,$selementid1,$selementid2,$triggers,$drawtype,$color){ $result=TRUE; foreach($triggers as $id => $trigger){ @@ -238,7 +238,7 @@ $result&=DBexecute('UPDATE sysmaps_links SET '. " sysmapid=$sysmapid,selementid1=$selementid1,selementid2=$selementid2,". - " drawtype_off=$drawtype_off,color_off=".zbx_dbstr($color_off). + " drawtype=$drawtype,color=".zbx_dbstr($color). " WHERE linkid=$linkid"); return $result; } diff --git a/frontends/php/map.php b/frontends/php/map.php index c4541119..d5d001ac 100644 --- a/frontends/php/map.php +++ b/frontends/php/map.php @@ -136,8 +136,8 @@ include_once "include/page_header.php"; list($x1, $y1) = get_icon_center_by_selementid($link["selementid1"]); list($x2, $y2) = get_icon_center_by_selementid($link["selementid2"]); - $drawtype = $link["drawtype_off"]; - $color = $colors[$link["color_off"]]; + $drawtype = $link["drawtype"]; + $color = $colors[$link["color"]]; $triggers = get_link_triggers($link['linkid']); @@ -147,15 +147,14 @@ include_once "include/page_header.php"; foreach($triggers as $id => $link_trigger){ $triggers[$id]=array_merge($link_trigger,get_trigger_by_triggerid($link_trigger["triggerid"])); if($triggers[$id]["status"] == TRIGGER_STATUS_ENABLED && $triggers[$id]["value"] == TRIGGER_VALUE_TRUE){ - if(($triggers[$id]['severity'] >= $max_severity)){ - $drawtype = $triggers[$id]["drawtype"]; + if($triggers[$id]['severity'] >= $max_severity){ + $drawtype = $triggers[$id]['drawtype']; $color = $colors[$triggers[$id]['color']]; $max_severity=$triggers[$id]['severity']; } } } } - MyDrawLine($im,$x1,$y1,$x2,$y2,$color,$drawtype); } diff --git a/frontends/php/sysmap.php b/frontends/php/sysmap.php index 6bf5e076..24188f52 100644 --- a/frontends/php/sysmap.php +++ b/frontends/php/sysmap.php @@ -51,8 +51,8 @@ include_once "include/page_header.php"; "selementid1"=> array(T_ZBX_INT, O_OPT, NULL, DB_ID.'{}!={selementid2}','isset({save_link})'), "selementid2"=> array(T_ZBX_INT, O_OPT, NULL, DB_ID.'{}!={selementid1}','isset({save_link})'), "triggers"=> array(T_ZBX_STR, O_OPT, NULL, null,'isset({save_link})'), - "drawtype_off"=>array(T_ZBX_INT, O_OPT, NULL, IN("0,1,2,3,4"),'isset({save_link})'), - "color_off"=> array(T_ZBX_STR, O_OPT, NULL, NOT_EMPTY,'isset({save_link})'), + "drawtype"=>array(T_ZBX_INT, O_OPT, NULL, IN("0,1,2,3,4"),'isset({save_link})'), + "color"=> array(T_ZBX_STR, O_OPT, NULL, NOT_EMPTY,'isset({save_link})'), /* actions */ "save"=> array(T_ZBX_STR, O_OPT, P_SYS|P_ACT, NULL, NULL), @@ -103,14 +103,14 @@ include_once "include/page_header.php"; if(isset($_REQUEST["linkid"])){ // update link $result=update_link($_REQUEST["linkid"], $_REQUEST["sysmapid"],$_REQUEST["selementid1"],$_REQUEST["selementid2"], - get_request("triggers",array()), $_REQUEST["drawtype_off"],$_REQUEST["color_off"]); + get_request("triggers",array()), $_REQUEST["drawtype"],$_REQUEST["color"]); $linkid = $_REQUEST["linkid"]; show_messages($result,"Link updated","Cannot update link"); } else{ // add link $result=add_link($_REQUEST["sysmapid"],$_REQUEST["selementid1"],$_REQUEST["selementid2"], - get_request("triggers",array()), $_REQUEST["drawtype_off"],$_REQUEST["color_off"]); + get_request("triggers",array()), $_REQUEST["drawtype"],$_REQUEST["color"]); $linkid = $result; show_messages($result,"Link added","Cannot add link"); @@ -139,8 +139,7 @@ include_once "include/page_header.php"; add_audit_if($result,AUDIT_ACTION_UPDATE,AUDIT_RESOURCE_MAP, 'Name ['.$sysmap['name'].'] Element ['.$_REQUEST["selementid"].'] deleteed '); - if($result) - { + if($result){ unset($_REQUEST["selementid"]); unset($_REQUEST["form"]); } |
