summaryrefslogtreecommitdiff
path: root/httemplate/elements/tr-select-realestate_unit.html
blob: 00c568eeae3681de44a1632f29c498a062629142 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<%doc>

Display a pair of select boxes for provisioning a realestate_unit
- Real Estate Location
- Real Estate Unit

</%doc>
<& tr-td-label.html, %opt &>
<td>
<& select-tiered.html,
  'tiers' => [
    {
      # (todo) need to filter out locations where all units are assigned
      field         => 'realestate_location',
      table         => 'realestate_location',
      #extra_sql     => "WHERE $classnum_sql",
      name_col      => 'location_title',
      empty_label   => '(all)',
    },
    {
      field         => 'realestate_unit',
      table         => 'realestate_unit',
      name_col      => 'unit_title',
      value_col     => 'realestatenum',
      link_col      => 'realestatelocnum',
      #extra_sql     => delete($opt{'extra_sql'}),
      # Need to add a filter to filter-out assigned units (todo)
      disable_empty => 1,
    },
  ],
  %opt,
  'prefix' => $opt{'prefix'}. $opt{'field'}. '_', #after %opt so it overrides
&>
</td>
</tr>
<%init>

my %opt = @_;

</%init>