<%-# Fedena #Copyright 2010 Foradian Technologies Private Limited # #This product includes software developed at #Project Fedena - http://www.projectfedena.org/ # #Licensed under the Apache License, Version 2.0 (the "License"); #you may not use this file except in compliance with the License. #You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # #Unless required by applicable law or agreed to in writing, #software distributed under the License is distributed on an #"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY #KIND, either express or implied. See the License for the #specific language governing permissions and limitations #under the License. -%>
<% @class_timing.each do |ct| %> <% end %> <% @weekday.each do |wk| %> <% @class_timing.each do |ct| %> <% @tte = @timetable[wk.id][ct.id] %> <% end %> <% end %>
<%= ct.start_time.strftime("%I:%M%p") unless ct.start_time.nil? %> - <%= ct.end_time.strftime("%I:%M%p") unless ct.end_time.nil? %>
<%= t(Date::DAYNAMES[wk.day_of_week].downcase).upcase %>
" class="drop"onClick="update_selected_divs('<%= "#{wk.id}_#{ct.id}" %>');">
<% if @tte.is_a? TimetableEntry %>
<% unless @tte.subject.nil? %> <% unless @tte.subject.elective_group_id.nil? %> <%= shorten_string(@tte.subject.elective_group.name.to_s,10) %> <% else %> <%= @tte.subject.code %> <% end %> <% unless @tte.subject.elective_group_id.nil? %> <% @subj_in_elective = Subject.find_all_by_elective_group_id(@tte.subject.elective_group_id,:conditions=>'is_deleted = false') %> <% @subj_in_elective.each do |s| %> <%= s.name unless s.nil? %> <% @sub_emp = EmployeesSubject.find_by_subject_id(s.id) %>
<%= @sub_emp.employee.full_name unless @sub_emp.nil? %>
<% end %> <% else %> <%= @tte.subject.name unless @tte.subject.nil? %>
<%= @tte.employee.full_name unless @tte.employee.nil? %>
<% end %>
<% end %>
<%= link_to_remote image_tag("/images/buttons/delete-new.png", :border => 0), :url => {:action => "delete_employee2", :id => @tte.id}, :complete => "clear_selected_divs();", :confirm=>t("remove_entry_confirm"), :before => "Element.show('loader')", :success => "Element.hide('loader')", :update => "timetable" \ unless @tte.subject.nil? -%> <% unless @tte.subject.nil? %> <% unless @tte.subject.elective_group_id.nil? %> <%= t('elective') %> <% else %> <%= @tte.employee.first_name unless @tte.employee.nil? %> <% end %> <% end %>
<% else %>
<% end %>
<%= drop_receiving_element("drop_#{wk.id}_#{ct.id}", :accept => "employees_subject", :onDrop => "function(draggable_element, droppable_element) { $(droppable_element).highlight(); make_ajax_calls('#{wk.id}_#{ct.id}', draggable_element.id.split('_').last()); }") -%>

<%= t('add_subjects') %>/<%= t('employee_text') %>

<% @ele_subjects.each do |s| %> <% s.name = s.elective_group.name %> <% end %> <% @subjects= @subjects + @ele_subjects %> <%= select :timetable_entries, :subject_id, @subjects.map { |s| [s.name, s.id] }, {:prompt => "#{t('select_subject')}"}, {:onChange => "#{remote_function(:url => {:action => "update_employees"}, :with => "'subject_id='+value", :update=>"employee-list", :before => "Element.show('loader')", :success => "Element.hide('loader')")}"} %>
<% unless @validation_problems.nil? %>
<% @validation_problems.each do |tte_id, errors| %> <% co_ordinate=tte_id.split("_") %> <% weekday=co_ordinate[0].to_i %> <% class_timing=co_ordinate[1].to_i %> <% tte = TimetableEntry.find_by_weekday_id_and_class_timing_id_and_batch_id_and_timetable_id(weekday,class_timing,@batch.id,@timetable.id) %> <%# tte_id=tte.id %>
<%= t('warning') %> : <%- errors["messages"].each do |err| -%> <%= err -%> <%- end -%> - On <%= Date::DAYNAMES[Weekday.find(weekday).day_of_week].capitalize %> (<%= ClassTiming.find(class_timing).name -%>) <%= link_to_remote "#{t('continue')}", :url=> {:action=> "tt_entry_update2"}, :with => "'&sub_id=#{errors["info"]["sub_id"]}' + '&tte_id=#{errors["info"]["tte_id"]}' + '&emp_id=#{errors["info"]["emp_id"]}' + '&timetable_id=#{@tt.id}' + '&batch_id=#{@batch.id}'", :before => "Element.show('loader')", :success => "Element.hide('loader')" -%> | <%= link_to_remote "#{t('cancel')}", :url=>{:action=>"tt_entry_noupdate2"}, :before => "Element.show('loader')", :success => "Element.hide('loader')", :with => "'emp_id=#{errors["info"]["emp_id"]}' + '&sub_id=#{errors["info"]["sub_id"]}' + '&tte_id=#{errors["info"]["tte_id"]}'+ '&timetable_id=#{@tt.id}'", :update=> "error_div_#{tte_id}" -%>
<%- end -%>
<%- end -%>