Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions app/views/weekly_time_sheet/_enter.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,16 @@
<label for="entry_project"><%=l 'field_project' %></label>
<select id="entry_project" name="entry[project_id]" onchange="MyWeeklyTimeEntry.projectChanged()">
<option value="">--- <%=l 'actionview_instancetag_blank_option' %> ---</option>
<% Project.find(:all, :conditions => Project.visible_by, :order => 'lft').each do |prj| %>
<option value="<%= prj.id %>" <%= 'selected="selected"' if prj.id == @entry.project_id %>><%= prj.to_s %></option>
<% end %>
<%
projects = User.current.projects.all
if projects.any?
s = ''
s << project_tree_options_for_select(projects, :selected => @project) do |p|
{ :value => p.id }
end
end
%>
<%= s %>
</select>
</p>
<p>
Expand Down Expand Up @@ -37,4 +44,4 @@
<%= submit_tag l(:button_save) %>
</p>
</div>
</form>
</form>
8 changes: 7 additions & 1 deletion app/views/weekly_time_sheet/_entries.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,13 @@ current_project_id = nil
<%=h entry.hours %>
</td>
<td>
<a href="#" onclick="return MyWeeklyTimeEntry.deleteTime(<%= entry.id %>)"><%=l 'button_delete' %></a>
<%= link_to image_tag('edit.png'), {:controller => 'timelog', :action => 'edit', :id => entry, :project_id => nil},
:title => l(:button_edit) %>
<%= link_to image_tag('delete.png'), {:controller => 'timelog', :action => 'destroy', :id => entry, :project_id => nil},
:confirm => l(:text_are_you_sure),
:method => :post,
:title => l(:button_delete) %>

</td>
</tr>

Expand Down
2 changes: 2 additions & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
en:
redmine_weekly_time_sheet_title: "Log Time"
7 changes: 7 additions & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
ActionController::Routing::Routes.draw do |map|
map.resources :weekly_time_sheet
map.connect 'weekly_time_sheet', :controller => 'weekly_time_sheet', :action => 'index'
map.connect 'delete_item', :controller => 'weekly_time_sheet', :action => 'delete_item'
map.connect 'project_tasks/:id', :controller => 'weekly_time_sheet', :action => 'project_tasks'
map.connect 'submit_time', :controller => 'weekly_time_sheet', :action => 'submit_time'
end
2 changes: 1 addition & 1 deletion init.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

menu(:top_menu,
:weekly_time_sheet,
{:controller => 'weekly_time_sheet ', :action => 'index'},
{:controller => 'weekly_time_sheet', :action => 'index'},
:caption => :redmine_weekly_time_sheet_title,
:if => Proc.new {
User.current.allowed_to?(:log_time, nil, :global => true) ||
Expand Down