allow files to be linked to rows (#733)
authorAaron Dummer <aaron@dummer.info>
Sun, 24 Feb 2013 22:41:40 +0000 (14:41 -0800)
committerAaron Dummer <aaron@dummer.info>
Sun, 24 Feb 2013 22:41:40 +0000 (14:41 -0800)
ChangeLog
wwwroot/inc/database.php
wwwroot/inc/functions.php
wwwroot/inc/interface.php
wwwroot/inc/navigation.php
wwwroot/inc/upgrade.php

index ba20dc7cd13e946e274dca23f3af256fd206a827..594bd40b885906d29f4d0aff800377b29695ab1d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -18,6 +18,7 @@
        update: 802.1Q: misconfigured uplink/downlink ports are highlighed red on '802.1Q Ports' tab
        update: assign IP addresses to objects whose type is Wireless (#755)
        update: SNMP support for Linksys SRW224G4 (#743)
+       update: files may be linked to rows (#733)
        new feature: configurable top-to-bottom units order in particular racks (#601)
        new feature: overridable tag names display style (via CSS and plug-ins)
 0.20.3 2012-12-19
index 44e4f55676b4b9ef74c60249c14d2fce89130225..dc70d08f0bb96c78278b87fbc444ee41abe82482 100644 (file)
@@ -4227,6 +4227,12 @@ function getFileLinks ($file_id)
                                $parent = spotEntity ($row['entity_type'], $row['entity_id']);
                                $name = $parent['name'];
                                break;
+                       case 'row':
+                               $page = 'row';
+                               $id_name = 'row_id';
+                               $parent = spotEntity ($row['entity_type'], $row['entity_id']);
+                               $name = $parent['name'];
+                               break;
                        case 'rack':
                                $page = 'rack';
                                $id_name = 'rack_id';
index 72e539361f20964fab2378e55dc5a32894f96564..407ce84f9ebd796826212ef05c97bc14acc96b37 100644 (file)
@@ -61,6 +61,7 @@ $etype_by_pageno = array
        'ipv4vs' => 'ipv4vs',
        'object' => 'object',
        'rack' => 'rack',
+       'row' => 'row',
        'location' => 'location',
        'user' => 'user',
        'file' => 'file',
@@ -2613,6 +2614,8 @@ function formatEntityName ($name) {
                        return 'Object';
                case 'rack':
                        return 'Rack';
+               case 'row':
+                       return 'Row';
                case 'location':
                        return 'Location';
                case 'user':
index 0c1a3ca20695575aaa4193a1628feb01748a8966..75a66605f4cba2f49f92e8bacba70aa883387c0b 100644 (file)
@@ -568,6 +568,7 @@ function renderRow ($row_id)
        finishPortlet();
        renderCellFilterPortlet ($cellfilter, 'rack', $rackList, array ('row_id' => $row_id));
 
+       renderFilesPortlet ('row',$row_id);
        echo "</td><td class=pcright>";
 
        global $nextorder;
index 72bf67319118b2257f0b961beb80d4ecde7895b1..4720a020a1261159d95e271aa97fd4f4110bb5fa 100644 (file)
@@ -103,12 +103,17 @@ $tab['row']['default'] = 'View';
 $tab['row']['editracks'] = 'Manage racks';
 $tab['row']['newrack'] = 'Add new rack';
 $tab['row']['tagroller'] = 'Tag roller';
+$tab['row']['files'] = 'Files';
 $tabhandler['row']['default'] = 'renderRow';
 $tabhandler['row']['editracks'] = 'renderRackSortForm';
 $tabhandler['row']['newrack'] = 'renderNewRackForm';
 $tabhandler['row']['tagroller'] = 'renderTagRollerForRow';
+$tabhandler['row']['files'] = 'renderFilesForEntity';
 $ophandler['row']['tagroller']['rollTags'] = 'rollTags';
 $ophandler['row']['newrack']['addRack'] = 'addRack';
+$ophandler['row']['files']['addFile'] = 'addFileToEntity';
+$ophandler['row']['files']['linkFile'] = 'linkFileToEntity';
+$ophandler['row']['files']['unlinkFile'] = 'unlinkFile';
 
 $page['rack']['bypass'] = 'rack_id';
 $page['rack']['bypass_type'] = 'uint';
index 8353d6f43bf33eaa28a0dcde1e88ec8550ec0e91..9764a1cd1681cd30cfe7a602b066822d80a68ae1 100644 (file)
@@ -1616,6 +1616,7 @@ CREATE TABLE `MuninGraph` (
                        $query[] = "UPDATE Config SET varvalue = '0.20.3' WHERE varname = 'DB_VERSION'";
                        break;
                case '0.20.4':
+                       $query[] = "ALTER TABLE `FileLink` MODIFY COLUMN `entity_type` ENUM('ipv4net','ipv4rspool','ipv4vs','ipv6net','location','object','rack','row','user') NOT NULL DEFAULT 'object'";
                        $query[] = "INSERT INTO `Config` (varname, varvalue, vartype, emptyok, is_hidden, is_userdefined, description) VALUES ('REVERSED_RACKS_LISTSRC', 'false', 'string', 'yes', 'no', 'no', 'List of racks with reversed (top to bottom) units order')";
                        $query[] = "UPDATE `Config` SET varvalue = CONCAT(varvalue, ' or {\$typeid_965}') WHERE varname = 'IPV4OBJ_LISTSRC'";
                        $query[] = "UPDATE AttributeValue INNER JOIN AttributeMap USING (attr_id) SET AttributeValue.uint_value = 1572 WHERE chapter_id = 12 AND uint_value = 162";