%-# 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. -%>
<% arrow_dir = rtl? ? "◀" : "▶" %>
- <%= link_to t('dashboard_text'), :controller => "user", :action => "dashboard" %>
<% if permitted_to? :index, :student %>
- <%= link_to t('students'), :controller => "student", :action => "index" %>
<% end %>
<% if @current_user.admin? %>
- <%= link_to "#{t('attendance')} ▼", :controller => "student_attendance", :action => "index" %>
- <%= link_to "#{t('attendance_register')}", :controller => 'attendances', :action => 'index' %>
- <%= link_to "#{t('attendance_report')}", :controller => "attendance_reports", :action => "index" %>
<% elsif @current_user.employee? %>
<% @employee= @current_user.employee_record %>
<% @employee_subjects= @employee.subject_ids %>
<% @employee_batches=Batch.find_all_by_employee_id(@employee.id) %>
<% @attendance_type = Configuration.find_by_config_key('StudentAttendanceType') %>
<% if @attendance_type.config_value == 'Daily' %>
<% if permitted_to? :index, :student_attendance or @employee_batches.present? or @current_user.privileges.map{|p| p.name}.include?("StudentAttendanceView") or @current_user.privileges.map{|p| p.name}.include?("StudentAttendanceRegister") %>
- <%= link_to "#{t('attendance')} ▼", :controller => "student_attendance", :action => "index" %>
<% if @employee_batches.present? or @current_user.privileges.map{|p| p.name}.include?("StudentAttendanceRegister") %>
- <%= link_to "#{t('attendance_register')}", :controller => 'attendances', :action => 'index' %>
<% end %>
- <%= link_to "#{t('attendance_report')}", :controller => "attendance_reports", :action => "index" %>
<% end %>
<% else %>
<% if permitted_to? :index, :student_attendance or @employee_batches.present? or @employee_subjects.present? or @current_user.privileges.map{|p| p.name}.include?("StudentAttendanceView") or @current_user.privileges.map{|p| p.name}.include?("StudentAttendanceRegister") %>
- <%= link_to "#{t('attendance')} ▼", :controller => "student_attendance", :action => "index" %>
<% if @employee_batches.present? or @employee_subjects.present? or @current_user.privileges.map{|p| p.name}.include?("StudentAttendanceRegister") %>
- <%= link_to "#{t('attendance_register')}", :controller => 'attendances', :action => 'index' %>
<% end %>
- <%= link_to "#{t('attendance_report')}", :controller => "attendance_reports", :action => "index" %>
<% end %>
<% end %>
<% end %>
<% if permitted_to? :index, :configuration %>
- <%= link_to "#{t('settings')} ▼", :controller => "configuration", :action => "index" %>
<% if permitted_to? :create, :courses %>
- <%= link_to "#{t('manage_course_batch')}", courses_path %>
<% end %>
<% if permitted_to? :settings, :configuration %>
- <%= link_to "#{t('manage_student_category')}", :controller => "student", :action => "categories" %>
<% end %>
<% if permitted_to? :index, :subjects %>
- <%= link_to "#{t('manage_subject')}", subjects_path %>
<% end %>
<% if permitted_to? :settings, :configuration %>
- <%= link_to "#{t('general_settings')}", :controller => "configuration", :action => "settings" %>
<% end %>
<% if permitted_to? :settings, :configuration %>
- <%= link_to "#{t('add_admission_additional_detail')}", :controller=>"student", :action => "add_additional_details" %>
<% end %>
<% if permitted_to? :index, :sms %>
- <%= link_to "#{t('sms_module')}", :controller=>"sms", :action => "index" %>
<% end %>
<% end %>
<% if permitted_to? :index, :timetable %>
- <%= link_to "#{t('timetable_text')} ▼", :controller => "timetable", :action => "index" %>
<% if permitted_to? :new_timetable,:timetable%>
- <%= link_to "#{t('create_timetable')}", :controller => "timetable", :action => "new_timetable" %>
<% end%>
<%if permitted_to? :edit_master,:timetable%>
- <%= link_to "#{t('edit_timetable')}", :controller => "timetable", :action => "edit_master" %>
<% end%>
<% if permitted_to? :index,:class_timings%>
- <%= link_to "#{t('set_class_timings')}", :controller => "class_timings", :action => "index" %>
<% end%>
<% if permitted_to? :index,:weekdays%>
- <%= link_to "#{t('set_weekdays')}", :controller => "weekday", :action => "index" %>
<% end%>
<% if permitted_to? :view,:timetable%>
- <%= link_to "#{t('view_timetable')}", :controller => "timetable", :action => "view" %>
<% end%>
<% if permitted_to? :view,:timetable%>
- <%= link_to "#{t('teacher_timetable')}", :controller => "timetable", :action => "teachers_timetable" %>
<% end%>
- <%= link_to "#{t('institutional')} #{t('timetable_text')}", :controller => "timetable", :action => "timetable" %>
<% if permitted_to? :edit,:timetable%>
- <%= link_to "#{t('create_text')} #{t('weekdays_text')}", :controller => "weekday", :action => "index" %>
<% end %>
<%if permitted_to? :work_allotment,:timetable%>
- <%= link_to "#{t('work_allotment')}", :controller => "timetable", :action => "work_allotment" %>
<% end %>
<% end %>
<% if @current_user.admin? %>
<% FedenaPlugin::AVAILABLE_MODULES.each do |mod| %>
<% unless mod[:top_bar].blank? %>
<% if permitted_to? "#{mod[:top_bar][:action]}".to_sym,"#{mod[:top_bar][:controller]}".to_sym %>
<%= link_to "#{t(mod[:top_bar][:title])}", {:controller => "#{mod[:top_bar][:controller]}", :action => "#{mod[:top_bar][:action]}"} %>
<% end %>
<% end %>
<% end %>
<% end %>
- <%= t('more') %> ▼
- <%= link_to "#{t('calendar_text')}" , :controller => "calendar", :action=>"index" %>
<% if permitted_to? :index, :exam %>
- <%= link_to "#{t('examination')} #{arrow_dir}" , :controller => "exam", :action=>"index" %>
<% @employee_subjects=[] %>
<% @employee_subjects= @current_user.employee_record.subjects.map { |n| n.id} if @current_user.employee? %>
<% if (@current_user.admin? or @current_user.privileges.collect(&:name).include?('ExaminationControl')) %>
<% if permitted_to? :settings,:exam %>
- <%= link_to "Settings" ,:controller=>'exam',:action=>'settings' %>
<% end %>
<% if permitted_to? :create_exam, :exam %>
- <%= link_to "#{t('exam_management')}" , :controller => "exam",:action=>'create_exam' %>
<% end %>
<% if permitted_to? :generate_reports,:exam %>
- <%= link_to "Generate Reports" ,:controller=>'exam',:action=>'generate_reports' %>
<% end %>
- <%= link_to "Report Center" , :controller => "exam",:action=>'report_center' %>
<% elsif (@current_user.privileges.collect(&:name).include?('EnterResults') or !@employee_subjects.empty?) %>
<% if permitted_to? :create_exam, :exam %>
- <%= link_to "#{t('exam_management')}" , :controller => "exam",:action=>'create_exam' %>
<% end %>
- <%= link_to "Report Center" , :controller => "exam",:action=>'report_center' %>
<% elsif (@current_user.privileges.collect(&:name).include?('ViewResults') or (Batch.all.collect(&:employee_id).include?(@current_user.employee_record.id.to_s) if @current_user.employee?)) %>
- <%= link_to "Report Center" , :controller => "exam",:action=>'report_center' %>
<% end %>
<% if Configuration.cce_enabled? %>
<% if permitted_to? :index, :cce_reports %>
- <%= link_to "CCE Report" , :controller => "cce_reports" %>
<% end %>
<% end %>
<% end %>
- <%= link_to "#{t('news_text')}" , :controller => "news", :action=>"index" %>
<% if permitted_to? :index, :event %>
- <%= link_to "#{t('event_creations')}" , :controller => "event", :action=>"index" %>
<% end %>
<% if permitted_to? :hr, :employee %>
- <%= link_to "#{t('human_resource')} #{arrow_dir}" , :controller => "employee", :action=>"hr" %>
<% if permitted_to? :settings, :employee %>
- <%= link_to "#{t('setting')}", :controller=>"employee", :action=>"settings"%>
<%end%>
<% if permitted_to? :employee_management, :employee %>
- <%= link_to "#{t('employee_management_text')}", :controller=>"employee", :action=>"employee_management"%>
<%end%>
<% if permitted_to? :employee_attendance, :employee %>
- <%= link_to "#{t('employee_leave_management')}", :controller=>"employee", :action=>"employee_attendance" %>
<%end%>
<% if permitted_to? :payslip, :employee %>
- <%= link_to "#{t('create_payslip')}", :controller=>"employee", :action=>"payslip" %>
<%end%>
<% if permitted_to? :search, :employee %>
- <%= link_to "#{t('employee_search')}", :controller=>"employee", :action=>"search" %>
<%end%>
<% if permitted_to? :department_payslip, :employee %>
- <%= link_to "#{t('employee_payslip')}", :controller=>"employee", :action=>"department_payslip" %>
<% end %>
<% unless @modules.include?("Finance") %>
<% if permitted_to? :payslip_approve, :employee %>
- <%= link_to "#{t('one_click_aprove_payslip')}", :controller=>"employee", :action=>"payslip_approve" %>
<%end%>
<%end%>
<% end %>
<% if permitted_to? :index, :finance %>
- <%= link_to "#{t('finance_text')} #{arrow_dir}" , :controller => "finance", :action=>"index" %>
<% end %>
<% if @current_user.admin? %>
- <%= link_to "#{t('user_text')}" , :controller => "user", :action=>"index" %>
<% end %>