% OrbitHelper.render_css_in_head(["basic/bootstrap-datetimepicker.css","property_hire_fullcalendar.css","property_hire_calendar"]) %>
<%= javascript_include_tag "validator.js" %>
<%
data = action_data
hire = data["hire"]
property = data["property"]
url = data["page"]
current_user = data["current_user"]
allow_no_logins_user = data["allow_no_logins_user"]
all_day_settings = data["all_day_settings"]
recover = data["recover"]
calendar_type = property.calendar_type.to_i rescue 0
right_col = 12
label_col = 2
input_col = 10
if calendar_type == 0
right_col -= 7
label_col += 2
input_col -= 2
end
%>
<% if !property.can_be_hired %>
<% end %>
<% if !allow_no_logins_user && current_user.nil? %>
<% else %>
<%= form_for hire, :url => "/xhr/property_hires/make_booking", html: { class: "form-horizontal" } do |f| %>
<% if property.set_availability %>
<% else %>
<% end %>
<% if(property.enable_notes_selector rescue false) %>
<% property.notes_selector.each do |index,sub_hash| %>
<% name = sub_hash["name"][I18n.locale.to_s] %>
<% name = sub_hash["name"].values.select{|v| v.present?}.first.to_s if name.blank? %>
<% values = sub_hash["value"][I18n.locale.to_s] %>
<% values = sub_hash["value"].values.select{|v| v.present?}.first.to_s if values.blank? %>
<% type = sub_hash["type"] %>
<% end %>
<% else %>
<% end %>
<% fields_name = ["organization" ,"person_in_charge" , "tel_of_person_in_charge" , "department" , "contact_person" , "tel_of_contact_person" , "mobile_phone_of_contact_person" , "contact_person_Email" , "contact_person_department"] %>
<% fields_name.each do |field_name| %>
<% if(property[field_name]["enable"] == "1" rescue false) %>
<% required = (property[field_name]["required"] == "true" rescue false) %>
<% end %>
<% end %>
<% if property.p_hire_fields.count != 0 %>
<% p_hire = PHire.new(:id=>nil) %>
<% @form_index = 0 %>
<% property.p_hire_fields.asc(:_id).each do |rf| %>
<%= rf.block_helper(property,@form_index,false,"p_hire",p_hire, rf.to_require,label_col) %>
<% @form_index = @form_index +1 %>
<% end %>
<% end %>
<% if allow_no_logins_user && current_user.nil? %>
<% end %>
<% end %>