Fix bug.
This commit is contained in:
parent
420ce3b065
commit
f2ad2647a5
|
@ -34,7 +34,7 @@ class PropertyHiresController < ApplicationController
|
|||
|
||||
def index_data(properties, url)
|
||||
ma = ModuleApp.find_by_key("property_hire")
|
||||
is_user_manager = (OrbitHelper.current_user.is_admin? || OrbitHelper.current_user.is_manager?(ma) || OrbitHelper.current_user.is_sub_manager?(ma))
|
||||
is_user_manager = OrbitHelper.current_user && (OrbitHelper.current_user.is_admin? || OrbitHelper.current_user.is_manager?(ma) || OrbitHelper.current_user.is_sub_manager?(ma))
|
||||
data = properties.collect do |property|
|
||||
actions = []
|
||||
url_to_show = "#{url}/#{property.to_param}?method=hire"
|
||||
|
@ -334,7 +334,7 @@ class PropertyHiresController < ApplicationController
|
|||
allow_no_logins_user = PropertyHireSetting.first.allow_no_logins_user
|
||||
all_day_settings = property.all_day_settings.map{|d,settings| [d,settings.map{|s| [s.id.to_s,s.title]}]}.to_h
|
||||
ma = ModuleApp.find_by_key("property_hire")
|
||||
is_user_manager = (OrbitHelper.current_user.is_admin? || OrbitHelper.current_user.is_manager?(ma) || OrbitHelper.current_user.is_sub_manager?(ma))
|
||||
is_user_manager = OrbitHelper.current_user && (OrbitHelper.current_user.is_admin? || OrbitHelper.current_user.is_manager?(ma) || OrbitHelper.current_user.is_sub_manager?(ma))
|
||||
{
|
||||
"hire" => hire,
|
||||
"property" => property,
|
||||
|
|
|
@ -148,9 +148,10 @@ class Property
|
|||
end
|
||||
|
||||
def can_reserve
|
||||
start_time = self.p_hire_start_time || Time.now
|
||||
end_time = self.p_hire_end_time || Time.now
|
||||
return Time.now >= start_time && end_time >= Time.now
|
||||
now = Time.now
|
||||
start_time = self.p_hire_start_time || now
|
||||
end_time = self.p_hire_end_time || now
|
||||
return now >= start_time && end_time >= now
|
||||
end
|
||||
|
||||
def p_hire_fields_enabled
|
||||
|
|
Loading…
Reference in New Issue