Revision: 46041
Author:   tparscal
Date:     2009-01-22 23:28:33 +0000 (Thu, 22 Jan 2009)

Log Message:
-----------
Added location information to rows of objects and racks when selecting to 
attach to plan.

Modified Paths:
--------------
    trunk/extensions/DataCenter/Views/Plans/Object.php
    trunk/extensions/DataCenter/Views/Plans/Rack.php

Modified: trunk/extensions/DataCenter/Views/Plans/Object.php
===================================================================
--- trunk/extensions/DataCenter/Views/Plans/Object.php  2009-01-22 23:11:11 UTC 
(rev 46040)
+++ trunk/extensions/DataCenter/Views/Plans/Object.php  2009-01-22 23:28:33 UTC 
(rev 46041)
@@ -165,6 +165,14 @@
                                                        'model', 'object', 'id',
                                                        'asset', 'object', 
'model',
                                                        array( 'name', 
'manufacturer' )
+                                               ),
+                                               DataCenterDB::buildJoin(
+                                                       'facility', 'location', 
'id',
+                                                       'asset', 'object', 
'location',
+                                                       array(
+                                                               'name' => 
'location_name',
+                                                               'region' => 
'location_region',
+                                                       )
                                                )
                                        )
                                ),
@@ -183,6 +191,14 @@
                                                        'model', 'object', 'id',
                                                        'asset', 'object', 
'model',
                                                        array( 'name', 
'manufacturer' )
+                                               ),
+                                               DataCenterDB::buildJoin(
+                                                       'facility', 'location', 
'id',
+                                                       'asset', 'object', 
'location',
+                                                       array(
+                                                               'name' => 
'location_name',
+                                                               'region' => 
'location_region',
+                                                       )
                                                )
                                        )
                                ),
@@ -206,7 +222,13 @@
                                                                'manufacturer',
                                                                'model' => 
array( 'field' => 'name' ),
                                                                'serial',
-                                                               'asset'
+                                                               'asset',
+                                                               'location' => 
array(
+                                                                       
'fields' => array(
+                                                                               
'location_name', 'location_region'
+                                                                       ),
+                                                                       'glue' 
=> ' / ',
+                                                               ),
                                                        ),
                                                        'link' => array(
                                                                'page' => 
'plans',

Modified: trunk/extensions/DataCenter/Views/Plans/Rack.php
===================================================================
--- trunk/extensions/DataCenter/Views/Plans/Rack.php    2009-01-22 23:11:11 UTC 
(rev 46040)
+++ trunk/extensions/DataCenter/Views/Plans/Rack.php    2009-01-22 23:28:33 UTC 
(rev 46041)
@@ -203,18 +203,41 @@
                        $racks = array(
                                'local' => DataCenterDB::getAssets(
                                        'rack',
-                                       DataCenterDB::buildCondition(
-                                               'asset', 'rack', 'location', 
$space->get( 'location' )
+                                       array_merge_recursive(
+                                               DataCenterDB::buildCondition(
+                                                       'asset',
+                                                       'rack',
+                                                       'location',
+                                                       $space->get( 'location' 
)
+                                               ),
+                                               DataCenterDB::buildJoin(
+                                                       'facility', 'location', 
'id',
+                                                       'asset', 'rack', 
'location',
+                                                       array(
+                                                               'name' => 
'location_name',
+                                                               'region' => 
'location_region',
+                                                       )
+                                               )
                                        )
                                ),
                                'remote' => DataCenterDB::getAssets(
                                        'rack',
-                                       DataCenterDB::buildCondition(
-                                               'asset',
-                                               'rack',
-                                               'location',
-                                               $space->get( 'location' ),
-                                               '!='
+                                       array_merge_recursive(
+                                               DataCenterDB::buildCondition(
+                                                       'asset',
+                                                       'rack',
+                                                       'location',
+                                                       $space->get( 'location' 
),
+                                                       '!='
+                                               ),
+                                               DataCenterDB::buildJoin(
+                                                       'facility', 'location', 
'id',
+                                                       'asset', 'rack', 
'location',
+                                                       array(
+                                                               'name' => 
'location_name',
+                                                               'region' => 
'location_region',
+                                                       )
+                                               )
                                        )
                                )
                        );
@@ -242,7 +265,13 @@
                                                                'manufacturer',
                                                                'model' => 
array( 'field' => 'name' ),
                                                                'serial',
-                                                               'asset'
+                                                               'asset',
+                                                               'location' => 
array(
+                                                                       
'fields' => array(
+                                                                               
'location_name', 'location_region'
+                                                                       ),
+                                                                       'glue' 
=> ' / ',
+                                                               ),
                                                        ),
                                                        'link' => array(
                                                                'page' => 
'plans',



_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to