Skip to content

Commit

Permalink
Merge pull request #320 from dhanasingh/dev
Browse files Browse the repository at this point in the history
v4.8.1
  • Loading branch information
Arun-TAK authored Dec 10, 2024
2 parents 8e7ef3c + 64dfbfc commit 41730d5
Show file tree
Hide file tree
Showing 21 changed files with 146 additions and 48 deletions.
4 changes: 2 additions & 2 deletions README.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ For more information on features, please refer to the user guide

rake redmine:plugins:migrate NAME=redmine_wktime VERSION=0 RAILS_ENV=production

=== Release Notes for v4.8
=== Release Notes for v4.8.1

- Redmine 6.0 compatibility.
- Sidebar-white theme related changes

=== Customization

Expand Down
3 changes: 1 addition & 2 deletions app/controllers/wkgltransaction_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,11 @@ def index
end

dup_summary = sort_direction == "desc" ? @summaryHash.to_a.reverse.to_h : @summaryHash
@summaryHashFirstKey = dup_summary.keys.first
dup_summary.each do |key, value|
getSummeryamount(key, value)
@summaryHash[key][:CB] = @closeBal
end
@summaryHashFirstKey = dup_summary.keys.first

else
formPagination(transaction.reorder(sort_clause))
isSubCr = isSubtractCr(@selectedLedger.ledger_type)
Expand Down
2 changes: 1 addition & 1 deletion app/lib/send_patch/timelog_controller_patch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -497,8 +497,8 @@ def find_time_entries
@time_entries = WkMaterialEntry.where(:id => params[:id] || params[:ids])
raise ActiveRecord::RecordNotFound if @time_entries.empty?
# ===================================
@projects = @time_entries.filter_map(&:project).uniq
end
@projects = @time_entries.filter_map(&:project).uniq
@project = @projects.first if @projects.size == 1
rescue ActiveRecord::RecordNotFound
render_404
Expand Down
2 changes: 1 addition & 1 deletion app/lib/wkdashboard/graph001_clock_in_users_over_time.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def getDetailReport(param={})
entries = entries.group(:user_id, :start_time, :end_time).select("wk_attendances.user_id, start_time, end_time")
entries = entries.where("group_id IN (?)", param[:group_id]) if param[:group_id].present?
header = {user: l(:field_user), date: l(:field_start_date), clockin: l(:label_clock_in), clockout: l(:label_clock_out)}
data = entries.map{|e| { user_id: e.user.name, date: e&.start_time&.localtime&.to_date, clockin: e&.start_time&.localtime&.to_s(:time), clockout: e&.end_time&.localtime&.to_s(:time) }}
data = entries.map{|e| { user_id: e.user.name, date: e&.start_time&.localtime&.to_date, clockin: e&.start_time&.localtime&.strftime('%R') || '', clockout: e&.end_time&.localtime&.strftime('%R') || '' }}
return {header: header, data: data}
end

Expand Down
6 changes: 3 additions & 3 deletions app/views/settings/_tab_attendance.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ lblYear = "<%=l(:label_year) %>";
%>
<label><%= l(:label_wk_break_time) %></label>
<%= select_tag('settings[wktime_break_time]',
options_for_select(breakTime, :selected => 'settings[wktime_break_time]'), :multiple=> true, :style => "width:200px; height:100px;")%>
options_for_select(breakTime, :selected => 'settings[wktime_break_time]'), :multiple=> true, :style => "width:200px; height:100px;", class: 'multi-row')%>

</p>
<p>
Expand Down Expand Up @@ -251,15 +251,15 @@ lblYear = "<%=l(:label_year) %>";
<tbody>
<tr valign="top">
<td>
<%= select_tag('settings[wktime_avialable_fields]', options_for_select(available_fields.invert), :multiple => true, :size=> 10, :style => "width:150px; ") %>
<%= select_tag('settings[wktime_avialable_fields]', options_for_select(available_fields.invert), :multiple => true, :size=> 10, :style => "width:150px;", class: 'multi-row') %>
</td>
<td valign="center">
<button type="button" onclick="listbox_moveacross('settings_wktime_avialable_fields', 'settings_wktime_fields_in_file')" id="rightmove" style="position:relative; top:40px;">&gt;&gt;</button>
<br>
<button type="button" onclick="listbox_moveacross('settings_wktime_fields_in_file', 'settings_wktime_avialable_fields')" id="rightmove" style="position:relative; top:50px;">&lt;&lt;</button>
</td>
<td>
<%= select_tag('settings[wktime_fields_in_file]', options_for_select(fldInFiles.invert, :selected => @settings['wktime_fields_in_file'] ), :multiple => true, :size => 10, :style => "width:150px;") %>
<%= select_tag('settings[wktime_fields_in_file]', options_for_select(fldInFiles.invert, :selected => @settings['wktime_fields_in_file'] ), :multiple => true, :size => 10, :style => "width:150px;", class: 'multi-row') %>
</td>
</tr>
</tbody>
Expand Down
2 changes: 1 addition & 1 deletion app/views/settings/_tab_crm.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
%>
<label><%= l(:label_sales_quote_components) %></label>
<%= select_tag('settings[wktime_sq_components]',
options_for_select(invComps, :selected => 'settings[wktime_sq_components]'), :multiple=> true, :style => "min-width:140px; height:100px;")%>
options_for_select(invComps, :selected => 'settings[wktime_sq_components]'), :multiple=> true, :style => "min-width:140px; height:100px;", class: 'multi-row')%>

</p>
<p>
Expand Down
6 changes: 3 additions & 3 deletions app/views/settings/_tab_purchase.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
%>
<label><%= l(:label_quote_components) %></label>
<%= select_tag('settings[wktime_quote_components]',
options_for_select(invComps, :selected => 'settings[wktime_quote_components]'), :multiple=> true, :style => "min-width:140px; height:100px;")%>
options_for_select(invComps, :selected => 'settings[wktime_quote_components]'), :multiple=> true, :style => "min-width:140px; height:100px;", class: 'multi-row')%>

</p>
<p>
Expand Down Expand Up @@ -92,7 +92,7 @@
%>
<label><%= l(:label_po_components) %></label>
<%= select_tag('settings[wktime_po_components]',
options_for_select(invComps, :selected => 'settings[wktime_po_components]'), :multiple=> true, :style => "min-width:140px; height:100px;")%>
options_for_select(invComps, :selected => 'settings[wktime_po_components]'), :multiple=> true, :style => "min-width:140px; height:100px;", class: 'multi-row')%>

</p>
<p>
Expand Down Expand Up @@ -122,7 +122,7 @@
%>
<label><%= l(:label_si_components) %></label>
<%= select_tag('settings[wktime_si_components]',
options_for_select(invComps, :selected => 'settings[wktime_si_components]'), :multiple=> true, :style => "min-width:140px; height:100px;")%>
options_for_select(invComps, :selected => 'settings[wktime_si_components]'), :multiple=> true, :style => "min-width:140px; height:100px;", class: 'multi-row')%>

</p>
<p>
Expand Down
2 changes: 1 addition & 1 deletion app/views/wkattendance/leavesettings.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
<p>
<label><%= l(:label_wk_leave) %></label>
<%= select_tag('settings[leave_settings]',
options_for_select(leave, :selected => 'settings[leave_settings]'), :multiple=> true, :style => "min-width:200px; height:100px;")%>
options_for_select(leave, :selected => 'settings[leave_settings]'), :multiple=> true, :style => "min-width:200px; height:100px;", class: 'multi-row')%>

</p>
<p>
Expand Down
9 changes: 5 additions & 4 deletions app/views/wkbase/_base_header.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,18 @@
<%= hidden_field_tag 'getspenttype_url', url_for(:controller => 'wklogmaterial', :action => 'loadSpentType') %>

<!-- For SideBar theme -->
<% if Setting.ui_theme.to_s.downcase == "sidebar" %>
<% if Setting.ui_theme.to_s.downcase == "sidebar" || (["sidebar_white", "sidebar-white"].include?(Setting.ui_theme.to_s.downcase)) %>
<%= stylesheet_link_tag 'sidebar', :plugin => "redmine_wktime" %>
<%= javascript_tag do %>
$(function() {
$("#top-menu .wkdashboard").attr("title", "ERPmine");
$("#top-menu .wkdashboard").prop("title", "ERPmine");
var topMenus = [];
$("#top-menu ul li a").each(function() {
var classNames = ($(this).attr('class')).split(" ");
var classNames = $(this).prop('class');
classNames = (classNames || "").split(" ");
var menuItem = classNames[0];
if(menuItem == "wkdashboard" && $("#main-menu ul").children("li").length > 0) {
var firstMenu =$("#main-menu ul").children("li").find("a").first().attr("href");
var firstMenu =$("#main-menu ul").children("li").find("a").first().prop("href");
if(firstMenu.match("^/wk") || firstMenu.match("^/rm")) {
$("."+menuItem).parent('li').addClass("active");
}
Expand Down
8 changes: 1 addition & 7 deletions app/views/wkdocument/_links.html.erb
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
<div class="attachments">
<div class="contextual">
<%= link_to(l(:label_edit_attachments),
container_attachments_edit_path(container),
:title => l(:label_edit_attachments),
:class => 'icon-only icon-edit'
) if options[:editable] %>
</div>

<table>
<% for attachment in attachments %>
<tr>
Expand Down
2 changes: 1 addition & 1 deletion app/views/wkexpense/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
<%=h hidden_field_tag('tab', "#{controller_name}") %>
<h2><%= l(:label_wkexpense) %></h2>

<div style="overflow: auto">
<div>
<table id="wktimeHeader">
<tr valign="top"><td>
<table id="wktimeStatus" class="list nowrap">
Expand Down
2 changes: 1 addition & 1 deletion app/views/wkorderentity/invoice_components.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<tr>
<th><label><%= l(:label_invoice_components) %></label></th>
<td><%= select_tag('invoice_components',
options_for_select(@invComps, selected: 'invoice_components'), multiple: true, style: "min-width:160px; height:100px;")%></td>
options_for_select(@invComps, selected: 'invoice_components'), multiple: true, style: "min-width:160px; height:100px;", class: 'multi-row')%></td>

</tr>
<tr>
Expand Down
10 changes: 9 additions & 1 deletion app/views/wkpaymententity/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,10 @@
<th align="left"><%= l(:label_payment_date) %></th>
<td align="left" style="padding-left:40px;"><%=h date_field_tag('payment_date',@payment.blank? ? Date.today : @payment.payment_date, :size => 10, :required => true) %> <%= calendar_for('payment_date') %></td>
<th align="left"><%= l(:label_payment_type) %></th>
<td align="left" style="padding-left:40px;"><%=h select_tag('payment_type_id', options_for_select(options_for_enum_select('PT', selectedPTId, false)),:required => true) %></td>
<td align="left" style="padding-left:40px;">
<%=h select_tag('payment_type_id', options_for_select(options_for_enum_select('PT', selectedPTId, false)),:required => true, onchange: "$('#hidden_pay_type_id').val(this.value)") %>
<%= hidden_field_tag "payment_type_id", selectedPTId, id: "hidden_pay_type_id" %>
</td>
<th align="left"><%= l(:label_reference_number) %></th>
<td align="left" style="padding-left:40px;"><%=h text_field_tag("reference_number",@payment.blank? ? '' : @payment.reference_number, :maxlength => 255) %> </td>
</tr>
Expand All @@ -94,3 +97,8 @@
<label><b><%= l(:label_no_data) %></b></label>
<% end %>
<% end %>
<script>
$(document).ready(function(){
$('#hidden_pay_type_id').val($('#payment_type_id').val());
})
</script>
12 changes: 6 additions & 6 deletions app/views/wkpayroll/payrollsettings.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<table><tr>
<td><label><%= l(:label_basic) %></label></td>
<td><%= select_tag('settings[basic]',
options_for_select(@payrollsettings['basic']), :multiple=> true, :style => "width:390px; height:18px;")%></td>
options_for_select(@payrollsettings['basic']), :multiple=> true, :style => "width:390px; height:18px;", class: 'multi-row')%></td>

</tr>
<tr>
Expand All @@ -43,7 +43,7 @@
<tr>
<td><label><%= l(:label_allowances) %></label></td>
<td><%= select_tag('settings[allowances]',
options_for_select(@payrollsettings["allowances"]), :multiple=> true, :style => "width:390px; height:80px;")%></td>
options_for_select(@payrollsettings["allowances"]), :multiple=> true, :style => "width:390px; height:80px;", class: 'multi-row')%></td>

</tr>
<tr>
Expand All @@ -54,7 +54,7 @@
<tr>
<td><label><%= l(:label_deduction) %></label></td>
<td><%= select_tag('settings[deduction]',
options_for_select(@payrollsettings["deduction"]), :multiple=> true, :style => "width:390px; height:80px;")%></td>
options_for_select(@payrollsettings["deduction"]), :multiple=> true, :style => "width:390px; height:80px;", class: 'multi-row')%></td>
</tr>
<tr>
<td></td><td><%= link_to l(:button_add), "javascript:payrollDialogAction('settings_deduction', 'Add');", :class => "button"%> |
Expand All @@ -64,7 +64,7 @@
<tr>
<td><label><%= l(:label_calculated_fields) %></label></td>
<td><%= select_tag('settings[calculated_fields]',
options_for_select(@payrollsettings["calculated_fields"]), :multiple=> true, :style => "width:390px; height:80px;")%></td>
options_for_select(@payrollsettings["calculated_fields"]), :multiple=> true, :style => "width:390px; height:80px;", class: 'multi-row')%></td>
</tr>
<tr>
<td></td>
Expand All @@ -76,7 +76,7 @@
</tr>
<tr>
<td><label><%= l(:label_reimbursements) %></label></td>
<td><%= select_tag('settings[reimburse]', options_for_select(@payrollsettings["reimburse"]), :multiple=> true, :style => "width:390px; height:20px;")%></td>
<td><%= select_tag('settings[reimburse]', options_for_select(@payrollsettings["reimburse"]), :multiple=> true, :style => "width:390px; height:20px;", class: 'multi-row')%></td>
</tr>
<tr>
<td></td>
Expand Down Expand Up @@ -159,7 +159,7 @@
</tr>
<tr>
<td valign="justify" style="font-weight:normal">
<label style="padding-left: 90px;font-weight: normal;"><%= l(:label_dependent) %></label>
<label style="font-weight: normal;"><%= l(:label_dependent) %></label>
<%= hidden_field_tag("compDepID_INDEX","") %>
</td>
<td><%= select_tag('depID_INDEX', options_for_select(getSalaryCompNames.invert), class: "component depElements", style: "width: 125px") %></td>
Expand Down
2 changes: 1 addition & 1 deletion app/views/wktime/_edit_issues.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<% end %>
</div>

<div style="overflow: auto">
<div>
<table id="issueTable" class="list time-entries">
<thead>
<tr>
Expand Down
6 changes: 3 additions & 3 deletions app/views/wktime/_edit_issues2.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<% if @editable %>
<%=h select_tag(isTemplate ? '__template__time_entry[][project_id]' : 'time_entry[][project_id]',
options_for_select(projects, :selected => project_id),
:onchange => "projectChanged(this,#{@row.to_s()});", :style=> "width:150px" ) %>
:onchange => "projectChanged(this,#{@row.to_s()});", :style=> "width:150px", id: "time_entry_project_id_#{@row}" ) %>
<% else %>
<% if project.blank? %>
<% if entry.nil? %>
Expand Down Expand Up @@ -87,8 +87,8 @@
<td class="issue" align="left" width="250px">
<% if @editable %>
<%=h select_tag(isTemplate ? '__template__time_entry[][issue_id]' : 'time_entry[][issue_id]',
options_for_select(issues, :selected => entry.nil? ? (Setting.plugin_redmine_wktime['wktime_holiday'].present? ? Setting.plugin_redmine_wktime['wktime_holiday'] : 0 ) : entry.issue_id, :required => true), class: 'issueDD',
:style=> "width:250px;" ) %>
options_for_select(issues, :selected => entry.nil? ? (Setting.plugin_redmine_wktime['wktime_holiday'].present? ? Setting.plugin_redmine_wktime['wktime_holiday'] : 0 ) : entry.issue_id,
:required => true), class: 'issueDD', id: "time_entry_issue_id_#{@row}", :style=> "width:250px;" ) %>
<% else %>
<%= entry.issue.tracker.to_s() + " #" + entry.issue.id.to_s() + ": " + entry.issue.subject if !entry.nil? && !entry.issue.nil? %>
<% end %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/wktime/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
<div style="clear: both;"></div>
<%=h hidden_field_tag('tab', "#{controller_name}") %>

<div style="overflow: auto">
<div>
<table id="wktimeHeader">
<tr valign="top"><td>
<table id="wktimeStatus" class="list nowrap">
Expand Down
7 changes: 4 additions & 3 deletions assets/javascripts/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -813,13 +813,14 @@ function renameProperty(cell, tag, prefix, str, newStr){
renameIDName(children[j], prefix+str, prefix+newStr);
}else if(tag == 'input'){
renameIDName(children[j], prefix+str, prefix+newStr);
if(children[j].id == 'time_entry__issue_id'){
if(children[j].id == 'time_entry[][issue_id]'){
renameOnChange(children[j], str, newStr);
}
}else if(tag == 'a'){
renameHref(children[j], prefix+str, prefix+newStr);
}else if(tag == 'select'){
renameOnChange(children[j], prefix+str, prefix+newStr);
renameIDName(children[j], prefix+str, prefix+newStr);
} else if(tag == 'span' && children[j].className == "allAttach"){
renameAttachment(children[j], newStr);
}
Expand Down Expand Up @@ -851,9 +852,9 @@ function renameOnChange(child, index, newIndex){
var onchng = child.onchange;
var func = null;
var enterIsueIdChk = document.getElementById("enter_issue_id");
if(child.id == 'time_entry__project_id'){
if(child.name == 'time_entry[][project_id]'){
func = function(){projectChanged(this, row);};
}else if(child.id == 'time_entry__issue_id'){
}else if(child.name == 'time_entry[][issue_id]'){
if(enterIsueIdChk && enterIsueIdChk.checked){
func = function(){issueAutocomplete(this, row);};
}
Expand Down
8 changes: 4 additions & 4 deletions assets/javascripts/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -381,19 +381,19 @@ function projChanged(projDropdown, userid, needBlankOption){
url: userUrl,
type: 'get',
data: {project_id: id, user_id: userid, format:fmt},
success: function(data){ updateUserDD(data, userDropdown, userid, needBlankOption, false,"All Users"); },
success: function(data){ updateUserDD(data, userDropdown, userid, needBlankOption, false,"All Users", "0"); },
beforeSend: function(){ $this.addClass('ajax-loading'); },
complete: function(){ $this.removeClass('ajax-loading'); }
});
}
function updateUserDD(itemStr, dropdown, userid, needBlankOption, skipFirst, blankText)
function updateUserDD(itemStr, dropdown, userid, needBlankOption, skipFirst, blankText, blankval="")
{
var items = itemStr.split('\n');
var i, index, val, text, start;
if(dropdown != null && dropdown.options != null){
dropdown.options.length = 0;
if(needBlankOption){
dropdown.options[0] = new Option(blankText, "", false, false)
dropdown.options[0] = new Option(blankText, blankval, false, false)
}
for(i=0; i < items.length-1; i++){
index = items[i].indexOf(',');
Expand Down Expand Up @@ -463,7 +463,7 @@ function grpChanged(grpDropdown, userid, needBlankOption){
url: grpUrl,
type: 'get',
data: {user_id: userid, format:fmt,group_id:id},
success: function(data){ updateUserDD(data, userDropdown, userid, needBlankOption, false,"All Users"); },
success: function(data){ updateUserDD(data, userDropdown, userid, needBlankOption, false,"All Users", "0"); },
beforeSend: function(){ $this.addClass('ajax-loading'); },
complete: function(){ $this.removeClass('ajax-loading'); }
});
Expand Down
Loading

0 comments on commit 41730d5

Please sign in to comment.