4.x style
[freeside.git] / httemplate / elements / 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 NOTE:
8   Records are always suppresed if
9   - realestate_location.disabled is set
10   - realestate_unit is provisioned to a customer [not working]
11
12   If it becomes necessary, an option may be added to the template
13   to show disabled/provisioned records, but is not yet implemented
14
15 </%doc>
16 <& select-tiered.html,
17   'tiers' => [
18     {
19
20       field         => 'realestate_location',
21       table         => 'realestate_location',
22       extra_sql     => "WHERE realestate_location.disabled IS NULL "
23                      . "   OR realestate_location.disabled = '' ",
24       name_col      => 'location_title',
25       empty_label   => '(all)',
26     },
27     {
28       field         => 'realestatenum',
29       table         => 'realestate_unit',
30       name_col      => 'unit_title',
31       value_col     => 'realestatenum',
32       link_col      => 'realestatelocnum',
33
34       # TODO: Filter units assigned to customers
35       # SQL below breaks the selectbox... why?
36
37       # Also, can we assume if realestatenum doesn't appear in svc_realestate
38       # that the realestate_unit is unprovisioned to a customer?  What indicator
39       # should be used to determine when a realestae_unit is not provisioned?
40
41       # addl_from     => "
42       #   LEFT JOIN svc_realestate
43       #     ON svc_realestate.realestatenum = realestate_unit.realestatenum
44       # ",
45
46       #extra_sql     => "WHERE svc_realestate.svcnum IS NULL ",
47
48       disable_empty => 1,
49       debug => 1,
50     },
51   ],
52   %opt,
53   'prefix' => $opt{'prefix'}. $opt{'field'}. '_', #after %opt so it overrides
54 &>
55 <%init>
56
57 my %opt = @_;
58
59 </%init>