Index: trunk/extensions/DataCenter/DataCenter.db.php |
— | — | @@ -2233,7 +2233,7 @@ |
2234 | 2234 | } |
2235 | 2235 | } |
2236 | 2236 | |
2237 | | -class DataCenterDBPlan extends DataCenterDBComponent { |
| 2237 | +class DataCenterDBPlan extends DataCenterDBRow { |
2238 | 2238 | |
2239 | 2239 | /* Protected Members */ |
2240 | 2240 | |
Index: trunk/extensions/DataCenter/Controllers/Plans.php |
— | — | @@ -92,6 +92,13 @@ |
93 | 93 | array $data, |
94 | 94 | $type |
95 | 95 | ) { |
| 96 | + // Checks for confirmation |
| 97 | + if ( |
| 98 | + !isset( $data['row']['confirm'] ) || |
| 99 | + ( $data['row']['confirm'] != 'yes' ) |
| 100 | + ) { |
| 101 | + return false; |
| 102 | + } |
96 | 103 | switch ( $type ) { |
97 | 104 | case 'plan': |
98 | 105 | $plan = DataCenterDBPlan::newFromValues( $data['row'] ); |
Index: trunk/extensions/DataCenter/Controllers/Settings.php |
— | — | @@ -59,6 +59,13 @@ |
60 | 60 | array $data, |
61 | 61 | $type |
62 | 62 | ) { |
| 63 | + // Checks for confirmation |
| 64 | + if ( |
| 65 | + !isset( $data['row']['confirm'] ) || |
| 66 | + ( $data['row']['confirm'] != 'yes' ) |
| 67 | + ) { |
| 68 | + return false; |
| 69 | + } |
63 | 70 | switch ( $type ) { |
64 | 71 | case 'field': |
65 | 72 | $field = DataCenterDBMetaField::newFromValues( $data['row'] ); |
Index: trunk/extensions/DataCenter/DataCenter.sql |
— | — | @@ -98,8 +98,6 @@ |
99 | 99 | mdl_rak_name VARBINARY(255) NOT NULL default '', |
100 | 100 | -- Kind of this rack model |
101 | 101 | mdl_rak_kind VARBINARY(255) NOT NULL default '', |
102 | | - -- Note about this rack model |
103 | | - mdl_rak_note BLOB, |
104 | 102 | -- Number of vertical rack units this rack model can hold |
105 | 103 | mdl_rak_units INTEGER, |
106 | 104 | -- |
— | — | @@ -117,8 +115,6 @@ |
118 | 116 | mdl_obj_name VARBINARY(255) NOT NULL default '', |
119 | 117 | -- Kind of this object model |
120 | 118 | mdl_obj_kind VARBINARY(255) NOT NULL default '', |
121 | | - -- Note about this object model |
122 | | - mdl_obj_note BLOB, |
123 | 119 | -- The form factor of this object model |
124 | 120 | mdl_obj_form_factor ENUM( |
125 | 121 | 'rackunit', |
— | — | @@ -507,7 +503,7 @@ |
508 | 504 | ) |
509 | 505 | VALUES |
510 | 506 | ( 'WikiMedia Owned', 'boolean' ), |
511 | | - ( 'Extra Notes', 'text' ), |
| 507 | + ( 'Notes', 'text' ), |
512 | 508 | ( 'Weight (LBS)', 'number' ), |
513 | 509 | ( 'Assigned User', 'string' ); |
514 | 510 | -- |
— | — | @@ -575,6 +571,9 @@ |
576 | 572 | ( 2, 'facility', 'space' ), |
577 | 573 | ( 2, 'asset', 'rack' ), |
578 | 574 | ( 2, 'asset', 'object' ), |
| 575 | + ( 2, 'model', 'rack' ), |
| 576 | + ( 2, 'model', 'object' ), |
| 577 | + ( 2, 'model', 'port' ), |
579 | 578 | ( 3, 'asset', 'object' ), |
580 | 579 | ( 4, 'asset', 'object' ); |
581 | 580 | -- |
Index: trunk/extensions/DataCenter/UI/Widgets/Table.php |
— | — | @@ -101,6 +101,13 @@ |
102 | 102 | DataCenterUI::message( 'field', $label ) |
103 | 103 | ); |
104 | 104 | } |
| 105 | + if ( count( $parameters['rows'] ) == 0 ) { |
| 106 | + $xmlOutput .= DataCenterXml::row( |
| 107 | + DataCenterXml::cell( |
| 108 | + DataCenterUI::message( 'error', 'no-rows' ) |
| 109 | + ) |
| 110 | + ); |
| 111 | + } |
105 | 112 | // Loops over each row |
106 | 113 | foreach ( $parameters['rows'] as $i => $row ) { |
107 | 114 | // Builds row attributes |
Index: trunk/extensions/DataCenter/Views/Settings/Field.php |
— | — | @@ -170,7 +170,9 @@ |
171 | 171 | 'page' => 'settings', |
172 | 172 | 'type' => 'field' |
173 | 173 | ), |
174 | | - 'fields' => array() |
| 174 | + 'fields' => array( |
| 175 | + 'confirm' => array( 'type' => 'string' ) |
| 176 | + ) |
175 | 177 | ) |
176 | 178 | ) |
177 | 179 | ) |
Index: trunk/extensions/DataCenter/Views/Models.php |
— | — | @@ -23,7 +23,6 @@ |
24 | 24 | 'manufacturer' => array( 'type' => 'string' ), |
25 | 25 | 'name' => array( 'type' => 'string' ), |
26 | 26 | 'kind' => array( 'type' => 'string' ), |
27 | | - 'note' => array( 'type' => 'text' ), |
28 | 27 | 'units' => array( |
29 | 28 | 'type' => 'number', |
30 | 29 | 'min' => 1, |
— | — | @@ -34,7 +33,7 @@ |
35 | 34 | 'details' => array( |
36 | 35 | 'heading' => array( 'field' => 'name' ), |
37 | 36 | 'fields' => array( |
38 | | - 'manufacturer', 'name', 'kind', 'units', 'note' |
| 37 | + 'manufacturer', 'name', 'kind', 'units' |
39 | 38 | ) |
40 | 39 | ), |
41 | 40 | ), |
— | — | @@ -51,7 +50,6 @@ |
52 | 51 | 'manufacturer' => array( 'type' => 'string' ), |
53 | 52 | 'name' => array( 'type' => 'string' ), |
54 | 53 | 'kind' => array( 'type' => 'string' ), |
55 | | - 'note' => array( 'type' => 'text' ), |
56 | 54 | 'form-factor' => array( |
57 | 55 | 'field' => 'form_factor', |
58 | 56 | 'type' => 'list', |
— | — | @@ -87,7 +85,6 @@ |
88 | 86 | 'units', |
89 | 87 | 'depth', |
90 | 88 | 'power', |
91 | | - 'note' |
92 | 89 | ) |
93 | 90 | ), |
94 | 91 | ), |
— | — | @@ -103,7 +100,6 @@ |
104 | 101 | 'fields' => array( |
105 | 102 | 'name' => array( 'type' => 'string' ), |
106 | 103 | 'kind' => array( 'type' => 'string' ), |
107 | | - 'note' => array( 'type' => 'text' ), |
108 | 104 | 'category' => array( |
109 | 105 | 'type' => 'list', |
110 | 106 | 'enum' => array( |
— | — | @@ -125,7 +121,7 @@ |
126 | 122 | 'details' => array( |
127 | 123 | 'heading' => array( 'field' => 'name' ), |
128 | 124 | 'fields' => array( |
129 | | - 'name', 'kind', 'category', 'format', 'note' |
| 125 | + 'name', 'kind', 'category', 'format' |
130 | 126 | ) |
131 | 127 | ), |
132 | 128 | ), |
Index: trunk/extensions/DataCenter/Views/Plans/Plan.php |
— | — | @@ -220,9 +220,9 @@ |
221 | 221 | DataCenterUI::renderWidget( |
222 | 222 | 'body', |
223 | 223 | array( |
224 | | - 'message' => 'confirm-remove-type', |
225 | | - 'subject' => $path['type'], |
226 | | - 'type' => 'notice', |
| 224 | + 'message' => 'notice-removing-type', |
| 225 | + 'type' => $path['type'], |
| 226 | + 'style' => 'notice', |
227 | 227 | ) |
228 | 228 | ), |
229 | 229 | DataCenterUI::renderWidget( |
— | — | @@ -259,7 +259,9 @@ |
260 | 260 | 'page' => 'plans', |
261 | 261 | 'type' => 'plan' |
262 | 262 | ), |
263 | | - 'fields' => array() |
| 263 | + 'fields' => array( |
| 264 | + 'confirm' => array( 'type' => 'string' ) |
| 265 | + ) |
264 | 266 | ) |
265 | 267 | ), |
266 | 268 | ) |
Index: trunk/extensions/DataCenter/Views/Plans/Rack.php |
— | — | @@ -308,9 +308,9 @@ |
309 | 309 | DataCenterUI::renderWidget( |
310 | 310 | 'body', |
311 | 311 | array( |
312 | | - 'message' => 'confirm-remove-type', |
313 | | - 'subject' => $path['type'], |
314 | | - 'type' => 'notice', |
| 312 | + 'message' => 'notice-removing-type', |
| 313 | + 'type' => $path['type'], |
| 314 | + 'style' => 'notice', |
315 | 315 | ) |
316 | 316 | ), |
317 | 317 | DataCenterUI::renderWidget( |
— | — | @@ -350,7 +350,9 @@ |
351 | 351 | 'page' => 'plans', |
352 | 352 | 'type' => 'rack' |
353 | 353 | ), |
354 | | - 'fields' => array() |
| 354 | + 'fields' => array( |
| 355 | + 'confirm' => array( 'type' => 'string' ) |
| 356 | + ) |
355 | 357 | ) |
356 | 358 | ), |
357 | 359 | ) |
Index: trunk/extensions/DataCenter/Views/Plans/Object.php |
— | — | @@ -281,9 +281,9 @@ |
282 | 282 | DataCenterUI::renderWidget( |
283 | 283 | 'body', |
284 | 284 | array( |
285 | | - 'message' => 'confirm-remove-type', |
286 | | - 'subject' => $path['type'], |
287 | | - 'type' => 'notice', |
| 285 | + 'message' => 'notice-removing-type', |
| 286 | + 'type' => $path['type'], |
| 287 | + 'style' => 'notice', |
288 | 288 | ) |
289 | 289 | ), |
290 | 290 | DataCenterUI::renderWidget( |
— | — | @@ -323,7 +323,9 @@ |
324 | 324 | 'page' => 'plans', |
325 | 325 | 'type' => 'object' |
326 | 326 | ), |
327 | | - 'fields' => array() |
| 327 | + 'fields' => array( |
| 328 | + 'confirm' => array( 'type' => 'string' ) |
| 329 | + ) |
328 | 330 | ) |
329 | 331 | ) |
330 | 332 | ) |
Index: trunk/extensions/DataCenter/DataCenter.i18n.php |
— | — | @@ -91,6 +91,7 @@ |
92 | 92 | 'datacenter-ui-error-invalid-data' => 'You have provided invalid data', |
93 | 93 | 'datacenter-ui-error-no-components' => 'No components were provided', |
94 | 94 | 'datacenter-ui-error-no-fields' => 'No fields were provided', |
| 95 | + 'datacenter-ui-error-no-rows' => 'No records found', |
95 | 96 | 'datacenter-ui-error-no-ui-widget' => 'The user-interface widget "$1" doesn\'t exist', |
96 | 97 | // Fields |
97 | 98 | 'datacenter-ui-field-name' => 'Name', |
— | — | @@ -142,6 +143,7 @@ |
143 | 144 | 'datacenter-ui-field-tense' => 'Tense', |
144 | 145 | 'datacenter-ui-field-change-summary' => 'Change Summary', |
145 | 146 | 'datacenter-ui-field-uses' => 'Uses', |
| 147 | + 'datacenter-ui-field-confirm' => 'Enter "yes" to confirm', |
146 | 148 | // Label |
147 | 149 | 'datacenter-ui-label-reset' => 'Reset', |
148 | 150 | 'datacenter-ui-label-cancel' => 'Cancel', |