r46041 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r46040‎ | r46041 | r46042 >
Date:23:28, 22 January 2009
Author:tparscal
Status:deferred
Tags:
Comment:
Added location information to rows of objects and racks when selecting to attach to plan.
Modified paths:
  • /trunk/extensions/DataCenter/Views/Plans/Object.php (modified) (history)
  • /trunk/extensions/DataCenter/Views/Plans/Rack.php (modified) (history)

Diff [purge]

Index: trunk/extensions/DataCenter/Views/Plans/Rack.php
@@ -203,18 +203,41 @@
204204 $racks = array(
205205 'local' => DataCenterDB::getAssets(
206206 'rack',
207 - DataCenterDB::buildCondition(
208 - 'asset', 'rack', 'location', $space->get( 'location' )
 207+ array_merge_recursive(
 208+ DataCenterDB::buildCondition(
 209+ 'asset',
 210+ 'rack',
 211+ 'location',
 212+ $space->get( 'location' )
 213+ ),
 214+ DataCenterDB::buildJoin(
 215+ 'facility', 'location', 'id',
 216+ 'asset', 'rack', 'location',
 217+ array(
 218+ 'name' => 'location_name',
 219+ 'region' => 'location_region',
 220+ )
 221+ )
209222 )
210223 ),
211224 'remote' => DataCenterDB::getAssets(
212225 'rack',
213 - DataCenterDB::buildCondition(
214 - 'asset',
215 - 'rack',
216 - 'location',
217 - $space->get( 'location' ),
218 - '!='
 226+ array_merge_recursive(
 227+ DataCenterDB::buildCondition(
 228+ 'asset',
 229+ 'rack',
 230+ 'location',
 231+ $space->get( 'location' ),
 232+ '!='
 233+ ),
 234+ DataCenterDB::buildJoin(
 235+ 'facility', 'location', 'id',
 236+ 'asset', 'rack', 'location',
 237+ array(
 238+ 'name' => 'location_name',
 239+ 'region' => 'location_region',
 240+ )
 241+ )
219242 )
220243 )
221244 );
@@ -242,7 +265,13 @@
243266 'manufacturer',
244267 'model' => array( 'field' => 'name' ),
245268 'serial',
246 - 'asset'
 269+ 'asset',
 270+ 'location' => array(
 271+ 'fields' => array(
 272+ 'location_name', 'location_region'
 273+ ),
 274+ 'glue' => ' / ',
 275+ ),
247276 ),
248277 'link' => array(
249278 'page' => 'plans',
Index: trunk/extensions/DataCenter/Views/Plans/Object.php
@@ -165,6 +165,14 @@
166166 'model', 'object', 'id',
167167 'asset', 'object', 'model',
168168 array( 'name', 'manufacturer' )
 169+ ),
 170+ DataCenterDB::buildJoin(
 171+ 'facility', 'location', 'id',
 172+ 'asset', 'object', 'location',
 173+ array(
 174+ 'name' => 'location_name',
 175+ 'region' => 'location_region',
 176+ )
169177 )
170178 )
171179 ),
@@ -183,6 +191,14 @@
184192 'model', 'object', 'id',
185193 'asset', 'object', 'model',
186194 array( 'name', 'manufacturer' )
 195+ ),
 196+ DataCenterDB::buildJoin(
 197+ 'facility', 'location', 'id',
 198+ 'asset', 'object', 'location',
 199+ array(
 200+ 'name' => 'location_name',
 201+ 'region' => 'location_region',
 202+ )
187203 )
188204 )
189205 ),
@@ -206,7 +222,13 @@
207223 'manufacturer',
208224 'model' => array( 'field' => 'name' ),
209225 'serial',
210 - 'asset'
 226+ 'asset',
 227+ 'location' => array(
 228+ 'fields' => array(
 229+ 'location_name', 'location_region'
 230+ ),
 231+ 'glue' => ' / ',
 232+ ),
211233 ),
212234 'link' => array(
213235 'page' => 'plans',

Status & tagging log