caboose-rets 0.1.18 → 0.1.19
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/caboose_rets/admin_media.js +7 -7
- data/app/assets/javascripts/caboose_rets/caboose_rets.js +8 -8
- data/app/controllers/caboose_rets/agents_controller.rb +67 -75
- data/app/controllers/caboose_rets/offices_controller.rb +4 -4
- data/app/controllers/caboose_rets/open_houses_controller.rb +3 -3
- data/app/controllers/caboose_rets/properties_controller.rb +160 -0
- data/app/controllers/caboose_rets/rets_controller.rb +2 -2
- data/app/controllers/caboose_rets/rets_media_controller.rb +13 -13
- data/app/controllers/caboose_rets/saved_properties_controller.rb +35 -35
- data/app/models/caboose_rets/agent.rb +42 -55
- data/app/models/caboose_rets/agent_meta.rb +7 -7
- data/app/models/caboose_rets/media.rb +63 -57
- data/app/models/caboose_rets/office.rb +35 -21
- data/app/models/caboose_rets/open_house.rb +15 -15
- data/app/models/caboose_rets/property.rb +203 -0
- data/app/models/caboose_rets/rets_importer.rb +193 -233
- data/app/models/caboose_rets/rets_importer_bak.rb +77 -77
- data/app/models/caboose_rets/rets_importer_old.rb +625 -0
- data/app/models/caboose_rets/saved_property.rb +4 -4
- data/app/models/caboose_rets/saved_search.rb +36 -33
- data/app/models/caboose_rets/schema.rb +324 -855
- data/app/models/caboose_rets/schema_past.rb +918 -0
- data/app/models/caboose_rets/search_option.rb +6 -6
- data/app/views/caboose/blocks/_layout_rets.html.erb +9 -6
- data/app/views/caboose/blocks/_rets_agent_listings.html.erb +3 -3
- data/app/views/caboose_rets/agents/index.html.erb +23 -40
- data/app/views/caboose_rets/media/admin_property_media.html.erb +2 -2
- data/app/views/caboose_rets/{residential → properties}/_search_form.html.erb +42 -42
- data/app/views/caboose_rets/{residential → properties}/admin_edit.html.erb +7 -7
- data/app/views/caboose_rets/{land → properties}/admin_index.html.erb +11 -11
- data/app/views/caboose_rets/properties/details.html.erb +127 -0
- data/app/views/caboose_rets/{land → properties}/index.html.erb +0 -0
- data/app/views/caboose_rets/{residential/residential_not_exists.html.erb → properties/property_not_exists.html.erb} +4 -5
- data/app/views/caboose_rets/{residential → properties}/test_form.html.erb +1 -1
- data/app/views/caboose_rets/rets/admin_import_form.html.erb +1 -1
- data/config/routes.rb +70 -55
- data/lib/caboose-rets.rb +1 -1
- data/lib/caboose_rets/engine.rb +3 -3
- data/lib/caboose_rets/version.rb +1 -1
- data/lib/rets/base/core.rb +1 -1
- data/lib/rets/base/sax_search.rb +1 -1
- data/lib/tasks/caboose_rets.rake +106 -17
- metadata +16 -50
- data/app/controllers/caboose_rets/commercial_controller.rb +0 -349
- data/app/controllers/caboose_rets/land_controller.rb +0 -144
- data/app/controllers/caboose_rets/multi_family_controller.rb +0 -107
- data/app/controllers/caboose_rets/residential_controller.rb +0 -163
- data/app/models/caboose_rets/commercial_property.rb +0 -214
- data/app/models/caboose_rets/land_property.rb +0 -144
- data/app/models/caboose_rets/multi_family_property.rb +0 -199
- data/app/models/caboose_rets/residential_property.rb +0 -236
- data/app/views/caboose/blocks/_rets_commercial_details.html.erb +0 -192
- data/app/views/caboose/blocks/_rets_commercial_headers.html.erb +0 -17
- data/app/views/caboose/blocks/_rets_commercial_index.html.erb +0 -71
- data/app/views/caboose/blocks/_rets_commercial_row.html.erb +0 -39
- data/app/views/caboose/blocks/_rets_commercial_search_form.html.erb +0 -201
- data/app/views/caboose/blocks/_rets_land_details.html.erb +0 -165
- data/app/views/caboose/blocks/_rets_land_index.html.erb +0 -63
- data/app/views/caboose/blocks/_rets_land_row.html.erb +0 -58
- data/app/views/caboose/blocks/_rets_land_search_form.html.erb +0 -194
- data/app/views/caboose/blocks/_rets_multifamily_details.html.erb +0 -161
- data/app/views/caboose/blocks/_rets_multifamily_index.html.erb +0 -63
- data/app/views/caboose/blocks/_rets_multifamily_row.html.erb +0 -56
- data/app/views/caboose/blocks/_rets_multifamily_search_form.html.erb +0 -273
- data/app/views/caboose/blocks/_rets_openhouse_details.html.erb +0 -12
- data/app/views/caboose/blocks/_rets_openhouses_index.html.erb +0 -79
- data/app/views/caboose/blocks/_rets_residential_details.html.erb +0 -243
- data/app/views/caboose/blocks/_rets_residential_index.html.erb +0 -65
- data/app/views/caboose/blocks/_rets_residential_row.html.erb +0 -59
- data/app/views/caboose/blocks/_rets_residential_search_form.html.erb +0 -304
- data/app/views/caboose_rets/commercial/admin_edit.html.erb +0 -269
- data/app/views/caboose_rets/commercial/admin_index.html.erb +0 -51
- data/app/views/caboose_rets/commercial/admin_new.html.erb +0 -57
- data/app/views/caboose_rets/commercial/details.html.erb +0 -0
- data/app/views/caboose_rets/commercial/index.html.erb +0 -87
- data/app/views/caboose_rets/land/admin_edit.html.erb +0 -156
- data/app/views/caboose_rets/land/details.html.erb +0 -0
- data/app/views/caboose_rets/multi_family/admin_edit.html.erb +0 -211
- data/app/views/caboose_rets/multi_family/admin_index.html.erb +0 -46
- data/app/views/caboose_rets/residential/admin_index.html.erb +0 -46
- data/app/views/caboose_rets/residential/details.html.erb +0 -0
- data/app/views/caboose_rets/residential/index.html.erb +0 -0
@@ -1,144 +0,0 @@
|
|
1
|
-
|
2
|
-
module CabooseRets
|
3
|
-
class LandController < ApplicationController
|
4
|
-
|
5
|
-
# GET /land
|
6
|
-
def index
|
7
|
-
@gen = Caboose::PageBarGenerator.new(params, {
|
8
|
-
'acreage' => '',
|
9
|
-
'acreage_gte' => '',
|
10
|
-
'acreage_lte' => '',
|
11
|
-
'acreage_source' => '',
|
12
|
-
'adjoining_land_use' => '',
|
13
|
-
'agent_notes_like' => '',
|
14
|
-
'area' => '',
|
15
|
-
'bom_date' => '',
|
16
|
-
'city' => '',
|
17
|
-
'city_code' => '',
|
18
|
-
'co_la_code' => '',
|
19
|
-
'co_lo_code' => '',
|
20
|
-
'co_sa_code' => '',
|
21
|
-
'co_so_code' => '',
|
22
|
-
'converted' => '',
|
23
|
-
'county' => '',
|
24
|
-
'current_price_gte' => '',
|
25
|
-
'current_price_lte' => '',
|
26
|
-
'date_created_gte' => '',
|
27
|
-
'date_created_lte' => '',
|
28
|
-
'date_modified_gte' => '',
|
29
|
-
'date_modified_lte' => '',
|
30
|
-
'elem_school' => '',
|
31
|
-
'ftr_access_like' => '',
|
32
|
-
'ftr_lotdesc_like' => '',
|
33
|
-
'ftr_mineralrights' => '',
|
34
|
-
'ftr_zoning' => '',
|
35
|
-
'high_school' => '',
|
36
|
-
'internet_yn' => '',
|
37
|
-
'la_code' => '',
|
38
|
-
'list_date_gte' => '',
|
39
|
-
'list_date_lte' => '',
|
40
|
-
'list_price_gte' => '',
|
41
|
-
'list_price_lte' => '',
|
42
|
-
'lo_code' => '',
|
43
|
-
'middle_school' => '',
|
44
|
-
'mls_acct' => '',
|
45
|
-
'municipality' => '',
|
46
|
-
'parcel_id' => '',
|
47
|
-
'prop_type' => '',
|
48
|
-
'remarks_like' => '',
|
49
|
-
'sa_code' => '',
|
50
|
-
'so_code' => '',
|
51
|
-
'state' => '',
|
52
|
-
'status' => 'Active',
|
53
|
-
'address_like' => '',
|
54
|
-
'street_name_like' => '',
|
55
|
-
'street_num_like' => '',
|
56
|
-
'subdivision' => '',
|
57
|
-
'unit_num' => '',
|
58
|
-
'waterfront' => '',
|
59
|
-
'waterfront_yn' => '',
|
60
|
-
'zip' => ''
|
61
|
-
},{
|
62
|
-
'model' => 'CabooseRets::LandProperty',
|
63
|
-
'sort' => CabooseRets::default_property_sort,
|
64
|
-
'desc' => false,
|
65
|
-
'skip' => ['status'],
|
66
|
-
'abbreviations' => {
|
67
|
-
'address_like' => 'street_num_concat_street_name_like'
|
68
|
-
},
|
69
|
-
'base_url' => '/land/search',
|
70
|
-
'items_per_page' => 10
|
71
|
-
})
|
72
|
-
|
73
|
-
@properties = @gen.items
|
74
|
-
if params[:waterfront].present? then @properties.reject!{|p| p.waterfront.blank?} end
|
75
|
-
|
76
|
-
@block_options = {
|
77
|
-
:properties => @properties,
|
78
|
-
:saved_search => nil,
|
79
|
-
:pager => @gen
|
80
|
-
}
|
81
|
-
|
82
|
-
end
|
83
|
-
|
84
|
-
# GET /land/:mls_acct/details
|
85
|
-
def details
|
86
|
-
@property = CabooseRets::LandProperty.where(:mls_acct => params[:mls_acct]).first
|
87
|
-
@saved = logged_in? && SavedProperty.where(:user_id => logged_in_user.id, :mls_acct => params[:mls_acct]).exists?
|
88
|
-
if @property.nil?
|
89
|
-
@mls_acct = params[:mls_acct]
|
90
|
-
CabooseRets::RetsImporter.delay(:queue => 'rets').import_property(@mls_acct.to_i)
|
91
|
-
render 'land/not_exists'
|
92
|
-
return
|
93
|
-
end
|
94
|
-
@block_options = {
|
95
|
-
:mls_acct => params[:mls_acct],
|
96
|
-
:property => @property,
|
97
|
-
:saved => @saved,
|
98
|
-
:agent => @property ? Agent.where(:la_code => @property.la_code).first : nil,
|
99
|
-
:form_authenticity_token => form_authenticity_token
|
100
|
-
}
|
101
|
-
end
|
102
|
-
|
103
|
-
#=============================================================================
|
104
|
-
# Admin actions
|
105
|
-
#=============================================================================
|
106
|
-
|
107
|
-
# GET /admin/land
|
108
|
-
def admin_index
|
109
|
-
return if !user_is_allowed('properties', 'view')
|
110
|
-
|
111
|
-
@gen = Caboose::PageBarGenerator.new(params, {
|
112
|
-
'mls_acct' => ''
|
113
|
-
},{
|
114
|
-
'model' => 'CabooseRets::LandProperty',
|
115
|
-
'sort' => 'mls_acct',
|
116
|
-
'desc' => false,
|
117
|
-
'base_url' => '/admin/land',
|
118
|
-
'use_url_params' => false
|
119
|
-
})
|
120
|
-
@properties = @gen.items
|
121
|
-
render :layout => 'caboose/admin'
|
122
|
-
end
|
123
|
-
|
124
|
-
# GET /admin/land/:mls_acct/edit
|
125
|
-
def admin_edit
|
126
|
-
return if !user_is_allowed('properties', 'edit')
|
127
|
-
@property = LandProperty.where(:mls_acct => params[:mls_acct]).first
|
128
|
-
render :layout => 'caboose/admin'
|
129
|
-
end
|
130
|
-
|
131
|
-
# GET /admin/land/:mls_acct/refresh
|
132
|
-
def admin_refresh
|
133
|
-
return if !user_is_allowed('properties', 'edit')
|
134
|
-
|
135
|
-
p = LandProperty.find(params[:mls_acct])
|
136
|
-
p.delay(:queue => 'rets').refresh_from_mls
|
137
|
-
|
138
|
-
resp = Caboose::StdClass.new
|
139
|
-
resp.success = "The property's info is being updated from MLS. This may take a few minutes depending on how many images it has."
|
140
|
-
render :json => resp
|
141
|
-
end
|
142
|
-
|
143
|
-
end
|
144
|
-
end
|
@@ -1,107 +0,0 @@
|
|
1
|
-
|
2
|
-
module CabooseRets
|
3
|
-
class MultiFamilyController < ApplicationController
|
4
|
-
|
5
|
-
# GET /multi-family
|
6
|
-
def index
|
7
|
-
params[:street_num_like] = params[:street_name_like].tr('A-z', '').tr(' ', '') unless params[:street_name_like].nil?
|
8
|
-
unless params[:street_name_like].nil?
|
9
|
-
params[:street_name_like] = params[:street_name_like].tr('0-9', "")
|
10
|
-
until params[:street_name_like][0] != " " || params[:street_name_like] == ''
|
11
|
-
params[:street_name_like][0] = '' if params[:street_name_like][0].to_i == 0
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
@gen = Caboose::PageBarGenerator.new(params, {
|
16
|
-
'name' => '',
|
17
|
-
'current_price_gte' => '',
|
18
|
-
'current_price_lte' => '',
|
19
|
-
'bedrooms_gte' => '',
|
20
|
-
'bedrooms_lte' => '',
|
21
|
-
'prop_type' => '',
|
22
|
-
'tot_heat_sqft_gte' => '',
|
23
|
-
'tot_heat_sqft_lte' => '',
|
24
|
-
'neighborhood' => '',
|
25
|
-
'elem_school' => '',
|
26
|
-
'middle_school' => '',
|
27
|
-
'high_school' => '',
|
28
|
-
'address' => '',
|
29
|
-
'lo_lo_code' => '',
|
30
|
-
'remarks_like' => '',
|
31
|
-
'waterfront' => '',
|
32
|
-
'ftr_lotdesc_like' => '',
|
33
|
-
'mls_acct' => '',
|
34
|
-
'subdivision' => '',
|
35
|
-
'foreclosure_yn' => '',
|
36
|
-
'address_like' => '',
|
37
|
-
'street_name_like' => '',
|
38
|
-
'street_num_like' => '',
|
39
|
-
'date_created_gte' => '',
|
40
|
-
'date_created_lte' => '',
|
41
|
-
'date_modified_gte' => '',
|
42
|
-
'date_modified_lte' => '',
|
43
|
-
'status' => 'Active'
|
44
|
-
},{
|
45
|
-
'model' => 'CabooseRets::MultiFamilyProperty',
|
46
|
-
'sort' => CabooseRets::default_property_sort,
|
47
|
-
'desc' => false,
|
48
|
-
'skip' => ['status'],
|
49
|
-
'abbreviations' => {
|
50
|
-
'address_like' => 'street_num_concat_street_name_like'
|
51
|
-
},
|
52
|
-
'base_url' => '/multi-family/search',
|
53
|
-
'items_per_page' => 10
|
54
|
-
})
|
55
|
-
@properties = @gen.items
|
56
|
-
end
|
57
|
-
|
58
|
-
# GET /multi_family/:mls_acct/details
|
59
|
-
def details
|
60
|
-
@property = MultiFamilyProperty.where(:mls_acct => params[:mls_acct]).first
|
61
|
-
@saved = logged_in? && SavedProperty.where(:user_id => logged_in_user.id, :mls_acct => params[:mls_acct]).exists?
|
62
|
-
if @property.nil?
|
63
|
-
@mls_acct = params[:mls_acct]
|
64
|
-
CabooseRets::RetsImporter.delay(:queue => 'rets').import_property(@mls_acct.to_i)
|
65
|
-
render 'multi_family/not_exists'
|
66
|
-
return
|
67
|
-
end
|
68
|
-
end
|
69
|
-
|
70
|
-
#=============================================================================
|
71
|
-
# Admin actions
|
72
|
-
#=============================================================================
|
73
|
-
|
74
|
-
# GET /admin/multi_family
|
75
|
-
def admin_index
|
76
|
-
return if !user_is_allowed('properties', 'view')
|
77
|
-
|
78
|
-
@gen = Caboose::PageBarGenerator.new(params, {
|
79
|
-
'mls_acct' => ''
|
80
|
-
},{
|
81
|
-
'model' => 'CabooseRets::MultiFamilyProperty',
|
82
|
-
'sort' => 'mls_acct',
|
83
|
-
'desc' => false,
|
84
|
-
'base_url' => '/admin/multi_family',
|
85
|
-
'use_url_params' => false
|
86
|
-
})
|
87
|
-
@properties = @gen.items
|
88
|
-
render :layout => 'caboose/admin'
|
89
|
-
end
|
90
|
-
|
91
|
-
# GET /admin/multi_family/:mls_acct/edit
|
92
|
-
def admin_edit
|
93
|
-
return if !user_is_allowed('properties', 'edit')
|
94
|
-
@property = MultiFamilyProperty.where(:mls_acct => params[:mls_acct]).first
|
95
|
-
render :layout => 'caboose/admin'
|
96
|
-
end
|
97
|
-
|
98
|
-
# GET /admin/multi_family/:mls_acct/refresh
|
99
|
-
def admin_refresh
|
100
|
-
p = MultiFamilyProperty.find(params[:mls_acct])
|
101
|
-
RetsImporter.import("(MLS_ACCT=#{p.mls_acct})", 'Property', 'LND')
|
102
|
-
RetsImporter.download_property_images(p)
|
103
|
-
render :json => Caboose::StdClass.new({ 'success' => "The property's info has been updated from MLS." })
|
104
|
-
end
|
105
|
-
|
106
|
-
end
|
107
|
-
end
|
@@ -1,163 +0,0 @@
|
|
1
|
-
|
2
|
-
module CabooseRets
|
3
|
-
class ResidentialController < ApplicationController
|
4
|
-
|
5
|
-
# GET /residential/search-options?q=rock quary
|
6
|
-
def search_options
|
7
|
-
count = params[:count_per_name] ? params[:count_per_name] : 10
|
8
|
-
arr = SearchOption.results(params[:q], count)
|
9
|
-
render :json => arr
|
10
|
-
end
|
11
|
-
|
12
|
-
# GET /residential
|
13
|
-
def index
|
14
|
-
params[:street_num_like] = params[:street_name_like].tr('A-z', '').tr(' ', '') unless params[:street_name_like].nil?
|
15
|
-
unless params[:street_name_like].nil?
|
16
|
-
params[:street_name_like] = params[:street_name_like].tr('0-9', "")
|
17
|
-
until params[:street_name_like][0] != " " || params[:street_name_like] == ''
|
18
|
-
params[:street_name_like][0] = '' if params[:street_name_like][0].to_i == 0
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
@pager = Caboose::PageBarGenerator.new(params, {
|
23
|
-
'area' => '',
|
24
|
-
'area_like' => '',
|
25
|
-
'name' => '',
|
26
|
-
'acreage_gte' => '',
|
27
|
-
'acreage_lte' => '',
|
28
|
-
'city' => '',
|
29
|
-
'city_like' => '',
|
30
|
-
'county' => '',
|
31
|
-
'county_like' => '',
|
32
|
-
'current_price_gte' => '',
|
33
|
-
'current_price_lte' => '',
|
34
|
-
'bedrooms_gte' => '',
|
35
|
-
'bedrooms_lte' => '',
|
36
|
-
'prop_type' => '',
|
37
|
-
'tot_heat_sqft_gte' => '',
|
38
|
-
'tot_heat_sqft_lte' => '',
|
39
|
-
'neighborhood' => '',
|
40
|
-
'elem_school' => '',
|
41
|
-
'middle_school' => '',
|
42
|
-
'high_school' => '',
|
43
|
-
'la_code' => '',
|
44
|
-
'lo_code' => '',
|
45
|
-
'remarks_like' => '',
|
46
|
-
'waterfront' => '',
|
47
|
-
'waterfront_not_null' => '',
|
48
|
-
'ftr_lotdesc_like' => '',
|
49
|
-
'mls_acct' => '',
|
50
|
-
'subdivision' => '',
|
51
|
-
'style' => '',
|
52
|
-
'foreclosure_yn' => '',
|
53
|
-
'address_like' => '',
|
54
|
-
'street_name_like' => '',
|
55
|
-
'street_num_like' => '',
|
56
|
-
'zip' => '',
|
57
|
-
'zip_like' => '',
|
58
|
-
'date_created_gte' => '',
|
59
|
-
'date_created_lte' => '',
|
60
|
-
'date_modified_gte' => '',
|
61
|
-
'date_modified_lte' => '',
|
62
|
-
'status' => 'Active'
|
63
|
-
},{
|
64
|
-
'model' => 'CabooseRets::ResidentialProperty',
|
65
|
-
'sort' => CabooseRets::default_property_sort,
|
66
|
-
'desc' => false,
|
67
|
-
'abbreviations' => {
|
68
|
-
'address_like' => 'street_num_concat_street_name_like'
|
69
|
-
},
|
70
|
-
'skip' => ['status'],
|
71
|
-
'base_url' => '/residential/search',
|
72
|
-
'items_per_page' => 10
|
73
|
-
})
|
74
|
-
|
75
|
-
@properties = @pager.items
|
76
|
-
if params[:waterfront].present? then @properties.reject!{|p| p.waterfront.blank?} end
|
77
|
-
if params[:ftr_lotdesc] == 'golf' then @properties.reject!{|p| p.ftr_lotdesc != 'golf'} end
|
78
|
-
#if params[:foreclosure] then @properties.reject!{|p| p.foreclosure_yn != "Y"} end
|
79
|
-
|
80
|
-
@saved_search = nil
|
81
|
-
if CabooseRets::SavedSearch.exists?(:uri => request.fullpath)
|
82
|
-
@saved_search = CabooseRets::SavedSearch.where(:uri => request.fullpath).first
|
83
|
-
end
|
84
|
-
|
85
|
-
@block_options = {
|
86
|
-
:properties => @properties,
|
87
|
-
:saved_search => @saved_search,
|
88
|
-
:pager => @pager
|
89
|
-
}
|
90
|
-
end
|
91
|
-
|
92
|
-
# GET /residential/:mls_acct/details
|
93
|
-
def details
|
94
|
-
@property = ResidentialProperty.where(:mls_acct => params[:mls_acct]).first
|
95
|
-
@saved = logged_in? && SavedProperty.where(:user_id => logged_in_user.id, :mls_acct => params[:mls_acct]).exists?
|
96
|
-
if @property && @property.lo_code == '46'
|
97
|
-
@agent = Agent.where(:la_code => @property.la_code).first
|
98
|
-
end
|
99
|
-
if @property.nil?
|
100
|
-
@mls_acct = params[:mls_acct]
|
101
|
-
CabooseRets::RetsImporter.delay(:queue => 'rets').import_property(@mls_acct.to_i)
|
102
|
-
render 'residential/residential_not_exists'
|
103
|
-
return
|
104
|
-
end
|
105
|
-
|
106
|
-
@block_options = {
|
107
|
-
:mls_acct => params[:mls_acct],
|
108
|
-
:property => @property,
|
109
|
-
:saved => @saved,
|
110
|
-
:agent => @property ? Agent.where(:la_code => @property.la_code).first : nil,
|
111
|
-
:form_authenticity_token => form_authenticity_token
|
112
|
-
}
|
113
|
-
|
114
|
-
#if @property.nil?
|
115
|
-
# @mls_acct = params[:mls_acct]
|
116
|
-
# CabooseRets::RetsImporter.delay(:queue => 'rets').import_property(@mls_acct.to_i)
|
117
|
-
# render 'residential/residential_not_exists'
|
118
|
-
# return
|
119
|
-
#end
|
120
|
-
end
|
121
|
-
|
122
|
-
#=============================================================================
|
123
|
-
# Admin actions
|
124
|
-
#=============================================================================
|
125
|
-
|
126
|
-
# GET /admin/residential
|
127
|
-
def admin_index
|
128
|
-
return if !user_is_allowed('properties', 'view')
|
129
|
-
|
130
|
-
@gen = Caboose::PageBarGenerator.new(params, {
|
131
|
-
'mls_acct' => ''
|
132
|
-
},{
|
133
|
-
'model' => 'CabooseRets::ResidentialProperty',
|
134
|
-
'sort' => 'mls_acct',
|
135
|
-
'desc' => false,
|
136
|
-
'base_url' => '/admin/residential',
|
137
|
-
'use_url_params' => false
|
138
|
-
})
|
139
|
-
@properties = @gen.items
|
140
|
-
render :layout => 'caboose/admin'
|
141
|
-
end
|
142
|
-
|
143
|
-
# GET /admin/residential/:mls_acct/edit
|
144
|
-
def admin_edit
|
145
|
-
return if !user_is_allowed('properties', 'edit')
|
146
|
-
@property = ResidentialProperty.where(:mls_acct => params[:mls_acct]).first
|
147
|
-
render :layout => 'caboose/admin'
|
148
|
-
end
|
149
|
-
|
150
|
-
# GET /admin/residential/:mls_acct/refresh
|
151
|
-
def admin_refresh
|
152
|
-
return if !user_is_allowed('properties', 'edit')
|
153
|
-
|
154
|
-
p = ResidentialProperty.find(params[:mls_acct])
|
155
|
-
p.delay(:queue => 'rets').refresh_from_mls
|
156
|
-
|
157
|
-
resp = Caboose::StdClass.new
|
158
|
-
resp.success = "The property's info is being updated from MLS. This may take a few minutes depending on how many images it has."
|
159
|
-
render :json => resp
|
160
|
-
end
|
161
|
-
|
162
|
-
end
|
163
|
-
end
|
@@ -1,214 +0,0 @@
|
|
1
|
-
|
2
|
-
class CabooseRets::CommercialProperty < ActiveRecord::Base
|
3
|
-
self.table_name = "rets_commercial"
|
4
|
-
attr_accessible :id, :mls_acct
|
5
|
-
|
6
|
-
def url() return "/commercial/#{self.id}" end
|
7
|
-
def agent() return CabooseRets::Agent.where(:la_code => self.la_code).first end
|
8
|
-
def office() return CabooseRets::Office.where(:lo_code => self.lo_code).first end
|
9
|
-
def images() return CabooseRets::Media.where(:mls_acct => self.mls_acct, :media_type => 'Photo').reorder(:media_order).all end
|
10
|
-
def files() return CabooseRets::Media.where(:mls_acct => self.mls_acct, :media_type => 'File' ).reorder(:media_order).all end
|
11
|
-
def virtual_tour
|
12
|
-
return nil if !CabooseRets::Media.where(:mls_acct => self.mls_acct.to_s).where(:media_type => 'Virtual Tour').exists?
|
13
|
-
media = CabooseRets::Media.where(:mls_acct => self.mls_acct.to_s, :media_type => 'Virtual Tour').first
|
14
|
-
return media.url
|
15
|
-
end
|
16
|
-
def self.geolocatable() all(conditions: "latitude IS NOT NULL AND longitude IS NOT NULL") end
|
17
|
-
|
18
|
-
def refresh_from_mls
|
19
|
-
CabooseRets::RetsImporter.import_commercial_property(self.mls_acct)
|
20
|
-
end
|
21
|
-
|
22
|
-
def parse(data)
|
23
|
-
self.acreage = data['ACREAGE']
|
24
|
-
self.adjoining_land_use = data['ADJOINING_LAND_USE']
|
25
|
-
self.agent_notes = data['AGENT_NOTES']
|
26
|
-
self.agent_other_contact_desc = data['AGENT_OTHER_CONTACT_DESC']
|
27
|
-
self.agent_other_contact_phone = data['AGENT_OTHER_CONTACT_PHONE']
|
28
|
-
self.annual_taxes = data['ANNUAL_TAXES']
|
29
|
-
self.approx_age = data['APPROX_AGE']
|
30
|
-
self.area = data['AREA']
|
31
|
-
self.baths = data['BATHS']
|
32
|
-
self.baths_full = data['BATHS_FULL']
|
33
|
-
self.baths_half = data['BATHS_HALF']
|
34
|
-
self.bedrooms = data['BEDROOMS']
|
35
|
-
self.bom_date = data['BOM_DATE']
|
36
|
-
self.book_number = data['BOOK_NUMBER']
|
37
|
-
self.book_page = data['BOOK_PAGE']
|
38
|
-
self.book_type = data['BOOK_TYPE']
|
39
|
-
self.box_on_unit = data['BOX_ON_UNIT']
|
40
|
-
self.box_on_unit_yn = data['BOX_ON_UNIT_YN']
|
41
|
-
self.business_included_yn = data['BUSINESS_INCLUDED_YN']
|
42
|
-
self.buyer_broker = data['BUYER_BROKER']
|
43
|
-
self.buyer_broker_type = data['BUYER_BROKER_TYPE']
|
44
|
-
self.buyer_city = data['BUYER_CITY']
|
45
|
-
self.buyer_name = data['BUYER_NAME']
|
46
|
-
self.buyer_state = data['BUYER_STATE']
|
47
|
-
self.buyer_zip = data['BUYER_ZIP']
|
48
|
-
self.category = data['CATEGORY']
|
49
|
-
self.city = data['CITY']
|
50
|
-
self.city_code = data['CITY_CODE']
|
51
|
-
self.co_la_code = data['CO_LA_CODE']
|
52
|
-
self.co_lo_code = data['CO_LO_CODE']
|
53
|
-
self.co_sa_code = data['CO_SA_CODE']
|
54
|
-
self.co_so_code = data['CO_SO_CODE']
|
55
|
-
self.contacts = data['CONTACTS']
|
56
|
-
self.contr_broker = data['CONTR_BROKER']
|
57
|
-
self.contr_broker_type = data['CONTR_BROKER_TYPE']
|
58
|
-
self.county = data['COUNTY']
|
59
|
-
self.current_price = data['CURRENT_PRICE']
|
60
|
-
self.date_created = data['DATE_CREATED']
|
61
|
-
self.date_leased = data['DATE_LEASED']
|
62
|
-
self.date_modified = data['DATE_MODIFIED']
|
63
|
-
self.df_yn = data['DF_YN']
|
64
|
-
self.directions = data['DIRECTIONS']
|
65
|
-
self.display_address_yn = data['DISPLAY_ADDRESS_YN']
|
66
|
-
self.dom = data['DOM']
|
67
|
-
self.elem_school = data['ELEM_SCHOOL']
|
68
|
-
self.expenses_assoc = data['EXPENSES_ASSOC']
|
69
|
-
self.expenses_ins = data['EXPENSES_INS']
|
70
|
-
self.expenses_maint = data['EXPENSES_MAINT']
|
71
|
-
self.expenses_mgmt = data['EXPENSES_MGMT']
|
72
|
-
self.expenses_other = data['EXPENSES_OTHER']
|
73
|
-
self.expenses_tax = data['EXPENSES_TAX']
|
74
|
-
self.expenses_utility = data['EXPENSES_UTILITY']
|
75
|
-
self.expire_date = data['EXPIRE_DATE']
|
76
|
-
self.flood_plain = data['FLOOD_PLAIN']
|
77
|
-
self.ftr_building = data['FTR_BUILDING']
|
78
|
-
self.ftr_building_type = data['FTR_BUILDING_TYPE']
|
79
|
-
self.ftr_closing = data['FTR_CLOSING']
|
80
|
-
self.ftr_cooling = data['FTR_COOLING']
|
81
|
-
self.ftr_docs_on_file = data['FTR_DOCS_ON_FILE']
|
82
|
-
self.ftr_exterior = data['FTR_EXTERIOR']
|
83
|
-
self.ftr_financing = data['FTR_FINANCING']
|
84
|
-
self.ftr_flooring = data['FTR_FLOORING']
|
85
|
-
self.ftr_heating = data['FTR_HEATING']
|
86
|
-
self.ftr_interior = data['FTR_INTERIOR']
|
87
|
-
self.ftr_internet = data['FTR_INTERNET']
|
88
|
-
self.ftr_lease_terms = data['FTR_LEASE_TERMS']
|
89
|
-
self.ftr_property_desc = data['FTR_PROPERTY_DESC']
|
90
|
-
self.ftr_roof = data['FTR_ROOF']
|
91
|
-
self.ftr_sale_terms = data['FTR_SALE_TERMS']
|
92
|
-
self.ftr_sewer = data['FTR_SEWER']
|
93
|
-
self.ftr_showing = data['FTR_SHOWING']
|
94
|
-
self.ftr_sprinkler = data['FTR_SPRINKLER']
|
95
|
-
self.ftr_style = data['FTR_STYLE']
|
96
|
-
self.ftr_utilities = data['FTR_UTILITIES']
|
97
|
-
self.ftr_utilities_rental = data['FTR_UTILITIES_RENTAL']
|
98
|
-
self.ftr_water = data['FTR_WATER']
|
99
|
-
self.geo_precision = data['GEO_PRECISION']
|
100
|
-
self.georesult = data['GEORESULT']
|
101
|
-
self.high_school = data['HIGH_SCHOOL']
|
102
|
-
self.hoa_fee = data['HOA_FEE']
|
103
|
-
self.hoa_fee_yn = data['HOA_FEE_YN']
|
104
|
-
self.hoa_term = data['HOA_TERM']
|
105
|
-
self.income_gross = data['INCOME_GROSS']
|
106
|
-
self.income_net = data['INCOME_NET']
|
107
|
-
self.income_other = data['INCOME_OTHER']
|
108
|
-
self.income_rental = data['INCOME_RENTAL']
|
109
|
-
self.internet_yn = data['INTERNET_YN']
|
110
|
-
self.la_code = data['LA_CODE']
|
111
|
-
self.leased_through = data['LEASED_THROUGH']
|
112
|
-
self.legal_block = data['LEGAL_BLOCK']
|
113
|
-
self.legal_lot = data['LEGAL_LOT']
|
114
|
-
self.legals = data['LEGALS']
|
115
|
-
self.list_date = data['LIST_DATE']
|
116
|
-
self.list_price = data['LIST_PRICE']
|
117
|
-
self.listing_type = data['LISTING_TYPE']
|
118
|
-
self.lo_code = data['LO_CODE']
|
119
|
-
self.lockbox_yn = data['LOCKBOX_YN']
|
120
|
-
self.lot_dimensions = data['LOT_DIMENSIONS']
|
121
|
-
self.lot_dimensions_source = data['LOT_DIMENSIONS_SOURCE']
|
122
|
-
self.media_flag = data['MEDIA_FLAG']
|
123
|
-
self.middle_school = data['MIDDLE_SCHOOL']
|
124
|
-
self.mls_acct = data['MLS_ACCT']
|
125
|
-
self.municipality = data['MUNICIPALITY']
|
126
|
-
self.num_units = data['NUM_UNITS']
|
127
|
-
self.num_units_occupied = data['NUM_UNITS_OCCUPIED']
|
128
|
-
self.off_mkt_date = data['OFF_MKT_DATE']
|
129
|
-
self.off_mkt_days = data['OFF_MKT_DAYS']
|
130
|
-
self.office_notes = data['OFFICE_NOTES']
|
131
|
-
self.orig_lp = data['ORIG_LP']
|
132
|
-
self.other_fee = data['OTHER_FEE']
|
133
|
-
self.other_fee_type = data['OTHER_FEE_TYPE']
|
134
|
-
self.owner_name = data['OWNER_NAME']
|
135
|
-
self.owner_phone = data['OWNER_PHONE']
|
136
|
-
self.parcel_id = data['PARCEL_ID']
|
137
|
-
self.pending_date = data['PENDING_DATE']
|
138
|
-
self.photo_count = data['PHOTO_COUNT']
|
139
|
-
self.photo_date_modified = data['PHOTO_DATE_MODIFIED']
|
140
|
-
self.photo_description = data['PHOTO_DESCRIPTION']
|
141
|
-
self.photo_instr = data['PHOTO_INSTR']
|
142
|
-
self.posession = data['POSESSION']
|
143
|
-
self.price_change_date = data['PRICE_CHANGE_DATE']
|
144
|
-
self.price_sqft = data['PRICE_SQFT']
|
145
|
-
self.proj_close_date = data['PROJ_CLOSE_DATE']
|
146
|
-
self.prop_desc = data['PROP_DESC']
|
147
|
-
self.prop_id = data['PROP_ID']
|
148
|
-
self.prop_type = data['PROP_TYPE']
|
149
|
-
self.remarks = data['REMARKS']
|
150
|
-
self.road_frontage_ft = data['ROAD_FRONTAGE_FT']
|
151
|
-
self.sa_code = data['SA_CODE']
|
152
|
-
self.sale_lease = data['SALE_LEASE']
|
153
|
-
self.sale_notes = data['SALE_NOTES']
|
154
|
-
self.so_code = data['SO_CODE']
|
155
|
-
self.sold_date = data['SOLD_DATE']
|
156
|
-
self.sold_price = data['SOLD_PRICE']
|
157
|
-
self.sold_terms = data['SOLD_TERMS']
|
158
|
-
self.sqft_source = data['SQFT_SOURCE']
|
159
|
-
self.state = data['STATE']
|
160
|
-
self.status = data['STATUS']
|
161
|
-
self.status_date = data['STATUS_DATE']
|
162
|
-
self.status_flag = data['STATUS_FLAG']
|
163
|
-
self.street = data['STREET']
|
164
|
-
self.street_dir = data['STREET_DIR']
|
165
|
-
self.street_name = data['STREET_NAME']
|
166
|
-
self.street_num = data['STREET_NUM']
|
167
|
-
self.sub_agent = data['SUB_AGENT']
|
168
|
-
self.sub_agent_type = data['SUB_AGENT_TYPE']
|
169
|
-
self.sub_area = data['SUB_AREA']
|
170
|
-
self.subdivision = data['SUBDIVISION']
|
171
|
-
self.take_photo_yn = data['TAKE_PHOTO_YN']
|
172
|
-
self.third_party_comm_yn = data['THIRD_PARTY_COMM_YN']
|
173
|
-
self.tot_heat_sqft = data['TOT_HEAT_SQFT']
|
174
|
-
self.tour_date = data['TOUR_DATE']
|
175
|
-
self.tour_submit_date = data['TOUR_SUBMIT_DATE']
|
176
|
-
self.type_detailed = data['TYPE_DETAILED']
|
177
|
-
self.u1_dims = data['U1_DIMS']
|
178
|
-
self.u1_free_standing_yn = data['U1_FREE_STANDING_YN']
|
179
|
-
self.u1_sqft_manuf = data['U1_SQFT_MANUF']
|
180
|
-
self.u1_sqft_office = data['U1_SQFT_OFFICE']
|
181
|
-
self.u1_sqft_retail = data['U1_SQFT_RETAIL']
|
182
|
-
self.u1_sqft_total = data['U1_SQFT_TOTAL']
|
183
|
-
self.u1_sqft_warehouse = data['U1_SQFT_WAREHOUSE']
|
184
|
-
self.u1_year_built = data['U1_YEAR_BUILT']
|
185
|
-
self.u2_dims = data['U2_DIMS']
|
186
|
-
self.u2_free_standing_yn = data['U2_FREE_STANDING_YN']
|
187
|
-
self.u2_sqft_manuf = data['U2_SQFT_MANUF']
|
188
|
-
self.u2_sqft_office = data['U2_SQFT_OFFICE']
|
189
|
-
self.u2_sqft_retail = data['U2_SQFT_RETAIL']
|
190
|
-
self.u2_sqft_total = data['U2_SQFT_TOTAL']
|
191
|
-
self.u2_sqft_warehouse = data['U2_SQFT_WAREHOUSE']
|
192
|
-
self.u2_year_built = data['U2_YEAR_BUILT']
|
193
|
-
self.u3_dims = data['U3_DIMS']
|
194
|
-
self.u3_free_standing_yn = data['U3_FREE_STANDING_YN']
|
195
|
-
self.u3_sqft_manuf = data['U3_SQFT_MANUF']
|
196
|
-
self.u3_sqft_office = data['U3_SQFT_OFFICE']
|
197
|
-
self.u3_sqft_retail = data['U3_SQFT_RETAIL']
|
198
|
-
self.u3_sqft_total = data['U3_SQFT_TOTAL']
|
199
|
-
self.u3_sqft_warehouse = data['U3_SQFT_WAREHOUSE']
|
200
|
-
self.u3_year_built = data['U3_YEAR_BUILT']
|
201
|
-
self.unit_num = data['UNIT_NUM']
|
202
|
-
self.upload_source = data['UPLOAD_SOURCE']
|
203
|
-
self.vacancy_rate = data['VACANCY_RATE']
|
204
|
-
self.vacant_yn = data['VACANT_YN']
|
205
|
-
self.valuation_yn = data['VALUATION_YN']
|
206
|
-
self.vt_yn = data['VT_YN']
|
207
|
-
self.waterfront_yn = data['WATERFRONT_YN']
|
208
|
-
self.withdrawn_date = data['WITHDRAWN_DATE']
|
209
|
-
self.year_built = data['YEAR_BUILT']
|
210
|
-
self.zip = data['ZIP']
|
211
|
-
self.zoning_northport = data['ZONING_NORTHPORT']
|
212
|
-
self.zoning_tusc = data['ZONING_TUSC']
|
213
|
-
end
|
214
|
-
end
|