rt# 74031 work in progress
[freeside.git] / httemplate / elements / tr-select-realestate_unit.html
1 <%doc>
2
3 Display a pair of select boxes for provisioning a realestate_unit
4 - Real Estate Location
5 - Real Estate Unit
6
7 </%doc>
8 <& tr-td-label.html, %opt &>
9 <td>
10 <& select-tiered.html,
11   'tiers' => [
12     {
13       # (todo) need to filter out locations where all units are assigned
14       field         => 'realestate_location',
15       table         => 'realestate_location',
16       #extra_sql     => "WHERE $classnum_sql",
17       name_col      => 'location_title',
18       empty_label   => '(all)',
19     },
20     {
21       field         => 'realestate_unit',
22       table         => 'realestate_unit',
23       name_col      => 'unit_title',
24       value_col     => 'realestatenum',
25       link_col      => 'realestatelocnum',
26       #extra_sql     => delete($opt{'extra_sql'}),
27       # Need to add a filter to filter-out assigned units (todo)
28       disable_empty => 1,
29     },
30   ],
31   %opt,
32   'prefix' => $opt{'prefix'}. $opt{'field'}. '_', #after %opt so it overrides
33 &>
34 </td>
35 </tr>
36 <%init>
37
38 my %opt = @_;
39
40 </%init>