diff --git a/app/views/wkexpense/_report_list.html.erb b/app/views/wkexpense/_report_list.html.erb index 48e548862..e7d6956da 100644 --- a/app/views/wkexpense/_report_list.html.erb +++ b/app/views/wkexpense/_report_list.html.erb @@ -1,4 +1,4 @@ -<%= form_tag({}) do -%> +<%= form_tag({}, :data => {:cm_url => time_entries_context_menu_path}) do -%> <%= hidden_field_tag 'back_url', url_for(params) %>
@@ -35,4 +35,4 @@ <% end -%> -<%= context_menu time_entries_context_menu_path %> +<%= context_menu %> diff --git a/app/views/wkexpense/edit.html.erb b/app/views/wkexpense/edit.html.erb index d112e8b15..58a870174 100644 --- a/app/views/wkexpense/edit.html.erb +++ b/app/views/wkexpense/edit.html.erb @@ -56,18 +56,14 @@ <% end %> - -<% # Martin Dube Contribution: show previous and next time entry %> - - -
- <%= link_to("\xc2\xab " + l(:label_previous ), {:controller => controller.controller_name, :action => 'edit', :startday => @startday-7, :user_id => @user.id, :project_id => params[:project_id]}, - :title => l(:label_wk_prev_week_tip)) %> - | - <%= link_to(l(:label_next) + " \xc2\xbb", {:controller => controller.controller_name, :action => 'edit', :startday => @startday+7, :user_id => @user.id, :project_id => params[:project_id]}, - :title => l(:label_wk_next_week_tip)) %> -
+ + + <%= render :partial => 'wktime/edit_options' %> + + + +
<%= render :partial => 'wktime/edit_issues', :locals => { :entries => @prev_template ? @prev_entries : @entries }%> diff --git a/app/views/wktime/_edit_header.html.erb b/app/views/wktime/_edit_header.html.erb index 767962da0..86d92340b 100644 --- a/app/views/wktime/_edit_header.html.erb +++ b/app/views/wktime/_edit_header.html.erb @@ -5,90 +5,52 @@ <%=h hidden_field_tag('getactivities_url', "#{url_for(:controller => controller.controller_name, :action => 'getactivities')}") %> <%=h hidden_field_tag('deleterow_url', "#{url_for(:controller => controller.controller_name, :action => 'deleterow')}") %> - - +
+
+ + +
+ - + - - <% if @editable %> - <% if !Setting.plugin_redmine_wktime['wktime_enter_issue_as'].blank? && Setting.plugin_redmine_wktime['wktime_enter_issue_as'].to_i == 1 %> - - - <% end %> - <% end %> - + - - <% if @editable %> - <% if !Setting.plugin_redmine_wktime['wktime_allow_filter_issue'].blank? && Setting.plugin_redmine_wktime['wktime_allow_filter_issue'].to_i == 1 %> - - - <% end %> - <% end %> + +<% # Martin Dube Contribution: show previous and next time entry %> + + + - + <% # the default status on new wktime object is 'new' %> - - <% status = @wktime.status unless @wktime.blank? %> - <% if controller.filterTrackerVisible && 'a' != status && 's' != status && (params[:enter_issue_id].blank? || (!params[:enter_issue_id].blank? && !params[:enter_issue_id].to_i == 1)) %> - <% - #tracker = Tracker.find(:all, :order =>'name') - tracker = Tracker.order('name') - unless tracker.blank? - trackers = tracker.collect {|t| [t.name, t.id] } - trackers.unshift(["",0]) - end - %> - - <% - issuetracker=nil - if(!params[:tracker_ids].blank?) - issuetrackerids=params[:tracker_ids] - issuetracker= issuetrackerids.split(",") - else - issuetracker = Setting.plugin_redmine_wktime[controller.getTFSettingName()] - end - %> - - - + - - - + - - \ No newline at end of file diff --git a/app/views/wktime/_edit_issues.html.erb b/app/views/wktime/_edit_issues.html.erb index 23c592526..b0f3deef0 100644 --- a/app/views/wktime/_edit_issues.html.erb +++ b/app/views/wktime/_edit_issues.html.erb @@ -140,4 +140,4 @@ currencySym = "" <% end %> -<%= context_menu time_entries_context_menu_path %> + diff --git a/app/views/wktime/_edit_options.html.erb b/app/views/wktime/_edit_options.html.erb new file mode 100644 index 000000000..9661b049c --- /dev/null +++ b/app/views/wktime/_edit_options.html.erb @@ -0,0 +1,52 @@ +
<%=l(:field_user)%><%=l(:field_user)%> <%=h @user.name %> <%=h hidden_field_tag('user_id', @user.id) %> <%= "#{l(:label_wk_enter_issue_id)}/#{l(:field_subject)}" %> - <%= check_box_tag('enter_issue_id', 1, (!params[:enter_issue_id].blank? && params[:enter_issue_id].to_i == 1), - :onclick => "enterIssueIdorAssignUser();") %> -
<%=l(:field_start_date)%><%=l(:field_start_date)%> <%=h format_date(@startday) %> <%=h hidden_field_tag('startday',@startday) %> <%= l(:label_issues_visibility_own) %> - <%= check_box_tag('issue_assign_user', 1, (!params[:issue_assign_user].blank? && params[:issue_assign_user].to_i == 1),:onclick => "enterIssueIdorAssignUser();") %> -
+ <%= link_to("\xc2\xab " + l(:label_previous ), {:controller => controller.controller_name, :action => 'edit', :startday => @startday-7, :user_id => @user.id, :project_id => params[:project_id]}, + :title => l(:label_wk_prev_week_tip)) %> + | + <%= link_to(l(:label_next) + " \xc2\xbb", {:controller => controller.controller_name, :action => 'edit', :startday => @startday+7, :user_id => @user.id, :project_id => params[:project_id]}, + :title => l(:label_wk_next_week_tip)) %> +
<%=l(:field_status)%><%=l(:field_status)%> <%=h statusString(@wktime.status) unless @wktime.blank? %> - <%= l(:label_wk_filter_issue_tracker) %> - - <%= select_tag('select_issues_tracker', options_for_select(trackers, :selected => issuetracker), :multiple=> true, - :onchange => "trackerFilterChanged(this);")%> - <% end %> -
<%=l(:label_submitted_by)%> + <%=l(:label_submitted_by)%> + <% status = @wktime.status unless @wktime.blank? %> <% if (status != 'n' && status != 'r' ) %> <%=h @wktime.blank? ? "" : (@wktime.submitter.name unless @wktime.submitter.blank?) %> <% end %>
<%=l(:label_approved_by)%><%=l(:label_approved_by)%> <% if (status == 'a') %> <%=h @wktime.blank? ? "" : (@wktime.updater.name unless @wktime.updater.blank?) %> <% end %>
+ <% if @editable %> + <% if !Setting.plugin_redmine_wktime['wktime_enter_issue_as'].blank? && Setting.plugin_redmine_wktime['wktime_enter_issue_as'].to_i == 1 %> + + + + + <% end %> + <% end %> + <% if @editable %> + <% if !Setting.plugin_redmine_wktime['wktime_allow_filter_issue'].blank? && Setting.plugin_redmine_wktime['wktime_allow_filter_issue'].to_i == 1 %> + + + + + <% end %> + <% end %> + <% status = @wktime.status unless @wktime.blank? %> + <% if controller.filterTrackerVisible && 'a' != status && 's' != status && (params[:enter_issue_id].blank? || (!params[:enter_issue_id].blank? && !params[:enter_issue_id].to_i == 1)) %> + <% + #tracker = Tracker.find(:all, :order =>'name') + tracker = Tracker.order('name') + unless tracker.blank? + trackers = tracker.collect {|t| [t.name, t.id] } + trackers.unshift(["",0]) + end + %> + + + <% + issuetracker=nil + if(!params[:tracker_ids].blank?) + issuetrackerids=params[:tracker_ids] + issuetracker= issuetrackerids.split(",") + else + issuetracker = Setting.plugin_redmine_wktime[controller.getTFSettingName()] + end + %> + + + <% end %> +
<%= "#{l(:label_wk_enter_issue_id)}/#{l(:field_subject)}" %> + <%= check_box_tag('enter_issue_id', 1, (!params[:enter_issue_id].blank? && params[:enter_issue_id].to_i == 1), + :onclick => "enterIssueIdorAssignUser();") %> +
<%= l(:label_issues_visibility_own) %> + <%= check_box_tag('issue_assign_user', 1, (!params[:issue_assign_user].blank? && params[:issue_assign_user].to_i == 1),:onclick => "enterIssueIdorAssignUser();") %> +
+ <%= l(:label_wk_filter_issue_tracker) %> + + <%= select_tag('select_issues_tracker', options_for_select(trackers, :selected => issuetracker), :multiple=> true, + :onchange => "trackerFilterChanged(this);")%> +
\ No newline at end of file diff --git a/app/views/wktime/_list.html.erb b/app/views/wktime/_list.html.erb index 225be2fe6..38c8ad872 100644 --- a/app/views/wktime/_list.html.erb +++ b/app/views/wktime/_list.html.erb @@ -1,5 +1,5 @@ <%= stylesheet_link_tag 'wk-time', :plugin => "redmine_wktime" %> -<%= form_tag({}) do -%> +<%= form_tag({}) do -%> <%= hidden_field_tag 'back_url', url_for(params) %>
@@ -43,4 +43,3 @@ <% end -%> -<%= context_menu time_entries_context_menu_path %> diff --git a/app/views/wktime/edit.html.erb b/app/views/wktime/edit.html.erb index 5fccb1d70..b4edc8d82 100644 --- a/app/views/wktime/edit.html.erb +++ b/app/views/wktime/edit.html.erb @@ -110,7 +110,7 @@ <% if !@wktime.blank? && @wktime.status == 'r' && !@wktime.notes.blank? %> - + @@ -144,17 +144,14 @@ <% end %> <% end %> - <% # Martin Dube Contribution: show previous and next time entry %> - - -
<%=l(:label_wk_reject_reason)%><%=l(:label_wk_reject_reason)%> <%=h @wktime.notes %>
- <%= link_to("\xc2\xab " + l(:label_previous ), {:controller => controller.controller_name, :action => 'edit', :startday => @startday-7, :user_id => @user.id, :project_id => params[:project_id]}, - :title => l(:label_wk_prev_week_tip)) %> - | - <%= link_to(l(:label_next) + " \xc2\xbb", {:controller => controller.controller_name, :action => 'edit', :startday => @startday+7, :user_id => @user.id, :project_id => params[:project_id]}, - :title => l(:label_wk_next_week_tip)) %> -
+
+ <%= render :partial => 'edit_options' %> +
+ <%= render :partial => 'edit_issues', :locals => { :entries => @prev_template ? @prev_entries : @entries }%> diff --git a/assets/stylesheets/wk-time.css b/assets/stylesheets/wk-time.css index da731f5e2..bc181fe35 100644 --- a/assets/stylesheets/wk-time.css +++ b/assets/stylesheets/wk-time.css @@ -11,4 +11,26 @@ .ui-accordion-header{ background: #3E5B76; color: #ffffff; -} \ No newline at end of file +} + +table#wktimeHeader, table#wktimeHeader td { + border-collapse: collapse; + padding: 0px; + padding-right: 10px; +} + +table#wktimeStatus td, table#wktimeStatus th{ + vertical-align: middle; + padding-left: 4px; + padding-right: 4px; +} + +table#wktimeOptions td, table#wktimeOptions th{ + vertical-align: middle; + padding-left: 4px; + padding-right: 4px; +} + +table.nowrap { + white-space: nowrap; +} diff --git a/init.rb b/init.rb index 90f766390..584de3f0e 100644 --- a/init.rb +++ b/init.rb @@ -319,7 +319,6 @@ def plugin 'wktime_enable_accounting_module' => '0', 'wktime_accounting_group' => '0', 'wktime_accounting_admin' => '0', - 'wktime_accounting_admin' => '0', 'wktime_crm_group' => '0', 'wktime_crm_admin' => '0', 'wktime_minimum_working_days_for_accrual' => '11', @@ -557,7 +556,7 @@ def view_projects_show_sidebar_bottom(context={}) wktime_helper = Object.new.extend(WktimeHelper) host_with_subdir = wktime_helper.getHostAndDir(context[:request]) project_ids = Setting.plugin_redmine_wktime['wkexpense_projects'] - if project_ids.blank? || (!project_ids.blank? && (project_ids == [""] || project_ids.include?("#{context[:project].id}"))) && User.current.allowed_to?(:view_time_entries, context[:project]) + if wktime_helper.showExpense && (project_ids.blank? || (!project_ids.blank? && (project_ids == [""] || project_ids.include?("#{context[:project].id}"))) && User.current.allowed_to?(:view_time_entries, context[:project])) "#{link_to(l(:label_wkexpense_reports), url_for(:controller => 'wkexpense', :action => 'reportdetail', :project_id => context[:project], :host => host_with_subdir, :only_path => true))}" end end