caboose-rets 0.1.189 → 0.1.192

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 315ade1ef137b27cad9c1b1c0860a7da8e6dd3feab9a965467d56d4078cbe6d9
4
- data.tar.gz: 9476364e035d5a7fc6e8a80faebfe36b2b3c3d3a75aaa7855601ebd7cc484a55
3
+ metadata.gz: bc2ec5dc5eb53231ac2e68313a01f68253d8912893a0aa8c29c4e2885001113b
4
+ data.tar.gz: 9b5a14bcd98c6518f036dde59d159f364e51966077a80e7697471dddea77b112
5
5
  SHA512:
6
- metadata.gz: cdbfdb54071aa93f7781431852a6e86e3db7943d8ab411ba7261ff74f07a8562f6d1888ef1e02d3b2b8eca0c69179291a698f34a1f2cb4817d3ef1b2029dc319
7
- data.tar.gz: 30ca35eb2cb85865c433c0074cd7df8da9b07c5f794acc16900019c22b477c8b8a8d73e6b5cadfefa2a64b5d7318269c6740e954b50801ee0a331b0dace64f80
6
+ metadata.gz: b81c17cea7ebd2d5be1049327fd9495d3c19712df9cf92c6a44f8d8a5c4e6f11aeec34715d7dd5e34bd14d550b0ee7daa5e796d934fc20170a09fe5b7e646bce
7
+ data.tar.gz: 6831b3e5c8bc6599ac89b6591b175fd650935b7524ccd32874d9e60c175bade2b433f5130cd61bcf58c350935f32481b914382e579d633153ffeec03c8ac80df
@@ -454,7 +454,7 @@ class CabooseRets::RetsImporter # < ActiveRecord::Base
454
454
  ids_to_remove = local_ids - ids
455
455
  self.log3(class_type,nil,"Found #{ids_to_remove.count} #{class_type} records in the local database that are not in the remote database.")
456
456
 
457
- # Delete all RetsMedia and CabooseMedia for the deleted property listings (except keep the first image)
457
+ # Delete all RetsMedia and CabooseMedia for the deleted property listings (except keep the first image)
458
458
  if class_type == 'Property' && ids_to_remove && ids_to_remove.count > 0
459
459
  self.log3(class_type,nil,"Deleting Media objects that shouldn't be there...")
460
460
  muis = CabooseRets::Property.where("#{k} in (?)", ids_to_remove).pluck(:matrix_unique_id)
@@ -472,6 +472,10 @@ class CabooseRets::RetsImporter # < ActiveRecord::Base
472
472
  self.log3(class_type,nil,"Deleting #{class_type} records in the local database that shouldn't be there...")
473
473
  query = ["delete from #{t} where #{k} in (?)", ids_to_remove]
474
474
  ActiveRecord::Base.connection.execute(ActiveRecord::Base.send(:sanitize_sql_array, query))
475
+ else # mark deleted properties as Deleted status
476
+ self.log3(class_type,nil,"Setting deleted properties as Deleted status...")
477
+ query = ["update #{t} set status = ? where #{k} in (?)", "Deleted", ids_to_remove]
478
+ ActiveRecord::Base.connection.execute(ActiveRecord::Base.send(:sanitize_sql_array, query))
475
479
  end
476
480
 
477
481
  # Find any ids in the remote database that should be in the local database
@@ -1,6 +1,6 @@
1
1
  class CabooseRets::RetsPlugin < Caboose::CaboosePlugin
2
2
 
3
- def self.admin_nav(nav, user = nil, page = nil, site)
3
+ def self.admin_nav(nav, user = nil, page = nil, site, is_superadmin)
4
4
  return nav if user.nil?
5
5
  return nav if !site.use_rets
6
6
  return nav if !user.is_allowed('rets_properties', 'view')
@@ -11,10 +11,10 @@ class CabooseRets::RetsPlugin < Caboose::CaboosePlugin
11
11
  'children' => [],
12
12
  'modal' => true
13
13
  }
14
- item['children'] << { 'id' => 'agents', 'icon' => 'users', 'href' => '/admin/agents' , 'text' => 'Agents' , 'modal' => false } if user.is_allowed('rets_agents','view')
14
+ item['children'] << { 'id' => 'agents', 'icon' => 'users', 'href' => '/admin/agents' , 'text' => 'Agents' , 'modal' => false } if user.is_allowed('rets_agents','view', is_superadmin)
15
15
  # item['children'] << { 'id' => 'offices' , 'href' => '/admin/offices' , 'text' => 'Offices' , 'modal' => false }
16
- item['children'] << { 'id' => 'open-houses', 'icon' => 'calendars', 'href' => '/admin/open-houses' , 'text' => 'Open Houses' , 'modal' => false } if user.is_allowed('rets_open_houses','view')
17
- item['children'] << { 'id' => 'properties' , 'icon' => 'rets', 'href' => '/admin/properties' , 'text' => 'Properties' , 'modal' => false } if user.is_allowed('rets_properties','view')
16
+ item['children'] << { 'id' => 'open-houses', 'icon' => 'calendars', 'href' => '/admin/open-houses' , 'text' => 'Open Houses' , 'modal' => false } if user.is_allowed('rets_open_houses','view',is_superadmin)
17
+ item['children'] << { 'id' => 'properties' , 'icon' => 'rets', 'href' => '/admin/properties' , 'text' => 'Properties' , 'modal' => false } if user.is_allowed('rets_properties','view',is_superadmin)
18
18
  # item['children'] << { 'id' => 'commercial' , 'href' => '/admin/commercial' , 'text' => 'Commercial Property' , 'modal' => false }
19
19
  # item['children'] << { 'id' => 'commercial' , 'href' => '/admin/multi-family' , 'text' => 'Multi-Family Property' , 'modal' => false }
20
20
  # item['children'] << { 'id' => 'land' , 'href' => '/admin/land' , 'text' => 'Land Property' , 'modal' => false }
@@ -1,3 +1,3 @@
1
1
  module CabooseRets
2
- VERSION = '0.1.189'
2
+ VERSION = '0.1.192'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: caboose-rets
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.189
4
+ version: 0.1.192
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Barry
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-08-17 00:00:00.000000000 Z
11
+ date: 2022-03-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: caboose-cms